From a9b0279ee050b522e7963ae770a906c162607d32 Mon Sep 17 00:00:00 2001 From: federicoon Date: Wed, 12 Dec 2018 17:07:23 +0100 Subject: [PATCH 01/16] Added insight.chain option --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index c2230e8..9bf0315 100644 --- a/index.js +++ b/index.js @@ -23,7 +23,9 @@ const blockexplorers = { 'https://testnet.blockexplorer.com/api' //'https://blockstream.info/api', //'https://blockexplorer.com/api' - ] + ], + chain: 'bitcoinTestnet' + //chain: 'bitcoin' //redundant, as this would be the default } From 0192e51fce9b7f14839d76ac1cd8e76d7cd287b7 Mon Sep 17 00:00:00 2001 From: federicoon Date: Wed, 12 Dec 2018 16:21:54 +0000 Subject: [PATCH 02/16] Updated ots library --- opentimestamps.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentimestamps.js b/opentimestamps.js index a4b4541..d55c8c4 100644 --- a/opentimestamps.js +++ b/opentimestamps.js @@ -1,2 +1,2 @@ // javascript-opentimestamps v.0.4.4-dev -var _get=function e(t,r,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,r);if(void 0===n){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,i)}if("value"in n)return n.value;var o=n.get;return void 0!==o?o.call(i):void 0},_createClass=function(){function i(e,t){for(var r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,f=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,p=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,l=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",i.copy(m[e])}function g(e){var t=e.match(o);if(!t)return!1;var r,i=+t[1],n=+t[2],a=+t[3];return 1<=n&&n<=12&&1<=a&&a<=(2!=n||((r=i)%4!=0||r%100==0&&r%400!=0)?s[n]:29)}function v(e,t){var r=e.match(c);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return(i<=23&&n<=59&&a<=59||23==i&&59==n&&60==a)&&(!t||o)}(t.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d},m.full={date:g,time:v,"date-time":function(e){var t=e.split(b);return 2==t.length&&g(t[0])&&v(t[1],!0)},uri:function(e){return y.test(e)&&a.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&n.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d};var b=/t|\s/i;var y=/\/|:/;var _=/[^\\]\\Z/;function w(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":12}],7:[function(e,t,r){"use strict";var I=e("./resolve"),P=e("./util"),O=e("./error_classes"),T=e("fast-json-stable-stringify"),B=e("../dotjs/validate"),C=P.ucs2length,F=e("fast-deep-equal"),R=O.Validation;function z(e,t,r){var i=n.call(this,e,t,r);return 0<=i?{index:i,compiling:!0}:{index:i=this._compilations.length,compiling:!(this._compilations[i]={schema:e,root:t,baseId:r})}}function M(e,t,r){var i=n.call(this,e,t,r);0<=i&&this._compilations.splice(i,1)}function n(e,t,r){for(var i=0;i",b=l?">":"<",y=void 0;if(g){var _=e.util.getData(m.$data,o,e.dataPathArr),w="exclusive"+a,k="exclType"+a,x="exclIsNumber"+a,S="' + "+(A="op"+a)+" + '";n+=" var schemaExcl"+a+" = "+_+"; ",n+=" var "+w+"; var "+k+" = typeof "+(_="schemaExcl"+a)+"; if ("+k+" != 'boolean' && "+k+" != 'undefined' && "+k+" != 'number') { ";var j;y=d;(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var E=n;n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+k+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+_+" "+v+"= "+i+") ? "+p+" "+b+"= "+_+" : "+p+" "+b+" "+i+" ) : ( ("+w+" = "+_+" === true) ? "+p+" "+b+"= "+i+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { var op"+a+" = "+w+" ? '"+v+"' : '"+v+"='; ",void 0===s&&(y=d,u=e.errSchemaPath+"/"+d,i=_,h=g)}else{S=v;if((x="number"==typeof m)&&h){var A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ( "+i+" === undefined || "+m+" "+v+"= "+i+" ? "+p+" "+b+"= "+m+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { "}else{x&&void 0===s?(w=!0,y=d,u=e.errSchemaPath+"/"+d,i=m,b+="="):(x&&(i=Math[l?"min":"max"](m,s)),m===(!x||i)?(w=!0,y=d,u=e.errSchemaPath+"/"+d,b+="="):(w=!1,S+="="));A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+" "+b+" "+i+" || "+p+" !== "+p+") { "}}y=y||t,(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+A+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+S+" ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";E=n;return n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s;var l="maxLength"==t?">":"<";n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+p+".length ":n+=" ucs2length("+p+") ",n+=" "+l+" "+i+") { ";var d=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+p+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.schema[t],a=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var f="valid"+c.level,p=c.baseId,h=!0,l=n;if(l)for(var d,m=-1,g=l.length-1;m "+E+") { ";var I=f+"["+E+"]";l.schema=j,l.schemaPath=s+"["+E+"]",l.errSchemaPath=c+"/"+E,l.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),l.dataPathArr[v]=E;var P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",i+=" } ",u&&(i+=" if ("+m+") { ",d+="}")}if("object"==(void 0===_?"undefined":_typeof(_))&&e.util.schemaHasRules(_,e.RULES.all)){l.schema=_,l.schemaPath=e.schemaPath+".additionalItems",l.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+f+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" } } ",u&&(i+=" if ("+m+") { ",d+="}")}}else if(e.util.schemaHasRules(o,e.RULES.all)){l.schema=o,l.schemaPath=s,l.errSchemaPath=c,i+=" for (var "+g+" = 0; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+d+" if ("+h+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],30:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="var division"+a+";if (",h&&(n+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),n+=" (division"+a+" = "+p+" / "+i+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var l=l||[];l.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var d=n;return n=l.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+d+"]); ":n+=" validate.errors = ["+d+"]; return false; ":n+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="errs__"+n,h=e.util.copy(e);h.level++;var l="valid"+h.level;if(e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+p+" = errors; ";var d,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(d=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,d&&(h.opts.allErrors=d),e.compositeRule=h.compositeRule=m,i+=" if ("+l+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var v=i;i=g.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ");return i}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="valid"+n,h="errs__"+n,l=e.util.copy(e),d="";l.level++;var m="valid"+l.level,g=l.baseId,v="prevValid"+n,b="passingSchemas"+n;i+="var "+h+" = errors , "+v+" = false , "+p+" = false , "+b+" = null; ";var y=e.compositeRule;e.compositeRule=l.compositeRule=!0;var _=o;if(_)for(var w,k=-1,x=_.length-1;k=e.opts.loopRequired,k=e.opts.ownProperties;if(u)if(i+=" var missing"+n+"; ",w){h||(i+=" var "+l+" = validate.schema"+s+"; ");var x="' + "+(P="schema"+n+"["+(E="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(_,P,e.opts.jsonPointers)),i+=" var "+p+" = true; ",h&&(i+=" if (schema"+n+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+n+")) "+p+" = false; else {"),i+=" for (var "+E+" = 0; "+E+" < "+l+".length; "+E+"++) { "+p+" = "+f+"["+l+"["+E+"]] !== undefined ",k&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", "+l+"["+E+"]) "),i+="; if (!"+p+") break; } ",h&&(i+=" } "),i+=" if (!"+p+") { ",(I=I||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+x+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var S=i;i=I.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var j=d;if(j)for(var E=-1,A=j.length-1;E 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(0<=d.indexOf("object")||0<=d.indexOf("array")))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var g="checkDataType"+(m?"s":"");n+=" if ("+e.util[g](d,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",l&&(n+=" } "),n+=" if (!"+h+") { ";var v=v||[];v.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var b=n;n=v.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { ")}else f&&(n+=" if (true) { ");return n}},{}],39:[function(e,t,r){"use strict";t.exports=function(i,e,t){var r="",n=!0===i.schema.$async,a=i.util.schemaHasRulesExcept(i.schema,i.RULES.all,"$ref"),o=i.self._getId(i.schema);if(i.isTop&&(r+=" var validate = ",n&&(i.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(i.opts.sourceCode||i.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof i.schema||!a&&!i.schema.$ref){e="false schema";var s=i.level,c=i.dataLevel,u=i.schema[e],f=i.schemaPath+i.util.getProperty(e),p=i.errSchemaPath+"/"+e,h=!i.opts.allErrors,l="data"+(c||""),d="valid"+s;if(!1===i.schema){i.isTop?h=!0:r+=" var "+d+" = false; ",(W=W||[]).push(r),r="",!1!==i.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(p)+" , params: {} ",!1!==i.opts.messages&&(r+=" , message: 'boolean schema is false' "),i.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+i.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var m=r;r=W.pop(),!i.compositeRule&&h?i.async?r+=" throw new ValidationError(["+m+"]); ":r+=" validate.errors = ["+m+"]; return false; ":r+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else i.isTop?r+=n?" return data; ":" validate.errors = null; return true; ":r+=" var "+d+" = true; ";return i.isTop&&(r+=" }; return validate; "),r}if(i.isTop){var g=i.isTop;s=i.level=0,c=i.dataLevel=0,l="data";i.rootId=i.resolve.fullPath(i.self._getId(i.root.schema)),i.baseId=i.baseId||i.rootId,delete i.isTop,i.dataPathArr=[void 0],r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{s=i.level,l="data"+((c=i.dataLevel)||"");if(o&&(i.baseId=i.resolve.url(i.baseId,o)),n&&!i.async)throw new Error("async schema in sync schema");r+=" var errs_"+s+" = errors;"}d="valid"+s,h=!i.opts.allErrors;var v="",b="",y=i.schema.type,_=Array.isArray(y);if(_&&1==y.length&&(y=y[0],_=!1),i.schema.$ref&&a){if("fail"==i.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+i.errSchemaPath+'" (see option extendRefs)');!0!==i.opts.extendRefs&&(a=!1,i.logger.warn('$ref: keywords ignored in schema at path "'+i.errSchemaPath+'"'))}if(i.schema.$comment&&i.opts.$comment&&(r+=" "+i.RULES.all.$comment.code(i,"$comment")),y){if(i.opts.coerceTypes)var w=i.util.coerceToTypes(i.opts.coerceTypes,y);var k=i.RULES.types[y];if(w||_||!0===k||k&&!Z(k)){f=i.schemaPath+".type",p=i.errSchemaPath+"/type",f=i.schemaPath+".type",p=i.errSchemaPath+"/type";var x=_?"checkDataTypes":"checkDataType";if(r+=" if ("+i.util[x](y,l,!0)+") { ",w){var S="dataType"+s,j="coerced"+s;r+=" var "+S+" = typeof "+l+"; ","array"==i.opts.coerceTypes&&(r+=" if ("+S+" == 'object' && Array.isArray("+l+")) "+S+" = 'array'; "),r+=" var "+j+" = undefined; ";var E="",A=w;if(A)for(var I,P=-1,O=A.length-1;P>6],n=0==(32&r);if(31==(31&r)){var a=r;for(r=0;128==(128&a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function p(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)o++;(n=new u(2+o))[0]=a,n[1]=128|o;s=1+o;for(var c=i.length;0>=8)n[s]=255&c;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new u(2*e.length),i=0;i>=7)n++}var o=new u(n),s=o.length-1;for(i=e.length-1;0<=i;i--){a=e[i];for(o[s--]=127&a;0<(a>>=7);)o[s--]=128|127&a}return this._createEncoderBuffer(o)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[c(i.getFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(i.getFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.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&&!u.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new u(r)}if(u.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new u(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var a=e;256<=a;a>>=8)i++;for(a=(n=new Array(i)).length-1;0<=a;a--)n[a]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new u(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var a=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),a.length!==n.defaultBuffer.length)return!1;for(i=0;i=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0===(t&=127))throw c("Indefinite length not supported");if(4this._size-i)return null;if(this._offset=i,0===this.length)return t?a.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?n:n.toString("utf8")},i.prototype.readOID=function(e){e||(e=s.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],i=0,n=0;n>0),r.join(".")},i.prototype._readTag=function(e){o.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw c("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(4this._size-r)return null;this._offset=r;for(var i=this._buf[this._offset],n=0,a=0;a>0},t.exports=i},{"./errors":60,"./types":63,assert:67,"safer-buffer":448}],63:[function(e,t,r){t.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},{}],64:[function(e,t,r){var n=e("assert"),a=e("safer-buffer").Buffer,o=e("./types"),i=e("./errors").newInvalidAsn1Error,s={size:1024,growthFactor:8};function c(e){var r,i;r=s,i=e||{},n.ok(r),n.equal(void 0===r?"undefined":_typeof(r),"object"),n.ok(i),n.equal(void 0===i?"undefined":_typeof(i),"object"),Object.getOwnPropertyNames(r).forEach(function(e){if(!i[e]){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,t)}}),e=i,this._buf=a.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw i(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},c.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=o.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&1 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;0>>24,e<<=8},c.prototype.writeNull=function(){this.writeByte(o.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=o.Enumeration),this.writeInt(e,t)},c.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=o.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},c.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+(void 0===e?"undefined":_typeof(e))+")");"number"!=typeof t&&(t=o.OctetString);var r=a.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},c.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!a.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},c.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(e){t.writeString(e)})},c.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=o.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),i=[];i.push(40*parseInt(r[0],10)+parseInt(r[1],10)),r.slice(2).forEach(function(e){var t,r;t=i,(r=parseInt(e,10))<128?t.push(r):(r<16384?t.push(r>>>7|128):(r<2097152?t.push(r>>>14|128):(r<268435456?t.push(r>>>21|128):(t.push(255&(r>>>28|128)),t.push(255&(r>>>21|128))),t.push(255&(r>>>14|128))),t.push(255&(r>>>7|128))),t.push(127&r))});var n=this;this._ensure(2+i.length),this.writeByte(t),this.writeLength(i.length),i.forEach(function(e){n.writeByte(e)})},c.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw i("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},c.prototype.startSequence=function(e){"number"!=typeof e&&(e=o.Sequence|o.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw i("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},c.prototype._shift=function(e,t,r){n.ok(void 0!==e),n.ok(void 0!==t),n.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},c.prototype._ensure=function(e){if(n.ok(e),this._size-this._offset>16&255,a[o++]=t>>8&255,a[o++]=255&t;var u,f;2===n&&(t=p[e.charCodeAt(c)]<<2|p[e.charCodeAt(c+1)]>>4,a[o++]=255&t);1===n&&(t=p[e.charCodeAt(c)]<<10|p[e.charCodeAt(c+1)]<<4|p[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],a=0,o=r-i;a>2]+s[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],p=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,a=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return a.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},{}],76:[function(e,t,r){"use strict";var y=e("tweetnacl").lowlevel.crypto_hash,s=0,c=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};function n(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}function u(e,t){var r,i=0;for(r=0;r<4;r++,s++)t<=s&&(s=0),i=i<<8|e[s];return i}c.prototype.encipher=function(e,t){void 0===t&&(t=new Uint8Array(e.buffer),0!==e.byteOffset&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=n(this.S,t,0)^this.P[r],e[0]^=n(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i},c.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);0!==e.byteOffset&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;0>>24,r[4*i+2]=a[i]>>>16,r[4*i+1]=a[i]>>>8,r[4*i+0]=a[i]}t.exports={BLOCKS:f,HASHSIZE:32,hash:_,pbkdf:function(e,t,r,i,n,a,o){var s,c,u,f,p,h,l=new Uint8Array(64),d=new Uint8Array(64),m=new Uint8Array(32),g=new Uint8Array(32),v=new Uint8Array(i+4),b=a;if(o<1)return-1;if(0===t||0===i||0===a||a>m.byteLength*m.byteLength||1<<20>>24,v[i+1]=h>>>16,v[i+2]=h>>>8,v[i+3]=h,y(d,v,i+4),_(l,d,g),s=m.byteLength;s--;)m[s]=g[s];for(s=1;sa[o]^r?1:-1;return c==u?0:u=t&&e<=r}function J(e){return"[object Array]"==Object.prototype.toString.call(e)}function Q(e,t,r){for(var i,n,a=[0],o=0,s=e.length;or-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}function ee(e,t){return(1(r=e.length)){for(i="0",t-=r;--t;i+="0");e+=i}else tt;)u[n]=0,n||(++a,u.unshift(1));for(o=u.length;!u[--o];);for(p=0,e="";p<=o;e+=U.charAt(u[p++]));e=te(e,a)}return e}function P(e,t,r,i){var n,a,o,s,c;if(r=null!=r&&k(r,0,8,i,q)?0|r:b,!e.c)return e.toString();if(n=e.c[0],o=e.e,null==t)c=Z(e.c),c=19==i||24==i&&o<=h?ee(c,o):te(c,o);else if(a=(e=C(new I(e),t,r)).e,s=(c=Z(e.c)).length,19==i||24==i&&(t<=a||a<=h)){for(;sy?e.c=e.e=null:e.c=r=p.length){if(!i)break e;for(;p.length<=u;p.push(0));c=f=0,o=(a%=K)-K+(n=1)}else{for(c=s=p[u],n=1;10<=s;s/=10,n++);f=(o=(a%=K)-K+n)<0?0:c/h[n-o-1]%10|0}if(i=i||t<0||null!=p[u+1]||(o<0?c:c%h[n-o-1]),i=r<4?(f||i)&&(0==r||r==(e.s<0?3:2)):5y?e.c=e.e=null:e.er)return null!=(e=n[r++])};return o(t="DECIMAL_PLACES")&&k(e,0,$,2,t)&&(d=0|e),i[t]=d,o(t="ROUNDING_MODE")&&k(e,0,8,2,t)&&(b=0|e),i[t]=b,o(t="EXPONENTIAL_AT")&&(J(e)?k(e[0],-$,0,2,t)&&k(e[1],0,$,2,t)&&(h=0|e[0],l=0|e[1]):k(e,-$,$,2,t)&&(h=-(l=0|(e<0?-e:e)))),i[t]=[h,l],o(t="RANGE")&&(J(e)?k(e[0],-$,-1,2,t)&&k(e[1],1,$,2,t)&&(m=0|e[0],y=0|e[1]):k(e,-$,$,2,t)&&(0|e?m=-(y=0|(e<0?-e:e)):w&&B(2,t+" cannot be zero",e))),i[t]=[m,y],o(t="ERRORS")&&(e===!!e||1===e||0===e?(_=0,k=(w=!!e)?O:X):w&&B(2,t+D,e)),i[t]=w,o(t="CRYPTO")&&(e===!!e||1===e||0===e?(x=!(!e||!F||"object"!=(void 0===F?"undefined":_typeof(F))),e&&!x&&w&&B(2,"crypto unavailable",F)):w&&B(2,t+D,e)),i[t]=x,o(t="MODULO_MODE")&&k(e,0,9,2,t)&&(S=0|e),i[t]=S,o(t="POW_PRECISION")&&k(e,0,$,2,t)&&(j=0|e),i[t]=j,o(t="FORMAT")&&("object"==(void 0===e?"undefined":_typeof(e))?E=e:w&&B(2,t+" not an object",e)),i[t]=E,i},I.max=function(){return n(arguments,i.lt)},I.min=function(){return n(arguments,i.gt)},I.random=(r=9007199254740992,u=Math.random()*r&2097151?function(){return N(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,n,a,o=0,s=[],c=new I(v);if(e=null!=e&&k(e,0,$,14)?0|e:d,n=M(e/K),x)if(F&&F.getRandomValues){for(t=F.getRandomValues(new Uint32Array(n*=2));o>>11))?(r=F.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(s.push(a%1e14),o+=2);o=n/2}else if(F&&F.randomBytes){for(t=F.randomBytes(n*=7);ot[n]?1:-1;break}return a}function A(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r](x[s]||0)&&o--,k<0)l.push(1),c=!0;else{for(b=x.length,_=S.length,k+=2,1<(u=N(n/(S[s=0]+1)))&&(S=j(S,u,n),x=j(x,u,n),_=S.length,b=x.length),v=_,m=(d=x.slice(0,_)).length;m<_;d[m++]=0);(w=S.slice()).unshift(0),y=S[0],S[1]>=n/2&&y++;do{if(u=0,(a=E(S,d,_,m))<0){if(g=d[0],_!=m&&(g=g*n+(d[1]||0)),1<(u=N(g/y)))for(n<=u&&(u=n-1),p=(f=j(S,u,n)).length,m=d.length;1==E(f,d,p,m);)u--,A(f,_this.c.length-2},i.isNaN=function(){return!this.s},i.isNegative=i.isNeg=function(){return this.s<0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.lessThan=i.lt=function(e,t){return _=8,Y(this,new I(e,t))<0},i.lessThanOrEqualTo=i.lte=function(e,t){return _=9,-1===(t=Y(this,new I(e,t)))||0===t},i.minus=i.sub=function(e,t){var r,i,n,a,o=this,s=o.s;if(_=10,t=(e=new I(e,t)).s,!s||!t)return new I(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/K,u=e.e/K,f=o.c,p=e.c;if(!c||!u){if(!f||!p)return f?(e.s=-t,e):new I(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new I(f[0]?o:3==b?-0:0)}if(c=W(c),u=W(u),f=f.slice(),s=c-u){for((n=(a=s<0)?(s=-s,f):(u=c,p)).reverse(),t=s;t--;n.push(0));n.reverse()}else for(i=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;tt&&(t=this.e+1),t},i.round=function(e,t){var r=new I(this);return(null==e||k(e,0,$,15))&&C(r,~~e+this.e+1,null!=t&&k(t,0,8,15,q)?0|t:b),r},i.shift=function(e){var t=this;return k(e,-a,a,16,"argument")?t.times("1e"+re(e)):new I(t.c&&t.c[0]&&(e<-a||at&&(r.c.length=t)}if(!(i=N(i/2)))break;n=n.times(n),t&&n.c&&n.c.length>t&&(n.c.length=t)}return e<0&&(r=v.div(r)),t?C(r,j,b):r},i.toPrecision=function(e,t){return P(this,null!=e&&k(e,1,$,24,"precision")?0|e:null,t,24)},i.toString=function(e){var t,r=this.s,i=this.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=Z(this.c),t=null!=e&&k(e,2,64,25,"base")?A(te(t,i),0|e,10,r):i<=h||l<=i?ee(t,i):te(t,i),r<0&&this.c[0]&&(t="-"+t)),t},i.truncated=i.trunc=function(){return C(new I(this),this.e+1,1)},i.valueOf=i.toJSON=function(){return this.toString()},null!=t&&I.config(t),I}(),"function"==typeof define&&define.amd)define(function(){return t});else if(void 0!==i&&i.exports){if(i.exports=t,!F)try{F=r("crypto")}catch(e){}}else e.BigNumber=t}(this)},{crypto:204}],78:[function(i,n,e){(function(e,t){"use strict";var r=n.exports;r.version="v"+i("./package.json").version,r.versionGuard=function(e){if(void 0!==e){throw new Error("More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.")}},r.versionGuard(e._bitcore),e._bitcore=r.version,r.crypto={},r.crypto.BN=i("./lib/crypto/bn"),r.crypto.ECDSA=i("./lib/crypto/ecdsa"),r.crypto.Hash=i("./lib/crypto/hash"),r.crypto.Random=i("./lib/crypto/random"),r.crypto.Point=i("./lib/crypto/point"),r.crypto.Signature=i("./lib/crypto/signature"),r.encoding={},r.encoding.Base58=i("./lib/encoding/base58"),r.encoding.Base58Check=i("./lib/encoding/base58check"),r.encoding.BufferReader=i("./lib/encoding/bufferreader"),r.encoding.BufferWriter=i("./lib/encoding/bufferwriter"),r.encoding.Varint=i("./lib/encoding/varint"),r.util={},r.util.buffer=i("./lib/util/buffer"),r.util.js=i("./lib/util/js"),r.util.preconditions=i("./lib/util/preconditions"),r.errors=i("./lib/errors"),r.Address=i("./lib/address"),r.Block=i("./lib/block"),r.MerkleBlock=i("./lib/block/merkleblock"),r.BlockHeader=i("./lib/block/blockheader"),r.HDPrivateKey=i("./lib/hdprivatekey.js"),r.HDPublicKey=i("./lib/hdpublickey.js"),r.Networks=i("./lib/networks"),r.Opcode=i("./lib/opcode"),r.PrivateKey=i("./lib/privatekey"),r.PublicKey=i("./lib/publickey"),r.Script=i("./lib/script"),r.Transaction=i("./lib/transaction"),r.URI=i("./lib/uri"),r.Unit=i("./lib/unit"),r.deps={},r.deps.bnjs=i("bn.js"),r.deps.bs58=i("bs58"),r.deps.Buffer=t,r.deps.elliptic=i("elliptic"),r.deps._=i("lodash"),r._HDKeyCache=i("./lib/hdkeycache"),r.Transaction.sighash=i("./lib/transaction/sighash")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i("buffer").Buffer)},{"./lib/address":79,"./lib/block":82,"./lib/block/blockheader":81,"./lib/block/merkleblock":83,"./lib/crypto/bn":84,"./lib/crypto/ecdsa":85,"./lib/crypto/hash":86,"./lib/crypto/point":87,"./lib/crypto/random":88,"./lib/crypto/signature":89,"./lib/encoding/base58":90,"./lib/encoding/base58check":91,"./lib/encoding/bufferreader":92,"./lib/encoding/bufferwriter":93,"./lib/encoding/varint":94,"./lib/errors":95,"./lib/hdkeycache":97,"./lib/hdprivatekey.js":98,"./lib/hdpublickey.js":99,"./lib/networks":100,"./lib/opcode":101,"./lib/privatekey":102,"./lib/publickey":103,"./lib/script":104,"./lib/transaction":107,"./lib/transaction/sighash":115,"./lib/unit":119,"./lib/uri":120,"./lib/util/buffer":121,"./lib/util/js":122,"./lib/util/preconditions":123,"./package.json":150,"bn.js":124,bs58:125,buffer:191,elliptic:127,lodash:149}],79:[function(e,t,r){(function(a){"use strict";var n=e("lodash"),o=e("./util/preconditions"),i=e("./errors"),s=e("./encoding/base58check"),c=e("./networks"),r=e("./crypto/hash"),u=e("./util/js"),f=e("./publickey");function p(e,t,r){if(!(this instanceof p))return new p(e,t,r);if(n.isArray(e)&&n.isNumber(t))return p.createMultisig(e,t,r);if(e instanceof p)return e;if(o.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!c.get(t))throw new TypeError('Second argument must be "livenet" or "testnet".');if(r&&r!==p.PayToPublicKeyHash&&r!==p.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||c.get(t)||c.defaultNetwork,i.type=i.type||r||p.PayToPublicKeyHash,u.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}p.prototype._classifyArguments=function(e,t,r){if((e instanceof a||e instanceof Uint8Array)&&20===e.length)return p._transformHash(e);if((e instanceof a||e instanceof Uint8Array)&&21===e.length)return p._transformBuffer(e,t,r);if(e instanceof f)return p._transformPublicKey(e);if(e instanceof h)return p._transformScript(e,t);if("string"==typeof e)return p._transformString(e,t,r);if(n.isObject(e))return p._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")},p.PayToPublicKeyHash="pubkeyhash",p.PayToScriptHash="scripthash",p._transformHash=function(e){var t={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==e.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t},p._transformObject=function(e){return o.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),o.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?new a(e.hash,"hex"):e.hashBuffer,network:c.get(e.network)||c.defaultNetwork,type:e.type}},p._classifyFromVersion=function(e){var t={},r=c.get(e[0],"pubkeyhash"),i=c.get(e[0],"scripthash");return r?(t.network=r,t.type=p.PayToPublicKeyHash):i&&(t.network=i,t.type=p.PayToScriptHash),t},p._transformBuffer=function(e,t,r){var i={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==e.length)throw new TypeError("Address buffers must be exactly 21 bytes.");t=c.get(t);var n=p._classifyFromVersion(e);if(!n.network||t&&t!==n.network)throw new TypeError("Address has mismatched network type.");if(!n.type||r&&r!==n.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=n.network,i.type=n.type,i},p._transformPublicKey=function(e){var t={};if(!(e instanceof f))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=r.sha256ripemd160(e.toBuffer()),t.type=p.PayToPublicKeyHash,t},p._transformScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new i.Script.CantDeriveAddress(e);return r},p.createMultisig=function(e,t,r){return r=r||e[0].network||c.defaultNetwork,p.payingTo(h.buildMultisigOut(e,t),r)},p._transformString=function(e,t,r){if("string"!=typeof e)throw new TypeError("data parameter supplied is not a string.");e=e.trim();var i=s.decode(e);return p._transformBuffer(i,t,r)},p.fromPublicKey=function(e,t){var r=p._transformPublicKey(e);return t=t||c.defaultNetwork,new p(r.hashBuffer,t,r.type)},p.fromPublicKeyHash=function(e,t){return new p(p._transformHash(e).hashBuffer,t,p.PayToPublicKeyHash)},p.fromScriptHash=function(e,t){return o.checkArgument(e,"hash parameter is required"),new p(p._transformHash(e).hashBuffer,t,p.PayToScriptHash)},p.payingTo=function(e,t){return o.checkArgument(e,"script is required"),o.checkArgument(e instanceof h,"script must be instance of Script"),p.fromScriptHash(r.sha256ripemd160(e.toBuffer()),t)},p.fromScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=p._transformScript(e,t);return new p(r.hashBuffer,t,r.type)},p.fromBuffer=function(e,t,r){var i=p._transformBuffer(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromString=function(e,t,r){var i=p._transformString(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromObject=function(e){return o.checkState(u.isHexa(e.hash),'Unexpected hash property, "'+e.hash+'", expected to be hex.'),new p(new a(e.hash,"hex"),e.network,e.type)},p.getValidationError=function(e,t,r){var i;try{new p(e,t,r)}catch(e){i=e}return i},p.isValid=function(e,t,r){return!p.getValidationError(e,t,r)},p.prototype.isPayToPublicKeyHash=function(){return this.type===p.PayToPublicKeyHash},p.prototype.isPayToScriptHash=function(){return this.type===p.PayToScriptHash},p.prototype.toBuffer=function(){var e=new a([this.network[this.type]]);return a.concat([e,this.hashBuffer])},p.prototype.toObject=p.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},p.prototype.toString=function(){return s.encode(this.toBuffer())},p.prototype.inspect=function(){return""},t.exports=p;var h=e("./script")}).call(this,e("buffer").Buffer)},{"./crypto/hash":86,"./encoding/base58check":91,"./errors":95,"./networks":100,"./publickey":103,"./script":104,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],80:[function(t,l,e){(function(o){"use strict";var r=t("lodash"),n=t("./blockheader"),i=t("../crypto/bn"),a=t("../util/buffer"),s=t("../encoding/bufferreader"),c=t("../encoding/bufferwriter"),u=t("../crypto/hash"),f=t("../transaction"),p=t("../util/preconditions");function h(e){return this instanceof h?(r.extend(this,h._from(e)),this):new h(e)}h.MAX_BLOCK_SIZE=1e6,h._from=function(e){var t={};if(a.isBuffer(e))t=h._fromBufferReader(s(e));else{if(!r.isObject(e))throw new TypeError("Unrecognized argument for Block");t=h._fromObject(e)}return t},h._fromObject=function(e){var t=[];return e.transactions.forEach(function(e){e instanceof f?t.push(e):t.push(f().fromObject(e))}),{header:n.fromObject(e.header),transactions:t}},h.fromObject=function(e){return new h(h._fromObject(e))},h._fromBufferReader=function(e){var t={};p.checkState(!e.finished(),"No block data received"),t.header=n.fromBufferReader(e);var r=e.readVarintNum();t.transactions=[];for(var i=0;i"},h.Values={START_OF_BLOCK:8,NULL_HASH:new o("0000000000000000000000000000000000000000000000000000000000000000","hex")},l.exports=h}).call(this,t("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../transaction":107,"../util/buffer":121,"../util/preconditions":123,"./blockheader":81,buffer:191,lodash:149}],81:[function(f,p,e){(function(i){"use strict";var n=f("lodash"),a=f("../crypto/bn"),o=f("../util/buffer"),s=f("../encoding/bufferreader"),t=f("../encoding/bufferwriter"),r=f("../crypto/hash"),c=(f("../util/js"),f("../util/preconditions")),u=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&c.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};u._from=function(e){var t={};if(o.isBuffer(e))t=u._fromBufferReader(s(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for BlockHeader");t=u._fromObject(e)}return t},u._fromObject=function(e){c.checkArgument(e,"data is required");var t=e.prevHash,r=e.merkleRoot;return n.isString(e.prevHash)&&(t=o.reverse(new i(e.prevHash,"hex"))),n.isString(e.merkleRoot)&&(r=o.reverse(new i(e.merkleRoot,"hex"))),{hash:e.hash,version:e.version,prevHash:t,merkleRoot:r,time:e.time,timestamp:e.time,bits:e.bits,nonce:e.nonce}},u.fromObject=function(e){var t=u._fromObject(e);return new u(t)},u.fromRawBlock=function(e){o.isBuffer(e)||(e=new i(e,"binary"));var t=s(e);t.pos=u.Constants.START_OF_HEADER;var r=u._fromBufferReader(t);return new u(r)},u.fromBuffer=function(e){var t=u._fromBufferReader(s(e));return new u(t)},u.fromString=function(e){var t=new i(e,"hex");return u.fromBuffer(t)},u._fromBufferReader=function(e){var t={};return t.version=e.readUInt32LE(),t.prevHash=e.read(32),t.merkleRoot=e.read(32),t.time=e.readUInt32LE(),t.bits=e.readUInt32LE(),t.nonce=e.readUInt32LE(),t},u.fromBufferReader=function(e){var t=u._fromBufferReader(e);return new u(t)},u.prototype.toObject=u.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:o.reverse(this.prevHash).toString("hex"),merkleRoot:o.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},u.prototype.toBuffer=function(){return this.toBufferWriter().concat()},u.prototype.toString=function(){return this.toBuffer().toString("hex")},u.prototype.toBufferWriter=function(e){return e||(e=new t),e.writeUInt32LE(this.version),e.write(this.prevHash),e.write(this.merkleRoot),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e},u.prototype.getTargetDifficulty=function(e){e=e||this.bits;for(var t=new a(16777215&e),r=8*((e>>>24)-3);0e+u.Constants.MAX_TIME_OFFSET)},u.prototype.validProofOfWork=function(){var e=new a(this.id,"hex"),t=this.getTargetDifficulty();return!(0"},u.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new a("10000000000000000000000000000000000000000000000000000000000000000","hex")},p.exports=u}).call(this,f("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],82:[function(e,t,r){t.exports=e("./block"),t.exports.BlockHeader=e("./blockheader"),t.exports.MerkleBlock=e("./merkleblock")},{"./block":80,"./blockheader":81,"./merkleblock":83}],83:[function(e,t,r){(function(s){"use strict";var n=e("lodash"),a=e("./blockheader"),o=e("../util/buffer"),r=e("../encoding/bufferreader"),i=e("../encoding/bufferwriter"),c=e("../crypto/hash"),u=(e("../util/js"),e("../transaction")),f=e("../util/preconditions");function p(e){if(!(this instanceof p))return new p(e);var t={};if(o.isBuffer(e))t=p._fromBufferReader(r(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for MerkleBlock");t={header:e.header instanceof a?e.header:a.fromObject(e.header),numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}return n.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}p.fromBuffer=function(e){return p.fromBufferReader(r(e))},p.fromBufferReader=function(e){return new p(p._fromBufferReader(e))},p.prototype.toBuffer=function(){return this.toBufferWriter().concat()},p.prototype.toBufferWriter=function(e){e||(e=new i),e.write(this.header.toBuffer()),e.writeUInt32LE(this.numTransactions),e.writeVarintNum(this.hashes.length);for(var t=0;tthis.numTransactions)return!1;if(8*this.flags.length8*this.flags.length)return null;var i=this.flags[r.flagBitsUsed>>3]>>>(7&r.flagBitsUsed++)&1;if(0!==e&&i){var n=this._traverseMerkleTree(e-1,2*t,r),a=n;return 2*t+1=this.hashes.length)return null;var o=this.hashes[r.hashesUsed++];return 0===e&&i&&r.txs.push(o),new s(o,"hex")},p.prototype._calcTreeWidth=function(e){return this.numTransactions+(1<>e},p.prototype._calcTreeHeight=function(){for(var e=0;1e.size?t=n.trim(t,i):i>1,o=d.getN(),s=d.getG(),c=a?r.add(o):r,u=d.fromX(n,c);if(!u.mul(o).isInfinity())throw new Error("nR is not a valid curve point");var f=t.neg().mod(o),p=r.invm(o),h=u.mul(i).add(s.mul(f)).mul(p);return m.fromPoint(h,this.sig.compressed)},h.prototype.sigError=function(){if(!f.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s;if(!(e.gt(l.Zero)&&e.lt(d.getN())&&t.gt(l.Zero)&&t.lt(d.getN())))return"r and s not in range";var r=l.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),i=d.getN(),n=t.invm(i),a=n.mul(r).mod(i),o=n.mul(e).mod(i),s=d.getG().mulAdd(a,this.pubkey.point,o);return s.isInfinity()?"p is infinity":0!==s.getX().mod(i).cmp(e)&&"Invalid signature"},h.toLowS=function(e){return e.gt(l.fromBuffer(new c("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=d.getN().sub(e)),e},h.prototype._findSignature=function(e,t){for(var r,i,n,a=d.getN(),o=d.getG(),s=0;(!this.k||0i)r=e(r);else if(r>>=8)}return r},e.exports=r}).call(this,i("_process"),i("buffer").Buffer)},{_process:382,buffer:191,crypto:204}],89:[function(e,r,t){(function(u){"use strict";var g=e("./bn"),v=e("lodash"),b=e("../util/preconditions"),y=e("../util/buffer"),t=e("../util/js"),o=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof g)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};o.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=void 0!==e.i?e.i:this.i,this.compressed=void 0!==e.compressed?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this},o.fromCompact=function(e){b.checkArgument(y.isBuffer(e),"Argument is expected to be a Buffer");var t=new o,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i+=4);var n=e.slice(1,33),a=e.slice(33,65);return b.checkArgument(0===i||1===i||2===i||3===i,new Error("i must be 0, 1, 2, or 3")),b.checkArgument(32===n.length,new Error("r must be 32 bytes")),b.checkArgument(32===a.length,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=g.fromBuffer(n),t.s=g.fromBuffer(a),t},o.fromDER=o.fromBuffer=function(e,t){var r=o.parseDER(e,t),i=new o;return i.r=r.r,i.s=r.s,i},o.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=new o.fromDER(r,!1);return i.nhashtype=t,i},o.fromString=function(e){var t=new u(e,"hex");return o.fromDER(t)},o.parseDER=function(e,t){b.checkArgument(y.isBuffer(e),new Error("DER formatted signature should be a buffer")),v.isUndefined(t)&&(t=!0);var r=e[0];b.checkArgument(48===r,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;b.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(2!==e[2])return!1;if(0===t)return!1;if(128&i[0])return!1;if(1=this.buf.length},e.prototype.read=function(e){r.checkArgument(!n.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t},e.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e},e.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e},e.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=o.fromBuffer(e);return this.pos=this.pos+8,t},e.prototype.readUInt64LEBN=function(){var e,t=this.buf.readUInt32LE(this.pos),r=4294967296*this.buf.readUInt32LE(this.pos+4)+t;if(r<=9007199254740991)e=new o(r);else{var i=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);e=new o(i,10,"le")}return this.pos=this.pos+8,e},e.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN().toNumber();if(t<=Math.pow(2,53))return t;throw new Error("number too large to retain precision - use readVarintBN");default:return e}},e.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return r.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t},e.prototype.readVarintBuf=function(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},e.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new o(this.readUInt16LE());case 254:return new o(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new o(e)}},e.prototype.reverse=function(){for(var e=new i(this.buf.length),t=0;t"},k.prototype.toObject=k.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:_.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},k.fromBuffer=function(e){return new k(e.toString())},k.prototype.toBuffer=function(){return _.copy(this._buffers.xprivkey)},k.DefaultDepth=0,k.DefaultFingerprint=0,k.DefaultChildIndex=0,k.MaxIndex=2*(k.Hardened=2147483648),k.RootElementAlias=["m","M","m'","M'"],k.VersionSize=4,k.DepthSize=1,k.ParentFingerPrintSize=4,k.ChildIndexSize=4,k.ChainCodeSize=32,k.PrivateKeySize=32,k.CheckSumSize=4,k.DataLength=78,k.SerializedByteSize=82,n((k.ChecksumEnd=(k.ChecksumStart=k.PrivateKeyEnd=(k.PrivateKeyStart=(k.ChainCodeEnd=(k.ChainCodeStart=k.ChildIndexEnd=(k.ChildIndexStart=k.ParentFingerPrintEnd=(k.ParentFingerPrintStart=k.DepthEnd=(k.DepthStart=k.VersionEnd=(k.VersionStart=0)+k.VersionSize)+k.DepthSize)+k.ParentFingerPrintSize)+k.ChildIndexSize)+k.ChainCodeSize)+1)+k.PrivateKeySize)+k.CheckSumSize)===k.SerializedByteSize),e.exports=k}).call(this,o("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./crypto/random":88,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdpublickey":99,"./networks":100,"./privatekey":102,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],99:[function(i,s,e){(function(u){"use strict";var n=i("lodash"),t=i("./util/preconditions"),f=i("./crypto/bn"),a=i("./encoding/base58"),p=i("./encoding/base58check"),h=i("./crypto/hash"),r=i("./hdprivatekey"),l=i("./hdkeycache"),d=i("./networks"),m=i("./crypto/point"),g=i("./publickey"),e=i("./errors"),v=e,b=e.HDPublicKey,o=i("assert"),y=i("./util/js"),_=i("./util/buffer");function w(e){if(e instanceof w)return e;if(!(this instanceof w))return new w(e);if(e){if(n.isString(e)||_.isBuffer(e)){var t=w.getSerializedError(e);if(t){if(_.isBuffer(e)&&!w.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof b.ArgumentIsPrivateExtended)return new r(e).hdPublicKey;throw t}return this._buildFromSerialized(e)}if(n.isObject(e))return e instanceof r?this._buildFromPrivate(e):this._buildFromObject(e);throw new b.UnrecognizedArgument(e)}throw new b.MustSupplyArgument}w.isValidPath=function(e){if(n.isString(e)){var t=r._getDerivationIndexes(e);return null!==t&&n.all(t,w.isValidPath)}return!!n.isNumber(e)&&(0<=e&&e"},w.prototype.toObject=w.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version)).name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:_.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},w.fromBuffer=function(e){return new w(e)},w.prototype.toBuffer=function(){return _.copy(this._buffers.xpubkey)},w.Hardened=2147483648,w.RootElementAlias=["m","M"],w.VersionSize=4,w.DepthSize=1,w.ParentFingerPrintSize=4,w.ChildIndexSize=4,w.ChainCodeSize=32,w.PublicKeySize=33,w.CheckSumSize=4,w.DataSize=78,w.SerializedByteSize=82,w.ChecksumEnd=(w.ChecksumStart=w.PublicKeyEnd=(w.PublicKeyStart=w.ChainCodeEnd=(w.ChainCodeStart=w.ChildIndexEnd=(w.ChildIndexStart=w.ParentFingerPrintEnd=(w.ParentFingerPrintStart=w.DepthEnd=(w.DepthStart=w.VersionEnd=(w.VersionStart=0)+w.VersionSize)+w.DepthSize)+w.ParentFingerPrintSize)+w.ChildIndexSize)+w.ChainCodeSize)+w.PublicKeySize)+w.CheckSumSize,o(w.PublicKeyEnd===w.DataSize),o(w.ChecksumEnd===w.SerializedByteSize),s.exports=w}).call(this,i("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdprivatekey":98,"./networks":100,"./publickey":103,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],100:[function(e,t,r){"use strict";var n=e("lodash"),i=e("./util/buffer"),a=e("./util/js"),o=[],s={};function c(){}function u(t,e){if(~o.indexOf(t))return t;if(!e)return s[t];n.isArray(e)||(e=[e]);var r=function(e){return o[i][e]===t};for(var i in o)if(n.any(e,r))return o[i]}function f(e){var t=new c;return a.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey}),e.networkMagic&&a.defineImmutable(t,{networkMagic:i.integerAsBuffer(e.networkMagic)}),e.port&&a.defineImmutable(t,{port:e.port}),e.dnsSeeds&&a.defineImmutable(t,{dnsSeeds:e.dnsSeeds}),n.each(t,function(e){n.isUndefined(e)||n.isObject(e)||(s[e]=t)}),o.push(t),t}c.prototype.toString=function(){return this.name},f({name:"livenet",alias:"mainnet",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var p=u("livenet");f({name:"testnet",alias:"regtest",pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956});var h=u("testnet"),l={PORT:18333,NETWORK_MAGIC:i.integerAsBuffer(185665799),DNS_SEEDS:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]};for(var d in l)n.isObject(l[d])||(s[l[d]]=h);var m={PORT:18444,NETWORK_MAGIC:i.integerAsBuffer(4206867930),DNS_SEEDS:[]};for(var d in m)n.isObject(m[d])||(s[m[d]]=h);Object.defineProperty(h,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.PORT:l.PORT}}),Object.defineProperty(h,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.NETWORK_MAGIC:l.NETWORK_MAGIC}}),Object.defineProperty(h,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.DNS_SEEDS:l.DNS_SEEDS}}),t.exports={add:f,remove:function(e){for(var t=0;t=a.map.OP_1&&e<=a.map.OP_16},a.prototype.inspect=function(){return""},c.exports=a}).call(this,s("buffer").Buffer)},{"./util/buffer":121,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],102:[function(h,l,e){(function(i){"use strict";var n=h("lodash"),r=h("./address"),a=h("./encoding/base58check"),o=h("./crypto/bn"),s=h("./util/js"),c=h("./networks"),u=h("./crypto/point"),e=h("./publickey"),f=h("./crypto/random"),t=h("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(e instanceof p)return e;var r=this._classifyArguments(e,t);if(!r.bn||0===r.bn.cmp(new o(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(u.getN()))throw new TypeError("Number must be less than N");if(void 0===r.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return s.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}p.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?c.get(t):c.defaultNetwork};if(n.isUndefined(e)||n.isNull(e))r.bn=p._getRandomBN();else if(e instanceof o)r.bn=e;else if(e instanceof i||e instanceof Uint8Array)r=p._transformBuffer(e,t);else if(e.bn&&e.network)r=p._transformObject(e);else if(!t&&c.get(e))r.bn=p._getRandomBN(),r.network=c.get(e);else{if("string"!=typeof e)throw new TypeError("First argument is an unrecognized data type.");s.isHexa(e)?r.bn=new o(new i(e,"hex")):r=p._transformWIF(e,t)}return r},p._getRandomBN=function(){var e,t;do{var r=f.getRandomBuffer(32);e=(t=o.fromBuffer(r)).lt(u.getN())}while(!e);return t},p._transformBuffer=function(e,t){var r={};if(32===e.length)return p._transformBNBuffer(e,t);if(r.network=c.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==c.get(t))throw new TypeError("Private key network mismatch");if(34===e.length&&1===e[33])r.compressed=!0;else{if(33!==e.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");r.compressed=!1}return r.bn=o.fromBuffer(e.slice(1,33)),r},p._transformBNBuffer=function(e,t){var r={};return r.network=c.get(t)||c.defaultNetwork,r.bn=o.fromBuffer(e),r.compressed=!1,r},p._transformWIF=function(e,t){return p._transformBuffer(a.decode(e),t)},p.fromBuffer=function(e,t){return new p(e,t)},p._transformObject=function(e){return{bn:new o(e.bn,"hex"),network:c.get(e.network),compressed:e.compressed}},p.fromString=p.fromWIF=function(e){return t.checkArgument(n.isString(e),"First argument is expected to be a string."),new p(e)},p.fromObject=function(e){return t.checkArgument(n.isObject(e),"First argument is expected to be an object."),new p(e)},p.fromRandom=function(e){return new p(p._getRandomBN(),e)},p.getValidationError=function(e,t){var r;try{new p(e,t)}catch(e){r=e}return r},p.isValid=function(e,t){return!!e&&!p.getValidationError(e,t)},p.prototype.toString=function(){return this.toBuffer().toString("hex")},p.prototype.toWIF=function(){var e,t=this.network;return e=this.compressed?i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32}),new i([1])]):i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32})]),a.encode(e)},p.prototype.toBigNumber=function(){return this.bn},p.prototype.toBuffer=function(){return this.bn.toBuffer()},p.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=e.fromPrivateKey(this)),this._pubkey},p.prototype.toAddress=function(e){var t=this.toPublicKey();return r.fromPublicKey(t,e||this.network)},p.prototype.toObject=p.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},p.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return""},l.exports=p}).call(this,h("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/point":87,"./crypto/random":88,"./encoding/base58check":91,"./networks":100,"./publickey":103,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],103:[function(t,r,e){(function(o){"use strict";var s=t("./crypto/bn"),c=t("./crypto/point"),e=t("./crypto/hash"),i=t("./util/js"),n=t("./networks"),u=t("lodash"),f=t("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(f.checkArgument(e,"First argument is required, please include public key data."),e instanceof p)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),i.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||n.defaultNetwork}),this}p.prototype._classifyArgs=function(e,t){var r={compressed:u.isUndefined(t.compressed)||t.compressed};if(e instanceof c)r.point=e;else if(e.x&&e.y)r=p._transformObject(e);else if("string"==typeof e)r=p._transformDER(new o(e,"hex"));else if(p._isBuffer(e))r=p._transformDER(e);else{if(!p._isPrivateKey(e))throw new TypeError("First argument is an unrecognized data format.");r=p._transformPrivateKey(e)}return r.network||(r.network=u.isUndefined(t.network)?void 0:n.get(t.network)),r},p._isPrivateKey=function(e){return e instanceof t("./privatekey")},p._isBuffer=function(e){return e instanceof o||e instanceof Uint8Array},p._transformPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=c.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t},p._transformDER=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r,i,n,a,o={};if(t=!!u.isUndefined(t)||t,4!==e[0]&&(t||6!==e[0]&&7!==e[0]))if(3===e[0])n=e.slice(1),r=new s(n),(o=p._transformX(!0,r)).compressed=!0;else{if(2!==e[0])throw new TypeError("Invalid DER format public key");n=e.slice(1),r=new s(n),(o=p._transformX(!1,r)).compressed=!0}else{if(n=e.slice(1,33),a=e.slice(33,65),32!==n.length||32!==a.length||65!==e.length)throw new TypeError("Length of x and y must be 32 bytes");r=new s(n),i=new s(a),o.point=new c(r,i),o.compressed=!1}return o},p._transformX=function(e,t){f.checkArgument("boolean"==typeof e,"Must specify whether y is odd or not (true or false)");var r={};return r.point=c.fromX(e,t),r},p._transformObject=function(e){var t=new s(e.x,"hex"),r=new s(e.y,"hex");return new p(new c(t,r),{compressed:e.compressed})},p.fromPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t=p._transformPrivateKey(e);return new p(t.point,{compressed:t.compressed,network:t.network})},p.fromDER=p.fromBuffer=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r=p._transformDER(e,t);return new p(r.point,{compressed:r.compressed})},p.fromPoint=function(e,t){return f.checkArgument(e instanceof c,"First argument must be an instance of Point."),new p(e,{compressed:t})},p.fromString=function(e,t){var r=new o(e,t||"hex"),i=p._transformDER(r);return new p(i.point,{compressed:i.compressed})},p.fromX=function(e,t){var r=p._transformX(e,t);return new p(r.point,{compressed:r.compressed})},p.getValidationError=function(e){var t;try{new p(e)}catch(e){t=e}return t},p.isValid=function(e){return!p.getValidationError(e)},p.prototype.toObject=p.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},p.prototype.toBuffer=p.prototype.toDER=function(){var e,t=this.point.getX(),r=this.point.getY(),i=t.toBuffer({size:32}),n=r.toBuffer({size:32});if(this.compressed){var a=n[n.length-1]%2;return e=new o(a?[3]:[2]),o.concat([e,i])}return e=new o([4]),o.concat([e,i,n])},p.prototype._getID=function(){return e.sha256ripemd160(this.toBuffer())},p.prototype.toAddress=function(e){return t("./address").fromPublicKey(this,e||this.network)},p.prototype.toString=function(){return this.toDER().toString("hex")},p.prototype.inspect=function(){return""},r.exports=p}).call(this,t("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./networks":100,"./privatekey":102,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],104:[function(e,t,r){t.exports=e("./script"),t.exports.Interpreter=e("./interpreter")},{"./interpreter":105,"./script":106}],105:[function(p,t,e){(function(e){"use strict";var R=p("lodash"),z=p("./script"),M=p("../opcode"),N=p("../crypto/bn"),D=p("../crypto/hash"),q=p("../crypto/signature"),L=p("../publickey"),U=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};U.prototype.verify=function(e,t,r,i,n){var a,o=p("../transaction");if(R.isUndefined(r)&&(r=new o),R.isUndefined(i)&&(i=0),R.isUndefined(n)&&(n=0),this.set({script:e,tx:r,nin:i,flags:n}),0!=(n&U.SCRIPT_VERIFY_SIGPUSHONLY)&&!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(!this.evaluate())return!1;n&U.SCRIPT_VERIFY_P2SH&&(a=this.stack.slice());var s=this.stack;if(this.initialize(),this.set({script:t,stack:s,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(0===this.stack.length)return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT");var c=this.stack[this.stack.length-1];if(!U.castToBool(c))return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK");if(n&U.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(0===a.length)throw new Error("internal error - stack copy empty");var u=a[a.length-1],f=z.fromBuffer(u);return a.pop(),this.initialize(),this.set({script:f,stack:a,tx:r,nin:i,flags:n}),!!this.evaluate()&&(0===a.length?!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK"):!!U.castToBool(a[a.length-1])||!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK"))}return!0},(t.exports=U).prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},U.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=void 0!==e.nin?e.nin:this.nin,this.stack=e.stack||this.stack,this.altstack=e.altack||this.altstack,this.pc=void 0!==e.pc?e.pc:this.pc,this.pbegincodehash=void 0!==e.pbegincodehash?e.pbegincodehash:this.pbegincodehash,this.nOpCount=void 0!==e.nOpCount?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=void 0!==e.flags?e.flags:this.flags},U.true=new e([1]),U.false=new e([]),U.MAX_SCRIPT_ELEMENT_SIZE=520,U.LOCKTIME_THRESHOLD_BN=new N(U.LOCKTIME_THRESHOLD=5e8),U.SCRIPT_VERIFY_NONE=0,U.SCRIPT_VERIFY_P2SH=1,U.SCRIPT_VERIFY_STRICTENC=2,U.SCRIPT_VERIFY_DERSIG=4,U.SCRIPT_VERIFY_LOW_S=8,U.SCRIPT_VERIFY_NULLDUMMY=16,U.SCRIPT_VERIFY_SIGPUSHONLY=32,U.SCRIPT_VERIFY_MINIMALDATA=64,U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,U.castToBool=function(e){for(var t=0;t=U.LOCKTIME_THRESHOLD&&e.gte(U.LOCKTIME_THRESHOLD_BN))&&(!e.gt(new N(this.tx.nLockTime))&&!!this.tx.inputs[this.nin].isFinal())},U.prototype.step=function(){var e,t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g,v=0!=(this.flags&U.SCRIPT_VERIFY_MINIMALDATA),b=-1===this.vfExec.indexOf(!1),y=this.script.chunks[this.pc];this.pc++;var _=y.opcodenum;if(R.isUndefined(_))return!(this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE");if(y.buf&&y.buf.length>U.MAX_SCRIPT_ELEMENT_SIZE)return!(this.errstr="SCRIPT_ERR_PUSH_SIZE");if(_>M.OP_16&&201<++this.nOpCount)return!(this.errstr="SCRIPT_ERR_OP_COUNT");if(_===M.OP_CAT||_===M.OP_SUBSTR||_===M.OP_LEFT||_===M.OP_RIGHT||_===M.OP_INVERT||_===M.OP_AND||_===M.OP_OR||_===M.OP_XOR||_===M.OP_2MUL||_===M.OP_2DIV||_===M.OP_MUL||_===M.OP_DIV||_===M.OP_MOD||_===M.OP_LSHIFT||_===M.OP_RSHIFT)return!(this.errstr="SCRIPT_ERR_DISABLED_OPCODE");if(b&&0<=_&&_<=M.OP_PUSHDATA4){if(v&&!this.script.checkMinimalPush(this.pc-1))return!(this.errstr="SCRIPT_ERR_MINIMALDATA");if(y.buf){if(y.len!==y.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(y.buf)}else this.stack.push(U.false)}else if(b||M.OP_IF<=_&&_<=M.OP_ENDIF)switch(_){case M.OP_1NEGATE:case M.OP_1:case M.OP_2:case M.OP_3:case M.OP_4:case M.OP_5:case M.OP_6:case M.OP_7:case M.OP_8:case M.OP_9:case M.OP_10:case M.OP_11:case M.OP_12:case M.OP_13:case M.OP_14:case M.OP_15:case M.OP_16:n=_-(M.OP_1-1),e=new N(n).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_NOP:break;case M.OP_NOP2:case M.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break}if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");var w=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v,5);if(w.lt(new N(0)))return!(this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME");if(!this.checkLockTime(w))return!(this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME");break;case M.OP_NOP1:case M.OP_NOP3:case M.OP_NOP4:case M.OP_NOP5:case M.OP_NOP6:case M.OP_NOP7:case M.OP_NOP8:case M.OP_NOP9:case M.OP_NOP10:if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break;case M.OP_IF:case M.OP_NOTIF:if(m=!1,b){if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");e=this.stack.pop(),m=U.castToBool(e),_===M.OP_NOTIF&&(m=!m)}this.vfExec.push(m);break;case M.OP_ELSE:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case M.OP_ENDIF:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec.pop();break;case M.OP_VERIFY:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],!(m=U.castToBool(e)))return!(this.errstr="SCRIPT_ERR_VERIFY");this.stack.pop();break;case M.OP_RETURN:return!(this.errstr="SCRIPT_ERR_OP_RETURN");case M.OP_TOALTSTACK:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.altstack.push(this.stack.pop());break;case M.OP_FROMALTSTACK:if(this.altstack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION");this.stack.push(this.altstack.pop());break;case M.OP_2DROP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop(),this.stack.pop();break;case M.OP_2DUP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1],this.stack.push(t),this.stack.push(r);break;case M.OP_3DUP:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-3],r=this.stack[this.stack.length-2];var k=this.stack[this.stack.length-1];this.stack.push(t),this.stack.push(r),this.stack.push(k);break;case M.OP_2OVER:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-4],r=this.stack[this.stack.length-3],this.stack.push(t),this.stack.push(r);break;case M.OP_2ROT:if(this.stack.length<6)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-6,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_2SWAP:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-4,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_IFDUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-1],(m=U.castToBool(e))&&this.stack.push(e);break;case M.OP_DEPTH:e=new N(this.stack.length).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_DROP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop();break;case M.OP_DUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-1]);break;case M.OP_NIP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,1);break;case M.OP_OVER:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-2]);break;case M.OP_PICK:case M.OP_ROLL:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],n=(s=N.fromScriptNumBuffer(e,v)).toNumber(),this.stack.pop(),n<0||n>=this.stack.length)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-n-1],_===M.OP_ROLL&&this.stack.splice(this.stack.length-n-1,1),this.stack.push(e);break;case M.OP_ROT:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-3],o=this.stack[this.stack.length-2];var x=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=o,this.stack[this.stack.length-2]=x,this.stack[this.stack.length-1]=a;break;case M.OP_SWAP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-2],o=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=o,this.stack[this.stack.length-1]=a;break;case M.OP_TUCK:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case M.OP_SIZE:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");s=new N(this.stack[this.stack.length-1].length),this.stack.push(s.toScriptNumBuffer());break;case M.OP_EQUAL:case M.OP_EQUALVERIFY:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1];var S=t.toString("hex")===r.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(S?U.true:U.false),_===M.OP_EQUALVERIFY){if(!S)return!(this.errstr="SCRIPT_ERR_EQUALVERIFY");this.stack.pop()}break;case M.OP_1ADD:case M.OP_1SUB:case M.OP_NEGATE:case M.OP_ABS:case M.OP_NOT:case M.OP_0NOTEQUAL:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(e=this.stack[this.stack.length-1],s=N.fromScriptNumBuffer(e,v),_){case M.OP_1ADD:s=s.add(N.One);break;case M.OP_1SUB:s=s.sub(N.One);break;case M.OP_NEGATE:s=s.neg();break;case M.OP_ABS:s.cmp(N.Zero)<0&&(s=s.neg());break;case M.OP_NOT:s=new N((0===s.cmp(N.Zero))+0);break;case M.OP_0NOTEQUAL:s=new N((0!==s.cmp(N.Zero))+0)}this.stack.pop(),this.stack.push(s.toScriptNumBuffer());break;case M.OP_ADD:case M.OP_SUB:case M.OP_BOOLAND:case M.OP_BOOLOR:case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:case M.OP_NUMNOTEQUAL:case M.OP_LESSTHAN:case M.OP_GREATERTHAN:case M.OP_LESSTHANOREQUAL:case M.OP_GREATERTHANOREQUAL:case M.OP_MIN:case M.OP_MAX:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(c=N.fromScriptNumBuffer(this.stack[this.stack.length-2],v),u=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v),s=new N(0),_){case M.OP_ADD:s=c.add(u);break;case M.OP_SUB:s=c.sub(u);break;case M.OP_BOOLAND:s=new N((0!==c.cmp(N.Zero)&&0!==u.cmp(N.Zero))+0);break;case M.OP_BOOLOR:s=new N((0!==c.cmp(N.Zero)||0!==u.cmp(N.Zero))+0);break;case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:s=new N((0===c.cmp(u))+0);break;case M.OP_NUMNOTEQUAL:s=new N((0!==c.cmp(u))+0);break;case M.OP_LESSTHAN:s=new N((c.cmp(u)<0)+0);break;case M.OP_GREATERTHAN:s=new N((0"},v.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==c.OP_DUP||this.chunks[1].opcodenum!==c.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==c.OP_EQUALVERIFY||this.chunks[4].opcodenum!==c.OP_CHECKSIG)},v.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&48===e[0]&&t&&t.length){var r=t[0];if((4===r||6===r||7===r)&&65===t.length)return!0;if((3===r||2===r)&&33===t.length)return!0}}return!1},v.prototype.getPublicKey=function(){return p.checkState(this.isPublicKeyOut(),"Can't retreive PublicKey from a non-PK output"),this.chunks[0].buf},v.prototype.getPublicKeyHash=function(){return p.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},v.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===c.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if((4!==t&&6!==t&&7!==t||65!==e.length)&&(3!==t&&2!==t||33!==e.length)||(r=!0),r)return u.isValid(e)}return!1},v.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var e=this.chunks[0].buf;if(e&&e.length&&48===e[0])return!0}return!1},v.prototype.isScriptHashOut=function(){var e=this.toBuffer();return 23===e.length&&e[0]===c.OP_HASH160&&20===e[1]&&e[e.length-1]===c.OP_EQUAL},v.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e,t=this.chunks[this.chunks.length-1].buf;if(!t)return!1;try{e=v.fromBuffer(t)}catch(e){if(e instanceof l.Script.InvalidBuffer)return!1;throw e}return e.classify()!==v.types.UNKNOWN},v.prototype.isMultisigOut=function(){return 3=c.OP_1&&e<=c.OP_16)return e-(c.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))},v.prototype.getSignatureOperationsCount=function(r){r=!!h.isUndefined(r)||r;var i=this,n=0,a=c.OP_INVALIDOPCODE;return h.each(i.chunks,function(e){var t=e.opcodenum;t==c.OP_CHECKSIG||t==c.OP_CHECKSIGVERIFY?n++:t!=c.OP_CHECKMULTISIG&&t!=c.OP_CHECKMULTISIGVERIFY||(r&&a>=c.OP_1&&a<=c.OP_16?n+=i._decodeOP_N(a):n+=20),a=t}),n},t.exports=v}).call(this,e("buffer").Buffer)},{"../address":79,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../networks":100,"../opcode":101,"../publickey":103,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],107:[function(e,t,r){t.exports=e("./transaction"),t.exports.Input=e("./input"),t.exports.Output=e("./output"),t.exports.UnspentOutput=e("./unspentoutput"),t.exports.Signature=e("./signature"),t.exports.Sighash=e("./sighash")},{"./input":108,"./output":114,"./sighash":115,"./signature":116,"./transaction":117,"./unspentoutput":118}],108:[function(e,t,r){t.exports=e("./input"),t.exports.PublicKey=e("./publickey"),t.exports.PublicKeyHash=e("./publickeyhash"),t.exports.MultiSig=e("./multisig.js"),t.exports.MultiSigScriptHash=e("./multisigscripthash.js")},{"./input":109,"./multisig.js":110,"./multisigscripthash.js":111,"./publickey":112,"./publickeyhash":113}],109:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../../util/preconditions"),a=e("../../errors"),o=e("../../encoding/bufferwriter"),s=e("buffer"),c=e("../../util/buffer"),u=e("../../util/js"),f=e("../../script"),p=e("../sighash"),h=e("../output"),l=4294967295;function d(e){return this instanceof d?e?this._fromObject(e):void 0:new d(e)}d.MAXINT=l,d.DEFAULT_SEQNUMBER=4294967295,d.DEFAULT_LOCKTIME_SEQNUMBER=4294967294,d.DEFAULT_RBF_SEQNUMBER=4294967293,Object.defineProperty(d.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new f(this._scriptBuffer),this._script._isInput=!0),this._script)}}),d.fromObject=function(e){return n.checkArgument(i.isObject(e)),(new d)._fromObject(e)},d.prototype._fromObject=function(e){var t;if(t=i.isString(e.prevTxId)&&u.isHexa(e.prevTxId)?new s.Buffer(e.prevTxId,"hex"):e.prevTxId,this.output=e.output?e.output instanceof h?e.output:new h(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=i.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=i.isUndefined(e.sequenceNumber)?i.isUndefined(e.seqnum)?4294967295:e.seqnum:e.sequenceNumber,i.isUndefined(e.script)&&i.isUndefined(e.scriptBuffer))throw new a.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this},d.prototype.toObject=d.prototype.toJSON=function(){var e={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(e.scriptString=this.script.toString()),this.output&&(e.output=this.output.toObject()),e},d.fromBufferReader=function(e){var t=new d;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t},d.prototype.toBufferWriter=function(e){e||(e=new o),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e},d.prototype.setScript=function(e){if(this._script=null,e instanceof f)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(u.isHexa(e))this._scriptBuffer=new s.Buffer(e,"hex");else if(i.isString(e))this._script=new f(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!c.isBuffer(e))throw new TypeError("Invalid argument type: script");this._scriptBuffer=new s.Buffer(e)}return this},d.prototype.getSignatures=function(){throw new a.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},d.prototype.isFullySigned=function(){throw new a.AbstractMethodInvoked("Input#isFullySigned")},d.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},d.prototype.addSignature=function(){throw new a.AbstractMethodInvoked("Input#addSignature")},d.prototype.clearSignatures=function(){throw new a.AbstractMethodInvoked("Input#clearSignatures")},d.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},d.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},d.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},t.exports=d},{"../../encoding/bufferwriter":93,"../../errors":95,"../../script":104,"../../util/buffer":121,"../../util/js":122,"../../util/preconditions":123,"../output":114,"../sighash":115,buffer:191,lodash:149}],110:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=(e("../transaction"),e("./input")),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),u.checkState(o.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.output.script),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},l.normalizeSignatures=function(n,a,o,e,t){return t.map(function(r){var i=null;return e=e.filter(function(e){if(i)return!0;var t=new h({signature:f.fromTxFormat(e),publicKey:r,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:o,sigtype:f.SIGHASH_ALL});return t.signature.nhashtype=t.sigtype,!p.verify(n,t.signature,t.publicKey,t.inputIndex,a.output.script)||(i=t,!1)}),i||null})},l.OPCODES_SIZE=1,l.SIGNATURE_SIZE=73,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"../transaction":117,"./input":109,inherits:148,lodash:149}],111:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=e("./input"),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),this.redeemScript=o.buildMultisigOut(this.publicKeys,r),u.checkState(o.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.redeemScript),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript)},l.OPCODES_SIZE=7,l.SIGNATURE_SIZE=74,l.PUBKEY_SIZE=34,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE+this.publicKeys.length*l.PUBKEY_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148,lodash:149}],112:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),n=(e("../../util/buffer"),e("./input")),o=e("../output"),s=e("../sighash"),c=e("../../script"),u=e("../../crypto/signature"),f=e("../signature");function p(){n.apply(this,arguments)}i(p,n),p.prototype.getSignatures=function(e,t,r,i){a.checkState(this.output instanceof o),i=i||u.SIGHASH_ALL;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new f({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:s.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},p.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(c.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this},p.prototype.clearSignatures=function(){return this.setScript(c.empty()),this},p.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},p.SCRIPT_MAX_SIZE=73,p.prototype._estimateSize=function(){return p.SCRIPT_MAX_SIZE},t.exports=p},{"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],113:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),o=e("../../util/buffer"),s=e("../../crypto/hash"),n=e("./input"),c=e("../output"),u=e("../sighash"),f=e("../../script"),p=e("../../crypto/signature"),h=e("../signature");function l(){n.apply(this,arguments)}i(l,n),l.prototype.getSignatures=function(e,t,r,i,n){return a.checkState(this.output instanceof c),n=n||s.sha256ripemd160(t.publicKey.toBuffer()),i=i||p.SIGHASH_ALL,o.equals(n,this.output.script.getPublicKeyHash())?[new h({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:u.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},l.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(f.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this},l.prototype.clearSignatures=function(){return this.setScript(f.empty()),this},l.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()},l.SCRIPT_MAX_SIZE=107,l.prototype._estimateSize=function(){return l.SCRIPT_MAX_SIZE},t.exports=l},{"../../crypto/hash":86,"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],114:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../crypto/bn"),a=e("buffer"),o=e("../util/buffer"),s=e("../util/js"),c=e("../encoding/bufferwriter"),u=e("../script"),f=e("../util/preconditions"),p=e("../errors");function h(e){if(!(this instanceof h))return new h(e);if(!i.isObject(e))throw new TypeError("Unrecognized argument for Output");var t;this.satoshis=e.satoshis,o.isBuffer(e.script)?this._scriptBuffer=e.script:(t=i.isString(e.script)&&s.isHexa(e.script)?new a.Buffer(e.script,"hex"):e.script,this.setScript(t))}Object.defineProperty(h.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script||this.setScriptFromBuffer(this._scriptBuffer),this._script}}),Object.defineProperty(h.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof n?(this._satoshisBN=e,this._satoshis=e.toNumber()):i.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=n.fromNumber(this._satoshis)):(f.checkArgument(s.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=n.fromNumber(e),this._satoshis=e),f.checkState(s.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),h.prototype.invalidSatoshis=function(){return 9007199254740991"},h.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return t.script=0!==r?e.read(r):new a.Buffer([]),new h(t)},h.prototype.toBufferWriter=function(e){e||(e=new c),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e},t.exports=h},{"../crypto/bn":84,"../encoding/bufferwriter":93,"../errors":95,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],115:[function(y,e,t){(function(f){"use strict";var p=y("buffer"),h=y("../crypto/signature"),l=y("../script"),d=y("./output"),m=y("../encoding/bufferreader"),g=y("../encoding/bufferwriter"),v=y("../crypto/bn"),b=y("../crypto/hash"),o=y("../crypto/ecdsa"),s=y("../util/preconditions"),c=y("lodash"),u=function(e,t,r,i){var n,a=y("./transaction"),o=y("./input"),s=a.shallowCopy(e);for((i=new l(i)).removeCodeseparators(),n=0;n=s.outputs.length)return new f("0000000000000000000000000000000000000000000000000000000000000001","hex");for(s.outputs.length=r+1,n=0;n"},S.prototype.toBuffer=function(){var e=new u;return this.toBufferWriter(e).toBuffer()},S.prototype.toBufferWriter=function(t){return t.writeUInt32LE(this.version),t.writeVarintNum(this.inputs.length),s.each(this.inputs,function(e){e.toBufferWriter(t)}),t.writeVarintNum(this.outputs.length),s.each(this.outputs,function(e){e.toBufferWriter(t)}),t.writeUInt32LE(this.nLockTime),t},S.prototype.fromBuffer=function(e){var t=new c(e);return this.fromBufferReader(t)},S.prototype.fromBufferReader=function(e){var t,r,i;for(a.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readUInt32LE(),r=e.readVarintNum(),t=0;t=this.inputs.length)throw new n.Transaction.InvalidIndex(e,this.inputs.length);var i=this.inputs[e];this.inputs=s.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()},S.prototype.sign=function(e,t){a.checkState(this.hasAllUtxoInfo());var r=this;return s.isArray(e)?s.each(e,function(e){r.sign(e,t)}):s.each(this.getSignatures(e,t),function(e){r.applySignature(e)}),this},S.prototype.getSignatures=function(r,i){r=new k(r),i=i||p.SIGHASH_ALL;var n=this,a=[],o=f.sha256ripemd160(r.publicKey.toBuffer());return s.each(this.inputs,function(e,t){s.each(e.getSignatures(n,r,t,i,o),function(e){a.push(e)})}),a},S.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this},S.prototype.isFullySigned=function(){return s.each(this.inputs,function(e){if(e.isFullySigned===m.prototype.isFullySigned)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),s.all(s.map(this.inputs,function(e){return e.isFullySigned()}))},S.prototype.isValidSignature=function(e){if(this.inputs[e.inputIndex].isValidSignature===m.prototype.isValidSignature)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e)},S.prototype.verifySignature=function(e,t,r,i){return h.verify(this,e,t,r,i)},S.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var e=new x(0),t=0;t=m.MAXINT-1&&(t.sequenceNumber=m.DEFAULT_RBF_SEQNUMBER)}return this},I.exports=S}).call(this,A("buffer").Buffer)},{"../address":79,"../crypto/bn":84,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../privatekey":102,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"./input":108,"./output":114,"./sighash":115,"./unspentoutput":118,buffer:191,"buffer-compare":126,lodash:149}],118:[function(e,t,r){"use strict";var o=e("lodash"),s=e("../util/preconditions"),c=e("../util/js"),u=e("../script"),f=e("../address"),p=e("../unit");function h(e){if(!(this instanceof h))return new h(e);s.checkArgument(o.isObject(e),"Must provide an object from where to extract data");var t=e.address?new f(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!c.isHexaString(r)||64"},h.prototype.toString=function(){return this.txId+":"+this.outputIndex},h.fromObject=function(e){return new h(e)},h.prototype.toObject=h.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:p.fromSatoshis(this.satoshis).toBTC()}},t.exports=h},{"../address":79,"../script":104,"../unit":119,"../util/js":122,"../util/preconditions":123,lodash:149}],119:[function(e,t,r){"use strict";var i=e("lodash"),n=e("./errors"),a=e("./util/preconditions"),o={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function s(e,t){if(!(this instanceof s))return new s(e,t);if(i.isNumber(t)){if(t<=0)throw new n.Unit.InvalidRate(t);e/=t,t=s.BTC}this._value=this._from(e,t);var r=this;Object.keys(o).forEach(function(e){Object.defineProperty(r,e,{get:function(){return r.to(e)},enumerable:!0})})}Object.keys(o).forEach(function(e){s[e]=e}),s.fromObject=function(e){return a.checkArgument(i.isObject(e),"Argument is expected to be an object"),new s(e.amount,e.code)},s.fromBTC=function(e){return new s(e,s.BTC)},s.fromMillis=s.fromMilis=function(e){return new s(e,s.mBTC)},s.fromMicros=s.fromBits=function(e){return new s(e,s.bits)},s.fromSatoshis=function(e){return new s(e,s.satoshis)},s.fromFiat=function(e,t){return new s(e,t)},s.prototype._from=function(e,t){if(!o[t])throw new n.Unit.UnknownCode(t);return parseInt((e*o[t][0]).toFixed())},s.prototype.to=function(e){if(i.isNumber(e)){if(e<=0)throw new n.Unit.InvalidRate(e);return parseFloat((this.BTC*e).toFixed(2))}if(!o[e])throw new n.Unit.UnknownCode(e);var t=this._value/o[e][0];return parseFloat(t.toFixed(o[e][1]))},s.prototype.toBTC=function(){return this.to(s.BTC)},s.prototype.toMillis=s.prototype.toMilis=function(){return this.to(s.mBTC)},s.prototype.toMicros=s.prototype.toBits=function(){return this.to(s.bits)},s.prototype.toSatoshis=function(){return this.to(s.satoshis)},s.prototype.atRate=function(e){return this.to(e)},s.prototype.toString=function(){return this.satoshis+" satoshis"},s.prototype.toObject=s.prototype.toJSON=function(){return{amount:this.BTC,code:s.BTC}},s.prototype.inspect=function(){return""},t.exports=s},{"./errors":95,"./util/preconditions":123,lodash:149}],120:[function(e,t,r){"use strict";var i=e("lodash"),n=e("url"),a=e("./address"),o=e("./unit"),s=function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.extras={},this.knownParams=r||[],this.address=this.network=this.amount=this.message=null,"string"==typeof t){var i=e.parse(t);i.amount&&(i.amount=this._parseAmount(i.amount)),this._fromObject(i)}else{if("object"!==(void 0===t?"undefined":_typeof(t)))throw new TypeError("Unrecognized data format.");this._fromObject(t)}};s.fromString=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return new s(e)},s.fromObject=function(e){return new s(e)},s.isValid=function(e,t){try{new s(e,t)}catch(e){return!1}return!0},s.parse=function(e){var t=n.parse(e,!0);if("bitcoin:"!==t.protocol)throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(e);return t.query.address=r&&r[1]||void 0,t.query},s.Members=["address","amount","message","label","r"],s.prototype._fromObject=function(e){if(!a.isValid(e.address))throw new TypeError("Invalid bitcoin address");for(var t in this.address=new a(e.address),this.network=this.address.network,this.amount=e.amount,e)if("address"!==t&&"amount"!==t){if(/^req-/.exec(t)&&-1===this.knownParams.indexOf(t))throw Error("Unknown required argument "+t);(-1"},t.exports=s},{"./address":79,"./unit":119,lodash:149,url:500}],121:[function(o,s,e){(function(r){"use strict";var i=o("buffer"),t=o("assert"),n=o("./js"),a=o("./preconditions");function e(e,t){if(e.length!==t.length)return!1;for(var r=e.length,i=0;i>24&255),t.push(e>>16&255),t.push(e>>8&255),t.push(255&e),new r(t)},integerFromBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]<<24|e[1]<<16|e[2]<<8|e[3]},integerFromSingleByteBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]},bufferToHex:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e.toString("hex")},reverse:function(e){for(var t=new i.Buffer(e.length),r=0;r>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}}else if("le"===r)for(i=0,a=0;i>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-i&4194303,26<=(i+=24)&&(i-=26,n++)}if(r+6!==t){a=o(e,t,r+6);this.words[n]|=a<>>26-i&4194303}this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];v.prototype.toString=function(e,t){if(16===(e=e||10)||"hex"===e){for(var r="",i=0,n=(t=0|t||1,0),a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return this.sign&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var c=l[e],u=d[e],f=(r="",this.clone());for(f.sign=!1;0!==f.cmpn(0);){var p=f.modn(u).toString(e);r=0!==(f=f.idivn(u)).cmpn(0)?h[c-p.length]+p+r:p+r}return 0===this.cmpn(0)&&(r="0"+r),this.sign&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.prototype.toJSON=function(){return this.toString(16)},v.prototype.toArray=function(){this.strip();var e=new Array(this.byteLength());e[0]=0;for(var t=this.clone(),r=0;0!==t.cmpn(0);r++){var i=t.andln(255);t.ishrn(8),e[e.length-r-1]=i}return e},v.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return 4096<=t&&(r+=13,t>>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.iand=function(e){var t;this.sign=this.sign&&e.sign,t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},v.prototype.ixor=function(e){var t,r;this.sign=this.sign||e.sign,r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);for(var r=e/26|0,i=e%26;this.length<=r;)this.words[this.length++]=0;return this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,a=0;a>>26}for(;0!==n&&a>>26}if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this);this.sign=!1;t=e.sub(this);return this.sign=!0,t},v.prototype.isub=function(e){if(e.sign){e.sign=!1;var t=this.iadd(e);return e.sign=!0,t._normSign()}if(this.sign)return this.sign=!1,this.iadd(e),this.sign=!0,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.sign=!1,this.length=1,this.words[0]=0,this;i=0>26,this.words[o]=67108863&t}for(;0!==a&&o>26,this.words[o]=67108863&t}if(0===a&&o>>26,a=67108863&r,o=Math.min(i,e.length-1),s=Math.max(0,i-this.length+1);s<=o;s++){var c=i-s,u=(0|this.words[c])*(0|e.words[s]),f=67108863&u;a=67108863&(f=f+a|0),n=(n=n+(u/67108864|0)|0)+(f>>>26)|0}t.words[i]=a,r=n}return 0!==r?t.words[i]=r:t.length--,t.strip()},v.prototype._bigMulTo=function(e,t){t.sign=e.sign!==this.sign,t.length=this.length+e.length;for(var r=0,i=0,n=0;n>>26)|0)>>>26,a&=67108863}t.words[n]=o,r=a,a=i}return 0!==r?t.words[n]=r:t.length--,t.strip()},v.prototype.mulTo=function(e,t){return this.length+e.length<63?this._smallMulTo(e,t):this._bigMulTo(e,t)},v.prototype.mul=function(e){var t=new v(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},v.prototype.imul=function(e){if(0===this.cmpn(0)||0===e.cmpn(0))return this.words[0]=0,this.length=1,this;var t=this.length,r=e.length;this.sign=e.sign!==this.sign,this.length=this.length+e.length,this.words[this.length-1]=0;for(var i=this.length-2;0<=i;i--){for(var n=0,a=0,o=Math.min(i,r-1),s=Math.max(0,i-t+1);s<=o;s++){var c=i-s,u=this.words[c]*e.words[s],f=67108863&u;n+=u/67108864|0,a=67108863&(f+=a),n+=f>>>26}this.words[i]=a,this.words[i+1]+=n,n=0}for(n=0,c=1;c>>26}return this.strip()},v.prototype.imuln=function(e){g("number"==typeof e);for(var t=0,r=0;r>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.mul(this)},v.prototype.ishln=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){for(var n=0,a=0;a>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;a>>n<a){this.length-=a;for(c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(c/67108864|0),this.words[a+r]=67108863&s}for(;a>26,this.words[a+r]=67108863&s}if(0===o)return this.strip();g(-1===o);for(a=o=0;a>26,this.words[a]=67108863&s}return this.sign=!0,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.shln(r),i.ishln(r),a=n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var n;i=this.divmod(e.neg(),t);return"mod"!==t&&(n=i.div.neg()),{div:n,mod:i.mod}},v.prototype.div=function(e){return this.divmod(e,"div").div},v.prototype.mod=function(e){return this.divmod(e,"mod").mod},v.prototype.divRound=function(e){var t=this.divmod(e);if(0===t.mod.cmpn(0))return t.div;var r=t.div.sign?t.mod.isub(e):t.mod,i=e.shrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:t.div.sign?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+this.words[i])%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=this.words[r]+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.ishrn(1),r.ishrn(1),++s;for(var c=r.clone(),u=t.clone();0!==t.cmpn(0);){for(;t.isEven();)t.ishrn(1),i.isEven()&&n.isEven()?(i.ishrn(1),n.ishrn(1)):(i.iadd(c).ishrn(1),n.isub(u).ishrn(1));for(;r.isEven();)r.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(u).ishrn(1));0<=t.cmp(r)?(t.isub(r),i.isub(a),n.isub(o)):(r.isub(t),a.isub(i),o.isub(n))}return{a:a,b:o,gcd:r.ishln(s)}},v.prototype._invmp=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=r.clone();0>>26,o&=67108863,this.words[n]=o}return 0!==a&&(this.words[n]=a,this.length++),this},v.prototype.cmpn=function(e){var t,r=e<0;if(r&&(e=-e),this.sign&&!r)return-1;if(!this.sign&&r)return 1;if(e&=67108863,this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}e.words[i-10]=n>>>22,e.length-=9},a.prototype.imulK=function(e){var t;e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(i[e])return i[e];var t;if("k256"===e)t=new a;else if("p224"===e)t=new s;else if("p192"===e)t=new c;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new u}return i[e]=t},f.prototype._verify1=function(e){g(!e.sign,"red works only with positives"),g(e.red,"red works only with red numbers")},f.prototype._verify2=function(e,t){g(!e.sign&&!t.sign,"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},f.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.mod(this.m)._forceRed(this)},f.prototype.neg=function(e){var t=e.clone();return t.sign=!t.sign,t.iadd(this.m)._forceRed(this)},f.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},f.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},f.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)},f.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.shln(t))},f.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},f.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},f.prototype.isqr=function(e){return this.imul(e,e)},f.prototype.sqr=function(e){return this.mul(e,e)},f.prototype.sqrt=function(e){if(0===e.cmpn(0))return e.clone();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).ishrn(2);return f=this.pow(e,r)}for(var i=this.m.subn(1),n=0;0!==i.cmpn(0)&&0===i.andln(1);)n++,i.ishrn(1);g(0!==i.cmpn(0));var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).ishrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).ishrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>8,i[r]&=255;for(;a;)i.push(255&a),a>>=8}for(t=0;"1"===e[t]&&tt[i]?1:0);++i);return 0==r&&(t.length>e.length?r=-1:e.length>t.length&&(r=1)),r}},{}],127:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.hmacDRBG=e("./elliptic/hmac-drbg"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec")},{"../package.json":147,"./elliptic/curve":130,"./elliptic/curves":133,"./elliptic/ec":134,"./elliptic/hmac-drbg":137,"./elliptic/utils":139,brorand:140}],128:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic"),S=n.utils.getNAF,j=n.utils.getJSF,u=n.utils.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function o(e,t){this.curve=e,this.type=t,this.precomputed=null}(t.exports=a).prototype.point=function(){throw new Error("Not implemented")},a.prototype.validate=function(){throw new Error("Not implemented")},a.prototype._fixedNafMul=function(e,t){var r=e._getDoubles(),i=S(t,1),n=(1<>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i){for(var n=this._wnafT1,a=this._wnafT2,o=this._wnafT3,s=0,c=0;c>1]:x<0&&(k=a[m][-x-1>>1].neg()),b="affine"===k.type?b.mixedAdd(k):b.add(k))}}for(c=0;c":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],130:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":128,"./edwards":129,"./mont":131,"./short":132}],131:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base;function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(s,o),(t.exports=s).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)},a(c,o.BasePoint),s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.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)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.ishrn(1))n.push(t.andln(1));for(var a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../curve":130,"bn.js":124,inherits:148}],132:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.shrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.sign&&(i=i.neg(),n=n.neg()),a.sign&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(t=new w(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b).redSqrt(),i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},c.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)},c.prototype._endoWnafMulAdd=function(e,t){for(var r=this._endoWnafT1,i=this._endoWnafT2,n=0;n":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],133:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":127,"./precomputed/secp256k1":138,"hash.js":141}],134:[function(e,t,r){"use strict";var d=e("bn.js"),m=e("../../elliptic"),i=m.utils.assert,n=e("./key"),g=e("./signature");function a(e){if(!(this instanceof a))return new a(e);"string"==typeof e&&(i(m.curves.hasOwnProperty(e),"Unknown curve "+e),e=m.curves[e]),e instanceof m.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(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}(t.exports=a).prototype.keyPair=function(e){return new n(this,e)},a.prototype.keyFromPrivate=function(e,t){return n.fromPrivate(this,e,t)},a.prototype.keyFromPublic=function(e,t){return n.fromPublic(this,e,t)},a.prototype.genKeyPair=function(e){e||(e={});for(var t=new m.hmacDRBG({hash:this.hash,pers:e.pers,entropy:e.entropy||m.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new d(2));;){var n=new d(t.generate(r));if(!(0"}},{"../../elliptic":127,"bn.js":124}],136:[function(e,t,r){"use strict";var n=e("bn.js"),a=e("../../elliptic").utils,i=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16))}(t.exports=o).prototype._importDER=function(e,t){if((e=a.toArray(e,t)).length<6||48!==e[0]||2!==e[2])return!1;if(1+e[1]>e.length)return!1;var r=e[3];if(128<=r)return!1;if(4+r+2>=e.length)return!1;if(2!==e[4+r])return!1;var i=e[5+r];return!(128<=i)&&(!(4+r+2+i>e.length)&&(this.r=new n(e.slice(4,4+r)),this.s=new n(e.slice(4+r+2,4+r+2+i)),!0))},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r));var i=[48,t.length+r.length+4,2,t.length];return i=i.concat(t,[2,r.length],r),a.encode(i,e)}},{"../../elliptic":127,"bn.js":124}],137:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("../elliptic").utils,n=o.assert;function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc),r=o.toArray(e.nonce,e.nonceEnc),i=o.toArray(e.pers,e.persEnc);n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this.reseed=1},a.prototype.generate=function(e,t,r,i){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i),this._update(r));for(var n=[];n.length>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e},i.getNAF=function(e,t){for(var r=[],i=1<>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=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=n.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{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;for(a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>10),n[a-7],(r=n[a-15],b(r,7)^b(r,18)^r>>>3),n[a-16]);var o,s,c=this.h[0],u=this.h[1],f=this.h[2],p=this.h[3],h=this.h[4],l=this.h[5],d=this.h[6],m=this.h[7];F(this.k.length===n.length);for(a=0;a>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function s(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}function u(e,t){if(!e)throw new Error(t||"Assertion failed")}i.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},i.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,r){return e+t+r>>>0},i.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},i.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},i.assert=u,i.inherits=n,r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:148}],147:[function(e,t,r){t.exports={_args:[["elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib"]],_from:"elliptic@=3.0.3",_id:"elliptic@3.0.3",_inCache:!0,_location:"/bitcore-lib/elliptic",_phantomChildren:{inherits:"2.0.1"},_requested:{name:"elliptic",raw:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",rawSpec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",scope:null,spec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",type:"remote"},_requiredBy:["/bitcore-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_shasum:"865c9b420bfbe55006b9f969f97a0d2c44966595",_shrinkwrap:null,_spec:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_where:"/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^2.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},description:"EC cryptography",devDependencies:{browserify:"^3.44.2",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",optionalDependencies:{},readme:"# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic)\n\nFast elliptic-curve cryptography in a plain javascript implementation.\n\nNOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve\nfor your cryptography operations.\n\n## Incentive\n\nECC is much slower than regular RSA cryptography, the JS implementations are\neven more slower.\n\n## Benchmarks\n\n```bash\n$ node benchmarks/index.js\nBenchmarking: sign\nelliptic#sign x 262 ops/sec ±0.51% (177 runs sampled)\neccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled)\n------------------------\nFastest is elliptic#sign\n========================\nBenchmarking: verify\nelliptic#verify x 113 ops/sec ±0.50% (166 runs sampled)\neccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled)\n------------------------\nFastest is elliptic#verify\n========================\nBenchmarking: gen\nelliptic#gen x 294 ops/sec ±0.43% (176 runs sampled)\neccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled)\n------------------------\nFastest is elliptic#gen\n========================\nBenchmarking: ecdh\nelliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled)\n------------------------\nFastest is elliptic#ecdh\n========================\n```\n\n## API\n\n### ECDSA\n\n```javascript\nvar EC = require('elliptic').ec;\n\n// Create and initialize EC context\n// (better do it once and reuse it)\nvar ec = new EC('secp256k1');\n\n// Generate keys\nvar key = ec.genKeyPair();\n\n// Sign message (must be an array, or it'll be treated as a hex sequence)\nvar msg = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];\nvar signature = key.sign(msg);\n\n// Export DER encoded signature in Array\nvar derSign = signature.toDER();\n\n// Verify signature\nconsole.log(key.verify(msg, derSign));\n```\n\n### ECDH\n\n```javascript\n// Generate keys\nvar key1 = ec.genKeyPair();\nvar key2 = ec.genKeyPair();\n\nvar shared1 = key1.derive(key2.getPublic());\nvar shared2 = key2.derive(key1.getPublic());\n\nconsole.log('Both shared secrets are BN instances');\nconsole.log(shared1.toString(16));\nconsole.log(shared2.toString(16));\n```\n\nNOTE: `.derive()` returns a [BN][1] instance.\n\n## Supported curves\n\nElliptic.js support following curve types:\n\n* Short Weierstrass\n* Montgomery\n* Edwards\n* Twisted Edwards\n\nFollowing curve 'presets' are embedded into the library:\n\n* `secp256k1`\n* `p192`\n* `p224`\n* `p256`\n* `curve25519`\n* `ed25519`\n\nNOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead.\n\n### Implementation details\n\nECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of\nthe curve operations are performed on non-affine coordinates (either projective\nor extended), various windowing techniques are used for different cases.\n\nAll operations are performed in reduction context using [bn.js][1], hashing is\nprovided by [hash.js][2]\n\n### Related projects\n\n* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both\n browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for\n node)\n\n#### LICENSE\n\nThis software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2014.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://tools.ietf.org/html/rfc6979\n[1]: https://github.com/indutny/bn.js\n[2]: https://github.com/indutny/hash.js\n[3]: https://github.com/bitchan/eccrypto\n[4]: https://github.com/wanderer/secp256k1-node\n",readmeFilename:"README.md",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{test:"make lint && mocha --reporter=spec test/*-test.js"},version:"3.0.3"}},{}],148:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{dup:68}],149:[function(e,y,_){(function(b){(function(){var dn,e,t,mn="3.10.1",gn=1,vn=2,bn=4,yn=8,_n=16,wn=32,kn=64,xn=128,Sn=256,jn=30,En="...",An=150,In=16,Pn=200,On=1,Tn=2,Bn="Expected a function",Cn="__lodash_placeholder__",Fn="[object Arguments]",Rn="[object Array]",zn="[object Boolean]",Mn="[object Date]",Nn="[object Error]",Dn="[object Function]",r="[object Map]",qn="[object Number]",Ln="[object Object]",Un="[object RegExp]",i="[object Set]",Hn="[object String]",n="[object WeakMap]",Kn="[object ArrayBuffer]",Vn="[object Float32Array]",Gn="[object Float64Array]",$n="[object Int8Array]",Wn="[object Int16Array]",Zn="[object Int32Array]",Yn="[object Uint8Array]",Xn="[object Uint8ClampedArray]",Jn="[object Uint16Array]",Qn="[object Uint32Array]",ea=/\b__p \+= '';/g,ta=/\b(__p \+=) '' \+/g,ra=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ia=/&(?:amp|lt|gt|quot|#39|#96);/g,na=/[&<>"'`]/g,aa=RegExp(ia.source),oa=RegExp(na.source),sa=/<%-([\s\S]+?)%>/g,ca=/<%([\s\S]+?)%>/g,ua=/<%=([\s\S]+?)%>/g,fa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,pa=/^\w*$/,ha=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,la=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,da=RegExp(la.source),ma=/[\u0300-\u036f\ufe20-\ufe23]/g,ga=/\\(\\)?/g,va=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ba=/\w*$/,ya=/^0[xX]/,_a=/^\[object .+?Constructor\]$/,wa=/^\d+$/,ka=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xa=/($^)/,Sa=/['\n\r\u2028\u2029\\]/g,ja=(e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",t="[a-z\\xdf-\\xf6\\xf8-\\xff]+",RegExp(e+"+(?="+e+t+")|"+e+"?"+t+"|"+e+"+|[0-9]+","g")),Ea=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Aa=-1,Ia={};Ia[Vn]=Ia[Gn]=Ia[$n]=Ia[Wn]=Ia[Zn]=Ia[Yn]=Ia[Xn]=Ia[Jn]=Ia[Qn]=!0,Ia[Fn]=Ia[Rn]=Ia[Kn]=Ia[zn]=Ia[Mn]=Ia[Nn]=Ia[Dn]=Ia[r]=Ia[qn]=Ia[Ln]=Ia[Un]=Ia[i]=Ia[Hn]=Ia[n]=!1;var Pa={};Pa[Fn]=Pa[Rn]=Pa[Kn]=Pa[zn]=Pa[Mn]=Pa[Vn]=Pa[Gn]=Pa[$n]=Pa[Wn]=Pa[Zn]=Pa[qn]=Pa[Ln]=Pa[Un]=Pa[Hn]=Pa[Yn]=Pa[Xn]=Pa[Jn]=Pa[Qn]=!0,Pa[Nn]=Pa[Dn]=Pa[r]=Pa[i]=Pa[n]=!1;var a={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},o={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},s={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},c={function:!0,object:!0},u={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},f={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},p=c[void 0===_?"undefined":_typeof(_)]&&_&&!_.nodeType&&_,h=c[void 0===y?"undefined":_typeof(y)]&&y&&!y.nodeType&&y,l=p&&h&&"object"==(void 0===b?"undefined":_typeof(b))&&b&&b.Object&&b,d=c["undefined"==typeof self?"undefined":_typeof(self)]&&self&&self.Object&&self,m=c["undefined"==typeof window?"undefined":_typeof(window)]&&window&&window.Object&&window,g=h&&h.exports===p&&p,Oa=l||m!==(this&&this.window)&&m||d||this;function Ta(e,t){if(e!==t){var r=null===e,i=e===dn,n=e==e,a=null===t,o=t===dn,s=t==t;if(t>>1,$=9007199254740991,W=O&&new O,Z={};function Y(e){if(Ka(e)&&!ui(e)&&!(e instanceof Q)){if(e instanceof J)return e;if(_.call(e,"__chain__")&&_.call(e,"__wrapped__"))return Qt(e)}return new J(e)}function X(){}function J(e,t,r){this.__wrapped__=e,this.__actions__=r||[],this.__chain__=!!t}Y.support={};function Q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function ee(){this.__data__={}}function te(e){var t=e?e.length:0;for(this.data={hash:B(null),set:new j};t--;)this.push(e[t])}function re(e,t){var r=e.data;return("string"==typeof t||li(t)?r.set.has(t):r.hash[t])?0:-1}function ie(e,t){var r=-1,i=e.length;for(t||(t=P(i));++r=Pn?st(t):null,c=t.length;s&&(a=re,o=!1,t=s);e:for(;++n>>0,t>>>=0;for(var a=P(n);++i>>1,o=e[a];(r?o<=t:o=Pn)return n.plant(t).value();for(var r=0,i=a?o[r].apply(this,e):t;++r=An)return e}else Gt=0;return Ue(e,t)});function Zt(e){for(var t=Ri(e),r=t.length,i=r&&e.length,n=!!i&&Ut(i)&&(ui(e)||ci(e)),a=-1,o=[];++a>>0,r>>>=0;r=N(t,r)&&e=(e=Ra(e)).length)return e;var o=i-n.length;if(o<1)return n;var s=e.slice(0,o);if(null==a)return s+n;if(vi(a)){if(e.slice(o).search(a)){var c,u,f=e.slice(0,o);for(a.global||(a=b(a.source,(ba.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(f);)u=c.index;s=s.slice(0,null==u?o:u)}}else if(e.indexOf(a,o)!=o){var p=s.lastIndexOf(a);-1=0.13.7 <0.14.0",_id:"bitcore-lib@0.13.19",_inCache:!0,_installable:!0,_location:"/bitcore-lib",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/bitcore-lib-0.13.19.tgz_1470850061596_0.2146058666985482"},_npmUser:{email:"braydon@bitpay.com",name:"braydonf"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{name:"bitcore-lib",raw:"bitcore-lib@^0.13.7",rawSpec:"^0.13.7",scope:null,spec:">=0.13.7 <0.14.0",type:"range"},_requiredBy:["/","/bitcore-message"],_resolved:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz",_shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",_shrinkwrap:{dependencies:{"bn.js":{from:"bn.js@=2.0.4",resolved:"https://registry.npmjs.org/bn.js/-/bn.js-2.0.4.tgz",version:"2.0.4"},bs58:{from:"bs58@=2.0.0",resolved:"https://registry.npmjs.org/bs58/-/bs58-2.0.0.tgz",version:"2.0.0"},"buffer-compare":{from:"buffer-compare@=1.0.0",resolved:"https://registry.npmjs.org/buffer-compare/-/buffer-compare-1.0.0.tgz",version:"1.0.0"},elliptic:{dependencies:{brorand:{from:"brorand@^1.0.1",resolved:"https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz",version:"1.0.5"},"hash.js":{from:"hash.js@=1.0.3",resolved:"https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz",version:"1.0.3"}},from:"elliptic@=3.0.3",resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",version:"3.0.3"},inherits:{from:"inherits@=2.0.1",resolved:"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",version:"2.0.1"},lodash:{from:"lodash@=3.10.1",resolved:"https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",version:"3.10.1"}},name:"bitcore",version:"0.13.18"},_spec:"bitcore-lib@^0.13.7",_where:"/home/administrator/javascript-opentimestamps",author:{email:"dev@bitpay.com",name:"BitPay"},browser:{request:"browser-request"},bugs:{url:"https://github.com/bitpay/bitcore-lib/issues"},contributors:[{name:"Manuel Araoz",email:"manuelaraoz@gmail.com"},{name:"Daniel Cousens",email:"bitcoin@dcousens.com"},{name:"Gordon Hall",email:"gordon@bitpay.com"},{name:"Jeff Garzik",email:"jgarzik@bitpay.com"},{name:"Kyle Drake",email:"kyle@kyledrake.net"},{name:"Esteban Ordano",email:"eordano@gmail.com"},{name:"Matias Alejo Garcia",email:"ematiu@gmail.com"},{name:"Ryan X. Charles",email:"ryanxcharles@gmail.com"},{name:"Stefan Thomas",email:"moon@justmoon.net"},{name:"Stephen Pair",email:"stephen@bitpay.com"},{name:"Wei Lu",email:"luwei.here@gmail.com"}],dependencies:{"bn.js":"=2.0.4",bs58:"=2.0.0","buffer-compare":"=1.0.0",elliptic:"=3.0.3",inherits:"=2.0.1",lodash:"=3.10.1"},description:"A pure and powerful JavaScript Bitcoin library.",devDependencies:{"bitcore-build":"github:bitpay/bitcore-build",brfs:"^1.2.0",chai:"^1.10.0",gulp:"^3.8.10",sinon:"^1.13.0"},directories:{},dist:{shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",tarball:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz"},gitHead:"9517864f14d09700f3fd02ff61173003c0280774",homepage:"https://github.com/bitpay/bitcore-lib#readme",keywords:["address","bip21","bip32","bip37","bip69","bip70","bitcoin","blockchain","cryptocurrency","ecies","multisig","p2p","payment","transaction"],license:"MIT",main:"index.js",maintainers:[{name:"braydonf",email:"braydon@bitpay.com"},{name:"gabegattis",email:"gabegattis@gmail.com"},{name:"gasteve",email:"stephen@pairhome.net"},{name:"patrickbitpay",email:"patrick@bitpay.com"}],name:"bitcore-lib",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/bitpay/bitcore-lib.git"},scripts:{build:"gulp",coverage:"gulp coverage",lint:"gulp lint",test:"gulp test"},version:"0.13.19"}},{}],151:[function(e,t,r){var i=e("bitcore-lib");i.Message=e("./lib/message"),t.exports=i.Message},{"./lib/message":152,"bitcore-lib":78}],152:[function(r,d,e){(function(o){"use strict";var e=r("bitcore-lib"),s=e.deps._,i=e.PrivateKey,n=e.PublicKey,c=e.Address,a=e.encoding.BufferWriter,u=e.crypto.ECDSA,f=e.crypto.Signature,p=e.crypto.Hash.sha256sha256,t=e.util.js,h=e.util.preconditions,l=function e(t){return this instanceof e?(h.checkArgument(s.isString(t),"First argument should be a string"),this.message=t,this):new e(t)};l.MAGIC_BYTES=new o("Bitcoin Signed Message:\n"),l.prototype.magicHash=function(){var e=a.varintBufNum(l.MAGIC_BYTES.length),t=new o(this.message),r=a.varintBufNum(t.length),i=o.concat([e,l.MAGIC_BYTES,r,t]);return p(i)},l.prototype._sign=function(e){h.checkArgument(e instanceof i,"First argument should be an instance of PrivateKey");var t=this.magicHash(),r=new u;return r.hashbuf=t,r.privkey=e,r.pubkey=e.toPublicKey(),r.signRandomK(),r.calci(),r.sig},l.prototype.sign=function(e){return this._sign(e).toCompact().toString("base64")},l.prototype._verify=function(e,t){h.checkArgument(e instanceof n,"First argument should be an instance of PublicKey"),h.checkArgument(t instanceof f,"Second argument should be an instance of Signature");var r=this.magicHash(),i=u.verify(r,t,e);return i||(this.error="The signature was invalid"),i},l.prototype.verify=function(e,t){h.checkArgument(e),h.checkArgument(t&&s.isString(t)),s.isString(e)&&(e=c.fromString(e));var r=f.fromCompact(new o(t,"base64")),i=new u;i.hashbuf=this.magicHash(),i.sig=r;var n=i.toPublicKey(),a=c.fromPublicKey(n,e.network);return e.toString()!==a.toString()?!(this.error="The signature did not match the message digest"):this._verify(n,r)},l.fromString=function(e){return new l(e)},l.fromJSON=function(e){return t.isValidJSON(e)&&(e=JSON.parse(e)),new l(e.message)},l.prototype.toObject=function(){return{message:this.message}},l.prototype.toJSON=function(){return JSON.stringify(this.toObject())},l.prototype.toString=function(){return this.message},l.prototype.inspect=function(){return""},d.exports=l}).call(this,r("buffer").Buffer)},{"bitcore-lib":78,buffer:191}],153:[function(e,r,i){(function(Q,U,u){!function(e){if("object"==(void 0===i?"undefined":_typeof(i))&&void 0!==r)r.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:void 0!==U?t=U:"undefined"!=typeof self&&(t=self),t.Promise=e()}}(function(){var e,t,r;return function a(o,s,c){function u(r,e){if(!s[r]){if(!o[r]){var t="function"==typeof _dereq_&&_dereq_;if(!e&&t)return t(r,!0);if(f)return f(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[r]={exports:{}};o[r][0].call(n.exports,function(e){var t=o[r][1][e];return u(t||e)},n,n.exports,a,o,s,c)}return s[r].exports}for(var f="function"==typeof _dereq_&&_dereq_,e=0;e, no stack trace)"}function V(){return"function"==typeof Y}var G=function(){return!1},$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function W(e){var t=e.match($);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function Z(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);Y(this,Z),32=a)return r[t]=e,this._queue.push(t),!1;null!==n&&(n[t]=e);var o=this._promise,s=this._callback,c=o._boundValue();o._pushContext();var u=g(s).call(c,e,t,i),f=o._popContext();if(m.checkForgottenReturns(u,f,null!==n?"Promise.filter":"Promise.map",o),u===v)return this._reject(u.e),!0;var p=d(u,this._promise);if(p instanceof l){var h=(p=p._target())._bitField;if(0==(50397184&h))return 1<=a&&this._inFlight++,(r[t]=p)._proxy(this,-1*(t+1)),!1;if(0==(33554432&h))return 0!=(16777216&h)?this._reject(p._reason()):this._cancel(),!0;u=p._value()}r[t]=u}return i<=++this._totalResolved&&(null!==n?this._filter(r,n):this._resolve(r),!0)},f.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;0>>16)){if(e===this){var r=c();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,0<(65535&t)&&(0!=(134217728&t)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},E.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,d.isNode);0<(65535&t)?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},E.prototype._fulfillPromises=function(e,t){for(var r=1;r=this._length&&(this._resolve(this._values),!0)},t.prototype._promiseCancelled=function(){return this._cancel(),!0},t.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},t.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof s)e.cancel();else for(var t=0;t=this._length){var r;if(this._isMap)r=function(e){for(var t=new s,r=e.length/2|0,i=0;i>1},i.prototype.props=function(){return r(this)},i.props=function(e){return r(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function i(e){this._capacity=e,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},n.prototype._promiseFulfilled=function(e,t){var r=new i;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},n.prototype._promiseRejected=function(e,t){var r=new i;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},e.settle=function(e){return r.deprecated(".settle()",".reflect()"),new n(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(f,e,t){"use strict";e.exports=function(e,t,n){var r=f("./util"),i=f("./errors").RangeError,a=f("./errors").AggregateError,o=r.isArray,s={};function c(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function u(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new c(e),i=r.promise();return r.setHowMany(t),r.init(),i}r.inherits(c,t),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=o(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(e){this._howMany=e},c.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(s),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);else if("le"===r)for(n=i=0;i>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-a&4194303,26<=(a+=24)&&(a-=26,i++);r+6!==t&&(n=o(e,t,r+6),this.words[i]|=n<>>26-a&4194303),this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=67108863&o,c=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,p=67108863&c,h=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=h;l++){var d=u-l|0;f+=(o=(n=0|e.words[d])*(a=0|t.words[l])+p)/67108864|0,p=67108863&o}r.words[u]=0|p,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}v.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,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}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)&&2<=e&&e<=36){var c=l[e],u=d[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var p=f.modn(u).toString(e);r=(f=f.idivn(u)).isZero()?p+r:h[c-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.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]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},v.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)},v.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},v.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},v.prototype.inotn=function(e){g("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},v.prototype.notn=function(e){return this.clone().inotn(e)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);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,e):(r=e,this);for(var n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},v.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;i=0>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],d=8191&l,m=l>>>13,g=0|o[2],v=8191&g,b=g>>>13,y=0|o[3],_=8191&y,w=y>>>13,k=0|o[4],x=8191&k,S=k>>>13,j=0|o[5],E=8191&j,A=j>>>13,I=0|o[6],P=8191&I,O=I>>>13,T=0|o[7],B=8191&T,C=T>>>13,F=0|o[8],R=8191&F,z=F>>>13,M=0|o[9],N=8191&M,D=M>>>13,q=0|s[0],L=8191&q,U=q>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],$=8191&G,W=G>>>13,Z=0|s[3],Y=8191&Z,X=Z>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],ae=8191&ne,oe=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],pe=8191&fe,he=fe>>>13,le=0|s[9],de=8191&le,me=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(p,L))|0)+((8191&(n=(n=Math.imul(p,U))+Math.imul(h,L)|0))<<13)|0;u=((a=Math.imul(h,U))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,L),n=(n=Math.imul(d,U))+Math.imul(m,L)|0,a=Math.imul(m,U);var ve=(u+(i=i+Math.imul(p,K)|0)|0)+((8191&(n=(n=n+Math.imul(p,V)|0)+Math.imul(h,K)|0))<<13)|0;u=((a=a+Math.imul(h,V)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(b,L)|0,a=Math.imul(b,U),i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,V)|0;var be=(u+(i=i+Math.imul(p,$)|0)|0)+((8191&(n=(n=n+Math.imul(p,W)|0)+Math.imul(h,$)|0))<<13)|0;u=((a=a+Math.imul(h,W)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(_,L),n=(n=Math.imul(_,U))+Math.imul(w,L)|0,a=Math.imul(w,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,i=i+Math.imul(d,$)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,W)|0;var ye=(u+(i=i+Math.imul(p,Y)|0)|0)+((8191&(n=(n=n+Math.imul(p,X)|0)+Math.imul(h,Y)|0))<<13)|0;u=((a=a+Math.imul(h,X)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(x,L),n=(n=Math.imul(x,U))+Math.imul(S,L)|0,a=Math.imul(S,U),i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,W)|0,i=i+Math.imul(d,Y)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,X)|0;var _e=(u+(i=i+Math.imul(p,Q)|0)|0)+((8191&(n=(n=n+Math.imul(p,ee)|0)+Math.imul(h,Q)|0))<<13)|0;u=((a=a+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(A,L)|0,a=Math.imul(A,U),i=i+Math.imul(x,K)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,V)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,W)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(b,Y)|0,a=a+Math.imul(b,X)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0;var we=(u+(i=i+Math.imul(p,re)|0)|0)+((8191&(n=(n=n+Math.imul(p,ie)|0)+Math.imul(h,re)|0))<<13)|0;u=((a=a+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(O,L)|0,a=Math.imul(O,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,V)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,W)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,X)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0;var ke=(u+(i=i+Math.imul(p,ae)|0)|0)+((8191&(n=(n=n+Math.imul(p,oe)|0)+Math.imul(h,ae)|0))<<13)|0;u=((a=a+Math.imul(h,oe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(C,L)|0,a=Math.imul(C,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(O,K)|0,a=a+Math.imul(O,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,W)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(S,Y)|0,a=a+Math.imul(S,X)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ie)|0,i=i+Math.imul(d,ae)|0,n=(n=n+Math.imul(d,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var xe=(u+(i=i+Math.imul(p,ce)|0)|0)+((8191&(n=(n=n+Math.imul(p,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((a=a+Math.imul(h,ue)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(R,L),n=(n=Math.imul(R,U))+Math.imul(z,L)|0,a=Math.imul(z,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,W)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ie)|0,i=i+Math.imul(v,ae)|0,n=(n=n+Math.imul(v,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,i=i+Math.imul(d,ce)|0,n=(n=n+Math.imul(d,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0;var Se=(u+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,he)|0)+Math.imul(h,pe)|0))<<13)|0;u=((a=a+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,U))+Math.imul(D,L)|0,a=Math.imul(D,U),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(z,K)|0,a=a+Math.imul(z,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,W)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,Y)|0,a=a+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ie)|0,i=i+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,i=i+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,ue)|0,i=i+Math.imul(d,pe)|0,n=(n=n+Math.imul(d,he)|0)+Math.imul(m,pe)|0,a=a+Math.imul(m,he)|0;var je=(u+(i=i+Math.imul(p,de)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(h,de)|0))<<13)|0;u=((a=a+Math.imul(h,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(N,K),n=(n=Math.imul(N,V))+Math.imul(D,K)|0,a=Math.imul(D,V),i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,W)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,W)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(C,Y)|0,a=a+Math.imul(C,X)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ie)|0,i=i+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,ue)|0,i=i+Math.imul(v,pe)|0,n=(n=n+Math.imul(v,he)|0)+Math.imul(b,pe)|0,a=a+Math.imul(b,he)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;u=((a=a+Math.imul(m,me)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(N,$),n=(n=Math.imul(N,W))+Math.imul(D,$)|0,a=Math.imul(D,W),i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,X)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ie)|0,i=i+Math.imul(E,ae)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,i=i+Math.imul(x,ce)|0,n=(n=n+Math.imul(x,ue)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,ue)|0,i=i+Math.imul(_,pe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,pe)|0,a=a+Math.imul(w,he)|0;var Ae=(u+(i=i+Math.imul(v,de)|0)|0)+((8191&(n=(n=n+Math.imul(v,me)|0)+Math.imul(b,de)|0))<<13)|0;u=((a=a+Math.imul(b,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(N,Y),n=(n=Math.imul(N,X))+Math.imul(D,Y)|0,a=Math.imul(D,X),i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ie)|0,i=i+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,i=i+Math.imul(x,pe)|0,n=(n=n+Math.imul(x,he)|0)+Math.imul(S,pe)|0,a=a+Math.imul(S,he)|0;var Ie=(u+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,me)|0)+Math.imul(w,de)|0))<<13)|0;u=((a=a+Math.imul(w,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(N,Q),n=(n=Math.imul(N,ee))+Math.imul(D,Q)|0,a=Math.imul(D,ee),i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ie)|0,i=i+Math.imul(B,ae)|0,n=(n=n+Math.imul(B,oe)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,ue)|0,i=i+Math.imul(E,pe)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(A,pe)|0,a=a+Math.imul(A,he)|0;var Pe=(u+(i=i+Math.imul(x,de)|0)|0)+((8191&(n=(n=n+Math.imul(x,me)|0)+Math.imul(S,de)|0))<<13)|0;u=((a=a+Math.imul(S,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(N,re),n=(n=Math.imul(N,ie))+Math.imul(D,re)|0,a=Math.imul(D,ie),i=i+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,i=i+Math.imul(B,ce)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,ue)|0,i=i+Math.imul(P,pe)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(O,pe)|0,a=a+Math.imul(O,he)|0;var Oe=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(A,de)|0))<<13)|0;u=((a=a+Math.imul(A,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(N,ae),n=(n=Math.imul(N,oe))+Math.imul(D,ae)|0,a=Math.imul(D,oe),i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(z,ce)|0,a=a+Math.imul(z,ue)|0,i=i+Math.imul(B,pe)|0,n=(n=n+Math.imul(B,he)|0)+Math.imul(C,pe)|0,a=a+Math.imul(C,he)|0;var Te=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(O,de)|0))<<13)|0;u=((a=a+Math.imul(O,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(N,ce),n=(n=Math.imul(N,ue))+Math.imul(D,ce)|0,a=Math.imul(D,ue),i=i+Math.imul(R,pe)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(z,pe)|0,a=a+Math.imul(z,he)|0;var Be=(u+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,me)|0)+Math.imul(C,de)|0))<<13)|0;u=((a=a+Math.imul(C,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(N,pe),n=(n=Math.imul(N,he))+Math.imul(D,pe)|0,a=Math.imul(D,he);var Ce=(u+(i=i+Math.imul(R,de)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(z,de)|0))<<13)|0;u=((a=a+Math.imul(z,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Fe=(u+(i=Math.imul(N,de))|0)+((8191&(n=(n=Math.imul(N,me))+Math.imul(D,de)|0))<<13)|0;return u=((a=Math.imul(D,me))+(n>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,c[0]=ge,c[1]=ve,c[2]=be,c[3]=ye,c[4]=_e,c[5]=we,c[6]=ke,c[7]=xe,c[8]=Se,c[9]=je,c[10]=Ee,c[11]=Ae,c[12]=Ie,c[13]=Pe,c[14]=Oe,c[15]=Te,c[16]=Be,c[17]=Ce,c[18]=Fe,0!==u&&(c[19]=u,r.length++),r};function s(e,t,r){return(new c).mulp(e,t,r)}function c(e,t){this.x=e,this.y=t}Math.imul||(a=n),v.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?a(this,e,t):r<63?n(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,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},c.prototype.makeRBT=function(e){for(var t=new Array(e),r=v.prototype._countBits(e)-1,i=0;i>=1;return i},c.prototype.permute=function(e,t,r,i,n,a){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*a+1]=8191&n,n>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.muln=function(e){return this.clone().imuln(e)},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.imul(this.clone())},v.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 v(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<a)for(this.length-=a,c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},v.prototype.ishrn=function(e,t,r){return g(0===this.negative),this.iushrn(e,t,r)},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.ushln=function(e){return this.clone().iushln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.ushrn=function(e){return this.clone().iushrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===o)return this.strip();for(g(-1===o),i=o=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,a},v.prototype.div=function(e){return this.divmod(e,"div",!1).div},v.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},v.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},v.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),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(0===e.negative),g(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var c=r.clone(),u=t.clone();!t.isZero();){for(var f=0,p=1;0==(t.words[0]&p)&&f<26;++f,p<<=1);if(0>>26,o&=67108863,this.words[a]=o}return 0!==n&&(this.words[a]=n,this.length++),this},v.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},v.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(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(u[e])return u[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new b;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return u[e]=t},w.prototype._verify1=function(e){g(0===e.negative,"red works only with positives"),g(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){g(0==(e.negative|t.negative),"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},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 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&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();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);g(!i.isZero());var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==a?(a<<=1,a|=f,(4===++o||0===i&&0===u)&&(n=this.mul(n,r[a]),a=o=0)):o=0}s=26}return n},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},v.mont=function(e){return new k(e)},r(k,w),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.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),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new v(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:157}],155:[function(e,t,r){var A=e("concat-map"),I=e("balanced-match");t.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function t(e,r){var i=[];var n=I("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var s=a||o;var c=0<=n.body.indexOf(",");if(!s&&!c)return n.post.match(/,.*\}/)?(e=n.pre+"{"+n.body+P+n.post,t(e)):[e];var u;if(s)u=n.body.split(/\.\./);else if(1===(u=T(n.body)).length&&1===(u=t(u[0],!1).map(B)).length){var f=n.post.length?t(n.post,!1):[""];return f.map(function(e){return n.pre+u[0]+e})}var p=n.pre;var f=n.post.length?t(n.post,!1):[""];var h;if(s){var l=O(u[0]),d=O(u[1]),m=Math.max(u[0].length,u[1].length),g=3==u.length?Math.abs(O(u[2])):1,v=F,b=d>>24]^f[d>>>16&255]^p[m>>>8&255]^h[255&g]^t[v++],o=u[d>>>24]^f[m>>>16&255]^p[g>>>8&255]^h[255&l]^t[v++],s=u[m>>>24]^f[g>>>16&255]^p[l>>>8&255]^h[255&d]^t[v++],c=u[g>>>24]^f[l>>>16&255]^p[d>>>8&255]^h[255&m]^t[v++],l=a,d=o,m=s,g=c;return a=(i[l>>>24]<<24|i[d>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[v++],o=(i[d>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&l])^t[v++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[l>>>8&255]<<8|i[255&d])^t[v++],c=(i[g>>>24]<<24|i[l>>>16&255]<<16|i[d>>>8&255]<<8|i[255&m])^t[v++],[a>>>=0,o>>>=0,s>>>=0,c>>>=0]}var p=[0,1,2,4,8,16,32,64,128,27,54],h=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=[[],[],[],[]],a=[[],[],[],[]],o=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;var f=e[i[r[o]=u]=o],p=e[f],h=e[p],l=257*e[u]^16843008*u;n[0][o]=l<<24|l>>>8,n[1][o]=l<<16|l>>>16,n[2][o]=l<<8|l>>>24,n[3][o]=l,l=16843009*h^65537*p^257*f^16843008*o,a[0][u]=l<<24|l>>>8,a[1][u]=l<<16|l>>>16,a[2][u]=l<<8|l>>>24,a[3][u]=l,0===o?o=s=1:(o=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();function s(e){this._key=a(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],a=0;a>>24,o=h.SBOX[o>>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o],o^=p[a/t|0]<<24):6>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o]),n[a]=n[a-t]^o}for(var s=[],c=0;c>>24]]^h.INV_SUB_MIX[1][h.SBOX[f>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[f>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return o(e=a(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=a(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":447}],159:[function(e,t,r){var o=e("./aes"),u=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),f=e("./ghash"),n=e("buffer-xor"),p=e("./incr32");function a(e,t,r,i){s.call(this);var n=u.alloc(4,0);this._cipher=new o.AES(t);var a=this._cipher.encryptBlock(n);this._ghash=new f(a),r=function(e,t,r){if(12===t.length)return e._finID=u.concat([t,u.from([0,0,0,1])]),u.concat([t,u.from([0,0,0,2])]);var i=new f(r),n=t.length,a=n%16;i.update(t),a&&(a=16-a,i.update(u.alloc(a,0))),i.update(u.alloc(8,0));var o=8*n,s=u.alloc(8);s.writeUIntBE(o,0,8),i.update(s),e._finID=i.state;var c=u.from(e._finID);return p(c),c}(this,r,a),this._prev=u.from(r),this._cache=u.allocUnsafe(0),this._secCache=u.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(a,s),a.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=u.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},a.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(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;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":447}],164:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],165:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":190}],166:[function(e,t,r){var a=e("safe-buffer").Buffer,o=e("buffer-xor");function s(e,t,r){var i=t.length,n=o(t,e._cache);return e._cache=e._cache.slice(i),e._prev=a.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=a.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=a.allocUnsafe(0)),!(e._cache.length<=t.length)){n=a.concat([n,s(e,t,r)]);break}i=e._cache.length,n=a.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":190,"safe-buffer":447}],167:[function(e,t,r){var o=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,a=-1,o=0;++a<8;)i=t&1<<7-a?128:0,o+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>a%8,e._prev=c(e._prev,r?i:n);return o}function c(e,t){var r=e.length,i=-1,n=o.allocUnsafe(e.length);for(e=o.concat([e,o.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=o.allocUnsafe(i),a=-1;++a=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var a=m(r);if("ec"===a.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=g[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new d(i),a=r.data.subjectPrivateKey.data;return n.verify(t,e,a)}(e,t,a)}if("dsa"===a.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,a=r.data.g,o=r.data.pub_key,s=m.signature.decode(e,"der"),c=s.s,u=s.r;v(c,n),v(u,n);var f=l.mont(i),p=c.invm(n);return 0===a.toRed(f).redPow(new l(t).mul(p).mod(n)).fromRed().mul(o.toRed(f).redPow(u.mul(p).mod(n)).fromRed()).mod(i).mod(n).cmp(u)}(e,t,a)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var o=a.modulus.byteLength(),s=[1],c=0;t.length+s.length+2l.UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function h(e,t){for(var r=0;rm.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsm.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelm.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelm.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=m.Z_FILTERED&&e.strategy!=m.Z_HUFFMAN_ONLY&&e.strategy!=m.Z_RLE&&e.strategy!=m.Z_FIXED&&e.strategy!=m.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!g.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new o.Zlib(t);var i=this;this._hadError=!1,this._binding.onerror=function(e,t){i._binding=null,i._hadError=!0;var r=new Error(e);r.errno=t,r.code=m.codes[t],i.emit("error",r)};var r=m.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(r=e.level);var n=m.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(n=e.strategy),this._binding.init(e.windowBits||m.Z_DEFAULT_WINDOWBITS,r,e.memLevel||m.Z_DEFAULT_MEMLEVEL,n,e.dictionary),this._buffer=new g(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=n,this.once("end",this.close)}o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION,Object.keys(o).forEach(function(e){e.match(/^Z/)&&(m[e]=o[e])}),m.codes={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},Object.keys(m.codes).forEach(function(e){m.codes[m.codes[e]]=e}),m.Deflate=s,m.Inflate=c,m.Gzip=u,m.Gunzip=f,m.DeflateRaw=p,m.InflateRaw=h,m.Unzip=l,m.createDeflate=function(e){return new s(e)},m.createInflate=function(e){return new c(e)},m.createDeflateRaw=function(e){return new p(e)},m.createInflateRaw=function(e){return new h(e)},m.createGzip=function(e){return new u(e)},m.createGunzip=function(e){return new f(e)},m.createUnzip=function(e){return new l(e)},m.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new s(t),e,r)},m.deflateSync=function(e,t){return r(new s(t),e)},m.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new u(t),e,r)},m.gzipSync=function(e,t){return r(new u(t),e)},m.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new p(t),e,r)},m.deflateRawSync=function(e,t){return r(new p(t),e)},m.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new l(t),e,r)},m.unzipSync=function(e,t){return r(new l(t),e)},m.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new c(t),e,r)},m.inflateSync=function(e,t){return r(new c(t),e)},m.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new f(t),e,r)},m.gunzipSync=function(e,t){return r(new f(t),e)},m.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new h(t),e,r)},m.inflateRawSync=function(e,t){return r(new h(t),e)},e.inherits(t,a),t.prototype.params=function(e,t,r){if(em.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=m.Z_FILTERED&&t!=m.Z_HUFFMAN_ONLY&&t!=m.Z_RLE&&t!=m.Z_FIXED&&t!=m.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var i=this;this.flush(o.Z_SYNC_FLUSH,function(){i._binding.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())})}else n.nextTick(r)},t.prototype.reset=function(){return this._binding.reset()},t.prototype._flush=function(e){this._transform(new g(0),"",e)},t.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=o.Z_FULL_FLUSH),r.ended)t&&n.nextTick(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var i=this;this.once("drain",function(){i.flush(t)})}else this._flushFlag=e,this.write(new g(0),"",t)},t.prototype.close=function(e){if(e&&n.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;n.nextTick(function(){t.emit("close")})}},t.prototype._transform=function(e,t,r){var i,n=this._writableState,a=(n.ending||n.ended)&&(!e||n.length===e.length);if(null===!e&&!g.isBuffer(e))return r(new Error("invalid input"));a?i=o.Z_FINISH:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH));this._processChunk(e,i,r)},t.prototype._processChunk=function(a,o,s){var c=a&&a.length,u=this._chunkSize-this._offset,f=0,p=this,h="function"==typeof s;if(!h){var t,l=[],d=0;this.on("error",function(e){t=e});do{var e=this._binding.writeSync(o,a,f,c,this._buffer,this._offset,u)}while(!this._hadError&&m(e[0],e[1]));if(this._hadError)throw t;var r=g.concat(l,d);return this.close(),r}var i=this._binding.write(o,a,f,c,this._buffer,this._offset,u);function m(e,t){if(!p._hadError){var r=u-t;if(v(0<=r,"have should not go down"),0=p._chunkSize)&&(u=p._chunkSize,p._offset=0,p._buffer=new g(p._chunkSize)),0===t){if(f+=c-e,c=e,!h)return!0;var n=p._binding.write(o,a,f,c,p._buffer,p._offset,p._chunkSize);return n.callback=m,void(n.buffer=a)}if(!h)return!1;s()}}i.buffer=a,i.callback=m},e.inherits(s,t),e.inherits(c,t),e.inherits(u,t),e.inherits(f,t),e.inherits(p,t),e.inherits(h,t),e.inherits(l,t)}).call(this,d("_process"),d("buffer").Buffer)},{"./binding":185,_process:382,_stream_transform:427,assert:67,buffer:191,util:505}],187:[function(e,t,r){arguments[4][157][0].apply(r,arguments)},{dup:157}],188:[function(e,B,C){(function(T){!function(e){var t="object"==(void 0===C?"undefined":_typeof(C))&&C&&!C.nodeType&&C,r="object"==(void 0===B?"undefined":_typeof(B))&&B&&!B.nodeType&&B,i="object"==(void 0===T?"undefined":_typeof(T))&&T;i.global!==i&&i.window!==i&&i.self!==i||(e=i);var n,a,v=2147483647,b=36,y=1,_=26,o=38,s=700,w=72,k=128,x="-",c=/^xn--/,u=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=b-y,S=Math.floor,j=String.fromCharCode;function E(e){throw new RangeError(p[e])}function l(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function d(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((v-d)/o))&&E("overflow"),d+=c*o,!(c<(u=s<=g?y:g+_<=s?_:s-g));s+=b)o>S(v/(f=b-u))&&E("overflow"),o*=f;g=O(d-a,t=h.length+1,0==a),S(d/t)>v-m&&E("overflow"),m+=S(d/t),d%=t,h.splice(d++,0,m)}return I(h)}function g(e){var t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g=[];for(h=(e=A(e)).length,t=k,a=w,o=r=0;oS((v-r)/(l=i+1))&&E("overflow"),r+=(s-t)*l,t=s,o=0;ov&&E("overflow"),p==t){for(c=r,u=b;!(c<(f=u<=a?y:a+_<=u?_:u-a));u+=b)m=c-f,d=b-f,g.push(j(P(f+m%d,0))),c=S(m/d);g.push(j(P(c,0))),a=O(r,l,i==n),r=0,++i}++r,++t}return g.join("")}if(n={version:"1.4.1",ucs2:{decode:A,encode:I},decode:m,encode:g,toASCII:function(e){return d(e,function(e){return u.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return d(e,function(e){return c.test(e)?m(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",function(){return n});else if(t&&r)if(B.exports==t)r.exports=n;else for(a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],189:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var a=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=c;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function c(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}a.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},a.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:191}],190:[function(e,t,r){(function(a){t.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new a(r),n=0;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function l(e,t){if(p.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return R(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=p.from(t,i)),p.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,n);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,n){var a,o=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;s/=o=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var f=-1;for(a=r;a>>10&1023|55296),f=56320|1023&f),i.push(f),n+=p}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;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 S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===p.compare(this,e)},p.prototype.inspect=function(){var e="",t=N.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,i,n){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(i,n),u=e.slice(t,r),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a,o,s,c,u,f,p,h,l,d=!1;;)switch(i){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return h=t,l=r,M(R(e,(p=this).length-h),p,h,l);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return c=this,u=t,f=r,M(z(e),c,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=t,s=r,M(function(e,t){for(var r,i,n,a=[],o=0;o>8,n=r%256,a.push(n),a.push(i);return a}(e,(a=this).length-o),a,o,s);default:if(d)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function k(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function I(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function P(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function O(e,t,r,i,n,a){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(e,t,r,i,n){return n||O(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function B(e,t,r,i,n){return n||O(e,0,r,8),a.write(e,t,r,i,52,8),r+8}p.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):I(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;0<=--a&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function z(e){return i.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function M(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":75,ieee754:318,isarray:323}],192:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],193:[function(e,t,r){function n(e){this.dict=e||{}}n.prototype.set=function(e,t,r){if("object"!==(void 0===e?"undefined":_typeof(e))){void 0===r&&(r=!0);var i=this.has(e);return!r&&i?this.dict[i]=this.dict[i]+","+t:this.dict[i||e]=t,i}for(var n in e)this.set(n,e[n],t)},n.prototype.has=function(e){for(var t=Object.keys(this.dict),r=(e=e.toLowerCase(),0);rr)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>8^255&n^99,u[r]=n;var a=e[f[n]=r],o=e[a],s=e[o],c=257*e[n]^16843008*n;p[r]=c<<24|c>>>8,h[r]=c<<16|c>>>16,l[r]=c<<8|c>>>24,d[r]=c;c=16843009*s^65537*o^257*a^16843008*r;m[n]=c<<24|c>>>8,g[n]=c<<16|c>>>16,v[n]=c<<8|c>>>24,b[n]=c,r?(r=a^e[e[e[s^a]]],i^=e[e[i]]):r=i=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],i=r.AES=t.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),n=this._keySchedule=[],a=0;a>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o]):(o=u[(o=o<<8|o>>>24)>>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o],o^=y[a/r|0]<<24),n[a]=n[a-r]^o}for(var s=this._invKeySchedule=[],c=0;c>>24]]^g[u[o>>>16&255]]^v[u[o>>>8&255]]^b[u[255&o]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,p,h,l,d,u)},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,m,g,v,b,f);r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,a,o,s){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],p=e[t+2]^r[2],h=e[t+3]^r[3],l=4,d=1;d>>24]^n[f>>>16&255]^a[p>>>8&255]^o[255&h]^r[l++],g=i[f>>>24]^n[p>>>16&255]^a[h>>>8&255]^o[255&u]^r[l++],v=i[p>>>24]^n[h>>>16&255]^a[u>>>8&255]^o[255&f]^r[l++],b=i[h>>>24]^n[u>>>16&255]^a[f>>>8&255]^o[255&p]^r[l++];u=m,f=g,p=v,h=b}m=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&h])^r[l++],g=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[h>>>8&255]<<8|s[255&u])^r[l++],v=(s[p>>>24]<<24|s[h>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^r[l++],b=(s[h>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^r[l++];e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=b},keySize:8});e.AES=t._createHelper(i)}(),n.AES},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],206:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,c,n,a,o,s,u,f,p,h,l,d,m,g,v,b;e.lib.Cipher||(r=(t=e).lib,i=r.Base,c=r.WordArray,n=r.BufferedBlockAlgorithm,(a=t.enc).Utf8,o=a.Base64,s=t.algo.EvpKDF,u=r.Cipher=n.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function n(e){return"string"==typeof e?b:g}return function(i){return{encrypt:function(e,t,r){return n(t).encrypt(i,e,t,r)},decrypt:function(e,t,r){return n(t).decrypt(i,e,t,r)}}}}()}),r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),f=t.mode={},p=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var e=p.extend();function a(e,t,r){var i=this._iv;if(i){var n=i;this._iv=void 0}else n=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:l}),reset:function(){u.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else{i=r.createDecryptor;this._minBufferSize=1}this._mode=i.call(r,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),d=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var i=c.create([1398893684,1701076831]).concat(r).concat(t);else i=t;return i.toString(o)},parse:function(e){var t=o.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var i=c.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return d.create({ciphertext:t,salt:i})}},g=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),a=n.finalize(t),o=n.cfg;return d.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.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}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=c.random(8));var n=s.create({keySize:t+r}).compute(e,i),a=c.create(n.words.slice(t),4*r);return n.sigBytes=4*t,d.create({key:n,iv:a,salt:i})}},b=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),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 a=g.encrypt.call(this,e,t,n.key,i);return a.mixIn(n),a},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,g.decrypt.call(this,e,t,n.key,i)}}))},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],207:[function(e,t,r){var i,n;i=this,n=function(){var f,r,e,t,i,p,n,a,o,s,c,u,h=h||(f=Math,r=Object.create||function(){function r(){}return function(e){var t;return r.prototype=e,t=new r,r.prototype=null,t}}(),t=(e={}).lib={},i=t.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$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)}},p=t.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).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 a=0;a>>2]>>>24-a%4*8&255;t[i+a>>>2]|=o<<24-(i+a)%4*8}else for(a=0;a>>2]=r[a>>>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=f.ceil(t/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,r=[],i=function(t){t=t;var r=987654321,i=4294967295;return function(){var e=((r=36969*(65535&r)+(r>>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return e/=4294967296,(e+=.5)*(.5>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).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 p.init(r,t/2)}},o=n.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(a))}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 p.init(r,t)}},s=n.Utf8={stringify:function(e){try{return decodeURIComponent(escape(o.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return o.parse(unescape(encodeURIComponent(e)))}},c=t.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=s.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,n=this.blockSize,a=i/(4*n),o=(a=e?f.ceil(a):f.max((0|a)-this._minBufferSize,0))*n,s=f.min(4*o,i);if(o){for(var c=0;c>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.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,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var n=0;n>>6-a%4*2;i[n>>>2]|=(o|s)<<24-n%4*8,n++}return c.create(i,n)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],209:[function(e,t,r){var i,n;i=this,n=function(r){return function(){var e=r,n=e.lib.WordArray,t=e.enc;t.Utf16=t.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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}};function o(e){return e<<8&4278255360|e>>>8&16711935}t.Utf16LE={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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return n.create(r,2*t)}}}(),r.enc.Utf16},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],210:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,f,n,a,o;return r=(t=e).lib,i=r.Base,f=r.WordArray,n=t.algo,a=n.MD5,o=n.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=r.hasher.create(),n=f.create(),a=n.words,o=r.keySize,s=r.iterations;a.lengthi&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),a=this._iKey=t.clone(),o=n.words,s=a.words,c=0;c>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)}).prototype=e}}(),t.lib.WordArray},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],215:[function(e,t,r){var i,n;i=this,n=function(o){return function(f){var e=o,t=e.lib,r=t.WordArray,i=t.Hasher,n=e.algo,E=[];!function(){for(var e=0;e<64;e++)E[e]=4294967296*f.abs(f.sin(e+1))|0}();var a=n.MD5=i.extend({_doReset:function(){this._hash=new r.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 a=this._hash.words,o=e[t+0],s=e[t+1],c=e[t+2],u=e[t+3],f=e[t+4],p=e[t+5],h=e[t+6],l=e[t+7],d=e[t+8],m=e[t+9],g=e[t+10],v=e[t+11],b=e[t+12],y=e[t+13],_=e[t+14],w=e[t+15],k=a[0],x=a[1],S=a[2],j=a[3];x=O(x=O(x=O(x=O(x=P(x=P(x=P(x=P(x=I(x=I(x=I(x=I(x=A(x=A(x=A(x=A(x,S=A(S,j=A(j,k=A(k,x,S,j,o,7,E[0]),x,S,s,12,E[1]),k,x,c,17,E[2]),j,k,u,22,E[3]),S=A(S,j=A(j,k=A(k,x,S,j,f,7,E[4]),x,S,p,12,E[5]),k,x,h,17,E[6]),j,k,l,22,E[7]),S=A(S,j=A(j,k=A(k,x,S,j,d,7,E[8]),x,S,m,12,E[9]),k,x,g,17,E[10]),j,k,v,22,E[11]),S=A(S,j=A(j,k=A(k,x,S,j,b,7,E[12]),x,S,y,12,E[13]),k,x,_,17,E[14]),j,k,w,22,E[15]),S=I(S,j=I(j,k=I(k,x,S,j,s,5,E[16]),x,S,h,9,E[17]),k,x,v,14,E[18]),j,k,o,20,E[19]),S=I(S,j=I(j,k=I(k,x,S,j,p,5,E[20]),x,S,g,9,E[21]),k,x,w,14,E[22]),j,k,f,20,E[23]),S=I(S,j=I(j,k=I(k,x,S,j,m,5,E[24]),x,S,_,9,E[25]),k,x,u,14,E[26]),j,k,d,20,E[27]),S=I(S,j=I(j,k=I(k,x,S,j,y,5,E[28]),x,S,c,9,E[29]),k,x,l,14,E[30]),j,k,b,20,E[31]),S=P(S,j=P(j,k=P(k,x,S,j,p,4,E[32]),x,S,d,11,E[33]),k,x,v,16,E[34]),j,k,_,23,E[35]),S=P(S,j=P(j,k=P(k,x,S,j,s,4,E[36]),x,S,f,11,E[37]),k,x,l,16,E[38]),j,k,g,23,E[39]),S=P(S,j=P(j,k=P(k,x,S,j,y,4,E[40]),x,S,o,11,E[41]),k,x,u,16,E[42]),j,k,h,23,E[43]),S=P(S,j=P(j,k=P(k,x,S,j,m,4,E[44]),x,S,b,11,E[45]),k,x,w,16,E[46]),j,k,c,23,E[47]),S=O(S,j=O(j,k=O(k,x,S,j,o,6,E[48]),x,S,l,10,E[49]),k,x,_,15,E[50]),j,k,p,21,E[51]),S=O(S,j=O(j,k=O(k,x,S,j,b,6,E[52]),x,S,u,10,E[53]),k,x,g,15,E[54]),j,k,s,21,E[55]),S=O(S,j=O(j,k=O(k,x,S,j,d,6,E[56]),x,S,w,10,E[57]),k,x,h,15,E[58]),j,k,y,21,E[59]),S=O(S,j=O(j,k=O(k,x,S,j,f,6,E[60]),x,S,v,10,E[61]),k,x,c,15,E[62]),j,k,m,21,E[63]),a[0]=a[0]+k|0,a[1]=a[1]+x|0,a[2]=a[2]+S|0,a[3]=a[3]+j|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var n=f.floor(r/4294967296),a=r;t[15+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,s=o.words,c=0;c<4;c++){var u=s[c];s[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function A(e,t,r,i,n,a,o){var s=e+(t&r|~t&i)+n+o;return(s<>>32-a)+t}function I(e,t,r,i,n,a,o){var s=e+(t&i|r&~i)+n+o;return(s<>>32-a)+t}function P(e,t,r,i,n,a,o){var s=e+(t^r^i)+n+o;return(s<>>32-a)+t}function O(e,t,r,i,n,a,o){var s=e+(r^(t|~i))+n+o;return(s<>>32-a)+t}e.MD5=i._createHelper(a),e.HmacMD5=i._createHmacHelper(a)}(Math),o.MD5},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],216:[function(e,t,r){var i,n;i=this,n=function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function a(e,t,r,i){var n=this._iv;if(n){var a=n.slice(0);this._iv=void 0}else a=this._prevBlock;i.encryptBlock(a,0);for(var o=0;o>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 t=e.Encryptor=e.extend({processBlock:function(e,t){var r,i=this._cipher,n=i.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),0===((r=o)[0]=u(r[0]))&&(r[1]=u(r[1]));var s=o.slice(0);i.encryptBlock(s,0);for(var c=0;c>>2]|=n<<24-a%4*8,e.sigBytes+=n},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],222:[function(e,t,r){var i,n;i=this,n=function(n){return n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],223:[function(e,t,r){var i,n;i=this,n=function(r){return r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],224:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],225:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],226:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,v,n,a,b,o;return r=(t=e).lib,i=r.Base,v=r.WordArray,n=t.algo,a=n.SHA1,b=n.HMAC,o=n.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=b.create(r.hasher,e),n=v.create(),a=v.create([1]),o=n.words,s=a.words,c=r.keySize,u=r.iterations;o.length>>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]],n=this._b=0;n<4;n++)h.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;i[0]^=c,i[1]^=f,i[2]^=u,i[3]^=p,i[4]^=c,i[5]^=f,i[6]^=u,i[7]^=p;for(n=0;n<4;n++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.RabbitLegacy=t._createHelper(i)}(),a.RabbitLegacy},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],228:[function(e,t,r){var i,n;i=this,n=function(a){return function(){var e=a,t=e.lib.StreamCipher,r=e.algo,n=[],c=[],u=[],i=r.Rabbit=t.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(r=this._b=0;r<4;r++)h.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;n[0]^=c,n[1]^=f,n[2]^=u,n[3]^=p,n[4]^=c,n[5]^=f,n[6]^=u,n[7]^=p;for(r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.Rabbit=t._createHelper(i)}(),a.Rabbit},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],229:[function(e,t,r){var i,n;i=this,n=function(o){return function(){var e=o,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.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 a=0;n<256;n++){var o=n%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+i[n]+s)%256;var c=i[n];i[n]=i[a],i[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=n.call(this)},keySize:8,ivSize:0});function n(){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 a=e[t];e[t]=e[r],e[r]=a,i|=e[(e[t]+e[r])%256]<<24-8*n}return this._i=t,this._j=r,i}e.RC4=t._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;0>>24)|4278255360&(n<<24|n>>>8)}var a,o,s,c,u,f,p,h,l,d,m,g=this._hash.words,v=A.words,b=I.words,y=x.words,_=S.words,w=j.words,k=E.words;f=a=g[0],p=o=g[1],h=s=g[2],l=c=g[3],d=u=g[4];for(r=0;r<80;r+=1)m=a+e[t+y[r]]|0,m+=r<16?P(o,s,c)+v[0]:r<32?O(o,s,c)+v[1]:r<48?T(o,s,c)+v[2]:r<64?B(o,s,c)+v[3]:C(o,s,c)+v[4],m=(m=F(m|=0,w[r]))+u|0,a=u,u=c,c=F(s,10),s=o,o=m,m=f+e[t+_[r]]|0,m+=r<16?C(p,h,l)+b[0]:r<32?B(p,h,l)+b[1]:r<48?T(p,h,l)+b[2]:r<64?O(p,h,l)+b[3]:P(p,h,l)+b[4],m=(m=F(m|=0,k[r]))+d|0,f=d,d=l,l=F(h,10),h=p,p=m;m=g[1]+s+l|0,g[1]=g[2]+c+d|0,g[2]=g[3]+u+f|0,g[3]=g[4]+a+p|0,g[4]=g[0]+o+h|0,g[0]=m},_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,a=n.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function P(e,t,r){return e^t^r}function O(e,t,r){return e&t|~e&r}function T(e,t,r){return(e|~t)^r}function B(e,t,r){return e&r|t&~r}function C(e,t,r){return e^(t|~r)}function F(e,t){return e<>>32-t}t.RIPEMD160=n._createHelper(o),t.HmacRIPEMD160=n._createHmacHelper(o)}(Math),s.RIPEMD160},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],231:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,p,o;return r=(t=e).lib,i=r.WordArray,n=r.Hasher,a=t.algo,p=[],o=a.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],a=r[2],o=r[3],s=r[4],c=0;c<80;c++){if(c<16)p[c]=0|e[t+c];else{var u=p[c-3]^p[c-8]^p[c-14]^p[c-16];p[c]=u<<1|u>>>31}var f=(i<<5|i>>>27)+s+p[c];f+=c<20?1518500249+(n&a|~n&o):c<40?1859775393+(n^a^o):c<60?(n&a|n&o|a&o)-1894007588:(n^a^o)-899497514,s=o,o=a,a=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|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(o),t.HmacSHA1=n._createHmacHelper(o),e.SHA1},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],232:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a;return r=(t=e).lib.WordArray,i=t.algo,n=i.SHA256,a=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(a),t.HmacSHA224=n._createHmacHelper(a),e.SHA224},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],n):n(i.CryptoJS)},{"./core":207,"./sha256":233}],233:[function(e,t,r){var i,n;i=this,n=function(c){return function(n){var e=c,t=e.lib,r=t.WordArray,i=t.Hasher,a=e.algo,o=[],y=[];!function(){function e(e){for(var t=n.sqrt(e),r=2;r<=t;r++)if(!(e%r))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(o[i]=t(n.pow(r,.5))),y[i]=t(n.pow(r,1/3)),i++),r++}();var _=[],s=a.SHA256=i.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=0;p<64;p++){if(p<16)_[p]=0|e[t+p];else{var h=_[p-15],l=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,d=_[p-2],m=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;_[p]=l+_[p-7]+m+_[p-16]}var g=i&n^i&a^n&a,v=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&u)+y[p]+_[p];f=u,u=c,c=s,s=o+b|0,o=a,a=n,n=i,i=b+(v+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+u|0,r[7]=r[7]+f|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)]=n.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA256=i._createHelper(s),e.HmacSHA256=i._createHmacHelper(s)}(Math),c.SHA256},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],234:[function(e,t,r){var i,n;i=this,n=function(a){return function(h){var e=a,t=e.lib,l=t.WordArray,i=t.Hasher,f=e.x64.Word,r=e.algo,P=[],O=[],T=[];!function(){for(var e=1,t=0,r=0;r<24;r++){P[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++)O[e+5*t]=t+(2*e+3*t)%5*5;for(var n=1,a=0;a<24;a++){for(var o=0,s=0,c=0;c<7;c++){if(1&n){var u=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(S=r[n]).high^=o,S.low^=a}for(var s=0;s<24;s++){for(var c=0;c<5;c++){for(var u=0,f=0,p=0;p<5;p++){u^=(S=r[c+5*p]).high,f^=S.low}var h=B[c];h.high=u,h.low=f}for(c=0;c<5;c++){var l=B[(c+4)%5],d=B[(c+1)%5],m=d.high,g=d.low;for(u=l.high^(m<<1|g>>>31),f=l.low^(g<<1|m>>>31),p=0;p<5;p++){(S=r[c+5*p]).high^=u,S.low^=f}}for(var v=1;v<25;v++){var b=(S=r[v]).high,y=S.low,_=P[v];if(_<32)u=b<<_|y>>>32-_,f=y<<_|b>>>32-_;else u=y<<_-32|b>>>64-_,f=b<<_-32|y>>>64-_;var w=B[O[v]];w.high=u,w.low=f}var k=B[0],x=r[0];k.high=x.high,k.low=x.low;for(c=0;c<5;c++)for(p=0;p<5;p++){var S=r[v=c+5*p],j=B[v],E=B[(c+1)%5+5*p],A=B[(c+2)%5+5*p];S.high=j.high^~E.high&A.high,S.low=j.low^~E.low&A.low}S=r[0];var I=T[s];S.high^=I.high,S.low^=I.low}},_doFinalize:function(){var e=this._data,t=e.words,r=(this._nDataBytes,8*e.sigBytes),i=32*this.blockSize;t[r>>>5]|=1<<24-r%32,t[(h.ceil((r+1)/i)*i>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();for(var n=this._state,a=this.cfg.outputLength/8,o=a/8,s=[],c=0;c>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),s.push(p),s.push(f)}return new l.init(s,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});e.SHA3=i._createHelper(n),e.HmacSHA3=i._createHmacHelper(n)}(Math),a.SHA3},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],235:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,o,s;return r=(t=e).x64,i=r.Word,n=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.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=o._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s),e.SHA384},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core"),e("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],n):n(i.CryptoJS)},{"./core":207,"./sha512":236,"./x64-core":238}],236:[function(e,t,r){var i,n;i=this,n=function(c){return function(){var e=c,t=e.lib.Hasher,r=e.x64,i=r.Word,n=r.WordArray,a=e.algo;function o(){return i.create.apply(i,arguments)}var xe=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],Se=[];!function(){for(var e=0;e<80;e++)Se[e]=o()}();var s=a.SHA512=t.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=i.high,h=i.low,l=n.high,d=n.low,m=a.high,g=a.low,v=o.high,b=o.low,y=s.high,_=s.low,w=c.high,k=c.low,x=u.high,S=u.low,j=f.high,E=f.low,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=w,N=k,D=x,q=S,L=j,U=E,H=0;H<80;H++){var K=Se[H];if(H<16)var V=K.high=0|e[t+2*H],G=K.low=0|e[t+2*H+1];else{var $=Se[H-15],W=$.high,Z=$.low,Y=(W>>>1|Z<<31)^(W>>>8|Z<<24)^W>>>7,X=(Z>>>1|W<<31)^(Z>>>8|W<<24)^(Z>>>7|W<<25),J=Se[H-2],Q=J.high,ee=J.low,te=(Q>>>19|ee<<13)^(Q<<3|ee>>>29)^Q>>>6,re=(ee>>>19|Q<<13)^(ee<<3|Q>>>29)^(ee>>>6|Q<<26),ie=Se[H-7],ne=ie.high,ae=ie.low,oe=Se[H-16],se=oe.high,ce=oe.low;V=(V=(V=Y+ne+((G=X+ae)>>>0>>0?1:0))+te+((G=G+re)>>>0>>0?1:0))+se+((G=G+ce)>>>0>>0?1:0);K.high=V,K.low=G}var ue,fe=R&M^~R&D,pe=z&N^~z&q,he=A&P^A&T^P&T,le=I&O^I&B^O&B,de=(A>>>28|I<<4)^(A<<30|I>>>2)^(A<<25|I>>>7),me=(I>>>28|A<<4)^(I<<30|A>>>2)^(I<<25|A>>>7),ge=(R>>>14|z<<18)^(R>>>18|z<<14)^(R<<23|z>>>9),ve=(z>>>14|R<<18)^(z>>>18|R<<14)^(z<<23|R>>>9),be=xe[H],ye=be.high,_e=be.low,we=L+ge+((ue=U+ve)>>>0>>0?1:0),ke=me+le;L=D,U=q,D=M,q=N,M=R,N=z,R=C+(we=(we=(we=we+fe+((ue=ue+pe)>>>0>>0?1:0))+ye+((ue=ue+_e)>>>0<_e>>>0?1:0))+V+((ue=ue+G)>>>0>>0?1:0))+((z=F+ue|0)>>>0>>0?1:0)|0,C=T,F=B,T=P,B=O,P=A,O=I,A=we+(de+he+(ke>>>0>>0?1:0))+((I=ue+ke|0)>>>0>>0?1:0)|0}h=i.low=h+I,i.high=p+A+(h>>>0>>0?1:0),d=n.low=d+O,n.high=l+P+(d>>>0>>0?1:0),g=a.low=g+B,a.high=m+T+(g>>>0>>0?1:0),b=o.low=b+F,o.high=v+C+(b>>>0>>0?1:0),_=s.low=_+z,s.high=y+R+(_>>>0>>0?1:0),k=c.low=k+N,c.high=w+M+(k>>>0>>0?1:0),S=u.low=S+q,u.high=x+D+(S>>>0>>0?1:0),E=f.low=E+U,f.high=j+L+(E>>>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=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(s),e.HmacSHA512=t._createHmacHelper(s)}(),c.SHA512},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],237:[function(e,t,r){var i,n;i=this,n=function(s){return function(){var e=s,t=e.lib,r=t.WordArray,i=t.BlockCipher,n=e.algo,u=[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],f=[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],p=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],a=n.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var i=u[r]-1;t[r]=e[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var o=n[a]=[],s=p[a];for(r=0;r<24;r++)o[r/6|0]|=t[(f[r]-1+s)%28]<<31-r%6,o[4+(r/6|0)]|=t[28+(f[r+24]-1+s)%28]<<31-r%6;o[0]=o[0]<<1|o[0]>>>31;for(r=1;r<7;r++)o[r]=o[r]>>>4*(r-1)+3;o[7]=o[7]<<5|o[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[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],d.call(this,4,252645135),d.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),d.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=h[c][((o^n[c])&l[c])>>>0];this._lBlock=o,this._rBlock=a^s}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,d.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(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<>>1];r=h.r28shl(r,a),i=h.r28shl(i,a),h.pc2(r,i,e.keys,n)}},c.prototype._update=function(e,t,r,i){var n=this._desState,a=h.readUInt32BE(e,t),o=h.readUInt32BE(e,t+4);h.ip(a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,o,n.tmp,0):this._decrypt(n,a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],h.writeUInt32BE(r,a,i),h.writeUInt32BE(r,o,i+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,a=p}h.rip(o,a,i,n)},c.prototype._decrypt=function(e,t,r,i,n){for(var a=r,o=t,s=e.keys.length-2;0<=s;s-=2){var c=e.keys[s],u=e.keys[s+1];h.expand(a,e.tmp,0),c^=e.tmp[0],u^=e.tmp[1];var f=h.substitute(c,u),p=a;a=(o^h.permute(f))>>>0,o=p}h.rip(a,o,i,n)}},{"../des":240,inherits:320,"minimalistic-assert":353}],244:[function(e,t,r){"use strict";var a=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),o=n.Cipher,s=n.DES;function c(e,t){a.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new c(this.type,this.options.key);this._edeState=t}i(u,o),(t.exports=u).create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":240,inherits:320,"minimalistic-assert":353}],245:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.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},r.ip=function(e,t,r,i){for(var n=0,a=0,o=6;0<=o;o-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+o&1}for(o=6;0<=o;o-=2){for(s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1;for(s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1}r[i+0]=n>>>0,r[i+1]=a>>>0},r.rip=function(e,t,r,i){for(var n=0,a=0,o=0;o<4;o++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+o&1,n<<=1,n|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;0<=s;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.pc1=function(e,t,r,i){for(var n=0,a=0,o=7;5<=o;o--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.r28shl=function(e,t){return e<>>28-t};var c=[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];r.pc2=function(e,t,r,i){for(var n=0,a=0,o=c.length>>>1,s=0;s>>c[s]&1;for(s=o;s>>c[s]&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var a=23;15<=a;a-=4)i<<=6,i|=e>>>a&63;for(a=11;3<=a;a-=4)n|=e>>>a&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[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];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[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];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(c),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;r.mod(p).cmp(h);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(i=r.shrn(1))&&g(r)&&v(i)&&v(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":154,"miller-rabin":349,randombytes:414}],249:[function(e,t,r){t.exports={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"}}},{}],250:[function(e,t,r){var u=e("crypto"),f=e("jsbn").BigInteger,p=(e("./lib/ec.js").ECPointFp,e("safer-buffer").Buffer);function h(e,t){return e.length>=t?e:h("0"+e,t)}r.ECCurves=e("./lib/sec.js"),r.ECKey=function(e,t,r){var i,n=e(),a=n.getN(),o=Math.floor(a.bitLength()/8);if(t)if(r){e=n.getCurve();this.P=e.decodePointHex(t.toString("hex"))}else{if(t.length!=o)return!1;i=new f(t.toString("hex"),16)}else{var s=a.subtract(f.ONE),c=new f(u.randomBytes(a.bitLength()));i=c.mod(s).add(f.ONE),this.P=n.getG().multiply(i)}this.P&&(this.PublicKey=p.from(n.getCurve().encodeCompressedPointHex(this.P),"hex")),i&&(this.PrivateKey=p.from(h(i.toString(16),2*o),"hex"),this.deriveSharedSecret=function(e){if(!e||!e.P)return!1;var t=e.P.multiply(i);return p.from(h(t.getX().toBigInteger().toString(16),2*o),"hex")})}},{"./lib/ec.js":251,"./lib/sec.js":252,crypto:204,jsbn:325,"safer-buffer":448}],251:[function(e,t,r){var l=e("jsbn").BigInteger,i=l.prototype.Barrett;function f(e,t){this.x=t,this.q=e}function d(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=null==i?l.ONE:i,this.zinv=null}function n(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new d(this,null,null),this.reducer=new i(this.q)}f.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},f.prototype.toBigInteger=function(){return this.x},f.prototype.negate=function(){return new f(this.q,this.x.negate().mod(this.q))},f.prototype.add=function(e){return new f(this.q,this.x.add(e.toBigInteger()).mod(this.q))},f.prototype.subtract=function(e){return new f(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},f.prototype.multiply=function(e){return new f(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},f.prototype.square=function(){return new f(this.q,this.x.square().mod(this.q))},f.prototype.divide=function(e){return new f(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},d.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO))},d.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(l.ZERO)&&!this.y.toBigInteger().equals(l.ZERO)},d.prototype.negate=function(){return new d(this.curve,this.x,this.y.negate(),this.z)},d.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(l.ZERO.equals(r))return l.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new l("3"),n=this.x.toBigInteger(),a=this.y.toBigInteger(),o=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),s=o.multiply(r),c=n.multiply(o),u=t.square().multiply(this.z),f=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(s).multiply(r).mod(this.curve.q),p=c.multiply(i).multiply(t).subtract(a.multiply(s)).subtract(u.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),h=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(p),h)},d.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new l("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),n=i.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),o=t.square().multiply(e);l.ZERO.equals(a)||(o=o.add(this.z.square().multiply(a)));var s=(o=o.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(i).mod(this.curve.q),c=o.multiply(e).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(o.square().multiply(o)).mod(this.curve.q),u=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(c),u)},d.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new l("3")),n=this.negate(),a=this;for(t=i.bitLength()-2;0r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var n=this.curve.getInfinity(),a=this.add(t);0<=i;)n=n.twice(),e.testBit(i)?n=r.testBit(i)?n.add(a):n.add(this):r.testBit(i)&&(n=n.add(t)),--i;return n},n.prototype.getQ=function(){return this.q},n.prototype.getA=function(){return this.a},n.prototype.getB=function(){return this.b},n.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},n.prototype.getInfinity=function(){return this.infinity},n.prototype.fromBigInteger=function(e){return new f(this.q,e)},n.prototype.reduce=function(e){this.reducer.reduce(e)},n.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;t.lengtht+1;){var r=e.shiftRight(t),i=e.subtract(r.shiftLeft(t));this.getR().equals(l.ONE)||(r=r.multiply(this.getR())),e=r.add(i)}for(;0<=e.compareTo(q);)e=e.subtract(q)}else e=e.mod(q);return e},f.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var e=new f(this.q,this.x.modPow(this.q.shiftRight(2).add(l.ONE),this.q));return e.square().equals(this)?e:null}var t=this.q.subtract(l.ONE),r=t.shiftRight(1);if(!this.x.modPow(r,this.q).equals(l.ONE))return null;var i,n,a=t.shiftRight(2).shiftLeft(1).add(l.ONE),o=this.x,s=modDouble(modDouble(o));do{for(var c;0<=(c=new l(this.q.bitLength(),new SecureRandom)).compareTo(this.q)||!c.multiply(c).subtract(s).modPow(r,this.q).equals(t););var u=this.lucasSequence(c,o,a);if(i=u[0],n=u[1],this.modMult(n,n).equals(s))return n.testBit(0)&&(n=n.add(q)),n=n.shiftRight(1),new f(q,n)}while(i.equals(l.ONE)||i.equals(t));return null},f.prototype.lucasSequence=function(e,t,r){for(var i=r.bitLength(),n=r.getLowestSetBit(),a=l.ONE,o=l.TWO,s=e,c=l.ONE,u=l.ONE,f=i-1;n+1<=f;--f)c=this.modMult(c,u),r.testBit(f)?(u=this.modMult(c,t),a=this.modMult(a,s),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1)))):(u=c,a=this.modReduce(a.multiply(o).subtract(c)),s=this.modReduce(s.multiply(o).subtract(e.multiply(c))),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))));c=this.modMult(c,u),u=this.modMult(c,t),a=this.modReduce(a.multiply(o).subtract(c)),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),c=this.modMult(c,u);for(f=1;f<=n;++f)a=this.modMult(a,o),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))),c=this.modMult(c,c);return[a,o]};r={ECCurveFp:n,ECPointFp:d,ECFieldElementFp:f};t.exports=r},{jsbn:325}],252:[function(e,t,r){var o=e("jsbn").BigInteger,s=e("./ec.js").ECCurveFp;function c(e,t,r,i){this.curve=e,this.g=t,this.n=r,this.h=i}function u(e){return new o(e,16)}function i(){var e=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),r=u("E87579C11079F43DD824993C2CEE5ED3"),i=u("FFFFFFFE0000000075A30D1B9038A115"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83"),i,n)}function n(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=o.ZERO,r=u("7"),i=u("0100000000000000000001B8FA16DFAB9ACA16B6B3"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE"),i,n)}function a(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),r=u("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),i=u("0100000000000000000001F4C8F927AED3CA752257"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32"),i,n)}function f(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=o.ZERO,r=u("3"),i=u("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"),i,n)}function p(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),r=u("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),i=u("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811"),i,n)}function h(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),r=u("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),i=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"),i,n)}function l(){var e=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),r=u("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),i=u("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),i,n)}c.prototype.getCurve=function(){return this.curve},c.prototype.getG=function(){return this.g},c.prototype.getN=function(){return this.n},c.prototype.getH=function(){return this.h},t.exports={secp128r1:i,secp160k1:n,secp160r1:a,secp192k1:f,secp192r1:p,secp224r1:h,secp256r1:l}},{"./ec.js":251,jsbn:325}],253:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":268,"./elliptic/curve":256,"./elliptic/curves":259,"./elliptic/ec":260,"./elliptic/eddsa":263,"./elliptic/utils":267,brorand:156}],254:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,j=n.getNAF,E=n.getJSF,p=n.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i,n){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,c=0,u=0;u>1]:S<0&&(x=o[g][-S-1>>1].neg()),y="affine"===x.type?y.mixedAdd(x):y.add(x))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},o.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.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),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],256:[function(e,t,r){arguments[4][130][0].apply(r,arguments)},{"./base":254,"./edwards":255,"./mont":257,"./short":258,dup:130}],257:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base,s=e("../../elliptic").utils;function c(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(c,o),(t.exports=c).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)},a(u,o.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},c.prototype.point=function(e,t){return new u(this,e,t)},c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.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)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},u.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 a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],258:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new w(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)},c.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)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],259:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":253,"./precomputed/secp256k1":266,"hash.js":299}],260:[function(e,t,r){"use strict";var g=e("bn.js"),v=e("hmac-drbg"),a=e("../../elliptic"),l=a.utils.assert,i=e("./key"),b=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(l(a.curves.hasOwnProperty(e),"Unknown curve "+e),e=a.curves[e]),e instanceof a.curves.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}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new v({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new g(2));;){var n=new g(t.generate(r));if(!(0>1;if(0<=o.cmp(this.curve.p.umod(this.curve.n))&&u)throw new Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var f=t.r.invm(n),p=n.sub(a).mul(f).umod(n),h=s.mul(f).umod(n);return this.g.mulAdd(p,o,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new b(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":253,"./key":261,"./signature":262,"bn.js":154,"hmac-drbg":311}],261:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=a).fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},{"../../elliptic":253,"bn.js":154}],262:[function(e,t,r){"use strict";var s=e("bn.js"),c=e("../../elliptic").utils,i=c.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=c.toArray(e,t);var r=new u;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=f(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=f(e,r);if(e.length!==a+r.place)return!1;var o=e.slice(r.place,a+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===o[0]&&128&o[1]&&(o=o.slice(1)),this.r=new s(n),this.s=new s(o),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];p(i,t.length),(i=i.concat(t)).push(2),p(i,r.length);var n=i.concat(r),a=[48];return p(a,n.length),a=a.concat(n),c.encode(a,e)}},{"../../elliptic":253,"bn.js":154}],263:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),a=n.utils,o=a.assert,c=a.parseBytes,s=e("./key"),u=e("./signature");function f(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=f).prototype.sign=function(e,t){e=c(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),a=this.encodePoint(n),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:a})},f.prototype.verify=function(e,t,r){e=c(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(a)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=6.0.0 <7.0.0",_id:"elliptic@6.4.1",_inCache:!0,_installable:!0,_location:"/elliptic",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/elliptic_6.4.1_1533787091502_0.6309761823717674"},_npmUser:{email:"fedor@indutny.com",name:"indutny"},_npmVersion:"6.3.0",_phantomChildren:{},_requested:{name:"elliptic",raw:"elliptic@^6.0.0",rawSpec:"^6.0.0",scope:null,spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/home/administrator/javascript-opentimestamps/node_modules/browserify-sign",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{fileCount:17,integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJba7vUCRA9TVsSAnZWagAA+gcP/jWaj5GmDZ0YFi/X4g5O\nx+pxu9i3HbP9YqywT7rz3XFXSaytu0LQDeDEbddl523X69tsbKfzHRTcnW8n\n2r0VjPhttRm+0RpEhBwjSIK34VkQA1xIWh2ugOToKXVCFVLM5VFDPGzbiN6x\n/hpL7gj1hoCRVmuhjnqFQ+vPKACKfv1Eq4CsRmu2focmP37kQpWQlweD/z4V\nJF4NxA33Fvp13Fl+9g4sPHyhUVsW9ojVaG3Ijn70pCaGQM18UPlbODkWQ1QX\nAgteOFjkIOtcalJk3B3qsM8GZeHEcAFvt2T73miJkHdCGNmRQS45Ede+gnj0\nlLlZJsCCKUHtTqrlprHo6AgMnBZufmytyozYAHC1/JYniazSBi2yPHtQeniR\nl69BfiRBdD2rNrMPwmCNRkMqrgel5WMGpaD0xdaFAHF1Ru2ZQFKsA7KvPGgp\nA20+LN11cCib67Pg5XDyrZ92T3yXec+6gQ3iq9d9UBZKFGl0P8ebVqq1LrUJ\na6nekwMpRISWnKcqV72XVmQdBmUWHq9VfVLsWJzVIJqtpHmUO7q74ACP3i4W\n0/F1REeI0YEhh3NjeStdDecfjlu7PY0pLQpbk2I3ms+6DO+cAfeDEev5jFBK\nwQabRNhITeT1FVtxZAcApj33fnCdqwaWr1NS00K5ZRqhDTTzPr/O4KRN4CR1\npstU\r\n=UVBB\r\n-----END PGP SIGNATURE-----\r\n",shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",unpackedSize:118371},files:["lib"],gitHead:"523da1cf71ddcfd607fbdee1858bc2af47f0e700",homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.1"}},{}],269:[function(e,t,r){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function c(e){return"function"==typeof e}function u(e){return"object"===(void 0===e?"undefined":_typeof(e))&&null!==e}function f(e){return void 0===e}((t.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},i.prototype.emit=function(e){var t,r,i,n,a,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(f(r=this._events[e]))return!1;if(c(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=Array.prototype.slice.call(arguments,1),r.apply(this,n)}else if(u(r))for(n=Array.prototype.slice.call(arguments,1),i=(o=r.slice()).length,a=0;ar&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!c(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,a;if(!c(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||c(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(r)){for(a=n;0=this._blockSize;){for(var n=this._blockOffset;n=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=n.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,a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":310}],310:[function(e,t,r){"use strict";var u=e("minimalistic-assert"),i=e("inherits");function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function o(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}r.inherits=i,r.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:320,"minimalistic-assert":353}],311:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),i=o.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length1e3*t.clockSkew)throw new E("clock skew of "+g/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach(function(e){if(u.params.headers.indexOf(e.toLowerCase())<0)throw new P(e+" was not a signed header")}),t.algorithms&&-1===t.algorithms.indexOf(u.params.algorithm))throw new I(u.params.algorithm+" is not a supported algorithm");return u.algorithm=u.params.algorithm.toUpperCase(),u.keyId=u.params.keyId,u}}},{"./utils":315,"assert-plus":66,util:505}],314:[function(n,a,e){(function(l){var d=n("assert-plus"),m=n("crypto"),e=(n("http"),n("util")),g=n("sshpk"),v=n("jsprim"),t=n("./utils"),b=n("util").format,y=t.HASH_ALGOS,_=t.PK_ALGOS,w=t.InvalidAlgorithmError,r=t.HttpSignatureError,k=t.validateAlgorithm,x='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';function S(e){r.call(this,e,S)}function j(e){r.call(this,e,j)}function i(e){d.object(e,"options");var t=[];if(void 0!==e.algorithm&&(d.string(e.algorithm,"options.algorithm"),t=k(e.algorithm)),this.rs_alg=t,void 0!==e.sign)d.func(e.sign,"options.sign"),this.rs_signFunc=e.sign;else if("hmac"===t[0]&&void 0!==e.key){if(d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,"string"!=typeof e.key&&!l.isBuffer(e.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=m.createHmac(t[1].toUpperCase(),e.key),this.rs_signer.sign=function(){var e=this.digest("base64");return{hashAlgorithm:t[1],toString:function(){return e}}}}else{if(void 0===e.key)throw new TypeError("options.sign (func) or options.key is required");var r=e.key;if(("string"==typeof r||l.isBuffer(r))&&(r=g.parsePrivateKey(r)),d.ok(g.PrivateKey.isPrivateKey(r,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=r,d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,!_[r.type])throw new w(r.type.toUpperCase()+" type keys are not supported");if(void 0!==t[0]&&r.type!==t[0])throw new w("options.key must be a "+t[0].toUpperCase()+" key, was given a "+r.type.toUpperCase()+" key instead");this.rs_signer=r.createSign(t[1])}this.rs_headers=[],this.rs_lines=[]}e.inherits(S,r),e.inherits(j,r),i.prototype.writeHeader=function(e,t){if(d.string(e,"header"),e=e.toLowerCase(),d.string(t,"value"),this.rs_headers.push(e),this.rs_signFunc)this.rs_lines.push(e+": "+t);else{var r=e+": "+t;0>1,f=-7,p=r?n-1:0,h=r?-1:1,l=e[t+p];for(p+=h,a=l&(1<<-f)-1,l>>=-f,f+=s;0>=-f,f+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:a-1,d=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),2<=(t+=1<=o+p?h/c:h*Math.pow(2,1-p))*c&&(o++,c/=2),f<=o+p?(s=0,o=f):1<=o+p?(s=(t*c-1)*Math.pow(2,n),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,n),o=0));8<=n;e[r+l]=255&s,l+=d,s/=256,n-=8);for(o=o<>15;0<=--a;){var c=32767&this[e],u=this[e++]>>15,f=s*c+u*o;n=((c=o*c+((32767&f)<<15)+r[i]+(1073741823&n))>>>30)+(f>>>15)+s*u+(n>>>30),r[i++]=1073741823&c}return n},30):t&&"Netscape"!=navigator.appName?(y.prototype.am=function(e,t,r,i,n,a){for(;0<=--a;){var o=t*this[e++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},26):(y.prototype.am=function(e,t,r,i,n,a){for(var o=16383&t,s=t>>14;0<=--a;){var c=16383&this[e],u=this[e++]>>14,f=s*c+u*o;n=((c=o*c+((16383&f)<<14)+r[i]+n)>>28)+(f>>14)+s*u,r[i++]=268435455&c}return n},28),y.prototype.DB=e,y.prototype.DM=(1<>>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 v(e){this.m=e}function b(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 l(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function d(){}function m(e){return e}function k(e){this.r2=_(),this.q3=_(),y.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},b.prototype.convert=function(e){var t=_();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&0>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),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},b.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.copyTo=function(e){for(var t=this.t-1;0<=t;--t)e[t]=this[t];e.t=this.t,e.s=this.s},y.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0this.DB?(this[this.t-1]|=(o&(1<>this.DB-a):this[this.t-1]|=o<=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,0>n|s,s=(this[r]&a)<=this.t)t.t=0;else{var i=e%this.DB,n=this.DB-i,a=(1<>i;for(var o=r+1;o>i;0>=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:0=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}0>this.F2:0),h=this.FV/p,l=(1<>s)&&(n=!0,a=c(r));0<=o;)s>(s+=this.DB-t)):(r=this[o]>>(s-=t)&i,s<=0&&(s+=this.DB,--o)),02*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=_();return e.copyTo(t),this.reduce(t),t},k.prototype.revert=function(e){return e},k.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);0<=e.compareTo(this.m);)e.subTo(this.m,e)},k.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},k.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x,S,j,E=[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],A=(1<<26)/E[E.length-1];function I(){var e;e=(new Date).getTime(),S[j++]^=255&e,S[j++]^=e>>8&255,S[j++]^=e>>16&255,S[j++]^=e>>24&255,R<=j&&(j-=R)}if(y.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},y.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||36=r&&(this.dMultiply(i),this.dAddOffset(o,0),o=a=0))}0e&&this.subTo(y.ONE.shiftLeft(e-1),this);else{var i=new Array,n=7&e;i.length=1+(e>>3),t.nextBytes(i),0>=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,0=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},y.prototype.multiplyLowerTo=function(e,t,r){var i,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;0>1)>E.length&&(e=E.length);for(var n=_(),a=0;a>24},y.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},y.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},y.prototype.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(0>i)!=(this.s&this.DM)>>i&&(t[n++]=r|this.s<>(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,(0=this.t?0!=this.s:0!=(this[t]&1<>n-c&u:(p=(e[l]&(1<>this.DB+n-c)),s=r;0==(1&p);)p>>=1,--s;if((n-=s)<0&&(n+=this.DB,--l),d)o[p].copyTo(a),d=!1;else{for(;1>>8,S[j++]=255&P;j=0,I()}function B(){if(null==x){for(I(),(x=new F).init(S),j=0;jt.maxItems&&n("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&m.concat(function(e,t,r,i){if("object"==(void 0===t?"undefined":_typeof(t)))for(var n in("object"!=(void 0===e?"undefined":_typeof(e))||e instanceof Array)&&m.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(n)){var a=e[n];if(void 0===a&&h.existingOnly)continue;var o=t[n];void 0===a&&o.default&&(a=e[n]=o.default),h.coerce&&n in e&&(a=e[n]=h.coerce(a,o)),g(a,o,r,n)}for(n in e){if(e.hasOwnProperty(n)&&("_"!=n.charAt(0)||"_"!=n.charAt(1))&&t&&!t[n]&&!1===i){if(h.filter){delete e[n];continue}m.push({property:r,message:(void 0===a?"undefined":_typeof(a))+"The property "+n+" is not defined in the schema and the schema does not allow additional properties"})}var s=t&&t[n]&&t[n].requires;!s||s in e||m.push({property:r,message:"the presence of the property "+n+" requires that "+s+" also be present"}),a=e[n],!i||t&&"object"==(void 0===t?"undefined":_typeof(t))&&n in t||(h.coerce&&(a=e[n]=h.coerce(a,i)),g(a,i,r,n)),!l&&a&&a.$schema&&(m=m.concat(g(a,a.$schema,r,n)))}return m}(e,t.properties,o,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&n("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&n("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.lengthe&&n("must have a minimum value of "+t.minimum),void 0!==_typeof(t.maximum)&&(void 0===e?"undefined":_typeof(e))==_typeof(t.maximum)&&t.maximum= 2"),d.ok(n.base<=36,"options.base <= 36"),d.bool(n.allowSign,"options.allowSign"),d.bool(n.allowPrefix,"options.allowPrefix"),d.bool(n.allowTrailing,"options.allowTrailing"),d.bool(n.allowImprecise,"options.allowImprecise"),d.bool(n.trimWhitespace,"options.trimWhitespace"),d.bool(n.leadingZeroIsOctal,"options.leadingZeroIsOctal"),n.leadingZeroIsOctal&&d.ok(!i,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var a,o=-1,s=n.base,c=1,u=0,f=0,p=e.length;if(n.trimWhitespace)for(;ft[0]||e[0]==t[0]&&e[1]>=t[1],"negative differences not allowed");var r=[e[0]-t[0],0];return e[1]>=t[1]?r[1]=e[1]-t[1]:(r[0]--,r[1]=1e9-(t[1]-e[1])),r}function R(e,t){return C(e),C(t),e[1]+=t[1],1e9<=e[1]&&(e[0]++,e[1]-=1e9),e[0]+=t[0],e}function z(e,t,r){var i,n;if(i={},r)for(n in r)i[n]=r[n];if(e)for(n in e)i[n]=e[n];if(t)for(n in t)i[n]=t[n];return i}},{"assert-plus":66,extsprintf:272,"json-schema":327,util:505,verror:509}],330:[function(e,t,r){"use strict";t.exports=e("./lib/api")(e("./lib/keccak"))},{"./lib/api":331,"./lib/keccak":335}],331:[function(e,t,r){"use strict";var n=e("./keccak"),a=e("./shake");t.exports=function(e){var r=n(e),i=a(e);return function(e,t){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new r(1152,448,null,224,t);case"keccak256":return new r(1088,512,null,256,t);case"keccak384":return new r(832,768,null,384,t);case"keccak512":return new r(576,1024,null,512,t);case"sha3-224":return new r(1152,448,6,224,t);case"sha3-256":return new r(1088,512,6,256,t);case"sha3-384":return new r(832,768,6,384,t);case"sha3-512":return new r(576,1024,6,512,t);case"shake128":return new i(1344,256,31,t);case"shake256":return new i(1088,512,31,t);default:throw new Error("Invald algorithm: "+e)}}}},{"./keccak":332,"./shake":333}],332:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,o=e("stream").Transform,n=e("inherits");t.exports=function(a){function t(e,t,r,i,n){o.call(this,n),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._hashBitLength=i,this._options=n,this._state=new a,this._state.initialize(e,t),this._finalized=!1}return n(t,o),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],333:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("stream").Transform,o=e("inherits");t.exports=function(n){function t(e,t,r,i){a.call(this,i),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._options=i,this._state=new n,this._state.initialize(e,t),this._finalized=!1}return o(t,a),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],334:[function(e,t,r){"use strict";var ot=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];r.p1600=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],n=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],h=f^(n<<1|a>>>31),l=p^(a<<1|n>>>31),d=e[0]^h,m=e[1]^l,g=e[10]^h,v=e[11]^l,b=e[20]^h,y=e[21]^l,_=e[30]^h,w=e[31]^l,k=e[40]^h,x=e[41]^l;h=r^(o<<1|s>>>31),l=i^(s<<1|o>>>31);var S=e[2]^h,j=e[3]^l,E=e[12]^h,A=e[13]^l,I=e[22]^h,P=e[23]^l,O=e[32]^h,T=e[33]^l,B=e[42]^h,C=e[43]^l;h=n^(c<<1|u>>>31),l=a^(u<<1|c>>>31);var F=e[4]^h,R=e[5]^l,z=e[14]^h,M=e[15]^l,N=e[24]^h,D=e[25]^l,q=e[34]^h,L=e[35]^l,U=e[44]^h,H=e[45]^l;h=o^(f<<1|p>>>31),l=s^(p<<1|f>>>31);var K=e[6]^h,V=e[7]^l,G=e[16]^h,$=e[17]^l,W=e[26]^h,Z=e[27]^l,Y=e[36]^h,X=e[37]^l,J=e[46]^h,Q=e[47]^l;h=c^(r<<1|i>>>31),l=u^(i<<1|r>>>31);var ee=e[8]^h,te=e[9]^l,re=e[18]^h,ie=e[19]^l,ne=e[28]^h,ae=e[29]^l,oe=e[38]^h,se=e[39]^l,ce=e[48]^h,ue=e[49]^l,fe=d,pe=m,he=v<<4|g>>>28,le=g<<4|v>>>28,de=b<<3|y>>>29,me=y<<3|b>>>29,ge=w<<9|_>>>23,ve=_<<9|w>>>23,be=k<<18|x>>>14,ye=x<<18|k>>>14,_e=S<<1|j>>>31,we=j<<1|S>>>31,ke=A<<12|E>>>20,xe=E<<12|A>>>20,Se=I<<10|P>>>22,je=P<<10|I>>>22,Ee=T<<13|O>>>19,Ae=O<<13|T>>>19,Ie=B<<2|C>>>30,Pe=C<<2|B>>>30,Oe=R<<30|F>>>2,Te=F<<30|R>>>2,Be=z<<6|M>>>26,Ce=M<<6|z>>>26,Fe=D<<11|N>>>21,Re=N<<11|D>>>21,ze=q<<15|L>>>17,Me=L<<15|q>>>17,Ne=H<<29|U>>>3,De=U<<29|H>>>3,qe=K<<28|V>>>4,Le=V<<28|K>>>4,Ue=$<<23|G>>>9,He=G<<23|$>>>9,Ke=W<<25|Z>>>7,Ve=Z<<25|W>>>7,Ge=Y<<21|X>>>11,$e=X<<21|Y>>>11,We=Q<<24|J>>>8,Ze=J<<24|Q>>>8,Ye=ee<<27|te>>>5,Xe=te<<27|ee>>>5,Je=re<<20|ie>>>12,Qe=ie<<20|re>>>12,et=ae<<7|ne>>>25,tt=ne<<7|ae>>>25,rt=oe<<8|se>>>24,it=se<<8|oe>>>24,nt=ce<<14|ue>>>18,at=ue<<14|ce>>>18;e[0]=fe^~ke&Fe,e[1]=pe^~xe&Re,e[10]=qe^~Je&de,e[11]=Le^~Qe&me,e[20]=_e^~Be&Ke,e[21]=we^~Ce&Ve,e[30]=Ye^~he&Se,e[31]=Xe^~le&je,e[40]=Oe^~Ue&et,e[41]=Te^~He&tt,e[2]=ke^~Fe&Ge,e[3]=xe^~Re&$e,e[12]=Je^~de&Ee,e[13]=Qe^~me&Ae,e[22]=Be^~Ke&rt,e[23]=Ce^~Ve&it,e[32]=he^~Se&ze,e[33]=le^~je&Me,e[42]=Ue^~et&ge,e[43]=He^~tt&ve,e[4]=Fe^~Ge&nt,e[5]=Re^~$e&at,e[14]=de^~Ee&Ne,e[15]=me^~Ae&De,e[24]=Ke^~rt&be,e[25]=Ve^~it&ye,e[34]=Se^~ze&We,e[35]=je^~Me&Ze,e[44]=et^~ge&Ie,e[45]=tt^~ve&Pe,e[6]=Ge^~nt&fe,e[7]=$e^~at&pe,e[16]=Ee^~Ne&qe,e[17]=Ae^~De&Le,e[26]=rt^~be&_e,e[27]=it^~ye&we,e[36]=ze^~We&Ye,e[37]=Me^~Ze&Xe,e[46]=ge^~Ie&Oe,e[47]=ve^~Pe&Te,e[8]=nt^~fe&ke,e[9]=at^~pe&xe,e[18]=Ne^~qe&Je,e[19]=De^~Le&Qe,e[28]=be^~_e&Be,e[29]=ye^~we&Ce,e[38]=We^~Ye&he,e[39]=Ze^~Xe&le,e[48]=Ie^~Oe&Ue,e[49]=Pe^~Te&He,e[0]^=ot[2*t],e[1]^=ot[2*t+1]}}},{}],335:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=e("./keccak-state-unroll");function a(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}a.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},a.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},a.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},t.exports=a},{"./keccak-state-unroll":334,"safe-buffer":447}],336:[function(e,t,r){var i=e("./_root").Symbol;t.exports=i},{"./_root":341}],337:[function(e,t,r){var i=e("./_Symbol"),n=e("./_getRawTag"),a=e("./_objectToString"),o=i?i.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},{"./_Symbol":336,"./_getRawTag":339,"./_objectToString":340}],338:[function(e,r,t){(function(e){var t="object"==(void 0===e?"undefined":_typeof(e))&&e&&e.Object===Object&&e;r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],339:[function(e,t,r){var i=e("./_Symbol"),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,s=i?i.toStringTag:void 0;t.exports=function(e){var t=a.call(e,s),r=e[s];try{var i=!(e[s]=void 0)}catch(e){}var n=o.call(e);return i&&(t?e[s]=r:delete e[s]),n}},{"./_Symbol":336}],340:[function(e,t,r){var i=Object.prototype.toString;t.exports=function(e){return i.call(e)}},{}],341:[function(e,t,r){var i=e("./_freeGlobal"),n="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,a=i||n||Function("return this")();t.exports=a},{"./_freeGlobal":338}],342:[function(e,t,r){var i=Array.isArray;t.exports=i},{}],343:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isObject");t.exports=function(e){if(!n(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},{"./_baseGetTag":337,"./isObject":344}],344:[function(e,t,r){t.exports=function(e){var t=void 0===e?"undefined":_typeof(e);return null!=e&&("object"==t||"function"==t)}},{}],345:[function(e,t,r){t.exports=function(e){return null!=e&&"object"==(void 0===e?"undefined":_typeof(e))}},{}],346:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isArray"),a=e("./isObjectLike");t.exports=function(e){return"string"==typeof e||!n(e)&&a(e)&&"[object String]"==i(e)}},{"./_baseGetTag":337,"./isArray":342,"./isObjectLike":345}],347:[function(e,t,r){t.exports=function(e){return void 0===e}},{}],348:[function(e,t,r){"use strict";var i=e("inherits"),n=e("hash-base"),a=e("safe-buffer").Buffer,o=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,r,i,n,a,o){return c(e+(t&r|~t&i)+n+a|0,o)+t|0}function f(e,t,r,i,n,a,o){return c(e+(t&i|r&~i)+n+a|0,o)+t|0}function p(e,t,r,i,n,a,o){return c(e+(t^r^i)+n+a|0,o)+t|0}function h(e,t,r,i,n,a,o){return c(e+(r^(t|~i))+n+a|0,o)+t|0}i(s,n),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,a=this._d;i=h(i=h(i=h(i=h(i=p(i=p(i=p(i=p(i=f(i=f(i=f(i=f(i=u(i=u(i=u(i=u(i,n=u(n,a=u(a,r=u(r,i,n,a,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),a,r,e[3],3250441966,22),n=u(n,a=u(a,r=u(r,i,n,a,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),a,r,e[7],4249261313,22),n=u(n,a=u(a,r=u(r,i,n,a,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),a,r,e[11],2304563134,22),n=u(n,a=u(a,r=u(r,i,n,a,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),a,r,e[15],1236535329,22),n=f(n,a=f(a,r=f(r,i,n,a,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),a,r,e[0],3921069994,20),n=f(n,a=f(a,r=f(r,i,n,a,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),a,r,e[4],3889429448,20),n=f(n,a=f(a,r=f(r,i,n,a,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),a,r,e[8],1163531501,20),n=f(n,a=f(a,r=f(r,i,n,a,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),a,r,e[12],2368359562,20),n=p(n,a=p(a,r=p(r,i,n,a,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),a,r,e[14],4259657740,23),n=p(n,a=p(a,r=p(r,i,n,a,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),a,r,e[10],3200236656,23),n=p(n,a=p(a,r=p(r,i,n,a,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),a,r,e[6],76029189,23),n=p(n,a=p(a,r=p(r,i,n,a,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),a,r,e[2],3299628645,23),n=h(n,a=h(a,r=h(r,i,n,a,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),a,r,e[5],4237533241,21),n=h(n,a=h(a,r=h(r,i,n,a,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),a,r,e[1],2240044497,21),n=h(n,a=h(a,r=h(r,i,n,a,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),a,r,e[13],1309151649,21),n=h(n,a=h(a,r=h(r,i,n,a,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),a,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+a|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e}},{}],355:[function(e,t,r){(t.exports=o).Minimatch=n;var u={sep:"/"};try{u=e("path")}catch(e){}var z=o.GLOBSTAR=n.GLOBSTAR={},i=e("brace-expansion"),M={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},N="[^/]*?",D="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{});var f=/\/+/;function a(t,r){t=t||{},r=r||{};var i={};return Object.keys(r).forEach(function(e){i[e]=r[e]}),Object.keys(t).forEach(function(e){i[e]=t[e]}),i}function o(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new n(t,r).match(e))}function n(e,t){if(!(this instanceof n))return new n(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==u.sep&&(e=e.split(u.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function s(e,t){if(t||(t=this instanceof n?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:i(e)}o.filter=function(i,n){return n=n||{},function(e,t,r){return o(e,i,n)}},o.defaults=function(i){if(!i||!Object.keys(i).length)return o;var n=o,e=function(e,t,r){return n.minimatch(e,t,a(i,r))};return e.Minimatch=function(e,t){return new n.Minimatch(e,a(i,t))},e},n.defaults=function(e){return e&&Object.keys(e).length?o.defaults(e).Minimatch:n},n.prototype.debug=function(){},n.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(f)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r},n.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=this.options,i=0;if(r.nonegate)return;for(var n=0,a=e.length;n>> no match, partial?",e,p,t,h),p!==o))}if("string"==typeof u?(c=i.nocase?f.toLowerCase()===u.toLowerCase():f===u,this.debug("string match",u,f,c)):(c=f.match(u),this.debug("pattern match",u,f,c)),!c)return!1}if(n===o&&a===s)return!0;if(n===o)return r;if(a===s)return n===o-1&&""===e[n];throw new Error("wtf?")}},{"brace-expansion":155,path:374}],356:[function(e,t,r){var c=e("crypto");function o(e,t,r){return c.createHmac(r,e).update(t).digest("base64")}function s(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function n(e,t){return t>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var n=s,a=i+r;e^=-1;for(var o=i;o>>8^n[255&(e^t[o])];return-1^e}},{}],362:[function(e,t,r){"use strict";var c,h=e("../utils/common"),u=e("./trees"),l=e("./adler32"),d=e("./crc32"),i=e("./messages"),f=0,p=4,m=0,g=-2,v=-1,b=4,n=2,y=8,_=9,a=286,o=30,s=19,w=2*a+1,k=15,x=3,S=258,j=S+x+1,E=42,A=113,I=1,P=2,O=3,T=4;function B(e,t){return e.msg=i[t],t}function C(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(h.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function z(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,R(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function N(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function D(e,t){var r,i,n=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-j?e.strstart-(e.w_size-j):0,u=e.window,f=e.w_mask,p=e.prev,h=e.strstart+S,l=u[a+o-1],d=u[a+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===d&&u[r+o-1]===l&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ac&&0!=--n);return o<=e.lookahead?o:e.lookahead}function q(e){var t,r,i,n,a,o,s,c,u,f,p=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-j)){for(h.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;i=e.head[--t],e.head[t]=p<=i?i-p:0,--r;);for(t=r=p;i=e.prev[--t],e.prev[t]=p<=i?i-p:0,--r;);n+=p}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,c=e.strstart+e.lookahead,u=n,f=void 0,f=o.avail_in,u=x)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(i=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(n=e.strstart+e.lookahead-x,i=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=n&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(q(e),0===e.lookahead&&t===f)return I;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,z(e,!1),0===e.strm.avail_out))return I;if(e.strstart-e.block_start>=e.w_size-j&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):(e.strstart>e.block_start&&(z(e,!1),e.strm.avail_out),I)}),new H(4,4,8,4,L),new H(4,5,16,8,L),new H(4,6,32,32,L),new H(4,4,16,16,U),new H(8,16,32,32,U),new H(8,16,128,128,U),new H(8,32,128,256,U),new H(32,128,258,1024,U),new H(32,258,258,4096,U)],r.deflateInit=function(e,t){return $(e,t,y,15,8,0)},r.deflateInit2=$,r.deflateReset=G,r.deflateResetKeep=V,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,m):g},r.deflate=function(e,t){var r,i,n,a;if(!e||!e.state||5>8&255),M(i,i.gzhead.time>>16&255),M(i,i.gzhead.time>>24&255),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(M(i,255&i.gzhead.extra.length),M(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=d(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(M(i,0),M(i,0),M(i,0),M(i,0),M(i,0),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,3),i.status=A);else{var o=y+(i.w_bits-8<<4)<<8;o|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(o|=32),o+=31-o%31,i.status=A,N(i,o),0!==i.strstart&&(N(i,e.adler>>>16),N(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending!==i.pending_buf_size));)M(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&R(e),i.pending+2<=i.pending_buf_size&&(M(i,255&e.adler),M(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(R(e),0===e.avail_out)return i.last_flush=-1,m}else if(0===e.avail_in&&C(t)<=C(r)&&t!==p)return B(e,-5);if(666===i.status&&0!==e.avail_in)return B(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==f&&666!==i.status){var s=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(q(e),0===e.lookahead)){if(t===f)return I;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):3===i.strategy?function(e,t){for(var r,i,n,a,o=e.window;;){if(e.lookahead<=S){if(q(e),e.lookahead<=S&&t===f)return I;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):c[i.level].func(i,t);if(s!==O&&s!==T||(i.status=666),s===I||s===O)return 0===e.avail_out&&(i.last_flush=-1),m;if(s===P&&(1===t?u._tr_align(i):5!==t&&(u._tr_stored_block(i,0,0,!1),3===t&&(F(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),R(e),0===e.avail_out))return i.last_flush=-1,m}return t!==p?m:i.wrap<=0?1:(2===i.wrap?(M(i,255&e.adler),M(i,e.adler>>8&255),M(i,e.adler>>16&255),M(i,e.adler>>24&255),M(i,255&e.total_in),M(i,e.total_in>>8&255),M(i,e.total_in>>16&255),M(i,e.total_in>>24&255)):(N(i,e.adler>>>16),N(i,65535&e.adler)),R(e),0=r.w_size&&(0===a&&(F(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new h.Buf8(r.w_size),h.arraySet(u,t,f-r.w_size,r.w_size,0),t=u,f=r.w_size),o=e.avail_in,s=e.next_in,c=e.input,e.avail_in=f,e.next_in=0,e.input=t,q(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=_=y>>>24,d-=_,0===(_=y>>>16&255))E[a++]=65535&y;else{if(!(16&_)){if(0==(64&_)){y=m[(65535&y)+(l&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&y,(_&=15)&&(d<_&&(l+=j[i++]<>>=_,d-=_),d<15&&(l+=j[i++]<>>=_=y>>>24,d-=_,!(16&(_=y>>>16&255))){if(0==(64&_)){y=g[(65535&y)+(l&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&y,d<(_&=15)&&(l+=j[i++]<>>=_,d-=_,(_=a-o)>3,l&=(1<<(d-=w<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new P.Buf16(320),this.work=new P.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=N,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new P.Buf32(i),t.distcode=t.distdyn=new P.Buf32(n),t.sane=1,t.back=-1,z):M}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):M}function c(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=a.wsize?(P.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(n=a.wsize-a.wnext)&&(n=i),P.arraySet(a.window,t,r-i,n,a.wnext),(i-=n)?(P.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=T(r.check,A,2,0),f=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(f-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=3;case 3:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>8&255,A[2]=u>>>16&255,A[3]=u>>>24&255,r.check=T(r.check,A,4,0)),f=u=0,r.mode=4;case 4:for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>8),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>>8&255,r.check=T(r.check,A,2,0)),f=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(s<(l=r.length)&&(l=s),l&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),P.arraySet(r.head.extra,i,a,l,k)),512&r.flags&&(r.check=T(r.check,i,l,a)),s-=l,a+=l,r.length-=l),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;for(l=0;k=i[a+l++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&l>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>=7&f,f-=7&f,r.mode=27;break}for(;f<3;){if(0===s)break e;s--,u+=i[a++]<>>=1)){case 0:r.mode=14;break;case 1:if(q(r),r.mode=20,6!==t)break;u>>>=2,f-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,f-=2;break;case 14:for(u>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,u+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,f=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(l=r.length){if(s>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,286>>=3,f-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=C(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=g,f-=g,r.lens[r.have++]=b;else{if(16===b){for(j=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],l=3+(3&u),u>>>=2,f-=2}else if(17===b){for(j=g+3;f>>=g)),u>>>=3,f-=3}else{for(j=g+7;f>>=g)),u>>>=7,f-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;l--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=C(F,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=C(R,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=s&&258<=c){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,r.hold=u,r.bits=f,B(e,h),o=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,u=r.hold,f=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;v=(E=r.lencode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,r.length=b,0===v){r.mode=26;break}if(32&v){r.back=-1,r.mode=12;break}if(64&v){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&v,r.mode=22;case 22:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=(E=r.distcode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&v,r.mode=24;case 24:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===c)break e;if(l=h-c,r.offset>l){if((l=r.offset-l)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d=l>r.wnext?(l-=r.wnext,r.wsize-l):r.wnext-l,l>r.length&&(l=r.length),m=r.window}else m=n,d=o-r.offset,l=r.length;for(cl?(m=B[C+o[y]],I[P+o[y]]):(m=96,0),c=1<>S)+(u-=c)]=d<<24|m<<16|g|0,0!==u;);for(c=1<>=1;if(0!==c?(A&=c-1,A+=c):A=0,y++,0==--O[b]){if(b===w)break;b=t[r+o[y]]}if(k>>7)]}function M(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function N(e,t,r){e.bi_valid>n-r?(e.bi_buf|=t<>n-e.bi_valid,e.bi_valid+=r-n):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function L(e,t,r){var i,n,a=new Array(v+1),o=0;for(i=1;i<=v;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=q(a[s]++,s))}}function U(e){var t;for(t=0;t>1;1<=r;r--)V(e,a,r);for(n=c;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],V(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,a[2*n]=a[2*r]+a[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,a[2*r+1]=a[2*i+1]=n,e.heap[1]=n++,V(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,n,a,o,s,c=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,p=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(a=0;a<=v;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return s;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return u;for(t=32;t>>3,(a=e.static_len+3+7>>>3)<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==t?X(e,t,r,i):4===e.strategy||a===n?(N(e,2+(i?1:0),3),G(e,E,A)):(N(e,4+(i?1:0),3),function(e,t,r,i){var n;for(N(e,t-257,5),N(e,r-1,5),N(e,i-4,4),n=0;n>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(P[r]+p+1)]++,e.dyn_dtree[2*z(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;N(e,2,3),D(e,b,E),16===(t=e).bi_valid?(M(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":358}],368:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],369:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],370:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var a=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=a;var o=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=o;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var f=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=f,r.DSAparam=i.define("DSAparam",function(){this.int()});var p=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=p;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":371,"asn1.js":46}],371:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),a=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(a)}),u=i.define("RDNSequence",function(){this.seqof(c)}),f=i.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),p=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(f),this.key("validity").use(p),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),d=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=d},{"asn1.js":46}],372:[function(e,t,r){(function(h){var l=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,d=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m,m=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,g=e("evp_bytestokey"),v=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(l);if(n){var a="aes"+n[1],o=new h(n[2],"hex"),s=new h(n[3].replace(/[\r\n]/g,""),"base64"),c=g(t,o.slice(0,8),parseInt(n[1],10)).key,u=[],f=v.createDecipheriv(a,c,o);u.push(f.update(s)),u.push(f.final()),r=h.concat(u)}else{var p=i.match(m);r=new h(p[2].replace(/[\r\n]/g,""),"base64")}return{tag:i.match(d)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":160,buffer:191,evp_bytestokey:270}],373:[function(t,r,e){(function(b){var y=t("./asn1"),_=t("./aesid.json"),w=t("./fixProc"),k=t("browserify-aes"),x=t("pbkdf2");function e(e){var t;"object"!==(void 0===e?"undefined":_typeof(e))||b.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new b(e));var r,i,n,a,o,s,c,u,f,p,h,l,d,m=w(e,t),g=m.tag,v=m.data;switch(g){case"CERTIFICATE":i=y.certificate.decode(v,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=y.PublicKey.decode(v,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=y.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"ENCRYPTED PRIVATE KEY":v=y.EncryptedPrivateKey.decode(v,"der"),a=t,o=(n=v).algorithm.decrypt.kde.kdeparams.salt,s=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=_[n.algorithm.decrypt.cipher.algo.join(".")],u=n.algorithm.decrypt.cipher.iv,f=n.subjectPrivateKey,p=parseInt(c.split("-")[1],10)/8,h=x.pbkdf2Sync(a,o,s,p),l=k.createDecipheriv(c,h,u),(d=[]).push(l.update(f)),d.push(l.final()),v=b.concat(d);case"PRIVATE KEY":switch(r=(i=y.PrivateKey.decode(v,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:y.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=y.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"RSA PUBLIC KEY":return y.RSAPublicKey.decode(v,"der");case"RSA PRIVATE KEY":return y.RSAPrivateKey.decode(v,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:y.DSAPrivateKey.decode(v,"der")};case"EC PRIVATE KEY":return{curve:(v=y.ECPrivateKey.decode(v,"der")).parameters.value,privateKey:v.privateKey};default:throw new Error("unknown key type "+g)}}(r.exports=e).signature=y.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":369,"./asn1":370,"./fixProc":372,"browserify-aes":160,buffer:191,pbkdf2:375}],374:[function(e,t,u){(function(n){function a(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function o(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;ia?t=n(t):t.length "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+o+";","var res;","switch (argLength) {",r.concat(["extra"]).map(function(e,t){return"case "+t+":res = fn.call("+["self"].concat(r.slice(0,t)).concat("cb").join(",")+");break;"}).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],n)(a,e)}(e)};var o="function (err, res) {if (err) { rj(err); } else { rs(res); }}";a.nodeify=function(r){return function(){var e=Array.prototype.slice.call(arguments),t="function"==typeof e[e.length-1]?e.pop():null,i=this;try{return r.apply(this,arguments).nodeify(t,i)}catch(r){if(null==t)return new a(function(e,t){t(r)});n(function(){t.call(i,r)})}}},a.prototype.nodeify=function(t,r){if("function"!=typeof t)return this;this.then(function(e){n(function(){t.call(r,null,e)})},function(e){n(function(){t.call(r,e)})})}},{"./core.js":384,asap:44}],390:[function(e,t,r){"use strict";var i=e("./core.js");(t.exports=i).enableSynchronous=function(){i.prototype.isPending=function(){return 0==this.getState()},i.prototype.isFulfilled=function(){return 1==this.getState()},i.prototype.isRejected=function(){return 2==this.getState()},i.prototype.getValue=function(){if(3===this._65)return this._55.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._55},i.prototype.getReason=function(){if(3===this._65)return this._55.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._55},i.prototype.getState=function(){return 3===this._65?this._55.getState():-1===this._65||-2===this._65?0:this._65}},i.disableSynchronous=function(){i.prototype.isPending=void 0,i.prototype.isFulfilled=void 0,i.prototype.isRejected=void 0,i.prototype.getValue=void 0,i.prototype.getReason=void 0,i.prototype.getState=void 0}},{"./core.js":384}],391:[function(e,t,r){"use strict";var n=function(e){for(var t=e.toString(16);4!==t.length;)t="0"+t;return"\\u"+t};t.exports=function(e,t,r,i){return!r.key||61!==t&&58!==t&&t!==r.separator?31o||0<=new u(t).cmp(a.modulus))throw new Error("decryption error");n=r?d(new u(t),a):h(t,a);var s=m.alloc(o-n.length);if(n=m.concat([s,n],o),4===i)return function(e,t){var r=e.modulus.byteLength(),i=l("sha1").update(m.alloc(0)).digest(),n=i.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,n+1),o=t.slice(n+1),s=p(a,f(o,n)),c=p(o,f(s,r-n-1));if(function(e,t){e=m.from(e),t=m.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){a++;break}var o=t.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&a++;o.length<8&&a++;if(a)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}},{"./mgf":401,"./withPublic":404,"./xor":405,"bn.js":154,"browserify-rsa":178,"create-hash":200,"parse-asn1":373,"safe-buffer":447}],403:[function(e,t,r){var o=e("parse-asn1"),h=e("randombytes"),l=e("create-hash"),d=e("./mgf"),m=e("./xor"),g=e("bn.js"),s=e("./withPublic"),c=e("browserify-rsa"),v=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,a=o(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=l("sha1").update(v.alloc(0)).digest(),a=n.length,o=2*a;if(r-o-2>6]+a[128|63&n]:n<55296||57344<=n?r+=a[224|n>>12]+a[128|n>>6&63]+a[128|63&n]:(i+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),r+=a[240|n>>18]+a[128|n>>12&63]+a[128|n>>6&63]+a[128|63&n])}return r},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function i(r,n,a){if(!n)return r;if("object"!==(void 0===n?"undefined":_typeof(n))){if(Array.isArray(r))r.push(n);else{if("object"!==(void 0===r?"undefined":_typeof(r)))return[r,n];(a.plainObjects||a.allowPrototypes||!o.call(Object.prototype,n))&&(r[n]=!0)}return r}if("object"!==(void 0===r?"undefined":_typeof(r)))return[r].concat(n);var e=r;return Array.isArray(r)&&!Array.isArray(n)&&(e=s(r,a)),Array.isArray(r)&&Array.isArray(n)?(n.forEach(function(e,t){o.call(r,t)?r[t]&&"object"===_typeof(r[t])?r[t]=i(r[t],e,a):r.push(e):r[t]=e}),r):Object.keys(n).reduce(function(e,t){var r=n[t];return o.call(e,t)?e[t]=i(e[t],r,a):e[t]=r,e},e)}}},{}],411:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var a=/\+/g;e=e.split(t);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var s,c,u=e.length;0t.highWaterMark&&(t.highWaterMark=(m<=(r=e)?r=m:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(_("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?v.nextTick(x,e):x(e))}function x(e){_("emit readable"),e.emit("readable"),I(e)}function S(e,t){t.readingMore||(t.readingMore=!0,v.nextTick(j,e,t))}function j(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;ea.length?a.length:e;if(o===a.length?n+=a:n+=a.slice(0,e),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=a.slice(o);break}++i}return t.length-=i,n}(e,t):function(e,t){var r=u.allocUnsafe(e),i=t.head,n=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i).data=a.slice(o);break}++n}return t.length-=n,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return _("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):k(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,n=t.needReadable;return _("need readable",n),(0===t.length||t.length-e>>0),a=this.head,o=0;a;)t=a.data,r=n,i=o,t.copy(r,i),o+=a.data.length,a=a.next;return n},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":447,util:157}],423:[function(e,t,r){"use strict";var a=e("process-nextick-args");function o(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a.nextTick(o,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(o,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":381}],424:[function(e,t,r){t.exports=e("events").EventEmitter},{events:269}],425:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":426}],426:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":417,"./lib/_stream_passthrough.js":418,"./lib/_stream_readable.js":419,"./lib/_stream_transform.js":420,"./lib/_stream_writable.js":421}],427:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":426}],428:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":421}],429:[function(e,t,r){"use strict";var s=e("../"),c=e("lodash/isArray"),u=e("lodash/isFunction"),f=e("lodash/isObjectLike");t.exports=function(e){var t="Please verify options";if(!f(e))throw new TypeError(t);if(!u(e.request))throw new TypeError(t+".request");if(!c(e.expose)||0===e.expose.length)throw new TypeError(t+".expose");for(var r=s({PromiseImpl:e.PromiseImpl,constructorMixin:e.constructorMixin}),i=e.request.Request.prototype.init,n=!(e.request.Request.prototype.init=function(e){return!f(e)||this._callback||this._rp_promise||r.init.call(this,e),i.apply(this,arguments)}),a=0;a=t.maxRedirects)return r.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+r.uri.href)),!1;t.redirectsFollowed+=1,o.test(i)||(i=a.resolve(r.uri.href,i));var n=r.uri;return r.uri=a.parse(i),r.uri.protocol!==n.protocol&&delete r.agent,t.redirects.push({statusCode:e.statusCode,redirectUri:i}),t.followAllRedirects&&"HEAD"!==r.method&&401!==e.statusCode&&307!==e.statusCode&&(r.method=t.followOriginalHttpMethod?r.method:"GET"),delete r.src,delete r.req,delete r._started,401!==e.statusCode&&307!==e.statusCode&&(delete r.body,delete r._form,r.headers&&(r.removeHeader("host"),r.removeHeader("content-type"),r.removeHeader("content-length"),r.uri.hostname!==r.originalHost.split(":")[0]&&r.removeHeader("authorization"))),t.removeRefererHeader||r.setHeader("referer",n.href),r.emit("redirect"),r.init(),!0},r.Redirect=i},{url:500}],444:[function(e,t,r){"use strict";var w=e("url"),k=e("tunnel-agent"),i=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],x=["proxy-authorization"];function n(e){this.request=e,this.proxyHeaderWhiteList=i,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}n.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},n.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=w.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,i,n,a,o,s,c=this.proxyHeaderExclusiveList.concat(x),u=this.proxyHeaderWhiteList.concat(c),f=(r=t.headers,i=u.reduce(function(e,t){return e[t.toLowerCase()]=!0,e},{}),Object.keys(r).filter(function(e){return i[e.toLowerCase()]}).reduce(function(e,t){return e[t]=r[t],e},{}));f.host=(n=t.uri,a=n.port,o=n.protocol,s=n.hostname+":",s+=a||("https:"===o?"443":"80")),c.forEach(t.removeHeader,t);var p,h,l,d,m,g,v,b,y=(l=(p=t).uri,d=p.proxy,h=d,m=["https:"===l.protocol?"https":"http","https:"===h.protocol?"Https":"Http"].join("Over"),k[m]),_=(v=f,{proxy:{host:(b=(g=t).proxy).hostname,port:+b.port,proxyAuth:b.auth,headers:v},headers:g.headers,ca:g.ca,cert:g.cert,key:g.key,passphrase:g.passphrase,pfx:g.pfx,ciphers:g.ciphers,rejectUnauthorized:g.rejectUnauthorized,secureOptions:g.secureOptions,secureProtocol:g.secureProtocol});return t.agent=y(_),!0},n.defaultProxyHeaderWhiteList=i,n.defaultProxyHeaderExclusiveList=x,r.Tunnel=n},{"tunnel-agent":497,url:500}],445:[function(U,H,e){(function(e){"use strict";var w=U("http"),k=U("https"),x=U("url"),t=U("util"),n=U("stream"),f=U("zlib"),c=U("aws-sign2"),u=U("aws4"),i=U("http-signature"),S=U("mime-types"),j=U("caseless"),E=U("forever-agent"),r=U("form-data"),a=U("extend"),A=U("isstream"),I=U("is-typedarray").strict,o=U("./lib/helpers"),s=U("./lib/cookies"),P=U("./lib/getProxyFromURI"),p=U("./lib/querystring").Querystring,h=U("./lib/har").Har,l=U("./lib/auth").Auth,d=U("./lib/oauth").OAuth,m=U("./lib/hawk"),g=U("./lib/multipart").Multipart,v=U("./lib/redirect").Redirect,b=U("./lib/tunnel").Tunnel,y=U("performance-now"),O=U("safe-buffer").Buffer,_=o.safeStringify,T=o.isReadStream,B=o.toBase64,C=o.defer,F=o.copy,R=o.version,z=s.jar(),M={};function N(){return{uri:this.uri,method:this.method,headers:this.headers}}function D(){return{statusCode:this.statusCode,body:this.body,headers:this.headers,request:N.call(this.request)}}function q(e){var t=this;e.har&&(t._har=new h(t),e=t._har.options(e)),n.Stream.call(t);var r=Object.keys(q.prototype),i=function(e,t){var r={};for(var i in t)-1===e.indexOf(i)&&(r[i]=t[i]);return r}(r,e);a(t,i),e=function(e,t){var r={};for(var i in t){var n=!(-1===e.indexOf(i)),a="function"==typeof t[i];n&&a||(r[i]=t[i])}return r}(r,e),t.readable=!0,t.writable=!0,e.method&&(t.explicitMethod=!0),t._qs=new p(t),t._auth=new l(t),t._oauth=new d(t),t._multipart=new g(t),t._redirect=new v(t),t._tunnel=new b(t),t.init(e)}function L(){q.debug&&console.error("REQUEST %s",t.format.apply(t,arguments))}t.inherits(q,n.Stream),q.debug=e.env.NODE_DEBUG&&/\brequest\b/.test(e.env.NODE_DEBUG),q.prototype.debug=L,q.prototype.init=function(e){var i=this;for(var t in e||(e={}),i.headers=i.headers?F(i.headers):{},i.headers)void 0===i.headers[t]&&delete i.headers[t];if(j.httpify(i,i.headers),i.method||(i.method=e.method||"GET"),i.localAddress||(i.localAddress=e.localAddress),i._qs.init(e),L(e),i.pool||!1===i.pool||(i.pool=M),i.dests=i.dests||[],i.__isRequestRequest=!0,!i._callback&&i.callback&&(i._callback=i.callback,i.callback=function(){i._callbackCalled||(i._callbackCalled=!0,i._callback.apply(i,arguments))},i.on("error",i.callback.bind()),i.on("complete",i.callback.bind(i,null))),!i.uri&&i.url&&(i.uri=i.url,delete i.url),i.baseUrl){if("string"!=typeof i.baseUrl)return i.emit("error",new Error("options.baseUrl must be a string"));if("string"!=typeof i.uri)return i.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(0===i.uri.indexOf("//")||-1!==i.uri.indexOf("://"))return i.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var r=i.baseUrl.lastIndexOf("/")===i.baseUrl.length-1,n=0===i.uri.indexOf("/");r&&n?i.uri=i.baseUrl+i.uri.slice(1):r||n?i.uri=i.baseUrl+i.uri:""===i.uri?i.uri=i.baseUrl:i.uri=i.baseUrl+"/"+i.uri,delete i.baseUrl}if(!i.uri)return i.emit("error",new Error("options.uri is a required argument"));if("string"==typeof i.uri&&(i.uri=x.parse(i.uri)),i.uri.href||(i.uri.href=x.format(i.uri)),"unix:"===i.uri.protocol)return i.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if("unix"===i.uri.host&&i.enableUnixSocket(),!1===i.strictSSL&&(i.rejectUnauthorized=!1),i.uri.pathname||(i.uri.pathname="/"),!(i.uri.host||i.uri.hostname&&i.uri.port||i.uri.isUnix)){var a='Invalid URI "'+x.format(i.uri)+'"';return 0===Object.keys(e).length&&(a+=". This can be caused by a crappy redirection."),i.abort(),i.emit("error",new Error(a))}if(i.hasOwnProperty("proxy")||(i.proxy=P(i.uri)),i.tunnel=i._tunnel.isEnabled(),i.proxy&&i._tunnel.setup(e),i._redirect.onRequest(e),i.setHost=!1,!i.hasHeader("host")){var o=i.originalHostHeaderName||"host";i.setHeader(o,i.uri.host),i.uri.port&&("80"===i.uri.port&&"http:"===i.uri.protocol||"443"===i.uri.port&&"https:"===i.uri.protocol)&&i.setHeader(o,i.uri.hostname),i.setHost=!0}if(i.jar(i._jar||e.jar),i.uri.port||("http:"===i.uri.protocol?i.uri.port=80:"https:"===i.uri.protocol&&(i.uri.port=443)),i.proxy&&!i.tunnel?(i.port=i.proxy.port,i.host=i.proxy.hostname):(i.port=i.uri.port,i.host=i.uri.hostname),e.form&&i.form(e.form),e.formData){var s=e.formData,c=i.form(),u=function(e,t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?c.append(e,t.value,t.options):c.append(e,t)};for(var f in s)if(s.hasOwnProperty(f)){var p=s[f];if(p instanceof Array)for(var h=0;h>>32-t}function S(e,t,r,i,n,a,o,s){return x(e+(t^r^i)+a+o|0,s)+n|0}function j(e,t,r,i,n,a,o,s){return x(e+(t&r|~t&i)+a+o|0,s)+n|0}function E(e,t,r,i,n,a,o,s){return x(e+((t|~r)^i)+a+o|0,s)+n|0}function A(e,t,r,i,n,a,o,s){return x(e+(t&i|r&~i)+a+o|0,s)+n|0}function I(e,t,r,i,n,a,o,s){return x(e+(t^(r|~i))+a+o|0,s)+n|0}n(o,a),o.prototype._update=function(){for(var e=g,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,a=0|this._d,o=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,f=0|this._d,p=0|this._e,h=0;h<80;h+=1){var l,d;d=h<16?(l=S(r,i,n,a,o,e[v[h]],w[0],y[h]),I(s,c,u,f,p,e[b[h]],k[0],_[h])):h<32?(l=j(r,i,n,a,o,e[v[h]],w[1],y[h]),A(s,c,u,f,p,e[b[h]],k[1],_[h])):h<48?(l=E(r,i,n,a,o,e[v[h]],w[2],y[h]),E(s,c,u,f,p,e[b[h]],k[2],_[h])):h<64?(l=A(r,i,n,a,o,e[v[h]],w[3],y[h]),j(s,c,u,f,p,e[b[h]],k[3],_[h])):(l=I(r,i,n,a,o,e[v[h]],w[4],y[h]),S(s,c,u,f,p,e[b[h]],k[4],_[h])),r=o,o=a,a=x(n,10),n=i,i=l,s=p,p=f,f=x(u,10),u=c,c=d}var m=this._b+n+f|0;this._b=this._c+a+p|0,this._c=this._d+o+s|0,this._d=this._e+r+c|0,this._e=this._a+i+u|0,this._a=m},o.prototype._digest=function(){this._block[this._blockOffset++]=128,56=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 a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":447}],450:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":451,"./sha1":452,"./sha224":453,"./sha256":454,"./sha384":455,"./sha512":456}],451:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,v=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s=this._w,c=0|this._a,u=0|this._b,f=0|this._c,p=0|this._d,h=0|this._e,l=0;l<16;++l)s[l]=e.readInt32BE(4*l);for(;l<80;++l)s[l]=s[l-3]^s[l-8]^s[l-14]^s[l-16];for(var d=0;d<80;++d){var m=~~(d/20),g=0|((o=c)<<5|o>>>27)+(i=u,n=f,a=p,0===(r=m)?i&n|~i&a:2===r?i&n|i&a|n&a:i^n^a)+h+s[d]+v[m];h=p,p=f,f=(t=u)<<30|t>>>2,u=c,c=g}this._a=c+this._a|0,this._b=u+this._b|0,this._c=f+this._c|0,this._d=p+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],452:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0;d<16;++d)c[d]=e.readInt32BE(4*d);for(;d<80;++d)c[d]=(t=c[d-3]^c[d-8]^c[d-14]^c[d-16])<<1|t>>>31;for(var m=0;m<80;++m){var g=~~(m/20),v=0|((s=u)<<5|s>>>27)+(n=f,a=p,o=h,0===(i=g)?n&a|~n&o:2===i?n&a|n&o|a&o:n^a^o)+l+c[m]+b[g];l=h,h=p,p=(r=f)<<30|r>>>2,f=u,u=v}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],453:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}i(c,n),c.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},c.prototype._hash=function(){var e=o.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},t.exports=c},{"./hash":449,"./sha256":454,inherits:320,"safe-buffer":447}],454:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,w=[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],o=new Array(64);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0|this._f,m=0|this._g,g=0|this._h,v=0;v<16;++v)c[v]=e.readInt32BE(4*v);for(;v<64;++v)c[v]=0|(((r=c[v-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+c[v-7]+(((t=c[v-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+c[v-16];for(var b=0;b<64;++b){var y=g+(((s=l)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((o=m)^l&(d^o))+w[b]+c[b]|0,_=0|(((a=u)>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+((i=u)&(n=f)|p&(i|n));g=m,m=d,d=l,l=h+y|0,h=p,p=f,f=u,u=y+_|0}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],455:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(160);function c(){this.init(),this._w=s,a.call(this,128,112)}i(c,n),c.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},c.prototype._hash=function(){var i=o.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=c},{"./hash":449,"./sha512":456,inherits:320,"safe-buffer":447}],456:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,ee=[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],o=new Array(160);function s(){this.init(),this._w=o,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ae(e,t){return e>>>0>>0?1:0}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c,u=this._w,f=0|this._ah,p=0|this._bh,h=0|this._ch,l=0|this._dh,d=0|this._eh,m=0|this._fh,g=0|this._gh,v=0|this._hh,b=0|this._al,y=0|this._bl,_=0|this._cl,w=0|this._dl,k=0|this._el,x=0|this._fl,S=0|this._gl,j=0|this._hl,E=0;E<32;E+=2)u[E]=e.readInt32BE(4*E),u[E+1]=e.readInt32BE(4*E+4);for(;E<160;E+=2){var A=u[E-30],I=u[E-30+1],P=((s=A)>>>1|(c=I)<<31)^(s>>>8|c<<24)^s>>>7,O=((a=I)>>>1|(o=A)<<31)^(a>>>8|o<<24)^(a>>>7|o<<25);A=u[E-4],I=u[E-4+1];var T=((i=A)>>>19|(n=I)<<13)^(n>>>29|i<<3)^i>>>6,B=((t=I)>>>19|(r=A)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),C=u[E-14],F=u[E-14+1],R=u[E-32],z=u[E-32+1],M=O+F|0,N=P+C+ae(M,O)|0;N=(N=N+T+ae(M=M+B|0,B)|0)+R+ae(M=M+z|0,z)|0,u[E]=N,u[E+1]=M}for(var D=0;D<160;D+=2){N=u[D],M=u[D+1];var q=re(f,p,h),L=re(b,y,_),U=ie(f,b),H=ie(b,f),K=ne(d,k),V=ne(k,d),G=ee[D],$=ee[D+1],W=te(d,m,g),Z=te(k,x,S),Y=j+V|0,X=v+K+ae(Y,j)|0;X=(X=(X=X+W+ae(Y=Y+Z|0,Z)|0)+G+ae(Y=Y+$|0,$)|0)+N+ae(Y=Y+M|0,M)|0;var J=H+L|0,Q=U+q+ae(J,H)|0;v=g,j=S,g=m,S=x,m=d,x=k,d=l+X+ae(k=w+Y|0,w)|0,l=h,w=_,h=p,_=y,p=f,y=b,f=X+Q+ae(b=Y+J|0,Y)|0}this._al=this._al+b|0,this._bl=this._bl+y|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+k|0,this._fl=this._fl+x|0,this._gl=this._gl+S|0,this._hl=this._hl+j|0,this._ah=this._ah+f+ae(this._al,b)|0,this._bh=this._bh+p+ae(this._bl,y)|0,this._ch=this._ch+h+ae(this._cl,_)|0,this._dh=this._dh+l+ae(this._dl,w)|0,this._eh=this._eh+d+ae(this._el,k)|0,this._fh=this._fh+m+ae(this._fl,x)|0,this._gh=this._gh+g+ae(this._gl,S)|0,this._hh=this._hh+v+ae(this._hl,j)|0},s.prototype._hash=function(){var i=a.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],457:[function(e,t,r){var i=e("safer-buffer").Buffer,n={dsa:{parts:["p","q","g","y"],sizePart:"p"},rsa:{parts:["e","n"],sizePart:"n"},ecdsa:{parts:["curve","Q"],sizePart:"Q"},ed25519:{parts:["A"],sizePart:"A"}};n.curve25519=n.ed25519;var a={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};a.curve25519=a.ed25519;var o={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:i.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g,""),"hex"),s:i.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g,""),"hex"),n:i.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g,""),"hex"),G:i.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g,""),"hex"),s:i.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g,""),"hex"),n:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g,""),"hex"),G:i.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:i.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g,""),"hex"),a:i.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g,""),"hex"),s:i.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g,""),"hex"),n:i.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g,""),"hex"),G:i.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g,""),"hex")}};t.exports={info:n,privInfo:a,hashAlgs:{md5:!0,sha1:!0,sha256:!0,sha384:!0,sha512:!0},curves:o}},{"safer-buffer":448}],458:[function(e,t,r){t.exports=_;var d=e("assert-plus"),m=e("safer-buffer").Buffer,i=e("./algs"),n=e("crypto"),a=e("./fingerprint"),o=(e("./signature"),e("./errors")),g=(e("util"),e("./utils")),v=e("./key"),b=e("./private-key"),y=e("./identity"),s={};s.openssh=e("./formats/openssh-cert"),s.x509=e("./formats/x509"),s.pem=e("./formats/x509-pem");var c=o.CertificateParseError,u=o.InvalidAlgorithmError;function _(e){d.object(e,"options"),d.arrayOfObject(e.subjects,"options.subjects"),g.assertCompatible(e.subjects[0],y,[1,0],"options.subjects"),g.assertCompatible(e.subjectKey,v,[1,0],"options.subjectKey"),g.assertCompatible(e.issuer,y,[1,0],"options.issuer"),void 0!==e.issuerKey&&g.assertCompatible(e.issuerKey,v,[1,0],"options.issuerKey"),d.object(e.signatures,"options.signatures"),d.buffer(e.serial,"options.serial"),d.date(e.validFrom,"options.validFrom"),d.date(e.validUntil,"optons.validUntil"),d.optionalArrayOfString(e.purposes,"options.purposes"),this._hashCache={},this.subjects=e.subjects,this.issuer=e.issuer,this.subjectKey=e.subjectKey,this.issuerKey=e.issuerKey,this.signatures=e.signatures,this.serial=e.serial,this.validFrom=e.validFrom,this.validUntil=e.validUntil,this.purposes=e.purposes}_.formats=s,_.prototype.toBuffer=function(e,t){return void 0===e&&(e="x509"),d.string(e,"format"),d.object(s[e],"formats[format]"),d.optionalObject(t,"options"),s[e].write(this,t)},_.prototype.toString=function(e,t){return void 0===e&&(e="pem"),this.toBuffer(e,t).toString()},_.prototype.fingerprint=function(e){void 0===e&&(e="sha256"),d.string(e,"algorithm");var t={type:"certificate",hash:this.hash(e),algorithm:e};return new a(t)},_.prototype.hash=function(e){if(d.string(e,"algorithm"),e=e.toLowerCase(),void 0===i.hashAlgs[e])throw new u(e);if(this._hashCache[e])return this._hashCache[e];var t=n.createHash(e).update(this.toBuffer("x509")).digest();return this._hashCache[e]=t},_.prototype.isExpired=function(e){return void 0===e&&(e=new Date),!(e.getTime()>=this.validFrom.getTime()&&e.getTime()e.length||"BEGIN"!==e.slice(t,t+5).toString("ascii"))}(e))return a.read(e,t);if(function(e){var t=0;for(;to.length&&(p=o.length),u+=c.write(o.slice(f,p),u),c[u++]=10,f=p}return u+=c.write("-----END "+i+"-----\n",u),c.slice(0,u)}};var b=e("assert-plus"),y=e("asn1"),_=e("crypto"),w=e("safer-buffer").Buffer,k=(e("../algs"),e("../utils")),h=e("../key"),l=e("../private-key"),x=e("./pkcs1"),S=e("./pkcs8"),j=e("./ssh-private"),E=e("./rfc4253"),A=e("../errors")},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../utils":480,"./pkcs1":467,"./pkcs8":468,"./rfc4253":469,"./ssh-private":470,asn1:65,"assert-plus":66,crypto:204,"safer-buffer":448}],467:[function(e,t,r){t.exports={read:function(e,t){return i.read(e,t,"pkcs1")},readPkcs1:function(e,t,r){switch(e){case"RSA":if("public"===t)return u=y(c=r,"modulus"),f=y(c,"exponent"),new p({type:"rsa",parts:[{name:"e",data:f},{name:"n",data:u}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t[0],0);var r=y(e,"modulus"),i=y(e,"public exponent"),n=y(e,"private exponent"),a=y(e,"prime1"),o=y(e,"prime2"),s=y(e,"exponent1"),c=y(e,"exponent2"),u=y(e,"iqmp");return new v({type:"rsa",parts:[{name:"n",data:r},{name:"e",data:i},{name:"d",data:n},{name:"iqmp",data:u},{name:"p",data:a},{name:"q",data:o},{name:"dmodp",data:s},{name:"dmodq",data:c}]})}(r);throw new Error("Unknown key type: "+t);case"DSA":if("public"===t)return n=y(i=r,"y"),a=y(i,"p"),o=y(i,"q"),s=y(i,"g"),new p({type:"dsa",parts:[{name:"y",data:n},{name:"p",data:a},{name:"q",data:o},{name:"g",data:s}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),0);var r=y(e,"p"),i=y(e,"q"),n=y(e,"g"),a=y(e,"y"),o=y(e,"x");return new v({type:"dsa",parts:[{name:"p",data:r},{name:"q",data:i},{name:"g",data:n},{name:"y",data:a},{name:"x",data:o}]})}(r);throw new Error("Unknown key type: "+t);case"EC":case"ECDSA":if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),1);var r=e.readString(l.Ber.OctetString,!0);e.readSequence(160);var i=b(e);h.string(i,"a known elliptic curve"),e.readSequence(161);var n=e.readString(l.Ber.BitString,!0);n=g.ecNormalize(n);var a={type:"ecdsa",parts:[{name:"curve",data:d.from(i)},{name:"Q",data:n},{name:"d",data:r}]};return new v(a)}(r);if("public"===t)return function(e){e.readSequence();var t=e.readOID();h.strictEqual(t,"1.2.840.10045.2.1","must be ecPublicKey");for(var r,i=e.readOID(),n=Object.keys(m.curves),a=0;aS.length&&(I=S.length),E+=x.write(S.slice(A,I),E),x[E++]=10,A=I}return E+=x.write("-----END "+k+"-----\n",E),x.slice(0,E)}};var O,T=P("assert-plus"),B=(P("asn1"),P("safer-buffer").Buffer),C=(P("../algs"),P("../utils")),F=P("crypto"),R=(P("../key"),P("../private-key")),r=P("./pem"),A=P("./rfc4253"),z=P("../ssh-buffer"),I=P("../errors");var M="openssh-key-v1"},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../ssh-buffer":479,"../utils":480,"./pem":466,"./rfc4253":469,asn1:65,"assert-plus":66,"bcrypt-pbkdf":76,crypto:204,"safer-buffer":448}],471:[function(e,t,r){t.exports={read:function(e,t){"string"!=typeof e&&(h.buffer(e,"buf"),e=e.toString("ascii"));var r=e.trim().replace(/[\\\r]/g,""),i=r.match(m);i||(i=r.match(g));h.ok(i,"key must match regex");var n,a=d.algToKeyType(i[1]),o=l.from(i[2],"base64"),s={};if(i[4])try{n=d.read(o)}catch(e){i=r.match(g),h.ok(i,"key must match regex"),o=l.from(i[2],"base64"),n=d.readInternal(s,"public",o)}else n=d.readInternal(s,"public",o);if(h.strictEqual(a,n.type),i[4]&&0n.length&&(u=n.length),s+=o.write(n.slice(c,u),s),o[s++]=10,c=u}return s+=o.write("-----END "+i+"-----\n",s),o.slice(0,s)}};var o=e("assert-plus"),p=(e("asn1"),e("safer-buffer").Buffer);e("../algs"),e("../utils"),e("../key"),e("../private-key"),e("./pem"),e("../identity"),e("../signature"),e("../certificate")},{"../algs":457,"../certificate":458,"../identity":474,"../key":476,"../private-key":477,"../signature":478,"../utils":480,"./pem":466,"./x509":473,asn1:65,"assert-plus":66,"safer-buffer":448}],473:[function(e,t,r){t.exports={read:function(e,t){"string"==typeof e&&(e=_.from(e,"binary"));b.buffer(e,"buf");var r=new y.BerReader(e);if(r.readSequence(),1=this._buffer.length},a.prototype.remainder=function(){return this._buffer.slice(this._offset)},a.prototype.skip=function(e){this._offset+=e},a.prototype.expand=function(){this._size*=2;var e=n.alloc(this._size);this._buffer.copy(e,0),this._buffer=e},a.prototype.readPart=function(){return{data:this.readBuffer()}},a.prototype.readBuffer=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4,i.ok(this._offset+e<=this._buffer.length,"length out of bounds at +0x"+this._offset.toString(16)+" (data truncated?)");var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t},a.prototype.readString=function(){return this.readBuffer().toString()},a.prototype.readCString=function(){for(var e=this._offset;ethis._size;)this.expand();this._buffer.writeUInt32BE(e.length,this._offset),this._offset+=4,e.copy(this._buffer,this._offset),this._offset+=e.length},a.prototype.writeString=function(e){this.writeBuffer(n.from(e,"utf8"))},a.prototype.writeCString=function(e){for(;this._offset+1+e.length>this._size;)this.expand();this._buffer.write(e,this._offset),this._offset+=e.length,this._buffer[this._offset++]=0},a.prototype.writeInt=function(e){for(;this._offset+4>this._size;)this.expand();this._buffer.writeUInt32BE(e,this._offset),this._offset+=4},a.prototype.writeInt64=function(e){if(i.buffer(e,"value"),8this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=8},a.prototype.writeChar=function(e){for(;this._offset+1>this._size;)this.expand();this._buffer[this._offset++]=e},a.prototype.writePart=function(e){this.writeBuffer(e.data)},a.prototype.write=function(e){for(;this._offset+e.length>this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=e.length}},{"assert-plus":66,"safer-buffer":448}],480:[function(e,t,r){t.exports={bufferSplit:function(e,t){p.buffer(e),p.string(t);for(var r=[],i=0,n=0,a=0;a=t.length){var o=a+1;r.push(e.slice(i,o-n)),i=o,n=0}i<=e.length&&r.push(e.slice(i,e.length));return r},addRSAMissing:function(e){p.object(e),u(e,s,[1,1]);var t,r=new g(e.part.d.data);if(!e.part.dmodp){var i=new g(e.part.p.data),n=r.mod(i.subtract(1));t=_(n),e.part.dmodp={name:"dmodp",data:t},e.parts.push(e.part.dmodp)}if(!e.part.dmodq){var a=new g(e.part.q.data),o=r.mod(a.subtract(1));t=_(o),e.part.dmodq={name:"dmodq",data:t},e.parts.push(e.part.dmodq)}},calculateDSAPublic:function(e,t,r){return p.buffer(e),p.buffer(t),p.buffer(r),e=new g(e),t=new g(t),r=new g(r),_(e.modPow(r,t))},calculateED25519Public:function(e){p.buffer(e);var t=i.sign.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},calculateX25519Public:function(e){p.buffer(e);var t=i.box.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},mpNormalize:y,mpDenormalize:function(e){p.buffer(e);for(;1c)return!1;if(i.constructor.name!==t.name)return!1;var a=i._sshpkApiVersion;void 0===a&&(a=t._oldVersionDetect(e));return!(a[0]!=r[0]||a[1]t;)p.equal(e[0],0),e=e.slice(1);for(;e.length=r[1],i+" must be compatible with "+t.name+" klass version "+r[0]+"."+r[1])}}var v={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}},b=8;function y(e){for(p.buffer(e);1t._pos){var i=r.substr(t._pos);if("x-user-defined"===t._charset){for(var n=new p(i.length),a=0;at._pos&&(t.push(new p(new Uint8Array(o.result.slice(t._pos)))),t._pos=o.result.byteLength)},o.onload=function(){t.push(null)},o.readAsArrayBuffer(r)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":484,_process:382,buffer:191,inherits:320,"readable-stream":426}],487:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=p,t=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1=2.4.3 <2.5.0",_id:"tough-cookie@2.4.3",_inCache:!0,_installable:!0,_location:"/tough-cookie",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/tough-cookie_2.4.3_1529960207843_0.4882910670728131"},_npmUser:{email:"jstash@gmail.com",name:"jstash"},_npmVersion:"6.1.0",_phantomChildren:{},_requested:{name:"tough-cookie",raw:"tough-cookie@~2.4.3",rawSpec:"~2.4.3",scope:null,spec:">=2.4.3 <2.5.0",type:"range"},_requiredBy:["/request","/request-promise"],_resolved:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",_shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",_shrinkwrap:null,_spec:"tough-cookie@~2.4.3",_where:"/home/administrator/javascript-opentimestamps/node_modules/request",author:{email:"jstash@gmail.com",name:"Jeremy Stashewsky"},bugs:{url:"https://github.com/salesforce/tough-cookie/issues"},contributors:[{name:"Alexander Savin"},{name:"Ian Livingstone"},{name:"Ivan Nikulin"},{name:"Lalit Kapoor"},{name:"Sam Thompson"},{name:"Sebastian Mayr"}],dependencies:{psl:"^1.1.24",punycode:"^1.4.1"},description:"RFC6265 Cookies and Cookie Jar for node.js",devDependencies:{async:"^1.4.2",nyc:"^11.6.0","string.prototype.repeat":"^0.2.0",vows:"^0.8.1"},directories:{},dist:{fileCount:9,integrity:"sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMVcQCRA9TVsSAnZWagAAzX0P/2COkbzb3dOX/FTOYIVL\n7oHge7BvGODNkEHTjBtNsR0jO/AA/gVcUOq6CSmFH+UC14LrmCyNDemQvD15\njnYuJXUIiZsSZO7BGGbOFYrQF+DKLiwgf0LokrIM8KasZ5nxc5xS1jYHG5o+\nwCqutfhlRTqlPbZsexB+eRlIuYNvpsbRAdSDYXrhLJNMZgx49g/SZ7IwunGN\nJ/5Fe041MZqqdi7MAavM3T7vX9IvVRJJ3f4xAEVxY1vh4s0dN+h4fG2eMQzL\nOiaulRUIahs4xmJUYHZgZESc9eTIrI8K+YT7i3r35TGc0Du7ueB2KYxBqy7q\n6AUFbdX9Ep308kTVsTf/h4wE0RvdxKLfZ0ww7T1ivADX9xMi2oIvVtyhCQHo\nSIpyBhaav/fTufF0/Fu4Lcr7PMJxyvF0UcNRqrPmEQTw4UZkFKfT8HN2P5cH\nBvJsFwpeEjt84tt5pJ/bmD0j0EUCLUXLGH6fbA84fHpZGifO239zSf262Qdv\nSXeygU7YxnK8wOCnvlauZx/gp+/WTMfMdODxiX0QnqwS5BctiPCgGG1cKJcC\nqvTECaAEmxMVf/gEW73oxVXJgUO7f6jJaWoawV7ka+wR91W9Bp0pKGOOAxAG\nU72rmnwQKid9U7ly5833sb3D+lbzKJXGNIqohegP4daKZfNNTaLWZXmKE+Iy\n7Vml\r\n=8KpS\r\n-----END PGP SIGNATURE-----\r\n",shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",tarball:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",unpackedSize:83959},engines:{node:">=0.8"},files:["lib"],gitHead:"671ad413b38d7464352886772f57a7ec417d4760",homepage:"https://github.com/salesforce/tough-cookie",keywords:["HTTP","RFC2965","RFC6265","cookie","cookiejar","cookies","jar","set-cookie"],license:"BSD-3-Clause",main:"./lib/cookie",maintainers:[{name:"awaterma",email:"awaterma@awaterma.net"},{name:"jstash",email:"jstash@gmail.com"},{name:"maratto",email:"marat+npm@salesforce.com"},{name:"ruoho",email:"clint@ruoho.org"}],name:"tough-cookie",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/salesforce/tough-cookie.git"},scripts:{cover:"nyc --reporter=lcov --reporter=html vows test/*_test.js",test:"vows test/*_test.js"},version:"2.4.3"}},{}],497:[function(s,e,c){(function(u){"use strict";s("net");var f,a=s("tls"),r=s("http"),i=s("https"),e=s("events"),p=s("assert"),t=s("util"),h=s("safe-buffer").Buffer;function o(e){var o=this;o.options=e||{},o.proxyOptions=o.options.proxy||{},o.maxSockets=o.options.maxSockets||r.Agent.defaultMaxSockets,o.requests=[],o.sockets=[],o.on("free",function(e,t,r){for(var i=0,n=o.requests.length;i=this.maxSockets?this.requests.push({host:t.host,port:t.port,request:e}):this.createConnection({host:t.host,port:t.port,request:e})},o.prototype.createConnection=function(e){var n=this;n.createSocket(e,function(t){function r(){n.emit("free",t,e.host,e.port)}function i(e){n.removeSocket(t),t.removeListener("free",r),t.removeListener("close",i),t.removeListener("agentRemove",i)}t.on("free",r),t.on("close",i),t.on("agentRemove",i),e.request.onSocket(t)})},o.prototype.createSocket=function(n,a){var o=this,s={};o.sockets.push(s);var e=l({},o.proxyOptions,{method:"CONNECT",path:n.host+":"+n.port,agent:!1});e.proxyAuth&&(e.headers=e.headers||{},e.headers["Proxy-Authorization"]="Basic "+h.from(e.proxyAuth).toString("base64")),f("making CONNECT request");var c=o.request(e);function i(e,t,r){if(c.removeAllListeners(),t.removeAllListeners(),200===e.statusCode)p.equal(r.length,0),f("tunneling connection has established"),o.sockets[o.sockets.indexOf(s)]=t,a(t);else{f("tunneling socket could not be established, statusCode=%d",e.statusCode);var i=new Error("tunneling socket could not be established, statusCode="+e.statusCode);i.code="ECONNRESET",n.request.emit("error",i),o.removeSocket(s)}}c.useChunkedEncodingByDefault=!1,c.once("response",function(e){e.upgrade=!0}),c.once("upgrade",function(e,t,r){u.nextTick(function(){i(e,t,r)})}),c.once("connect",i),c.once("error",function(e){c.removeAllListeners(),f("tunneling socket could not be established, cause=%s\n",e.message,e.stack);var t=new Error("tunneling socket could not be established, cause="+e.message);t.code="ECONNRESET",n.request.emit("error",t),o.removeSocket(s)}),c.end()},o.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},f=u.env.NODE_DEBUG&&/\btunnel\b/.test(u.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},c.debug=f}).call(this,s("_process"))},{_process:382,assert:67,events:269,http:483,https:317,net:187,"safe-buffer":447,tls:187,util:505}],498:[function(e,t,r){!function(a){"use strict";var m=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function d(e,t,r,i,n){var a,o=0;for(a=0;a>>8)-1}function v(e,t,r,i){return d(e,t,r,i,16)}function b(e,t,r,i){return d(e,t,r,i,32)}function y(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=a,k=o,x=s,S=c,j=u,E=f,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=0;M<20;M+=2)w^=(n=(C^=(n=(P^=(n=(j^=(n=w+C|0)<<7|n>>>25)+w|0)<<9|n>>>23)+j|0)<<13|n>>>19)+P|0)<<18|n>>>14,E^=(n=(k^=(n=(F^=(n=(O^=(n=E+k|0)<<7|n>>>25)+E|0)<<9|n>>>23)+O|0)<<13|n>>>19)+F|0)<<18|n>>>14,T^=(n=(A^=(n=(x^=(n=(R^=(n=T+A|0)<<7|n>>>25)+T|0)<<9|n>>>23)+R|0)<<13|n>>>19)+x|0)<<18|n>>>14,z^=(n=(B^=(n=(I^=(n=(S^=(n=z+B|0)<<7|n>>>25)+z|0)<<9|n>>>23)+S|0)<<13|n>>>19)+I|0)<<18|n>>>14,w^=(n=(S^=(n=(x^=(n=(k^=(n=w+S|0)<<7|n>>>25)+w|0)<<9|n>>>23)+k|0)<<13|n>>>19)+x|0)<<18|n>>>14,E^=(n=(j^=(n=(I^=(n=(A^=(n=E+j|0)<<7|n>>>25)+E|0)<<9|n>>>23)+A|0)<<13|n>>>19)+I|0)<<18|n>>>14,T^=(n=(O^=(n=(P^=(n=(B^=(n=T+O|0)<<7|n>>>25)+T|0)<<9|n>>>23)+B|0)<<13|n>>>19)+P|0)<<18|n>>>14,z^=(n=(R^=(n=(F^=(n=(C^=(n=z+R|0)<<7|n>>>25)+z|0)<<9|n>>>23)+C|0)<<13|n>>>19)+F|0)<<18|n>>>14;w=w+a|0,k=k+o|0,x=x+s|0,S=S+c|0,j=j+u|0,E=E+f|0,A=A+p|0,I=I+h|0,P=P+l|0,O=O+d|0,T=T+m|0,B=B+g|0,C=C+v|0,F=F+b|0,R=R+y|0,z=z+_|0,e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=x>>>0&255,e[9]=x>>>8&255,e[10]=x>>>16&255,e[11]=x>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=j>>>0&255,e[17]=j>>>8&255,e[18]=j>>>16&255,e[19]=j>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=B>>>0&255,e[45]=B>>>8&255,e[46]=B>>>16&255,e[47]=B>>>24&255,e[48]=C>>>0&255,e[49]=C>>>8&255,e[50]=C>>>16&255,e[51]=C>>>24&255,e[52]=F>>>0&255,e[53]=F>>>8&255,e[54]=F>>>16&255,e[55]=F>>>24&255,e[56]=R>>>0&255,e[57]=R>>>8&255,e[58]=R>>>16&255,e[59]=R>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,i)}function _(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=0;w<20;w+=2)a^=(n=(v^=(n=(l^=(n=(u^=(n=a+v|0)<<7|n>>>25)+a|0)<<9|n>>>23)+u|0)<<13|n>>>19)+l|0)<<18|n>>>14,f^=(n=(o^=(n=(b^=(n=(d^=(n=f+o|0)<<7|n>>>25)+f|0)<<9|n>>>23)+d|0)<<13|n>>>19)+b|0)<<18|n>>>14,m^=(n=(p^=(n=(s^=(n=(y^=(n=m+p|0)<<7|n>>>25)+m|0)<<9|n>>>23)+y|0)<<13|n>>>19)+s|0)<<18|n>>>14,_^=(n=(g^=(n=(h^=(n=(c^=(n=_+g|0)<<7|n>>>25)+_|0)<<9|n>>>23)+c|0)<<13|n>>>19)+h|0)<<18|n>>>14,a^=(n=(c^=(n=(s^=(n=(o^=(n=a+c|0)<<7|n>>>25)+a|0)<<9|n>>>23)+o|0)<<13|n>>>19)+s|0)<<18|n>>>14,f^=(n=(u^=(n=(h^=(n=(p^=(n=f+u|0)<<7|n>>>25)+f|0)<<9|n>>>23)+p|0)<<13|n>>>19)+h|0)<<18|n>>>14,m^=(n=(d^=(n=(l^=(n=(g^=(n=m+d|0)<<7|n>>>25)+m|0)<<9|n>>>23)+g|0)<<13|n>>>19)+l|0)<<18|n>>>14,_^=(n=(y^=(n=(b^=(n=(v^=(n=_+y|0)<<7|n>>>25)+_|0)<<9|n>>>23)+v|0)<<13|n>>>19)+b|0)<<18|n>>>14;e[0]=a>>>0&255,e[1]=a>>>8&255,e[2]=a>>>16&255,e[3]=a>>>24&255,e[4]=f>>>0&255,e[5]=f>>>8&255,e[6]=f>>>16&255,e[7]=f>>>24&255,e[8]=m>>>0&255,e[9]=m>>>8&255,e[10]=m>>>16&255,e[11]=m>>>24&255,e[12]=_>>>0&255,e[13]=_>>>8&255,e[14]=_>>>16&255,e[15]=_>>>24&255,e[16]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255}(e,t,r,i)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function k(e,t,r,i,n,a,o){var s,c,u=new Uint8Array(16),f=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=a[c];for(;64<=n;){for(y(f,u,o,w),c=0;c<64;c++)e[t+c]=r[i+c]^f[c];for(s=1,c=8;c<16;c++)s=s+(255&u[c])|0,u[c]=255&s,s>>>=8;n-=64,t+=64,i+=64}if(0>>=8;r-=64,t+=64}if(0>>13|r<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|i<<6),n=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|n<<9),a=255&e[8]|(255&e[9])<<8,this.r[4]=255&(n>>>4|a<<12),this.r[5]=a>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(a>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,r,i,n,a){var o=new E(a);return o.update(r,i,n),o.finish(e,t),0}function I(e,t,r,i,n,a){var o=new Uint8Array(16);return A(o,0,r,i,n,a),v(e,t,o,0)}function P(e,t,r,i,n){var a;if(r<32)return-1;for(j(e,0,t,0,r,i,n),A(e,16,e,32,r-32,e),a=0;a<16;a++)e[a]=0;return 0}function O(e,t,r,i,n){var a,o=new Uint8Array(32);if(r<32)return-1;if(S(o,0,32,i,n),0!==I(t,16,t,32,r-32,o))return-1;for(j(e,0,t,0,r,i,n),a=0;a<32;a++)e[a]=0;return 0}function T(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function C(e,t,r){for(var i,n=~(r-1),a=0;a<16;a++)i=n&(e[a]^t[a]),e[a]^=i,t[a]^=i}function F(e,t){var r,i,n,a=m(),o=m();for(r=0;r<16;r++)o[r]=t[r];for(B(o),B(o),B(o),i=0;i<2;i++){for(a[0]=o[0]-65517,r=1;r<15;r++)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),n=a[15]>>16&1,a[14]&=65535,C(o,a,1-n)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function R(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return F(r,e),F(i,t),b(r,0,i,0)}function z(e){var t=new Uint8Array(32);return F(t,e),1&t[0]}function M(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function N(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function D(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function q(e,t,r){var i,n,a=0,o=0,s=0,c=0,u=0,f=0,p=0,h=0,l=0,d=0,m=0,g=0,v=0,b=0,y=0,_=0,w=0,k=0,x=0,S=0,j=0,E=0,A=0,I=0,P=0,O=0,T=0,B=0,C=0,F=0,R=0,z=r[0],M=r[1],N=r[2],D=r[3],q=r[4],L=r[5],U=r[6],H=r[7],K=r[8],V=r[9],G=r[10],$=r[11],W=r[12],Z=r[13],Y=r[14],X=r[15];a+=(i=t[0])*z,o+=i*M,s+=i*N,c+=i*D,u+=i*q,f+=i*L,p+=i*U,h+=i*H,l+=i*K,d+=i*V,m+=i*G,g+=i*$,v+=i*W,b+=i*Z,y+=i*Y,_+=i*X,o+=(i=t[1])*z,s+=i*M,c+=i*N,u+=i*D,f+=i*q,p+=i*L,h+=i*U,l+=i*H,d+=i*K,m+=i*V,g+=i*G,v+=i*$,b+=i*W,y+=i*Z,_+=i*Y,w+=i*X,s+=(i=t[2])*z,c+=i*M,u+=i*N,f+=i*D,p+=i*q,h+=i*L,l+=i*U,d+=i*H,m+=i*K,g+=i*V,v+=i*G,b+=i*$,y+=i*W,_+=i*Z,w+=i*Y,k+=i*X,c+=(i=t[3])*z,u+=i*M,f+=i*N,p+=i*D,h+=i*q,l+=i*L,d+=i*U,m+=i*H,g+=i*K,v+=i*V,b+=i*G,y+=i*$,_+=i*W,w+=i*Z,k+=i*Y,x+=i*X,u+=(i=t[4])*z,f+=i*M,p+=i*N,h+=i*D,l+=i*q,d+=i*L,m+=i*U,g+=i*H,v+=i*K,b+=i*V,y+=i*G,_+=i*$,w+=i*W,k+=i*Z,x+=i*Y,S+=i*X,f+=(i=t[5])*z,p+=i*M,h+=i*N,l+=i*D,d+=i*q,m+=i*L,g+=i*U,v+=i*H,b+=i*K,y+=i*V,_+=i*G,w+=i*$,k+=i*W,x+=i*Z,S+=i*Y,j+=i*X,p+=(i=t[6])*z,h+=i*M,l+=i*N,d+=i*D,m+=i*q,g+=i*L,v+=i*U,b+=i*H,y+=i*K,_+=i*V,w+=i*G,k+=i*$,x+=i*W,S+=i*Z,j+=i*Y,E+=i*X,h+=(i=t[7])*z,l+=i*M,d+=i*N,m+=i*D,g+=i*q,v+=i*L,b+=i*U,y+=i*H,_+=i*K,w+=i*V,k+=i*G,x+=i*$,S+=i*W,j+=i*Z,E+=i*Y,A+=i*X,l+=(i=t[8])*z,d+=i*M,m+=i*N,g+=i*D,v+=i*q,b+=i*L,y+=i*U,_+=i*H,w+=i*K,k+=i*V,x+=i*G,S+=i*$,j+=i*W,E+=i*Z,A+=i*Y,I+=i*X,d+=(i=t[9])*z,m+=i*M,g+=i*N,v+=i*D,b+=i*q,y+=i*L,_+=i*U,w+=i*H,k+=i*K,x+=i*V,S+=i*G,j+=i*$,E+=i*W,A+=i*Z,I+=i*Y,P+=i*X,m+=(i=t[10])*z,g+=i*M,v+=i*N,b+=i*D,y+=i*q,_+=i*L,w+=i*U,k+=i*H,x+=i*K,S+=i*V,j+=i*G,E+=i*$,A+=i*W,I+=i*Z,P+=i*Y,O+=i*X,g+=(i=t[11])*z,v+=i*M,b+=i*N,y+=i*D,_+=i*q,w+=i*L,k+=i*U,x+=i*H,S+=i*K,j+=i*V,E+=i*G,A+=i*$,I+=i*W,P+=i*Z,O+=i*Y,T+=i*X,v+=(i=t[12])*z,b+=i*M,y+=i*N,_+=i*D,w+=i*q,k+=i*L,x+=i*U,S+=i*H,j+=i*K,E+=i*V,A+=i*G,I+=i*$,P+=i*W,O+=i*Z,T+=i*Y,B+=i*X,b+=(i=t[13])*z,y+=i*M,_+=i*N,w+=i*D,k+=i*q,x+=i*L,S+=i*U,j+=i*H,E+=i*K,A+=i*V,I+=i*G,P+=i*$,O+=i*W,T+=i*Z,B+=i*Y,C+=i*X,y+=(i=t[14])*z,_+=i*M,w+=i*N,k+=i*D,x+=i*q,S+=i*L,j+=i*U,E+=i*H,A+=i*K,I+=i*V,P+=i*G,O+=i*$,T+=i*W,B+=i*Z,C+=i*Y,F+=i*X,_+=(i=t[15])*z,o+=38*(k+=i*N),s+=38*(x+=i*D),c+=38*(S+=i*q),u+=38*(j+=i*L),f+=38*(E+=i*U),p+=38*(A+=i*H),h+=38*(I+=i*K),l+=38*(P+=i*V),d+=38*(O+=i*G),m+=38*(T+=i*$),g+=38*(B+=i*W),v+=38*(C+=i*Z),b+=38*(F+=i*Y),y+=38*(R+=i*X),a=(i=(a+=38*(w+=i*M))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a=(i=(a+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a+=n-1+37*(n-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=h,e[8]=l,e[9]=d,e[10]=m,e[11]=g,e[12]=v,e[13]=b,e[14]=y,e[15]=_}function L(e,t){q(e,t,t)}function U(e,t){var r,i=m();for(r=0;r<16;r++)i[r]=t[r];for(r=253;0<=r;r--)L(i,i),2!==r&&4!==r&&q(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function H(e,t,r){var i,n,a=new Uint8Array(32),o=new Float64Array(80),s=m(),c=m(),u=m(),f=m(),p=m(),h=m();for(n=0;n<31;n++)a[n]=t[n];for(a[31]=127&t[31]|64,a[0]&=248,M(o,r),n=0;n<16;n++)c[n]=o[n],f[n]=s[n]=u[n]=0;for(s[0]=f[0]=1,n=254;0<=n;--n)C(s,c,i=a[n>>>3]>>>(7&n)&1),C(u,f,i),N(p,s,u),D(s,s,u),N(u,c,f),D(c,c,f),L(f,p),L(h,s),q(s,u,s),q(u,c,p),N(p,s,u),D(s,s,u),L(c,s),D(u,f,h),q(s,u,g),N(s,s,f),q(u,u,s),q(s,f,h),q(f,c,o),L(c,p),C(s,c,i),C(u,f,i);for(n=0;n<16;n++)o[n+16]=s[n],o[n+32]=u[n],o[n+48]=c[n],o[n+64]=f[n];var l=o.subarray(32),d=o.subarray(16);return U(l,l),q(d,d,l),F(e,d),0}function K(e,t){return H(e,t,r)}function V(e,t){return o(t,32),K(e,t)}function G(e,t,r){var i=new Uint8Array(32);return H(i,r,t),_(e,n,i,w)}E.prototype.blocks=function(e,t,r){for(var i,n,a,o,s,c,u,f,p,h,l,d,m,g,v,b,y,_,w,k=this.fin?0:2048,x=this.h[0],S=this.h[1],j=this.h[2],E=this.h[3],A=this.h[4],I=this.h[5],P=this.h[6],O=this.h[7],T=this.h[8],B=this.h[9],C=this.r[0],F=this.r[1],R=this.r[2],z=this.r[3],M=this.r[4],N=this.r[5],D=this.r[6],q=this.r[7],L=this.r[8],U=this.r[9];16<=r;)h=p=0,h+=(x+=8191&(i=255&e[t+0]|(255&e[t+1])<<8))*C,h+=(S+=8191&(i>>>13|(n=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*U),h+=(j+=8191&(n>>>10|(a=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*L),h+=(E+=8191&(a>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*q),p=(h+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*D))>>>13,h&=8191,h+=(I+=s>>>1&8191)*(5*N),h+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*M),h+=(O+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),h+=(T+=8191&(u>>>8|(f=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*R),l=p+=(h+=(B+=f>>>5|k)*(5*F))>>>13,l+=x*F,l+=S*C,l+=j*(5*U),l+=E*(5*L),p=(l+=A*(5*q))>>>13,l&=8191,l+=I*(5*D),l+=P*(5*N),l+=O*(5*M),l+=T*(5*z),p+=(l+=B*(5*R))>>>13,l&=8191,d=p,d+=x*R,d+=S*F,d+=j*C,d+=E*(5*U),p=(d+=A*(5*L))>>>13,d&=8191,d+=I*(5*q),d+=P*(5*D),d+=O*(5*N),d+=T*(5*M),m=p+=(d+=B*(5*z))>>>13,m+=x*z,m+=S*R,m+=j*F,m+=E*C,p=(m+=A*(5*U))>>>13,m&=8191,m+=I*(5*L),m+=P*(5*q),m+=O*(5*D),m+=T*(5*N),g=p+=(m+=B*(5*M))>>>13,g+=x*M,g+=S*z,g+=j*R,g+=E*F,p=(g+=A*C)>>>13,g&=8191,g+=I*(5*U),g+=P*(5*L),g+=O*(5*q),g+=T*(5*D),v=p+=(g+=B*(5*N))>>>13,v+=x*N,v+=S*M,v+=j*z,v+=E*R,p=(v+=A*F)>>>13,v&=8191,v+=I*C,v+=P*(5*U),v+=O*(5*L),v+=T*(5*q),b=p+=(v+=B*(5*D))>>>13,b+=x*D,b+=S*N,b+=j*M,b+=E*z,p=(b+=A*R)>>>13,b&=8191,b+=I*F,b+=P*C,b+=O*(5*U),b+=T*(5*L),y=p+=(b+=B*(5*q))>>>13,y+=x*q,y+=S*D,y+=j*N,y+=E*M,p=(y+=A*z)>>>13,y&=8191,y+=I*R,y+=P*F,y+=O*C,y+=T*(5*U),_=p+=(y+=B*(5*L))>>>13,_+=x*L,_+=S*q,_+=j*D,_+=E*N,p=(_+=A*M)>>>13,_&=8191,_+=I*z,_+=P*R,_+=O*F,_+=T*C,w=p+=(_+=B*(5*U))>>>13,w+=x*U,w+=S*L,w+=j*q,w+=E*D,p=(w+=A*N)>>>13,w&=8191,w+=I*M,w+=P*z,w+=O*R,w+=T*F,x=h=8191&(p=(p=((p+=(w+=B*C)>>>13)<<2)+p|0)+(h&=8191)|0),S=l+=p>>>=13,j=d&=8191,E=m&=8191,A=g&=8191,I=v&=8191,P=b&=8191,O=y&=8191,T=_&=8191,B=w&=8191,t+=16,r-=16;this.h[0]=x,this.h[1]=S,this.h[2]=j,this.h[3]=E,this.h[4]=A,this.h[5]=I,this.h[6]=P,this.h[7]=O,this.h[8]=T,this.h[9]=B},E.prototype.finish=function(e,t){var r,i,n,a,o=new Uint16Array(10);if(this.leftover){for(a=this.leftover,this.buffer[a++]=1;a<16;a++)this.buffer[a]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=r,r=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this.h[a]+r,r=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,i=(1^r)-1,a=0;a<10;a++)o[a]&=i;for(i=~i,a=0;a<10;a++)this.h[a]=this.h[a]&i|o[a];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,a=1;a<8;a++)n=(this.h[a]+this.pad[a]|0)+(n>>>16)|0,this.h[a]=65535&n;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var i,n;if(this.leftover){for(r<(n=16-this.leftover)&&(n=r),i=0;i>>16,I=65535&(S=D),P=S>>>16,E+=65535&(j=((g=K)>>>14|(c=z)<<18)^(K>>>18|z<<14)^(z>>>9|K<<23)),A+=j>>>16,I+=65535&(S=(z>>>14|K<<18)^(z>>>18|K<<14)^(K>>>9|z<<23)),P+=S>>>16,E+=65535&(j=K&(v=V)^~K&(b=G)),A+=j>>>16,I+=65535&(S=z&(u=M)^~z&(f=N)),P+=S>>>16,S=Z[2*k],E+=65535&(j=Z[2*k+1]),A+=j>>>16,I+=65535&S,P+=S>>>16,S=O[k%16],A+=(j=T[k%16])>>>16,I+=65535&S,P+=S>>>16,I+=(A+=(E+=65535&j)>>>16)>>>16,E=65535&(j=w=65535&E|A<<16),A=j>>>16,I=65535&(S=_=65535&I|(P+=I>>>16)<<16),P=S>>>16,E+=65535&(j=(q>>>28|B<<4)^(B>>>2|q<<30)^(B>>>7|q<<25)),A+=j>>>16,I+=65535&(S=(B>>>28|q<<4)^(q>>>2|B<<30)^(q>>>7|B<<25)),P+=S>>>16,A+=(j=q&L^q&U^L&U)>>>16,I+=65535&(S=B&C^B&F^C&F),P+=S>>>16,p=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,y=65535&E|A<<16,E=65535&(j=m),A=j>>>16,I=65535&(S=s),P=S>>>16,A+=(j=w)>>>16,I+=65535&(S=_),P+=S>>>16,C=n,F=a,R=o,z=s=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,M=c,N=u,D=f,B=p,L=h,U=l,H=d,K=m=65535&E|A<<16,V=g,G=v,$=b,q=y,k%16==15)for(x=0;x<16;x++)S=O[x],E=65535&(j=T[x]),A=j>>>16,I=65535&S,P=S>>>16,S=O[(x+9)%16],E+=65535&(j=T[(x+9)%16]),A+=j>>>16,I+=65535&S,P+=S>>>16,_=O[(x+1)%16],E+=65535&(j=((w=T[(x+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),A+=j>>>16,I+=65535&(S=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),P+=S>>>16,_=O[(x+14)%16],A+=(j=((w=T[(x+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,I+=65535&(S=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,O[x]=65535&I|P<<16,T[x]=65535&E|A<<16;E=65535&(j=q),A=j>>>16,I=65535&(S=B),P=S>>>16,S=e[0],A+=(j=t[0])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[0]=B=65535&I|P<<16,t[0]=q=65535&E|A<<16,E=65535&(j=L),A=j>>>16,I=65535&(S=C),P=S>>>16,S=e[1],A+=(j=t[1])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[1]=C=65535&I|P<<16,t[1]=L=65535&E|A<<16,E=65535&(j=U),A=j>>>16,I=65535&(S=F),P=S>>>16,S=e[2],A+=(j=t[2])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[2]=F=65535&I|P<<16,t[2]=U=65535&E|A<<16,E=65535&(j=H),A=j>>>16,I=65535&(S=R),P=S>>>16,S=e[3],A+=(j=t[3])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[3]=R=65535&I|P<<16,t[3]=H=65535&E|A<<16,E=65535&(j=K),A=j>>>16,I=65535&(S=z),P=S>>>16,S=e[4],A+=(j=t[4])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[4]=z=65535&I|P<<16,t[4]=K=65535&E|A<<16,E=65535&(j=V),A=j>>>16,I=65535&(S=M),P=S>>>16,S=e[5],A+=(j=t[5])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[5]=M=65535&I|P<<16,t[5]=V=65535&E|A<<16,E=65535&(j=G),A=j>>>16,I=65535&(S=N),P=S>>>16,S=e[6],A+=(j=t[6])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[6]=N=65535&I|P<<16,t[6]=G=65535&E|A<<16,E=65535&(j=$),A=j>>>16,I=65535&(S=D),P=S>>>16,S=e[7],A+=(j=t[7])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[7]=D=65535&I|P<<16,t[7]=$=65535&E|A<<16,W+=128,i-=128}return i}function X(e,t,r){var i,n=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,Y(n,a,t,r),r%=128,i=0;i>(7&n)&1),J(t,e),J(e,e),Q(e,t,i)}function re(e,t){var r=[m(),m(),m(),m()];T(r[0],i),T(r[1],s),T(r[2],f),q(r[3],i,s),te(e,r,t)}function ie(e,t,r){var i,n=new Uint8Array(64),a=[m(),m(),m(),m()];for(r||o(t,32),X(n,t,32),n[0]&=248,n[31]&=127,n[31]|=64,re(a,n),ee(e,a),i=0;i<32;i++)t[i+32]=e[i];return 0}var ne=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var r,i,n,a;for(i=63;32<=i;--i){for(r=0,n=i-32,a=i-12;n>8,t[n]-=256*r;t[n]+=r,t[i]=0}for(n=r=0;n<32;n++)t[n]+=r-(t[31]>>4)*ne[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*ne[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function oe(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function se(e,t,r,i){var n,a,o=new Uint8Array(64),s=new Uint8Array(64),c=new Uint8Array(64),u=new Float64Array(64),f=[m(),m(),m(),m()];X(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var p=r+64;for(n=0;n>7&&D(e[0],u,e[0]),q(e[3],e[0],e[1]),0)}function ue(e,t,r,i){var n,a=new Uint8Array(32),o=new Uint8Array(64),s=[m(),m(),m(),m()],c=[m(),m(),m(),m()];if(-1,r<64)return-1;if(ce(c,i))return-1;for(n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,M=String.fromCharCode;function N(e){throw new RangeError(o[e])}function s(e,t){var r=e.split("@"),i="";return 1>1,e+=z(e/t);455z((C-n)/p))&&N("overflow"),n+=l*p;var d=h<=o?1:o+26<=h?26:h-o;if(lz(C/m)&&N("overflow"),p*=m}var g=r.length+1;o=L(n-f,g,0==f),z(n/g)>C-a&&N("overflow"),a+=z(n/g),n%=g,r.splice(n++,0,a)}return String.fromCodePoint.apply(String,r)},u=function(e){var t=[],r=(e=D(e)).length,i=128,n=0,a=72,o=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(o=(u=f.next()).done);o=!0){var p=u.value;p<128&&t.push(M(p))}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}var h=t.length,l=h;for(h&&t.push("-");lz((C-n)/w)&&N("overflow"),n+=(d-i)*w,i=d;var k=!0,x=!1,S=void 0;try{for(var j,E=e[Symbol.iterator]();!(k=(j=E.next()).done);k=!0){var A=j.value;if(AC&&N("overflow"),A==i){for(var I=n,P=36;;P+=36){var O=P<=a?1:a+26<=P?26:P-a;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function l(e){for(var t="",r=0,i=e.length;rA-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(V,"g"),Y=new RegExp($,"g"),X=new RegExp(F("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',W),"g"),J=new RegExp(F("[^]",V,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),Q=J;function ee(e){var t=l(e);return t.match(Z)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,a={},o=r.query.split("&"),s=0,c=o.length;s",'"',"`"," ","\r","\n","\t"]),M=["'"].concat(n),N=["%","/","?",";","#"].concat(M),D=["/","?","#"],q=/^[+a-z0-9A-Z_-]{0,63}$/,L=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,U={javascript:!0,"javascript:":!0},H={javascript:!0,"javascript:":!0},K={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},V=e("querystring");function a(e,t,r){if(e&&F.isObject(e)&&e instanceof A)return e;var i=new A;return i.parse(e,t,r),i}A.prototype.parse=function(e,t,r){if(!F.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===e?"undefined":_typeof(e)));var i=e.indexOf("?"),n=-1!==i&&i>t&63|128)}function p(e){if(0==(4294967168&e))return s(e);var t="";return 0==(4294965248&e)?t=s(e>>6&31|192):0==(4294901760&e)?(u(e),t=s(e>>12&15|224),t+=f(e,6)):0==(4292870144&e)&&(t=s(e>>18&7|240),t+=f(e,12),t+=f(e,6)),t+=s(63&e|128)}function h(){if(a<=o)throw Error("Invalid byte index");var e=255&n[o];if(o++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,t;if(a>>10&1023|55296),t=56320|1023&t),n+=s(t);return n}(r)}};if("function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define(function(){return d});else if(t&&!t.nodeType)if(r)r.exports=d;else{var m={}.hasOwnProperty;for(var g in d)m.call(d,g)&&(t[g]=d[g])}else e.utf8=d}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],503:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],504:[function(e,t,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],505:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{"./support/isBuffer":504,_process:382,dup:70,inherits:320}],506:[function(e,t,r){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},{}],507:[function(e,t,r){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var n=new Uint8Array(16);t.exports=function(){return i(n),n}}else{var a=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}},{}],508:[function(e,t,r){var o=e("./lib/rng"),s=e("./lib/bytesToUuid");t.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var a=0;a<16;++a)t[i+a]=n[a];return t||s(n)}},{"./lib/bytesToUuid":506,"./lib/rng":507}],509:[function(e,t,r){var s=e("assert-plus"),i=e("util"),n=e("extsprintf"),c=e("core-util-is").isError,a=n.sprintf;function u(e){var t,r,i,n;if(s.object(e,"args"),s.bool(e.strict,"args.strict"),s.array(e.argv,"args.argv"),0===(t=e.argv).length)r={},i=[];else if(c(t[0]))r={cause:t[0]},i=t.slice(1);else if("object"===_typeof(t[0])){for(n in r={},t[0])r[n]=t[0][n];i=t.slice(1)}else s.string(t[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},i=t;return s.object(r),r.strict||e.strict||(i=i.map(function(e){return null===e?"null":void 0===e?"undefined":e})),{options:r,shortmessage:0===i.length?"":a.apply(null,i)}}function f(){var e,t,r,i,n,a,o;if(e=Array.prototype.slice.call(arguments,0),!(this instanceof f))return t=Object.create(f.prototype),f.apply(t,arguments),t;if((r=u({argv:e,strict:!1})).options.name&&(s.string(r.options.name,'error\'s "name" must be a string'),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,a=r.shortmessage,(i=r.options.cause)&&(s.ok(c(i),"cause is not an Error"),this.jse_cause=i,r.options.skipCauseMessage||(a+=": "+i.message)),this.jse_info={},r.options.info)for(o in r.options.info)this.jse_info[o]=r.options.info[o];return this.message=a,Error.call(this,a),Error.captureStackTrace&&(n=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,n)),this}function o(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof o?(i=(r=u({argv:e,strict:!0})).options,f.call(this,i,"%s",r.shortmessage),this):(t=Object.create(o.prototype),o.apply(t,arguments),t)}function p(e){s.array(e,"list of errors"),s.ok(0this._inputTypes.length&&!n.isObject(e[e.length-1]))return a.inputDefaultBlockNumberFormatter(e.pop())},s.prototype.toPayload=function(e){var t={};return e.length>this._inputTypes.length&&n.isObject(e[e.length-1])&&(t=e[e.length-1]),t.to=this._address,t.data="0x"+this.signature()+i.encodeParams(this._inputTypes,e),t},s.prototype.signature=function(){return o(this._name).slice(0,8)},s.prototype.unpackOutput=function(e){if(e){e=2<=e.length?e.slice(2):e;var t=i.decodeParams(this._outputTypes,e);return 1===t.length?t[0]:t}},s.prototype.call=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),i=this.extractCallback(e),t=this.extractDefaultBlock(e),r=this.toPayload(e);if(!i){var n=this._eth.call(r,t);return this.unpackOutput(n)}var a=this;this._eth.call(r,t,function(t,e){if(t)return i(t,null);var r=null;try{r=a.unpackOutput(e)}catch(e){t=e}i(t,r)})},s.prototype.sendTransaction=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),t=this.extractCallback(e),r=this.toPayload(e);if(0=this.buffer.length)){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,t}}},{key:"read",value:function(e){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,Array.from(t)}},{key:"readBool",value:function(){var e=this.read(1)[0];if(255===e)return!0;if(0===e)return!1;throw new n("read_bool() expected 0xff or 0x00; got +"+e)}},{key:"readVaruint",value:function(){for(var e=0,t=0,r=void 0;e|=(127&(r=this.read(1)[0]))< "+e);if(r>=7}}},{key:"writeByte",value:function(e){if(this.length>=this.buffer.length){var t=2*this.length,r=new Uint8Array(t);r.set(this.buffer,0),this.buffer=r}isNaN(e)?this.buffer[this.length]=e.codePointAt():this.buffer[this.length]=e,this.length++}},{key:"writeBytes",value:function(e){var t=this;e.forEach(function(e){t.writeByte(e)})}},{key:"writeVarbytes",value:function(e){this.writeVaruint(e.length),this.writeBytes(e)}},{key:"toString",value:function(){return this.buffer.toHex(0)}}]),e}();m.exports={StreamDeserialization:h,StreamSerialization:l,DeserializationError:n,BadMagicError:a,UnsupportedMajorVersion:o,TruncationError:s,TrailingGarbageError:c,RecursionLimitError:u,SerializerTypeError:f,SerializerValueError:p,ValueError:e,TypeError:t}}).call(this,d("buffer").Buffer)},{"./extend-error.js":568,"./utils.js":575,buffer:191}],567:[function(e,t,r){"use strict";var s=e("./ops.js"),c=e("./timestamp.js"),i=e("./utils.js"),u=e("./context.js"),f=[0,79,112,101,110,84,105,109,101,115,116,97,109,112,115,0,0,80,114,111,111,102,0,191,137,226,232,132,232,146,148],n=function(){function o(e,t){if(_classCallCheck2(this,o),!(e instanceof s.Op&&t instanceof c))throw new u.ValueError("Invalid Timestamp or fileHashOp");if(t.msg.length!==e._DIGEST_LENGTH())throw new u.ValueError("Timestamp message length and fileHashOp digest length differ");this.fileHashOp=e,this.timestamp=t}return _createClass(o,[{key:"fileDigest",value:function(){return this.timestamp.msg}},{key:"serialize",value:function(e){e.writeBytes(f),e.writeVaruint(1),this.fileHashOp.serialize(e),e.writeBytes(this.timestamp.msg),this.timestamp.serialize(e)}},{key:"serializeToBytes",value:function(){var e=new u.StreamSerialization;return this.serialize(e),e.getOutput()}},{key:"toString",value:function(){var e="DetachedTimestampFile\n";return e+="fileHashOp: "+this.fileHashOp.toString()+"\n",e+="timestamp: "+this.timestamp.toString()+"\n"}},{key:"toJson",value:function(){var e={};e.hash=i.bytesToHex(this.fileDigest()),e.op=this.fileHashOp._HASHLIB_NAME(),e.timestamp=this.timestamp.toJson()}},{key:"equals",value:function(e){return e instanceof o&&(!!e.fileHashOp.equals(this.fileHashOp)&&!!e.timestamp.equals(this.timestamp))}}],[{key:"deserialize",value:function(e){var t=void 0;if(e instanceof u.StreamDeserialization)t=e;else if(e instanceof Array)t=new u.StreamDeserialization(e);else if(e instanceof Uint8Array)t=new u.StreamDeserialization(Array.from(e));else{if(!(e instanceof ArrayBuffer))throw new Error("StreamDeserialization deserialize: Invalid param");t=new u.StreamDeserialization(Array.from(e))}t.assertMagic(f);var r=t.readVaruint();if(1!==r)throw new u.UnsupportedMajorVersion("Version "+r+" detached timestamp files are not supported");var i=s.CryptOp.deserialize(t),n=t.readBytes(i._DIGEST_LENGTH()),a=c.deserialize(t,n);return t.assertEof(),new o(i,a)}},{key:"fromBytes",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOp param");var r=void 0;if(t instanceof u.StreamDeserialization)r=e.hashFd(t);else if(t instanceof Array){var i=new u.StreamDeserialization(t);r=e.hashFd(i)}else if(t instanceof Uint8Array){var n=new u.StreamDeserialization(Array.from(t));r=e.hashFd(n)}else{if(!(t instanceof ArrayBuffer))throw new Error("DetachedTimestampFile: Invalid buffer param");var a=new u.StreamDeserialization(Array.from(t));r=e.hashFd(a)}return new o(e,new c(r))}},{key:"fromHash",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOpss param");if(t instanceof Array)return new o(e,new c(t));if(t instanceof ArrayBuffer||t instanceof Uint8Array)return new o(e,new c(Array.from(t)));throw new Error("DetachedTimestampFile: Invalid fdHash param")}}]),o}();t.exports=n},{"./context.js":566,"./ops.js":573,"./timestamp.js":574,"./utils.js":575}],568:[function(e,t,r){var n=e("util"),a=e("assert");Error.extend=function(r,i){a(r,"subTypeName is required");var e=function e(t){if(!(this instanceof e))return new e(t);try{Error.captureStackTrace(this,this.constructor)}catch(e){}this.name=r,this.code=i,this.message=t||"",this.stack=this.stack.replace("Error",this.toString())};return n.inherits(e,this),e.prototype.toString=function(){return this.name+": "+n.inspect(this.message)},e.extend=this.extend,e}},{assert:67,util:505}],569:[function(e,t,r){"use strict";var n=e("request-promise"),a=e("promise"),o=e("./blockstream.js"),s=e("./utils.js"),c=function(){function r(e,t){_classCallCheck2(this,r),this.urlBlockindex=e+"/block-index",this.urlBlock=e+"/block",this.timeout=1e3*t}return _createClass(r,[{key:"blockhash",value:function(e){var i={url:this.urlBlockindex+"/"+e,method:"GET",headers:{Accept:"application/json","User-Agent":"javascript-opentimestamps","Content-Type":"application/x-www-form-urlencoded"},json:!0,timeout:this.timeout};return new a(function(t,r){n(i).then(function(e){if(0===e.size)return console.error("Insight response error body "),void r(new Error("Insight response error body "));t(e.blockHash)}).catch(function(e){console.error("Insight response error: "+e.toString().substr(0,100)),r(e)})})}},{key:"block",value:function(e){var i={url:this.urlBlock+"/"+e,method:"GET",headers:{Accept:"application/json","User-Agent":"javascript-opentimestamps","Content-Type":"application/x-www-form-urlencoded"},json:!0,timeout:this.timeout};return new a(function(t,r){n(i).then(function(e){return e?e.merkleroot&&e.time?void t({merkleroot:e.merkleroot,time:e.time}):r(new Error("Insight response error body ")):(console.error("Insight response error body "),r(new Error("Insight response error body ")))}).catch(function(e){console.error("Insight response error: "+e.toString().substr(0,100)),r(e)})})}}]),r}(),u={bitcoin:["https://insight.bitpay.com/api","https://btc-bitcore1.trezor.io/api","https://btc-bitcore4.trezor.io/api","https://blockexplorer.com/api","https://bitcore.schmoock.net/insight-api"],litecoin:["https://ltc-bitcore1.trezor.io/api","https://insight.litecore.io/api"]},i=function(){function n(e){var r=this;_classCallCheck2(this,n),this.insights=[];var i=e&&Object.prototype.hasOwnProperty.call(e,"timeout")?e.timeout:10,t=e&&Object.prototype.hasOwnProperty.call(e,"chain")?e.chain:"bitcoin";(e&&Object.prototype.hasOwnProperty.call(e,"urls")&&1(new i)._MAX_URI_LENGTH())return console.error("URI exceeds maximum length"),!1;for(var t=0;ta.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=a.privateCalendars.length;else if(a.privateCalendars=[],a.calendars&&0!==a.calendars.length||(a.calendars=c.DEFAULT_AGGREGATORS),a.m&&0!==a.m){if(a.m<0||a.m>a.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=1,2<=a.calendars.length&&(a.m=2);o.createTimestamp(i,a.calendars,a.m,a.privateCalendars).then(function(e){if(void 0===e)return r(new Error("Error on timestamp creation"));t()}).catch(function(e){r(e)})})},createTimestamp:function(i,e,t,r){var n=[];return e&&e.forEach(function(e){var t=new c.RemoteCalendar(e);n.push(t.submit(i.msg)),console.log("Submitting to remote calendar "+e)}),r&&r.forEach(function(e,t){var r=new c.RemoteCalendar(t);r.setKey(e),n.push(r.submit(i.msg)),console.log("Submitting to remote calendar "+t)}),new Promise(function(t,r){Promise.all(n.map(f.softFail)).then(function(e){return e.filter(function(e){return!(e instanceof Error)&&void 0!==e}).forEach(function(e){i.merge(e)}),t(i)}).catch(function(e){r(e)})})},makeMerkleTree:function(e){var i=[];return e.forEach(function(e){if(e instanceof s)try{var t=f.randBytes(16),r=e.timestamp.add(new n.OpAppend(f.arrayToBytes(t))).add(new n.OpSHA256);i.push(r)}catch(e){return}else console.error("Invalid input")}),l.makeMerkleTree(i)},verify:function(e,t,i){if(!f.arrEq(e.fileDigest(),t.fileDigest()))return console.error("Expected digest "+f.bytesToHex(e.fileDigest())),console.error("File does not match original!"),new Promise(function(e,t){t(new Error("File does not match original!"))});var n=this;return new Promise(function(t,r){n.upgradeTimestamp(e.timestamp,i).then(function(){n.verifyTimestamp(e.timestamp,i).then(function(e){return t(e)}).catch(function(e){return r(e)})})})},verifyTimestamp:function(e,r){var i=[],n=this;function c(e,t){return e.attestedTimet.attestedTime?1:0}return e.allAttestations().forEach(function(e,t){i.push(n.verifyAttestation(e,t,r))}),new Promise(function(o,s){Promise.all(i.map(f.softFail)).then(function(e){var t=e.filter(function(e){return e.constructor===p.VerificationError?e:void 0});if(0this._MAX_MSG_LENGTH())){var t=this.call(e);return t.length>this._MAX_RESULT_LENGTH()&&console.error("Error : Result too long;"),t}console.error("Error : Message too long;")}}],[{key:"deserialize",value:function(e){return this.tag=e.readBytes(1)[0],t.deserializeFromTag(e,this.tag)}},{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return n.get(t).deserializeFromTag(e,t);console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),t=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t.arg=void 0===e?[]:e,t}return _inherits(r,c),_createClass(r,[{key:"serialize",value:function(e){_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"serialize",this).call(this,e),e.writeVarbytes(this.arg)}},{key:"toString",value:function(){return this._TAG_NAME()+" "+i.bytesToHex(this.arg)}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t)){var r=e.readVarbytes((new c)._MAX_RESULT_LENGTH(),1);return new(n.get(t))(r)}}}]),r}(),e=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 240}},{key:"_TAG_NAME",value:function(){return"append"}},{key:"call",value:function(e){return e.concat(this.arg)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),r=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 241}},{key:"_TAG_NAME",value:function(){return"prepend"}},{key:"call",value:function(e){return this.arg.concat(e)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),u=function(e){function t(){return _classCallCheck2(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,c),_createClass(t,[{key:"toString",value:function(){return this._TAG_NAME()}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return new(n.get(t));console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),f=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 242}},{key:"_TAG_NAME",value:function(){return"reverse"}},{key:"call",value:function(e){return 0===e.length&&console.error("Can't reverse an empty message"),e.reverse()}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),p=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 243}},{key:"_TAG_NAME",value:function(){return"hexlify"}},{key:"_MAX_MSG_LENGTH",value:function(){return u._MAX_RESULT_LENGTH()}},{key:"call",value:function(e){0===e.length&&console.error("Can't hexlify an empty message")}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),h=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_HASHLIB_NAME",value:function(){return 0}},{key:"call",value:function(e,t){for(var r=("keccak256"===e._HASHLIB_NAME()?s(e._HASHLIB_NAME()).update(a.from(t)):o.createHash(e._HASHLIB_NAME()).update(a.from(t))).digest(),i=[r.length],n=0;n(new m.Op)._MAX_MSG_LENGTH())throw new TypeError("Message exceeds Op length limit; "+e.length+" > "+(new m.Op)._MAX_MSG_LENGTH());this.msg=e,this.attestations=[],this.ops=new Map}return _createClass(h,[{key:"getDigest",value:function(){return this.msg}},{key:"serialize",value:function(r){var i=this;if(!this.attestations&&!this.ops)throw new a.ValueError("An empty timestamp can't be serialized");var e=this.attestations;if(e.sort(function(e,t){return e.compareTo(t)}),1 "+t.toString()+u(o,n,i)+"\n",f+=e.strTree(a+1,o)});else if(0>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},r.charsToHex=function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&i).toString(16))}return t.join("")},r.charToByte=function(e){return e.charCodeAt(0)},r.charsToBytes=function(e){for(var t=[],r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,f=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,p=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,l=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",i.copy(m[e])}function g(e){var t=e.match(o);if(!t)return!1;var r,i=+t[1],n=+t[2],a=+t[3];return 1<=n&&n<=12&&1<=a&&a<=(2!=n||((r=i)%4!=0||r%100==0&&r%400!=0)?s[n]:29)}function v(e,t){var r=e.match(c);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return(i<=23&&n<=59&&a<=59||23==i&&59==n&&60==a)&&(!t||o)}(t.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d},m.full={date:g,time:v,"date-time":function(e){var t=e.split(b);return 2==t.length&&g(t[0])&&v(t[1],!0)},uri:function(e){return y.test(e)&&a.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&n.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d};var b=/t|\s/i;var y=/\/|:/;var _=/[^\\]\\Z/;function w(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":12}],7:[function(e,t,r){"use strict";var I=e("./resolve"),P=e("./util"),O=e("./error_classes"),T=e("fast-json-stable-stringify"),B=e("../dotjs/validate"),C=P.ucs2length,F=e("fast-deep-equal"),R=O.Validation;function z(e,t,r){var i=n.call(this,e,t,r);return 0<=i?{index:i,compiling:!0}:{index:i=this._compilations.length,compiling:!(this._compilations[i]={schema:e,root:t,baseId:r})}}function M(e,t,r){var i=n.call(this,e,t,r);0<=i&&this._compilations.splice(i,1)}function n(e,t,r){for(var i=0;i",b=l?">":"<",y=void 0;if(g){var _=e.util.getData(m.$data,o,e.dataPathArr),w="exclusive"+a,k="exclType"+a,x="exclIsNumber"+a,S="' + "+(A="op"+a)+" + '";n+=" var schemaExcl"+a+" = "+_+"; ",n+=" var "+w+"; var "+k+" = typeof "+(_="schemaExcl"+a)+"; if ("+k+" != 'boolean' && "+k+" != 'undefined' && "+k+" != 'number') { ";var j;y=d;(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var E=n;n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+k+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+_+" "+v+"= "+i+") ? "+p+" "+b+"= "+_+" : "+p+" "+b+" "+i+" ) : ( ("+w+" = "+_+" === true) ? "+p+" "+b+"= "+i+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { var op"+a+" = "+w+" ? '"+v+"' : '"+v+"='; ",void 0===s&&(y=d,u=e.errSchemaPath+"/"+d,i=_,h=g)}else{S=v;if((x="number"==typeof m)&&h){var A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ( "+i+" === undefined || "+m+" "+v+"= "+i+" ? "+p+" "+b+"= "+m+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { "}else{x&&void 0===s?(w=!0,y=d,u=e.errSchemaPath+"/"+d,i=m,b+="="):(x&&(i=Math[l?"min":"max"](m,s)),m===(!x||i)?(w=!0,y=d,u=e.errSchemaPath+"/"+d,b+="="):(w=!1,S+="="));A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+" "+b+" "+i+" || "+p+" !== "+p+") { "}}y=y||t,(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+A+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+S+" ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";E=n;return n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s;var l="maxLength"==t?">":"<";n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+p+".length ":n+=" ucs2length("+p+") ",n+=" "+l+" "+i+") { ";var d=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+p+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.schema[t],a=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var f="valid"+c.level,p=c.baseId,h=!0,l=n;if(l)for(var d,m=-1,g=l.length-1;m "+E+") { ";var I=f+"["+E+"]";l.schema=j,l.schemaPath=s+"["+E+"]",l.errSchemaPath=c+"/"+E,l.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),l.dataPathArr[v]=E;var P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",i+=" } ",u&&(i+=" if ("+m+") { ",d+="}")}if("object"==(void 0===_?"undefined":_typeof(_))&&e.util.schemaHasRules(_,e.RULES.all)){l.schema=_,l.schemaPath=e.schemaPath+".additionalItems",l.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+f+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" } } ",u&&(i+=" if ("+m+") { ",d+="}")}}else if(e.util.schemaHasRules(o,e.RULES.all)){l.schema=o,l.schemaPath=s,l.errSchemaPath=c,i+=" for (var "+g+" = 0; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+d+" if ("+h+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],30:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="var division"+a+";if (",h&&(n+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),n+=" (division"+a+" = "+p+" / "+i+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var l=l||[];l.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var d=n;return n=l.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+d+"]); ":n+=" validate.errors = ["+d+"]; return false; ":n+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="errs__"+n,h=e.util.copy(e);h.level++;var l="valid"+h.level;if(e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+p+" = errors; ";var d,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(d=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,d&&(h.opts.allErrors=d),e.compositeRule=h.compositeRule=m,i+=" if ("+l+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var v=i;i=g.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ");return i}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="valid"+n,h="errs__"+n,l=e.util.copy(e),d="";l.level++;var m="valid"+l.level,g=l.baseId,v="prevValid"+n,b="passingSchemas"+n;i+="var "+h+" = errors , "+v+" = false , "+p+" = false , "+b+" = null; ";var y=e.compositeRule;e.compositeRule=l.compositeRule=!0;var _=o;if(_)for(var w,k=-1,x=_.length-1;k=e.opts.loopRequired,k=e.opts.ownProperties;if(u)if(i+=" var missing"+n+"; ",w){h||(i+=" var "+l+" = validate.schema"+s+"; ");var x="' + "+(P="schema"+n+"["+(E="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(_,P,e.opts.jsonPointers)),i+=" var "+p+" = true; ",h&&(i+=" if (schema"+n+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+n+")) "+p+" = false; else {"),i+=" for (var "+E+" = 0; "+E+" < "+l+".length; "+E+"++) { "+p+" = "+f+"["+l+"["+E+"]] !== undefined ",k&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", "+l+"["+E+"]) "),i+="; if (!"+p+") break; } ",h&&(i+=" } "),i+=" if (!"+p+") { ",(I=I||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+x+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var S=i;i=I.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var j=d;if(j)for(var E=-1,A=j.length-1;E 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(0<=d.indexOf("object")||0<=d.indexOf("array")))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var g="checkDataType"+(m?"s":"");n+=" if ("+e.util[g](d,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",l&&(n+=" } "),n+=" if (!"+h+") { ";var v=v||[];v.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var b=n;n=v.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { ")}else f&&(n+=" if (true) { ");return n}},{}],39:[function(e,t,r){"use strict";t.exports=function(i,e,t){var r="",n=!0===i.schema.$async,a=i.util.schemaHasRulesExcept(i.schema,i.RULES.all,"$ref"),o=i.self._getId(i.schema);if(i.isTop&&(r+=" var validate = ",n&&(i.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(i.opts.sourceCode||i.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof i.schema||!a&&!i.schema.$ref){e="false schema";var s=i.level,c=i.dataLevel,u=i.schema[e],f=i.schemaPath+i.util.getProperty(e),p=i.errSchemaPath+"/"+e,h=!i.opts.allErrors,l="data"+(c||""),d="valid"+s;if(!1===i.schema){i.isTop?h=!0:r+=" var "+d+" = false; ",(W=W||[]).push(r),r="",!1!==i.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(p)+" , params: {} ",!1!==i.opts.messages&&(r+=" , message: 'boolean schema is false' "),i.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+i.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var m=r;r=W.pop(),!i.compositeRule&&h?i.async?r+=" throw new ValidationError(["+m+"]); ":r+=" validate.errors = ["+m+"]; return false; ":r+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else i.isTop?r+=n?" return data; ":" validate.errors = null; return true; ":r+=" var "+d+" = true; ";return i.isTop&&(r+=" }; return validate; "),r}if(i.isTop){var g=i.isTop;s=i.level=0,c=i.dataLevel=0,l="data";i.rootId=i.resolve.fullPath(i.self._getId(i.root.schema)),i.baseId=i.baseId||i.rootId,delete i.isTop,i.dataPathArr=[void 0],r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{s=i.level,l="data"+((c=i.dataLevel)||"");if(o&&(i.baseId=i.resolve.url(i.baseId,o)),n&&!i.async)throw new Error("async schema in sync schema");r+=" var errs_"+s+" = errors;"}d="valid"+s,h=!i.opts.allErrors;var v="",b="",y=i.schema.type,_=Array.isArray(y);if(_&&1==y.length&&(y=y[0],_=!1),i.schema.$ref&&a){if("fail"==i.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+i.errSchemaPath+'" (see option extendRefs)');!0!==i.opts.extendRefs&&(a=!1,i.logger.warn('$ref: keywords ignored in schema at path "'+i.errSchemaPath+'"'))}if(i.schema.$comment&&i.opts.$comment&&(r+=" "+i.RULES.all.$comment.code(i,"$comment")),y){if(i.opts.coerceTypes)var w=i.util.coerceToTypes(i.opts.coerceTypes,y);var k=i.RULES.types[y];if(w||_||!0===k||k&&!Z(k)){f=i.schemaPath+".type",p=i.errSchemaPath+"/type",f=i.schemaPath+".type",p=i.errSchemaPath+"/type";var x=_?"checkDataTypes":"checkDataType";if(r+=" if ("+i.util[x](y,l,!0)+") { ",w){var S="dataType"+s,j="coerced"+s;r+=" var "+S+" = typeof "+l+"; ","array"==i.opts.coerceTypes&&(r+=" if ("+S+" == 'object' && Array.isArray("+l+")) "+S+" = 'array'; "),r+=" var "+j+" = undefined; ";var E="",A=w;if(A)for(var I,P=-1,O=A.length-1;P>6],n=0==(32&r);if(31==(31&r)){var a=r;for(r=0;128==(128&a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function p(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)o++;(n=new u(2+o))[0]=a,n[1]=128|o;s=1+o;for(var c=i.length;0>=8)n[s]=255&c;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new u(2*e.length),i=0;i>=7)n++}var o=new u(n),s=o.length-1;for(i=e.length-1;0<=i;i--){a=e[i];for(o[s--]=127&a;0<(a>>=7);)o[s--]=128|127&a}return this._createEncoderBuffer(o)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[c(i.getFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(i.getFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.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&&!u.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new u(r)}if(u.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new u(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var a=e;256<=a;a>>=8)i++;for(a=(n=new Array(i)).length-1;0<=a;a--)n[a]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new u(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var a=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),a.length!==n.defaultBuffer.length)return!1;for(i=0;i=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0===(t&=127))throw c("Indefinite length not supported");if(4this._size-i)return null;if(this._offset=i,0===this.length)return t?a.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?n:n.toString("utf8")},i.prototype.readOID=function(e){e||(e=s.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],i=0,n=0;n>0),r.join(".")},i.prototype._readTag=function(e){o.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw c("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(4this._size-r)return null;this._offset=r;for(var i=this._buf[this._offset],n=0,a=0;a>0},t.exports=i},{"./errors":60,"./types":63,assert:67,"safer-buffer":448}],63:[function(e,t,r){t.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},{}],64:[function(e,t,r){var n=e("assert"),a=e("safer-buffer").Buffer,o=e("./types"),i=e("./errors").newInvalidAsn1Error,s={size:1024,growthFactor:8};function c(e){var r,i;r=s,i=e||{},n.ok(r),n.equal(void 0===r?"undefined":_typeof(r),"object"),n.ok(i),n.equal(void 0===i?"undefined":_typeof(i),"object"),Object.getOwnPropertyNames(r).forEach(function(e){if(!i[e]){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,t)}}),e=i,this._buf=a.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw i(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},c.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=o.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&1 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;0>>24,e<<=8},c.prototype.writeNull=function(){this.writeByte(o.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=o.Enumeration),this.writeInt(e,t)},c.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=o.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},c.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+(void 0===e?"undefined":_typeof(e))+")");"number"!=typeof t&&(t=o.OctetString);var r=a.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},c.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!a.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},c.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(e){t.writeString(e)})},c.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=o.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),i=[];i.push(40*parseInt(r[0],10)+parseInt(r[1],10)),r.slice(2).forEach(function(e){var t,r;t=i,(r=parseInt(e,10))<128?t.push(r):(r<16384?t.push(r>>>7|128):(r<2097152?t.push(r>>>14|128):(r<268435456?t.push(r>>>21|128):(t.push(255&(r>>>28|128)),t.push(255&(r>>>21|128))),t.push(255&(r>>>14|128))),t.push(255&(r>>>7|128))),t.push(127&r))});var n=this;this._ensure(2+i.length),this.writeByte(t),this.writeLength(i.length),i.forEach(function(e){n.writeByte(e)})},c.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw i("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},c.prototype.startSequence=function(e){"number"!=typeof e&&(e=o.Sequence|o.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw i("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},c.prototype._shift=function(e,t,r){n.ok(void 0!==e),n.ok(void 0!==t),n.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},c.prototype._ensure=function(e){if(n.ok(e),this._size-this._offset>16&255,a[o++]=t>>8&255,a[o++]=255&t;var u,f;2===n&&(t=p[e.charCodeAt(c)]<<2|p[e.charCodeAt(c+1)]>>4,a[o++]=255&t);1===n&&(t=p[e.charCodeAt(c)]<<10|p[e.charCodeAt(c+1)]<<4|p[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],a=0,o=r-i;a>2]+s[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],p=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,a=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return a.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},{}],76:[function(e,t,r){"use strict";var y=e("tweetnacl").lowlevel.crypto_hash,s=0,c=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};function n(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}function u(e,t){var r,i=0;for(r=0;r<4;r++,s++)t<=s&&(s=0),i=i<<8|e[s];return i}c.prototype.encipher=function(e,t){void 0===t&&(t=new Uint8Array(e.buffer),0!==e.byteOffset&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=n(this.S,t,0)^this.P[r],e[0]^=n(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i},c.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);0!==e.byteOffset&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;0>>24,r[4*i+2]=a[i]>>>16,r[4*i+1]=a[i]>>>8,r[4*i+0]=a[i]}t.exports={BLOCKS:f,HASHSIZE:32,hash:_,pbkdf:function(e,t,r,i,n,a,o){var s,c,u,f,p,h,l=new Uint8Array(64),d=new Uint8Array(64),m=new Uint8Array(32),g=new Uint8Array(32),v=new Uint8Array(i+4),b=a;if(o<1)return-1;if(0===t||0===i||0===a||a>m.byteLength*m.byteLength||1<<20>>24,v[i+1]=h>>>16,v[i+2]=h>>>8,v[i+3]=h,y(d,v,i+4),_(l,d,g),s=m.byteLength;s--;)m[s]=g[s];for(s=1;sa[o]^r?1:-1;return c==u?0:u=t&&e<=r}function J(e){return"[object Array]"==Object.prototype.toString.call(e)}function Q(e,t,r){for(var i,n,a=[0],o=0,s=e.length;or-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}function ee(e,t){return(1(r=e.length)){for(i="0",t-=r;--t;i+="0");e+=i}else tt;)u[n]=0,n||(++a,u.unshift(1));for(o=u.length;!u[--o];);for(p=0,e="";p<=o;e+=U.charAt(u[p++]));e=te(e,a)}return e}function P(e,t,r,i){var n,a,o,s,c;if(r=null!=r&&k(r,0,8,i,q)?0|r:b,!e.c)return e.toString();if(n=e.c[0],o=e.e,null==t)c=Z(e.c),c=19==i||24==i&&o<=h?ee(c,o):te(c,o);else if(a=(e=C(new I(e),t,r)).e,s=(c=Z(e.c)).length,19==i||24==i&&(t<=a||a<=h)){for(;sy?e.c=e.e=null:e.c=r=p.length){if(!i)break e;for(;p.length<=u;p.push(0));c=f=0,o=(a%=K)-K+(n=1)}else{for(c=s=p[u],n=1;10<=s;s/=10,n++);f=(o=(a%=K)-K+n)<0?0:c/h[n-o-1]%10|0}if(i=i||t<0||null!=p[u+1]||(o<0?c:c%h[n-o-1]),i=r<4?(f||i)&&(0==r||r==(e.s<0?3:2)):5y?e.c=e.e=null:e.er)return null!=(e=n[r++])};return o(t="DECIMAL_PLACES")&&k(e,0,$,2,t)&&(d=0|e),i[t]=d,o(t="ROUNDING_MODE")&&k(e,0,8,2,t)&&(b=0|e),i[t]=b,o(t="EXPONENTIAL_AT")&&(J(e)?k(e[0],-$,0,2,t)&&k(e[1],0,$,2,t)&&(h=0|e[0],l=0|e[1]):k(e,-$,$,2,t)&&(h=-(l=0|(e<0?-e:e)))),i[t]=[h,l],o(t="RANGE")&&(J(e)?k(e[0],-$,-1,2,t)&&k(e[1],1,$,2,t)&&(m=0|e[0],y=0|e[1]):k(e,-$,$,2,t)&&(0|e?m=-(y=0|(e<0?-e:e)):w&&B(2,t+" cannot be zero",e))),i[t]=[m,y],o(t="ERRORS")&&(e===!!e||1===e||0===e?(_=0,k=(w=!!e)?O:X):w&&B(2,t+D,e)),i[t]=w,o(t="CRYPTO")&&(e===!!e||1===e||0===e?(x=!(!e||!F||"object"!=(void 0===F?"undefined":_typeof(F))),e&&!x&&w&&B(2,"crypto unavailable",F)):w&&B(2,t+D,e)),i[t]=x,o(t="MODULO_MODE")&&k(e,0,9,2,t)&&(S=0|e),i[t]=S,o(t="POW_PRECISION")&&k(e,0,$,2,t)&&(j=0|e),i[t]=j,o(t="FORMAT")&&("object"==(void 0===e?"undefined":_typeof(e))?E=e:w&&B(2,t+" not an object",e)),i[t]=E,i},I.max=function(){return n(arguments,i.lt)},I.min=function(){return n(arguments,i.gt)},I.random=(r=9007199254740992,u=Math.random()*r&2097151?function(){return N(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,n,a,o=0,s=[],c=new I(v);if(e=null!=e&&k(e,0,$,14)?0|e:d,n=M(e/K),x)if(F&&F.getRandomValues){for(t=F.getRandomValues(new Uint32Array(n*=2));o>>11))?(r=F.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(s.push(a%1e14),o+=2);o=n/2}else if(F&&F.randomBytes){for(t=F.randomBytes(n*=7);ot[n]?1:-1;break}return a}function A(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r](x[s]||0)&&o--,k<0)l.push(1),c=!0;else{for(b=x.length,_=S.length,k+=2,1<(u=N(n/(S[s=0]+1)))&&(S=j(S,u,n),x=j(x,u,n),_=S.length,b=x.length),v=_,m=(d=x.slice(0,_)).length;m<_;d[m++]=0);(w=S.slice()).unshift(0),y=S[0],S[1]>=n/2&&y++;do{if(u=0,(a=E(S,d,_,m))<0){if(g=d[0],_!=m&&(g=g*n+(d[1]||0)),1<(u=N(g/y)))for(n<=u&&(u=n-1),p=(f=j(S,u,n)).length,m=d.length;1==E(f,d,p,m);)u--,A(f,_this.c.length-2},i.isNaN=function(){return!this.s},i.isNegative=i.isNeg=function(){return this.s<0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.lessThan=i.lt=function(e,t){return _=8,Y(this,new I(e,t))<0},i.lessThanOrEqualTo=i.lte=function(e,t){return _=9,-1===(t=Y(this,new I(e,t)))||0===t},i.minus=i.sub=function(e,t){var r,i,n,a,o=this,s=o.s;if(_=10,t=(e=new I(e,t)).s,!s||!t)return new I(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/K,u=e.e/K,f=o.c,p=e.c;if(!c||!u){if(!f||!p)return f?(e.s=-t,e):new I(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new I(f[0]?o:3==b?-0:0)}if(c=W(c),u=W(u),f=f.slice(),s=c-u){for((n=(a=s<0)?(s=-s,f):(u=c,p)).reverse(),t=s;t--;n.push(0));n.reverse()}else for(i=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;tt&&(t=this.e+1),t},i.round=function(e,t){var r=new I(this);return(null==e||k(e,0,$,15))&&C(r,~~e+this.e+1,null!=t&&k(t,0,8,15,q)?0|t:b),r},i.shift=function(e){var t=this;return k(e,-a,a,16,"argument")?t.times("1e"+re(e)):new I(t.c&&t.c[0]&&(e<-a||at&&(r.c.length=t)}if(!(i=N(i/2)))break;n=n.times(n),t&&n.c&&n.c.length>t&&(n.c.length=t)}return e<0&&(r=v.div(r)),t?C(r,j,b):r},i.toPrecision=function(e,t){return P(this,null!=e&&k(e,1,$,24,"precision")?0|e:null,t,24)},i.toString=function(e){var t,r=this.s,i=this.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=Z(this.c),t=null!=e&&k(e,2,64,25,"base")?A(te(t,i),0|e,10,r):i<=h||l<=i?ee(t,i):te(t,i),r<0&&this.c[0]&&(t="-"+t)),t},i.truncated=i.trunc=function(){return C(new I(this),this.e+1,1)},i.valueOf=i.toJSON=function(){return this.toString()},null!=t&&I.config(t),I}(),"function"==typeof define&&define.amd)define(function(){return t});else if(void 0!==i&&i.exports){if(i.exports=t,!F)try{F=r("crypto")}catch(e){}}else e.BigNumber=t}(this)},{crypto:204}],78:[function(i,n,e){(function(e,t){"use strict";var r=n.exports;r.version="v"+i("./package.json").version,r.versionGuard=function(e){if(void 0!==e){throw new Error("More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.")}},r.versionGuard(e._bitcore),e._bitcore=r.version,r.crypto={},r.crypto.BN=i("./lib/crypto/bn"),r.crypto.ECDSA=i("./lib/crypto/ecdsa"),r.crypto.Hash=i("./lib/crypto/hash"),r.crypto.Random=i("./lib/crypto/random"),r.crypto.Point=i("./lib/crypto/point"),r.crypto.Signature=i("./lib/crypto/signature"),r.encoding={},r.encoding.Base58=i("./lib/encoding/base58"),r.encoding.Base58Check=i("./lib/encoding/base58check"),r.encoding.BufferReader=i("./lib/encoding/bufferreader"),r.encoding.BufferWriter=i("./lib/encoding/bufferwriter"),r.encoding.Varint=i("./lib/encoding/varint"),r.util={},r.util.buffer=i("./lib/util/buffer"),r.util.js=i("./lib/util/js"),r.util.preconditions=i("./lib/util/preconditions"),r.errors=i("./lib/errors"),r.Address=i("./lib/address"),r.Block=i("./lib/block"),r.MerkleBlock=i("./lib/block/merkleblock"),r.BlockHeader=i("./lib/block/blockheader"),r.HDPrivateKey=i("./lib/hdprivatekey.js"),r.HDPublicKey=i("./lib/hdpublickey.js"),r.Networks=i("./lib/networks"),r.Opcode=i("./lib/opcode"),r.PrivateKey=i("./lib/privatekey"),r.PublicKey=i("./lib/publickey"),r.Script=i("./lib/script"),r.Transaction=i("./lib/transaction"),r.URI=i("./lib/uri"),r.Unit=i("./lib/unit"),r.deps={},r.deps.bnjs=i("bn.js"),r.deps.bs58=i("bs58"),r.deps.Buffer=t,r.deps.elliptic=i("elliptic"),r.deps._=i("lodash"),r._HDKeyCache=i("./lib/hdkeycache"),r.Transaction.sighash=i("./lib/transaction/sighash")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i("buffer").Buffer)},{"./lib/address":79,"./lib/block":82,"./lib/block/blockheader":81,"./lib/block/merkleblock":83,"./lib/crypto/bn":84,"./lib/crypto/ecdsa":85,"./lib/crypto/hash":86,"./lib/crypto/point":87,"./lib/crypto/random":88,"./lib/crypto/signature":89,"./lib/encoding/base58":90,"./lib/encoding/base58check":91,"./lib/encoding/bufferreader":92,"./lib/encoding/bufferwriter":93,"./lib/encoding/varint":94,"./lib/errors":95,"./lib/hdkeycache":97,"./lib/hdprivatekey.js":98,"./lib/hdpublickey.js":99,"./lib/networks":100,"./lib/opcode":101,"./lib/privatekey":102,"./lib/publickey":103,"./lib/script":104,"./lib/transaction":107,"./lib/transaction/sighash":115,"./lib/unit":119,"./lib/uri":120,"./lib/util/buffer":121,"./lib/util/js":122,"./lib/util/preconditions":123,"./package.json":150,"bn.js":124,bs58:125,buffer:191,elliptic:127,lodash:149}],79:[function(e,t,r){(function(a){"use strict";var n=e("lodash"),o=e("./util/preconditions"),i=e("./errors"),s=e("./encoding/base58check"),c=e("./networks"),r=e("./crypto/hash"),u=e("./util/js"),f=e("./publickey");function p(e,t,r){if(!(this instanceof p))return new p(e,t,r);if(n.isArray(e)&&n.isNumber(t))return p.createMultisig(e,t,r);if(e instanceof p)return e;if(o.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!c.get(t))throw new TypeError('Second argument must be "livenet" or "testnet".');if(r&&r!==p.PayToPublicKeyHash&&r!==p.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||c.get(t)||c.defaultNetwork,i.type=i.type||r||p.PayToPublicKeyHash,u.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}p.prototype._classifyArguments=function(e,t,r){if((e instanceof a||e instanceof Uint8Array)&&20===e.length)return p._transformHash(e);if((e instanceof a||e instanceof Uint8Array)&&21===e.length)return p._transformBuffer(e,t,r);if(e instanceof f)return p._transformPublicKey(e);if(e instanceof h)return p._transformScript(e,t);if("string"==typeof e)return p._transformString(e,t,r);if(n.isObject(e))return p._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")},p.PayToPublicKeyHash="pubkeyhash",p.PayToScriptHash="scripthash",p._transformHash=function(e){var t={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==e.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t},p._transformObject=function(e){return o.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),o.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?new a(e.hash,"hex"):e.hashBuffer,network:c.get(e.network)||c.defaultNetwork,type:e.type}},p._classifyFromVersion=function(e){var t={},r=c.get(e[0],"pubkeyhash"),i=c.get(e[0],"scripthash");return r?(t.network=r,t.type=p.PayToPublicKeyHash):i&&(t.network=i,t.type=p.PayToScriptHash),t},p._transformBuffer=function(e,t,r){var i={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==e.length)throw new TypeError("Address buffers must be exactly 21 bytes.");t=c.get(t);var n=p._classifyFromVersion(e);if(!n.network||t&&t!==n.network)throw new TypeError("Address has mismatched network type.");if(!n.type||r&&r!==n.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=n.network,i.type=n.type,i},p._transformPublicKey=function(e){var t={};if(!(e instanceof f))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=r.sha256ripemd160(e.toBuffer()),t.type=p.PayToPublicKeyHash,t},p._transformScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new i.Script.CantDeriveAddress(e);return r},p.createMultisig=function(e,t,r){return r=r||e[0].network||c.defaultNetwork,p.payingTo(h.buildMultisigOut(e,t),r)},p._transformString=function(e,t,r){if("string"!=typeof e)throw new TypeError("data parameter supplied is not a string.");e=e.trim();var i=s.decode(e);return p._transformBuffer(i,t,r)},p.fromPublicKey=function(e,t){var r=p._transformPublicKey(e);return t=t||c.defaultNetwork,new p(r.hashBuffer,t,r.type)},p.fromPublicKeyHash=function(e,t){return new p(p._transformHash(e).hashBuffer,t,p.PayToPublicKeyHash)},p.fromScriptHash=function(e,t){return o.checkArgument(e,"hash parameter is required"),new p(p._transformHash(e).hashBuffer,t,p.PayToScriptHash)},p.payingTo=function(e,t){return o.checkArgument(e,"script is required"),o.checkArgument(e instanceof h,"script must be instance of Script"),p.fromScriptHash(r.sha256ripemd160(e.toBuffer()),t)},p.fromScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=p._transformScript(e,t);return new p(r.hashBuffer,t,r.type)},p.fromBuffer=function(e,t,r){var i=p._transformBuffer(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromString=function(e,t,r){var i=p._transformString(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromObject=function(e){return o.checkState(u.isHexa(e.hash),'Unexpected hash property, "'+e.hash+'", expected to be hex.'),new p(new a(e.hash,"hex"),e.network,e.type)},p.getValidationError=function(e,t,r){var i;try{new p(e,t,r)}catch(e){i=e}return i},p.isValid=function(e,t,r){return!p.getValidationError(e,t,r)},p.prototype.isPayToPublicKeyHash=function(){return this.type===p.PayToPublicKeyHash},p.prototype.isPayToScriptHash=function(){return this.type===p.PayToScriptHash},p.prototype.toBuffer=function(){var e=new a([this.network[this.type]]);return a.concat([e,this.hashBuffer])},p.prototype.toObject=p.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},p.prototype.toString=function(){return s.encode(this.toBuffer())},p.prototype.inspect=function(){return""},t.exports=p;var h=e("./script")}).call(this,e("buffer").Buffer)},{"./crypto/hash":86,"./encoding/base58check":91,"./errors":95,"./networks":100,"./publickey":103,"./script":104,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],80:[function(t,l,e){(function(o){"use strict";var r=t("lodash"),n=t("./blockheader"),i=t("../crypto/bn"),a=t("../util/buffer"),s=t("../encoding/bufferreader"),c=t("../encoding/bufferwriter"),u=t("../crypto/hash"),f=t("../transaction"),p=t("../util/preconditions");function h(e){return this instanceof h?(r.extend(this,h._from(e)),this):new h(e)}h.MAX_BLOCK_SIZE=1e6,h._from=function(e){var t={};if(a.isBuffer(e))t=h._fromBufferReader(s(e));else{if(!r.isObject(e))throw new TypeError("Unrecognized argument for Block");t=h._fromObject(e)}return t},h._fromObject=function(e){var t=[];return e.transactions.forEach(function(e){e instanceof f?t.push(e):t.push(f().fromObject(e))}),{header:n.fromObject(e.header),transactions:t}},h.fromObject=function(e){return new h(h._fromObject(e))},h._fromBufferReader=function(e){var t={};p.checkState(!e.finished(),"No block data received"),t.header=n.fromBufferReader(e);var r=e.readVarintNum();t.transactions=[];for(var i=0;i"},h.Values={START_OF_BLOCK:8,NULL_HASH:new o("0000000000000000000000000000000000000000000000000000000000000000","hex")},l.exports=h}).call(this,t("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../transaction":107,"../util/buffer":121,"../util/preconditions":123,"./blockheader":81,buffer:191,lodash:149}],81:[function(f,p,e){(function(i){"use strict";var n=f("lodash"),a=f("../crypto/bn"),o=f("../util/buffer"),s=f("../encoding/bufferreader"),t=f("../encoding/bufferwriter"),r=f("../crypto/hash"),c=(f("../util/js"),f("../util/preconditions")),u=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&c.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};u._from=function(e){var t={};if(o.isBuffer(e))t=u._fromBufferReader(s(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for BlockHeader");t=u._fromObject(e)}return t},u._fromObject=function(e){c.checkArgument(e,"data is required");var t=e.prevHash,r=e.merkleRoot;return n.isString(e.prevHash)&&(t=o.reverse(new i(e.prevHash,"hex"))),n.isString(e.merkleRoot)&&(r=o.reverse(new i(e.merkleRoot,"hex"))),{hash:e.hash,version:e.version,prevHash:t,merkleRoot:r,time:e.time,timestamp:e.time,bits:e.bits,nonce:e.nonce}},u.fromObject=function(e){var t=u._fromObject(e);return new u(t)},u.fromRawBlock=function(e){o.isBuffer(e)||(e=new i(e,"binary"));var t=s(e);t.pos=u.Constants.START_OF_HEADER;var r=u._fromBufferReader(t);return new u(r)},u.fromBuffer=function(e){var t=u._fromBufferReader(s(e));return new u(t)},u.fromString=function(e){var t=new i(e,"hex");return u.fromBuffer(t)},u._fromBufferReader=function(e){var t={};return t.version=e.readUInt32LE(),t.prevHash=e.read(32),t.merkleRoot=e.read(32),t.time=e.readUInt32LE(),t.bits=e.readUInt32LE(),t.nonce=e.readUInt32LE(),t},u.fromBufferReader=function(e){var t=u._fromBufferReader(e);return new u(t)},u.prototype.toObject=u.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:o.reverse(this.prevHash).toString("hex"),merkleRoot:o.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},u.prototype.toBuffer=function(){return this.toBufferWriter().concat()},u.prototype.toString=function(){return this.toBuffer().toString("hex")},u.prototype.toBufferWriter=function(e){return e||(e=new t),e.writeUInt32LE(this.version),e.write(this.prevHash),e.write(this.merkleRoot),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e},u.prototype.getTargetDifficulty=function(e){e=e||this.bits;for(var t=new a(16777215&e),r=8*((e>>>24)-3);0e+u.Constants.MAX_TIME_OFFSET)},u.prototype.validProofOfWork=function(){var e=new a(this.id,"hex"),t=this.getTargetDifficulty();return!(0"},u.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new a("10000000000000000000000000000000000000000000000000000000000000000","hex")},p.exports=u}).call(this,f("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],82:[function(e,t,r){t.exports=e("./block"),t.exports.BlockHeader=e("./blockheader"),t.exports.MerkleBlock=e("./merkleblock")},{"./block":80,"./blockheader":81,"./merkleblock":83}],83:[function(e,t,r){(function(s){"use strict";var n=e("lodash"),a=e("./blockheader"),o=e("../util/buffer"),r=e("../encoding/bufferreader"),i=e("../encoding/bufferwriter"),c=e("../crypto/hash"),u=(e("../util/js"),e("../transaction")),f=e("../util/preconditions");function p(e){if(!(this instanceof p))return new p(e);var t={};if(o.isBuffer(e))t=p._fromBufferReader(r(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for MerkleBlock");t={header:e.header instanceof a?e.header:a.fromObject(e.header),numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}return n.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}p.fromBuffer=function(e){return p.fromBufferReader(r(e))},p.fromBufferReader=function(e){return new p(p._fromBufferReader(e))},p.prototype.toBuffer=function(){return this.toBufferWriter().concat()},p.prototype.toBufferWriter=function(e){e||(e=new i),e.write(this.header.toBuffer()),e.writeUInt32LE(this.numTransactions),e.writeVarintNum(this.hashes.length);for(var t=0;tthis.numTransactions)return!1;if(8*this.flags.length8*this.flags.length)return null;var i=this.flags[r.flagBitsUsed>>3]>>>(7&r.flagBitsUsed++)&1;if(0!==e&&i){var n=this._traverseMerkleTree(e-1,2*t,r),a=n;return 2*t+1=this.hashes.length)return null;var o=this.hashes[r.hashesUsed++];return 0===e&&i&&r.txs.push(o),new s(o,"hex")},p.prototype._calcTreeWidth=function(e){return this.numTransactions+(1<>e},p.prototype._calcTreeHeight=function(){for(var e=0;1e.size?t=n.trim(t,i):i>1,o=d.getN(),s=d.getG(),c=a?r.add(o):r,u=d.fromX(n,c);if(!u.mul(o).isInfinity())throw new Error("nR is not a valid curve point");var f=t.neg().mod(o),p=r.invm(o),h=u.mul(i).add(s.mul(f)).mul(p);return m.fromPoint(h,this.sig.compressed)},h.prototype.sigError=function(){if(!f.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s;if(!(e.gt(l.Zero)&&e.lt(d.getN())&&t.gt(l.Zero)&&t.lt(d.getN())))return"r and s not in range";var r=l.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),i=d.getN(),n=t.invm(i),a=n.mul(r).mod(i),o=n.mul(e).mod(i),s=d.getG().mulAdd(a,this.pubkey.point,o);return s.isInfinity()?"p is infinity":0!==s.getX().mod(i).cmp(e)&&"Invalid signature"},h.toLowS=function(e){return e.gt(l.fromBuffer(new c("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=d.getN().sub(e)),e},h.prototype._findSignature=function(e,t){for(var r,i,n,a=d.getN(),o=d.getG(),s=0;(!this.k||0i)r=e(r);else if(r>>=8)}return r},e.exports=r}).call(this,i("_process"),i("buffer").Buffer)},{_process:382,buffer:191,crypto:204}],89:[function(e,r,t){(function(u){"use strict";var g=e("./bn"),v=e("lodash"),b=e("../util/preconditions"),y=e("../util/buffer"),t=e("../util/js"),o=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof g)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};o.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=void 0!==e.i?e.i:this.i,this.compressed=void 0!==e.compressed?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this},o.fromCompact=function(e){b.checkArgument(y.isBuffer(e),"Argument is expected to be a Buffer");var t=new o,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i+=4);var n=e.slice(1,33),a=e.slice(33,65);return b.checkArgument(0===i||1===i||2===i||3===i,new Error("i must be 0, 1, 2, or 3")),b.checkArgument(32===n.length,new Error("r must be 32 bytes")),b.checkArgument(32===a.length,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=g.fromBuffer(n),t.s=g.fromBuffer(a),t},o.fromDER=o.fromBuffer=function(e,t){var r=o.parseDER(e,t),i=new o;return i.r=r.r,i.s=r.s,i},o.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=new o.fromDER(r,!1);return i.nhashtype=t,i},o.fromString=function(e){var t=new u(e,"hex");return o.fromDER(t)},o.parseDER=function(e,t){b.checkArgument(y.isBuffer(e),new Error("DER formatted signature should be a buffer")),v.isUndefined(t)&&(t=!0);var r=e[0];b.checkArgument(48===r,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;b.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(2!==e[2])return!1;if(0===t)return!1;if(128&i[0])return!1;if(1=this.buf.length},e.prototype.read=function(e){r.checkArgument(!n.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t},e.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e},e.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e},e.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=o.fromBuffer(e);return this.pos=this.pos+8,t},e.prototype.readUInt64LEBN=function(){var e,t=this.buf.readUInt32LE(this.pos),r=4294967296*this.buf.readUInt32LE(this.pos+4)+t;if(r<=9007199254740991)e=new o(r);else{var i=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);e=new o(i,10,"le")}return this.pos=this.pos+8,e},e.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN().toNumber();if(t<=Math.pow(2,53))return t;throw new Error("number too large to retain precision - use readVarintBN");default:return e}},e.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return r.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t},e.prototype.readVarintBuf=function(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},e.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new o(this.readUInt16LE());case 254:return new o(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new o(e)}},e.prototype.reverse=function(){for(var e=new i(this.buf.length),t=0;t"},k.prototype.toObject=k.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:_.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},k.fromBuffer=function(e){return new k(e.toString())},k.prototype.toBuffer=function(){return _.copy(this._buffers.xprivkey)},k.DefaultDepth=0,k.DefaultFingerprint=0,k.DefaultChildIndex=0,k.MaxIndex=2*(k.Hardened=2147483648),k.RootElementAlias=["m","M","m'","M'"],k.VersionSize=4,k.DepthSize=1,k.ParentFingerPrintSize=4,k.ChildIndexSize=4,k.ChainCodeSize=32,k.PrivateKeySize=32,k.CheckSumSize=4,k.DataLength=78,k.SerializedByteSize=82,n((k.ChecksumEnd=(k.ChecksumStart=k.PrivateKeyEnd=(k.PrivateKeyStart=(k.ChainCodeEnd=(k.ChainCodeStart=k.ChildIndexEnd=(k.ChildIndexStart=k.ParentFingerPrintEnd=(k.ParentFingerPrintStart=k.DepthEnd=(k.DepthStart=k.VersionEnd=(k.VersionStart=0)+k.VersionSize)+k.DepthSize)+k.ParentFingerPrintSize)+k.ChildIndexSize)+k.ChainCodeSize)+1)+k.PrivateKeySize)+k.CheckSumSize)===k.SerializedByteSize),e.exports=k}).call(this,o("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./crypto/random":88,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdpublickey":99,"./networks":100,"./privatekey":102,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],99:[function(i,s,e){(function(u){"use strict";var n=i("lodash"),t=i("./util/preconditions"),f=i("./crypto/bn"),a=i("./encoding/base58"),p=i("./encoding/base58check"),h=i("./crypto/hash"),r=i("./hdprivatekey"),l=i("./hdkeycache"),d=i("./networks"),m=i("./crypto/point"),g=i("./publickey"),e=i("./errors"),v=e,b=e.HDPublicKey,o=i("assert"),y=i("./util/js"),_=i("./util/buffer");function w(e){if(e instanceof w)return e;if(!(this instanceof w))return new w(e);if(e){if(n.isString(e)||_.isBuffer(e)){var t=w.getSerializedError(e);if(t){if(_.isBuffer(e)&&!w.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof b.ArgumentIsPrivateExtended)return new r(e).hdPublicKey;throw t}return this._buildFromSerialized(e)}if(n.isObject(e))return e instanceof r?this._buildFromPrivate(e):this._buildFromObject(e);throw new b.UnrecognizedArgument(e)}throw new b.MustSupplyArgument}w.isValidPath=function(e){if(n.isString(e)){var t=r._getDerivationIndexes(e);return null!==t&&n.all(t,w.isValidPath)}return!!n.isNumber(e)&&(0<=e&&e"},w.prototype.toObject=w.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version)).name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:_.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},w.fromBuffer=function(e){return new w(e)},w.prototype.toBuffer=function(){return _.copy(this._buffers.xpubkey)},w.Hardened=2147483648,w.RootElementAlias=["m","M"],w.VersionSize=4,w.DepthSize=1,w.ParentFingerPrintSize=4,w.ChildIndexSize=4,w.ChainCodeSize=32,w.PublicKeySize=33,w.CheckSumSize=4,w.DataSize=78,w.SerializedByteSize=82,w.ChecksumEnd=(w.ChecksumStart=w.PublicKeyEnd=(w.PublicKeyStart=w.ChainCodeEnd=(w.ChainCodeStart=w.ChildIndexEnd=(w.ChildIndexStart=w.ParentFingerPrintEnd=(w.ParentFingerPrintStart=w.DepthEnd=(w.DepthStart=w.VersionEnd=(w.VersionStart=0)+w.VersionSize)+w.DepthSize)+w.ParentFingerPrintSize)+w.ChildIndexSize)+w.ChainCodeSize)+w.PublicKeySize)+w.CheckSumSize,o(w.PublicKeyEnd===w.DataSize),o(w.ChecksumEnd===w.SerializedByteSize),s.exports=w}).call(this,i("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdprivatekey":98,"./networks":100,"./publickey":103,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],100:[function(e,t,r){"use strict";var n=e("lodash"),i=e("./util/buffer"),a=e("./util/js"),o=[],s={};function c(){}function u(t,e){if(~o.indexOf(t))return t;if(!e)return s[t];n.isArray(e)||(e=[e]);var r=function(e){return o[i][e]===t};for(var i in o)if(n.any(e,r))return o[i]}function f(e){var t=new c;return a.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey}),e.networkMagic&&a.defineImmutable(t,{networkMagic:i.integerAsBuffer(e.networkMagic)}),e.port&&a.defineImmutable(t,{port:e.port}),e.dnsSeeds&&a.defineImmutable(t,{dnsSeeds:e.dnsSeeds}),n.each(t,function(e){n.isUndefined(e)||n.isObject(e)||(s[e]=t)}),o.push(t),t}c.prototype.toString=function(){return this.name},f({name:"livenet",alias:"mainnet",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var p=u("livenet");f({name:"testnet",alias:"regtest",pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956});var h=u("testnet"),l={PORT:18333,NETWORK_MAGIC:i.integerAsBuffer(185665799),DNS_SEEDS:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]};for(var d in l)n.isObject(l[d])||(s[l[d]]=h);var m={PORT:18444,NETWORK_MAGIC:i.integerAsBuffer(4206867930),DNS_SEEDS:[]};for(var d in m)n.isObject(m[d])||(s[m[d]]=h);Object.defineProperty(h,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.PORT:l.PORT}}),Object.defineProperty(h,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.NETWORK_MAGIC:l.NETWORK_MAGIC}}),Object.defineProperty(h,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.DNS_SEEDS:l.DNS_SEEDS}}),t.exports={add:f,remove:function(e){for(var t=0;t=a.map.OP_1&&e<=a.map.OP_16},a.prototype.inspect=function(){return""},c.exports=a}).call(this,s("buffer").Buffer)},{"./util/buffer":121,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],102:[function(h,l,e){(function(i){"use strict";var n=h("lodash"),r=h("./address"),a=h("./encoding/base58check"),o=h("./crypto/bn"),s=h("./util/js"),c=h("./networks"),u=h("./crypto/point"),e=h("./publickey"),f=h("./crypto/random"),t=h("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(e instanceof p)return e;var r=this._classifyArguments(e,t);if(!r.bn||0===r.bn.cmp(new o(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(u.getN()))throw new TypeError("Number must be less than N");if(void 0===r.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return s.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}p.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?c.get(t):c.defaultNetwork};if(n.isUndefined(e)||n.isNull(e))r.bn=p._getRandomBN();else if(e instanceof o)r.bn=e;else if(e instanceof i||e instanceof Uint8Array)r=p._transformBuffer(e,t);else if(e.bn&&e.network)r=p._transformObject(e);else if(!t&&c.get(e))r.bn=p._getRandomBN(),r.network=c.get(e);else{if("string"!=typeof e)throw new TypeError("First argument is an unrecognized data type.");s.isHexa(e)?r.bn=new o(new i(e,"hex")):r=p._transformWIF(e,t)}return r},p._getRandomBN=function(){var e,t;do{var r=f.getRandomBuffer(32);e=(t=o.fromBuffer(r)).lt(u.getN())}while(!e);return t},p._transformBuffer=function(e,t){var r={};if(32===e.length)return p._transformBNBuffer(e,t);if(r.network=c.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==c.get(t))throw new TypeError("Private key network mismatch");if(34===e.length&&1===e[33])r.compressed=!0;else{if(33!==e.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");r.compressed=!1}return r.bn=o.fromBuffer(e.slice(1,33)),r},p._transformBNBuffer=function(e,t){var r={};return r.network=c.get(t)||c.defaultNetwork,r.bn=o.fromBuffer(e),r.compressed=!1,r},p._transformWIF=function(e,t){return p._transformBuffer(a.decode(e),t)},p.fromBuffer=function(e,t){return new p(e,t)},p._transformObject=function(e){return{bn:new o(e.bn,"hex"),network:c.get(e.network),compressed:e.compressed}},p.fromString=p.fromWIF=function(e){return t.checkArgument(n.isString(e),"First argument is expected to be a string."),new p(e)},p.fromObject=function(e){return t.checkArgument(n.isObject(e),"First argument is expected to be an object."),new p(e)},p.fromRandom=function(e){return new p(p._getRandomBN(),e)},p.getValidationError=function(e,t){var r;try{new p(e,t)}catch(e){r=e}return r},p.isValid=function(e,t){return!!e&&!p.getValidationError(e,t)},p.prototype.toString=function(){return this.toBuffer().toString("hex")},p.prototype.toWIF=function(){var e,t=this.network;return e=this.compressed?i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32}),new i([1])]):i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32})]),a.encode(e)},p.prototype.toBigNumber=function(){return this.bn},p.prototype.toBuffer=function(){return this.bn.toBuffer()},p.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=e.fromPrivateKey(this)),this._pubkey},p.prototype.toAddress=function(e){var t=this.toPublicKey();return r.fromPublicKey(t,e||this.network)},p.prototype.toObject=p.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},p.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return""},l.exports=p}).call(this,h("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/point":87,"./crypto/random":88,"./encoding/base58check":91,"./networks":100,"./publickey":103,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],103:[function(t,r,e){(function(o){"use strict";var s=t("./crypto/bn"),c=t("./crypto/point"),e=t("./crypto/hash"),i=t("./util/js"),n=t("./networks"),u=t("lodash"),f=t("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(f.checkArgument(e,"First argument is required, please include public key data."),e instanceof p)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),i.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||n.defaultNetwork}),this}p.prototype._classifyArgs=function(e,t){var r={compressed:u.isUndefined(t.compressed)||t.compressed};if(e instanceof c)r.point=e;else if(e.x&&e.y)r=p._transformObject(e);else if("string"==typeof e)r=p._transformDER(new o(e,"hex"));else if(p._isBuffer(e))r=p._transformDER(e);else{if(!p._isPrivateKey(e))throw new TypeError("First argument is an unrecognized data format.");r=p._transformPrivateKey(e)}return r.network||(r.network=u.isUndefined(t.network)?void 0:n.get(t.network)),r},p._isPrivateKey=function(e){return e instanceof t("./privatekey")},p._isBuffer=function(e){return e instanceof o||e instanceof Uint8Array},p._transformPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=c.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t},p._transformDER=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r,i,n,a,o={};if(t=!!u.isUndefined(t)||t,4!==e[0]&&(t||6!==e[0]&&7!==e[0]))if(3===e[0])n=e.slice(1),r=new s(n),(o=p._transformX(!0,r)).compressed=!0;else{if(2!==e[0])throw new TypeError("Invalid DER format public key");n=e.slice(1),r=new s(n),(o=p._transformX(!1,r)).compressed=!0}else{if(n=e.slice(1,33),a=e.slice(33,65),32!==n.length||32!==a.length||65!==e.length)throw new TypeError("Length of x and y must be 32 bytes");r=new s(n),i=new s(a),o.point=new c(r,i),o.compressed=!1}return o},p._transformX=function(e,t){f.checkArgument("boolean"==typeof e,"Must specify whether y is odd or not (true or false)");var r={};return r.point=c.fromX(e,t),r},p._transformObject=function(e){var t=new s(e.x,"hex"),r=new s(e.y,"hex");return new p(new c(t,r),{compressed:e.compressed})},p.fromPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t=p._transformPrivateKey(e);return new p(t.point,{compressed:t.compressed,network:t.network})},p.fromDER=p.fromBuffer=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r=p._transformDER(e,t);return new p(r.point,{compressed:r.compressed})},p.fromPoint=function(e,t){return f.checkArgument(e instanceof c,"First argument must be an instance of Point."),new p(e,{compressed:t})},p.fromString=function(e,t){var r=new o(e,t||"hex"),i=p._transformDER(r);return new p(i.point,{compressed:i.compressed})},p.fromX=function(e,t){var r=p._transformX(e,t);return new p(r.point,{compressed:r.compressed})},p.getValidationError=function(e){var t;try{new p(e)}catch(e){t=e}return t},p.isValid=function(e){return!p.getValidationError(e)},p.prototype.toObject=p.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},p.prototype.toBuffer=p.prototype.toDER=function(){var e,t=this.point.getX(),r=this.point.getY(),i=t.toBuffer({size:32}),n=r.toBuffer({size:32});if(this.compressed){var a=n[n.length-1]%2;return e=new o(a?[3]:[2]),o.concat([e,i])}return e=new o([4]),o.concat([e,i,n])},p.prototype._getID=function(){return e.sha256ripemd160(this.toBuffer())},p.prototype.toAddress=function(e){return t("./address").fromPublicKey(this,e||this.network)},p.prototype.toString=function(){return this.toDER().toString("hex")},p.prototype.inspect=function(){return""},r.exports=p}).call(this,t("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./networks":100,"./privatekey":102,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],104:[function(e,t,r){t.exports=e("./script"),t.exports.Interpreter=e("./interpreter")},{"./interpreter":105,"./script":106}],105:[function(p,t,e){(function(e){"use strict";var R=p("lodash"),z=p("./script"),M=p("../opcode"),N=p("../crypto/bn"),D=p("../crypto/hash"),q=p("../crypto/signature"),L=p("../publickey"),U=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};U.prototype.verify=function(e,t,r,i,n){var a,o=p("../transaction");if(R.isUndefined(r)&&(r=new o),R.isUndefined(i)&&(i=0),R.isUndefined(n)&&(n=0),this.set({script:e,tx:r,nin:i,flags:n}),0!=(n&U.SCRIPT_VERIFY_SIGPUSHONLY)&&!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(!this.evaluate())return!1;n&U.SCRIPT_VERIFY_P2SH&&(a=this.stack.slice());var s=this.stack;if(this.initialize(),this.set({script:t,stack:s,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(0===this.stack.length)return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT");var c=this.stack[this.stack.length-1];if(!U.castToBool(c))return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK");if(n&U.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(0===a.length)throw new Error("internal error - stack copy empty");var u=a[a.length-1],f=z.fromBuffer(u);return a.pop(),this.initialize(),this.set({script:f,stack:a,tx:r,nin:i,flags:n}),!!this.evaluate()&&(0===a.length?!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK"):!!U.castToBool(a[a.length-1])||!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK"))}return!0},(t.exports=U).prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},U.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=void 0!==e.nin?e.nin:this.nin,this.stack=e.stack||this.stack,this.altstack=e.altack||this.altstack,this.pc=void 0!==e.pc?e.pc:this.pc,this.pbegincodehash=void 0!==e.pbegincodehash?e.pbegincodehash:this.pbegincodehash,this.nOpCount=void 0!==e.nOpCount?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=void 0!==e.flags?e.flags:this.flags},U.true=new e([1]),U.false=new e([]),U.MAX_SCRIPT_ELEMENT_SIZE=520,U.LOCKTIME_THRESHOLD_BN=new N(U.LOCKTIME_THRESHOLD=5e8),U.SCRIPT_VERIFY_NONE=0,U.SCRIPT_VERIFY_P2SH=1,U.SCRIPT_VERIFY_STRICTENC=2,U.SCRIPT_VERIFY_DERSIG=4,U.SCRIPT_VERIFY_LOW_S=8,U.SCRIPT_VERIFY_NULLDUMMY=16,U.SCRIPT_VERIFY_SIGPUSHONLY=32,U.SCRIPT_VERIFY_MINIMALDATA=64,U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,U.castToBool=function(e){for(var t=0;t=U.LOCKTIME_THRESHOLD&&e.gte(U.LOCKTIME_THRESHOLD_BN))&&(!e.gt(new N(this.tx.nLockTime))&&!!this.tx.inputs[this.nin].isFinal())},U.prototype.step=function(){var e,t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g,v=0!=(this.flags&U.SCRIPT_VERIFY_MINIMALDATA),b=-1===this.vfExec.indexOf(!1),y=this.script.chunks[this.pc];this.pc++;var _=y.opcodenum;if(R.isUndefined(_))return!(this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE");if(y.buf&&y.buf.length>U.MAX_SCRIPT_ELEMENT_SIZE)return!(this.errstr="SCRIPT_ERR_PUSH_SIZE");if(_>M.OP_16&&201<++this.nOpCount)return!(this.errstr="SCRIPT_ERR_OP_COUNT");if(_===M.OP_CAT||_===M.OP_SUBSTR||_===M.OP_LEFT||_===M.OP_RIGHT||_===M.OP_INVERT||_===M.OP_AND||_===M.OP_OR||_===M.OP_XOR||_===M.OP_2MUL||_===M.OP_2DIV||_===M.OP_MUL||_===M.OP_DIV||_===M.OP_MOD||_===M.OP_LSHIFT||_===M.OP_RSHIFT)return!(this.errstr="SCRIPT_ERR_DISABLED_OPCODE");if(b&&0<=_&&_<=M.OP_PUSHDATA4){if(v&&!this.script.checkMinimalPush(this.pc-1))return!(this.errstr="SCRIPT_ERR_MINIMALDATA");if(y.buf){if(y.len!==y.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(y.buf)}else this.stack.push(U.false)}else if(b||M.OP_IF<=_&&_<=M.OP_ENDIF)switch(_){case M.OP_1NEGATE:case M.OP_1:case M.OP_2:case M.OP_3:case M.OP_4:case M.OP_5:case M.OP_6:case M.OP_7:case M.OP_8:case M.OP_9:case M.OP_10:case M.OP_11:case M.OP_12:case M.OP_13:case M.OP_14:case M.OP_15:case M.OP_16:n=_-(M.OP_1-1),e=new N(n).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_NOP:break;case M.OP_NOP2:case M.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break}if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");var w=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v,5);if(w.lt(new N(0)))return!(this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME");if(!this.checkLockTime(w))return!(this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME");break;case M.OP_NOP1:case M.OP_NOP3:case M.OP_NOP4:case M.OP_NOP5:case M.OP_NOP6:case M.OP_NOP7:case M.OP_NOP8:case M.OP_NOP9:case M.OP_NOP10:if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break;case M.OP_IF:case M.OP_NOTIF:if(m=!1,b){if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");e=this.stack.pop(),m=U.castToBool(e),_===M.OP_NOTIF&&(m=!m)}this.vfExec.push(m);break;case M.OP_ELSE:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case M.OP_ENDIF:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec.pop();break;case M.OP_VERIFY:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],!(m=U.castToBool(e)))return!(this.errstr="SCRIPT_ERR_VERIFY");this.stack.pop();break;case M.OP_RETURN:return!(this.errstr="SCRIPT_ERR_OP_RETURN");case M.OP_TOALTSTACK:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.altstack.push(this.stack.pop());break;case M.OP_FROMALTSTACK:if(this.altstack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION");this.stack.push(this.altstack.pop());break;case M.OP_2DROP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop(),this.stack.pop();break;case M.OP_2DUP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1],this.stack.push(t),this.stack.push(r);break;case M.OP_3DUP:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-3],r=this.stack[this.stack.length-2];var k=this.stack[this.stack.length-1];this.stack.push(t),this.stack.push(r),this.stack.push(k);break;case M.OP_2OVER:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-4],r=this.stack[this.stack.length-3],this.stack.push(t),this.stack.push(r);break;case M.OP_2ROT:if(this.stack.length<6)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-6,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_2SWAP:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-4,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_IFDUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-1],(m=U.castToBool(e))&&this.stack.push(e);break;case M.OP_DEPTH:e=new N(this.stack.length).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_DROP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop();break;case M.OP_DUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-1]);break;case M.OP_NIP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,1);break;case M.OP_OVER:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-2]);break;case M.OP_PICK:case M.OP_ROLL:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],n=(s=N.fromScriptNumBuffer(e,v)).toNumber(),this.stack.pop(),n<0||n>=this.stack.length)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-n-1],_===M.OP_ROLL&&this.stack.splice(this.stack.length-n-1,1),this.stack.push(e);break;case M.OP_ROT:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-3],o=this.stack[this.stack.length-2];var x=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=o,this.stack[this.stack.length-2]=x,this.stack[this.stack.length-1]=a;break;case M.OP_SWAP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-2],o=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=o,this.stack[this.stack.length-1]=a;break;case M.OP_TUCK:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case M.OP_SIZE:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");s=new N(this.stack[this.stack.length-1].length),this.stack.push(s.toScriptNumBuffer());break;case M.OP_EQUAL:case M.OP_EQUALVERIFY:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1];var S=t.toString("hex")===r.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(S?U.true:U.false),_===M.OP_EQUALVERIFY){if(!S)return!(this.errstr="SCRIPT_ERR_EQUALVERIFY");this.stack.pop()}break;case M.OP_1ADD:case M.OP_1SUB:case M.OP_NEGATE:case M.OP_ABS:case M.OP_NOT:case M.OP_0NOTEQUAL:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(e=this.stack[this.stack.length-1],s=N.fromScriptNumBuffer(e,v),_){case M.OP_1ADD:s=s.add(N.One);break;case M.OP_1SUB:s=s.sub(N.One);break;case M.OP_NEGATE:s=s.neg();break;case M.OP_ABS:s.cmp(N.Zero)<0&&(s=s.neg());break;case M.OP_NOT:s=new N((0===s.cmp(N.Zero))+0);break;case M.OP_0NOTEQUAL:s=new N((0!==s.cmp(N.Zero))+0)}this.stack.pop(),this.stack.push(s.toScriptNumBuffer());break;case M.OP_ADD:case M.OP_SUB:case M.OP_BOOLAND:case M.OP_BOOLOR:case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:case M.OP_NUMNOTEQUAL:case M.OP_LESSTHAN:case M.OP_GREATERTHAN:case M.OP_LESSTHANOREQUAL:case M.OP_GREATERTHANOREQUAL:case M.OP_MIN:case M.OP_MAX:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(c=N.fromScriptNumBuffer(this.stack[this.stack.length-2],v),u=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v),s=new N(0),_){case M.OP_ADD:s=c.add(u);break;case M.OP_SUB:s=c.sub(u);break;case M.OP_BOOLAND:s=new N((0!==c.cmp(N.Zero)&&0!==u.cmp(N.Zero))+0);break;case M.OP_BOOLOR:s=new N((0!==c.cmp(N.Zero)||0!==u.cmp(N.Zero))+0);break;case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:s=new N((0===c.cmp(u))+0);break;case M.OP_NUMNOTEQUAL:s=new N((0!==c.cmp(u))+0);break;case M.OP_LESSTHAN:s=new N((c.cmp(u)<0)+0);break;case M.OP_GREATERTHAN:s=new N((0"},v.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==c.OP_DUP||this.chunks[1].opcodenum!==c.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==c.OP_EQUALVERIFY||this.chunks[4].opcodenum!==c.OP_CHECKSIG)},v.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&48===e[0]&&t&&t.length){var r=t[0];if((4===r||6===r||7===r)&&65===t.length)return!0;if((3===r||2===r)&&33===t.length)return!0}}return!1},v.prototype.getPublicKey=function(){return p.checkState(this.isPublicKeyOut(),"Can't retreive PublicKey from a non-PK output"),this.chunks[0].buf},v.prototype.getPublicKeyHash=function(){return p.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},v.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===c.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if((4!==t&&6!==t&&7!==t||65!==e.length)&&(3!==t&&2!==t||33!==e.length)||(r=!0),r)return u.isValid(e)}return!1},v.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var e=this.chunks[0].buf;if(e&&e.length&&48===e[0])return!0}return!1},v.prototype.isScriptHashOut=function(){var e=this.toBuffer();return 23===e.length&&e[0]===c.OP_HASH160&&20===e[1]&&e[e.length-1]===c.OP_EQUAL},v.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e,t=this.chunks[this.chunks.length-1].buf;if(!t)return!1;try{e=v.fromBuffer(t)}catch(e){if(e instanceof l.Script.InvalidBuffer)return!1;throw e}return e.classify()!==v.types.UNKNOWN},v.prototype.isMultisigOut=function(){return 3=c.OP_1&&e<=c.OP_16)return e-(c.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))},v.prototype.getSignatureOperationsCount=function(r){r=!!h.isUndefined(r)||r;var i=this,n=0,a=c.OP_INVALIDOPCODE;return h.each(i.chunks,function(e){var t=e.opcodenum;t==c.OP_CHECKSIG||t==c.OP_CHECKSIGVERIFY?n++:t!=c.OP_CHECKMULTISIG&&t!=c.OP_CHECKMULTISIGVERIFY||(r&&a>=c.OP_1&&a<=c.OP_16?n+=i._decodeOP_N(a):n+=20),a=t}),n},t.exports=v}).call(this,e("buffer").Buffer)},{"../address":79,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../networks":100,"../opcode":101,"../publickey":103,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],107:[function(e,t,r){t.exports=e("./transaction"),t.exports.Input=e("./input"),t.exports.Output=e("./output"),t.exports.UnspentOutput=e("./unspentoutput"),t.exports.Signature=e("./signature"),t.exports.Sighash=e("./sighash")},{"./input":108,"./output":114,"./sighash":115,"./signature":116,"./transaction":117,"./unspentoutput":118}],108:[function(e,t,r){t.exports=e("./input"),t.exports.PublicKey=e("./publickey"),t.exports.PublicKeyHash=e("./publickeyhash"),t.exports.MultiSig=e("./multisig.js"),t.exports.MultiSigScriptHash=e("./multisigscripthash.js")},{"./input":109,"./multisig.js":110,"./multisigscripthash.js":111,"./publickey":112,"./publickeyhash":113}],109:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../../util/preconditions"),a=e("../../errors"),o=e("../../encoding/bufferwriter"),s=e("buffer"),c=e("../../util/buffer"),u=e("../../util/js"),f=e("../../script"),p=e("../sighash"),h=e("../output"),l=4294967295;function d(e){return this instanceof d?e?this._fromObject(e):void 0:new d(e)}d.MAXINT=l,d.DEFAULT_SEQNUMBER=4294967295,d.DEFAULT_LOCKTIME_SEQNUMBER=4294967294,d.DEFAULT_RBF_SEQNUMBER=4294967293,Object.defineProperty(d.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new f(this._scriptBuffer),this._script._isInput=!0),this._script)}}),d.fromObject=function(e){return n.checkArgument(i.isObject(e)),(new d)._fromObject(e)},d.prototype._fromObject=function(e){var t;if(t=i.isString(e.prevTxId)&&u.isHexa(e.prevTxId)?new s.Buffer(e.prevTxId,"hex"):e.prevTxId,this.output=e.output?e.output instanceof h?e.output:new h(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=i.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=i.isUndefined(e.sequenceNumber)?i.isUndefined(e.seqnum)?4294967295:e.seqnum:e.sequenceNumber,i.isUndefined(e.script)&&i.isUndefined(e.scriptBuffer))throw new a.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this},d.prototype.toObject=d.prototype.toJSON=function(){var e={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(e.scriptString=this.script.toString()),this.output&&(e.output=this.output.toObject()),e},d.fromBufferReader=function(e){var t=new d;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t},d.prototype.toBufferWriter=function(e){e||(e=new o),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e},d.prototype.setScript=function(e){if(this._script=null,e instanceof f)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(u.isHexa(e))this._scriptBuffer=new s.Buffer(e,"hex");else if(i.isString(e))this._script=new f(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!c.isBuffer(e))throw new TypeError("Invalid argument type: script");this._scriptBuffer=new s.Buffer(e)}return this},d.prototype.getSignatures=function(){throw new a.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},d.prototype.isFullySigned=function(){throw new a.AbstractMethodInvoked("Input#isFullySigned")},d.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},d.prototype.addSignature=function(){throw new a.AbstractMethodInvoked("Input#addSignature")},d.prototype.clearSignatures=function(){throw new a.AbstractMethodInvoked("Input#clearSignatures")},d.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},d.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},d.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},t.exports=d},{"../../encoding/bufferwriter":93,"../../errors":95,"../../script":104,"../../util/buffer":121,"../../util/js":122,"../../util/preconditions":123,"../output":114,"../sighash":115,buffer:191,lodash:149}],110:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=(e("../transaction"),e("./input")),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),u.checkState(o.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.output.script),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},l.normalizeSignatures=function(n,a,o,e,t){return t.map(function(r){var i=null;return e=e.filter(function(e){if(i)return!0;var t=new h({signature:f.fromTxFormat(e),publicKey:r,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:o,sigtype:f.SIGHASH_ALL});return t.signature.nhashtype=t.sigtype,!p.verify(n,t.signature,t.publicKey,t.inputIndex,a.output.script)||(i=t,!1)}),i||null})},l.OPCODES_SIZE=1,l.SIGNATURE_SIZE=73,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"../transaction":117,"./input":109,inherits:148,lodash:149}],111:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=e("./input"),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),this.redeemScript=o.buildMultisigOut(this.publicKeys,r),u.checkState(o.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.redeemScript),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript)},l.OPCODES_SIZE=7,l.SIGNATURE_SIZE=74,l.PUBKEY_SIZE=34,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE+this.publicKeys.length*l.PUBKEY_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148,lodash:149}],112:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),n=(e("../../util/buffer"),e("./input")),o=e("../output"),s=e("../sighash"),c=e("../../script"),u=e("../../crypto/signature"),f=e("../signature");function p(){n.apply(this,arguments)}i(p,n),p.prototype.getSignatures=function(e,t,r,i){a.checkState(this.output instanceof o),i=i||u.SIGHASH_ALL;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new f({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:s.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},p.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(c.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this},p.prototype.clearSignatures=function(){return this.setScript(c.empty()),this},p.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},p.SCRIPT_MAX_SIZE=73,p.prototype._estimateSize=function(){return p.SCRIPT_MAX_SIZE},t.exports=p},{"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],113:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),o=e("../../util/buffer"),s=e("../../crypto/hash"),n=e("./input"),c=e("../output"),u=e("../sighash"),f=e("../../script"),p=e("../../crypto/signature"),h=e("../signature");function l(){n.apply(this,arguments)}i(l,n),l.prototype.getSignatures=function(e,t,r,i,n){return a.checkState(this.output instanceof c),n=n||s.sha256ripemd160(t.publicKey.toBuffer()),i=i||p.SIGHASH_ALL,o.equals(n,this.output.script.getPublicKeyHash())?[new h({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:u.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},l.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(f.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this},l.prototype.clearSignatures=function(){return this.setScript(f.empty()),this},l.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()},l.SCRIPT_MAX_SIZE=107,l.prototype._estimateSize=function(){return l.SCRIPT_MAX_SIZE},t.exports=l},{"../../crypto/hash":86,"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],114:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../crypto/bn"),a=e("buffer"),o=e("../util/buffer"),s=e("../util/js"),c=e("../encoding/bufferwriter"),u=e("../script"),f=e("../util/preconditions"),p=e("../errors");function h(e){if(!(this instanceof h))return new h(e);if(!i.isObject(e))throw new TypeError("Unrecognized argument for Output");var t;this.satoshis=e.satoshis,o.isBuffer(e.script)?this._scriptBuffer=e.script:(t=i.isString(e.script)&&s.isHexa(e.script)?new a.Buffer(e.script,"hex"):e.script,this.setScript(t))}Object.defineProperty(h.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script||this.setScriptFromBuffer(this._scriptBuffer),this._script}}),Object.defineProperty(h.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof n?(this._satoshisBN=e,this._satoshis=e.toNumber()):i.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=n.fromNumber(this._satoshis)):(f.checkArgument(s.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=n.fromNumber(e),this._satoshis=e),f.checkState(s.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),h.prototype.invalidSatoshis=function(){return 9007199254740991"},h.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return t.script=0!==r?e.read(r):new a.Buffer([]),new h(t)},h.prototype.toBufferWriter=function(e){e||(e=new c),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e},t.exports=h},{"../crypto/bn":84,"../encoding/bufferwriter":93,"../errors":95,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],115:[function(y,e,t){(function(f){"use strict";var p=y("buffer"),h=y("../crypto/signature"),l=y("../script"),d=y("./output"),m=y("../encoding/bufferreader"),g=y("../encoding/bufferwriter"),v=y("../crypto/bn"),b=y("../crypto/hash"),o=y("../crypto/ecdsa"),s=y("../util/preconditions"),c=y("lodash"),u=function(e,t,r,i){var n,a=y("./transaction"),o=y("./input"),s=a.shallowCopy(e);for((i=new l(i)).removeCodeseparators(),n=0;n=s.outputs.length)return new f("0000000000000000000000000000000000000000000000000000000000000001","hex");for(s.outputs.length=r+1,n=0;n"},S.prototype.toBuffer=function(){var e=new u;return this.toBufferWriter(e).toBuffer()},S.prototype.toBufferWriter=function(t){return t.writeUInt32LE(this.version),t.writeVarintNum(this.inputs.length),s.each(this.inputs,function(e){e.toBufferWriter(t)}),t.writeVarintNum(this.outputs.length),s.each(this.outputs,function(e){e.toBufferWriter(t)}),t.writeUInt32LE(this.nLockTime),t},S.prototype.fromBuffer=function(e){var t=new c(e);return this.fromBufferReader(t)},S.prototype.fromBufferReader=function(e){var t,r,i;for(a.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readUInt32LE(),r=e.readVarintNum(),t=0;t=this.inputs.length)throw new n.Transaction.InvalidIndex(e,this.inputs.length);var i=this.inputs[e];this.inputs=s.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()},S.prototype.sign=function(e,t){a.checkState(this.hasAllUtxoInfo());var r=this;return s.isArray(e)?s.each(e,function(e){r.sign(e,t)}):s.each(this.getSignatures(e,t),function(e){r.applySignature(e)}),this},S.prototype.getSignatures=function(r,i){r=new k(r),i=i||p.SIGHASH_ALL;var n=this,a=[],o=f.sha256ripemd160(r.publicKey.toBuffer());return s.each(this.inputs,function(e,t){s.each(e.getSignatures(n,r,t,i,o),function(e){a.push(e)})}),a},S.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this},S.prototype.isFullySigned=function(){return s.each(this.inputs,function(e){if(e.isFullySigned===m.prototype.isFullySigned)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),s.all(s.map(this.inputs,function(e){return e.isFullySigned()}))},S.prototype.isValidSignature=function(e){if(this.inputs[e.inputIndex].isValidSignature===m.prototype.isValidSignature)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e)},S.prototype.verifySignature=function(e,t,r,i){return h.verify(this,e,t,r,i)},S.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var e=new x(0),t=0;t=m.MAXINT-1&&(t.sequenceNumber=m.DEFAULT_RBF_SEQNUMBER)}return this},I.exports=S}).call(this,A("buffer").Buffer)},{"../address":79,"../crypto/bn":84,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../privatekey":102,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"./input":108,"./output":114,"./sighash":115,"./unspentoutput":118,buffer:191,"buffer-compare":126,lodash:149}],118:[function(e,t,r){"use strict";var o=e("lodash"),s=e("../util/preconditions"),c=e("../util/js"),u=e("../script"),f=e("../address"),p=e("../unit");function h(e){if(!(this instanceof h))return new h(e);s.checkArgument(o.isObject(e),"Must provide an object from where to extract data");var t=e.address?new f(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!c.isHexaString(r)||64"},h.prototype.toString=function(){return this.txId+":"+this.outputIndex},h.fromObject=function(e){return new h(e)},h.prototype.toObject=h.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:p.fromSatoshis(this.satoshis).toBTC()}},t.exports=h},{"../address":79,"../script":104,"../unit":119,"../util/js":122,"../util/preconditions":123,lodash:149}],119:[function(e,t,r){"use strict";var i=e("lodash"),n=e("./errors"),a=e("./util/preconditions"),o={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function s(e,t){if(!(this instanceof s))return new s(e,t);if(i.isNumber(t)){if(t<=0)throw new n.Unit.InvalidRate(t);e/=t,t=s.BTC}this._value=this._from(e,t);var r=this;Object.keys(o).forEach(function(e){Object.defineProperty(r,e,{get:function(){return r.to(e)},enumerable:!0})})}Object.keys(o).forEach(function(e){s[e]=e}),s.fromObject=function(e){return a.checkArgument(i.isObject(e),"Argument is expected to be an object"),new s(e.amount,e.code)},s.fromBTC=function(e){return new s(e,s.BTC)},s.fromMillis=s.fromMilis=function(e){return new s(e,s.mBTC)},s.fromMicros=s.fromBits=function(e){return new s(e,s.bits)},s.fromSatoshis=function(e){return new s(e,s.satoshis)},s.fromFiat=function(e,t){return new s(e,t)},s.prototype._from=function(e,t){if(!o[t])throw new n.Unit.UnknownCode(t);return parseInt((e*o[t][0]).toFixed())},s.prototype.to=function(e){if(i.isNumber(e)){if(e<=0)throw new n.Unit.InvalidRate(e);return parseFloat((this.BTC*e).toFixed(2))}if(!o[e])throw new n.Unit.UnknownCode(e);var t=this._value/o[e][0];return parseFloat(t.toFixed(o[e][1]))},s.prototype.toBTC=function(){return this.to(s.BTC)},s.prototype.toMillis=s.prototype.toMilis=function(){return this.to(s.mBTC)},s.prototype.toMicros=s.prototype.toBits=function(){return this.to(s.bits)},s.prototype.toSatoshis=function(){return this.to(s.satoshis)},s.prototype.atRate=function(e){return this.to(e)},s.prototype.toString=function(){return this.satoshis+" satoshis"},s.prototype.toObject=s.prototype.toJSON=function(){return{amount:this.BTC,code:s.BTC}},s.prototype.inspect=function(){return""},t.exports=s},{"./errors":95,"./util/preconditions":123,lodash:149}],120:[function(e,t,r){"use strict";var i=e("lodash"),n=e("url"),a=e("./address"),o=e("./unit"),s=function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.extras={},this.knownParams=r||[],this.address=this.network=this.amount=this.message=null,"string"==typeof t){var i=e.parse(t);i.amount&&(i.amount=this._parseAmount(i.amount)),this._fromObject(i)}else{if("object"!==(void 0===t?"undefined":_typeof(t)))throw new TypeError("Unrecognized data format.");this._fromObject(t)}};s.fromString=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return new s(e)},s.fromObject=function(e){return new s(e)},s.isValid=function(e,t){try{new s(e,t)}catch(e){return!1}return!0},s.parse=function(e){var t=n.parse(e,!0);if("bitcoin:"!==t.protocol)throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(e);return t.query.address=r&&r[1]||void 0,t.query},s.Members=["address","amount","message","label","r"],s.prototype._fromObject=function(e){if(!a.isValid(e.address))throw new TypeError("Invalid bitcoin address");for(var t in this.address=new a(e.address),this.network=this.address.network,this.amount=e.amount,e)if("address"!==t&&"amount"!==t){if(/^req-/.exec(t)&&-1===this.knownParams.indexOf(t))throw Error("Unknown required argument "+t);(-1"},t.exports=s},{"./address":79,"./unit":119,lodash:149,url:500}],121:[function(o,s,e){(function(r){"use strict";var i=o("buffer"),t=o("assert"),n=o("./js"),a=o("./preconditions");function e(e,t){if(e.length!==t.length)return!1;for(var r=e.length,i=0;i>24&255),t.push(e>>16&255),t.push(e>>8&255),t.push(255&e),new r(t)},integerFromBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]<<24|e[1]<<16|e[2]<<8|e[3]},integerFromSingleByteBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]},bufferToHex:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e.toString("hex")},reverse:function(e){for(var t=new i.Buffer(e.length),r=0;r>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}}else if("le"===r)for(i=0,a=0;i>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-i&4194303,26<=(i+=24)&&(i-=26,n++)}if(r+6!==t){a=o(e,t,r+6);this.words[n]|=a<>>26-i&4194303}this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];v.prototype.toString=function(e,t){if(16===(e=e||10)||"hex"===e){for(var r="",i=0,n=(t=0|t||1,0),a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return this.sign&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var c=l[e],u=d[e],f=(r="",this.clone());for(f.sign=!1;0!==f.cmpn(0);){var p=f.modn(u).toString(e);r=0!==(f=f.idivn(u)).cmpn(0)?h[c-p.length]+p+r:p+r}return 0===this.cmpn(0)&&(r="0"+r),this.sign&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.prototype.toJSON=function(){return this.toString(16)},v.prototype.toArray=function(){this.strip();var e=new Array(this.byteLength());e[0]=0;for(var t=this.clone(),r=0;0!==t.cmpn(0);r++){var i=t.andln(255);t.ishrn(8),e[e.length-r-1]=i}return e},v.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return 4096<=t&&(r+=13,t>>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.iand=function(e){var t;this.sign=this.sign&&e.sign,t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},v.prototype.ixor=function(e){var t,r;this.sign=this.sign||e.sign,r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);for(var r=e/26|0,i=e%26;this.length<=r;)this.words[this.length++]=0;return this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,a=0;a>>26}for(;0!==n&&a>>26}if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this);this.sign=!1;t=e.sub(this);return this.sign=!0,t},v.prototype.isub=function(e){if(e.sign){e.sign=!1;var t=this.iadd(e);return e.sign=!0,t._normSign()}if(this.sign)return this.sign=!1,this.iadd(e),this.sign=!0,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.sign=!1,this.length=1,this.words[0]=0,this;i=0>26,this.words[o]=67108863&t}for(;0!==a&&o>26,this.words[o]=67108863&t}if(0===a&&o>>26,a=67108863&r,o=Math.min(i,e.length-1),s=Math.max(0,i-this.length+1);s<=o;s++){var c=i-s,u=(0|this.words[c])*(0|e.words[s]),f=67108863&u;a=67108863&(f=f+a|0),n=(n=n+(u/67108864|0)|0)+(f>>>26)|0}t.words[i]=a,r=n}return 0!==r?t.words[i]=r:t.length--,t.strip()},v.prototype._bigMulTo=function(e,t){t.sign=e.sign!==this.sign,t.length=this.length+e.length;for(var r=0,i=0,n=0;n>>26)|0)>>>26,a&=67108863}t.words[n]=o,r=a,a=i}return 0!==r?t.words[n]=r:t.length--,t.strip()},v.prototype.mulTo=function(e,t){return this.length+e.length<63?this._smallMulTo(e,t):this._bigMulTo(e,t)},v.prototype.mul=function(e){var t=new v(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},v.prototype.imul=function(e){if(0===this.cmpn(0)||0===e.cmpn(0))return this.words[0]=0,this.length=1,this;var t=this.length,r=e.length;this.sign=e.sign!==this.sign,this.length=this.length+e.length,this.words[this.length-1]=0;for(var i=this.length-2;0<=i;i--){for(var n=0,a=0,o=Math.min(i,r-1),s=Math.max(0,i-t+1);s<=o;s++){var c=i-s,u=this.words[c]*e.words[s],f=67108863&u;n+=u/67108864|0,a=67108863&(f+=a),n+=f>>>26}this.words[i]=a,this.words[i+1]+=n,n=0}for(n=0,c=1;c>>26}return this.strip()},v.prototype.imuln=function(e){g("number"==typeof e);for(var t=0,r=0;r>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.mul(this)},v.prototype.ishln=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){for(var n=0,a=0;a>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;a>>n<a){this.length-=a;for(c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(c/67108864|0),this.words[a+r]=67108863&s}for(;a>26,this.words[a+r]=67108863&s}if(0===o)return this.strip();g(-1===o);for(a=o=0;a>26,this.words[a]=67108863&s}return this.sign=!0,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.shln(r),i.ishln(r),a=n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var n;i=this.divmod(e.neg(),t);return"mod"!==t&&(n=i.div.neg()),{div:n,mod:i.mod}},v.prototype.div=function(e){return this.divmod(e,"div").div},v.prototype.mod=function(e){return this.divmod(e,"mod").mod},v.prototype.divRound=function(e){var t=this.divmod(e);if(0===t.mod.cmpn(0))return t.div;var r=t.div.sign?t.mod.isub(e):t.mod,i=e.shrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:t.div.sign?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+this.words[i])%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=this.words[r]+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.ishrn(1),r.ishrn(1),++s;for(var c=r.clone(),u=t.clone();0!==t.cmpn(0);){for(;t.isEven();)t.ishrn(1),i.isEven()&&n.isEven()?(i.ishrn(1),n.ishrn(1)):(i.iadd(c).ishrn(1),n.isub(u).ishrn(1));for(;r.isEven();)r.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(u).ishrn(1));0<=t.cmp(r)?(t.isub(r),i.isub(a),n.isub(o)):(r.isub(t),a.isub(i),o.isub(n))}return{a:a,b:o,gcd:r.ishln(s)}},v.prototype._invmp=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=r.clone();0>>26,o&=67108863,this.words[n]=o}return 0!==a&&(this.words[n]=a,this.length++),this},v.prototype.cmpn=function(e){var t,r=e<0;if(r&&(e=-e),this.sign&&!r)return-1;if(!this.sign&&r)return 1;if(e&=67108863,this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}e.words[i-10]=n>>>22,e.length-=9},a.prototype.imulK=function(e){var t;e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(i[e])return i[e];var t;if("k256"===e)t=new a;else if("p224"===e)t=new s;else if("p192"===e)t=new c;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new u}return i[e]=t},f.prototype._verify1=function(e){g(!e.sign,"red works only with positives"),g(e.red,"red works only with red numbers")},f.prototype._verify2=function(e,t){g(!e.sign&&!t.sign,"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},f.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.mod(this.m)._forceRed(this)},f.prototype.neg=function(e){var t=e.clone();return t.sign=!t.sign,t.iadd(this.m)._forceRed(this)},f.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},f.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},f.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)},f.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.shln(t))},f.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},f.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},f.prototype.isqr=function(e){return this.imul(e,e)},f.prototype.sqr=function(e){return this.mul(e,e)},f.prototype.sqrt=function(e){if(0===e.cmpn(0))return e.clone();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).ishrn(2);return f=this.pow(e,r)}for(var i=this.m.subn(1),n=0;0!==i.cmpn(0)&&0===i.andln(1);)n++,i.ishrn(1);g(0!==i.cmpn(0));var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).ishrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).ishrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>8,i[r]&=255;for(;a;)i.push(255&a),a>>=8}for(t=0;"1"===e[t]&&tt[i]?1:0);++i);return 0==r&&(t.length>e.length?r=-1:e.length>t.length&&(r=1)),r}},{}],127:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.hmacDRBG=e("./elliptic/hmac-drbg"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec")},{"../package.json":147,"./elliptic/curve":130,"./elliptic/curves":133,"./elliptic/ec":134,"./elliptic/hmac-drbg":137,"./elliptic/utils":139,brorand:140}],128:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic"),S=n.utils.getNAF,j=n.utils.getJSF,u=n.utils.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function o(e,t){this.curve=e,this.type=t,this.precomputed=null}(t.exports=a).prototype.point=function(){throw new Error("Not implemented")},a.prototype.validate=function(){throw new Error("Not implemented")},a.prototype._fixedNafMul=function(e,t){var r=e._getDoubles(),i=S(t,1),n=(1<>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i){for(var n=this._wnafT1,a=this._wnafT2,o=this._wnafT3,s=0,c=0;c>1]:x<0&&(k=a[m][-x-1>>1].neg()),b="affine"===k.type?b.mixedAdd(k):b.add(k))}}for(c=0;c":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],130:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":128,"./edwards":129,"./mont":131,"./short":132}],131:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base;function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(s,o),(t.exports=s).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)},a(c,o.BasePoint),s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.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)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.ishrn(1))n.push(t.andln(1));for(var a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../curve":130,"bn.js":124,inherits:148}],132:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.shrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.sign&&(i=i.neg(),n=n.neg()),a.sign&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(t=new w(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b).redSqrt(),i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},c.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)},c.prototype._endoWnafMulAdd=function(e,t){for(var r=this._endoWnafT1,i=this._endoWnafT2,n=0;n":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],133:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":127,"./precomputed/secp256k1":138,"hash.js":141}],134:[function(e,t,r){"use strict";var d=e("bn.js"),m=e("../../elliptic"),i=m.utils.assert,n=e("./key"),g=e("./signature");function a(e){if(!(this instanceof a))return new a(e);"string"==typeof e&&(i(m.curves.hasOwnProperty(e),"Unknown curve "+e),e=m.curves[e]),e instanceof m.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(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}(t.exports=a).prototype.keyPair=function(e){return new n(this,e)},a.prototype.keyFromPrivate=function(e,t){return n.fromPrivate(this,e,t)},a.prototype.keyFromPublic=function(e,t){return n.fromPublic(this,e,t)},a.prototype.genKeyPair=function(e){e||(e={});for(var t=new m.hmacDRBG({hash:this.hash,pers:e.pers,entropy:e.entropy||m.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new d(2));;){var n=new d(t.generate(r));if(!(0"}},{"../../elliptic":127,"bn.js":124}],136:[function(e,t,r){"use strict";var n=e("bn.js"),a=e("../../elliptic").utils,i=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16))}(t.exports=o).prototype._importDER=function(e,t){if((e=a.toArray(e,t)).length<6||48!==e[0]||2!==e[2])return!1;if(1+e[1]>e.length)return!1;var r=e[3];if(128<=r)return!1;if(4+r+2>=e.length)return!1;if(2!==e[4+r])return!1;var i=e[5+r];return!(128<=i)&&(!(4+r+2+i>e.length)&&(this.r=new n(e.slice(4,4+r)),this.s=new n(e.slice(4+r+2,4+r+2+i)),!0))},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r));var i=[48,t.length+r.length+4,2,t.length];return i=i.concat(t,[2,r.length],r),a.encode(i,e)}},{"../../elliptic":127,"bn.js":124}],137:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("../elliptic").utils,n=o.assert;function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc),r=o.toArray(e.nonce,e.nonceEnc),i=o.toArray(e.pers,e.persEnc);n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this.reseed=1},a.prototype.generate=function(e,t,r,i){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i),this._update(r));for(var n=[];n.length>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e},i.getNAF=function(e,t){for(var r=[],i=1<>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=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=n.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{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;for(a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>10),n[a-7],(r=n[a-15],b(r,7)^b(r,18)^r>>>3),n[a-16]);var o,s,c=this.h[0],u=this.h[1],f=this.h[2],p=this.h[3],h=this.h[4],l=this.h[5],d=this.h[6],m=this.h[7];F(this.k.length===n.length);for(a=0;a>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function s(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}function u(e,t){if(!e)throw new Error(t||"Assertion failed")}i.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},i.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,r){return e+t+r>>>0},i.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},i.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},i.assert=u,i.inherits=n,r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:148}],147:[function(e,t,r){t.exports={_args:[["elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib"]],_from:"elliptic@=3.0.3",_id:"elliptic@3.0.3",_inCache:!0,_location:"/bitcore-lib/elliptic",_phantomChildren:{inherits:"2.0.1"},_requested:{name:"elliptic",raw:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",rawSpec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",scope:null,spec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",type:"remote"},_requiredBy:["/bitcore-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_shasum:"865c9b420bfbe55006b9f969f97a0d2c44966595",_shrinkwrap:null,_spec:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_where:"/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^2.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},description:"EC cryptography",devDependencies:{browserify:"^3.44.2",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",optionalDependencies:{},readme:"# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic)\n\nFast elliptic-curve cryptography in a plain javascript implementation.\n\nNOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve\nfor your cryptography operations.\n\n## Incentive\n\nECC is much slower than regular RSA cryptography, the JS implementations are\neven more slower.\n\n## Benchmarks\n\n```bash\n$ node benchmarks/index.js\nBenchmarking: sign\nelliptic#sign x 262 ops/sec ±0.51% (177 runs sampled)\neccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled)\n------------------------\nFastest is elliptic#sign\n========================\nBenchmarking: verify\nelliptic#verify x 113 ops/sec ±0.50% (166 runs sampled)\neccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled)\n------------------------\nFastest is elliptic#verify\n========================\nBenchmarking: gen\nelliptic#gen x 294 ops/sec ±0.43% (176 runs sampled)\neccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled)\n------------------------\nFastest is elliptic#gen\n========================\nBenchmarking: ecdh\nelliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled)\n------------------------\nFastest is elliptic#ecdh\n========================\n```\n\n## API\n\n### ECDSA\n\n```javascript\nvar EC = require('elliptic').ec;\n\n// Create and initialize EC context\n// (better do it once and reuse it)\nvar ec = new EC('secp256k1');\n\n// Generate keys\nvar key = ec.genKeyPair();\n\n// Sign message (must be an array, or it'll be treated as a hex sequence)\nvar msg = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];\nvar signature = key.sign(msg);\n\n// Export DER encoded signature in Array\nvar derSign = signature.toDER();\n\n// Verify signature\nconsole.log(key.verify(msg, derSign));\n```\n\n### ECDH\n\n```javascript\n// Generate keys\nvar key1 = ec.genKeyPair();\nvar key2 = ec.genKeyPair();\n\nvar shared1 = key1.derive(key2.getPublic());\nvar shared2 = key2.derive(key1.getPublic());\n\nconsole.log('Both shared secrets are BN instances');\nconsole.log(shared1.toString(16));\nconsole.log(shared2.toString(16));\n```\n\nNOTE: `.derive()` returns a [BN][1] instance.\n\n## Supported curves\n\nElliptic.js support following curve types:\n\n* Short Weierstrass\n* Montgomery\n* Edwards\n* Twisted Edwards\n\nFollowing curve 'presets' are embedded into the library:\n\n* `secp256k1`\n* `p192`\n* `p224`\n* `p256`\n* `curve25519`\n* `ed25519`\n\nNOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead.\n\n### Implementation details\n\nECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of\nthe curve operations are performed on non-affine coordinates (either projective\nor extended), various windowing techniques are used for different cases.\n\nAll operations are performed in reduction context using [bn.js][1], hashing is\nprovided by [hash.js][2]\n\n### Related projects\n\n* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both\n browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for\n node)\n\n#### LICENSE\n\nThis software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2014.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://tools.ietf.org/html/rfc6979\n[1]: https://github.com/indutny/bn.js\n[2]: https://github.com/indutny/hash.js\n[3]: https://github.com/bitchan/eccrypto\n[4]: https://github.com/wanderer/secp256k1-node\n",readmeFilename:"README.md",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{test:"make lint && mocha --reporter=spec test/*-test.js"},version:"3.0.3"}},{}],148:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{dup:68}],149:[function(e,y,_){(function(b){(function(){var dn,e,t,mn="3.10.1",gn=1,vn=2,bn=4,yn=8,_n=16,wn=32,kn=64,xn=128,Sn=256,jn=30,En="...",An=150,In=16,Pn=200,On=1,Tn=2,Bn="Expected a function",Cn="__lodash_placeholder__",Fn="[object Arguments]",Rn="[object Array]",zn="[object Boolean]",Mn="[object Date]",Nn="[object Error]",Dn="[object Function]",r="[object Map]",qn="[object Number]",Ln="[object Object]",Un="[object RegExp]",i="[object Set]",Hn="[object String]",n="[object WeakMap]",Kn="[object ArrayBuffer]",Vn="[object Float32Array]",Gn="[object Float64Array]",$n="[object Int8Array]",Wn="[object Int16Array]",Zn="[object Int32Array]",Yn="[object Uint8Array]",Xn="[object Uint8ClampedArray]",Jn="[object Uint16Array]",Qn="[object Uint32Array]",ea=/\b__p \+= '';/g,ta=/\b(__p \+=) '' \+/g,ra=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ia=/&(?:amp|lt|gt|quot|#39|#96);/g,na=/[&<>"'`]/g,aa=RegExp(ia.source),oa=RegExp(na.source),sa=/<%-([\s\S]+?)%>/g,ca=/<%([\s\S]+?)%>/g,ua=/<%=([\s\S]+?)%>/g,fa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,pa=/^\w*$/,ha=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,la=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,da=RegExp(la.source),ma=/[\u0300-\u036f\ufe20-\ufe23]/g,ga=/\\(\\)?/g,va=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ba=/\w*$/,ya=/^0[xX]/,_a=/^\[object .+?Constructor\]$/,wa=/^\d+$/,ka=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xa=/($^)/,Sa=/['\n\r\u2028\u2029\\]/g,ja=(e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",t="[a-z\\xdf-\\xf6\\xf8-\\xff]+",RegExp(e+"+(?="+e+t+")|"+e+"?"+t+"|"+e+"+|[0-9]+","g")),Ea=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Aa=-1,Ia={};Ia[Vn]=Ia[Gn]=Ia[$n]=Ia[Wn]=Ia[Zn]=Ia[Yn]=Ia[Xn]=Ia[Jn]=Ia[Qn]=!0,Ia[Fn]=Ia[Rn]=Ia[Kn]=Ia[zn]=Ia[Mn]=Ia[Nn]=Ia[Dn]=Ia[r]=Ia[qn]=Ia[Ln]=Ia[Un]=Ia[i]=Ia[Hn]=Ia[n]=!1;var Pa={};Pa[Fn]=Pa[Rn]=Pa[Kn]=Pa[zn]=Pa[Mn]=Pa[Vn]=Pa[Gn]=Pa[$n]=Pa[Wn]=Pa[Zn]=Pa[qn]=Pa[Ln]=Pa[Un]=Pa[Hn]=Pa[Yn]=Pa[Xn]=Pa[Jn]=Pa[Qn]=!0,Pa[Nn]=Pa[Dn]=Pa[r]=Pa[i]=Pa[n]=!1;var a={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},o={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},s={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},c={function:!0,object:!0},u={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},f={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},p=c[void 0===_?"undefined":_typeof(_)]&&_&&!_.nodeType&&_,h=c[void 0===y?"undefined":_typeof(y)]&&y&&!y.nodeType&&y,l=p&&h&&"object"==(void 0===b?"undefined":_typeof(b))&&b&&b.Object&&b,d=c["undefined"==typeof self?"undefined":_typeof(self)]&&self&&self.Object&&self,m=c["undefined"==typeof window?"undefined":_typeof(window)]&&window&&window.Object&&window,g=h&&h.exports===p&&p,Oa=l||m!==(this&&this.window)&&m||d||this;function Ta(e,t){if(e!==t){var r=null===e,i=e===dn,n=e==e,a=null===t,o=t===dn,s=t==t;if(t>>1,$=9007199254740991,W=O&&new O,Z={};function Y(e){if(Ka(e)&&!ui(e)&&!(e instanceof Q)){if(e instanceof J)return e;if(_.call(e,"__chain__")&&_.call(e,"__wrapped__"))return Qt(e)}return new J(e)}function X(){}function J(e,t,r){this.__wrapped__=e,this.__actions__=r||[],this.__chain__=!!t}Y.support={};function Q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function ee(){this.__data__={}}function te(e){var t=e?e.length:0;for(this.data={hash:B(null),set:new j};t--;)this.push(e[t])}function re(e,t){var r=e.data;return("string"==typeof t||li(t)?r.set.has(t):r.hash[t])?0:-1}function ie(e,t){var r=-1,i=e.length;for(t||(t=P(i));++r=Pn?st(t):null,c=t.length;s&&(a=re,o=!1,t=s);e:for(;++n>>0,t>>>=0;for(var a=P(n);++i>>1,o=e[a];(r?o<=t:o=Pn)return n.plant(t).value();for(var r=0,i=a?o[r].apply(this,e):t;++r=An)return e}else Gt=0;return Ue(e,t)});function Zt(e){for(var t=Ri(e),r=t.length,i=r&&e.length,n=!!i&&Ut(i)&&(ui(e)||ci(e)),a=-1,o=[];++a>>0,r>>>=0;r=N(t,r)&&e=(e=Ra(e)).length)return e;var o=i-n.length;if(o<1)return n;var s=e.slice(0,o);if(null==a)return s+n;if(vi(a)){if(e.slice(o).search(a)){var c,u,f=e.slice(0,o);for(a.global||(a=b(a.source,(ba.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(f);)u=c.index;s=s.slice(0,null==u?o:u)}}else if(e.indexOf(a,o)!=o){var p=s.lastIndexOf(a);-1=0.13.7 <0.14.0",_id:"bitcore-lib@0.13.19",_inCache:!0,_installable:!0,_location:"/bitcore-lib",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/bitcore-lib-0.13.19.tgz_1470850061596_0.2146058666985482"},_npmUser:{email:"braydon@bitpay.com",name:"braydonf"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{name:"bitcore-lib",raw:"bitcore-lib@^0.13.7",rawSpec:"^0.13.7",scope:null,spec:">=0.13.7 <0.14.0",type:"range"},_requiredBy:["/","/bitcore-message"],_resolved:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz",_shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",_shrinkwrap:{dependencies:{"bn.js":{from:"bn.js@=2.0.4",resolved:"https://registry.npmjs.org/bn.js/-/bn.js-2.0.4.tgz",version:"2.0.4"},bs58:{from:"bs58@=2.0.0",resolved:"https://registry.npmjs.org/bs58/-/bs58-2.0.0.tgz",version:"2.0.0"},"buffer-compare":{from:"buffer-compare@=1.0.0",resolved:"https://registry.npmjs.org/buffer-compare/-/buffer-compare-1.0.0.tgz",version:"1.0.0"},elliptic:{dependencies:{brorand:{from:"brorand@^1.0.1",resolved:"https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz",version:"1.0.5"},"hash.js":{from:"hash.js@=1.0.3",resolved:"https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz",version:"1.0.3"}},from:"elliptic@=3.0.3",resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",version:"3.0.3"},inherits:{from:"inherits@=2.0.1",resolved:"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",version:"2.0.1"},lodash:{from:"lodash@=3.10.1",resolved:"https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",version:"3.10.1"}},name:"bitcore",version:"0.13.18"},_spec:"bitcore-lib@^0.13.7",_where:"/home/administrator/javascript-opentimestamps",author:{email:"dev@bitpay.com",name:"BitPay"},browser:{request:"browser-request"},bugs:{url:"https://github.com/bitpay/bitcore-lib/issues"},contributors:[{name:"Manuel Araoz",email:"manuelaraoz@gmail.com"},{name:"Daniel Cousens",email:"bitcoin@dcousens.com"},{name:"Gordon Hall",email:"gordon@bitpay.com"},{name:"Jeff Garzik",email:"jgarzik@bitpay.com"},{name:"Kyle Drake",email:"kyle@kyledrake.net"},{name:"Esteban Ordano",email:"eordano@gmail.com"},{name:"Matias Alejo Garcia",email:"ematiu@gmail.com"},{name:"Ryan X. Charles",email:"ryanxcharles@gmail.com"},{name:"Stefan Thomas",email:"moon@justmoon.net"},{name:"Stephen Pair",email:"stephen@bitpay.com"},{name:"Wei Lu",email:"luwei.here@gmail.com"}],dependencies:{"bn.js":"=2.0.4",bs58:"=2.0.0","buffer-compare":"=1.0.0",elliptic:"=3.0.3",inherits:"=2.0.1",lodash:"=3.10.1"},description:"A pure and powerful JavaScript Bitcoin library.",devDependencies:{"bitcore-build":"github:bitpay/bitcore-build",brfs:"^1.2.0",chai:"^1.10.0",gulp:"^3.8.10",sinon:"^1.13.0"},directories:{},dist:{shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",tarball:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz"},gitHead:"9517864f14d09700f3fd02ff61173003c0280774",homepage:"https://github.com/bitpay/bitcore-lib#readme",keywords:["address","bip21","bip32","bip37","bip69","bip70","bitcoin","blockchain","cryptocurrency","ecies","multisig","p2p","payment","transaction"],license:"MIT",main:"index.js",maintainers:[{name:"braydonf",email:"braydon@bitpay.com"},{name:"gabegattis",email:"gabegattis@gmail.com"},{name:"gasteve",email:"stephen@pairhome.net"},{name:"patrickbitpay",email:"patrick@bitpay.com"}],name:"bitcore-lib",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/bitpay/bitcore-lib.git"},scripts:{build:"gulp",coverage:"gulp coverage",lint:"gulp lint",test:"gulp test"},version:"0.13.19"}},{}],151:[function(e,t,r){var i=e("bitcore-lib");i.Message=e("./lib/message"),t.exports=i.Message},{"./lib/message":152,"bitcore-lib":78}],152:[function(r,d,e){(function(o){"use strict";var e=r("bitcore-lib"),s=e.deps._,i=e.PrivateKey,n=e.PublicKey,c=e.Address,a=e.encoding.BufferWriter,u=e.crypto.ECDSA,f=e.crypto.Signature,p=e.crypto.Hash.sha256sha256,t=e.util.js,h=e.util.preconditions,l=function e(t){return this instanceof e?(h.checkArgument(s.isString(t),"First argument should be a string"),this.message=t,this):new e(t)};l.MAGIC_BYTES=new o("Bitcoin Signed Message:\n"),l.prototype.magicHash=function(){var e=a.varintBufNum(l.MAGIC_BYTES.length),t=new o(this.message),r=a.varintBufNum(t.length),i=o.concat([e,l.MAGIC_BYTES,r,t]);return p(i)},l.prototype._sign=function(e){h.checkArgument(e instanceof i,"First argument should be an instance of PrivateKey");var t=this.magicHash(),r=new u;return r.hashbuf=t,r.privkey=e,r.pubkey=e.toPublicKey(),r.signRandomK(),r.calci(),r.sig},l.prototype.sign=function(e){return this._sign(e).toCompact().toString("base64")},l.prototype._verify=function(e,t){h.checkArgument(e instanceof n,"First argument should be an instance of PublicKey"),h.checkArgument(t instanceof f,"Second argument should be an instance of Signature");var r=this.magicHash(),i=u.verify(r,t,e);return i||(this.error="The signature was invalid"),i},l.prototype.verify=function(e,t){h.checkArgument(e),h.checkArgument(t&&s.isString(t)),s.isString(e)&&(e=c.fromString(e));var r=f.fromCompact(new o(t,"base64")),i=new u;i.hashbuf=this.magicHash(),i.sig=r;var n=i.toPublicKey(),a=c.fromPublicKey(n,e.network);return e.toString()!==a.toString()?!(this.error="The signature did not match the message digest"):this._verify(n,r)},l.fromString=function(e){return new l(e)},l.fromJSON=function(e){return t.isValidJSON(e)&&(e=JSON.parse(e)),new l(e.message)},l.prototype.toObject=function(){return{message:this.message}},l.prototype.toJSON=function(){return JSON.stringify(this.toObject())},l.prototype.toString=function(){return this.message},l.prototype.inspect=function(){return""},d.exports=l}).call(this,r("buffer").Buffer)},{"bitcore-lib":78,buffer:191}],153:[function(e,r,i){(function(Q,U,u){!function(e){if("object"==(void 0===i?"undefined":_typeof(i))&&void 0!==r)r.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:void 0!==U?t=U:"undefined"!=typeof self&&(t=self),t.Promise=e()}}(function(){var e,t,r;return function a(o,s,c){function u(r,e){if(!s[r]){if(!o[r]){var t="function"==typeof _dereq_&&_dereq_;if(!e&&t)return t(r,!0);if(f)return f(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[r]={exports:{}};o[r][0].call(n.exports,function(e){var t=o[r][1][e];return u(t||e)},n,n.exports,a,o,s,c)}return s[r].exports}for(var f="function"==typeof _dereq_&&_dereq_,e=0;e, no stack trace)"}function V(){return"function"==typeof Y}var G=function(){return!1},$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function W(e){var t=e.match($);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function Z(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);Y(this,Z),32=a)return r[t]=e,this._queue.push(t),!1;null!==n&&(n[t]=e);var o=this._promise,s=this._callback,c=o._boundValue();o._pushContext();var u=g(s).call(c,e,t,i),f=o._popContext();if(m.checkForgottenReturns(u,f,null!==n?"Promise.filter":"Promise.map",o),u===v)return this._reject(u.e),!0;var p=d(u,this._promise);if(p instanceof l){var h=(p=p._target())._bitField;if(0==(50397184&h))return 1<=a&&this._inFlight++,(r[t]=p)._proxy(this,-1*(t+1)),!1;if(0==(33554432&h))return 0!=(16777216&h)?this._reject(p._reason()):this._cancel(),!0;u=p._value()}r[t]=u}return i<=++this._totalResolved&&(null!==n?this._filter(r,n):this._resolve(r),!0)},f.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;0>>16)){if(e===this){var r=c();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,0<(65535&t)&&(0!=(134217728&t)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},E.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,d.isNode);0<(65535&t)?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},E.prototype._fulfillPromises=function(e,t){for(var r=1;r=this._length&&(this._resolve(this._values),!0)},t.prototype._promiseCancelled=function(){return this._cancel(),!0},t.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},t.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof s)e.cancel();else for(var t=0;t=this._length){var r;if(this._isMap)r=function(e){for(var t=new s,r=e.length/2|0,i=0;i>1},i.prototype.props=function(){return r(this)},i.props=function(e){return r(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function i(e){this._capacity=e,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},n.prototype._promiseFulfilled=function(e,t){var r=new i;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},n.prototype._promiseRejected=function(e,t){var r=new i;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},e.settle=function(e){return r.deprecated(".settle()",".reflect()"),new n(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(f,e,t){"use strict";e.exports=function(e,t,n){var r=f("./util"),i=f("./errors").RangeError,a=f("./errors").AggregateError,o=r.isArray,s={};function c(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function u(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new c(e),i=r.promise();return r.setHowMany(t),r.init(),i}r.inherits(c,t),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=o(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(e){this._howMany=e},c.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(s),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);else if("le"===r)for(n=i=0;i>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-a&4194303,26<=(a+=24)&&(a-=26,i++);r+6!==t&&(n=o(e,t,r+6),this.words[i]|=n<>>26-a&4194303),this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=67108863&o,c=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,p=67108863&c,h=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=h;l++){var d=u-l|0;f+=(o=(n=0|e.words[d])*(a=0|t.words[l])+p)/67108864|0,p=67108863&o}r.words[u]=0|p,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}v.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,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}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)&&2<=e&&e<=36){var c=l[e],u=d[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var p=f.modn(u).toString(e);r=(f=f.idivn(u)).isZero()?p+r:h[c-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.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]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},v.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)},v.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},v.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},v.prototype.inotn=function(e){g("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},v.prototype.notn=function(e){return this.clone().inotn(e)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);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,e):(r=e,this);for(var n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},v.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;i=0>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],d=8191&l,m=l>>>13,g=0|o[2],v=8191&g,b=g>>>13,y=0|o[3],_=8191&y,w=y>>>13,k=0|o[4],x=8191&k,S=k>>>13,j=0|o[5],E=8191&j,A=j>>>13,I=0|o[6],P=8191&I,O=I>>>13,T=0|o[7],B=8191&T,C=T>>>13,F=0|o[8],R=8191&F,z=F>>>13,M=0|o[9],N=8191&M,D=M>>>13,q=0|s[0],L=8191&q,U=q>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],$=8191&G,W=G>>>13,Z=0|s[3],Y=8191&Z,X=Z>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],ae=8191&ne,oe=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],pe=8191&fe,he=fe>>>13,le=0|s[9],de=8191&le,me=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(p,L))|0)+((8191&(n=(n=Math.imul(p,U))+Math.imul(h,L)|0))<<13)|0;u=((a=Math.imul(h,U))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,L),n=(n=Math.imul(d,U))+Math.imul(m,L)|0,a=Math.imul(m,U);var ve=(u+(i=i+Math.imul(p,K)|0)|0)+((8191&(n=(n=n+Math.imul(p,V)|0)+Math.imul(h,K)|0))<<13)|0;u=((a=a+Math.imul(h,V)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(b,L)|0,a=Math.imul(b,U),i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,V)|0;var be=(u+(i=i+Math.imul(p,$)|0)|0)+((8191&(n=(n=n+Math.imul(p,W)|0)+Math.imul(h,$)|0))<<13)|0;u=((a=a+Math.imul(h,W)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(_,L),n=(n=Math.imul(_,U))+Math.imul(w,L)|0,a=Math.imul(w,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,i=i+Math.imul(d,$)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,W)|0;var ye=(u+(i=i+Math.imul(p,Y)|0)|0)+((8191&(n=(n=n+Math.imul(p,X)|0)+Math.imul(h,Y)|0))<<13)|0;u=((a=a+Math.imul(h,X)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(x,L),n=(n=Math.imul(x,U))+Math.imul(S,L)|0,a=Math.imul(S,U),i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,W)|0,i=i+Math.imul(d,Y)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,X)|0;var _e=(u+(i=i+Math.imul(p,Q)|0)|0)+((8191&(n=(n=n+Math.imul(p,ee)|0)+Math.imul(h,Q)|0))<<13)|0;u=((a=a+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(A,L)|0,a=Math.imul(A,U),i=i+Math.imul(x,K)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,V)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,W)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(b,Y)|0,a=a+Math.imul(b,X)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0;var we=(u+(i=i+Math.imul(p,re)|0)|0)+((8191&(n=(n=n+Math.imul(p,ie)|0)+Math.imul(h,re)|0))<<13)|0;u=((a=a+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(O,L)|0,a=Math.imul(O,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,V)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,W)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,X)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0;var ke=(u+(i=i+Math.imul(p,ae)|0)|0)+((8191&(n=(n=n+Math.imul(p,oe)|0)+Math.imul(h,ae)|0))<<13)|0;u=((a=a+Math.imul(h,oe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(C,L)|0,a=Math.imul(C,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(O,K)|0,a=a+Math.imul(O,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,W)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(S,Y)|0,a=a+Math.imul(S,X)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ie)|0,i=i+Math.imul(d,ae)|0,n=(n=n+Math.imul(d,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var xe=(u+(i=i+Math.imul(p,ce)|0)|0)+((8191&(n=(n=n+Math.imul(p,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((a=a+Math.imul(h,ue)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(R,L),n=(n=Math.imul(R,U))+Math.imul(z,L)|0,a=Math.imul(z,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,W)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ie)|0,i=i+Math.imul(v,ae)|0,n=(n=n+Math.imul(v,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,i=i+Math.imul(d,ce)|0,n=(n=n+Math.imul(d,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0;var Se=(u+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,he)|0)+Math.imul(h,pe)|0))<<13)|0;u=((a=a+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,U))+Math.imul(D,L)|0,a=Math.imul(D,U),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(z,K)|0,a=a+Math.imul(z,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,W)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,Y)|0,a=a+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ie)|0,i=i+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,i=i+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,ue)|0,i=i+Math.imul(d,pe)|0,n=(n=n+Math.imul(d,he)|0)+Math.imul(m,pe)|0,a=a+Math.imul(m,he)|0;var je=(u+(i=i+Math.imul(p,de)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(h,de)|0))<<13)|0;u=((a=a+Math.imul(h,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(N,K),n=(n=Math.imul(N,V))+Math.imul(D,K)|0,a=Math.imul(D,V),i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,W)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,W)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(C,Y)|0,a=a+Math.imul(C,X)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ie)|0,i=i+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,ue)|0,i=i+Math.imul(v,pe)|0,n=(n=n+Math.imul(v,he)|0)+Math.imul(b,pe)|0,a=a+Math.imul(b,he)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;u=((a=a+Math.imul(m,me)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(N,$),n=(n=Math.imul(N,W))+Math.imul(D,$)|0,a=Math.imul(D,W),i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,X)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ie)|0,i=i+Math.imul(E,ae)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,i=i+Math.imul(x,ce)|0,n=(n=n+Math.imul(x,ue)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,ue)|0,i=i+Math.imul(_,pe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,pe)|0,a=a+Math.imul(w,he)|0;var Ae=(u+(i=i+Math.imul(v,de)|0)|0)+((8191&(n=(n=n+Math.imul(v,me)|0)+Math.imul(b,de)|0))<<13)|0;u=((a=a+Math.imul(b,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(N,Y),n=(n=Math.imul(N,X))+Math.imul(D,Y)|0,a=Math.imul(D,X),i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ie)|0,i=i+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,i=i+Math.imul(x,pe)|0,n=(n=n+Math.imul(x,he)|0)+Math.imul(S,pe)|0,a=a+Math.imul(S,he)|0;var Ie=(u+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,me)|0)+Math.imul(w,de)|0))<<13)|0;u=((a=a+Math.imul(w,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(N,Q),n=(n=Math.imul(N,ee))+Math.imul(D,Q)|0,a=Math.imul(D,ee),i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ie)|0,i=i+Math.imul(B,ae)|0,n=(n=n+Math.imul(B,oe)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,ue)|0,i=i+Math.imul(E,pe)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(A,pe)|0,a=a+Math.imul(A,he)|0;var Pe=(u+(i=i+Math.imul(x,de)|0)|0)+((8191&(n=(n=n+Math.imul(x,me)|0)+Math.imul(S,de)|0))<<13)|0;u=((a=a+Math.imul(S,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(N,re),n=(n=Math.imul(N,ie))+Math.imul(D,re)|0,a=Math.imul(D,ie),i=i+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,i=i+Math.imul(B,ce)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,ue)|0,i=i+Math.imul(P,pe)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(O,pe)|0,a=a+Math.imul(O,he)|0;var Oe=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(A,de)|0))<<13)|0;u=((a=a+Math.imul(A,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(N,ae),n=(n=Math.imul(N,oe))+Math.imul(D,ae)|0,a=Math.imul(D,oe),i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(z,ce)|0,a=a+Math.imul(z,ue)|0,i=i+Math.imul(B,pe)|0,n=(n=n+Math.imul(B,he)|0)+Math.imul(C,pe)|0,a=a+Math.imul(C,he)|0;var Te=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(O,de)|0))<<13)|0;u=((a=a+Math.imul(O,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(N,ce),n=(n=Math.imul(N,ue))+Math.imul(D,ce)|0,a=Math.imul(D,ue),i=i+Math.imul(R,pe)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(z,pe)|0,a=a+Math.imul(z,he)|0;var Be=(u+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,me)|0)+Math.imul(C,de)|0))<<13)|0;u=((a=a+Math.imul(C,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(N,pe),n=(n=Math.imul(N,he))+Math.imul(D,pe)|0,a=Math.imul(D,he);var Ce=(u+(i=i+Math.imul(R,de)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(z,de)|0))<<13)|0;u=((a=a+Math.imul(z,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Fe=(u+(i=Math.imul(N,de))|0)+((8191&(n=(n=Math.imul(N,me))+Math.imul(D,de)|0))<<13)|0;return u=((a=Math.imul(D,me))+(n>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,c[0]=ge,c[1]=ve,c[2]=be,c[3]=ye,c[4]=_e,c[5]=we,c[6]=ke,c[7]=xe,c[8]=Se,c[9]=je,c[10]=Ee,c[11]=Ae,c[12]=Ie,c[13]=Pe,c[14]=Oe,c[15]=Te,c[16]=Be,c[17]=Ce,c[18]=Fe,0!==u&&(c[19]=u,r.length++),r};function s(e,t,r){return(new c).mulp(e,t,r)}function c(e,t){this.x=e,this.y=t}Math.imul||(a=n),v.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?a(this,e,t):r<63?n(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,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},c.prototype.makeRBT=function(e){for(var t=new Array(e),r=v.prototype._countBits(e)-1,i=0;i>=1;return i},c.prototype.permute=function(e,t,r,i,n,a){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*a+1]=8191&n,n>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.muln=function(e){return this.clone().imuln(e)},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.imul(this.clone())},v.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 v(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<a)for(this.length-=a,c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},v.prototype.ishrn=function(e,t,r){return g(0===this.negative),this.iushrn(e,t,r)},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.ushln=function(e){return this.clone().iushln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.ushrn=function(e){return this.clone().iushrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===o)return this.strip();for(g(-1===o),i=o=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,a},v.prototype.div=function(e){return this.divmod(e,"div",!1).div},v.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},v.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},v.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),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(0===e.negative),g(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var c=r.clone(),u=t.clone();!t.isZero();){for(var f=0,p=1;0==(t.words[0]&p)&&f<26;++f,p<<=1);if(0>>26,o&=67108863,this.words[a]=o}return 0!==n&&(this.words[a]=n,this.length++),this},v.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},v.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(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(u[e])return u[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new b;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return u[e]=t},w.prototype._verify1=function(e){g(0===e.negative,"red works only with positives"),g(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){g(0==(e.negative|t.negative),"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},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 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&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();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);g(!i.isZero());var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==a?(a<<=1,a|=f,(4===++o||0===i&&0===u)&&(n=this.mul(n,r[a]),a=o=0)):o=0}s=26}return n},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},v.mont=function(e){return new k(e)},r(k,w),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.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),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new v(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:157}],155:[function(e,t,r){var A=e("concat-map"),I=e("balanced-match");t.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function t(e,r){var i=[];var n=I("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var s=a||o;var c=0<=n.body.indexOf(",");if(!s&&!c)return n.post.match(/,.*\}/)?(e=n.pre+"{"+n.body+P+n.post,t(e)):[e];var u;if(s)u=n.body.split(/\.\./);else if(1===(u=T(n.body)).length&&1===(u=t(u[0],!1).map(B)).length){var f=n.post.length?t(n.post,!1):[""];return f.map(function(e){return n.pre+u[0]+e})}var p=n.pre;var f=n.post.length?t(n.post,!1):[""];var h;if(s){var l=O(u[0]),d=O(u[1]),m=Math.max(u[0].length,u[1].length),g=3==u.length?Math.abs(O(u[2])):1,v=F,b=d>>24]^f[d>>>16&255]^p[m>>>8&255]^h[255&g]^t[v++],o=u[d>>>24]^f[m>>>16&255]^p[g>>>8&255]^h[255&l]^t[v++],s=u[m>>>24]^f[g>>>16&255]^p[l>>>8&255]^h[255&d]^t[v++],c=u[g>>>24]^f[l>>>16&255]^p[d>>>8&255]^h[255&m]^t[v++],l=a,d=o,m=s,g=c;return a=(i[l>>>24]<<24|i[d>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[v++],o=(i[d>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&l])^t[v++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[l>>>8&255]<<8|i[255&d])^t[v++],c=(i[g>>>24]<<24|i[l>>>16&255]<<16|i[d>>>8&255]<<8|i[255&m])^t[v++],[a>>>=0,o>>>=0,s>>>=0,c>>>=0]}var p=[0,1,2,4,8,16,32,64,128,27,54],h=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=[[],[],[],[]],a=[[],[],[],[]],o=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;var f=e[i[r[o]=u]=o],p=e[f],h=e[p],l=257*e[u]^16843008*u;n[0][o]=l<<24|l>>>8,n[1][o]=l<<16|l>>>16,n[2][o]=l<<8|l>>>24,n[3][o]=l,l=16843009*h^65537*p^257*f^16843008*o,a[0][u]=l<<24|l>>>8,a[1][u]=l<<16|l>>>16,a[2][u]=l<<8|l>>>24,a[3][u]=l,0===o?o=s=1:(o=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();function s(e){this._key=a(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],a=0;a>>24,o=h.SBOX[o>>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o],o^=p[a/t|0]<<24):6>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o]),n[a]=n[a-t]^o}for(var s=[],c=0;c>>24]]^h.INV_SUB_MIX[1][h.SBOX[f>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[f>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return o(e=a(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=a(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":447}],159:[function(e,t,r){var o=e("./aes"),u=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),f=e("./ghash"),n=e("buffer-xor"),p=e("./incr32");function a(e,t,r,i){s.call(this);var n=u.alloc(4,0);this._cipher=new o.AES(t);var a=this._cipher.encryptBlock(n);this._ghash=new f(a),r=function(e,t,r){if(12===t.length)return e._finID=u.concat([t,u.from([0,0,0,1])]),u.concat([t,u.from([0,0,0,2])]);var i=new f(r),n=t.length,a=n%16;i.update(t),a&&(a=16-a,i.update(u.alloc(a,0))),i.update(u.alloc(8,0));var o=8*n,s=u.alloc(8);s.writeUIntBE(o,0,8),i.update(s),e._finID=i.state;var c=u.from(e._finID);return p(c),c}(this,r,a),this._prev=u.from(r),this._cache=u.allocUnsafe(0),this._secCache=u.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(a,s),a.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=u.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},a.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(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;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":447}],164:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],165:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":190}],166:[function(e,t,r){var a=e("safe-buffer").Buffer,o=e("buffer-xor");function s(e,t,r){var i=t.length,n=o(t,e._cache);return e._cache=e._cache.slice(i),e._prev=a.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=a.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=a.allocUnsafe(0)),!(e._cache.length<=t.length)){n=a.concat([n,s(e,t,r)]);break}i=e._cache.length,n=a.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":190,"safe-buffer":447}],167:[function(e,t,r){var o=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,a=-1,o=0;++a<8;)i=t&1<<7-a?128:0,o+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>a%8,e._prev=c(e._prev,r?i:n);return o}function c(e,t){var r=e.length,i=-1,n=o.allocUnsafe(e.length);for(e=o.concat([e,o.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=o.allocUnsafe(i),a=-1;++a=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var a=m(r);if("ec"===a.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=g[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new d(i),a=r.data.subjectPrivateKey.data;return n.verify(t,e,a)}(e,t,a)}if("dsa"===a.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,a=r.data.g,o=r.data.pub_key,s=m.signature.decode(e,"der"),c=s.s,u=s.r;v(c,n),v(u,n);var f=l.mont(i),p=c.invm(n);return 0===a.toRed(f).redPow(new l(t).mul(p).mod(n)).fromRed().mul(o.toRed(f).redPow(u.mul(p).mod(n)).fromRed()).mod(i).mod(n).cmp(u)}(e,t,a)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var o=a.modulus.byteLength(),s=[1],c=0;t.length+s.length+2l.UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function h(e,t){for(var r=0;rm.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsm.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelm.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelm.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=m.Z_FILTERED&&e.strategy!=m.Z_HUFFMAN_ONLY&&e.strategy!=m.Z_RLE&&e.strategy!=m.Z_FIXED&&e.strategy!=m.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!g.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new o.Zlib(t);var i=this;this._hadError=!1,this._binding.onerror=function(e,t){i._binding=null,i._hadError=!0;var r=new Error(e);r.errno=t,r.code=m.codes[t],i.emit("error",r)};var r=m.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(r=e.level);var n=m.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(n=e.strategy),this._binding.init(e.windowBits||m.Z_DEFAULT_WINDOWBITS,r,e.memLevel||m.Z_DEFAULT_MEMLEVEL,n,e.dictionary),this._buffer=new g(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=n,this.once("end",this.close)}o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION,Object.keys(o).forEach(function(e){e.match(/^Z/)&&(m[e]=o[e])}),m.codes={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},Object.keys(m.codes).forEach(function(e){m.codes[m.codes[e]]=e}),m.Deflate=s,m.Inflate=c,m.Gzip=u,m.Gunzip=f,m.DeflateRaw=p,m.InflateRaw=h,m.Unzip=l,m.createDeflate=function(e){return new s(e)},m.createInflate=function(e){return new c(e)},m.createDeflateRaw=function(e){return new p(e)},m.createInflateRaw=function(e){return new h(e)},m.createGzip=function(e){return new u(e)},m.createGunzip=function(e){return new f(e)},m.createUnzip=function(e){return new l(e)},m.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new s(t),e,r)},m.deflateSync=function(e,t){return r(new s(t),e)},m.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new u(t),e,r)},m.gzipSync=function(e,t){return r(new u(t),e)},m.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new p(t),e,r)},m.deflateRawSync=function(e,t){return r(new p(t),e)},m.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new l(t),e,r)},m.unzipSync=function(e,t){return r(new l(t),e)},m.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new c(t),e,r)},m.inflateSync=function(e,t){return r(new c(t),e)},m.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new f(t),e,r)},m.gunzipSync=function(e,t){return r(new f(t),e)},m.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new h(t),e,r)},m.inflateRawSync=function(e,t){return r(new h(t),e)},e.inherits(t,a),t.prototype.params=function(e,t,r){if(em.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=m.Z_FILTERED&&t!=m.Z_HUFFMAN_ONLY&&t!=m.Z_RLE&&t!=m.Z_FIXED&&t!=m.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var i=this;this.flush(o.Z_SYNC_FLUSH,function(){i._binding.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())})}else n.nextTick(r)},t.prototype.reset=function(){return this._binding.reset()},t.prototype._flush=function(e){this._transform(new g(0),"",e)},t.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=o.Z_FULL_FLUSH),r.ended)t&&n.nextTick(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var i=this;this.once("drain",function(){i.flush(t)})}else this._flushFlag=e,this.write(new g(0),"",t)},t.prototype.close=function(e){if(e&&n.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;n.nextTick(function(){t.emit("close")})}},t.prototype._transform=function(e,t,r){var i,n=this._writableState,a=(n.ending||n.ended)&&(!e||n.length===e.length);if(null===!e&&!g.isBuffer(e))return r(new Error("invalid input"));a?i=o.Z_FINISH:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH));this._processChunk(e,i,r)},t.prototype._processChunk=function(a,o,s){var c=a&&a.length,u=this._chunkSize-this._offset,f=0,p=this,h="function"==typeof s;if(!h){var t,l=[],d=0;this.on("error",function(e){t=e});do{var e=this._binding.writeSync(o,a,f,c,this._buffer,this._offset,u)}while(!this._hadError&&m(e[0],e[1]));if(this._hadError)throw t;var r=g.concat(l,d);return this.close(),r}var i=this._binding.write(o,a,f,c,this._buffer,this._offset,u);function m(e,t){if(!p._hadError){var r=u-t;if(v(0<=r,"have should not go down"),0=p._chunkSize)&&(u=p._chunkSize,p._offset=0,p._buffer=new g(p._chunkSize)),0===t){if(f+=c-e,c=e,!h)return!0;var n=p._binding.write(o,a,f,c,p._buffer,p._offset,p._chunkSize);return n.callback=m,void(n.buffer=a)}if(!h)return!1;s()}}i.buffer=a,i.callback=m},e.inherits(s,t),e.inherits(c,t),e.inherits(u,t),e.inherits(f,t),e.inherits(p,t),e.inherits(h,t),e.inherits(l,t)}).call(this,d("_process"),d("buffer").Buffer)},{"./binding":185,_process:382,_stream_transform:427,assert:67,buffer:191,util:505}],187:[function(e,t,r){arguments[4][157][0].apply(r,arguments)},{dup:157}],188:[function(e,B,C){(function(T){!function(e){var t="object"==(void 0===C?"undefined":_typeof(C))&&C&&!C.nodeType&&C,r="object"==(void 0===B?"undefined":_typeof(B))&&B&&!B.nodeType&&B,i="object"==(void 0===T?"undefined":_typeof(T))&&T;i.global!==i&&i.window!==i&&i.self!==i||(e=i);var n,a,v=2147483647,b=36,y=1,_=26,o=38,s=700,w=72,k=128,x="-",c=/^xn--/,u=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=b-y,S=Math.floor,j=String.fromCharCode;function E(e){throw new RangeError(p[e])}function l(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function d(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((v-d)/o))&&E("overflow"),d+=c*o,!(c<(u=s<=g?y:g+_<=s?_:s-g));s+=b)o>S(v/(f=b-u))&&E("overflow"),o*=f;g=O(d-a,t=h.length+1,0==a),S(d/t)>v-m&&E("overflow"),m+=S(d/t),d%=t,h.splice(d++,0,m)}return I(h)}function g(e){var t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g=[];for(h=(e=A(e)).length,t=k,a=w,o=r=0;oS((v-r)/(l=i+1))&&E("overflow"),r+=(s-t)*l,t=s,o=0;ov&&E("overflow"),p==t){for(c=r,u=b;!(c<(f=u<=a?y:a+_<=u?_:u-a));u+=b)m=c-f,d=b-f,g.push(j(P(f+m%d,0))),c=S(m/d);g.push(j(P(c,0))),a=O(r,l,i==n),r=0,++i}++r,++t}return g.join("")}if(n={version:"1.4.1",ucs2:{decode:A,encode:I},decode:m,encode:g,toASCII:function(e){return d(e,function(e){return u.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return d(e,function(e){return c.test(e)?m(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",function(){return n});else if(t&&r)if(B.exports==t)r.exports=n;else for(a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],189:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var a=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=c;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function c(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}a.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},a.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:191}],190:[function(e,t,r){(function(a){t.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new a(r),n=0;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function l(e,t){if(p.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return R(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=p.from(t,i)),p.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,n);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,n){var a,o=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;s/=o=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var f=-1;for(a=r;a>>10&1023|55296),f=56320|1023&f),i.push(f),n+=p}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;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 S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===p.compare(this,e)},p.prototype.inspect=function(){var e="",t=N.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,i,n){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(i,n),u=e.slice(t,r),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a,o,s,c,u,f,p,h,l,d=!1;;)switch(i){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return h=t,l=r,M(R(e,(p=this).length-h),p,h,l);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return c=this,u=t,f=r,M(z(e),c,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=t,s=r,M(function(e,t){for(var r,i,n,a=[],o=0;o>8,n=r%256,a.push(n),a.push(i);return a}(e,(a=this).length-o),a,o,s);default:if(d)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function k(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function I(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function P(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function O(e,t,r,i,n,a){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(e,t,r,i,n){return n||O(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function B(e,t,r,i,n){return n||O(e,0,r,8),a.write(e,t,r,i,52,8),r+8}p.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):I(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;0<=--a&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function z(e){return i.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function M(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":75,ieee754:318,isarray:323}],192:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],193:[function(e,t,r){function n(e){this.dict=e||{}}n.prototype.set=function(e,t,r){if("object"!==(void 0===e?"undefined":_typeof(e))){void 0===r&&(r=!0);var i=this.has(e);return!r&&i?this.dict[i]=this.dict[i]+","+t:this.dict[i||e]=t,i}for(var n in e)this.set(n,e[n],t)},n.prototype.has=function(e){for(var t=Object.keys(this.dict),r=(e=e.toLowerCase(),0);rr)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>8^255&n^99,u[r]=n;var a=e[f[n]=r],o=e[a],s=e[o],c=257*e[n]^16843008*n;p[r]=c<<24|c>>>8,h[r]=c<<16|c>>>16,l[r]=c<<8|c>>>24,d[r]=c;c=16843009*s^65537*o^257*a^16843008*r;m[n]=c<<24|c>>>8,g[n]=c<<16|c>>>16,v[n]=c<<8|c>>>24,b[n]=c,r?(r=a^e[e[e[s^a]]],i^=e[e[i]]):r=i=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],i=r.AES=t.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),n=this._keySchedule=[],a=0;a>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o]):(o=u[(o=o<<8|o>>>24)>>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o],o^=y[a/r|0]<<24),n[a]=n[a-r]^o}for(var s=this._invKeySchedule=[],c=0;c>>24]]^g[u[o>>>16&255]]^v[u[o>>>8&255]]^b[u[255&o]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,p,h,l,d,u)},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,m,g,v,b,f);r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,a,o,s){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],p=e[t+2]^r[2],h=e[t+3]^r[3],l=4,d=1;d>>24]^n[f>>>16&255]^a[p>>>8&255]^o[255&h]^r[l++],g=i[f>>>24]^n[p>>>16&255]^a[h>>>8&255]^o[255&u]^r[l++],v=i[p>>>24]^n[h>>>16&255]^a[u>>>8&255]^o[255&f]^r[l++],b=i[h>>>24]^n[u>>>16&255]^a[f>>>8&255]^o[255&p]^r[l++];u=m,f=g,p=v,h=b}m=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&h])^r[l++],g=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[h>>>8&255]<<8|s[255&u])^r[l++],v=(s[p>>>24]<<24|s[h>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^r[l++],b=(s[h>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^r[l++];e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=b},keySize:8});e.AES=t._createHelper(i)}(),n.AES},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],206:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,c,n,a,o,s,u,f,p,h,l,d,m,g,v,b;e.lib.Cipher||(r=(t=e).lib,i=r.Base,c=r.WordArray,n=r.BufferedBlockAlgorithm,(a=t.enc).Utf8,o=a.Base64,s=t.algo.EvpKDF,u=r.Cipher=n.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function n(e){return"string"==typeof e?b:g}return function(i){return{encrypt:function(e,t,r){return n(t).encrypt(i,e,t,r)},decrypt:function(e,t,r){return n(t).decrypt(i,e,t,r)}}}}()}),r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),f=t.mode={},p=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var e=p.extend();function a(e,t,r){var i=this._iv;if(i){var n=i;this._iv=void 0}else n=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:l}),reset:function(){u.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else{i=r.createDecryptor;this._minBufferSize=1}this._mode=i.call(r,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),d=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var i=c.create([1398893684,1701076831]).concat(r).concat(t);else i=t;return i.toString(o)},parse:function(e){var t=o.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var i=c.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return d.create({ciphertext:t,salt:i})}},g=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),a=n.finalize(t),o=n.cfg;return d.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.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}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=c.random(8));var n=s.create({keySize:t+r}).compute(e,i),a=c.create(n.words.slice(t),4*r);return n.sigBytes=4*t,d.create({key:n,iv:a,salt:i})}},b=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),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 a=g.encrypt.call(this,e,t,n.key,i);return a.mixIn(n),a},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,g.decrypt.call(this,e,t,n.key,i)}}))},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],207:[function(e,t,r){var i,n;i=this,n=function(){var f,r,e,t,i,p,n,a,o,s,c,u,h=h||(f=Math,r=Object.create||function(){function r(){}return function(e){var t;return r.prototype=e,t=new r,r.prototype=null,t}}(),t=(e={}).lib={},i=t.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$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)}},p=t.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).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 a=0;a>>2]>>>24-a%4*8&255;t[i+a>>>2]|=o<<24-(i+a)%4*8}else for(a=0;a>>2]=r[a>>>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=f.ceil(t/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,r=[],i=function(t){t=t;var r=987654321,i=4294967295;return function(){var e=((r=36969*(65535&r)+(r>>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return e/=4294967296,(e+=.5)*(.5>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).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 p.init(r,t/2)}},o=n.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(a))}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 p.init(r,t)}},s=n.Utf8={stringify:function(e){try{return decodeURIComponent(escape(o.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return o.parse(unescape(encodeURIComponent(e)))}},c=t.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=s.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,n=this.blockSize,a=i/(4*n),o=(a=e?f.ceil(a):f.max((0|a)-this._minBufferSize,0))*n,s=f.min(4*o,i);if(o){for(var c=0;c>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.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,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var n=0;n>>6-a%4*2;i[n>>>2]|=(o|s)<<24-n%4*8,n++}return c.create(i,n)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],209:[function(e,t,r){var i,n;i=this,n=function(r){return function(){var e=r,n=e.lib.WordArray,t=e.enc;t.Utf16=t.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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}};function o(e){return e<<8&4278255360|e>>>8&16711935}t.Utf16LE={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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return n.create(r,2*t)}}}(),r.enc.Utf16},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],210:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,f,n,a,o;return r=(t=e).lib,i=r.Base,f=r.WordArray,n=t.algo,a=n.MD5,o=n.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=r.hasher.create(),n=f.create(),a=n.words,o=r.keySize,s=r.iterations;a.lengthi&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),a=this._iKey=t.clone(),o=n.words,s=a.words,c=0;c>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)}).prototype=e}}(),t.lib.WordArray},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],215:[function(e,t,r){var i,n;i=this,n=function(o){return function(f){var e=o,t=e.lib,r=t.WordArray,i=t.Hasher,n=e.algo,E=[];!function(){for(var e=0;e<64;e++)E[e]=4294967296*f.abs(f.sin(e+1))|0}();var a=n.MD5=i.extend({_doReset:function(){this._hash=new r.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 a=this._hash.words,o=e[t+0],s=e[t+1],c=e[t+2],u=e[t+3],f=e[t+4],p=e[t+5],h=e[t+6],l=e[t+7],d=e[t+8],m=e[t+9],g=e[t+10],v=e[t+11],b=e[t+12],y=e[t+13],_=e[t+14],w=e[t+15],k=a[0],x=a[1],S=a[2],j=a[3];x=O(x=O(x=O(x=O(x=P(x=P(x=P(x=P(x=I(x=I(x=I(x=I(x=A(x=A(x=A(x=A(x,S=A(S,j=A(j,k=A(k,x,S,j,o,7,E[0]),x,S,s,12,E[1]),k,x,c,17,E[2]),j,k,u,22,E[3]),S=A(S,j=A(j,k=A(k,x,S,j,f,7,E[4]),x,S,p,12,E[5]),k,x,h,17,E[6]),j,k,l,22,E[7]),S=A(S,j=A(j,k=A(k,x,S,j,d,7,E[8]),x,S,m,12,E[9]),k,x,g,17,E[10]),j,k,v,22,E[11]),S=A(S,j=A(j,k=A(k,x,S,j,b,7,E[12]),x,S,y,12,E[13]),k,x,_,17,E[14]),j,k,w,22,E[15]),S=I(S,j=I(j,k=I(k,x,S,j,s,5,E[16]),x,S,h,9,E[17]),k,x,v,14,E[18]),j,k,o,20,E[19]),S=I(S,j=I(j,k=I(k,x,S,j,p,5,E[20]),x,S,g,9,E[21]),k,x,w,14,E[22]),j,k,f,20,E[23]),S=I(S,j=I(j,k=I(k,x,S,j,m,5,E[24]),x,S,_,9,E[25]),k,x,u,14,E[26]),j,k,d,20,E[27]),S=I(S,j=I(j,k=I(k,x,S,j,y,5,E[28]),x,S,c,9,E[29]),k,x,l,14,E[30]),j,k,b,20,E[31]),S=P(S,j=P(j,k=P(k,x,S,j,p,4,E[32]),x,S,d,11,E[33]),k,x,v,16,E[34]),j,k,_,23,E[35]),S=P(S,j=P(j,k=P(k,x,S,j,s,4,E[36]),x,S,f,11,E[37]),k,x,l,16,E[38]),j,k,g,23,E[39]),S=P(S,j=P(j,k=P(k,x,S,j,y,4,E[40]),x,S,o,11,E[41]),k,x,u,16,E[42]),j,k,h,23,E[43]),S=P(S,j=P(j,k=P(k,x,S,j,m,4,E[44]),x,S,b,11,E[45]),k,x,w,16,E[46]),j,k,c,23,E[47]),S=O(S,j=O(j,k=O(k,x,S,j,o,6,E[48]),x,S,l,10,E[49]),k,x,_,15,E[50]),j,k,p,21,E[51]),S=O(S,j=O(j,k=O(k,x,S,j,b,6,E[52]),x,S,u,10,E[53]),k,x,g,15,E[54]),j,k,s,21,E[55]),S=O(S,j=O(j,k=O(k,x,S,j,d,6,E[56]),x,S,w,10,E[57]),k,x,h,15,E[58]),j,k,y,21,E[59]),S=O(S,j=O(j,k=O(k,x,S,j,f,6,E[60]),x,S,v,10,E[61]),k,x,c,15,E[62]),j,k,m,21,E[63]),a[0]=a[0]+k|0,a[1]=a[1]+x|0,a[2]=a[2]+S|0,a[3]=a[3]+j|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var n=f.floor(r/4294967296),a=r;t[15+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,s=o.words,c=0;c<4;c++){var u=s[c];s[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function A(e,t,r,i,n,a,o){var s=e+(t&r|~t&i)+n+o;return(s<>>32-a)+t}function I(e,t,r,i,n,a,o){var s=e+(t&i|r&~i)+n+o;return(s<>>32-a)+t}function P(e,t,r,i,n,a,o){var s=e+(t^r^i)+n+o;return(s<>>32-a)+t}function O(e,t,r,i,n,a,o){var s=e+(r^(t|~i))+n+o;return(s<>>32-a)+t}e.MD5=i._createHelper(a),e.HmacMD5=i._createHmacHelper(a)}(Math),o.MD5},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],216:[function(e,t,r){var i,n;i=this,n=function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function a(e,t,r,i){var n=this._iv;if(n){var a=n.slice(0);this._iv=void 0}else a=this._prevBlock;i.encryptBlock(a,0);for(var o=0;o>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 t=e.Encryptor=e.extend({processBlock:function(e,t){var r,i=this._cipher,n=i.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),0===((r=o)[0]=u(r[0]))&&(r[1]=u(r[1]));var s=o.slice(0);i.encryptBlock(s,0);for(var c=0;c>>2]|=n<<24-a%4*8,e.sigBytes+=n},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],222:[function(e,t,r){var i,n;i=this,n=function(n){return n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],223:[function(e,t,r){var i,n;i=this,n=function(r){return r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],224:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],225:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],226:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,v,n,a,b,o;return r=(t=e).lib,i=r.Base,v=r.WordArray,n=t.algo,a=n.SHA1,b=n.HMAC,o=n.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=b.create(r.hasher,e),n=v.create(),a=v.create([1]),o=n.words,s=a.words,c=r.keySize,u=r.iterations;o.length>>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]],n=this._b=0;n<4;n++)h.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;i[0]^=c,i[1]^=f,i[2]^=u,i[3]^=p,i[4]^=c,i[5]^=f,i[6]^=u,i[7]^=p;for(n=0;n<4;n++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.RabbitLegacy=t._createHelper(i)}(),a.RabbitLegacy},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],228:[function(e,t,r){var i,n;i=this,n=function(a){return function(){var e=a,t=e.lib.StreamCipher,r=e.algo,n=[],c=[],u=[],i=r.Rabbit=t.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(r=this._b=0;r<4;r++)h.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;n[0]^=c,n[1]^=f,n[2]^=u,n[3]^=p,n[4]^=c,n[5]^=f,n[6]^=u,n[7]^=p;for(r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.Rabbit=t._createHelper(i)}(),a.Rabbit},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],229:[function(e,t,r){var i,n;i=this,n=function(o){return function(){var e=o,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.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 a=0;n<256;n++){var o=n%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+i[n]+s)%256;var c=i[n];i[n]=i[a],i[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=n.call(this)},keySize:8,ivSize:0});function n(){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 a=e[t];e[t]=e[r],e[r]=a,i|=e[(e[t]+e[r])%256]<<24-8*n}return this._i=t,this._j=r,i}e.RC4=t._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;0>>24)|4278255360&(n<<24|n>>>8)}var a,o,s,c,u,f,p,h,l,d,m,g=this._hash.words,v=A.words,b=I.words,y=x.words,_=S.words,w=j.words,k=E.words;f=a=g[0],p=o=g[1],h=s=g[2],l=c=g[3],d=u=g[4];for(r=0;r<80;r+=1)m=a+e[t+y[r]]|0,m+=r<16?P(o,s,c)+v[0]:r<32?O(o,s,c)+v[1]:r<48?T(o,s,c)+v[2]:r<64?B(o,s,c)+v[3]:C(o,s,c)+v[4],m=(m=F(m|=0,w[r]))+u|0,a=u,u=c,c=F(s,10),s=o,o=m,m=f+e[t+_[r]]|0,m+=r<16?C(p,h,l)+b[0]:r<32?B(p,h,l)+b[1]:r<48?T(p,h,l)+b[2]:r<64?O(p,h,l)+b[3]:P(p,h,l)+b[4],m=(m=F(m|=0,k[r]))+d|0,f=d,d=l,l=F(h,10),h=p,p=m;m=g[1]+s+l|0,g[1]=g[2]+c+d|0,g[2]=g[3]+u+f|0,g[3]=g[4]+a+p|0,g[4]=g[0]+o+h|0,g[0]=m},_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,a=n.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function P(e,t,r){return e^t^r}function O(e,t,r){return e&t|~e&r}function T(e,t,r){return(e|~t)^r}function B(e,t,r){return e&r|t&~r}function C(e,t,r){return e^(t|~r)}function F(e,t){return e<>>32-t}t.RIPEMD160=n._createHelper(o),t.HmacRIPEMD160=n._createHmacHelper(o)}(Math),s.RIPEMD160},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],231:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,p,o;return r=(t=e).lib,i=r.WordArray,n=r.Hasher,a=t.algo,p=[],o=a.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],a=r[2],o=r[3],s=r[4],c=0;c<80;c++){if(c<16)p[c]=0|e[t+c];else{var u=p[c-3]^p[c-8]^p[c-14]^p[c-16];p[c]=u<<1|u>>>31}var f=(i<<5|i>>>27)+s+p[c];f+=c<20?1518500249+(n&a|~n&o):c<40?1859775393+(n^a^o):c<60?(n&a|n&o|a&o)-1894007588:(n^a^o)-899497514,s=o,o=a,a=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|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(o),t.HmacSHA1=n._createHmacHelper(o),e.SHA1},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],232:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a;return r=(t=e).lib.WordArray,i=t.algo,n=i.SHA256,a=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(a),t.HmacSHA224=n._createHmacHelper(a),e.SHA224},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],n):n(i.CryptoJS)},{"./core":207,"./sha256":233}],233:[function(e,t,r){var i,n;i=this,n=function(c){return function(n){var e=c,t=e.lib,r=t.WordArray,i=t.Hasher,a=e.algo,o=[],y=[];!function(){function e(e){for(var t=n.sqrt(e),r=2;r<=t;r++)if(!(e%r))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(o[i]=t(n.pow(r,.5))),y[i]=t(n.pow(r,1/3)),i++),r++}();var _=[],s=a.SHA256=i.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=0;p<64;p++){if(p<16)_[p]=0|e[t+p];else{var h=_[p-15],l=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,d=_[p-2],m=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;_[p]=l+_[p-7]+m+_[p-16]}var g=i&n^i&a^n&a,v=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&u)+y[p]+_[p];f=u,u=c,c=s,s=o+b|0,o=a,a=n,n=i,i=b+(v+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+u|0,r[7]=r[7]+f|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)]=n.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA256=i._createHelper(s),e.HmacSHA256=i._createHmacHelper(s)}(Math),c.SHA256},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],234:[function(e,t,r){var i,n;i=this,n=function(a){return function(h){var e=a,t=e.lib,l=t.WordArray,i=t.Hasher,f=e.x64.Word,r=e.algo,P=[],O=[],T=[];!function(){for(var e=1,t=0,r=0;r<24;r++){P[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++)O[e+5*t]=t+(2*e+3*t)%5*5;for(var n=1,a=0;a<24;a++){for(var o=0,s=0,c=0;c<7;c++){if(1&n){var u=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(S=r[n]).high^=o,S.low^=a}for(var s=0;s<24;s++){for(var c=0;c<5;c++){for(var u=0,f=0,p=0;p<5;p++){u^=(S=r[c+5*p]).high,f^=S.low}var h=B[c];h.high=u,h.low=f}for(c=0;c<5;c++){var l=B[(c+4)%5],d=B[(c+1)%5],m=d.high,g=d.low;for(u=l.high^(m<<1|g>>>31),f=l.low^(g<<1|m>>>31),p=0;p<5;p++){(S=r[c+5*p]).high^=u,S.low^=f}}for(var v=1;v<25;v++){var b=(S=r[v]).high,y=S.low,_=P[v];if(_<32)u=b<<_|y>>>32-_,f=y<<_|b>>>32-_;else u=y<<_-32|b>>>64-_,f=b<<_-32|y>>>64-_;var w=B[O[v]];w.high=u,w.low=f}var k=B[0],x=r[0];k.high=x.high,k.low=x.low;for(c=0;c<5;c++)for(p=0;p<5;p++){var S=r[v=c+5*p],j=B[v],E=B[(c+1)%5+5*p],A=B[(c+2)%5+5*p];S.high=j.high^~E.high&A.high,S.low=j.low^~E.low&A.low}S=r[0];var I=T[s];S.high^=I.high,S.low^=I.low}},_doFinalize:function(){var e=this._data,t=e.words,r=(this._nDataBytes,8*e.sigBytes),i=32*this.blockSize;t[r>>>5]|=1<<24-r%32,t[(h.ceil((r+1)/i)*i>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();for(var n=this._state,a=this.cfg.outputLength/8,o=a/8,s=[],c=0;c>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),s.push(p),s.push(f)}return new l.init(s,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});e.SHA3=i._createHelper(n),e.HmacSHA3=i._createHmacHelper(n)}(Math),a.SHA3},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],235:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,o,s;return r=(t=e).x64,i=r.Word,n=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.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=o._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s),e.SHA384},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core"),e("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],n):n(i.CryptoJS)},{"./core":207,"./sha512":236,"./x64-core":238}],236:[function(e,t,r){var i,n;i=this,n=function(c){return function(){var e=c,t=e.lib.Hasher,r=e.x64,i=r.Word,n=r.WordArray,a=e.algo;function o(){return i.create.apply(i,arguments)}var xe=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],Se=[];!function(){for(var e=0;e<80;e++)Se[e]=o()}();var s=a.SHA512=t.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=i.high,h=i.low,l=n.high,d=n.low,m=a.high,g=a.low,v=o.high,b=o.low,y=s.high,_=s.low,w=c.high,k=c.low,x=u.high,S=u.low,j=f.high,E=f.low,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=w,N=k,D=x,q=S,L=j,U=E,H=0;H<80;H++){var K=Se[H];if(H<16)var V=K.high=0|e[t+2*H],G=K.low=0|e[t+2*H+1];else{var $=Se[H-15],W=$.high,Z=$.low,Y=(W>>>1|Z<<31)^(W>>>8|Z<<24)^W>>>7,X=(Z>>>1|W<<31)^(Z>>>8|W<<24)^(Z>>>7|W<<25),J=Se[H-2],Q=J.high,ee=J.low,te=(Q>>>19|ee<<13)^(Q<<3|ee>>>29)^Q>>>6,re=(ee>>>19|Q<<13)^(ee<<3|Q>>>29)^(ee>>>6|Q<<26),ie=Se[H-7],ne=ie.high,ae=ie.low,oe=Se[H-16],se=oe.high,ce=oe.low;V=(V=(V=Y+ne+((G=X+ae)>>>0>>0?1:0))+te+((G=G+re)>>>0>>0?1:0))+se+((G=G+ce)>>>0>>0?1:0);K.high=V,K.low=G}var ue,fe=R&M^~R&D,pe=z&N^~z&q,he=A&P^A&T^P&T,le=I&O^I&B^O&B,de=(A>>>28|I<<4)^(A<<30|I>>>2)^(A<<25|I>>>7),me=(I>>>28|A<<4)^(I<<30|A>>>2)^(I<<25|A>>>7),ge=(R>>>14|z<<18)^(R>>>18|z<<14)^(R<<23|z>>>9),ve=(z>>>14|R<<18)^(z>>>18|R<<14)^(z<<23|R>>>9),be=xe[H],ye=be.high,_e=be.low,we=L+ge+((ue=U+ve)>>>0>>0?1:0),ke=me+le;L=D,U=q,D=M,q=N,M=R,N=z,R=C+(we=(we=(we=we+fe+((ue=ue+pe)>>>0>>0?1:0))+ye+((ue=ue+_e)>>>0<_e>>>0?1:0))+V+((ue=ue+G)>>>0>>0?1:0))+((z=F+ue|0)>>>0>>0?1:0)|0,C=T,F=B,T=P,B=O,P=A,O=I,A=we+(de+he+(ke>>>0>>0?1:0))+((I=ue+ke|0)>>>0>>0?1:0)|0}h=i.low=h+I,i.high=p+A+(h>>>0>>0?1:0),d=n.low=d+O,n.high=l+P+(d>>>0>>0?1:0),g=a.low=g+B,a.high=m+T+(g>>>0>>0?1:0),b=o.low=b+F,o.high=v+C+(b>>>0>>0?1:0),_=s.low=_+z,s.high=y+R+(_>>>0>>0?1:0),k=c.low=k+N,c.high=w+M+(k>>>0>>0?1:0),S=u.low=S+q,u.high=x+D+(S>>>0>>0?1:0),E=f.low=E+U,f.high=j+L+(E>>>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=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(s),e.HmacSHA512=t._createHmacHelper(s)}(),c.SHA512},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],237:[function(e,t,r){var i,n;i=this,n=function(s){return function(){var e=s,t=e.lib,r=t.WordArray,i=t.BlockCipher,n=e.algo,u=[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],f=[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],p=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],a=n.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var i=u[r]-1;t[r]=e[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var o=n[a]=[],s=p[a];for(r=0;r<24;r++)o[r/6|0]|=t[(f[r]-1+s)%28]<<31-r%6,o[4+(r/6|0)]|=t[28+(f[r+24]-1+s)%28]<<31-r%6;o[0]=o[0]<<1|o[0]>>>31;for(r=1;r<7;r++)o[r]=o[r]>>>4*(r-1)+3;o[7]=o[7]<<5|o[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[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],d.call(this,4,252645135),d.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),d.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=h[c][((o^n[c])&l[c])>>>0];this._lBlock=o,this._rBlock=a^s}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,d.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(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<>>1];r=h.r28shl(r,a),i=h.r28shl(i,a),h.pc2(r,i,e.keys,n)}},c.prototype._update=function(e,t,r,i){var n=this._desState,a=h.readUInt32BE(e,t),o=h.readUInt32BE(e,t+4);h.ip(a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,o,n.tmp,0):this._decrypt(n,a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],h.writeUInt32BE(r,a,i),h.writeUInt32BE(r,o,i+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,a=p}h.rip(o,a,i,n)},c.prototype._decrypt=function(e,t,r,i,n){for(var a=r,o=t,s=e.keys.length-2;0<=s;s-=2){var c=e.keys[s],u=e.keys[s+1];h.expand(a,e.tmp,0),c^=e.tmp[0],u^=e.tmp[1];var f=h.substitute(c,u),p=a;a=(o^h.permute(f))>>>0,o=p}h.rip(a,o,i,n)}},{"../des":240,inherits:320,"minimalistic-assert":353}],244:[function(e,t,r){"use strict";var a=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),o=n.Cipher,s=n.DES;function c(e,t){a.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new c(this.type,this.options.key);this._edeState=t}i(u,o),(t.exports=u).create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":240,inherits:320,"minimalistic-assert":353}],245:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.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},r.ip=function(e,t,r,i){for(var n=0,a=0,o=6;0<=o;o-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+o&1}for(o=6;0<=o;o-=2){for(s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1;for(s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1}r[i+0]=n>>>0,r[i+1]=a>>>0},r.rip=function(e,t,r,i){for(var n=0,a=0,o=0;o<4;o++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+o&1,n<<=1,n|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;0<=s;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.pc1=function(e,t,r,i){for(var n=0,a=0,o=7;5<=o;o--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.r28shl=function(e,t){return e<>>28-t};var c=[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];r.pc2=function(e,t,r,i){for(var n=0,a=0,o=c.length>>>1,s=0;s>>c[s]&1;for(s=o;s>>c[s]&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var a=23;15<=a;a-=4)i<<=6,i|=e>>>a&63;for(a=11;3<=a;a-=4)n|=e>>>a&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[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];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[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];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(c),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;r.mod(p).cmp(h);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(i=r.shrn(1))&&g(r)&&v(i)&&v(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":154,"miller-rabin":349,randombytes:414}],249:[function(e,t,r){t.exports={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"}}},{}],250:[function(e,t,r){var u=e("crypto"),f=e("jsbn").BigInteger,p=(e("./lib/ec.js").ECPointFp,e("safer-buffer").Buffer);function h(e,t){return e.length>=t?e:h("0"+e,t)}r.ECCurves=e("./lib/sec.js"),r.ECKey=function(e,t,r){var i,n=e(),a=n.getN(),o=Math.floor(a.bitLength()/8);if(t)if(r){e=n.getCurve();this.P=e.decodePointHex(t.toString("hex"))}else{if(t.length!=o)return!1;i=new f(t.toString("hex"),16)}else{var s=a.subtract(f.ONE),c=new f(u.randomBytes(a.bitLength()));i=c.mod(s).add(f.ONE),this.P=n.getG().multiply(i)}this.P&&(this.PublicKey=p.from(n.getCurve().encodeCompressedPointHex(this.P),"hex")),i&&(this.PrivateKey=p.from(h(i.toString(16),2*o),"hex"),this.deriveSharedSecret=function(e){if(!e||!e.P)return!1;var t=e.P.multiply(i);return p.from(h(t.getX().toBigInteger().toString(16),2*o),"hex")})}},{"./lib/ec.js":251,"./lib/sec.js":252,crypto:204,jsbn:325,"safer-buffer":448}],251:[function(e,t,r){var l=e("jsbn").BigInteger,i=l.prototype.Barrett;function f(e,t){this.x=t,this.q=e}function d(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=null==i?l.ONE:i,this.zinv=null}function n(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new d(this,null,null),this.reducer=new i(this.q)}f.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},f.prototype.toBigInteger=function(){return this.x},f.prototype.negate=function(){return new f(this.q,this.x.negate().mod(this.q))},f.prototype.add=function(e){return new f(this.q,this.x.add(e.toBigInteger()).mod(this.q))},f.prototype.subtract=function(e){return new f(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},f.prototype.multiply=function(e){return new f(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},f.prototype.square=function(){return new f(this.q,this.x.square().mod(this.q))},f.prototype.divide=function(e){return new f(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},d.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO))},d.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(l.ZERO)&&!this.y.toBigInteger().equals(l.ZERO)},d.prototype.negate=function(){return new d(this.curve,this.x,this.y.negate(),this.z)},d.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(l.ZERO.equals(r))return l.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new l("3"),n=this.x.toBigInteger(),a=this.y.toBigInteger(),o=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),s=o.multiply(r),c=n.multiply(o),u=t.square().multiply(this.z),f=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(s).multiply(r).mod(this.curve.q),p=c.multiply(i).multiply(t).subtract(a.multiply(s)).subtract(u.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),h=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(p),h)},d.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new l("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),n=i.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),o=t.square().multiply(e);l.ZERO.equals(a)||(o=o.add(this.z.square().multiply(a)));var s=(o=o.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(i).mod(this.curve.q),c=o.multiply(e).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(o.square().multiply(o)).mod(this.curve.q),u=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(c),u)},d.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new l("3")),n=this.negate(),a=this;for(t=i.bitLength()-2;0r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var n=this.curve.getInfinity(),a=this.add(t);0<=i;)n=n.twice(),e.testBit(i)?n=r.testBit(i)?n.add(a):n.add(this):r.testBit(i)&&(n=n.add(t)),--i;return n},n.prototype.getQ=function(){return this.q},n.prototype.getA=function(){return this.a},n.prototype.getB=function(){return this.b},n.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},n.prototype.getInfinity=function(){return this.infinity},n.prototype.fromBigInteger=function(e){return new f(this.q,e)},n.prototype.reduce=function(e){this.reducer.reduce(e)},n.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;t.lengtht+1;){var r=e.shiftRight(t),i=e.subtract(r.shiftLeft(t));this.getR().equals(l.ONE)||(r=r.multiply(this.getR())),e=r.add(i)}for(;0<=e.compareTo(q);)e=e.subtract(q)}else e=e.mod(q);return e},f.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var e=new f(this.q,this.x.modPow(this.q.shiftRight(2).add(l.ONE),this.q));return e.square().equals(this)?e:null}var t=this.q.subtract(l.ONE),r=t.shiftRight(1);if(!this.x.modPow(r,this.q).equals(l.ONE))return null;var i,n,a=t.shiftRight(2).shiftLeft(1).add(l.ONE),o=this.x,s=modDouble(modDouble(o));do{for(var c;0<=(c=new l(this.q.bitLength(),new SecureRandom)).compareTo(this.q)||!c.multiply(c).subtract(s).modPow(r,this.q).equals(t););var u=this.lucasSequence(c,o,a);if(i=u[0],n=u[1],this.modMult(n,n).equals(s))return n.testBit(0)&&(n=n.add(q)),n=n.shiftRight(1),new f(q,n)}while(i.equals(l.ONE)||i.equals(t));return null},f.prototype.lucasSequence=function(e,t,r){for(var i=r.bitLength(),n=r.getLowestSetBit(),a=l.ONE,o=l.TWO,s=e,c=l.ONE,u=l.ONE,f=i-1;n+1<=f;--f)c=this.modMult(c,u),r.testBit(f)?(u=this.modMult(c,t),a=this.modMult(a,s),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1)))):(u=c,a=this.modReduce(a.multiply(o).subtract(c)),s=this.modReduce(s.multiply(o).subtract(e.multiply(c))),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))));c=this.modMult(c,u),u=this.modMult(c,t),a=this.modReduce(a.multiply(o).subtract(c)),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),c=this.modMult(c,u);for(f=1;f<=n;++f)a=this.modMult(a,o),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))),c=this.modMult(c,c);return[a,o]};r={ECCurveFp:n,ECPointFp:d,ECFieldElementFp:f};t.exports=r},{jsbn:325}],252:[function(e,t,r){var o=e("jsbn").BigInteger,s=e("./ec.js").ECCurveFp;function c(e,t,r,i){this.curve=e,this.g=t,this.n=r,this.h=i}function u(e){return new o(e,16)}function i(){var e=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),r=u("E87579C11079F43DD824993C2CEE5ED3"),i=u("FFFFFFFE0000000075A30D1B9038A115"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83"),i,n)}function n(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=o.ZERO,r=u("7"),i=u("0100000000000000000001B8FA16DFAB9ACA16B6B3"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE"),i,n)}function a(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),r=u("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),i=u("0100000000000000000001F4C8F927AED3CA752257"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32"),i,n)}function f(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=o.ZERO,r=u("3"),i=u("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"),i,n)}function p(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),r=u("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),i=u("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811"),i,n)}function h(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),r=u("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),i=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"),i,n)}function l(){var e=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),r=u("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),i=u("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),i,n)}c.prototype.getCurve=function(){return this.curve},c.prototype.getG=function(){return this.g},c.prototype.getN=function(){return this.n},c.prototype.getH=function(){return this.h},t.exports={secp128r1:i,secp160k1:n,secp160r1:a,secp192k1:f,secp192r1:p,secp224r1:h,secp256r1:l}},{"./ec.js":251,jsbn:325}],253:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":268,"./elliptic/curve":256,"./elliptic/curves":259,"./elliptic/ec":260,"./elliptic/eddsa":263,"./elliptic/utils":267,brorand:156}],254:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,j=n.getNAF,E=n.getJSF,p=n.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i,n){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,c=0,u=0;u>1]:S<0&&(x=o[g][-S-1>>1].neg()),y="affine"===x.type?y.mixedAdd(x):y.add(x))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},o.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.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),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],256:[function(e,t,r){arguments[4][130][0].apply(r,arguments)},{"./base":254,"./edwards":255,"./mont":257,"./short":258,dup:130}],257:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base,s=e("../../elliptic").utils;function c(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(c,o),(t.exports=c).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)},a(u,o.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},c.prototype.point=function(e,t){return new u(this,e,t)},c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.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)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},u.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 a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],258:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new w(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)},c.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)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],259:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":253,"./precomputed/secp256k1":266,"hash.js":299}],260:[function(e,t,r){"use strict";var g=e("bn.js"),v=e("hmac-drbg"),a=e("../../elliptic"),l=a.utils.assert,i=e("./key"),b=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(l(a.curves.hasOwnProperty(e),"Unknown curve "+e),e=a.curves[e]),e instanceof a.curves.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}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new v({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new g(2));;){var n=new g(t.generate(r));if(!(0>1;if(0<=o.cmp(this.curve.p.umod(this.curve.n))&&u)throw new Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var f=t.r.invm(n),p=n.sub(a).mul(f).umod(n),h=s.mul(f).umod(n);return this.g.mulAdd(p,o,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new b(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":253,"./key":261,"./signature":262,"bn.js":154,"hmac-drbg":311}],261:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=a).fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},{"../../elliptic":253,"bn.js":154}],262:[function(e,t,r){"use strict";var s=e("bn.js"),c=e("../../elliptic").utils,i=c.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=c.toArray(e,t);var r=new u;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=f(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=f(e,r);if(e.length!==a+r.place)return!1;var o=e.slice(r.place,a+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===o[0]&&128&o[1]&&(o=o.slice(1)),this.r=new s(n),this.s=new s(o),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];p(i,t.length),(i=i.concat(t)).push(2),p(i,r.length);var n=i.concat(r),a=[48];return p(a,n.length),a=a.concat(n),c.encode(a,e)}},{"../../elliptic":253,"bn.js":154}],263:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),a=n.utils,o=a.assert,c=a.parseBytes,s=e("./key"),u=e("./signature");function f(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=f).prototype.sign=function(e,t){e=c(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),a=this.encodePoint(n),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:a})},f.prototype.verify=function(e,t,r){e=c(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(a)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=6.0.0 <7.0.0",_id:"elliptic@6.4.1",_inCache:!0,_installable:!0,_location:"/elliptic",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/elliptic_6.4.1_1533787091502_0.6309761823717674"},_npmUser:{email:"fedor@indutny.com",name:"indutny"},_npmVersion:"6.3.0",_phantomChildren:{},_requested:{name:"elliptic",raw:"elliptic@^6.0.0",rawSpec:"^6.0.0",scope:null,spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/home/administrator/javascript-opentimestamps/node_modules/browserify-sign",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{fileCount:17,integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJba7vUCRA9TVsSAnZWagAA+gcP/jWaj5GmDZ0YFi/X4g5O\nx+pxu9i3HbP9YqywT7rz3XFXSaytu0LQDeDEbddl523X69tsbKfzHRTcnW8n\n2r0VjPhttRm+0RpEhBwjSIK34VkQA1xIWh2ugOToKXVCFVLM5VFDPGzbiN6x\n/hpL7gj1hoCRVmuhjnqFQ+vPKACKfv1Eq4CsRmu2focmP37kQpWQlweD/z4V\nJF4NxA33Fvp13Fl+9g4sPHyhUVsW9ojVaG3Ijn70pCaGQM18UPlbODkWQ1QX\nAgteOFjkIOtcalJk3B3qsM8GZeHEcAFvt2T73miJkHdCGNmRQS45Ede+gnj0\nlLlZJsCCKUHtTqrlprHo6AgMnBZufmytyozYAHC1/JYniazSBi2yPHtQeniR\nl69BfiRBdD2rNrMPwmCNRkMqrgel5WMGpaD0xdaFAHF1Ru2ZQFKsA7KvPGgp\nA20+LN11cCib67Pg5XDyrZ92T3yXec+6gQ3iq9d9UBZKFGl0P8ebVqq1LrUJ\na6nekwMpRISWnKcqV72XVmQdBmUWHq9VfVLsWJzVIJqtpHmUO7q74ACP3i4W\n0/F1REeI0YEhh3NjeStdDecfjlu7PY0pLQpbk2I3ms+6DO+cAfeDEev5jFBK\nwQabRNhITeT1FVtxZAcApj33fnCdqwaWr1NS00K5ZRqhDTTzPr/O4KRN4CR1\npstU\r\n=UVBB\r\n-----END PGP SIGNATURE-----\r\n",shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",unpackedSize:118371},files:["lib"],gitHead:"523da1cf71ddcfd607fbdee1858bc2af47f0e700",homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.1"}},{}],269:[function(e,t,r){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function c(e){return"function"==typeof e}function u(e){return"object"===(void 0===e?"undefined":_typeof(e))&&null!==e}function f(e){return void 0===e}((t.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},i.prototype.emit=function(e){var t,r,i,n,a,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(f(r=this._events[e]))return!1;if(c(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=Array.prototype.slice.call(arguments,1),r.apply(this,n)}else if(u(r))for(n=Array.prototype.slice.call(arguments,1),i=(o=r.slice()).length,a=0;ar&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!c(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,a;if(!c(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||c(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(r)){for(a=n;0=this._blockSize;){for(var n=this._blockOffset;n=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=n.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,a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":310}],310:[function(e,t,r){"use strict";var u=e("minimalistic-assert"),i=e("inherits");function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function o(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}r.inherits=i,r.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:320,"minimalistic-assert":353}],311:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),i=o.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length1e3*t.clockSkew)throw new E("clock skew of "+g/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach(function(e){if(u.params.headers.indexOf(e.toLowerCase())<0)throw new P(e+" was not a signed header")}),t.algorithms&&-1===t.algorithms.indexOf(u.params.algorithm))throw new I(u.params.algorithm+" is not a supported algorithm");return u.algorithm=u.params.algorithm.toUpperCase(),u.keyId=u.params.keyId,u}}},{"./utils":315,"assert-plus":66,util:505}],314:[function(n,a,e){(function(l){var d=n("assert-plus"),m=n("crypto"),e=(n("http"),n("util")),g=n("sshpk"),v=n("jsprim"),t=n("./utils"),b=n("util").format,y=t.HASH_ALGOS,_=t.PK_ALGOS,w=t.InvalidAlgorithmError,r=t.HttpSignatureError,k=t.validateAlgorithm,x='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';function S(e){r.call(this,e,S)}function j(e){r.call(this,e,j)}function i(e){d.object(e,"options");var t=[];if(void 0!==e.algorithm&&(d.string(e.algorithm,"options.algorithm"),t=k(e.algorithm)),this.rs_alg=t,void 0!==e.sign)d.func(e.sign,"options.sign"),this.rs_signFunc=e.sign;else if("hmac"===t[0]&&void 0!==e.key){if(d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,"string"!=typeof e.key&&!l.isBuffer(e.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=m.createHmac(t[1].toUpperCase(),e.key),this.rs_signer.sign=function(){var e=this.digest("base64");return{hashAlgorithm:t[1],toString:function(){return e}}}}else{if(void 0===e.key)throw new TypeError("options.sign (func) or options.key is required");var r=e.key;if(("string"==typeof r||l.isBuffer(r))&&(r=g.parsePrivateKey(r)),d.ok(g.PrivateKey.isPrivateKey(r,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=r,d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,!_[r.type])throw new w(r.type.toUpperCase()+" type keys are not supported");if(void 0!==t[0]&&r.type!==t[0])throw new w("options.key must be a "+t[0].toUpperCase()+" key, was given a "+r.type.toUpperCase()+" key instead");this.rs_signer=r.createSign(t[1])}this.rs_headers=[],this.rs_lines=[]}e.inherits(S,r),e.inherits(j,r),i.prototype.writeHeader=function(e,t){if(d.string(e,"header"),e=e.toLowerCase(),d.string(t,"value"),this.rs_headers.push(e),this.rs_signFunc)this.rs_lines.push(e+": "+t);else{var r=e+": "+t;0>1,f=-7,p=r?n-1:0,h=r?-1:1,l=e[t+p];for(p+=h,a=l&(1<<-f)-1,l>>=-f,f+=s;0>=-f,f+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:a-1,d=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),2<=(t+=1<=o+p?h/c:h*Math.pow(2,1-p))*c&&(o++,c/=2),f<=o+p?(s=0,o=f):1<=o+p?(s=(t*c-1)*Math.pow(2,n),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,n),o=0));8<=n;e[r+l]=255&s,l+=d,s/=256,n-=8);for(o=o<>15;0<=--a;){var c=32767&this[e],u=this[e++]>>15,f=s*c+u*o;n=((c=o*c+((32767&f)<<15)+r[i]+(1073741823&n))>>>30)+(f>>>15)+s*u+(n>>>30),r[i++]=1073741823&c}return n},30):t&&"Netscape"!=navigator.appName?(y.prototype.am=function(e,t,r,i,n,a){for(;0<=--a;){var o=t*this[e++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},26):(y.prototype.am=function(e,t,r,i,n,a){for(var o=16383&t,s=t>>14;0<=--a;){var c=16383&this[e],u=this[e++]>>14,f=s*c+u*o;n=((c=o*c+((16383&f)<<14)+r[i]+n)>>28)+(f>>14)+s*u,r[i++]=268435455&c}return n},28),y.prototype.DB=e,y.prototype.DM=(1<>>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 v(e){this.m=e}function b(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 l(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function d(){}function m(e){return e}function k(e){this.r2=_(),this.q3=_(),y.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},b.prototype.convert=function(e){var t=_();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&0>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),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},b.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.copyTo=function(e){for(var t=this.t-1;0<=t;--t)e[t]=this[t];e.t=this.t,e.s=this.s},y.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0this.DB?(this[this.t-1]|=(o&(1<>this.DB-a):this[this.t-1]|=o<=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,0>n|s,s=(this[r]&a)<=this.t)t.t=0;else{var i=e%this.DB,n=this.DB-i,a=(1<>i;for(var o=r+1;o>i;0>=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:0=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}0>this.F2:0),h=this.FV/p,l=(1<>s)&&(n=!0,a=c(r));0<=o;)s>(s+=this.DB-t)):(r=this[o]>>(s-=t)&i,s<=0&&(s+=this.DB,--o)),02*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=_();return e.copyTo(t),this.reduce(t),t},k.prototype.revert=function(e){return e},k.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);0<=e.compareTo(this.m);)e.subTo(this.m,e)},k.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},k.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x,S,j,E=[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],A=(1<<26)/E[E.length-1];function I(){var e;e=(new Date).getTime(),S[j++]^=255&e,S[j++]^=e>>8&255,S[j++]^=e>>16&255,S[j++]^=e>>24&255,R<=j&&(j-=R)}if(y.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},y.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||36=r&&(this.dMultiply(i),this.dAddOffset(o,0),o=a=0))}0e&&this.subTo(y.ONE.shiftLeft(e-1),this);else{var i=new Array,n=7&e;i.length=1+(e>>3),t.nextBytes(i),0>=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,0=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},y.prototype.multiplyLowerTo=function(e,t,r){var i,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;0>1)>E.length&&(e=E.length);for(var n=_(),a=0;a>24},y.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},y.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},y.prototype.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(0>i)!=(this.s&this.DM)>>i&&(t[n++]=r|this.s<>(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,(0=this.t?0!=this.s:0!=(this[t]&1<>n-c&u:(p=(e[l]&(1<>this.DB+n-c)),s=r;0==(1&p);)p>>=1,--s;if((n-=s)<0&&(n+=this.DB,--l),d)o[p].copyTo(a),d=!1;else{for(;1>>8,S[j++]=255&P;j=0,I()}function B(){if(null==x){for(I(),(x=new F).init(S),j=0;jt.maxItems&&n("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&m.concat(function(e,t,r,i){if("object"==(void 0===t?"undefined":_typeof(t)))for(var n in("object"!=(void 0===e?"undefined":_typeof(e))||e instanceof Array)&&m.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(n)){var a=e[n];if(void 0===a&&h.existingOnly)continue;var o=t[n];void 0===a&&o.default&&(a=e[n]=o.default),h.coerce&&n in e&&(a=e[n]=h.coerce(a,o)),g(a,o,r,n)}for(n in e){if(e.hasOwnProperty(n)&&("_"!=n.charAt(0)||"_"!=n.charAt(1))&&t&&!t[n]&&!1===i){if(h.filter){delete e[n];continue}m.push({property:r,message:(void 0===a?"undefined":_typeof(a))+"The property "+n+" is not defined in the schema and the schema does not allow additional properties"})}var s=t&&t[n]&&t[n].requires;!s||s in e||m.push({property:r,message:"the presence of the property "+n+" requires that "+s+" also be present"}),a=e[n],!i||t&&"object"==(void 0===t?"undefined":_typeof(t))&&n in t||(h.coerce&&(a=e[n]=h.coerce(a,i)),g(a,i,r,n)),!l&&a&&a.$schema&&(m=m.concat(g(a,a.$schema,r,n)))}return m}(e,t.properties,o,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&n("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&n("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.lengthe&&n("must have a minimum value of "+t.minimum),void 0!==_typeof(t.maximum)&&(void 0===e?"undefined":_typeof(e))==_typeof(t.maximum)&&t.maximum= 2"),d.ok(n.base<=36,"options.base <= 36"),d.bool(n.allowSign,"options.allowSign"),d.bool(n.allowPrefix,"options.allowPrefix"),d.bool(n.allowTrailing,"options.allowTrailing"),d.bool(n.allowImprecise,"options.allowImprecise"),d.bool(n.trimWhitespace,"options.trimWhitespace"),d.bool(n.leadingZeroIsOctal,"options.leadingZeroIsOctal"),n.leadingZeroIsOctal&&d.ok(!i,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var a,o=-1,s=n.base,c=1,u=0,f=0,p=e.length;if(n.trimWhitespace)for(;ft[0]||e[0]==t[0]&&e[1]>=t[1],"negative differences not allowed");var r=[e[0]-t[0],0];return e[1]>=t[1]?r[1]=e[1]-t[1]:(r[0]--,r[1]=1e9-(t[1]-e[1])),r}function R(e,t){return C(e),C(t),e[1]+=t[1],1e9<=e[1]&&(e[0]++,e[1]-=1e9),e[0]+=t[0],e}function z(e,t,r){var i,n;if(i={},r)for(n in r)i[n]=r[n];if(e)for(n in e)i[n]=e[n];if(t)for(n in t)i[n]=t[n];return i}},{"assert-plus":66,extsprintf:272,"json-schema":327,util:505,verror:509}],330:[function(e,t,r){"use strict";t.exports=e("./lib/api")(e("./lib/keccak"))},{"./lib/api":331,"./lib/keccak":335}],331:[function(e,t,r){"use strict";var n=e("./keccak"),a=e("./shake");t.exports=function(e){var r=n(e),i=a(e);return function(e,t){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new r(1152,448,null,224,t);case"keccak256":return new r(1088,512,null,256,t);case"keccak384":return new r(832,768,null,384,t);case"keccak512":return new r(576,1024,null,512,t);case"sha3-224":return new r(1152,448,6,224,t);case"sha3-256":return new r(1088,512,6,256,t);case"sha3-384":return new r(832,768,6,384,t);case"sha3-512":return new r(576,1024,6,512,t);case"shake128":return new i(1344,256,31,t);case"shake256":return new i(1088,512,31,t);default:throw new Error("Invald algorithm: "+e)}}}},{"./keccak":332,"./shake":333}],332:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,o=e("stream").Transform,n=e("inherits");t.exports=function(a){function t(e,t,r,i,n){o.call(this,n),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._hashBitLength=i,this._options=n,this._state=new a,this._state.initialize(e,t),this._finalized=!1}return n(t,o),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],333:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("stream").Transform,o=e("inherits");t.exports=function(n){function t(e,t,r,i){a.call(this,i),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._options=i,this._state=new n,this._state.initialize(e,t),this._finalized=!1}return o(t,a),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],334:[function(e,t,r){"use strict";var ot=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];r.p1600=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],n=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],h=f^(n<<1|a>>>31),l=p^(a<<1|n>>>31),d=e[0]^h,m=e[1]^l,g=e[10]^h,v=e[11]^l,b=e[20]^h,y=e[21]^l,_=e[30]^h,w=e[31]^l,k=e[40]^h,x=e[41]^l;h=r^(o<<1|s>>>31),l=i^(s<<1|o>>>31);var S=e[2]^h,j=e[3]^l,E=e[12]^h,A=e[13]^l,I=e[22]^h,P=e[23]^l,O=e[32]^h,T=e[33]^l,B=e[42]^h,C=e[43]^l;h=n^(c<<1|u>>>31),l=a^(u<<1|c>>>31);var F=e[4]^h,R=e[5]^l,z=e[14]^h,M=e[15]^l,N=e[24]^h,D=e[25]^l,q=e[34]^h,L=e[35]^l,U=e[44]^h,H=e[45]^l;h=o^(f<<1|p>>>31),l=s^(p<<1|f>>>31);var K=e[6]^h,V=e[7]^l,G=e[16]^h,$=e[17]^l,W=e[26]^h,Z=e[27]^l,Y=e[36]^h,X=e[37]^l,J=e[46]^h,Q=e[47]^l;h=c^(r<<1|i>>>31),l=u^(i<<1|r>>>31);var ee=e[8]^h,te=e[9]^l,re=e[18]^h,ie=e[19]^l,ne=e[28]^h,ae=e[29]^l,oe=e[38]^h,se=e[39]^l,ce=e[48]^h,ue=e[49]^l,fe=d,pe=m,he=v<<4|g>>>28,le=g<<4|v>>>28,de=b<<3|y>>>29,me=y<<3|b>>>29,ge=w<<9|_>>>23,ve=_<<9|w>>>23,be=k<<18|x>>>14,ye=x<<18|k>>>14,_e=S<<1|j>>>31,we=j<<1|S>>>31,ke=A<<12|E>>>20,xe=E<<12|A>>>20,Se=I<<10|P>>>22,je=P<<10|I>>>22,Ee=T<<13|O>>>19,Ae=O<<13|T>>>19,Ie=B<<2|C>>>30,Pe=C<<2|B>>>30,Oe=R<<30|F>>>2,Te=F<<30|R>>>2,Be=z<<6|M>>>26,Ce=M<<6|z>>>26,Fe=D<<11|N>>>21,Re=N<<11|D>>>21,ze=q<<15|L>>>17,Me=L<<15|q>>>17,Ne=H<<29|U>>>3,De=U<<29|H>>>3,qe=K<<28|V>>>4,Le=V<<28|K>>>4,Ue=$<<23|G>>>9,He=G<<23|$>>>9,Ke=W<<25|Z>>>7,Ve=Z<<25|W>>>7,Ge=Y<<21|X>>>11,$e=X<<21|Y>>>11,We=Q<<24|J>>>8,Ze=J<<24|Q>>>8,Ye=ee<<27|te>>>5,Xe=te<<27|ee>>>5,Je=re<<20|ie>>>12,Qe=ie<<20|re>>>12,et=ae<<7|ne>>>25,tt=ne<<7|ae>>>25,rt=oe<<8|se>>>24,it=se<<8|oe>>>24,nt=ce<<14|ue>>>18,at=ue<<14|ce>>>18;e[0]=fe^~ke&Fe,e[1]=pe^~xe&Re,e[10]=qe^~Je&de,e[11]=Le^~Qe&me,e[20]=_e^~Be&Ke,e[21]=we^~Ce&Ve,e[30]=Ye^~he&Se,e[31]=Xe^~le&je,e[40]=Oe^~Ue&et,e[41]=Te^~He&tt,e[2]=ke^~Fe&Ge,e[3]=xe^~Re&$e,e[12]=Je^~de&Ee,e[13]=Qe^~me&Ae,e[22]=Be^~Ke&rt,e[23]=Ce^~Ve&it,e[32]=he^~Se&ze,e[33]=le^~je&Me,e[42]=Ue^~et&ge,e[43]=He^~tt&ve,e[4]=Fe^~Ge&nt,e[5]=Re^~$e&at,e[14]=de^~Ee&Ne,e[15]=me^~Ae&De,e[24]=Ke^~rt&be,e[25]=Ve^~it&ye,e[34]=Se^~ze&We,e[35]=je^~Me&Ze,e[44]=et^~ge&Ie,e[45]=tt^~ve&Pe,e[6]=Ge^~nt&fe,e[7]=$e^~at&pe,e[16]=Ee^~Ne&qe,e[17]=Ae^~De&Le,e[26]=rt^~be&_e,e[27]=it^~ye&we,e[36]=ze^~We&Ye,e[37]=Me^~Ze&Xe,e[46]=ge^~Ie&Oe,e[47]=ve^~Pe&Te,e[8]=nt^~fe&ke,e[9]=at^~pe&xe,e[18]=Ne^~qe&Je,e[19]=De^~Le&Qe,e[28]=be^~_e&Be,e[29]=ye^~we&Ce,e[38]=We^~Ye&he,e[39]=Ze^~Xe&le,e[48]=Ie^~Oe&Ue,e[49]=Pe^~Te&He,e[0]^=ot[2*t],e[1]^=ot[2*t+1]}}},{}],335:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=e("./keccak-state-unroll");function a(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}a.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},a.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},a.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},t.exports=a},{"./keccak-state-unroll":334,"safe-buffer":447}],336:[function(e,t,r){var i=e("./_root").Symbol;t.exports=i},{"./_root":341}],337:[function(e,t,r){var i=e("./_Symbol"),n=e("./_getRawTag"),a=e("./_objectToString"),o=i?i.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},{"./_Symbol":336,"./_getRawTag":339,"./_objectToString":340}],338:[function(e,r,t){(function(e){var t="object"==(void 0===e?"undefined":_typeof(e))&&e&&e.Object===Object&&e;r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],339:[function(e,t,r){var i=e("./_Symbol"),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,s=i?i.toStringTag:void 0;t.exports=function(e){var t=a.call(e,s),r=e[s];try{var i=!(e[s]=void 0)}catch(e){}var n=o.call(e);return i&&(t?e[s]=r:delete e[s]),n}},{"./_Symbol":336}],340:[function(e,t,r){var i=Object.prototype.toString;t.exports=function(e){return i.call(e)}},{}],341:[function(e,t,r){var i=e("./_freeGlobal"),n="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,a=i||n||Function("return this")();t.exports=a},{"./_freeGlobal":338}],342:[function(e,t,r){var i=Array.isArray;t.exports=i},{}],343:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isObject");t.exports=function(e){if(!n(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},{"./_baseGetTag":337,"./isObject":344}],344:[function(e,t,r){t.exports=function(e){var t=void 0===e?"undefined":_typeof(e);return null!=e&&("object"==t||"function"==t)}},{}],345:[function(e,t,r){t.exports=function(e){return null!=e&&"object"==(void 0===e?"undefined":_typeof(e))}},{}],346:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isArray"),a=e("./isObjectLike");t.exports=function(e){return"string"==typeof e||!n(e)&&a(e)&&"[object String]"==i(e)}},{"./_baseGetTag":337,"./isArray":342,"./isObjectLike":345}],347:[function(e,t,r){t.exports=function(e){return void 0===e}},{}],348:[function(e,t,r){"use strict";var i=e("inherits"),n=e("hash-base"),a=e("safe-buffer").Buffer,o=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,r,i,n,a,o){return c(e+(t&r|~t&i)+n+a|0,o)+t|0}function f(e,t,r,i,n,a,o){return c(e+(t&i|r&~i)+n+a|0,o)+t|0}function p(e,t,r,i,n,a,o){return c(e+(t^r^i)+n+a|0,o)+t|0}function h(e,t,r,i,n,a,o){return c(e+(r^(t|~i))+n+a|0,o)+t|0}i(s,n),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,a=this._d;i=h(i=h(i=h(i=h(i=p(i=p(i=p(i=p(i=f(i=f(i=f(i=f(i=u(i=u(i=u(i=u(i,n=u(n,a=u(a,r=u(r,i,n,a,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),a,r,e[3],3250441966,22),n=u(n,a=u(a,r=u(r,i,n,a,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),a,r,e[7],4249261313,22),n=u(n,a=u(a,r=u(r,i,n,a,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),a,r,e[11],2304563134,22),n=u(n,a=u(a,r=u(r,i,n,a,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),a,r,e[15],1236535329,22),n=f(n,a=f(a,r=f(r,i,n,a,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),a,r,e[0],3921069994,20),n=f(n,a=f(a,r=f(r,i,n,a,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),a,r,e[4],3889429448,20),n=f(n,a=f(a,r=f(r,i,n,a,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),a,r,e[8],1163531501,20),n=f(n,a=f(a,r=f(r,i,n,a,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),a,r,e[12],2368359562,20),n=p(n,a=p(a,r=p(r,i,n,a,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),a,r,e[14],4259657740,23),n=p(n,a=p(a,r=p(r,i,n,a,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),a,r,e[10],3200236656,23),n=p(n,a=p(a,r=p(r,i,n,a,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),a,r,e[6],76029189,23),n=p(n,a=p(a,r=p(r,i,n,a,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),a,r,e[2],3299628645,23),n=h(n,a=h(a,r=h(r,i,n,a,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),a,r,e[5],4237533241,21),n=h(n,a=h(a,r=h(r,i,n,a,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),a,r,e[1],2240044497,21),n=h(n,a=h(a,r=h(r,i,n,a,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),a,r,e[13],1309151649,21),n=h(n,a=h(a,r=h(r,i,n,a,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),a,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+a|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e}},{}],355:[function(e,t,r){(t.exports=o).Minimatch=n;var u={sep:"/"};try{u=e("path")}catch(e){}var z=o.GLOBSTAR=n.GLOBSTAR={},i=e("brace-expansion"),M={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},N="[^/]*?",D="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{});var f=/\/+/;function a(t,r){t=t||{},r=r||{};var i={};return Object.keys(r).forEach(function(e){i[e]=r[e]}),Object.keys(t).forEach(function(e){i[e]=t[e]}),i}function o(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new n(t,r).match(e))}function n(e,t){if(!(this instanceof n))return new n(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==u.sep&&(e=e.split(u.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function s(e,t){if(t||(t=this instanceof n?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:i(e)}o.filter=function(i,n){return n=n||{},function(e,t,r){return o(e,i,n)}},o.defaults=function(i){if(!i||!Object.keys(i).length)return o;var n=o,e=function(e,t,r){return n.minimatch(e,t,a(i,r))};return e.Minimatch=function(e,t){return new n.Minimatch(e,a(i,t))},e},n.defaults=function(e){return e&&Object.keys(e).length?o.defaults(e).Minimatch:n},n.prototype.debug=function(){},n.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(f)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r},n.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=this.options,i=0;if(r.nonegate)return;for(var n=0,a=e.length;n>> no match, partial?",e,p,t,h),p!==o))}if("string"==typeof u?(c=i.nocase?f.toLowerCase()===u.toLowerCase():f===u,this.debug("string match",u,f,c)):(c=f.match(u),this.debug("pattern match",u,f,c)),!c)return!1}if(n===o&&a===s)return!0;if(n===o)return r;if(a===s)return n===o-1&&""===e[n];throw new Error("wtf?")}},{"brace-expansion":155,path:374}],356:[function(e,t,r){var c=e("crypto");function o(e,t,r){return c.createHmac(r,e).update(t).digest("base64")}function s(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function n(e,t){return t>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var n=s,a=i+r;e^=-1;for(var o=i;o>>8^n[255&(e^t[o])];return-1^e}},{}],362:[function(e,t,r){"use strict";var c,h=e("../utils/common"),u=e("./trees"),l=e("./adler32"),d=e("./crc32"),i=e("./messages"),f=0,p=4,m=0,g=-2,v=-1,b=4,n=2,y=8,_=9,a=286,o=30,s=19,w=2*a+1,k=15,x=3,S=258,j=S+x+1,E=42,A=113,I=1,P=2,O=3,T=4;function B(e,t){return e.msg=i[t],t}function C(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(h.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function z(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,R(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function N(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function D(e,t){var r,i,n=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-j?e.strstart-(e.w_size-j):0,u=e.window,f=e.w_mask,p=e.prev,h=e.strstart+S,l=u[a+o-1],d=u[a+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===d&&u[r+o-1]===l&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ac&&0!=--n);return o<=e.lookahead?o:e.lookahead}function q(e){var t,r,i,n,a,o,s,c,u,f,p=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-j)){for(h.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;i=e.head[--t],e.head[t]=p<=i?i-p:0,--r;);for(t=r=p;i=e.prev[--t],e.prev[t]=p<=i?i-p:0,--r;);n+=p}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,c=e.strstart+e.lookahead,u=n,f=void 0,f=o.avail_in,u=x)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(i=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(n=e.strstart+e.lookahead-x,i=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=n&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(q(e),0===e.lookahead&&t===f)return I;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,z(e,!1),0===e.strm.avail_out))return I;if(e.strstart-e.block_start>=e.w_size-j&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):(e.strstart>e.block_start&&(z(e,!1),e.strm.avail_out),I)}),new H(4,4,8,4,L),new H(4,5,16,8,L),new H(4,6,32,32,L),new H(4,4,16,16,U),new H(8,16,32,32,U),new H(8,16,128,128,U),new H(8,32,128,256,U),new H(32,128,258,1024,U),new H(32,258,258,4096,U)],r.deflateInit=function(e,t){return $(e,t,y,15,8,0)},r.deflateInit2=$,r.deflateReset=G,r.deflateResetKeep=V,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,m):g},r.deflate=function(e,t){var r,i,n,a;if(!e||!e.state||5>8&255),M(i,i.gzhead.time>>16&255),M(i,i.gzhead.time>>24&255),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(M(i,255&i.gzhead.extra.length),M(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=d(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(M(i,0),M(i,0),M(i,0),M(i,0),M(i,0),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,3),i.status=A);else{var o=y+(i.w_bits-8<<4)<<8;o|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(o|=32),o+=31-o%31,i.status=A,N(i,o),0!==i.strstart&&(N(i,e.adler>>>16),N(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending!==i.pending_buf_size));)M(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&R(e),i.pending+2<=i.pending_buf_size&&(M(i,255&e.adler),M(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(R(e),0===e.avail_out)return i.last_flush=-1,m}else if(0===e.avail_in&&C(t)<=C(r)&&t!==p)return B(e,-5);if(666===i.status&&0!==e.avail_in)return B(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==f&&666!==i.status){var s=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(q(e),0===e.lookahead)){if(t===f)return I;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):3===i.strategy?function(e,t){for(var r,i,n,a,o=e.window;;){if(e.lookahead<=S){if(q(e),e.lookahead<=S&&t===f)return I;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):c[i.level].func(i,t);if(s!==O&&s!==T||(i.status=666),s===I||s===O)return 0===e.avail_out&&(i.last_flush=-1),m;if(s===P&&(1===t?u._tr_align(i):5!==t&&(u._tr_stored_block(i,0,0,!1),3===t&&(F(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),R(e),0===e.avail_out))return i.last_flush=-1,m}return t!==p?m:i.wrap<=0?1:(2===i.wrap?(M(i,255&e.adler),M(i,e.adler>>8&255),M(i,e.adler>>16&255),M(i,e.adler>>24&255),M(i,255&e.total_in),M(i,e.total_in>>8&255),M(i,e.total_in>>16&255),M(i,e.total_in>>24&255)):(N(i,e.adler>>>16),N(i,65535&e.adler)),R(e),0=r.w_size&&(0===a&&(F(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new h.Buf8(r.w_size),h.arraySet(u,t,f-r.w_size,r.w_size,0),t=u,f=r.w_size),o=e.avail_in,s=e.next_in,c=e.input,e.avail_in=f,e.next_in=0,e.input=t,q(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=_=y>>>24,d-=_,0===(_=y>>>16&255))E[a++]=65535&y;else{if(!(16&_)){if(0==(64&_)){y=m[(65535&y)+(l&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&y,(_&=15)&&(d<_&&(l+=j[i++]<>>=_,d-=_),d<15&&(l+=j[i++]<>>=_=y>>>24,d-=_,!(16&(_=y>>>16&255))){if(0==(64&_)){y=g[(65535&y)+(l&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&y,d<(_&=15)&&(l+=j[i++]<>>=_,d-=_,(_=a-o)>3,l&=(1<<(d-=w<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new P.Buf16(320),this.work=new P.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=N,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new P.Buf32(i),t.distcode=t.distdyn=new P.Buf32(n),t.sane=1,t.back=-1,z):M}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):M}function c(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=a.wsize?(P.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(n=a.wsize-a.wnext)&&(n=i),P.arraySet(a.window,t,r-i,n,a.wnext),(i-=n)?(P.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=T(r.check,A,2,0),f=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(f-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=3;case 3:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>8&255,A[2]=u>>>16&255,A[3]=u>>>24&255,r.check=T(r.check,A,4,0)),f=u=0,r.mode=4;case 4:for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>8),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>>8&255,r.check=T(r.check,A,2,0)),f=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(s<(l=r.length)&&(l=s),l&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),P.arraySet(r.head.extra,i,a,l,k)),512&r.flags&&(r.check=T(r.check,i,l,a)),s-=l,a+=l,r.length-=l),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;for(l=0;k=i[a+l++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&l>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>=7&f,f-=7&f,r.mode=27;break}for(;f<3;){if(0===s)break e;s--,u+=i[a++]<>>=1)){case 0:r.mode=14;break;case 1:if(q(r),r.mode=20,6!==t)break;u>>>=2,f-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,f-=2;break;case 14:for(u>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,u+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,f=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(l=r.length){if(s>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,286>>=3,f-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=C(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=g,f-=g,r.lens[r.have++]=b;else{if(16===b){for(j=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],l=3+(3&u),u>>>=2,f-=2}else if(17===b){for(j=g+3;f>>=g)),u>>>=3,f-=3}else{for(j=g+7;f>>=g)),u>>>=7,f-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;l--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=C(F,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=C(R,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=s&&258<=c){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,r.hold=u,r.bits=f,B(e,h),o=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,u=r.hold,f=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;v=(E=r.lencode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,r.length=b,0===v){r.mode=26;break}if(32&v){r.back=-1,r.mode=12;break}if(64&v){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&v,r.mode=22;case 22:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=(E=r.distcode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&v,r.mode=24;case 24:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===c)break e;if(l=h-c,r.offset>l){if((l=r.offset-l)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d=l>r.wnext?(l-=r.wnext,r.wsize-l):r.wnext-l,l>r.length&&(l=r.length),m=r.window}else m=n,d=o-r.offset,l=r.length;for(cl?(m=B[C+o[y]],I[P+o[y]]):(m=96,0),c=1<>S)+(u-=c)]=d<<24|m<<16|g|0,0!==u;);for(c=1<>=1;if(0!==c?(A&=c-1,A+=c):A=0,y++,0==--O[b]){if(b===w)break;b=t[r+o[y]]}if(k>>7)]}function M(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function N(e,t,r){e.bi_valid>n-r?(e.bi_buf|=t<>n-e.bi_valid,e.bi_valid+=r-n):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function L(e,t,r){var i,n,a=new Array(v+1),o=0;for(i=1;i<=v;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=q(a[s]++,s))}}function U(e){var t;for(t=0;t>1;1<=r;r--)V(e,a,r);for(n=c;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],V(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,a[2*n]=a[2*r]+a[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,a[2*r+1]=a[2*i+1]=n,e.heap[1]=n++,V(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,n,a,o,s,c=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,p=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(a=0;a<=v;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return s;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return u;for(t=32;t>>3,(a=e.static_len+3+7>>>3)<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==t?X(e,t,r,i):4===e.strategy||a===n?(N(e,2+(i?1:0),3),G(e,E,A)):(N(e,4+(i?1:0),3),function(e,t,r,i){var n;for(N(e,t-257,5),N(e,r-1,5),N(e,i-4,4),n=0;n>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(P[r]+p+1)]++,e.dyn_dtree[2*z(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;N(e,2,3),D(e,b,E),16===(t=e).bi_valid?(M(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":358}],368:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],369:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],370:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var a=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=a;var o=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=o;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var f=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=f,r.DSAparam=i.define("DSAparam",function(){this.int()});var p=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=p;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":371,"asn1.js":46}],371:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),a=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(a)}),u=i.define("RDNSequence",function(){this.seqof(c)}),f=i.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),p=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(f),this.key("validity").use(p),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),d=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=d},{"asn1.js":46}],372:[function(e,t,r){(function(h){var l=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,d=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m,m=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,g=e("evp_bytestokey"),v=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(l);if(n){var a="aes"+n[1],o=new h(n[2],"hex"),s=new h(n[3].replace(/[\r\n]/g,""),"base64"),c=g(t,o.slice(0,8),parseInt(n[1],10)).key,u=[],f=v.createDecipheriv(a,c,o);u.push(f.update(s)),u.push(f.final()),r=h.concat(u)}else{var p=i.match(m);r=new h(p[2].replace(/[\r\n]/g,""),"base64")}return{tag:i.match(d)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":160,buffer:191,evp_bytestokey:270}],373:[function(t,r,e){(function(b){var y=t("./asn1"),_=t("./aesid.json"),w=t("./fixProc"),k=t("browserify-aes"),x=t("pbkdf2");function e(e){var t;"object"!==(void 0===e?"undefined":_typeof(e))||b.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new b(e));var r,i,n,a,o,s,c,u,f,p,h,l,d,m=w(e,t),g=m.tag,v=m.data;switch(g){case"CERTIFICATE":i=y.certificate.decode(v,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=y.PublicKey.decode(v,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=y.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"ENCRYPTED PRIVATE KEY":v=y.EncryptedPrivateKey.decode(v,"der"),a=t,o=(n=v).algorithm.decrypt.kde.kdeparams.salt,s=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=_[n.algorithm.decrypt.cipher.algo.join(".")],u=n.algorithm.decrypt.cipher.iv,f=n.subjectPrivateKey,p=parseInt(c.split("-")[1],10)/8,h=x.pbkdf2Sync(a,o,s,p),l=k.createDecipheriv(c,h,u),(d=[]).push(l.update(f)),d.push(l.final()),v=b.concat(d);case"PRIVATE KEY":switch(r=(i=y.PrivateKey.decode(v,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:y.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=y.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"RSA PUBLIC KEY":return y.RSAPublicKey.decode(v,"der");case"RSA PRIVATE KEY":return y.RSAPrivateKey.decode(v,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:y.DSAPrivateKey.decode(v,"der")};case"EC PRIVATE KEY":return{curve:(v=y.ECPrivateKey.decode(v,"der")).parameters.value,privateKey:v.privateKey};default:throw new Error("unknown key type "+g)}}(r.exports=e).signature=y.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":369,"./asn1":370,"./fixProc":372,"browserify-aes":160,buffer:191,pbkdf2:375}],374:[function(e,t,u){(function(n){function a(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function o(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;ia?t=n(t):t.length "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+o+";","var res;","switch (argLength) {",r.concat(["extra"]).map(function(e,t){return"case "+t+":res = fn.call("+["self"].concat(r.slice(0,t)).concat("cb").join(",")+");break;"}).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],n)(a,e)}(e)};var o="function (err, res) {if (err) { rj(err); } else { rs(res); }}";a.nodeify=function(r){return function(){var e=Array.prototype.slice.call(arguments),t="function"==typeof e[e.length-1]?e.pop():null,i=this;try{return r.apply(this,arguments).nodeify(t,i)}catch(r){if(null==t)return new a(function(e,t){t(r)});n(function(){t.call(i,r)})}}},a.prototype.nodeify=function(t,r){if("function"!=typeof t)return this;this.then(function(e){n(function(){t.call(r,null,e)})},function(e){n(function(){t.call(r,e)})})}},{"./core.js":384,asap:44}],390:[function(e,t,r){"use strict";var i=e("./core.js");(t.exports=i).enableSynchronous=function(){i.prototype.isPending=function(){return 0==this.getState()},i.prototype.isFulfilled=function(){return 1==this.getState()},i.prototype.isRejected=function(){return 2==this.getState()},i.prototype.getValue=function(){if(3===this._65)return this._55.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._55},i.prototype.getReason=function(){if(3===this._65)return this._55.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._55},i.prototype.getState=function(){return 3===this._65?this._55.getState():-1===this._65||-2===this._65?0:this._65}},i.disableSynchronous=function(){i.prototype.isPending=void 0,i.prototype.isFulfilled=void 0,i.prototype.isRejected=void 0,i.prototype.getValue=void 0,i.prototype.getReason=void 0,i.prototype.getState=void 0}},{"./core.js":384}],391:[function(e,t,r){"use strict";var n=function(e){for(var t=e.toString(16);4!==t.length;)t="0"+t;return"\\u"+t};t.exports=function(e,t,r,i){return!r.key||61!==t&&58!==t&&t!==r.separator?31o||0<=new u(t).cmp(a.modulus))throw new Error("decryption error");n=r?d(new u(t),a):h(t,a);var s=m.alloc(o-n.length);if(n=m.concat([s,n],o),4===i)return function(e,t){var r=e.modulus.byteLength(),i=l("sha1").update(m.alloc(0)).digest(),n=i.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,n+1),o=t.slice(n+1),s=p(a,f(o,n)),c=p(o,f(s,r-n-1));if(function(e,t){e=m.from(e),t=m.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){a++;break}var o=t.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&a++;o.length<8&&a++;if(a)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}},{"./mgf":401,"./withPublic":404,"./xor":405,"bn.js":154,"browserify-rsa":178,"create-hash":200,"parse-asn1":373,"safe-buffer":447}],403:[function(e,t,r){var o=e("parse-asn1"),h=e("randombytes"),l=e("create-hash"),d=e("./mgf"),m=e("./xor"),g=e("bn.js"),s=e("./withPublic"),c=e("browserify-rsa"),v=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,a=o(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=l("sha1").update(v.alloc(0)).digest(),a=n.length,o=2*a;if(r-o-2>6]+a[128|63&n]:n<55296||57344<=n?r+=a[224|n>>12]+a[128|n>>6&63]+a[128|63&n]:(i+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),r+=a[240|n>>18]+a[128|n>>12&63]+a[128|n>>6&63]+a[128|63&n])}return r},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function i(r,n,a){if(!n)return r;if("object"!==(void 0===n?"undefined":_typeof(n))){if(Array.isArray(r))r.push(n);else{if("object"!==(void 0===r?"undefined":_typeof(r)))return[r,n];(a.plainObjects||a.allowPrototypes||!o.call(Object.prototype,n))&&(r[n]=!0)}return r}if("object"!==(void 0===r?"undefined":_typeof(r)))return[r].concat(n);var e=r;return Array.isArray(r)&&!Array.isArray(n)&&(e=s(r,a)),Array.isArray(r)&&Array.isArray(n)?(n.forEach(function(e,t){o.call(r,t)?r[t]&&"object"===_typeof(r[t])?r[t]=i(r[t],e,a):r.push(e):r[t]=e}),r):Object.keys(n).reduce(function(e,t){var r=n[t];return o.call(e,t)?e[t]=i(e[t],r,a):e[t]=r,e},e)}}},{}],411:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var a=/\+/g;e=e.split(t);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var s,c,u=e.length;0t.highWaterMark&&(t.highWaterMark=(m<=(r=e)?r=m:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(_("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?v.nextTick(x,e):x(e))}function x(e){_("emit readable"),e.emit("readable"),I(e)}function S(e,t){t.readingMore||(t.readingMore=!0,v.nextTick(j,e,t))}function j(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;ea.length?a.length:e;if(o===a.length?n+=a:n+=a.slice(0,e),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=a.slice(o);break}++i}return t.length-=i,n}(e,t):function(e,t){var r=u.allocUnsafe(e),i=t.head,n=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i).data=a.slice(o);break}++n}return t.length-=n,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return _("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):k(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,n=t.needReadable;return _("need readable",n),(0===t.length||t.length-e>>0),a=this.head,o=0;a;)t=a.data,r=n,i=o,t.copy(r,i),o+=a.data.length,a=a.next;return n},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":447,util:157}],423:[function(e,t,r){"use strict";var a=e("process-nextick-args");function o(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a.nextTick(o,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(o,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":381}],424:[function(e,t,r){t.exports=e("events").EventEmitter},{events:269}],425:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":426}],426:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":417,"./lib/_stream_passthrough.js":418,"./lib/_stream_readable.js":419,"./lib/_stream_transform.js":420,"./lib/_stream_writable.js":421}],427:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":426}],428:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":421}],429:[function(e,t,r){"use strict";var s=e("../"),c=e("lodash/isArray"),u=e("lodash/isFunction"),f=e("lodash/isObjectLike");t.exports=function(e){var t="Please verify options";if(!f(e))throw new TypeError(t);if(!u(e.request))throw new TypeError(t+".request");if(!c(e.expose)||0===e.expose.length)throw new TypeError(t+".expose");for(var r=s({PromiseImpl:e.PromiseImpl,constructorMixin:e.constructorMixin}),i=e.request.Request.prototype.init,n=!(e.request.Request.prototype.init=function(e){return!f(e)||this._callback||this._rp_promise||r.init.call(this,e),i.apply(this,arguments)}),a=0;a=t.maxRedirects)return r.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+r.uri.href)),!1;t.redirectsFollowed+=1,o.test(i)||(i=a.resolve(r.uri.href,i));var n=r.uri;return r.uri=a.parse(i),r.uri.protocol!==n.protocol&&delete r.agent,t.redirects.push({statusCode:e.statusCode,redirectUri:i}),t.followAllRedirects&&"HEAD"!==r.method&&401!==e.statusCode&&307!==e.statusCode&&(r.method=t.followOriginalHttpMethod?r.method:"GET"),delete r.src,delete r.req,delete r._started,401!==e.statusCode&&307!==e.statusCode&&(delete r.body,delete r._form,r.headers&&(r.removeHeader("host"),r.removeHeader("content-type"),r.removeHeader("content-length"),r.uri.hostname!==r.originalHost.split(":")[0]&&r.removeHeader("authorization"))),t.removeRefererHeader||r.setHeader("referer",n.href),r.emit("redirect"),r.init(),!0},r.Redirect=i},{url:500}],444:[function(e,t,r){"use strict";var w=e("url"),k=e("tunnel-agent"),i=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],x=["proxy-authorization"];function n(e){this.request=e,this.proxyHeaderWhiteList=i,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}n.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},n.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=w.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,i,n,a,o,s,c=this.proxyHeaderExclusiveList.concat(x),u=this.proxyHeaderWhiteList.concat(c),f=(r=t.headers,i=u.reduce(function(e,t){return e[t.toLowerCase()]=!0,e},{}),Object.keys(r).filter(function(e){return i[e.toLowerCase()]}).reduce(function(e,t){return e[t]=r[t],e},{}));f.host=(n=t.uri,a=n.port,o=n.protocol,s=n.hostname+":",s+=a||("https:"===o?"443":"80")),c.forEach(t.removeHeader,t);var p,h,l,d,m,g,v,b,y=(l=(p=t).uri,d=p.proxy,h=d,m=["https:"===l.protocol?"https":"http","https:"===h.protocol?"Https":"Http"].join("Over"),k[m]),_=(v=f,{proxy:{host:(b=(g=t).proxy).hostname,port:+b.port,proxyAuth:b.auth,headers:v},headers:g.headers,ca:g.ca,cert:g.cert,key:g.key,passphrase:g.passphrase,pfx:g.pfx,ciphers:g.ciphers,rejectUnauthorized:g.rejectUnauthorized,secureOptions:g.secureOptions,secureProtocol:g.secureProtocol});return t.agent=y(_),!0},n.defaultProxyHeaderWhiteList=i,n.defaultProxyHeaderExclusiveList=x,r.Tunnel=n},{"tunnel-agent":497,url:500}],445:[function(U,H,e){(function(e){"use strict";var w=U("http"),k=U("https"),x=U("url"),t=U("util"),n=U("stream"),f=U("zlib"),c=U("aws-sign2"),u=U("aws4"),i=U("http-signature"),S=U("mime-types"),j=U("caseless"),E=U("forever-agent"),r=U("form-data"),a=U("extend"),A=U("isstream"),I=U("is-typedarray").strict,o=U("./lib/helpers"),s=U("./lib/cookies"),P=U("./lib/getProxyFromURI"),p=U("./lib/querystring").Querystring,h=U("./lib/har").Har,l=U("./lib/auth").Auth,d=U("./lib/oauth").OAuth,m=U("./lib/hawk"),g=U("./lib/multipart").Multipart,v=U("./lib/redirect").Redirect,b=U("./lib/tunnel").Tunnel,y=U("performance-now"),O=U("safe-buffer").Buffer,_=o.safeStringify,T=o.isReadStream,B=o.toBase64,C=o.defer,F=o.copy,R=o.version,z=s.jar(),M={};function N(){return{uri:this.uri,method:this.method,headers:this.headers}}function D(){return{statusCode:this.statusCode,body:this.body,headers:this.headers,request:N.call(this.request)}}function q(e){var t=this;e.har&&(t._har=new h(t),e=t._har.options(e)),n.Stream.call(t);var r=Object.keys(q.prototype),i=function(e,t){var r={};for(var i in t)-1===e.indexOf(i)&&(r[i]=t[i]);return r}(r,e);a(t,i),e=function(e,t){var r={};for(var i in t){var n=!(-1===e.indexOf(i)),a="function"==typeof t[i];n&&a||(r[i]=t[i])}return r}(r,e),t.readable=!0,t.writable=!0,e.method&&(t.explicitMethod=!0),t._qs=new p(t),t._auth=new l(t),t._oauth=new d(t),t._multipart=new g(t),t._redirect=new v(t),t._tunnel=new b(t),t.init(e)}function L(){q.debug&&console.error("REQUEST %s",t.format.apply(t,arguments))}t.inherits(q,n.Stream),q.debug=e.env.NODE_DEBUG&&/\brequest\b/.test(e.env.NODE_DEBUG),q.prototype.debug=L,q.prototype.init=function(e){var i=this;for(var t in e||(e={}),i.headers=i.headers?F(i.headers):{},i.headers)void 0===i.headers[t]&&delete i.headers[t];if(j.httpify(i,i.headers),i.method||(i.method=e.method||"GET"),i.localAddress||(i.localAddress=e.localAddress),i._qs.init(e),L(e),i.pool||!1===i.pool||(i.pool=M),i.dests=i.dests||[],i.__isRequestRequest=!0,!i._callback&&i.callback&&(i._callback=i.callback,i.callback=function(){i._callbackCalled||(i._callbackCalled=!0,i._callback.apply(i,arguments))},i.on("error",i.callback.bind()),i.on("complete",i.callback.bind(i,null))),!i.uri&&i.url&&(i.uri=i.url,delete i.url),i.baseUrl){if("string"!=typeof i.baseUrl)return i.emit("error",new Error("options.baseUrl must be a string"));if("string"!=typeof i.uri)return i.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(0===i.uri.indexOf("//")||-1!==i.uri.indexOf("://"))return i.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var r=i.baseUrl.lastIndexOf("/")===i.baseUrl.length-1,n=0===i.uri.indexOf("/");r&&n?i.uri=i.baseUrl+i.uri.slice(1):r||n?i.uri=i.baseUrl+i.uri:""===i.uri?i.uri=i.baseUrl:i.uri=i.baseUrl+"/"+i.uri,delete i.baseUrl}if(!i.uri)return i.emit("error",new Error("options.uri is a required argument"));if("string"==typeof i.uri&&(i.uri=x.parse(i.uri)),i.uri.href||(i.uri.href=x.format(i.uri)),"unix:"===i.uri.protocol)return i.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if("unix"===i.uri.host&&i.enableUnixSocket(),!1===i.strictSSL&&(i.rejectUnauthorized=!1),i.uri.pathname||(i.uri.pathname="/"),!(i.uri.host||i.uri.hostname&&i.uri.port||i.uri.isUnix)){var a='Invalid URI "'+x.format(i.uri)+'"';return 0===Object.keys(e).length&&(a+=". This can be caused by a crappy redirection."),i.abort(),i.emit("error",new Error(a))}if(i.hasOwnProperty("proxy")||(i.proxy=P(i.uri)),i.tunnel=i._tunnel.isEnabled(),i.proxy&&i._tunnel.setup(e),i._redirect.onRequest(e),i.setHost=!1,!i.hasHeader("host")){var o=i.originalHostHeaderName||"host";i.setHeader(o,i.uri.host),i.uri.port&&("80"===i.uri.port&&"http:"===i.uri.protocol||"443"===i.uri.port&&"https:"===i.uri.protocol)&&i.setHeader(o,i.uri.hostname),i.setHost=!0}if(i.jar(i._jar||e.jar),i.uri.port||("http:"===i.uri.protocol?i.uri.port=80:"https:"===i.uri.protocol&&(i.uri.port=443)),i.proxy&&!i.tunnel?(i.port=i.proxy.port,i.host=i.proxy.hostname):(i.port=i.uri.port,i.host=i.uri.hostname),e.form&&i.form(e.form),e.formData){var s=e.formData,c=i.form(),u=function(e,t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?c.append(e,t.value,t.options):c.append(e,t)};for(var f in s)if(s.hasOwnProperty(f)){var p=s[f];if(p instanceof Array)for(var h=0;h>>32-t}function S(e,t,r,i,n,a,o,s){return x(e+(t^r^i)+a+o|0,s)+n|0}function j(e,t,r,i,n,a,o,s){return x(e+(t&r|~t&i)+a+o|0,s)+n|0}function E(e,t,r,i,n,a,o,s){return x(e+((t|~r)^i)+a+o|0,s)+n|0}function A(e,t,r,i,n,a,o,s){return x(e+(t&i|r&~i)+a+o|0,s)+n|0}function I(e,t,r,i,n,a,o,s){return x(e+(t^(r|~i))+a+o|0,s)+n|0}n(o,a),o.prototype._update=function(){for(var e=g,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,a=0|this._d,o=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,f=0|this._d,p=0|this._e,h=0;h<80;h+=1){var l,d;d=h<16?(l=S(r,i,n,a,o,e[v[h]],w[0],y[h]),I(s,c,u,f,p,e[b[h]],k[0],_[h])):h<32?(l=j(r,i,n,a,o,e[v[h]],w[1],y[h]),A(s,c,u,f,p,e[b[h]],k[1],_[h])):h<48?(l=E(r,i,n,a,o,e[v[h]],w[2],y[h]),E(s,c,u,f,p,e[b[h]],k[2],_[h])):h<64?(l=A(r,i,n,a,o,e[v[h]],w[3],y[h]),j(s,c,u,f,p,e[b[h]],k[3],_[h])):(l=I(r,i,n,a,o,e[v[h]],w[4],y[h]),S(s,c,u,f,p,e[b[h]],k[4],_[h])),r=o,o=a,a=x(n,10),n=i,i=l,s=p,p=f,f=x(u,10),u=c,c=d}var m=this._b+n+f|0;this._b=this._c+a+p|0,this._c=this._d+o+s|0,this._d=this._e+r+c|0,this._e=this._a+i+u|0,this._a=m},o.prototype._digest=function(){this._block[this._blockOffset++]=128,56=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 a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":447}],450:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":451,"./sha1":452,"./sha224":453,"./sha256":454,"./sha384":455,"./sha512":456}],451:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,v=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s=this._w,c=0|this._a,u=0|this._b,f=0|this._c,p=0|this._d,h=0|this._e,l=0;l<16;++l)s[l]=e.readInt32BE(4*l);for(;l<80;++l)s[l]=s[l-3]^s[l-8]^s[l-14]^s[l-16];for(var d=0;d<80;++d){var m=~~(d/20),g=0|((o=c)<<5|o>>>27)+(i=u,n=f,a=p,0===(r=m)?i&n|~i&a:2===r?i&n|i&a|n&a:i^n^a)+h+s[d]+v[m];h=p,p=f,f=(t=u)<<30|t>>>2,u=c,c=g}this._a=c+this._a|0,this._b=u+this._b|0,this._c=f+this._c|0,this._d=p+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],452:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0;d<16;++d)c[d]=e.readInt32BE(4*d);for(;d<80;++d)c[d]=(t=c[d-3]^c[d-8]^c[d-14]^c[d-16])<<1|t>>>31;for(var m=0;m<80;++m){var g=~~(m/20),v=0|((s=u)<<5|s>>>27)+(n=f,a=p,o=h,0===(i=g)?n&a|~n&o:2===i?n&a|n&o|a&o:n^a^o)+l+c[m]+b[g];l=h,h=p,p=(r=f)<<30|r>>>2,f=u,u=v}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],453:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}i(c,n),c.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},c.prototype._hash=function(){var e=o.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},t.exports=c},{"./hash":449,"./sha256":454,inherits:320,"safe-buffer":447}],454:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,w=[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],o=new Array(64);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0|this._f,m=0|this._g,g=0|this._h,v=0;v<16;++v)c[v]=e.readInt32BE(4*v);for(;v<64;++v)c[v]=0|(((r=c[v-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+c[v-7]+(((t=c[v-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+c[v-16];for(var b=0;b<64;++b){var y=g+(((s=l)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((o=m)^l&(d^o))+w[b]+c[b]|0,_=0|(((a=u)>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+((i=u)&(n=f)|p&(i|n));g=m,m=d,d=l,l=h+y|0,h=p,p=f,f=u,u=y+_|0}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],455:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(160);function c(){this.init(),this._w=s,a.call(this,128,112)}i(c,n),c.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},c.prototype._hash=function(){var i=o.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=c},{"./hash":449,"./sha512":456,inherits:320,"safe-buffer":447}],456:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,ee=[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],o=new Array(160);function s(){this.init(),this._w=o,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ae(e,t){return e>>>0>>0?1:0}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c,u=this._w,f=0|this._ah,p=0|this._bh,h=0|this._ch,l=0|this._dh,d=0|this._eh,m=0|this._fh,g=0|this._gh,v=0|this._hh,b=0|this._al,y=0|this._bl,_=0|this._cl,w=0|this._dl,k=0|this._el,x=0|this._fl,S=0|this._gl,j=0|this._hl,E=0;E<32;E+=2)u[E]=e.readInt32BE(4*E),u[E+1]=e.readInt32BE(4*E+4);for(;E<160;E+=2){var A=u[E-30],I=u[E-30+1],P=((s=A)>>>1|(c=I)<<31)^(s>>>8|c<<24)^s>>>7,O=((a=I)>>>1|(o=A)<<31)^(a>>>8|o<<24)^(a>>>7|o<<25);A=u[E-4],I=u[E-4+1];var T=((i=A)>>>19|(n=I)<<13)^(n>>>29|i<<3)^i>>>6,B=((t=I)>>>19|(r=A)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),C=u[E-14],F=u[E-14+1],R=u[E-32],z=u[E-32+1],M=O+F|0,N=P+C+ae(M,O)|0;N=(N=N+T+ae(M=M+B|0,B)|0)+R+ae(M=M+z|0,z)|0,u[E]=N,u[E+1]=M}for(var D=0;D<160;D+=2){N=u[D],M=u[D+1];var q=re(f,p,h),L=re(b,y,_),U=ie(f,b),H=ie(b,f),K=ne(d,k),V=ne(k,d),G=ee[D],$=ee[D+1],W=te(d,m,g),Z=te(k,x,S),Y=j+V|0,X=v+K+ae(Y,j)|0;X=(X=(X=X+W+ae(Y=Y+Z|0,Z)|0)+G+ae(Y=Y+$|0,$)|0)+N+ae(Y=Y+M|0,M)|0;var J=H+L|0,Q=U+q+ae(J,H)|0;v=g,j=S,g=m,S=x,m=d,x=k,d=l+X+ae(k=w+Y|0,w)|0,l=h,w=_,h=p,_=y,p=f,y=b,f=X+Q+ae(b=Y+J|0,Y)|0}this._al=this._al+b|0,this._bl=this._bl+y|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+k|0,this._fl=this._fl+x|0,this._gl=this._gl+S|0,this._hl=this._hl+j|0,this._ah=this._ah+f+ae(this._al,b)|0,this._bh=this._bh+p+ae(this._bl,y)|0,this._ch=this._ch+h+ae(this._cl,_)|0,this._dh=this._dh+l+ae(this._dl,w)|0,this._eh=this._eh+d+ae(this._el,k)|0,this._fh=this._fh+m+ae(this._fl,x)|0,this._gh=this._gh+g+ae(this._gl,S)|0,this._hh=this._hh+v+ae(this._hl,j)|0},s.prototype._hash=function(){var i=a.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],457:[function(e,t,r){var i=e("safer-buffer").Buffer,n={dsa:{parts:["p","q","g","y"],sizePart:"p"},rsa:{parts:["e","n"],sizePart:"n"},ecdsa:{parts:["curve","Q"],sizePart:"Q"},ed25519:{parts:["A"],sizePart:"A"}};n.curve25519=n.ed25519;var a={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};a.curve25519=a.ed25519;var o={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:i.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g,""),"hex"),s:i.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g,""),"hex"),n:i.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g,""),"hex"),G:i.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g,""),"hex"),s:i.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g,""),"hex"),n:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g,""),"hex"),G:i.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:i.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g,""),"hex"),a:i.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g,""),"hex"),s:i.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g,""),"hex"),n:i.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g,""),"hex"),G:i.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g,""),"hex")}};t.exports={info:n,privInfo:a,hashAlgs:{md5:!0,sha1:!0,sha256:!0,sha384:!0,sha512:!0},curves:o}},{"safer-buffer":448}],458:[function(e,t,r){t.exports=_;var d=e("assert-plus"),m=e("safer-buffer").Buffer,i=e("./algs"),n=e("crypto"),a=e("./fingerprint"),o=(e("./signature"),e("./errors")),g=(e("util"),e("./utils")),v=e("./key"),b=e("./private-key"),y=e("./identity"),s={};s.openssh=e("./formats/openssh-cert"),s.x509=e("./formats/x509"),s.pem=e("./formats/x509-pem");var c=o.CertificateParseError,u=o.InvalidAlgorithmError;function _(e){d.object(e,"options"),d.arrayOfObject(e.subjects,"options.subjects"),g.assertCompatible(e.subjects[0],y,[1,0],"options.subjects"),g.assertCompatible(e.subjectKey,v,[1,0],"options.subjectKey"),g.assertCompatible(e.issuer,y,[1,0],"options.issuer"),void 0!==e.issuerKey&&g.assertCompatible(e.issuerKey,v,[1,0],"options.issuerKey"),d.object(e.signatures,"options.signatures"),d.buffer(e.serial,"options.serial"),d.date(e.validFrom,"options.validFrom"),d.date(e.validUntil,"optons.validUntil"),d.optionalArrayOfString(e.purposes,"options.purposes"),this._hashCache={},this.subjects=e.subjects,this.issuer=e.issuer,this.subjectKey=e.subjectKey,this.issuerKey=e.issuerKey,this.signatures=e.signatures,this.serial=e.serial,this.validFrom=e.validFrom,this.validUntil=e.validUntil,this.purposes=e.purposes}_.formats=s,_.prototype.toBuffer=function(e,t){return void 0===e&&(e="x509"),d.string(e,"format"),d.object(s[e],"formats[format]"),d.optionalObject(t,"options"),s[e].write(this,t)},_.prototype.toString=function(e,t){return void 0===e&&(e="pem"),this.toBuffer(e,t).toString()},_.prototype.fingerprint=function(e){void 0===e&&(e="sha256"),d.string(e,"algorithm");var t={type:"certificate",hash:this.hash(e),algorithm:e};return new a(t)},_.prototype.hash=function(e){if(d.string(e,"algorithm"),e=e.toLowerCase(),void 0===i.hashAlgs[e])throw new u(e);if(this._hashCache[e])return this._hashCache[e];var t=n.createHash(e).update(this.toBuffer("x509")).digest();return this._hashCache[e]=t},_.prototype.isExpired=function(e){return void 0===e&&(e=new Date),!(e.getTime()>=this.validFrom.getTime()&&e.getTime()e.length||"BEGIN"!==e.slice(t,t+5).toString("ascii"))}(e))return a.read(e,t);if(function(e){var t=0;for(;to.length&&(p=o.length),u+=c.write(o.slice(f,p),u),c[u++]=10,f=p}return u+=c.write("-----END "+i+"-----\n",u),c.slice(0,u)}};var b=e("assert-plus"),y=e("asn1"),_=e("crypto"),w=e("safer-buffer").Buffer,k=(e("../algs"),e("../utils")),h=e("../key"),l=e("../private-key"),x=e("./pkcs1"),S=e("./pkcs8"),j=e("./ssh-private"),E=e("./rfc4253"),A=e("../errors")},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../utils":480,"./pkcs1":467,"./pkcs8":468,"./rfc4253":469,"./ssh-private":470,asn1:65,"assert-plus":66,crypto:204,"safer-buffer":448}],467:[function(e,t,r){t.exports={read:function(e,t){return i.read(e,t,"pkcs1")},readPkcs1:function(e,t,r){switch(e){case"RSA":if("public"===t)return u=y(c=r,"modulus"),f=y(c,"exponent"),new p({type:"rsa",parts:[{name:"e",data:f},{name:"n",data:u}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t[0],0);var r=y(e,"modulus"),i=y(e,"public exponent"),n=y(e,"private exponent"),a=y(e,"prime1"),o=y(e,"prime2"),s=y(e,"exponent1"),c=y(e,"exponent2"),u=y(e,"iqmp");return new v({type:"rsa",parts:[{name:"n",data:r},{name:"e",data:i},{name:"d",data:n},{name:"iqmp",data:u},{name:"p",data:a},{name:"q",data:o},{name:"dmodp",data:s},{name:"dmodq",data:c}]})}(r);throw new Error("Unknown key type: "+t);case"DSA":if("public"===t)return n=y(i=r,"y"),a=y(i,"p"),o=y(i,"q"),s=y(i,"g"),new p({type:"dsa",parts:[{name:"y",data:n},{name:"p",data:a},{name:"q",data:o},{name:"g",data:s}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),0);var r=y(e,"p"),i=y(e,"q"),n=y(e,"g"),a=y(e,"y"),o=y(e,"x");return new v({type:"dsa",parts:[{name:"p",data:r},{name:"q",data:i},{name:"g",data:n},{name:"y",data:a},{name:"x",data:o}]})}(r);throw new Error("Unknown key type: "+t);case"EC":case"ECDSA":if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),1);var r=e.readString(l.Ber.OctetString,!0);e.readSequence(160);var i=b(e);h.string(i,"a known elliptic curve"),e.readSequence(161);var n=e.readString(l.Ber.BitString,!0);n=g.ecNormalize(n);var a={type:"ecdsa",parts:[{name:"curve",data:d.from(i)},{name:"Q",data:n},{name:"d",data:r}]};return new v(a)}(r);if("public"===t)return function(e){e.readSequence();var t=e.readOID();h.strictEqual(t,"1.2.840.10045.2.1","must be ecPublicKey");for(var r,i=e.readOID(),n=Object.keys(m.curves),a=0;aS.length&&(I=S.length),E+=x.write(S.slice(A,I),E),x[E++]=10,A=I}return E+=x.write("-----END "+k+"-----\n",E),x.slice(0,E)}};var O,T=P("assert-plus"),B=(P("asn1"),P("safer-buffer").Buffer),C=(P("../algs"),P("../utils")),F=P("crypto"),R=(P("../key"),P("../private-key")),r=P("./pem"),A=P("./rfc4253"),z=P("../ssh-buffer"),I=P("../errors");var M="openssh-key-v1"},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../ssh-buffer":479,"../utils":480,"./pem":466,"./rfc4253":469,asn1:65,"assert-plus":66,"bcrypt-pbkdf":76,crypto:204,"safer-buffer":448}],471:[function(e,t,r){t.exports={read:function(e,t){"string"!=typeof e&&(h.buffer(e,"buf"),e=e.toString("ascii"));var r=e.trim().replace(/[\\\r]/g,""),i=r.match(m);i||(i=r.match(g));h.ok(i,"key must match regex");var n,a=d.algToKeyType(i[1]),o=l.from(i[2],"base64"),s={};if(i[4])try{n=d.read(o)}catch(e){i=r.match(g),h.ok(i,"key must match regex"),o=l.from(i[2],"base64"),n=d.readInternal(s,"public",o)}else n=d.readInternal(s,"public",o);if(h.strictEqual(a,n.type),i[4]&&0n.length&&(u=n.length),s+=o.write(n.slice(c,u),s),o[s++]=10,c=u}return s+=o.write("-----END "+i+"-----\n",s),o.slice(0,s)}};var o=e("assert-plus"),p=(e("asn1"),e("safer-buffer").Buffer);e("../algs"),e("../utils"),e("../key"),e("../private-key"),e("./pem"),e("../identity"),e("../signature"),e("../certificate")},{"../algs":457,"../certificate":458,"../identity":474,"../key":476,"../private-key":477,"../signature":478,"../utils":480,"./pem":466,"./x509":473,asn1:65,"assert-plus":66,"safer-buffer":448}],473:[function(e,t,r){t.exports={read:function(e,t){"string"==typeof e&&(e=_.from(e,"binary"));b.buffer(e,"buf");var r=new y.BerReader(e);if(r.readSequence(),1=this._buffer.length},a.prototype.remainder=function(){return this._buffer.slice(this._offset)},a.prototype.skip=function(e){this._offset+=e},a.prototype.expand=function(){this._size*=2;var e=n.alloc(this._size);this._buffer.copy(e,0),this._buffer=e},a.prototype.readPart=function(){return{data:this.readBuffer()}},a.prototype.readBuffer=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4,i.ok(this._offset+e<=this._buffer.length,"length out of bounds at +0x"+this._offset.toString(16)+" (data truncated?)");var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t},a.prototype.readString=function(){return this.readBuffer().toString()},a.prototype.readCString=function(){for(var e=this._offset;ethis._size;)this.expand();this._buffer.writeUInt32BE(e.length,this._offset),this._offset+=4,e.copy(this._buffer,this._offset),this._offset+=e.length},a.prototype.writeString=function(e){this.writeBuffer(n.from(e,"utf8"))},a.prototype.writeCString=function(e){for(;this._offset+1+e.length>this._size;)this.expand();this._buffer.write(e,this._offset),this._offset+=e.length,this._buffer[this._offset++]=0},a.prototype.writeInt=function(e){for(;this._offset+4>this._size;)this.expand();this._buffer.writeUInt32BE(e,this._offset),this._offset+=4},a.prototype.writeInt64=function(e){if(i.buffer(e,"value"),8this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=8},a.prototype.writeChar=function(e){for(;this._offset+1>this._size;)this.expand();this._buffer[this._offset++]=e},a.prototype.writePart=function(e){this.writeBuffer(e.data)},a.prototype.write=function(e){for(;this._offset+e.length>this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=e.length}},{"assert-plus":66,"safer-buffer":448}],480:[function(e,t,r){t.exports={bufferSplit:function(e,t){p.buffer(e),p.string(t);for(var r=[],i=0,n=0,a=0;a=t.length){var o=a+1;r.push(e.slice(i,o-n)),i=o,n=0}i<=e.length&&r.push(e.slice(i,e.length));return r},addRSAMissing:function(e){p.object(e),u(e,s,[1,1]);var t,r=new g(e.part.d.data);if(!e.part.dmodp){var i=new g(e.part.p.data),n=r.mod(i.subtract(1));t=_(n),e.part.dmodp={name:"dmodp",data:t},e.parts.push(e.part.dmodp)}if(!e.part.dmodq){var a=new g(e.part.q.data),o=r.mod(a.subtract(1));t=_(o),e.part.dmodq={name:"dmodq",data:t},e.parts.push(e.part.dmodq)}},calculateDSAPublic:function(e,t,r){return p.buffer(e),p.buffer(t),p.buffer(r),e=new g(e),t=new g(t),r=new g(r),_(e.modPow(r,t))},calculateED25519Public:function(e){p.buffer(e);var t=i.sign.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},calculateX25519Public:function(e){p.buffer(e);var t=i.box.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},mpNormalize:y,mpDenormalize:function(e){p.buffer(e);for(;1c)return!1;if(i.constructor.name!==t.name)return!1;var a=i._sshpkApiVersion;void 0===a&&(a=t._oldVersionDetect(e));return!(a[0]!=r[0]||a[1]t;)p.equal(e[0],0),e=e.slice(1);for(;e.length=r[1],i+" must be compatible with "+t.name+" klass version "+r[0]+"."+r[1])}}var v={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}},b=8;function y(e){for(p.buffer(e);1t._pos){var i=r.substr(t._pos);if("x-user-defined"===t._charset){for(var n=new p(i.length),a=0;at._pos&&(t.push(new p(new Uint8Array(o.result.slice(t._pos)))),t._pos=o.result.byteLength)},o.onload=function(){t.push(null)},o.readAsArrayBuffer(r)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":484,_process:382,buffer:191,inherits:320,"readable-stream":426}],487:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=p,t=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1=2.4.3 <2.5.0",_id:"tough-cookie@2.4.3",_inCache:!0,_installable:!0,_location:"/tough-cookie",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/tough-cookie_2.4.3_1529960207843_0.4882910670728131"},_npmUser:{email:"jstash@gmail.com",name:"jstash"},_npmVersion:"6.1.0",_phantomChildren:{},_requested:{name:"tough-cookie",raw:"tough-cookie@~2.4.3",rawSpec:"~2.4.3",scope:null,spec:">=2.4.3 <2.5.0",type:"range"},_requiredBy:["/request","/request-promise"],_resolved:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",_shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",_shrinkwrap:null,_spec:"tough-cookie@~2.4.3",_where:"/home/administrator/javascript-opentimestamps/node_modules/request",author:{email:"jstash@gmail.com",name:"Jeremy Stashewsky"},bugs:{url:"https://github.com/salesforce/tough-cookie/issues"},contributors:[{name:"Alexander Savin"},{name:"Ian Livingstone"},{name:"Ivan Nikulin"},{name:"Lalit Kapoor"},{name:"Sam Thompson"},{name:"Sebastian Mayr"}],dependencies:{psl:"^1.1.24",punycode:"^1.4.1"},description:"RFC6265 Cookies and Cookie Jar for node.js",devDependencies:{async:"^1.4.2",nyc:"^11.6.0","string.prototype.repeat":"^0.2.0",vows:"^0.8.1"},directories:{},dist:{fileCount:9,integrity:"sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMVcQCRA9TVsSAnZWagAAzX0P/2COkbzb3dOX/FTOYIVL\n7oHge7BvGODNkEHTjBtNsR0jO/AA/gVcUOq6CSmFH+UC14LrmCyNDemQvD15\njnYuJXUIiZsSZO7BGGbOFYrQF+DKLiwgf0LokrIM8KasZ5nxc5xS1jYHG5o+\nwCqutfhlRTqlPbZsexB+eRlIuYNvpsbRAdSDYXrhLJNMZgx49g/SZ7IwunGN\nJ/5Fe041MZqqdi7MAavM3T7vX9IvVRJJ3f4xAEVxY1vh4s0dN+h4fG2eMQzL\nOiaulRUIahs4xmJUYHZgZESc9eTIrI8K+YT7i3r35TGc0Du7ueB2KYxBqy7q\n6AUFbdX9Ep308kTVsTf/h4wE0RvdxKLfZ0ww7T1ivADX9xMi2oIvVtyhCQHo\nSIpyBhaav/fTufF0/Fu4Lcr7PMJxyvF0UcNRqrPmEQTw4UZkFKfT8HN2P5cH\nBvJsFwpeEjt84tt5pJ/bmD0j0EUCLUXLGH6fbA84fHpZGifO239zSf262Qdv\nSXeygU7YxnK8wOCnvlauZx/gp+/WTMfMdODxiX0QnqwS5BctiPCgGG1cKJcC\nqvTECaAEmxMVf/gEW73oxVXJgUO7f6jJaWoawV7ka+wR91W9Bp0pKGOOAxAG\nU72rmnwQKid9U7ly5833sb3D+lbzKJXGNIqohegP4daKZfNNTaLWZXmKE+Iy\n7Vml\r\n=8KpS\r\n-----END PGP SIGNATURE-----\r\n",shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",tarball:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",unpackedSize:83959},engines:{node:">=0.8"},files:["lib"],gitHead:"671ad413b38d7464352886772f57a7ec417d4760",homepage:"https://github.com/salesforce/tough-cookie",keywords:["HTTP","RFC2965","RFC6265","cookie","cookiejar","cookies","jar","set-cookie"],license:"BSD-3-Clause",main:"./lib/cookie",maintainers:[{name:"awaterma",email:"awaterma@awaterma.net"},{name:"jstash",email:"jstash@gmail.com"},{name:"maratto",email:"marat+npm@salesforce.com"},{name:"ruoho",email:"clint@ruoho.org"}],name:"tough-cookie",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/salesforce/tough-cookie.git"},scripts:{cover:"nyc --reporter=lcov --reporter=html vows test/*_test.js",test:"vows test/*_test.js"},version:"2.4.3"}},{}],497:[function(s,e,c){(function(u){"use strict";s("net");var f,a=s("tls"),r=s("http"),i=s("https"),e=s("events"),p=s("assert"),t=s("util"),h=s("safe-buffer").Buffer;function o(e){var o=this;o.options=e||{},o.proxyOptions=o.options.proxy||{},o.maxSockets=o.options.maxSockets||r.Agent.defaultMaxSockets,o.requests=[],o.sockets=[],o.on("free",function(e,t,r){for(var i=0,n=o.requests.length;i=this.maxSockets?this.requests.push({host:t.host,port:t.port,request:e}):this.createConnection({host:t.host,port:t.port,request:e})},o.prototype.createConnection=function(e){var n=this;n.createSocket(e,function(t){function r(){n.emit("free",t,e.host,e.port)}function i(e){n.removeSocket(t),t.removeListener("free",r),t.removeListener("close",i),t.removeListener("agentRemove",i)}t.on("free",r),t.on("close",i),t.on("agentRemove",i),e.request.onSocket(t)})},o.prototype.createSocket=function(n,a){var o=this,s={};o.sockets.push(s);var e=l({},o.proxyOptions,{method:"CONNECT",path:n.host+":"+n.port,agent:!1});e.proxyAuth&&(e.headers=e.headers||{},e.headers["Proxy-Authorization"]="Basic "+h.from(e.proxyAuth).toString("base64")),f("making CONNECT request");var c=o.request(e);function i(e,t,r){if(c.removeAllListeners(),t.removeAllListeners(),200===e.statusCode)p.equal(r.length,0),f("tunneling connection has established"),o.sockets[o.sockets.indexOf(s)]=t,a(t);else{f("tunneling socket could not be established, statusCode=%d",e.statusCode);var i=new Error("tunneling socket could not be established, statusCode="+e.statusCode);i.code="ECONNRESET",n.request.emit("error",i),o.removeSocket(s)}}c.useChunkedEncodingByDefault=!1,c.once("response",function(e){e.upgrade=!0}),c.once("upgrade",function(e,t,r){u.nextTick(function(){i(e,t,r)})}),c.once("connect",i),c.once("error",function(e){c.removeAllListeners(),f("tunneling socket could not be established, cause=%s\n",e.message,e.stack);var t=new Error("tunneling socket could not be established, cause="+e.message);t.code="ECONNRESET",n.request.emit("error",t),o.removeSocket(s)}),c.end()},o.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},f=u.env.NODE_DEBUG&&/\btunnel\b/.test(u.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},c.debug=f}).call(this,s("_process"))},{_process:382,assert:67,events:269,http:483,https:317,net:187,"safe-buffer":447,tls:187,util:505}],498:[function(e,t,r){!function(a){"use strict";var m=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function d(e,t,r,i,n){var a,o=0;for(a=0;a>>8)-1}function v(e,t,r,i){return d(e,t,r,i,16)}function b(e,t,r,i){return d(e,t,r,i,32)}function y(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=a,k=o,x=s,S=c,j=u,E=f,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=0;M<20;M+=2)w^=(n=(C^=(n=(P^=(n=(j^=(n=w+C|0)<<7|n>>>25)+w|0)<<9|n>>>23)+j|0)<<13|n>>>19)+P|0)<<18|n>>>14,E^=(n=(k^=(n=(F^=(n=(O^=(n=E+k|0)<<7|n>>>25)+E|0)<<9|n>>>23)+O|0)<<13|n>>>19)+F|0)<<18|n>>>14,T^=(n=(A^=(n=(x^=(n=(R^=(n=T+A|0)<<7|n>>>25)+T|0)<<9|n>>>23)+R|0)<<13|n>>>19)+x|0)<<18|n>>>14,z^=(n=(B^=(n=(I^=(n=(S^=(n=z+B|0)<<7|n>>>25)+z|0)<<9|n>>>23)+S|0)<<13|n>>>19)+I|0)<<18|n>>>14,w^=(n=(S^=(n=(x^=(n=(k^=(n=w+S|0)<<7|n>>>25)+w|0)<<9|n>>>23)+k|0)<<13|n>>>19)+x|0)<<18|n>>>14,E^=(n=(j^=(n=(I^=(n=(A^=(n=E+j|0)<<7|n>>>25)+E|0)<<9|n>>>23)+A|0)<<13|n>>>19)+I|0)<<18|n>>>14,T^=(n=(O^=(n=(P^=(n=(B^=(n=T+O|0)<<7|n>>>25)+T|0)<<9|n>>>23)+B|0)<<13|n>>>19)+P|0)<<18|n>>>14,z^=(n=(R^=(n=(F^=(n=(C^=(n=z+R|0)<<7|n>>>25)+z|0)<<9|n>>>23)+C|0)<<13|n>>>19)+F|0)<<18|n>>>14;w=w+a|0,k=k+o|0,x=x+s|0,S=S+c|0,j=j+u|0,E=E+f|0,A=A+p|0,I=I+h|0,P=P+l|0,O=O+d|0,T=T+m|0,B=B+g|0,C=C+v|0,F=F+b|0,R=R+y|0,z=z+_|0,e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=x>>>0&255,e[9]=x>>>8&255,e[10]=x>>>16&255,e[11]=x>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=j>>>0&255,e[17]=j>>>8&255,e[18]=j>>>16&255,e[19]=j>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=B>>>0&255,e[45]=B>>>8&255,e[46]=B>>>16&255,e[47]=B>>>24&255,e[48]=C>>>0&255,e[49]=C>>>8&255,e[50]=C>>>16&255,e[51]=C>>>24&255,e[52]=F>>>0&255,e[53]=F>>>8&255,e[54]=F>>>16&255,e[55]=F>>>24&255,e[56]=R>>>0&255,e[57]=R>>>8&255,e[58]=R>>>16&255,e[59]=R>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,i)}function _(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=0;w<20;w+=2)a^=(n=(v^=(n=(l^=(n=(u^=(n=a+v|0)<<7|n>>>25)+a|0)<<9|n>>>23)+u|0)<<13|n>>>19)+l|0)<<18|n>>>14,f^=(n=(o^=(n=(b^=(n=(d^=(n=f+o|0)<<7|n>>>25)+f|0)<<9|n>>>23)+d|0)<<13|n>>>19)+b|0)<<18|n>>>14,m^=(n=(p^=(n=(s^=(n=(y^=(n=m+p|0)<<7|n>>>25)+m|0)<<9|n>>>23)+y|0)<<13|n>>>19)+s|0)<<18|n>>>14,_^=(n=(g^=(n=(h^=(n=(c^=(n=_+g|0)<<7|n>>>25)+_|0)<<9|n>>>23)+c|0)<<13|n>>>19)+h|0)<<18|n>>>14,a^=(n=(c^=(n=(s^=(n=(o^=(n=a+c|0)<<7|n>>>25)+a|0)<<9|n>>>23)+o|0)<<13|n>>>19)+s|0)<<18|n>>>14,f^=(n=(u^=(n=(h^=(n=(p^=(n=f+u|0)<<7|n>>>25)+f|0)<<9|n>>>23)+p|0)<<13|n>>>19)+h|0)<<18|n>>>14,m^=(n=(d^=(n=(l^=(n=(g^=(n=m+d|0)<<7|n>>>25)+m|0)<<9|n>>>23)+g|0)<<13|n>>>19)+l|0)<<18|n>>>14,_^=(n=(y^=(n=(b^=(n=(v^=(n=_+y|0)<<7|n>>>25)+_|0)<<9|n>>>23)+v|0)<<13|n>>>19)+b|0)<<18|n>>>14;e[0]=a>>>0&255,e[1]=a>>>8&255,e[2]=a>>>16&255,e[3]=a>>>24&255,e[4]=f>>>0&255,e[5]=f>>>8&255,e[6]=f>>>16&255,e[7]=f>>>24&255,e[8]=m>>>0&255,e[9]=m>>>8&255,e[10]=m>>>16&255,e[11]=m>>>24&255,e[12]=_>>>0&255,e[13]=_>>>8&255,e[14]=_>>>16&255,e[15]=_>>>24&255,e[16]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255}(e,t,r,i)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function k(e,t,r,i,n,a,o){var s,c,u=new Uint8Array(16),f=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=a[c];for(;64<=n;){for(y(f,u,o,w),c=0;c<64;c++)e[t+c]=r[i+c]^f[c];for(s=1,c=8;c<16;c++)s=s+(255&u[c])|0,u[c]=255&s,s>>>=8;n-=64,t+=64,i+=64}if(0>>=8;r-=64,t+=64}if(0>>13|r<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|i<<6),n=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|n<<9),a=255&e[8]|(255&e[9])<<8,this.r[4]=255&(n>>>4|a<<12),this.r[5]=a>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(a>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,r,i,n,a){var o=new E(a);return o.update(r,i,n),o.finish(e,t),0}function I(e,t,r,i,n,a){var o=new Uint8Array(16);return A(o,0,r,i,n,a),v(e,t,o,0)}function P(e,t,r,i,n){var a;if(r<32)return-1;for(j(e,0,t,0,r,i,n),A(e,16,e,32,r-32,e),a=0;a<16;a++)e[a]=0;return 0}function O(e,t,r,i,n){var a,o=new Uint8Array(32);if(r<32)return-1;if(S(o,0,32,i,n),0!==I(t,16,t,32,r-32,o))return-1;for(j(e,0,t,0,r,i,n),a=0;a<32;a++)e[a]=0;return 0}function T(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function C(e,t,r){for(var i,n=~(r-1),a=0;a<16;a++)i=n&(e[a]^t[a]),e[a]^=i,t[a]^=i}function F(e,t){var r,i,n,a=m(),o=m();for(r=0;r<16;r++)o[r]=t[r];for(B(o),B(o),B(o),i=0;i<2;i++){for(a[0]=o[0]-65517,r=1;r<15;r++)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),n=a[15]>>16&1,a[14]&=65535,C(o,a,1-n)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function R(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return F(r,e),F(i,t),b(r,0,i,0)}function z(e){var t=new Uint8Array(32);return F(t,e),1&t[0]}function M(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function N(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function D(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function q(e,t,r){var i,n,a=0,o=0,s=0,c=0,u=0,f=0,p=0,h=0,l=0,d=0,m=0,g=0,v=0,b=0,y=0,_=0,w=0,k=0,x=0,S=0,j=0,E=0,A=0,I=0,P=0,O=0,T=0,B=0,C=0,F=0,R=0,z=r[0],M=r[1],N=r[2],D=r[3],q=r[4],L=r[5],U=r[6],H=r[7],K=r[8],V=r[9],G=r[10],$=r[11],W=r[12],Z=r[13],Y=r[14],X=r[15];a+=(i=t[0])*z,o+=i*M,s+=i*N,c+=i*D,u+=i*q,f+=i*L,p+=i*U,h+=i*H,l+=i*K,d+=i*V,m+=i*G,g+=i*$,v+=i*W,b+=i*Z,y+=i*Y,_+=i*X,o+=(i=t[1])*z,s+=i*M,c+=i*N,u+=i*D,f+=i*q,p+=i*L,h+=i*U,l+=i*H,d+=i*K,m+=i*V,g+=i*G,v+=i*$,b+=i*W,y+=i*Z,_+=i*Y,w+=i*X,s+=(i=t[2])*z,c+=i*M,u+=i*N,f+=i*D,p+=i*q,h+=i*L,l+=i*U,d+=i*H,m+=i*K,g+=i*V,v+=i*G,b+=i*$,y+=i*W,_+=i*Z,w+=i*Y,k+=i*X,c+=(i=t[3])*z,u+=i*M,f+=i*N,p+=i*D,h+=i*q,l+=i*L,d+=i*U,m+=i*H,g+=i*K,v+=i*V,b+=i*G,y+=i*$,_+=i*W,w+=i*Z,k+=i*Y,x+=i*X,u+=(i=t[4])*z,f+=i*M,p+=i*N,h+=i*D,l+=i*q,d+=i*L,m+=i*U,g+=i*H,v+=i*K,b+=i*V,y+=i*G,_+=i*$,w+=i*W,k+=i*Z,x+=i*Y,S+=i*X,f+=(i=t[5])*z,p+=i*M,h+=i*N,l+=i*D,d+=i*q,m+=i*L,g+=i*U,v+=i*H,b+=i*K,y+=i*V,_+=i*G,w+=i*$,k+=i*W,x+=i*Z,S+=i*Y,j+=i*X,p+=(i=t[6])*z,h+=i*M,l+=i*N,d+=i*D,m+=i*q,g+=i*L,v+=i*U,b+=i*H,y+=i*K,_+=i*V,w+=i*G,k+=i*$,x+=i*W,S+=i*Z,j+=i*Y,E+=i*X,h+=(i=t[7])*z,l+=i*M,d+=i*N,m+=i*D,g+=i*q,v+=i*L,b+=i*U,y+=i*H,_+=i*K,w+=i*V,k+=i*G,x+=i*$,S+=i*W,j+=i*Z,E+=i*Y,A+=i*X,l+=(i=t[8])*z,d+=i*M,m+=i*N,g+=i*D,v+=i*q,b+=i*L,y+=i*U,_+=i*H,w+=i*K,k+=i*V,x+=i*G,S+=i*$,j+=i*W,E+=i*Z,A+=i*Y,I+=i*X,d+=(i=t[9])*z,m+=i*M,g+=i*N,v+=i*D,b+=i*q,y+=i*L,_+=i*U,w+=i*H,k+=i*K,x+=i*V,S+=i*G,j+=i*$,E+=i*W,A+=i*Z,I+=i*Y,P+=i*X,m+=(i=t[10])*z,g+=i*M,v+=i*N,b+=i*D,y+=i*q,_+=i*L,w+=i*U,k+=i*H,x+=i*K,S+=i*V,j+=i*G,E+=i*$,A+=i*W,I+=i*Z,P+=i*Y,O+=i*X,g+=(i=t[11])*z,v+=i*M,b+=i*N,y+=i*D,_+=i*q,w+=i*L,k+=i*U,x+=i*H,S+=i*K,j+=i*V,E+=i*G,A+=i*$,I+=i*W,P+=i*Z,O+=i*Y,T+=i*X,v+=(i=t[12])*z,b+=i*M,y+=i*N,_+=i*D,w+=i*q,k+=i*L,x+=i*U,S+=i*H,j+=i*K,E+=i*V,A+=i*G,I+=i*$,P+=i*W,O+=i*Z,T+=i*Y,B+=i*X,b+=(i=t[13])*z,y+=i*M,_+=i*N,w+=i*D,k+=i*q,x+=i*L,S+=i*U,j+=i*H,E+=i*K,A+=i*V,I+=i*G,P+=i*$,O+=i*W,T+=i*Z,B+=i*Y,C+=i*X,y+=(i=t[14])*z,_+=i*M,w+=i*N,k+=i*D,x+=i*q,S+=i*L,j+=i*U,E+=i*H,A+=i*K,I+=i*V,P+=i*G,O+=i*$,T+=i*W,B+=i*Z,C+=i*Y,F+=i*X,_+=(i=t[15])*z,o+=38*(k+=i*N),s+=38*(x+=i*D),c+=38*(S+=i*q),u+=38*(j+=i*L),f+=38*(E+=i*U),p+=38*(A+=i*H),h+=38*(I+=i*K),l+=38*(P+=i*V),d+=38*(O+=i*G),m+=38*(T+=i*$),g+=38*(B+=i*W),v+=38*(C+=i*Z),b+=38*(F+=i*Y),y+=38*(R+=i*X),a=(i=(a+=38*(w+=i*M))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a=(i=(a+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a+=n-1+37*(n-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=h,e[8]=l,e[9]=d,e[10]=m,e[11]=g,e[12]=v,e[13]=b,e[14]=y,e[15]=_}function L(e,t){q(e,t,t)}function U(e,t){var r,i=m();for(r=0;r<16;r++)i[r]=t[r];for(r=253;0<=r;r--)L(i,i),2!==r&&4!==r&&q(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function H(e,t,r){var i,n,a=new Uint8Array(32),o=new Float64Array(80),s=m(),c=m(),u=m(),f=m(),p=m(),h=m();for(n=0;n<31;n++)a[n]=t[n];for(a[31]=127&t[31]|64,a[0]&=248,M(o,r),n=0;n<16;n++)c[n]=o[n],f[n]=s[n]=u[n]=0;for(s[0]=f[0]=1,n=254;0<=n;--n)C(s,c,i=a[n>>>3]>>>(7&n)&1),C(u,f,i),N(p,s,u),D(s,s,u),N(u,c,f),D(c,c,f),L(f,p),L(h,s),q(s,u,s),q(u,c,p),N(p,s,u),D(s,s,u),L(c,s),D(u,f,h),q(s,u,g),N(s,s,f),q(u,u,s),q(s,f,h),q(f,c,o),L(c,p),C(s,c,i),C(u,f,i);for(n=0;n<16;n++)o[n+16]=s[n],o[n+32]=u[n],o[n+48]=c[n],o[n+64]=f[n];var l=o.subarray(32),d=o.subarray(16);return U(l,l),q(d,d,l),F(e,d),0}function K(e,t){return H(e,t,r)}function V(e,t){return o(t,32),K(e,t)}function G(e,t,r){var i=new Uint8Array(32);return H(i,r,t),_(e,n,i,w)}E.prototype.blocks=function(e,t,r){for(var i,n,a,o,s,c,u,f,p,h,l,d,m,g,v,b,y,_,w,k=this.fin?0:2048,x=this.h[0],S=this.h[1],j=this.h[2],E=this.h[3],A=this.h[4],I=this.h[5],P=this.h[6],O=this.h[7],T=this.h[8],B=this.h[9],C=this.r[0],F=this.r[1],R=this.r[2],z=this.r[3],M=this.r[4],N=this.r[5],D=this.r[6],q=this.r[7],L=this.r[8],U=this.r[9];16<=r;)h=p=0,h+=(x+=8191&(i=255&e[t+0]|(255&e[t+1])<<8))*C,h+=(S+=8191&(i>>>13|(n=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*U),h+=(j+=8191&(n>>>10|(a=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*L),h+=(E+=8191&(a>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*q),p=(h+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*D))>>>13,h&=8191,h+=(I+=s>>>1&8191)*(5*N),h+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*M),h+=(O+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),h+=(T+=8191&(u>>>8|(f=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*R),l=p+=(h+=(B+=f>>>5|k)*(5*F))>>>13,l+=x*F,l+=S*C,l+=j*(5*U),l+=E*(5*L),p=(l+=A*(5*q))>>>13,l&=8191,l+=I*(5*D),l+=P*(5*N),l+=O*(5*M),l+=T*(5*z),p+=(l+=B*(5*R))>>>13,l&=8191,d=p,d+=x*R,d+=S*F,d+=j*C,d+=E*(5*U),p=(d+=A*(5*L))>>>13,d&=8191,d+=I*(5*q),d+=P*(5*D),d+=O*(5*N),d+=T*(5*M),m=p+=(d+=B*(5*z))>>>13,m+=x*z,m+=S*R,m+=j*F,m+=E*C,p=(m+=A*(5*U))>>>13,m&=8191,m+=I*(5*L),m+=P*(5*q),m+=O*(5*D),m+=T*(5*N),g=p+=(m+=B*(5*M))>>>13,g+=x*M,g+=S*z,g+=j*R,g+=E*F,p=(g+=A*C)>>>13,g&=8191,g+=I*(5*U),g+=P*(5*L),g+=O*(5*q),g+=T*(5*D),v=p+=(g+=B*(5*N))>>>13,v+=x*N,v+=S*M,v+=j*z,v+=E*R,p=(v+=A*F)>>>13,v&=8191,v+=I*C,v+=P*(5*U),v+=O*(5*L),v+=T*(5*q),b=p+=(v+=B*(5*D))>>>13,b+=x*D,b+=S*N,b+=j*M,b+=E*z,p=(b+=A*R)>>>13,b&=8191,b+=I*F,b+=P*C,b+=O*(5*U),b+=T*(5*L),y=p+=(b+=B*(5*q))>>>13,y+=x*q,y+=S*D,y+=j*N,y+=E*M,p=(y+=A*z)>>>13,y&=8191,y+=I*R,y+=P*F,y+=O*C,y+=T*(5*U),_=p+=(y+=B*(5*L))>>>13,_+=x*L,_+=S*q,_+=j*D,_+=E*N,p=(_+=A*M)>>>13,_&=8191,_+=I*z,_+=P*R,_+=O*F,_+=T*C,w=p+=(_+=B*(5*U))>>>13,w+=x*U,w+=S*L,w+=j*q,w+=E*D,p=(w+=A*N)>>>13,w&=8191,w+=I*M,w+=P*z,w+=O*R,w+=T*F,x=h=8191&(p=(p=((p+=(w+=B*C)>>>13)<<2)+p|0)+(h&=8191)|0),S=l+=p>>>=13,j=d&=8191,E=m&=8191,A=g&=8191,I=v&=8191,P=b&=8191,O=y&=8191,T=_&=8191,B=w&=8191,t+=16,r-=16;this.h[0]=x,this.h[1]=S,this.h[2]=j,this.h[3]=E,this.h[4]=A,this.h[5]=I,this.h[6]=P,this.h[7]=O,this.h[8]=T,this.h[9]=B},E.prototype.finish=function(e,t){var r,i,n,a,o=new Uint16Array(10);if(this.leftover){for(a=this.leftover,this.buffer[a++]=1;a<16;a++)this.buffer[a]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=r,r=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this.h[a]+r,r=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,i=(1^r)-1,a=0;a<10;a++)o[a]&=i;for(i=~i,a=0;a<10;a++)this.h[a]=this.h[a]&i|o[a];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,a=1;a<8;a++)n=(this.h[a]+this.pad[a]|0)+(n>>>16)|0,this.h[a]=65535&n;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var i,n;if(this.leftover){for(r<(n=16-this.leftover)&&(n=r),i=0;i>>16,I=65535&(S=D),P=S>>>16,E+=65535&(j=((g=K)>>>14|(c=z)<<18)^(K>>>18|z<<14)^(z>>>9|K<<23)),A+=j>>>16,I+=65535&(S=(z>>>14|K<<18)^(z>>>18|K<<14)^(K>>>9|z<<23)),P+=S>>>16,E+=65535&(j=K&(v=V)^~K&(b=G)),A+=j>>>16,I+=65535&(S=z&(u=M)^~z&(f=N)),P+=S>>>16,S=Z[2*k],E+=65535&(j=Z[2*k+1]),A+=j>>>16,I+=65535&S,P+=S>>>16,S=O[k%16],A+=(j=T[k%16])>>>16,I+=65535&S,P+=S>>>16,I+=(A+=(E+=65535&j)>>>16)>>>16,E=65535&(j=w=65535&E|A<<16),A=j>>>16,I=65535&(S=_=65535&I|(P+=I>>>16)<<16),P=S>>>16,E+=65535&(j=(q>>>28|B<<4)^(B>>>2|q<<30)^(B>>>7|q<<25)),A+=j>>>16,I+=65535&(S=(B>>>28|q<<4)^(q>>>2|B<<30)^(q>>>7|B<<25)),P+=S>>>16,A+=(j=q&L^q&U^L&U)>>>16,I+=65535&(S=B&C^B&F^C&F),P+=S>>>16,p=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,y=65535&E|A<<16,E=65535&(j=m),A=j>>>16,I=65535&(S=s),P=S>>>16,A+=(j=w)>>>16,I+=65535&(S=_),P+=S>>>16,C=n,F=a,R=o,z=s=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,M=c,N=u,D=f,B=p,L=h,U=l,H=d,K=m=65535&E|A<<16,V=g,G=v,$=b,q=y,k%16==15)for(x=0;x<16;x++)S=O[x],E=65535&(j=T[x]),A=j>>>16,I=65535&S,P=S>>>16,S=O[(x+9)%16],E+=65535&(j=T[(x+9)%16]),A+=j>>>16,I+=65535&S,P+=S>>>16,_=O[(x+1)%16],E+=65535&(j=((w=T[(x+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),A+=j>>>16,I+=65535&(S=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),P+=S>>>16,_=O[(x+14)%16],A+=(j=((w=T[(x+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,I+=65535&(S=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,O[x]=65535&I|P<<16,T[x]=65535&E|A<<16;E=65535&(j=q),A=j>>>16,I=65535&(S=B),P=S>>>16,S=e[0],A+=(j=t[0])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[0]=B=65535&I|P<<16,t[0]=q=65535&E|A<<16,E=65535&(j=L),A=j>>>16,I=65535&(S=C),P=S>>>16,S=e[1],A+=(j=t[1])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[1]=C=65535&I|P<<16,t[1]=L=65535&E|A<<16,E=65535&(j=U),A=j>>>16,I=65535&(S=F),P=S>>>16,S=e[2],A+=(j=t[2])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[2]=F=65535&I|P<<16,t[2]=U=65535&E|A<<16,E=65535&(j=H),A=j>>>16,I=65535&(S=R),P=S>>>16,S=e[3],A+=(j=t[3])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[3]=R=65535&I|P<<16,t[3]=H=65535&E|A<<16,E=65535&(j=K),A=j>>>16,I=65535&(S=z),P=S>>>16,S=e[4],A+=(j=t[4])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[4]=z=65535&I|P<<16,t[4]=K=65535&E|A<<16,E=65535&(j=V),A=j>>>16,I=65535&(S=M),P=S>>>16,S=e[5],A+=(j=t[5])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[5]=M=65535&I|P<<16,t[5]=V=65535&E|A<<16,E=65535&(j=G),A=j>>>16,I=65535&(S=N),P=S>>>16,S=e[6],A+=(j=t[6])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[6]=N=65535&I|P<<16,t[6]=G=65535&E|A<<16,E=65535&(j=$),A=j>>>16,I=65535&(S=D),P=S>>>16,S=e[7],A+=(j=t[7])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[7]=D=65535&I|P<<16,t[7]=$=65535&E|A<<16,W+=128,i-=128}return i}function X(e,t,r){var i,n=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,Y(n,a,t,r),r%=128,i=0;i>(7&n)&1),J(t,e),J(e,e),Q(e,t,i)}function re(e,t){var r=[m(),m(),m(),m()];T(r[0],i),T(r[1],s),T(r[2],f),q(r[3],i,s),te(e,r,t)}function ie(e,t,r){var i,n=new Uint8Array(64),a=[m(),m(),m(),m()];for(r||o(t,32),X(n,t,32),n[0]&=248,n[31]&=127,n[31]|=64,re(a,n),ee(e,a),i=0;i<32;i++)t[i+32]=e[i];return 0}var ne=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var r,i,n,a;for(i=63;32<=i;--i){for(r=0,n=i-32,a=i-12;n>8,t[n]-=256*r;t[n]+=r,t[i]=0}for(n=r=0;n<32;n++)t[n]+=r-(t[31]>>4)*ne[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*ne[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function oe(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function se(e,t,r,i){var n,a,o=new Uint8Array(64),s=new Uint8Array(64),c=new Uint8Array(64),u=new Float64Array(64),f=[m(),m(),m(),m()];X(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var p=r+64;for(n=0;n>7&&D(e[0],u,e[0]),q(e[3],e[0],e[1]),0)}function ue(e,t,r,i){var n,a=new Uint8Array(32),o=new Uint8Array(64),s=[m(),m(),m(),m()],c=[m(),m(),m(),m()];if(-1,r<64)return-1;if(ce(c,i))return-1;for(n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,M=String.fromCharCode;function N(e){throw new RangeError(o[e])}function s(e,t){var r=e.split("@"),i="";return 1>1,e+=z(e/t);455z((C-n)/p))&&N("overflow"),n+=l*p;var d=h<=o?1:o+26<=h?26:h-o;if(lz(C/m)&&N("overflow"),p*=m}var g=r.length+1;o=L(n-f,g,0==f),z(n/g)>C-a&&N("overflow"),a+=z(n/g),n%=g,r.splice(n++,0,a)}return String.fromCodePoint.apply(String,r)},u=function(e){var t=[],r=(e=D(e)).length,i=128,n=0,a=72,o=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(o=(u=f.next()).done);o=!0){var p=u.value;p<128&&t.push(M(p))}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}var h=t.length,l=h;for(h&&t.push("-");lz((C-n)/w)&&N("overflow"),n+=(d-i)*w,i=d;var k=!0,x=!1,S=void 0;try{for(var j,E=e[Symbol.iterator]();!(k=(j=E.next()).done);k=!0){var A=j.value;if(AC&&N("overflow"),A==i){for(var I=n,P=36;;P+=36){var O=P<=a?1:a+26<=P?26:P-a;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function l(e){for(var t="",r=0,i=e.length;rA-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(V,"g"),Y=new RegExp($,"g"),X=new RegExp(F("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',W),"g"),J=new RegExp(F("[^]",V,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),Q=J;function ee(e){var t=l(e);return t.match(Z)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,a={},o=r.query.split("&"),s=0,c=o.length;s",'"',"`"," ","\r","\n","\t"]),M=["'"].concat(n),N=["%","/","?",";","#"].concat(M),D=["/","?","#"],q=/^[+a-z0-9A-Z_-]{0,63}$/,L=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,U={javascript:!0,"javascript:":!0},H={javascript:!0,"javascript:":!0},K={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},V=e("querystring");function a(e,t,r){if(e&&F.isObject(e)&&e instanceof A)return e;var i=new A;return i.parse(e,t,r),i}A.prototype.parse=function(e,t,r){if(!F.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===e?"undefined":_typeof(e)));var i=e.indexOf("?"),n=-1!==i&&i>t&63|128)}function p(e){if(0==(4294967168&e))return s(e);var t="";return 0==(4294965248&e)?t=s(e>>6&31|192):0==(4294901760&e)?(u(e),t=s(e>>12&15|224),t+=f(e,6)):0==(4292870144&e)&&(t=s(e>>18&7|240),t+=f(e,12),t+=f(e,6)),t+=s(63&e|128)}function h(){if(a<=o)throw Error("Invalid byte index");var e=255&n[o];if(o++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,t;if(a>>10&1023|55296),t=56320|1023&t),n+=s(t);return n}(r)}};if("function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define(function(){return d});else if(t&&!t.nodeType)if(r)r.exports=d;else{var m={}.hasOwnProperty;for(var g in d)m.call(d,g)&&(t[g]=d[g])}else e.utf8=d}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],503:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],504:[function(e,t,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],505:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{"./support/isBuffer":504,_process:382,dup:70,inherits:320}],506:[function(e,t,r){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},{}],507:[function(e,t,r){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var n=new Uint8Array(16);t.exports=function(){return i(n),n}}else{var a=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}},{}],508:[function(e,t,r){var o=e("./lib/rng"),s=e("./lib/bytesToUuid");t.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var a=0;a<16;++a)t[i+a]=n[a];return t||s(n)}},{"./lib/bytesToUuid":506,"./lib/rng":507}],509:[function(e,t,r){var s=e("assert-plus"),i=e("util"),n=e("extsprintf"),c=e("core-util-is").isError,a=n.sprintf;function u(e){var t,r,i,n;if(s.object(e,"args"),s.bool(e.strict,"args.strict"),s.array(e.argv,"args.argv"),0===(t=e.argv).length)r={},i=[];else if(c(t[0]))r={cause:t[0]},i=t.slice(1);else if("object"===_typeof(t[0])){for(n in r={},t[0])r[n]=t[0][n];i=t.slice(1)}else s.string(t[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},i=t;return s.object(r),r.strict||e.strict||(i=i.map(function(e){return null===e?"null":void 0===e?"undefined":e})),{options:r,shortmessage:0===i.length?"":a.apply(null,i)}}function f(){var e,t,r,i,n,a,o;if(e=Array.prototype.slice.call(arguments,0),!(this instanceof f))return t=Object.create(f.prototype),f.apply(t,arguments),t;if((r=u({argv:e,strict:!1})).options.name&&(s.string(r.options.name,'error\'s "name" must be a string'),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,a=r.shortmessage,(i=r.options.cause)&&(s.ok(c(i),"cause is not an Error"),this.jse_cause=i,r.options.skipCauseMessage||(a+=": "+i.message)),this.jse_info={},r.options.info)for(o in r.options.info)this.jse_info[o]=r.options.info[o];return this.message=a,Error.call(this,a),Error.captureStackTrace&&(n=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,n)),this}function o(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof o?(i=(r=u({argv:e,strict:!0})).options,f.call(this,i,"%s",r.shortmessage),this):(t=Object.create(o.prototype),o.apply(t,arguments),t)}function p(e){s.array(e,"list of errors"),s.ok(0this._inputTypes.length&&!n.isObject(e[e.length-1]))return a.inputDefaultBlockNumberFormatter(e.pop())},s.prototype.toPayload=function(e){var t={};return e.length>this._inputTypes.length&&n.isObject(e[e.length-1])&&(t=e[e.length-1]),t.to=this._address,t.data="0x"+this.signature()+i.encodeParams(this._inputTypes,e),t},s.prototype.signature=function(){return o(this._name).slice(0,8)},s.prototype.unpackOutput=function(e){if(e){e=2<=e.length?e.slice(2):e;var t=i.decodeParams(this._outputTypes,e);return 1===t.length?t[0]:t}},s.prototype.call=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),i=this.extractCallback(e),t=this.extractDefaultBlock(e),r=this.toPayload(e);if(!i){var n=this._eth.call(r,t);return this.unpackOutput(n)}var a=this;this._eth.call(r,t,function(t,e){if(t)return i(t,null);var r=null;try{r=a.unpackOutput(e)}catch(e){t=e}i(t,r)})},s.prototype.sendTransaction=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),t=this.extractCallback(e),r=this.toPayload(e);if(0=this.buffer.length)){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,t}}},{key:"read",value:function(e){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,Array.from(t)}},{key:"readBool",value:function(){var e=this.read(1)[0];if(255===e)return!0;if(0===e)return!1;throw new n("read_bool() expected 0xff or 0x00; got +"+e)}},{key:"readVaruint",value:function(){for(var e=0,t=0,r=void 0;e|=(127&(r=this.read(1)[0]))< "+e);if(r>=7}}},{key:"writeByte",value:function(e){if(this.length>=this.buffer.length){var t=2*this.length,r=new Uint8Array(t);r.set(this.buffer,0),this.buffer=r}isNaN(e)?this.buffer[this.length]=e.codePointAt():this.buffer[this.length]=e,this.length++}},{key:"writeBytes",value:function(e){var t=this;e.forEach(function(e){t.writeByte(e)})}},{key:"writeVarbytes",value:function(e){this.writeVaruint(e.length),this.writeBytes(e)}},{key:"toString",value:function(){return this.buffer.toHex(0)}}]),e}();m.exports={StreamDeserialization:h,StreamSerialization:l,DeserializationError:n,BadMagicError:a,UnsupportedMajorVersion:o,TruncationError:s,TrailingGarbageError:c,RecursionLimitError:u,SerializerTypeError:f,SerializerValueError:p,ValueError:e,TypeError:t}}).call(this,d("buffer").Buffer)},{"./extend-error.js":568,"./utils.js":575,buffer:191}],567:[function(e,t,r){"use strict";var s=e("./ops.js"),c=e("./timestamp.js"),i=e("./utils.js"),u=e("./context.js"),f=[0,79,112,101,110,84,105,109,101,115,116,97,109,112,115,0,0,80,114,111,111,102,0,191,137,226,232,132,232,146,148],n=function(){function o(e,t){if(_classCallCheck2(this,o),!(e instanceof s.Op&&t instanceof c))throw new u.ValueError("Invalid Timestamp or fileHashOp");if(t.msg.length!==e._DIGEST_LENGTH())throw new u.ValueError("Timestamp message length and fileHashOp digest length differ");this.fileHashOp=e,this.timestamp=t}return _createClass(o,[{key:"fileDigest",value:function(){return this.timestamp.msg}},{key:"serialize",value:function(e){e.writeBytes(f),e.writeVaruint(1),this.fileHashOp.serialize(e),e.writeBytes(this.timestamp.msg),this.timestamp.serialize(e)}},{key:"serializeToBytes",value:function(){var e=new u.StreamSerialization;return this.serialize(e),e.getOutput()}},{key:"toString",value:function(){var e="DetachedTimestampFile\n";return e+="fileHashOp: "+this.fileHashOp.toString()+"\n",e+="timestamp: "+this.timestamp.toString()+"\n"}},{key:"toJson",value:function(){var e={};e.hash=i.bytesToHex(this.fileDigest()),e.op=this.fileHashOp._HASHLIB_NAME(),e.timestamp=this.timestamp.toJson()}},{key:"equals",value:function(e){return e instanceof o&&(!!e.fileHashOp.equals(this.fileHashOp)&&!!e.timestamp.equals(this.timestamp))}}],[{key:"deserialize",value:function(e){var t=void 0;if(e instanceof u.StreamDeserialization)t=e;else if(e instanceof Array)t=new u.StreamDeserialization(e);else if(e instanceof Uint8Array)t=new u.StreamDeserialization(Array.from(e));else{if(!(e instanceof ArrayBuffer))throw new Error("StreamDeserialization deserialize: Invalid param");t=new u.StreamDeserialization(Array.from(e))}t.assertMagic(f);var r=t.readVaruint();if(1!==r)throw new u.UnsupportedMajorVersion("Version "+r+" detached timestamp files are not supported");var i=s.CryptOp.deserialize(t),n=t.readBytes(i._DIGEST_LENGTH()),a=c.deserialize(t,n);return t.assertEof(),new o(i,a)}},{key:"fromBytes",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOp param");var r=void 0;if(t instanceof u.StreamDeserialization)r=e.hashFd(t);else if(t instanceof Array){var i=new u.StreamDeserialization(t);r=e.hashFd(i)}else if(t instanceof Uint8Array){var n=new u.StreamDeserialization(Array.from(t));r=e.hashFd(n)}else{if(!(t instanceof ArrayBuffer))throw new Error("DetachedTimestampFile: Invalid buffer param");var a=new u.StreamDeserialization(Array.from(t));r=e.hashFd(a)}return new o(e,new c(r))}},{key:"fromHash",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOpss param");if(t instanceof Array)return new o(e,new c(t));if(t instanceof ArrayBuffer||t instanceof Uint8Array)return new o(e,new c(Array.from(t)));throw new Error("DetachedTimestampFile: Invalid fdHash param")}}]),o}();t.exports=n},{"./context.js":566,"./ops.js":573,"./timestamp.js":574,"./utils.js":575}],568:[function(e,t,r){var n=e("util"),a=e("assert");Error.extend=function(r,i){a(r,"subTypeName is required");var e=function e(t){if(!(this instanceof e))return new e(t);try{Error.captureStackTrace(this,this.constructor)}catch(e){}this.name=r,this.code=i,this.message=t||"",this.stack=this.stack.replace("Error",this.toString())};return n.inherits(e,this),e.prototype.toString=function(){return this.name+": "+n.inspect(this.message)},e.extend=this.extend,e}},{assert:67,util:505}],569:[function(e,t,r){"use strict";var n=e("request-promise"),a=e("promise"),o=e("./blockstream.js"),s=e("./utils.js"),c=function(){function r(e,t){_classCallCheck2(this,r),this.urlBlockindex=e+"/block-index",this.urlBlock=e+"/block",this.timeout=1e3*t}return _createClass(r,[{key:"blockhash",value:function(e){var i={url:this.urlBlockindex+"/"+e,method:"GET",headers:{Accept:"application/json","User-Agent":"javascript-opentimestamps","Content-Type":"application/x-www-form-urlencoded"},json:!0,timeout:this.timeout};return new a(function(t,r){n(i).then(function(e){if(0===e.size)return console.error("Insight response error body "),void r(new Error("Insight response error body "));t(e.blockHash)}).catch(function(e){console.error("Insight response error: "+e.toString().substr(0,100)),r(e)})})}},{key:"block",value:function(e){var i={url:this.urlBlock+"/"+e,method:"GET",headers:{Accept:"application/json","User-Agent":"javascript-opentimestamps","Content-Type":"application/x-www-form-urlencoded"},json:!0,timeout:this.timeout};return new a(function(t,r){n(i).then(function(e){return e?e.merkleroot&&e.time?void t({merkleroot:e.merkleroot,time:e.time}):r(new Error("Insight response error body ")):(console.error("Insight response error body "),r(new Error("Insight response error body ")))}).catch(function(e){console.error("Insight response error: "+e.toString().substr(0,100)),r(e)})})}}]),r}(),u={bitcoin:["https://insight.bitpay.com/api","https://btc-bitcore1.trezor.io/api","https://btc-bitcore4.trezor.io/api","https://blockexplorer.com/api","https://bitcore.schmoock.net/insight-api"],bitcoinTestnet:["https://test-insight.bitpay.com/api","https://testnet.blockexplorer.com/api"],litecoin:["https://ltc-bitcore1.trezor.io/api","https://insight.litecore.io/api"]},i=function(){function t(e){var r=this;_classCallCheck2(this,t),this.insights=[];var i=e&&Object.prototype.hasOwnProperty.call(e,"timeout")?e.timeout:10,n=e&&Object.prototype.hasOwnProperty.call(e,"chain")?e.chain:"bitcoin";(e&&Object.prototype.hasOwnProperty.call(e,"urls")&&1(new i)._MAX_URI_LENGTH())return console.error("URI exceeds maximum length"),!1;for(var t=0;ta.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=a.privateCalendars.length;else if(a.privateCalendars=[],a.calendars&&0!==a.calendars.length||(a.calendars=c.DEFAULT_AGGREGATORS),a.m&&0!==a.m){if(a.m<0||a.m>a.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=1,2<=a.calendars.length&&(a.m=2);o.createTimestamp(i,a.calendars,a.m,a.privateCalendars).then(function(e){if(void 0===e)return r(new Error("Error on timestamp creation"));t()}).catch(function(e){r(e)})})},createTimestamp:function(i,e,t,r){var n=[];return e&&e.forEach(function(e){var t=new c.RemoteCalendar(e);n.push(t.submit(i.msg)),console.log("Submitting to remote calendar "+e)}),r&&r.forEach(function(e,t){var r=new c.RemoteCalendar(t);r.setKey(e),n.push(r.submit(i.msg)),console.log("Submitting to remote calendar "+t)}),new Promise(function(t,r){Promise.all(n.map(f.softFail)).then(function(e){return e.filter(function(e){return!(e instanceof Error)&&void 0!==e}).forEach(function(e){i.merge(e)}),t(i)}).catch(function(e){r(e)})})},makeMerkleTree:function(e){var i=[];return e.forEach(function(e){if(e instanceof s)try{var t=f.randBytes(16),r=e.timestamp.add(new n.OpAppend(f.arrayToBytes(t))).add(new n.OpSHA256);i.push(r)}catch(e){return}else console.error("Invalid input")}),l.makeMerkleTree(i)},verify:function(e,t,i){if(!f.arrEq(e.fileDigest(),t.fileDigest()))return console.error("Expected digest "+f.bytesToHex(e.fileDigest())),console.error("File does not match original!"),new Promise(function(e,t){t(new Error("File does not match original!"))});var n=this;return new Promise(function(t,r){n.upgradeTimestamp(e.timestamp,i).then(function(){n.verifyTimestamp(e.timestamp,i).then(function(e){return t(e)}).catch(function(e){return r(e)})})})},verifyTimestamp:function(e,r){var i=[],n=this;function c(e,t){return e.attestedTimet.attestedTime?1:0}return e.allAttestations().forEach(function(e,t){i.push(n.verifyAttestation(e,t,r))}),new Promise(function(o,s){Promise.all(i.map(f.softFail)).then(function(e){var t=e.filter(function(e){return e.constructor===p.VerificationError?e:void 0});if(0this._MAX_MSG_LENGTH())){var t=this.call(e);return t.length>this._MAX_RESULT_LENGTH()&&console.error("Error : Result too long;"),t}console.error("Error : Message too long;")}}],[{key:"deserialize",value:function(e){return this.tag=e.readBytes(1)[0],t.deserializeFromTag(e,this.tag)}},{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return n.get(t).deserializeFromTag(e,t);console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),t=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t.arg=void 0===e?[]:e,t}return _inherits(r,c),_createClass(r,[{key:"serialize",value:function(e){_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"serialize",this).call(this,e),e.writeVarbytes(this.arg)}},{key:"toString",value:function(){return this._TAG_NAME()+" "+i.bytesToHex(this.arg)}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t)){var r=e.readVarbytes((new c)._MAX_RESULT_LENGTH(),1);return new(n.get(t))(r)}}}]),r}(),e=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 240}},{key:"_TAG_NAME",value:function(){return"append"}},{key:"call",value:function(e){return e.concat(this.arg)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),r=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 241}},{key:"_TAG_NAME",value:function(){return"prepend"}},{key:"call",value:function(e){return this.arg.concat(e)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),u=function(e){function t(){return _classCallCheck2(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,c),_createClass(t,[{key:"toString",value:function(){return this._TAG_NAME()}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return new(n.get(t));console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),f=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 242}},{key:"_TAG_NAME",value:function(){return"reverse"}},{key:"call",value:function(e){return 0===e.length&&console.error("Can't reverse an empty message"),e.reverse()}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),p=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 243}},{key:"_TAG_NAME",value:function(){return"hexlify"}},{key:"_MAX_MSG_LENGTH",value:function(){return u._MAX_RESULT_LENGTH()}},{key:"call",value:function(e){0===e.length&&console.error("Can't hexlify an empty message")}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),h=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_HASHLIB_NAME",value:function(){return 0}},{key:"call",value:function(e,t){for(var r=("keccak256"===e._HASHLIB_NAME()?s(e._HASHLIB_NAME()).update(a.from(t)):o.createHash(e._HASHLIB_NAME()).update(a.from(t))).digest(),i=[r.length],n=0;n(new m.Op)._MAX_MSG_LENGTH())throw new TypeError("Message exceeds Op length limit; "+e.length+" > "+(new m.Op)._MAX_MSG_LENGTH());this.msg=e,this.attestations=[],this.ops=new Map}return _createClass(h,[{key:"getDigest",value:function(){return this.msg}},{key:"serialize",value:function(r){var i=this;if(!this.attestations&&!this.ops)throw new a.ValueError("An empty timestamp can't be serialized");var e=this.attestations;if(e.sort(function(e,t){return e.compareTo(t)}),1 "+t.toString()+u(o,n,i)+"\n",f+=e.strTree(a+1,o)});else if(0>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},r.charsToHex=function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&i).toString(16))}return t.join("")},r.charToByte=function(e){return e.charCodeAt(0)},r.charsToBytes=function(e){for(var t=[],r=0;r Date: Tue, 18 Dec 2018 16:47:19 +0100 Subject: [PATCH 03/16] Options for multichain verify --- index.js | 57 +++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index 548ffa4..5c324c0 100644 --- a/index.js +++ b/index.js @@ -1,15 +1,41 @@ const OpenTimestamps = window.OpenTimestamps -const calendarsList = ['http://calendar.irsa.it:80'] -const whitelistedCalendars = new OpenTimestamps.Calendar.UrlWhitelist(calendarsList) + +// an empty list would be equivalent to the default calendars +const calendarsList = [ + 'http://calendar.irsa.it:80' + //'https://alice.btc.calendar.opentimestamps.org', + //'https://bob.btc.calendar.opentimestamps.org', + //'https://finney.calendar.eternitywall.com' +] + +// an empty list is not acceptable here +const wcalendars = [ + 'http://calendar.irsa.it:80' + //'https://alice.btc.calendar.opentimestamps.org' + //'https://bob.btc.calendar.opentimestamps.org', + //'https://finney.calendar.eternitywall.com' +] +const whitelistedCalendars = new OpenTimestamps.Calendar.UrlWhitelist(wcalendars) + const blockexplorers = { - urls: [ - 'https://blockstream.info/testnet/api', - 'https://testnet.blockexplorer.com/api' - ] + bitcoin: { + explorers: [ + {url: 'https://blockstream.info/api', type: 'blockstream'}, + {url: 'https://blockexplorer.com/api', type: 'insight'} + ] + }, + bitcoinTestnet: { + explorers: [ + {url: 'https://blockstream.info/testnet/api', type: 'blockstream'}, + {url: 'https://testnet.blockexplorer.com/api', type: 'insight'} + ] + } } + $("#btn-hash").click(function(event) { event.preventDefault() + // begin processing... $("#hash-output").val("Waiting for result...") const filename = $("#hash-filename").val().replace(/^.*[\\\/]/, '') @@ -52,9 +78,10 @@ $("#btn-hash").click(function(event) { return false }) +// TODO: list calendars the hash as been submitted to $("#btn-stamp").click(function(event) { - // list calendars the hash as been submitted to event.preventDefault() + // begin processing... $("#stamp-output").val("Waiting for result...") const hashType = $("#stamp-hashType").val() @@ -99,6 +126,7 @@ $("#btn-stamp").click(function(event) { $("#btn-load").click(function(event) { event.preventDefault() + // begin processing... $("#load-output").val("Waiting for result...") const filename = $("#load-filename").val().replace(/^.*[\\\/]/, '') @@ -136,6 +164,7 @@ $("#btn-load").click(function(event) { }) $("#btn-info").click(function(event) { + // begin processing... event.preventDefault() $("#info-output").val("Waiting for result...") @@ -157,6 +186,7 @@ $("#btn-info").click(function(event) { $("#btn-upgrade").click(function(event) { event.preventDefault() + // begin processing... $("#upgrade-output").val("Waiting for result...") const hexots = $("#upgrade-ots").val() @@ -169,8 +199,8 @@ $("#btn-upgrade").click(function(event) { const filename = $("#upgrade-filename").val() $("#verify-filename").val(filename) - const options = { whitelist: whitelistedCalendars } - OpenTimestamps.upgrade(detachedStamped, options).then( (changed)=>{ + const upgradeOptions = { whitelist: whitelistedCalendars } + OpenTimestamps.upgrade(detachedStamped, upgradeOptions).then( (changed)=>{ const timestampBytes = detachedStamped.serializeToBytes() const hexots = bytesToHex(timestampBytes) if (changed === true) { @@ -193,10 +223,11 @@ $("#btn-upgrade").click(function(event) { return false }) +// TODO: make upgrade optional +// multiple attestations? $("#btn-verify").click(function(event) { - // optional upgrade - // multiple attestations? event.preventDefault() + // begin processing... $("#verify-output").val("Waiting for result...") var hexots = $("#verify-ots").val() @@ -230,8 +261,8 @@ $("#btn-verify").click(function(event) { outputText += "No proof upgrade available" } $("#verify-output").val(outputText + "\nWaiting for verification results...") - const options = { insight: blockexplorers } - return OpenTimestamps.verifyTimestamp(detachedStamped.timestamp, options) + //const options = { bitcoinTestnet: blockexplorers } + return OpenTimestamps.verifyTimestamp(detachedStamped.timestamp, blockexplorers) }).then( (results)=>{ if (Object.keys(results).length === 0) { if (!detachedStamped.timestamp.isTimestampComplete()) From 9480119690e708562e393d63ba13691447639fc3 Mon Sep 17 00:00:00 2001 From: federicoon Date: Tue, 18 Dec 2018 16:14:23 +0000 Subject: [PATCH 04/16] updated opentimestamps.js dependancy --- opentimestamps.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentimestamps.js b/opentimestamps.js index d55c8c4..2d553e1 100644 --- a/opentimestamps.js +++ b/opentimestamps.js @@ -1,2 +1,2 @@ // javascript-opentimestamps v.0.4.4-dev -var _get=function e(t,r,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,r);if(void 0===n){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,i)}if("value"in n)return n.value;var o=n.get;return void 0!==o?o.call(i):void 0},_createClass=function(){function i(e,t){for(var r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,f=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,p=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,l=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",i.copy(m[e])}function g(e){var t=e.match(o);if(!t)return!1;var r,i=+t[1],n=+t[2],a=+t[3];return 1<=n&&n<=12&&1<=a&&a<=(2!=n||((r=i)%4!=0||r%100==0&&r%400!=0)?s[n]:29)}function v(e,t){var r=e.match(c);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return(i<=23&&n<=59&&a<=59||23==i&&59==n&&60==a)&&(!t||o)}(t.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d},m.full={date:g,time:v,"date-time":function(e){var t=e.split(b);return 2==t.length&&g(t[0])&&v(t[1],!0)},uri:function(e){return y.test(e)&&a.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&n.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d};var b=/t|\s/i;var y=/\/|:/;var _=/[^\\]\\Z/;function w(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":12}],7:[function(e,t,r){"use strict";var I=e("./resolve"),P=e("./util"),O=e("./error_classes"),T=e("fast-json-stable-stringify"),B=e("../dotjs/validate"),C=P.ucs2length,F=e("fast-deep-equal"),R=O.Validation;function z(e,t,r){var i=n.call(this,e,t,r);return 0<=i?{index:i,compiling:!0}:{index:i=this._compilations.length,compiling:!(this._compilations[i]={schema:e,root:t,baseId:r})}}function M(e,t,r){var i=n.call(this,e,t,r);0<=i&&this._compilations.splice(i,1)}function n(e,t,r){for(var i=0;i",b=l?">":"<",y=void 0;if(g){var _=e.util.getData(m.$data,o,e.dataPathArr),w="exclusive"+a,k="exclType"+a,x="exclIsNumber"+a,S="' + "+(A="op"+a)+" + '";n+=" var schemaExcl"+a+" = "+_+"; ",n+=" var "+w+"; var "+k+" = typeof "+(_="schemaExcl"+a)+"; if ("+k+" != 'boolean' && "+k+" != 'undefined' && "+k+" != 'number') { ";var j;y=d;(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var E=n;n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+k+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+_+" "+v+"= "+i+") ? "+p+" "+b+"= "+_+" : "+p+" "+b+" "+i+" ) : ( ("+w+" = "+_+" === true) ? "+p+" "+b+"= "+i+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { var op"+a+" = "+w+" ? '"+v+"' : '"+v+"='; ",void 0===s&&(y=d,u=e.errSchemaPath+"/"+d,i=_,h=g)}else{S=v;if((x="number"==typeof m)&&h){var A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ( "+i+" === undefined || "+m+" "+v+"= "+i+" ? "+p+" "+b+"= "+m+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { "}else{x&&void 0===s?(w=!0,y=d,u=e.errSchemaPath+"/"+d,i=m,b+="="):(x&&(i=Math[l?"min":"max"](m,s)),m===(!x||i)?(w=!0,y=d,u=e.errSchemaPath+"/"+d,b+="="):(w=!1,S+="="));A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+" "+b+" "+i+" || "+p+" !== "+p+") { "}}y=y||t,(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+A+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+S+" ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";E=n;return n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s;var l="maxLength"==t?">":"<";n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+p+".length ":n+=" ucs2length("+p+") ",n+=" "+l+" "+i+") { ";var d=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+p+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.schema[t],a=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var f="valid"+c.level,p=c.baseId,h=!0,l=n;if(l)for(var d,m=-1,g=l.length-1;m "+E+") { ";var I=f+"["+E+"]";l.schema=j,l.schemaPath=s+"["+E+"]",l.errSchemaPath=c+"/"+E,l.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),l.dataPathArr[v]=E;var P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",i+=" } ",u&&(i+=" if ("+m+") { ",d+="}")}if("object"==(void 0===_?"undefined":_typeof(_))&&e.util.schemaHasRules(_,e.RULES.all)){l.schema=_,l.schemaPath=e.schemaPath+".additionalItems",l.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+f+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" } } ",u&&(i+=" if ("+m+") { ",d+="}")}}else if(e.util.schemaHasRules(o,e.RULES.all)){l.schema=o,l.schemaPath=s,l.errSchemaPath=c,i+=" for (var "+g+" = 0; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+d+" if ("+h+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],30:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="var division"+a+";if (",h&&(n+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),n+=" (division"+a+" = "+p+" / "+i+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var l=l||[];l.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var d=n;return n=l.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+d+"]); ":n+=" validate.errors = ["+d+"]; return false; ":n+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="errs__"+n,h=e.util.copy(e);h.level++;var l="valid"+h.level;if(e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+p+" = errors; ";var d,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(d=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,d&&(h.opts.allErrors=d),e.compositeRule=h.compositeRule=m,i+=" if ("+l+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var v=i;i=g.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ");return i}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="valid"+n,h="errs__"+n,l=e.util.copy(e),d="";l.level++;var m="valid"+l.level,g=l.baseId,v="prevValid"+n,b="passingSchemas"+n;i+="var "+h+" = errors , "+v+" = false , "+p+" = false , "+b+" = null; ";var y=e.compositeRule;e.compositeRule=l.compositeRule=!0;var _=o;if(_)for(var w,k=-1,x=_.length-1;k=e.opts.loopRequired,k=e.opts.ownProperties;if(u)if(i+=" var missing"+n+"; ",w){h||(i+=" var "+l+" = validate.schema"+s+"; ");var x="' + "+(P="schema"+n+"["+(E="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(_,P,e.opts.jsonPointers)),i+=" var "+p+" = true; ",h&&(i+=" if (schema"+n+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+n+")) "+p+" = false; else {"),i+=" for (var "+E+" = 0; "+E+" < "+l+".length; "+E+"++) { "+p+" = "+f+"["+l+"["+E+"]] !== undefined ",k&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", "+l+"["+E+"]) "),i+="; if (!"+p+") break; } ",h&&(i+=" } "),i+=" if (!"+p+") { ",(I=I||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+x+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var S=i;i=I.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var j=d;if(j)for(var E=-1,A=j.length-1;E 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(0<=d.indexOf("object")||0<=d.indexOf("array")))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var g="checkDataType"+(m?"s":"");n+=" if ("+e.util[g](d,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",l&&(n+=" } "),n+=" if (!"+h+") { ";var v=v||[];v.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var b=n;n=v.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { ")}else f&&(n+=" if (true) { ");return n}},{}],39:[function(e,t,r){"use strict";t.exports=function(i,e,t){var r="",n=!0===i.schema.$async,a=i.util.schemaHasRulesExcept(i.schema,i.RULES.all,"$ref"),o=i.self._getId(i.schema);if(i.isTop&&(r+=" var validate = ",n&&(i.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(i.opts.sourceCode||i.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof i.schema||!a&&!i.schema.$ref){e="false schema";var s=i.level,c=i.dataLevel,u=i.schema[e],f=i.schemaPath+i.util.getProperty(e),p=i.errSchemaPath+"/"+e,h=!i.opts.allErrors,l="data"+(c||""),d="valid"+s;if(!1===i.schema){i.isTop?h=!0:r+=" var "+d+" = false; ",(W=W||[]).push(r),r="",!1!==i.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(p)+" , params: {} ",!1!==i.opts.messages&&(r+=" , message: 'boolean schema is false' "),i.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+i.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var m=r;r=W.pop(),!i.compositeRule&&h?i.async?r+=" throw new ValidationError(["+m+"]); ":r+=" validate.errors = ["+m+"]; return false; ":r+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else i.isTop?r+=n?" return data; ":" validate.errors = null; return true; ":r+=" var "+d+" = true; ";return i.isTop&&(r+=" }; return validate; "),r}if(i.isTop){var g=i.isTop;s=i.level=0,c=i.dataLevel=0,l="data";i.rootId=i.resolve.fullPath(i.self._getId(i.root.schema)),i.baseId=i.baseId||i.rootId,delete i.isTop,i.dataPathArr=[void 0],r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{s=i.level,l="data"+((c=i.dataLevel)||"");if(o&&(i.baseId=i.resolve.url(i.baseId,o)),n&&!i.async)throw new Error("async schema in sync schema");r+=" var errs_"+s+" = errors;"}d="valid"+s,h=!i.opts.allErrors;var v="",b="",y=i.schema.type,_=Array.isArray(y);if(_&&1==y.length&&(y=y[0],_=!1),i.schema.$ref&&a){if("fail"==i.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+i.errSchemaPath+'" (see option extendRefs)');!0!==i.opts.extendRefs&&(a=!1,i.logger.warn('$ref: keywords ignored in schema at path "'+i.errSchemaPath+'"'))}if(i.schema.$comment&&i.opts.$comment&&(r+=" "+i.RULES.all.$comment.code(i,"$comment")),y){if(i.opts.coerceTypes)var w=i.util.coerceToTypes(i.opts.coerceTypes,y);var k=i.RULES.types[y];if(w||_||!0===k||k&&!Z(k)){f=i.schemaPath+".type",p=i.errSchemaPath+"/type",f=i.schemaPath+".type",p=i.errSchemaPath+"/type";var x=_?"checkDataTypes":"checkDataType";if(r+=" if ("+i.util[x](y,l,!0)+") { ",w){var S="dataType"+s,j="coerced"+s;r+=" var "+S+" = typeof "+l+"; ","array"==i.opts.coerceTypes&&(r+=" if ("+S+" == 'object' && Array.isArray("+l+")) "+S+" = 'array'; "),r+=" var "+j+" = undefined; ";var E="",A=w;if(A)for(var I,P=-1,O=A.length-1;P>6],n=0==(32&r);if(31==(31&r)){var a=r;for(r=0;128==(128&a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function p(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)o++;(n=new u(2+o))[0]=a,n[1]=128|o;s=1+o;for(var c=i.length;0>=8)n[s]=255&c;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new u(2*e.length),i=0;i>=7)n++}var o=new u(n),s=o.length-1;for(i=e.length-1;0<=i;i--){a=e[i];for(o[s--]=127&a;0<(a>>=7);)o[s--]=128|127&a}return this._createEncoderBuffer(o)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[c(i.getFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(i.getFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.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&&!u.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new u(r)}if(u.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new u(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var a=e;256<=a;a>>=8)i++;for(a=(n=new Array(i)).length-1;0<=a;a--)n[a]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new u(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var a=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),a.length!==n.defaultBuffer.length)return!1;for(i=0;i=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0===(t&=127))throw c("Indefinite length not supported");if(4this._size-i)return null;if(this._offset=i,0===this.length)return t?a.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?n:n.toString("utf8")},i.prototype.readOID=function(e){e||(e=s.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],i=0,n=0;n>0),r.join(".")},i.prototype._readTag=function(e){o.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw c("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(4this._size-r)return null;this._offset=r;for(var i=this._buf[this._offset],n=0,a=0;a>0},t.exports=i},{"./errors":60,"./types":63,assert:67,"safer-buffer":448}],63:[function(e,t,r){t.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},{}],64:[function(e,t,r){var n=e("assert"),a=e("safer-buffer").Buffer,o=e("./types"),i=e("./errors").newInvalidAsn1Error,s={size:1024,growthFactor:8};function c(e){var r,i;r=s,i=e||{},n.ok(r),n.equal(void 0===r?"undefined":_typeof(r),"object"),n.ok(i),n.equal(void 0===i?"undefined":_typeof(i),"object"),Object.getOwnPropertyNames(r).forEach(function(e){if(!i[e]){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,t)}}),e=i,this._buf=a.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw i(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},c.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=o.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&1 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;0>>24,e<<=8},c.prototype.writeNull=function(){this.writeByte(o.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=o.Enumeration),this.writeInt(e,t)},c.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=o.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},c.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+(void 0===e?"undefined":_typeof(e))+")");"number"!=typeof t&&(t=o.OctetString);var r=a.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},c.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!a.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},c.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(e){t.writeString(e)})},c.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=o.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),i=[];i.push(40*parseInt(r[0],10)+parseInt(r[1],10)),r.slice(2).forEach(function(e){var t,r;t=i,(r=parseInt(e,10))<128?t.push(r):(r<16384?t.push(r>>>7|128):(r<2097152?t.push(r>>>14|128):(r<268435456?t.push(r>>>21|128):(t.push(255&(r>>>28|128)),t.push(255&(r>>>21|128))),t.push(255&(r>>>14|128))),t.push(255&(r>>>7|128))),t.push(127&r))});var n=this;this._ensure(2+i.length),this.writeByte(t),this.writeLength(i.length),i.forEach(function(e){n.writeByte(e)})},c.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw i("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},c.prototype.startSequence=function(e){"number"!=typeof e&&(e=o.Sequence|o.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw i("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},c.prototype._shift=function(e,t,r){n.ok(void 0!==e),n.ok(void 0!==t),n.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},c.prototype._ensure=function(e){if(n.ok(e),this._size-this._offset>16&255,a[o++]=t>>8&255,a[o++]=255&t;var u,f;2===n&&(t=p[e.charCodeAt(c)]<<2|p[e.charCodeAt(c+1)]>>4,a[o++]=255&t);1===n&&(t=p[e.charCodeAt(c)]<<10|p[e.charCodeAt(c+1)]<<4|p[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],a=0,o=r-i;a>2]+s[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],p=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,a=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return a.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},{}],76:[function(e,t,r){"use strict";var y=e("tweetnacl").lowlevel.crypto_hash,s=0,c=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};function n(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}function u(e,t){var r,i=0;for(r=0;r<4;r++,s++)t<=s&&(s=0),i=i<<8|e[s];return i}c.prototype.encipher=function(e,t){void 0===t&&(t=new Uint8Array(e.buffer),0!==e.byteOffset&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=n(this.S,t,0)^this.P[r],e[0]^=n(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i},c.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);0!==e.byteOffset&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;0>>24,r[4*i+2]=a[i]>>>16,r[4*i+1]=a[i]>>>8,r[4*i+0]=a[i]}t.exports={BLOCKS:f,HASHSIZE:32,hash:_,pbkdf:function(e,t,r,i,n,a,o){var s,c,u,f,p,h,l=new Uint8Array(64),d=new Uint8Array(64),m=new Uint8Array(32),g=new Uint8Array(32),v=new Uint8Array(i+4),b=a;if(o<1)return-1;if(0===t||0===i||0===a||a>m.byteLength*m.byteLength||1<<20>>24,v[i+1]=h>>>16,v[i+2]=h>>>8,v[i+3]=h,y(d,v,i+4),_(l,d,g),s=m.byteLength;s--;)m[s]=g[s];for(s=1;sa[o]^r?1:-1;return c==u?0:u=t&&e<=r}function J(e){return"[object Array]"==Object.prototype.toString.call(e)}function Q(e,t,r){for(var i,n,a=[0],o=0,s=e.length;or-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}function ee(e,t){return(1(r=e.length)){for(i="0",t-=r;--t;i+="0");e+=i}else tt;)u[n]=0,n||(++a,u.unshift(1));for(o=u.length;!u[--o];);for(p=0,e="";p<=o;e+=U.charAt(u[p++]));e=te(e,a)}return e}function P(e,t,r,i){var n,a,o,s,c;if(r=null!=r&&k(r,0,8,i,q)?0|r:b,!e.c)return e.toString();if(n=e.c[0],o=e.e,null==t)c=Z(e.c),c=19==i||24==i&&o<=h?ee(c,o):te(c,o);else if(a=(e=C(new I(e),t,r)).e,s=(c=Z(e.c)).length,19==i||24==i&&(t<=a||a<=h)){for(;sy?e.c=e.e=null:e.c=r=p.length){if(!i)break e;for(;p.length<=u;p.push(0));c=f=0,o=(a%=K)-K+(n=1)}else{for(c=s=p[u],n=1;10<=s;s/=10,n++);f=(o=(a%=K)-K+n)<0?0:c/h[n-o-1]%10|0}if(i=i||t<0||null!=p[u+1]||(o<0?c:c%h[n-o-1]),i=r<4?(f||i)&&(0==r||r==(e.s<0?3:2)):5y?e.c=e.e=null:e.er)return null!=(e=n[r++])};return o(t="DECIMAL_PLACES")&&k(e,0,$,2,t)&&(d=0|e),i[t]=d,o(t="ROUNDING_MODE")&&k(e,0,8,2,t)&&(b=0|e),i[t]=b,o(t="EXPONENTIAL_AT")&&(J(e)?k(e[0],-$,0,2,t)&&k(e[1],0,$,2,t)&&(h=0|e[0],l=0|e[1]):k(e,-$,$,2,t)&&(h=-(l=0|(e<0?-e:e)))),i[t]=[h,l],o(t="RANGE")&&(J(e)?k(e[0],-$,-1,2,t)&&k(e[1],1,$,2,t)&&(m=0|e[0],y=0|e[1]):k(e,-$,$,2,t)&&(0|e?m=-(y=0|(e<0?-e:e)):w&&B(2,t+" cannot be zero",e))),i[t]=[m,y],o(t="ERRORS")&&(e===!!e||1===e||0===e?(_=0,k=(w=!!e)?O:X):w&&B(2,t+D,e)),i[t]=w,o(t="CRYPTO")&&(e===!!e||1===e||0===e?(x=!(!e||!F||"object"!=(void 0===F?"undefined":_typeof(F))),e&&!x&&w&&B(2,"crypto unavailable",F)):w&&B(2,t+D,e)),i[t]=x,o(t="MODULO_MODE")&&k(e,0,9,2,t)&&(S=0|e),i[t]=S,o(t="POW_PRECISION")&&k(e,0,$,2,t)&&(j=0|e),i[t]=j,o(t="FORMAT")&&("object"==(void 0===e?"undefined":_typeof(e))?E=e:w&&B(2,t+" not an object",e)),i[t]=E,i},I.max=function(){return n(arguments,i.lt)},I.min=function(){return n(arguments,i.gt)},I.random=(r=9007199254740992,u=Math.random()*r&2097151?function(){return N(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,n,a,o=0,s=[],c=new I(v);if(e=null!=e&&k(e,0,$,14)?0|e:d,n=M(e/K),x)if(F&&F.getRandomValues){for(t=F.getRandomValues(new Uint32Array(n*=2));o>>11))?(r=F.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(s.push(a%1e14),o+=2);o=n/2}else if(F&&F.randomBytes){for(t=F.randomBytes(n*=7);ot[n]?1:-1;break}return a}function A(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r](x[s]||0)&&o--,k<0)l.push(1),c=!0;else{for(b=x.length,_=S.length,k+=2,1<(u=N(n/(S[s=0]+1)))&&(S=j(S,u,n),x=j(x,u,n),_=S.length,b=x.length),v=_,m=(d=x.slice(0,_)).length;m<_;d[m++]=0);(w=S.slice()).unshift(0),y=S[0],S[1]>=n/2&&y++;do{if(u=0,(a=E(S,d,_,m))<0){if(g=d[0],_!=m&&(g=g*n+(d[1]||0)),1<(u=N(g/y)))for(n<=u&&(u=n-1),p=(f=j(S,u,n)).length,m=d.length;1==E(f,d,p,m);)u--,A(f,_this.c.length-2},i.isNaN=function(){return!this.s},i.isNegative=i.isNeg=function(){return this.s<0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.lessThan=i.lt=function(e,t){return _=8,Y(this,new I(e,t))<0},i.lessThanOrEqualTo=i.lte=function(e,t){return _=9,-1===(t=Y(this,new I(e,t)))||0===t},i.minus=i.sub=function(e,t){var r,i,n,a,o=this,s=o.s;if(_=10,t=(e=new I(e,t)).s,!s||!t)return new I(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/K,u=e.e/K,f=o.c,p=e.c;if(!c||!u){if(!f||!p)return f?(e.s=-t,e):new I(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new I(f[0]?o:3==b?-0:0)}if(c=W(c),u=W(u),f=f.slice(),s=c-u){for((n=(a=s<0)?(s=-s,f):(u=c,p)).reverse(),t=s;t--;n.push(0));n.reverse()}else for(i=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;tt&&(t=this.e+1),t},i.round=function(e,t){var r=new I(this);return(null==e||k(e,0,$,15))&&C(r,~~e+this.e+1,null!=t&&k(t,0,8,15,q)?0|t:b),r},i.shift=function(e){var t=this;return k(e,-a,a,16,"argument")?t.times("1e"+re(e)):new I(t.c&&t.c[0]&&(e<-a||at&&(r.c.length=t)}if(!(i=N(i/2)))break;n=n.times(n),t&&n.c&&n.c.length>t&&(n.c.length=t)}return e<0&&(r=v.div(r)),t?C(r,j,b):r},i.toPrecision=function(e,t){return P(this,null!=e&&k(e,1,$,24,"precision")?0|e:null,t,24)},i.toString=function(e){var t,r=this.s,i=this.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=Z(this.c),t=null!=e&&k(e,2,64,25,"base")?A(te(t,i),0|e,10,r):i<=h||l<=i?ee(t,i):te(t,i),r<0&&this.c[0]&&(t="-"+t)),t},i.truncated=i.trunc=function(){return C(new I(this),this.e+1,1)},i.valueOf=i.toJSON=function(){return this.toString()},null!=t&&I.config(t),I}(),"function"==typeof define&&define.amd)define(function(){return t});else if(void 0!==i&&i.exports){if(i.exports=t,!F)try{F=r("crypto")}catch(e){}}else e.BigNumber=t}(this)},{crypto:204}],78:[function(i,n,e){(function(e,t){"use strict";var r=n.exports;r.version="v"+i("./package.json").version,r.versionGuard=function(e){if(void 0!==e){throw new Error("More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.")}},r.versionGuard(e._bitcore),e._bitcore=r.version,r.crypto={},r.crypto.BN=i("./lib/crypto/bn"),r.crypto.ECDSA=i("./lib/crypto/ecdsa"),r.crypto.Hash=i("./lib/crypto/hash"),r.crypto.Random=i("./lib/crypto/random"),r.crypto.Point=i("./lib/crypto/point"),r.crypto.Signature=i("./lib/crypto/signature"),r.encoding={},r.encoding.Base58=i("./lib/encoding/base58"),r.encoding.Base58Check=i("./lib/encoding/base58check"),r.encoding.BufferReader=i("./lib/encoding/bufferreader"),r.encoding.BufferWriter=i("./lib/encoding/bufferwriter"),r.encoding.Varint=i("./lib/encoding/varint"),r.util={},r.util.buffer=i("./lib/util/buffer"),r.util.js=i("./lib/util/js"),r.util.preconditions=i("./lib/util/preconditions"),r.errors=i("./lib/errors"),r.Address=i("./lib/address"),r.Block=i("./lib/block"),r.MerkleBlock=i("./lib/block/merkleblock"),r.BlockHeader=i("./lib/block/blockheader"),r.HDPrivateKey=i("./lib/hdprivatekey.js"),r.HDPublicKey=i("./lib/hdpublickey.js"),r.Networks=i("./lib/networks"),r.Opcode=i("./lib/opcode"),r.PrivateKey=i("./lib/privatekey"),r.PublicKey=i("./lib/publickey"),r.Script=i("./lib/script"),r.Transaction=i("./lib/transaction"),r.URI=i("./lib/uri"),r.Unit=i("./lib/unit"),r.deps={},r.deps.bnjs=i("bn.js"),r.deps.bs58=i("bs58"),r.deps.Buffer=t,r.deps.elliptic=i("elliptic"),r.deps._=i("lodash"),r._HDKeyCache=i("./lib/hdkeycache"),r.Transaction.sighash=i("./lib/transaction/sighash")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i("buffer").Buffer)},{"./lib/address":79,"./lib/block":82,"./lib/block/blockheader":81,"./lib/block/merkleblock":83,"./lib/crypto/bn":84,"./lib/crypto/ecdsa":85,"./lib/crypto/hash":86,"./lib/crypto/point":87,"./lib/crypto/random":88,"./lib/crypto/signature":89,"./lib/encoding/base58":90,"./lib/encoding/base58check":91,"./lib/encoding/bufferreader":92,"./lib/encoding/bufferwriter":93,"./lib/encoding/varint":94,"./lib/errors":95,"./lib/hdkeycache":97,"./lib/hdprivatekey.js":98,"./lib/hdpublickey.js":99,"./lib/networks":100,"./lib/opcode":101,"./lib/privatekey":102,"./lib/publickey":103,"./lib/script":104,"./lib/transaction":107,"./lib/transaction/sighash":115,"./lib/unit":119,"./lib/uri":120,"./lib/util/buffer":121,"./lib/util/js":122,"./lib/util/preconditions":123,"./package.json":150,"bn.js":124,bs58:125,buffer:191,elliptic:127,lodash:149}],79:[function(e,t,r){(function(a){"use strict";var n=e("lodash"),o=e("./util/preconditions"),i=e("./errors"),s=e("./encoding/base58check"),c=e("./networks"),r=e("./crypto/hash"),u=e("./util/js"),f=e("./publickey");function p(e,t,r){if(!(this instanceof p))return new p(e,t,r);if(n.isArray(e)&&n.isNumber(t))return p.createMultisig(e,t,r);if(e instanceof p)return e;if(o.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!c.get(t))throw new TypeError('Second argument must be "livenet" or "testnet".');if(r&&r!==p.PayToPublicKeyHash&&r!==p.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||c.get(t)||c.defaultNetwork,i.type=i.type||r||p.PayToPublicKeyHash,u.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}p.prototype._classifyArguments=function(e,t,r){if((e instanceof a||e instanceof Uint8Array)&&20===e.length)return p._transformHash(e);if((e instanceof a||e instanceof Uint8Array)&&21===e.length)return p._transformBuffer(e,t,r);if(e instanceof f)return p._transformPublicKey(e);if(e instanceof h)return p._transformScript(e,t);if("string"==typeof e)return p._transformString(e,t,r);if(n.isObject(e))return p._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")},p.PayToPublicKeyHash="pubkeyhash",p.PayToScriptHash="scripthash",p._transformHash=function(e){var t={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==e.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t},p._transformObject=function(e){return o.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),o.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?new a(e.hash,"hex"):e.hashBuffer,network:c.get(e.network)||c.defaultNetwork,type:e.type}},p._classifyFromVersion=function(e){var t={},r=c.get(e[0],"pubkeyhash"),i=c.get(e[0],"scripthash");return r?(t.network=r,t.type=p.PayToPublicKeyHash):i&&(t.network=i,t.type=p.PayToScriptHash),t},p._transformBuffer=function(e,t,r){var i={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==e.length)throw new TypeError("Address buffers must be exactly 21 bytes.");t=c.get(t);var n=p._classifyFromVersion(e);if(!n.network||t&&t!==n.network)throw new TypeError("Address has mismatched network type.");if(!n.type||r&&r!==n.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=n.network,i.type=n.type,i},p._transformPublicKey=function(e){var t={};if(!(e instanceof f))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=r.sha256ripemd160(e.toBuffer()),t.type=p.PayToPublicKeyHash,t},p._transformScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new i.Script.CantDeriveAddress(e);return r},p.createMultisig=function(e,t,r){return r=r||e[0].network||c.defaultNetwork,p.payingTo(h.buildMultisigOut(e,t),r)},p._transformString=function(e,t,r){if("string"!=typeof e)throw new TypeError("data parameter supplied is not a string.");e=e.trim();var i=s.decode(e);return p._transformBuffer(i,t,r)},p.fromPublicKey=function(e,t){var r=p._transformPublicKey(e);return t=t||c.defaultNetwork,new p(r.hashBuffer,t,r.type)},p.fromPublicKeyHash=function(e,t){return new p(p._transformHash(e).hashBuffer,t,p.PayToPublicKeyHash)},p.fromScriptHash=function(e,t){return o.checkArgument(e,"hash parameter is required"),new p(p._transformHash(e).hashBuffer,t,p.PayToScriptHash)},p.payingTo=function(e,t){return o.checkArgument(e,"script is required"),o.checkArgument(e instanceof h,"script must be instance of Script"),p.fromScriptHash(r.sha256ripemd160(e.toBuffer()),t)},p.fromScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=p._transformScript(e,t);return new p(r.hashBuffer,t,r.type)},p.fromBuffer=function(e,t,r){var i=p._transformBuffer(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromString=function(e,t,r){var i=p._transformString(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromObject=function(e){return o.checkState(u.isHexa(e.hash),'Unexpected hash property, "'+e.hash+'", expected to be hex.'),new p(new a(e.hash,"hex"),e.network,e.type)},p.getValidationError=function(e,t,r){var i;try{new p(e,t,r)}catch(e){i=e}return i},p.isValid=function(e,t,r){return!p.getValidationError(e,t,r)},p.prototype.isPayToPublicKeyHash=function(){return this.type===p.PayToPublicKeyHash},p.prototype.isPayToScriptHash=function(){return this.type===p.PayToScriptHash},p.prototype.toBuffer=function(){var e=new a([this.network[this.type]]);return a.concat([e,this.hashBuffer])},p.prototype.toObject=p.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},p.prototype.toString=function(){return s.encode(this.toBuffer())},p.prototype.inspect=function(){return""},t.exports=p;var h=e("./script")}).call(this,e("buffer").Buffer)},{"./crypto/hash":86,"./encoding/base58check":91,"./errors":95,"./networks":100,"./publickey":103,"./script":104,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],80:[function(t,l,e){(function(o){"use strict";var r=t("lodash"),n=t("./blockheader"),i=t("../crypto/bn"),a=t("../util/buffer"),s=t("../encoding/bufferreader"),c=t("../encoding/bufferwriter"),u=t("../crypto/hash"),f=t("../transaction"),p=t("../util/preconditions");function h(e){return this instanceof h?(r.extend(this,h._from(e)),this):new h(e)}h.MAX_BLOCK_SIZE=1e6,h._from=function(e){var t={};if(a.isBuffer(e))t=h._fromBufferReader(s(e));else{if(!r.isObject(e))throw new TypeError("Unrecognized argument for Block");t=h._fromObject(e)}return t},h._fromObject=function(e){var t=[];return e.transactions.forEach(function(e){e instanceof f?t.push(e):t.push(f().fromObject(e))}),{header:n.fromObject(e.header),transactions:t}},h.fromObject=function(e){return new h(h._fromObject(e))},h._fromBufferReader=function(e){var t={};p.checkState(!e.finished(),"No block data received"),t.header=n.fromBufferReader(e);var r=e.readVarintNum();t.transactions=[];for(var i=0;i"},h.Values={START_OF_BLOCK:8,NULL_HASH:new o("0000000000000000000000000000000000000000000000000000000000000000","hex")},l.exports=h}).call(this,t("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../transaction":107,"../util/buffer":121,"../util/preconditions":123,"./blockheader":81,buffer:191,lodash:149}],81:[function(f,p,e){(function(i){"use strict";var n=f("lodash"),a=f("../crypto/bn"),o=f("../util/buffer"),s=f("../encoding/bufferreader"),t=f("../encoding/bufferwriter"),r=f("../crypto/hash"),c=(f("../util/js"),f("../util/preconditions")),u=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&c.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};u._from=function(e){var t={};if(o.isBuffer(e))t=u._fromBufferReader(s(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for BlockHeader");t=u._fromObject(e)}return t},u._fromObject=function(e){c.checkArgument(e,"data is required");var t=e.prevHash,r=e.merkleRoot;return n.isString(e.prevHash)&&(t=o.reverse(new i(e.prevHash,"hex"))),n.isString(e.merkleRoot)&&(r=o.reverse(new i(e.merkleRoot,"hex"))),{hash:e.hash,version:e.version,prevHash:t,merkleRoot:r,time:e.time,timestamp:e.time,bits:e.bits,nonce:e.nonce}},u.fromObject=function(e){var t=u._fromObject(e);return new u(t)},u.fromRawBlock=function(e){o.isBuffer(e)||(e=new i(e,"binary"));var t=s(e);t.pos=u.Constants.START_OF_HEADER;var r=u._fromBufferReader(t);return new u(r)},u.fromBuffer=function(e){var t=u._fromBufferReader(s(e));return new u(t)},u.fromString=function(e){var t=new i(e,"hex");return u.fromBuffer(t)},u._fromBufferReader=function(e){var t={};return t.version=e.readUInt32LE(),t.prevHash=e.read(32),t.merkleRoot=e.read(32),t.time=e.readUInt32LE(),t.bits=e.readUInt32LE(),t.nonce=e.readUInt32LE(),t},u.fromBufferReader=function(e){var t=u._fromBufferReader(e);return new u(t)},u.prototype.toObject=u.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:o.reverse(this.prevHash).toString("hex"),merkleRoot:o.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},u.prototype.toBuffer=function(){return this.toBufferWriter().concat()},u.prototype.toString=function(){return this.toBuffer().toString("hex")},u.prototype.toBufferWriter=function(e){return e||(e=new t),e.writeUInt32LE(this.version),e.write(this.prevHash),e.write(this.merkleRoot),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e},u.prototype.getTargetDifficulty=function(e){e=e||this.bits;for(var t=new a(16777215&e),r=8*((e>>>24)-3);0e+u.Constants.MAX_TIME_OFFSET)},u.prototype.validProofOfWork=function(){var e=new a(this.id,"hex"),t=this.getTargetDifficulty();return!(0"},u.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new a("10000000000000000000000000000000000000000000000000000000000000000","hex")},p.exports=u}).call(this,f("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],82:[function(e,t,r){t.exports=e("./block"),t.exports.BlockHeader=e("./blockheader"),t.exports.MerkleBlock=e("./merkleblock")},{"./block":80,"./blockheader":81,"./merkleblock":83}],83:[function(e,t,r){(function(s){"use strict";var n=e("lodash"),a=e("./blockheader"),o=e("../util/buffer"),r=e("../encoding/bufferreader"),i=e("../encoding/bufferwriter"),c=e("../crypto/hash"),u=(e("../util/js"),e("../transaction")),f=e("../util/preconditions");function p(e){if(!(this instanceof p))return new p(e);var t={};if(o.isBuffer(e))t=p._fromBufferReader(r(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for MerkleBlock");t={header:e.header instanceof a?e.header:a.fromObject(e.header),numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}return n.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}p.fromBuffer=function(e){return p.fromBufferReader(r(e))},p.fromBufferReader=function(e){return new p(p._fromBufferReader(e))},p.prototype.toBuffer=function(){return this.toBufferWriter().concat()},p.prototype.toBufferWriter=function(e){e||(e=new i),e.write(this.header.toBuffer()),e.writeUInt32LE(this.numTransactions),e.writeVarintNum(this.hashes.length);for(var t=0;tthis.numTransactions)return!1;if(8*this.flags.length8*this.flags.length)return null;var i=this.flags[r.flagBitsUsed>>3]>>>(7&r.flagBitsUsed++)&1;if(0!==e&&i){var n=this._traverseMerkleTree(e-1,2*t,r),a=n;return 2*t+1=this.hashes.length)return null;var o=this.hashes[r.hashesUsed++];return 0===e&&i&&r.txs.push(o),new s(o,"hex")},p.prototype._calcTreeWidth=function(e){return this.numTransactions+(1<>e},p.prototype._calcTreeHeight=function(){for(var e=0;1e.size?t=n.trim(t,i):i>1,o=d.getN(),s=d.getG(),c=a?r.add(o):r,u=d.fromX(n,c);if(!u.mul(o).isInfinity())throw new Error("nR is not a valid curve point");var f=t.neg().mod(o),p=r.invm(o),h=u.mul(i).add(s.mul(f)).mul(p);return m.fromPoint(h,this.sig.compressed)},h.prototype.sigError=function(){if(!f.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s;if(!(e.gt(l.Zero)&&e.lt(d.getN())&&t.gt(l.Zero)&&t.lt(d.getN())))return"r and s not in range";var r=l.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),i=d.getN(),n=t.invm(i),a=n.mul(r).mod(i),o=n.mul(e).mod(i),s=d.getG().mulAdd(a,this.pubkey.point,o);return s.isInfinity()?"p is infinity":0!==s.getX().mod(i).cmp(e)&&"Invalid signature"},h.toLowS=function(e){return e.gt(l.fromBuffer(new c("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=d.getN().sub(e)),e},h.prototype._findSignature=function(e,t){for(var r,i,n,a=d.getN(),o=d.getG(),s=0;(!this.k||0i)r=e(r);else if(r>>=8)}return r},e.exports=r}).call(this,i("_process"),i("buffer").Buffer)},{_process:382,buffer:191,crypto:204}],89:[function(e,r,t){(function(u){"use strict";var g=e("./bn"),v=e("lodash"),b=e("../util/preconditions"),y=e("../util/buffer"),t=e("../util/js"),o=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof g)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};o.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=void 0!==e.i?e.i:this.i,this.compressed=void 0!==e.compressed?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this},o.fromCompact=function(e){b.checkArgument(y.isBuffer(e),"Argument is expected to be a Buffer");var t=new o,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i+=4);var n=e.slice(1,33),a=e.slice(33,65);return b.checkArgument(0===i||1===i||2===i||3===i,new Error("i must be 0, 1, 2, or 3")),b.checkArgument(32===n.length,new Error("r must be 32 bytes")),b.checkArgument(32===a.length,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=g.fromBuffer(n),t.s=g.fromBuffer(a),t},o.fromDER=o.fromBuffer=function(e,t){var r=o.parseDER(e,t),i=new o;return i.r=r.r,i.s=r.s,i},o.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=new o.fromDER(r,!1);return i.nhashtype=t,i},o.fromString=function(e){var t=new u(e,"hex");return o.fromDER(t)},o.parseDER=function(e,t){b.checkArgument(y.isBuffer(e),new Error("DER formatted signature should be a buffer")),v.isUndefined(t)&&(t=!0);var r=e[0];b.checkArgument(48===r,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;b.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(2!==e[2])return!1;if(0===t)return!1;if(128&i[0])return!1;if(1=this.buf.length},e.prototype.read=function(e){r.checkArgument(!n.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t},e.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e},e.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e},e.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=o.fromBuffer(e);return this.pos=this.pos+8,t},e.prototype.readUInt64LEBN=function(){var e,t=this.buf.readUInt32LE(this.pos),r=4294967296*this.buf.readUInt32LE(this.pos+4)+t;if(r<=9007199254740991)e=new o(r);else{var i=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);e=new o(i,10,"le")}return this.pos=this.pos+8,e},e.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN().toNumber();if(t<=Math.pow(2,53))return t;throw new Error("number too large to retain precision - use readVarintBN");default:return e}},e.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return r.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t},e.prototype.readVarintBuf=function(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},e.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new o(this.readUInt16LE());case 254:return new o(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new o(e)}},e.prototype.reverse=function(){for(var e=new i(this.buf.length),t=0;t"},k.prototype.toObject=k.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:_.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},k.fromBuffer=function(e){return new k(e.toString())},k.prototype.toBuffer=function(){return _.copy(this._buffers.xprivkey)},k.DefaultDepth=0,k.DefaultFingerprint=0,k.DefaultChildIndex=0,k.MaxIndex=2*(k.Hardened=2147483648),k.RootElementAlias=["m","M","m'","M'"],k.VersionSize=4,k.DepthSize=1,k.ParentFingerPrintSize=4,k.ChildIndexSize=4,k.ChainCodeSize=32,k.PrivateKeySize=32,k.CheckSumSize=4,k.DataLength=78,k.SerializedByteSize=82,n((k.ChecksumEnd=(k.ChecksumStart=k.PrivateKeyEnd=(k.PrivateKeyStart=(k.ChainCodeEnd=(k.ChainCodeStart=k.ChildIndexEnd=(k.ChildIndexStart=k.ParentFingerPrintEnd=(k.ParentFingerPrintStart=k.DepthEnd=(k.DepthStart=k.VersionEnd=(k.VersionStart=0)+k.VersionSize)+k.DepthSize)+k.ParentFingerPrintSize)+k.ChildIndexSize)+k.ChainCodeSize)+1)+k.PrivateKeySize)+k.CheckSumSize)===k.SerializedByteSize),e.exports=k}).call(this,o("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./crypto/random":88,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdpublickey":99,"./networks":100,"./privatekey":102,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],99:[function(i,s,e){(function(u){"use strict";var n=i("lodash"),t=i("./util/preconditions"),f=i("./crypto/bn"),a=i("./encoding/base58"),p=i("./encoding/base58check"),h=i("./crypto/hash"),r=i("./hdprivatekey"),l=i("./hdkeycache"),d=i("./networks"),m=i("./crypto/point"),g=i("./publickey"),e=i("./errors"),v=e,b=e.HDPublicKey,o=i("assert"),y=i("./util/js"),_=i("./util/buffer");function w(e){if(e instanceof w)return e;if(!(this instanceof w))return new w(e);if(e){if(n.isString(e)||_.isBuffer(e)){var t=w.getSerializedError(e);if(t){if(_.isBuffer(e)&&!w.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof b.ArgumentIsPrivateExtended)return new r(e).hdPublicKey;throw t}return this._buildFromSerialized(e)}if(n.isObject(e))return e instanceof r?this._buildFromPrivate(e):this._buildFromObject(e);throw new b.UnrecognizedArgument(e)}throw new b.MustSupplyArgument}w.isValidPath=function(e){if(n.isString(e)){var t=r._getDerivationIndexes(e);return null!==t&&n.all(t,w.isValidPath)}return!!n.isNumber(e)&&(0<=e&&e"},w.prototype.toObject=w.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version)).name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:_.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},w.fromBuffer=function(e){return new w(e)},w.prototype.toBuffer=function(){return _.copy(this._buffers.xpubkey)},w.Hardened=2147483648,w.RootElementAlias=["m","M"],w.VersionSize=4,w.DepthSize=1,w.ParentFingerPrintSize=4,w.ChildIndexSize=4,w.ChainCodeSize=32,w.PublicKeySize=33,w.CheckSumSize=4,w.DataSize=78,w.SerializedByteSize=82,w.ChecksumEnd=(w.ChecksumStart=w.PublicKeyEnd=(w.PublicKeyStart=w.ChainCodeEnd=(w.ChainCodeStart=w.ChildIndexEnd=(w.ChildIndexStart=w.ParentFingerPrintEnd=(w.ParentFingerPrintStart=w.DepthEnd=(w.DepthStart=w.VersionEnd=(w.VersionStart=0)+w.VersionSize)+w.DepthSize)+w.ParentFingerPrintSize)+w.ChildIndexSize)+w.ChainCodeSize)+w.PublicKeySize)+w.CheckSumSize,o(w.PublicKeyEnd===w.DataSize),o(w.ChecksumEnd===w.SerializedByteSize),s.exports=w}).call(this,i("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdprivatekey":98,"./networks":100,"./publickey":103,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],100:[function(e,t,r){"use strict";var n=e("lodash"),i=e("./util/buffer"),a=e("./util/js"),o=[],s={};function c(){}function u(t,e){if(~o.indexOf(t))return t;if(!e)return s[t];n.isArray(e)||(e=[e]);var r=function(e){return o[i][e]===t};for(var i in o)if(n.any(e,r))return o[i]}function f(e){var t=new c;return a.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey}),e.networkMagic&&a.defineImmutable(t,{networkMagic:i.integerAsBuffer(e.networkMagic)}),e.port&&a.defineImmutable(t,{port:e.port}),e.dnsSeeds&&a.defineImmutable(t,{dnsSeeds:e.dnsSeeds}),n.each(t,function(e){n.isUndefined(e)||n.isObject(e)||(s[e]=t)}),o.push(t),t}c.prototype.toString=function(){return this.name},f({name:"livenet",alias:"mainnet",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var p=u("livenet");f({name:"testnet",alias:"regtest",pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956});var h=u("testnet"),l={PORT:18333,NETWORK_MAGIC:i.integerAsBuffer(185665799),DNS_SEEDS:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]};for(var d in l)n.isObject(l[d])||(s[l[d]]=h);var m={PORT:18444,NETWORK_MAGIC:i.integerAsBuffer(4206867930),DNS_SEEDS:[]};for(var d in m)n.isObject(m[d])||(s[m[d]]=h);Object.defineProperty(h,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.PORT:l.PORT}}),Object.defineProperty(h,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.NETWORK_MAGIC:l.NETWORK_MAGIC}}),Object.defineProperty(h,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.DNS_SEEDS:l.DNS_SEEDS}}),t.exports={add:f,remove:function(e){for(var t=0;t=a.map.OP_1&&e<=a.map.OP_16},a.prototype.inspect=function(){return""},c.exports=a}).call(this,s("buffer").Buffer)},{"./util/buffer":121,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],102:[function(h,l,e){(function(i){"use strict";var n=h("lodash"),r=h("./address"),a=h("./encoding/base58check"),o=h("./crypto/bn"),s=h("./util/js"),c=h("./networks"),u=h("./crypto/point"),e=h("./publickey"),f=h("./crypto/random"),t=h("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(e instanceof p)return e;var r=this._classifyArguments(e,t);if(!r.bn||0===r.bn.cmp(new o(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(u.getN()))throw new TypeError("Number must be less than N");if(void 0===r.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return s.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}p.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?c.get(t):c.defaultNetwork};if(n.isUndefined(e)||n.isNull(e))r.bn=p._getRandomBN();else if(e instanceof o)r.bn=e;else if(e instanceof i||e instanceof Uint8Array)r=p._transformBuffer(e,t);else if(e.bn&&e.network)r=p._transformObject(e);else if(!t&&c.get(e))r.bn=p._getRandomBN(),r.network=c.get(e);else{if("string"!=typeof e)throw new TypeError("First argument is an unrecognized data type.");s.isHexa(e)?r.bn=new o(new i(e,"hex")):r=p._transformWIF(e,t)}return r},p._getRandomBN=function(){var e,t;do{var r=f.getRandomBuffer(32);e=(t=o.fromBuffer(r)).lt(u.getN())}while(!e);return t},p._transformBuffer=function(e,t){var r={};if(32===e.length)return p._transformBNBuffer(e,t);if(r.network=c.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==c.get(t))throw new TypeError("Private key network mismatch");if(34===e.length&&1===e[33])r.compressed=!0;else{if(33!==e.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");r.compressed=!1}return r.bn=o.fromBuffer(e.slice(1,33)),r},p._transformBNBuffer=function(e,t){var r={};return r.network=c.get(t)||c.defaultNetwork,r.bn=o.fromBuffer(e),r.compressed=!1,r},p._transformWIF=function(e,t){return p._transformBuffer(a.decode(e),t)},p.fromBuffer=function(e,t){return new p(e,t)},p._transformObject=function(e){return{bn:new o(e.bn,"hex"),network:c.get(e.network),compressed:e.compressed}},p.fromString=p.fromWIF=function(e){return t.checkArgument(n.isString(e),"First argument is expected to be a string."),new p(e)},p.fromObject=function(e){return t.checkArgument(n.isObject(e),"First argument is expected to be an object."),new p(e)},p.fromRandom=function(e){return new p(p._getRandomBN(),e)},p.getValidationError=function(e,t){var r;try{new p(e,t)}catch(e){r=e}return r},p.isValid=function(e,t){return!!e&&!p.getValidationError(e,t)},p.prototype.toString=function(){return this.toBuffer().toString("hex")},p.prototype.toWIF=function(){var e,t=this.network;return e=this.compressed?i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32}),new i([1])]):i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32})]),a.encode(e)},p.prototype.toBigNumber=function(){return this.bn},p.prototype.toBuffer=function(){return this.bn.toBuffer()},p.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=e.fromPrivateKey(this)),this._pubkey},p.prototype.toAddress=function(e){var t=this.toPublicKey();return r.fromPublicKey(t,e||this.network)},p.prototype.toObject=p.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},p.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return""},l.exports=p}).call(this,h("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/point":87,"./crypto/random":88,"./encoding/base58check":91,"./networks":100,"./publickey":103,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],103:[function(t,r,e){(function(o){"use strict";var s=t("./crypto/bn"),c=t("./crypto/point"),e=t("./crypto/hash"),i=t("./util/js"),n=t("./networks"),u=t("lodash"),f=t("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(f.checkArgument(e,"First argument is required, please include public key data."),e instanceof p)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),i.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||n.defaultNetwork}),this}p.prototype._classifyArgs=function(e,t){var r={compressed:u.isUndefined(t.compressed)||t.compressed};if(e instanceof c)r.point=e;else if(e.x&&e.y)r=p._transformObject(e);else if("string"==typeof e)r=p._transformDER(new o(e,"hex"));else if(p._isBuffer(e))r=p._transformDER(e);else{if(!p._isPrivateKey(e))throw new TypeError("First argument is an unrecognized data format.");r=p._transformPrivateKey(e)}return r.network||(r.network=u.isUndefined(t.network)?void 0:n.get(t.network)),r},p._isPrivateKey=function(e){return e instanceof t("./privatekey")},p._isBuffer=function(e){return e instanceof o||e instanceof Uint8Array},p._transformPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=c.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t},p._transformDER=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r,i,n,a,o={};if(t=!!u.isUndefined(t)||t,4!==e[0]&&(t||6!==e[0]&&7!==e[0]))if(3===e[0])n=e.slice(1),r=new s(n),(o=p._transformX(!0,r)).compressed=!0;else{if(2!==e[0])throw new TypeError("Invalid DER format public key");n=e.slice(1),r=new s(n),(o=p._transformX(!1,r)).compressed=!0}else{if(n=e.slice(1,33),a=e.slice(33,65),32!==n.length||32!==a.length||65!==e.length)throw new TypeError("Length of x and y must be 32 bytes");r=new s(n),i=new s(a),o.point=new c(r,i),o.compressed=!1}return o},p._transformX=function(e,t){f.checkArgument("boolean"==typeof e,"Must specify whether y is odd or not (true or false)");var r={};return r.point=c.fromX(e,t),r},p._transformObject=function(e){var t=new s(e.x,"hex"),r=new s(e.y,"hex");return new p(new c(t,r),{compressed:e.compressed})},p.fromPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t=p._transformPrivateKey(e);return new p(t.point,{compressed:t.compressed,network:t.network})},p.fromDER=p.fromBuffer=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r=p._transformDER(e,t);return new p(r.point,{compressed:r.compressed})},p.fromPoint=function(e,t){return f.checkArgument(e instanceof c,"First argument must be an instance of Point."),new p(e,{compressed:t})},p.fromString=function(e,t){var r=new o(e,t||"hex"),i=p._transformDER(r);return new p(i.point,{compressed:i.compressed})},p.fromX=function(e,t){var r=p._transformX(e,t);return new p(r.point,{compressed:r.compressed})},p.getValidationError=function(e){var t;try{new p(e)}catch(e){t=e}return t},p.isValid=function(e){return!p.getValidationError(e)},p.prototype.toObject=p.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},p.prototype.toBuffer=p.prototype.toDER=function(){var e,t=this.point.getX(),r=this.point.getY(),i=t.toBuffer({size:32}),n=r.toBuffer({size:32});if(this.compressed){var a=n[n.length-1]%2;return e=new o(a?[3]:[2]),o.concat([e,i])}return e=new o([4]),o.concat([e,i,n])},p.prototype._getID=function(){return e.sha256ripemd160(this.toBuffer())},p.prototype.toAddress=function(e){return t("./address").fromPublicKey(this,e||this.network)},p.prototype.toString=function(){return this.toDER().toString("hex")},p.prototype.inspect=function(){return""},r.exports=p}).call(this,t("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./networks":100,"./privatekey":102,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],104:[function(e,t,r){t.exports=e("./script"),t.exports.Interpreter=e("./interpreter")},{"./interpreter":105,"./script":106}],105:[function(p,t,e){(function(e){"use strict";var R=p("lodash"),z=p("./script"),M=p("../opcode"),N=p("../crypto/bn"),D=p("../crypto/hash"),q=p("../crypto/signature"),L=p("../publickey"),U=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};U.prototype.verify=function(e,t,r,i,n){var a,o=p("../transaction");if(R.isUndefined(r)&&(r=new o),R.isUndefined(i)&&(i=0),R.isUndefined(n)&&(n=0),this.set({script:e,tx:r,nin:i,flags:n}),0!=(n&U.SCRIPT_VERIFY_SIGPUSHONLY)&&!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(!this.evaluate())return!1;n&U.SCRIPT_VERIFY_P2SH&&(a=this.stack.slice());var s=this.stack;if(this.initialize(),this.set({script:t,stack:s,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(0===this.stack.length)return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT");var c=this.stack[this.stack.length-1];if(!U.castToBool(c))return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK");if(n&U.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(0===a.length)throw new Error("internal error - stack copy empty");var u=a[a.length-1],f=z.fromBuffer(u);return a.pop(),this.initialize(),this.set({script:f,stack:a,tx:r,nin:i,flags:n}),!!this.evaluate()&&(0===a.length?!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK"):!!U.castToBool(a[a.length-1])||!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK"))}return!0},(t.exports=U).prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},U.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=void 0!==e.nin?e.nin:this.nin,this.stack=e.stack||this.stack,this.altstack=e.altack||this.altstack,this.pc=void 0!==e.pc?e.pc:this.pc,this.pbegincodehash=void 0!==e.pbegincodehash?e.pbegincodehash:this.pbegincodehash,this.nOpCount=void 0!==e.nOpCount?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=void 0!==e.flags?e.flags:this.flags},U.true=new e([1]),U.false=new e([]),U.MAX_SCRIPT_ELEMENT_SIZE=520,U.LOCKTIME_THRESHOLD_BN=new N(U.LOCKTIME_THRESHOLD=5e8),U.SCRIPT_VERIFY_NONE=0,U.SCRIPT_VERIFY_P2SH=1,U.SCRIPT_VERIFY_STRICTENC=2,U.SCRIPT_VERIFY_DERSIG=4,U.SCRIPT_VERIFY_LOW_S=8,U.SCRIPT_VERIFY_NULLDUMMY=16,U.SCRIPT_VERIFY_SIGPUSHONLY=32,U.SCRIPT_VERIFY_MINIMALDATA=64,U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,U.castToBool=function(e){for(var t=0;t=U.LOCKTIME_THRESHOLD&&e.gte(U.LOCKTIME_THRESHOLD_BN))&&(!e.gt(new N(this.tx.nLockTime))&&!!this.tx.inputs[this.nin].isFinal())},U.prototype.step=function(){var e,t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g,v=0!=(this.flags&U.SCRIPT_VERIFY_MINIMALDATA),b=-1===this.vfExec.indexOf(!1),y=this.script.chunks[this.pc];this.pc++;var _=y.opcodenum;if(R.isUndefined(_))return!(this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE");if(y.buf&&y.buf.length>U.MAX_SCRIPT_ELEMENT_SIZE)return!(this.errstr="SCRIPT_ERR_PUSH_SIZE");if(_>M.OP_16&&201<++this.nOpCount)return!(this.errstr="SCRIPT_ERR_OP_COUNT");if(_===M.OP_CAT||_===M.OP_SUBSTR||_===M.OP_LEFT||_===M.OP_RIGHT||_===M.OP_INVERT||_===M.OP_AND||_===M.OP_OR||_===M.OP_XOR||_===M.OP_2MUL||_===M.OP_2DIV||_===M.OP_MUL||_===M.OP_DIV||_===M.OP_MOD||_===M.OP_LSHIFT||_===M.OP_RSHIFT)return!(this.errstr="SCRIPT_ERR_DISABLED_OPCODE");if(b&&0<=_&&_<=M.OP_PUSHDATA4){if(v&&!this.script.checkMinimalPush(this.pc-1))return!(this.errstr="SCRIPT_ERR_MINIMALDATA");if(y.buf){if(y.len!==y.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(y.buf)}else this.stack.push(U.false)}else if(b||M.OP_IF<=_&&_<=M.OP_ENDIF)switch(_){case M.OP_1NEGATE:case M.OP_1:case M.OP_2:case M.OP_3:case M.OP_4:case M.OP_5:case M.OP_6:case M.OP_7:case M.OP_8:case M.OP_9:case M.OP_10:case M.OP_11:case M.OP_12:case M.OP_13:case M.OP_14:case M.OP_15:case M.OP_16:n=_-(M.OP_1-1),e=new N(n).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_NOP:break;case M.OP_NOP2:case M.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break}if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");var w=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v,5);if(w.lt(new N(0)))return!(this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME");if(!this.checkLockTime(w))return!(this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME");break;case M.OP_NOP1:case M.OP_NOP3:case M.OP_NOP4:case M.OP_NOP5:case M.OP_NOP6:case M.OP_NOP7:case M.OP_NOP8:case M.OP_NOP9:case M.OP_NOP10:if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break;case M.OP_IF:case M.OP_NOTIF:if(m=!1,b){if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");e=this.stack.pop(),m=U.castToBool(e),_===M.OP_NOTIF&&(m=!m)}this.vfExec.push(m);break;case M.OP_ELSE:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case M.OP_ENDIF:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec.pop();break;case M.OP_VERIFY:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],!(m=U.castToBool(e)))return!(this.errstr="SCRIPT_ERR_VERIFY");this.stack.pop();break;case M.OP_RETURN:return!(this.errstr="SCRIPT_ERR_OP_RETURN");case M.OP_TOALTSTACK:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.altstack.push(this.stack.pop());break;case M.OP_FROMALTSTACK:if(this.altstack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION");this.stack.push(this.altstack.pop());break;case M.OP_2DROP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop(),this.stack.pop();break;case M.OP_2DUP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1],this.stack.push(t),this.stack.push(r);break;case M.OP_3DUP:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-3],r=this.stack[this.stack.length-2];var k=this.stack[this.stack.length-1];this.stack.push(t),this.stack.push(r),this.stack.push(k);break;case M.OP_2OVER:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-4],r=this.stack[this.stack.length-3],this.stack.push(t),this.stack.push(r);break;case M.OP_2ROT:if(this.stack.length<6)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-6,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_2SWAP:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-4,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_IFDUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-1],(m=U.castToBool(e))&&this.stack.push(e);break;case M.OP_DEPTH:e=new N(this.stack.length).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_DROP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop();break;case M.OP_DUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-1]);break;case M.OP_NIP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,1);break;case M.OP_OVER:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-2]);break;case M.OP_PICK:case M.OP_ROLL:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],n=(s=N.fromScriptNumBuffer(e,v)).toNumber(),this.stack.pop(),n<0||n>=this.stack.length)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-n-1],_===M.OP_ROLL&&this.stack.splice(this.stack.length-n-1,1),this.stack.push(e);break;case M.OP_ROT:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-3],o=this.stack[this.stack.length-2];var x=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=o,this.stack[this.stack.length-2]=x,this.stack[this.stack.length-1]=a;break;case M.OP_SWAP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-2],o=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=o,this.stack[this.stack.length-1]=a;break;case M.OP_TUCK:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case M.OP_SIZE:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");s=new N(this.stack[this.stack.length-1].length),this.stack.push(s.toScriptNumBuffer());break;case M.OP_EQUAL:case M.OP_EQUALVERIFY:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1];var S=t.toString("hex")===r.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(S?U.true:U.false),_===M.OP_EQUALVERIFY){if(!S)return!(this.errstr="SCRIPT_ERR_EQUALVERIFY");this.stack.pop()}break;case M.OP_1ADD:case M.OP_1SUB:case M.OP_NEGATE:case M.OP_ABS:case M.OP_NOT:case M.OP_0NOTEQUAL:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(e=this.stack[this.stack.length-1],s=N.fromScriptNumBuffer(e,v),_){case M.OP_1ADD:s=s.add(N.One);break;case M.OP_1SUB:s=s.sub(N.One);break;case M.OP_NEGATE:s=s.neg();break;case M.OP_ABS:s.cmp(N.Zero)<0&&(s=s.neg());break;case M.OP_NOT:s=new N((0===s.cmp(N.Zero))+0);break;case M.OP_0NOTEQUAL:s=new N((0!==s.cmp(N.Zero))+0)}this.stack.pop(),this.stack.push(s.toScriptNumBuffer());break;case M.OP_ADD:case M.OP_SUB:case M.OP_BOOLAND:case M.OP_BOOLOR:case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:case M.OP_NUMNOTEQUAL:case M.OP_LESSTHAN:case M.OP_GREATERTHAN:case M.OP_LESSTHANOREQUAL:case M.OP_GREATERTHANOREQUAL:case M.OP_MIN:case M.OP_MAX:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(c=N.fromScriptNumBuffer(this.stack[this.stack.length-2],v),u=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v),s=new N(0),_){case M.OP_ADD:s=c.add(u);break;case M.OP_SUB:s=c.sub(u);break;case M.OP_BOOLAND:s=new N((0!==c.cmp(N.Zero)&&0!==u.cmp(N.Zero))+0);break;case M.OP_BOOLOR:s=new N((0!==c.cmp(N.Zero)||0!==u.cmp(N.Zero))+0);break;case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:s=new N((0===c.cmp(u))+0);break;case M.OP_NUMNOTEQUAL:s=new N((0!==c.cmp(u))+0);break;case M.OP_LESSTHAN:s=new N((c.cmp(u)<0)+0);break;case M.OP_GREATERTHAN:s=new N((0"},v.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==c.OP_DUP||this.chunks[1].opcodenum!==c.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==c.OP_EQUALVERIFY||this.chunks[4].opcodenum!==c.OP_CHECKSIG)},v.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&48===e[0]&&t&&t.length){var r=t[0];if((4===r||6===r||7===r)&&65===t.length)return!0;if((3===r||2===r)&&33===t.length)return!0}}return!1},v.prototype.getPublicKey=function(){return p.checkState(this.isPublicKeyOut(),"Can't retreive PublicKey from a non-PK output"),this.chunks[0].buf},v.prototype.getPublicKeyHash=function(){return p.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},v.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===c.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if((4!==t&&6!==t&&7!==t||65!==e.length)&&(3!==t&&2!==t||33!==e.length)||(r=!0),r)return u.isValid(e)}return!1},v.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var e=this.chunks[0].buf;if(e&&e.length&&48===e[0])return!0}return!1},v.prototype.isScriptHashOut=function(){var e=this.toBuffer();return 23===e.length&&e[0]===c.OP_HASH160&&20===e[1]&&e[e.length-1]===c.OP_EQUAL},v.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e,t=this.chunks[this.chunks.length-1].buf;if(!t)return!1;try{e=v.fromBuffer(t)}catch(e){if(e instanceof l.Script.InvalidBuffer)return!1;throw e}return e.classify()!==v.types.UNKNOWN},v.prototype.isMultisigOut=function(){return 3=c.OP_1&&e<=c.OP_16)return e-(c.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))},v.prototype.getSignatureOperationsCount=function(r){r=!!h.isUndefined(r)||r;var i=this,n=0,a=c.OP_INVALIDOPCODE;return h.each(i.chunks,function(e){var t=e.opcodenum;t==c.OP_CHECKSIG||t==c.OP_CHECKSIGVERIFY?n++:t!=c.OP_CHECKMULTISIG&&t!=c.OP_CHECKMULTISIGVERIFY||(r&&a>=c.OP_1&&a<=c.OP_16?n+=i._decodeOP_N(a):n+=20),a=t}),n},t.exports=v}).call(this,e("buffer").Buffer)},{"../address":79,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../networks":100,"../opcode":101,"../publickey":103,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],107:[function(e,t,r){t.exports=e("./transaction"),t.exports.Input=e("./input"),t.exports.Output=e("./output"),t.exports.UnspentOutput=e("./unspentoutput"),t.exports.Signature=e("./signature"),t.exports.Sighash=e("./sighash")},{"./input":108,"./output":114,"./sighash":115,"./signature":116,"./transaction":117,"./unspentoutput":118}],108:[function(e,t,r){t.exports=e("./input"),t.exports.PublicKey=e("./publickey"),t.exports.PublicKeyHash=e("./publickeyhash"),t.exports.MultiSig=e("./multisig.js"),t.exports.MultiSigScriptHash=e("./multisigscripthash.js")},{"./input":109,"./multisig.js":110,"./multisigscripthash.js":111,"./publickey":112,"./publickeyhash":113}],109:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../../util/preconditions"),a=e("../../errors"),o=e("../../encoding/bufferwriter"),s=e("buffer"),c=e("../../util/buffer"),u=e("../../util/js"),f=e("../../script"),p=e("../sighash"),h=e("../output"),l=4294967295;function d(e){return this instanceof d?e?this._fromObject(e):void 0:new d(e)}d.MAXINT=l,d.DEFAULT_SEQNUMBER=4294967295,d.DEFAULT_LOCKTIME_SEQNUMBER=4294967294,d.DEFAULT_RBF_SEQNUMBER=4294967293,Object.defineProperty(d.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new f(this._scriptBuffer),this._script._isInput=!0),this._script)}}),d.fromObject=function(e){return n.checkArgument(i.isObject(e)),(new d)._fromObject(e)},d.prototype._fromObject=function(e){var t;if(t=i.isString(e.prevTxId)&&u.isHexa(e.prevTxId)?new s.Buffer(e.prevTxId,"hex"):e.prevTxId,this.output=e.output?e.output instanceof h?e.output:new h(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=i.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=i.isUndefined(e.sequenceNumber)?i.isUndefined(e.seqnum)?4294967295:e.seqnum:e.sequenceNumber,i.isUndefined(e.script)&&i.isUndefined(e.scriptBuffer))throw new a.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this},d.prototype.toObject=d.prototype.toJSON=function(){var e={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(e.scriptString=this.script.toString()),this.output&&(e.output=this.output.toObject()),e},d.fromBufferReader=function(e){var t=new d;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t},d.prototype.toBufferWriter=function(e){e||(e=new o),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e},d.prototype.setScript=function(e){if(this._script=null,e instanceof f)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(u.isHexa(e))this._scriptBuffer=new s.Buffer(e,"hex");else if(i.isString(e))this._script=new f(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!c.isBuffer(e))throw new TypeError("Invalid argument type: script");this._scriptBuffer=new s.Buffer(e)}return this},d.prototype.getSignatures=function(){throw new a.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},d.prototype.isFullySigned=function(){throw new a.AbstractMethodInvoked("Input#isFullySigned")},d.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},d.prototype.addSignature=function(){throw new a.AbstractMethodInvoked("Input#addSignature")},d.prototype.clearSignatures=function(){throw new a.AbstractMethodInvoked("Input#clearSignatures")},d.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},d.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},d.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},t.exports=d},{"../../encoding/bufferwriter":93,"../../errors":95,"../../script":104,"../../util/buffer":121,"../../util/js":122,"../../util/preconditions":123,"../output":114,"../sighash":115,buffer:191,lodash:149}],110:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=(e("../transaction"),e("./input")),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),u.checkState(o.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.output.script),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},l.normalizeSignatures=function(n,a,o,e,t){return t.map(function(r){var i=null;return e=e.filter(function(e){if(i)return!0;var t=new h({signature:f.fromTxFormat(e),publicKey:r,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:o,sigtype:f.SIGHASH_ALL});return t.signature.nhashtype=t.sigtype,!p.verify(n,t.signature,t.publicKey,t.inputIndex,a.output.script)||(i=t,!1)}),i||null})},l.OPCODES_SIZE=1,l.SIGNATURE_SIZE=73,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"../transaction":117,"./input":109,inherits:148,lodash:149}],111:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=e("./input"),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),this.redeemScript=o.buildMultisigOut(this.publicKeys,r),u.checkState(o.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.redeemScript),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript)},l.OPCODES_SIZE=7,l.SIGNATURE_SIZE=74,l.PUBKEY_SIZE=34,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE+this.publicKeys.length*l.PUBKEY_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148,lodash:149}],112:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),n=(e("../../util/buffer"),e("./input")),o=e("../output"),s=e("../sighash"),c=e("../../script"),u=e("../../crypto/signature"),f=e("../signature");function p(){n.apply(this,arguments)}i(p,n),p.prototype.getSignatures=function(e,t,r,i){a.checkState(this.output instanceof o),i=i||u.SIGHASH_ALL;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new f({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:s.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},p.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(c.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this},p.prototype.clearSignatures=function(){return this.setScript(c.empty()),this},p.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},p.SCRIPT_MAX_SIZE=73,p.prototype._estimateSize=function(){return p.SCRIPT_MAX_SIZE},t.exports=p},{"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],113:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),o=e("../../util/buffer"),s=e("../../crypto/hash"),n=e("./input"),c=e("../output"),u=e("../sighash"),f=e("../../script"),p=e("../../crypto/signature"),h=e("../signature");function l(){n.apply(this,arguments)}i(l,n),l.prototype.getSignatures=function(e,t,r,i,n){return a.checkState(this.output instanceof c),n=n||s.sha256ripemd160(t.publicKey.toBuffer()),i=i||p.SIGHASH_ALL,o.equals(n,this.output.script.getPublicKeyHash())?[new h({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:u.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},l.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(f.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this},l.prototype.clearSignatures=function(){return this.setScript(f.empty()),this},l.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()},l.SCRIPT_MAX_SIZE=107,l.prototype._estimateSize=function(){return l.SCRIPT_MAX_SIZE},t.exports=l},{"../../crypto/hash":86,"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],114:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../crypto/bn"),a=e("buffer"),o=e("../util/buffer"),s=e("../util/js"),c=e("../encoding/bufferwriter"),u=e("../script"),f=e("../util/preconditions"),p=e("../errors");function h(e){if(!(this instanceof h))return new h(e);if(!i.isObject(e))throw new TypeError("Unrecognized argument for Output");var t;this.satoshis=e.satoshis,o.isBuffer(e.script)?this._scriptBuffer=e.script:(t=i.isString(e.script)&&s.isHexa(e.script)?new a.Buffer(e.script,"hex"):e.script,this.setScript(t))}Object.defineProperty(h.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script||this.setScriptFromBuffer(this._scriptBuffer),this._script}}),Object.defineProperty(h.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof n?(this._satoshisBN=e,this._satoshis=e.toNumber()):i.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=n.fromNumber(this._satoshis)):(f.checkArgument(s.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=n.fromNumber(e),this._satoshis=e),f.checkState(s.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),h.prototype.invalidSatoshis=function(){return 9007199254740991"},h.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return t.script=0!==r?e.read(r):new a.Buffer([]),new h(t)},h.prototype.toBufferWriter=function(e){e||(e=new c),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e},t.exports=h},{"../crypto/bn":84,"../encoding/bufferwriter":93,"../errors":95,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],115:[function(y,e,t){(function(f){"use strict";var p=y("buffer"),h=y("../crypto/signature"),l=y("../script"),d=y("./output"),m=y("../encoding/bufferreader"),g=y("../encoding/bufferwriter"),v=y("../crypto/bn"),b=y("../crypto/hash"),o=y("../crypto/ecdsa"),s=y("../util/preconditions"),c=y("lodash"),u=function(e,t,r,i){var n,a=y("./transaction"),o=y("./input"),s=a.shallowCopy(e);for((i=new l(i)).removeCodeseparators(),n=0;n=s.outputs.length)return new f("0000000000000000000000000000000000000000000000000000000000000001","hex");for(s.outputs.length=r+1,n=0;n"},S.prototype.toBuffer=function(){var e=new u;return this.toBufferWriter(e).toBuffer()},S.prototype.toBufferWriter=function(t){return t.writeUInt32LE(this.version),t.writeVarintNum(this.inputs.length),s.each(this.inputs,function(e){e.toBufferWriter(t)}),t.writeVarintNum(this.outputs.length),s.each(this.outputs,function(e){e.toBufferWriter(t)}),t.writeUInt32LE(this.nLockTime),t},S.prototype.fromBuffer=function(e){var t=new c(e);return this.fromBufferReader(t)},S.prototype.fromBufferReader=function(e){var t,r,i;for(a.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readUInt32LE(),r=e.readVarintNum(),t=0;t=this.inputs.length)throw new n.Transaction.InvalidIndex(e,this.inputs.length);var i=this.inputs[e];this.inputs=s.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()},S.prototype.sign=function(e,t){a.checkState(this.hasAllUtxoInfo());var r=this;return s.isArray(e)?s.each(e,function(e){r.sign(e,t)}):s.each(this.getSignatures(e,t),function(e){r.applySignature(e)}),this},S.prototype.getSignatures=function(r,i){r=new k(r),i=i||p.SIGHASH_ALL;var n=this,a=[],o=f.sha256ripemd160(r.publicKey.toBuffer());return s.each(this.inputs,function(e,t){s.each(e.getSignatures(n,r,t,i,o),function(e){a.push(e)})}),a},S.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this},S.prototype.isFullySigned=function(){return s.each(this.inputs,function(e){if(e.isFullySigned===m.prototype.isFullySigned)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),s.all(s.map(this.inputs,function(e){return e.isFullySigned()}))},S.prototype.isValidSignature=function(e){if(this.inputs[e.inputIndex].isValidSignature===m.prototype.isValidSignature)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e)},S.prototype.verifySignature=function(e,t,r,i){return h.verify(this,e,t,r,i)},S.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var e=new x(0),t=0;t=m.MAXINT-1&&(t.sequenceNumber=m.DEFAULT_RBF_SEQNUMBER)}return this},I.exports=S}).call(this,A("buffer").Buffer)},{"../address":79,"../crypto/bn":84,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../privatekey":102,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"./input":108,"./output":114,"./sighash":115,"./unspentoutput":118,buffer:191,"buffer-compare":126,lodash:149}],118:[function(e,t,r){"use strict";var o=e("lodash"),s=e("../util/preconditions"),c=e("../util/js"),u=e("../script"),f=e("../address"),p=e("../unit");function h(e){if(!(this instanceof h))return new h(e);s.checkArgument(o.isObject(e),"Must provide an object from where to extract data");var t=e.address?new f(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!c.isHexaString(r)||64"},h.prototype.toString=function(){return this.txId+":"+this.outputIndex},h.fromObject=function(e){return new h(e)},h.prototype.toObject=h.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:p.fromSatoshis(this.satoshis).toBTC()}},t.exports=h},{"../address":79,"../script":104,"../unit":119,"../util/js":122,"../util/preconditions":123,lodash:149}],119:[function(e,t,r){"use strict";var i=e("lodash"),n=e("./errors"),a=e("./util/preconditions"),o={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function s(e,t){if(!(this instanceof s))return new s(e,t);if(i.isNumber(t)){if(t<=0)throw new n.Unit.InvalidRate(t);e/=t,t=s.BTC}this._value=this._from(e,t);var r=this;Object.keys(o).forEach(function(e){Object.defineProperty(r,e,{get:function(){return r.to(e)},enumerable:!0})})}Object.keys(o).forEach(function(e){s[e]=e}),s.fromObject=function(e){return a.checkArgument(i.isObject(e),"Argument is expected to be an object"),new s(e.amount,e.code)},s.fromBTC=function(e){return new s(e,s.BTC)},s.fromMillis=s.fromMilis=function(e){return new s(e,s.mBTC)},s.fromMicros=s.fromBits=function(e){return new s(e,s.bits)},s.fromSatoshis=function(e){return new s(e,s.satoshis)},s.fromFiat=function(e,t){return new s(e,t)},s.prototype._from=function(e,t){if(!o[t])throw new n.Unit.UnknownCode(t);return parseInt((e*o[t][0]).toFixed())},s.prototype.to=function(e){if(i.isNumber(e)){if(e<=0)throw new n.Unit.InvalidRate(e);return parseFloat((this.BTC*e).toFixed(2))}if(!o[e])throw new n.Unit.UnknownCode(e);var t=this._value/o[e][0];return parseFloat(t.toFixed(o[e][1]))},s.prototype.toBTC=function(){return this.to(s.BTC)},s.prototype.toMillis=s.prototype.toMilis=function(){return this.to(s.mBTC)},s.prototype.toMicros=s.prototype.toBits=function(){return this.to(s.bits)},s.prototype.toSatoshis=function(){return this.to(s.satoshis)},s.prototype.atRate=function(e){return this.to(e)},s.prototype.toString=function(){return this.satoshis+" satoshis"},s.prototype.toObject=s.prototype.toJSON=function(){return{amount:this.BTC,code:s.BTC}},s.prototype.inspect=function(){return""},t.exports=s},{"./errors":95,"./util/preconditions":123,lodash:149}],120:[function(e,t,r){"use strict";var i=e("lodash"),n=e("url"),a=e("./address"),o=e("./unit"),s=function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.extras={},this.knownParams=r||[],this.address=this.network=this.amount=this.message=null,"string"==typeof t){var i=e.parse(t);i.amount&&(i.amount=this._parseAmount(i.amount)),this._fromObject(i)}else{if("object"!==(void 0===t?"undefined":_typeof(t)))throw new TypeError("Unrecognized data format.");this._fromObject(t)}};s.fromString=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return new s(e)},s.fromObject=function(e){return new s(e)},s.isValid=function(e,t){try{new s(e,t)}catch(e){return!1}return!0},s.parse=function(e){var t=n.parse(e,!0);if("bitcoin:"!==t.protocol)throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(e);return t.query.address=r&&r[1]||void 0,t.query},s.Members=["address","amount","message","label","r"],s.prototype._fromObject=function(e){if(!a.isValid(e.address))throw new TypeError("Invalid bitcoin address");for(var t in this.address=new a(e.address),this.network=this.address.network,this.amount=e.amount,e)if("address"!==t&&"amount"!==t){if(/^req-/.exec(t)&&-1===this.knownParams.indexOf(t))throw Error("Unknown required argument "+t);(-1"},t.exports=s},{"./address":79,"./unit":119,lodash:149,url:500}],121:[function(o,s,e){(function(r){"use strict";var i=o("buffer"),t=o("assert"),n=o("./js"),a=o("./preconditions");function e(e,t){if(e.length!==t.length)return!1;for(var r=e.length,i=0;i>24&255),t.push(e>>16&255),t.push(e>>8&255),t.push(255&e),new r(t)},integerFromBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]<<24|e[1]<<16|e[2]<<8|e[3]},integerFromSingleByteBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]},bufferToHex:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e.toString("hex")},reverse:function(e){for(var t=new i.Buffer(e.length),r=0;r>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}}else if("le"===r)for(i=0,a=0;i>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-i&4194303,26<=(i+=24)&&(i-=26,n++)}if(r+6!==t){a=o(e,t,r+6);this.words[n]|=a<>>26-i&4194303}this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];v.prototype.toString=function(e,t){if(16===(e=e||10)||"hex"===e){for(var r="",i=0,n=(t=0|t||1,0),a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return this.sign&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var c=l[e],u=d[e],f=(r="",this.clone());for(f.sign=!1;0!==f.cmpn(0);){var p=f.modn(u).toString(e);r=0!==(f=f.idivn(u)).cmpn(0)?h[c-p.length]+p+r:p+r}return 0===this.cmpn(0)&&(r="0"+r),this.sign&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.prototype.toJSON=function(){return this.toString(16)},v.prototype.toArray=function(){this.strip();var e=new Array(this.byteLength());e[0]=0;for(var t=this.clone(),r=0;0!==t.cmpn(0);r++){var i=t.andln(255);t.ishrn(8),e[e.length-r-1]=i}return e},v.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return 4096<=t&&(r+=13,t>>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.iand=function(e){var t;this.sign=this.sign&&e.sign,t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},v.prototype.ixor=function(e){var t,r;this.sign=this.sign||e.sign,r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);for(var r=e/26|0,i=e%26;this.length<=r;)this.words[this.length++]=0;return this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,a=0;a>>26}for(;0!==n&&a>>26}if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this);this.sign=!1;t=e.sub(this);return this.sign=!0,t},v.prototype.isub=function(e){if(e.sign){e.sign=!1;var t=this.iadd(e);return e.sign=!0,t._normSign()}if(this.sign)return this.sign=!1,this.iadd(e),this.sign=!0,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.sign=!1,this.length=1,this.words[0]=0,this;i=0>26,this.words[o]=67108863&t}for(;0!==a&&o>26,this.words[o]=67108863&t}if(0===a&&o>>26,a=67108863&r,o=Math.min(i,e.length-1),s=Math.max(0,i-this.length+1);s<=o;s++){var c=i-s,u=(0|this.words[c])*(0|e.words[s]),f=67108863&u;a=67108863&(f=f+a|0),n=(n=n+(u/67108864|0)|0)+(f>>>26)|0}t.words[i]=a,r=n}return 0!==r?t.words[i]=r:t.length--,t.strip()},v.prototype._bigMulTo=function(e,t){t.sign=e.sign!==this.sign,t.length=this.length+e.length;for(var r=0,i=0,n=0;n>>26)|0)>>>26,a&=67108863}t.words[n]=o,r=a,a=i}return 0!==r?t.words[n]=r:t.length--,t.strip()},v.prototype.mulTo=function(e,t){return this.length+e.length<63?this._smallMulTo(e,t):this._bigMulTo(e,t)},v.prototype.mul=function(e){var t=new v(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},v.prototype.imul=function(e){if(0===this.cmpn(0)||0===e.cmpn(0))return this.words[0]=0,this.length=1,this;var t=this.length,r=e.length;this.sign=e.sign!==this.sign,this.length=this.length+e.length,this.words[this.length-1]=0;for(var i=this.length-2;0<=i;i--){for(var n=0,a=0,o=Math.min(i,r-1),s=Math.max(0,i-t+1);s<=o;s++){var c=i-s,u=this.words[c]*e.words[s],f=67108863&u;n+=u/67108864|0,a=67108863&(f+=a),n+=f>>>26}this.words[i]=a,this.words[i+1]+=n,n=0}for(n=0,c=1;c>>26}return this.strip()},v.prototype.imuln=function(e){g("number"==typeof e);for(var t=0,r=0;r>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.mul(this)},v.prototype.ishln=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){for(var n=0,a=0;a>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;a>>n<a){this.length-=a;for(c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(c/67108864|0),this.words[a+r]=67108863&s}for(;a>26,this.words[a+r]=67108863&s}if(0===o)return this.strip();g(-1===o);for(a=o=0;a>26,this.words[a]=67108863&s}return this.sign=!0,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.shln(r),i.ishln(r),a=n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var n;i=this.divmod(e.neg(),t);return"mod"!==t&&(n=i.div.neg()),{div:n,mod:i.mod}},v.prototype.div=function(e){return this.divmod(e,"div").div},v.prototype.mod=function(e){return this.divmod(e,"mod").mod},v.prototype.divRound=function(e){var t=this.divmod(e);if(0===t.mod.cmpn(0))return t.div;var r=t.div.sign?t.mod.isub(e):t.mod,i=e.shrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:t.div.sign?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+this.words[i])%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=this.words[r]+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.ishrn(1),r.ishrn(1),++s;for(var c=r.clone(),u=t.clone();0!==t.cmpn(0);){for(;t.isEven();)t.ishrn(1),i.isEven()&&n.isEven()?(i.ishrn(1),n.ishrn(1)):(i.iadd(c).ishrn(1),n.isub(u).ishrn(1));for(;r.isEven();)r.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(u).ishrn(1));0<=t.cmp(r)?(t.isub(r),i.isub(a),n.isub(o)):(r.isub(t),a.isub(i),o.isub(n))}return{a:a,b:o,gcd:r.ishln(s)}},v.prototype._invmp=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=r.clone();0>>26,o&=67108863,this.words[n]=o}return 0!==a&&(this.words[n]=a,this.length++),this},v.prototype.cmpn=function(e){var t,r=e<0;if(r&&(e=-e),this.sign&&!r)return-1;if(!this.sign&&r)return 1;if(e&=67108863,this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}e.words[i-10]=n>>>22,e.length-=9},a.prototype.imulK=function(e){var t;e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(i[e])return i[e];var t;if("k256"===e)t=new a;else if("p224"===e)t=new s;else if("p192"===e)t=new c;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new u}return i[e]=t},f.prototype._verify1=function(e){g(!e.sign,"red works only with positives"),g(e.red,"red works only with red numbers")},f.prototype._verify2=function(e,t){g(!e.sign&&!t.sign,"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},f.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.mod(this.m)._forceRed(this)},f.prototype.neg=function(e){var t=e.clone();return t.sign=!t.sign,t.iadd(this.m)._forceRed(this)},f.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},f.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},f.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)},f.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.shln(t))},f.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},f.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},f.prototype.isqr=function(e){return this.imul(e,e)},f.prototype.sqr=function(e){return this.mul(e,e)},f.prototype.sqrt=function(e){if(0===e.cmpn(0))return e.clone();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).ishrn(2);return f=this.pow(e,r)}for(var i=this.m.subn(1),n=0;0!==i.cmpn(0)&&0===i.andln(1);)n++,i.ishrn(1);g(0!==i.cmpn(0));var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).ishrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).ishrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>8,i[r]&=255;for(;a;)i.push(255&a),a>>=8}for(t=0;"1"===e[t]&&tt[i]?1:0);++i);return 0==r&&(t.length>e.length?r=-1:e.length>t.length&&(r=1)),r}},{}],127:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.hmacDRBG=e("./elliptic/hmac-drbg"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec")},{"../package.json":147,"./elliptic/curve":130,"./elliptic/curves":133,"./elliptic/ec":134,"./elliptic/hmac-drbg":137,"./elliptic/utils":139,brorand:140}],128:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic"),S=n.utils.getNAF,j=n.utils.getJSF,u=n.utils.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function o(e,t){this.curve=e,this.type=t,this.precomputed=null}(t.exports=a).prototype.point=function(){throw new Error("Not implemented")},a.prototype.validate=function(){throw new Error("Not implemented")},a.prototype._fixedNafMul=function(e,t){var r=e._getDoubles(),i=S(t,1),n=(1<>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i){for(var n=this._wnafT1,a=this._wnafT2,o=this._wnafT3,s=0,c=0;c>1]:x<0&&(k=a[m][-x-1>>1].neg()),b="affine"===k.type?b.mixedAdd(k):b.add(k))}}for(c=0;c":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],130:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":128,"./edwards":129,"./mont":131,"./short":132}],131:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base;function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(s,o),(t.exports=s).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)},a(c,o.BasePoint),s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.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)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.ishrn(1))n.push(t.andln(1));for(var a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../curve":130,"bn.js":124,inherits:148}],132:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.shrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.sign&&(i=i.neg(),n=n.neg()),a.sign&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(t=new w(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b).redSqrt(),i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},c.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)},c.prototype._endoWnafMulAdd=function(e,t){for(var r=this._endoWnafT1,i=this._endoWnafT2,n=0;n":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],133:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":127,"./precomputed/secp256k1":138,"hash.js":141}],134:[function(e,t,r){"use strict";var d=e("bn.js"),m=e("../../elliptic"),i=m.utils.assert,n=e("./key"),g=e("./signature");function a(e){if(!(this instanceof a))return new a(e);"string"==typeof e&&(i(m.curves.hasOwnProperty(e),"Unknown curve "+e),e=m.curves[e]),e instanceof m.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(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}(t.exports=a).prototype.keyPair=function(e){return new n(this,e)},a.prototype.keyFromPrivate=function(e,t){return n.fromPrivate(this,e,t)},a.prototype.keyFromPublic=function(e,t){return n.fromPublic(this,e,t)},a.prototype.genKeyPair=function(e){e||(e={});for(var t=new m.hmacDRBG({hash:this.hash,pers:e.pers,entropy:e.entropy||m.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new d(2));;){var n=new d(t.generate(r));if(!(0"}},{"../../elliptic":127,"bn.js":124}],136:[function(e,t,r){"use strict";var n=e("bn.js"),a=e("../../elliptic").utils,i=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16))}(t.exports=o).prototype._importDER=function(e,t){if((e=a.toArray(e,t)).length<6||48!==e[0]||2!==e[2])return!1;if(1+e[1]>e.length)return!1;var r=e[3];if(128<=r)return!1;if(4+r+2>=e.length)return!1;if(2!==e[4+r])return!1;var i=e[5+r];return!(128<=i)&&(!(4+r+2+i>e.length)&&(this.r=new n(e.slice(4,4+r)),this.s=new n(e.slice(4+r+2,4+r+2+i)),!0))},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r));var i=[48,t.length+r.length+4,2,t.length];return i=i.concat(t,[2,r.length],r),a.encode(i,e)}},{"../../elliptic":127,"bn.js":124}],137:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("../elliptic").utils,n=o.assert;function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc),r=o.toArray(e.nonce,e.nonceEnc),i=o.toArray(e.pers,e.persEnc);n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this.reseed=1},a.prototype.generate=function(e,t,r,i){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i),this._update(r));for(var n=[];n.length>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e},i.getNAF=function(e,t){for(var r=[],i=1<>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=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=n.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{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;for(a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>10),n[a-7],(r=n[a-15],b(r,7)^b(r,18)^r>>>3),n[a-16]);var o,s,c=this.h[0],u=this.h[1],f=this.h[2],p=this.h[3],h=this.h[4],l=this.h[5],d=this.h[6],m=this.h[7];F(this.k.length===n.length);for(a=0;a>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function s(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}function u(e,t){if(!e)throw new Error(t||"Assertion failed")}i.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},i.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,r){return e+t+r>>>0},i.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},i.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},i.assert=u,i.inherits=n,r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:148}],147:[function(e,t,r){t.exports={_args:[["elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib"]],_from:"elliptic@=3.0.3",_id:"elliptic@3.0.3",_inCache:!0,_location:"/bitcore-lib/elliptic",_phantomChildren:{inherits:"2.0.1"},_requested:{name:"elliptic",raw:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",rawSpec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",scope:null,spec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",type:"remote"},_requiredBy:["/bitcore-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_shasum:"865c9b420bfbe55006b9f969f97a0d2c44966595",_shrinkwrap:null,_spec:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_where:"/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^2.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},description:"EC cryptography",devDependencies:{browserify:"^3.44.2",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",optionalDependencies:{},readme:"# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic)\n\nFast elliptic-curve cryptography in a plain javascript implementation.\n\nNOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve\nfor your cryptography operations.\n\n## Incentive\n\nECC is much slower than regular RSA cryptography, the JS implementations are\neven more slower.\n\n## Benchmarks\n\n```bash\n$ node benchmarks/index.js\nBenchmarking: sign\nelliptic#sign x 262 ops/sec ±0.51% (177 runs sampled)\neccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled)\n------------------------\nFastest is elliptic#sign\n========================\nBenchmarking: verify\nelliptic#verify x 113 ops/sec ±0.50% (166 runs sampled)\neccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled)\n------------------------\nFastest is elliptic#verify\n========================\nBenchmarking: gen\nelliptic#gen x 294 ops/sec ±0.43% (176 runs sampled)\neccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled)\n------------------------\nFastest is elliptic#gen\n========================\nBenchmarking: ecdh\nelliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled)\n------------------------\nFastest is elliptic#ecdh\n========================\n```\n\n## API\n\n### ECDSA\n\n```javascript\nvar EC = require('elliptic').ec;\n\n// Create and initialize EC context\n// (better do it once and reuse it)\nvar ec = new EC('secp256k1');\n\n// Generate keys\nvar key = ec.genKeyPair();\n\n// Sign message (must be an array, or it'll be treated as a hex sequence)\nvar msg = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];\nvar signature = key.sign(msg);\n\n// Export DER encoded signature in Array\nvar derSign = signature.toDER();\n\n// Verify signature\nconsole.log(key.verify(msg, derSign));\n```\n\n### ECDH\n\n```javascript\n// Generate keys\nvar key1 = ec.genKeyPair();\nvar key2 = ec.genKeyPair();\n\nvar shared1 = key1.derive(key2.getPublic());\nvar shared2 = key2.derive(key1.getPublic());\n\nconsole.log('Both shared secrets are BN instances');\nconsole.log(shared1.toString(16));\nconsole.log(shared2.toString(16));\n```\n\nNOTE: `.derive()` returns a [BN][1] instance.\n\n## Supported curves\n\nElliptic.js support following curve types:\n\n* Short Weierstrass\n* Montgomery\n* Edwards\n* Twisted Edwards\n\nFollowing curve 'presets' are embedded into the library:\n\n* `secp256k1`\n* `p192`\n* `p224`\n* `p256`\n* `curve25519`\n* `ed25519`\n\nNOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead.\n\n### Implementation details\n\nECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of\nthe curve operations are performed on non-affine coordinates (either projective\nor extended), various windowing techniques are used for different cases.\n\nAll operations are performed in reduction context using [bn.js][1], hashing is\nprovided by [hash.js][2]\n\n### Related projects\n\n* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both\n browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for\n node)\n\n#### LICENSE\n\nThis software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2014.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://tools.ietf.org/html/rfc6979\n[1]: https://github.com/indutny/bn.js\n[2]: https://github.com/indutny/hash.js\n[3]: https://github.com/bitchan/eccrypto\n[4]: https://github.com/wanderer/secp256k1-node\n",readmeFilename:"README.md",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{test:"make lint && mocha --reporter=spec test/*-test.js"},version:"3.0.3"}},{}],148:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{dup:68}],149:[function(e,y,_){(function(b){(function(){var dn,e,t,mn="3.10.1",gn=1,vn=2,bn=4,yn=8,_n=16,wn=32,kn=64,xn=128,Sn=256,jn=30,En="...",An=150,In=16,Pn=200,On=1,Tn=2,Bn="Expected a function",Cn="__lodash_placeholder__",Fn="[object Arguments]",Rn="[object Array]",zn="[object Boolean]",Mn="[object Date]",Nn="[object Error]",Dn="[object Function]",r="[object Map]",qn="[object Number]",Ln="[object Object]",Un="[object RegExp]",i="[object Set]",Hn="[object String]",n="[object WeakMap]",Kn="[object ArrayBuffer]",Vn="[object Float32Array]",Gn="[object Float64Array]",$n="[object Int8Array]",Wn="[object Int16Array]",Zn="[object Int32Array]",Yn="[object Uint8Array]",Xn="[object Uint8ClampedArray]",Jn="[object Uint16Array]",Qn="[object Uint32Array]",ea=/\b__p \+= '';/g,ta=/\b(__p \+=) '' \+/g,ra=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ia=/&(?:amp|lt|gt|quot|#39|#96);/g,na=/[&<>"'`]/g,aa=RegExp(ia.source),oa=RegExp(na.source),sa=/<%-([\s\S]+?)%>/g,ca=/<%([\s\S]+?)%>/g,ua=/<%=([\s\S]+?)%>/g,fa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,pa=/^\w*$/,ha=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,la=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,da=RegExp(la.source),ma=/[\u0300-\u036f\ufe20-\ufe23]/g,ga=/\\(\\)?/g,va=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ba=/\w*$/,ya=/^0[xX]/,_a=/^\[object .+?Constructor\]$/,wa=/^\d+$/,ka=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xa=/($^)/,Sa=/['\n\r\u2028\u2029\\]/g,ja=(e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",t="[a-z\\xdf-\\xf6\\xf8-\\xff]+",RegExp(e+"+(?="+e+t+")|"+e+"?"+t+"|"+e+"+|[0-9]+","g")),Ea=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Aa=-1,Ia={};Ia[Vn]=Ia[Gn]=Ia[$n]=Ia[Wn]=Ia[Zn]=Ia[Yn]=Ia[Xn]=Ia[Jn]=Ia[Qn]=!0,Ia[Fn]=Ia[Rn]=Ia[Kn]=Ia[zn]=Ia[Mn]=Ia[Nn]=Ia[Dn]=Ia[r]=Ia[qn]=Ia[Ln]=Ia[Un]=Ia[i]=Ia[Hn]=Ia[n]=!1;var Pa={};Pa[Fn]=Pa[Rn]=Pa[Kn]=Pa[zn]=Pa[Mn]=Pa[Vn]=Pa[Gn]=Pa[$n]=Pa[Wn]=Pa[Zn]=Pa[qn]=Pa[Ln]=Pa[Un]=Pa[Hn]=Pa[Yn]=Pa[Xn]=Pa[Jn]=Pa[Qn]=!0,Pa[Nn]=Pa[Dn]=Pa[r]=Pa[i]=Pa[n]=!1;var a={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},o={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},s={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},c={function:!0,object:!0},u={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},f={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},p=c[void 0===_?"undefined":_typeof(_)]&&_&&!_.nodeType&&_,h=c[void 0===y?"undefined":_typeof(y)]&&y&&!y.nodeType&&y,l=p&&h&&"object"==(void 0===b?"undefined":_typeof(b))&&b&&b.Object&&b,d=c["undefined"==typeof self?"undefined":_typeof(self)]&&self&&self.Object&&self,m=c["undefined"==typeof window?"undefined":_typeof(window)]&&window&&window.Object&&window,g=h&&h.exports===p&&p,Oa=l||m!==(this&&this.window)&&m||d||this;function Ta(e,t){if(e!==t){var r=null===e,i=e===dn,n=e==e,a=null===t,o=t===dn,s=t==t;if(t>>1,$=9007199254740991,W=O&&new O,Z={};function Y(e){if(Ka(e)&&!ui(e)&&!(e instanceof Q)){if(e instanceof J)return e;if(_.call(e,"__chain__")&&_.call(e,"__wrapped__"))return Qt(e)}return new J(e)}function X(){}function J(e,t,r){this.__wrapped__=e,this.__actions__=r||[],this.__chain__=!!t}Y.support={};function Q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function ee(){this.__data__={}}function te(e){var t=e?e.length:0;for(this.data={hash:B(null),set:new j};t--;)this.push(e[t])}function re(e,t){var r=e.data;return("string"==typeof t||li(t)?r.set.has(t):r.hash[t])?0:-1}function ie(e,t){var r=-1,i=e.length;for(t||(t=P(i));++r=Pn?st(t):null,c=t.length;s&&(a=re,o=!1,t=s);e:for(;++n>>0,t>>>=0;for(var a=P(n);++i>>1,o=e[a];(r?o<=t:o=Pn)return n.plant(t).value();for(var r=0,i=a?o[r].apply(this,e):t;++r=An)return e}else Gt=0;return Ue(e,t)});function Zt(e){for(var t=Ri(e),r=t.length,i=r&&e.length,n=!!i&&Ut(i)&&(ui(e)||ci(e)),a=-1,o=[];++a>>0,r>>>=0;r=N(t,r)&&e=(e=Ra(e)).length)return e;var o=i-n.length;if(o<1)return n;var s=e.slice(0,o);if(null==a)return s+n;if(vi(a)){if(e.slice(o).search(a)){var c,u,f=e.slice(0,o);for(a.global||(a=b(a.source,(ba.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(f);)u=c.index;s=s.slice(0,null==u?o:u)}}else if(e.indexOf(a,o)!=o){var p=s.lastIndexOf(a);-1=0.13.7 <0.14.0",_id:"bitcore-lib@0.13.19",_inCache:!0,_installable:!0,_location:"/bitcore-lib",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/bitcore-lib-0.13.19.tgz_1470850061596_0.2146058666985482"},_npmUser:{email:"braydon@bitpay.com",name:"braydonf"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{name:"bitcore-lib",raw:"bitcore-lib@^0.13.7",rawSpec:"^0.13.7",scope:null,spec:">=0.13.7 <0.14.0",type:"range"},_requiredBy:["/","/bitcore-message"],_resolved:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz",_shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",_shrinkwrap:{dependencies:{"bn.js":{from:"bn.js@=2.0.4",resolved:"https://registry.npmjs.org/bn.js/-/bn.js-2.0.4.tgz",version:"2.0.4"},bs58:{from:"bs58@=2.0.0",resolved:"https://registry.npmjs.org/bs58/-/bs58-2.0.0.tgz",version:"2.0.0"},"buffer-compare":{from:"buffer-compare@=1.0.0",resolved:"https://registry.npmjs.org/buffer-compare/-/buffer-compare-1.0.0.tgz",version:"1.0.0"},elliptic:{dependencies:{brorand:{from:"brorand@^1.0.1",resolved:"https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz",version:"1.0.5"},"hash.js":{from:"hash.js@=1.0.3",resolved:"https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz",version:"1.0.3"}},from:"elliptic@=3.0.3",resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",version:"3.0.3"},inherits:{from:"inherits@=2.0.1",resolved:"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",version:"2.0.1"},lodash:{from:"lodash@=3.10.1",resolved:"https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",version:"3.10.1"}},name:"bitcore",version:"0.13.18"},_spec:"bitcore-lib@^0.13.7",_where:"/home/administrator/javascript-opentimestamps",author:{email:"dev@bitpay.com",name:"BitPay"},browser:{request:"browser-request"},bugs:{url:"https://github.com/bitpay/bitcore-lib/issues"},contributors:[{name:"Manuel Araoz",email:"manuelaraoz@gmail.com"},{name:"Daniel Cousens",email:"bitcoin@dcousens.com"},{name:"Gordon Hall",email:"gordon@bitpay.com"},{name:"Jeff Garzik",email:"jgarzik@bitpay.com"},{name:"Kyle Drake",email:"kyle@kyledrake.net"},{name:"Esteban Ordano",email:"eordano@gmail.com"},{name:"Matias Alejo Garcia",email:"ematiu@gmail.com"},{name:"Ryan X. Charles",email:"ryanxcharles@gmail.com"},{name:"Stefan Thomas",email:"moon@justmoon.net"},{name:"Stephen Pair",email:"stephen@bitpay.com"},{name:"Wei Lu",email:"luwei.here@gmail.com"}],dependencies:{"bn.js":"=2.0.4",bs58:"=2.0.0","buffer-compare":"=1.0.0",elliptic:"=3.0.3",inherits:"=2.0.1",lodash:"=3.10.1"},description:"A pure and powerful JavaScript Bitcoin library.",devDependencies:{"bitcore-build":"github:bitpay/bitcore-build",brfs:"^1.2.0",chai:"^1.10.0",gulp:"^3.8.10",sinon:"^1.13.0"},directories:{},dist:{shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",tarball:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz"},gitHead:"9517864f14d09700f3fd02ff61173003c0280774",homepage:"https://github.com/bitpay/bitcore-lib#readme",keywords:["address","bip21","bip32","bip37","bip69","bip70","bitcoin","blockchain","cryptocurrency","ecies","multisig","p2p","payment","transaction"],license:"MIT",main:"index.js",maintainers:[{name:"braydonf",email:"braydon@bitpay.com"},{name:"gabegattis",email:"gabegattis@gmail.com"},{name:"gasteve",email:"stephen@pairhome.net"},{name:"patrickbitpay",email:"patrick@bitpay.com"}],name:"bitcore-lib",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/bitpay/bitcore-lib.git"},scripts:{build:"gulp",coverage:"gulp coverage",lint:"gulp lint",test:"gulp test"},version:"0.13.19"}},{}],151:[function(e,t,r){var i=e("bitcore-lib");i.Message=e("./lib/message"),t.exports=i.Message},{"./lib/message":152,"bitcore-lib":78}],152:[function(r,d,e){(function(o){"use strict";var e=r("bitcore-lib"),s=e.deps._,i=e.PrivateKey,n=e.PublicKey,c=e.Address,a=e.encoding.BufferWriter,u=e.crypto.ECDSA,f=e.crypto.Signature,p=e.crypto.Hash.sha256sha256,t=e.util.js,h=e.util.preconditions,l=function e(t){return this instanceof e?(h.checkArgument(s.isString(t),"First argument should be a string"),this.message=t,this):new e(t)};l.MAGIC_BYTES=new o("Bitcoin Signed Message:\n"),l.prototype.magicHash=function(){var e=a.varintBufNum(l.MAGIC_BYTES.length),t=new o(this.message),r=a.varintBufNum(t.length),i=o.concat([e,l.MAGIC_BYTES,r,t]);return p(i)},l.prototype._sign=function(e){h.checkArgument(e instanceof i,"First argument should be an instance of PrivateKey");var t=this.magicHash(),r=new u;return r.hashbuf=t,r.privkey=e,r.pubkey=e.toPublicKey(),r.signRandomK(),r.calci(),r.sig},l.prototype.sign=function(e){return this._sign(e).toCompact().toString("base64")},l.prototype._verify=function(e,t){h.checkArgument(e instanceof n,"First argument should be an instance of PublicKey"),h.checkArgument(t instanceof f,"Second argument should be an instance of Signature");var r=this.magicHash(),i=u.verify(r,t,e);return i||(this.error="The signature was invalid"),i},l.prototype.verify=function(e,t){h.checkArgument(e),h.checkArgument(t&&s.isString(t)),s.isString(e)&&(e=c.fromString(e));var r=f.fromCompact(new o(t,"base64")),i=new u;i.hashbuf=this.magicHash(),i.sig=r;var n=i.toPublicKey(),a=c.fromPublicKey(n,e.network);return e.toString()!==a.toString()?!(this.error="The signature did not match the message digest"):this._verify(n,r)},l.fromString=function(e){return new l(e)},l.fromJSON=function(e){return t.isValidJSON(e)&&(e=JSON.parse(e)),new l(e.message)},l.prototype.toObject=function(){return{message:this.message}},l.prototype.toJSON=function(){return JSON.stringify(this.toObject())},l.prototype.toString=function(){return this.message},l.prototype.inspect=function(){return""},d.exports=l}).call(this,r("buffer").Buffer)},{"bitcore-lib":78,buffer:191}],153:[function(e,r,i){(function(Q,U,u){!function(e){if("object"==(void 0===i?"undefined":_typeof(i))&&void 0!==r)r.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:void 0!==U?t=U:"undefined"!=typeof self&&(t=self),t.Promise=e()}}(function(){var e,t,r;return function a(o,s,c){function u(r,e){if(!s[r]){if(!o[r]){var t="function"==typeof _dereq_&&_dereq_;if(!e&&t)return t(r,!0);if(f)return f(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[r]={exports:{}};o[r][0].call(n.exports,function(e){var t=o[r][1][e];return u(t||e)},n,n.exports,a,o,s,c)}return s[r].exports}for(var f="function"==typeof _dereq_&&_dereq_,e=0;e, no stack trace)"}function V(){return"function"==typeof Y}var G=function(){return!1},$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function W(e){var t=e.match($);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function Z(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);Y(this,Z),32=a)return r[t]=e,this._queue.push(t),!1;null!==n&&(n[t]=e);var o=this._promise,s=this._callback,c=o._boundValue();o._pushContext();var u=g(s).call(c,e,t,i),f=o._popContext();if(m.checkForgottenReturns(u,f,null!==n?"Promise.filter":"Promise.map",o),u===v)return this._reject(u.e),!0;var p=d(u,this._promise);if(p instanceof l){var h=(p=p._target())._bitField;if(0==(50397184&h))return 1<=a&&this._inFlight++,(r[t]=p)._proxy(this,-1*(t+1)),!1;if(0==(33554432&h))return 0!=(16777216&h)?this._reject(p._reason()):this._cancel(),!0;u=p._value()}r[t]=u}return i<=++this._totalResolved&&(null!==n?this._filter(r,n):this._resolve(r),!0)},f.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;0>>16)){if(e===this){var r=c();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,0<(65535&t)&&(0!=(134217728&t)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},E.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,d.isNode);0<(65535&t)?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},E.prototype._fulfillPromises=function(e,t){for(var r=1;r=this._length&&(this._resolve(this._values),!0)},t.prototype._promiseCancelled=function(){return this._cancel(),!0},t.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},t.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof s)e.cancel();else for(var t=0;t=this._length){var r;if(this._isMap)r=function(e){for(var t=new s,r=e.length/2|0,i=0;i>1},i.prototype.props=function(){return r(this)},i.props=function(e){return r(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function i(e){this._capacity=e,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},n.prototype._promiseFulfilled=function(e,t){var r=new i;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},n.prototype._promiseRejected=function(e,t){var r=new i;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},e.settle=function(e){return r.deprecated(".settle()",".reflect()"),new n(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(f,e,t){"use strict";e.exports=function(e,t,n){var r=f("./util"),i=f("./errors").RangeError,a=f("./errors").AggregateError,o=r.isArray,s={};function c(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function u(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new c(e),i=r.promise();return r.setHowMany(t),r.init(),i}r.inherits(c,t),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=o(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(e){this._howMany=e},c.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(s),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);else if("le"===r)for(n=i=0;i>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-a&4194303,26<=(a+=24)&&(a-=26,i++);r+6!==t&&(n=o(e,t,r+6),this.words[i]|=n<>>26-a&4194303),this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=67108863&o,c=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,p=67108863&c,h=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=h;l++){var d=u-l|0;f+=(o=(n=0|e.words[d])*(a=0|t.words[l])+p)/67108864|0,p=67108863&o}r.words[u]=0|p,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}v.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,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}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)&&2<=e&&e<=36){var c=l[e],u=d[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var p=f.modn(u).toString(e);r=(f=f.idivn(u)).isZero()?p+r:h[c-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.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]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},v.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)},v.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},v.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},v.prototype.inotn=function(e){g("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},v.prototype.notn=function(e){return this.clone().inotn(e)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);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,e):(r=e,this);for(var n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},v.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;i=0>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],d=8191&l,m=l>>>13,g=0|o[2],v=8191&g,b=g>>>13,y=0|o[3],_=8191&y,w=y>>>13,k=0|o[4],x=8191&k,S=k>>>13,j=0|o[5],E=8191&j,A=j>>>13,I=0|o[6],P=8191&I,O=I>>>13,T=0|o[7],B=8191&T,C=T>>>13,F=0|o[8],R=8191&F,z=F>>>13,M=0|o[9],N=8191&M,D=M>>>13,q=0|s[0],L=8191&q,U=q>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],$=8191&G,W=G>>>13,Z=0|s[3],Y=8191&Z,X=Z>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],ae=8191&ne,oe=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],pe=8191&fe,he=fe>>>13,le=0|s[9],de=8191&le,me=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(p,L))|0)+((8191&(n=(n=Math.imul(p,U))+Math.imul(h,L)|0))<<13)|0;u=((a=Math.imul(h,U))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,L),n=(n=Math.imul(d,U))+Math.imul(m,L)|0,a=Math.imul(m,U);var ve=(u+(i=i+Math.imul(p,K)|0)|0)+((8191&(n=(n=n+Math.imul(p,V)|0)+Math.imul(h,K)|0))<<13)|0;u=((a=a+Math.imul(h,V)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(b,L)|0,a=Math.imul(b,U),i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,V)|0;var be=(u+(i=i+Math.imul(p,$)|0)|0)+((8191&(n=(n=n+Math.imul(p,W)|0)+Math.imul(h,$)|0))<<13)|0;u=((a=a+Math.imul(h,W)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(_,L),n=(n=Math.imul(_,U))+Math.imul(w,L)|0,a=Math.imul(w,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,i=i+Math.imul(d,$)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,W)|0;var ye=(u+(i=i+Math.imul(p,Y)|0)|0)+((8191&(n=(n=n+Math.imul(p,X)|0)+Math.imul(h,Y)|0))<<13)|0;u=((a=a+Math.imul(h,X)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(x,L),n=(n=Math.imul(x,U))+Math.imul(S,L)|0,a=Math.imul(S,U),i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,W)|0,i=i+Math.imul(d,Y)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,X)|0;var _e=(u+(i=i+Math.imul(p,Q)|0)|0)+((8191&(n=(n=n+Math.imul(p,ee)|0)+Math.imul(h,Q)|0))<<13)|0;u=((a=a+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(A,L)|0,a=Math.imul(A,U),i=i+Math.imul(x,K)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,V)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,W)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(b,Y)|0,a=a+Math.imul(b,X)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0;var we=(u+(i=i+Math.imul(p,re)|0)|0)+((8191&(n=(n=n+Math.imul(p,ie)|0)+Math.imul(h,re)|0))<<13)|0;u=((a=a+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(O,L)|0,a=Math.imul(O,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,V)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,W)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,X)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0;var ke=(u+(i=i+Math.imul(p,ae)|0)|0)+((8191&(n=(n=n+Math.imul(p,oe)|0)+Math.imul(h,ae)|0))<<13)|0;u=((a=a+Math.imul(h,oe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(C,L)|0,a=Math.imul(C,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(O,K)|0,a=a+Math.imul(O,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,W)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(S,Y)|0,a=a+Math.imul(S,X)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ie)|0,i=i+Math.imul(d,ae)|0,n=(n=n+Math.imul(d,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var xe=(u+(i=i+Math.imul(p,ce)|0)|0)+((8191&(n=(n=n+Math.imul(p,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((a=a+Math.imul(h,ue)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(R,L),n=(n=Math.imul(R,U))+Math.imul(z,L)|0,a=Math.imul(z,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,W)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ie)|0,i=i+Math.imul(v,ae)|0,n=(n=n+Math.imul(v,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,i=i+Math.imul(d,ce)|0,n=(n=n+Math.imul(d,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0;var Se=(u+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,he)|0)+Math.imul(h,pe)|0))<<13)|0;u=((a=a+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,U))+Math.imul(D,L)|0,a=Math.imul(D,U),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(z,K)|0,a=a+Math.imul(z,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,W)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,Y)|0,a=a+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ie)|0,i=i+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,i=i+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,ue)|0,i=i+Math.imul(d,pe)|0,n=(n=n+Math.imul(d,he)|0)+Math.imul(m,pe)|0,a=a+Math.imul(m,he)|0;var je=(u+(i=i+Math.imul(p,de)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(h,de)|0))<<13)|0;u=((a=a+Math.imul(h,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(N,K),n=(n=Math.imul(N,V))+Math.imul(D,K)|0,a=Math.imul(D,V),i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,W)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,W)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(C,Y)|0,a=a+Math.imul(C,X)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ie)|0,i=i+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,ue)|0,i=i+Math.imul(v,pe)|0,n=(n=n+Math.imul(v,he)|0)+Math.imul(b,pe)|0,a=a+Math.imul(b,he)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;u=((a=a+Math.imul(m,me)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(N,$),n=(n=Math.imul(N,W))+Math.imul(D,$)|0,a=Math.imul(D,W),i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,X)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ie)|0,i=i+Math.imul(E,ae)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,i=i+Math.imul(x,ce)|0,n=(n=n+Math.imul(x,ue)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,ue)|0,i=i+Math.imul(_,pe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,pe)|0,a=a+Math.imul(w,he)|0;var Ae=(u+(i=i+Math.imul(v,de)|0)|0)+((8191&(n=(n=n+Math.imul(v,me)|0)+Math.imul(b,de)|0))<<13)|0;u=((a=a+Math.imul(b,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(N,Y),n=(n=Math.imul(N,X))+Math.imul(D,Y)|0,a=Math.imul(D,X),i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ie)|0,i=i+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,i=i+Math.imul(x,pe)|0,n=(n=n+Math.imul(x,he)|0)+Math.imul(S,pe)|0,a=a+Math.imul(S,he)|0;var Ie=(u+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,me)|0)+Math.imul(w,de)|0))<<13)|0;u=((a=a+Math.imul(w,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(N,Q),n=(n=Math.imul(N,ee))+Math.imul(D,Q)|0,a=Math.imul(D,ee),i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ie)|0,i=i+Math.imul(B,ae)|0,n=(n=n+Math.imul(B,oe)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,ue)|0,i=i+Math.imul(E,pe)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(A,pe)|0,a=a+Math.imul(A,he)|0;var Pe=(u+(i=i+Math.imul(x,de)|0)|0)+((8191&(n=(n=n+Math.imul(x,me)|0)+Math.imul(S,de)|0))<<13)|0;u=((a=a+Math.imul(S,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(N,re),n=(n=Math.imul(N,ie))+Math.imul(D,re)|0,a=Math.imul(D,ie),i=i+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,i=i+Math.imul(B,ce)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,ue)|0,i=i+Math.imul(P,pe)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(O,pe)|0,a=a+Math.imul(O,he)|0;var Oe=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(A,de)|0))<<13)|0;u=((a=a+Math.imul(A,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(N,ae),n=(n=Math.imul(N,oe))+Math.imul(D,ae)|0,a=Math.imul(D,oe),i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(z,ce)|0,a=a+Math.imul(z,ue)|0,i=i+Math.imul(B,pe)|0,n=(n=n+Math.imul(B,he)|0)+Math.imul(C,pe)|0,a=a+Math.imul(C,he)|0;var Te=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(O,de)|0))<<13)|0;u=((a=a+Math.imul(O,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(N,ce),n=(n=Math.imul(N,ue))+Math.imul(D,ce)|0,a=Math.imul(D,ue),i=i+Math.imul(R,pe)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(z,pe)|0,a=a+Math.imul(z,he)|0;var Be=(u+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,me)|0)+Math.imul(C,de)|0))<<13)|0;u=((a=a+Math.imul(C,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(N,pe),n=(n=Math.imul(N,he))+Math.imul(D,pe)|0,a=Math.imul(D,he);var Ce=(u+(i=i+Math.imul(R,de)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(z,de)|0))<<13)|0;u=((a=a+Math.imul(z,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Fe=(u+(i=Math.imul(N,de))|0)+((8191&(n=(n=Math.imul(N,me))+Math.imul(D,de)|0))<<13)|0;return u=((a=Math.imul(D,me))+(n>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,c[0]=ge,c[1]=ve,c[2]=be,c[3]=ye,c[4]=_e,c[5]=we,c[6]=ke,c[7]=xe,c[8]=Se,c[9]=je,c[10]=Ee,c[11]=Ae,c[12]=Ie,c[13]=Pe,c[14]=Oe,c[15]=Te,c[16]=Be,c[17]=Ce,c[18]=Fe,0!==u&&(c[19]=u,r.length++),r};function s(e,t,r){return(new c).mulp(e,t,r)}function c(e,t){this.x=e,this.y=t}Math.imul||(a=n),v.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?a(this,e,t):r<63?n(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,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},c.prototype.makeRBT=function(e){for(var t=new Array(e),r=v.prototype._countBits(e)-1,i=0;i>=1;return i},c.prototype.permute=function(e,t,r,i,n,a){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*a+1]=8191&n,n>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.muln=function(e){return this.clone().imuln(e)},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.imul(this.clone())},v.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 v(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<a)for(this.length-=a,c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},v.prototype.ishrn=function(e,t,r){return g(0===this.negative),this.iushrn(e,t,r)},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.ushln=function(e){return this.clone().iushln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.ushrn=function(e){return this.clone().iushrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===o)return this.strip();for(g(-1===o),i=o=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,a},v.prototype.div=function(e){return this.divmod(e,"div",!1).div},v.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},v.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},v.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),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(0===e.negative),g(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var c=r.clone(),u=t.clone();!t.isZero();){for(var f=0,p=1;0==(t.words[0]&p)&&f<26;++f,p<<=1);if(0>>26,o&=67108863,this.words[a]=o}return 0!==n&&(this.words[a]=n,this.length++),this},v.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},v.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(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(u[e])return u[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new b;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return u[e]=t},w.prototype._verify1=function(e){g(0===e.negative,"red works only with positives"),g(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){g(0==(e.negative|t.negative),"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},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 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&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();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);g(!i.isZero());var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==a?(a<<=1,a|=f,(4===++o||0===i&&0===u)&&(n=this.mul(n,r[a]),a=o=0)):o=0}s=26}return n},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},v.mont=function(e){return new k(e)},r(k,w),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.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),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new v(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:157}],155:[function(e,t,r){var A=e("concat-map"),I=e("balanced-match");t.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function t(e,r){var i=[];var n=I("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var s=a||o;var c=0<=n.body.indexOf(",");if(!s&&!c)return n.post.match(/,.*\}/)?(e=n.pre+"{"+n.body+P+n.post,t(e)):[e];var u;if(s)u=n.body.split(/\.\./);else if(1===(u=T(n.body)).length&&1===(u=t(u[0],!1).map(B)).length){var f=n.post.length?t(n.post,!1):[""];return f.map(function(e){return n.pre+u[0]+e})}var p=n.pre;var f=n.post.length?t(n.post,!1):[""];var h;if(s){var l=O(u[0]),d=O(u[1]),m=Math.max(u[0].length,u[1].length),g=3==u.length?Math.abs(O(u[2])):1,v=F,b=d>>24]^f[d>>>16&255]^p[m>>>8&255]^h[255&g]^t[v++],o=u[d>>>24]^f[m>>>16&255]^p[g>>>8&255]^h[255&l]^t[v++],s=u[m>>>24]^f[g>>>16&255]^p[l>>>8&255]^h[255&d]^t[v++],c=u[g>>>24]^f[l>>>16&255]^p[d>>>8&255]^h[255&m]^t[v++],l=a,d=o,m=s,g=c;return a=(i[l>>>24]<<24|i[d>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[v++],o=(i[d>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&l])^t[v++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[l>>>8&255]<<8|i[255&d])^t[v++],c=(i[g>>>24]<<24|i[l>>>16&255]<<16|i[d>>>8&255]<<8|i[255&m])^t[v++],[a>>>=0,o>>>=0,s>>>=0,c>>>=0]}var p=[0,1,2,4,8,16,32,64,128,27,54],h=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=[[],[],[],[]],a=[[],[],[],[]],o=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;var f=e[i[r[o]=u]=o],p=e[f],h=e[p],l=257*e[u]^16843008*u;n[0][o]=l<<24|l>>>8,n[1][o]=l<<16|l>>>16,n[2][o]=l<<8|l>>>24,n[3][o]=l,l=16843009*h^65537*p^257*f^16843008*o,a[0][u]=l<<24|l>>>8,a[1][u]=l<<16|l>>>16,a[2][u]=l<<8|l>>>24,a[3][u]=l,0===o?o=s=1:(o=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();function s(e){this._key=a(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],a=0;a>>24,o=h.SBOX[o>>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o],o^=p[a/t|0]<<24):6>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o]),n[a]=n[a-t]^o}for(var s=[],c=0;c>>24]]^h.INV_SUB_MIX[1][h.SBOX[f>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[f>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return o(e=a(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=a(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":447}],159:[function(e,t,r){var o=e("./aes"),u=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),f=e("./ghash"),n=e("buffer-xor"),p=e("./incr32");function a(e,t,r,i){s.call(this);var n=u.alloc(4,0);this._cipher=new o.AES(t);var a=this._cipher.encryptBlock(n);this._ghash=new f(a),r=function(e,t,r){if(12===t.length)return e._finID=u.concat([t,u.from([0,0,0,1])]),u.concat([t,u.from([0,0,0,2])]);var i=new f(r),n=t.length,a=n%16;i.update(t),a&&(a=16-a,i.update(u.alloc(a,0))),i.update(u.alloc(8,0));var o=8*n,s=u.alloc(8);s.writeUIntBE(o,0,8),i.update(s),e._finID=i.state;var c=u.from(e._finID);return p(c),c}(this,r,a),this._prev=u.from(r),this._cache=u.allocUnsafe(0),this._secCache=u.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(a,s),a.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=u.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},a.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(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;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":447}],164:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],165:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":190}],166:[function(e,t,r){var a=e("safe-buffer").Buffer,o=e("buffer-xor");function s(e,t,r){var i=t.length,n=o(t,e._cache);return e._cache=e._cache.slice(i),e._prev=a.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=a.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=a.allocUnsafe(0)),!(e._cache.length<=t.length)){n=a.concat([n,s(e,t,r)]);break}i=e._cache.length,n=a.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":190,"safe-buffer":447}],167:[function(e,t,r){var o=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,a=-1,o=0;++a<8;)i=t&1<<7-a?128:0,o+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>a%8,e._prev=c(e._prev,r?i:n);return o}function c(e,t){var r=e.length,i=-1,n=o.allocUnsafe(e.length);for(e=o.concat([e,o.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=o.allocUnsafe(i),a=-1;++a=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var a=m(r);if("ec"===a.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=g[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new d(i),a=r.data.subjectPrivateKey.data;return n.verify(t,e,a)}(e,t,a)}if("dsa"===a.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,a=r.data.g,o=r.data.pub_key,s=m.signature.decode(e,"der"),c=s.s,u=s.r;v(c,n),v(u,n);var f=l.mont(i),p=c.invm(n);return 0===a.toRed(f).redPow(new l(t).mul(p).mod(n)).fromRed().mul(o.toRed(f).redPow(u.mul(p).mod(n)).fromRed()).mod(i).mod(n).cmp(u)}(e,t,a)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var o=a.modulus.byteLength(),s=[1],c=0;t.length+s.length+2l.UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function h(e,t){for(var r=0;rm.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsm.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelm.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelm.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=m.Z_FILTERED&&e.strategy!=m.Z_HUFFMAN_ONLY&&e.strategy!=m.Z_RLE&&e.strategy!=m.Z_FIXED&&e.strategy!=m.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!g.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new o.Zlib(t);var i=this;this._hadError=!1,this._binding.onerror=function(e,t){i._binding=null,i._hadError=!0;var r=new Error(e);r.errno=t,r.code=m.codes[t],i.emit("error",r)};var r=m.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(r=e.level);var n=m.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(n=e.strategy),this._binding.init(e.windowBits||m.Z_DEFAULT_WINDOWBITS,r,e.memLevel||m.Z_DEFAULT_MEMLEVEL,n,e.dictionary),this._buffer=new g(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=n,this.once("end",this.close)}o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION,Object.keys(o).forEach(function(e){e.match(/^Z/)&&(m[e]=o[e])}),m.codes={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},Object.keys(m.codes).forEach(function(e){m.codes[m.codes[e]]=e}),m.Deflate=s,m.Inflate=c,m.Gzip=u,m.Gunzip=f,m.DeflateRaw=p,m.InflateRaw=h,m.Unzip=l,m.createDeflate=function(e){return new s(e)},m.createInflate=function(e){return new c(e)},m.createDeflateRaw=function(e){return new p(e)},m.createInflateRaw=function(e){return new h(e)},m.createGzip=function(e){return new u(e)},m.createGunzip=function(e){return new f(e)},m.createUnzip=function(e){return new l(e)},m.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new s(t),e,r)},m.deflateSync=function(e,t){return r(new s(t),e)},m.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new u(t),e,r)},m.gzipSync=function(e,t){return r(new u(t),e)},m.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new p(t),e,r)},m.deflateRawSync=function(e,t){return r(new p(t),e)},m.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new l(t),e,r)},m.unzipSync=function(e,t){return r(new l(t),e)},m.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new c(t),e,r)},m.inflateSync=function(e,t){return r(new c(t),e)},m.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new f(t),e,r)},m.gunzipSync=function(e,t){return r(new f(t),e)},m.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new h(t),e,r)},m.inflateRawSync=function(e,t){return r(new h(t),e)},e.inherits(t,a),t.prototype.params=function(e,t,r){if(em.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=m.Z_FILTERED&&t!=m.Z_HUFFMAN_ONLY&&t!=m.Z_RLE&&t!=m.Z_FIXED&&t!=m.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var i=this;this.flush(o.Z_SYNC_FLUSH,function(){i._binding.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())})}else n.nextTick(r)},t.prototype.reset=function(){return this._binding.reset()},t.prototype._flush=function(e){this._transform(new g(0),"",e)},t.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=o.Z_FULL_FLUSH),r.ended)t&&n.nextTick(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var i=this;this.once("drain",function(){i.flush(t)})}else this._flushFlag=e,this.write(new g(0),"",t)},t.prototype.close=function(e){if(e&&n.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;n.nextTick(function(){t.emit("close")})}},t.prototype._transform=function(e,t,r){var i,n=this._writableState,a=(n.ending||n.ended)&&(!e||n.length===e.length);if(null===!e&&!g.isBuffer(e))return r(new Error("invalid input"));a?i=o.Z_FINISH:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH));this._processChunk(e,i,r)},t.prototype._processChunk=function(a,o,s){var c=a&&a.length,u=this._chunkSize-this._offset,f=0,p=this,h="function"==typeof s;if(!h){var t,l=[],d=0;this.on("error",function(e){t=e});do{var e=this._binding.writeSync(o,a,f,c,this._buffer,this._offset,u)}while(!this._hadError&&m(e[0],e[1]));if(this._hadError)throw t;var r=g.concat(l,d);return this.close(),r}var i=this._binding.write(o,a,f,c,this._buffer,this._offset,u);function m(e,t){if(!p._hadError){var r=u-t;if(v(0<=r,"have should not go down"),0=p._chunkSize)&&(u=p._chunkSize,p._offset=0,p._buffer=new g(p._chunkSize)),0===t){if(f+=c-e,c=e,!h)return!0;var n=p._binding.write(o,a,f,c,p._buffer,p._offset,p._chunkSize);return n.callback=m,void(n.buffer=a)}if(!h)return!1;s()}}i.buffer=a,i.callback=m},e.inherits(s,t),e.inherits(c,t),e.inherits(u,t),e.inherits(f,t),e.inherits(p,t),e.inherits(h,t),e.inherits(l,t)}).call(this,d("_process"),d("buffer").Buffer)},{"./binding":185,_process:382,_stream_transform:427,assert:67,buffer:191,util:505}],187:[function(e,t,r){arguments[4][157][0].apply(r,arguments)},{dup:157}],188:[function(e,B,C){(function(T){!function(e){var t="object"==(void 0===C?"undefined":_typeof(C))&&C&&!C.nodeType&&C,r="object"==(void 0===B?"undefined":_typeof(B))&&B&&!B.nodeType&&B,i="object"==(void 0===T?"undefined":_typeof(T))&&T;i.global!==i&&i.window!==i&&i.self!==i||(e=i);var n,a,v=2147483647,b=36,y=1,_=26,o=38,s=700,w=72,k=128,x="-",c=/^xn--/,u=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=b-y,S=Math.floor,j=String.fromCharCode;function E(e){throw new RangeError(p[e])}function l(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function d(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((v-d)/o))&&E("overflow"),d+=c*o,!(c<(u=s<=g?y:g+_<=s?_:s-g));s+=b)o>S(v/(f=b-u))&&E("overflow"),o*=f;g=O(d-a,t=h.length+1,0==a),S(d/t)>v-m&&E("overflow"),m+=S(d/t),d%=t,h.splice(d++,0,m)}return I(h)}function g(e){var t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g=[];for(h=(e=A(e)).length,t=k,a=w,o=r=0;oS((v-r)/(l=i+1))&&E("overflow"),r+=(s-t)*l,t=s,o=0;ov&&E("overflow"),p==t){for(c=r,u=b;!(c<(f=u<=a?y:a+_<=u?_:u-a));u+=b)m=c-f,d=b-f,g.push(j(P(f+m%d,0))),c=S(m/d);g.push(j(P(c,0))),a=O(r,l,i==n),r=0,++i}++r,++t}return g.join("")}if(n={version:"1.4.1",ucs2:{decode:A,encode:I},decode:m,encode:g,toASCII:function(e){return d(e,function(e){return u.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return d(e,function(e){return c.test(e)?m(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",function(){return n});else if(t&&r)if(B.exports==t)r.exports=n;else for(a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],189:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var a=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=c;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function c(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}a.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},a.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:191}],190:[function(e,t,r){(function(a){t.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new a(r),n=0;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function l(e,t){if(p.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return R(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=p.from(t,i)),p.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,n);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,n){var a,o=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;s/=o=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var f=-1;for(a=r;a>>10&1023|55296),f=56320|1023&f),i.push(f),n+=p}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;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 S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===p.compare(this,e)},p.prototype.inspect=function(){var e="",t=N.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,i,n){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(i,n),u=e.slice(t,r),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a,o,s,c,u,f,p,h,l,d=!1;;)switch(i){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return h=t,l=r,M(R(e,(p=this).length-h),p,h,l);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return c=this,u=t,f=r,M(z(e),c,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=t,s=r,M(function(e,t){for(var r,i,n,a=[],o=0;o>8,n=r%256,a.push(n),a.push(i);return a}(e,(a=this).length-o),a,o,s);default:if(d)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function k(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function I(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function P(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function O(e,t,r,i,n,a){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(e,t,r,i,n){return n||O(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function B(e,t,r,i,n){return n||O(e,0,r,8),a.write(e,t,r,i,52,8),r+8}p.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):I(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;0<=--a&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function z(e){return i.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function M(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":75,ieee754:318,isarray:323}],192:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],193:[function(e,t,r){function n(e){this.dict=e||{}}n.prototype.set=function(e,t,r){if("object"!==(void 0===e?"undefined":_typeof(e))){void 0===r&&(r=!0);var i=this.has(e);return!r&&i?this.dict[i]=this.dict[i]+","+t:this.dict[i||e]=t,i}for(var n in e)this.set(n,e[n],t)},n.prototype.has=function(e){for(var t=Object.keys(this.dict),r=(e=e.toLowerCase(),0);rr)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>8^255&n^99,u[r]=n;var a=e[f[n]=r],o=e[a],s=e[o],c=257*e[n]^16843008*n;p[r]=c<<24|c>>>8,h[r]=c<<16|c>>>16,l[r]=c<<8|c>>>24,d[r]=c;c=16843009*s^65537*o^257*a^16843008*r;m[n]=c<<24|c>>>8,g[n]=c<<16|c>>>16,v[n]=c<<8|c>>>24,b[n]=c,r?(r=a^e[e[e[s^a]]],i^=e[e[i]]):r=i=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],i=r.AES=t.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),n=this._keySchedule=[],a=0;a>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o]):(o=u[(o=o<<8|o>>>24)>>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o],o^=y[a/r|0]<<24),n[a]=n[a-r]^o}for(var s=this._invKeySchedule=[],c=0;c>>24]]^g[u[o>>>16&255]]^v[u[o>>>8&255]]^b[u[255&o]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,p,h,l,d,u)},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,m,g,v,b,f);r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,a,o,s){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],p=e[t+2]^r[2],h=e[t+3]^r[3],l=4,d=1;d>>24]^n[f>>>16&255]^a[p>>>8&255]^o[255&h]^r[l++],g=i[f>>>24]^n[p>>>16&255]^a[h>>>8&255]^o[255&u]^r[l++],v=i[p>>>24]^n[h>>>16&255]^a[u>>>8&255]^o[255&f]^r[l++],b=i[h>>>24]^n[u>>>16&255]^a[f>>>8&255]^o[255&p]^r[l++];u=m,f=g,p=v,h=b}m=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&h])^r[l++],g=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[h>>>8&255]<<8|s[255&u])^r[l++],v=(s[p>>>24]<<24|s[h>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^r[l++],b=(s[h>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^r[l++];e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=b},keySize:8});e.AES=t._createHelper(i)}(),n.AES},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],206:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,c,n,a,o,s,u,f,p,h,l,d,m,g,v,b;e.lib.Cipher||(r=(t=e).lib,i=r.Base,c=r.WordArray,n=r.BufferedBlockAlgorithm,(a=t.enc).Utf8,o=a.Base64,s=t.algo.EvpKDF,u=r.Cipher=n.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function n(e){return"string"==typeof e?b:g}return function(i){return{encrypt:function(e,t,r){return n(t).encrypt(i,e,t,r)},decrypt:function(e,t,r){return n(t).decrypt(i,e,t,r)}}}}()}),r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),f=t.mode={},p=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var e=p.extend();function a(e,t,r){var i=this._iv;if(i){var n=i;this._iv=void 0}else n=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:l}),reset:function(){u.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else{i=r.createDecryptor;this._minBufferSize=1}this._mode=i.call(r,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),d=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var i=c.create([1398893684,1701076831]).concat(r).concat(t);else i=t;return i.toString(o)},parse:function(e){var t=o.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var i=c.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return d.create({ciphertext:t,salt:i})}},g=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),a=n.finalize(t),o=n.cfg;return d.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.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}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=c.random(8));var n=s.create({keySize:t+r}).compute(e,i),a=c.create(n.words.slice(t),4*r);return n.sigBytes=4*t,d.create({key:n,iv:a,salt:i})}},b=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),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 a=g.encrypt.call(this,e,t,n.key,i);return a.mixIn(n),a},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,g.decrypt.call(this,e,t,n.key,i)}}))},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],207:[function(e,t,r){var i,n;i=this,n=function(){var f,r,e,t,i,p,n,a,o,s,c,u,h=h||(f=Math,r=Object.create||function(){function r(){}return function(e){var t;return r.prototype=e,t=new r,r.prototype=null,t}}(),t=(e={}).lib={},i=t.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$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)}},p=t.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).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 a=0;a>>2]>>>24-a%4*8&255;t[i+a>>>2]|=o<<24-(i+a)%4*8}else for(a=0;a>>2]=r[a>>>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=f.ceil(t/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,r=[],i=function(t){t=t;var r=987654321,i=4294967295;return function(){var e=((r=36969*(65535&r)+(r>>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return e/=4294967296,(e+=.5)*(.5>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).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 p.init(r,t/2)}},o=n.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(a))}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 p.init(r,t)}},s=n.Utf8={stringify:function(e){try{return decodeURIComponent(escape(o.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return o.parse(unescape(encodeURIComponent(e)))}},c=t.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=s.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,n=this.blockSize,a=i/(4*n),o=(a=e?f.ceil(a):f.max((0|a)-this._minBufferSize,0))*n,s=f.min(4*o,i);if(o){for(var c=0;c>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.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,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var n=0;n>>6-a%4*2;i[n>>>2]|=(o|s)<<24-n%4*8,n++}return c.create(i,n)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],209:[function(e,t,r){var i,n;i=this,n=function(r){return function(){var e=r,n=e.lib.WordArray,t=e.enc;t.Utf16=t.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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}};function o(e){return e<<8&4278255360|e>>>8&16711935}t.Utf16LE={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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return n.create(r,2*t)}}}(),r.enc.Utf16},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],210:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,f,n,a,o;return r=(t=e).lib,i=r.Base,f=r.WordArray,n=t.algo,a=n.MD5,o=n.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=r.hasher.create(),n=f.create(),a=n.words,o=r.keySize,s=r.iterations;a.lengthi&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),a=this._iKey=t.clone(),o=n.words,s=a.words,c=0;c>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)}).prototype=e}}(),t.lib.WordArray},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],215:[function(e,t,r){var i,n;i=this,n=function(o){return function(f){var e=o,t=e.lib,r=t.WordArray,i=t.Hasher,n=e.algo,E=[];!function(){for(var e=0;e<64;e++)E[e]=4294967296*f.abs(f.sin(e+1))|0}();var a=n.MD5=i.extend({_doReset:function(){this._hash=new r.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 a=this._hash.words,o=e[t+0],s=e[t+1],c=e[t+2],u=e[t+3],f=e[t+4],p=e[t+5],h=e[t+6],l=e[t+7],d=e[t+8],m=e[t+9],g=e[t+10],v=e[t+11],b=e[t+12],y=e[t+13],_=e[t+14],w=e[t+15],k=a[0],x=a[1],S=a[2],j=a[3];x=O(x=O(x=O(x=O(x=P(x=P(x=P(x=P(x=I(x=I(x=I(x=I(x=A(x=A(x=A(x=A(x,S=A(S,j=A(j,k=A(k,x,S,j,o,7,E[0]),x,S,s,12,E[1]),k,x,c,17,E[2]),j,k,u,22,E[3]),S=A(S,j=A(j,k=A(k,x,S,j,f,7,E[4]),x,S,p,12,E[5]),k,x,h,17,E[6]),j,k,l,22,E[7]),S=A(S,j=A(j,k=A(k,x,S,j,d,7,E[8]),x,S,m,12,E[9]),k,x,g,17,E[10]),j,k,v,22,E[11]),S=A(S,j=A(j,k=A(k,x,S,j,b,7,E[12]),x,S,y,12,E[13]),k,x,_,17,E[14]),j,k,w,22,E[15]),S=I(S,j=I(j,k=I(k,x,S,j,s,5,E[16]),x,S,h,9,E[17]),k,x,v,14,E[18]),j,k,o,20,E[19]),S=I(S,j=I(j,k=I(k,x,S,j,p,5,E[20]),x,S,g,9,E[21]),k,x,w,14,E[22]),j,k,f,20,E[23]),S=I(S,j=I(j,k=I(k,x,S,j,m,5,E[24]),x,S,_,9,E[25]),k,x,u,14,E[26]),j,k,d,20,E[27]),S=I(S,j=I(j,k=I(k,x,S,j,y,5,E[28]),x,S,c,9,E[29]),k,x,l,14,E[30]),j,k,b,20,E[31]),S=P(S,j=P(j,k=P(k,x,S,j,p,4,E[32]),x,S,d,11,E[33]),k,x,v,16,E[34]),j,k,_,23,E[35]),S=P(S,j=P(j,k=P(k,x,S,j,s,4,E[36]),x,S,f,11,E[37]),k,x,l,16,E[38]),j,k,g,23,E[39]),S=P(S,j=P(j,k=P(k,x,S,j,y,4,E[40]),x,S,o,11,E[41]),k,x,u,16,E[42]),j,k,h,23,E[43]),S=P(S,j=P(j,k=P(k,x,S,j,m,4,E[44]),x,S,b,11,E[45]),k,x,w,16,E[46]),j,k,c,23,E[47]),S=O(S,j=O(j,k=O(k,x,S,j,o,6,E[48]),x,S,l,10,E[49]),k,x,_,15,E[50]),j,k,p,21,E[51]),S=O(S,j=O(j,k=O(k,x,S,j,b,6,E[52]),x,S,u,10,E[53]),k,x,g,15,E[54]),j,k,s,21,E[55]),S=O(S,j=O(j,k=O(k,x,S,j,d,6,E[56]),x,S,w,10,E[57]),k,x,h,15,E[58]),j,k,y,21,E[59]),S=O(S,j=O(j,k=O(k,x,S,j,f,6,E[60]),x,S,v,10,E[61]),k,x,c,15,E[62]),j,k,m,21,E[63]),a[0]=a[0]+k|0,a[1]=a[1]+x|0,a[2]=a[2]+S|0,a[3]=a[3]+j|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var n=f.floor(r/4294967296),a=r;t[15+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,s=o.words,c=0;c<4;c++){var u=s[c];s[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function A(e,t,r,i,n,a,o){var s=e+(t&r|~t&i)+n+o;return(s<>>32-a)+t}function I(e,t,r,i,n,a,o){var s=e+(t&i|r&~i)+n+o;return(s<>>32-a)+t}function P(e,t,r,i,n,a,o){var s=e+(t^r^i)+n+o;return(s<>>32-a)+t}function O(e,t,r,i,n,a,o){var s=e+(r^(t|~i))+n+o;return(s<>>32-a)+t}e.MD5=i._createHelper(a),e.HmacMD5=i._createHmacHelper(a)}(Math),o.MD5},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],216:[function(e,t,r){var i,n;i=this,n=function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function a(e,t,r,i){var n=this._iv;if(n){var a=n.slice(0);this._iv=void 0}else a=this._prevBlock;i.encryptBlock(a,0);for(var o=0;o>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 t=e.Encryptor=e.extend({processBlock:function(e,t){var r,i=this._cipher,n=i.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),0===((r=o)[0]=u(r[0]))&&(r[1]=u(r[1]));var s=o.slice(0);i.encryptBlock(s,0);for(var c=0;c>>2]|=n<<24-a%4*8,e.sigBytes+=n},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],222:[function(e,t,r){var i,n;i=this,n=function(n){return n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],223:[function(e,t,r){var i,n;i=this,n=function(r){return r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],224:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],225:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],226:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,v,n,a,b,o;return r=(t=e).lib,i=r.Base,v=r.WordArray,n=t.algo,a=n.SHA1,b=n.HMAC,o=n.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=b.create(r.hasher,e),n=v.create(),a=v.create([1]),o=n.words,s=a.words,c=r.keySize,u=r.iterations;o.length>>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]],n=this._b=0;n<4;n++)h.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;i[0]^=c,i[1]^=f,i[2]^=u,i[3]^=p,i[4]^=c,i[5]^=f,i[6]^=u,i[7]^=p;for(n=0;n<4;n++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.RabbitLegacy=t._createHelper(i)}(),a.RabbitLegacy},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],228:[function(e,t,r){var i,n;i=this,n=function(a){return function(){var e=a,t=e.lib.StreamCipher,r=e.algo,n=[],c=[],u=[],i=r.Rabbit=t.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(r=this._b=0;r<4;r++)h.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;n[0]^=c,n[1]^=f,n[2]^=u,n[3]^=p,n[4]^=c,n[5]^=f,n[6]^=u,n[7]^=p;for(r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.Rabbit=t._createHelper(i)}(),a.Rabbit},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],229:[function(e,t,r){var i,n;i=this,n=function(o){return function(){var e=o,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.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 a=0;n<256;n++){var o=n%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+i[n]+s)%256;var c=i[n];i[n]=i[a],i[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=n.call(this)},keySize:8,ivSize:0});function n(){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 a=e[t];e[t]=e[r],e[r]=a,i|=e[(e[t]+e[r])%256]<<24-8*n}return this._i=t,this._j=r,i}e.RC4=t._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;0>>24)|4278255360&(n<<24|n>>>8)}var a,o,s,c,u,f,p,h,l,d,m,g=this._hash.words,v=A.words,b=I.words,y=x.words,_=S.words,w=j.words,k=E.words;f=a=g[0],p=o=g[1],h=s=g[2],l=c=g[3],d=u=g[4];for(r=0;r<80;r+=1)m=a+e[t+y[r]]|0,m+=r<16?P(o,s,c)+v[0]:r<32?O(o,s,c)+v[1]:r<48?T(o,s,c)+v[2]:r<64?B(o,s,c)+v[3]:C(o,s,c)+v[4],m=(m=F(m|=0,w[r]))+u|0,a=u,u=c,c=F(s,10),s=o,o=m,m=f+e[t+_[r]]|0,m+=r<16?C(p,h,l)+b[0]:r<32?B(p,h,l)+b[1]:r<48?T(p,h,l)+b[2]:r<64?O(p,h,l)+b[3]:P(p,h,l)+b[4],m=(m=F(m|=0,k[r]))+d|0,f=d,d=l,l=F(h,10),h=p,p=m;m=g[1]+s+l|0,g[1]=g[2]+c+d|0,g[2]=g[3]+u+f|0,g[3]=g[4]+a+p|0,g[4]=g[0]+o+h|0,g[0]=m},_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,a=n.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function P(e,t,r){return e^t^r}function O(e,t,r){return e&t|~e&r}function T(e,t,r){return(e|~t)^r}function B(e,t,r){return e&r|t&~r}function C(e,t,r){return e^(t|~r)}function F(e,t){return e<>>32-t}t.RIPEMD160=n._createHelper(o),t.HmacRIPEMD160=n._createHmacHelper(o)}(Math),s.RIPEMD160},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],231:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,p,o;return r=(t=e).lib,i=r.WordArray,n=r.Hasher,a=t.algo,p=[],o=a.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],a=r[2],o=r[3],s=r[4],c=0;c<80;c++){if(c<16)p[c]=0|e[t+c];else{var u=p[c-3]^p[c-8]^p[c-14]^p[c-16];p[c]=u<<1|u>>>31}var f=(i<<5|i>>>27)+s+p[c];f+=c<20?1518500249+(n&a|~n&o):c<40?1859775393+(n^a^o):c<60?(n&a|n&o|a&o)-1894007588:(n^a^o)-899497514,s=o,o=a,a=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|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(o),t.HmacSHA1=n._createHmacHelper(o),e.SHA1},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],232:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a;return r=(t=e).lib.WordArray,i=t.algo,n=i.SHA256,a=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(a),t.HmacSHA224=n._createHmacHelper(a),e.SHA224},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],n):n(i.CryptoJS)},{"./core":207,"./sha256":233}],233:[function(e,t,r){var i,n;i=this,n=function(c){return function(n){var e=c,t=e.lib,r=t.WordArray,i=t.Hasher,a=e.algo,o=[],y=[];!function(){function e(e){for(var t=n.sqrt(e),r=2;r<=t;r++)if(!(e%r))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(o[i]=t(n.pow(r,.5))),y[i]=t(n.pow(r,1/3)),i++),r++}();var _=[],s=a.SHA256=i.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=0;p<64;p++){if(p<16)_[p]=0|e[t+p];else{var h=_[p-15],l=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,d=_[p-2],m=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;_[p]=l+_[p-7]+m+_[p-16]}var g=i&n^i&a^n&a,v=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&u)+y[p]+_[p];f=u,u=c,c=s,s=o+b|0,o=a,a=n,n=i,i=b+(v+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+u|0,r[7]=r[7]+f|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)]=n.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA256=i._createHelper(s),e.HmacSHA256=i._createHmacHelper(s)}(Math),c.SHA256},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],234:[function(e,t,r){var i,n;i=this,n=function(a){return function(h){var e=a,t=e.lib,l=t.WordArray,i=t.Hasher,f=e.x64.Word,r=e.algo,P=[],O=[],T=[];!function(){for(var e=1,t=0,r=0;r<24;r++){P[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++)O[e+5*t]=t+(2*e+3*t)%5*5;for(var n=1,a=0;a<24;a++){for(var o=0,s=0,c=0;c<7;c++){if(1&n){var u=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(S=r[n]).high^=o,S.low^=a}for(var s=0;s<24;s++){for(var c=0;c<5;c++){for(var u=0,f=0,p=0;p<5;p++){u^=(S=r[c+5*p]).high,f^=S.low}var h=B[c];h.high=u,h.low=f}for(c=0;c<5;c++){var l=B[(c+4)%5],d=B[(c+1)%5],m=d.high,g=d.low;for(u=l.high^(m<<1|g>>>31),f=l.low^(g<<1|m>>>31),p=0;p<5;p++){(S=r[c+5*p]).high^=u,S.low^=f}}for(var v=1;v<25;v++){var b=(S=r[v]).high,y=S.low,_=P[v];if(_<32)u=b<<_|y>>>32-_,f=y<<_|b>>>32-_;else u=y<<_-32|b>>>64-_,f=b<<_-32|y>>>64-_;var w=B[O[v]];w.high=u,w.low=f}var k=B[0],x=r[0];k.high=x.high,k.low=x.low;for(c=0;c<5;c++)for(p=0;p<5;p++){var S=r[v=c+5*p],j=B[v],E=B[(c+1)%5+5*p],A=B[(c+2)%5+5*p];S.high=j.high^~E.high&A.high,S.low=j.low^~E.low&A.low}S=r[0];var I=T[s];S.high^=I.high,S.low^=I.low}},_doFinalize:function(){var e=this._data,t=e.words,r=(this._nDataBytes,8*e.sigBytes),i=32*this.blockSize;t[r>>>5]|=1<<24-r%32,t[(h.ceil((r+1)/i)*i>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();for(var n=this._state,a=this.cfg.outputLength/8,o=a/8,s=[],c=0;c>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),s.push(p),s.push(f)}return new l.init(s,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});e.SHA3=i._createHelper(n),e.HmacSHA3=i._createHmacHelper(n)}(Math),a.SHA3},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],235:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,o,s;return r=(t=e).x64,i=r.Word,n=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.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=o._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s),e.SHA384},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core"),e("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],n):n(i.CryptoJS)},{"./core":207,"./sha512":236,"./x64-core":238}],236:[function(e,t,r){var i,n;i=this,n=function(c){return function(){var e=c,t=e.lib.Hasher,r=e.x64,i=r.Word,n=r.WordArray,a=e.algo;function o(){return i.create.apply(i,arguments)}var xe=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],Se=[];!function(){for(var e=0;e<80;e++)Se[e]=o()}();var s=a.SHA512=t.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=i.high,h=i.low,l=n.high,d=n.low,m=a.high,g=a.low,v=o.high,b=o.low,y=s.high,_=s.low,w=c.high,k=c.low,x=u.high,S=u.low,j=f.high,E=f.low,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=w,N=k,D=x,q=S,L=j,U=E,H=0;H<80;H++){var K=Se[H];if(H<16)var V=K.high=0|e[t+2*H],G=K.low=0|e[t+2*H+1];else{var $=Se[H-15],W=$.high,Z=$.low,Y=(W>>>1|Z<<31)^(W>>>8|Z<<24)^W>>>7,X=(Z>>>1|W<<31)^(Z>>>8|W<<24)^(Z>>>7|W<<25),J=Se[H-2],Q=J.high,ee=J.low,te=(Q>>>19|ee<<13)^(Q<<3|ee>>>29)^Q>>>6,re=(ee>>>19|Q<<13)^(ee<<3|Q>>>29)^(ee>>>6|Q<<26),ie=Se[H-7],ne=ie.high,ae=ie.low,oe=Se[H-16],se=oe.high,ce=oe.low;V=(V=(V=Y+ne+((G=X+ae)>>>0>>0?1:0))+te+((G=G+re)>>>0>>0?1:0))+se+((G=G+ce)>>>0>>0?1:0);K.high=V,K.low=G}var ue,fe=R&M^~R&D,pe=z&N^~z&q,he=A&P^A&T^P&T,le=I&O^I&B^O&B,de=(A>>>28|I<<4)^(A<<30|I>>>2)^(A<<25|I>>>7),me=(I>>>28|A<<4)^(I<<30|A>>>2)^(I<<25|A>>>7),ge=(R>>>14|z<<18)^(R>>>18|z<<14)^(R<<23|z>>>9),ve=(z>>>14|R<<18)^(z>>>18|R<<14)^(z<<23|R>>>9),be=xe[H],ye=be.high,_e=be.low,we=L+ge+((ue=U+ve)>>>0>>0?1:0),ke=me+le;L=D,U=q,D=M,q=N,M=R,N=z,R=C+(we=(we=(we=we+fe+((ue=ue+pe)>>>0>>0?1:0))+ye+((ue=ue+_e)>>>0<_e>>>0?1:0))+V+((ue=ue+G)>>>0>>0?1:0))+((z=F+ue|0)>>>0>>0?1:0)|0,C=T,F=B,T=P,B=O,P=A,O=I,A=we+(de+he+(ke>>>0>>0?1:0))+((I=ue+ke|0)>>>0>>0?1:0)|0}h=i.low=h+I,i.high=p+A+(h>>>0>>0?1:0),d=n.low=d+O,n.high=l+P+(d>>>0>>0?1:0),g=a.low=g+B,a.high=m+T+(g>>>0>>0?1:0),b=o.low=b+F,o.high=v+C+(b>>>0>>0?1:0),_=s.low=_+z,s.high=y+R+(_>>>0>>0?1:0),k=c.low=k+N,c.high=w+M+(k>>>0>>0?1:0),S=u.low=S+q,u.high=x+D+(S>>>0>>0?1:0),E=f.low=E+U,f.high=j+L+(E>>>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=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(s),e.HmacSHA512=t._createHmacHelper(s)}(),c.SHA512},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],237:[function(e,t,r){var i,n;i=this,n=function(s){return function(){var e=s,t=e.lib,r=t.WordArray,i=t.BlockCipher,n=e.algo,u=[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],f=[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],p=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],a=n.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var i=u[r]-1;t[r]=e[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var o=n[a]=[],s=p[a];for(r=0;r<24;r++)o[r/6|0]|=t[(f[r]-1+s)%28]<<31-r%6,o[4+(r/6|0)]|=t[28+(f[r+24]-1+s)%28]<<31-r%6;o[0]=o[0]<<1|o[0]>>>31;for(r=1;r<7;r++)o[r]=o[r]>>>4*(r-1)+3;o[7]=o[7]<<5|o[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[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],d.call(this,4,252645135),d.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),d.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=h[c][((o^n[c])&l[c])>>>0];this._lBlock=o,this._rBlock=a^s}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,d.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(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<>>1];r=h.r28shl(r,a),i=h.r28shl(i,a),h.pc2(r,i,e.keys,n)}},c.prototype._update=function(e,t,r,i){var n=this._desState,a=h.readUInt32BE(e,t),o=h.readUInt32BE(e,t+4);h.ip(a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,o,n.tmp,0):this._decrypt(n,a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],h.writeUInt32BE(r,a,i),h.writeUInt32BE(r,o,i+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,a=p}h.rip(o,a,i,n)},c.prototype._decrypt=function(e,t,r,i,n){for(var a=r,o=t,s=e.keys.length-2;0<=s;s-=2){var c=e.keys[s],u=e.keys[s+1];h.expand(a,e.tmp,0),c^=e.tmp[0],u^=e.tmp[1];var f=h.substitute(c,u),p=a;a=(o^h.permute(f))>>>0,o=p}h.rip(a,o,i,n)}},{"../des":240,inherits:320,"minimalistic-assert":353}],244:[function(e,t,r){"use strict";var a=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),o=n.Cipher,s=n.DES;function c(e,t){a.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new c(this.type,this.options.key);this._edeState=t}i(u,o),(t.exports=u).create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":240,inherits:320,"minimalistic-assert":353}],245:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.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},r.ip=function(e,t,r,i){for(var n=0,a=0,o=6;0<=o;o-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+o&1}for(o=6;0<=o;o-=2){for(s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1;for(s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1}r[i+0]=n>>>0,r[i+1]=a>>>0},r.rip=function(e,t,r,i){for(var n=0,a=0,o=0;o<4;o++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+o&1,n<<=1,n|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;0<=s;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.pc1=function(e,t,r,i){for(var n=0,a=0,o=7;5<=o;o--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.r28shl=function(e,t){return e<>>28-t};var c=[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];r.pc2=function(e,t,r,i){for(var n=0,a=0,o=c.length>>>1,s=0;s>>c[s]&1;for(s=o;s>>c[s]&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var a=23;15<=a;a-=4)i<<=6,i|=e>>>a&63;for(a=11;3<=a;a-=4)n|=e>>>a&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[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];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[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];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(c),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;r.mod(p).cmp(h);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(i=r.shrn(1))&&g(r)&&v(i)&&v(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":154,"miller-rabin":349,randombytes:414}],249:[function(e,t,r){t.exports={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"}}},{}],250:[function(e,t,r){var u=e("crypto"),f=e("jsbn").BigInteger,p=(e("./lib/ec.js").ECPointFp,e("safer-buffer").Buffer);function h(e,t){return e.length>=t?e:h("0"+e,t)}r.ECCurves=e("./lib/sec.js"),r.ECKey=function(e,t,r){var i,n=e(),a=n.getN(),o=Math.floor(a.bitLength()/8);if(t)if(r){e=n.getCurve();this.P=e.decodePointHex(t.toString("hex"))}else{if(t.length!=o)return!1;i=new f(t.toString("hex"),16)}else{var s=a.subtract(f.ONE),c=new f(u.randomBytes(a.bitLength()));i=c.mod(s).add(f.ONE),this.P=n.getG().multiply(i)}this.P&&(this.PublicKey=p.from(n.getCurve().encodeCompressedPointHex(this.P),"hex")),i&&(this.PrivateKey=p.from(h(i.toString(16),2*o),"hex"),this.deriveSharedSecret=function(e){if(!e||!e.P)return!1;var t=e.P.multiply(i);return p.from(h(t.getX().toBigInteger().toString(16),2*o),"hex")})}},{"./lib/ec.js":251,"./lib/sec.js":252,crypto:204,jsbn:325,"safer-buffer":448}],251:[function(e,t,r){var l=e("jsbn").BigInteger,i=l.prototype.Barrett;function f(e,t){this.x=t,this.q=e}function d(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=null==i?l.ONE:i,this.zinv=null}function n(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new d(this,null,null),this.reducer=new i(this.q)}f.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},f.prototype.toBigInteger=function(){return this.x},f.prototype.negate=function(){return new f(this.q,this.x.negate().mod(this.q))},f.prototype.add=function(e){return new f(this.q,this.x.add(e.toBigInteger()).mod(this.q))},f.prototype.subtract=function(e){return new f(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},f.prototype.multiply=function(e){return new f(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},f.prototype.square=function(){return new f(this.q,this.x.square().mod(this.q))},f.prototype.divide=function(e){return new f(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},d.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO))},d.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(l.ZERO)&&!this.y.toBigInteger().equals(l.ZERO)},d.prototype.negate=function(){return new d(this.curve,this.x,this.y.negate(),this.z)},d.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(l.ZERO.equals(r))return l.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new l("3"),n=this.x.toBigInteger(),a=this.y.toBigInteger(),o=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),s=o.multiply(r),c=n.multiply(o),u=t.square().multiply(this.z),f=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(s).multiply(r).mod(this.curve.q),p=c.multiply(i).multiply(t).subtract(a.multiply(s)).subtract(u.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),h=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(p),h)},d.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new l("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),n=i.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),o=t.square().multiply(e);l.ZERO.equals(a)||(o=o.add(this.z.square().multiply(a)));var s=(o=o.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(i).mod(this.curve.q),c=o.multiply(e).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(o.square().multiply(o)).mod(this.curve.q),u=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(c),u)},d.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new l("3")),n=this.negate(),a=this;for(t=i.bitLength()-2;0r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var n=this.curve.getInfinity(),a=this.add(t);0<=i;)n=n.twice(),e.testBit(i)?n=r.testBit(i)?n.add(a):n.add(this):r.testBit(i)&&(n=n.add(t)),--i;return n},n.prototype.getQ=function(){return this.q},n.prototype.getA=function(){return this.a},n.prototype.getB=function(){return this.b},n.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},n.prototype.getInfinity=function(){return this.infinity},n.prototype.fromBigInteger=function(e){return new f(this.q,e)},n.prototype.reduce=function(e){this.reducer.reduce(e)},n.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;t.lengtht+1;){var r=e.shiftRight(t),i=e.subtract(r.shiftLeft(t));this.getR().equals(l.ONE)||(r=r.multiply(this.getR())),e=r.add(i)}for(;0<=e.compareTo(q);)e=e.subtract(q)}else e=e.mod(q);return e},f.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var e=new f(this.q,this.x.modPow(this.q.shiftRight(2).add(l.ONE),this.q));return e.square().equals(this)?e:null}var t=this.q.subtract(l.ONE),r=t.shiftRight(1);if(!this.x.modPow(r,this.q).equals(l.ONE))return null;var i,n,a=t.shiftRight(2).shiftLeft(1).add(l.ONE),o=this.x,s=modDouble(modDouble(o));do{for(var c;0<=(c=new l(this.q.bitLength(),new SecureRandom)).compareTo(this.q)||!c.multiply(c).subtract(s).modPow(r,this.q).equals(t););var u=this.lucasSequence(c,o,a);if(i=u[0],n=u[1],this.modMult(n,n).equals(s))return n.testBit(0)&&(n=n.add(q)),n=n.shiftRight(1),new f(q,n)}while(i.equals(l.ONE)||i.equals(t));return null},f.prototype.lucasSequence=function(e,t,r){for(var i=r.bitLength(),n=r.getLowestSetBit(),a=l.ONE,o=l.TWO,s=e,c=l.ONE,u=l.ONE,f=i-1;n+1<=f;--f)c=this.modMult(c,u),r.testBit(f)?(u=this.modMult(c,t),a=this.modMult(a,s),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1)))):(u=c,a=this.modReduce(a.multiply(o).subtract(c)),s=this.modReduce(s.multiply(o).subtract(e.multiply(c))),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))));c=this.modMult(c,u),u=this.modMult(c,t),a=this.modReduce(a.multiply(o).subtract(c)),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),c=this.modMult(c,u);for(f=1;f<=n;++f)a=this.modMult(a,o),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))),c=this.modMult(c,c);return[a,o]};r={ECCurveFp:n,ECPointFp:d,ECFieldElementFp:f};t.exports=r},{jsbn:325}],252:[function(e,t,r){var o=e("jsbn").BigInteger,s=e("./ec.js").ECCurveFp;function c(e,t,r,i){this.curve=e,this.g=t,this.n=r,this.h=i}function u(e){return new o(e,16)}function i(){var e=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),r=u("E87579C11079F43DD824993C2CEE5ED3"),i=u("FFFFFFFE0000000075A30D1B9038A115"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83"),i,n)}function n(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=o.ZERO,r=u("7"),i=u("0100000000000000000001B8FA16DFAB9ACA16B6B3"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE"),i,n)}function a(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),r=u("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),i=u("0100000000000000000001F4C8F927AED3CA752257"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32"),i,n)}function f(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=o.ZERO,r=u("3"),i=u("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"),i,n)}function p(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),r=u("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),i=u("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811"),i,n)}function h(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),r=u("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),i=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"),i,n)}function l(){var e=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),r=u("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),i=u("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),i,n)}c.prototype.getCurve=function(){return this.curve},c.prototype.getG=function(){return this.g},c.prototype.getN=function(){return this.n},c.prototype.getH=function(){return this.h},t.exports={secp128r1:i,secp160k1:n,secp160r1:a,secp192k1:f,secp192r1:p,secp224r1:h,secp256r1:l}},{"./ec.js":251,jsbn:325}],253:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":268,"./elliptic/curve":256,"./elliptic/curves":259,"./elliptic/ec":260,"./elliptic/eddsa":263,"./elliptic/utils":267,brorand:156}],254:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,j=n.getNAF,E=n.getJSF,p=n.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i,n){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,c=0,u=0;u>1]:S<0&&(x=o[g][-S-1>>1].neg()),y="affine"===x.type?y.mixedAdd(x):y.add(x))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},o.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.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),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],256:[function(e,t,r){arguments[4][130][0].apply(r,arguments)},{"./base":254,"./edwards":255,"./mont":257,"./short":258,dup:130}],257:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base,s=e("../../elliptic").utils;function c(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(c,o),(t.exports=c).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)},a(u,o.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},c.prototype.point=function(e,t){return new u(this,e,t)},c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.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)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},u.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 a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],258:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new w(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)},c.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)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],259:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":253,"./precomputed/secp256k1":266,"hash.js":299}],260:[function(e,t,r){"use strict";var g=e("bn.js"),v=e("hmac-drbg"),a=e("../../elliptic"),l=a.utils.assert,i=e("./key"),b=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(l(a.curves.hasOwnProperty(e),"Unknown curve "+e),e=a.curves[e]),e instanceof a.curves.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}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new v({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new g(2));;){var n=new g(t.generate(r));if(!(0>1;if(0<=o.cmp(this.curve.p.umod(this.curve.n))&&u)throw new Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var f=t.r.invm(n),p=n.sub(a).mul(f).umod(n),h=s.mul(f).umod(n);return this.g.mulAdd(p,o,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new b(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":253,"./key":261,"./signature":262,"bn.js":154,"hmac-drbg":311}],261:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=a).fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},{"../../elliptic":253,"bn.js":154}],262:[function(e,t,r){"use strict";var s=e("bn.js"),c=e("../../elliptic").utils,i=c.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=c.toArray(e,t);var r=new u;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=f(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=f(e,r);if(e.length!==a+r.place)return!1;var o=e.slice(r.place,a+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===o[0]&&128&o[1]&&(o=o.slice(1)),this.r=new s(n),this.s=new s(o),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];p(i,t.length),(i=i.concat(t)).push(2),p(i,r.length);var n=i.concat(r),a=[48];return p(a,n.length),a=a.concat(n),c.encode(a,e)}},{"../../elliptic":253,"bn.js":154}],263:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),a=n.utils,o=a.assert,c=a.parseBytes,s=e("./key"),u=e("./signature");function f(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=f).prototype.sign=function(e,t){e=c(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),a=this.encodePoint(n),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:a})},f.prototype.verify=function(e,t,r){e=c(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(a)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=6.0.0 <7.0.0",_id:"elliptic@6.4.1",_inCache:!0,_installable:!0,_location:"/elliptic",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/elliptic_6.4.1_1533787091502_0.6309761823717674"},_npmUser:{email:"fedor@indutny.com",name:"indutny"},_npmVersion:"6.3.0",_phantomChildren:{},_requested:{name:"elliptic",raw:"elliptic@^6.0.0",rawSpec:"^6.0.0",scope:null,spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/home/administrator/javascript-opentimestamps/node_modules/browserify-sign",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{fileCount:17,integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJba7vUCRA9TVsSAnZWagAA+gcP/jWaj5GmDZ0YFi/X4g5O\nx+pxu9i3HbP9YqywT7rz3XFXSaytu0LQDeDEbddl523X69tsbKfzHRTcnW8n\n2r0VjPhttRm+0RpEhBwjSIK34VkQA1xIWh2ugOToKXVCFVLM5VFDPGzbiN6x\n/hpL7gj1hoCRVmuhjnqFQ+vPKACKfv1Eq4CsRmu2focmP37kQpWQlweD/z4V\nJF4NxA33Fvp13Fl+9g4sPHyhUVsW9ojVaG3Ijn70pCaGQM18UPlbODkWQ1QX\nAgteOFjkIOtcalJk3B3qsM8GZeHEcAFvt2T73miJkHdCGNmRQS45Ede+gnj0\nlLlZJsCCKUHtTqrlprHo6AgMnBZufmytyozYAHC1/JYniazSBi2yPHtQeniR\nl69BfiRBdD2rNrMPwmCNRkMqrgel5WMGpaD0xdaFAHF1Ru2ZQFKsA7KvPGgp\nA20+LN11cCib67Pg5XDyrZ92T3yXec+6gQ3iq9d9UBZKFGl0P8ebVqq1LrUJ\na6nekwMpRISWnKcqV72XVmQdBmUWHq9VfVLsWJzVIJqtpHmUO7q74ACP3i4W\n0/F1REeI0YEhh3NjeStdDecfjlu7PY0pLQpbk2I3ms+6DO+cAfeDEev5jFBK\nwQabRNhITeT1FVtxZAcApj33fnCdqwaWr1NS00K5ZRqhDTTzPr/O4KRN4CR1\npstU\r\n=UVBB\r\n-----END PGP SIGNATURE-----\r\n",shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",unpackedSize:118371},files:["lib"],gitHead:"523da1cf71ddcfd607fbdee1858bc2af47f0e700",homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.1"}},{}],269:[function(e,t,r){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function c(e){return"function"==typeof e}function u(e){return"object"===(void 0===e?"undefined":_typeof(e))&&null!==e}function f(e){return void 0===e}((t.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},i.prototype.emit=function(e){var t,r,i,n,a,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(f(r=this._events[e]))return!1;if(c(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=Array.prototype.slice.call(arguments,1),r.apply(this,n)}else if(u(r))for(n=Array.prototype.slice.call(arguments,1),i=(o=r.slice()).length,a=0;ar&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!c(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,a;if(!c(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||c(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(r)){for(a=n;0=this._blockSize;){for(var n=this._blockOffset;n=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=n.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,a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":310}],310:[function(e,t,r){"use strict";var u=e("minimalistic-assert"),i=e("inherits");function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function o(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}r.inherits=i,r.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:320,"minimalistic-assert":353}],311:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),i=o.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length1e3*t.clockSkew)throw new E("clock skew of "+g/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach(function(e){if(u.params.headers.indexOf(e.toLowerCase())<0)throw new P(e+" was not a signed header")}),t.algorithms&&-1===t.algorithms.indexOf(u.params.algorithm))throw new I(u.params.algorithm+" is not a supported algorithm");return u.algorithm=u.params.algorithm.toUpperCase(),u.keyId=u.params.keyId,u}}},{"./utils":315,"assert-plus":66,util:505}],314:[function(n,a,e){(function(l){var d=n("assert-plus"),m=n("crypto"),e=(n("http"),n("util")),g=n("sshpk"),v=n("jsprim"),t=n("./utils"),b=n("util").format,y=t.HASH_ALGOS,_=t.PK_ALGOS,w=t.InvalidAlgorithmError,r=t.HttpSignatureError,k=t.validateAlgorithm,x='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';function S(e){r.call(this,e,S)}function j(e){r.call(this,e,j)}function i(e){d.object(e,"options");var t=[];if(void 0!==e.algorithm&&(d.string(e.algorithm,"options.algorithm"),t=k(e.algorithm)),this.rs_alg=t,void 0!==e.sign)d.func(e.sign,"options.sign"),this.rs_signFunc=e.sign;else if("hmac"===t[0]&&void 0!==e.key){if(d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,"string"!=typeof e.key&&!l.isBuffer(e.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=m.createHmac(t[1].toUpperCase(),e.key),this.rs_signer.sign=function(){var e=this.digest("base64");return{hashAlgorithm:t[1],toString:function(){return e}}}}else{if(void 0===e.key)throw new TypeError("options.sign (func) or options.key is required");var r=e.key;if(("string"==typeof r||l.isBuffer(r))&&(r=g.parsePrivateKey(r)),d.ok(g.PrivateKey.isPrivateKey(r,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=r,d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,!_[r.type])throw new w(r.type.toUpperCase()+" type keys are not supported");if(void 0!==t[0]&&r.type!==t[0])throw new w("options.key must be a "+t[0].toUpperCase()+" key, was given a "+r.type.toUpperCase()+" key instead");this.rs_signer=r.createSign(t[1])}this.rs_headers=[],this.rs_lines=[]}e.inherits(S,r),e.inherits(j,r),i.prototype.writeHeader=function(e,t){if(d.string(e,"header"),e=e.toLowerCase(),d.string(t,"value"),this.rs_headers.push(e),this.rs_signFunc)this.rs_lines.push(e+": "+t);else{var r=e+": "+t;0>1,f=-7,p=r?n-1:0,h=r?-1:1,l=e[t+p];for(p+=h,a=l&(1<<-f)-1,l>>=-f,f+=s;0>=-f,f+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:a-1,d=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),2<=(t+=1<=o+p?h/c:h*Math.pow(2,1-p))*c&&(o++,c/=2),f<=o+p?(s=0,o=f):1<=o+p?(s=(t*c-1)*Math.pow(2,n),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,n),o=0));8<=n;e[r+l]=255&s,l+=d,s/=256,n-=8);for(o=o<>15;0<=--a;){var c=32767&this[e],u=this[e++]>>15,f=s*c+u*o;n=((c=o*c+((32767&f)<<15)+r[i]+(1073741823&n))>>>30)+(f>>>15)+s*u+(n>>>30),r[i++]=1073741823&c}return n},30):t&&"Netscape"!=navigator.appName?(y.prototype.am=function(e,t,r,i,n,a){for(;0<=--a;){var o=t*this[e++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},26):(y.prototype.am=function(e,t,r,i,n,a){for(var o=16383&t,s=t>>14;0<=--a;){var c=16383&this[e],u=this[e++]>>14,f=s*c+u*o;n=((c=o*c+((16383&f)<<14)+r[i]+n)>>28)+(f>>14)+s*u,r[i++]=268435455&c}return n},28),y.prototype.DB=e,y.prototype.DM=(1<>>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 v(e){this.m=e}function b(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 l(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function d(){}function m(e){return e}function k(e){this.r2=_(),this.q3=_(),y.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},b.prototype.convert=function(e){var t=_();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&0>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),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},b.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.copyTo=function(e){for(var t=this.t-1;0<=t;--t)e[t]=this[t];e.t=this.t,e.s=this.s},y.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0this.DB?(this[this.t-1]|=(o&(1<>this.DB-a):this[this.t-1]|=o<=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,0>n|s,s=(this[r]&a)<=this.t)t.t=0;else{var i=e%this.DB,n=this.DB-i,a=(1<>i;for(var o=r+1;o>i;0>=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:0=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}0>this.F2:0),h=this.FV/p,l=(1<>s)&&(n=!0,a=c(r));0<=o;)s>(s+=this.DB-t)):(r=this[o]>>(s-=t)&i,s<=0&&(s+=this.DB,--o)),02*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=_();return e.copyTo(t),this.reduce(t),t},k.prototype.revert=function(e){return e},k.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);0<=e.compareTo(this.m);)e.subTo(this.m,e)},k.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},k.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x,S,j,E=[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],A=(1<<26)/E[E.length-1];function I(){var e;e=(new Date).getTime(),S[j++]^=255&e,S[j++]^=e>>8&255,S[j++]^=e>>16&255,S[j++]^=e>>24&255,R<=j&&(j-=R)}if(y.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},y.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||36=r&&(this.dMultiply(i),this.dAddOffset(o,0),o=a=0))}0e&&this.subTo(y.ONE.shiftLeft(e-1),this);else{var i=new Array,n=7&e;i.length=1+(e>>3),t.nextBytes(i),0>=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,0=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},y.prototype.multiplyLowerTo=function(e,t,r){var i,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;0>1)>E.length&&(e=E.length);for(var n=_(),a=0;a>24},y.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},y.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},y.prototype.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(0>i)!=(this.s&this.DM)>>i&&(t[n++]=r|this.s<>(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,(0=this.t?0!=this.s:0!=(this[t]&1<>n-c&u:(p=(e[l]&(1<>this.DB+n-c)),s=r;0==(1&p);)p>>=1,--s;if((n-=s)<0&&(n+=this.DB,--l),d)o[p].copyTo(a),d=!1;else{for(;1>>8,S[j++]=255&P;j=0,I()}function B(){if(null==x){for(I(),(x=new F).init(S),j=0;jt.maxItems&&n("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&m.concat(function(e,t,r,i){if("object"==(void 0===t?"undefined":_typeof(t)))for(var n in("object"!=(void 0===e?"undefined":_typeof(e))||e instanceof Array)&&m.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(n)){var a=e[n];if(void 0===a&&h.existingOnly)continue;var o=t[n];void 0===a&&o.default&&(a=e[n]=o.default),h.coerce&&n in e&&(a=e[n]=h.coerce(a,o)),g(a,o,r,n)}for(n in e){if(e.hasOwnProperty(n)&&("_"!=n.charAt(0)||"_"!=n.charAt(1))&&t&&!t[n]&&!1===i){if(h.filter){delete e[n];continue}m.push({property:r,message:(void 0===a?"undefined":_typeof(a))+"The property "+n+" is not defined in the schema and the schema does not allow additional properties"})}var s=t&&t[n]&&t[n].requires;!s||s in e||m.push({property:r,message:"the presence of the property "+n+" requires that "+s+" also be present"}),a=e[n],!i||t&&"object"==(void 0===t?"undefined":_typeof(t))&&n in t||(h.coerce&&(a=e[n]=h.coerce(a,i)),g(a,i,r,n)),!l&&a&&a.$schema&&(m=m.concat(g(a,a.$schema,r,n)))}return m}(e,t.properties,o,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&n("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&n("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.lengthe&&n("must have a minimum value of "+t.minimum),void 0!==_typeof(t.maximum)&&(void 0===e?"undefined":_typeof(e))==_typeof(t.maximum)&&t.maximum= 2"),d.ok(n.base<=36,"options.base <= 36"),d.bool(n.allowSign,"options.allowSign"),d.bool(n.allowPrefix,"options.allowPrefix"),d.bool(n.allowTrailing,"options.allowTrailing"),d.bool(n.allowImprecise,"options.allowImprecise"),d.bool(n.trimWhitespace,"options.trimWhitespace"),d.bool(n.leadingZeroIsOctal,"options.leadingZeroIsOctal"),n.leadingZeroIsOctal&&d.ok(!i,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var a,o=-1,s=n.base,c=1,u=0,f=0,p=e.length;if(n.trimWhitespace)for(;ft[0]||e[0]==t[0]&&e[1]>=t[1],"negative differences not allowed");var r=[e[0]-t[0],0];return e[1]>=t[1]?r[1]=e[1]-t[1]:(r[0]--,r[1]=1e9-(t[1]-e[1])),r}function R(e,t){return C(e),C(t),e[1]+=t[1],1e9<=e[1]&&(e[0]++,e[1]-=1e9),e[0]+=t[0],e}function z(e,t,r){var i,n;if(i={},r)for(n in r)i[n]=r[n];if(e)for(n in e)i[n]=e[n];if(t)for(n in t)i[n]=t[n];return i}},{"assert-plus":66,extsprintf:272,"json-schema":327,util:505,verror:509}],330:[function(e,t,r){"use strict";t.exports=e("./lib/api")(e("./lib/keccak"))},{"./lib/api":331,"./lib/keccak":335}],331:[function(e,t,r){"use strict";var n=e("./keccak"),a=e("./shake");t.exports=function(e){var r=n(e),i=a(e);return function(e,t){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new r(1152,448,null,224,t);case"keccak256":return new r(1088,512,null,256,t);case"keccak384":return new r(832,768,null,384,t);case"keccak512":return new r(576,1024,null,512,t);case"sha3-224":return new r(1152,448,6,224,t);case"sha3-256":return new r(1088,512,6,256,t);case"sha3-384":return new r(832,768,6,384,t);case"sha3-512":return new r(576,1024,6,512,t);case"shake128":return new i(1344,256,31,t);case"shake256":return new i(1088,512,31,t);default:throw new Error("Invald algorithm: "+e)}}}},{"./keccak":332,"./shake":333}],332:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,o=e("stream").Transform,n=e("inherits");t.exports=function(a){function t(e,t,r,i,n){o.call(this,n),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._hashBitLength=i,this._options=n,this._state=new a,this._state.initialize(e,t),this._finalized=!1}return n(t,o),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],333:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("stream").Transform,o=e("inherits");t.exports=function(n){function t(e,t,r,i){a.call(this,i),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._options=i,this._state=new n,this._state.initialize(e,t),this._finalized=!1}return o(t,a),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],334:[function(e,t,r){"use strict";var ot=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];r.p1600=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],n=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],h=f^(n<<1|a>>>31),l=p^(a<<1|n>>>31),d=e[0]^h,m=e[1]^l,g=e[10]^h,v=e[11]^l,b=e[20]^h,y=e[21]^l,_=e[30]^h,w=e[31]^l,k=e[40]^h,x=e[41]^l;h=r^(o<<1|s>>>31),l=i^(s<<1|o>>>31);var S=e[2]^h,j=e[3]^l,E=e[12]^h,A=e[13]^l,I=e[22]^h,P=e[23]^l,O=e[32]^h,T=e[33]^l,B=e[42]^h,C=e[43]^l;h=n^(c<<1|u>>>31),l=a^(u<<1|c>>>31);var F=e[4]^h,R=e[5]^l,z=e[14]^h,M=e[15]^l,N=e[24]^h,D=e[25]^l,q=e[34]^h,L=e[35]^l,U=e[44]^h,H=e[45]^l;h=o^(f<<1|p>>>31),l=s^(p<<1|f>>>31);var K=e[6]^h,V=e[7]^l,G=e[16]^h,$=e[17]^l,W=e[26]^h,Z=e[27]^l,Y=e[36]^h,X=e[37]^l,J=e[46]^h,Q=e[47]^l;h=c^(r<<1|i>>>31),l=u^(i<<1|r>>>31);var ee=e[8]^h,te=e[9]^l,re=e[18]^h,ie=e[19]^l,ne=e[28]^h,ae=e[29]^l,oe=e[38]^h,se=e[39]^l,ce=e[48]^h,ue=e[49]^l,fe=d,pe=m,he=v<<4|g>>>28,le=g<<4|v>>>28,de=b<<3|y>>>29,me=y<<3|b>>>29,ge=w<<9|_>>>23,ve=_<<9|w>>>23,be=k<<18|x>>>14,ye=x<<18|k>>>14,_e=S<<1|j>>>31,we=j<<1|S>>>31,ke=A<<12|E>>>20,xe=E<<12|A>>>20,Se=I<<10|P>>>22,je=P<<10|I>>>22,Ee=T<<13|O>>>19,Ae=O<<13|T>>>19,Ie=B<<2|C>>>30,Pe=C<<2|B>>>30,Oe=R<<30|F>>>2,Te=F<<30|R>>>2,Be=z<<6|M>>>26,Ce=M<<6|z>>>26,Fe=D<<11|N>>>21,Re=N<<11|D>>>21,ze=q<<15|L>>>17,Me=L<<15|q>>>17,Ne=H<<29|U>>>3,De=U<<29|H>>>3,qe=K<<28|V>>>4,Le=V<<28|K>>>4,Ue=$<<23|G>>>9,He=G<<23|$>>>9,Ke=W<<25|Z>>>7,Ve=Z<<25|W>>>7,Ge=Y<<21|X>>>11,$e=X<<21|Y>>>11,We=Q<<24|J>>>8,Ze=J<<24|Q>>>8,Ye=ee<<27|te>>>5,Xe=te<<27|ee>>>5,Je=re<<20|ie>>>12,Qe=ie<<20|re>>>12,et=ae<<7|ne>>>25,tt=ne<<7|ae>>>25,rt=oe<<8|se>>>24,it=se<<8|oe>>>24,nt=ce<<14|ue>>>18,at=ue<<14|ce>>>18;e[0]=fe^~ke&Fe,e[1]=pe^~xe&Re,e[10]=qe^~Je&de,e[11]=Le^~Qe&me,e[20]=_e^~Be&Ke,e[21]=we^~Ce&Ve,e[30]=Ye^~he&Se,e[31]=Xe^~le&je,e[40]=Oe^~Ue&et,e[41]=Te^~He&tt,e[2]=ke^~Fe&Ge,e[3]=xe^~Re&$e,e[12]=Je^~de&Ee,e[13]=Qe^~me&Ae,e[22]=Be^~Ke&rt,e[23]=Ce^~Ve&it,e[32]=he^~Se&ze,e[33]=le^~je&Me,e[42]=Ue^~et&ge,e[43]=He^~tt&ve,e[4]=Fe^~Ge&nt,e[5]=Re^~$e&at,e[14]=de^~Ee&Ne,e[15]=me^~Ae&De,e[24]=Ke^~rt&be,e[25]=Ve^~it&ye,e[34]=Se^~ze&We,e[35]=je^~Me&Ze,e[44]=et^~ge&Ie,e[45]=tt^~ve&Pe,e[6]=Ge^~nt&fe,e[7]=$e^~at&pe,e[16]=Ee^~Ne&qe,e[17]=Ae^~De&Le,e[26]=rt^~be&_e,e[27]=it^~ye&we,e[36]=ze^~We&Ye,e[37]=Me^~Ze&Xe,e[46]=ge^~Ie&Oe,e[47]=ve^~Pe&Te,e[8]=nt^~fe&ke,e[9]=at^~pe&xe,e[18]=Ne^~qe&Je,e[19]=De^~Le&Qe,e[28]=be^~_e&Be,e[29]=ye^~we&Ce,e[38]=We^~Ye&he,e[39]=Ze^~Xe&le,e[48]=Ie^~Oe&Ue,e[49]=Pe^~Te&He,e[0]^=ot[2*t],e[1]^=ot[2*t+1]}}},{}],335:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=e("./keccak-state-unroll");function a(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}a.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},a.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},a.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},t.exports=a},{"./keccak-state-unroll":334,"safe-buffer":447}],336:[function(e,t,r){var i=e("./_root").Symbol;t.exports=i},{"./_root":341}],337:[function(e,t,r){var i=e("./_Symbol"),n=e("./_getRawTag"),a=e("./_objectToString"),o=i?i.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},{"./_Symbol":336,"./_getRawTag":339,"./_objectToString":340}],338:[function(e,r,t){(function(e){var t="object"==(void 0===e?"undefined":_typeof(e))&&e&&e.Object===Object&&e;r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],339:[function(e,t,r){var i=e("./_Symbol"),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,s=i?i.toStringTag:void 0;t.exports=function(e){var t=a.call(e,s),r=e[s];try{var i=!(e[s]=void 0)}catch(e){}var n=o.call(e);return i&&(t?e[s]=r:delete e[s]),n}},{"./_Symbol":336}],340:[function(e,t,r){var i=Object.prototype.toString;t.exports=function(e){return i.call(e)}},{}],341:[function(e,t,r){var i=e("./_freeGlobal"),n="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,a=i||n||Function("return this")();t.exports=a},{"./_freeGlobal":338}],342:[function(e,t,r){var i=Array.isArray;t.exports=i},{}],343:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isObject");t.exports=function(e){if(!n(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},{"./_baseGetTag":337,"./isObject":344}],344:[function(e,t,r){t.exports=function(e){var t=void 0===e?"undefined":_typeof(e);return null!=e&&("object"==t||"function"==t)}},{}],345:[function(e,t,r){t.exports=function(e){return null!=e&&"object"==(void 0===e?"undefined":_typeof(e))}},{}],346:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isArray"),a=e("./isObjectLike");t.exports=function(e){return"string"==typeof e||!n(e)&&a(e)&&"[object String]"==i(e)}},{"./_baseGetTag":337,"./isArray":342,"./isObjectLike":345}],347:[function(e,t,r){t.exports=function(e){return void 0===e}},{}],348:[function(e,t,r){"use strict";var i=e("inherits"),n=e("hash-base"),a=e("safe-buffer").Buffer,o=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,r,i,n,a,o){return c(e+(t&r|~t&i)+n+a|0,o)+t|0}function f(e,t,r,i,n,a,o){return c(e+(t&i|r&~i)+n+a|0,o)+t|0}function p(e,t,r,i,n,a,o){return c(e+(t^r^i)+n+a|0,o)+t|0}function h(e,t,r,i,n,a,o){return c(e+(r^(t|~i))+n+a|0,o)+t|0}i(s,n),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,a=this._d;i=h(i=h(i=h(i=h(i=p(i=p(i=p(i=p(i=f(i=f(i=f(i=f(i=u(i=u(i=u(i=u(i,n=u(n,a=u(a,r=u(r,i,n,a,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),a,r,e[3],3250441966,22),n=u(n,a=u(a,r=u(r,i,n,a,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),a,r,e[7],4249261313,22),n=u(n,a=u(a,r=u(r,i,n,a,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),a,r,e[11],2304563134,22),n=u(n,a=u(a,r=u(r,i,n,a,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),a,r,e[15],1236535329,22),n=f(n,a=f(a,r=f(r,i,n,a,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),a,r,e[0],3921069994,20),n=f(n,a=f(a,r=f(r,i,n,a,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),a,r,e[4],3889429448,20),n=f(n,a=f(a,r=f(r,i,n,a,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),a,r,e[8],1163531501,20),n=f(n,a=f(a,r=f(r,i,n,a,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),a,r,e[12],2368359562,20),n=p(n,a=p(a,r=p(r,i,n,a,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),a,r,e[14],4259657740,23),n=p(n,a=p(a,r=p(r,i,n,a,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),a,r,e[10],3200236656,23),n=p(n,a=p(a,r=p(r,i,n,a,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),a,r,e[6],76029189,23),n=p(n,a=p(a,r=p(r,i,n,a,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),a,r,e[2],3299628645,23),n=h(n,a=h(a,r=h(r,i,n,a,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),a,r,e[5],4237533241,21),n=h(n,a=h(a,r=h(r,i,n,a,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),a,r,e[1],2240044497,21),n=h(n,a=h(a,r=h(r,i,n,a,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),a,r,e[13],1309151649,21),n=h(n,a=h(a,r=h(r,i,n,a,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),a,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+a|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e}},{}],355:[function(e,t,r){(t.exports=o).Minimatch=n;var u={sep:"/"};try{u=e("path")}catch(e){}var z=o.GLOBSTAR=n.GLOBSTAR={},i=e("brace-expansion"),M={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},N="[^/]*?",D="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{});var f=/\/+/;function a(t,r){t=t||{},r=r||{};var i={};return Object.keys(r).forEach(function(e){i[e]=r[e]}),Object.keys(t).forEach(function(e){i[e]=t[e]}),i}function o(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new n(t,r).match(e))}function n(e,t){if(!(this instanceof n))return new n(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==u.sep&&(e=e.split(u.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function s(e,t){if(t||(t=this instanceof n?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:i(e)}o.filter=function(i,n){return n=n||{},function(e,t,r){return o(e,i,n)}},o.defaults=function(i){if(!i||!Object.keys(i).length)return o;var n=o,e=function(e,t,r){return n.minimatch(e,t,a(i,r))};return e.Minimatch=function(e,t){return new n.Minimatch(e,a(i,t))},e},n.defaults=function(e){return e&&Object.keys(e).length?o.defaults(e).Minimatch:n},n.prototype.debug=function(){},n.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(f)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r},n.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=this.options,i=0;if(r.nonegate)return;for(var n=0,a=e.length;n>> no match, partial?",e,p,t,h),p!==o))}if("string"==typeof u?(c=i.nocase?f.toLowerCase()===u.toLowerCase():f===u,this.debug("string match",u,f,c)):(c=f.match(u),this.debug("pattern match",u,f,c)),!c)return!1}if(n===o&&a===s)return!0;if(n===o)return r;if(a===s)return n===o-1&&""===e[n];throw new Error("wtf?")}},{"brace-expansion":155,path:374}],356:[function(e,t,r){var c=e("crypto");function o(e,t,r){return c.createHmac(r,e).update(t).digest("base64")}function s(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function n(e,t){return t>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var n=s,a=i+r;e^=-1;for(var o=i;o>>8^n[255&(e^t[o])];return-1^e}},{}],362:[function(e,t,r){"use strict";var c,h=e("../utils/common"),u=e("./trees"),l=e("./adler32"),d=e("./crc32"),i=e("./messages"),f=0,p=4,m=0,g=-2,v=-1,b=4,n=2,y=8,_=9,a=286,o=30,s=19,w=2*a+1,k=15,x=3,S=258,j=S+x+1,E=42,A=113,I=1,P=2,O=3,T=4;function B(e,t){return e.msg=i[t],t}function C(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(h.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function z(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,R(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function N(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function D(e,t){var r,i,n=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-j?e.strstart-(e.w_size-j):0,u=e.window,f=e.w_mask,p=e.prev,h=e.strstart+S,l=u[a+o-1],d=u[a+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===d&&u[r+o-1]===l&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ac&&0!=--n);return o<=e.lookahead?o:e.lookahead}function q(e){var t,r,i,n,a,o,s,c,u,f,p=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-j)){for(h.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;i=e.head[--t],e.head[t]=p<=i?i-p:0,--r;);for(t=r=p;i=e.prev[--t],e.prev[t]=p<=i?i-p:0,--r;);n+=p}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,c=e.strstart+e.lookahead,u=n,f=void 0,f=o.avail_in,u=x)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(i=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(n=e.strstart+e.lookahead-x,i=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=n&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(q(e),0===e.lookahead&&t===f)return I;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,z(e,!1),0===e.strm.avail_out))return I;if(e.strstart-e.block_start>=e.w_size-j&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):(e.strstart>e.block_start&&(z(e,!1),e.strm.avail_out),I)}),new H(4,4,8,4,L),new H(4,5,16,8,L),new H(4,6,32,32,L),new H(4,4,16,16,U),new H(8,16,32,32,U),new H(8,16,128,128,U),new H(8,32,128,256,U),new H(32,128,258,1024,U),new H(32,258,258,4096,U)],r.deflateInit=function(e,t){return $(e,t,y,15,8,0)},r.deflateInit2=$,r.deflateReset=G,r.deflateResetKeep=V,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,m):g},r.deflate=function(e,t){var r,i,n,a;if(!e||!e.state||5>8&255),M(i,i.gzhead.time>>16&255),M(i,i.gzhead.time>>24&255),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(M(i,255&i.gzhead.extra.length),M(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=d(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(M(i,0),M(i,0),M(i,0),M(i,0),M(i,0),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,3),i.status=A);else{var o=y+(i.w_bits-8<<4)<<8;o|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(o|=32),o+=31-o%31,i.status=A,N(i,o),0!==i.strstart&&(N(i,e.adler>>>16),N(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending!==i.pending_buf_size));)M(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&R(e),i.pending+2<=i.pending_buf_size&&(M(i,255&e.adler),M(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(R(e),0===e.avail_out)return i.last_flush=-1,m}else if(0===e.avail_in&&C(t)<=C(r)&&t!==p)return B(e,-5);if(666===i.status&&0!==e.avail_in)return B(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==f&&666!==i.status){var s=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(q(e),0===e.lookahead)){if(t===f)return I;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):3===i.strategy?function(e,t){for(var r,i,n,a,o=e.window;;){if(e.lookahead<=S){if(q(e),e.lookahead<=S&&t===f)return I;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):c[i.level].func(i,t);if(s!==O&&s!==T||(i.status=666),s===I||s===O)return 0===e.avail_out&&(i.last_flush=-1),m;if(s===P&&(1===t?u._tr_align(i):5!==t&&(u._tr_stored_block(i,0,0,!1),3===t&&(F(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),R(e),0===e.avail_out))return i.last_flush=-1,m}return t!==p?m:i.wrap<=0?1:(2===i.wrap?(M(i,255&e.adler),M(i,e.adler>>8&255),M(i,e.adler>>16&255),M(i,e.adler>>24&255),M(i,255&e.total_in),M(i,e.total_in>>8&255),M(i,e.total_in>>16&255),M(i,e.total_in>>24&255)):(N(i,e.adler>>>16),N(i,65535&e.adler)),R(e),0=r.w_size&&(0===a&&(F(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new h.Buf8(r.w_size),h.arraySet(u,t,f-r.w_size,r.w_size,0),t=u,f=r.w_size),o=e.avail_in,s=e.next_in,c=e.input,e.avail_in=f,e.next_in=0,e.input=t,q(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=_=y>>>24,d-=_,0===(_=y>>>16&255))E[a++]=65535&y;else{if(!(16&_)){if(0==(64&_)){y=m[(65535&y)+(l&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&y,(_&=15)&&(d<_&&(l+=j[i++]<>>=_,d-=_),d<15&&(l+=j[i++]<>>=_=y>>>24,d-=_,!(16&(_=y>>>16&255))){if(0==(64&_)){y=g[(65535&y)+(l&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&y,d<(_&=15)&&(l+=j[i++]<>>=_,d-=_,(_=a-o)>3,l&=(1<<(d-=w<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new P.Buf16(320),this.work=new P.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=N,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new P.Buf32(i),t.distcode=t.distdyn=new P.Buf32(n),t.sane=1,t.back=-1,z):M}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):M}function c(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=a.wsize?(P.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(n=a.wsize-a.wnext)&&(n=i),P.arraySet(a.window,t,r-i,n,a.wnext),(i-=n)?(P.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=T(r.check,A,2,0),f=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(f-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=3;case 3:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>8&255,A[2]=u>>>16&255,A[3]=u>>>24&255,r.check=T(r.check,A,4,0)),f=u=0,r.mode=4;case 4:for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>8),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>>8&255,r.check=T(r.check,A,2,0)),f=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(s<(l=r.length)&&(l=s),l&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),P.arraySet(r.head.extra,i,a,l,k)),512&r.flags&&(r.check=T(r.check,i,l,a)),s-=l,a+=l,r.length-=l),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;for(l=0;k=i[a+l++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&l>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>=7&f,f-=7&f,r.mode=27;break}for(;f<3;){if(0===s)break e;s--,u+=i[a++]<>>=1)){case 0:r.mode=14;break;case 1:if(q(r),r.mode=20,6!==t)break;u>>>=2,f-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,f-=2;break;case 14:for(u>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,u+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,f=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(l=r.length){if(s>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,286>>=3,f-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=C(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=g,f-=g,r.lens[r.have++]=b;else{if(16===b){for(j=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],l=3+(3&u),u>>>=2,f-=2}else if(17===b){for(j=g+3;f>>=g)),u>>>=3,f-=3}else{for(j=g+7;f>>=g)),u>>>=7,f-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;l--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=C(F,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=C(R,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=s&&258<=c){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,r.hold=u,r.bits=f,B(e,h),o=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,u=r.hold,f=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;v=(E=r.lencode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,r.length=b,0===v){r.mode=26;break}if(32&v){r.back=-1,r.mode=12;break}if(64&v){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&v,r.mode=22;case 22:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=(E=r.distcode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&v,r.mode=24;case 24:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===c)break e;if(l=h-c,r.offset>l){if((l=r.offset-l)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d=l>r.wnext?(l-=r.wnext,r.wsize-l):r.wnext-l,l>r.length&&(l=r.length),m=r.window}else m=n,d=o-r.offset,l=r.length;for(cl?(m=B[C+o[y]],I[P+o[y]]):(m=96,0),c=1<>S)+(u-=c)]=d<<24|m<<16|g|0,0!==u;);for(c=1<>=1;if(0!==c?(A&=c-1,A+=c):A=0,y++,0==--O[b]){if(b===w)break;b=t[r+o[y]]}if(k>>7)]}function M(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function N(e,t,r){e.bi_valid>n-r?(e.bi_buf|=t<>n-e.bi_valid,e.bi_valid+=r-n):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function L(e,t,r){var i,n,a=new Array(v+1),o=0;for(i=1;i<=v;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=q(a[s]++,s))}}function U(e){var t;for(t=0;t>1;1<=r;r--)V(e,a,r);for(n=c;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],V(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,a[2*n]=a[2*r]+a[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,a[2*r+1]=a[2*i+1]=n,e.heap[1]=n++,V(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,n,a,o,s,c=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,p=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(a=0;a<=v;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return s;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return u;for(t=32;t>>3,(a=e.static_len+3+7>>>3)<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==t?X(e,t,r,i):4===e.strategy||a===n?(N(e,2+(i?1:0),3),G(e,E,A)):(N(e,4+(i?1:0),3),function(e,t,r,i){var n;for(N(e,t-257,5),N(e,r-1,5),N(e,i-4,4),n=0;n>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(P[r]+p+1)]++,e.dyn_dtree[2*z(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;N(e,2,3),D(e,b,E),16===(t=e).bi_valid?(M(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":358}],368:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],369:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],370:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var a=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=a;var o=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=o;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var f=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=f,r.DSAparam=i.define("DSAparam",function(){this.int()});var p=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=p;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":371,"asn1.js":46}],371:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),a=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(a)}),u=i.define("RDNSequence",function(){this.seqof(c)}),f=i.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),p=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(f),this.key("validity").use(p),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),d=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=d},{"asn1.js":46}],372:[function(e,t,r){(function(h){var l=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,d=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m,m=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,g=e("evp_bytestokey"),v=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(l);if(n){var a="aes"+n[1],o=new h(n[2],"hex"),s=new h(n[3].replace(/[\r\n]/g,""),"base64"),c=g(t,o.slice(0,8),parseInt(n[1],10)).key,u=[],f=v.createDecipheriv(a,c,o);u.push(f.update(s)),u.push(f.final()),r=h.concat(u)}else{var p=i.match(m);r=new h(p[2].replace(/[\r\n]/g,""),"base64")}return{tag:i.match(d)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":160,buffer:191,evp_bytestokey:270}],373:[function(t,r,e){(function(b){var y=t("./asn1"),_=t("./aesid.json"),w=t("./fixProc"),k=t("browserify-aes"),x=t("pbkdf2");function e(e){var t;"object"!==(void 0===e?"undefined":_typeof(e))||b.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new b(e));var r,i,n,a,o,s,c,u,f,p,h,l,d,m=w(e,t),g=m.tag,v=m.data;switch(g){case"CERTIFICATE":i=y.certificate.decode(v,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=y.PublicKey.decode(v,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=y.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"ENCRYPTED PRIVATE KEY":v=y.EncryptedPrivateKey.decode(v,"der"),a=t,o=(n=v).algorithm.decrypt.kde.kdeparams.salt,s=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=_[n.algorithm.decrypt.cipher.algo.join(".")],u=n.algorithm.decrypt.cipher.iv,f=n.subjectPrivateKey,p=parseInt(c.split("-")[1],10)/8,h=x.pbkdf2Sync(a,o,s,p),l=k.createDecipheriv(c,h,u),(d=[]).push(l.update(f)),d.push(l.final()),v=b.concat(d);case"PRIVATE KEY":switch(r=(i=y.PrivateKey.decode(v,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:y.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=y.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"RSA PUBLIC KEY":return y.RSAPublicKey.decode(v,"der");case"RSA PRIVATE KEY":return y.RSAPrivateKey.decode(v,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:y.DSAPrivateKey.decode(v,"der")};case"EC PRIVATE KEY":return{curve:(v=y.ECPrivateKey.decode(v,"der")).parameters.value,privateKey:v.privateKey};default:throw new Error("unknown key type "+g)}}(r.exports=e).signature=y.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":369,"./asn1":370,"./fixProc":372,"browserify-aes":160,buffer:191,pbkdf2:375}],374:[function(e,t,u){(function(n){function a(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function o(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;ia?t=n(t):t.length "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+o+";","var res;","switch (argLength) {",r.concat(["extra"]).map(function(e,t){return"case "+t+":res = fn.call("+["self"].concat(r.slice(0,t)).concat("cb").join(",")+");break;"}).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],n)(a,e)}(e)};var o="function (err, res) {if (err) { rj(err); } else { rs(res); }}";a.nodeify=function(r){return function(){var e=Array.prototype.slice.call(arguments),t="function"==typeof e[e.length-1]?e.pop():null,i=this;try{return r.apply(this,arguments).nodeify(t,i)}catch(r){if(null==t)return new a(function(e,t){t(r)});n(function(){t.call(i,r)})}}},a.prototype.nodeify=function(t,r){if("function"!=typeof t)return this;this.then(function(e){n(function(){t.call(r,null,e)})},function(e){n(function(){t.call(r,e)})})}},{"./core.js":384,asap:44}],390:[function(e,t,r){"use strict";var i=e("./core.js");(t.exports=i).enableSynchronous=function(){i.prototype.isPending=function(){return 0==this.getState()},i.prototype.isFulfilled=function(){return 1==this.getState()},i.prototype.isRejected=function(){return 2==this.getState()},i.prototype.getValue=function(){if(3===this._65)return this._55.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._55},i.prototype.getReason=function(){if(3===this._65)return this._55.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._55},i.prototype.getState=function(){return 3===this._65?this._55.getState():-1===this._65||-2===this._65?0:this._65}},i.disableSynchronous=function(){i.prototype.isPending=void 0,i.prototype.isFulfilled=void 0,i.prototype.isRejected=void 0,i.prototype.getValue=void 0,i.prototype.getReason=void 0,i.prototype.getState=void 0}},{"./core.js":384}],391:[function(e,t,r){"use strict";var n=function(e){for(var t=e.toString(16);4!==t.length;)t="0"+t;return"\\u"+t};t.exports=function(e,t,r,i){return!r.key||61!==t&&58!==t&&t!==r.separator?31o||0<=new u(t).cmp(a.modulus))throw new Error("decryption error");n=r?d(new u(t),a):h(t,a);var s=m.alloc(o-n.length);if(n=m.concat([s,n],o),4===i)return function(e,t){var r=e.modulus.byteLength(),i=l("sha1").update(m.alloc(0)).digest(),n=i.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,n+1),o=t.slice(n+1),s=p(a,f(o,n)),c=p(o,f(s,r-n-1));if(function(e,t){e=m.from(e),t=m.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){a++;break}var o=t.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&a++;o.length<8&&a++;if(a)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}},{"./mgf":401,"./withPublic":404,"./xor":405,"bn.js":154,"browserify-rsa":178,"create-hash":200,"parse-asn1":373,"safe-buffer":447}],403:[function(e,t,r){var o=e("parse-asn1"),h=e("randombytes"),l=e("create-hash"),d=e("./mgf"),m=e("./xor"),g=e("bn.js"),s=e("./withPublic"),c=e("browserify-rsa"),v=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,a=o(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=l("sha1").update(v.alloc(0)).digest(),a=n.length,o=2*a;if(r-o-2>6]+a[128|63&n]:n<55296||57344<=n?r+=a[224|n>>12]+a[128|n>>6&63]+a[128|63&n]:(i+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),r+=a[240|n>>18]+a[128|n>>12&63]+a[128|n>>6&63]+a[128|63&n])}return r},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function i(r,n,a){if(!n)return r;if("object"!==(void 0===n?"undefined":_typeof(n))){if(Array.isArray(r))r.push(n);else{if("object"!==(void 0===r?"undefined":_typeof(r)))return[r,n];(a.plainObjects||a.allowPrototypes||!o.call(Object.prototype,n))&&(r[n]=!0)}return r}if("object"!==(void 0===r?"undefined":_typeof(r)))return[r].concat(n);var e=r;return Array.isArray(r)&&!Array.isArray(n)&&(e=s(r,a)),Array.isArray(r)&&Array.isArray(n)?(n.forEach(function(e,t){o.call(r,t)?r[t]&&"object"===_typeof(r[t])?r[t]=i(r[t],e,a):r.push(e):r[t]=e}),r):Object.keys(n).reduce(function(e,t){var r=n[t];return o.call(e,t)?e[t]=i(e[t],r,a):e[t]=r,e},e)}}},{}],411:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var a=/\+/g;e=e.split(t);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var s,c,u=e.length;0t.highWaterMark&&(t.highWaterMark=(m<=(r=e)?r=m:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(_("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?v.nextTick(x,e):x(e))}function x(e){_("emit readable"),e.emit("readable"),I(e)}function S(e,t){t.readingMore||(t.readingMore=!0,v.nextTick(j,e,t))}function j(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;ea.length?a.length:e;if(o===a.length?n+=a:n+=a.slice(0,e),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=a.slice(o);break}++i}return t.length-=i,n}(e,t):function(e,t){var r=u.allocUnsafe(e),i=t.head,n=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i).data=a.slice(o);break}++n}return t.length-=n,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return _("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):k(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,n=t.needReadable;return _("need readable",n),(0===t.length||t.length-e>>0),a=this.head,o=0;a;)t=a.data,r=n,i=o,t.copy(r,i),o+=a.data.length,a=a.next;return n},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":447,util:157}],423:[function(e,t,r){"use strict";var a=e("process-nextick-args");function o(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a.nextTick(o,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(o,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":381}],424:[function(e,t,r){t.exports=e("events").EventEmitter},{events:269}],425:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":426}],426:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":417,"./lib/_stream_passthrough.js":418,"./lib/_stream_readable.js":419,"./lib/_stream_transform.js":420,"./lib/_stream_writable.js":421}],427:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":426}],428:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":421}],429:[function(e,t,r){"use strict";var s=e("../"),c=e("lodash/isArray"),u=e("lodash/isFunction"),f=e("lodash/isObjectLike");t.exports=function(e){var t="Please verify options";if(!f(e))throw new TypeError(t);if(!u(e.request))throw new TypeError(t+".request");if(!c(e.expose)||0===e.expose.length)throw new TypeError(t+".expose");for(var r=s({PromiseImpl:e.PromiseImpl,constructorMixin:e.constructorMixin}),i=e.request.Request.prototype.init,n=!(e.request.Request.prototype.init=function(e){return!f(e)||this._callback||this._rp_promise||r.init.call(this,e),i.apply(this,arguments)}),a=0;a=t.maxRedirects)return r.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+r.uri.href)),!1;t.redirectsFollowed+=1,o.test(i)||(i=a.resolve(r.uri.href,i));var n=r.uri;return r.uri=a.parse(i),r.uri.protocol!==n.protocol&&delete r.agent,t.redirects.push({statusCode:e.statusCode,redirectUri:i}),t.followAllRedirects&&"HEAD"!==r.method&&401!==e.statusCode&&307!==e.statusCode&&(r.method=t.followOriginalHttpMethod?r.method:"GET"),delete r.src,delete r.req,delete r._started,401!==e.statusCode&&307!==e.statusCode&&(delete r.body,delete r._form,r.headers&&(r.removeHeader("host"),r.removeHeader("content-type"),r.removeHeader("content-length"),r.uri.hostname!==r.originalHost.split(":")[0]&&r.removeHeader("authorization"))),t.removeRefererHeader||r.setHeader("referer",n.href),r.emit("redirect"),r.init(),!0},r.Redirect=i},{url:500}],444:[function(e,t,r){"use strict";var w=e("url"),k=e("tunnel-agent"),i=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],x=["proxy-authorization"];function n(e){this.request=e,this.proxyHeaderWhiteList=i,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}n.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},n.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=w.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,i,n,a,o,s,c=this.proxyHeaderExclusiveList.concat(x),u=this.proxyHeaderWhiteList.concat(c),f=(r=t.headers,i=u.reduce(function(e,t){return e[t.toLowerCase()]=!0,e},{}),Object.keys(r).filter(function(e){return i[e.toLowerCase()]}).reduce(function(e,t){return e[t]=r[t],e},{}));f.host=(n=t.uri,a=n.port,o=n.protocol,s=n.hostname+":",s+=a||("https:"===o?"443":"80")),c.forEach(t.removeHeader,t);var p,h,l,d,m,g,v,b,y=(l=(p=t).uri,d=p.proxy,h=d,m=["https:"===l.protocol?"https":"http","https:"===h.protocol?"Https":"Http"].join("Over"),k[m]),_=(v=f,{proxy:{host:(b=(g=t).proxy).hostname,port:+b.port,proxyAuth:b.auth,headers:v},headers:g.headers,ca:g.ca,cert:g.cert,key:g.key,passphrase:g.passphrase,pfx:g.pfx,ciphers:g.ciphers,rejectUnauthorized:g.rejectUnauthorized,secureOptions:g.secureOptions,secureProtocol:g.secureProtocol});return t.agent=y(_),!0},n.defaultProxyHeaderWhiteList=i,n.defaultProxyHeaderExclusiveList=x,r.Tunnel=n},{"tunnel-agent":497,url:500}],445:[function(U,H,e){(function(e){"use strict";var w=U("http"),k=U("https"),x=U("url"),t=U("util"),n=U("stream"),f=U("zlib"),c=U("aws-sign2"),u=U("aws4"),i=U("http-signature"),S=U("mime-types"),j=U("caseless"),E=U("forever-agent"),r=U("form-data"),a=U("extend"),A=U("isstream"),I=U("is-typedarray").strict,o=U("./lib/helpers"),s=U("./lib/cookies"),P=U("./lib/getProxyFromURI"),p=U("./lib/querystring").Querystring,h=U("./lib/har").Har,l=U("./lib/auth").Auth,d=U("./lib/oauth").OAuth,m=U("./lib/hawk"),g=U("./lib/multipart").Multipart,v=U("./lib/redirect").Redirect,b=U("./lib/tunnel").Tunnel,y=U("performance-now"),O=U("safe-buffer").Buffer,_=o.safeStringify,T=o.isReadStream,B=o.toBase64,C=o.defer,F=o.copy,R=o.version,z=s.jar(),M={};function N(){return{uri:this.uri,method:this.method,headers:this.headers}}function D(){return{statusCode:this.statusCode,body:this.body,headers:this.headers,request:N.call(this.request)}}function q(e){var t=this;e.har&&(t._har=new h(t),e=t._har.options(e)),n.Stream.call(t);var r=Object.keys(q.prototype),i=function(e,t){var r={};for(var i in t)-1===e.indexOf(i)&&(r[i]=t[i]);return r}(r,e);a(t,i),e=function(e,t){var r={};for(var i in t){var n=!(-1===e.indexOf(i)),a="function"==typeof t[i];n&&a||(r[i]=t[i])}return r}(r,e),t.readable=!0,t.writable=!0,e.method&&(t.explicitMethod=!0),t._qs=new p(t),t._auth=new l(t),t._oauth=new d(t),t._multipart=new g(t),t._redirect=new v(t),t._tunnel=new b(t),t.init(e)}function L(){q.debug&&console.error("REQUEST %s",t.format.apply(t,arguments))}t.inherits(q,n.Stream),q.debug=e.env.NODE_DEBUG&&/\brequest\b/.test(e.env.NODE_DEBUG),q.prototype.debug=L,q.prototype.init=function(e){var i=this;for(var t in e||(e={}),i.headers=i.headers?F(i.headers):{},i.headers)void 0===i.headers[t]&&delete i.headers[t];if(j.httpify(i,i.headers),i.method||(i.method=e.method||"GET"),i.localAddress||(i.localAddress=e.localAddress),i._qs.init(e),L(e),i.pool||!1===i.pool||(i.pool=M),i.dests=i.dests||[],i.__isRequestRequest=!0,!i._callback&&i.callback&&(i._callback=i.callback,i.callback=function(){i._callbackCalled||(i._callbackCalled=!0,i._callback.apply(i,arguments))},i.on("error",i.callback.bind()),i.on("complete",i.callback.bind(i,null))),!i.uri&&i.url&&(i.uri=i.url,delete i.url),i.baseUrl){if("string"!=typeof i.baseUrl)return i.emit("error",new Error("options.baseUrl must be a string"));if("string"!=typeof i.uri)return i.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(0===i.uri.indexOf("//")||-1!==i.uri.indexOf("://"))return i.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var r=i.baseUrl.lastIndexOf("/")===i.baseUrl.length-1,n=0===i.uri.indexOf("/");r&&n?i.uri=i.baseUrl+i.uri.slice(1):r||n?i.uri=i.baseUrl+i.uri:""===i.uri?i.uri=i.baseUrl:i.uri=i.baseUrl+"/"+i.uri,delete i.baseUrl}if(!i.uri)return i.emit("error",new Error("options.uri is a required argument"));if("string"==typeof i.uri&&(i.uri=x.parse(i.uri)),i.uri.href||(i.uri.href=x.format(i.uri)),"unix:"===i.uri.protocol)return i.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if("unix"===i.uri.host&&i.enableUnixSocket(),!1===i.strictSSL&&(i.rejectUnauthorized=!1),i.uri.pathname||(i.uri.pathname="/"),!(i.uri.host||i.uri.hostname&&i.uri.port||i.uri.isUnix)){var a='Invalid URI "'+x.format(i.uri)+'"';return 0===Object.keys(e).length&&(a+=". This can be caused by a crappy redirection."),i.abort(),i.emit("error",new Error(a))}if(i.hasOwnProperty("proxy")||(i.proxy=P(i.uri)),i.tunnel=i._tunnel.isEnabled(),i.proxy&&i._tunnel.setup(e),i._redirect.onRequest(e),i.setHost=!1,!i.hasHeader("host")){var o=i.originalHostHeaderName||"host";i.setHeader(o,i.uri.host),i.uri.port&&("80"===i.uri.port&&"http:"===i.uri.protocol||"443"===i.uri.port&&"https:"===i.uri.protocol)&&i.setHeader(o,i.uri.hostname),i.setHost=!0}if(i.jar(i._jar||e.jar),i.uri.port||("http:"===i.uri.protocol?i.uri.port=80:"https:"===i.uri.protocol&&(i.uri.port=443)),i.proxy&&!i.tunnel?(i.port=i.proxy.port,i.host=i.proxy.hostname):(i.port=i.uri.port,i.host=i.uri.hostname),e.form&&i.form(e.form),e.formData){var s=e.formData,c=i.form(),u=function(e,t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?c.append(e,t.value,t.options):c.append(e,t)};for(var f in s)if(s.hasOwnProperty(f)){var p=s[f];if(p instanceof Array)for(var h=0;h>>32-t}function S(e,t,r,i,n,a,o,s){return x(e+(t^r^i)+a+o|0,s)+n|0}function j(e,t,r,i,n,a,o,s){return x(e+(t&r|~t&i)+a+o|0,s)+n|0}function E(e,t,r,i,n,a,o,s){return x(e+((t|~r)^i)+a+o|0,s)+n|0}function A(e,t,r,i,n,a,o,s){return x(e+(t&i|r&~i)+a+o|0,s)+n|0}function I(e,t,r,i,n,a,o,s){return x(e+(t^(r|~i))+a+o|0,s)+n|0}n(o,a),o.prototype._update=function(){for(var e=g,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,a=0|this._d,o=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,f=0|this._d,p=0|this._e,h=0;h<80;h+=1){var l,d;d=h<16?(l=S(r,i,n,a,o,e[v[h]],w[0],y[h]),I(s,c,u,f,p,e[b[h]],k[0],_[h])):h<32?(l=j(r,i,n,a,o,e[v[h]],w[1],y[h]),A(s,c,u,f,p,e[b[h]],k[1],_[h])):h<48?(l=E(r,i,n,a,o,e[v[h]],w[2],y[h]),E(s,c,u,f,p,e[b[h]],k[2],_[h])):h<64?(l=A(r,i,n,a,o,e[v[h]],w[3],y[h]),j(s,c,u,f,p,e[b[h]],k[3],_[h])):(l=I(r,i,n,a,o,e[v[h]],w[4],y[h]),S(s,c,u,f,p,e[b[h]],k[4],_[h])),r=o,o=a,a=x(n,10),n=i,i=l,s=p,p=f,f=x(u,10),u=c,c=d}var m=this._b+n+f|0;this._b=this._c+a+p|0,this._c=this._d+o+s|0,this._d=this._e+r+c|0,this._e=this._a+i+u|0,this._a=m},o.prototype._digest=function(){this._block[this._blockOffset++]=128,56=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 a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":447}],450:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":451,"./sha1":452,"./sha224":453,"./sha256":454,"./sha384":455,"./sha512":456}],451:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,v=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s=this._w,c=0|this._a,u=0|this._b,f=0|this._c,p=0|this._d,h=0|this._e,l=0;l<16;++l)s[l]=e.readInt32BE(4*l);for(;l<80;++l)s[l]=s[l-3]^s[l-8]^s[l-14]^s[l-16];for(var d=0;d<80;++d){var m=~~(d/20),g=0|((o=c)<<5|o>>>27)+(i=u,n=f,a=p,0===(r=m)?i&n|~i&a:2===r?i&n|i&a|n&a:i^n^a)+h+s[d]+v[m];h=p,p=f,f=(t=u)<<30|t>>>2,u=c,c=g}this._a=c+this._a|0,this._b=u+this._b|0,this._c=f+this._c|0,this._d=p+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],452:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0;d<16;++d)c[d]=e.readInt32BE(4*d);for(;d<80;++d)c[d]=(t=c[d-3]^c[d-8]^c[d-14]^c[d-16])<<1|t>>>31;for(var m=0;m<80;++m){var g=~~(m/20),v=0|((s=u)<<5|s>>>27)+(n=f,a=p,o=h,0===(i=g)?n&a|~n&o:2===i?n&a|n&o|a&o:n^a^o)+l+c[m]+b[g];l=h,h=p,p=(r=f)<<30|r>>>2,f=u,u=v}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],453:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}i(c,n),c.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},c.prototype._hash=function(){var e=o.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},t.exports=c},{"./hash":449,"./sha256":454,inherits:320,"safe-buffer":447}],454:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,w=[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],o=new Array(64);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0|this._f,m=0|this._g,g=0|this._h,v=0;v<16;++v)c[v]=e.readInt32BE(4*v);for(;v<64;++v)c[v]=0|(((r=c[v-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+c[v-7]+(((t=c[v-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+c[v-16];for(var b=0;b<64;++b){var y=g+(((s=l)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((o=m)^l&(d^o))+w[b]+c[b]|0,_=0|(((a=u)>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+((i=u)&(n=f)|p&(i|n));g=m,m=d,d=l,l=h+y|0,h=p,p=f,f=u,u=y+_|0}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],455:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(160);function c(){this.init(),this._w=s,a.call(this,128,112)}i(c,n),c.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},c.prototype._hash=function(){var i=o.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=c},{"./hash":449,"./sha512":456,inherits:320,"safe-buffer":447}],456:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,ee=[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],o=new Array(160);function s(){this.init(),this._w=o,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ae(e,t){return e>>>0>>0?1:0}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c,u=this._w,f=0|this._ah,p=0|this._bh,h=0|this._ch,l=0|this._dh,d=0|this._eh,m=0|this._fh,g=0|this._gh,v=0|this._hh,b=0|this._al,y=0|this._bl,_=0|this._cl,w=0|this._dl,k=0|this._el,x=0|this._fl,S=0|this._gl,j=0|this._hl,E=0;E<32;E+=2)u[E]=e.readInt32BE(4*E),u[E+1]=e.readInt32BE(4*E+4);for(;E<160;E+=2){var A=u[E-30],I=u[E-30+1],P=((s=A)>>>1|(c=I)<<31)^(s>>>8|c<<24)^s>>>7,O=((a=I)>>>1|(o=A)<<31)^(a>>>8|o<<24)^(a>>>7|o<<25);A=u[E-4],I=u[E-4+1];var T=((i=A)>>>19|(n=I)<<13)^(n>>>29|i<<3)^i>>>6,B=((t=I)>>>19|(r=A)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),C=u[E-14],F=u[E-14+1],R=u[E-32],z=u[E-32+1],M=O+F|0,N=P+C+ae(M,O)|0;N=(N=N+T+ae(M=M+B|0,B)|0)+R+ae(M=M+z|0,z)|0,u[E]=N,u[E+1]=M}for(var D=0;D<160;D+=2){N=u[D],M=u[D+1];var q=re(f,p,h),L=re(b,y,_),U=ie(f,b),H=ie(b,f),K=ne(d,k),V=ne(k,d),G=ee[D],$=ee[D+1],W=te(d,m,g),Z=te(k,x,S),Y=j+V|0,X=v+K+ae(Y,j)|0;X=(X=(X=X+W+ae(Y=Y+Z|0,Z)|0)+G+ae(Y=Y+$|0,$)|0)+N+ae(Y=Y+M|0,M)|0;var J=H+L|0,Q=U+q+ae(J,H)|0;v=g,j=S,g=m,S=x,m=d,x=k,d=l+X+ae(k=w+Y|0,w)|0,l=h,w=_,h=p,_=y,p=f,y=b,f=X+Q+ae(b=Y+J|0,Y)|0}this._al=this._al+b|0,this._bl=this._bl+y|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+k|0,this._fl=this._fl+x|0,this._gl=this._gl+S|0,this._hl=this._hl+j|0,this._ah=this._ah+f+ae(this._al,b)|0,this._bh=this._bh+p+ae(this._bl,y)|0,this._ch=this._ch+h+ae(this._cl,_)|0,this._dh=this._dh+l+ae(this._dl,w)|0,this._eh=this._eh+d+ae(this._el,k)|0,this._fh=this._fh+m+ae(this._fl,x)|0,this._gh=this._gh+g+ae(this._gl,S)|0,this._hh=this._hh+v+ae(this._hl,j)|0},s.prototype._hash=function(){var i=a.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],457:[function(e,t,r){var i=e("safer-buffer").Buffer,n={dsa:{parts:["p","q","g","y"],sizePart:"p"},rsa:{parts:["e","n"],sizePart:"n"},ecdsa:{parts:["curve","Q"],sizePart:"Q"},ed25519:{parts:["A"],sizePart:"A"}};n.curve25519=n.ed25519;var a={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};a.curve25519=a.ed25519;var o={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:i.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g,""),"hex"),s:i.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g,""),"hex"),n:i.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g,""),"hex"),G:i.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g,""),"hex"),s:i.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g,""),"hex"),n:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g,""),"hex"),G:i.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:i.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g,""),"hex"),a:i.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g,""),"hex"),s:i.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g,""),"hex"),n:i.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g,""),"hex"),G:i.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g,""),"hex")}};t.exports={info:n,privInfo:a,hashAlgs:{md5:!0,sha1:!0,sha256:!0,sha384:!0,sha512:!0},curves:o}},{"safer-buffer":448}],458:[function(e,t,r){t.exports=_;var d=e("assert-plus"),m=e("safer-buffer").Buffer,i=e("./algs"),n=e("crypto"),a=e("./fingerprint"),o=(e("./signature"),e("./errors")),g=(e("util"),e("./utils")),v=e("./key"),b=e("./private-key"),y=e("./identity"),s={};s.openssh=e("./formats/openssh-cert"),s.x509=e("./formats/x509"),s.pem=e("./formats/x509-pem");var c=o.CertificateParseError,u=o.InvalidAlgorithmError;function _(e){d.object(e,"options"),d.arrayOfObject(e.subjects,"options.subjects"),g.assertCompatible(e.subjects[0],y,[1,0],"options.subjects"),g.assertCompatible(e.subjectKey,v,[1,0],"options.subjectKey"),g.assertCompatible(e.issuer,y,[1,0],"options.issuer"),void 0!==e.issuerKey&&g.assertCompatible(e.issuerKey,v,[1,0],"options.issuerKey"),d.object(e.signatures,"options.signatures"),d.buffer(e.serial,"options.serial"),d.date(e.validFrom,"options.validFrom"),d.date(e.validUntil,"optons.validUntil"),d.optionalArrayOfString(e.purposes,"options.purposes"),this._hashCache={},this.subjects=e.subjects,this.issuer=e.issuer,this.subjectKey=e.subjectKey,this.issuerKey=e.issuerKey,this.signatures=e.signatures,this.serial=e.serial,this.validFrom=e.validFrom,this.validUntil=e.validUntil,this.purposes=e.purposes}_.formats=s,_.prototype.toBuffer=function(e,t){return void 0===e&&(e="x509"),d.string(e,"format"),d.object(s[e],"formats[format]"),d.optionalObject(t,"options"),s[e].write(this,t)},_.prototype.toString=function(e,t){return void 0===e&&(e="pem"),this.toBuffer(e,t).toString()},_.prototype.fingerprint=function(e){void 0===e&&(e="sha256"),d.string(e,"algorithm");var t={type:"certificate",hash:this.hash(e),algorithm:e};return new a(t)},_.prototype.hash=function(e){if(d.string(e,"algorithm"),e=e.toLowerCase(),void 0===i.hashAlgs[e])throw new u(e);if(this._hashCache[e])return this._hashCache[e];var t=n.createHash(e).update(this.toBuffer("x509")).digest();return this._hashCache[e]=t},_.prototype.isExpired=function(e){return void 0===e&&(e=new Date),!(e.getTime()>=this.validFrom.getTime()&&e.getTime()e.length||"BEGIN"!==e.slice(t,t+5).toString("ascii"))}(e))return a.read(e,t);if(function(e){var t=0;for(;to.length&&(p=o.length),u+=c.write(o.slice(f,p),u),c[u++]=10,f=p}return u+=c.write("-----END "+i+"-----\n",u),c.slice(0,u)}};var b=e("assert-plus"),y=e("asn1"),_=e("crypto"),w=e("safer-buffer").Buffer,k=(e("../algs"),e("../utils")),h=e("../key"),l=e("../private-key"),x=e("./pkcs1"),S=e("./pkcs8"),j=e("./ssh-private"),E=e("./rfc4253"),A=e("../errors")},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../utils":480,"./pkcs1":467,"./pkcs8":468,"./rfc4253":469,"./ssh-private":470,asn1:65,"assert-plus":66,crypto:204,"safer-buffer":448}],467:[function(e,t,r){t.exports={read:function(e,t){return i.read(e,t,"pkcs1")},readPkcs1:function(e,t,r){switch(e){case"RSA":if("public"===t)return u=y(c=r,"modulus"),f=y(c,"exponent"),new p({type:"rsa",parts:[{name:"e",data:f},{name:"n",data:u}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t[0],0);var r=y(e,"modulus"),i=y(e,"public exponent"),n=y(e,"private exponent"),a=y(e,"prime1"),o=y(e,"prime2"),s=y(e,"exponent1"),c=y(e,"exponent2"),u=y(e,"iqmp");return new v({type:"rsa",parts:[{name:"n",data:r},{name:"e",data:i},{name:"d",data:n},{name:"iqmp",data:u},{name:"p",data:a},{name:"q",data:o},{name:"dmodp",data:s},{name:"dmodq",data:c}]})}(r);throw new Error("Unknown key type: "+t);case"DSA":if("public"===t)return n=y(i=r,"y"),a=y(i,"p"),o=y(i,"q"),s=y(i,"g"),new p({type:"dsa",parts:[{name:"y",data:n},{name:"p",data:a},{name:"q",data:o},{name:"g",data:s}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),0);var r=y(e,"p"),i=y(e,"q"),n=y(e,"g"),a=y(e,"y"),o=y(e,"x");return new v({type:"dsa",parts:[{name:"p",data:r},{name:"q",data:i},{name:"g",data:n},{name:"y",data:a},{name:"x",data:o}]})}(r);throw new Error("Unknown key type: "+t);case"EC":case"ECDSA":if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),1);var r=e.readString(l.Ber.OctetString,!0);e.readSequence(160);var i=b(e);h.string(i,"a known elliptic curve"),e.readSequence(161);var n=e.readString(l.Ber.BitString,!0);n=g.ecNormalize(n);var a={type:"ecdsa",parts:[{name:"curve",data:d.from(i)},{name:"Q",data:n},{name:"d",data:r}]};return new v(a)}(r);if("public"===t)return function(e){e.readSequence();var t=e.readOID();h.strictEqual(t,"1.2.840.10045.2.1","must be ecPublicKey");for(var r,i=e.readOID(),n=Object.keys(m.curves),a=0;aS.length&&(I=S.length),E+=x.write(S.slice(A,I),E),x[E++]=10,A=I}return E+=x.write("-----END "+k+"-----\n",E),x.slice(0,E)}};var O,T=P("assert-plus"),B=(P("asn1"),P("safer-buffer").Buffer),C=(P("../algs"),P("../utils")),F=P("crypto"),R=(P("../key"),P("../private-key")),r=P("./pem"),A=P("./rfc4253"),z=P("../ssh-buffer"),I=P("../errors");var M="openssh-key-v1"},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../ssh-buffer":479,"../utils":480,"./pem":466,"./rfc4253":469,asn1:65,"assert-plus":66,"bcrypt-pbkdf":76,crypto:204,"safer-buffer":448}],471:[function(e,t,r){t.exports={read:function(e,t){"string"!=typeof e&&(h.buffer(e,"buf"),e=e.toString("ascii"));var r=e.trim().replace(/[\\\r]/g,""),i=r.match(m);i||(i=r.match(g));h.ok(i,"key must match regex");var n,a=d.algToKeyType(i[1]),o=l.from(i[2],"base64"),s={};if(i[4])try{n=d.read(o)}catch(e){i=r.match(g),h.ok(i,"key must match regex"),o=l.from(i[2],"base64"),n=d.readInternal(s,"public",o)}else n=d.readInternal(s,"public",o);if(h.strictEqual(a,n.type),i[4]&&0n.length&&(u=n.length),s+=o.write(n.slice(c,u),s),o[s++]=10,c=u}return s+=o.write("-----END "+i+"-----\n",s),o.slice(0,s)}};var o=e("assert-plus"),p=(e("asn1"),e("safer-buffer").Buffer);e("../algs"),e("../utils"),e("../key"),e("../private-key"),e("./pem"),e("../identity"),e("../signature"),e("../certificate")},{"../algs":457,"../certificate":458,"../identity":474,"../key":476,"../private-key":477,"../signature":478,"../utils":480,"./pem":466,"./x509":473,asn1:65,"assert-plus":66,"safer-buffer":448}],473:[function(e,t,r){t.exports={read:function(e,t){"string"==typeof e&&(e=_.from(e,"binary"));b.buffer(e,"buf");var r=new y.BerReader(e);if(r.readSequence(),1=this._buffer.length},a.prototype.remainder=function(){return this._buffer.slice(this._offset)},a.prototype.skip=function(e){this._offset+=e},a.prototype.expand=function(){this._size*=2;var e=n.alloc(this._size);this._buffer.copy(e,0),this._buffer=e},a.prototype.readPart=function(){return{data:this.readBuffer()}},a.prototype.readBuffer=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4,i.ok(this._offset+e<=this._buffer.length,"length out of bounds at +0x"+this._offset.toString(16)+" (data truncated?)");var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t},a.prototype.readString=function(){return this.readBuffer().toString()},a.prototype.readCString=function(){for(var e=this._offset;ethis._size;)this.expand();this._buffer.writeUInt32BE(e.length,this._offset),this._offset+=4,e.copy(this._buffer,this._offset),this._offset+=e.length},a.prototype.writeString=function(e){this.writeBuffer(n.from(e,"utf8"))},a.prototype.writeCString=function(e){for(;this._offset+1+e.length>this._size;)this.expand();this._buffer.write(e,this._offset),this._offset+=e.length,this._buffer[this._offset++]=0},a.prototype.writeInt=function(e){for(;this._offset+4>this._size;)this.expand();this._buffer.writeUInt32BE(e,this._offset),this._offset+=4},a.prototype.writeInt64=function(e){if(i.buffer(e,"value"),8this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=8},a.prototype.writeChar=function(e){for(;this._offset+1>this._size;)this.expand();this._buffer[this._offset++]=e},a.prototype.writePart=function(e){this.writeBuffer(e.data)},a.prototype.write=function(e){for(;this._offset+e.length>this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=e.length}},{"assert-plus":66,"safer-buffer":448}],480:[function(e,t,r){t.exports={bufferSplit:function(e,t){p.buffer(e),p.string(t);for(var r=[],i=0,n=0,a=0;a=t.length){var o=a+1;r.push(e.slice(i,o-n)),i=o,n=0}i<=e.length&&r.push(e.slice(i,e.length));return r},addRSAMissing:function(e){p.object(e),u(e,s,[1,1]);var t,r=new g(e.part.d.data);if(!e.part.dmodp){var i=new g(e.part.p.data),n=r.mod(i.subtract(1));t=_(n),e.part.dmodp={name:"dmodp",data:t},e.parts.push(e.part.dmodp)}if(!e.part.dmodq){var a=new g(e.part.q.data),o=r.mod(a.subtract(1));t=_(o),e.part.dmodq={name:"dmodq",data:t},e.parts.push(e.part.dmodq)}},calculateDSAPublic:function(e,t,r){return p.buffer(e),p.buffer(t),p.buffer(r),e=new g(e),t=new g(t),r=new g(r),_(e.modPow(r,t))},calculateED25519Public:function(e){p.buffer(e);var t=i.sign.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},calculateX25519Public:function(e){p.buffer(e);var t=i.box.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},mpNormalize:y,mpDenormalize:function(e){p.buffer(e);for(;1c)return!1;if(i.constructor.name!==t.name)return!1;var a=i._sshpkApiVersion;void 0===a&&(a=t._oldVersionDetect(e));return!(a[0]!=r[0]||a[1]t;)p.equal(e[0],0),e=e.slice(1);for(;e.length=r[1],i+" must be compatible with "+t.name+" klass version "+r[0]+"."+r[1])}}var v={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}},b=8;function y(e){for(p.buffer(e);1t._pos){var i=r.substr(t._pos);if("x-user-defined"===t._charset){for(var n=new p(i.length),a=0;at._pos&&(t.push(new p(new Uint8Array(o.result.slice(t._pos)))),t._pos=o.result.byteLength)},o.onload=function(){t.push(null)},o.readAsArrayBuffer(r)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":484,_process:382,buffer:191,inherits:320,"readable-stream":426}],487:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=p,t=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1=2.4.3 <2.5.0",_id:"tough-cookie@2.4.3",_inCache:!0,_installable:!0,_location:"/tough-cookie",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/tough-cookie_2.4.3_1529960207843_0.4882910670728131"},_npmUser:{email:"jstash@gmail.com",name:"jstash"},_npmVersion:"6.1.0",_phantomChildren:{},_requested:{name:"tough-cookie",raw:"tough-cookie@~2.4.3",rawSpec:"~2.4.3",scope:null,spec:">=2.4.3 <2.5.0",type:"range"},_requiredBy:["/request","/request-promise"],_resolved:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",_shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",_shrinkwrap:null,_spec:"tough-cookie@~2.4.3",_where:"/home/administrator/javascript-opentimestamps/node_modules/request",author:{email:"jstash@gmail.com",name:"Jeremy Stashewsky"},bugs:{url:"https://github.com/salesforce/tough-cookie/issues"},contributors:[{name:"Alexander Savin"},{name:"Ian Livingstone"},{name:"Ivan Nikulin"},{name:"Lalit Kapoor"},{name:"Sam Thompson"},{name:"Sebastian Mayr"}],dependencies:{psl:"^1.1.24",punycode:"^1.4.1"},description:"RFC6265 Cookies and Cookie Jar for node.js",devDependencies:{async:"^1.4.2",nyc:"^11.6.0","string.prototype.repeat":"^0.2.0",vows:"^0.8.1"},directories:{},dist:{fileCount:9,integrity:"sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMVcQCRA9TVsSAnZWagAAzX0P/2COkbzb3dOX/FTOYIVL\n7oHge7BvGODNkEHTjBtNsR0jO/AA/gVcUOq6CSmFH+UC14LrmCyNDemQvD15\njnYuJXUIiZsSZO7BGGbOFYrQF+DKLiwgf0LokrIM8KasZ5nxc5xS1jYHG5o+\nwCqutfhlRTqlPbZsexB+eRlIuYNvpsbRAdSDYXrhLJNMZgx49g/SZ7IwunGN\nJ/5Fe041MZqqdi7MAavM3T7vX9IvVRJJ3f4xAEVxY1vh4s0dN+h4fG2eMQzL\nOiaulRUIahs4xmJUYHZgZESc9eTIrI8K+YT7i3r35TGc0Du7ueB2KYxBqy7q\n6AUFbdX9Ep308kTVsTf/h4wE0RvdxKLfZ0ww7T1ivADX9xMi2oIvVtyhCQHo\nSIpyBhaav/fTufF0/Fu4Lcr7PMJxyvF0UcNRqrPmEQTw4UZkFKfT8HN2P5cH\nBvJsFwpeEjt84tt5pJ/bmD0j0EUCLUXLGH6fbA84fHpZGifO239zSf262Qdv\nSXeygU7YxnK8wOCnvlauZx/gp+/WTMfMdODxiX0QnqwS5BctiPCgGG1cKJcC\nqvTECaAEmxMVf/gEW73oxVXJgUO7f6jJaWoawV7ka+wR91W9Bp0pKGOOAxAG\nU72rmnwQKid9U7ly5833sb3D+lbzKJXGNIqohegP4daKZfNNTaLWZXmKE+Iy\n7Vml\r\n=8KpS\r\n-----END PGP SIGNATURE-----\r\n",shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",tarball:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",unpackedSize:83959},engines:{node:">=0.8"},files:["lib"],gitHead:"671ad413b38d7464352886772f57a7ec417d4760",homepage:"https://github.com/salesforce/tough-cookie",keywords:["HTTP","RFC2965","RFC6265","cookie","cookiejar","cookies","jar","set-cookie"],license:"BSD-3-Clause",main:"./lib/cookie",maintainers:[{name:"awaterma",email:"awaterma@awaterma.net"},{name:"jstash",email:"jstash@gmail.com"},{name:"maratto",email:"marat+npm@salesforce.com"},{name:"ruoho",email:"clint@ruoho.org"}],name:"tough-cookie",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/salesforce/tough-cookie.git"},scripts:{cover:"nyc --reporter=lcov --reporter=html vows test/*_test.js",test:"vows test/*_test.js"},version:"2.4.3"}},{}],497:[function(s,e,c){(function(u){"use strict";s("net");var f,a=s("tls"),r=s("http"),i=s("https"),e=s("events"),p=s("assert"),t=s("util"),h=s("safe-buffer").Buffer;function o(e){var o=this;o.options=e||{},o.proxyOptions=o.options.proxy||{},o.maxSockets=o.options.maxSockets||r.Agent.defaultMaxSockets,o.requests=[],o.sockets=[],o.on("free",function(e,t,r){for(var i=0,n=o.requests.length;i=this.maxSockets?this.requests.push({host:t.host,port:t.port,request:e}):this.createConnection({host:t.host,port:t.port,request:e})},o.prototype.createConnection=function(e){var n=this;n.createSocket(e,function(t){function r(){n.emit("free",t,e.host,e.port)}function i(e){n.removeSocket(t),t.removeListener("free",r),t.removeListener("close",i),t.removeListener("agentRemove",i)}t.on("free",r),t.on("close",i),t.on("agentRemove",i),e.request.onSocket(t)})},o.prototype.createSocket=function(n,a){var o=this,s={};o.sockets.push(s);var e=l({},o.proxyOptions,{method:"CONNECT",path:n.host+":"+n.port,agent:!1});e.proxyAuth&&(e.headers=e.headers||{},e.headers["Proxy-Authorization"]="Basic "+h.from(e.proxyAuth).toString("base64")),f("making CONNECT request");var c=o.request(e);function i(e,t,r){if(c.removeAllListeners(),t.removeAllListeners(),200===e.statusCode)p.equal(r.length,0),f("tunneling connection has established"),o.sockets[o.sockets.indexOf(s)]=t,a(t);else{f("tunneling socket could not be established, statusCode=%d",e.statusCode);var i=new Error("tunneling socket could not be established, statusCode="+e.statusCode);i.code="ECONNRESET",n.request.emit("error",i),o.removeSocket(s)}}c.useChunkedEncodingByDefault=!1,c.once("response",function(e){e.upgrade=!0}),c.once("upgrade",function(e,t,r){u.nextTick(function(){i(e,t,r)})}),c.once("connect",i),c.once("error",function(e){c.removeAllListeners(),f("tunneling socket could not be established, cause=%s\n",e.message,e.stack);var t=new Error("tunneling socket could not be established, cause="+e.message);t.code="ECONNRESET",n.request.emit("error",t),o.removeSocket(s)}),c.end()},o.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},f=u.env.NODE_DEBUG&&/\btunnel\b/.test(u.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},c.debug=f}).call(this,s("_process"))},{_process:382,assert:67,events:269,http:483,https:317,net:187,"safe-buffer":447,tls:187,util:505}],498:[function(e,t,r){!function(a){"use strict";var m=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function d(e,t,r,i,n){var a,o=0;for(a=0;a>>8)-1}function v(e,t,r,i){return d(e,t,r,i,16)}function b(e,t,r,i){return d(e,t,r,i,32)}function y(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=a,k=o,x=s,S=c,j=u,E=f,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=0;M<20;M+=2)w^=(n=(C^=(n=(P^=(n=(j^=(n=w+C|0)<<7|n>>>25)+w|0)<<9|n>>>23)+j|0)<<13|n>>>19)+P|0)<<18|n>>>14,E^=(n=(k^=(n=(F^=(n=(O^=(n=E+k|0)<<7|n>>>25)+E|0)<<9|n>>>23)+O|0)<<13|n>>>19)+F|0)<<18|n>>>14,T^=(n=(A^=(n=(x^=(n=(R^=(n=T+A|0)<<7|n>>>25)+T|0)<<9|n>>>23)+R|0)<<13|n>>>19)+x|0)<<18|n>>>14,z^=(n=(B^=(n=(I^=(n=(S^=(n=z+B|0)<<7|n>>>25)+z|0)<<9|n>>>23)+S|0)<<13|n>>>19)+I|0)<<18|n>>>14,w^=(n=(S^=(n=(x^=(n=(k^=(n=w+S|0)<<7|n>>>25)+w|0)<<9|n>>>23)+k|0)<<13|n>>>19)+x|0)<<18|n>>>14,E^=(n=(j^=(n=(I^=(n=(A^=(n=E+j|0)<<7|n>>>25)+E|0)<<9|n>>>23)+A|0)<<13|n>>>19)+I|0)<<18|n>>>14,T^=(n=(O^=(n=(P^=(n=(B^=(n=T+O|0)<<7|n>>>25)+T|0)<<9|n>>>23)+B|0)<<13|n>>>19)+P|0)<<18|n>>>14,z^=(n=(R^=(n=(F^=(n=(C^=(n=z+R|0)<<7|n>>>25)+z|0)<<9|n>>>23)+C|0)<<13|n>>>19)+F|0)<<18|n>>>14;w=w+a|0,k=k+o|0,x=x+s|0,S=S+c|0,j=j+u|0,E=E+f|0,A=A+p|0,I=I+h|0,P=P+l|0,O=O+d|0,T=T+m|0,B=B+g|0,C=C+v|0,F=F+b|0,R=R+y|0,z=z+_|0,e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=x>>>0&255,e[9]=x>>>8&255,e[10]=x>>>16&255,e[11]=x>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=j>>>0&255,e[17]=j>>>8&255,e[18]=j>>>16&255,e[19]=j>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=B>>>0&255,e[45]=B>>>8&255,e[46]=B>>>16&255,e[47]=B>>>24&255,e[48]=C>>>0&255,e[49]=C>>>8&255,e[50]=C>>>16&255,e[51]=C>>>24&255,e[52]=F>>>0&255,e[53]=F>>>8&255,e[54]=F>>>16&255,e[55]=F>>>24&255,e[56]=R>>>0&255,e[57]=R>>>8&255,e[58]=R>>>16&255,e[59]=R>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,i)}function _(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=0;w<20;w+=2)a^=(n=(v^=(n=(l^=(n=(u^=(n=a+v|0)<<7|n>>>25)+a|0)<<9|n>>>23)+u|0)<<13|n>>>19)+l|0)<<18|n>>>14,f^=(n=(o^=(n=(b^=(n=(d^=(n=f+o|0)<<7|n>>>25)+f|0)<<9|n>>>23)+d|0)<<13|n>>>19)+b|0)<<18|n>>>14,m^=(n=(p^=(n=(s^=(n=(y^=(n=m+p|0)<<7|n>>>25)+m|0)<<9|n>>>23)+y|0)<<13|n>>>19)+s|0)<<18|n>>>14,_^=(n=(g^=(n=(h^=(n=(c^=(n=_+g|0)<<7|n>>>25)+_|0)<<9|n>>>23)+c|0)<<13|n>>>19)+h|0)<<18|n>>>14,a^=(n=(c^=(n=(s^=(n=(o^=(n=a+c|0)<<7|n>>>25)+a|0)<<9|n>>>23)+o|0)<<13|n>>>19)+s|0)<<18|n>>>14,f^=(n=(u^=(n=(h^=(n=(p^=(n=f+u|0)<<7|n>>>25)+f|0)<<9|n>>>23)+p|0)<<13|n>>>19)+h|0)<<18|n>>>14,m^=(n=(d^=(n=(l^=(n=(g^=(n=m+d|0)<<7|n>>>25)+m|0)<<9|n>>>23)+g|0)<<13|n>>>19)+l|0)<<18|n>>>14,_^=(n=(y^=(n=(b^=(n=(v^=(n=_+y|0)<<7|n>>>25)+_|0)<<9|n>>>23)+v|0)<<13|n>>>19)+b|0)<<18|n>>>14;e[0]=a>>>0&255,e[1]=a>>>8&255,e[2]=a>>>16&255,e[3]=a>>>24&255,e[4]=f>>>0&255,e[5]=f>>>8&255,e[6]=f>>>16&255,e[7]=f>>>24&255,e[8]=m>>>0&255,e[9]=m>>>8&255,e[10]=m>>>16&255,e[11]=m>>>24&255,e[12]=_>>>0&255,e[13]=_>>>8&255,e[14]=_>>>16&255,e[15]=_>>>24&255,e[16]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255}(e,t,r,i)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function k(e,t,r,i,n,a,o){var s,c,u=new Uint8Array(16),f=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=a[c];for(;64<=n;){for(y(f,u,o,w),c=0;c<64;c++)e[t+c]=r[i+c]^f[c];for(s=1,c=8;c<16;c++)s=s+(255&u[c])|0,u[c]=255&s,s>>>=8;n-=64,t+=64,i+=64}if(0>>=8;r-=64,t+=64}if(0>>13|r<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|i<<6),n=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|n<<9),a=255&e[8]|(255&e[9])<<8,this.r[4]=255&(n>>>4|a<<12),this.r[5]=a>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(a>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,r,i,n,a){var o=new E(a);return o.update(r,i,n),o.finish(e,t),0}function I(e,t,r,i,n,a){var o=new Uint8Array(16);return A(o,0,r,i,n,a),v(e,t,o,0)}function P(e,t,r,i,n){var a;if(r<32)return-1;for(j(e,0,t,0,r,i,n),A(e,16,e,32,r-32,e),a=0;a<16;a++)e[a]=0;return 0}function O(e,t,r,i,n){var a,o=new Uint8Array(32);if(r<32)return-1;if(S(o,0,32,i,n),0!==I(t,16,t,32,r-32,o))return-1;for(j(e,0,t,0,r,i,n),a=0;a<32;a++)e[a]=0;return 0}function T(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function C(e,t,r){for(var i,n=~(r-1),a=0;a<16;a++)i=n&(e[a]^t[a]),e[a]^=i,t[a]^=i}function F(e,t){var r,i,n,a=m(),o=m();for(r=0;r<16;r++)o[r]=t[r];for(B(o),B(o),B(o),i=0;i<2;i++){for(a[0]=o[0]-65517,r=1;r<15;r++)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),n=a[15]>>16&1,a[14]&=65535,C(o,a,1-n)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function R(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return F(r,e),F(i,t),b(r,0,i,0)}function z(e){var t=new Uint8Array(32);return F(t,e),1&t[0]}function M(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function N(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function D(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function q(e,t,r){var i,n,a=0,o=0,s=0,c=0,u=0,f=0,p=0,h=0,l=0,d=0,m=0,g=0,v=0,b=0,y=0,_=0,w=0,k=0,x=0,S=0,j=0,E=0,A=0,I=0,P=0,O=0,T=0,B=0,C=0,F=0,R=0,z=r[0],M=r[1],N=r[2],D=r[3],q=r[4],L=r[5],U=r[6],H=r[7],K=r[8],V=r[9],G=r[10],$=r[11],W=r[12],Z=r[13],Y=r[14],X=r[15];a+=(i=t[0])*z,o+=i*M,s+=i*N,c+=i*D,u+=i*q,f+=i*L,p+=i*U,h+=i*H,l+=i*K,d+=i*V,m+=i*G,g+=i*$,v+=i*W,b+=i*Z,y+=i*Y,_+=i*X,o+=(i=t[1])*z,s+=i*M,c+=i*N,u+=i*D,f+=i*q,p+=i*L,h+=i*U,l+=i*H,d+=i*K,m+=i*V,g+=i*G,v+=i*$,b+=i*W,y+=i*Z,_+=i*Y,w+=i*X,s+=(i=t[2])*z,c+=i*M,u+=i*N,f+=i*D,p+=i*q,h+=i*L,l+=i*U,d+=i*H,m+=i*K,g+=i*V,v+=i*G,b+=i*$,y+=i*W,_+=i*Z,w+=i*Y,k+=i*X,c+=(i=t[3])*z,u+=i*M,f+=i*N,p+=i*D,h+=i*q,l+=i*L,d+=i*U,m+=i*H,g+=i*K,v+=i*V,b+=i*G,y+=i*$,_+=i*W,w+=i*Z,k+=i*Y,x+=i*X,u+=(i=t[4])*z,f+=i*M,p+=i*N,h+=i*D,l+=i*q,d+=i*L,m+=i*U,g+=i*H,v+=i*K,b+=i*V,y+=i*G,_+=i*$,w+=i*W,k+=i*Z,x+=i*Y,S+=i*X,f+=(i=t[5])*z,p+=i*M,h+=i*N,l+=i*D,d+=i*q,m+=i*L,g+=i*U,v+=i*H,b+=i*K,y+=i*V,_+=i*G,w+=i*$,k+=i*W,x+=i*Z,S+=i*Y,j+=i*X,p+=(i=t[6])*z,h+=i*M,l+=i*N,d+=i*D,m+=i*q,g+=i*L,v+=i*U,b+=i*H,y+=i*K,_+=i*V,w+=i*G,k+=i*$,x+=i*W,S+=i*Z,j+=i*Y,E+=i*X,h+=(i=t[7])*z,l+=i*M,d+=i*N,m+=i*D,g+=i*q,v+=i*L,b+=i*U,y+=i*H,_+=i*K,w+=i*V,k+=i*G,x+=i*$,S+=i*W,j+=i*Z,E+=i*Y,A+=i*X,l+=(i=t[8])*z,d+=i*M,m+=i*N,g+=i*D,v+=i*q,b+=i*L,y+=i*U,_+=i*H,w+=i*K,k+=i*V,x+=i*G,S+=i*$,j+=i*W,E+=i*Z,A+=i*Y,I+=i*X,d+=(i=t[9])*z,m+=i*M,g+=i*N,v+=i*D,b+=i*q,y+=i*L,_+=i*U,w+=i*H,k+=i*K,x+=i*V,S+=i*G,j+=i*$,E+=i*W,A+=i*Z,I+=i*Y,P+=i*X,m+=(i=t[10])*z,g+=i*M,v+=i*N,b+=i*D,y+=i*q,_+=i*L,w+=i*U,k+=i*H,x+=i*K,S+=i*V,j+=i*G,E+=i*$,A+=i*W,I+=i*Z,P+=i*Y,O+=i*X,g+=(i=t[11])*z,v+=i*M,b+=i*N,y+=i*D,_+=i*q,w+=i*L,k+=i*U,x+=i*H,S+=i*K,j+=i*V,E+=i*G,A+=i*$,I+=i*W,P+=i*Z,O+=i*Y,T+=i*X,v+=(i=t[12])*z,b+=i*M,y+=i*N,_+=i*D,w+=i*q,k+=i*L,x+=i*U,S+=i*H,j+=i*K,E+=i*V,A+=i*G,I+=i*$,P+=i*W,O+=i*Z,T+=i*Y,B+=i*X,b+=(i=t[13])*z,y+=i*M,_+=i*N,w+=i*D,k+=i*q,x+=i*L,S+=i*U,j+=i*H,E+=i*K,A+=i*V,I+=i*G,P+=i*$,O+=i*W,T+=i*Z,B+=i*Y,C+=i*X,y+=(i=t[14])*z,_+=i*M,w+=i*N,k+=i*D,x+=i*q,S+=i*L,j+=i*U,E+=i*H,A+=i*K,I+=i*V,P+=i*G,O+=i*$,T+=i*W,B+=i*Z,C+=i*Y,F+=i*X,_+=(i=t[15])*z,o+=38*(k+=i*N),s+=38*(x+=i*D),c+=38*(S+=i*q),u+=38*(j+=i*L),f+=38*(E+=i*U),p+=38*(A+=i*H),h+=38*(I+=i*K),l+=38*(P+=i*V),d+=38*(O+=i*G),m+=38*(T+=i*$),g+=38*(B+=i*W),v+=38*(C+=i*Z),b+=38*(F+=i*Y),y+=38*(R+=i*X),a=(i=(a+=38*(w+=i*M))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a=(i=(a+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a+=n-1+37*(n-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=h,e[8]=l,e[9]=d,e[10]=m,e[11]=g,e[12]=v,e[13]=b,e[14]=y,e[15]=_}function L(e,t){q(e,t,t)}function U(e,t){var r,i=m();for(r=0;r<16;r++)i[r]=t[r];for(r=253;0<=r;r--)L(i,i),2!==r&&4!==r&&q(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function H(e,t,r){var i,n,a=new Uint8Array(32),o=new Float64Array(80),s=m(),c=m(),u=m(),f=m(),p=m(),h=m();for(n=0;n<31;n++)a[n]=t[n];for(a[31]=127&t[31]|64,a[0]&=248,M(o,r),n=0;n<16;n++)c[n]=o[n],f[n]=s[n]=u[n]=0;for(s[0]=f[0]=1,n=254;0<=n;--n)C(s,c,i=a[n>>>3]>>>(7&n)&1),C(u,f,i),N(p,s,u),D(s,s,u),N(u,c,f),D(c,c,f),L(f,p),L(h,s),q(s,u,s),q(u,c,p),N(p,s,u),D(s,s,u),L(c,s),D(u,f,h),q(s,u,g),N(s,s,f),q(u,u,s),q(s,f,h),q(f,c,o),L(c,p),C(s,c,i),C(u,f,i);for(n=0;n<16;n++)o[n+16]=s[n],o[n+32]=u[n],o[n+48]=c[n],o[n+64]=f[n];var l=o.subarray(32),d=o.subarray(16);return U(l,l),q(d,d,l),F(e,d),0}function K(e,t){return H(e,t,r)}function V(e,t){return o(t,32),K(e,t)}function G(e,t,r){var i=new Uint8Array(32);return H(i,r,t),_(e,n,i,w)}E.prototype.blocks=function(e,t,r){for(var i,n,a,o,s,c,u,f,p,h,l,d,m,g,v,b,y,_,w,k=this.fin?0:2048,x=this.h[0],S=this.h[1],j=this.h[2],E=this.h[3],A=this.h[4],I=this.h[5],P=this.h[6],O=this.h[7],T=this.h[8],B=this.h[9],C=this.r[0],F=this.r[1],R=this.r[2],z=this.r[3],M=this.r[4],N=this.r[5],D=this.r[6],q=this.r[7],L=this.r[8],U=this.r[9];16<=r;)h=p=0,h+=(x+=8191&(i=255&e[t+0]|(255&e[t+1])<<8))*C,h+=(S+=8191&(i>>>13|(n=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*U),h+=(j+=8191&(n>>>10|(a=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*L),h+=(E+=8191&(a>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*q),p=(h+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*D))>>>13,h&=8191,h+=(I+=s>>>1&8191)*(5*N),h+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*M),h+=(O+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),h+=(T+=8191&(u>>>8|(f=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*R),l=p+=(h+=(B+=f>>>5|k)*(5*F))>>>13,l+=x*F,l+=S*C,l+=j*(5*U),l+=E*(5*L),p=(l+=A*(5*q))>>>13,l&=8191,l+=I*(5*D),l+=P*(5*N),l+=O*(5*M),l+=T*(5*z),p+=(l+=B*(5*R))>>>13,l&=8191,d=p,d+=x*R,d+=S*F,d+=j*C,d+=E*(5*U),p=(d+=A*(5*L))>>>13,d&=8191,d+=I*(5*q),d+=P*(5*D),d+=O*(5*N),d+=T*(5*M),m=p+=(d+=B*(5*z))>>>13,m+=x*z,m+=S*R,m+=j*F,m+=E*C,p=(m+=A*(5*U))>>>13,m&=8191,m+=I*(5*L),m+=P*(5*q),m+=O*(5*D),m+=T*(5*N),g=p+=(m+=B*(5*M))>>>13,g+=x*M,g+=S*z,g+=j*R,g+=E*F,p=(g+=A*C)>>>13,g&=8191,g+=I*(5*U),g+=P*(5*L),g+=O*(5*q),g+=T*(5*D),v=p+=(g+=B*(5*N))>>>13,v+=x*N,v+=S*M,v+=j*z,v+=E*R,p=(v+=A*F)>>>13,v&=8191,v+=I*C,v+=P*(5*U),v+=O*(5*L),v+=T*(5*q),b=p+=(v+=B*(5*D))>>>13,b+=x*D,b+=S*N,b+=j*M,b+=E*z,p=(b+=A*R)>>>13,b&=8191,b+=I*F,b+=P*C,b+=O*(5*U),b+=T*(5*L),y=p+=(b+=B*(5*q))>>>13,y+=x*q,y+=S*D,y+=j*N,y+=E*M,p=(y+=A*z)>>>13,y&=8191,y+=I*R,y+=P*F,y+=O*C,y+=T*(5*U),_=p+=(y+=B*(5*L))>>>13,_+=x*L,_+=S*q,_+=j*D,_+=E*N,p=(_+=A*M)>>>13,_&=8191,_+=I*z,_+=P*R,_+=O*F,_+=T*C,w=p+=(_+=B*(5*U))>>>13,w+=x*U,w+=S*L,w+=j*q,w+=E*D,p=(w+=A*N)>>>13,w&=8191,w+=I*M,w+=P*z,w+=O*R,w+=T*F,x=h=8191&(p=(p=((p+=(w+=B*C)>>>13)<<2)+p|0)+(h&=8191)|0),S=l+=p>>>=13,j=d&=8191,E=m&=8191,A=g&=8191,I=v&=8191,P=b&=8191,O=y&=8191,T=_&=8191,B=w&=8191,t+=16,r-=16;this.h[0]=x,this.h[1]=S,this.h[2]=j,this.h[3]=E,this.h[4]=A,this.h[5]=I,this.h[6]=P,this.h[7]=O,this.h[8]=T,this.h[9]=B},E.prototype.finish=function(e,t){var r,i,n,a,o=new Uint16Array(10);if(this.leftover){for(a=this.leftover,this.buffer[a++]=1;a<16;a++)this.buffer[a]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=r,r=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this.h[a]+r,r=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,i=(1^r)-1,a=0;a<10;a++)o[a]&=i;for(i=~i,a=0;a<10;a++)this.h[a]=this.h[a]&i|o[a];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,a=1;a<8;a++)n=(this.h[a]+this.pad[a]|0)+(n>>>16)|0,this.h[a]=65535&n;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var i,n;if(this.leftover){for(r<(n=16-this.leftover)&&(n=r),i=0;i>>16,I=65535&(S=D),P=S>>>16,E+=65535&(j=((g=K)>>>14|(c=z)<<18)^(K>>>18|z<<14)^(z>>>9|K<<23)),A+=j>>>16,I+=65535&(S=(z>>>14|K<<18)^(z>>>18|K<<14)^(K>>>9|z<<23)),P+=S>>>16,E+=65535&(j=K&(v=V)^~K&(b=G)),A+=j>>>16,I+=65535&(S=z&(u=M)^~z&(f=N)),P+=S>>>16,S=Z[2*k],E+=65535&(j=Z[2*k+1]),A+=j>>>16,I+=65535&S,P+=S>>>16,S=O[k%16],A+=(j=T[k%16])>>>16,I+=65535&S,P+=S>>>16,I+=(A+=(E+=65535&j)>>>16)>>>16,E=65535&(j=w=65535&E|A<<16),A=j>>>16,I=65535&(S=_=65535&I|(P+=I>>>16)<<16),P=S>>>16,E+=65535&(j=(q>>>28|B<<4)^(B>>>2|q<<30)^(B>>>7|q<<25)),A+=j>>>16,I+=65535&(S=(B>>>28|q<<4)^(q>>>2|B<<30)^(q>>>7|B<<25)),P+=S>>>16,A+=(j=q&L^q&U^L&U)>>>16,I+=65535&(S=B&C^B&F^C&F),P+=S>>>16,p=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,y=65535&E|A<<16,E=65535&(j=m),A=j>>>16,I=65535&(S=s),P=S>>>16,A+=(j=w)>>>16,I+=65535&(S=_),P+=S>>>16,C=n,F=a,R=o,z=s=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,M=c,N=u,D=f,B=p,L=h,U=l,H=d,K=m=65535&E|A<<16,V=g,G=v,$=b,q=y,k%16==15)for(x=0;x<16;x++)S=O[x],E=65535&(j=T[x]),A=j>>>16,I=65535&S,P=S>>>16,S=O[(x+9)%16],E+=65535&(j=T[(x+9)%16]),A+=j>>>16,I+=65535&S,P+=S>>>16,_=O[(x+1)%16],E+=65535&(j=((w=T[(x+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),A+=j>>>16,I+=65535&(S=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),P+=S>>>16,_=O[(x+14)%16],A+=(j=((w=T[(x+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,I+=65535&(S=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,O[x]=65535&I|P<<16,T[x]=65535&E|A<<16;E=65535&(j=q),A=j>>>16,I=65535&(S=B),P=S>>>16,S=e[0],A+=(j=t[0])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[0]=B=65535&I|P<<16,t[0]=q=65535&E|A<<16,E=65535&(j=L),A=j>>>16,I=65535&(S=C),P=S>>>16,S=e[1],A+=(j=t[1])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[1]=C=65535&I|P<<16,t[1]=L=65535&E|A<<16,E=65535&(j=U),A=j>>>16,I=65535&(S=F),P=S>>>16,S=e[2],A+=(j=t[2])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[2]=F=65535&I|P<<16,t[2]=U=65535&E|A<<16,E=65535&(j=H),A=j>>>16,I=65535&(S=R),P=S>>>16,S=e[3],A+=(j=t[3])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[3]=R=65535&I|P<<16,t[3]=H=65535&E|A<<16,E=65535&(j=K),A=j>>>16,I=65535&(S=z),P=S>>>16,S=e[4],A+=(j=t[4])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[4]=z=65535&I|P<<16,t[4]=K=65535&E|A<<16,E=65535&(j=V),A=j>>>16,I=65535&(S=M),P=S>>>16,S=e[5],A+=(j=t[5])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[5]=M=65535&I|P<<16,t[5]=V=65535&E|A<<16,E=65535&(j=G),A=j>>>16,I=65535&(S=N),P=S>>>16,S=e[6],A+=(j=t[6])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[6]=N=65535&I|P<<16,t[6]=G=65535&E|A<<16,E=65535&(j=$),A=j>>>16,I=65535&(S=D),P=S>>>16,S=e[7],A+=(j=t[7])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[7]=D=65535&I|P<<16,t[7]=$=65535&E|A<<16,W+=128,i-=128}return i}function X(e,t,r){var i,n=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,Y(n,a,t,r),r%=128,i=0;i>(7&n)&1),J(t,e),J(e,e),Q(e,t,i)}function re(e,t){var r=[m(),m(),m(),m()];T(r[0],i),T(r[1],s),T(r[2],f),q(r[3],i,s),te(e,r,t)}function ie(e,t,r){var i,n=new Uint8Array(64),a=[m(),m(),m(),m()];for(r||o(t,32),X(n,t,32),n[0]&=248,n[31]&=127,n[31]|=64,re(a,n),ee(e,a),i=0;i<32;i++)t[i+32]=e[i];return 0}var ne=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var r,i,n,a;for(i=63;32<=i;--i){for(r=0,n=i-32,a=i-12;n>8,t[n]-=256*r;t[n]+=r,t[i]=0}for(n=r=0;n<32;n++)t[n]+=r-(t[31]>>4)*ne[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*ne[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function oe(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function se(e,t,r,i){var n,a,o=new Uint8Array(64),s=new Uint8Array(64),c=new Uint8Array(64),u=new Float64Array(64),f=[m(),m(),m(),m()];X(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var p=r+64;for(n=0;n>7&&D(e[0],u,e[0]),q(e[3],e[0],e[1]),0)}function ue(e,t,r,i){var n,a=new Uint8Array(32),o=new Uint8Array(64),s=[m(),m(),m(),m()],c=[m(),m(),m(),m()];if(-1,r<64)return-1;if(ce(c,i))return-1;for(n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,M=String.fromCharCode;function N(e){throw new RangeError(o[e])}function s(e,t){var r=e.split("@"),i="";return 1>1,e+=z(e/t);455z((C-n)/p))&&N("overflow"),n+=l*p;var d=h<=o?1:o+26<=h?26:h-o;if(lz(C/m)&&N("overflow"),p*=m}var g=r.length+1;o=L(n-f,g,0==f),z(n/g)>C-a&&N("overflow"),a+=z(n/g),n%=g,r.splice(n++,0,a)}return String.fromCodePoint.apply(String,r)},u=function(e){var t=[],r=(e=D(e)).length,i=128,n=0,a=72,o=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(o=(u=f.next()).done);o=!0){var p=u.value;p<128&&t.push(M(p))}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}var h=t.length,l=h;for(h&&t.push("-");lz((C-n)/w)&&N("overflow"),n+=(d-i)*w,i=d;var k=!0,x=!1,S=void 0;try{for(var j,E=e[Symbol.iterator]();!(k=(j=E.next()).done);k=!0){var A=j.value;if(AC&&N("overflow"),A==i){for(var I=n,P=36;;P+=36){var O=P<=a?1:a+26<=P?26:P-a;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function l(e){for(var t="",r=0,i=e.length;rA-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(V,"g"),Y=new RegExp($,"g"),X=new RegExp(F("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',W),"g"),J=new RegExp(F("[^]",V,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),Q=J;function ee(e){var t=l(e);return t.match(Z)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,a={},o=r.query.split("&"),s=0,c=o.length;s",'"',"`"," ","\r","\n","\t"]),M=["'"].concat(n),N=["%","/","?",";","#"].concat(M),D=["/","?","#"],q=/^[+a-z0-9A-Z_-]{0,63}$/,L=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,U={javascript:!0,"javascript:":!0},H={javascript:!0,"javascript:":!0},K={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},V=e("querystring");function a(e,t,r){if(e&&F.isObject(e)&&e instanceof A)return e;var i=new A;return i.parse(e,t,r),i}A.prototype.parse=function(e,t,r){if(!F.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===e?"undefined":_typeof(e)));var i=e.indexOf("?"),n=-1!==i&&i>t&63|128)}function p(e){if(0==(4294967168&e))return s(e);var t="";return 0==(4294965248&e)?t=s(e>>6&31|192):0==(4294901760&e)?(u(e),t=s(e>>12&15|224),t+=f(e,6)):0==(4292870144&e)&&(t=s(e>>18&7|240),t+=f(e,12),t+=f(e,6)),t+=s(63&e|128)}function h(){if(a<=o)throw Error("Invalid byte index");var e=255&n[o];if(o++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,t;if(a>>10&1023|55296),t=56320|1023&t),n+=s(t);return n}(r)}};if("function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define(function(){return d});else if(t&&!t.nodeType)if(r)r.exports=d;else{var m={}.hasOwnProperty;for(var g in d)m.call(d,g)&&(t[g]=d[g])}else e.utf8=d}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],503:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],504:[function(e,t,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],505:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{"./support/isBuffer":504,_process:382,dup:70,inherits:320}],506:[function(e,t,r){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},{}],507:[function(e,t,r){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var n=new Uint8Array(16);t.exports=function(){return i(n),n}}else{var a=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}},{}],508:[function(e,t,r){var o=e("./lib/rng"),s=e("./lib/bytesToUuid");t.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var a=0;a<16;++a)t[i+a]=n[a];return t||s(n)}},{"./lib/bytesToUuid":506,"./lib/rng":507}],509:[function(e,t,r){var s=e("assert-plus"),i=e("util"),n=e("extsprintf"),c=e("core-util-is").isError,a=n.sprintf;function u(e){var t,r,i,n;if(s.object(e,"args"),s.bool(e.strict,"args.strict"),s.array(e.argv,"args.argv"),0===(t=e.argv).length)r={},i=[];else if(c(t[0]))r={cause:t[0]},i=t.slice(1);else if("object"===_typeof(t[0])){for(n in r={},t[0])r[n]=t[0][n];i=t.slice(1)}else s.string(t[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},i=t;return s.object(r),r.strict||e.strict||(i=i.map(function(e){return null===e?"null":void 0===e?"undefined":e})),{options:r,shortmessage:0===i.length?"":a.apply(null,i)}}function f(){var e,t,r,i,n,a,o;if(e=Array.prototype.slice.call(arguments,0),!(this instanceof f))return t=Object.create(f.prototype),f.apply(t,arguments),t;if((r=u({argv:e,strict:!1})).options.name&&(s.string(r.options.name,'error\'s "name" must be a string'),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,a=r.shortmessage,(i=r.options.cause)&&(s.ok(c(i),"cause is not an Error"),this.jse_cause=i,r.options.skipCauseMessage||(a+=": "+i.message)),this.jse_info={},r.options.info)for(o in r.options.info)this.jse_info[o]=r.options.info[o];return this.message=a,Error.call(this,a),Error.captureStackTrace&&(n=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,n)),this}function o(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof o?(i=(r=u({argv:e,strict:!0})).options,f.call(this,i,"%s",r.shortmessage),this):(t=Object.create(o.prototype),o.apply(t,arguments),t)}function p(e){s.array(e,"list of errors"),s.ok(0this._inputTypes.length&&!n.isObject(e[e.length-1]))return a.inputDefaultBlockNumberFormatter(e.pop())},s.prototype.toPayload=function(e){var t={};return e.length>this._inputTypes.length&&n.isObject(e[e.length-1])&&(t=e[e.length-1]),t.to=this._address,t.data="0x"+this.signature()+i.encodeParams(this._inputTypes,e),t},s.prototype.signature=function(){return o(this._name).slice(0,8)},s.prototype.unpackOutput=function(e){if(e){e=2<=e.length?e.slice(2):e;var t=i.decodeParams(this._outputTypes,e);return 1===t.length?t[0]:t}},s.prototype.call=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),i=this.extractCallback(e),t=this.extractDefaultBlock(e),r=this.toPayload(e);if(!i){var n=this._eth.call(r,t);return this.unpackOutput(n)}var a=this;this._eth.call(r,t,function(t,e){if(t)return i(t,null);var r=null;try{r=a.unpackOutput(e)}catch(e){t=e}i(t,r)})},s.prototype.sendTransaction=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),t=this.extractCallback(e),r=this.toPayload(e);if(0=this.buffer.length)){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,t}}},{key:"read",value:function(e){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,Array.from(t)}},{key:"readBool",value:function(){var e=this.read(1)[0];if(255===e)return!0;if(0===e)return!1;throw new n("read_bool() expected 0xff or 0x00; got +"+e)}},{key:"readVaruint",value:function(){for(var e=0,t=0,r=void 0;e|=(127&(r=this.read(1)[0]))< "+e);if(r>=7}}},{key:"writeByte",value:function(e){if(this.length>=this.buffer.length){var t=2*this.length,r=new Uint8Array(t);r.set(this.buffer,0),this.buffer=r}isNaN(e)?this.buffer[this.length]=e.codePointAt():this.buffer[this.length]=e,this.length++}},{key:"writeBytes",value:function(e){var t=this;e.forEach(function(e){t.writeByte(e)})}},{key:"writeVarbytes",value:function(e){this.writeVaruint(e.length),this.writeBytes(e)}},{key:"toString",value:function(){return this.buffer.toHex(0)}}]),e}();m.exports={StreamDeserialization:h,StreamSerialization:l,DeserializationError:n,BadMagicError:a,UnsupportedMajorVersion:o,TruncationError:s,TrailingGarbageError:c,RecursionLimitError:u,SerializerTypeError:f,SerializerValueError:p,ValueError:e,TypeError:t}}).call(this,d("buffer").Buffer)},{"./extend-error.js":568,"./utils.js":575,buffer:191}],567:[function(e,t,r){"use strict";var s=e("./ops.js"),c=e("./timestamp.js"),i=e("./utils.js"),u=e("./context.js"),f=[0,79,112,101,110,84,105,109,101,115,116,97,109,112,115,0,0,80,114,111,111,102,0,191,137,226,232,132,232,146,148],n=function(){function o(e,t){if(_classCallCheck2(this,o),!(e instanceof s.Op&&t instanceof c))throw new u.ValueError("Invalid Timestamp or fileHashOp");if(t.msg.length!==e._DIGEST_LENGTH())throw new u.ValueError("Timestamp message length and fileHashOp digest length differ");this.fileHashOp=e,this.timestamp=t}return _createClass(o,[{key:"fileDigest",value:function(){return this.timestamp.msg}},{key:"serialize",value:function(e){e.writeBytes(f),e.writeVaruint(1),this.fileHashOp.serialize(e),e.writeBytes(this.timestamp.msg),this.timestamp.serialize(e)}},{key:"serializeToBytes",value:function(){var e=new u.StreamSerialization;return this.serialize(e),e.getOutput()}},{key:"toString",value:function(){var e="DetachedTimestampFile\n";return e+="fileHashOp: "+this.fileHashOp.toString()+"\n",e+="timestamp: "+this.timestamp.toString()+"\n"}},{key:"toJson",value:function(){var e={};e.hash=i.bytesToHex(this.fileDigest()),e.op=this.fileHashOp._HASHLIB_NAME(),e.timestamp=this.timestamp.toJson()}},{key:"equals",value:function(e){return e instanceof o&&(!!e.fileHashOp.equals(this.fileHashOp)&&!!e.timestamp.equals(this.timestamp))}}],[{key:"deserialize",value:function(e){var t=void 0;if(e instanceof u.StreamDeserialization)t=e;else if(e instanceof Array)t=new u.StreamDeserialization(e);else if(e instanceof Uint8Array)t=new u.StreamDeserialization(Array.from(e));else{if(!(e instanceof ArrayBuffer))throw new Error("StreamDeserialization deserialize: Invalid param");t=new u.StreamDeserialization(Array.from(e))}t.assertMagic(f);var r=t.readVaruint();if(1!==r)throw new u.UnsupportedMajorVersion("Version "+r+" detached timestamp files are not supported");var i=s.CryptOp.deserialize(t),n=t.readBytes(i._DIGEST_LENGTH()),a=c.deserialize(t,n);return t.assertEof(),new o(i,a)}},{key:"fromBytes",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOp param");var r=void 0;if(t instanceof u.StreamDeserialization)r=e.hashFd(t);else if(t instanceof Array){var i=new u.StreamDeserialization(t);r=e.hashFd(i)}else if(t instanceof Uint8Array){var n=new u.StreamDeserialization(Array.from(t));r=e.hashFd(n)}else{if(!(t instanceof ArrayBuffer))throw new Error("DetachedTimestampFile: Invalid buffer param");var a=new u.StreamDeserialization(Array.from(t));r=e.hashFd(a)}return new o(e,new c(r))}},{key:"fromHash",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOpss param");if(t instanceof Array)return new o(e,new c(t));if(t instanceof ArrayBuffer||t instanceof Uint8Array)return new o(e,new c(Array.from(t)));throw new Error("DetachedTimestampFile: Invalid fdHash param")}}]),o}();t.exports=n},{"./context.js":566,"./ops.js":573,"./timestamp.js":574,"./utils.js":575}],568:[function(e,t,r){var n=e("util"),a=e("assert");Error.extend=function(r,i){a(r,"subTypeName is required");var e=function e(t){if(!(this instanceof e))return new e(t);try{Error.captureStackTrace(this,this.constructor)}catch(e){}this.name=r,this.code=i,this.message=t||"",this.stack=this.stack.replace("Error",this.toString())};return n.inherits(e,this),e.prototype.toString=function(){return this.name+": "+n.inspect(this.message)},e.extend=this.extend,e}},{assert:67,util:505}],569:[function(e,t,r){"use strict";var n=e("request-promise"),a=e("promise"),o=e("./blockstream.js"),s=e("./utils.js"),c=function(){function r(e,t){_classCallCheck2(this,r),this.urlBlockindex=e+"/block-index",this.urlBlock=e+"/block",this.timeout=1e3*t}return _createClass(r,[{key:"blockhash",value:function(e){var i={url:this.urlBlockindex+"/"+e,method:"GET",headers:{Accept:"application/json","User-Agent":"javascript-opentimestamps","Content-Type":"application/x-www-form-urlencoded"},json:!0,timeout:this.timeout};return new a(function(t,r){n(i).then(function(e){if(0===e.size)return console.error("Insight response error body "),void r(new Error("Insight response error body "));t(e.blockHash)}).catch(function(e){console.error("Insight response error: "+e.toString().substr(0,100)),r(e)})})}},{key:"block",value:function(e){var i={url:this.urlBlock+"/"+e,method:"GET",headers:{Accept:"application/json","User-Agent":"javascript-opentimestamps","Content-Type":"application/x-www-form-urlencoded"},json:!0,timeout:this.timeout};return new a(function(t,r){n(i).then(function(e){return e?e.merkleroot&&e.time?void t({merkleroot:e.merkleroot,time:e.time}):r(new Error("Insight response error body ")):(console.error("Insight response error body "),r(new Error("Insight response error body ")))}).catch(function(e){console.error("Insight response error: "+e.toString().substr(0,100)),r(e)})})}}]),r}(),u={bitcoin:["https://insight.bitpay.com/api","https://btc-bitcore1.trezor.io/api","https://btc-bitcore4.trezor.io/api","https://blockexplorer.com/api","https://bitcore.schmoock.net/insight-api"],bitcoinTestnet:["https://test-insight.bitpay.com/api","https://testnet.blockexplorer.com/api"],litecoin:["https://ltc-bitcore1.trezor.io/api","https://insight.litecore.io/api"]},i=function(){function t(e){var r=this;_classCallCheck2(this,t),this.insights=[];var i=e&&Object.prototype.hasOwnProperty.call(e,"timeout")?e.timeout:10,n=e&&Object.prototype.hasOwnProperty.call(e,"chain")?e.chain:"bitcoin";(e&&Object.prototype.hasOwnProperty.call(e,"urls")&&1(new i)._MAX_URI_LENGTH())return console.error("URI exceeds maximum length"),!1;for(var t=0;ta.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=a.privateCalendars.length;else if(a.privateCalendars=[],a.calendars&&0!==a.calendars.length||(a.calendars=c.DEFAULT_AGGREGATORS),a.m&&0!==a.m){if(a.m<0||a.m>a.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=1,2<=a.calendars.length&&(a.m=2);o.createTimestamp(i,a.calendars,a.m,a.privateCalendars).then(function(e){if(void 0===e)return r(new Error("Error on timestamp creation"));t()}).catch(function(e){r(e)})})},createTimestamp:function(i,e,t,r){var n=[];return e&&e.forEach(function(e){var t=new c.RemoteCalendar(e);n.push(t.submit(i.msg)),console.log("Submitting to remote calendar "+e)}),r&&r.forEach(function(e,t){var r=new c.RemoteCalendar(t);r.setKey(e),n.push(r.submit(i.msg)),console.log("Submitting to remote calendar "+t)}),new Promise(function(t,r){Promise.all(n.map(f.softFail)).then(function(e){return e.filter(function(e){return!(e instanceof Error)&&void 0!==e}).forEach(function(e){i.merge(e)}),t(i)}).catch(function(e){r(e)})})},makeMerkleTree:function(e){var i=[];return e.forEach(function(e){if(e instanceof s)try{var t=f.randBytes(16),r=e.timestamp.add(new n.OpAppend(f.arrayToBytes(t))).add(new n.OpSHA256);i.push(r)}catch(e){return}else console.error("Invalid input")}),l.makeMerkleTree(i)},verify:function(e,t,i){if(!f.arrEq(e.fileDigest(),t.fileDigest()))return console.error("Expected digest "+f.bytesToHex(e.fileDigest())),console.error("File does not match original!"),new Promise(function(e,t){t(new Error("File does not match original!"))});var n=this;return new Promise(function(t,r){n.upgradeTimestamp(e.timestamp,i).then(function(){n.verifyTimestamp(e.timestamp,i).then(function(e){return t(e)}).catch(function(e){return r(e)})})})},verifyTimestamp:function(e,r){var i=[],n=this;function c(e,t){return e.attestedTimet.attestedTime?1:0}return e.allAttestations().forEach(function(e,t){i.push(n.verifyAttestation(e,t,r))}),new Promise(function(o,s){Promise.all(i.map(f.softFail)).then(function(e){var t=e.filter(function(e){return e.constructor===p.VerificationError?e:void 0});if(0this._MAX_MSG_LENGTH())){var t=this.call(e);return t.length>this._MAX_RESULT_LENGTH()&&console.error("Error : Result too long;"),t}console.error("Error : Message too long;")}}],[{key:"deserialize",value:function(e){return this.tag=e.readBytes(1)[0],t.deserializeFromTag(e,this.tag)}},{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return n.get(t).deserializeFromTag(e,t);console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),t=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t.arg=void 0===e?[]:e,t}return _inherits(r,c),_createClass(r,[{key:"serialize",value:function(e){_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"serialize",this).call(this,e),e.writeVarbytes(this.arg)}},{key:"toString",value:function(){return this._TAG_NAME()+" "+i.bytesToHex(this.arg)}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t)){var r=e.readVarbytes((new c)._MAX_RESULT_LENGTH(),1);return new(n.get(t))(r)}}}]),r}(),e=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 240}},{key:"_TAG_NAME",value:function(){return"append"}},{key:"call",value:function(e){return e.concat(this.arg)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),r=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 241}},{key:"_TAG_NAME",value:function(){return"prepend"}},{key:"call",value:function(e){return this.arg.concat(e)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),u=function(e){function t(){return _classCallCheck2(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,c),_createClass(t,[{key:"toString",value:function(){return this._TAG_NAME()}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return new(n.get(t));console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),f=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 242}},{key:"_TAG_NAME",value:function(){return"reverse"}},{key:"call",value:function(e){return 0===e.length&&console.error("Can't reverse an empty message"),e.reverse()}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),p=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 243}},{key:"_TAG_NAME",value:function(){return"hexlify"}},{key:"_MAX_MSG_LENGTH",value:function(){return u._MAX_RESULT_LENGTH()}},{key:"call",value:function(e){0===e.length&&console.error("Can't hexlify an empty message")}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),h=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_HASHLIB_NAME",value:function(){return 0}},{key:"call",value:function(e,t){for(var r=("keccak256"===e._HASHLIB_NAME()?s(e._HASHLIB_NAME()).update(a.from(t)):o.createHash(e._HASHLIB_NAME()).update(a.from(t))).digest(),i=[r.length],n=0;n(new m.Op)._MAX_MSG_LENGTH())throw new TypeError("Message exceeds Op length limit; "+e.length+" > "+(new m.Op)._MAX_MSG_LENGTH());this.msg=e,this.attestations=[],this.ops=new Map}return _createClass(h,[{key:"getDigest",value:function(){return this.msg}},{key:"serialize",value:function(r){var i=this;if(!this.attestations&&!this.ops)throw new a.ValueError("An empty timestamp can't be serialized");var e=this.attestations;if(e.sort(function(e,t){return e.compareTo(t)}),1 "+t.toString()+u(o,n,i)+"\n",f+=e.strTree(a+1,o)});else if(0>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},r.charsToHex=function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&i).toString(16))}return t.join("")},r.charToByte=function(e){return e.charCodeAt(0)},r.charsToBytes=function(e){for(var t=[],r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,f=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,p=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,l=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",i.copy(m[e])}function g(e){var t=e.match(o);if(!t)return!1;var r,i=+t[1],n=+t[2],a=+t[3];return 1<=n&&n<=12&&1<=a&&a<=(2!=n||((r=i)%4!=0||r%100==0&&r%400!=0)?s[n]:29)}function v(e,t){var r=e.match(c);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return(i<=23&&n<=59&&a<=59||23==i&&59==n&&60==a)&&(!t||o)}(t.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d},m.full={date:g,time:v,"date-time":function(e){var t=e.split(b);return 2==t.length&&g(t[0])&&v(t[1],!0)},uri:function(e){return y.test(e)&&a.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&n.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d};var b=/t|\s/i;var y=/\/|:/;var _=/[^\\]\\Z/;function w(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":12}],7:[function(e,t,r){"use strict";var I=e("./resolve"),P=e("./util"),O=e("./error_classes"),T=e("fast-json-stable-stringify"),B=e("../dotjs/validate"),C=P.ucs2length,F=e("fast-deep-equal"),R=O.Validation;function z(e,t,r){var i=n.call(this,e,t,r);return 0<=i?{index:i,compiling:!0}:{index:i=this._compilations.length,compiling:!(this._compilations[i]={schema:e,root:t,baseId:r})}}function M(e,t,r){var i=n.call(this,e,t,r);0<=i&&this._compilations.splice(i,1)}function n(e,t,r){for(var i=0;i",b=l?">":"<",y=void 0;if(g){var _=e.util.getData(m.$data,o,e.dataPathArr),w="exclusive"+a,k="exclType"+a,x="exclIsNumber"+a,S="' + "+(A="op"+a)+" + '";n+=" var schemaExcl"+a+" = "+_+"; ",n+=" var "+w+"; var "+k+" = typeof "+(_="schemaExcl"+a)+"; if ("+k+" != 'boolean' && "+k+" != 'undefined' && "+k+" != 'number') { ";var j;y=d;(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var E=n;n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+k+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+_+" "+v+"= "+i+") ? "+p+" "+b+"= "+_+" : "+p+" "+b+" "+i+" ) : ( ("+w+" = "+_+" === true) ? "+p+" "+b+"= "+i+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { var op"+a+" = "+w+" ? '"+v+"' : '"+v+"='; ",void 0===s&&(y=d,u=e.errSchemaPath+"/"+d,i=_,h=g)}else{S=v;if((x="number"==typeof m)&&h){var A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ( "+i+" === undefined || "+m+" "+v+"= "+i+" ? "+p+" "+b+"= "+m+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { "}else{x&&void 0===s?(w=!0,y=d,u=e.errSchemaPath+"/"+d,i=m,b+="="):(x&&(i=Math[l?"min":"max"](m,s)),m===(!x||i)?(w=!0,y=d,u=e.errSchemaPath+"/"+d,b+="="):(w=!1,S+="="));A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+" "+b+" "+i+" || "+p+" !== "+p+") { "}}y=y||t,(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+A+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+S+" ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";E=n;return n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s;var l="maxLength"==t?">":"<";n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+p+".length ":n+=" ucs2length("+p+") ",n+=" "+l+" "+i+") { ";var d=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+p+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.schema[t],a=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var f="valid"+c.level,p=c.baseId,h=!0,l=n;if(l)for(var d,m=-1,g=l.length-1;m "+E+") { ";var I=f+"["+E+"]";l.schema=j,l.schemaPath=s+"["+E+"]",l.errSchemaPath=c+"/"+E,l.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),l.dataPathArr[v]=E;var P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",i+=" } ",u&&(i+=" if ("+m+") { ",d+="}")}if("object"==(void 0===_?"undefined":_typeof(_))&&e.util.schemaHasRules(_,e.RULES.all)){l.schema=_,l.schemaPath=e.schemaPath+".additionalItems",l.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+f+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" } } ",u&&(i+=" if ("+m+") { ",d+="}")}}else if(e.util.schemaHasRules(o,e.RULES.all)){l.schema=o,l.schemaPath=s,l.errSchemaPath=c,i+=" for (var "+g+" = 0; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+d+" if ("+h+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],30:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="var division"+a+";if (",h&&(n+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),n+=" (division"+a+" = "+p+" / "+i+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var l=l||[];l.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var d=n;return n=l.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+d+"]); ":n+=" validate.errors = ["+d+"]; return false; ":n+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="errs__"+n,h=e.util.copy(e);h.level++;var l="valid"+h.level;if(e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+p+" = errors; ";var d,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(d=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,d&&(h.opts.allErrors=d),e.compositeRule=h.compositeRule=m,i+=" if ("+l+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var v=i;i=g.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ");return i}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="valid"+n,h="errs__"+n,l=e.util.copy(e),d="";l.level++;var m="valid"+l.level,g=l.baseId,v="prevValid"+n,b="passingSchemas"+n;i+="var "+h+" = errors , "+v+" = false , "+p+" = false , "+b+" = null; ";var y=e.compositeRule;e.compositeRule=l.compositeRule=!0;var _=o;if(_)for(var w,k=-1,x=_.length-1;k=e.opts.loopRequired,k=e.opts.ownProperties;if(u)if(i+=" var missing"+n+"; ",w){h||(i+=" var "+l+" = validate.schema"+s+"; ");var x="' + "+(P="schema"+n+"["+(E="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(_,P,e.opts.jsonPointers)),i+=" var "+p+" = true; ",h&&(i+=" if (schema"+n+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+n+")) "+p+" = false; else {"),i+=" for (var "+E+" = 0; "+E+" < "+l+".length; "+E+"++) { "+p+" = "+f+"["+l+"["+E+"]] !== undefined ",k&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", "+l+"["+E+"]) "),i+="; if (!"+p+") break; } ",h&&(i+=" } "),i+=" if (!"+p+") { ",(I=I||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+x+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var S=i;i=I.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var j=d;if(j)for(var E=-1,A=j.length-1;E 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(0<=d.indexOf("object")||0<=d.indexOf("array")))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var g="checkDataType"+(m?"s":"");n+=" if ("+e.util[g](d,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",l&&(n+=" } "),n+=" if (!"+h+") { ";var v=v||[];v.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var b=n;n=v.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { ")}else f&&(n+=" if (true) { ");return n}},{}],39:[function(e,t,r){"use strict";t.exports=function(i,e,t){var r="",n=!0===i.schema.$async,a=i.util.schemaHasRulesExcept(i.schema,i.RULES.all,"$ref"),o=i.self._getId(i.schema);if(i.isTop&&(r+=" var validate = ",n&&(i.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(i.opts.sourceCode||i.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof i.schema||!a&&!i.schema.$ref){e="false schema";var s=i.level,c=i.dataLevel,u=i.schema[e],f=i.schemaPath+i.util.getProperty(e),p=i.errSchemaPath+"/"+e,h=!i.opts.allErrors,l="data"+(c||""),d="valid"+s;if(!1===i.schema){i.isTop?h=!0:r+=" var "+d+" = false; ",(W=W||[]).push(r),r="",!1!==i.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(p)+" , params: {} ",!1!==i.opts.messages&&(r+=" , message: 'boolean schema is false' "),i.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+i.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var m=r;r=W.pop(),!i.compositeRule&&h?i.async?r+=" throw new ValidationError(["+m+"]); ":r+=" validate.errors = ["+m+"]; return false; ":r+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else i.isTop?r+=n?" return data; ":" validate.errors = null; return true; ":r+=" var "+d+" = true; ";return i.isTop&&(r+=" }; return validate; "),r}if(i.isTop){var g=i.isTop;s=i.level=0,c=i.dataLevel=0,l="data";i.rootId=i.resolve.fullPath(i.self._getId(i.root.schema)),i.baseId=i.baseId||i.rootId,delete i.isTop,i.dataPathArr=[void 0],r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{s=i.level,l="data"+((c=i.dataLevel)||"");if(o&&(i.baseId=i.resolve.url(i.baseId,o)),n&&!i.async)throw new Error("async schema in sync schema");r+=" var errs_"+s+" = errors;"}d="valid"+s,h=!i.opts.allErrors;var v="",b="",y=i.schema.type,_=Array.isArray(y);if(_&&1==y.length&&(y=y[0],_=!1),i.schema.$ref&&a){if("fail"==i.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+i.errSchemaPath+'" (see option extendRefs)');!0!==i.opts.extendRefs&&(a=!1,i.logger.warn('$ref: keywords ignored in schema at path "'+i.errSchemaPath+'"'))}if(i.schema.$comment&&i.opts.$comment&&(r+=" "+i.RULES.all.$comment.code(i,"$comment")),y){if(i.opts.coerceTypes)var w=i.util.coerceToTypes(i.opts.coerceTypes,y);var k=i.RULES.types[y];if(w||_||!0===k||k&&!Z(k)){f=i.schemaPath+".type",p=i.errSchemaPath+"/type",f=i.schemaPath+".type",p=i.errSchemaPath+"/type";var x=_?"checkDataTypes":"checkDataType";if(r+=" if ("+i.util[x](y,l,!0)+") { ",w){var S="dataType"+s,j="coerced"+s;r+=" var "+S+" = typeof "+l+"; ","array"==i.opts.coerceTypes&&(r+=" if ("+S+" == 'object' && Array.isArray("+l+")) "+S+" = 'array'; "),r+=" var "+j+" = undefined; ";var E="",A=w;if(A)for(var I,P=-1,O=A.length-1;P>6],n=0==(32&r);if(31==(31&r)){var a=r;for(r=0;128==(128&a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function p(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)o++;(n=new u(2+o))[0]=a,n[1]=128|o;s=1+o;for(var c=i.length;0>=8)n[s]=255&c;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new u(2*e.length),i=0;i>=7)n++}var o=new u(n),s=o.length-1;for(i=e.length-1;0<=i;i--){a=e[i];for(o[s--]=127&a;0<(a>>=7);)o[s--]=128|127&a}return this._createEncoderBuffer(o)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[c(i.getFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(i.getFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.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&&!u.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new u(r)}if(u.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new u(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var a=e;256<=a;a>>=8)i++;for(a=(n=new Array(i)).length-1;0<=a;a--)n[a]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new u(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var a=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),a.length!==n.defaultBuffer.length)return!1;for(i=0;i=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0===(t&=127))throw c("Indefinite length not supported");if(4this._size-i)return null;if(this._offset=i,0===this.length)return t?a.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?n:n.toString("utf8")},i.prototype.readOID=function(e){e||(e=s.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],i=0,n=0;n>0),r.join(".")},i.prototype._readTag=function(e){o.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw c("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(4this._size-r)return null;this._offset=r;for(var i=this._buf[this._offset],n=0,a=0;a>0},t.exports=i},{"./errors":60,"./types":63,assert:67,"safer-buffer":448}],63:[function(e,t,r){t.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},{}],64:[function(e,t,r){var n=e("assert"),a=e("safer-buffer").Buffer,o=e("./types"),i=e("./errors").newInvalidAsn1Error,s={size:1024,growthFactor:8};function c(e){var r,i;r=s,i=e||{},n.ok(r),n.equal(void 0===r?"undefined":_typeof(r),"object"),n.ok(i),n.equal(void 0===i?"undefined":_typeof(i),"object"),Object.getOwnPropertyNames(r).forEach(function(e){if(!i[e]){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,t)}}),e=i,this._buf=a.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw i(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},c.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=o.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&1 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;0>>24,e<<=8},c.prototype.writeNull=function(){this.writeByte(o.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=o.Enumeration),this.writeInt(e,t)},c.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=o.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},c.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+(void 0===e?"undefined":_typeof(e))+")");"number"!=typeof t&&(t=o.OctetString);var r=a.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},c.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!a.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},c.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(e){t.writeString(e)})},c.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=o.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),i=[];i.push(40*parseInt(r[0],10)+parseInt(r[1],10)),r.slice(2).forEach(function(e){var t,r;t=i,(r=parseInt(e,10))<128?t.push(r):(r<16384?t.push(r>>>7|128):(r<2097152?t.push(r>>>14|128):(r<268435456?t.push(r>>>21|128):(t.push(255&(r>>>28|128)),t.push(255&(r>>>21|128))),t.push(255&(r>>>14|128))),t.push(255&(r>>>7|128))),t.push(127&r))});var n=this;this._ensure(2+i.length),this.writeByte(t),this.writeLength(i.length),i.forEach(function(e){n.writeByte(e)})},c.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw i("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},c.prototype.startSequence=function(e){"number"!=typeof e&&(e=o.Sequence|o.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw i("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},c.prototype._shift=function(e,t,r){n.ok(void 0!==e),n.ok(void 0!==t),n.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},c.prototype._ensure=function(e){if(n.ok(e),this._size-this._offset>16&255,a[o++]=t>>8&255,a[o++]=255&t;var u,f;2===n&&(t=p[e.charCodeAt(c)]<<2|p[e.charCodeAt(c+1)]>>4,a[o++]=255&t);1===n&&(t=p[e.charCodeAt(c)]<<10|p[e.charCodeAt(c+1)]<<4|p[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],a=0,o=r-i;a>2]+s[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],p=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,a=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return a.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},{}],76:[function(e,t,r){"use strict";var y=e("tweetnacl").lowlevel.crypto_hash,s=0,c=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};function n(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}function u(e,t){var r,i=0;for(r=0;r<4;r++,s++)t<=s&&(s=0),i=i<<8|e[s];return i}c.prototype.encipher=function(e,t){void 0===t&&(t=new Uint8Array(e.buffer),0!==e.byteOffset&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=n(this.S,t,0)^this.P[r],e[0]^=n(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i},c.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);0!==e.byteOffset&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;0>>24,r[4*i+2]=a[i]>>>16,r[4*i+1]=a[i]>>>8,r[4*i+0]=a[i]}t.exports={BLOCKS:f,HASHSIZE:32,hash:_,pbkdf:function(e,t,r,i,n,a,o){var s,c,u,f,p,h,l=new Uint8Array(64),d=new Uint8Array(64),m=new Uint8Array(32),g=new Uint8Array(32),v=new Uint8Array(i+4),b=a;if(o<1)return-1;if(0===t||0===i||0===a||a>m.byteLength*m.byteLength||1<<20>>24,v[i+1]=h>>>16,v[i+2]=h>>>8,v[i+3]=h,y(d,v,i+4),_(l,d,g),s=m.byteLength;s--;)m[s]=g[s];for(s=1;sa[o]^r?1:-1;return c==u?0:u=t&&e<=r}function J(e){return"[object Array]"==Object.prototype.toString.call(e)}function Q(e,t,r){for(var i,n,a=[0],o=0,s=e.length;or-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}function ee(e,t){return(1(r=e.length)){for(i="0",t-=r;--t;i+="0");e+=i}else tt;)u[n]=0,n||(++a,u.unshift(1));for(o=u.length;!u[--o];);for(p=0,e="";p<=o;e+=U.charAt(u[p++]));e=te(e,a)}return e}function P(e,t,r,i){var n,a,o,s,c;if(r=null!=r&&k(r,0,8,i,q)?0|r:b,!e.c)return e.toString();if(n=e.c[0],o=e.e,null==t)c=Z(e.c),c=19==i||24==i&&o<=h?ee(c,o):te(c,o);else if(a=(e=C(new I(e),t,r)).e,s=(c=Z(e.c)).length,19==i||24==i&&(t<=a||a<=h)){for(;sy?e.c=e.e=null:e.c=r=p.length){if(!i)break e;for(;p.length<=u;p.push(0));c=f=0,o=(a%=K)-K+(n=1)}else{for(c=s=p[u],n=1;10<=s;s/=10,n++);f=(o=(a%=K)-K+n)<0?0:c/h[n-o-1]%10|0}if(i=i||t<0||null!=p[u+1]||(o<0?c:c%h[n-o-1]),i=r<4?(f||i)&&(0==r||r==(e.s<0?3:2)):5y?e.c=e.e=null:e.er)return null!=(e=n[r++])};return o(t="DECIMAL_PLACES")&&k(e,0,$,2,t)&&(d=0|e),i[t]=d,o(t="ROUNDING_MODE")&&k(e,0,8,2,t)&&(b=0|e),i[t]=b,o(t="EXPONENTIAL_AT")&&(J(e)?k(e[0],-$,0,2,t)&&k(e[1],0,$,2,t)&&(h=0|e[0],l=0|e[1]):k(e,-$,$,2,t)&&(h=-(l=0|(e<0?-e:e)))),i[t]=[h,l],o(t="RANGE")&&(J(e)?k(e[0],-$,-1,2,t)&&k(e[1],1,$,2,t)&&(m=0|e[0],y=0|e[1]):k(e,-$,$,2,t)&&(0|e?m=-(y=0|(e<0?-e:e)):w&&B(2,t+" cannot be zero",e))),i[t]=[m,y],o(t="ERRORS")&&(e===!!e||1===e||0===e?(_=0,k=(w=!!e)?O:X):w&&B(2,t+D,e)),i[t]=w,o(t="CRYPTO")&&(e===!!e||1===e||0===e?(x=!(!e||!F||"object"!=(void 0===F?"undefined":_typeof(F))),e&&!x&&w&&B(2,"crypto unavailable",F)):w&&B(2,t+D,e)),i[t]=x,o(t="MODULO_MODE")&&k(e,0,9,2,t)&&(S=0|e),i[t]=S,o(t="POW_PRECISION")&&k(e,0,$,2,t)&&(j=0|e),i[t]=j,o(t="FORMAT")&&("object"==(void 0===e?"undefined":_typeof(e))?E=e:w&&B(2,t+" not an object",e)),i[t]=E,i},I.max=function(){return n(arguments,i.lt)},I.min=function(){return n(arguments,i.gt)},I.random=(r=9007199254740992,u=Math.random()*r&2097151?function(){return N(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,n,a,o=0,s=[],c=new I(v);if(e=null!=e&&k(e,0,$,14)?0|e:d,n=M(e/K),x)if(F&&F.getRandomValues){for(t=F.getRandomValues(new Uint32Array(n*=2));o>>11))?(r=F.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(s.push(a%1e14),o+=2);o=n/2}else if(F&&F.randomBytes){for(t=F.randomBytes(n*=7);ot[n]?1:-1;break}return a}function A(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r](x[s]||0)&&o--,k<0)l.push(1),c=!0;else{for(b=x.length,_=S.length,k+=2,1<(u=N(n/(S[s=0]+1)))&&(S=j(S,u,n),x=j(x,u,n),_=S.length,b=x.length),v=_,m=(d=x.slice(0,_)).length;m<_;d[m++]=0);(w=S.slice()).unshift(0),y=S[0],S[1]>=n/2&&y++;do{if(u=0,(a=E(S,d,_,m))<0){if(g=d[0],_!=m&&(g=g*n+(d[1]||0)),1<(u=N(g/y)))for(n<=u&&(u=n-1),p=(f=j(S,u,n)).length,m=d.length;1==E(f,d,p,m);)u--,A(f,_this.c.length-2},i.isNaN=function(){return!this.s},i.isNegative=i.isNeg=function(){return this.s<0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.lessThan=i.lt=function(e,t){return _=8,Y(this,new I(e,t))<0},i.lessThanOrEqualTo=i.lte=function(e,t){return _=9,-1===(t=Y(this,new I(e,t)))||0===t},i.minus=i.sub=function(e,t){var r,i,n,a,o=this,s=o.s;if(_=10,t=(e=new I(e,t)).s,!s||!t)return new I(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/K,u=e.e/K,f=o.c,p=e.c;if(!c||!u){if(!f||!p)return f?(e.s=-t,e):new I(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new I(f[0]?o:3==b?-0:0)}if(c=W(c),u=W(u),f=f.slice(),s=c-u){for((n=(a=s<0)?(s=-s,f):(u=c,p)).reverse(),t=s;t--;n.push(0));n.reverse()}else for(i=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;tt&&(t=this.e+1),t},i.round=function(e,t){var r=new I(this);return(null==e||k(e,0,$,15))&&C(r,~~e+this.e+1,null!=t&&k(t,0,8,15,q)?0|t:b),r},i.shift=function(e){var t=this;return k(e,-a,a,16,"argument")?t.times("1e"+re(e)):new I(t.c&&t.c[0]&&(e<-a||at&&(r.c.length=t)}if(!(i=N(i/2)))break;n=n.times(n),t&&n.c&&n.c.length>t&&(n.c.length=t)}return e<0&&(r=v.div(r)),t?C(r,j,b):r},i.toPrecision=function(e,t){return P(this,null!=e&&k(e,1,$,24,"precision")?0|e:null,t,24)},i.toString=function(e){var t,r=this.s,i=this.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=Z(this.c),t=null!=e&&k(e,2,64,25,"base")?A(te(t,i),0|e,10,r):i<=h||l<=i?ee(t,i):te(t,i),r<0&&this.c[0]&&(t="-"+t)),t},i.truncated=i.trunc=function(){return C(new I(this),this.e+1,1)},i.valueOf=i.toJSON=function(){return this.toString()},null!=t&&I.config(t),I}(),"function"==typeof define&&define.amd)define(function(){return t});else if(void 0!==i&&i.exports){if(i.exports=t,!F)try{F=r("crypto")}catch(e){}}else e.BigNumber=t}(this)},{crypto:204}],78:[function(i,n,e){(function(e,t){"use strict";var r=n.exports;r.version="v"+i("./package.json").version,r.versionGuard=function(e){if(void 0!==e){throw new Error("More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.")}},r.versionGuard(e._bitcore),e._bitcore=r.version,r.crypto={},r.crypto.BN=i("./lib/crypto/bn"),r.crypto.ECDSA=i("./lib/crypto/ecdsa"),r.crypto.Hash=i("./lib/crypto/hash"),r.crypto.Random=i("./lib/crypto/random"),r.crypto.Point=i("./lib/crypto/point"),r.crypto.Signature=i("./lib/crypto/signature"),r.encoding={},r.encoding.Base58=i("./lib/encoding/base58"),r.encoding.Base58Check=i("./lib/encoding/base58check"),r.encoding.BufferReader=i("./lib/encoding/bufferreader"),r.encoding.BufferWriter=i("./lib/encoding/bufferwriter"),r.encoding.Varint=i("./lib/encoding/varint"),r.util={},r.util.buffer=i("./lib/util/buffer"),r.util.js=i("./lib/util/js"),r.util.preconditions=i("./lib/util/preconditions"),r.errors=i("./lib/errors"),r.Address=i("./lib/address"),r.Block=i("./lib/block"),r.MerkleBlock=i("./lib/block/merkleblock"),r.BlockHeader=i("./lib/block/blockheader"),r.HDPrivateKey=i("./lib/hdprivatekey.js"),r.HDPublicKey=i("./lib/hdpublickey.js"),r.Networks=i("./lib/networks"),r.Opcode=i("./lib/opcode"),r.PrivateKey=i("./lib/privatekey"),r.PublicKey=i("./lib/publickey"),r.Script=i("./lib/script"),r.Transaction=i("./lib/transaction"),r.URI=i("./lib/uri"),r.Unit=i("./lib/unit"),r.deps={},r.deps.bnjs=i("bn.js"),r.deps.bs58=i("bs58"),r.deps.Buffer=t,r.deps.elliptic=i("elliptic"),r.deps._=i("lodash"),r._HDKeyCache=i("./lib/hdkeycache"),r.Transaction.sighash=i("./lib/transaction/sighash")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i("buffer").Buffer)},{"./lib/address":79,"./lib/block":82,"./lib/block/blockheader":81,"./lib/block/merkleblock":83,"./lib/crypto/bn":84,"./lib/crypto/ecdsa":85,"./lib/crypto/hash":86,"./lib/crypto/point":87,"./lib/crypto/random":88,"./lib/crypto/signature":89,"./lib/encoding/base58":90,"./lib/encoding/base58check":91,"./lib/encoding/bufferreader":92,"./lib/encoding/bufferwriter":93,"./lib/encoding/varint":94,"./lib/errors":95,"./lib/hdkeycache":97,"./lib/hdprivatekey.js":98,"./lib/hdpublickey.js":99,"./lib/networks":100,"./lib/opcode":101,"./lib/privatekey":102,"./lib/publickey":103,"./lib/script":104,"./lib/transaction":107,"./lib/transaction/sighash":115,"./lib/unit":119,"./lib/uri":120,"./lib/util/buffer":121,"./lib/util/js":122,"./lib/util/preconditions":123,"./package.json":150,"bn.js":124,bs58:125,buffer:191,elliptic:127,lodash:149}],79:[function(e,t,r){(function(a){"use strict";var n=e("lodash"),o=e("./util/preconditions"),i=e("./errors"),s=e("./encoding/base58check"),c=e("./networks"),r=e("./crypto/hash"),u=e("./util/js"),f=e("./publickey");function p(e,t,r){if(!(this instanceof p))return new p(e,t,r);if(n.isArray(e)&&n.isNumber(t))return p.createMultisig(e,t,r);if(e instanceof p)return e;if(o.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!c.get(t))throw new TypeError('Second argument must be "livenet" or "testnet".');if(r&&r!==p.PayToPublicKeyHash&&r!==p.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||c.get(t)||c.defaultNetwork,i.type=i.type||r||p.PayToPublicKeyHash,u.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}p.prototype._classifyArguments=function(e,t,r){if((e instanceof a||e instanceof Uint8Array)&&20===e.length)return p._transformHash(e);if((e instanceof a||e instanceof Uint8Array)&&21===e.length)return p._transformBuffer(e,t,r);if(e instanceof f)return p._transformPublicKey(e);if(e instanceof h)return p._transformScript(e,t);if("string"==typeof e)return p._transformString(e,t,r);if(n.isObject(e))return p._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")},p.PayToPublicKeyHash="pubkeyhash",p.PayToScriptHash="scripthash",p._transformHash=function(e){var t={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==e.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t},p._transformObject=function(e){return o.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),o.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?new a(e.hash,"hex"):e.hashBuffer,network:c.get(e.network)||c.defaultNetwork,type:e.type}},p._classifyFromVersion=function(e){var t={},r=c.get(e[0],"pubkeyhash"),i=c.get(e[0],"scripthash");return r?(t.network=r,t.type=p.PayToPublicKeyHash):i&&(t.network=i,t.type=p.PayToScriptHash),t},p._transformBuffer=function(e,t,r){var i={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==e.length)throw new TypeError("Address buffers must be exactly 21 bytes.");t=c.get(t);var n=p._classifyFromVersion(e);if(!n.network||t&&t!==n.network)throw new TypeError("Address has mismatched network type.");if(!n.type||r&&r!==n.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=n.network,i.type=n.type,i},p._transformPublicKey=function(e){var t={};if(!(e instanceof f))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=r.sha256ripemd160(e.toBuffer()),t.type=p.PayToPublicKeyHash,t},p._transformScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new i.Script.CantDeriveAddress(e);return r},p.createMultisig=function(e,t,r){return r=r||e[0].network||c.defaultNetwork,p.payingTo(h.buildMultisigOut(e,t),r)},p._transformString=function(e,t,r){if("string"!=typeof e)throw new TypeError("data parameter supplied is not a string.");e=e.trim();var i=s.decode(e);return p._transformBuffer(i,t,r)},p.fromPublicKey=function(e,t){var r=p._transformPublicKey(e);return t=t||c.defaultNetwork,new p(r.hashBuffer,t,r.type)},p.fromPublicKeyHash=function(e,t){return new p(p._transformHash(e).hashBuffer,t,p.PayToPublicKeyHash)},p.fromScriptHash=function(e,t){return o.checkArgument(e,"hash parameter is required"),new p(p._transformHash(e).hashBuffer,t,p.PayToScriptHash)},p.payingTo=function(e,t){return o.checkArgument(e,"script is required"),o.checkArgument(e instanceof h,"script must be instance of Script"),p.fromScriptHash(r.sha256ripemd160(e.toBuffer()),t)},p.fromScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=p._transformScript(e,t);return new p(r.hashBuffer,t,r.type)},p.fromBuffer=function(e,t,r){var i=p._transformBuffer(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromString=function(e,t,r){var i=p._transformString(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromObject=function(e){return o.checkState(u.isHexa(e.hash),'Unexpected hash property, "'+e.hash+'", expected to be hex.'),new p(new a(e.hash,"hex"),e.network,e.type)},p.getValidationError=function(e,t,r){var i;try{new p(e,t,r)}catch(e){i=e}return i},p.isValid=function(e,t,r){return!p.getValidationError(e,t,r)},p.prototype.isPayToPublicKeyHash=function(){return this.type===p.PayToPublicKeyHash},p.prototype.isPayToScriptHash=function(){return this.type===p.PayToScriptHash},p.prototype.toBuffer=function(){var e=new a([this.network[this.type]]);return a.concat([e,this.hashBuffer])},p.prototype.toObject=p.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},p.prototype.toString=function(){return s.encode(this.toBuffer())},p.prototype.inspect=function(){return""},t.exports=p;var h=e("./script")}).call(this,e("buffer").Buffer)},{"./crypto/hash":86,"./encoding/base58check":91,"./errors":95,"./networks":100,"./publickey":103,"./script":104,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],80:[function(t,l,e){(function(o){"use strict";var r=t("lodash"),n=t("./blockheader"),i=t("../crypto/bn"),a=t("../util/buffer"),s=t("../encoding/bufferreader"),c=t("../encoding/bufferwriter"),u=t("../crypto/hash"),f=t("../transaction"),p=t("../util/preconditions");function h(e){return this instanceof h?(r.extend(this,h._from(e)),this):new h(e)}h.MAX_BLOCK_SIZE=1e6,h._from=function(e){var t={};if(a.isBuffer(e))t=h._fromBufferReader(s(e));else{if(!r.isObject(e))throw new TypeError("Unrecognized argument for Block");t=h._fromObject(e)}return t},h._fromObject=function(e){var t=[];return e.transactions.forEach(function(e){e instanceof f?t.push(e):t.push(f().fromObject(e))}),{header:n.fromObject(e.header),transactions:t}},h.fromObject=function(e){return new h(h._fromObject(e))},h._fromBufferReader=function(e){var t={};p.checkState(!e.finished(),"No block data received"),t.header=n.fromBufferReader(e);var r=e.readVarintNum();t.transactions=[];for(var i=0;i"},h.Values={START_OF_BLOCK:8,NULL_HASH:new o("0000000000000000000000000000000000000000000000000000000000000000","hex")},l.exports=h}).call(this,t("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../transaction":107,"../util/buffer":121,"../util/preconditions":123,"./blockheader":81,buffer:191,lodash:149}],81:[function(f,p,e){(function(i){"use strict";var n=f("lodash"),a=f("../crypto/bn"),o=f("../util/buffer"),s=f("../encoding/bufferreader"),t=f("../encoding/bufferwriter"),r=f("../crypto/hash"),c=(f("../util/js"),f("../util/preconditions")),u=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&c.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};u._from=function(e){var t={};if(o.isBuffer(e))t=u._fromBufferReader(s(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for BlockHeader");t=u._fromObject(e)}return t},u._fromObject=function(e){c.checkArgument(e,"data is required");var t=e.prevHash,r=e.merkleRoot;return n.isString(e.prevHash)&&(t=o.reverse(new i(e.prevHash,"hex"))),n.isString(e.merkleRoot)&&(r=o.reverse(new i(e.merkleRoot,"hex"))),{hash:e.hash,version:e.version,prevHash:t,merkleRoot:r,time:e.time,timestamp:e.time,bits:e.bits,nonce:e.nonce}},u.fromObject=function(e){var t=u._fromObject(e);return new u(t)},u.fromRawBlock=function(e){o.isBuffer(e)||(e=new i(e,"binary"));var t=s(e);t.pos=u.Constants.START_OF_HEADER;var r=u._fromBufferReader(t);return new u(r)},u.fromBuffer=function(e){var t=u._fromBufferReader(s(e));return new u(t)},u.fromString=function(e){var t=new i(e,"hex");return u.fromBuffer(t)},u._fromBufferReader=function(e){var t={};return t.version=e.readUInt32LE(),t.prevHash=e.read(32),t.merkleRoot=e.read(32),t.time=e.readUInt32LE(),t.bits=e.readUInt32LE(),t.nonce=e.readUInt32LE(),t},u.fromBufferReader=function(e){var t=u._fromBufferReader(e);return new u(t)},u.prototype.toObject=u.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:o.reverse(this.prevHash).toString("hex"),merkleRoot:o.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},u.prototype.toBuffer=function(){return this.toBufferWriter().concat()},u.prototype.toString=function(){return this.toBuffer().toString("hex")},u.prototype.toBufferWriter=function(e){return e||(e=new t),e.writeUInt32LE(this.version),e.write(this.prevHash),e.write(this.merkleRoot),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e},u.prototype.getTargetDifficulty=function(e){e=e||this.bits;for(var t=new a(16777215&e),r=8*((e>>>24)-3);0e+u.Constants.MAX_TIME_OFFSET)},u.prototype.validProofOfWork=function(){var e=new a(this.id,"hex"),t=this.getTargetDifficulty();return!(0"},u.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new a("10000000000000000000000000000000000000000000000000000000000000000","hex")},p.exports=u}).call(this,f("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],82:[function(e,t,r){t.exports=e("./block"),t.exports.BlockHeader=e("./blockheader"),t.exports.MerkleBlock=e("./merkleblock")},{"./block":80,"./blockheader":81,"./merkleblock":83}],83:[function(e,t,r){(function(s){"use strict";var n=e("lodash"),a=e("./blockheader"),o=e("../util/buffer"),r=e("../encoding/bufferreader"),i=e("../encoding/bufferwriter"),c=e("../crypto/hash"),u=(e("../util/js"),e("../transaction")),f=e("../util/preconditions");function p(e){if(!(this instanceof p))return new p(e);var t={};if(o.isBuffer(e))t=p._fromBufferReader(r(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for MerkleBlock");t={header:e.header instanceof a?e.header:a.fromObject(e.header),numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}return n.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}p.fromBuffer=function(e){return p.fromBufferReader(r(e))},p.fromBufferReader=function(e){return new p(p._fromBufferReader(e))},p.prototype.toBuffer=function(){return this.toBufferWriter().concat()},p.prototype.toBufferWriter=function(e){e||(e=new i),e.write(this.header.toBuffer()),e.writeUInt32LE(this.numTransactions),e.writeVarintNum(this.hashes.length);for(var t=0;tthis.numTransactions)return!1;if(8*this.flags.length8*this.flags.length)return null;var i=this.flags[r.flagBitsUsed>>3]>>>(7&r.flagBitsUsed++)&1;if(0!==e&&i){var n=this._traverseMerkleTree(e-1,2*t,r),a=n;return 2*t+1=this.hashes.length)return null;var o=this.hashes[r.hashesUsed++];return 0===e&&i&&r.txs.push(o),new s(o,"hex")},p.prototype._calcTreeWidth=function(e){return this.numTransactions+(1<>e},p.prototype._calcTreeHeight=function(){for(var e=0;1e.size?t=n.trim(t,i):i>1,o=d.getN(),s=d.getG(),c=a?r.add(o):r,u=d.fromX(n,c);if(!u.mul(o).isInfinity())throw new Error("nR is not a valid curve point");var f=t.neg().mod(o),p=r.invm(o),h=u.mul(i).add(s.mul(f)).mul(p);return m.fromPoint(h,this.sig.compressed)},h.prototype.sigError=function(){if(!f.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s;if(!(e.gt(l.Zero)&&e.lt(d.getN())&&t.gt(l.Zero)&&t.lt(d.getN())))return"r and s not in range";var r=l.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),i=d.getN(),n=t.invm(i),a=n.mul(r).mod(i),o=n.mul(e).mod(i),s=d.getG().mulAdd(a,this.pubkey.point,o);return s.isInfinity()?"p is infinity":0!==s.getX().mod(i).cmp(e)&&"Invalid signature"},h.toLowS=function(e){return e.gt(l.fromBuffer(new c("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=d.getN().sub(e)),e},h.prototype._findSignature=function(e,t){for(var r,i,n,a=d.getN(),o=d.getG(),s=0;(!this.k||0i)r=e(r);else if(r>>=8)}return r},e.exports=r}).call(this,i("_process"),i("buffer").Buffer)},{_process:382,buffer:191,crypto:204}],89:[function(e,r,t){(function(u){"use strict";var g=e("./bn"),v=e("lodash"),b=e("../util/preconditions"),y=e("../util/buffer"),t=e("../util/js"),o=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof g)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};o.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=void 0!==e.i?e.i:this.i,this.compressed=void 0!==e.compressed?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this},o.fromCompact=function(e){b.checkArgument(y.isBuffer(e),"Argument is expected to be a Buffer");var t=new o,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i+=4);var n=e.slice(1,33),a=e.slice(33,65);return b.checkArgument(0===i||1===i||2===i||3===i,new Error("i must be 0, 1, 2, or 3")),b.checkArgument(32===n.length,new Error("r must be 32 bytes")),b.checkArgument(32===a.length,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=g.fromBuffer(n),t.s=g.fromBuffer(a),t},o.fromDER=o.fromBuffer=function(e,t){var r=o.parseDER(e,t),i=new o;return i.r=r.r,i.s=r.s,i},o.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=new o.fromDER(r,!1);return i.nhashtype=t,i},o.fromString=function(e){var t=new u(e,"hex");return o.fromDER(t)},o.parseDER=function(e,t){b.checkArgument(y.isBuffer(e),new Error("DER formatted signature should be a buffer")),v.isUndefined(t)&&(t=!0);var r=e[0];b.checkArgument(48===r,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;b.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(2!==e[2])return!1;if(0===t)return!1;if(128&i[0])return!1;if(1=this.buf.length},e.prototype.read=function(e){r.checkArgument(!n.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t},e.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e},e.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e},e.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=o.fromBuffer(e);return this.pos=this.pos+8,t},e.prototype.readUInt64LEBN=function(){var e,t=this.buf.readUInt32LE(this.pos),r=4294967296*this.buf.readUInt32LE(this.pos+4)+t;if(r<=9007199254740991)e=new o(r);else{var i=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);e=new o(i,10,"le")}return this.pos=this.pos+8,e},e.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN().toNumber();if(t<=Math.pow(2,53))return t;throw new Error("number too large to retain precision - use readVarintBN");default:return e}},e.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return r.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t},e.prototype.readVarintBuf=function(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},e.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new o(this.readUInt16LE());case 254:return new o(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new o(e)}},e.prototype.reverse=function(){for(var e=new i(this.buf.length),t=0;t"},k.prototype.toObject=k.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:_.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},k.fromBuffer=function(e){return new k(e.toString())},k.prototype.toBuffer=function(){return _.copy(this._buffers.xprivkey)},k.DefaultDepth=0,k.DefaultFingerprint=0,k.DefaultChildIndex=0,k.MaxIndex=2*(k.Hardened=2147483648),k.RootElementAlias=["m","M","m'","M'"],k.VersionSize=4,k.DepthSize=1,k.ParentFingerPrintSize=4,k.ChildIndexSize=4,k.ChainCodeSize=32,k.PrivateKeySize=32,k.CheckSumSize=4,k.DataLength=78,k.SerializedByteSize=82,n((k.ChecksumEnd=(k.ChecksumStart=k.PrivateKeyEnd=(k.PrivateKeyStart=(k.ChainCodeEnd=(k.ChainCodeStart=k.ChildIndexEnd=(k.ChildIndexStart=k.ParentFingerPrintEnd=(k.ParentFingerPrintStart=k.DepthEnd=(k.DepthStart=k.VersionEnd=(k.VersionStart=0)+k.VersionSize)+k.DepthSize)+k.ParentFingerPrintSize)+k.ChildIndexSize)+k.ChainCodeSize)+1)+k.PrivateKeySize)+k.CheckSumSize)===k.SerializedByteSize),e.exports=k}).call(this,o("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./crypto/random":88,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdpublickey":99,"./networks":100,"./privatekey":102,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],99:[function(i,s,e){(function(u){"use strict";var n=i("lodash"),t=i("./util/preconditions"),f=i("./crypto/bn"),a=i("./encoding/base58"),p=i("./encoding/base58check"),h=i("./crypto/hash"),r=i("./hdprivatekey"),l=i("./hdkeycache"),d=i("./networks"),m=i("./crypto/point"),g=i("./publickey"),e=i("./errors"),v=e,b=e.HDPublicKey,o=i("assert"),y=i("./util/js"),_=i("./util/buffer");function w(e){if(e instanceof w)return e;if(!(this instanceof w))return new w(e);if(e){if(n.isString(e)||_.isBuffer(e)){var t=w.getSerializedError(e);if(t){if(_.isBuffer(e)&&!w.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof b.ArgumentIsPrivateExtended)return new r(e).hdPublicKey;throw t}return this._buildFromSerialized(e)}if(n.isObject(e))return e instanceof r?this._buildFromPrivate(e):this._buildFromObject(e);throw new b.UnrecognizedArgument(e)}throw new b.MustSupplyArgument}w.isValidPath=function(e){if(n.isString(e)){var t=r._getDerivationIndexes(e);return null!==t&&n.all(t,w.isValidPath)}return!!n.isNumber(e)&&(0<=e&&e"},w.prototype.toObject=w.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version)).name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:_.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},w.fromBuffer=function(e){return new w(e)},w.prototype.toBuffer=function(){return _.copy(this._buffers.xpubkey)},w.Hardened=2147483648,w.RootElementAlias=["m","M"],w.VersionSize=4,w.DepthSize=1,w.ParentFingerPrintSize=4,w.ChildIndexSize=4,w.ChainCodeSize=32,w.PublicKeySize=33,w.CheckSumSize=4,w.DataSize=78,w.SerializedByteSize=82,w.ChecksumEnd=(w.ChecksumStart=w.PublicKeyEnd=(w.PublicKeyStart=w.ChainCodeEnd=(w.ChainCodeStart=w.ChildIndexEnd=(w.ChildIndexStart=w.ParentFingerPrintEnd=(w.ParentFingerPrintStart=w.DepthEnd=(w.DepthStart=w.VersionEnd=(w.VersionStart=0)+w.VersionSize)+w.DepthSize)+w.ParentFingerPrintSize)+w.ChildIndexSize)+w.ChainCodeSize)+w.PublicKeySize)+w.CheckSumSize,o(w.PublicKeyEnd===w.DataSize),o(w.ChecksumEnd===w.SerializedByteSize),s.exports=w}).call(this,i("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdprivatekey":98,"./networks":100,"./publickey":103,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],100:[function(e,t,r){"use strict";var n=e("lodash"),i=e("./util/buffer"),a=e("./util/js"),o=[],s={};function c(){}function u(t,e){if(~o.indexOf(t))return t;if(!e)return s[t];n.isArray(e)||(e=[e]);var r=function(e){return o[i][e]===t};for(var i in o)if(n.any(e,r))return o[i]}function f(e){var t=new c;return a.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey}),e.networkMagic&&a.defineImmutable(t,{networkMagic:i.integerAsBuffer(e.networkMagic)}),e.port&&a.defineImmutable(t,{port:e.port}),e.dnsSeeds&&a.defineImmutable(t,{dnsSeeds:e.dnsSeeds}),n.each(t,function(e){n.isUndefined(e)||n.isObject(e)||(s[e]=t)}),o.push(t),t}c.prototype.toString=function(){return this.name},f({name:"livenet",alias:"mainnet",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var p=u("livenet");f({name:"testnet",alias:"regtest",pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956});var h=u("testnet"),l={PORT:18333,NETWORK_MAGIC:i.integerAsBuffer(185665799),DNS_SEEDS:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]};for(var d in l)n.isObject(l[d])||(s[l[d]]=h);var m={PORT:18444,NETWORK_MAGIC:i.integerAsBuffer(4206867930),DNS_SEEDS:[]};for(var d in m)n.isObject(m[d])||(s[m[d]]=h);Object.defineProperty(h,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.PORT:l.PORT}}),Object.defineProperty(h,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.NETWORK_MAGIC:l.NETWORK_MAGIC}}),Object.defineProperty(h,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.DNS_SEEDS:l.DNS_SEEDS}}),t.exports={add:f,remove:function(e){for(var t=0;t=a.map.OP_1&&e<=a.map.OP_16},a.prototype.inspect=function(){return""},c.exports=a}).call(this,s("buffer").Buffer)},{"./util/buffer":121,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],102:[function(h,l,e){(function(i){"use strict";var n=h("lodash"),r=h("./address"),a=h("./encoding/base58check"),o=h("./crypto/bn"),s=h("./util/js"),c=h("./networks"),u=h("./crypto/point"),e=h("./publickey"),f=h("./crypto/random"),t=h("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(e instanceof p)return e;var r=this._classifyArguments(e,t);if(!r.bn||0===r.bn.cmp(new o(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(u.getN()))throw new TypeError("Number must be less than N");if(void 0===r.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return s.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}p.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?c.get(t):c.defaultNetwork};if(n.isUndefined(e)||n.isNull(e))r.bn=p._getRandomBN();else if(e instanceof o)r.bn=e;else if(e instanceof i||e instanceof Uint8Array)r=p._transformBuffer(e,t);else if(e.bn&&e.network)r=p._transformObject(e);else if(!t&&c.get(e))r.bn=p._getRandomBN(),r.network=c.get(e);else{if("string"!=typeof e)throw new TypeError("First argument is an unrecognized data type.");s.isHexa(e)?r.bn=new o(new i(e,"hex")):r=p._transformWIF(e,t)}return r},p._getRandomBN=function(){var e,t;do{var r=f.getRandomBuffer(32);e=(t=o.fromBuffer(r)).lt(u.getN())}while(!e);return t},p._transformBuffer=function(e,t){var r={};if(32===e.length)return p._transformBNBuffer(e,t);if(r.network=c.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==c.get(t))throw new TypeError("Private key network mismatch");if(34===e.length&&1===e[33])r.compressed=!0;else{if(33!==e.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");r.compressed=!1}return r.bn=o.fromBuffer(e.slice(1,33)),r},p._transformBNBuffer=function(e,t){var r={};return r.network=c.get(t)||c.defaultNetwork,r.bn=o.fromBuffer(e),r.compressed=!1,r},p._transformWIF=function(e,t){return p._transformBuffer(a.decode(e),t)},p.fromBuffer=function(e,t){return new p(e,t)},p._transformObject=function(e){return{bn:new o(e.bn,"hex"),network:c.get(e.network),compressed:e.compressed}},p.fromString=p.fromWIF=function(e){return t.checkArgument(n.isString(e),"First argument is expected to be a string."),new p(e)},p.fromObject=function(e){return t.checkArgument(n.isObject(e),"First argument is expected to be an object."),new p(e)},p.fromRandom=function(e){return new p(p._getRandomBN(),e)},p.getValidationError=function(e,t){var r;try{new p(e,t)}catch(e){r=e}return r},p.isValid=function(e,t){return!!e&&!p.getValidationError(e,t)},p.prototype.toString=function(){return this.toBuffer().toString("hex")},p.prototype.toWIF=function(){var e,t=this.network;return e=this.compressed?i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32}),new i([1])]):i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32})]),a.encode(e)},p.prototype.toBigNumber=function(){return this.bn},p.prototype.toBuffer=function(){return this.bn.toBuffer()},p.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=e.fromPrivateKey(this)),this._pubkey},p.prototype.toAddress=function(e){var t=this.toPublicKey();return r.fromPublicKey(t,e||this.network)},p.prototype.toObject=p.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},p.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return""},l.exports=p}).call(this,h("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/point":87,"./crypto/random":88,"./encoding/base58check":91,"./networks":100,"./publickey":103,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],103:[function(t,r,e){(function(o){"use strict";var s=t("./crypto/bn"),c=t("./crypto/point"),e=t("./crypto/hash"),i=t("./util/js"),n=t("./networks"),u=t("lodash"),f=t("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(f.checkArgument(e,"First argument is required, please include public key data."),e instanceof p)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),i.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||n.defaultNetwork}),this}p.prototype._classifyArgs=function(e,t){var r={compressed:u.isUndefined(t.compressed)||t.compressed};if(e instanceof c)r.point=e;else if(e.x&&e.y)r=p._transformObject(e);else if("string"==typeof e)r=p._transformDER(new o(e,"hex"));else if(p._isBuffer(e))r=p._transformDER(e);else{if(!p._isPrivateKey(e))throw new TypeError("First argument is an unrecognized data format.");r=p._transformPrivateKey(e)}return r.network||(r.network=u.isUndefined(t.network)?void 0:n.get(t.network)),r},p._isPrivateKey=function(e){return e instanceof t("./privatekey")},p._isBuffer=function(e){return e instanceof o||e instanceof Uint8Array},p._transformPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=c.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t},p._transformDER=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r,i,n,a,o={};if(t=!!u.isUndefined(t)||t,4!==e[0]&&(t||6!==e[0]&&7!==e[0]))if(3===e[0])n=e.slice(1),r=new s(n),(o=p._transformX(!0,r)).compressed=!0;else{if(2!==e[0])throw new TypeError("Invalid DER format public key");n=e.slice(1),r=new s(n),(o=p._transformX(!1,r)).compressed=!0}else{if(n=e.slice(1,33),a=e.slice(33,65),32!==n.length||32!==a.length||65!==e.length)throw new TypeError("Length of x and y must be 32 bytes");r=new s(n),i=new s(a),o.point=new c(r,i),o.compressed=!1}return o},p._transformX=function(e,t){f.checkArgument("boolean"==typeof e,"Must specify whether y is odd or not (true or false)");var r={};return r.point=c.fromX(e,t),r},p._transformObject=function(e){var t=new s(e.x,"hex"),r=new s(e.y,"hex");return new p(new c(t,r),{compressed:e.compressed})},p.fromPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t=p._transformPrivateKey(e);return new p(t.point,{compressed:t.compressed,network:t.network})},p.fromDER=p.fromBuffer=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r=p._transformDER(e,t);return new p(r.point,{compressed:r.compressed})},p.fromPoint=function(e,t){return f.checkArgument(e instanceof c,"First argument must be an instance of Point."),new p(e,{compressed:t})},p.fromString=function(e,t){var r=new o(e,t||"hex"),i=p._transformDER(r);return new p(i.point,{compressed:i.compressed})},p.fromX=function(e,t){var r=p._transformX(e,t);return new p(r.point,{compressed:r.compressed})},p.getValidationError=function(e){var t;try{new p(e)}catch(e){t=e}return t},p.isValid=function(e){return!p.getValidationError(e)},p.prototype.toObject=p.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},p.prototype.toBuffer=p.prototype.toDER=function(){var e,t=this.point.getX(),r=this.point.getY(),i=t.toBuffer({size:32}),n=r.toBuffer({size:32});if(this.compressed){var a=n[n.length-1]%2;return e=new o(a?[3]:[2]),o.concat([e,i])}return e=new o([4]),o.concat([e,i,n])},p.prototype._getID=function(){return e.sha256ripemd160(this.toBuffer())},p.prototype.toAddress=function(e){return t("./address").fromPublicKey(this,e||this.network)},p.prototype.toString=function(){return this.toDER().toString("hex")},p.prototype.inspect=function(){return""},r.exports=p}).call(this,t("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./networks":100,"./privatekey":102,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],104:[function(e,t,r){t.exports=e("./script"),t.exports.Interpreter=e("./interpreter")},{"./interpreter":105,"./script":106}],105:[function(p,t,e){(function(e){"use strict";var R=p("lodash"),z=p("./script"),M=p("../opcode"),N=p("../crypto/bn"),D=p("../crypto/hash"),q=p("../crypto/signature"),L=p("../publickey"),U=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};U.prototype.verify=function(e,t,r,i,n){var a,o=p("../transaction");if(R.isUndefined(r)&&(r=new o),R.isUndefined(i)&&(i=0),R.isUndefined(n)&&(n=0),this.set({script:e,tx:r,nin:i,flags:n}),0!=(n&U.SCRIPT_VERIFY_SIGPUSHONLY)&&!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(!this.evaluate())return!1;n&U.SCRIPT_VERIFY_P2SH&&(a=this.stack.slice());var s=this.stack;if(this.initialize(),this.set({script:t,stack:s,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(0===this.stack.length)return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT");var c=this.stack[this.stack.length-1];if(!U.castToBool(c))return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK");if(n&U.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(0===a.length)throw new Error("internal error - stack copy empty");var u=a[a.length-1],f=z.fromBuffer(u);return a.pop(),this.initialize(),this.set({script:f,stack:a,tx:r,nin:i,flags:n}),!!this.evaluate()&&(0===a.length?!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK"):!!U.castToBool(a[a.length-1])||!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK"))}return!0},(t.exports=U).prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},U.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=void 0!==e.nin?e.nin:this.nin,this.stack=e.stack||this.stack,this.altstack=e.altack||this.altstack,this.pc=void 0!==e.pc?e.pc:this.pc,this.pbegincodehash=void 0!==e.pbegincodehash?e.pbegincodehash:this.pbegincodehash,this.nOpCount=void 0!==e.nOpCount?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=void 0!==e.flags?e.flags:this.flags},U.true=new e([1]),U.false=new e([]),U.MAX_SCRIPT_ELEMENT_SIZE=520,U.LOCKTIME_THRESHOLD_BN=new N(U.LOCKTIME_THRESHOLD=5e8),U.SCRIPT_VERIFY_NONE=0,U.SCRIPT_VERIFY_P2SH=1,U.SCRIPT_VERIFY_STRICTENC=2,U.SCRIPT_VERIFY_DERSIG=4,U.SCRIPT_VERIFY_LOW_S=8,U.SCRIPT_VERIFY_NULLDUMMY=16,U.SCRIPT_VERIFY_SIGPUSHONLY=32,U.SCRIPT_VERIFY_MINIMALDATA=64,U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,U.castToBool=function(e){for(var t=0;t=U.LOCKTIME_THRESHOLD&&e.gte(U.LOCKTIME_THRESHOLD_BN))&&(!e.gt(new N(this.tx.nLockTime))&&!!this.tx.inputs[this.nin].isFinal())},U.prototype.step=function(){var e,t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g,v=0!=(this.flags&U.SCRIPT_VERIFY_MINIMALDATA),b=-1===this.vfExec.indexOf(!1),y=this.script.chunks[this.pc];this.pc++;var _=y.opcodenum;if(R.isUndefined(_))return!(this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE");if(y.buf&&y.buf.length>U.MAX_SCRIPT_ELEMENT_SIZE)return!(this.errstr="SCRIPT_ERR_PUSH_SIZE");if(_>M.OP_16&&201<++this.nOpCount)return!(this.errstr="SCRIPT_ERR_OP_COUNT");if(_===M.OP_CAT||_===M.OP_SUBSTR||_===M.OP_LEFT||_===M.OP_RIGHT||_===M.OP_INVERT||_===M.OP_AND||_===M.OP_OR||_===M.OP_XOR||_===M.OP_2MUL||_===M.OP_2DIV||_===M.OP_MUL||_===M.OP_DIV||_===M.OP_MOD||_===M.OP_LSHIFT||_===M.OP_RSHIFT)return!(this.errstr="SCRIPT_ERR_DISABLED_OPCODE");if(b&&0<=_&&_<=M.OP_PUSHDATA4){if(v&&!this.script.checkMinimalPush(this.pc-1))return!(this.errstr="SCRIPT_ERR_MINIMALDATA");if(y.buf){if(y.len!==y.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(y.buf)}else this.stack.push(U.false)}else if(b||M.OP_IF<=_&&_<=M.OP_ENDIF)switch(_){case M.OP_1NEGATE:case M.OP_1:case M.OP_2:case M.OP_3:case M.OP_4:case M.OP_5:case M.OP_6:case M.OP_7:case M.OP_8:case M.OP_9:case M.OP_10:case M.OP_11:case M.OP_12:case M.OP_13:case M.OP_14:case M.OP_15:case M.OP_16:n=_-(M.OP_1-1),e=new N(n).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_NOP:break;case M.OP_NOP2:case M.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break}if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");var w=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v,5);if(w.lt(new N(0)))return!(this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME");if(!this.checkLockTime(w))return!(this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME");break;case M.OP_NOP1:case M.OP_NOP3:case M.OP_NOP4:case M.OP_NOP5:case M.OP_NOP6:case M.OP_NOP7:case M.OP_NOP8:case M.OP_NOP9:case M.OP_NOP10:if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break;case M.OP_IF:case M.OP_NOTIF:if(m=!1,b){if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");e=this.stack.pop(),m=U.castToBool(e),_===M.OP_NOTIF&&(m=!m)}this.vfExec.push(m);break;case M.OP_ELSE:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case M.OP_ENDIF:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec.pop();break;case M.OP_VERIFY:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],!(m=U.castToBool(e)))return!(this.errstr="SCRIPT_ERR_VERIFY");this.stack.pop();break;case M.OP_RETURN:return!(this.errstr="SCRIPT_ERR_OP_RETURN");case M.OP_TOALTSTACK:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.altstack.push(this.stack.pop());break;case M.OP_FROMALTSTACK:if(this.altstack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION");this.stack.push(this.altstack.pop());break;case M.OP_2DROP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop(),this.stack.pop();break;case M.OP_2DUP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1],this.stack.push(t),this.stack.push(r);break;case M.OP_3DUP:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-3],r=this.stack[this.stack.length-2];var k=this.stack[this.stack.length-1];this.stack.push(t),this.stack.push(r),this.stack.push(k);break;case M.OP_2OVER:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-4],r=this.stack[this.stack.length-3],this.stack.push(t),this.stack.push(r);break;case M.OP_2ROT:if(this.stack.length<6)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-6,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_2SWAP:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-4,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_IFDUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-1],(m=U.castToBool(e))&&this.stack.push(e);break;case M.OP_DEPTH:e=new N(this.stack.length).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_DROP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop();break;case M.OP_DUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-1]);break;case M.OP_NIP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,1);break;case M.OP_OVER:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-2]);break;case M.OP_PICK:case M.OP_ROLL:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],n=(s=N.fromScriptNumBuffer(e,v)).toNumber(),this.stack.pop(),n<0||n>=this.stack.length)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-n-1],_===M.OP_ROLL&&this.stack.splice(this.stack.length-n-1,1),this.stack.push(e);break;case M.OP_ROT:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-3],o=this.stack[this.stack.length-2];var x=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=o,this.stack[this.stack.length-2]=x,this.stack[this.stack.length-1]=a;break;case M.OP_SWAP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-2],o=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=o,this.stack[this.stack.length-1]=a;break;case M.OP_TUCK:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case M.OP_SIZE:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");s=new N(this.stack[this.stack.length-1].length),this.stack.push(s.toScriptNumBuffer());break;case M.OP_EQUAL:case M.OP_EQUALVERIFY:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1];var S=t.toString("hex")===r.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(S?U.true:U.false),_===M.OP_EQUALVERIFY){if(!S)return!(this.errstr="SCRIPT_ERR_EQUALVERIFY");this.stack.pop()}break;case M.OP_1ADD:case M.OP_1SUB:case M.OP_NEGATE:case M.OP_ABS:case M.OP_NOT:case M.OP_0NOTEQUAL:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(e=this.stack[this.stack.length-1],s=N.fromScriptNumBuffer(e,v),_){case M.OP_1ADD:s=s.add(N.One);break;case M.OP_1SUB:s=s.sub(N.One);break;case M.OP_NEGATE:s=s.neg();break;case M.OP_ABS:s.cmp(N.Zero)<0&&(s=s.neg());break;case M.OP_NOT:s=new N((0===s.cmp(N.Zero))+0);break;case M.OP_0NOTEQUAL:s=new N((0!==s.cmp(N.Zero))+0)}this.stack.pop(),this.stack.push(s.toScriptNumBuffer());break;case M.OP_ADD:case M.OP_SUB:case M.OP_BOOLAND:case M.OP_BOOLOR:case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:case M.OP_NUMNOTEQUAL:case M.OP_LESSTHAN:case M.OP_GREATERTHAN:case M.OP_LESSTHANOREQUAL:case M.OP_GREATERTHANOREQUAL:case M.OP_MIN:case M.OP_MAX:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(c=N.fromScriptNumBuffer(this.stack[this.stack.length-2],v),u=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v),s=new N(0),_){case M.OP_ADD:s=c.add(u);break;case M.OP_SUB:s=c.sub(u);break;case M.OP_BOOLAND:s=new N((0!==c.cmp(N.Zero)&&0!==u.cmp(N.Zero))+0);break;case M.OP_BOOLOR:s=new N((0!==c.cmp(N.Zero)||0!==u.cmp(N.Zero))+0);break;case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:s=new N((0===c.cmp(u))+0);break;case M.OP_NUMNOTEQUAL:s=new N((0!==c.cmp(u))+0);break;case M.OP_LESSTHAN:s=new N((c.cmp(u)<0)+0);break;case M.OP_GREATERTHAN:s=new N((0"},v.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==c.OP_DUP||this.chunks[1].opcodenum!==c.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==c.OP_EQUALVERIFY||this.chunks[4].opcodenum!==c.OP_CHECKSIG)},v.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&48===e[0]&&t&&t.length){var r=t[0];if((4===r||6===r||7===r)&&65===t.length)return!0;if((3===r||2===r)&&33===t.length)return!0}}return!1},v.prototype.getPublicKey=function(){return p.checkState(this.isPublicKeyOut(),"Can't retreive PublicKey from a non-PK output"),this.chunks[0].buf},v.prototype.getPublicKeyHash=function(){return p.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},v.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===c.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if((4!==t&&6!==t&&7!==t||65!==e.length)&&(3!==t&&2!==t||33!==e.length)||(r=!0),r)return u.isValid(e)}return!1},v.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var e=this.chunks[0].buf;if(e&&e.length&&48===e[0])return!0}return!1},v.prototype.isScriptHashOut=function(){var e=this.toBuffer();return 23===e.length&&e[0]===c.OP_HASH160&&20===e[1]&&e[e.length-1]===c.OP_EQUAL},v.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e,t=this.chunks[this.chunks.length-1].buf;if(!t)return!1;try{e=v.fromBuffer(t)}catch(e){if(e instanceof l.Script.InvalidBuffer)return!1;throw e}return e.classify()!==v.types.UNKNOWN},v.prototype.isMultisigOut=function(){return 3=c.OP_1&&e<=c.OP_16)return e-(c.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))},v.prototype.getSignatureOperationsCount=function(r){r=!!h.isUndefined(r)||r;var i=this,n=0,a=c.OP_INVALIDOPCODE;return h.each(i.chunks,function(e){var t=e.opcodenum;t==c.OP_CHECKSIG||t==c.OP_CHECKSIGVERIFY?n++:t!=c.OP_CHECKMULTISIG&&t!=c.OP_CHECKMULTISIGVERIFY||(r&&a>=c.OP_1&&a<=c.OP_16?n+=i._decodeOP_N(a):n+=20),a=t}),n},t.exports=v}).call(this,e("buffer").Buffer)},{"../address":79,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../networks":100,"../opcode":101,"../publickey":103,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],107:[function(e,t,r){t.exports=e("./transaction"),t.exports.Input=e("./input"),t.exports.Output=e("./output"),t.exports.UnspentOutput=e("./unspentoutput"),t.exports.Signature=e("./signature"),t.exports.Sighash=e("./sighash")},{"./input":108,"./output":114,"./sighash":115,"./signature":116,"./transaction":117,"./unspentoutput":118}],108:[function(e,t,r){t.exports=e("./input"),t.exports.PublicKey=e("./publickey"),t.exports.PublicKeyHash=e("./publickeyhash"),t.exports.MultiSig=e("./multisig.js"),t.exports.MultiSigScriptHash=e("./multisigscripthash.js")},{"./input":109,"./multisig.js":110,"./multisigscripthash.js":111,"./publickey":112,"./publickeyhash":113}],109:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../../util/preconditions"),a=e("../../errors"),o=e("../../encoding/bufferwriter"),s=e("buffer"),c=e("../../util/buffer"),u=e("../../util/js"),f=e("../../script"),p=e("../sighash"),h=e("../output"),l=4294967295;function d(e){return this instanceof d?e?this._fromObject(e):void 0:new d(e)}d.MAXINT=l,d.DEFAULT_SEQNUMBER=4294967295,d.DEFAULT_LOCKTIME_SEQNUMBER=4294967294,d.DEFAULT_RBF_SEQNUMBER=4294967293,Object.defineProperty(d.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new f(this._scriptBuffer),this._script._isInput=!0),this._script)}}),d.fromObject=function(e){return n.checkArgument(i.isObject(e)),(new d)._fromObject(e)},d.prototype._fromObject=function(e){var t;if(t=i.isString(e.prevTxId)&&u.isHexa(e.prevTxId)?new s.Buffer(e.prevTxId,"hex"):e.prevTxId,this.output=e.output?e.output instanceof h?e.output:new h(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=i.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=i.isUndefined(e.sequenceNumber)?i.isUndefined(e.seqnum)?4294967295:e.seqnum:e.sequenceNumber,i.isUndefined(e.script)&&i.isUndefined(e.scriptBuffer))throw new a.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this},d.prototype.toObject=d.prototype.toJSON=function(){var e={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(e.scriptString=this.script.toString()),this.output&&(e.output=this.output.toObject()),e},d.fromBufferReader=function(e){var t=new d;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t},d.prototype.toBufferWriter=function(e){e||(e=new o),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e},d.prototype.setScript=function(e){if(this._script=null,e instanceof f)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(u.isHexa(e))this._scriptBuffer=new s.Buffer(e,"hex");else if(i.isString(e))this._script=new f(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!c.isBuffer(e))throw new TypeError("Invalid argument type: script");this._scriptBuffer=new s.Buffer(e)}return this},d.prototype.getSignatures=function(){throw new a.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},d.prototype.isFullySigned=function(){throw new a.AbstractMethodInvoked("Input#isFullySigned")},d.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},d.prototype.addSignature=function(){throw new a.AbstractMethodInvoked("Input#addSignature")},d.prototype.clearSignatures=function(){throw new a.AbstractMethodInvoked("Input#clearSignatures")},d.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},d.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},d.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},t.exports=d},{"../../encoding/bufferwriter":93,"../../errors":95,"../../script":104,"../../util/buffer":121,"../../util/js":122,"../../util/preconditions":123,"../output":114,"../sighash":115,buffer:191,lodash:149}],110:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=(e("../transaction"),e("./input")),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),u.checkState(o.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.output.script),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},l.normalizeSignatures=function(n,a,o,e,t){return t.map(function(r){var i=null;return e=e.filter(function(e){if(i)return!0;var t=new h({signature:f.fromTxFormat(e),publicKey:r,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:o,sigtype:f.SIGHASH_ALL});return t.signature.nhashtype=t.sigtype,!p.verify(n,t.signature,t.publicKey,t.inputIndex,a.output.script)||(i=t,!1)}),i||null})},l.OPCODES_SIZE=1,l.SIGNATURE_SIZE=73,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"../transaction":117,"./input":109,inherits:148,lodash:149}],111:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=e("./input"),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),this.redeemScript=o.buildMultisigOut(this.publicKeys,r),u.checkState(o.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.redeemScript),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript)},l.OPCODES_SIZE=7,l.SIGNATURE_SIZE=74,l.PUBKEY_SIZE=34,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE+this.publicKeys.length*l.PUBKEY_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148,lodash:149}],112:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),n=(e("../../util/buffer"),e("./input")),o=e("../output"),s=e("../sighash"),c=e("../../script"),u=e("../../crypto/signature"),f=e("../signature");function p(){n.apply(this,arguments)}i(p,n),p.prototype.getSignatures=function(e,t,r,i){a.checkState(this.output instanceof o),i=i||u.SIGHASH_ALL;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new f({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:s.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},p.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(c.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this},p.prototype.clearSignatures=function(){return this.setScript(c.empty()),this},p.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},p.SCRIPT_MAX_SIZE=73,p.prototype._estimateSize=function(){return p.SCRIPT_MAX_SIZE},t.exports=p},{"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],113:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),o=e("../../util/buffer"),s=e("../../crypto/hash"),n=e("./input"),c=e("../output"),u=e("../sighash"),f=e("../../script"),p=e("../../crypto/signature"),h=e("../signature");function l(){n.apply(this,arguments)}i(l,n),l.prototype.getSignatures=function(e,t,r,i,n){return a.checkState(this.output instanceof c),n=n||s.sha256ripemd160(t.publicKey.toBuffer()),i=i||p.SIGHASH_ALL,o.equals(n,this.output.script.getPublicKeyHash())?[new h({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:u.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},l.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(f.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this},l.prototype.clearSignatures=function(){return this.setScript(f.empty()),this},l.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()},l.SCRIPT_MAX_SIZE=107,l.prototype._estimateSize=function(){return l.SCRIPT_MAX_SIZE},t.exports=l},{"../../crypto/hash":86,"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],114:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../crypto/bn"),a=e("buffer"),o=e("../util/buffer"),s=e("../util/js"),c=e("../encoding/bufferwriter"),u=e("../script"),f=e("../util/preconditions"),p=e("../errors");function h(e){if(!(this instanceof h))return new h(e);if(!i.isObject(e))throw new TypeError("Unrecognized argument for Output");var t;this.satoshis=e.satoshis,o.isBuffer(e.script)?this._scriptBuffer=e.script:(t=i.isString(e.script)&&s.isHexa(e.script)?new a.Buffer(e.script,"hex"):e.script,this.setScript(t))}Object.defineProperty(h.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script||this.setScriptFromBuffer(this._scriptBuffer),this._script}}),Object.defineProperty(h.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof n?(this._satoshisBN=e,this._satoshis=e.toNumber()):i.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=n.fromNumber(this._satoshis)):(f.checkArgument(s.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=n.fromNumber(e),this._satoshis=e),f.checkState(s.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),h.prototype.invalidSatoshis=function(){return 9007199254740991"},h.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return t.script=0!==r?e.read(r):new a.Buffer([]),new h(t)},h.prototype.toBufferWriter=function(e){e||(e=new c),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e},t.exports=h},{"../crypto/bn":84,"../encoding/bufferwriter":93,"../errors":95,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],115:[function(y,e,t){(function(f){"use strict";var p=y("buffer"),h=y("../crypto/signature"),l=y("../script"),d=y("./output"),m=y("../encoding/bufferreader"),g=y("../encoding/bufferwriter"),v=y("../crypto/bn"),b=y("../crypto/hash"),o=y("../crypto/ecdsa"),s=y("../util/preconditions"),c=y("lodash"),u=function(e,t,r,i){var n,a=y("./transaction"),o=y("./input"),s=a.shallowCopy(e);for((i=new l(i)).removeCodeseparators(),n=0;n=s.outputs.length)return new f("0000000000000000000000000000000000000000000000000000000000000001","hex");for(s.outputs.length=r+1,n=0;n"},S.prototype.toBuffer=function(){var e=new u;return this.toBufferWriter(e).toBuffer()},S.prototype.toBufferWriter=function(t){return t.writeUInt32LE(this.version),t.writeVarintNum(this.inputs.length),s.each(this.inputs,function(e){e.toBufferWriter(t)}),t.writeVarintNum(this.outputs.length),s.each(this.outputs,function(e){e.toBufferWriter(t)}),t.writeUInt32LE(this.nLockTime),t},S.prototype.fromBuffer=function(e){var t=new c(e);return this.fromBufferReader(t)},S.prototype.fromBufferReader=function(e){var t,r,i;for(a.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readUInt32LE(),r=e.readVarintNum(),t=0;t=this.inputs.length)throw new n.Transaction.InvalidIndex(e,this.inputs.length);var i=this.inputs[e];this.inputs=s.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()},S.prototype.sign=function(e,t){a.checkState(this.hasAllUtxoInfo());var r=this;return s.isArray(e)?s.each(e,function(e){r.sign(e,t)}):s.each(this.getSignatures(e,t),function(e){r.applySignature(e)}),this},S.prototype.getSignatures=function(r,i){r=new k(r),i=i||p.SIGHASH_ALL;var n=this,a=[],o=f.sha256ripemd160(r.publicKey.toBuffer());return s.each(this.inputs,function(e,t){s.each(e.getSignatures(n,r,t,i,o),function(e){a.push(e)})}),a},S.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this},S.prototype.isFullySigned=function(){return s.each(this.inputs,function(e){if(e.isFullySigned===m.prototype.isFullySigned)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),s.all(s.map(this.inputs,function(e){return e.isFullySigned()}))},S.prototype.isValidSignature=function(e){if(this.inputs[e.inputIndex].isValidSignature===m.prototype.isValidSignature)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e)},S.prototype.verifySignature=function(e,t,r,i){return h.verify(this,e,t,r,i)},S.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var e=new x(0),t=0;t=m.MAXINT-1&&(t.sequenceNumber=m.DEFAULT_RBF_SEQNUMBER)}return this},I.exports=S}).call(this,A("buffer").Buffer)},{"../address":79,"../crypto/bn":84,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../privatekey":102,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"./input":108,"./output":114,"./sighash":115,"./unspentoutput":118,buffer:191,"buffer-compare":126,lodash:149}],118:[function(e,t,r){"use strict";var o=e("lodash"),s=e("../util/preconditions"),c=e("../util/js"),u=e("../script"),f=e("../address"),p=e("../unit");function h(e){if(!(this instanceof h))return new h(e);s.checkArgument(o.isObject(e),"Must provide an object from where to extract data");var t=e.address?new f(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!c.isHexaString(r)||64"},h.prototype.toString=function(){return this.txId+":"+this.outputIndex},h.fromObject=function(e){return new h(e)},h.prototype.toObject=h.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:p.fromSatoshis(this.satoshis).toBTC()}},t.exports=h},{"../address":79,"../script":104,"../unit":119,"../util/js":122,"../util/preconditions":123,lodash:149}],119:[function(e,t,r){"use strict";var i=e("lodash"),n=e("./errors"),a=e("./util/preconditions"),o={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function s(e,t){if(!(this instanceof s))return new s(e,t);if(i.isNumber(t)){if(t<=0)throw new n.Unit.InvalidRate(t);e/=t,t=s.BTC}this._value=this._from(e,t);var r=this;Object.keys(o).forEach(function(e){Object.defineProperty(r,e,{get:function(){return r.to(e)},enumerable:!0})})}Object.keys(o).forEach(function(e){s[e]=e}),s.fromObject=function(e){return a.checkArgument(i.isObject(e),"Argument is expected to be an object"),new s(e.amount,e.code)},s.fromBTC=function(e){return new s(e,s.BTC)},s.fromMillis=s.fromMilis=function(e){return new s(e,s.mBTC)},s.fromMicros=s.fromBits=function(e){return new s(e,s.bits)},s.fromSatoshis=function(e){return new s(e,s.satoshis)},s.fromFiat=function(e,t){return new s(e,t)},s.prototype._from=function(e,t){if(!o[t])throw new n.Unit.UnknownCode(t);return parseInt((e*o[t][0]).toFixed())},s.prototype.to=function(e){if(i.isNumber(e)){if(e<=0)throw new n.Unit.InvalidRate(e);return parseFloat((this.BTC*e).toFixed(2))}if(!o[e])throw new n.Unit.UnknownCode(e);var t=this._value/o[e][0];return parseFloat(t.toFixed(o[e][1]))},s.prototype.toBTC=function(){return this.to(s.BTC)},s.prototype.toMillis=s.prototype.toMilis=function(){return this.to(s.mBTC)},s.prototype.toMicros=s.prototype.toBits=function(){return this.to(s.bits)},s.prototype.toSatoshis=function(){return this.to(s.satoshis)},s.prototype.atRate=function(e){return this.to(e)},s.prototype.toString=function(){return this.satoshis+" satoshis"},s.prototype.toObject=s.prototype.toJSON=function(){return{amount:this.BTC,code:s.BTC}},s.prototype.inspect=function(){return""},t.exports=s},{"./errors":95,"./util/preconditions":123,lodash:149}],120:[function(e,t,r){"use strict";var i=e("lodash"),n=e("url"),a=e("./address"),o=e("./unit"),s=function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.extras={},this.knownParams=r||[],this.address=this.network=this.amount=this.message=null,"string"==typeof t){var i=e.parse(t);i.amount&&(i.amount=this._parseAmount(i.amount)),this._fromObject(i)}else{if("object"!==(void 0===t?"undefined":_typeof(t)))throw new TypeError("Unrecognized data format.");this._fromObject(t)}};s.fromString=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return new s(e)},s.fromObject=function(e){return new s(e)},s.isValid=function(e,t){try{new s(e,t)}catch(e){return!1}return!0},s.parse=function(e){var t=n.parse(e,!0);if("bitcoin:"!==t.protocol)throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(e);return t.query.address=r&&r[1]||void 0,t.query},s.Members=["address","amount","message","label","r"],s.prototype._fromObject=function(e){if(!a.isValid(e.address))throw new TypeError("Invalid bitcoin address");for(var t in this.address=new a(e.address),this.network=this.address.network,this.amount=e.amount,e)if("address"!==t&&"amount"!==t){if(/^req-/.exec(t)&&-1===this.knownParams.indexOf(t))throw Error("Unknown required argument "+t);(-1"},t.exports=s},{"./address":79,"./unit":119,lodash:149,url:500}],121:[function(o,s,e){(function(r){"use strict";var i=o("buffer"),t=o("assert"),n=o("./js"),a=o("./preconditions");function e(e,t){if(e.length!==t.length)return!1;for(var r=e.length,i=0;i>24&255),t.push(e>>16&255),t.push(e>>8&255),t.push(255&e),new r(t)},integerFromBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]<<24|e[1]<<16|e[2]<<8|e[3]},integerFromSingleByteBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]},bufferToHex:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e.toString("hex")},reverse:function(e){for(var t=new i.Buffer(e.length),r=0;r>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}}else if("le"===r)for(i=0,a=0;i>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-i&4194303,26<=(i+=24)&&(i-=26,n++)}if(r+6!==t){a=o(e,t,r+6);this.words[n]|=a<>>26-i&4194303}this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];v.prototype.toString=function(e,t){if(16===(e=e||10)||"hex"===e){for(var r="",i=0,n=(t=0|t||1,0),a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return this.sign&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var c=l[e],u=d[e],f=(r="",this.clone());for(f.sign=!1;0!==f.cmpn(0);){var p=f.modn(u).toString(e);r=0!==(f=f.idivn(u)).cmpn(0)?h[c-p.length]+p+r:p+r}return 0===this.cmpn(0)&&(r="0"+r),this.sign&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.prototype.toJSON=function(){return this.toString(16)},v.prototype.toArray=function(){this.strip();var e=new Array(this.byteLength());e[0]=0;for(var t=this.clone(),r=0;0!==t.cmpn(0);r++){var i=t.andln(255);t.ishrn(8),e[e.length-r-1]=i}return e},v.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return 4096<=t&&(r+=13,t>>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.iand=function(e){var t;this.sign=this.sign&&e.sign,t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},v.prototype.ixor=function(e){var t,r;this.sign=this.sign||e.sign,r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);for(var r=e/26|0,i=e%26;this.length<=r;)this.words[this.length++]=0;return this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,a=0;a>>26}for(;0!==n&&a>>26}if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this);this.sign=!1;t=e.sub(this);return this.sign=!0,t},v.prototype.isub=function(e){if(e.sign){e.sign=!1;var t=this.iadd(e);return e.sign=!0,t._normSign()}if(this.sign)return this.sign=!1,this.iadd(e),this.sign=!0,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.sign=!1,this.length=1,this.words[0]=0,this;i=0>26,this.words[o]=67108863&t}for(;0!==a&&o>26,this.words[o]=67108863&t}if(0===a&&o>>26,a=67108863&r,o=Math.min(i,e.length-1),s=Math.max(0,i-this.length+1);s<=o;s++){var c=i-s,u=(0|this.words[c])*(0|e.words[s]),f=67108863&u;a=67108863&(f=f+a|0),n=(n=n+(u/67108864|0)|0)+(f>>>26)|0}t.words[i]=a,r=n}return 0!==r?t.words[i]=r:t.length--,t.strip()},v.prototype._bigMulTo=function(e,t){t.sign=e.sign!==this.sign,t.length=this.length+e.length;for(var r=0,i=0,n=0;n>>26)|0)>>>26,a&=67108863}t.words[n]=o,r=a,a=i}return 0!==r?t.words[n]=r:t.length--,t.strip()},v.prototype.mulTo=function(e,t){return this.length+e.length<63?this._smallMulTo(e,t):this._bigMulTo(e,t)},v.prototype.mul=function(e){var t=new v(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},v.prototype.imul=function(e){if(0===this.cmpn(0)||0===e.cmpn(0))return this.words[0]=0,this.length=1,this;var t=this.length,r=e.length;this.sign=e.sign!==this.sign,this.length=this.length+e.length,this.words[this.length-1]=0;for(var i=this.length-2;0<=i;i--){for(var n=0,a=0,o=Math.min(i,r-1),s=Math.max(0,i-t+1);s<=o;s++){var c=i-s,u=this.words[c]*e.words[s],f=67108863&u;n+=u/67108864|0,a=67108863&(f+=a),n+=f>>>26}this.words[i]=a,this.words[i+1]+=n,n=0}for(n=0,c=1;c>>26}return this.strip()},v.prototype.imuln=function(e){g("number"==typeof e);for(var t=0,r=0;r>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.mul(this)},v.prototype.ishln=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){for(var n=0,a=0;a>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;a>>n<a){this.length-=a;for(c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(c/67108864|0),this.words[a+r]=67108863&s}for(;a>26,this.words[a+r]=67108863&s}if(0===o)return this.strip();g(-1===o);for(a=o=0;a>26,this.words[a]=67108863&s}return this.sign=!0,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.shln(r),i.ishln(r),a=n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var n;i=this.divmod(e.neg(),t);return"mod"!==t&&(n=i.div.neg()),{div:n,mod:i.mod}},v.prototype.div=function(e){return this.divmod(e,"div").div},v.prototype.mod=function(e){return this.divmod(e,"mod").mod},v.prototype.divRound=function(e){var t=this.divmod(e);if(0===t.mod.cmpn(0))return t.div;var r=t.div.sign?t.mod.isub(e):t.mod,i=e.shrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:t.div.sign?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+this.words[i])%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=this.words[r]+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.ishrn(1),r.ishrn(1),++s;for(var c=r.clone(),u=t.clone();0!==t.cmpn(0);){for(;t.isEven();)t.ishrn(1),i.isEven()&&n.isEven()?(i.ishrn(1),n.ishrn(1)):(i.iadd(c).ishrn(1),n.isub(u).ishrn(1));for(;r.isEven();)r.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(u).ishrn(1));0<=t.cmp(r)?(t.isub(r),i.isub(a),n.isub(o)):(r.isub(t),a.isub(i),o.isub(n))}return{a:a,b:o,gcd:r.ishln(s)}},v.prototype._invmp=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=r.clone();0>>26,o&=67108863,this.words[n]=o}return 0!==a&&(this.words[n]=a,this.length++),this},v.prototype.cmpn=function(e){var t,r=e<0;if(r&&(e=-e),this.sign&&!r)return-1;if(!this.sign&&r)return 1;if(e&=67108863,this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}e.words[i-10]=n>>>22,e.length-=9},a.prototype.imulK=function(e){var t;e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(i[e])return i[e];var t;if("k256"===e)t=new a;else if("p224"===e)t=new s;else if("p192"===e)t=new c;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new u}return i[e]=t},f.prototype._verify1=function(e){g(!e.sign,"red works only with positives"),g(e.red,"red works only with red numbers")},f.prototype._verify2=function(e,t){g(!e.sign&&!t.sign,"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},f.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.mod(this.m)._forceRed(this)},f.prototype.neg=function(e){var t=e.clone();return t.sign=!t.sign,t.iadd(this.m)._forceRed(this)},f.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},f.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},f.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)},f.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.shln(t))},f.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},f.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},f.prototype.isqr=function(e){return this.imul(e,e)},f.prototype.sqr=function(e){return this.mul(e,e)},f.prototype.sqrt=function(e){if(0===e.cmpn(0))return e.clone();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).ishrn(2);return f=this.pow(e,r)}for(var i=this.m.subn(1),n=0;0!==i.cmpn(0)&&0===i.andln(1);)n++,i.ishrn(1);g(0!==i.cmpn(0));var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).ishrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).ishrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>8,i[r]&=255;for(;a;)i.push(255&a),a>>=8}for(t=0;"1"===e[t]&&tt[i]?1:0);++i);return 0==r&&(t.length>e.length?r=-1:e.length>t.length&&(r=1)),r}},{}],127:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.hmacDRBG=e("./elliptic/hmac-drbg"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec")},{"../package.json":147,"./elliptic/curve":130,"./elliptic/curves":133,"./elliptic/ec":134,"./elliptic/hmac-drbg":137,"./elliptic/utils":139,brorand:140}],128:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic"),S=n.utils.getNAF,j=n.utils.getJSF,u=n.utils.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function o(e,t){this.curve=e,this.type=t,this.precomputed=null}(t.exports=a).prototype.point=function(){throw new Error("Not implemented")},a.prototype.validate=function(){throw new Error("Not implemented")},a.prototype._fixedNafMul=function(e,t){var r=e._getDoubles(),i=S(t,1),n=(1<>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i){for(var n=this._wnafT1,a=this._wnafT2,o=this._wnafT3,s=0,c=0;c>1]:x<0&&(k=a[m][-x-1>>1].neg()),b="affine"===k.type?b.mixedAdd(k):b.add(k))}}for(c=0;c":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],130:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":128,"./edwards":129,"./mont":131,"./short":132}],131:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base;function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(s,o),(t.exports=s).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)},a(c,o.BasePoint),s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.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)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.ishrn(1))n.push(t.andln(1));for(var a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../curve":130,"bn.js":124,inherits:148}],132:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.shrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.sign&&(i=i.neg(),n=n.neg()),a.sign&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(t=new w(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b).redSqrt(),i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},c.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)},c.prototype._endoWnafMulAdd=function(e,t){for(var r=this._endoWnafT1,i=this._endoWnafT2,n=0;n":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],133:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":127,"./precomputed/secp256k1":138,"hash.js":141}],134:[function(e,t,r){"use strict";var d=e("bn.js"),m=e("../../elliptic"),i=m.utils.assert,n=e("./key"),g=e("./signature");function a(e){if(!(this instanceof a))return new a(e);"string"==typeof e&&(i(m.curves.hasOwnProperty(e),"Unknown curve "+e),e=m.curves[e]),e instanceof m.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(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}(t.exports=a).prototype.keyPair=function(e){return new n(this,e)},a.prototype.keyFromPrivate=function(e,t){return n.fromPrivate(this,e,t)},a.prototype.keyFromPublic=function(e,t){return n.fromPublic(this,e,t)},a.prototype.genKeyPair=function(e){e||(e={});for(var t=new m.hmacDRBG({hash:this.hash,pers:e.pers,entropy:e.entropy||m.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new d(2));;){var n=new d(t.generate(r));if(!(0"}},{"../../elliptic":127,"bn.js":124}],136:[function(e,t,r){"use strict";var n=e("bn.js"),a=e("../../elliptic").utils,i=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16))}(t.exports=o).prototype._importDER=function(e,t){if((e=a.toArray(e,t)).length<6||48!==e[0]||2!==e[2])return!1;if(1+e[1]>e.length)return!1;var r=e[3];if(128<=r)return!1;if(4+r+2>=e.length)return!1;if(2!==e[4+r])return!1;var i=e[5+r];return!(128<=i)&&(!(4+r+2+i>e.length)&&(this.r=new n(e.slice(4,4+r)),this.s=new n(e.slice(4+r+2,4+r+2+i)),!0))},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r));var i=[48,t.length+r.length+4,2,t.length];return i=i.concat(t,[2,r.length],r),a.encode(i,e)}},{"../../elliptic":127,"bn.js":124}],137:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("../elliptic").utils,n=o.assert;function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc),r=o.toArray(e.nonce,e.nonceEnc),i=o.toArray(e.pers,e.persEnc);n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this.reseed=1},a.prototype.generate=function(e,t,r,i){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i),this._update(r));for(var n=[];n.length>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e},i.getNAF=function(e,t){for(var r=[],i=1<>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=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=n.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{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;for(a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>10),n[a-7],(r=n[a-15],b(r,7)^b(r,18)^r>>>3),n[a-16]);var o,s,c=this.h[0],u=this.h[1],f=this.h[2],p=this.h[3],h=this.h[4],l=this.h[5],d=this.h[6],m=this.h[7];F(this.k.length===n.length);for(a=0;a>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function s(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}function u(e,t){if(!e)throw new Error(t||"Assertion failed")}i.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},i.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,r){return e+t+r>>>0},i.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},i.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},i.assert=u,i.inherits=n,r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:148}],147:[function(e,t,r){t.exports={_args:[["elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib"]],_from:"elliptic@=3.0.3",_id:"elliptic@3.0.3",_inCache:!0,_location:"/bitcore-lib/elliptic",_phantomChildren:{inherits:"2.0.1"},_requested:{name:"elliptic",raw:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",rawSpec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",scope:null,spec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",type:"remote"},_requiredBy:["/bitcore-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_shasum:"865c9b420bfbe55006b9f969f97a0d2c44966595",_shrinkwrap:null,_spec:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_where:"/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^2.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},description:"EC cryptography",devDependencies:{browserify:"^3.44.2",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",optionalDependencies:{},readme:"# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic)\n\nFast elliptic-curve cryptography in a plain javascript implementation.\n\nNOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve\nfor your cryptography operations.\n\n## Incentive\n\nECC is much slower than regular RSA cryptography, the JS implementations are\neven more slower.\n\n## Benchmarks\n\n```bash\n$ node benchmarks/index.js\nBenchmarking: sign\nelliptic#sign x 262 ops/sec ±0.51% (177 runs sampled)\neccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled)\n------------------------\nFastest is elliptic#sign\n========================\nBenchmarking: verify\nelliptic#verify x 113 ops/sec ±0.50% (166 runs sampled)\neccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled)\n------------------------\nFastest is elliptic#verify\n========================\nBenchmarking: gen\nelliptic#gen x 294 ops/sec ±0.43% (176 runs sampled)\neccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled)\n------------------------\nFastest is elliptic#gen\n========================\nBenchmarking: ecdh\nelliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled)\n------------------------\nFastest is elliptic#ecdh\n========================\n```\n\n## API\n\n### ECDSA\n\n```javascript\nvar EC = require('elliptic').ec;\n\n// Create and initialize EC context\n// (better do it once and reuse it)\nvar ec = new EC('secp256k1');\n\n// Generate keys\nvar key = ec.genKeyPair();\n\n// Sign message (must be an array, or it'll be treated as a hex sequence)\nvar msg = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];\nvar signature = key.sign(msg);\n\n// Export DER encoded signature in Array\nvar derSign = signature.toDER();\n\n// Verify signature\nconsole.log(key.verify(msg, derSign));\n```\n\n### ECDH\n\n```javascript\n// Generate keys\nvar key1 = ec.genKeyPair();\nvar key2 = ec.genKeyPair();\n\nvar shared1 = key1.derive(key2.getPublic());\nvar shared2 = key2.derive(key1.getPublic());\n\nconsole.log('Both shared secrets are BN instances');\nconsole.log(shared1.toString(16));\nconsole.log(shared2.toString(16));\n```\n\nNOTE: `.derive()` returns a [BN][1] instance.\n\n## Supported curves\n\nElliptic.js support following curve types:\n\n* Short Weierstrass\n* Montgomery\n* Edwards\n* Twisted Edwards\n\nFollowing curve 'presets' are embedded into the library:\n\n* `secp256k1`\n* `p192`\n* `p224`\n* `p256`\n* `curve25519`\n* `ed25519`\n\nNOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead.\n\n### Implementation details\n\nECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of\nthe curve operations are performed on non-affine coordinates (either projective\nor extended), various windowing techniques are used for different cases.\n\nAll operations are performed in reduction context using [bn.js][1], hashing is\nprovided by [hash.js][2]\n\n### Related projects\n\n* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both\n browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for\n node)\n\n#### LICENSE\n\nThis software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2014.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://tools.ietf.org/html/rfc6979\n[1]: https://github.com/indutny/bn.js\n[2]: https://github.com/indutny/hash.js\n[3]: https://github.com/bitchan/eccrypto\n[4]: https://github.com/wanderer/secp256k1-node\n",readmeFilename:"README.md",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{test:"make lint && mocha --reporter=spec test/*-test.js"},version:"3.0.3"}},{}],148:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{dup:68}],149:[function(e,y,_){(function(b){(function(){var dn,e,t,mn="3.10.1",gn=1,vn=2,bn=4,yn=8,_n=16,wn=32,kn=64,xn=128,Sn=256,jn=30,En="...",An=150,In=16,Pn=200,On=1,Tn=2,Bn="Expected a function",Cn="__lodash_placeholder__",Fn="[object Arguments]",Rn="[object Array]",zn="[object Boolean]",Mn="[object Date]",Nn="[object Error]",Dn="[object Function]",r="[object Map]",qn="[object Number]",Ln="[object Object]",Un="[object RegExp]",i="[object Set]",Hn="[object String]",n="[object WeakMap]",Kn="[object ArrayBuffer]",Vn="[object Float32Array]",Gn="[object Float64Array]",$n="[object Int8Array]",Wn="[object Int16Array]",Zn="[object Int32Array]",Yn="[object Uint8Array]",Xn="[object Uint8ClampedArray]",Jn="[object Uint16Array]",Qn="[object Uint32Array]",ea=/\b__p \+= '';/g,ta=/\b(__p \+=) '' \+/g,ra=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ia=/&(?:amp|lt|gt|quot|#39|#96);/g,na=/[&<>"'`]/g,aa=RegExp(ia.source),oa=RegExp(na.source),sa=/<%-([\s\S]+?)%>/g,ca=/<%([\s\S]+?)%>/g,ua=/<%=([\s\S]+?)%>/g,fa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,pa=/^\w*$/,ha=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,la=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,da=RegExp(la.source),ma=/[\u0300-\u036f\ufe20-\ufe23]/g,ga=/\\(\\)?/g,va=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ba=/\w*$/,ya=/^0[xX]/,_a=/^\[object .+?Constructor\]$/,wa=/^\d+$/,ka=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xa=/($^)/,Sa=/['\n\r\u2028\u2029\\]/g,ja=(e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",t="[a-z\\xdf-\\xf6\\xf8-\\xff]+",RegExp(e+"+(?="+e+t+")|"+e+"?"+t+"|"+e+"+|[0-9]+","g")),Ea=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Aa=-1,Ia={};Ia[Vn]=Ia[Gn]=Ia[$n]=Ia[Wn]=Ia[Zn]=Ia[Yn]=Ia[Xn]=Ia[Jn]=Ia[Qn]=!0,Ia[Fn]=Ia[Rn]=Ia[Kn]=Ia[zn]=Ia[Mn]=Ia[Nn]=Ia[Dn]=Ia[r]=Ia[qn]=Ia[Ln]=Ia[Un]=Ia[i]=Ia[Hn]=Ia[n]=!1;var Pa={};Pa[Fn]=Pa[Rn]=Pa[Kn]=Pa[zn]=Pa[Mn]=Pa[Vn]=Pa[Gn]=Pa[$n]=Pa[Wn]=Pa[Zn]=Pa[qn]=Pa[Ln]=Pa[Un]=Pa[Hn]=Pa[Yn]=Pa[Xn]=Pa[Jn]=Pa[Qn]=!0,Pa[Nn]=Pa[Dn]=Pa[r]=Pa[i]=Pa[n]=!1;var a={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},o={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},s={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},c={function:!0,object:!0},u={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},f={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},p=c[void 0===_?"undefined":_typeof(_)]&&_&&!_.nodeType&&_,h=c[void 0===y?"undefined":_typeof(y)]&&y&&!y.nodeType&&y,l=p&&h&&"object"==(void 0===b?"undefined":_typeof(b))&&b&&b.Object&&b,d=c["undefined"==typeof self?"undefined":_typeof(self)]&&self&&self.Object&&self,m=c["undefined"==typeof window?"undefined":_typeof(window)]&&window&&window.Object&&window,g=h&&h.exports===p&&p,Oa=l||m!==(this&&this.window)&&m||d||this;function Ta(e,t){if(e!==t){var r=null===e,i=e===dn,n=e==e,a=null===t,o=t===dn,s=t==t;if(t>>1,$=9007199254740991,W=O&&new O,Z={};function Y(e){if(Ka(e)&&!ui(e)&&!(e instanceof Q)){if(e instanceof J)return e;if(_.call(e,"__chain__")&&_.call(e,"__wrapped__"))return Qt(e)}return new J(e)}function X(){}function J(e,t,r){this.__wrapped__=e,this.__actions__=r||[],this.__chain__=!!t}Y.support={};function Q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function ee(){this.__data__={}}function te(e){var t=e?e.length:0;for(this.data={hash:B(null),set:new j};t--;)this.push(e[t])}function re(e,t){var r=e.data;return("string"==typeof t||li(t)?r.set.has(t):r.hash[t])?0:-1}function ie(e,t){var r=-1,i=e.length;for(t||(t=P(i));++r=Pn?st(t):null,c=t.length;s&&(a=re,o=!1,t=s);e:for(;++n>>0,t>>>=0;for(var a=P(n);++i>>1,o=e[a];(r?o<=t:o=Pn)return n.plant(t).value();for(var r=0,i=a?o[r].apply(this,e):t;++r=An)return e}else Gt=0;return Ue(e,t)});function Zt(e){for(var t=Ri(e),r=t.length,i=r&&e.length,n=!!i&&Ut(i)&&(ui(e)||ci(e)),a=-1,o=[];++a>>0,r>>>=0;r=N(t,r)&&e=(e=Ra(e)).length)return e;var o=i-n.length;if(o<1)return n;var s=e.slice(0,o);if(null==a)return s+n;if(vi(a)){if(e.slice(o).search(a)){var c,u,f=e.slice(0,o);for(a.global||(a=b(a.source,(ba.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(f);)u=c.index;s=s.slice(0,null==u?o:u)}}else if(e.indexOf(a,o)!=o){var p=s.lastIndexOf(a);-1=0.13.7 <0.14.0",_id:"bitcore-lib@0.13.19",_inCache:!0,_installable:!0,_location:"/bitcore-lib",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/bitcore-lib-0.13.19.tgz_1470850061596_0.2146058666985482"},_npmUser:{email:"braydon@bitpay.com",name:"braydonf"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{name:"bitcore-lib",raw:"bitcore-lib@^0.13.7",rawSpec:"^0.13.7",scope:null,spec:">=0.13.7 <0.14.0",type:"range"},_requiredBy:["/","/bitcore-message"],_resolved:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz",_shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",_shrinkwrap:{dependencies:{"bn.js":{from:"bn.js@=2.0.4",resolved:"https://registry.npmjs.org/bn.js/-/bn.js-2.0.4.tgz",version:"2.0.4"},bs58:{from:"bs58@=2.0.0",resolved:"https://registry.npmjs.org/bs58/-/bs58-2.0.0.tgz",version:"2.0.0"},"buffer-compare":{from:"buffer-compare@=1.0.0",resolved:"https://registry.npmjs.org/buffer-compare/-/buffer-compare-1.0.0.tgz",version:"1.0.0"},elliptic:{dependencies:{brorand:{from:"brorand@^1.0.1",resolved:"https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz",version:"1.0.5"},"hash.js":{from:"hash.js@=1.0.3",resolved:"https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz",version:"1.0.3"}},from:"elliptic@=3.0.3",resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",version:"3.0.3"},inherits:{from:"inherits@=2.0.1",resolved:"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",version:"2.0.1"},lodash:{from:"lodash@=3.10.1",resolved:"https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",version:"3.10.1"}},name:"bitcore",version:"0.13.18"},_spec:"bitcore-lib@^0.13.7",_where:"/home/administrator/javascript-opentimestamps",author:{email:"dev@bitpay.com",name:"BitPay"},browser:{request:"browser-request"},bugs:{url:"https://github.com/bitpay/bitcore-lib/issues"},contributors:[{name:"Manuel Araoz",email:"manuelaraoz@gmail.com"},{name:"Daniel Cousens",email:"bitcoin@dcousens.com"},{name:"Gordon Hall",email:"gordon@bitpay.com"},{name:"Jeff Garzik",email:"jgarzik@bitpay.com"},{name:"Kyle Drake",email:"kyle@kyledrake.net"},{name:"Esteban Ordano",email:"eordano@gmail.com"},{name:"Matias Alejo Garcia",email:"ematiu@gmail.com"},{name:"Ryan X. Charles",email:"ryanxcharles@gmail.com"},{name:"Stefan Thomas",email:"moon@justmoon.net"},{name:"Stephen Pair",email:"stephen@bitpay.com"},{name:"Wei Lu",email:"luwei.here@gmail.com"}],dependencies:{"bn.js":"=2.0.4",bs58:"=2.0.0","buffer-compare":"=1.0.0",elliptic:"=3.0.3",inherits:"=2.0.1",lodash:"=3.10.1"},description:"A pure and powerful JavaScript Bitcoin library.",devDependencies:{"bitcore-build":"github:bitpay/bitcore-build",brfs:"^1.2.0",chai:"^1.10.0",gulp:"^3.8.10",sinon:"^1.13.0"},directories:{},dist:{shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",tarball:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz"},gitHead:"9517864f14d09700f3fd02ff61173003c0280774",homepage:"https://github.com/bitpay/bitcore-lib#readme",keywords:["address","bip21","bip32","bip37","bip69","bip70","bitcoin","blockchain","cryptocurrency","ecies","multisig","p2p","payment","transaction"],license:"MIT",main:"index.js",maintainers:[{name:"braydonf",email:"braydon@bitpay.com"},{name:"gabegattis",email:"gabegattis@gmail.com"},{name:"gasteve",email:"stephen@pairhome.net"},{name:"patrickbitpay",email:"patrick@bitpay.com"}],name:"bitcore-lib",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/bitpay/bitcore-lib.git"},scripts:{build:"gulp",coverage:"gulp coverage",lint:"gulp lint",test:"gulp test"},version:"0.13.19"}},{}],151:[function(e,t,r){var i=e("bitcore-lib");i.Message=e("./lib/message"),t.exports=i.Message},{"./lib/message":152,"bitcore-lib":78}],152:[function(r,d,e){(function(o){"use strict";var e=r("bitcore-lib"),s=e.deps._,i=e.PrivateKey,n=e.PublicKey,c=e.Address,a=e.encoding.BufferWriter,u=e.crypto.ECDSA,f=e.crypto.Signature,p=e.crypto.Hash.sha256sha256,t=e.util.js,h=e.util.preconditions,l=function e(t){return this instanceof e?(h.checkArgument(s.isString(t),"First argument should be a string"),this.message=t,this):new e(t)};l.MAGIC_BYTES=new o("Bitcoin Signed Message:\n"),l.prototype.magicHash=function(){var e=a.varintBufNum(l.MAGIC_BYTES.length),t=new o(this.message),r=a.varintBufNum(t.length),i=o.concat([e,l.MAGIC_BYTES,r,t]);return p(i)},l.prototype._sign=function(e){h.checkArgument(e instanceof i,"First argument should be an instance of PrivateKey");var t=this.magicHash(),r=new u;return r.hashbuf=t,r.privkey=e,r.pubkey=e.toPublicKey(),r.signRandomK(),r.calci(),r.sig},l.prototype.sign=function(e){return this._sign(e).toCompact().toString("base64")},l.prototype._verify=function(e,t){h.checkArgument(e instanceof n,"First argument should be an instance of PublicKey"),h.checkArgument(t instanceof f,"Second argument should be an instance of Signature");var r=this.magicHash(),i=u.verify(r,t,e);return i||(this.error="The signature was invalid"),i},l.prototype.verify=function(e,t){h.checkArgument(e),h.checkArgument(t&&s.isString(t)),s.isString(e)&&(e=c.fromString(e));var r=f.fromCompact(new o(t,"base64")),i=new u;i.hashbuf=this.magicHash(),i.sig=r;var n=i.toPublicKey(),a=c.fromPublicKey(n,e.network);return e.toString()!==a.toString()?!(this.error="The signature did not match the message digest"):this._verify(n,r)},l.fromString=function(e){return new l(e)},l.fromJSON=function(e){return t.isValidJSON(e)&&(e=JSON.parse(e)),new l(e.message)},l.prototype.toObject=function(){return{message:this.message}},l.prototype.toJSON=function(){return JSON.stringify(this.toObject())},l.prototype.toString=function(){return this.message},l.prototype.inspect=function(){return""},d.exports=l}).call(this,r("buffer").Buffer)},{"bitcore-lib":78,buffer:191}],153:[function(e,r,i){(function(Q,U,u){!function(e){if("object"==(void 0===i?"undefined":_typeof(i))&&void 0!==r)r.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:void 0!==U?t=U:"undefined"!=typeof self&&(t=self),t.Promise=e()}}(function(){var e,t,r;return function a(o,s,c){function u(r,e){if(!s[r]){if(!o[r]){var t="function"==typeof _dereq_&&_dereq_;if(!e&&t)return t(r,!0);if(f)return f(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[r]={exports:{}};o[r][0].call(n.exports,function(e){var t=o[r][1][e];return u(t||e)},n,n.exports,a,o,s,c)}return s[r].exports}for(var f="function"==typeof _dereq_&&_dereq_,e=0;e, no stack trace)"}function V(){return"function"==typeof Y}var G=function(){return!1},$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function W(e){var t=e.match($);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function Z(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);Y(this,Z),32=a)return r[t]=e,this._queue.push(t),!1;null!==n&&(n[t]=e);var o=this._promise,s=this._callback,c=o._boundValue();o._pushContext();var u=g(s).call(c,e,t,i),f=o._popContext();if(m.checkForgottenReturns(u,f,null!==n?"Promise.filter":"Promise.map",o),u===v)return this._reject(u.e),!0;var p=d(u,this._promise);if(p instanceof l){var h=(p=p._target())._bitField;if(0==(50397184&h))return 1<=a&&this._inFlight++,(r[t]=p)._proxy(this,-1*(t+1)),!1;if(0==(33554432&h))return 0!=(16777216&h)?this._reject(p._reason()):this._cancel(),!0;u=p._value()}r[t]=u}return i<=++this._totalResolved&&(null!==n?this._filter(r,n):this._resolve(r),!0)},f.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;0>>16)){if(e===this){var r=c();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,0<(65535&t)&&(0!=(134217728&t)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},E.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,d.isNode);0<(65535&t)?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},E.prototype._fulfillPromises=function(e,t){for(var r=1;r=this._length&&(this._resolve(this._values),!0)},t.prototype._promiseCancelled=function(){return this._cancel(),!0},t.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},t.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof s)e.cancel();else for(var t=0;t=this._length){var r;if(this._isMap)r=function(e){for(var t=new s,r=e.length/2|0,i=0;i>1},i.prototype.props=function(){return r(this)},i.props=function(e){return r(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function i(e){this._capacity=e,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},n.prototype._promiseFulfilled=function(e,t){var r=new i;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},n.prototype._promiseRejected=function(e,t){var r=new i;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},e.settle=function(e){return r.deprecated(".settle()",".reflect()"),new n(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(f,e,t){"use strict";e.exports=function(e,t,n){var r=f("./util"),i=f("./errors").RangeError,a=f("./errors").AggregateError,o=r.isArray,s={};function c(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function u(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new c(e),i=r.promise();return r.setHowMany(t),r.init(),i}r.inherits(c,t),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=o(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(e){this._howMany=e},c.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(s),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);else if("le"===r)for(n=i=0;i>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-a&4194303,26<=(a+=24)&&(a-=26,i++);r+6!==t&&(n=o(e,t,r+6),this.words[i]|=n<>>26-a&4194303),this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=67108863&o,c=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,p=67108863&c,h=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=h;l++){var d=u-l|0;f+=(o=(n=0|e.words[d])*(a=0|t.words[l])+p)/67108864|0,p=67108863&o}r.words[u]=0|p,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}v.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,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}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)&&2<=e&&e<=36){var c=l[e],u=d[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var p=f.modn(u).toString(e);r=(f=f.idivn(u)).isZero()?p+r:h[c-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.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]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},v.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)},v.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},v.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},v.prototype.inotn=function(e){g("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},v.prototype.notn=function(e){return this.clone().inotn(e)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);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,e):(r=e,this);for(var n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},v.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;i=0>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],d=8191&l,m=l>>>13,g=0|o[2],v=8191&g,b=g>>>13,y=0|o[3],_=8191&y,w=y>>>13,k=0|o[4],x=8191&k,S=k>>>13,j=0|o[5],E=8191&j,A=j>>>13,I=0|o[6],P=8191&I,O=I>>>13,T=0|o[7],B=8191&T,C=T>>>13,F=0|o[8],R=8191&F,z=F>>>13,M=0|o[9],N=8191&M,D=M>>>13,q=0|s[0],L=8191&q,U=q>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],$=8191&G,W=G>>>13,Z=0|s[3],Y=8191&Z,X=Z>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],ae=8191&ne,oe=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],pe=8191&fe,he=fe>>>13,le=0|s[9],de=8191&le,me=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(p,L))|0)+((8191&(n=(n=Math.imul(p,U))+Math.imul(h,L)|0))<<13)|0;u=((a=Math.imul(h,U))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,L),n=(n=Math.imul(d,U))+Math.imul(m,L)|0,a=Math.imul(m,U);var ve=(u+(i=i+Math.imul(p,K)|0)|0)+((8191&(n=(n=n+Math.imul(p,V)|0)+Math.imul(h,K)|0))<<13)|0;u=((a=a+Math.imul(h,V)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(b,L)|0,a=Math.imul(b,U),i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,V)|0;var be=(u+(i=i+Math.imul(p,$)|0)|0)+((8191&(n=(n=n+Math.imul(p,W)|0)+Math.imul(h,$)|0))<<13)|0;u=((a=a+Math.imul(h,W)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(_,L),n=(n=Math.imul(_,U))+Math.imul(w,L)|0,a=Math.imul(w,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,i=i+Math.imul(d,$)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,W)|0;var ye=(u+(i=i+Math.imul(p,Y)|0)|0)+((8191&(n=(n=n+Math.imul(p,X)|0)+Math.imul(h,Y)|0))<<13)|0;u=((a=a+Math.imul(h,X)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(x,L),n=(n=Math.imul(x,U))+Math.imul(S,L)|0,a=Math.imul(S,U),i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,W)|0,i=i+Math.imul(d,Y)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,X)|0;var _e=(u+(i=i+Math.imul(p,Q)|0)|0)+((8191&(n=(n=n+Math.imul(p,ee)|0)+Math.imul(h,Q)|0))<<13)|0;u=((a=a+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(A,L)|0,a=Math.imul(A,U),i=i+Math.imul(x,K)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,V)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,W)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(b,Y)|0,a=a+Math.imul(b,X)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0;var we=(u+(i=i+Math.imul(p,re)|0)|0)+((8191&(n=(n=n+Math.imul(p,ie)|0)+Math.imul(h,re)|0))<<13)|0;u=((a=a+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(O,L)|0,a=Math.imul(O,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,V)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,W)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,X)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0;var ke=(u+(i=i+Math.imul(p,ae)|0)|0)+((8191&(n=(n=n+Math.imul(p,oe)|0)+Math.imul(h,ae)|0))<<13)|0;u=((a=a+Math.imul(h,oe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(C,L)|0,a=Math.imul(C,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(O,K)|0,a=a+Math.imul(O,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,W)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(S,Y)|0,a=a+Math.imul(S,X)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ie)|0,i=i+Math.imul(d,ae)|0,n=(n=n+Math.imul(d,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var xe=(u+(i=i+Math.imul(p,ce)|0)|0)+((8191&(n=(n=n+Math.imul(p,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((a=a+Math.imul(h,ue)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(R,L),n=(n=Math.imul(R,U))+Math.imul(z,L)|0,a=Math.imul(z,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,W)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ie)|0,i=i+Math.imul(v,ae)|0,n=(n=n+Math.imul(v,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,i=i+Math.imul(d,ce)|0,n=(n=n+Math.imul(d,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0;var Se=(u+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,he)|0)+Math.imul(h,pe)|0))<<13)|0;u=((a=a+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,U))+Math.imul(D,L)|0,a=Math.imul(D,U),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(z,K)|0,a=a+Math.imul(z,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,W)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,Y)|0,a=a+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ie)|0,i=i+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,i=i+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,ue)|0,i=i+Math.imul(d,pe)|0,n=(n=n+Math.imul(d,he)|0)+Math.imul(m,pe)|0,a=a+Math.imul(m,he)|0;var je=(u+(i=i+Math.imul(p,de)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(h,de)|0))<<13)|0;u=((a=a+Math.imul(h,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(N,K),n=(n=Math.imul(N,V))+Math.imul(D,K)|0,a=Math.imul(D,V),i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,W)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,W)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(C,Y)|0,a=a+Math.imul(C,X)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ie)|0,i=i+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,ue)|0,i=i+Math.imul(v,pe)|0,n=(n=n+Math.imul(v,he)|0)+Math.imul(b,pe)|0,a=a+Math.imul(b,he)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;u=((a=a+Math.imul(m,me)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(N,$),n=(n=Math.imul(N,W))+Math.imul(D,$)|0,a=Math.imul(D,W),i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,X)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ie)|0,i=i+Math.imul(E,ae)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,i=i+Math.imul(x,ce)|0,n=(n=n+Math.imul(x,ue)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,ue)|0,i=i+Math.imul(_,pe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,pe)|0,a=a+Math.imul(w,he)|0;var Ae=(u+(i=i+Math.imul(v,de)|0)|0)+((8191&(n=(n=n+Math.imul(v,me)|0)+Math.imul(b,de)|0))<<13)|0;u=((a=a+Math.imul(b,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(N,Y),n=(n=Math.imul(N,X))+Math.imul(D,Y)|0,a=Math.imul(D,X),i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ie)|0,i=i+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,i=i+Math.imul(x,pe)|0,n=(n=n+Math.imul(x,he)|0)+Math.imul(S,pe)|0,a=a+Math.imul(S,he)|0;var Ie=(u+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,me)|0)+Math.imul(w,de)|0))<<13)|0;u=((a=a+Math.imul(w,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(N,Q),n=(n=Math.imul(N,ee))+Math.imul(D,Q)|0,a=Math.imul(D,ee),i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ie)|0,i=i+Math.imul(B,ae)|0,n=(n=n+Math.imul(B,oe)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,ue)|0,i=i+Math.imul(E,pe)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(A,pe)|0,a=a+Math.imul(A,he)|0;var Pe=(u+(i=i+Math.imul(x,de)|0)|0)+((8191&(n=(n=n+Math.imul(x,me)|0)+Math.imul(S,de)|0))<<13)|0;u=((a=a+Math.imul(S,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(N,re),n=(n=Math.imul(N,ie))+Math.imul(D,re)|0,a=Math.imul(D,ie),i=i+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,i=i+Math.imul(B,ce)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,ue)|0,i=i+Math.imul(P,pe)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(O,pe)|0,a=a+Math.imul(O,he)|0;var Oe=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(A,de)|0))<<13)|0;u=((a=a+Math.imul(A,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(N,ae),n=(n=Math.imul(N,oe))+Math.imul(D,ae)|0,a=Math.imul(D,oe),i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(z,ce)|0,a=a+Math.imul(z,ue)|0,i=i+Math.imul(B,pe)|0,n=(n=n+Math.imul(B,he)|0)+Math.imul(C,pe)|0,a=a+Math.imul(C,he)|0;var Te=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(O,de)|0))<<13)|0;u=((a=a+Math.imul(O,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(N,ce),n=(n=Math.imul(N,ue))+Math.imul(D,ce)|0,a=Math.imul(D,ue),i=i+Math.imul(R,pe)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(z,pe)|0,a=a+Math.imul(z,he)|0;var Be=(u+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,me)|0)+Math.imul(C,de)|0))<<13)|0;u=((a=a+Math.imul(C,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(N,pe),n=(n=Math.imul(N,he))+Math.imul(D,pe)|0,a=Math.imul(D,he);var Ce=(u+(i=i+Math.imul(R,de)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(z,de)|0))<<13)|0;u=((a=a+Math.imul(z,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Fe=(u+(i=Math.imul(N,de))|0)+((8191&(n=(n=Math.imul(N,me))+Math.imul(D,de)|0))<<13)|0;return u=((a=Math.imul(D,me))+(n>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,c[0]=ge,c[1]=ve,c[2]=be,c[3]=ye,c[4]=_e,c[5]=we,c[6]=ke,c[7]=xe,c[8]=Se,c[9]=je,c[10]=Ee,c[11]=Ae,c[12]=Ie,c[13]=Pe,c[14]=Oe,c[15]=Te,c[16]=Be,c[17]=Ce,c[18]=Fe,0!==u&&(c[19]=u,r.length++),r};function s(e,t,r){return(new c).mulp(e,t,r)}function c(e,t){this.x=e,this.y=t}Math.imul||(a=n),v.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?a(this,e,t):r<63?n(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,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},c.prototype.makeRBT=function(e){for(var t=new Array(e),r=v.prototype._countBits(e)-1,i=0;i>=1;return i},c.prototype.permute=function(e,t,r,i,n,a){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*a+1]=8191&n,n>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.muln=function(e){return this.clone().imuln(e)},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.imul(this.clone())},v.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 v(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<a)for(this.length-=a,c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},v.prototype.ishrn=function(e,t,r){return g(0===this.negative),this.iushrn(e,t,r)},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.ushln=function(e){return this.clone().iushln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.ushrn=function(e){return this.clone().iushrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===o)return this.strip();for(g(-1===o),i=o=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,a},v.prototype.div=function(e){return this.divmod(e,"div",!1).div},v.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},v.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},v.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),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(0===e.negative),g(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var c=r.clone(),u=t.clone();!t.isZero();){for(var f=0,p=1;0==(t.words[0]&p)&&f<26;++f,p<<=1);if(0>>26,o&=67108863,this.words[a]=o}return 0!==n&&(this.words[a]=n,this.length++),this},v.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},v.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(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(u[e])return u[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new b;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return u[e]=t},w.prototype._verify1=function(e){g(0===e.negative,"red works only with positives"),g(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){g(0==(e.negative|t.negative),"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},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 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&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();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);g(!i.isZero());var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==a?(a<<=1,a|=f,(4===++o||0===i&&0===u)&&(n=this.mul(n,r[a]),a=o=0)):o=0}s=26}return n},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},v.mont=function(e){return new k(e)},r(k,w),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.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),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new v(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:157}],155:[function(e,t,r){var A=e("concat-map"),I=e("balanced-match");t.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function t(e,r){var i=[];var n=I("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var s=a||o;var c=0<=n.body.indexOf(",");if(!s&&!c)return n.post.match(/,.*\}/)?(e=n.pre+"{"+n.body+P+n.post,t(e)):[e];var u;if(s)u=n.body.split(/\.\./);else if(1===(u=T(n.body)).length&&1===(u=t(u[0],!1).map(B)).length){var f=n.post.length?t(n.post,!1):[""];return f.map(function(e){return n.pre+u[0]+e})}var p=n.pre;var f=n.post.length?t(n.post,!1):[""];var h;if(s){var l=O(u[0]),d=O(u[1]),m=Math.max(u[0].length,u[1].length),g=3==u.length?Math.abs(O(u[2])):1,v=F,b=d>>24]^f[d>>>16&255]^p[m>>>8&255]^h[255&g]^t[v++],o=u[d>>>24]^f[m>>>16&255]^p[g>>>8&255]^h[255&l]^t[v++],s=u[m>>>24]^f[g>>>16&255]^p[l>>>8&255]^h[255&d]^t[v++],c=u[g>>>24]^f[l>>>16&255]^p[d>>>8&255]^h[255&m]^t[v++],l=a,d=o,m=s,g=c;return a=(i[l>>>24]<<24|i[d>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[v++],o=(i[d>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&l])^t[v++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[l>>>8&255]<<8|i[255&d])^t[v++],c=(i[g>>>24]<<24|i[l>>>16&255]<<16|i[d>>>8&255]<<8|i[255&m])^t[v++],[a>>>=0,o>>>=0,s>>>=0,c>>>=0]}var p=[0,1,2,4,8,16,32,64,128,27,54],h=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=[[],[],[],[]],a=[[],[],[],[]],o=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;var f=e[i[r[o]=u]=o],p=e[f],h=e[p],l=257*e[u]^16843008*u;n[0][o]=l<<24|l>>>8,n[1][o]=l<<16|l>>>16,n[2][o]=l<<8|l>>>24,n[3][o]=l,l=16843009*h^65537*p^257*f^16843008*o,a[0][u]=l<<24|l>>>8,a[1][u]=l<<16|l>>>16,a[2][u]=l<<8|l>>>24,a[3][u]=l,0===o?o=s=1:(o=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();function s(e){this._key=a(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],a=0;a>>24,o=h.SBOX[o>>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o],o^=p[a/t|0]<<24):6>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o]),n[a]=n[a-t]^o}for(var s=[],c=0;c>>24]]^h.INV_SUB_MIX[1][h.SBOX[f>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[f>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return o(e=a(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=a(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":447}],159:[function(e,t,r){var o=e("./aes"),u=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),f=e("./ghash"),n=e("buffer-xor"),p=e("./incr32");function a(e,t,r,i){s.call(this);var n=u.alloc(4,0);this._cipher=new o.AES(t);var a=this._cipher.encryptBlock(n);this._ghash=new f(a),r=function(e,t,r){if(12===t.length)return e._finID=u.concat([t,u.from([0,0,0,1])]),u.concat([t,u.from([0,0,0,2])]);var i=new f(r),n=t.length,a=n%16;i.update(t),a&&(a=16-a,i.update(u.alloc(a,0))),i.update(u.alloc(8,0));var o=8*n,s=u.alloc(8);s.writeUIntBE(o,0,8),i.update(s),e._finID=i.state;var c=u.from(e._finID);return p(c),c}(this,r,a),this._prev=u.from(r),this._cache=u.allocUnsafe(0),this._secCache=u.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(a,s),a.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=u.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},a.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(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;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":447}],164:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],165:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":190}],166:[function(e,t,r){var a=e("safe-buffer").Buffer,o=e("buffer-xor");function s(e,t,r){var i=t.length,n=o(t,e._cache);return e._cache=e._cache.slice(i),e._prev=a.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=a.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=a.allocUnsafe(0)),!(e._cache.length<=t.length)){n=a.concat([n,s(e,t,r)]);break}i=e._cache.length,n=a.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":190,"safe-buffer":447}],167:[function(e,t,r){var o=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,a=-1,o=0;++a<8;)i=t&1<<7-a?128:0,o+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>a%8,e._prev=c(e._prev,r?i:n);return o}function c(e,t){var r=e.length,i=-1,n=o.allocUnsafe(e.length);for(e=o.concat([e,o.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=o.allocUnsafe(i),a=-1;++a=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var a=m(r);if("ec"===a.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=g[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new d(i),a=r.data.subjectPrivateKey.data;return n.verify(t,e,a)}(e,t,a)}if("dsa"===a.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,a=r.data.g,o=r.data.pub_key,s=m.signature.decode(e,"der"),c=s.s,u=s.r;v(c,n),v(u,n);var f=l.mont(i),p=c.invm(n);return 0===a.toRed(f).redPow(new l(t).mul(p).mod(n)).fromRed().mul(o.toRed(f).redPow(u.mul(p).mod(n)).fromRed()).mod(i).mod(n).cmp(u)}(e,t,a)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var o=a.modulus.byteLength(),s=[1],c=0;t.length+s.length+2l.UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function h(e,t){for(var r=0;rm.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsm.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelm.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelm.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=m.Z_FILTERED&&e.strategy!=m.Z_HUFFMAN_ONLY&&e.strategy!=m.Z_RLE&&e.strategy!=m.Z_FIXED&&e.strategy!=m.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!g.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new o.Zlib(t);var i=this;this._hadError=!1,this._binding.onerror=function(e,t){i._binding=null,i._hadError=!0;var r=new Error(e);r.errno=t,r.code=m.codes[t],i.emit("error",r)};var r=m.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(r=e.level);var n=m.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(n=e.strategy),this._binding.init(e.windowBits||m.Z_DEFAULT_WINDOWBITS,r,e.memLevel||m.Z_DEFAULT_MEMLEVEL,n,e.dictionary),this._buffer=new g(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=n,this.once("end",this.close)}o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION,Object.keys(o).forEach(function(e){e.match(/^Z/)&&(m[e]=o[e])}),m.codes={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},Object.keys(m.codes).forEach(function(e){m.codes[m.codes[e]]=e}),m.Deflate=s,m.Inflate=c,m.Gzip=u,m.Gunzip=f,m.DeflateRaw=p,m.InflateRaw=h,m.Unzip=l,m.createDeflate=function(e){return new s(e)},m.createInflate=function(e){return new c(e)},m.createDeflateRaw=function(e){return new p(e)},m.createInflateRaw=function(e){return new h(e)},m.createGzip=function(e){return new u(e)},m.createGunzip=function(e){return new f(e)},m.createUnzip=function(e){return new l(e)},m.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new s(t),e,r)},m.deflateSync=function(e,t){return r(new s(t),e)},m.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new u(t),e,r)},m.gzipSync=function(e,t){return r(new u(t),e)},m.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new p(t),e,r)},m.deflateRawSync=function(e,t){return r(new p(t),e)},m.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new l(t),e,r)},m.unzipSync=function(e,t){return r(new l(t),e)},m.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new c(t),e,r)},m.inflateSync=function(e,t){return r(new c(t),e)},m.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new f(t),e,r)},m.gunzipSync=function(e,t){return r(new f(t),e)},m.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new h(t),e,r)},m.inflateRawSync=function(e,t){return r(new h(t),e)},e.inherits(t,a),t.prototype.params=function(e,t,r){if(em.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=m.Z_FILTERED&&t!=m.Z_HUFFMAN_ONLY&&t!=m.Z_RLE&&t!=m.Z_FIXED&&t!=m.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var i=this;this.flush(o.Z_SYNC_FLUSH,function(){i._binding.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())})}else n.nextTick(r)},t.prototype.reset=function(){return this._binding.reset()},t.prototype._flush=function(e){this._transform(new g(0),"",e)},t.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=o.Z_FULL_FLUSH),r.ended)t&&n.nextTick(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var i=this;this.once("drain",function(){i.flush(t)})}else this._flushFlag=e,this.write(new g(0),"",t)},t.prototype.close=function(e){if(e&&n.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;n.nextTick(function(){t.emit("close")})}},t.prototype._transform=function(e,t,r){var i,n=this._writableState,a=(n.ending||n.ended)&&(!e||n.length===e.length);if(null===!e&&!g.isBuffer(e))return r(new Error("invalid input"));a?i=o.Z_FINISH:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH));this._processChunk(e,i,r)},t.prototype._processChunk=function(a,o,s){var c=a&&a.length,u=this._chunkSize-this._offset,f=0,p=this,h="function"==typeof s;if(!h){var t,l=[],d=0;this.on("error",function(e){t=e});do{var e=this._binding.writeSync(o,a,f,c,this._buffer,this._offset,u)}while(!this._hadError&&m(e[0],e[1]));if(this._hadError)throw t;var r=g.concat(l,d);return this.close(),r}var i=this._binding.write(o,a,f,c,this._buffer,this._offset,u);function m(e,t){if(!p._hadError){var r=u-t;if(v(0<=r,"have should not go down"),0=p._chunkSize)&&(u=p._chunkSize,p._offset=0,p._buffer=new g(p._chunkSize)),0===t){if(f+=c-e,c=e,!h)return!0;var n=p._binding.write(o,a,f,c,p._buffer,p._offset,p._chunkSize);return n.callback=m,void(n.buffer=a)}if(!h)return!1;s()}}i.buffer=a,i.callback=m},e.inherits(s,t),e.inherits(c,t),e.inherits(u,t),e.inherits(f,t),e.inherits(p,t),e.inherits(h,t),e.inherits(l,t)}).call(this,d("_process"),d("buffer").Buffer)},{"./binding":185,_process:382,_stream_transform:427,assert:67,buffer:191,util:505}],187:[function(e,t,r){arguments[4][157][0].apply(r,arguments)},{dup:157}],188:[function(e,B,C){(function(T){!function(e){var t="object"==(void 0===C?"undefined":_typeof(C))&&C&&!C.nodeType&&C,r="object"==(void 0===B?"undefined":_typeof(B))&&B&&!B.nodeType&&B,i="object"==(void 0===T?"undefined":_typeof(T))&&T;i.global!==i&&i.window!==i&&i.self!==i||(e=i);var n,a,v=2147483647,b=36,y=1,_=26,o=38,s=700,w=72,k=128,x="-",c=/^xn--/,u=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=b-y,S=Math.floor,j=String.fromCharCode;function E(e){throw new RangeError(p[e])}function l(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function d(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((v-d)/o))&&E("overflow"),d+=c*o,!(c<(u=s<=g?y:g+_<=s?_:s-g));s+=b)o>S(v/(f=b-u))&&E("overflow"),o*=f;g=O(d-a,t=h.length+1,0==a),S(d/t)>v-m&&E("overflow"),m+=S(d/t),d%=t,h.splice(d++,0,m)}return I(h)}function g(e){var t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g=[];for(h=(e=A(e)).length,t=k,a=w,o=r=0;oS((v-r)/(l=i+1))&&E("overflow"),r+=(s-t)*l,t=s,o=0;ov&&E("overflow"),p==t){for(c=r,u=b;!(c<(f=u<=a?y:a+_<=u?_:u-a));u+=b)m=c-f,d=b-f,g.push(j(P(f+m%d,0))),c=S(m/d);g.push(j(P(c,0))),a=O(r,l,i==n),r=0,++i}++r,++t}return g.join("")}if(n={version:"1.4.1",ucs2:{decode:A,encode:I},decode:m,encode:g,toASCII:function(e){return d(e,function(e){return u.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return d(e,function(e){return c.test(e)?m(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",function(){return n});else if(t&&r)if(B.exports==t)r.exports=n;else for(a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],189:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var a=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=c;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function c(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}a.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},a.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:191}],190:[function(e,t,r){(function(a){t.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new a(r),n=0;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function l(e,t){if(p.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return R(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=p.from(t,i)),p.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,n);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,n){var a,o=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;s/=o=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var f=-1;for(a=r;a>>10&1023|55296),f=56320|1023&f),i.push(f),n+=p}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;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 S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===p.compare(this,e)},p.prototype.inspect=function(){var e="",t=N.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,i,n){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(i,n),u=e.slice(t,r),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a,o,s,c,u,f,p,h,l,d=!1;;)switch(i){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return h=t,l=r,M(R(e,(p=this).length-h),p,h,l);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return c=this,u=t,f=r,M(z(e),c,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=t,s=r,M(function(e,t){for(var r,i,n,a=[],o=0;o>8,n=r%256,a.push(n),a.push(i);return a}(e,(a=this).length-o),a,o,s);default:if(d)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function k(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function I(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function P(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function O(e,t,r,i,n,a){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(e,t,r,i,n){return n||O(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function B(e,t,r,i,n){return n||O(e,0,r,8),a.write(e,t,r,i,52,8),r+8}p.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):I(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;0<=--a&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function z(e){return i.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function M(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":75,ieee754:318,isarray:323}],192:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],193:[function(e,t,r){function n(e){this.dict=e||{}}n.prototype.set=function(e,t,r){if("object"!==(void 0===e?"undefined":_typeof(e))){void 0===r&&(r=!0);var i=this.has(e);return!r&&i?this.dict[i]=this.dict[i]+","+t:this.dict[i||e]=t,i}for(var n in e)this.set(n,e[n],t)},n.prototype.has=function(e){for(var t=Object.keys(this.dict),r=(e=e.toLowerCase(),0);rr)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>8^255&n^99,u[r]=n;var a=e[f[n]=r],o=e[a],s=e[o],c=257*e[n]^16843008*n;p[r]=c<<24|c>>>8,h[r]=c<<16|c>>>16,l[r]=c<<8|c>>>24,d[r]=c;c=16843009*s^65537*o^257*a^16843008*r;m[n]=c<<24|c>>>8,g[n]=c<<16|c>>>16,v[n]=c<<8|c>>>24,b[n]=c,r?(r=a^e[e[e[s^a]]],i^=e[e[i]]):r=i=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],i=r.AES=t.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),n=this._keySchedule=[],a=0;a>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o]):(o=u[(o=o<<8|o>>>24)>>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o],o^=y[a/r|0]<<24),n[a]=n[a-r]^o}for(var s=this._invKeySchedule=[],c=0;c>>24]]^g[u[o>>>16&255]]^v[u[o>>>8&255]]^b[u[255&o]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,p,h,l,d,u)},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,m,g,v,b,f);r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,a,o,s){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],p=e[t+2]^r[2],h=e[t+3]^r[3],l=4,d=1;d>>24]^n[f>>>16&255]^a[p>>>8&255]^o[255&h]^r[l++],g=i[f>>>24]^n[p>>>16&255]^a[h>>>8&255]^o[255&u]^r[l++],v=i[p>>>24]^n[h>>>16&255]^a[u>>>8&255]^o[255&f]^r[l++],b=i[h>>>24]^n[u>>>16&255]^a[f>>>8&255]^o[255&p]^r[l++];u=m,f=g,p=v,h=b}m=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&h])^r[l++],g=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[h>>>8&255]<<8|s[255&u])^r[l++],v=(s[p>>>24]<<24|s[h>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^r[l++],b=(s[h>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^r[l++];e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=b},keySize:8});e.AES=t._createHelper(i)}(),n.AES},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],206:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,c,n,a,o,s,u,f,p,h,l,d,m,g,v,b;e.lib.Cipher||(r=(t=e).lib,i=r.Base,c=r.WordArray,n=r.BufferedBlockAlgorithm,(a=t.enc).Utf8,o=a.Base64,s=t.algo.EvpKDF,u=r.Cipher=n.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function n(e){return"string"==typeof e?b:g}return function(i){return{encrypt:function(e,t,r){return n(t).encrypt(i,e,t,r)},decrypt:function(e,t,r){return n(t).decrypt(i,e,t,r)}}}}()}),r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),f=t.mode={},p=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var e=p.extend();function a(e,t,r){var i=this._iv;if(i){var n=i;this._iv=void 0}else n=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:l}),reset:function(){u.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else{i=r.createDecryptor;this._minBufferSize=1}this._mode=i.call(r,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),d=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var i=c.create([1398893684,1701076831]).concat(r).concat(t);else i=t;return i.toString(o)},parse:function(e){var t=o.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var i=c.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return d.create({ciphertext:t,salt:i})}},g=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),a=n.finalize(t),o=n.cfg;return d.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.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}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=c.random(8));var n=s.create({keySize:t+r}).compute(e,i),a=c.create(n.words.slice(t),4*r);return n.sigBytes=4*t,d.create({key:n,iv:a,salt:i})}},b=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),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 a=g.encrypt.call(this,e,t,n.key,i);return a.mixIn(n),a},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,g.decrypt.call(this,e,t,n.key,i)}}))},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],207:[function(e,t,r){var i,n;i=this,n=function(){var f,r,e,t,i,p,n,a,o,s,c,u,h=h||(f=Math,r=Object.create||function(){function r(){}return function(e){var t;return r.prototype=e,t=new r,r.prototype=null,t}}(),t=(e={}).lib={},i=t.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$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)}},p=t.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).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 a=0;a>>2]>>>24-a%4*8&255;t[i+a>>>2]|=o<<24-(i+a)%4*8}else for(a=0;a>>2]=r[a>>>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=f.ceil(t/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,r=[],i=function(t){t=t;var r=987654321,i=4294967295;return function(){var e=((r=36969*(65535&r)+(r>>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return e/=4294967296,(e+=.5)*(.5>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).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 p.init(r,t/2)}},o=n.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(a))}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 p.init(r,t)}},s=n.Utf8={stringify:function(e){try{return decodeURIComponent(escape(o.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return o.parse(unescape(encodeURIComponent(e)))}},c=t.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=s.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,n=this.blockSize,a=i/(4*n),o=(a=e?f.ceil(a):f.max((0|a)-this._minBufferSize,0))*n,s=f.min(4*o,i);if(o){for(var c=0;c>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.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,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var n=0;n>>6-a%4*2;i[n>>>2]|=(o|s)<<24-n%4*8,n++}return c.create(i,n)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],209:[function(e,t,r){var i,n;i=this,n=function(r){return function(){var e=r,n=e.lib.WordArray,t=e.enc;t.Utf16=t.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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}};function o(e){return e<<8&4278255360|e>>>8&16711935}t.Utf16LE={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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return n.create(r,2*t)}}}(),r.enc.Utf16},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],210:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,f,n,a,o;return r=(t=e).lib,i=r.Base,f=r.WordArray,n=t.algo,a=n.MD5,o=n.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=r.hasher.create(),n=f.create(),a=n.words,o=r.keySize,s=r.iterations;a.lengthi&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),a=this._iKey=t.clone(),o=n.words,s=a.words,c=0;c>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)}).prototype=e}}(),t.lib.WordArray},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],215:[function(e,t,r){var i,n;i=this,n=function(o){return function(f){var e=o,t=e.lib,r=t.WordArray,i=t.Hasher,n=e.algo,E=[];!function(){for(var e=0;e<64;e++)E[e]=4294967296*f.abs(f.sin(e+1))|0}();var a=n.MD5=i.extend({_doReset:function(){this._hash=new r.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 a=this._hash.words,o=e[t+0],s=e[t+1],c=e[t+2],u=e[t+3],f=e[t+4],p=e[t+5],h=e[t+6],l=e[t+7],d=e[t+8],m=e[t+9],g=e[t+10],v=e[t+11],b=e[t+12],y=e[t+13],_=e[t+14],w=e[t+15],k=a[0],x=a[1],S=a[2],j=a[3];x=O(x=O(x=O(x=O(x=P(x=P(x=P(x=P(x=I(x=I(x=I(x=I(x=A(x=A(x=A(x=A(x,S=A(S,j=A(j,k=A(k,x,S,j,o,7,E[0]),x,S,s,12,E[1]),k,x,c,17,E[2]),j,k,u,22,E[3]),S=A(S,j=A(j,k=A(k,x,S,j,f,7,E[4]),x,S,p,12,E[5]),k,x,h,17,E[6]),j,k,l,22,E[7]),S=A(S,j=A(j,k=A(k,x,S,j,d,7,E[8]),x,S,m,12,E[9]),k,x,g,17,E[10]),j,k,v,22,E[11]),S=A(S,j=A(j,k=A(k,x,S,j,b,7,E[12]),x,S,y,12,E[13]),k,x,_,17,E[14]),j,k,w,22,E[15]),S=I(S,j=I(j,k=I(k,x,S,j,s,5,E[16]),x,S,h,9,E[17]),k,x,v,14,E[18]),j,k,o,20,E[19]),S=I(S,j=I(j,k=I(k,x,S,j,p,5,E[20]),x,S,g,9,E[21]),k,x,w,14,E[22]),j,k,f,20,E[23]),S=I(S,j=I(j,k=I(k,x,S,j,m,5,E[24]),x,S,_,9,E[25]),k,x,u,14,E[26]),j,k,d,20,E[27]),S=I(S,j=I(j,k=I(k,x,S,j,y,5,E[28]),x,S,c,9,E[29]),k,x,l,14,E[30]),j,k,b,20,E[31]),S=P(S,j=P(j,k=P(k,x,S,j,p,4,E[32]),x,S,d,11,E[33]),k,x,v,16,E[34]),j,k,_,23,E[35]),S=P(S,j=P(j,k=P(k,x,S,j,s,4,E[36]),x,S,f,11,E[37]),k,x,l,16,E[38]),j,k,g,23,E[39]),S=P(S,j=P(j,k=P(k,x,S,j,y,4,E[40]),x,S,o,11,E[41]),k,x,u,16,E[42]),j,k,h,23,E[43]),S=P(S,j=P(j,k=P(k,x,S,j,m,4,E[44]),x,S,b,11,E[45]),k,x,w,16,E[46]),j,k,c,23,E[47]),S=O(S,j=O(j,k=O(k,x,S,j,o,6,E[48]),x,S,l,10,E[49]),k,x,_,15,E[50]),j,k,p,21,E[51]),S=O(S,j=O(j,k=O(k,x,S,j,b,6,E[52]),x,S,u,10,E[53]),k,x,g,15,E[54]),j,k,s,21,E[55]),S=O(S,j=O(j,k=O(k,x,S,j,d,6,E[56]),x,S,w,10,E[57]),k,x,h,15,E[58]),j,k,y,21,E[59]),S=O(S,j=O(j,k=O(k,x,S,j,f,6,E[60]),x,S,v,10,E[61]),k,x,c,15,E[62]),j,k,m,21,E[63]),a[0]=a[0]+k|0,a[1]=a[1]+x|0,a[2]=a[2]+S|0,a[3]=a[3]+j|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var n=f.floor(r/4294967296),a=r;t[15+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,s=o.words,c=0;c<4;c++){var u=s[c];s[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function A(e,t,r,i,n,a,o){var s=e+(t&r|~t&i)+n+o;return(s<>>32-a)+t}function I(e,t,r,i,n,a,o){var s=e+(t&i|r&~i)+n+o;return(s<>>32-a)+t}function P(e,t,r,i,n,a,o){var s=e+(t^r^i)+n+o;return(s<>>32-a)+t}function O(e,t,r,i,n,a,o){var s=e+(r^(t|~i))+n+o;return(s<>>32-a)+t}e.MD5=i._createHelper(a),e.HmacMD5=i._createHmacHelper(a)}(Math),o.MD5},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],216:[function(e,t,r){var i,n;i=this,n=function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function a(e,t,r,i){var n=this._iv;if(n){var a=n.slice(0);this._iv=void 0}else a=this._prevBlock;i.encryptBlock(a,0);for(var o=0;o>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 t=e.Encryptor=e.extend({processBlock:function(e,t){var r,i=this._cipher,n=i.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),0===((r=o)[0]=u(r[0]))&&(r[1]=u(r[1]));var s=o.slice(0);i.encryptBlock(s,0);for(var c=0;c>>2]|=n<<24-a%4*8,e.sigBytes+=n},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],222:[function(e,t,r){var i,n;i=this,n=function(n){return n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],223:[function(e,t,r){var i,n;i=this,n=function(r){return r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],224:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],225:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],226:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,v,n,a,b,o;return r=(t=e).lib,i=r.Base,v=r.WordArray,n=t.algo,a=n.SHA1,b=n.HMAC,o=n.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=b.create(r.hasher,e),n=v.create(),a=v.create([1]),o=n.words,s=a.words,c=r.keySize,u=r.iterations;o.length>>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]],n=this._b=0;n<4;n++)h.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;i[0]^=c,i[1]^=f,i[2]^=u,i[3]^=p,i[4]^=c,i[5]^=f,i[6]^=u,i[7]^=p;for(n=0;n<4;n++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.RabbitLegacy=t._createHelper(i)}(),a.RabbitLegacy},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],228:[function(e,t,r){var i,n;i=this,n=function(a){return function(){var e=a,t=e.lib.StreamCipher,r=e.algo,n=[],c=[],u=[],i=r.Rabbit=t.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(r=this._b=0;r<4;r++)h.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;n[0]^=c,n[1]^=f,n[2]^=u,n[3]^=p,n[4]^=c,n[5]^=f,n[6]^=u,n[7]^=p;for(r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.Rabbit=t._createHelper(i)}(),a.Rabbit},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],229:[function(e,t,r){var i,n;i=this,n=function(o){return function(){var e=o,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.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 a=0;n<256;n++){var o=n%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+i[n]+s)%256;var c=i[n];i[n]=i[a],i[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=n.call(this)},keySize:8,ivSize:0});function n(){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 a=e[t];e[t]=e[r],e[r]=a,i|=e[(e[t]+e[r])%256]<<24-8*n}return this._i=t,this._j=r,i}e.RC4=t._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;0>>24)|4278255360&(n<<24|n>>>8)}var a,o,s,c,u,f,p,h,l,d,m,g=this._hash.words,v=A.words,b=I.words,y=x.words,_=S.words,w=j.words,k=E.words;f=a=g[0],p=o=g[1],h=s=g[2],l=c=g[3],d=u=g[4];for(r=0;r<80;r+=1)m=a+e[t+y[r]]|0,m+=r<16?P(o,s,c)+v[0]:r<32?O(o,s,c)+v[1]:r<48?T(o,s,c)+v[2]:r<64?B(o,s,c)+v[3]:C(o,s,c)+v[4],m=(m=F(m|=0,w[r]))+u|0,a=u,u=c,c=F(s,10),s=o,o=m,m=f+e[t+_[r]]|0,m+=r<16?C(p,h,l)+b[0]:r<32?B(p,h,l)+b[1]:r<48?T(p,h,l)+b[2]:r<64?O(p,h,l)+b[3]:P(p,h,l)+b[4],m=(m=F(m|=0,k[r]))+d|0,f=d,d=l,l=F(h,10),h=p,p=m;m=g[1]+s+l|0,g[1]=g[2]+c+d|0,g[2]=g[3]+u+f|0,g[3]=g[4]+a+p|0,g[4]=g[0]+o+h|0,g[0]=m},_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,a=n.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function P(e,t,r){return e^t^r}function O(e,t,r){return e&t|~e&r}function T(e,t,r){return(e|~t)^r}function B(e,t,r){return e&r|t&~r}function C(e,t,r){return e^(t|~r)}function F(e,t){return e<>>32-t}t.RIPEMD160=n._createHelper(o),t.HmacRIPEMD160=n._createHmacHelper(o)}(Math),s.RIPEMD160},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],231:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,p,o;return r=(t=e).lib,i=r.WordArray,n=r.Hasher,a=t.algo,p=[],o=a.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],a=r[2],o=r[3],s=r[4],c=0;c<80;c++){if(c<16)p[c]=0|e[t+c];else{var u=p[c-3]^p[c-8]^p[c-14]^p[c-16];p[c]=u<<1|u>>>31}var f=(i<<5|i>>>27)+s+p[c];f+=c<20?1518500249+(n&a|~n&o):c<40?1859775393+(n^a^o):c<60?(n&a|n&o|a&o)-1894007588:(n^a^o)-899497514,s=o,o=a,a=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|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(o),t.HmacSHA1=n._createHmacHelper(o),e.SHA1},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],232:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a;return r=(t=e).lib.WordArray,i=t.algo,n=i.SHA256,a=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(a),t.HmacSHA224=n._createHmacHelper(a),e.SHA224},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],n):n(i.CryptoJS)},{"./core":207,"./sha256":233}],233:[function(e,t,r){var i,n;i=this,n=function(c){return function(n){var e=c,t=e.lib,r=t.WordArray,i=t.Hasher,a=e.algo,o=[],y=[];!function(){function e(e){for(var t=n.sqrt(e),r=2;r<=t;r++)if(!(e%r))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(o[i]=t(n.pow(r,.5))),y[i]=t(n.pow(r,1/3)),i++),r++}();var _=[],s=a.SHA256=i.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=0;p<64;p++){if(p<16)_[p]=0|e[t+p];else{var h=_[p-15],l=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,d=_[p-2],m=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;_[p]=l+_[p-7]+m+_[p-16]}var g=i&n^i&a^n&a,v=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&u)+y[p]+_[p];f=u,u=c,c=s,s=o+b|0,o=a,a=n,n=i,i=b+(v+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+u|0,r[7]=r[7]+f|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)]=n.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA256=i._createHelper(s),e.HmacSHA256=i._createHmacHelper(s)}(Math),c.SHA256},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],234:[function(e,t,r){var i,n;i=this,n=function(a){return function(h){var e=a,t=e.lib,l=t.WordArray,i=t.Hasher,f=e.x64.Word,r=e.algo,P=[],O=[],T=[];!function(){for(var e=1,t=0,r=0;r<24;r++){P[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++)O[e+5*t]=t+(2*e+3*t)%5*5;for(var n=1,a=0;a<24;a++){for(var o=0,s=0,c=0;c<7;c++){if(1&n){var u=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(S=r[n]).high^=o,S.low^=a}for(var s=0;s<24;s++){for(var c=0;c<5;c++){for(var u=0,f=0,p=0;p<5;p++){u^=(S=r[c+5*p]).high,f^=S.low}var h=B[c];h.high=u,h.low=f}for(c=0;c<5;c++){var l=B[(c+4)%5],d=B[(c+1)%5],m=d.high,g=d.low;for(u=l.high^(m<<1|g>>>31),f=l.low^(g<<1|m>>>31),p=0;p<5;p++){(S=r[c+5*p]).high^=u,S.low^=f}}for(var v=1;v<25;v++){var b=(S=r[v]).high,y=S.low,_=P[v];if(_<32)u=b<<_|y>>>32-_,f=y<<_|b>>>32-_;else u=y<<_-32|b>>>64-_,f=b<<_-32|y>>>64-_;var w=B[O[v]];w.high=u,w.low=f}var k=B[0],x=r[0];k.high=x.high,k.low=x.low;for(c=0;c<5;c++)for(p=0;p<5;p++){var S=r[v=c+5*p],j=B[v],E=B[(c+1)%5+5*p],A=B[(c+2)%5+5*p];S.high=j.high^~E.high&A.high,S.low=j.low^~E.low&A.low}S=r[0];var I=T[s];S.high^=I.high,S.low^=I.low}},_doFinalize:function(){var e=this._data,t=e.words,r=(this._nDataBytes,8*e.sigBytes),i=32*this.blockSize;t[r>>>5]|=1<<24-r%32,t[(h.ceil((r+1)/i)*i>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();for(var n=this._state,a=this.cfg.outputLength/8,o=a/8,s=[],c=0;c>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),s.push(p),s.push(f)}return new l.init(s,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});e.SHA3=i._createHelper(n),e.HmacSHA3=i._createHmacHelper(n)}(Math),a.SHA3},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],235:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,o,s;return r=(t=e).x64,i=r.Word,n=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.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=o._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s),e.SHA384},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core"),e("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],n):n(i.CryptoJS)},{"./core":207,"./sha512":236,"./x64-core":238}],236:[function(e,t,r){var i,n;i=this,n=function(c){return function(){var e=c,t=e.lib.Hasher,r=e.x64,i=r.Word,n=r.WordArray,a=e.algo;function o(){return i.create.apply(i,arguments)}var xe=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],Se=[];!function(){for(var e=0;e<80;e++)Se[e]=o()}();var s=a.SHA512=t.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=i.high,h=i.low,l=n.high,d=n.low,m=a.high,g=a.low,v=o.high,b=o.low,y=s.high,_=s.low,w=c.high,k=c.low,x=u.high,S=u.low,j=f.high,E=f.low,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=w,N=k,D=x,q=S,L=j,U=E,H=0;H<80;H++){var K=Se[H];if(H<16)var V=K.high=0|e[t+2*H],G=K.low=0|e[t+2*H+1];else{var $=Se[H-15],W=$.high,Z=$.low,Y=(W>>>1|Z<<31)^(W>>>8|Z<<24)^W>>>7,X=(Z>>>1|W<<31)^(Z>>>8|W<<24)^(Z>>>7|W<<25),J=Se[H-2],Q=J.high,ee=J.low,te=(Q>>>19|ee<<13)^(Q<<3|ee>>>29)^Q>>>6,re=(ee>>>19|Q<<13)^(ee<<3|Q>>>29)^(ee>>>6|Q<<26),ie=Se[H-7],ne=ie.high,ae=ie.low,oe=Se[H-16],se=oe.high,ce=oe.low;V=(V=(V=Y+ne+((G=X+ae)>>>0>>0?1:0))+te+((G=G+re)>>>0>>0?1:0))+se+((G=G+ce)>>>0>>0?1:0);K.high=V,K.low=G}var ue,fe=R&M^~R&D,pe=z&N^~z&q,he=A&P^A&T^P&T,le=I&O^I&B^O&B,de=(A>>>28|I<<4)^(A<<30|I>>>2)^(A<<25|I>>>7),me=(I>>>28|A<<4)^(I<<30|A>>>2)^(I<<25|A>>>7),ge=(R>>>14|z<<18)^(R>>>18|z<<14)^(R<<23|z>>>9),ve=(z>>>14|R<<18)^(z>>>18|R<<14)^(z<<23|R>>>9),be=xe[H],ye=be.high,_e=be.low,we=L+ge+((ue=U+ve)>>>0>>0?1:0),ke=me+le;L=D,U=q,D=M,q=N,M=R,N=z,R=C+(we=(we=(we=we+fe+((ue=ue+pe)>>>0>>0?1:0))+ye+((ue=ue+_e)>>>0<_e>>>0?1:0))+V+((ue=ue+G)>>>0>>0?1:0))+((z=F+ue|0)>>>0>>0?1:0)|0,C=T,F=B,T=P,B=O,P=A,O=I,A=we+(de+he+(ke>>>0>>0?1:0))+((I=ue+ke|0)>>>0>>0?1:0)|0}h=i.low=h+I,i.high=p+A+(h>>>0>>0?1:0),d=n.low=d+O,n.high=l+P+(d>>>0>>0?1:0),g=a.low=g+B,a.high=m+T+(g>>>0>>0?1:0),b=o.low=b+F,o.high=v+C+(b>>>0>>0?1:0),_=s.low=_+z,s.high=y+R+(_>>>0>>0?1:0),k=c.low=k+N,c.high=w+M+(k>>>0>>0?1:0),S=u.low=S+q,u.high=x+D+(S>>>0>>0?1:0),E=f.low=E+U,f.high=j+L+(E>>>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=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(s),e.HmacSHA512=t._createHmacHelper(s)}(),c.SHA512},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],237:[function(e,t,r){var i,n;i=this,n=function(s){return function(){var e=s,t=e.lib,r=t.WordArray,i=t.BlockCipher,n=e.algo,u=[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],f=[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],p=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],a=n.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var i=u[r]-1;t[r]=e[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var o=n[a]=[],s=p[a];for(r=0;r<24;r++)o[r/6|0]|=t[(f[r]-1+s)%28]<<31-r%6,o[4+(r/6|0)]|=t[28+(f[r+24]-1+s)%28]<<31-r%6;o[0]=o[0]<<1|o[0]>>>31;for(r=1;r<7;r++)o[r]=o[r]>>>4*(r-1)+3;o[7]=o[7]<<5|o[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[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],d.call(this,4,252645135),d.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),d.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=h[c][((o^n[c])&l[c])>>>0];this._lBlock=o,this._rBlock=a^s}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,d.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(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<>>1];r=h.r28shl(r,a),i=h.r28shl(i,a),h.pc2(r,i,e.keys,n)}},c.prototype._update=function(e,t,r,i){var n=this._desState,a=h.readUInt32BE(e,t),o=h.readUInt32BE(e,t+4);h.ip(a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,o,n.tmp,0):this._decrypt(n,a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],h.writeUInt32BE(r,a,i),h.writeUInt32BE(r,o,i+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,a=p}h.rip(o,a,i,n)},c.prototype._decrypt=function(e,t,r,i,n){for(var a=r,o=t,s=e.keys.length-2;0<=s;s-=2){var c=e.keys[s],u=e.keys[s+1];h.expand(a,e.tmp,0),c^=e.tmp[0],u^=e.tmp[1];var f=h.substitute(c,u),p=a;a=(o^h.permute(f))>>>0,o=p}h.rip(a,o,i,n)}},{"../des":240,inherits:320,"minimalistic-assert":353}],244:[function(e,t,r){"use strict";var a=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),o=n.Cipher,s=n.DES;function c(e,t){a.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new c(this.type,this.options.key);this._edeState=t}i(u,o),(t.exports=u).create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":240,inherits:320,"minimalistic-assert":353}],245:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.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},r.ip=function(e,t,r,i){for(var n=0,a=0,o=6;0<=o;o-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+o&1}for(o=6;0<=o;o-=2){for(s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1;for(s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1}r[i+0]=n>>>0,r[i+1]=a>>>0},r.rip=function(e,t,r,i){for(var n=0,a=0,o=0;o<4;o++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+o&1,n<<=1,n|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;0<=s;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.pc1=function(e,t,r,i){for(var n=0,a=0,o=7;5<=o;o--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.r28shl=function(e,t){return e<>>28-t};var c=[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];r.pc2=function(e,t,r,i){for(var n=0,a=0,o=c.length>>>1,s=0;s>>c[s]&1;for(s=o;s>>c[s]&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var a=23;15<=a;a-=4)i<<=6,i|=e>>>a&63;for(a=11;3<=a;a-=4)n|=e>>>a&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[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];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[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];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(c),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;r.mod(p).cmp(h);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(i=r.shrn(1))&&g(r)&&v(i)&&v(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":154,"miller-rabin":349,randombytes:414}],249:[function(e,t,r){t.exports={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"}}},{}],250:[function(e,t,r){var u=e("crypto"),f=e("jsbn").BigInteger,p=(e("./lib/ec.js").ECPointFp,e("safer-buffer").Buffer);function h(e,t){return e.length>=t?e:h("0"+e,t)}r.ECCurves=e("./lib/sec.js"),r.ECKey=function(e,t,r){var i,n=e(),a=n.getN(),o=Math.floor(a.bitLength()/8);if(t)if(r){e=n.getCurve();this.P=e.decodePointHex(t.toString("hex"))}else{if(t.length!=o)return!1;i=new f(t.toString("hex"),16)}else{var s=a.subtract(f.ONE),c=new f(u.randomBytes(a.bitLength()));i=c.mod(s).add(f.ONE),this.P=n.getG().multiply(i)}this.P&&(this.PublicKey=p.from(n.getCurve().encodeCompressedPointHex(this.P),"hex")),i&&(this.PrivateKey=p.from(h(i.toString(16),2*o),"hex"),this.deriveSharedSecret=function(e){if(!e||!e.P)return!1;var t=e.P.multiply(i);return p.from(h(t.getX().toBigInteger().toString(16),2*o),"hex")})}},{"./lib/ec.js":251,"./lib/sec.js":252,crypto:204,jsbn:325,"safer-buffer":448}],251:[function(e,t,r){var l=e("jsbn").BigInteger,i=l.prototype.Barrett;function f(e,t){this.x=t,this.q=e}function d(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=null==i?l.ONE:i,this.zinv=null}function n(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new d(this,null,null),this.reducer=new i(this.q)}f.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},f.prototype.toBigInteger=function(){return this.x},f.prototype.negate=function(){return new f(this.q,this.x.negate().mod(this.q))},f.prototype.add=function(e){return new f(this.q,this.x.add(e.toBigInteger()).mod(this.q))},f.prototype.subtract=function(e){return new f(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},f.prototype.multiply=function(e){return new f(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},f.prototype.square=function(){return new f(this.q,this.x.square().mod(this.q))},f.prototype.divide=function(e){return new f(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},d.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO))},d.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(l.ZERO)&&!this.y.toBigInteger().equals(l.ZERO)},d.prototype.negate=function(){return new d(this.curve,this.x,this.y.negate(),this.z)},d.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(l.ZERO.equals(r))return l.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new l("3"),n=this.x.toBigInteger(),a=this.y.toBigInteger(),o=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),s=o.multiply(r),c=n.multiply(o),u=t.square().multiply(this.z),f=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(s).multiply(r).mod(this.curve.q),p=c.multiply(i).multiply(t).subtract(a.multiply(s)).subtract(u.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),h=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(p),h)},d.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new l("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),n=i.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),o=t.square().multiply(e);l.ZERO.equals(a)||(o=o.add(this.z.square().multiply(a)));var s=(o=o.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(i).mod(this.curve.q),c=o.multiply(e).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(o.square().multiply(o)).mod(this.curve.q),u=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(c),u)},d.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new l("3")),n=this.negate(),a=this;for(t=i.bitLength()-2;0r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var n=this.curve.getInfinity(),a=this.add(t);0<=i;)n=n.twice(),e.testBit(i)?n=r.testBit(i)?n.add(a):n.add(this):r.testBit(i)&&(n=n.add(t)),--i;return n},n.prototype.getQ=function(){return this.q},n.prototype.getA=function(){return this.a},n.prototype.getB=function(){return this.b},n.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},n.prototype.getInfinity=function(){return this.infinity},n.prototype.fromBigInteger=function(e){return new f(this.q,e)},n.prototype.reduce=function(e){this.reducer.reduce(e)},n.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;t.lengtht+1;){var r=e.shiftRight(t),i=e.subtract(r.shiftLeft(t));this.getR().equals(l.ONE)||(r=r.multiply(this.getR())),e=r.add(i)}for(;0<=e.compareTo(q);)e=e.subtract(q)}else e=e.mod(q);return e},f.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var e=new f(this.q,this.x.modPow(this.q.shiftRight(2).add(l.ONE),this.q));return e.square().equals(this)?e:null}var t=this.q.subtract(l.ONE),r=t.shiftRight(1);if(!this.x.modPow(r,this.q).equals(l.ONE))return null;var i,n,a=t.shiftRight(2).shiftLeft(1).add(l.ONE),o=this.x,s=modDouble(modDouble(o));do{for(var c;0<=(c=new l(this.q.bitLength(),new SecureRandom)).compareTo(this.q)||!c.multiply(c).subtract(s).modPow(r,this.q).equals(t););var u=this.lucasSequence(c,o,a);if(i=u[0],n=u[1],this.modMult(n,n).equals(s))return n.testBit(0)&&(n=n.add(q)),n=n.shiftRight(1),new f(q,n)}while(i.equals(l.ONE)||i.equals(t));return null},f.prototype.lucasSequence=function(e,t,r){for(var i=r.bitLength(),n=r.getLowestSetBit(),a=l.ONE,o=l.TWO,s=e,c=l.ONE,u=l.ONE,f=i-1;n+1<=f;--f)c=this.modMult(c,u),r.testBit(f)?(u=this.modMult(c,t),a=this.modMult(a,s),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1)))):(u=c,a=this.modReduce(a.multiply(o).subtract(c)),s=this.modReduce(s.multiply(o).subtract(e.multiply(c))),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))));c=this.modMult(c,u),u=this.modMult(c,t),a=this.modReduce(a.multiply(o).subtract(c)),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),c=this.modMult(c,u);for(f=1;f<=n;++f)a=this.modMult(a,o),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))),c=this.modMult(c,c);return[a,o]};r={ECCurveFp:n,ECPointFp:d,ECFieldElementFp:f};t.exports=r},{jsbn:325}],252:[function(e,t,r){var o=e("jsbn").BigInteger,s=e("./ec.js").ECCurveFp;function c(e,t,r,i){this.curve=e,this.g=t,this.n=r,this.h=i}function u(e){return new o(e,16)}function i(){var e=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),r=u("E87579C11079F43DD824993C2CEE5ED3"),i=u("FFFFFFFE0000000075A30D1B9038A115"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83"),i,n)}function n(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=o.ZERO,r=u("7"),i=u("0100000000000000000001B8FA16DFAB9ACA16B6B3"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE"),i,n)}function a(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),r=u("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),i=u("0100000000000000000001F4C8F927AED3CA752257"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32"),i,n)}function f(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=o.ZERO,r=u("3"),i=u("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"),i,n)}function p(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),r=u("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),i=u("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811"),i,n)}function h(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),r=u("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),i=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"),i,n)}function l(){var e=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),r=u("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),i=u("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),i,n)}c.prototype.getCurve=function(){return this.curve},c.prototype.getG=function(){return this.g},c.prototype.getN=function(){return this.n},c.prototype.getH=function(){return this.h},t.exports={secp128r1:i,secp160k1:n,secp160r1:a,secp192k1:f,secp192r1:p,secp224r1:h,secp256r1:l}},{"./ec.js":251,jsbn:325}],253:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":268,"./elliptic/curve":256,"./elliptic/curves":259,"./elliptic/ec":260,"./elliptic/eddsa":263,"./elliptic/utils":267,brorand:156}],254:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,j=n.getNAF,E=n.getJSF,p=n.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i,n){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,c=0,u=0;u>1]:S<0&&(x=o[g][-S-1>>1].neg()),y="affine"===x.type?y.mixedAdd(x):y.add(x))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},o.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.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),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],256:[function(e,t,r){arguments[4][130][0].apply(r,arguments)},{"./base":254,"./edwards":255,"./mont":257,"./short":258,dup:130}],257:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base,s=e("../../elliptic").utils;function c(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(c,o),(t.exports=c).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)},a(u,o.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},c.prototype.point=function(e,t){return new u(this,e,t)},c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.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)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},u.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 a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],258:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new w(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)},c.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)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],259:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":253,"./precomputed/secp256k1":266,"hash.js":299}],260:[function(e,t,r){"use strict";var g=e("bn.js"),v=e("hmac-drbg"),a=e("../../elliptic"),l=a.utils.assert,i=e("./key"),b=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(l(a.curves.hasOwnProperty(e),"Unknown curve "+e),e=a.curves[e]),e instanceof a.curves.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}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new v({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new g(2));;){var n=new g(t.generate(r));if(!(0>1;if(0<=o.cmp(this.curve.p.umod(this.curve.n))&&u)throw new Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var f=t.r.invm(n),p=n.sub(a).mul(f).umod(n),h=s.mul(f).umod(n);return this.g.mulAdd(p,o,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new b(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":253,"./key":261,"./signature":262,"bn.js":154,"hmac-drbg":311}],261:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=a).fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},{"../../elliptic":253,"bn.js":154}],262:[function(e,t,r){"use strict";var s=e("bn.js"),c=e("../../elliptic").utils,i=c.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=c.toArray(e,t);var r=new u;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=f(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=f(e,r);if(e.length!==a+r.place)return!1;var o=e.slice(r.place,a+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===o[0]&&128&o[1]&&(o=o.slice(1)),this.r=new s(n),this.s=new s(o),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];p(i,t.length),(i=i.concat(t)).push(2),p(i,r.length);var n=i.concat(r),a=[48];return p(a,n.length),a=a.concat(n),c.encode(a,e)}},{"../../elliptic":253,"bn.js":154}],263:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),a=n.utils,o=a.assert,c=a.parseBytes,s=e("./key"),u=e("./signature");function f(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=f).prototype.sign=function(e,t){e=c(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),a=this.encodePoint(n),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:a})},f.prototype.verify=function(e,t,r){e=c(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(a)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=6.0.0 <7.0.0",_id:"elliptic@6.4.1",_inCache:!0,_installable:!0,_location:"/elliptic",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/elliptic_6.4.1_1533787091502_0.6309761823717674"},_npmUser:{email:"fedor@indutny.com",name:"indutny"},_npmVersion:"6.3.0",_phantomChildren:{},_requested:{name:"elliptic",raw:"elliptic@^6.0.0",rawSpec:"^6.0.0",scope:null,spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/home/administrator/javascript-opentimestamps/node_modules/browserify-sign",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{fileCount:17,integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJba7vUCRA9TVsSAnZWagAA+gcP/jWaj5GmDZ0YFi/X4g5O\nx+pxu9i3HbP9YqywT7rz3XFXSaytu0LQDeDEbddl523X69tsbKfzHRTcnW8n\n2r0VjPhttRm+0RpEhBwjSIK34VkQA1xIWh2ugOToKXVCFVLM5VFDPGzbiN6x\n/hpL7gj1hoCRVmuhjnqFQ+vPKACKfv1Eq4CsRmu2focmP37kQpWQlweD/z4V\nJF4NxA33Fvp13Fl+9g4sPHyhUVsW9ojVaG3Ijn70pCaGQM18UPlbODkWQ1QX\nAgteOFjkIOtcalJk3B3qsM8GZeHEcAFvt2T73miJkHdCGNmRQS45Ede+gnj0\nlLlZJsCCKUHtTqrlprHo6AgMnBZufmytyozYAHC1/JYniazSBi2yPHtQeniR\nl69BfiRBdD2rNrMPwmCNRkMqrgel5WMGpaD0xdaFAHF1Ru2ZQFKsA7KvPGgp\nA20+LN11cCib67Pg5XDyrZ92T3yXec+6gQ3iq9d9UBZKFGl0P8ebVqq1LrUJ\na6nekwMpRISWnKcqV72XVmQdBmUWHq9VfVLsWJzVIJqtpHmUO7q74ACP3i4W\n0/F1REeI0YEhh3NjeStdDecfjlu7PY0pLQpbk2I3ms+6DO+cAfeDEev5jFBK\nwQabRNhITeT1FVtxZAcApj33fnCdqwaWr1NS00K5ZRqhDTTzPr/O4KRN4CR1\npstU\r\n=UVBB\r\n-----END PGP SIGNATURE-----\r\n",shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",unpackedSize:118371},files:["lib"],gitHead:"523da1cf71ddcfd607fbdee1858bc2af47f0e700",homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.1"}},{}],269:[function(e,t,r){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function c(e){return"function"==typeof e}function u(e){return"object"===(void 0===e?"undefined":_typeof(e))&&null!==e}function f(e){return void 0===e}((t.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},i.prototype.emit=function(e){var t,r,i,n,a,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(f(r=this._events[e]))return!1;if(c(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=Array.prototype.slice.call(arguments,1),r.apply(this,n)}else if(u(r))for(n=Array.prototype.slice.call(arguments,1),i=(o=r.slice()).length,a=0;ar&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!c(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,a;if(!c(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||c(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(r)){for(a=n;0=this._blockSize;){for(var n=this._blockOffset;n=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=n.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,a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":310}],310:[function(e,t,r){"use strict";var u=e("minimalistic-assert"),i=e("inherits");function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function o(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}r.inherits=i,r.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:320,"minimalistic-assert":353}],311:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),i=o.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length1e3*t.clockSkew)throw new E("clock skew of "+g/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach(function(e){if(u.params.headers.indexOf(e.toLowerCase())<0)throw new P(e+" was not a signed header")}),t.algorithms&&-1===t.algorithms.indexOf(u.params.algorithm))throw new I(u.params.algorithm+" is not a supported algorithm");return u.algorithm=u.params.algorithm.toUpperCase(),u.keyId=u.params.keyId,u}}},{"./utils":315,"assert-plus":66,util:505}],314:[function(n,a,e){(function(l){var d=n("assert-plus"),m=n("crypto"),e=(n("http"),n("util")),g=n("sshpk"),v=n("jsprim"),t=n("./utils"),b=n("util").format,y=t.HASH_ALGOS,_=t.PK_ALGOS,w=t.InvalidAlgorithmError,r=t.HttpSignatureError,k=t.validateAlgorithm,x='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';function S(e){r.call(this,e,S)}function j(e){r.call(this,e,j)}function i(e){d.object(e,"options");var t=[];if(void 0!==e.algorithm&&(d.string(e.algorithm,"options.algorithm"),t=k(e.algorithm)),this.rs_alg=t,void 0!==e.sign)d.func(e.sign,"options.sign"),this.rs_signFunc=e.sign;else if("hmac"===t[0]&&void 0!==e.key){if(d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,"string"!=typeof e.key&&!l.isBuffer(e.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=m.createHmac(t[1].toUpperCase(),e.key),this.rs_signer.sign=function(){var e=this.digest("base64");return{hashAlgorithm:t[1],toString:function(){return e}}}}else{if(void 0===e.key)throw new TypeError("options.sign (func) or options.key is required");var r=e.key;if(("string"==typeof r||l.isBuffer(r))&&(r=g.parsePrivateKey(r)),d.ok(g.PrivateKey.isPrivateKey(r,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=r,d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,!_[r.type])throw new w(r.type.toUpperCase()+" type keys are not supported");if(void 0!==t[0]&&r.type!==t[0])throw new w("options.key must be a "+t[0].toUpperCase()+" key, was given a "+r.type.toUpperCase()+" key instead");this.rs_signer=r.createSign(t[1])}this.rs_headers=[],this.rs_lines=[]}e.inherits(S,r),e.inherits(j,r),i.prototype.writeHeader=function(e,t){if(d.string(e,"header"),e=e.toLowerCase(),d.string(t,"value"),this.rs_headers.push(e),this.rs_signFunc)this.rs_lines.push(e+": "+t);else{var r=e+": "+t;0>1,f=-7,p=r?n-1:0,h=r?-1:1,l=e[t+p];for(p+=h,a=l&(1<<-f)-1,l>>=-f,f+=s;0>=-f,f+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:a-1,d=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),2<=(t+=1<=o+p?h/c:h*Math.pow(2,1-p))*c&&(o++,c/=2),f<=o+p?(s=0,o=f):1<=o+p?(s=(t*c-1)*Math.pow(2,n),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,n),o=0));8<=n;e[r+l]=255&s,l+=d,s/=256,n-=8);for(o=o<>15;0<=--a;){var c=32767&this[e],u=this[e++]>>15,f=s*c+u*o;n=((c=o*c+((32767&f)<<15)+r[i]+(1073741823&n))>>>30)+(f>>>15)+s*u+(n>>>30),r[i++]=1073741823&c}return n},30):t&&"Netscape"!=navigator.appName?(y.prototype.am=function(e,t,r,i,n,a){for(;0<=--a;){var o=t*this[e++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},26):(y.prototype.am=function(e,t,r,i,n,a){for(var o=16383&t,s=t>>14;0<=--a;){var c=16383&this[e],u=this[e++]>>14,f=s*c+u*o;n=((c=o*c+((16383&f)<<14)+r[i]+n)>>28)+(f>>14)+s*u,r[i++]=268435455&c}return n},28),y.prototype.DB=e,y.prototype.DM=(1<>>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 v(e){this.m=e}function b(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 l(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function d(){}function m(e){return e}function k(e){this.r2=_(),this.q3=_(),y.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},b.prototype.convert=function(e){var t=_();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&0>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),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},b.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.copyTo=function(e){for(var t=this.t-1;0<=t;--t)e[t]=this[t];e.t=this.t,e.s=this.s},y.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0this.DB?(this[this.t-1]|=(o&(1<>this.DB-a):this[this.t-1]|=o<=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,0>n|s,s=(this[r]&a)<=this.t)t.t=0;else{var i=e%this.DB,n=this.DB-i,a=(1<>i;for(var o=r+1;o>i;0>=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:0=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}0>this.F2:0),h=this.FV/p,l=(1<>s)&&(n=!0,a=c(r));0<=o;)s>(s+=this.DB-t)):(r=this[o]>>(s-=t)&i,s<=0&&(s+=this.DB,--o)),02*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=_();return e.copyTo(t),this.reduce(t),t},k.prototype.revert=function(e){return e},k.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);0<=e.compareTo(this.m);)e.subTo(this.m,e)},k.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},k.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x,S,j,E=[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],A=(1<<26)/E[E.length-1];function I(){var e;e=(new Date).getTime(),S[j++]^=255&e,S[j++]^=e>>8&255,S[j++]^=e>>16&255,S[j++]^=e>>24&255,R<=j&&(j-=R)}if(y.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},y.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||36=r&&(this.dMultiply(i),this.dAddOffset(o,0),o=a=0))}0e&&this.subTo(y.ONE.shiftLeft(e-1),this);else{var i=new Array,n=7&e;i.length=1+(e>>3),t.nextBytes(i),0>=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,0=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},y.prototype.multiplyLowerTo=function(e,t,r){var i,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;0>1)>E.length&&(e=E.length);for(var n=_(),a=0;a>24},y.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},y.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},y.prototype.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(0>i)!=(this.s&this.DM)>>i&&(t[n++]=r|this.s<>(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,(0=this.t?0!=this.s:0!=(this[t]&1<>n-c&u:(p=(e[l]&(1<>this.DB+n-c)),s=r;0==(1&p);)p>>=1,--s;if((n-=s)<0&&(n+=this.DB,--l),d)o[p].copyTo(a),d=!1;else{for(;1>>8,S[j++]=255&P;j=0,I()}function B(){if(null==x){for(I(),(x=new F).init(S),j=0;jt.maxItems&&n("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&m.concat(function(e,t,r,i){if("object"==(void 0===t?"undefined":_typeof(t)))for(var n in("object"!=(void 0===e?"undefined":_typeof(e))||e instanceof Array)&&m.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(n)){var a=e[n];if(void 0===a&&h.existingOnly)continue;var o=t[n];void 0===a&&o.default&&(a=e[n]=o.default),h.coerce&&n in e&&(a=e[n]=h.coerce(a,o)),g(a,o,r,n)}for(n in e){if(e.hasOwnProperty(n)&&("_"!=n.charAt(0)||"_"!=n.charAt(1))&&t&&!t[n]&&!1===i){if(h.filter){delete e[n];continue}m.push({property:r,message:(void 0===a?"undefined":_typeof(a))+"The property "+n+" is not defined in the schema and the schema does not allow additional properties"})}var s=t&&t[n]&&t[n].requires;!s||s in e||m.push({property:r,message:"the presence of the property "+n+" requires that "+s+" also be present"}),a=e[n],!i||t&&"object"==(void 0===t?"undefined":_typeof(t))&&n in t||(h.coerce&&(a=e[n]=h.coerce(a,i)),g(a,i,r,n)),!l&&a&&a.$schema&&(m=m.concat(g(a,a.$schema,r,n)))}return m}(e,t.properties,o,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&n("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&n("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.lengthe&&n("must have a minimum value of "+t.minimum),void 0!==_typeof(t.maximum)&&(void 0===e?"undefined":_typeof(e))==_typeof(t.maximum)&&t.maximum= 2"),d.ok(n.base<=36,"options.base <= 36"),d.bool(n.allowSign,"options.allowSign"),d.bool(n.allowPrefix,"options.allowPrefix"),d.bool(n.allowTrailing,"options.allowTrailing"),d.bool(n.allowImprecise,"options.allowImprecise"),d.bool(n.trimWhitespace,"options.trimWhitespace"),d.bool(n.leadingZeroIsOctal,"options.leadingZeroIsOctal"),n.leadingZeroIsOctal&&d.ok(!i,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var a,o=-1,s=n.base,c=1,u=0,f=0,p=e.length;if(n.trimWhitespace)for(;ft[0]||e[0]==t[0]&&e[1]>=t[1],"negative differences not allowed");var r=[e[0]-t[0],0];return e[1]>=t[1]?r[1]=e[1]-t[1]:(r[0]--,r[1]=1e9-(t[1]-e[1])),r}function R(e,t){return C(e),C(t),e[1]+=t[1],1e9<=e[1]&&(e[0]++,e[1]-=1e9),e[0]+=t[0],e}function z(e,t,r){var i,n;if(i={},r)for(n in r)i[n]=r[n];if(e)for(n in e)i[n]=e[n];if(t)for(n in t)i[n]=t[n];return i}},{"assert-plus":66,extsprintf:272,"json-schema":327,util:505,verror:509}],330:[function(e,t,r){"use strict";t.exports=e("./lib/api")(e("./lib/keccak"))},{"./lib/api":331,"./lib/keccak":335}],331:[function(e,t,r){"use strict";var n=e("./keccak"),a=e("./shake");t.exports=function(e){var r=n(e),i=a(e);return function(e,t){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new r(1152,448,null,224,t);case"keccak256":return new r(1088,512,null,256,t);case"keccak384":return new r(832,768,null,384,t);case"keccak512":return new r(576,1024,null,512,t);case"sha3-224":return new r(1152,448,6,224,t);case"sha3-256":return new r(1088,512,6,256,t);case"sha3-384":return new r(832,768,6,384,t);case"sha3-512":return new r(576,1024,6,512,t);case"shake128":return new i(1344,256,31,t);case"shake256":return new i(1088,512,31,t);default:throw new Error("Invald algorithm: "+e)}}}},{"./keccak":332,"./shake":333}],332:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,o=e("stream").Transform,n=e("inherits");t.exports=function(a){function t(e,t,r,i,n){o.call(this,n),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._hashBitLength=i,this._options=n,this._state=new a,this._state.initialize(e,t),this._finalized=!1}return n(t,o),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],333:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("stream").Transform,o=e("inherits");t.exports=function(n){function t(e,t,r,i){a.call(this,i),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._options=i,this._state=new n,this._state.initialize(e,t),this._finalized=!1}return o(t,a),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],334:[function(e,t,r){"use strict";var ot=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];r.p1600=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],n=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],h=f^(n<<1|a>>>31),l=p^(a<<1|n>>>31),d=e[0]^h,m=e[1]^l,g=e[10]^h,v=e[11]^l,b=e[20]^h,y=e[21]^l,_=e[30]^h,w=e[31]^l,k=e[40]^h,x=e[41]^l;h=r^(o<<1|s>>>31),l=i^(s<<1|o>>>31);var S=e[2]^h,j=e[3]^l,E=e[12]^h,A=e[13]^l,I=e[22]^h,P=e[23]^l,O=e[32]^h,T=e[33]^l,B=e[42]^h,C=e[43]^l;h=n^(c<<1|u>>>31),l=a^(u<<1|c>>>31);var F=e[4]^h,R=e[5]^l,z=e[14]^h,M=e[15]^l,N=e[24]^h,D=e[25]^l,q=e[34]^h,L=e[35]^l,U=e[44]^h,H=e[45]^l;h=o^(f<<1|p>>>31),l=s^(p<<1|f>>>31);var K=e[6]^h,V=e[7]^l,G=e[16]^h,$=e[17]^l,W=e[26]^h,Z=e[27]^l,Y=e[36]^h,X=e[37]^l,J=e[46]^h,Q=e[47]^l;h=c^(r<<1|i>>>31),l=u^(i<<1|r>>>31);var ee=e[8]^h,te=e[9]^l,re=e[18]^h,ie=e[19]^l,ne=e[28]^h,ae=e[29]^l,oe=e[38]^h,se=e[39]^l,ce=e[48]^h,ue=e[49]^l,fe=d,pe=m,he=v<<4|g>>>28,le=g<<4|v>>>28,de=b<<3|y>>>29,me=y<<3|b>>>29,ge=w<<9|_>>>23,ve=_<<9|w>>>23,be=k<<18|x>>>14,ye=x<<18|k>>>14,_e=S<<1|j>>>31,we=j<<1|S>>>31,ke=A<<12|E>>>20,xe=E<<12|A>>>20,Se=I<<10|P>>>22,je=P<<10|I>>>22,Ee=T<<13|O>>>19,Ae=O<<13|T>>>19,Ie=B<<2|C>>>30,Pe=C<<2|B>>>30,Oe=R<<30|F>>>2,Te=F<<30|R>>>2,Be=z<<6|M>>>26,Ce=M<<6|z>>>26,Fe=D<<11|N>>>21,Re=N<<11|D>>>21,ze=q<<15|L>>>17,Me=L<<15|q>>>17,Ne=H<<29|U>>>3,De=U<<29|H>>>3,qe=K<<28|V>>>4,Le=V<<28|K>>>4,Ue=$<<23|G>>>9,He=G<<23|$>>>9,Ke=W<<25|Z>>>7,Ve=Z<<25|W>>>7,Ge=Y<<21|X>>>11,$e=X<<21|Y>>>11,We=Q<<24|J>>>8,Ze=J<<24|Q>>>8,Ye=ee<<27|te>>>5,Xe=te<<27|ee>>>5,Je=re<<20|ie>>>12,Qe=ie<<20|re>>>12,et=ae<<7|ne>>>25,tt=ne<<7|ae>>>25,rt=oe<<8|se>>>24,it=se<<8|oe>>>24,nt=ce<<14|ue>>>18,at=ue<<14|ce>>>18;e[0]=fe^~ke&Fe,e[1]=pe^~xe&Re,e[10]=qe^~Je&de,e[11]=Le^~Qe&me,e[20]=_e^~Be&Ke,e[21]=we^~Ce&Ve,e[30]=Ye^~he&Se,e[31]=Xe^~le&je,e[40]=Oe^~Ue&et,e[41]=Te^~He&tt,e[2]=ke^~Fe&Ge,e[3]=xe^~Re&$e,e[12]=Je^~de&Ee,e[13]=Qe^~me&Ae,e[22]=Be^~Ke&rt,e[23]=Ce^~Ve&it,e[32]=he^~Se&ze,e[33]=le^~je&Me,e[42]=Ue^~et&ge,e[43]=He^~tt&ve,e[4]=Fe^~Ge&nt,e[5]=Re^~$e&at,e[14]=de^~Ee&Ne,e[15]=me^~Ae&De,e[24]=Ke^~rt&be,e[25]=Ve^~it&ye,e[34]=Se^~ze&We,e[35]=je^~Me&Ze,e[44]=et^~ge&Ie,e[45]=tt^~ve&Pe,e[6]=Ge^~nt&fe,e[7]=$e^~at&pe,e[16]=Ee^~Ne&qe,e[17]=Ae^~De&Le,e[26]=rt^~be&_e,e[27]=it^~ye&we,e[36]=ze^~We&Ye,e[37]=Me^~Ze&Xe,e[46]=ge^~Ie&Oe,e[47]=ve^~Pe&Te,e[8]=nt^~fe&ke,e[9]=at^~pe&xe,e[18]=Ne^~qe&Je,e[19]=De^~Le&Qe,e[28]=be^~_e&Be,e[29]=ye^~we&Ce,e[38]=We^~Ye&he,e[39]=Ze^~Xe&le,e[48]=Ie^~Oe&Ue,e[49]=Pe^~Te&He,e[0]^=ot[2*t],e[1]^=ot[2*t+1]}}},{}],335:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=e("./keccak-state-unroll");function a(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}a.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},a.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},a.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},t.exports=a},{"./keccak-state-unroll":334,"safe-buffer":447}],336:[function(e,t,r){var i=e("./_root").Symbol;t.exports=i},{"./_root":341}],337:[function(e,t,r){var i=e("./_Symbol"),n=e("./_getRawTag"),a=e("./_objectToString"),o=i?i.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},{"./_Symbol":336,"./_getRawTag":339,"./_objectToString":340}],338:[function(e,r,t){(function(e){var t="object"==(void 0===e?"undefined":_typeof(e))&&e&&e.Object===Object&&e;r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],339:[function(e,t,r){var i=e("./_Symbol"),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,s=i?i.toStringTag:void 0;t.exports=function(e){var t=a.call(e,s),r=e[s];try{var i=!(e[s]=void 0)}catch(e){}var n=o.call(e);return i&&(t?e[s]=r:delete e[s]),n}},{"./_Symbol":336}],340:[function(e,t,r){var i=Object.prototype.toString;t.exports=function(e){return i.call(e)}},{}],341:[function(e,t,r){var i=e("./_freeGlobal"),n="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,a=i||n||Function("return this")();t.exports=a},{"./_freeGlobal":338}],342:[function(e,t,r){var i=Array.isArray;t.exports=i},{}],343:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isObject");t.exports=function(e){if(!n(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},{"./_baseGetTag":337,"./isObject":344}],344:[function(e,t,r){t.exports=function(e){var t=void 0===e?"undefined":_typeof(e);return null!=e&&("object"==t||"function"==t)}},{}],345:[function(e,t,r){t.exports=function(e){return null!=e&&"object"==(void 0===e?"undefined":_typeof(e))}},{}],346:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isArray"),a=e("./isObjectLike");t.exports=function(e){return"string"==typeof e||!n(e)&&a(e)&&"[object String]"==i(e)}},{"./_baseGetTag":337,"./isArray":342,"./isObjectLike":345}],347:[function(e,t,r){t.exports=function(e){return void 0===e}},{}],348:[function(e,t,r){"use strict";var i=e("inherits"),n=e("hash-base"),a=e("safe-buffer").Buffer,o=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,r,i,n,a,o){return c(e+(t&r|~t&i)+n+a|0,o)+t|0}function f(e,t,r,i,n,a,o){return c(e+(t&i|r&~i)+n+a|0,o)+t|0}function p(e,t,r,i,n,a,o){return c(e+(t^r^i)+n+a|0,o)+t|0}function h(e,t,r,i,n,a,o){return c(e+(r^(t|~i))+n+a|0,o)+t|0}i(s,n),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,a=this._d;i=h(i=h(i=h(i=h(i=p(i=p(i=p(i=p(i=f(i=f(i=f(i=f(i=u(i=u(i=u(i=u(i,n=u(n,a=u(a,r=u(r,i,n,a,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),a,r,e[3],3250441966,22),n=u(n,a=u(a,r=u(r,i,n,a,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),a,r,e[7],4249261313,22),n=u(n,a=u(a,r=u(r,i,n,a,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),a,r,e[11],2304563134,22),n=u(n,a=u(a,r=u(r,i,n,a,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),a,r,e[15],1236535329,22),n=f(n,a=f(a,r=f(r,i,n,a,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),a,r,e[0],3921069994,20),n=f(n,a=f(a,r=f(r,i,n,a,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),a,r,e[4],3889429448,20),n=f(n,a=f(a,r=f(r,i,n,a,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),a,r,e[8],1163531501,20),n=f(n,a=f(a,r=f(r,i,n,a,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),a,r,e[12],2368359562,20),n=p(n,a=p(a,r=p(r,i,n,a,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),a,r,e[14],4259657740,23),n=p(n,a=p(a,r=p(r,i,n,a,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),a,r,e[10],3200236656,23),n=p(n,a=p(a,r=p(r,i,n,a,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),a,r,e[6],76029189,23),n=p(n,a=p(a,r=p(r,i,n,a,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),a,r,e[2],3299628645,23),n=h(n,a=h(a,r=h(r,i,n,a,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),a,r,e[5],4237533241,21),n=h(n,a=h(a,r=h(r,i,n,a,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),a,r,e[1],2240044497,21),n=h(n,a=h(a,r=h(r,i,n,a,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),a,r,e[13],1309151649,21),n=h(n,a=h(a,r=h(r,i,n,a,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),a,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+a|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e}},{}],355:[function(e,t,r){(t.exports=o).Minimatch=n;var u={sep:"/"};try{u=e("path")}catch(e){}var z=o.GLOBSTAR=n.GLOBSTAR={},i=e("brace-expansion"),M={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},N="[^/]*?",D="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{});var f=/\/+/;function a(t,r){t=t||{},r=r||{};var i={};return Object.keys(r).forEach(function(e){i[e]=r[e]}),Object.keys(t).forEach(function(e){i[e]=t[e]}),i}function o(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new n(t,r).match(e))}function n(e,t){if(!(this instanceof n))return new n(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==u.sep&&(e=e.split(u.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function s(e,t){if(t||(t=this instanceof n?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:i(e)}o.filter=function(i,n){return n=n||{},function(e,t,r){return o(e,i,n)}},o.defaults=function(i){if(!i||!Object.keys(i).length)return o;var n=o,e=function(e,t,r){return n.minimatch(e,t,a(i,r))};return e.Minimatch=function(e,t){return new n.Minimatch(e,a(i,t))},e},n.defaults=function(e){return e&&Object.keys(e).length?o.defaults(e).Minimatch:n},n.prototype.debug=function(){},n.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(f)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r},n.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=this.options,i=0;if(r.nonegate)return;for(var n=0,a=e.length;n>> no match, partial?",e,p,t,h),p!==o))}if("string"==typeof u?(c=i.nocase?f.toLowerCase()===u.toLowerCase():f===u,this.debug("string match",u,f,c)):(c=f.match(u),this.debug("pattern match",u,f,c)),!c)return!1}if(n===o&&a===s)return!0;if(n===o)return r;if(a===s)return n===o-1&&""===e[n];throw new Error("wtf?")}},{"brace-expansion":155,path:374}],356:[function(e,t,r){var c=e("crypto");function o(e,t,r){return c.createHmac(r,e).update(t).digest("base64")}function s(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function n(e,t){return t>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var n=s,a=i+r;e^=-1;for(var o=i;o>>8^n[255&(e^t[o])];return-1^e}},{}],362:[function(e,t,r){"use strict";var c,h=e("../utils/common"),u=e("./trees"),l=e("./adler32"),d=e("./crc32"),i=e("./messages"),f=0,p=4,m=0,g=-2,v=-1,b=4,n=2,y=8,_=9,a=286,o=30,s=19,w=2*a+1,k=15,x=3,S=258,j=S+x+1,E=42,A=113,I=1,P=2,O=3,T=4;function B(e,t){return e.msg=i[t],t}function C(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(h.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function z(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,R(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function N(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function D(e,t){var r,i,n=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-j?e.strstart-(e.w_size-j):0,u=e.window,f=e.w_mask,p=e.prev,h=e.strstart+S,l=u[a+o-1],d=u[a+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===d&&u[r+o-1]===l&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ac&&0!=--n);return o<=e.lookahead?o:e.lookahead}function q(e){var t,r,i,n,a,o,s,c,u,f,p=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-j)){for(h.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;i=e.head[--t],e.head[t]=p<=i?i-p:0,--r;);for(t=r=p;i=e.prev[--t],e.prev[t]=p<=i?i-p:0,--r;);n+=p}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,c=e.strstart+e.lookahead,u=n,f=void 0,f=o.avail_in,u=x)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(i=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(n=e.strstart+e.lookahead-x,i=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=n&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(q(e),0===e.lookahead&&t===f)return I;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,z(e,!1),0===e.strm.avail_out))return I;if(e.strstart-e.block_start>=e.w_size-j&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):(e.strstart>e.block_start&&(z(e,!1),e.strm.avail_out),I)}),new H(4,4,8,4,L),new H(4,5,16,8,L),new H(4,6,32,32,L),new H(4,4,16,16,U),new H(8,16,32,32,U),new H(8,16,128,128,U),new H(8,32,128,256,U),new H(32,128,258,1024,U),new H(32,258,258,4096,U)],r.deflateInit=function(e,t){return $(e,t,y,15,8,0)},r.deflateInit2=$,r.deflateReset=G,r.deflateResetKeep=V,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,m):g},r.deflate=function(e,t){var r,i,n,a;if(!e||!e.state||5>8&255),M(i,i.gzhead.time>>16&255),M(i,i.gzhead.time>>24&255),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(M(i,255&i.gzhead.extra.length),M(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=d(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(M(i,0),M(i,0),M(i,0),M(i,0),M(i,0),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,3),i.status=A);else{var o=y+(i.w_bits-8<<4)<<8;o|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(o|=32),o+=31-o%31,i.status=A,N(i,o),0!==i.strstart&&(N(i,e.adler>>>16),N(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending!==i.pending_buf_size));)M(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&R(e),i.pending+2<=i.pending_buf_size&&(M(i,255&e.adler),M(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(R(e),0===e.avail_out)return i.last_flush=-1,m}else if(0===e.avail_in&&C(t)<=C(r)&&t!==p)return B(e,-5);if(666===i.status&&0!==e.avail_in)return B(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==f&&666!==i.status){var s=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(q(e),0===e.lookahead)){if(t===f)return I;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):3===i.strategy?function(e,t){for(var r,i,n,a,o=e.window;;){if(e.lookahead<=S){if(q(e),e.lookahead<=S&&t===f)return I;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):c[i.level].func(i,t);if(s!==O&&s!==T||(i.status=666),s===I||s===O)return 0===e.avail_out&&(i.last_flush=-1),m;if(s===P&&(1===t?u._tr_align(i):5!==t&&(u._tr_stored_block(i,0,0,!1),3===t&&(F(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),R(e),0===e.avail_out))return i.last_flush=-1,m}return t!==p?m:i.wrap<=0?1:(2===i.wrap?(M(i,255&e.adler),M(i,e.adler>>8&255),M(i,e.adler>>16&255),M(i,e.adler>>24&255),M(i,255&e.total_in),M(i,e.total_in>>8&255),M(i,e.total_in>>16&255),M(i,e.total_in>>24&255)):(N(i,e.adler>>>16),N(i,65535&e.adler)),R(e),0=r.w_size&&(0===a&&(F(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new h.Buf8(r.w_size),h.arraySet(u,t,f-r.w_size,r.w_size,0),t=u,f=r.w_size),o=e.avail_in,s=e.next_in,c=e.input,e.avail_in=f,e.next_in=0,e.input=t,q(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=_=y>>>24,d-=_,0===(_=y>>>16&255))E[a++]=65535&y;else{if(!(16&_)){if(0==(64&_)){y=m[(65535&y)+(l&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&y,(_&=15)&&(d<_&&(l+=j[i++]<>>=_,d-=_),d<15&&(l+=j[i++]<>>=_=y>>>24,d-=_,!(16&(_=y>>>16&255))){if(0==(64&_)){y=g[(65535&y)+(l&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&y,d<(_&=15)&&(l+=j[i++]<>>=_,d-=_,(_=a-o)>3,l&=(1<<(d-=w<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new P.Buf16(320),this.work=new P.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=N,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new P.Buf32(i),t.distcode=t.distdyn=new P.Buf32(n),t.sane=1,t.back=-1,z):M}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):M}function c(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=a.wsize?(P.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(n=a.wsize-a.wnext)&&(n=i),P.arraySet(a.window,t,r-i,n,a.wnext),(i-=n)?(P.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=T(r.check,A,2,0),f=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(f-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=3;case 3:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>8&255,A[2]=u>>>16&255,A[3]=u>>>24&255,r.check=T(r.check,A,4,0)),f=u=0,r.mode=4;case 4:for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>8),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>>8&255,r.check=T(r.check,A,2,0)),f=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(s<(l=r.length)&&(l=s),l&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),P.arraySet(r.head.extra,i,a,l,k)),512&r.flags&&(r.check=T(r.check,i,l,a)),s-=l,a+=l,r.length-=l),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;for(l=0;k=i[a+l++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&l>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>=7&f,f-=7&f,r.mode=27;break}for(;f<3;){if(0===s)break e;s--,u+=i[a++]<>>=1)){case 0:r.mode=14;break;case 1:if(q(r),r.mode=20,6!==t)break;u>>>=2,f-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,f-=2;break;case 14:for(u>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,u+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,f=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(l=r.length){if(s>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,286>>=3,f-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=C(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=g,f-=g,r.lens[r.have++]=b;else{if(16===b){for(j=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],l=3+(3&u),u>>>=2,f-=2}else if(17===b){for(j=g+3;f>>=g)),u>>>=3,f-=3}else{for(j=g+7;f>>=g)),u>>>=7,f-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;l--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=C(F,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=C(R,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=s&&258<=c){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,r.hold=u,r.bits=f,B(e,h),o=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,u=r.hold,f=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;v=(E=r.lencode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,r.length=b,0===v){r.mode=26;break}if(32&v){r.back=-1,r.mode=12;break}if(64&v){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&v,r.mode=22;case 22:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=(E=r.distcode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&v,r.mode=24;case 24:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===c)break e;if(l=h-c,r.offset>l){if((l=r.offset-l)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d=l>r.wnext?(l-=r.wnext,r.wsize-l):r.wnext-l,l>r.length&&(l=r.length),m=r.window}else m=n,d=o-r.offset,l=r.length;for(cl?(m=B[C+o[y]],I[P+o[y]]):(m=96,0),c=1<>S)+(u-=c)]=d<<24|m<<16|g|0,0!==u;);for(c=1<>=1;if(0!==c?(A&=c-1,A+=c):A=0,y++,0==--O[b]){if(b===w)break;b=t[r+o[y]]}if(k>>7)]}function M(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function N(e,t,r){e.bi_valid>n-r?(e.bi_buf|=t<>n-e.bi_valid,e.bi_valid+=r-n):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function L(e,t,r){var i,n,a=new Array(v+1),o=0;for(i=1;i<=v;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=q(a[s]++,s))}}function U(e){var t;for(t=0;t>1;1<=r;r--)V(e,a,r);for(n=c;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],V(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,a[2*n]=a[2*r]+a[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,a[2*r+1]=a[2*i+1]=n,e.heap[1]=n++,V(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,n,a,o,s,c=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,p=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(a=0;a<=v;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return s;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return u;for(t=32;t>>3,(a=e.static_len+3+7>>>3)<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==t?X(e,t,r,i):4===e.strategy||a===n?(N(e,2+(i?1:0),3),G(e,E,A)):(N(e,4+(i?1:0),3),function(e,t,r,i){var n;for(N(e,t-257,5),N(e,r-1,5),N(e,i-4,4),n=0;n>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(P[r]+p+1)]++,e.dyn_dtree[2*z(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;N(e,2,3),D(e,b,E),16===(t=e).bi_valid?(M(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":358}],368:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],369:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],370:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var a=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=a;var o=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=o;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var f=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=f,r.DSAparam=i.define("DSAparam",function(){this.int()});var p=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=p;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":371,"asn1.js":46}],371:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),a=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(a)}),u=i.define("RDNSequence",function(){this.seqof(c)}),f=i.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),p=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(f),this.key("validity").use(p),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),d=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=d},{"asn1.js":46}],372:[function(e,t,r){(function(h){var l=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,d=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m,m=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,g=e("evp_bytestokey"),v=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(l);if(n){var a="aes"+n[1],o=new h(n[2],"hex"),s=new h(n[3].replace(/[\r\n]/g,""),"base64"),c=g(t,o.slice(0,8),parseInt(n[1],10)).key,u=[],f=v.createDecipheriv(a,c,o);u.push(f.update(s)),u.push(f.final()),r=h.concat(u)}else{var p=i.match(m);r=new h(p[2].replace(/[\r\n]/g,""),"base64")}return{tag:i.match(d)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":160,buffer:191,evp_bytestokey:270}],373:[function(t,r,e){(function(b){var y=t("./asn1"),_=t("./aesid.json"),w=t("./fixProc"),k=t("browserify-aes"),x=t("pbkdf2");function e(e){var t;"object"!==(void 0===e?"undefined":_typeof(e))||b.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new b(e));var r,i,n,a,o,s,c,u,f,p,h,l,d,m=w(e,t),g=m.tag,v=m.data;switch(g){case"CERTIFICATE":i=y.certificate.decode(v,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=y.PublicKey.decode(v,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=y.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"ENCRYPTED PRIVATE KEY":v=y.EncryptedPrivateKey.decode(v,"der"),a=t,o=(n=v).algorithm.decrypt.kde.kdeparams.salt,s=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=_[n.algorithm.decrypt.cipher.algo.join(".")],u=n.algorithm.decrypt.cipher.iv,f=n.subjectPrivateKey,p=parseInt(c.split("-")[1],10)/8,h=x.pbkdf2Sync(a,o,s,p),l=k.createDecipheriv(c,h,u),(d=[]).push(l.update(f)),d.push(l.final()),v=b.concat(d);case"PRIVATE KEY":switch(r=(i=y.PrivateKey.decode(v,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:y.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=y.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"RSA PUBLIC KEY":return y.RSAPublicKey.decode(v,"der");case"RSA PRIVATE KEY":return y.RSAPrivateKey.decode(v,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:y.DSAPrivateKey.decode(v,"der")};case"EC PRIVATE KEY":return{curve:(v=y.ECPrivateKey.decode(v,"der")).parameters.value,privateKey:v.privateKey};default:throw new Error("unknown key type "+g)}}(r.exports=e).signature=y.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":369,"./asn1":370,"./fixProc":372,"browserify-aes":160,buffer:191,pbkdf2:375}],374:[function(e,t,u){(function(n){function a(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function o(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;ia?t=n(t):t.length "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+o+";","var res;","switch (argLength) {",r.concat(["extra"]).map(function(e,t){return"case "+t+":res = fn.call("+["self"].concat(r.slice(0,t)).concat("cb").join(",")+");break;"}).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],n)(a,e)}(e)};var o="function (err, res) {if (err) { rj(err); } else { rs(res); }}";a.nodeify=function(r){return function(){var e=Array.prototype.slice.call(arguments),t="function"==typeof e[e.length-1]?e.pop():null,i=this;try{return r.apply(this,arguments).nodeify(t,i)}catch(r){if(null==t)return new a(function(e,t){t(r)});n(function(){t.call(i,r)})}}},a.prototype.nodeify=function(t,r){if("function"!=typeof t)return this;this.then(function(e){n(function(){t.call(r,null,e)})},function(e){n(function(){t.call(r,e)})})}},{"./core.js":384,asap:44}],390:[function(e,t,r){"use strict";var i=e("./core.js");(t.exports=i).enableSynchronous=function(){i.prototype.isPending=function(){return 0==this.getState()},i.prototype.isFulfilled=function(){return 1==this.getState()},i.prototype.isRejected=function(){return 2==this.getState()},i.prototype.getValue=function(){if(3===this._65)return this._55.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._55},i.prototype.getReason=function(){if(3===this._65)return this._55.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._55},i.prototype.getState=function(){return 3===this._65?this._55.getState():-1===this._65||-2===this._65?0:this._65}},i.disableSynchronous=function(){i.prototype.isPending=void 0,i.prototype.isFulfilled=void 0,i.prototype.isRejected=void 0,i.prototype.getValue=void 0,i.prototype.getReason=void 0,i.prototype.getState=void 0}},{"./core.js":384}],391:[function(e,t,r){"use strict";var n=function(e){for(var t=e.toString(16);4!==t.length;)t="0"+t;return"\\u"+t};t.exports=function(e,t,r,i){return!r.key||61!==t&&58!==t&&t!==r.separator?31o||0<=new u(t).cmp(a.modulus))throw new Error("decryption error");n=r?d(new u(t),a):h(t,a);var s=m.alloc(o-n.length);if(n=m.concat([s,n],o),4===i)return function(e,t){var r=e.modulus.byteLength(),i=l("sha1").update(m.alloc(0)).digest(),n=i.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,n+1),o=t.slice(n+1),s=p(a,f(o,n)),c=p(o,f(s,r-n-1));if(function(e,t){e=m.from(e),t=m.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){a++;break}var o=t.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&a++;o.length<8&&a++;if(a)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}},{"./mgf":401,"./withPublic":404,"./xor":405,"bn.js":154,"browserify-rsa":178,"create-hash":200,"parse-asn1":373,"safe-buffer":447}],403:[function(e,t,r){var o=e("parse-asn1"),h=e("randombytes"),l=e("create-hash"),d=e("./mgf"),m=e("./xor"),g=e("bn.js"),s=e("./withPublic"),c=e("browserify-rsa"),v=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,a=o(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=l("sha1").update(v.alloc(0)).digest(),a=n.length,o=2*a;if(r-o-2>6]+a[128|63&n]:n<55296||57344<=n?r+=a[224|n>>12]+a[128|n>>6&63]+a[128|63&n]:(i+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),r+=a[240|n>>18]+a[128|n>>12&63]+a[128|n>>6&63]+a[128|63&n])}return r},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function i(r,n,a){if(!n)return r;if("object"!==(void 0===n?"undefined":_typeof(n))){if(Array.isArray(r))r.push(n);else{if("object"!==(void 0===r?"undefined":_typeof(r)))return[r,n];(a.plainObjects||a.allowPrototypes||!o.call(Object.prototype,n))&&(r[n]=!0)}return r}if("object"!==(void 0===r?"undefined":_typeof(r)))return[r].concat(n);var e=r;return Array.isArray(r)&&!Array.isArray(n)&&(e=s(r,a)),Array.isArray(r)&&Array.isArray(n)?(n.forEach(function(e,t){o.call(r,t)?r[t]&&"object"===_typeof(r[t])?r[t]=i(r[t],e,a):r.push(e):r[t]=e}),r):Object.keys(n).reduce(function(e,t){var r=n[t];return o.call(e,t)?e[t]=i(e[t],r,a):e[t]=r,e},e)}}},{}],411:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var a=/\+/g;e=e.split(t);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var s,c,u=e.length;0t.highWaterMark&&(t.highWaterMark=(m<=(r=e)?r=m:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(_("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?v.nextTick(x,e):x(e))}function x(e){_("emit readable"),e.emit("readable"),I(e)}function S(e,t){t.readingMore||(t.readingMore=!0,v.nextTick(j,e,t))}function j(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;ea.length?a.length:e;if(o===a.length?n+=a:n+=a.slice(0,e),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=a.slice(o);break}++i}return t.length-=i,n}(e,t):function(e,t){var r=u.allocUnsafe(e),i=t.head,n=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i).data=a.slice(o);break}++n}return t.length-=n,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return _("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):k(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,n=t.needReadable;return _("need readable",n),(0===t.length||t.length-e>>0),a=this.head,o=0;a;)t=a.data,r=n,i=o,t.copy(r,i),o+=a.data.length,a=a.next;return n},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":447,util:157}],423:[function(e,t,r){"use strict";var a=e("process-nextick-args");function o(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a.nextTick(o,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(o,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":381}],424:[function(e,t,r){t.exports=e("events").EventEmitter},{events:269}],425:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":426}],426:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":417,"./lib/_stream_passthrough.js":418,"./lib/_stream_readable.js":419,"./lib/_stream_transform.js":420,"./lib/_stream_writable.js":421}],427:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":426}],428:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":421}],429:[function(e,t,r){"use strict";var s=e("../"),c=e("lodash/isArray"),u=e("lodash/isFunction"),f=e("lodash/isObjectLike");t.exports=function(e){var t="Please verify options";if(!f(e))throw new TypeError(t);if(!u(e.request))throw new TypeError(t+".request");if(!c(e.expose)||0===e.expose.length)throw new TypeError(t+".expose");for(var r=s({PromiseImpl:e.PromiseImpl,constructorMixin:e.constructorMixin}),i=e.request.Request.prototype.init,n=!(e.request.Request.prototype.init=function(e){return!f(e)||this._callback||this._rp_promise||r.init.call(this,e),i.apply(this,arguments)}),a=0;a=t.maxRedirects)return r.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+r.uri.href)),!1;t.redirectsFollowed+=1,o.test(i)||(i=a.resolve(r.uri.href,i));var n=r.uri;return r.uri=a.parse(i),r.uri.protocol!==n.protocol&&delete r.agent,t.redirects.push({statusCode:e.statusCode,redirectUri:i}),t.followAllRedirects&&"HEAD"!==r.method&&401!==e.statusCode&&307!==e.statusCode&&(r.method=t.followOriginalHttpMethod?r.method:"GET"),delete r.src,delete r.req,delete r._started,401!==e.statusCode&&307!==e.statusCode&&(delete r.body,delete r._form,r.headers&&(r.removeHeader("host"),r.removeHeader("content-type"),r.removeHeader("content-length"),r.uri.hostname!==r.originalHost.split(":")[0]&&r.removeHeader("authorization"))),t.removeRefererHeader||r.setHeader("referer",n.href),r.emit("redirect"),r.init(),!0},r.Redirect=i},{url:500}],444:[function(e,t,r){"use strict";var w=e("url"),k=e("tunnel-agent"),i=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],x=["proxy-authorization"];function n(e){this.request=e,this.proxyHeaderWhiteList=i,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}n.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},n.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=w.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,i,n,a,o,s,c=this.proxyHeaderExclusiveList.concat(x),u=this.proxyHeaderWhiteList.concat(c),f=(r=t.headers,i=u.reduce(function(e,t){return e[t.toLowerCase()]=!0,e},{}),Object.keys(r).filter(function(e){return i[e.toLowerCase()]}).reduce(function(e,t){return e[t]=r[t],e},{}));f.host=(n=t.uri,a=n.port,o=n.protocol,s=n.hostname+":",s+=a||("https:"===o?"443":"80")),c.forEach(t.removeHeader,t);var p,h,l,d,m,g,v,b,y=(l=(p=t).uri,d=p.proxy,h=d,m=["https:"===l.protocol?"https":"http","https:"===h.protocol?"Https":"Http"].join("Over"),k[m]),_=(v=f,{proxy:{host:(b=(g=t).proxy).hostname,port:+b.port,proxyAuth:b.auth,headers:v},headers:g.headers,ca:g.ca,cert:g.cert,key:g.key,passphrase:g.passphrase,pfx:g.pfx,ciphers:g.ciphers,rejectUnauthorized:g.rejectUnauthorized,secureOptions:g.secureOptions,secureProtocol:g.secureProtocol});return t.agent=y(_),!0},n.defaultProxyHeaderWhiteList=i,n.defaultProxyHeaderExclusiveList=x,r.Tunnel=n},{"tunnel-agent":497,url:500}],445:[function(U,H,e){(function(e){"use strict";var w=U("http"),k=U("https"),x=U("url"),t=U("util"),n=U("stream"),f=U("zlib"),c=U("aws-sign2"),u=U("aws4"),i=U("http-signature"),S=U("mime-types"),j=U("caseless"),E=U("forever-agent"),r=U("form-data"),a=U("extend"),A=U("isstream"),I=U("is-typedarray").strict,o=U("./lib/helpers"),s=U("./lib/cookies"),P=U("./lib/getProxyFromURI"),p=U("./lib/querystring").Querystring,h=U("./lib/har").Har,l=U("./lib/auth").Auth,d=U("./lib/oauth").OAuth,m=U("./lib/hawk"),g=U("./lib/multipart").Multipart,v=U("./lib/redirect").Redirect,b=U("./lib/tunnel").Tunnel,y=U("performance-now"),O=U("safe-buffer").Buffer,_=o.safeStringify,T=o.isReadStream,B=o.toBase64,C=o.defer,F=o.copy,R=o.version,z=s.jar(),M={};function N(){return{uri:this.uri,method:this.method,headers:this.headers}}function D(){return{statusCode:this.statusCode,body:this.body,headers:this.headers,request:N.call(this.request)}}function q(e){var t=this;e.har&&(t._har=new h(t),e=t._har.options(e)),n.Stream.call(t);var r=Object.keys(q.prototype),i=function(e,t){var r={};for(var i in t)-1===e.indexOf(i)&&(r[i]=t[i]);return r}(r,e);a(t,i),e=function(e,t){var r={};for(var i in t){var n=!(-1===e.indexOf(i)),a="function"==typeof t[i];n&&a||(r[i]=t[i])}return r}(r,e),t.readable=!0,t.writable=!0,e.method&&(t.explicitMethod=!0),t._qs=new p(t),t._auth=new l(t),t._oauth=new d(t),t._multipart=new g(t),t._redirect=new v(t),t._tunnel=new b(t),t.init(e)}function L(){q.debug&&console.error("REQUEST %s",t.format.apply(t,arguments))}t.inherits(q,n.Stream),q.debug=e.env.NODE_DEBUG&&/\brequest\b/.test(e.env.NODE_DEBUG),q.prototype.debug=L,q.prototype.init=function(e){var i=this;for(var t in e||(e={}),i.headers=i.headers?F(i.headers):{},i.headers)void 0===i.headers[t]&&delete i.headers[t];if(j.httpify(i,i.headers),i.method||(i.method=e.method||"GET"),i.localAddress||(i.localAddress=e.localAddress),i._qs.init(e),L(e),i.pool||!1===i.pool||(i.pool=M),i.dests=i.dests||[],i.__isRequestRequest=!0,!i._callback&&i.callback&&(i._callback=i.callback,i.callback=function(){i._callbackCalled||(i._callbackCalled=!0,i._callback.apply(i,arguments))},i.on("error",i.callback.bind()),i.on("complete",i.callback.bind(i,null))),!i.uri&&i.url&&(i.uri=i.url,delete i.url),i.baseUrl){if("string"!=typeof i.baseUrl)return i.emit("error",new Error("options.baseUrl must be a string"));if("string"!=typeof i.uri)return i.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(0===i.uri.indexOf("//")||-1!==i.uri.indexOf("://"))return i.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var r=i.baseUrl.lastIndexOf("/")===i.baseUrl.length-1,n=0===i.uri.indexOf("/");r&&n?i.uri=i.baseUrl+i.uri.slice(1):r||n?i.uri=i.baseUrl+i.uri:""===i.uri?i.uri=i.baseUrl:i.uri=i.baseUrl+"/"+i.uri,delete i.baseUrl}if(!i.uri)return i.emit("error",new Error("options.uri is a required argument"));if("string"==typeof i.uri&&(i.uri=x.parse(i.uri)),i.uri.href||(i.uri.href=x.format(i.uri)),"unix:"===i.uri.protocol)return i.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if("unix"===i.uri.host&&i.enableUnixSocket(),!1===i.strictSSL&&(i.rejectUnauthorized=!1),i.uri.pathname||(i.uri.pathname="/"),!(i.uri.host||i.uri.hostname&&i.uri.port||i.uri.isUnix)){var a='Invalid URI "'+x.format(i.uri)+'"';return 0===Object.keys(e).length&&(a+=". This can be caused by a crappy redirection."),i.abort(),i.emit("error",new Error(a))}if(i.hasOwnProperty("proxy")||(i.proxy=P(i.uri)),i.tunnel=i._tunnel.isEnabled(),i.proxy&&i._tunnel.setup(e),i._redirect.onRequest(e),i.setHost=!1,!i.hasHeader("host")){var o=i.originalHostHeaderName||"host";i.setHeader(o,i.uri.host),i.uri.port&&("80"===i.uri.port&&"http:"===i.uri.protocol||"443"===i.uri.port&&"https:"===i.uri.protocol)&&i.setHeader(o,i.uri.hostname),i.setHost=!0}if(i.jar(i._jar||e.jar),i.uri.port||("http:"===i.uri.protocol?i.uri.port=80:"https:"===i.uri.protocol&&(i.uri.port=443)),i.proxy&&!i.tunnel?(i.port=i.proxy.port,i.host=i.proxy.hostname):(i.port=i.uri.port,i.host=i.uri.hostname),e.form&&i.form(e.form),e.formData){var s=e.formData,c=i.form(),u=function(e,t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?c.append(e,t.value,t.options):c.append(e,t)};for(var f in s)if(s.hasOwnProperty(f)){var p=s[f];if(p instanceof Array)for(var h=0;h>>32-t}function S(e,t,r,i,n,a,o,s){return x(e+(t^r^i)+a+o|0,s)+n|0}function j(e,t,r,i,n,a,o,s){return x(e+(t&r|~t&i)+a+o|0,s)+n|0}function E(e,t,r,i,n,a,o,s){return x(e+((t|~r)^i)+a+o|0,s)+n|0}function A(e,t,r,i,n,a,o,s){return x(e+(t&i|r&~i)+a+o|0,s)+n|0}function I(e,t,r,i,n,a,o,s){return x(e+(t^(r|~i))+a+o|0,s)+n|0}n(o,a),o.prototype._update=function(){for(var e=g,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,a=0|this._d,o=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,f=0|this._d,p=0|this._e,h=0;h<80;h+=1){var l,d;d=h<16?(l=S(r,i,n,a,o,e[v[h]],w[0],y[h]),I(s,c,u,f,p,e[b[h]],k[0],_[h])):h<32?(l=j(r,i,n,a,o,e[v[h]],w[1],y[h]),A(s,c,u,f,p,e[b[h]],k[1],_[h])):h<48?(l=E(r,i,n,a,o,e[v[h]],w[2],y[h]),E(s,c,u,f,p,e[b[h]],k[2],_[h])):h<64?(l=A(r,i,n,a,o,e[v[h]],w[3],y[h]),j(s,c,u,f,p,e[b[h]],k[3],_[h])):(l=I(r,i,n,a,o,e[v[h]],w[4],y[h]),S(s,c,u,f,p,e[b[h]],k[4],_[h])),r=o,o=a,a=x(n,10),n=i,i=l,s=p,p=f,f=x(u,10),u=c,c=d}var m=this._b+n+f|0;this._b=this._c+a+p|0,this._c=this._d+o+s|0,this._d=this._e+r+c|0,this._e=this._a+i+u|0,this._a=m},o.prototype._digest=function(){this._block[this._blockOffset++]=128,56=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 a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":447}],450:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":451,"./sha1":452,"./sha224":453,"./sha256":454,"./sha384":455,"./sha512":456}],451:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,v=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s=this._w,c=0|this._a,u=0|this._b,f=0|this._c,p=0|this._d,h=0|this._e,l=0;l<16;++l)s[l]=e.readInt32BE(4*l);for(;l<80;++l)s[l]=s[l-3]^s[l-8]^s[l-14]^s[l-16];for(var d=0;d<80;++d){var m=~~(d/20),g=0|((o=c)<<5|o>>>27)+(i=u,n=f,a=p,0===(r=m)?i&n|~i&a:2===r?i&n|i&a|n&a:i^n^a)+h+s[d]+v[m];h=p,p=f,f=(t=u)<<30|t>>>2,u=c,c=g}this._a=c+this._a|0,this._b=u+this._b|0,this._c=f+this._c|0,this._d=p+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],452:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0;d<16;++d)c[d]=e.readInt32BE(4*d);for(;d<80;++d)c[d]=(t=c[d-3]^c[d-8]^c[d-14]^c[d-16])<<1|t>>>31;for(var m=0;m<80;++m){var g=~~(m/20),v=0|((s=u)<<5|s>>>27)+(n=f,a=p,o=h,0===(i=g)?n&a|~n&o:2===i?n&a|n&o|a&o:n^a^o)+l+c[m]+b[g];l=h,h=p,p=(r=f)<<30|r>>>2,f=u,u=v}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],453:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}i(c,n),c.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},c.prototype._hash=function(){var e=o.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},t.exports=c},{"./hash":449,"./sha256":454,inherits:320,"safe-buffer":447}],454:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,w=[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],o=new Array(64);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0|this._f,m=0|this._g,g=0|this._h,v=0;v<16;++v)c[v]=e.readInt32BE(4*v);for(;v<64;++v)c[v]=0|(((r=c[v-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+c[v-7]+(((t=c[v-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+c[v-16];for(var b=0;b<64;++b){var y=g+(((s=l)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((o=m)^l&(d^o))+w[b]+c[b]|0,_=0|(((a=u)>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+((i=u)&(n=f)|p&(i|n));g=m,m=d,d=l,l=h+y|0,h=p,p=f,f=u,u=y+_|0}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],455:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(160);function c(){this.init(),this._w=s,a.call(this,128,112)}i(c,n),c.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},c.prototype._hash=function(){var i=o.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=c},{"./hash":449,"./sha512":456,inherits:320,"safe-buffer":447}],456:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,ee=[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],o=new Array(160);function s(){this.init(),this._w=o,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ae(e,t){return e>>>0>>0?1:0}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c,u=this._w,f=0|this._ah,p=0|this._bh,h=0|this._ch,l=0|this._dh,d=0|this._eh,m=0|this._fh,g=0|this._gh,v=0|this._hh,b=0|this._al,y=0|this._bl,_=0|this._cl,w=0|this._dl,k=0|this._el,x=0|this._fl,S=0|this._gl,j=0|this._hl,E=0;E<32;E+=2)u[E]=e.readInt32BE(4*E),u[E+1]=e.readInt32BE(4*E+4);for(;E<160;E+=2){var A=u[E-30],I=u[E-30+1],P=((s=A)>>>1|(c=I)<<31)^(s>>>8|c<<24)^s>>>7,O=((a=I)>>>1|(o=A)<<31)^(a>>>8|o<<24)^(a>>>7|o<<25);A=u[E-4],I=u[E-4+1];var T=((i=A)>>>19|(n=I)<<13)^(n>>>29|i<<3)^i>>>6,B=((t=I)>>>19|(r=A)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),C=u[E-14],F=u[E-14+1],R=u[E-32],z=u[E-32+1],M=O+F|0,N=P+C+ae(M,O)|0;N=(N=N+T+ae(M=M+B|0,B)|0)+R+ae(M=M+z|0,z)|0,u[E]=N,u[E+1]=M}for(var D=0;D<160;D+=2){N=u[D],M=u[D+1];var q=re(f,p,h),L=re(b,y,_),U=ie(f,b),H=ie(b,f),K=ne(d,k),V=ne(k,d),G=ee[D],$=ee[D+1],W=te(d,m,g),Z=te(k,x,S),Y=j+V|0,X=v+K+ae(Y,j)|0;X=(X=(X=X+W+ae(Y=Y+Z|0,Z)|0)+G+ae(Y=Y+$|0,$)|0)+N+ae(Y=Y+M|0,M)|0;var J=H+L|0,Q=U+q+ae(J,H)|0;v=g,j=S,g=m,S=x,m=d,x=k,d=l+X+ae(k=w+Y|0,w)|0,l=h,w=_,h=p,_=y,p=f,y=b,f=X+Q+ae(b=Y+J|0,Y)|0}this._al=this._al+b|0,this._bl=this._bl+y|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+k|0,this._fl=this._fl+x|0,this._gl=this._gl+S|0,this._hl=this._hl+j|0,this._ah=this._ah+f+ae(this._al,b)|0,this._bh=this._bh+p+ae(this._bl,y)|0,this._ch=this._ch+h+ae(this._cl,_)|0,this._dh=this._dh+l+ae(this._dl,w)|0,this._eh=this._eh+d+ae(this._el,k)|0,this._fh=this._fh+m+ae(this._fl,x)|0,this._gh=this._gh+g+ae(this._gl,S)|0,this._hh=this._hh+v+ae(this._hl,j)|0},s.prototype._hash=function(){var i=a.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],457:[function(e,t,r){var i=e("safer-buffer").Buffer,n={dsa:{parts:["p","q","g","y"],sizePart:"p"},rsa:{parts:["e","n"],sizePart:"n"},ecdsa:{parts:["curve","Q"],sizePart:"Q"},ed25519:{parts:["A"],sizePart:"A"}};n.curve25519=n.ed25519;var a={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};a.curve25519=a.ed25519;var o={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:i.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g,""),"hex"),s:i.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g,""),"hex"),n:i.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g,""),"hex"),G:i.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g,""),"hex"),s:i.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g,""),"hex"),n:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g,""),"hex"),G:i.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:i.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g,""),"hex"),a:i.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g,""),"hex"),s:i.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g,""),"hex"),n:i.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g,""),"hex"),G:i.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g,""),"hex")}};t.exports={info:n,privInfo:a,hashAlgs:{md5:!0,sha1:!0,sha256:!0,sha384:!0,sha512:!0},curves:o}},{"safer-buffer":448}],458:[function(e,t,r){t.exports=_;var d=e("assert-plus"),m=e("safer-buffer").Buffer,i=e("./algs"),n=e("crypto"),a=e("./fingerprint"),o=(e("./signature"),e("./errors")),g=(e("util"),e("./utils")),v=e("./key"),b=e("./private-key"),y=e("./identity"),s={};s.openssh=e("./formats/openssh-cert"),s.x509=e("./formats/x509"),s.pem=e("./formats/x509-pem");var c=o.CertificateParseError,u=o.InvalidAlgorithmError;function _(e){d.object(e,"options"),d.arrayOfObject(e.subjects,"options.subjects"),g.assertCompatible(e.subjects[0],y,[1,0],"options.subjects"),g.assertCompatible(e.subjectKey,v,[1,0],"options.subjectKey"),g.assertCompatible(e.issuer,y,[1,0],"options.issuer"),void 0!==e.issuerKey&&g.assertCompatible(e.issuerKey,v,[1,0],"options.issuerKey"),d.object(e.signatures,"options.signatures"),d.buffer(e.serial,"options.serial"),d.date(e.validFrom,"options.validFrom"),d.date(e.validUntil,"optons.validUntil"),d.optionalArrayOfString(e.purposes,"options.purposes"),this._hashCache={},this.subjects=e.subjects,this.issuer=e.issuer,this.subjectKey=e.subjectKey,this.issuerKey=e.issuerKey,this.signatures=e.signatures,this.serial=e.serial,this.validFrom=e.validFrom,this.validUntil=e.validUntil,this.purposes=e.purposes}_.formats=s,_.prototype.toBuffer=function(e,t){return void 0===e&&(e="x509"),d.string(e,"format"),d.object(s[e],"formats[format]"),d.optionalObject(t,"options"),s[e].write(this,t)},_.prototype.toString=function(e,t){return void 0===e&&(e="pem"),this.toBuffer(e,t).toString()},_.prototype.fingerprint=function(e){void 0===e&&(e="sha256"),d.string(e,"algorithm");var t={type:"certificate",hash:this.hash(e),algorithm:e};return new a(t)},_.prototype.hash=function(e){if(d.string(e,"algorithm"),e=e.toLowerCase(),void 0===i.hashAlgs[e])throw new u(e);if(this._hashCache[e])return this._hashCache[e];var t=n.createHash(e).update(this.toBuffer("x509")).digest();return this._hashCache[e]=t},_.prototype.isExpired=function(e){return void 0===e&&(e=new Date),!(e.getTime()>=this.validFrom.getTime()&&e.getTime()e.length||"BEGIN"!==e.slice(t,t+5).toString("ascii"))}(e))return a.read(e,t);if(function(e){var t=0;for(;to.length&&(p=o.length),u+=c.write(o.slice(f,p),u),c[u++]=10,f=p}return u+=c.write("-----END "+i+"-----\n",u),c.slice(0,u)}};var b=e("assert-plus"),y=e("asn1"),_=e("crypto"),w=e("safer-buffer").Buffer,k=(e("../algs"),e("../utils")),h=e("../key"),l=e("../private-key"),x=e("./pkcs1"),S=e("./pkcs8"),j=e("./ssh-private"),E=e("./rfc4253"),A=e("../errors")},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../utils":480,"./pkcs1":467,"./pkcs8":468,"./rfc4253":469,"./ssh-private":470,asn1:65,"assert-plus":66,crypto:204,"safer-buffer":448}],467:[function(e,t,r){t.exports={read:function(e,t){return i.read(e,t,"pkcs1")},readPkcs1:function(e,t,r){switch(e){case"RSA":if("public"===t)return u=y(c=r,"modulus"),f=y(c,"exponent"),new p({type:"rsa",parts:[{name:"e",data:f},{name:"n",data:u}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t[0],0);var r=y(e,"modulus"),i=y(e,"public exponent"),n=y(e,"private exponent"),a=y(e,"prime1"),o=y(e,"prime2"),s=y(e,"exponent1"),c=y(e,"exponent2"),u=y(e,"iqmp");return new v({type:"rsa",parts:[{name:"n",data:r},{name:"e",data:i},{name:"d",data:n},{name:"iqmp",data:u},{name:"p",data:a},{name:"q",data:o},{name:"dmodp",data:s},{name:"dmodq",data:c}]})}(r);throw new Error("Unknown key type: "+t);case"DSA":if("public"===t)return n=y(i=r,"y"),a=y(i,"p"),o=y(i,"q"),s=y(i,"g"),new p({type:"dsa",parts:[{name:"y",data:n},{name:"p",data:a},{name:"q",data:o},{name:"g",data:s}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),0);var r=y(e,"p"),i=y(e,"q"),n=y(e,"g"),a=y(e,"y"),o=y(e,"x");return new v({type:"dsa",parts:[{name:"p",data:r},{name:"q",data:i},{name:"g",data:n},{name:"y",data:a},{name:"x",data:o}]})}(r);throw new Error("Unknown key type: "+t);case"EC":case"ECDSA":if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),1);var r=e.readString(l.Ber.OctetString,!0);e.readSequence(160);var i=b(e);h.string(i,"a known elliptic curve"),e.readSequence(161);var n=e.readString(l.Ber.BitString,!0);n=g.ecNormalize(n);var a={type:"ecdsa",parts:[{name:"curve",data:d.from(i)},{name:"Q",data:n},{name:"d",data:r}]};return new v(a)}(r);if("public"===t)return function(e){e.readSequence();var t=e.readOID();h.strictEqual(t,"1.2.840.10045.2.1","must be ecPublicKey");for(var r,i=e.readOID(),n=Object.keys(m.curves),a=0;aS.length&&(I=S.length),E+=x.write(S.slice(A,I),E),x[E++]=10,A=I}return E+=x.write("-----END "+k+"-----\n",E),x.slice(0,E)}};var O,T=P("assert-plus"),B=(P("asn1"),P("safer-buffer").Buffer),C=(P("../algs"),P("../utils")),F=P("crypto"),R=(P("../key"),P("../private-key")),r=P("./pem"),A=P("./rfc4253"),z=P("../ssh-buffer"),I=P("../errors");var M="openssh-key-v1"},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../ssh-buffer":479,"../utils":480,"./pem":466,"./rfc4253":469,asn1:65,"assert-plus":66,"bcrypt-pbkdf":76,crypto:204,"safer-buffer":448}],471:[function(e,t,r){t.exports={read:function(e,t){"string"!=typeof e&&(h.buffer(e,"buf"),e=e.toString("ascii"));var r=e.trim().replace(/[\\\r]/g,""),i=r.match(m);i||(i=r.match(g));h.ok(i,"key must match regex");var n,a=d.algToKeyType(i[1]),o=l.from(i[2],"base64"),s={};if(i[4])try{n=d.read(o)}catch(e){i=r.match(g),h.ok(i,"key must match regex"),o=l.from(i[2],"base64"),n=d.readInternal(s,"public",o)}else n=d.readInternal(s,"public",o);if(h.strictEqual(a,n.type),i[4]&&0n.length&&(u=n.length),s+=o.write(n.slice(c,u),s),o[s++]=10,c=u}return s+=o.write("-----END "+i+"-----\n",s),o.slice(0,s)}};var o=e("assert-plus"),p=(e("asn1"),e("safer-buffer").Buffer);e("../algs"),e("../utils"),e("../key"),e("../private-key"),e("./pem"),e("../identity"),e("../signature"),e("../certificate")},{"../algs":457,"../certificate":458,"../identity":474,"../key":476,"../private-key":477,"../signature":478,"../utils":480,"./pem":466,"./x509":473,asn1:65,"assert-plus":66,"safer-buffer":448}],473:[function(e,t,r){t.exports={read:function(e,t){"string"==typeof e&&(e=_.from(e,"binary"));b.buffer(e,"buf");var r=new y.BerReader(e);if(r.readSequence(),1=this._buffer.length},a.prototype.remainder=function(){return this._buffer.slice(this._offset)},a.prototype.skip=function(e){this._offset+=e},a.prototype.expand=function(){this._size*=2;var e=n.alloc(this._size);this._buffer.copy(e,0),this._buffer=e},a.prototype.readPart=function(){return{data:this.readBuffer()}},a.prototype.readBuffer=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4,i.ok(this._offset+e<=this._buffer.length,"length out of bounds at +0x"+this._offset.toString(16)+" (data truncated?)");var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t},a.prototype.readString=function(){return this.readBuffer().toString()},a.prototype.readCString=function(){for(var e=this._offset;ethis._size;)this.expand();this._buffer.writeUInt32BE(e.length,this._offset),this._offset+=4,e.copy(this._buffer,this._offset),this._offset+=e.length},a.prototype.writeString=function(e){this.writeBuffer(n.from(e,"utf8"))},a.prototype.writeCString=function(e){for(;this._offset+1+e.length>this._size;)this.expand();this._buffer.write(e,this._offset),this._offset+=e.length,this._buffer[this._offset++]=0},a.prototype.writeInt=function(e){for(;this._offset+4>this._size;)this.expand();this._buffer.writeUInt32BE(e,this._offset),this._offset+=4},a.prototype.writeInt64=function(e){if(i.buffer(e,"value"),8this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=8},a.prototype.writeChar=function(e){for(;this._offset+1>this._size;)this.expand();this._buffer[this._offset++]=e},a.prototype.writePart=function(e){this.writeBuffer(e.data)},a.prototype.write=function(e){for(;this._offset+e.length>this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=e.length}},{"assert-plus":66,"safer-buffer":448}],480:[function(e,t,r){t.exports={bufferSplit:function(e,t){p.buffer(e),p.string(t);for(var r=[],i=0,n=0,a=0;a=t.length){var o=a+1;r.push(e.slice(i,o-n)),i=o,n=0}i<=e.length&&r.push(e.slice(i,e.length));return r},addRSAMissing:function(e){p.object(e),u(e,s,[1,1]);var t,r=new g(e.part.d.data);if(!e.part.dmodp){var i=new g(e.part.p.data),n=r.mod(i.subtract(1));t=_(n),e.part.dmodp={name:"dmodp",data:t},e.parts.push(e.part.dmodp)}if(!e.part.dmodq){var a=new g(e.part.q.data),o=r.mod(a.subtract(1));t=_(o),e.part.dmodq={name:"dmodq",data:t},e.parts.push(e.part.dmodq)}},calculateDSAPublic:function(e,t,r){return p.buffer(e),p.buffer(t),p.buffer(r),e=new g(e),t=new g(t),r=new g(r),_(e.modPow(r,t))},calculateED25519Public:function(e){p.buffer(e);var t=i.sign.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},calculateX25519Public:function(e){p.buffer(e);var t=i.box.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},mpNormalize:y,mpDenormalize:function(e){p.buffer(e);for(;1c)return!1;if(i.constructor.name!==t.name)return!1;var a=i._sshpkApiVersion;void 0===a&&(a=t._oldVersionDetect(e));return!(a[0]!=r[0]||a[1]t;)p.equal(e[0],0),e=e.slice(1);for(;e.length=r[1],i+" must be compatible with "+t.name+" klass version "+r[0]+"."+r[1])}}var v={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}},b=8;function y(e){for(p.buffer(e);1t._pos){var i=r.substr(t._pos);if("x-user-defined"===t._charset){for(var n=new p(i.length),a=0;at._pos&&(t.push(new p(new Uint8Array(o.result.slice(t._pos)))),t._pos=o.result.byteLength)},o.onload=function(){t.push(null)},o.readAsArrayBuffer(r)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":484,_process:382,buffer:191,inherits:320,"readable-stream":426}],487:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=p,t=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1=2.4.3 <2.5.0",_id:"tough-cookie@2.4.3",_inCache:!0,_installable:!0,_location:"/tough-cookie",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/tough-cookie_2.4.3_1529960207843_0.4882910670728131"},_npmUser:{email:"jstash@gmail.com",name:"jstash"},_npmVersion:"6.1.0",_phantomChildren:{},_requested:{name:"tough-cookie",raw:"tough-cookie@~2.4.3",rawSpec:"~2.4.3",scope:null,spec:">=2.4.3 <2.5.0",type:"range"},_requiredBy:["/request","/request-promise"],_resolved:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",_shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",_shrinkwrap:null,_spec:"tough-cookie@~2.4.3",_where:"/home/administrator/javascript-opentimestamps/node_modules/request",author:{email:"jstash@gmail.com",name:"Jeremy Stashewsky"},bugs:{url:"https://github.com/salesforce/tough-cookie/issues"},contributors:[{name:"Alexander Savin"},{name:"Ian Livingstone"},{name:"Ivan Nikulin"},{name:"Lalit Kapoor"},{name:"Sam Thompson"},{name:"Sebastian Mayr"}],dependencies:{psl:"^1.1.24",punycode:"^1.4.1"},description:"RFC6265 Cookies and Cookie Jar for node.js",devDependencies:{async:"^1.4.2",nyc:"^11.6.0","string.prototype.repeat":"^0.2.0",vows:"^0.8.1"},directories:{},dist:{fileCount:9,integrity:"sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMVcQCRA9TVsSAnZWagAAzX0P/2COkbzb3dOX/FTOYIVL\n7oHge7BvGODNkEHTjBtNsR0jO/AA/gVcUOq6CSmFH+UC14LrmCyNDemQvD15\njnYuJXUIiZsSZO7BGGbOFYrQF+DKLiwgf0LokrIM8KasZ5nxc5xS1jYHG5o+\nwCqutfhlRTqlPbZsexB+eRlIuYNvpsbRAdSDYXrhLJNMZgx49g/SZ7IwunGN\nJ/5Fe041MZqqdi7MAavM3T7vX9IvVRJJ3f4xAEVxY1vh4s0dN+h4fG2eMQzL\nOiaulRUIahs4xmJUYHZgZESc9eTIrI8K+YT7i3r35TGc0Du7ueB2KYxBqy7q\n6AUFbdX9Ep308kTVsTf/h4wE0RvdxKLfZ0ww7T1ivADX9xMi2oIvVtyhCQHo\nSIpyBhaav/fTufF0/Fu4Lcr7PMJxyvF0UcNRqrPmEQTw4UZkFKfT8HN2P5cH\nBvJsFwpeEjt84tt5pJ/bmD0j0EUCLUXLGH6fbA84fHpZGifO239zSf262Qdv\nSXeygU7YxnK8wOCnvlauZx/gp+/WTMfMdODxiX0QnqwS5BctiPCgGG1cKJcC\nqvTECaAEmxMVf/gEW73oxVXJgUO7f6jJaWoawV7ka+wR91W9Bp0pKGOOAxAG\nU72rmnwQKid9U7ly5833sb3D+lbzKJXGNIqohegP4daKZfNNTaLWZXmKE+Iy\n7Vml\r\n=8KpS\r\n-----END PGP SIGNATURE-----\r\n",shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",tarball:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",unpackedSize:83959},engines:{node:">=0.8"},files:["lib"],gitHead:"671ad413b38d7464352886772f57a7ec417d4760",homepage:"https://github.com/salesforce/tough-cookie",keywords:["HTTP","RFC2965","RFC6265","cookie","cookiejar","cookies","jar","set-cookie"],license:"BSD-3-Clause",main:"./lib/cookie",maintainers:[{name:"awaterma",email:"awaterma@awaterma.net"},{name:"jstash",email:"jstash@gmail.com"},{name:"maratto",email:"marat+npm@salesforce.com"},{name:"ruoho",email:"clint@ruoho.org"}],name:"tough-cookie",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/salesforce/tough-cookie.git"},scripts:{cover:"nyc --reporter=lcov --reporter=html vows test/*_test.js",test:"vows test/*_test.js"},version:"2.4.3"}},{}],497:[function(s,e,c){(function(u){"use strict";s("net");var f,a=s("tls"),r=s("http"),i=s("https"),e=s("events"),p=s("assert"),t=s("util"),h=s("safe-buffer").Buffer;function o(e){var o=this;o.options=e||{},o.proxyOptions=o.options.proxy||{},o.maxSockets=o.options.maxSockets||r.Agent.defaultMaxSockets,o.requests=[],o.sockets=[],o.on("free",function(e,t,r){for(var i=0,n=o.requests.length;i=this.maxSockets?this.requests.push({host:t.host,port:t.port,request:e}):this.createConnection({host:t.host,port:t.port,request:e})},o.prototype.createConnection=function(e){var n=this;n.createSocket(e,function(t){function r(){n.emit("free",t,e.host,e.port)}function i(e){n.removeSocket(t),t.removeListener("free",r),t.removeListener("close",i),t.removeListener("agentRemove",i)}t.on("free",r),t.on("close",i),t.on("agentRemove",i),e.request.onSocket(t)})},o.prototype.createSocket=function(n,a){var o=this,s={};o.sockets.push(s);var e=l({},o.proxyOptions,{method:"CONNECT",path:n.host+":"+n.port,agent:!1});e.proxyAuth&&(e.headers=e.headers||{},e.headers["Proxy-Authorization"]="Basic "+h.from(e.proxyAuth).toString("base64")),f("making CONNECT request");var c=o.request(e);function i(e,t,r){if(c.removeAllListeners(),t.removeAllListeners(),200===e.statusCode)p.equal(r.length,0),f("tunneling connection has established"),o.sockets[o.sockets.indexOf(s)]=t,a(t);else{f("tunneling socket could not be established, statusCode=%d",e.statusCode);var i=new Error("tunneling socket could not be established, statusCode="+e.statusCode);i.code="ECONNRESET",n.request.emit("error",i),o.removeSocket(s)}}c.useChunkedEncodingByDefault=!1,c.once("response",function(e){e.upgrade=!0}),c.once("upgrade",function(e,t,r){u.nextTick(function(){i(e,t,r)})}),c.once("connect",i),c.once("error",function(e){c.removeAllListeners(),f("tunneling socket could not be established, cause=%s\n",e.message,e.stack);var t=new Error("tunneling socket could not be established, cause="+e.message);t.code="ECONNRESET",n.request.emit("error",t),o.removeSocket(s)}),c.end()},o.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},f=u.env.NODE_DEBUG&&/\btunnel\b/.test(u.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},c.debug=f}).call(this,s("_process"))},{_process:382,assert:67,events:269,http:483,https:317,net:187,"safe-buffer":447,tls:187,util:505}],498:[function(e,t,r){!function(a){"use strict";var m=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function d(e,t,r,i,n){var a,o=0;for(a=0;a>>8)-1}function v(e,t,r,i){return d(e,t,r,i,16)}function b(e,t,r,i){return d(e,t,r,i,32)}function y(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=a,k=o,x=s,S=c,j=u,E=f,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=0;M<20;M+=2)w^=(n=(C^=(n=(P^=(n=(j^=(n=w+C|0)<<7|n>>>25)+w|0)<<9|n>>>23)+j|0)<<13|n>>>19)+P|0)<<18|n>>>14,E^=(n=(k^=(n=(F^=(n=(O^=(n=E+k|0)<<7|n>>>25)+E|0)<<9|n>>>23)+O|0)<<13|n>>>19)+F|0)<<18|n>>>14,T^=(n=(A^=(n=(x^=(n=(R^=(n=T+A|0)<<7|n>>>25)+T|0)<<9|n>>>23)+R|0)<<13|n>>>19)+x|0)<<18|n>>>14,z^=(n=(B^=(n=(I^=(n=(S^=(n=z+B|0)<<7|n>>>25)+z|0)<<9|n>>>23)+S|0)<<13|n>>>19)+I|0)<<18|n>>>14,w^=(n=(S^=(n=(x^=(n=(k^=(n=w+S|0)<<7|n>>>25)+w|0)<<9|n>>>23)+k|0)<<13|n>>>19)+x|0)<<18|n>>>14,E^=(n=(j^=(n=(I^=(n=(A^=(n=E+j|0)<<7|n>>>25)+E|0)<<9|n>>>23)+A|0)<<13|n>>>19)+I|0)<<18|n>>>14,T^=(n=(O^=(n=(P^=(n=(B^=(n=T+O|0)<<7|n>>>25)+T|0)<<9|n>>>23)+B|0)<<13|n>>>19)+P|0)<<18|n>>>14,z^=(n=(R^=(n=(F^=(n=(C^=(n=z+R|0)<<7|n>>>25)+z|0)<<9|n>>>23)+C|0)<<13|n>>>19)+F|0)<<18|n>>>14;w=w+a|0,k=k+o|0,x=x+s|0,S=S+c|0,j=j+u|0,E=E+f|0,A=A+p|0,I=I+h|0,P=P+l|0,O=O+d|0,T=T+m|0,B=B+g|0,C=C+v|0,F=F+b|0,R=R+y|0,z=z+_|0,e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=x>>>0&255,e[9]=x>>>8&255,e[10]=x>>>16&255,e[11]=x>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=j>>>0&255,e[17]=j>>>8&255,e[18]=j>>>16&255,e[19]=j>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=B>>>0&255,e[45]=B>>>8&255,e[46]=B>>>16&255,e[47]=B>>>24&255,e[48]=C>>>0&255,e[49]=C>>>8&255,e[50]=C>>>16&255,e[51]=C>>>24&255,e[52]=F>>>0&255,e[53]=F>>>8&255,e[54]=F>>>16&255,e[55]=F>>>24&255,e[56]=R>>>0&255,e[57]=R>>>8&255,e[58]=R>>>16&255,e[59]=R>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,i)}function _(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=0;w<20;w+=2)a^=(n=(v^=(n=(l^=(n=(u^=(n=a+v|0)<<7|n>>>25)+a|0)<<9|n>>>23)+u|0)<<13|n>>>19)+l|0)<<18|n>>>14,f^=(n=(o^=(n=(b^=(n=(d^=(n=f+o|0)<<7|n>>>25)+f|0)<<9|n>>>23)+d|0)<<13|n>>>19)+b|0)<<18|n>>>14,m^=(n=(p^=(n=(s^=(n=(y^=(n=m+p|0)<<7|n>>>25)+m|0)<<9|n>>>23)+y|0)<<13|n>>>19)+s|0)<<18|n>>>14,_^=(n=(g^=(n=(h^=(n=(c^=(n=_+g|0)<<7|n>>>25)+_|0)<<9|n>>>23)+c|0)<<13|n>>>19)+h|0)<<18|n>>>14,a^=(n=(c^=(n=(s^=(n=(o^=(n=a+c|0)<<7|n>>>25)+a|0)<<9|n>>>23)+o|0)<<13|n>>>19)+s|0)<<18|n>>>14,f^=(n=(u^=(n=(h^=(n=(p^=(n=f+u|0)<<7|n>>>25)+f|0)<<9|n>>>23)+p|0)<<13|n>>>19)+h|0)<<18|n>>>14,m^=(n=(d^=(n=(l^=(n=(g^=(n=m+d|0)<<7|n>>>25)+m|0)<<9|n>>>23)+g|0)<<13|n>>>19)+l|0)<<18|n>>>14,_^=(n=(y^=(n=(b^=(n=(v^=(n=_+y|0)<<7|n>>>25)+_|0)<<9|n>>>23)+v|0)<<13|n>>>19)+b|0)<<18|n>>>14;e[0]=a>>>0&255,e[1]=a>>>8&255,e[2]=a>>>16&255,e[3]=a>>>24&255,e[4]=f>>>0&255,e[5]=f>>>8&255,e[6]=f>>>16&255,e[7]=f>>>24&255,e[8]=m>>>0&255,e[9]=m>>>8&255,e[10]=m>>>16&255,e[11]=m>>>24&255,e[12]=_>>>0&255,e[13]=_>>>8&255,e[14]=_>>>16&255,e[15]=_>>>24&255,e[16]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255}(e,t,r,i)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function k(e,t,r,i,n,a,o){var s,c,u=new Uint8Array(16),f=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=a[c];for(;64<=n;){for(y(f,u,o,w),c=0;c<64;c++)e[t+c]=r[i+c]^f[c];for(s=1,c=8;c<16;c++)s=s+(255&u[c])|0,u[c]=255&s,s>>>=8;n-=64,t+=64,i+=64}if(0>>=8;r-=64,t+=64}if(0>>13|r<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|i<<6),n=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|n<<9),a=255&e[8]|(255&e[9])<<8,this.r[4]=255&(n>>>4|a<<12),this.r[5]=a>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(a>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,r,i,n,a){var o=new E(a);return o.update(r,i,n),o.finish(e,t),0}function I(e,t,r,i,n,a){var o=new Uint8Array(16);return A(o,0,r,i,n,a),v(e,t,o,0)}function P(e,t,r,i,n){var a;if(r<32)return-1;for(j(e,0,t,0,r,i,n),A(e,16,e,32,r-32,e),a=0;a<16;a++)e[a]=0;return 0}function O(e,t,r,i,n){var a,o=new Uint8Array(32);if(r<32)return-1;if(S(o,0,32,i,n),0!==I(t,16,t,32,r-32,o))return-1;for(j(e,0,t,0,r,i,n),a=0;a<32;a++)e[a]=0;return 0}function T(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function C(e,t,r){for(var i,n=~(r-1),a=0;a<16;a++)i=n&(e[a]^t[a]),e[a]^=i,t[a]^=i}function F(e,t){var r,i,n,a=m(),o=m();for(r=0;r<16;r++)o[r]=t[r];for(B(o),B(o),B(o),i=0;i<2;i++){for(a[0]=o[0]-65517,r=1;r<15;r++)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),n=a[15]>>16&1,a[14]&=65535,C(o,a,1-n)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function R(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return F(r,e),F(i,t),b(r,0,i,0)}function z(e){var t=new Uint8Array(32);return F(t,e),1&t[0]}function M(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function N(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function D(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function q(e,t,r){var i,n,a=0,o=0,s=0,c=0,u=0,f=0,p=0,h=0,l=0,d=0,m=0,g=0,v=0,b=0,y=0,_=0,w=0,k=0,x=0,S=0,j=0,E=0,A=0,I=0,P=0,O=0,T=0,B=0,C=0,F=0,R=0,z=r[0],M=r[1],N=r[2],D=r[3],q=r[4],L=r[5],U=r[6],H=r[7],K=r[8],V=r[9],G=r[10],$=r[11],W=r[12],Z=r[13],Y=r[14],X=r[15];a+=(i=t[0])*z,o+=i*M,s+=i*N,c+=i*D,u+=i*q,f+=i*L,p+=i*U,h+=i*H,l+=i*K,d+=i*V,m+=i*G,g+=i*$,v+=i*W,b+=i*Z,y+=i*Y,_+=i*X,o+=(i=t[1])*z,s+=i*M,c+=i*N,u+=i*D,f+=i*q,p+=i*L,h+=i*U,l+=i*H,d+=i*K,m+=i*V,g+=i*G,v+=i*$,b+=i*W,y+=i*Z,_+=i*Y,w+=i*X,s+=(i=t[2])*z,c+=i*M,u+=i*N,f+=i*D,p+=i*q,h+=i*L,l+=i*U,d+=i*H,m+=i*K,g+=i*V,v+=i*G,b+=i*$,y+=i*W,_+=i*Z,w+=i*Y,k+=i*X,c+=(i=t[3])*z,u+=i*M,f+=i*N,p+=i*D,h+=i*q,l+=i*L,d+=i*U,m+=i*H,g+=i*K,v+=i*V,b+=i*G,y+=i*$,_+=i*W,w+=i*Z,k+=i*Y,x+=i*X,u+=(i=t[4])*z,f+=i*M,p+=i*N,h+=i*D,l+=i*q,d+=i*L,m+=i*U,g+=i*H,v+=i*K,b+=i*V,y+=i*G,_+=i*$,w+=i*W,k+=i*Z,x+=i*Y,S+=i*X,f+=(i=t[5])*z,p+=i*M,h+=i*N,l+=i*D,d+=i*q,m+=i*L,g+=i*U,v+=i*H,b+=i*K,y+=i*V,_+=i*G,w+=i*$,k+=i*W,x+=i*Z,S+=i*Y,j+=i*X,p+=(i=t[6])*z,h+=i*M,l+=i*N,d+=i*D,m+=i*q,g+=i*L,v+=i*U,b+=i*H,y+=i*K,_+=i*V,w+=i*G,k+=i*$,x+=i*W,S+=i*Z,j+=i*Y,E+=i*X,h+=(i=t[7])*z,l+=i*M,d+=i*N,m+=i*D,g+=i*q,v+=i*L,b+=i*U,y+=i*H,_+=i*K,w+=i*V,k+=i*G,x+=i*$,S+=i*W,j+=i*Z,E+=i*Y,A+=i*X,l+=(i=t[8])*z,d+=i*M,m+=i*N,g+=i*D,v+=i*q,b+=i*L,y+=i*U,_+=i*H,w+=i*K,k+=i*V,x+=i*G,S+=i*$,j+=i*W,E+=i*Z,A+=i*Y,I+=i*X,d+=(i=t[9])*z,m+=i*M,g+=i*N,v+=i*D,b+=i*q,y+=i*L,_+=i*U,w+=i*H,k+=i*K,x+=i*V,S+=i*G,j+=i*$,E+=i*W,A+=i*Z,I+=i*Y,P+=i*X,m+=(i=t[10])*z,g+=i*M,v+=i*N,b+=i*D,y+=i*q,_+=i*L,w+=i*U,k+=i*H,x+=i*K,S+=i*V,j+=i*G,E+=i*$,A+=i*W,I+=i*Z,P+=i*Y,O+=i*X,g+=(i=t[11])*z,v+=i*M,b+=i*N,y+=i*D,_+=i*q,w+=i*L,k+=i*U,x+=i*H,S+=i*K,j+=i*V,E+=i*G,A+=i*$,I+=i*W,P+=i*Z,O+=i*Y,T+=i*X,v+=(i=t[12])*z,b+=i*M,y+=i*N,_+=i*D,w+=i*q,k+=i*L,x+=i*U,S+=i*H,j+=i*K,E+=i*V,A+=i*G,I+=i*$,P+=i*W,O+=i*Z,T+=i*Y,B+=i*X,b+=(i=t[13])*z,y+=i*M,_+=i*N,w+=i*D,k+=i*q,x+=i*L,S+=i*U,j+=i*H,E+=i*K,A+=i*V,I+=i*G,P+=i*$,O+=i*W,T+=i*Z,B+=i*Y,C+=i*X,y+=(i=t[14])*z,_+=i*M,w+=i*N,k+=i*D,x+=i*q,S+=i*L,j+=i*U,E+=i*H,A+=i*K,I+=i*V,P+=i*G,O+=i*$,T+=i*W,B+=i*Z,C+=i*Y,F+=i*X,_+=(i=t[15])*z,o+=38*(k+=i*N),s+=38*(x+=i*D),c+=38*(S+=i*q),u+=38*(j+=i*L),f+=38*(E+=i*U),p+=38*(A+=i*H),h+=38*(I+=i*K),l+=38*(P+=i*V),d+=38*(O+=i*G),m+=38*(T+=i*$),g+=38*(B+=i*W),v+=38*(C+=i*Z),b+=38*(F+=i*Y),y+=38*(R+=i*X),a=(i=(a+=38*(w+=i*M))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a=(i=(a+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a+=n-1+37*(n-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=h,e[8]=l,e[9]=d,e[10]=m,e[11]=g,e[12]=v,e[13]=b,e[14]=y,e[15]=_}function L(e,t){q(e,t,t)}function U(e,t){var r,i=m();for(r=0;r<16;r++)i[r]=t[r];for(r=253;0<=r;r--)L(i,i),2!==r&&4!==r&&q(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function H(e,t,r){var i,n,a=new Uint8Array(32),o=new Float64Array(80),s=m(),c=m(),u=m(),f=m(),p=m(),h=m();for(n=0;n<31;n++)a[n]=t[n];for(a[31]=127&t[31]|64,a[0]&=248,M(o,r),n=0;n<16;n++)c[n]=o[n],f[n]=s[n]=u[n]=0;for(s[0]=f[0]=1,n=254;0<=n;--n)C(s,c,i=a[n>>>3]>>>(7&n)&1),C(u,f,i),N(p,s,u),D(s,s,u),N(u,c,f),D(c,c,f),L(f,p),L(h,s),q(s,u,s),q(u,c,p),N(p,s,u),D(s,s,u),L(c,s),D(u,f,h),q(s,u,g),N(s,s,f),q(u,u,s),q(s,f,h),q(f,c,o),L(c,p),C(s,c,i),C(u,f,i);for(n=0;n<16;n++)o[n+16]=s[n],o[n+32]=u[n],o[n+48]=c[n],o[n+64]=f[n];var l=o.subarray(32),d=o.subarray(16);return U(l,l),q(d,d,l),F(e,d),0}function K(e,t){return H(e,t,r)}function V(e,t){return o(t,32),K(e,t)}function G(e,t,r){var i=new Uint8Array(32);return H(i,r,t),_(e,n,i,w)}E.prototype.blocks=function(e,t,r){for(var i,n,a,o,s,c,u,f,p,h,l,d,m,g,v,b,y,_,w,k=this.fin?0:2048,x=this.h[0],S=this.h[1],j=this.h[2],E=this.h[3],A=this.h[4],I=this.h[5],P=this.h[6],O=this.h[7],T=this.h[8],B=this.h[9],C=this.r[0],F=this.r[1],R=this.r[2],z=this.r[3],M=this.r[4],N=this.r[5],D=this.r[6],q=this.r[7],L=this.r[8],U=this.r[9];16<=r;)h=p=0,h+=(x+=8191&(i=255&e[t+0]|(255&e[t+1])<<8))*C,h+=(S+=8191&(i>>>13|(n=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*U),h+=(j+=8191&(n>>>10|(a=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*L),h+=(E+=8191&(a>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*q),p=(h+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*D))>>>13,h&=8191,h+=(I+=s>>>1&8191)*(5*N),h+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*M),h+=(O+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),h+=(T+=8191&(u>>>8|(f=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*R),l=p+=(h+=(B+=f>>>5|k)*(5*F))>>>13,l+=x*F,l+=S*C,l+=j*(5*U),l+=E*(5*L),p=(l+=A*(5*q))>>>13,l&=8191,l+=I*(5*D),l+=P*(5*N),l+=O*(5*M),l+=T*(5*z),p+=(l+=B*(5*R))>>>13,l&=8191,d=p,d+=x*R,d+=S*F,d+=j*C,d+=E*(5*U),p=(d+=A*(5*L))>>>13,d&=8191,d+=I*(5*q),d+=P*(5*D),d+=O*(5*N),d+=T*(5*M),m=p+=(d+=B*(5*z))>>>13,m+=x*z,m+=S*R,m+=j*F,m+=E*C,p=(m+=A*(5*U))>>>13,m&=8191,m+=I*(5*L),m+=P*(5*q),m+=O*(5*D),m+=T*(5*N),g=p+=(m+=B*(5*M))>>>13,g+=x*M,g+=S*z,g+=j*R,g+=E*F,p=(g+=A*C)>>>13,g&=8191,g+=I*(5*U),g+=P*(5*L),g+=O*(5*q),g+=T*(5*D),v=p+=(g+=B*(5*N))>>>13,v+=x*N,v+=S*M,v+=j*z,v+=E*R,p=(v+=A*F)>>>13,v&=8191,v+=I*C,v+=P*(5*U),v+=O*(5*L),v+=T*(5*q),b=p+=(v+=B*(5*D))>>>13,b+=x*D,b+=S*N,b+=j*M,b+=E*z,p=(b+=A*R)>>>13,b&=8191,b+=I*F,b+=P*C,b+=O*(5*U),b+=T*(5*L),y=p+=(b+=B*(5*q))>>>13,y+=x*q,y+=S*D,y+=j*N,y+=E*M,p=(y+=A*z)>>>13,y&=8191,y+=I*R,y+=P*F,y+=O*C,y+=T*(5*U),_=p+=(y+=B*(5*L))>>>13,_+=x*L,_+=S*q,_+=j*D,_+=E*N,p=(_+=A*M)>>>13,_&=8191,_+=I*z,_+=P*R,_+=O*F,_+=T*C,w=p+=(_+=B*(5*U))>>>13,w+=x*U,w+=S*L,w+=j*q,w+=E*D,p=(w+=A*N)>>>13,w&=8191,w+=I*M,w+=P*z,w+=O*R,w+=T*F,x=h=8191&(p=(p=((p+=(w+=B*C)>>>13)<<2)+p|0)+(h&=8191)|0),S=l+=p>>>=13,j=d&=8191,E=m&=8191,A=g&=8191,I=v&=8191,P=b&=8191,O=y&=8191,T=_&=8191,B=w&=8191,t+=16,r-=16;this.h[0]=x,this.h[1]=S,this.h[2]=j,this.h[3]=E,this.h[4]=A,this.h[5]=I,this.h[6]=P,this.h[7]=O,this.h[8]=T,this.h[9]=B},E.prototype.finish=function(e,t){var r,i,n,a,o=new Uint16Array(10);if(this.leftover){for(a=this.leftover,this.buffer[a++]=1;a<16;a++)this.buffer[a]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=r,r=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this.h[a]+r,r=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,i=(1^r)-1,a=0;a<10;a++)o[a]&=i;for(i=~i,a=0;a<10;a++)this.h[a]=this.h[a]&i|o[a];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,a=1;a<8;a++)n=(this.h[a]+this.pad[a]|0)+(n>>>16)|0,this.h[a]=65535&n;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var i,n;if(this.leftover){for(r<(n=16-this.leftover)&&(n=r),i=0;i>>16,I=65535&(S=D),P=S>>>16,E+=65535&(j=((g=K)>>>14|(c=z)<<18)^(K>>>18|z<<14)^(z>>>9|K<<23)),A+=j>>>16,I+=65535&(S=(z>>>14|K<<18)^(z>>>18|K<<14)^(K>>>9|z<<23)),P+=S>>>16,E+=65535&(j=K&(v=V)^~K&(b=G)),A+=j>>>16,I+=65535&(S=z&(u=M)^~z&(f=N)),P+=S>>>16,S=Z[2*k],E+=65535&(j=Z[2*k+1]),A+=j>>>16,I+=65535&S,P+=S>>>16,S=O[k%16],A+=(j=T[k%16])>>>16,I+=65535&S,P+=S>>>16,I+=(A+=(E+=65535&j)>>>16)>>>16,E=65535&(j=w=65535&E|A<<16),A=j>>>16,I=65535&(S=_=65535&I|(P+=I>>>16)<<16),P=S>>>16,E+=65535&(j=(q>>>28|B<<4)^(B>>>2|q<<30)^(B>>>7|q<<25)),A+=j>>>16,I+=65535&(S=(B>>>28|q<<4)^(q>>>2|B<<30)^(q>>>7|B<<25)),P+=S>>>16,A+=(j=q&L^q&U^L&U)>>>16,I+=65535&(S=B&C^B&F^C&F),P+=S>>>16,p=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,y=65535&E|A<<16,E=65535&(j=m),A=j>>>16,I=65535&(S=s),P=S>>>16,A+=(j=w)>>>16,I+=65535&(S=_),P+=S>>>16,C=n,F=a,R=o,z=s=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,M=c,N=u,D=f,B=p,L=h,U=l,H=d,K=m=65535&E|A<<16,V=g,G=v,$=b,q=y,k%16==15)for(x=0;x<16;x++)S=O[x],E=65535&(j=T[x]),A=j>>>16,I=65535&S,P=S>>>16,S=O[(x+9)%16],E+=65535&(j=T[(x+9)%16]),A+=j>>>16,I+=65535&S,P+=S>>>16,_=O[(x+1)%16],E+=65535&(j=((w=T[(x+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),A+=j>>>16,I+=65535&(S=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),P+=S>>>16,_=O[(x+14)%16],A+=(j=((w=T[(x+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,I+=65535&(S=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,O[x]=65535&I|P<<16,T[x]=65535&E|A<<16;E=65535&(j=q),A=j>>>16,I=65535&(S=B),P=S>>>16,S=e[0],A+=(j=t[0])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[0]=B=65535&I|P<<16,t[0]=q=65535&E|A<<16,E=65535&(j=L),A=j>>>16,I=65535&(S=C),P=S>>>16,S=e[1],A+=(j=t[1])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[1]=C=65535&I|P<<16,t[1]=L=65535&E|A<<16,E=65535&(j=U),A=j>>>16,I=65535&(S=F),P=S>>>16,S=e[2],A+=(j=t[2])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[2]=F=65535&I|P<<16,t[2]=U=65535&E|A<<16,E=65535&(j=H),A=j>>>16,I=65535&(S=R),P=S>>>16,S=e[3],A+=(j=t[3])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[3]=R=65535&I|P<<16,t[3]=H=65535&E|A<<16,E=65535&(j=K),A=j>>>16,I=65535&(S=z),P=S>>>16,S=e[4],A+=(j=t[4])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[4]=z=65535&I|P<<16,t[4]=K=65535&E|A<<16,E=65535&(j=V),A=j>>>16,I=65535&(S=M),P=S>>>16,S=e[5],A+=(j=t[5])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[5]=M=65535&I|P<<16,t[5]=V=65535&E|A<<16,E=65535&(j=G),A=j>>>16,I=65535&(S=N),P=S>>>16,S=e[6],A+=(j=t[6])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[6]=N=65535&I|P<<16,t[6]=G=65535&E|A<<16,E=65535&(j=$),A=j>>>16,I=65535&(S=D),P=S>>>16,S=e[7],A+=(j=t[7])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[7]=D=65535&I|P<<16,t[7]=$=65535&E|A<<16,W+=128,i-=128}return i}function X(e,t,r){var i,n=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,Y(n,a,t,r),r%=128,i=0;i>(7&n)&1),J(t,e),J(e,e),Q(e,t,i)}function re(e,t){var r=[m(),m(),m(),m()];T(r[0],i),T(r[1],s),T(r[2],f),q(r[3],i,s),te(e,r,t)}function ie(e,t,r){var i,n=new Uint8Array(64),a=[m(),m(),m(),m()];for(r||o(t,32),X(n,t,32),n[0]&=248,n[31]&=127,n[31]|=64,re(a,n),ee(e,a),i=0;i<32;i++)t[i+32]=e[i];return 0}var ne=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var r,i,n,a;for(i=63;32<=i;--i){for(r=0,n=i-32,a=i-12;n>8,t[n]-=256*r;t[n]+=r,t[i]=0}for(n=r=0;n<32;n++)t[n]+=r-(t[31]>>4)*ne[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*ne[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function oe(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function se(e,t,r,i){var n,a,o=new Uint8Array(64),s=new Uint8Array(64),c=new Uint8Array(64),u=new Float64Array(64),f=[m(),m(),m(),m()];X(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var p=r+64;for(n=0;n>7&&D(e[0],u,e[0]),q(e[3],e[0],e[1]),0)}function ue(e,t,r,i){var n,a=new Uint8Array(32),o=new Uint8Array(64),s=[m(),m(),m(),m()],c=[m(),m(),m(),m()];if(-1,r<64)return-1;if(ce(c,i))return-1;for(n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,M=String.fromCharCode;function N(e){throw new RangeError(o[e])}function s(e,t){var r=e.split("@"),i="";return 1>1,e+=z(e/t);455z((C-n)/p))&&N("overflow"),n+=l*p;var d=h<=o?1:o+26<=h?26:h-o;if(lz(C/m)&&N("overflow"),p*=m}var g=r.length+1;o=L(n-f,g,0==f),z(n/g)>C-a&&N("overflow"),a+=z(n/g),n%=g,r.splice(n++,0,a)}return String.fromCodePoint.apply(String,r)},u=function(e){var t=[],r=(e=D(e)).length,i=128,n=0,a=72,o=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(o=(u=f.next()).done);o=!0){var p=u.value;p<128&&t.push(M(p))}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}var h=t.length,l=h;for(h&&t.push("-");lz((C-n)/w)&&N("overflow"),n+=(d-i)*w,i=d;var k=!0,x=!1,S=void 0;try{for(var j,E=e[Symbol.iterator]();!(k=(j=E.next()).done);k=!0){var A=j.value;if(AC&&N("overflow"),A==i){for(var I=n,P=36;;P+=36){var O=P<=a?1:a+26<=P?26:P-a;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function l(e){for(var t="",r=0,i=e.length;rA-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(V,"g"),Y=new RegExp($,"g"),X=new RegExp(F("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',W),"g"),J=new RegExp(F("[^]",V,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),Q=J;function ee(e){var t=l(e);return t.match(Z)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,a={},o=r.query.split("&"),s=0,c=o.length;s",'"',"`"," ","\r","\n","\t"]),M=["'"].concat(n),N=["%","/","?",";","#"].concat(M),D=["/","?","#"],q=/^[+a-z0-9A-Z_-]{0,63}$/,L=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,U={javascript:!0,"javascript:":!0},H={javascript:!0,"javascript:":!0},K={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},V=e("querystring");function a(e,t,r){if(e&&F.isObject(e)&&e instanceof A)return e;var i=new A;return i.parse(e,t,r),i}A.prototype.parse=function(e,t,r){if(!F.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===e?"undefined":_typeof(e)));var i=e.indexOf("?"),n=-1!==i&&i>t&63|128)}function p(e){if(0==(4294967168&e))return s(e);var t="";return 0==(4294965248&e)?t=s(e>>6&31|192):0==(4294901760&e)?(u(e),t=s(e>>12&15|224),t+=f(e,6)):0==(4292870144&e)&&(t=s(e>>18&7|240),t+=f(e,12),t+=f(e,6)),t+=s(63&e|128)}function h(){if(a<=o)throw Error("Invalid byte index");var e=255&n[o];if(o++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,t;if(a>>10&1023|55296),t=56320|1023&t),n+=s(t);return n}(r)}};if("function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define(function(){return d});else if(t&&!t.nodeType)if(r)r.exports=d;else{var m={}.hasOwnProperty;for(var g in d)m.call(d,g)&&(t[g]=d[g])}else e.utf8=d}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],503:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],504:[function(e,t,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],505:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{"./support/isBuffer":504,_process:382,dup:70,inherits:320}],506:[function(e,t,r){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},{}],507:[function(e,t,r){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var n=new Uint8Array(16);t.exports=function(){return i(n),n}}else{var a=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}},{}],508:[function(e,t,r){var o=e("./lib/rng"),s=e("./lib/bytesToUuid");t.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var a=0;a<16;++a)t[i+a]=n[a];return t||s(n)}},{"./lib/bytesToUuid":506,"./lib/rng":507}],509:[function(e,t,r){var s=e("assert-plus"),i=e("util"),n=e("extsprintf"),c=e("core-util-is").isError,a=n.sprintf;function u(e){var t,r,i,n;if(s.object(e,"args"),s.bool(e.strict,"args.strict"),s.array(e.argv,"args.argv"),0===(t=e.argv).length)r={},i=[];else if(c(t[0]))r={cause:t[0]},i=t.slice(1);else if("object"===_typeof(t[0])){for(n in r={},t[0])r[n]=t[0][n];i=t.slice(1)}else s.string(t[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},i=t;return s.object(r),r.strict||e.strict||(i=i.map(function(e){return null===e?"null":void 0===e?"undefined":e})),{options:r,shortmessage:0===i.length?"":a.apply(null,i)}}function f(){var e,t,r,i,n,a,o;if(e=Array.prototype.slice.call(arguments,0),!(this instanceof f))return t=Object.create(f.prototype),f.apply(t,arguments),t;if((r=u({argv:e,strict:!1})).options.name&&(s.string(r.options.name,'error\'s "name" must be a string'),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,a=r.shortmessage,(i=r.options.cause)&&(s.ok(c(i),"cause is not an Error"),this.jse_cause=i,r.options.skipCauseMessage||(a+=": "+i.message)),this.jse_info={},r.options.info)for(o in r.options.info)this.jse_info[o]=r.options.info[o];return this.message=a,Error.call(this,a),Error.captureStackTrace&&(n=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,n)),this}function o(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof o?(i=(r=u({argv:e,strict:!0})).options,f.call(this,i,"%s",r.shortmessage),this):(t=Object.create(o.prototype),o.apply(t,arguments),t)}function p(e){s.array(e,"list of errors"),s.ok(0this._inputTypes.length&&!n.isObject(e[e.length-1]))return a.inputDefaultBlockNumberFormatter(e.pop())},s.prototype.toPayload=function(e){var t={};return e.length>this._inputTypes.length&&n.isObject(e[e.length-1])&&(t=e[e.length-1]),t.to=this._address,t.data="0x"+this.signature()+i.encodeParams(this._inputTypes,e),t},s.prototype.signature=function(){return o(this._name).slice(0,8)},s.prototype.unpackOutput=function(e){if(e){e=2<=e.length?e.slice(2):e;var t=i.decodeParams(this._outputTypes,e);return 1===t.length?t[0]:t}},s.prototype.call=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),i=this.extractCallback(e),t=this.extractDefaultBlock(e),r=this.toPayload(e);if(!i){var n=this._eth.call(r,t);return this.unpackOutput(n)}var a=this;this._eth.call(r,t,function(t,e){if(t)return i(t,null);var r=null;try{r=a.unpackOutput(e)}catch(e){t=e}i(t,r)})},s.prototype.sendTransaction=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),t=this.extractCallback(e),r=this.toPayload(e);if(0=this.buffer.length)){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,t}}},{key:"read",value:function(e){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,Array.from(t)}},{key:"readBool",value:function(){var e=this.read(1)[0];if(255===e)return!0;if(0===e)return!1;throw new n("read_bool() expected 0xff or 0x00; got +"+e)}},{key:"readVaruint",value:function(){for(var e=0,t=0,r=void 0;e|=(127&(r=this.read(1)[0]))< "+e);if(r>=7}}},{key:"writeByte",value:function(e){if(this.length>=this.buffer.length){var t=2*this.length,r=new Uint8Array(t);r.set(this.buffer,0),this.buffer=r}isNaN(e)?this.buffer[this.length]=e.codePointAt():this.buffer[this.length]=e,this.length++}},{key:"writeBytes",value:function(e){var t=this;e.forEach(function(e){t.writeByte(e)})}},{key:"writeVarbytes",value:function(e){this.writeVaruint(e.length),this.writeBytes(e)}},{key:"toString",value:function(){return this.buffer.toHex(0)}}]),e}();m.exports={StreamDeserialization:h,StreamSerialization:l,DeserializationError:n,BadMagicError:a,UnsupportedMajorVersion:o,TruncationError:s,TrailingGarbageError:c,RecursionLimitError:u,SerializerTypeError:f,SerializerValueError:p,ValueError:e,TypeError:t}}).call(this,d("buffer").Buffer)},{"./extend-error.js":568,"./utils.js":574,buffer:191}],567:[function(e,t,r){"use strict";var s=e("./ops.js"),c=e("./timestamp.js"),i=e("./utils.js"),u=e("./context.js"),f=[0,79,112,101,110,84,105,109,101,115,116,97,109,112,115,0,0,80,114,111,111,102,0,191,137,226,232,132,232,146,148],n=function(){function o(e,t){if(_classCallCheck2(this,o),!(e instanceof s.Op&&t instanceof c))throw new u.ValueError("Invalid Timestamp or fileHashOp");if(t.msg.length!==e._DIGEST_LENGTH())throw new u.ValueError("Timestamp message length and fileHashOp digest length differ");this.fileHashOp=e,this.timestamp=t}return _createClass(o,[{key:"fileDigest",value:function(){return this.timestamp.msg}},{key:"serialize",value:function(e){e.writeBytes(f),e.writeVaruint(1),this.fileHashOp.serialize(e),e.writeBytes(this.timestamp.msg),this.timestamp.serialize(e)}},{key:"serializeToBytes",value:function(){var e=new u.StreamSerialization;return this.serialize(e),e.getOutput()}},{key:"toString",value:function(){var e="DetachedTimestampFile\n";return e+="fileHashOp: "+this.fileHashOp.toString()+"\n",e+="timestamp: "+this.timestamp.toString()+"\n"}},{key:"toJson",value:function(){var e={};e.hash=i.bytesToHex(this.fileDigest()),e.op=this.fileHashOp._HASHLIB_NAME(),e.timestamp=this.timestamp.toJson()}},{key:"equals",value:function(e){return e instanceof o&&(!!e.fileHashOp.equals(this.fileHashOp)&&!!e.timestamp.equals(this.timestamp))}}],[{key:"deserialize",value:function(e){var t=void 0;if(e instanceof u.StreamDeserialization)t=e;else if(e instanceof Array)t=new u.StreamDeserialization(e);else if(e instanceof Uint8Array)t=new u.StreamDeserialization(Array.from(e));else{if(!(e instanceof ArrayBuffer))throw new Error("StreamDeserialization deserialize: Invalid param");t=new u.StreamDeserialization(Array.from(e))}t.assertMagic(f);var r=t.readVaruint();if(1!==r)throw new u.UnsupportedMajorVersion("Version "+r+" detached timestamp files are not supported");var i=s.CryptOp.deserialize(t),n=t.readBytes(i._DIGEST_LENGTH()),a=c.deserialize(t,n);return t.assertEof(),new o(i,a)}},{key:"fromBytes",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOp param");var r=void 0;if(t instanceof u.StreamDeserialization)r=e.hashFd(t);else if(t instanceof Array){var i=new u.StreamDeserialization(t);r=e.hashFd(i)}else if(t instanceof Uint8Array){var n=new u.StreamDeserialization(Array.from(t));r=e.hashFd(n)}else{if(!(t instanceof ArrayBuffer))throw new Error("DetachedTimestampFile: Invalid buffer param");var a=new u.StreamDeserialization(Array.from(t));r=e.hashFd(a)}return new o(e,new c(r))}},{key:"fromHash",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOpss param");if(t instanceof Array)return new o(e,new c(t));if(t instanceof ArrayBuffer||t instanceof Uint8Array)return new o(e,new c(Array.from(t)));throw new Error("DetachedTimestampFile: Invalid fdHash param")}}]),o}();t.exports=n},{"./context.js":566,"./ops.js":572,"./timestamp.js":573,"./utils.js":574}],568:[function(e,t,r){var n=e("util"),a=e("assert");Error.extend=function(r,i){a(r,"subTypeName is required");var e=function e(t){if(!(this instanceof e))return new e(t);try{Error.captureStackTrace(this,this.constructor)}catch(e){}this.name=r,this.code=i,this.message=t||"",this.stack=this.stack.replace("Error",this.toString())};return n.inherits(e,this),e.prototype.toString=function(){return this.name+": "+n.inspect(this.message)},e.extend=this.extend,e}},{assert:67,util:505}],569:[function(e,t,r){"use strict";var a=e("./timestamp.js"),o=e("./ops.js"),i=function(){function h(){_classCallCheck2(this,h)}return _createClass(h,null,[{key:"catThenUnaryOp",value:function(e,t,r){t instanceof a||(t=new a(t)),r instanceof a||(r=new a(r));var i=r.add(new o.OpPrepend(t.msg));return t.ops.set(new o.OpAppend(r.msg),i),i.add(new o.OpSHA256)}},{key:"catSha256",value:function(e,t){return h.catThenUnaryOp(o.OpSHA256,e,t)}},{key:"catSha256d",value:function(e,t){var r=h.catSha256(e,t),i=new o.OpSHA256,n=r.ops.get(i);return void 0===n&&(n=new a(i.call(r.msg)),r.ops.set(i,n)),n}},{key:"makeMerkleTreeIterator",value:function(e){var t=e,r=[],i=void 0;do{t=t[Symbol.iterator](),i=void 0;try{i=t.next().value}catch(e){return"Need at least one timestamp"}var n=!0,a=!(r=[]),o=void 0;try{for(var s,c=t[Symbol.iterator]();!(n=(s=c.next()).done);n=!0){var u=s.value;i=void 0===i?u:void r.push(h.catSha256(i,u))}}catch(e){a=!0,o=e}finally{try{!n&&c.return&&c.return()}finally{if(a)throw o}}0(new i)._MAX_URI_LENGTH())return console.error("URI exceeds maximum length"),!1;for(var t=0;ta.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=a.privateCalendars.length;else if(a.privateCalendars=[],a.calendars&&0!==a.calendars.length||(a.calendars=c.DEFAULT_AGGREGATORS),a.m&&0!==a.m){if(a.m<0||a.m>a.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=1,2<=a.calendars.length&&(a.m=2);o.createTimestamp(i,a.calendars,a.m,a.privateCalendars).then(function(e){if(void 0===e)return r(new Error("Error on timestamp creation"));t()}).catch(function(e){r(e)})})},createTimestamp:function(i,e,t,r){var n=[];return e&&e.forEach(function(e){var t=new c.RemoteCalendar(e);n.push(t.submit(i.msg)),console.log("Submitting to remote calendar "+e)}),r&&r.forEach(function(e,t){var r=new c.RemoteCalendar(t);r.setKey(e),n.push(r.submit(i.msg)),console.log("Submitting to remote calendar "+t)}),new Promise(function(t,r){Promise.all(n.map(u.softFail)).then(function(e){return e.filter(function(e){return!(e instanceof Error)&&void 0!==e}).forEach(function(e){i.merge(e)}),t(i)}).catch(function(e){r(e)})})},makeMerkleTree:function(e){var i=[];return e.forEach(function(e){if(e instanceof s)try{var t=u.randBytes(16),r=e.timestamp.add(new n.OpAppend(u.arrayToBytes(t))).add(new n.OpSHA256);i.push(r)}catch(e){return}else console.error("Invalid input")}),f.makeMerkleTree(i)},verify:function(e,t,i){if(!u.arrEq(e.fileDigest(),t.fileDigest()))return console.error("Expected digest "+u.bytesToHex(e.fileDigest())),console.error("File does not match original!"),new Promise(function(e,t){t(new Error("File does not match original!"))});var n=this;return new Promise(function(t,r){n.upgradeTimestamp(e.timestamp,i).then(function(){n.verifyTimestamp(e.timestamp,i).then(function(e){return t(e)}).catch(function(e){return r(e)})})})},verifyTimestamp:function(e,r){var i=[],n=this;function c(e,t){return e.attestedTimet.attestedTime?1:0}return e.allAttestations().forEach(function(e,t){i.push(n.verifyAttestation(e,t,r))}),new Promise(function(o,s){Promise.all(i.map(u.softFail)).then(function(e){var t=e.filter(function(e){return e.constructor===h.VerificationError?e:void 0});if(0this._MAX_MSG_LENGTH())){var t=this.call(e);return t.length>this._MAX_RESULT_LENGTH()&&console.error("Error : Result too long;"),t}console.error("Error : Message too long;")}}],[{key:"deserialize",value:function(e){return this.tag=e.readBytes(1)[0],t.deserializeFromTag(e,this.tag)}},{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return n.get(t).deserializeFromTag(e,t);console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),t=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t.arg=void 0===e?[]:e,t}return _inherits(r,c),_createClass(r,[{key:"serialize",value:function(e){_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"serialize",this).call(this,e),e.writeVarbytes(this.arg)}},{key:"toString",value:function(){return this._TAG_NAME()+" "+i.bytesToHex(this.arg)}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t)){var r=e.readVarbytes((new c)._MAX_RESULT_LENGTH(),1);return new(n.get(t))(r)}}}]),r}(),e=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 240}},{key:"_TAG_NAME",value:function(){return"append"}},{key:"call",value:function(e){return e.concat(this.arg)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),r=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 241}},{key:"_TAG_NAME",value:function(){return"prepend"}},{key:"call",value:function(e){return this.arg.concat(e)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),u=function(e){function t(){return _classCallCheck2(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,c),_createClass(t,[{key:"toString",value:function(){return this._TAG_NAME()}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return new(n.get(t));console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),f=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 242}},{key:"_TAG_NAME",value:function(){return"reverse"}},{key:"call",value:function(e){return 0===e.length&&console.error("Can't reverse an empty message"),e.reverse()}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),p=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 243}},{key:"_TAG_NAME",value:function(){return"hexlify"}},{key:"_MAX_MSG_LENGTH",value:function(){return u._MAX_RESULT_LENGTH()}},{key:"call",value:function(e){0===e.length&&console.error("Can't hexlify an empty message")}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),h=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_HASHLIB_NAME",value:function(){return 0}},{key:"call",value:function(e,t){for(var r=("keccak256"===e._HASHLIB_NAME()?s(e._HASHLIB_NAME()).update(a.from(t)):o.createHash(e._HASHLIB_NAME()).update(a.from(t))).digest(),i=[r.length],n=0;n(new m.Op)._MAX_MSG_LENGTH())throw new TypeError("Message exceeds Op length limit; "+e.length+" > "+(new m.Op)._MAX_MSG_LENGTH());this.msg=e,this.attestations=[],this.ops=new Map}return _createClass(h,[{key:"getDigest",value:function(){return this.msg}},{key:"serialize",value:function(r){var i=this;if(!this.attestations&&!this.ops)throw new a.ValueError("An empty timestamp can't be serialized");var e=this.attestations;if(e.sort(function(e,t){return e.compareTo(t)}),1 "+t.toString()+u(o,n,i)+"\n",f+=e.strTree(a+1,o)});else if(0>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},r.charsToHex=function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&i).toString(16))}return t.join("")},r.charToByte=function(e){return e.charCodeAt(0)},r.charsToBytes=function(e){for(var t=[],r=0;r Date: Wed, 19 Dec 2018 12:55:13 +0000 Subject: [PATCH 05/16] updated opentimestamps.js dependancy --- opentimestamps.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentimestamps.js b/opentimestamps.js index 2d553e1..f0cae3e 100644 --- a/opentimestamps.js +++ b/opentimestamps.js @@ -1,2 +1,2 @@ // javascript-opentimestamps v.0.4.4-dev -var _get=function e(t,r,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,r);if(void 0===n){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,i)}if("value"in n)return n.value;var o=n.get;return void 0!==o?o.call(i):void 0},_createClass=function(){function i(e,t){for(var r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,f=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,p=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,l=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",i.copy(m[e])}function g(e){var t=e.match(o);if(!t)return!1;var r,i=+t[1],n=+t[2],a=+t[3];return 1<=n&&n<=12&&1<=a&&a<=(2!=n||((r=i)%4!=0||r%100==0&&r%400!=0)?s[n]:29)}function v(e,t){var r=e.match(c);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return(i<=23&&n<=59&&a<=59||23==i&&59==n&&60==a)&&(!t||o)}(t.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d},m.full={date:g,time:v,"date-time":function(e){var t=e.split(b);return 2==t.length&&g(t[0])&&v(t[1],!0)},uri:function(e){return y.test(e)&&a.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&n.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d};var b=/t|\s/i;var y=/\/|:/;var _=/[^\\]\\Z/;function w(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":12}],7:[function(e,t,r){"use strict";var I=e("./resolve"),P=e("./util"),O=e("./error_classes"),T=e("fast-json-stable-stringify"),B=e("../dotjs/validate"),C=P.ucs2length,F=e("fast-deep-equal"),R=O.Validation;function z(e,t,r){var i=n.call(this,e,t,r);return 0<=i?{index:i,compiling:!0}:{index:i=this._compilations.length,compiling:!(this._compilations[i]={schema:e,root:t,baseId:r})}}function M(e,t,r){var i=n.call(this,e,t,r);0<=i&&this._compilations.splice(i,1)}function n(e,t,r){for(var i=0;i",b=l?">":"<",y=void 0;if(g){var _=e.util.getData(m.$data,o,e.dataPathArr),w="exclusive"+a,k="exclType"+a,x="exclIsNumber"+a,S="' + "+(A="op"+a)+" + '";n+=" var schemaExcl"+a+" = "+_+"; ",n+=" var "+w+"; var "+k+" = typeof "+(_="schemaExcl"+a)+"; if ("+k+" != 'boolean' && "+k+" != 'undefined' && "+k+" != 'number') { ";var j;y=d;(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var E=n;n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+k+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+_+" "+v+"= "+i+") ? "+p+" "+b+"= "+_+" : "+p+" "+b+" "+i+" ) : ( ("+w+" = "+_+" === true) ? "+p+" "+b+"= "+i+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { var op"+a+" = "+w+" ? '"+v+"' : '"+v+"='; ",void 0===s&&(y=d,u=e.errSchemaPath+"/"+d,i=_,h=g)}else{S=v;if((x="number"==typeof m)&&h){var A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ( "+i+" === undefined || "+m+" "+v+"= "+i+" ? "+p+" "+b+"= "+m+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { "}else{x&&void 0===s?(w=!0,y=d,u=e.errSchemaPath+"/"+d,i=m,b+="="):(x&&(i=Math[l?"min":"max"](m,s)),m===(!x||i)?(w=!0,y=d,u=e.errSchemaPath+"/"+d,b+="="):(w=!1,S+="="));A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+" "+b+" "+i+" || "+p+" !== "+p+") { "}}y=y||t,(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+A+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+S+" ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";E=n;return n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s;var l="maxLength"==t?">":"<";n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+p+".length ":n+=" ucs2length("+p+") ",n+=" "+l+" "+i+") { ";var d=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+p+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.schema[t],a=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var f="valid"+c.level,p=c.baseId,h=!0,l=n;if(l)for(var d,m=-1,g=l.length-1;m "+E+") { ";var I=f+"["+E+"]";l.schema=j,l.schemaPath=s+"["+E+"]",l.errSchemaPath=c+"/"+E,l.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),l.dataPathArr[v]=E;var P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",i+=" } ",u&&(i+=" if ("+m+") { ",d+="}")}if("object"==(void 0===_?"undefined":_typeof(_))&&e.util.schemaHasRules(_,e.RULES.all)){l.schema=_,l.schemaPath=e.schemaPath+".additionalItems",l.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+f+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" } } ",u&&(i+=" if ("+m+") { ",d+="}")}}else if(e.util.schemaHasRules(o,e.RULES.all)){l.schema=o,l.schemaPath=s,l.errSchemaPath=c,i+=" for (var "+g+" = 0; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+d+" if ("+h+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],30:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="var division"+a+";if (",h&&(n+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),n+=" (division"+a+" = "+p+" / "+i+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var l=l||[];l.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var d=n;return n=l.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+d+"]); ":n+=" validate.errors = ["+d+"]; return false; ":n+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="errs__"+n,h=e.util.copy(e);h.level++;var l="valid"+h.level;if(e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+p+" = errors; ";var d,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(d=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,d&&(h.opts.allErrors=d),e.compositeRule=h.compositeRule=m,i+=" if ("+l+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var v=i;i=g.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ");return i}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="valid"+n,h="errs__"+n,l=e.util.copy(e),d="";l.level++;var m="valid"+l.level,g=l.baseId,v="prevValid"+n,b="passingSchemas"+n;i+="var "+h+" = errors , "+v+" = false , "+p+" = false , "+b+" = null; ";var y=e.compositeRule;e.compositeRule=l.compositeRule=!0;var _=o;if(_)for(var w,k=-1,x=_.length-1;k=e.opts.loopRequired,k=e.opts.ownProperties;if(u)if(i+=" var missing"+n+"; ",w){h||(i+=" var "+l+" = validate.schema"+s+"; ");var x="' + "+(P="schema"+n+"["+(E="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(_,P,e.opts.jsonPointers)),i+=" var "+p+" = true; ",h&&(i+=" if (schema"+n+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+n+")) "+p+" = false; else {"),i+=" for (var "+E+" = 0; "+E+" < "+l+".length; "+E+"++) { "+p+" = "+f+"["+l+"["+E+"]] !== undefined ",k&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", "+l+"["+E+"]) "),i+="; if (!"+p+") break; } ",h&&(i+=" } "),i+=" if (!"+p+") { ",(I=I||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+x+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var S=i;i=I.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var j=d;if(j)for(var E=-1,A=j.length-1;E 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(0<=d.indexOf("object")||0<=d.indexOf("array")))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var g="checkDataType"+(m?"s":"");n+=" if ("+e.util[g](d,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",l&&(n+=" } "),n+=" if (!"+h+") { ";var v=v||[];v.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var b=n;n=v.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { ")}else f&&(n+=" if (true) { ");return n}},{}],39:[function(e,t,r){"use strict";t.exports=function(i,e,t){var r="",n=!0===i.schema.$async,a=i.util.schemaHasRulesExcept(i.schema,i.RULES.all,"$ref"),o=i.self._getId(i.schema);if(i.isTop&&(r+=" var validate = ",n&&(i.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(i.opts.sourceCode||i.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof i.schema||!a&&!i.schema.$ref){e="false schema";var s=i.level,c=i.dataLevel,u=i.schema[e],f=i.schemaPath+i.util.getProperty(e),p=i.errSchemaPath+"/"+e,h=!i.opts.allErrors,l="data"+(c||""),d="valid"+s;if(!1===i.schema){i.isTop?h=!0:r+=" var "+d+" = false; ",(W=W||[]).push(r),r="",!1!==i.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(p)+" , params: {} ",!1!==i.opts.messages&&(r+=" , message: 'boolean schema is false' "),i.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+i.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var m=r;r=W.pop(),!i.compositeRule&&h?i.async?r+=" throw new ValidationError(["+m+"]); ":r+=" validate.errors = ["+m+"]; return false; ":r+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else i.isTop?r+=n?" return data; ":" validate.errors = null; return true; ":r+=" var "+d+" = true; ";return i.isTop&&(r+=" }; return validate; "),r}if(i.isTop){var g=i.isTop;s=i.level=0,c=i.dataLevel=0,l="data";i.rootId=i.resolve.fullPath(i.self._getId(i.root.schema)),i.baseId=i.baseId||i.rootId,delete i.isTop,i.dataPathArr=[void 0],r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{s=i.level,l="data"+((c=i.dataLevel)||"");if(o&&(i.baseId=i.resolve.url(i.baseId,o)),n&&!i.async)throw new Error("async schema in sync schema");r+=" var errs_"+s+" = errors;"}d="valid"+s,h=!i.opts.allErrors;var v="",b="",y=i.schema.type,_=Array.isArray(y);if(_&&1==y.length&&(y=y[0],_=!1),i.schema.$ref&&a){if("fail"==i.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+i.errSchemaPath+'" (see option extendRefs)');!0!==i.opts.extendRefs&&(a=!1,i.logger.warn('$ref: keywords ignored in schema at path "'+i.errSchemaPath+'"'))}if(i.schema.$comment&&i.opts.$comment&&(r+=" "+i.RULES.all.$comment.code(i,"$comment")),y){if(i.opts.coerceTypes)var w=i.util.coerceToTypes(i.opts.coerceTypes,y);var k=i.RULES.types[y];if(w||_||!0===k||k&&!Z(k)){f=i.schemaPath+".type",p=i.errSchemaPath+"/type",f=i.schemaPath+".type",p=i.errSchemaPath+"/type";var x=_?"checkDataTypes":"checkDataType";if(r+=" if ("+i.util[x](y,l,!0)+") { ",w){var S="dataType"+s,j="coerced"+s;r+=" var "+S+" = typeof "+l+"; ","array"==i.opts.coerceTypes&&(r+=" if ("+S+" == 'object' && Array.isArray("+l+")) "+S+" = 'array'; "),r+=" var "+j+" = undefined; ";var E="",A=w;if(A)for(var I,P=-1,O=A.length-1;P>6],n=0==(32&r);if(31==(31&r)){var a=r;for(r=0;128==(128&a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function p(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)o++;(n=new u(2+o))[0]=a,n[1]=128|o;s=1+o;for(var c=i.length;0>=8)n[s]=255&c;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new u(2*e.length),i=0;i>=7)n++}var o=new u(n),s=o.length-1;for(i=e.length-1;0<=i;i--){a=e[i];for(o[s--]=127&a;0<(a>>=7);)o[s--]=128|127&a}return this._createEncoderBuffer(o)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[c(i.getFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(i.getFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.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&&!u.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new u(r)}if(u.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new u(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var a=e;256<=a;a>>=8)i++;for(a=(n=new Array(i)).length-1;0<=a;a--)n[a]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new u(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var a=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),a.length!==n.defaultBuffer.length)return!1;for(i=0;i=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0===(t&=127))throw c("Indefinite length not supported");if(4this._size-i)return null;if(this._offset=i,0===this.length)return t?a.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?n:n.toString("utf8")},i.prototype.readOID=function(e){e||(e=s.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],i=0,n=0;n>0),r.join(".")},i.prototype._readTag=function(e){o.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw c("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(4this._size-r)return null;this._offset=r;for(var i=this._buf[this._offset],n=0,a=0;a>0},t.exports=i},{"./errors":60,"./types":63,assert:67,"safer-buffer":448}],63:[function(e,t,r){t.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},{}],64:[function(e,t,r){var n=e("assert"),a=e("safer-buffer").Buffer,o=e("./types"),i=e("./errors").newInvalidAsn1Error,s={size:1024,growthFactor:8};function c(e){var r,i;r=s,i=e||{},n.ok(r),n.equal(void 0===r?"undefined":_typeof(r),"object"),n.ok(i),n.equal(void 0===i?"undefined":_typeof(i),"object"),Object.getOwnPropertyNames(r).forEach(function(e){if(!i[e]){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,t)}}),e=i,this._buf=a.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw i(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},c.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=o.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&1 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;0>>24,e<<=8},c.prototype.writeNull=function(){this.writeByte(o.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=o.Enumeration),this.writeInt(e,t)},c.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=o.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},c.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+(void 0===e?"undefined":_typeof(e))+")");"number"!=typeof t&&(t=o.OctetString);var r=a.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},c.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!a.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},c.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(e){t.writeString(e)})},c.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=o.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),i=[];i.push(40*parseInt(r[0],10)+parseInt(r[1],10)),r.slice(2).forEach(function(e){var t,r;t=i,(r=parseInt(e,10))<128?t.push(r):(r<16384?t.push(r>>>7|128):(r<2097152?t.push(r>>>14|128):(r<268435456?t.push(r>>>21|128):(t.push(255&(r>>>28|128)),t.push(255&(r>>>21|128))),t.push(255&(r>>>14|128))),t.push(255&(r>>>7|128))),t.push(127&r))});var n=this;this._ensure(2+i.length),this.writeByte(t),this.writeLength(i.length),i.forEach(function(e){n.writeByte(e)})},c.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw i("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},c.prototype.startSequence=function(e){"number"!=typeof e&&(e=o.Sequence|o.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw i("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},c.prototype._shift=function(e,t,r){n.ok(void 0!==e),n.ok(void 0!==t),n.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},c.prototype._ensure=function(e){if(n.ok(e),this._size-this._offset>16&255,a[o++]=t>>8&255,a[o++]=255&t;var u,f;2===n&&(t=p[e.charCodeAt(c)]<<2|p[e.charCodeAt(c+1)]>>4,a[o++]=255&t);1===n&&(t=p[e.charCodeAt(c)]<<10|p[e.charCodeAt(c+1)]<<4|p[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],a=0,o=r-i;a>2]+s[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],p=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,a=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return a.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},{}],76:[function(e,t,r){"use strict";var y=e("tweetnacl").lowlevel.crypto_hash,s=0,c=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};function n(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}function u(e,t){var r,i=0;for(r=0;r<4;r++,s++)t<=s&&(s=0),i=i<<8|e[s];return i}c.prototype.encipher=function(e,t){void 0===t&&(t=new Uint8Array(e.buffer),0!==e.byteOffset&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=n(this.S,t,0)^this.P[r],e[0]^=n(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i},c.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);0!==e.byteOffset&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;0>>24,r[4*i+2]=a[i]>>>16,r[4*i+1]=a[i]>>>8,r[4*i+0]=a[i]}t.exports={BLOCKS:f,HASHSIZE:32,hash:_,pbkdf:function(e,t,r,i,n,a,o){var s,c,u,f,p,h,l=new Uint8Array(64),d=new Uint8Array(64),m=new Uint8Array(32),g=new Uint8Array(32),v=new Uint8Array(i+4),b=a;if(o<1)return-1;if(0===t||0===i||0===a||a>m.byteLength*m.byteLength||1<<20>>24,v[i+1]=h>>>16,v[i+2]=h>>>8,v[i+3]=h,y(d,v,i+4),_(l,d,g),s=m.byteLength;s--;)m[s]=g[s];for(s=1;sa[o]^r?1:-1;return c==u?0:u=t&&e<=r}function J(e){return"[object Array]"==Object.prototype.toString.call(e)}function Q(e,t,r){for(var i,n,a=[0],o=0,s=e.length;or-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}function ee(e,t){return(1(r=e.length)){for(i="0",t-=r;--t;i+="0");e+=i}else tt;)u[n]=0,n||(++a,u.unshift(1));for(o=u.length;!u[--o];);for(p=0,e="";p<=o;e+=U.charAt(u[p++]));e=te(e,a)}return e}function P(e,t,r,i){var n,a,o,s,c;if(r=null!=r&&k(r,0,8,i,q)?0|r:b,!e.c)return e.toString();if(n=e.c[0],o=e.e,null==t)c=Z(e.c),c=19==i||24==i&&o<=h?ee(c,o):te(c,o);else if(a=(e=C(new I(e),t,r)).e,s=(c=Z(e.c)).length,19==i||24==i&&(t<=a||a<=h)){for(;sy?e.c=e.e=null:e.c=r=p.length){if(!i)break e;for(;p.length<=u;p.push(0));c=f=0,o=(a%=K)-K+(n=1)}else{for(c=s=p[u],n=1;10<=s;s/=10,n++);f=(o=(a%=K)-K+n)<0?0:c/h[n-o-1]%10|0}if(i=i||t<0||null!=p[u+1]||(o<0?c:c%h[n-o-1]),i=r<4?(f||i)&&(0==r||r==(e.s<0?3:2)):5y?e.c=e.e=null:e.er)return null!=(e=n[r++])};return o(t="DECIMAL_PLACES")&&k(e,0,$,2,t)&&(d=0|e),i[t]=d,o(t="ROUNDING_MODE")&&k(e,0,8,2,t)&&(b=0|e),i[t]=b,o(t="EXPONENTIAL_AT")&&(J(e)?k(e[0],-$,0,2,t)&&k(e[1],0,$,2,t)&&(h=0|e[0],l=0|e[1]):k(e,-$,$,2,t)&&(h=-(l=0|(e<0?-e:e)))),i[t]=[h,l],o(t="RANGE")&&(J(e)?k(e[0],-$,-1,2,t)&&k(e[1],1,$,2,t)&&(m=0|e[0],y=0|e[1]):k(e,-$,$,2,t)&&(0|e?m=-(y=0|(e<0?-e:e)):w&&B(2,t+" cannot be zero",e))),i[t]=[m,y],o(t="ERRORS")&&(e===!!e||1===e||0===e?(_=0,k=(w=!!e)?O:X):w&&B(2,t+D,e)),i[t]=w,o(t="CRYPTO")&&(e===!!e||1===e||0===e?(x=!(!e||!F||"object"!=(void 0===F?"undefined":_typeof(F))),e&&!x&&w&&B(2,"crypto unavailable",F)):w&&B(2,t+D,e)),i[t]=x,o(t="MODULO_MODE")&&k(e,0,9,2,t)&&(S=0|e),i[t]=S,o(t="POW_PRECISION")&&k(e,0,$,2,t)&&(j=0|e),i[t]=j,o(t="FORMAT")&&("object"==(void 0===e?"undefined":_typeof(e))?E=e:w&&B(2,t+" not an object",e)),i[t]=E,i},I.max=function(){return n(arguments,i.lt)},I.min=function(){return n(arguments,i.gt)},I.random=(r=9007199254740992,u=Math.random()*r&2097151?function(){return N(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,n,a,o=0,s=[],c=new I(v);if(e=null!=e&&k(e,0,$,14)?0|e:d,n=M(e/K),x)if(F&&F.getRandomValues){for(t=F.getRandomValues(new Uint32Array(n*=2));o>>11))?(r=F.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(s.push(a%1e14),o+=2);o=n/2}else if(F&&F.randomBytes){for(t=F.randomBytes(n*=7);ot[n]?1:-1;break}return a}function A(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r](x[s]||0)&&o--,k<0)l.push(1),c=!0;else{for(b=x.length,_=S.length,k+=2,1<(u=N(n/(S[s=0]+1)))&&(S=j(S,u,n),x=j(x,u,n),_=S.length,b=x.length),v=_,m=(d=x.slice(0,_)).length;m<_;d[m++]=0);(w=S.slice()).unshift(0),y=S[0],S[1]>=n/2&&y++;do{if(u=0,(a=E(S,d,_,m))<0){if(g=d[0],_!=m&&(g=g*n+(d[1]||0)),1<(u=N(g/y)))for(n<=u&&(u=n-1),p=(f=j(S,u,n)).length,m=d.length;1==E(f,d,p,m);)u--,A(f,_this.c.length-2},i.isNaN=function(){return!this.s},i.isNegative=i.isNeg=function(){return this.s<0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.lessThan=i.lt=function(e,t){return _=8,Y(this,new I(e,t))<0},i.lessThanOrEqualTo=i.lte=function(e,t){return _=9,-1===(t=Y(this,new I(e,t)))||0===t},i.minus=i.sub=function(e,t){var r,i,n,a,o=this,s=o.s;if(_=10,t=(e=new I(e,t)).s,!s||!t)return new I(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/K,u=e.e/K,f=o.c,p=e.c;if(!c||!u){if(!f||!p)return f?(e.s=-t,e):new I(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new I(f[0]?o:3==b?-0:0)}if(c=W(c),u=W(u),f=f.slice(),s=c-u){for((n=(a=s<0)?(s=-s,f):(u=c,p)).reverse(),t=s;t--;n.push(0));n.reverse()}else for(i=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;tt&&(t=this.e+1),t},i.round=function(e,t){var r=new I(this);return(null==e||k(e,0,$,15))&&C(r,~~e+this.e+1,null!=t&&k(t,0,8,15,q)?0|t:b),r},i.shift=function(e){var t=this;return k(e,-a,a,16,"argument")?t.times("1e"+re(e)):new I(t.c&&t.c[0]&&(e<-a||at&&(r.c.length=t)}if(!(i=N(i/2)))break;n=n.times(n),t&&n.c&&n.c.length>t&&(n.c.length=t)}return e<0&&(r=v.div(r)),t?C(r,j,b):r},i.toPrecision=function(e,t){return P(this,null!=e&&k(e,1,$,24,"precision")?0|e:null,t,24)},i.toString=function(e){var t,r=this.s,i=this.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=Z(this.c),t=null!=e&&k(e,2,64,25,"base")?A(te(t,i),0|e,10,r):i<=h||l<=i?ee(t,i):te(t,i),r<0&&this.c[0]&&(t="-"+t)),t},i.truncated=i.trunc=function(){return C(new I(this),this.e+1,1)},i.valueOf=i.toJSON=function(){return this.toString()},null!=t&&I.config(t),I}(),"function"==typeof define&&define.amd)define(function(){return t});else if(void 0!==i&&i.exports){if(i.exports=t,!F)try{F=r("crypto")}catch(e){}}else e.BigNumber=t}(this)},{crypto:204}],78:[function(i,n,e){(function(e,t){"use strict";var r=n.exports;r.version="v"+i("./package.json").version,r.versionGuard=function(e){if(void 0!==e){throw new Error("More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.")}},r.versionGuard(e._bitcore),e._bitcore=r.version,r.crypto={},r.crypto.BN=i("./lib/crypto/bn"),r.crypto.ECDSA=i("./lib/crypto/ecdsa"),r.crypto.Hash=i("./lib/crypto/hash"),r.crypto.Random=i("./lib/crypto/random"),r.crypto.Point=i("./lib/crypto/point"),r.crypto.Signature=i("./lib/crypto/signature"),r.encoding={},r.encoding.Base58=i("./lib/encoding/base58"),r.encoding.Base58Check=i("./lib/encoding/base58check"),r.encoding.BufferReader=i("./lib/encoding/bufferreader"),r.encoding.BufferWriter=i("./lib/encoding/bufferwriter"),r.encoding.Varint=i("./lib/encoding/varint"),r.util={},r.util.buffer=i("./lib/util/buffer"),r.util.js=i("./lib/util/js"),r.util.preconditions=i("./lib/util/preconditions"),r.errors=i("./lib/errors"),r.Address=i("./lib/address"),r.Block=i("./lib/block"),r.MerkleBlock=i("./lib/block/merkleblock"),r.BlockHeader=i("./lib/block/blockheader"),r.HDPrivateKey=i("./lib/hdprivatekey.js"),r.HDPublicKey=i("./lib/hdpublickey.js"),r.Networks=i("./lib/networks"),r.Opcode=i("./lib/opcode"),r.PrivateKey=i("./lib/privatekey"),r.PublicKey=i("./lib/publickey"),r.Script=i("./lib/script"),r.Transaction=i("./lib/transaction"),r.URI=i("./lib/uri"),r.Unit=i("./lib/unit"),r.deps={},r.deps.bnjs=i("bn.js"),r.deps.bs58=i("bs58"),r.deps.Buffer=t,r.deps.elliptic=i("elliptic"),r.deps._=i("lodash"),r._HDKeyCache=i("./lib/hdkeycache"),r.Transaction.sighash=i("./lib/transaction/sighash")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i("buffer").Buffer)},{"./lib/address":79,"./lib/block":82,"./lib/block/blockheader":81,"./lib/block/merkleblock":83,"./lib/crypto/bn":84,"./lib/crypto/ecdsa":85,"./lib/crypto/hash":86,"./lib/crypto/point":87,"./lib/crypto/random":88,"./lib/crypto/signature":89,"./lib/encoding/base58":90,"./lib/encoding/base58check":91,"./lib/encoding/bufferreader":92,"./lib/encoding/bufferwriter":93,"./lib/encoding/varint":94,"./lib/errors":95,"./lib/hdkeycache":97,"./lib/hdprivatekey.js":98,"./lib/hdpublickey.js":99,"./lib/networks":100,"./lib/opcode":101,"./lib/privatekey":102,"./lib/publickey":103,"./lib/script":104,"./lib/transaction":107,"./lib/transaction/sighash":115,"./lib/unit":119,"./lib/uri":120,"./lib/util/buffer":121,"./lib/util/js":122,"./lib/util/preconditions":123,"./package.json":150,"bn.js":124,bs58:125,buffer:191,elliptic:127,lodash:149}],79:[function(e,t,r){(function(a){"use strict";var n=e("lodash"),o=e("./util/preconditions"),i=e("./errors"),s=e("./encoding/base58check"),c=e("./networks"),r=e("./crypto/hash"),u=e("./util/js"),f=e("./publickey");function p(e,t,r){if(!(this instanceof p))return new p(e,t,r);if(n.isArray(e)&&n.isNumber(t))return p.createMultisig(e,t,r);if(e instanceof p)return e;if(o.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!c.get(t))throw new TypeError('Second argument must be "livenet" or "testnet".');if(r&&r!==p.PayToPublicKeyHash&&r!==p.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||c.get(t)||c.defaultNetwork,i.type=i.type||r||p.PayToPublicKeyHash,u.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}p.prototype._classifyArguments=function(e,t,r){if((e instanceof a||e instanceof Uint8Array)&&20===e.length)return p._transformHash(e);if((e instanceof a||e instanceof Uint8Array)&&21===e.length)return p._transformBuffer(e,t,r);if(e instanceof f)return p._transformPublicKey(e);if(e instanceof h)return p._transformScript(e,t);if("string"==typeof e)return p._transformString(e,t,r);if(n.isObject(e))return p._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")},p.PayToPublicKeyHash="pubkeyhash",p.PayToScriptHash="scripthash",p._transformHash=function(e){var t={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==e.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t},p._transformObject=function(e){return o.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),o.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?new a(e.hash,"hex"):e.hashBuffer,network:c.get(e.network)||c.defaultNetwork,type:e.type}},p._classifyFromVersion=function(e){var t={},r=c.get(e[0],"pubkeyhash"),i=c.get(e[0],"scripthash");return r?(t.network=r,t.type=p.PayToPublicKeyHash):i&&(t.network=i,t.type=p.PayToScriptHash),t},p._transformBuffer=function(e,t,r){var i={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==e.length)throw new TypeError("Address buffers must be exactly 21 bytes.");t=c.get(t);var n=p._classifyFromVersion(e);if(!n.network||t&&t!==n.network)throw new TypeError("Address has mismatched network type.");if(!n.type||r&&r!==n.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=n.network,i.type=n.type,i},p._transformPublicKey=function(e){var t={};if(!(e instanceof f))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=r.sha256ripemd160(e.toBuffer()),t.type=p.PayToPublicKeyHash,t},p._transformScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new i.Script.CantDeriveAddress(e);return r},p.createMultisig=function(e,t,r){return r=r||e[0].network||c.defaultNetwork,p.payingTo(h.buildMultisigOut(e,t),r)},p._transformString=function(e,t,r){if("string"!=typeof e)throw new TypeError("data parameter supplied is not a string.");e=e.trim();var i=s.decode(e);return p._transformBuffer(i,t,r)},p.fromPublicKey=function(e,t){var r=p._transformPublicKey(e);return t=t||c.defaultNetwork,new p(r.hashBuffer,t,r.type)},p.fromPublicKeyHash=function(e,t){return new p(p._transformHash(e).hashBuffer,t,p.PayToPublicKeyHash)},p.fromScriptHash=function(e,t){return o.checkArgument(e,"hash parameter is required"),new p(p._transformHash(e).hashBuffer,t,p.PayToScriptHash)},p.payingTo=function(e,t){return o.checkArgument(e,"script is required"),o.checkArgument(e instanceof h,"script must be instance of Script"),p.fromScriptHash(r.sha256ripemd160(e.toBuffer()),t)},p.fromScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=p._transformScript(e,t);return new p(r.hashBuffer,t,r.type)},p.fromBuffer=function(e,t,r){var i=p._transformBuffer(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromString=function(e,t,r){var i=p._transformString(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromObject=function(e){return o.checkState(u.isHexa(e.hash),'Unexpected hash property, "'+e.hash+'", expected to be hex.'),new p(new a(e.hash,"hex"),e.network,e.type)},p.getValidationError=function(e,t,r){var i;try{new p(e,t,r)}catch(e){i=e}return i},p.isValid=function(e,t,r){return!p.getValidationError(e,t,r)},p.prototype.isPayToPublicKeyHash=function(){return this.type===p.PayToPublicKeyHash},p.prototype.isPayToScriptHash=function(){return this.type===p.PayToScriptHash},p.prototype.toBuffer=function(){var e=new a([this.network[this.type]]);return a.concat([e,this.hashBuffer])},p.prototype.toObject=p.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},p.prototype.toString=function(){return s.encode(this.toBuffer())},p.prototype.inspect=function(){return""},t.exports=p;var h=e("./script")}).call(this,e("buffer").Buffer)},{"./crypto/hash":86,"./encoding/base58check":91,"./errors":95,"./networks":100,"./publickey":103,"./script":104,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],80:[function(t,l,e){(function(o){"use strict";var r=t("lodash"),n=t("./blockheader"),i=t("../crypto/bn"),a=t("../util/buffer"),s=t("../encoding/bufferreader"),c=t("../encoding/bufferwriter"),u=t("../crypto/hash"),f=t("../transaction"),p=t("../util/preconditions");function h(e){return this instanceof h?(r.extend(this,h._from(e)),this):new h(e)}h.MAX_BLOCK_SIZE=1e6,h._from=function(e){var t={};if(a.isBuffer(e))t=h._fromBufferReader(s(e));else{if(!r.isObject(e))throw new TypeError("Unrecognized argument for Block");t=h._fromObject(e)}return t},h._fromObject=function(e){var t=[];return e.transactions.forEach(function(e){e instanceof f?t.push(e):t.push(f().fromObject(e))}),{header:n.fromObject(e.header),transactions:t}},h.fromObject=function(e){return new h(h._fromObject(e))},h._fromBufferReader=function(e){var t={};p.checkState(!e.finished(),"No block data received"),t.header=n.fromBufferReader(e);var r=e.readVarintNum();t.transactions=[];for(var i=0;i"},h.Values={START_OF_BLOCK:8,NULL_HASH:new o("0000000000000000000000000000000000000000000000000000000000000000","hex")},l.exports=h}).call(this,t("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../transaction":107,"../util/buffer":121,"../util/preconditions":123,"./blockheader":81,buffer:191,lodash:149}],81:[function(f,p,e){(function(i){"use strict";var n=f("lodash"),a=f("../crypto/bn"),o=f("../util/buffer"),s=f("../encoding/bufferreader"),t=f("../encoding/bufferwriter"),r=f("../crypto/hash"),c=(f("../util/js"),f("../util/preconditions")),u=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&c.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};u._from=function(e){var t={};if(o.isBuffer(e))t=u._fromBufferReader(s(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for BlockHeader");t=u._fromObject(e)}return t},u._fromObject=function(e){c.checkArgument(e,"data is required");var t=e.prevHash,r=e.merkleRoot;return n.isString(e.prevHash)&&(t=o.reverse(new i(e.prevHash,"hex"))),n.isString(e.merkleRoot)&&(r=o.reverse(new i(e.merkleRoot,"hex"))),{hash:e.hash,version:e.version,prevHash:t,merkleRoot:r,time:e.time,timestamp:e.time,bits:e.bits,nonce:e.nonce}},u.fromObject=function(e){var t=u._fromObject(e);return new u(t)},u.fromRawBlock=function(e){o.isBuffer(e)||(e=new i(e,"binary"));var t=s(e);t.pos=u.Constants.START_OF_HEADER;var r=u._fromBufferReader(t);return new u(r)},u.fromBuffer=function(e){var t=u._fromBufferReader(s(e));return new u(t)},u.fromString=function(e){var t=new i(e,"hex");return u.fromBuffer(t)},u._fromBufferReader=function(e){var t={};return t.version=e.readUInt32LE(),t.prevHash=e.read(32),t.merkleRoot=e.read(32),t.time=e.readUInt32LE(),t.bits=e.readUInt32LE(),t.nonce=e.readUInt32LE(),t},u.fromBufferReader=function(e){var t=u._fromBufferReader(e);return new u(t)},u.prototype.toObject=u.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:o.reverse(this.prevHash).toString("hex"),merkleRoot:o.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},u.prototype.toBuffer=function(){return this.toBufferWriter().concat()},u.prototype.toString=function(){return this.toBuffer().toString("hex")},u.prototype.toBufferWriter=function(e){return e||(e=new t),e.writeUInt32LE(this.version),e.write(this.prevHash),e.write(this.merkleRoot),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e},u.prototype.getTargetDifficulty=function(e){e=e||this.bits;for(var t=new a(16777215&e),r=8*((e>>>24)-3);0e+u.Constants.MAX_TIME_OFFSET)},u.prototype.validProofOfWork=function(){var e=new a(this.id,"hex"),t=this.getTargetDifficulty();return!(0"},u.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new a("10000000000000000000000000000000000000000000000000000000000000000","hex")},p.exports=u}).call(this,f("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],82:[function(e,t,r){t.exports=e("./block"),t.exports.BlockHeader=e("./blockheader"),t.exports.MerkleBlock=e("./merkleblock")},{"./block":80,"./blockheader":81,"./merkleblock":83}],83:[function(e,t,r){(function(s){"use strict";var n=e("lodash"),a=e("./blockheader"),o=e("../util/buffer"),r=e("../encoding/bufferreader"),i=e("../encoding/bufferwriter"),c=e("../crypto/hash"),u=(e("../util/js"),e("../transaction")),f=e("../util/preconditions");function p(e){if(!(this instanceof p))return new p(e);var t={};if(o.isBuffer(e))t=p._fromBufferReader(r(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for MerkleBlock");t={header:e.header instanceof a?e.header:a.fromObject(e.header),numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}return n.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}p.fromBuffer=function(e){return p.fromBufferReader(r(e))},p.fromBufferReader=function(e){return new p(p._fromBufferReader(e))},p.prototype.toBuffer=function(){return this.toBufferWriter().concat()},p.prototype.toBufferWriter=function(e){e||(e=new i),e.write(this.header.toBuffer()),e.writeUInt32LE(this.numTransactions),e.writeVarintNum(this.hashes.length);for(var t=0;tthis.numTransactions)return!1;if(8*this.flags.length8*this.flags.length)return null;var i=this.flags[r.flagBitsUsed>>3]>>>(7&r.flagBitsUsed++)&1;if(0!==e&&i){var n=this._traverseMerkleTree(e-1,2*t,r),a=n;return 2*t+1=this.hashes.length)return null;var o=this.hashes[r.hashesUsed++];return 0===e&&i&&r.txs.push(o),new s(o,"hex")},p.prototype._calcTreeWidth=function(e){return this.numTransactions+(1<>e},p.prototype._calcTreeHeight=function(){for(var e=0;1e.size?t=n.trim(t,i):i>1,o=d.getN(),s=d.getG(),c=a?r.add(o):r,u=d.fromX(n,c);if(!u.mul(o).isInfinity())throw new Error("nR is not a valid curve point");var f=t.neg().mod(o),p=r.invm(o),h=u.mul(i).add(s.mul(f)).mul(p);return m.fromPoint(h,this.sig.compressed)},h.prototype.sigError=function(){if(!f.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s;if(!(e.gt(l.Zero)&&e.lt(d.getN())&&t.gt(l.Zero)&&t.lt(d.getN())))return"r and s not in range";var r=l.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),i=d.getN(),n=t.invm(i),a=n.mul(r).mod(i),o=n.mul(e).mod(i),s=d.getG().mulAdd(a,this.pubkey.point,o);return s.isInfinity()?"p is infinity":0!==s.getX().mod(i).cmp(e)&&"Invalid signature"},h.toLowS=function(e){return e.gt(l.fromBuffer(new c("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=d.getN().sub(e)),e},h.prototype._findSignature=function(e,t){for(var r,i,n,a=d.getN(),o=d.getG(),s=0;(!this.k||0i)r=e(r);else if(r>>=8)}return r},e.exports=r}).call(this,i("_process"),i("buffer").Buffer)},{_process:382,buffer:191,crypto:204}],89:[function(e,r,t){(function(u){"use strict";var g=e("./bn"),v=e("lodash"),b=e("../util/preconditions"),y=e("../util/buffer"),t=e("../util/js"),o=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof g)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};o.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=void 0!==e.i?e.i:this.i,this.compressed=void 0!==e.compressed?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this},o.fromCompact=function(e){b.checkArgument(y.isBuffer(e),"Argument is expected to be a Buffer");var t=new o,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i+=4);var n=e.slice(1,33),a=e.slice(33,65);return b.checkArgument(0===i||1===i||2===i||3===i,new Error("i must be 0, 1, 2, or 3")),b.checkArgument(32===n.length,new Error("r must be 32 bytes")),b.checkArgument(32===a.length,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=g.fromBuffer(n),t.s=g.fromBuffer(a),t},o.fromDER=o.fromBuffer=function(e,t){var r=o.parseDER(e,t),i=new o;return i.r=r.r,i.s=r.s,i},o.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=new o.fromDER(r,!1);return i.nhashtype=t,i},o.fromString=function(e){var t=new u(e,"hex");return o.fromDER(t)},o.parseDER=function(e,t){b.checkArgument(y.isBuffer(e),new Error("DER formatted signature should be a buffer")),v.isUndefined(t)&&(t=!0);var r=e[0];b.checkArgument(48===r,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;b.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(2!==e[2])return!1;if(0===t)return!1;if(128&i[0])return!1;if(1=this.buf.length},e.prototype.read=function(e){r.checkArgument(!n.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t},e.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e},e.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e},e.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=o.fromBuffer(e);return this.pos=this.pos+8,t},e.prototype.readUInt64LEBN=function(){var e,t=this.buf.readUInt32LE(this.pos),r=4294967296*this.buf.readUInt32LE(this.pos+4)+t;if(r<=9007199254740991)e=new o(r);else{var i=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);e=new o(i,10,"le")}return this.pos=this.pos+8,e},e.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN().toNumber();if(t<=Math.pow(2,53))return t;throw new Error("number too large to retain precision - use readVarintBN");default:return e}},e.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return r.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t},e.prototype.readVarintBuf=function(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},e.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new o(this.readUInt16LE());case 254:return new o(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new o(e)}},e.prototype.reverse=function(){for(var e=new i(this.buf.length),t=0;t"},k.prototype.toObject=k.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:_.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},k.fromBuffer=function(e){return new k(e.toString())},k.prototype.toBuffer=function(){return _.copy(this._buffers.xprivkey)},k.DefaultDepth=0,k.DefaultFingerprint=0,k.DefaultChildIndex=0,k.MaxIndex=2*(k.Hardened=2147483648),k.RootElementAlias=["m","M","m'","M'"],k.VersionSize=4,k.DepthSize=1,k.ParentFingerPrintSize=4,k.ChildIndexSize=4,k.ChainCodeSize=32,k.PrivateKeySize=32,k.CheckSumSize=4,k.DataLength=78,k.SerializedByteSize=82,n((k.ChecksumEnd=(k.ChecksumStart=k.PrivateKeyEnd=(k.PrivateKeyStart=(k.ChainCodeEnd=(k.ChainCodeStart=k.ChildIndexEnd=(k.ChildIndexStart=k.ParentFingerPrintEnd=(k.ParentFingerPrintStart=k.DepthEnd=(k.DepthStart=k.VersionEnd=(k.VersionStart=0)+k.VersionSize)+k.DepthSize)+k.ParentFingerPrintSize)+k.ChildIndexSize)+k.ChainCodeSize)+1)+k.PrivateKeySize)+k.CheckSumSize)===k.SerializedByteSize),e.exports=k}).call(this,o("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./crypto/random":88,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdpublickey":99,"./networks":100,"./privatekey":102,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],99:[function(i,s,e){(function(u){"use strict";var n=i("lodash"),t=i("./util/preconditions"),f=i("./crypto/bn"),a=i("./encoding/base58"),p=i("./encoding/base58check"),h=i("./crypto/hash"),r=i("./hdprivatekey"),l=i("./hdkeycache"),d=i("./networks"),m=i("./crypto/point"),g=i("./publickey"),e=i("./errors"),v=e,b=e.HDPublicKey,o=i("assert"),y=i("./util/js"),_=i("./util/buffer");function w(e){if(e instanceof w)return e;if(!(this instanceof w))return new w(e);if(e){if(n.isString(e)||_.isBuffer(e)){var t=w.getSerializedError(e);if(t){if(_.isBuffer(e)&&!w.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof b.ArgumentIsPrivateExtended)return new r(e).hdPublicKey;throw t}return this._buildFromSerialized(e)}if(n.isObject(e))return e instanceof r?this._buildFromPrivate(e):this._buildFromObject(e);throw new b.UnrecognizedArgument(e)}throw new b.MustSupplyArgument}w.isValidPath=function(e){if(n.isString(e)){var t=r._getDerivationIndexes(e);return null!==t&&n.all(t,w.isValidPath)}return!!n.isNumber(e)&&(0<=e&&e"},w.prototype.toObject=w.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version)).name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:_.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},w.fromBuffer=function(e){return new w(e)},w.prototype.toBuffer=function(){return _.copy(this._buffers.xpubkey)},w.Hardened=2147483648,w.RootElementAlias=["m","M"],w.VersionSize=4,w.DepthSize=1,w.ParentFingerPrintSize=4,w.ChildIndexSize=4,w.ChainCodeSize=32,w.PublicKeySize=33,w.CheckSumSize=4,w.DataSize=78,w.SerializedByteSize=82,w.ChecksumEnd=(w.ChecksumStart=w.PublicKeyEnd=(w.PublicKeyStart=w.ChainCodeEnd=(w.ChainCodeStart=w.ChildIndexEnd=(w.ChildIndexStart=w.ParentFingerPrintEnd=(w.ParentFingerPrintStart=w.DepthEnd=(w.DepthStart=w.VersionEnd=(w.VersionStart=0)+w.VersionSize)+w.DepthSize)+w.ParentFingerPrintSize)+w.ChildIndexSize)+w.ChainCodeSize)+w.PublicKeySize)+w.CheckSumSize,o(w.PublicKeyEnd===w.DataSize),o(w.ChecksumEnd===w.SerializedByteSize),s.exports=w}).call(this,i("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdprivatekey":98,"./networks":100,"./publickey":103,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],100:[function(e,t,r){"use strict";var n=e("lodash"),i=e("./util/buffer"),a=e("./util/js"),o=[],s={};function c(){}function u(t,e){if(~o.indexOf(t))return t;if(!e)return s[t];n.isArray(e)||(e=[e]);var r=function(e){return o[i][e]===t};for(var i in o)if(n.any(e,r))return o[i]}function f(e){var t=new c;return a.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey}),e.networkMagic&&a.defineImmutable(t,{networkMagic:i.integerAsBuffer(e.networkMagic)}),e.port&&a.defineImmutable(t,{port:e.port}),e.dnsSeeds&&a.defineImmutable(t,{dnsSeeds:e.dnsSeeds}),n.each(t,function(e){n.isUndefined(e)||n.isObject(e)||(s[e]=t)}),o.push(t),t}c.prototype.toString=function(){return this.name},f({name:"livenet",alias:"mainnet",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var p=u("livenet");f({name:"testnet",alias:"regtest",pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956});var h=u("testnet"),l={PORT:18333,NETWORK_MAGIC:i.integerAsBuffer(185665799),DNS_SEEDS:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]};for(var d in l)n.isObject(l[d])||(s[l[d]]=h);var m={PORT:18444,NETWORK_MAGIC:i.integerAsBuffer(4206867930),DNS_SEEDS:[]};for(var d in m)n.isObject(m[d])||(s[m[d]]=h);Object.defineProperty(h,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.PORT:l.PORT}}),Object.defineProperty(h,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.NETWORK_MAGIC:l.NETWORK_MAGIC}}),Object.defineProperty(h,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.DNS_SEEDS:l.DNS_SEEDS}}),t.exports={add:f,remove:function(e){for(var t=0;t=a.map.OP_1&&e<=a.map.OP_16},a.prototype.inspect=function(){return""},c.exports=a}).call(this,s("buffer").Buffer)},{"./util/buffer":121,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],102:[function(h,l,e){(function(i){"use strict";var n=h("lodash"),r=h("./address"),a=h("./encoding/base58check"),o=h("./crypto/bn"),s=h("./util/js"),c=h("./networks"),u=h("./crypto/point"),e=h("./publickey"),f=h("./crypto/random"),t=h("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(e instanceof p)return e;var r=this._classifyArguments(e,t);if(!r.bn||0===r.bn.cmp(new o(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(u.getN()))throw new TypeError("Number must be less than N");if(void 0===r.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return s.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}p.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?c.get(t):c.defaultNetwork};if(n.isUndefined(e)||n.isNull(e))r.bn=p._getRandomBN();else if(e instanceof o)r.bn=e;else if(e instanceof i||e instanceof Uint8Array)r=p._transformBuffer(e,t);else if(e.bn&&e.network)r=p._transformObject(e);else if(!t&&c.get(e))r.bn=p._getRandomBN(),r.network=c.get(e);else{if("string"!=typeof e)throw new TypeError("First argument is an unrecognized data type.");s.isHexa(e)?r.bn=new o(new i(e,"hex")):r=p._transformWIF(e,t)}return r},p._getRandomBN=function(){var e,t;do{var r=f.getRandomBuffer(32);e=(t=o.fromBuffer(r)).lt(u.getN())}while(!e);return t},p._transformBuffer=function(e,t){var r={};if(32===e.length)return p._transformBNBuffer(e,t);if(r.network=c.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==c.get(t))throw new TypeError("Private key network mismatch");if(34===e.length&&1===e[33])r.compressed=!0;else{if(33!==e.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");r.compressed=!1}return r.bn=o.fromBuffer(e.slice(1,33)),r},p._transformBNBuffer=function(e,t){var r={};return r.network=c.get(t)||c.defaultNetwork,r.bn=o.fromBuffer(e),r.compressed=!1,r},p._transformWIF=function(e,t){return p._transformBuffer(a.decode(e),t)},p.fromBuffer=function(e,t){return new p(e,t)},p._transformObject=function(e){return{bn:new o(e.bn,"hex"),network:c.get(e.network),compressed:e.compressed}},p.fromString=p.fromWIF=function(e){return t.checkArgument(n.isString(e),"First argument is expected to be a string."),new p(e)},p.fromObject=function(e){return t.checkArgument(n.isObject(e),"First argument is expected to be an object."),new p(e)},p.fromRandom=function(e){return new p(p._getRandomBN(),e)},p.getValidationError=function(e,t){var r;try{new p(e,t)}catch(e){r=e}return r},p.isValid=function(e,t){return!!e&&!p.getValidationError(e,t)},p.prototype.toString=function(){return this.toBuffer().toString("hex")},p.prototype.toWIF=function(){var e,t=this.network;return e=this.compressed?i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32}),new i([1])]):i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32})]),a.encode(e)},p.prototype.toBigNumber=function(){return this.bn},p.prototype.toBuffer=function(){return this.bn.toBuffer()},p.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=e.fromPrivateKey(this)),this._pubkey},p.prototype.toAddress=function(e){var t=this.toPublicKey();return r.fromPublicKey(t,e||this.network)},p.prototype.toObject=p.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},p.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return""},l.exports=p}).call(this,h("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/point":87,"./crypto/random":88,"./encoding/base58check":91,"./networks":100,"./publickey":103,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],103:[function(t,r,e){(function(o){"use strict";var s=t("./crypto/bn"),c=t("./crypto/point"),e=t("./crypto/hash"),i=t("./util/js"),n=t("./networks"),u=t("lodash"),f=t("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(f.checkArgument(e,"First argument is required, please include public key data."),e instanceof p)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),i.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||n.defaultNetwork}),this}p.prototype._classifyArgs=function(e,t){var r={compressed:u.isUndefined(t.compressed)||t.compressed};if(e instanceof c)r.point=e;else if(e.x&&e.y)r=p._transformObject(e);else if("string"==typeof e)r=p._transformDER(new o(e,"hex"));else if(p._isBuffer(e))r=p._transformDER(e);else{if(!p._isPrivateKey(e))throw new TypeError("First argument is an unrecognized data format.");r=p._transformPrivateKey(e)}return r.network||(r.network=u.isUndefined(t.network)?void 0:n.get(t.network)),r},p._isPrivateKey=function(e){return e instanceof t("./privatekey")},p._isBuffer=function(e){return e instanceof o||e instanceof Uint8Array},p._transformPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=c.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t},p._transformDER=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r,i,n,a,o={};if(t=!!u.isUndefined(t)||t,4!==e[0]&&(t||6!==e[0]&&7!==e[0]))if(3===e[0])n=e.slice(1),r=new s(n),(o=p._transformX(!0,r)).compressed=!0;else{if(2!==e[0])throw new TypeError("Invalid DER format public key");n=e.slice(1),r=new s(n),(o=p._transformX(!1,r)).compressed=!0}else{if(n=e.slice(1,33),a=e.slice(33,65),32!==n.length||32!==a.length||65!==e.length)throw new TypeError("Length of x and y must be 32 bytes");r=new s(n),i=new s(a),o.point=new c(r,i),o.compressed=!1}return o},p._transformX=function(e,t){f.checkArgument("boolean"==typeof e,"Must specify whether y is odd or not (true or false)");var r={};return r.point=c.fromX(e,t),r},p._transformObject=function(e){var t=new s(e.x,"hex"),r=new s(e.y,"hex");return new p(new c(t,r),{compressed:e.compressed})},p.fromPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t=p._transformPrivateKey(e);return new p(t.point,{compressed:t.compressed,network:t.network})},p.fromDER=p.fromBuffer=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r=p._transformDER(e,t);return new p(r.point,{compressed:r.compressed})},p.fromPoint=function(e,t){return f.checkArgument(e instanceof c,"First argument must be an instance of Point."),new p(e,{compressed:t})},p.fromString=function(e,t){var r=new o(e,t||"hex"),i=p._transformDER(r);return new p(i.point,{compressed:i.compressed})},p.fromX=function(e,t){var r=p._transformX(e,t);return new p(r.point,{compressed:r.compressed})},p.getValidationError=function(e){var t;try{new p(e)}catch(e){t=e}return t},p.isValid=function(e){return!p.getValidationError(e)},p.prototype.toObject=p.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},p.prototype.toBuffer=p.prototype.toDER=function(){var e,t=this.point.getX(),r=this.point.getY(),i=t.toBuffer({size:32}),n=r.toBuffer({size:32});if(this.compressed){var a=n[n.length-1]%2;return e=new o(a?[3]:[2]),o.concat([e,i])}return e=new o([4]),o.concat([e,i,n])},p.prototype._getID=function(){return e.sha256ripemd160(this.toBuffer())},p.prototype.toAddress=function(e){return t("./address").fromPublicKey(this,e||this.network)},p.prototype.toString=function(){return this.toDER().toString("hex")},p.prototype.inspect=function(){return""},r.exports=p}).call(this,t("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./networks":100,"./privatekey":102,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],104:[function(e,t,r){t.exports=e("./script"),t.exports.Interpreter=e("./interpreter")},{"./interpreter":105,"./script":106}],105:[function(p,t,e){(function(e){"use strict";var R=p("lodash"),z=p("./script"),M=p("../opcode"),N=p("../crypto/bn"),D=p("../crypto/hash"),q=p("../crypto/signature"),L=p("../publickey"),U=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};U.prototype.verify=function(e,t,r,i,n){var a,o=p("../transaction");if(R.isUndefined(r)&&(r=new o),R.isUndefined(i)&&(i=0),R.isUndefined(n)&&(n=0),this.set({script:e,tx:r,nin:i,flags:n}),0!=(n&U.SCRIPT_VERIFY_SIGPUSHONLY)&&!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(!this.evaluate())return!1;n&U.SCRIPT_VERIFY_P2SH&&(a=this.stack.slice());var s=this.stack;if(this.initialize(),this.set({script:t,stack:s,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(0===this.stack.length)return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT");var c=this.stack[this.stack.length-1];if(!U.castToBool(c))return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK");if(n&U.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(0===a.length)throw new Error("internal error - stack copy empty");var u=a[a.length-1],f=z.fromBuffer(u);return a.pop(),this.initialize(),this.set({script:f,stack:a,tx:r,nin:i,flags:n}),!!this.evaluate()&&(0===a.length?!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK"):!!U.castToBool(a[a.length-1])||!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK"))}return!0},(t.exports=U).prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},U.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=void 0!==e.nin?e.nin:this.nin,this.stack=e.stack||this.stack,this.altstack=e.altack||this.altstack,this.pc=void 0!==e.pc?e.pc:this.pc,this.pbegincodehash=void 0!==e.pbegincodehash?e.pbegincodehash:this.pbegincodehash,this.nOpCount=void 0!==e.nOpCount?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=void 0!==e.flags?e.flags:this.flags},U.true=new e([1]),U.false=new e([]),U.MAX_SCRIPT_ELEMENT_SIZE=520,U.LOCKTIME_THRESHOLD_BN=new N(U.LOCKTIME_THRESHOLD=5e8),U.SCRIPT_VERIFY_NONE=0,U.SCRIPT_VERIFY_P2SH=1,U.SCRIPT_VERIFY_STRICTENC=2,U.SCRIPT_VERIFY_DERSIG=4,U.SCRIPT_VERIFY_LOW_S=8,U.SCRIPT_VERIFY_NULLDUMMY=16,U.SCRIPT_VERIFY_SIGPUSHONLY=32,U.SCRIPT_VERIFY_MINIMALDATA=64,U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,U.castToBool=function(e){for(var t=0;t=U.LOCKTIME_THRESHOLD&&e.gte(U.LOCKTIME_THRESHOLD_BN))&&(!e.gt(new N(this.tx.nLockTime))&&!!this.tx.inputs[this.nin].isFinal())},U.prototype.step=function(){var e,t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g,v=0!=(this.flags&U.SCRIPT_VERIFY_MINIMALDATA),b=-1===this.vfExec.indexOf(!1),y=this.script.chunks[this.pc];this.pc++;var _=y.opcodenum;if(R.isUndefined(_))return!(this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE");if(y.buf&&y.buf.length>U.MAX_SCRIPT_ELEMENT_SIZE)return!(this.errstr="SCRIPT_ERR_PUSH_SIZE");if(_>M.OP_16&&201<++this.nOpCount)return!(this.errstr="SCRIPT_ERR_OP_COUNT");if(_===M.OP_CAT||_===M.OP_SUBSTR||_===M.OP_LEFT||_===M.OP_RIGHT||_===M.OP_INVERT||_===M.OP_AND||_===M.OP_OR||_===M.OP_XOR||_===M.OP_2MUL||_===M.OP_2DIV||_===M.OP_MUL||_===M.OP_DIV||_===M.OP_MOD||_===M.OP_LSHIFT||_===M.OP_RSHIFT)return!(this.errstr="SCRIPT_ERR_DISABLED_OPCODE");if(b&&0<=_&&_<=M.OP_PUSHDATA4){if(v&&!this.script.checkMinimalPush(this.pc-1))return!(this.errstr="SCRIPT_ERR_MINIMALDATA");if(y.buf){if(y.len!==y.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(y.buf)}else this.stack.push(U.false)}else if(b||M.OP_IF<=_&&_<=M.OP_ENDIF)switch(_){case M.OP_1NEGATE:case M.OP_1:case M.OP_2:case M.OP_3:case M.OP_4:case M.OP_5:case M.OP_6:case M.OP_7:case M.OP_8:case M.OP_9:case M.OP_10:case M.OP_11:case M.OP_12:case M.OP_13:case M.OP_14:case M.OP_15:case M.OP_16:n=_-(M.OP_1-1),e=new N(n).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_NOP:break;case M.OP_NOP2:case M.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break}if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");var w=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v,5);if(w.lt(new N(0)))return!(this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME");if(!this.checkLockTime(w))return!(this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME");break;case M.OP_NOP1:case M.OP_NOP3:case M.OP_NOP4:case M.OP_NOP5:case M.OP_NOP6:case M.OP_NOP7:case M.OP_NOP8:case M.OP_NOP9:case M.OP_NOP10:if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break;case M.OP_IF:case M.OP_NOTIF:if(m=!1,b){if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");e=this.stack.pop(),m=U.castToBool(e),_===M.OP_NOTIF&&(m=!m)}this.vfExec.push(m);break;case M.OP_ELSE:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case M.OP_ENDIF:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec.pop();break;case M.OP_VERIFY:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],!(m=U.castToBool(e)))return!(this.errstr="SCRIPT_ERR_VERIFY");this.stack.pop();break;case M.OP_RETURN:return!(this.errstr="SCRIPT_ERR_OP_RETURN");case M.OP_TOALTSTACK:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.altstack.push(this.stack.pop());break;case M.OP_FROMALTSTACK:if(this.altstack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION");this.stack.push(this.altstack.pop());break;case M.OP_2DROP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop(),this.stack.pop();break;case M.OP_2DUP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1],this.stack.push(t),this.stack.push(r);break;case M.OP_3DUP:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-3],r=this.stack[this.stack.length-2];var k=this.stack[this.stack.length-1];this.stack.push(t),this.stack.push(r),this.stack.push(k);break;case M.OP_2OVER:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-4],r=this.stack[this.stack.length-3],this.stack.push(t),this.stack.push(r);break;case M.OP_2ROT:if(this.stack.length<6)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-6,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_2SWAP:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-4,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_IFDUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-1],(m=U.castToBool(e))&&this.stack.push(e);break;case M.OP_DEPTH:e=new N(this.stack.length).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_DROP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop();break;case M.OP_DUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-1]);break;case M.OP_NIP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,1);break;case M.OP_OVER:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-2]);break;case M.OP_PICK:case M.OP_ROLL:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],n=(s=N.fromScriptNumBuffer(e,v)).toNumber(),this.stack.pop(),n<0||n>=this.stack.length)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-n-1],_===M.OP_ROLL&&this.stack.splice(this.stack.length-n-1,1),this.stack.push(e);break;case M.OP_ROT:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-3],o=this.stack[this.stack.length-2];var x=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=o,this.stack[this.stack.length-2]=x,this.stack[this.stack.length-1]=a;break;case M.OP_SWAP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-2],o=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=o,this.stack[this.stack.length-1]=a;break;case M.OP_TUCK:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case M.OP_SIZE:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");s=new N(this.stack[this.stack.length-1].length),this.stack.push(s.toScriptNumBuffer());break;case M.OP_EQUAL:case M.OP_EQUALVERIFY:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1];var S=t.toString("hex")===r.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(S?U.true:U.false),_===M.OP_EQUALVERIFY){if(!S)return!(this.errstr="SCRIPT_ERR_EQUALVERIFY");this.stack.pop()}break;case M.OP_1ADD:case M.OP_1SUB:case M.OP_NEGATE:case M.OP_ABS:case M.OP_NOT:case M.OP_0NOTEQUAL:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(e=this.stack[this.stack.length-1],s=N.fromScriptNumBuffer(e,v),_){case M.OP_1ADD:s=s.add(N.One);break;case M.OP_1SUB:s=s.sub(N.One);break;case M.OP_NEGATE:s=s.neg();break;case M.OP_ABS:s.cmp(N.Zero)<0&&(s=s.neg());break;case M.OP_NOT:s=new N((0===s.cmp(N.Zero))+0);break;case M.OP_0NOTEQUAL:s=new N((0!==s.cmp(N.Zero))+0)}this.stack.pop(),this.stack.push(s.toScriptNumBuffer());break;case M.OP_ADD:case M.OP_SUB:case M.OP_BOOLAND:case M.OP_BOOLOR:case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:case M.OP_NUMNOTEQUAL:case M.OP_LESSTHAN:case M.OP_GREATERTHAN:case M.OP_LESSTHANOREQUAL:case M.OP_GREATERTHANOREQUAL:case M.OP_MIN:case M.OP_MAX:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(c=N.fromScriptNumBuffer(this.stack[this.stack.length-2],v),u=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v),s=new N(0),_){case M.OP_ADD:s=c.add(u);break;case M.OP_SUB:s=c.sub(u);break;case M.OP_BOOLAND:s=new N((0!==c.cmp(N.Zero)&&0!==u.cmp(N.Zero))+0);break;case M.OP_BOOLOR:s=new N((0!==c.cmp(N.Zero)||0!==u.cmp(N.Zero))+0);break;case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:s=new N((0===c.cmp(u))+0);break;case M.OP_NUMNOTEQUAL:s=new N((0!==c.cmp(u))+0);break;case M.OP_LESSTHAN:s=new N((c.cmp(u)<0)+0);break;case M.OP_GREATERTHAN:s=new N((0"},v.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==c.OP_DUP||this.chunks[1].opcodenum!==c.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==c.OP_EQUALVERIFY||this.chunks[4].opcodenum!==c.OP_CHECKSIG)},v.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&48===e[0]&&t&&t.length){var r=t[0];if((4===r||6===r||7===r)&&65===t.length)return!0;if((3===r||2===r)&&33===t.length)return!0}}return!1},v.prototype.getPublicKey=function(){return p.checkState(this.isPublicKeyOut(),"Can't retreive PublicKey from a non-PK output"),this.chunks[0].buf},v.prototype.getPublicKeyHash=function(){return p.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},v.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===c.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if((4!==t&&6!==t&&7!==t||65!==e.length)&&(3!==t&&2!==t||33!==e.length)||(r=!0),r)return u.isValid(e)}return!1},v.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var e=this.chunks[0].buf;if(e&&e.length&&48===e[0])return!0}return!1},v.prototype.isScriptHashOut=function(){var e=this.toBuffer();return 23===e.length&&e[0]===c.OP_HASH160&&20===e[1]&&e[e.length-1]===c.OP_EQUAL},v.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e,t=this.chunks[this.chunks.length-1].buf;if(!t)return!1;try{e=v.fromBuffer(t)}catch(e){if(e instanceof l.Script.InvalidBuffer)return!1;throw e}return e.classify()!==v.types.UNKNOWN},v.prototype.isMultisigOut=function(){return 3=c.OP_1&&e<=c.OP_16)return e-(c.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))},v.prototype.getSignatureOperationsCount=function(r){r=!!h.isUndefined(r)||r;var i=this,n=0,a=c.OP_INVALIDOPCODE;return h.each(i.chunks,function(e){var t=e.opcodenum;t==c.OP_CHECKSIG||t==c.OP_CHECKSIGVERIFY?n++:t!=c.OP_CHECKMULTISIG&&t!=c.OP_CHECKMULTISIGVERIFY||(r&&a>=c.OP_1&&a<=c.OP_16?n+=i._decodeOP_N(a):n+=20),a=t}),n},t.exports=v}).call(this,e("buffer").Buffer)},{"../address":79,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../networks":100,"../opcode":101,"../publickey":103,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],107:[function(e,t,r){t.exports=e("./transaction"),t.exports.Input=e("./input"),t.exports.Output=e("./output"),t.exports.UnspentOutput=e("./unspentoutput"),t.exports.Signature=e("./signature"),t.exports.Sighash=e("./sighash")},{"./input":108,"./output":114,"./sighash":115,"./signature":116,"./transaction":117,"./unspentoutput":118}],108:[function(e,t,r){t.exports=e("./input"),t.exports.PublicKey=e("./publickey"),t.exports.PublicKeyHash=e("./publickeyhash"),t.exports.MultiSig=e("./multisig.js"),t.exports.MultiSigScriptHash=e("./multisigscripthash.js")},{"./input":109,"./multisig.js":110,"./multisigscripthash.js":111,"./publickey":112,"./publickeyhash":113}],109:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../../util/preconditions"),a=e("../../errors"),o=e("../../encoding/bufferwriter"),s=e("buffer"),c=e("../../util/buffer"),u=e("../../util/js"),f=e("../../script"),p=e("../sighash"),h=e("../output"),l=4294967295;function d(e){return this instanceof d?e?this._fromObject(e):void 0:new d(e)}d.MAXINT=l,d.DEFAULT_SEQNUMBER=4294967295,d.DEFAULT_LOCKTIME_SEQNUMBER=4294967294,d.DEFAULT_RBF_SEQNUMBER=4294967293,Object.defineProperty(d.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new f(this._scriptBuffer),this._script._isInput=!0),this._script)}}),d.fromObject=function(e){return n.checkArgument(i.isObject(e)),(new d)._fromObject(e)},d.prototype._fromObject=function(e){var t;if(t=i.isString(e.prevTxId)&&u.isHexa(e.prevTxId)?new s.Buffer(e.prevTxId,"hex"):e.prevTxId,this.output=e.output?e.output instanceof h?e.output:new h(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=i.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=i.isUndefined(e.sequenceNumber)?i.isUndefined(e.seqnum)?4294967295:e.seqnum:e.sequenceNumber,i.isUndefined(e.script)&&i.isUndefined(e.scriptBuffer))throw new a.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this},d.prototype.toObject=d.prototype.toJSON=function(){var e={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(e.scriptString=this.script.toString()),this.output&&(e.output=this.output.toObject()),e},d.fromBufferReader=function(e){var t=new d;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t},d.prototype.toBufferWriter=function(e){e||(e=new o),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e},d.prototype.setScript=function(e){if(this._script=null,e instanceof f)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(u.isHexa(e))this._scriptBuffer=new s.Buffer(e,"hex");else if(i.isString(e))this._script=new f(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!c.isBuffer(e))throw new TypeError("Invalid argument type: script");this._scriptBuffer=new s.Buffer(e)}return this},d.prototype.getSignatures=function(){throw new a.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},d.prototype.isFullySigned=function(){throw new a.AbstractMethodInvoked("Input#isFullySigned")},d.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},d.prototype.addSignature=function(){throw new a.AbstractMethodInvoked("Input#addSignature")},d.prototype.clearSignatures=function(){throw new a.AbstractMethodInvoked("Input#clearSignatures")},d.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},d.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},d.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},t.exports=d},{"../../encoding/bufferwriter":93,"../../errors":95,"../../script":104,"../../util/buffer":121,"../../util/js":122,"../../util/preconditions":123,"../output":114,"../sighash":115,buffer:191,lodash:149}],110:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=(e("../transaction"),e("./input")),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),u.checkState(o.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.output.script),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},l.normalizeSignatures=function(n,a,o,e,t){return t.map(function(r){var i=null;return e=e.filter(function(e){if(i)return!0;var t=new h({signature:f.fromTxFormat(e),publicKey:r,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:o,sigtype:f.SIGHASH_ALL});return t.signature.nhashtype=t.sigtype,!p.verify(n,t.signature,t.publicKey,t.inputIndex,a.output.script)||(i=t,!1)}),i||null})},l.OPCODES_SIZE=1,l.SIGNATURE_SIZE=73,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"../transaction":117,"./input":109,inherits:148,lodash:149}],111:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=e("./input"),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),this.redeemScript=o.buildMultisigOut(this.publicKeys,r),u.checkState(o.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.redeemScript),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript)},l.OPCODES_SIZE=7,l.SIGNATURE_SIZE=74,l.PUBKEY_SIZE=34,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE+this.publicKeys.length*l.PUBKEY_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148,lodash:149}],112:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),n=(e("../../util/buffer"),e("./input")),o=e("../output"),s=e("../sighash"),c=e("../../script"),u=e("../../crypto/signature"),f=e("../signature");function p(){n.apply(this,arguments)}i(p,n),p.prototype.getSignatures=function(e,t,r,i){a.checkState(this.output instanceof o),i=i||u.SIGHASH_ALL;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new f({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:s.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},p.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(c.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this},p.prototype.clearSignatures=function(){return this.setScript(c.empty()),this},p.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},p.SCRIPT_MAX_SIZE=73,p.prototype._estimateSize=function(){return p.SCRIPT_MAX_SIZE},t.exports=p},{"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],113:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),o=e("../../util/buffer"),s=e("../../crypto/hash"),n=e("./input"),c=e("../output"),u=e("../sighash"),f=e("../../script"),p=e("../../crypto/signature"),h=e("../signature");function l(){n.apply(this,arguments)}i(l,n),l.prototype.getSignatures=function(e,t,r,i,n){return a.checkState(this.output instanceof c),n=n||s.sha256ripemd160(t.publicKey.toBuffer()),i=i||p.SIGHASH_ALL,o.equals(n,this.output.script.getPublicKeyHash())?[new h({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:u.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},l.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(f.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this},l.prototype.clearSignatures=function(){return this.setScript(f.empty()),this},l.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()},l.SCRIPT_MAX_SIZE=107,l.prototype._estimateSize=function(){return l.SCRIPT_MAX_SIZE},t.exports=l},{"../../crypto/hash":86,"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],114:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../crypto/bn"),a=e("buffer"),o=e("../util/buffer"),s=e("../util/js"),c=e("../encoding/bufferwriter"),u=e("../script"),f=e("../util/preconditions"),p=e("../errors");function h(e){if(!(this instanceof h))return new h(e);if(!i.isObject(e))throw new TypeError("Unrecognized argument for Output");var t;this.satoshis=e.satoshis,o.isBuffer(e.script)?this._scriptBuffer=e.script:(t=i.isString(e.script)&&s.isHexa(e.script)?new a.Buffer(e.script,"hex"):e.script,this.setScript(t))}Object.defineProperty(h.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script||this.setScriptFromBuffer(this._scriptBuffer),this._script}}),Object.defineProperty(h.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof n?(this._satoshisBN=e,this._satoshis=e.toNumber()):i.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=n.fromNumber(this._satoshis)):(f.checkArgument(s.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=n.fromNumber(e),this._satoshis=e),f.checkState(s.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),h.prototype.invalidSatoshis=function(){return 9007199254740991"},h.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return t.script=0!==r?e.read(r):new a.Buffer([]),new h(t)},h.prototype.toBufferWriter=function(e){e||(e=new c),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e},t.exports=h},{"../crypto/bn":84,"../encoding/bufferwriter":93,"../errors":95,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],115:[function(y,e,t){(function(f){"use strict";var p=y("buffer"),h=y("../crypto/signature"),l=y("../script"),d=y("./output"),m=y("../encoding/bufferreader"),g=y("../encoding/bufferwriter"),v=y("../crypto/bn"),b=y("../crypto/hash"),o=y("../crypto/ecdsa"),s=y("../util/preconditions"),c=y("lodash"),u=function(e,t,r,i){var n,a=y("./transaction"),o=y("./input"),s=a.shallowCopy(e);for((i=new l(i)).removeCodeseparators(),n=0;n=s.outputs.length)return new f("0000000000000000000000000000000000000000000000000000000000000001","hex");for(s.outputs.length=r+1,n=0;n"},S.prototype.toBuffer=function(){var e=new u;return this.toBufferWriter(e).toBuffer()},S.prototype.toBufferWriter=function(t){return t.writeUInt32LE(this.version),t.writeVarintNum(this.inputs.length),s.each(this.inputs,function(e){e.toBufferWriter(t)}),t.writeVarintNum(this.outputs.length),s.each(this.outputs,function(e){e.toBufferWriter(t)}),t.writeUInt32LE(this.nLockTime),t},S.prototype.fromBuffer=function(e){var t=new c(e);return this.fromBufferReader(t)},S.prototype.fromBufferReader=function(e){var t,r,i;for(a.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readUInt32LE(),r=e.readVarintNum(),t=0;t=this.inputs.length)throw new n.Transaction.InvalidIndex(e,this.inputs.length);var i=this.inputs[e];this.inputs=s.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()},S.prototype.sign=function(e,t){a.checkState(this.hasAllUtxoInfo());var r=this;return s.isArray(e)?s.each(e,function(e){r.sign(e,t)}):s.each(this.getSignatures(e,t),function(e){r.applySignature(e)}),this},S.prototype.getSignatures=function(r,i){r=new k(r),i=i||p.SIGHASH_ALL;var n=this,a=[],o=f.sha256ripemd160(r.publicKey.toBuffer());return s.each(this.inputs,function(e,t){s.each(e.getSignatures(n,r,t,i,o),function(e){a.push(e)})}),a},S.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this},S.prototype.isFullySigned=function(){return s.each(this.inputs,function(e){if(e.isFullySigned===m.prototype.isFullySigned)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),s.all(s.map(this.inputs,function(e){return e.isFullySigned()}))},S.prototype.isValidSignature=function(e){if(this.inputs[e.inputIndex].isValidSignature===m.prototype.isValidSignature)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e)},S.prototype.verifySignature=function(e,t,r,i){return h.verify(this,e,t,r,i)},S.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var e=new x(0),t=0;t=m.MAXINT-1&&(t.sequenceNumber=m.DEFAULT_RBF_SEQNUMBER)}return this},I.exports=S}).call(this,A("buffer").Buffer)},{"../address":79,"../crypto/bn":84,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../privatekey":102,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"./input":108,"./output":114,"./sighash":115,"./unspentoutput":118,buffer:191,"buffer-compare":126,lodash:149}],118:[function(e,t,r){"use strict";var o=e("lodash"),s=e("../util/preconditions"),c=e("../util/js"),u=e("../script"),f=e("../address"),p=e("../unit");function h(e){if(!(this instanceof h))return new h(e);s.checkArgument(o.isObject(e),"Must provide an object from where to extract data");var t=e.address?new f(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!c.isHexaString(r)||64"},h.prototype.toString=function(){return this.txId+":"+this.outputIndex},h.fromObject=function(e){return new h(e)},h.prototype.toObject=h.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:p.fromSatoshis(this.satoshis).toBTC()}},t.exports=h},{"../address":79,"../script":104,"../unit":119,"../util/js":122,"../util/preconditions":123,lodash:149}],119:[function(e,t,r){"use strict";var i=e("lodash"),n=e("./errors"),a=e("./util/preconditions"),o={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function s(e,t){if(!(this instanceof s))return new s(e,t);if(i.isNumber(t)){if(t<=0)throw new n.Unit.InvalidRate(t);e/=t,t=s.BTC}this._value=this._from(e,t);var r=this;Object.keys(o).forEach(function(e){Object.defineProperty(r,e,{get:function(){return r.to(e)},enumerable:!0})})}Object.keys(o).forEach(function(e){s[e]=e}),s.fromObject=function(e){return a.checkArgument(i.isObject(e),"Argument is expected to be an object"),new s(e.amount,e.code)},s.fromBTC=function(e){return new s(e,s.BTC)},s.fromMillis=s.fromMilis=function(e){return new s(e,s.mBTC)},s.fromMicros=s.fromBits=function(e){return new s(e,s.bits)},s.fromSatoshis=function(e){return new s(e,s.satoshis)},s.fromFiat=function(e,t){return new s(e,t)},s.prototype._from=function(e,t){if(!o[t])throw new n.Unit.UnknownCode(t);return parseInt((e*o[t][0]).toFixed())},s.prototype.to=function(e){if(i.isNumber(e)){if(e<=0)throw new n.Unit.InvalidRate(e);return parseFloat((this.BTC*e).toFixed(2))}if(!o[e])throw new n.Unit.UnknownCode(e);var t=this._value/o[e][0];return parseFloat(t.toFixed(o[e][1]))},s.prototype.toBTC=function(){return this.to(s.BTC)},s.prototype.toMillis=s.prototype.toMilis=function(){return this.to(s.mBTC)},s.prototype.toMicros=s.prototype.toBits=function(){return this.to(s.bits)},s.prototype.toSatoshis=function(){return this.to(s.satoshis)},s.prototype.atRate=function(e){return this.to(e)},s.prototype.toString=function(){return this.satoshis+" satoshis"},s.prototype.toObject=s.prototype.toJSON=function(){return{amount:this.BTC,code:s.BTC}},s.prototype.inspect=function(){return""},t.exports=s},{"./errors":95,"./util/preconditions":123,lodash:149}],120:[function(e,t,r){"use strict";var i=e("lodash"),n=e("url"),a=e("./address"),o=e("./unit"),s=function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.extras={},this.knownParams=r||[],this.address=this.network=this.amount=this.message=null,"string"==typeof t){var i=e.parse(t);i.amount&&(i.amount=this._parseAmount(i.amount)),this._fromObject(i)}else{if("object"!==(void 0===t?"undefined":_typeof(t)))throw new TypeError("Unrecognized data format.");this._fromObject(t)}};s.fromString=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return new s(e)},s.fromObject=function(e){return new s(e)},s.isValid=function(e,t){try{new s(e,t)}catch(e){return!1}return!0},s.parse=function(e){var t=n.parse(e,!0);if("bitcoin:"!==t.protocol)throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(e);return t.query.address=r&&r[1]||void 0,t.query},s.Members=["address","amount","message","label","r"],s.prototype._fromObject=function(e){if(!a.isValid(e.address))throw new TypeError("Invalid bitcoin address");for(var t in this.address=new a(e.address),this.network=this.address.network,this.amount=e.amount,e)if("address"!==t&&"amount"!==t){if(/^req-/.exec(t)&&-1===this.knownParams.indexOf(t))throw Error("Unknown required argument "+t);(-1"},t.exports=s},{"./address":79,"./unit":119,lodash:149,url:500}],121:[function(o,s,e){(function(r){"use strict";var i=o("buffer"),t=o("assert"),n=o("./js"),a=o("./preconditions");function e(e,t){if(e.length!==t.length)return!1;for(var r=e.length,i=0;i>24&255),t.push(e>>16&255),t.push(e>>8&255),t.push(255&e),new r(t)},integerFromBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]<<24|e[1]<<16|e[2]<<8|e[3]},integerFromSingleByteBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]},bufferToHex:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e.toString("hex")},reverse:function(e){for(var t=new i.Buffer(e.length),r=0;r>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}}else if("le"===r)for(i=0,a=0;i>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-i&4194303,26<=(i+=24)&&(i-=26,n++)}if(r+6!==t){a=o(e,t,r+6);this.words[n]|=a<>>26-i&4194303}this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];v.prototype.toString=function(e,t){if(16===(e=e||10)||"hex"===e){for(var r="",i=0,n=(t=0|t||1,0),a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return this.sign&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var c=l[e],u=d[e],f=(r="",this.clone());for(f.sign=!1;0!==f.cmpn(0);){var p=f.modn(u).toString(e);r=0!==(f=f.idivn(u)).cmpn(0)?h[c-p.length]+p+r:p+r}return 0===this.cmpn(0)&&(r="0"+r),this.sign&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.prototype.toJSON=function(){return this.toString(16)},v.prototype.toArray=function(){this.strip();var e=new Array(this.byteLength());e[0]=0;for(var t=this.clone(),r=0;0!==t.cmpn(0);r++){var i=t.andln(255);t.ishrn(8),e[e.length-r-1]=i}return e},v.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return 4096<=t&&(r+=13,t>>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.iand=function(e){var t;this.sign=this.sign&&e.sign,t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},v.prototype.ixor=function(e){var t,r;this.sign=this.sign||e.sign,r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);for(var r=e/26|0,i=e%26;this.length<=r;)this.words[this.length++]=0;return this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,a=0;a>>26}for(;0!==n&&a>>26}if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this);this.sign=!1;t=e.sub(this);return this.sign=!0,t},v.prototype.isub=function(e){if(e.sign){e.sign=!1;var t=this.iadd(e);return e.sign=!0,t._normSign()}if(this.sign)return this.sign=!1,this.iadd(e),this.sign=!0,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.sign=!1,this.length=1,this.words[0]=0,this;i=0>26,this.words[o]=67108863&t}for(;0!==a&&o>26,this.words[o]=67108863&t}if(0===a&&o>>26,a=67108863&r,o=Math.min(i,e.length-1),s=Math.max(0,i-this.length+1);s<=o;s++){var c=i-s,u=(0|this.words[c])*(0|e.words[s]),f=67108863&u;a=67108863&(f=f+a|0),n=(n=n+(u/67108864|0)|0)+(f>>>26)|0}t.words[i]=a,r=n}return 0!==r?t.words[i]=r:t.length--,t.strip()},v.prototype._bigMulTo=function(e,t){t.sign=e.sign!==this.sign,t.length=this.length+e.length;for(var r=0,i=0,n=0;n>>26)|0)>>>26,a&=67108863}t.words[n]=o,r=a,a=i}return 0!==r?t.words[n]=r:t.length--,t.strip()},v.prototype.mulTo=function(e,t){return this.length+e.length<63?this._smallMulTo(e,t):this._bigMulTo(e,t)},v.prototype.mul=function(e){var t=new v(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},v.prototype.imul=function(e){if(0===this.cmpn(0)||0===e.cmpn(0))return this.words[0]=0,this.length=1,this;var t=this.length,r=e.length;this.sign=e.sign!==this.sign,this.length=this.length+e.length,this.words[this.length-1]=0;for(var i=this.length-2;0<=i;i--){for(var n=0,a=0,o=Math.min(i,r-1),s=Math.max(0,i-t+1);s<=o;s++){var c=i-s,u=this.words[c]*e.words[s],f=67108863&u;n+=u/67108864|0,a=67108863&(f+=a),n+=f>>>26}this.words[i]=a,this.words[i+1]+=n,n=0}for(n=0,c=1;c>>26}return this.strip()},v.prototype.imuln=function(e){g("number"==typeof e);for(var t=0,r=0;r>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.mul(this)},v.prototype.ishln=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){for(var n=0,a=0;a>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;a>>n<a){this.length-=a;for(c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(c/67108864|0),this.words[a+r]=67108863&s}for(;a>26,this.words[a+r]=67108863&s}if(0===o)return this.strip();g(-1===o);for(a=o=0;a>26,this.words[a]=67108863&s}return this.sign=!0,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.shln(r),i.ishln(r),a=n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var n;i=this.divmod(e.neg(),t);return"mod"!==t&&(n=i.div.neg()),{div:n,mod:i.mod}},v.prototype.div=function(e){return this.divmod(e,"div").div},v.prototype.mod=function(e){return this.divmod(e,"mod").mod},v.prototype.divRound=function(e){var t=this.divmod(e);if(0===t.mod.cmpn(0))return t.div;var r=t.div.sign?t.mod.isub(e):t.mod,i=e.shrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:t.div.sign?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+this.words[i])%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=this.words[r]+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.ishrn(1),r.ishrn(1),++s;for(var c=r.clone(),u=t.clone();0!==t.cmpn(0);){for(;t.isEven();)t.ishrn(1),i.isEven()&&n.isEven()?(i.ishrn(1),n.ishrn(1)):(i.iadd(c).ishrn(1),n.isub(u).ishrn(1));for(;r.isEven();)r.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(u).ishrn(1));0<=t.cmp(r)?(t.isub(r),i.isub(a),n.isub(o)):(r.isub(t),a.isub(i),o.isub(n))}return{a:a,b:o,gcd:r.ishln(s)}},v.prototype._invmp=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=r.clone();0>>26,o&=67108863,this.words[n]=o}return 0!==a&&(this.words[n]=a,this.length++),this},v.prototype.cmpn=function(e){var t,r=e<0;if(r&&(e=-e),this.sign&&!r)return-1;if(!this.sign&&r)return 1;if(e&=67108863,this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}e.words[i-10]=n>>>22,e.length-=9},a.prototype.imulK=function(e){var t;e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(i[e])return i[e];var t;if("k256"===e)t=new a;else if("p224"===e)t=new s;else if("p192"===e)t=new c;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new u}return i[e]=t},f.prototype._verify1=function(e){g(!e.sign,"red works only with positives"),g(e.red,"red works only with red numbers")},f.prototype._verify2=function(e,t){g(!e.sign&&!t.sign,"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},f.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.mod(this.m)._forceRed(this)},f.prototype.neg=function(e){var t=e.clone();return t.sign=!t.sign,t.iadd(this.m)._forceRed(this)},f.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},f.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},f.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)},f.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.shln(t))},f.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},f.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},f.prototype.isqr=function(e){return this.imul(e,e)},f.prototype.sqr=function(e){return this.mul(e,e)},f.prototype.sqrt=function(e){if(0===e.cmpn(0))return e.clone();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).ishrn(2);return f=this.pow(e,r)}for(var i=this.m.subn(1),n=0;0!==i.cmpn(0)&&0===i.andln(1);)n++,i.ishrn(1);g(0!==i.cmpn(0));var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).ishrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).ishrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>8,i[r]&=255;for(;a;)i.push(255&a),a>>=8}for(t=0;"1"===e[t]&&tt[i]?1:0);++i);return 0==r&&(t.length>e.length?r=-1:e.length>t.length&&(r=1)),r}},{}],127:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.hmacDRBG=e("./elliptic/hmac-drbg"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec")},{"../package.json":147,"./elliptic/curve":130,"./elliptic/curves":133,"./elliptic/ec":134,"./elliptic/hmac-drbg":137,"./elliptic/utils":139,brorand:140}],128:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic"),S=n.utils.getNAF,j=n.utils.getJSF,u=n.utils.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function o(e,t){this.curve=e,this.type=t,this.precomputed=null}(t.exports=a).prototype.point=function(){throw new Error("Not implemented")},a.prototype.validate=function(){throw new Error("Not implemented")},a.prototype._fixedNafMul=function(e,t){var r=e._getDoubles(),i=S(t,1),n=(1<>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i){for(var n=this._wnafT1,a=this._wnafT2,o=this._wnafT3,s=0,c=0;c>1]:x<0&&(k=a[m][-x-1>>1].neg()),b="affine"===k.type?b.mixedAdd(k):b.add(k))}}for(c=0;c":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],130:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":128,"./edwards":129,"./mont":131,"./short":132}],131:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base;function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(s,o),(t.exports=s).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)},a(c,o.BasePoint),s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.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)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.ishrn(1))n.push(t.andln(1));for(var a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../curve":130,"bn.js":124,inherits:148}],132:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.shrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.sign&&(i=i.neg(),n=n.neg()),a.sign&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(t=new w(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b).redSqrt(),i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},c.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)},c.prototype._endoWnafMulAdd=function(e,t){for(var r=this._endoWnafT1,i=this._endoWnafT2,n=0;n":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],133:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":127,"./precomputed/secp256k1":138,"hash.js":141}],134:[function(e,t,r){"use strict";var d=e("bn.js"),m=e("../../elliptic"),i=m.utils.assert,n=e("./key"),g=e("./signature");function a(e){if(!(this instanceof a))return new a(e);"string"==typeof e&&(i(m.curves.hasOwnProperty(e),"Unknown curve "+e),e=m.curves[e]),e instanceof m.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(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}(t.exports=a).prototype.keyPair=function(e){return new n(this,e)},a.prototype.keyFromPrivate=function(e,t){return n.fromPrivate(this,e,t)},a.prototype.keyFromPublic=function(e,t){return n.fromPublic(this,e,t)},a.prototype.genKeyPair=function(e){e||(e={});for(var t=new m.hmacDRBG({hash:this.hash,pers:e.pers,entropy:e.entropy||m.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new d(2));;){var n=new d(t.generate(r));if(!(0"}},{"../../elliptic":127,"bn.js":124}],136:[function(e,t,r){"use strict";var n=e("bn.js"),a=e("../../elliptic").utils,i=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16))}(t.exports=o).prototype._importDER=function(e,t){if((e=a.toArray(e,t)).length<6||48!==e[0]||2!==e[2])return!1;if(1+e[1]>e.length)return!1;var r=e[3];if(128<=r)return!1;if(4+r+2>=e.length)return!1;if(2!==e[4+r])return!1;var i=e[5+r];return!(128<=i)&&(!(4+r+2+i>e.length)&&(this.r=new n(e.slice(4,4+r)),this.s=new n(e.slice(4+r+2,4+r+2+i)),!0))},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r));var i=[48,t.length+r.length+4,2,t.length];return i=i.concat(t,[2,r.length],r),a.encode(i,e)}},{"../../elliptic":127,"bn.js":124}],137:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("../elliptic").utils,n=o.assert;function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc),r=o.toArray(e.nonce,e.nonceEnc),i=o.toArray(e.pers,e.persEnc);n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this.reseed=1},a.prototype.generate=function(e,t,r,i){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i),this._update(r));for(var n=[];n.length>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e},i.getNAF=function(e,t){for(var r=[],i=1<>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=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=n.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{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;for(a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>10),n[a-7],(r=n[a-15],b(r,7)^b(r,18)^r>>>3),n[a-16]);var o,s,c=this.h[0],u=this.h[1],f=this.h[2],p=this.h[3],h=this.h[4],l=this.h[5],d=this.h[6],m=this.h[7];F(this.k.length===n.length);for(a=0;a>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function s(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}function u(e,t){if(!e)throw new Error(t||"Assertion failed")}i.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},i.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,r){return e+t+r>>>0},i.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},i.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},i.assert=u,i.inherits=n,r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:148}],147:[function(e,t,r){t.exports={_args:[["elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib"]],_from:"elliptic@=3.0.3",_id:"elliptic@3.0.3",_inCache:!0,_location:"/bitcore-lib/elliptic",_phantomChildren:{inherits:"2.0.1"},_requested:{name:"elliptic",raw:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",rawSpec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",scope:null,spec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",type:"remote"},_requiredBy:["/bitcore-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_shasum:"865c9b420bfbe55006b9f969f97a0d2c44966595",_shrinkwrap:null,_spec:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_where:"/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^2.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},description:"EC cryptography",devDependencies:{browserify:"^3.44.2",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",optionalDependencies:{},readme:"# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic)\n\nFast elliptic-curve cryptography in a plain javascript implementation.\n\nNOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve\nfor your cryptography operations.\n\n## Incentive\n\nECC is much slower than regular RSA cryptography, the JS implementations are\neven more slower.\n\n## Benchmarks\n\n```bash\n$ node benchmarks/index.js\nBenchmarking: sign\nelliptic#sign x 262 ops/sec ±0.51% (177 runs sampled)\neccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled)\n------------------------\nFastest is elliptic#sign\n========================\nBenchmarking: verify\nelliptic#verify x 113 ops/sec ±0.50% (166 runs sampled)\neccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled)\n------------------------\nFastest is elliptic#verify\n========================\nBenchmarking: gen\nelliptic#gen x 294 ops/sec ±0.43% (176 runs sampled)\neccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled)\n------------------------\nFastest is elliptic#gen\n========================\nBenchmarking: ecdh\nelliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled)\n------------------------\nFastest is elliptic#ecdh\n========================\n```\n\n## API\n\n### ECDSA\n\n```javascript\nvar EC = require('elliptic').ec;\n\n// Create and initialize EC context\n// (better do it once and reuse it)\nvar ec = new EC('secp256k1');\n\n// Generate keys\nvar key = ec.genKeyPair();\n\n// Sign message (must be an array, or it'll be treated as a hex sequence)\nvar msg = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];\nvar signature = key.sign(msg);\n\n// Export DER encoded signature in Array\nvar derSign = signature.toDER();\n\n// Verify signature\nconsole.log(key.verify(msg, derSign));\n```\n\n### ECDH\n\n```javascript\n// Generate keys\nvar key1 = ec.genKeyPair();\nvar key2 = ec.genKeyPair();\n\nvar shared1 = key1.derive(key2.getPublic());\nvar shared2 = key2.derive(key1.getPublic());\n\nconsole.log('Both shared secrets are BN instances');\nconsole.log(shared1.toString(16));\nconsole.log(shared2.toString(16));\n```\n\nNOTE: `.derive()` returns a [BN][1] instance.\n\n## Supported curves\n\nElliptic.js support following curve types:\n\n* Short Weierstrass\n* Montgomery\n* Edwards\n* Twisted Edwards\n\nFollowing curve 'presets' are embedded into the library:\n\n* `secp256k1`\n* `p192`\n* `p224`\n* `p256`\n* `curve25519`\n* `ed25519`\n\nNOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead.\n\n### Implementation details\n\nECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of\nthe curve operations are performed on non-affine coordinates (either projective\nor extended), various windowing techniques are used for different cases.\n\nAll operations are performed in reduction context using [bn.js][1], hashing is\nprovided by [hash.js][2]\n\n### Related projects\n\n* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both\n browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for\n node)\n\n#### LICENSE\n\nThis software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2014.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://tools.ietf.org/html/rfc6979\n[1]: https://github.com/indutny/bn.js\n[2]: https://github.com/indutny/hash.js\n[3]: https://github.com/bitchan/eccrypto\n[4]: https://github.com/wanderer/secp256k1-node\n",readmeFilename:"README.md",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{test:"make lint && mocha --reporter=spec test/*-test.js"},version:"3.0.3"}},{}],148:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{dup:68}],149:[function(e,y,_){(function(b){(function(){var dn,e,t,mn="3.10.1",gn=1,vn=2,bn=4,yn=8,_n=16,wn=32,kn=64,xn=128,Sn=256,jn=30,En="...",An=150,In=16,Pn=200,On=1,Tn=2,Bn="Expected a function",Cn="__lodash_placeholder__",Fn="[object Arguments]",Rn="[object Array]",zn="[object Boolean]",Mn="[object Date]",Nn="[object Error]",Dn="[object Function]",r="[object Map]",qn="[object Number]",Ln="[object Object]",Un="[object RegExp]",i="[object Set]",Hn="[object String]",n="[object WeakMap]",Kn="[object ArrayBuffer]",Vn="[object Float32Array]",Gn="[object Float64Array]",$n="[object Int8Array]",Wn="[object Int16Array]",Zn="[object Int32Array]",Yn="[object Uint8Array]",Xn="[object Uint8ClampedArray]",Jn="[object Uint16Array]",Qn="[object Uint32Array]",ea=/\b__p \+= '';/g,ta=/\b(__p \+=) '' \+/g,ra=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ia=/&(?:amp|lt|gt|quot|#39|#96);/g,na=/[&<>"'`]/g,aa=RegExp(ia.source),oa=RegExp(na.source),sa=/<%-([\s\S]+?)%>/g,ca=/<%([\s\S]+?)%>/g,ua=/<%=([\s\S]+?)%>/g,fa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,pa=/^\w*$/,ha=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,la=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,da=RegExp(la.source),ma=/[\u0300-\u036f\ufe20-\ufe23]/g,ga=/\\(\\)?/g,va=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ba=/\w*$/,ya=/^0[xX]/,_a=/^\[object .+?Constructor\]$/,wa=/^\d+$/,ka=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xa=/($^)/,Sa=/['\n\r\u2028\u2029\\]/g,ja=(e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",t="[a-z\\xdf-\\xf6\\xf8-\\xff]+",RegExp(e+"+(?="+e+t+")|"+e+"?"+t+"|"+e+"+|[0-9]+","g")),Ea=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Aa=-1,Ia={};Ia[Vn]=Ia[Gn]=Ia[$n]=Ia[Wn]=Ia[Zn]=Ia[Yn]=Ia[Xn]=Ia[Jn]=Ia[Qn]=!0,Ia[Fn]=Ia[Rn]=Ia[Kn]=Ia[zn]=Ia[Mn]=Ia[Nn]=Ia[Dn]=Ia[r]=Ia[qn]=Ia[Ln]=Ia[Un]=Ia[i]=Ia[Hn]=Ia[n]=!1;var Pa={};Pa[Fn]=Pa[Rn]=Pa[Kn]=Pa[zn]=Pa[Mn]=Pa[Vn]=Pa[Gn]=Pa[$n]=Pa[Wn]=Pa[Zn]=Pa[qn]=Pa[Ln]=Pa[Un]=Pa[Hn]=Pa[Yn]=Pa[Xn]=Pa[Jn]=Pa[Qn]=!0,Pa[Nn]=Pa[Dn]=Pa[r]=Pa[i]=Pa[n]=!1;var a={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},o={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},s={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},c={function:!0,object:!0},u={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},f={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},p=c[void 0===_?"undefined":_typeof(_)]&&_&&!_.nodeType&&_,h=c[void 0===y?"undefined":_typeof(y)]&&y&&!y.nodeType&&y,l=p&&h&&"object"==(void 0===b?"undefined":_typeof(b))&&b&&b.Object&&b,d=c["undefined"==typeof self?"undefined":_typeof(self)]&&self&&self.Object&&self,m=c["undefined"==typeof window?"undefined":_typeof(window)]&&window&&window.Object&&window,g=h&&h.exports===p&&p,Oa=l||m!==(this&&this.window)&&m||d||this;function Ta(e,t){if(e!==t){var r=null===e,i=e===dn,n=e==e,a=null===t,o=t===dn,s=t==t;if(t>>1,$=9007199254740991,W=O&&new O,Z={};function Y(e){if(Ka(e)&&!ui(e)&&!(e instanceof Q)){if(e instanceof J)return e;if(_.call(e,"__chain__")&&_.call(e,"__wrapped__"))return Qt(e)}return new J(e)}function X(){}function J(e,t,r){this.__wrapped__=e,this.__actions__=r||[],this.__chain__=!!t}Y.support={};function Q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function ee(){this.__data__={}}function te(e){var t=e?e.length:0;for(this.data={hash:B(null),set:new j};t--;)this.push(e[t])}function re(e,t){var r=e.data;return("string"==typeof t||li(t)?r.set.has(t):r.hash[t])?0:-1}function ie(e,t){var r=-1,i=e.length;for(t||(t=P(i));++r=Pn?st(t):null,c=t.length;s&&(a=re,o=!1,t=s);e:for(;++n>>0,t>>>=0;for(var a=P(n);++i>>1,o=e[a];(r?o<=t:o=Pn)return n.plant(t).value();for(var r=0,i=a?o[r].apply(this,e):t;++r=An)return e}else Gt=0;return Ue(e,t)});function Zt(e){for(var t=Ri(e),r=t.length,i=r&&e.length,n=!!i&&Ut(i)&&(ui(e)||ci(e)),a=-1,o=[];++a>>0,r>>>=0;r=N(t,r)&&e=(e=Ra(e)).length)return e;var o=i-n.length;if(o<1)return n;var s=e.slice(0,o);if(null==a)return s+n;if(vi(a)){if(e.slice(o).search(a)){var c,u,f=e.slice(0,o);for(a.global||(a=b(a.source,(ba.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(f);)u=c.index;s=s.slice(0,null==u?o:u)}}else if(e.indexOf(a,o)!=o){var p=s.lastIndexOf(a);-1=0.13.7 <0.14.0",_id:"bitcore-lib@0.13.19",_inCache:!0,_installable:!0,_location:"/bitcore-lib",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/bitcore-lib-0.13.19.tgz_1470850061596_0.2146058666985482"},_npmUser:{email:"braydon@bitpay.com",name:"braydonf"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{name:"bitcore-lib",raw:"bitcore-lib@^0.13.7",rawSpec:"^0.13.7",scope:null,spec:">=0.13.7 <0.14.0",type:"range"},_requiredBy:["/","/bitcore-message"],_resolved:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz",_shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",_shrinkwrap:{dependencies:{"bn.js":{from:"bn.js@=2.0.4",resolved:"https://registry.npmjs.org/bn.js/-/bn.js-2.0.4.tgz",version:"2.0.4"},bs58:{from:"bs58@=2.0.0",resolved:"https://registry.npmjs.org/bs58/-/bs58-2.0.0.tgz",version:"2.0.0"},"buffer-compare":{from:"buffer-compare@=1.0.0",resolved:"https://registry.npmjs.org/buffer-compare/-/buffer-compare-1.0.0.tgz",version:"1.0.0"},elliptic:{dependencies:{brorand:{from:"brorand@^1.0.1",resolved:"https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz",version:"1.0.5"},"hash.js":{from:"hash.js@=1.0.3",resolved:"https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz",version:"1.0.3"}},from:"elliptic@=3.0.3",resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",version:"3.0.3"},inherits:{from:"inherits@=2.0.1",resolved:"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",version:"2.0.1"},lodash:{from:"lodash@=3.10.1",resolved:"https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",version:"3.10.1"}},name:"bitcore",version:"0.13.18"},_spec:"bitcore-lib@^0.13.7",_where:"/home/administrator/javascript-opentimestamps",author:{email:"dev@bitpay.com",name:"BitPay"},browser:{request:"browser-request"},bugs:{url:"https://github.com/bitpay/bitcore-lib/issues"},contributors:[{name:"Manuel Araoz",email:"manuelaraoz@gmail.com"},{name:"Daniel Cousens",email:"bitcoin@dcousens.com"},{name:"Gordon Hall",email:"gordon@bitpay.com"},{name:"Jeff Garzik",email:"jgarzik@bitpay.com"},{name:"Kyle Drake",email:"kyle@kyledrake.net"},{name:"Esteban Ordano",email:"eordano@gmail.com"},{name:"Matias Alejo Garcia",email:"ematiu@gmail.com"},{name:"Ryan X. Charles",email:"ryanxcharles@gmail.com"},{name:"Stefan Thomas",email:"moon@justmoon.net"},{name:"Stephen Pair",email:"stephen@bitpay.com"},{name:"Wei Lu",email:"luwei.here@gmail.com"}],dependencies:{"bn.js":"=2.0.4",bs58:"=2.0.0","buffer-compare":"=1.0.0",elliptic:"=3.0.3",inherits:"=2.0.1",lodash:"=3.10.1"},description:"A pure and powerful JavaScript Bitcoin library.",devDependencies:{"bitcore-build":"github:bitpay/bitcore-build",brfs:"^1.2.0",chai:"^1.10.0",gulp:"^3.8.10",sinon:"^1.13.0"},directories:{},dist:{shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",tarball:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz"},gitHead:"9517864f14d09700f3fd02ff61173003c0280774",homepage:"https://github.com/bitpay/bitcore-lib#readme",keywords:["address","bip21","bip32","bip37","bip69","bip70","bitcoin","blockchain","cryptocurrency","ecies","multisig","p2p","payment","transaction"],license:"MIT",main:"index.js",maintainers:[{name:"braydonf",email:"braydon@bitpay.com"},{name:"gabegattis",email:"gabegattis@gmail.com"},{name:"gasteve",email:"stephen@pairhome.net"},{name:"patrickbitpay",email:"patrick@bitpay.com"}],name:"bitcore-lib",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/bitpay/bitcore-lib.git"},scripts:{build:"gulp",coverage:"gulp coverage",lint:"gulp lint",test:"gulp test"},version:"0.13.19"}},{}],151:[function(e,t,r){var i=e("bitcore-lib");i.Message=e("./lib/message"),t.exports=i.Message},{"./lib/message":152,"bitcore-lib":78}],152:[function(r,d,e){(function(o){"use strict";var e=r("bitcore-lib"),s=e.deps._,i=e.PrivateKey,n=e.PublicKey,c=e.Address,a=e.encoding.BufferWriter,u=e.crypto.ECDSA,f=e.crypto.Signature,p=e.crypto.Hash.sha256sha256,t=e.util.js,h=e.util.preconditions,l=function e(t){return this instanceof e?(h.checkArgument(s.isString(t),"First argument should be a string"),this.message=t,this):new e(t)};l.MAGIC_BYTES=new o("Bitcoin Signed Message:\n"),l.prototype.magicHash=function(){var e=a.varintBufNum(l.MAGIC_BYTES.length),t=new o(this.message),r=a.varintBufNum(t.length),i=o.concat([e,l.MAGIC_BYTES,r,t]);return p(i)},l.prototype._sign=function(e){h.checkArgument(e instanceof i,"First argument should be an instance of PrivateKey");var t=this.magicHash(),r=new u;return r.hashbuf=t,r.privkey=e,r.pubkey=e.toPublicKey(),r.signRandomK(),r.calci(),r.sig},l.prototype.sign=function(e){return this._sign(e).toCompact().toString("base64")},l.prototype._verify=function(e,t){h.checkArgument(e instanceof n,"First argument should be an instance of PublicKey"),h.checkArgument(t instanceof f,"Second argument should be an instance of Signature");var r=this.magicHash(),i=u.verify(r,t,e);return i||(this.error="The signature was invalid"),i},l.prototype.verify=function(e,t){h.checkArgument(e),h.checkArgument(t&&s.isString(t)),s.isString(e)&&(e=c.fromString(e));var r=f.fromCompact(new o(t,"base64")),i=new u;i.hashbuf=this.magicHash(),i.sig=r;var n=i.toPublicKey(),a=c.fromPublicKey(n,e.network);return e.toString()!==a.toString()?!(this.error="The signature did not match the message digest"):this._verify(n,r)},l.fromString=function(e){return new l(e)},l.fromJSON=function(e){return t.isValidJSON(e)&&(e=JSON.parse(e)),new l(e.message)},l.prototype.toObject=function(){return{message:this.message}},l.prototype.toJSON=function(){return JSON.stringify(this.toObject())},l.prototype.toString=function(){return this.message},l.prototype.inspect=function(){return""},d.exports=l}).call(this,r("buffer").Buffer)},{"bitcore-lib":78,buffer:191}],153:[function(e,r,i){(function(Q,U,u){!function(e){if("object"==(void 0===i?"undefined":_typeof(i))&&void 0!==r)r.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:void 0!==U?t=U:"undefined"!=typeof self&&(t=self),t.Promise=e()}}(function(){var e,t,r;return function a(o,s,c){function u(r,e){if(!s[r]){if(!o[r]){var t="function"==typeof _dereq_&&_dereq_;if(!e&&t)return t(r,!0);if(f)return f(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[r]={exports:{}};o[r][0].call(n.exports,function(e){var t=o[r][1][e];return u(t||e)},n,n.exports,a,o,s,c)}return s[r].exports}for(var f="function"==typeof _dereq_&&_dereq_,e=0;e, no stack trace)"}function V(){return"function"==typeof Y}var G=function(){return!1},$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function W(e){var t=e.match($);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function Z(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);Y(this,Z),32=a)return r[t]=e,this._queue.push(t),!1;null!==n&&(n[t]=e);var o=this._promise,s=this._callback,c=o._boundValue();o._pushContext();var u=g(s).call(c,e,t,i),f=o._popContext();if(m.checkForgottenReturns(u,f,null!==n?"Promise.filter":"Promise.map",o),u===v)return this._reject(u.e),!0;var p=d(u,this._promise);if(p instanceof l){var h=(p=p._target())._bitField;if(0==(50397184&h))return 1<=a&&this._inFlight++,(r[t]=p)._proxy(this,-1*(t+1)),!1;if(0==(33554432&h))return 0!=(16777216&h)?this._reject(p._reason()):this._cancel(),!0;u=p._value()}r[t]=u}return i<=++this._totalResolved&&(null!==n?this._filter(r,n):this._resolve(r),!0)},f.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;0>>16)){if(e===this){var r=c();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,0<(65535&t)&&(0!=(134217728&t)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},E.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,d.isNode);0<(65535&t)?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},E.prototype._fulfillPromises=function(e,t){for(var r=1;r=this._length&&(this._resolve(this._values),!0)},t.prototype._promiseCancelled=function(){return this._cancel(),!0},t.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},t.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof s)e.cancel();else for(var t=0;t=this._length){var r;if(this._isMap)r=function(e){for(var t=new s,r=e.length/2|0,i=0;i>1},i.prototype.props=function(){return r(this)},i.props=function(e){return r(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function i(e){this._capacity=e,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},n.prototype._promiseFulfilled=function(e,t){var r=new i;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},n.prototype._promiseRejected=function(e,t){var r=new i;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},e.settle=function(e){return r.deprecated(".settle()",".reflect()"),new n(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(f,e,t){"use strict";e.exports=function(e,t,n){var r=f("./util"),i=f("./errors").RangeError,a=f("./errors").AggregateError,o=r.isArray,s={};function c(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function u(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new c(e),i=r.promise();return r.setHowMany(t),r.init(),i}r.inherits(c,t),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=o(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(e){this._howMany=e},c.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(s),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);else if("le"===r)for(n=i=0;i>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-a&4194303,26<=(a+=24)&&(a-=26,i++);r+6!==t&&(n=o(e,t,r+6),this.words[i]|=n<>>26-a&4194303),this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=67108863&o,c=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,p=67108863&c,h=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=h;l++){var d=u-l|0;f+=(o=(n=0|e.words[d])*(a=0|t.words[l])+p)/67108864|0,p=67108863&o}r.words[u]=0|p,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}v.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,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}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)&&2<=e&&e<=36){var c=l[e],u=d[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var p=f.modn(u).toString(e);r=(f=f.idivn(u)).isZero()?p+r:h[c-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.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]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},v.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)},v.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},v.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},v.prototype.inotn=function(e){g("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},v.prototype.notn=function(e){return this.clone().inotn(e)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);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,e):(r=e,this);for(var n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},v.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;i=0>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],d=8191&l,m=l>>>13,g=0|o[2],v=8191&g,b=g>>>13,y=0|o[3],_=8191&y,w=y>>>13,k=0|o[4],x=8191&k,S=k>>>13,j=0|o[5],E=8191&j,A=j>>>13,I=0|o[6],P=8191&I,O=I>>>13,T=0|o[7],B=8191&T,C=T>>>13,F=0|o[8],R=8191&F,z=F>>>13,M=0|o[9],N=8191&M,D=M>>>13,q=0|s[0],L=8191&q,U=q>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],$=8191&G,W=G>>>13,Z=0|s[3],Y=8191&Z,X=Z>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],ae=8191&ne,oe=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],pe=8191&fe,he=fe>>>13,le=0|s[9],de=8191&le,me=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(p,L))|0)+((8191&(n=(n=Math.imul(p,U))+Math.imul(h,L)|0))<<13)|0;u=((a=Math.imul(h,U))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,L),n=(n=Math.imul(d,U))+Math.imul(m,L)|0,a=Math.imul(m,U);var ve=(u+(i=i+Math.imul(p,K)|0)|0)+((8191&(n=(n=n+Math.imul(p,V)|0)+Math.imul(h,K)|0))<<13)|0;u=((a=a+Math.imul(h,V)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(b,L)|0,a=Math.imul(b,U),i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,V)|0;var be=(u+(i=i+Math.imul(p,$)|0)|0)+((8191&(n=(n=n+Math.imul(p,W)|0)+Math.imul(h,$)|0))<<13)|0;u=((a=a+Math.imul(h,W)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(_,L),n=(n=Math.imul(_,U))+Math.imul(w,L)|0,a=Math.imul(w,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,i=i+Math.imul(d,$)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,W)|0;var ye=(u+(i=i+Math.imul(p,Y)|0)|0)+((8191&(n=(n=n+Math.imul(p,X)|0)+Math.imul(h,Y)|0))<<13)|0;u=((a=a+Math.imul(h,X)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(x,L),n=(n=Math.imul(x,U))+Math.imul(S,L)|0,a=Math.imul(S,U),i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,W)|0,i=i+Math.imul(d,Y)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,X)|0;var _e=(u+(i=i+Math.imul(p,Q)|0)|0)+((8191&(n=(n=n+Math.imul(p,ee)|0)+Math.imul(h,Q)|0))<<13)|0;u=((a=a+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(A,L)|0,a=Math.imul(A,U),i=i+Math.imul(x,K)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,V)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,W)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(b,Y)|0,a=a+Math.imul(b,X)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0;var we=(u+(i=i+Math.imul(p,re)|0)|0)+((8191&(n=(n=n+Math.imul(p,ie)|0)+Math.imul(h,re)|0))<<13)|0;u=((a=a+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(O,L)|0,a=Math.imul(O,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,V)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,W)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,X)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0;var ke=(u+(i=i+Math.imul(p,ae)|0)|0)+((8191&(n=(n=n+Math.imul(p,oe)|0)+Math.imul(h,ae)|0))<<13)|0;u=((a=a+Math.imul(h,oe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(C,L)|0,a=Math.imul(C,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(O,K)|0,a=a+Math.imul(O,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,W)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(S,Y)|0,a=a+Math.imul(S,X)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ie)|0,i=i+Math.imul(d,ae)|0,n=(n=n+Math.imul(d,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var xe=(u+(i=i+Math.imul(p,ce)|0)|0)+((8191&(n=(n=n+Math.imul(p,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((a=a+Math.imul(h,ue)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(R,L),n=(n=Math.imul(R,U))+Math.imul(z,L)|0,a=Math.imul(z,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,W)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ie)|0,i=i+Math.imul(v,ae)|0,n=(n=n+Math.imul(v,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,i=i+Math.imul(d,ce)|0,n=(n=n+Math.imul(d,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0;var Se=(u+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,he)|0)+Math.imul(h,pe)|0))<<13)|0;u=((a=a+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,U))+Math.imul(D,L)|0,a=Math.imul(D,U),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(z,K)|0,a=a+Math.imul(z,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,W)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,Y)|0,a=a+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ie)|0,i=i+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,i=i+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,ue)|0,i=i+Math.imul(d,pe)|0,n=(n=n+Math.imul(d,he)|0)+Math.imul(m,pe)|0,a=a+Math.imul(m,he)|0;var je=(u+(i=i+Math.imul(p,de)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(h,de)|0))<<13)|0;u=((a=a+Math.imul(h,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(N,K),n=(n=Math.imul(N,V))+Math.imul(D,K)|0,a=Math.imul(D,V),i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,W)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,W)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(C,Y)|0,a=a+Math.imul(C,X)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ie)|0,i=i+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,ue)|0,i=i+Math.imul(v,pe)|0,n=(n=n+Math.imul(v,he)|0)+Math.imul(b,pe)|0,a=a+Math.imul(b,he)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;u=((a=a+Math.imul(m,me)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(N,$),n=(n=Math.imul(N,W))+Math.imul(D,$)|0,a=Math.imul(D,W),i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,X)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ie)|0,i=i+Math.imul(E,ae)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,i=i+Math.imul(x,ce)|0,n=(n=n+Math.imul(x,ue)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,ue)|0,i=i+Math.imul(_,pe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,pe)|0,a=a+Math.imul(w,he)|0;var Ae=(u+(i=i+Math.imul(v,de)|0)|0)+((8191&(n=(n=n+Math.imul(v,me)|0)+Math.imul(b,de)|0))<<13)|0;u=((a=a+Math.imul(b,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(N,Y),n=(n=Math.imul(N,X))+Math.imul(D,Y)|0,a=Math.imul(D,X),i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ie)|0,i=i+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,i=i+Math.imul(x,pe)|0,n=(n=n+Math.imul(x,he)|0)+Math.imul(S,pe)|0,a=a+Math.imul(S,he)|0;var Ie=(u+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,me)|0)+Math.imul(w,de)|0))<<13)|0;u=((a=a+Math.imul(w,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(N,Q),n=(n=Math.imul(N,ee))+Math.imul(D,Q)|0,a=Math.imul(D,ee),i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ie)|0,i=i+Math.imul(B,ae)|0,n=(n=n+Math.imul(B,oe)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,ue)|0,i=i+Math.imul(E,pe)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(A,pe)|0,a=a+Math.imul(A,he)|0;var Pe=(u+(i=i+Math.imul(x,de)|0)|0)+((8191&(n=(n=n+Math.imul(x,me)|0)+Math.imul(S,de)|0))<<13)|0;u=((a=a+Math.imul(S,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(N,re),n=(n=Math.imul(N,ie))+Math.imul(D,re)|0,a=Math.imul(D,ie),i=i+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,i=i+Math.imul(B,ce)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,ue)|0,i=i+Math.imul(P,pe)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(O,pe)|0,a=a+Math.imul(O,he)|0;var Oe=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(A,de)|0))<<13)|0;u=((a=a+Math.imul(A,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(N,ae),n=(n=Math.imul(N,oe))+Math.imul(D,ae)|0,a=Math.imul(D,oe),i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(z,ce)|0,a=a+Math.imul(z,ue)|0,i=i+Math.imul(B,pe)|0,n=(n=n+Math.imul(B,he)|0)+Math.imul(C,pe)|0,a=a+Math.imul(C,he)|0;var Te=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(O,de)|0))<<13)|0;u=((a=a+Math.imul(O,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(N,ce),n=(n=Math.imul(N,ue))+Math.imul(D,ce)|0,a=Math.imul(D,ue),i=i+Math.imul(R,pe)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(z,pe)|0,a=a+Math.imul(z,he)|0;var Be=(u+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,me)|0)+Math.imul(C,de)|0))<<13)|0;u=((a=a+Math.imul(C,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(N,pe),n=(n=Math.imul(N,he))+Math.imul(D,pe)|0,a=Math.imul(D,he);var Ce=(u+(i=i+Math.imul(R,de)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(z,de)|0))<<13)|0;u=((a=a+Math.imul(z,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Fe=(u+(i=Math.imul(N,de))|0)+((8191&(n=(n=Math.imul(N,me))+Math.imul(D,de)|0))<<13)|0;return u=((a=Math.imul(D,me))+(n>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,c[0]=ge,c[1]=ve,c[2]=be,c[3]=ye,c[4]=_e,c[5]=we,c[6]=ke,c[7]=xe,c[8]=Se,c[9]=je,c[10]=Ee,c[11]=Ae,c[12]=Ie,c[13]=Pe,c[14]=Oe,c[15]=Te,c[16]=Be,c[17]=Ce,c[18]=Fe,0!==u&&(c[19]=u,r.length++),r};function s(e,t,r){return(new c).mulp(e,t,r)}function c(e,t){this.x=e,this.y=t}Math.imul||(a=n),v.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?a(this,e,t):r<63?n(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,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},c.prototype.makeRBT=function(e){for(var t=new Array(e),r=v.prototype._countBits(e)-1,i=0;i>=1;return i},c.prototype.permute=function(e,t,r,i,n,a){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*a+1]=8191&n,n>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.muln=function(e){return this.clone().imuln(e)},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.imul(this.clone())},v.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 v(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<a)for(this.length-=a,c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},v.prototype.ishrn=function(e,t,r){return g(0===this.negative),this.iushrn(e,t,r)},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.ushln=function(e){return this.clone().iushln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.ushrn=function(e){return this.clone().iushrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===o)return this.strip();for(g(-1===o),i=o=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,a},v.prototype.div=function(e){return this.divmod(e,"div",!1).div},v.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},v.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},v.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),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(0===e.negative),g(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var c=r.clone(),u=t.clone();!t.isZero();){for(var f=0,p=1;0==(t.words[0]&p)&&f<26;++f,p<<=1);if(0>>26,o&=67108863,this.words[a]=o}return 0!==n&&(this.words[a]=n,this.length++),this},v.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},v.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(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(u[e])return u[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new b;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return u[e]=t},w.prototype._verify1=function(e){g(0===e.negative,"red works only with positives"),g(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){g(0==(e.negative|t.negative),"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},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 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&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();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);g(!i.isZero());var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==a?(a<<=1,a|=f,(4===++o||0===i&&0===u)&&(n=this.mul(n,r[a]),a=o=0)):o=0}s=26}return n},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},v.mont=function(e){return new k(e)},r(k,w),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.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),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new v(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:157}],155:[function(e,t,r){var A=e("concat-map"),I=e("balanced-match");t.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function t(e,r){var i=[];var n=I("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var s=a||o;var c=0<=n.body.indexOf(",");if(!s&&!c)return n.post.match(/,.*\}/)?(e=n.pre+"{"+n.body+P+n.post,t(e)):[e];var u;if(s)u=n.body.split(/\.\./);else if(1===(u=T(n.body)).length&&1===(u=t(u[0],!1).map(B)).length){var f=n.post.length?t(n.post,!1):[""];return f.map(function(e){return n.pre+u[0]+e})}var p=n.pre;var f=n.post.length?t(n.post,!1):[""];var h;if(s){var l=O(u[0]),d=O(u[1]),m=Math.max(u[0].length,u[1].length),g=3==u.length?Math.abs(O(u[2])):1,v=F,b=d>>24]^f[d>>>16&255]^p[m>>>8&255]^h[255&g]^t[v++],o=u[d>>>24]^f[m>>>16&255]^p[g>>>8&255]^h[255&l]^t[v++],s=u[m>>>24]^f[g>>>16&255]^p[l>>>8&255]^h[255&d]^t[v++],c=u[g>>>24]^f[l>>>16&255]^p[d>>>8&255]^h[255&m]^t[v++],l=a,d=o,m=s,g=c;return a=(i[l>>>24]<<24|i[d>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[v++],o=(i[d>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&l])^t[v++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[l>>>8&255]<<8|i[255&d])^t[v++],c=(i[g>>>24]<<24|i[l>>>16&255]<<16|i[d>>>8&255]<<8|i[255&m])^t[v++],[a>>>=0,o>>>=0,s>>>=0,c>>>=0]}var p=[0,1,2,4,8,16,32,64,128,27,54],h=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=[[],[],[],[]],a=[[],[],[],[]],o=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;var f=e[i[r[o]=u]=o],p=e[f],h=e[p],l=257*e[u]^16843008*u;n[0][o]=l<<24|l>>>8,n[1][o]=l<<16|l>>>16,n[2][o]=l<<8|l>>>24,n[3][o]=l,l=16843009*h^65537*p^257*f^16843008*o,a[0][u]=l<<24|l>>>8,a[1][u]=l<<16|l>>>16,a[2][u]=l<<8|l>>>24,a[3][u]=l,0===o?o=s=1:(o=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();function s(e){this._key=a(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],a=0;a>>24,o=h.SBOX[o>>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o],o^=p[a/t|0]<<24):6>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o]),n[a]=n[a-t]^o}for(var s=[],c=0;c>>24]]^h.INV_SUB_MIX[1][h.SBOX[f>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[f>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return o(e=a(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=a(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":447}],159:[function(e,t,r){var o=e("./aes"),u=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),f=e("./ghash"),n=e("buffer-xor"),p=e("./incr32");function a(e,t,r,i){s.call(this);var n=u.alloc(4,0);this._cipher=new o.AES(t);var a=this._cipher.encryptBlock(n);this._ghash=new f(a),r=function(e,t,r){if(12===t.length)return e._finID=u.concat([t,u.from([0,0,0,1])]),u.concat([t,u.from([0,0,0,2])]);var i=new f(r),n=t.length,a=n%16;i.update(t),a&&(a=16-a,i.update(u.alloc(a,0))),i.update(u.alloc(8,0));var o=8*n,s=u.alloc(8);s.writeUIntBE(o,0,8),i.update(s),e._finID=i.state;var c=u.from(e._finID);return p(c),c}(this,r,a),this._prev=u.from(r),this._cache=u.allocUnsafe(0),this._secCache=u.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(a,s),a.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=u.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},a.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(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;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":447}],164:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],165:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":190}],166:[function(e,t,r){var a=e("safe-buffer").Buffer,o=e("buffer-xor");function s(e,t,r){var i=t.length,n=o(t,e._cache);return e._cache=e._cache.slice(i),e._prev=a.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=a.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=a.allocUnsafe(0)),!(e._cache.length<=t.length)){n=a.concat([n,s(e,t,r)]);break}i=e._cache.length,n=a.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":190,"safe-buffer":447}],167:[function(e,t,r){var o=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,a=-1,o=0;++a<8;)i=t&1<<7-a?128:0,o+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>a%8,e._prev=c(e._prev,r?i:n);return o}function c(e,t){var r=e.length,i=-1,n=o.allocUnsafe(e.length);for(e=o.concat([e,o.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=o.allocUnsafe(i),a=-1;++a=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var a=m(r);if("ec"===a.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=g[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new d(i),a=r.data.subjectPrivateKey.data;return n.verify(t,e,a)}(e,t,a)}if("dsa"===a.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,a=r.data.g,o=r.data.pub_key,s=m.signature.decode(e,"der"),c=s.s,u=s.r;v(c,n),v(u,n);var f=l.mont(i),p=c.invm(n);return 0===a.toRed(f).redPow(new l(t).mul(p).mod(n)).fromRed().mul(o.toRed(f).redPow(u.mul(p).mod(n)).fromRed()).mod(i).mod(n).cmp(u)}(e,t,a)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var o=a.modulus.byteLength(),s=[1],c=0;t.length+s.length+2l.UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function h(e,t){for(var r=0;rm.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsm.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelm.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelm.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=m.Z_FILTERED&&e.strategy!=m.Z_HUFFMAN_ONLY&&e.strategy!=m.Z_RLE&&e.strategy!=m.Z_FIXED&&e.strategy!=m.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!g.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new o.Zlib(t);var i=this;this._hadError=!1,this._binding.onerror=function(e,t){i._binding=null,i._hadError=!0;var r=new Error(e);r.errno=t,r.code=m.codes[t],i.emit("error",r)};var r=m.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(r=e.level);var n=m.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(n=e.strategy),this._binding.init(e.windowBits||m.Z_DEFAULT_WINDOWBITS,r,e.memLevel||m.Z_DEFAULT_MEMLEVEL,n,e.dictionary),this._buffer=new g(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=n,this.once("end",this.close)}o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION,Object.keys(o).forEach(function(e){e.match(/^Z/)&&(m[e]=o[e])}),m.codes={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},Object.keys(m.codes).forEach(function(e){m.codes[m.codes[e]]=e}),m.Deflate=s,m.Inflate=c,m.Gzip=u,m.Gunzip=f,m.DeflateRaw=p,m.InflateRaw=h,m.Unzip=l,m.createDeflate=function(e){return new s(e)},m.createInflate=function(e){return new c(e)},m.createDeflateRaw=function(e){return new p(e)},m.createInflateRaw=function(e){return new h(e)},m.createGzip=function(e){return new u(e)},m.createGunzip=function(e){return new f(e)},m.createUnzip=function(e){return new l(e)},m.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new s(t),e,r)},m.deflateSync=function(e,t){return r(new s(t),e)},m.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new u(t),e,r)},m.gzipSync=function(e,t){return r(new u(t),e)},m.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new p(t),e,r)},m.deflateRawSync=function(e,t){return r(new p(t),e)},m.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new l(t),e,r)},m.unzipSync=function(e,t){return r(new l(t),e)},m.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new c(t),e,r)},m.inflateSync=function(e,t){return r(new c(t),e)},m.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new f(t),e,r)},m.gunzipSync=function(e,t){return r(new f(t),e)},m.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new h(t),e,r)},m.inflateRawSync=function(e,t){return r(new h(t),e)},e.inherits(t,a),t.prototype.params=function(e,t,r){if(em.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=m.Z_FILTERED&&t!=m.Z_HUFFMAN_ONLY&&t!=m.Z_RLE&&t!=m.Z_FIXED&&t!=m.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var i=this;this.flush(o.Z_SYNC_FLUSH,function(){i._binding.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())})}else n.nextTick(r)},t.prototype.reset=function(){return this._binding.reset()},t.prototype._flush=function(e){this._transform(new g(0),"",e)},t.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=o.Z_FULL_FLUSH),r.ended)t&&n.nextTick(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var i=this;this.once("drain",function(){i.flush(t)})}else this._flushFlag=e,this.write(new g(0),"",t)},t.prototype.close=function(e){if(e&&n.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;n.nextTick(function(){t.emit("close")})}},t.prototype._transform=function(e,t,r){var i,n=this._writableState,a=(n.ending||n.ended)&&(!e||n.length===e.length);if(null===!e&&!g.isBuffer(e))return r(new Error("invalid input"));a?i=o.Z_FINISH:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH));this._processChunk(e,i,r)},t.prototype._processChunk=function(a,o,s){var c=a&&a.length,u=this._chunkSize-this._offset,f=0,p=this,h="function"==typeof s;if(!h){var t,l=[],d=0;this.on("error",function(e){t=e});do{var e=this._binding.writeSync(o,a,f,c,this._buffer,this._offset,u)}while(!this._hadError&&m(e[0],e[1]));if(this._hadError)throw t;var r=g.concat(l,d);return this.close(),r}var i=this._binding.write(o,a,f,c,this._buffer,this._offset,u);function m(e,t){if(!p._hadError){var r=u-t;if(v(0<=r,"have should not go down"),0=p._chunkSize)&&(u=p._chunkSize,p._offset=0,p._buffer=new g(p._chunkSize)),0===t){if(f+=c-e,c=e,!h)return!0;var n=p._binding.write(o,a,f,c,p._buffer,p._offset,p._chunkSize);return n.callback=m,void(n.buffer=a)}if(!h)return!1;s()}}i.buffer=a,i.callback=m},e.inherits(s,t),e.inherits(c,t),e.inherits(u,t),e.inherits(f,t),e.inherits(p,t),e.inherits(h,t),e.inherits(l,t)}).call(this,d("_process"),d("buffer").Buffer)},{"./binding":185,_process:382,_stream_transform:427,assert:67,buffer:191,util:505}],187:[function(e,t,r){arguments[4][157][0].apply(r,arguments)},{dup:157}],188:[function(e,B,C){(function(T){!function(e){var t="object"==(void 0===C?"undefined":_typeof(C))&&C&&!C.nodeType&&C,r="object"==(void 0===B?"undefined":_typeof(B))&&B&&!B.nodeType&&B,i="object"==(void 0===T?"undefined":_typeof(T))&&T;i.global!==i&&i.window!==i&&i.self!==i||(e=i);var n,a,v=2147483647,b=36,y=1,_=26,o=38,s=700,w=72,k=128,x="-",c=/^xn--/,u=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=b-y,S=Math.floor,j=String.fromCharCode;function E(e){throw new RangeError(p[e])}function l(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function d(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((v-d)/o))&&E("overflow"),d+=c*o,!(c<(u=s<=g?y:g+_<=s?_:s-g));s+=b)o>S(v/(f=b-u))&&E("overflow"),o*=f;g=O(d-a,t=h.length+1,0==a),S(d/t)>v-m&&E("overflow"),m+=S(d/t),d%=t,h.splice(d++,0,m)}return I(h)}function g(e){var t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g=[];for(h=(e=A(e)).length,t=k,a=w,o=r=0;oS((v-r)/(l=i+1))&&E("overflow"),r+=(s-t)*l,t=s,o=0;ov&&E("overflow"),p==t){for(c=r,u=b;!(c<(f=u<=a?y:a+_<=u?_:u-a));u+=b)m=c-f,d=b-f,g.push(j(P(f+m%d,0))),c=S(m/d);g.push(j(P(c,0))),a=O(r,l,i==n),r=0,++i}++r,++t}return g.join("")}if(n={version:"1.4.1",ucs2:{decode:A,encode:I},decode:m,encode:g,toASCII:function(e){return d(e,function(e){return u.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return d(e,function(e){return c.test(e)?m(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",function(){return n});else if(t&&r)if(B.exports==t)r.exports=n;else for(a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],189:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var a=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=c;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function c(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}a.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},a.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:191}],190:[function(e,t,r){(function(a){t.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new a(r),n=0;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function l(e,t){if(p.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return R(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=p.from(t,i)),p.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,n);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,n){var a,o=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;s/=o=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var f=-1;for(a=r;a>>10&1023|55296),f=56320|1023&f),i.push(f),n+=p}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;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 S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===p.compare(this,e)},p.prototype.inspect=function(){var e="",t=N.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,i,n){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(i,n),u=e.slice(t,r),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a,o,s,c,u,f,p,h,l,d=!1;;)switch(i){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return h=t,l=r,M(R(e,(p=this).length-h),p,h,l);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return c=this,u=t,f=r,M(z(e),c,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=t,s=r,M(function(e,t){for(var r,i,n,a=[],o=0;o>8,n=r%256,a.push(n),a.push(i);return a}(e,(a=this).length-o),a,o,s);default:if(d)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function k(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function I(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function P(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function O(e,t,r,i,n,a){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(e,t,r,i,n){return n||O(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function B(e,t,r,i,n){return n||O(e,0,r,8),a.write(e,t,r,i,52,8),r+8}p.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):I(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;0<=--a&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function z(e){return i.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function M(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":75,ieee754:318,isarray:323}],192:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],193:[function(e,t,r){function n(e){this.dict=e||{}}n.prototype.set=function(e,t,r){if("object"!==(void 0===e?"undefined":_typeof(e))){void 0===r&&(r=!0);var i=this.has(e);return!r&&i?this.dict[i]=this.dict[i]+","+t:this.dict[i||e]=t,i}for(var n in e)this.set(n,e[n],t)},n.prototype.has=function(e){for(var t=Object.keys(this.dict),r=(e=e.toLowerCase(),0);rr)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>8^255&n^99,u[r]=n;var a=e[f[n]=r],o=e[a],s=e[o],c=257*e[n]^16843008*n;p[r]=c<<24|c>>>8,h[r]=c<<16|c>>>16,l[r]=c<<8|c>>>24,d[r]=c;c=16843009*s^65537*o^257*a^16843008*r;m[n]=c<<24|c>>>8,g[n]=c<<16|c>>>16,v[n]=c<<8|c>>>24,b[n]=c,r?(r=a^e[e[e[s^a]]],i^=e[e[i]]):r=i=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],i=r.AES=t.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),n=this._keySchedule=[],a=0;a>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o]):(o=u[(o=o<<8|o>>>24)>>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o],o^=y[a/r|0]<<24),n[a]=n[a-r]^o}for(var s=this._invKeySchedule=[],c=0;c>>24]]^g[u[o>>>16&255]]^v[u[o>>>8&255]]^b[u[255&o]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,p,h,l,d,u)},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,m,g,v,b,f);r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,a,o,s){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],p=e[t+2]^r[2],h=e[t+3]^r[3],l=4,d=1;d>>24]^n[f>>>16&255]^a[p>>>8&255]^o[255&h]^r[l++],g=i[f>>>24]^n[p>>>16&255]^a[h>>>8&255]^o[255&u]^r[l++],v=i[p>>>24]^n[h>>>16&255]^a[u>>>8&255]^o[255&f]^r[l++],b=i[h>>>24]^n[u>>>16&255]^a[f>>>8&255]^o[255&p]^r[l++];u=m,f=g,p=v,h=b}m=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&h])^r[l++],g=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[h>>>8&255]<<8|s[255&u])^r[l++],v=(s[p>>>24]<<24|s[h>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^r[l++],b=(s[h>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^r[l++];e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=b},keySize:8});e.AES=t._createHelper(i)}(),n.AES},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],206:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,c,n,a,o,s,u,f,p,h,l,d,m,g,v,b;e.lib.Cipher||(r=(t=e).lib,i=r.Base,c=r.WordArray,n=r.BufferedBlockAlgorithm,(a=t.enc).Utf8,o=a.Base64,s=t.algo.EvpKDF,u=r.Cipher=n.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function n(e){return"string"==typeof e?b:g}return function(i){return{encrypt:function(e,t,r){return n(t).encrypt(i,e,t,r)},decrypt:function(e,t,r){return n(t).decrypt(i,e,t,r)}}}}()}),r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),f=t.mode={},p=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var e=p.extend();function a(e,t,r){var i=this._iv;if(i){var n=i;this._iv=void 0}else n=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:l}),reset:function(){u.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else{i=r.createDecryptor;this._minBufferSize=1}this._mode=i.call(r,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),d=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var i=c.create([1398893684,1701076831]).concat(r).concat(t);else i=t;return i.toString(o)},parse:function(e){var t=o.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var i=c.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return d.create({ciphertext:t,salt:i})}},g=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),a=n.finalize(t),o=n.cfg;return d.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.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}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=c.random(8));var n=s.create({keySize:t+r}).compute(e,i),a=c.create(n.words.slice(t),4*r);return n.sigBytes=4*t,d.create({key:n,iv:a,salt:i})}},b=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),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 a=g.encrypt.call(this,e,t,n.key,i);return a.mixIn(n),a},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,g.decrypt.call(this,e,t,n.key,i)}}))},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],207:[function(e,t,r){var i,n;i=this,n=function(){var f,r,e,t,i,p,n,a,o,s,c,u,h=h||(f=Math,r=Object.create||function(){function r(){}return function(e){var t;return r.prototype=e,t=new r,r.prototype=null,t}}(),t=(e={}).lib={},i=t.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$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)}},p=t.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).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 a=0;a>>2]>>>24-a%4*8&255;t[i+a>>>2]|=o<<24-(i+a)%4*8}else for(a=0;a>>2]=r[a>>>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=f.ceil(t/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,r=[],i=function(t){t=t;var r=987654321,i=4294967295;return function(){var e=((r=36969*(65535&r)+(r>>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return e/=4294967296,(e+=.5)*(.5>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).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 p.init(r,t/2)}},o=n.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(a))}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 p.init(r,t)}},s=n.Utf8={stringify:function(e){try{return decodeURIComponent(escape(o.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return o.parse(unescape(encodeURIComponent(e)))}},c=t.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=s.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,n=this.blockSize,a=i/(4*n),o=(a=e?f.ceil(a):f.max((0|a)-this._minBufferSize,0))*n,s=f.min(4*o,i);if(o){for(var c=0;c>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.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,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var n=0;n>>6-a%4*2;i[n>>>2]|=(o|s)<<24-n%4*8,n++}return c.create(i,n)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],209:[function(e,t,r){var i,n;i=this,n=function(r){return function(){var e=r,n=e.lib.WordArray,t=e.enc;t.Utf16=t.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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}};function o(e){return e<<8&4278255360|e>>>8&16711935}t.Utf16LE={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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return n.create(r,2*t)}}}(),r.enc.Utf16},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],210:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,f,n,a,o;return r=(t=e).lib,i=r.Base,f=r.WordArray,n=t.algo,a=n.MD5,o=n.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=r.hasher.create(),n=f.create(),a=n.words,o=r.keySize,s=r.iterations;a.lengthi&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),a=this._iKey=t.clone(),o=n.words,s=a.words,c=0;c>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)}).prototype=e}}(),t.lib.WordArray},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],215:[function(e,t,r){var i,n;i=this,n=function(o){return function(f){var e=o,t=e.lib,r=t.WordArray,i=t.Hasher,n=e.algo,E=[];!function(){for(var e=0;e<64;e++)E[e]=4294967296*f.abs(f.sin(e+1))|0}();var a=n.MD5=i.extend({_doReset:function(){this._hash=new r.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 a=this._hash.words,o=e[t+0],s=e[t+1],c=e[t+2],u=e[t+3],f=e[t+4],p=e[t+5],h=e[t+6],l=e[t+7],d=e[t+8],m=e[t+9],g=e[t+10],v=e[t+11],b=e[t+12],y=e[t+13],_=e[t+14],w=e[t+15],k=a[0],x=a[1],S=a[2],j=a[3];x=O(x=O(x=O(x=O(x=P(x=P(x=P(x=P(x=I(x=I(x=I(x=I(x=A(x=A(x=A(x=A(x,S=A(S,j=A(j,k=A(k,x,S,j,o,7,E[0]),x,S,s,12,E[1]),k,x,c,17,E[2]),j,k,u,22,E[3]),S=A(S,j=A(j,k=A(k,x,S,j,f,7,E[4]),x,S,p,12,E[5]),k,x,h,17,E[6]),j,k,l,22,E[7]),S=A(S,j=A(j,k=A(k,x,S,j,d,7,E[8]),x,S,m,12,E[9]),k,x,g,17,E[10]),j,k,v,22,E[11]),S=A(S,j=A(j,k=A(k,x,S,j,b,7,E[12]),x,S,y,12,E[13]),k,x,_,17,E[14]),j,k,w,22,E[15]),S=I(S,j=I(j,k=I(k,x,S,j,s,5,E[16]),x,S,h,9,E[17]),k,x,v,14,E[18]),j,k,o,20,E[19]),S=I(S,j=I(j,k=I(k,x,S,j,p,5,E[20]),x,S,g,9,E[21]),k,x,w,14,E[22]),j,k,f,20,E[23]),S=I(S,j=I(j,k=I(k,x,S,j,m,5,E[24]),x,S,_,9,E[25]),k,x,u,14,E[26]),j,k,d,20,E[27]),S=I(S,j=I(j,k=I(k,x,S,j,y,5,E[28]),x,S,c,9,E[29]),k,x,l,14,E[30]),j,k,b,20,E[31]),S=P(S,j=P(j,k=P(k,x,S,j,p,4,E[32]),x,S,d,11,E[33]),k,x,v,16,E[34]),j,k,_,23,E[35]),S=P(S,j=P(j,k=P(k,x,S,j,s,4,E[36]),x,S,f,11,E[37]),k,x,l,16,E[38]),j,k,g,23,E[39]),S=P(S,j=P(j,k=P(k,x,S,j,y,4,E[40]),x,S,o,11,E[41]),k,x,u,16,E[42]),j,k,h,23,E[43]),S=P(S,j=P(j,k=P(k,x,S,j,m,4,E[44]),x,S,b,11,E[45]),k,x,w,16,E[46]),j,k,c,23,E[47]),S=O(S,j=O(j,k=O(k,x,S,j,o,6,E[48]),x,S,l,10,E[49]),k,x,_,15,E[50]),j,k,p,21,E[51]),S=O(S,j=O(j,k=O(k,x,S,j,b,6,E[52]),x,S,u,10,E[53]),k,x,g,15,E[54]),j,k,s,21,E[55]),S=O(S,j=O(j,k=O(k,x,S,j,d,6,E[56]),x,S,w,10,E[57]),k,x,h,15,E[58]),j,k,y,21,E[59]),S=O(S,j=O(j,k=O(k,x,S,j,f,6,E[60]),x,S,v,10,E[61]),k,x,c,15,E[62]),j,k,m,21,E[63]),a[0]=a[0]+k|0,a[1]=a[1]+x|0,a[2]=a[2]+S|0,a[3]=a[3]+j|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var n=f.floor(r/4294967296),a=r;t[15+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,s=o.words,c=0;c<4;c++){var u=s[c];s[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function A(e,t,r,i,n,a,o){var s=e+(t&r|~t&i)+n+o;return(s<>>32-a)+t}function I(e,t,r,i,n,a,o){var s=e+(t&i|r&~i)+n+o;return(s<>>32-a)+t}function P(e,t,r,i,n,a,o){var s=e+(t^r^i)+n+o;return(s<>>32-a)+t}function O(e,t,r,i,n,a,o){var s=e+(r^(t|~i))+n+o;return(s<>>32-a)+t}e.MD5=i._createHelper(a),e.HmacMD5=i._createHmacHelper(a)}(Math),o.MD5},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],216:[function(e,t,r){var i,n;i=this,n=function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function a(e,t,r,i){var n=this._iv;if(n){var a=n.slice(0);this._iv=void 0}else a=this._prevBlock;i.encryptBlock(a,0);for(var o=0;o>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 t=e.Encryptor=e.extend({processBlock:function(e,t){var r,i=this._cipher,n=i.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),0===((r=o)[0]=u(r[0]))&&(r[1]=u(r[1]));var s=o.slice(0);i.encryptBlock(s,0);for(var c=0;c>>2]|=n<<24-a%4*8,e.sigBytes+=n},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],222:[function(e,t,r){var i,n;i=this,n=function(n){return n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],223:[function(e,t,r){var i,n;i=this,n=function(r){return r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],224:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],225:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],226:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,v,n,a,b,o;return r=(t=e).lib,i=r.Base,v=r.WordArray,n=t.algo,a=n.SHA1,b=n.HMAC,o=n.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=b.create(r.hasher,e),n=v.create(),a=v.create([1]),o=n.words,s=a.words,c=r.keySize,u=r.iterations;o.length>>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]],n=this._b=0;n<4;n++)h.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;i[0]^=c,i[1]^=f,i[2]^=u,i[3]^=p,i[4]^=c,i[5]^=f,i[6]^=u,i[7]^=p;for(n=0;n<4;n++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.RabbitLegacy=t._createHelper(i)}(),a.RabbitLegacy},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],228:[function(e,t,r){var i,n;i=this,n=function(a){return function(){var e=a,t=e.lib.StreamCipher,r=e.algo,n=[],c=[],u=[],i=r.Rabbit=t.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(r=this._b=0;r<4;r++)h.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;n[0]^=c,n[1]^=f,n[2]^=u,n[3]^=p,n[4]^=c,n[5]^=f,n[6]^=u,n[7]^=p;for(r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.Rabbit=t._createHelper(i)}(),a.Rabbit},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],229:[function(e,t,r){var i,n;i=this,n=function(o){return function(){var e=o,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.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 a=0;n<256;n++){var o=n%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+i[n]+s)%256;var c=i[n];i[n]=i[a],i[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=n.call(this)},keySize:8,ivSize:0});function n(){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 a=e[t];e[t]=e[r],e[r]=a,i|=e[(e[t]+e[r])%256]<<24-8*n}return this._i=t,this._j=r,i}e.RC4=t._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;0>>24)|4278255360&(n<<24|n>>>8)}var a,o,s,c,u,f,p,h,l,d,m,g=this._hash.words,v=A.words,b=I.words,y=x.words,_=S.words,w=j.words,k=E.words;f=a=g[0],p=o=g[1],h=s=g[2],l=c=g[3],d=u=g[4];for(r=0;r<80;r+=1)m=a+e[t+y[r]]|0,m+=r<16?P(o,s,c)+v[0]:r<32?O(o,s,c)+v[1]:r<48?T(o,s,c)+v[2]:r<64?B(o,s,c)+v[3]:C(o,s,c)+v[4],m=(m=F(m|=0,w[r]))+u|0,a=u,u=c,c=F(s,10),s=o,o=m,m=f+e[t+_[r]]|0,m+=r<16?C(p,h,l)+b[0]:r<32?B(p,h,l)+b[1]:r<48?T(p,h,l)+b[2]:r<64?O(p,h,l)+b[3]:P(p,h,l)+b[4],m=(m=F(m|=0,k[r]))+d|0,f=d,d=l,l=F(h,10),h=p,p=m;m=g[1]+s+l|0,g[1]=g[2]+c+d|0,g[2]=g[3]+u+f|0,g[3]=g[4]+a+p|0,g[4]=g[0]+o+h|0,g[0]=m},_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,a=n.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function P(e,t,r){return e^t^r}function O(e,t,r){return e&t|~e&r}function T(e,t,r){return(e|~t)^r}function B(e,t,r){return e&r|t&~r}function C(e,t,r){return e^(t|~r)}function F(e,t){return e<>>32-t}t.RIPEMD160=n._createHelper(o),t.HmacRIPEMD160=n._createHmacHelper(o)}(Math),s.RIPEMD160},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],231:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,p,o;return r=(t=e).lib,i=r.WordArray,n=r.Hasher,a=t.algo,p=[],o=a.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],a=r[2],o=r[3],s=r[4],c=0;c<80;c++){if(c<16)p[c]=0|e[t+c];else{var u=p[c-3]^p[c-8]^p[c-14]^p[c-16];p[c]=u<<1|u>>>31}var f=(i<<5|i>>>27)+s+p[c];f+=c<20?1518500249+(n&a|~n&o):c<40?1859775393+(n^a^o):c<60?(n&a|n&o|a&o)-1894007588:(n^a^o)-899497514,s=o,o=a,a=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|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(o),t.HmacSHA1=n._createHmacHelper(o),e.SHA1},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],232:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a;return r=(t=e).lib.WordArray,i=t.algo,n=i.SHA256,a=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(a),t.HmacSHA224=n._createHmacHelper(a),e.SHA224},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],n):n(i.CryptoJS)},{"./core":207,"./sha256":233}],233:[function(e,t,r){var i,n;i=this,n=function(c){return function(n){var e=c,t=e.lib,r=t.WordArray,i=t.Hasher,a=e.algo,o=[],y=[];!function(){function e(e){for(var t=n.sqrt(e),r=2;r<=t;r++)if(!(e%r))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(o[i]=t(n.pow(r,.5))),y[i]=t(n.pow(r,1/3)),i++),r++}();var _=[],s=a.SHA256=i.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=0;p<64;p++){if(p<16)_[p]=0|e[t+p];else{var h=_[p-15],l=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,d=_[p-2],m=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;_[p]=l+_[p-7]+m+_[p-16]}var g=i&n^i&a^n&a,v=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&u)+y[p]+_[p];f=u,u=c,c=s,s=o+b|0,o=a,a=n,n=i,i=b+(v+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+u|0,r[7]=r[7]+f|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)]=n.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA256=i._createHelper(s),e.HmacSHA256=i._createHmacHelper(s)}(Math),c.SHA256},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],234:[function(e,t,r){var i,n;i=this,n=function(a){return function(h){var e=a,t=e.lib,l=t.WordArray,i=t.Hasher,f=e.x64.Word,r=e.algo,P=[],O=[],T=[];!function(){for(var e=1,t=0,r=0;r<24;r++){P[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++)O[e+5*t]=t+(2*e+3*t)%5*5;for(var n=1,a=0;a<24;a++){for(var o=0,s=0,c=0;c<7;c++){if(1&n){var u=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(S=r[n]).high^=o,S.low^=a}for(var s=0;s<24;s++){for(var c=0;c<5;c++){for(var u=0,f=0,p=0;p<5;p++){u^=(S=r[c+5*p]).high,f^=S.low}var h=B[c];h.high=u,h.low=f}for(c=0;c<5;c++){var l=B[(c+4)%5],d=B[(c+1)%5],m=d.high,g=d.low;for(u=l.high^(m<<1|g>>>31),f=l.low^(g<<1|m>>>31),p=0;p<5;p++){(S=r[c+5*p]).high^=u,S.low^=f}}for(var v=1;v<25;v++){var b=(S=r[v]).high,y=S.low,_=P[v];if(_<32)u=b<<_|y>>>32-_,f=y<<_|b>>>32-_;else u=y<<_-32|b>>>64-_,f=b<<_-32|y>>>64-_;var w=B[O[v]];w.high=u,w.low=f}var k=B[0],x=r[0];k.high=x.high,k.low=x.low;for(c=0;c<5;c++)for(p=0;p<5;p++){var S=r[v=c+5*p],j=B[v],E=B[(c+1)%5+5*p],A=B[(c+2)%5+5*p];S.high=j.high^~E.high&A.high,S.low=j.low^~E.low&A.low}S=r[0];var I=T[s];S.high^=I.high,S.low^=I.low}},_doFinalize:function(){var e=this._data,t=e.words,r=(this._nDataBytes,8*e.sigBytes),i=32*this.blockSize;t[r>>>5]|=1<<24-r%32,t[(h.ceil((r+1)/i)*i>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();for(var n=this._state,a=this.cfg.outputLength/8,o=a/8,s=[],c=0;c>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),s.push(p),s.push(f)}return new l.init(s,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});e.SHA3=i._createHelper(n),e.HmacSHA3=i._createHmacHelper(n)}(Math),a.SHA3},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],235:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,o,s;return r=(t=e).x64,i=r.Word,n=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.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=o._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s),e.SHA384},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core"),e("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],n):n(i.CryptoJS)},{"./core":207,"./sha512":236,"./x64-core":238}],236:[function(e,t,r){var i,n;i=this,n=function(c){return function(){var e=c,t=e.lib.Hasher,r=e.x64,i=r.Word,n=r.WordArray,a=e.algo;function o(){return i.create.apply(i,arguments)}var xe=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],Se=[];!function(){for(var e=0;e<80;e++)Se[e]=o()}();var s=a.SHA512=t.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=i.high,h=i.low,l=n.high,d=n.low,m=a.high,g=a.low,v=o.high,b=o.low,y=s.high,_=s.low,w=c.high,k=c.low,x=u.high,S=u.low,j=f.high,E=f.low,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=w,N=k,D=x,q=S,L=j,U=E,H=0;H<80;H++){var K=Se[H];if(H<16)var V=K.high=0|e[t+2*H],G=K.low=0|e[t+2*H+1];else{var $=Se[H-15],W=$.high,Z=$.low,Y=(W>>>1|Z<<31)^(W>>>8|Z<<24)^W>>>7,X=(Z>>>1|W<<31)^(Z>>>8|W<<24)^(Z>>>7|W<<25),J=Se[H-2],Q=J.high,ee=J.low,te=(Q>>>19|ee<<13)^(Q<<3|ee>>>29)^Q>>>6,re=(ee>>>19|Q<<13)^(ee<<3|Q>>>29)^(ee>>>6|Q<<26),ie=Se[H-7],ne=ie.high,ae=ie.low,oe=Se[H-16],se=oe.high,ce=oe.low;V=(V=(V=Y+ne+((G=X+ae)>>>0>>0?1:0))+te+((G=G+re)>>>0>>0?1:0))+se+((G=G+ce)>>>0>>0?1:0);K.high=V,K.low=G}var ue,fe=R&M^~R&D,pe=z&N^~z&q,he=A&P^A&T^P&T,le=I&O^I&B^O&B,de=(A>>>28|I<<4)^(A<<30|I>>>2)^(A<<25|I>>>7),me=(I>>>28|A<<4)^(I<<30|A>>>2)^(I<<25|A>>>7),ge=(R>>>14|z<<18)^(R>>>18|z<<14)^(R<<23|z>>>9),ve=(z>>>14|R<<18)^(z>>>18|R<<14)^(z<<23|R>>>9),be=xe[H],ye=be.high,_e=be.low,we=L+ge+((ue=U+ve)>>>0>>0?1:0),ke=me+le;L=D,U=q,D=M,q=N,M=R,N=z,R=C+(we=(we=(we=we+fe+((ue=ue+pe)>>>0>>0?1:0))+ye+((ue=ue+_e)>>>0<_e>>>0?1:0))+V+((ue=ue+G)>>>0>>0?1:0))+((z=F+ue|0)>>>0>>0?1:0)|0,C=T,F=B,T=P,B=O,P=A,O=I,A=we+(de+he+(ke>>>0>>0?1:0))+((I=ue+ke|0)>>>0>>0?1:0)|0}h=i.low=h+I,i.high=p+A+(h>>>0>>0?1:0),d=n.low=d+O,n.high=l+P+(d>>>0>>0?1:0),g=a.low=g+B,a.high=m+T+(g>>>0>>0?1:0),b=o.low=b+F,o.high=v+C+(b>>>0>>0?1:0),_=s.low=_+z,s.high=y+R+(_>>>0>>0?1:0),k=c.low=k+N,c.high=w+M+(k>>>0>>0?1:0),S=u.low=S+q,u.high=x+D+(S>>>0>>0?1:0),E=f.low=E+U,f.high=j+L+(E>>>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=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(s),e.HmacSHA512=t._createHmacHelper(s)}(),c.SHA512},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],237:[function(e,t,r){var i,n;i=this,n=function(s){return function(){var e=s,t=e.lib,r=t.WordArray,i=t.BlockCipher,n=e.algo,u=[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],f=[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],p=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],a=n.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var i=u[r]-1;t[r]=e[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var o=n[a]=[],s=p[a];for(r=0;r<24;r++)o[r/6|0]|=t[(f[r]-1+s)%28]<<31-r%6,o[4+(r/6|0)]|=t[28+(f[r+24]-1+s)%28]<<31-r%6;o[0]=o[0]<<1|o[0]>>>31;for(r=1;r<7;r++)o[r]=o[r]>>>4*(r-1)+3;o[7]=o[7]<<5|o[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[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],d.call(this,4,252645135),d.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),d.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=h[c][((o^n[c])&l[c])>>>0];this._lBlock=o,this._rBlock=a^s}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,d.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(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<>>1];r=h.r28shl(r,a),i=h.r28shl(i,a),h.pc2(r,i,e.keys,n)}},c.prototype._update=function(e,t,r,i){var n=this._desState,a=h.readUInt32BE(e,t),o=h.readUInt32BE(e,t+4);h.ip(a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,o,n.tmp,0):this._decrypt(n,a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],h.writeUInt32BE(r,a,i),h.writeUInt32BE(r,o,i+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,a=p}h.rip(o,a,i,n)},c.prototype._decrypt=function(e,t,r,i,n){for(var a=r,o=t,s=e.keys.length-2;0<=s;s-=2){var c=e.keys[s],u=e.keys[s+1];h.expand(a,e.tmp,0),c^=e.tmp[0],u^=e.tmp[1];var f=h.substitute(c,u),p=a;a=(o^h.permute(f))>>>0,o=p}h.rip(a,o,i,n)}},{"../des":240,inherits:320,"minimalistic-assert":353}],244:[function(e,t,r){"use strict";var a=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),o=n.Cipher,s=n.DES;function c(e,t){a.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new c(this.type,this.options.key);this._edeState=t}i(u,o),(t.exports=u).create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":240,inherits:320,"minimalistic-assert":353}],245:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.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},r.ip=function(e,t,r,i){for(var n=0,a=0,o=6;0<=o;o-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+o&1}for(o=6;0<=o;o-=2){for(s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1;for(s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1}r[i+0]=n>>>0,r[i+1]=a>>>0},r.rip=function(e,t,r,i){for(var n=0,a=0,o=0;o<4;o++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+o&1,n<<=1,n|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;0<=s;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.pc1=function(e,t,r,i){for(var n=0,a=0,o=7;5<=o;o--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.r28shl=function(e,t){return e<>>28-t};var c=[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];r.pc2=function(e,t,r,i){for(var n=0,a=0,o=c.length>>>1,s=0;s>>c[s]&1;for(s=o;s>>c[s]&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var a=23;15<=a;a-=4)i<<=6,i|=e>>>a&63;for(a=11;3<=a;a-=4)n|=e>>>a&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[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];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[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];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(c),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;r.mod(p).cmp(h);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(i=r.shrn(1))&&g(r)&&v(i)&&v(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":154,"miller-rabin":349,randombytes:414}],249:[function(e,t,r){t.exports={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"}}},{}],250:[function(e,t,r){var u=e("crypto"),f=e("jsbn").BigInteger,p=(e("./lib/ec.js").ECPointFp,e("safer-buffer").Buffer);function h(e,t){return e.length>=t?e:h("0"+e,t)}r.ECCurves=e("./lib/sec.js"),r.ECKey=function(e,t,r){var i,n=e(),a=n.getN(),o=Math.floor(a.bitLength()/8);if(t)if(r){e=n.getCurve();this.P=e.decodePointHex(t.toString("hex"))}else{if(t.length!=o)return!1;i=new f(t.toString("hex"),16)}else{var s=a.subtract(f.ONE),c=new f(u.randomBytes(a.bitLength()));i=c.mod(s).add(f.ONE),this.P=n.getG().multiply(i)}this.P&&(this.PublicKey=p.from(n.getCurve().encodeCompressedPointHex(this.P),"hex")),i&&(this.PrivateKey=p.from(h(i.toString(16),2*o),"hex"),this.deriveSharedSecret=function(e){if(!e||!e.P)return!1;var t=e.P.multiply(i);return p.from(h(t.getX().toBigInteger().toString(16),2*o),"hex")})}},{"./lib/ec.js":251,"./lib/sec.js":252,crypto:204,jsbn:325,"safer-buffer":448}],251:[function(e,t,r){var l=e("jsbn").BigInteger,i=l.prototype.Barrett;function f(e,t){this.x=t,this.q=e}function d(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=null==i?l.ONE:i,this.zinv=null}function n(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new d(this,null,null),this.reducer=new i(this.q)}f.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},f.prototype.toBigInteger=function(){return this.x},f.prototype.negate=function(){return new f(this.q,this.x.negate().mod(this.q))},f.prototype.add=function(e){return new f(this.q,this.x.add(e.toBigInteger()).mod(this.q))},f.prototype.subtract=function(e){return new f(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},f.prototype.multiply=function(e){return new f(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},f.prototype.square=function(){return new f(this.q,this.x.square().mod(this.q))},f.prototype.divide=function(e){return new f(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},d.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO))},d.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(l.ZERO)&&!this.y.toBigInteger().equals(l.ZERO)},d.prototype.negate=function(){return new d(this.curve,this.x,this.y.negate(),this.z)},d.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(l.ZERO.equals(r))return l.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new l("3"),n=this.x.toBigInteger(),a=this.y.toBigInteger(),o=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),s=o.multiply(r),c=n.multiply(o),u=t.square().multiply(this.z),f=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(s).multiply(r).mod(this.curve.q),p=c.multiply(i).multiply(t).subtract(a.multiply(s)).subtract(u.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),h=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(p),h)},d.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new l("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),n=i.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),o=t.square().multiply(e);l.ZERO.equals(a)||(o=o.add(this.z.square().multiply(a)));var s=(o=o.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(i).mod(this.curve.q),c=o.multiply(e).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(o.square().multiply(o)).mod(this.curve.q),u=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(c),u)},d.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new l("3")),n=this.negate(),a=this;for(t=i.bitLength()-2;0r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var n=this.curve.getInfinity(),a=this.add(t);0<=i;)n=n.twice(),e.testBit(i)?n=r.testBit(i)?n.add(a):n.add(this):r.testBit(i)&&(n=n.add(t)),--i;return n},n.prototype.getQ=function(){return this.q},n.prototype.getA=function(){return this.a},n.prototype.getB=function(){return this.b},n.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},n.prototype.getInfinity=function(){return this.infinity},n.prototype.fromBigInteger=function(e){return new f(this.q,e)},n.prototype.reduce=function(e){this.reducer.reduce(e)},n.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;t.lengtht+1;){var r=e.shiftRight(t),i=e.subtract(r.shiftLeft(t));this.getR().equals(l.ONE)||(r=r.multiply(this.getR())),e=r.add(i)}for(;0<=e.compareTo(q);)e=e.subtract(q)}else e=e.mod(q);return e},f.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var e=new f(this.q,this.x.modPow(this.q.shiftRight(2).add(l.ONE),this.q));return e.square().equals(this)?e:null}var t=this.q.subtract(l.ONE),r=t.shiftRight(1);if(!this.x.modPow(r,this.q).equals(l.ONE))return null;var i,n,a=t.shiftRight(2).shiftLeft(1).add(l.ONE),o=this.x,s=modDouble(modDouble(o));do{for(var c;0<=(c=new l(this.q.bitLength(),new SecureRandom)).compareTo(this.q)||!c.multiply(c).subtract(s).modPow(r,this.q).equals(t););var u=this.lucasSequence(c,o,a);if(i=u[0],n=u[1],this.modMult(n,n).equals(s))return n.testBit(0)&&(n=n.add(q)),n=n.shiftRight(1),new f(q,n)}while(i.equals(l.ONE)||i.equals(t));return null},f.prototype.lucasSequence=function(e,t,r){for(var i=r.bitLength(),n=r.getLowestSetBit(),a=l.ONE,o=l.TWO,s=e,c=l.ONE,u=l.ONE,f=i-1;n+1<=f;--f)c=this.modMult(c,u),r.testBit(f)?(u=this.modMult(c,t),a=this.modMult(a,s),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1)))):(u=c,a=this.modReduce(a.multiply(o).subtract(c)),s=this.modReduce(s.multiply(o).subtract(e.multiply(c))),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))));c=this.modMult(c,u),u=this.modMult(c,t),a=this.modReduce(a.multiply(o).subtract(c)),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),c=this.modMult(c,u);for(f=1;f<=n;++f)a=this.modMult(a,o),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))),c=this.modMult(c,c);return[a,o]};r={ECCurveFp:n,ECPointFp:d,ECFieldElementFp:f};t.exports=r},{jsbn:325}],252:[function(e,t,r){var o=e("jsbn").BigInteger,s=e("./ec.js").ECCurveFp;function c(e,t,r,i){this.curve=e,this.g=t,this.n=r,this.h=i}function u(e){return new o(e,16)}function i(){var e=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),r=u("E87579C11079F43DD824993C2CEE5ED3"),i=u("FFFFFFFE0000000075A30D1B9038A115"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83"),i,n)}function n(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=o.ZERO,r=u("7"),i=u("0100000000000000000001B8FA16DFAB9ACA16B6B3"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE"),i,n)}function a(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),r=u("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),i=u("0100000000000000000001F4C8F927AED3CA752257"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32"),i,n)}function f(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=o.ZERO,r=u("3"),i=u("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"),i,n)}function p(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),r=u("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),i=u("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811"),i,n)}function h(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),r=u("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),i=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"),i,n)}function l(){var e=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),r=u("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),i=u("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),i,n)}c.prototype.getCurve=function(){return this.curve},c.prototype.getG=function(){return this.g},c.prototype.getN=function(){return this.n},c.prototype.getH=function(){return this.h},t.exports={secp128r1:i,secp160k1:n,secp160r1:a,secp192k1:f,secp192r1:p,secp224r1:h,secp256r1:l}},{"./ec.js":251,jsbn:325}],253:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":268,"./elliptic/curve":256,"./elliptic/curves":259,"./elliptic/ec":260,"./elliptic/eddsa":263,"./elliptic/utils":267,brorand:156}],254:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,j=n.getNAF,E=n.getJSF,p=n.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i,n){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,c=0,u=0;u>1]:S<0&&(x=o[g][-S-1>>1].neg()),y="affine"===x.type?y.mixedAdd(x):y.add(x))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},o.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.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),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],256:[function(e,t,r){arguments[4][130][0].apply(r,arguments)},{"./base":254,"./edwards":255,"./mont":257,"./short":258,dup:130}],257:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base,s=e("../../elliptic").utils;function c(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(c,o),(t.exports=c).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)},a(u,o.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},c.prototype.point=function(e,t){return new u(this,e,t)},c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.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)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},u.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 a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],258:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new w(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)},c.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)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],259:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":253,"./precomputed/secp256k1":266,"hash.js":299}],260:[function(e,t,r){"use strict";var g=e("bn.js"),v=e("hmac-drbg"),a=e("../../elliptic"),l=a.utils.assert,i=e("./key"),b=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(l(a.curves.hasOwnProperty(e),"Unknown curve "+e),e=a.curves[e]),e instanceof a.curves.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}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new v({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new g(2));;){var n=new g(t.generate(r));if(!(0>1;if(0<=o.cmp(this.curve.p.umod(this.curve.n))&&u)throw new Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var f=t.r.invm(n),p=n.sub(a).mul(f).umod(n),h=s.mul(f).umod(n);return this.g.mulAdd(p,o,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new b(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":253,"./key":261,"./signature":262,"bn.js":154,"hmac-drbg":311}],261:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=a).fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},{"../../elliptic":253,"bn.js":154}],262:[function(e,t,r){"use strict";var s=e("bn.js"),c=e("../../elliptic").utils,i=c.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=c.toArray(e,t);var r=new u;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=f(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=f(e,r);if(e.length!==a+r.place)return!1;var o=e.slice(r.place,a+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===o[0]&&128&o[1]&&(o=o.slice(1)),this.r=new s(n),this.s=new s(o),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];p(i,t.length),(i=i.concat(t)).push(2),p(i,r.length);var n=i.concat(r),a=[48];return p(a,n.length),a=a.concat(n),c.encode(a,e)}},{"../../elliptic":253,"bn.js":154}],263:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),a=n.utils,o=a.assert,c=a.parseBytes,s=e("./key"),u=e("./signature");function f(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=f).prototype.sign=function(e,t){e=c(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),a=this.encodePoint(n),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:a})},f.prototype.verify=function(e,t,r){e=c(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(a)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=6.0.0 <7.0.0",_id:"elliptic@6.4.1",_inCache:!0,_installable:!0,_location:"/elliptic",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/elliptic_6.4.1_1533787091502_0.6309761823717674"},_npmUser:{email:"fedor@indutny.com",name:"indutny"},_npmVersion:"6.3.0",_phantomChildren:{},_requested:{name:"elliptic",raw:"elliptic@^6.0.0",rawSpec:"^6.0.0",scope:null,spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/home/administrator/javascript-opentimestamps/node_modules/browserify-sign",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{fileCount:17,integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJba7vUCRA9TVsSAnZWagAA+gcP/jWaj5GmDZ0YFi/X4g5O\nx+pxu9i3HbP9YqywT7rz3XFXSaytu0LQDeDEbddl523X69tsbKfzHRTcnW8n\n2r0VjPhttRm+0RpEhBwjSIK34VkQA1xIWh2ugOToKXVCFVLM5VFDPGzbiN6x\n/hpL7gj1hoCRVmuhjnqFQ+vPKACKfv1Eq4CsRmu2focmP37kQpWQlweD/z4V\nJF4NxA33Fvp13Fl+9g4sPHyhUVsW9ojVaG3Ijn70pCaGQM18UPlbODkWQ1QX\nAgteOFjkIOtcalJk3B3qsM8GZeHEcAFvt2T73miJkHdCGNmRQS45Ede+gnj0\nlLlZJsCCKUHtTqrlprHo6AgMnBZufmytyozYAHC1/JYniazSBi2yPHtQeniR\nl69BfiRBdD2rNrMPwmCNRkMqrgel5WMGpaD0xdaFAHF1Ru2ZQFKsA7KvPGgp\nA20+LN11cCib67Pg5XDyrZ92T3yXec+6gQ3iq9d9UBZKFGl0P8ebVqq1LrUJ\na6nekwMpRISWnKcqV72XVmQdBmUWHq9VfVLsWJzVIJqtpHmUO7q74ACP3i4W\n0/F1REeI0YEhh3NjeStdDecfjlu7PY0pLQpbk2I3ms+6DO+cAfeDEev5jFBK\nwQabRNhITeT1FVtxZAcApj33fnCdqwaWr1NS00K5ZRqhDTTzPr/O4KRN4CR1\npstU\r\n=UVBB\r\n-----END PGP SIGNATURE-----\r\n",shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",unpackedSize:118371},files:["lib"],gitHead:"523da1cf71ddcfd607fbdee1858bc2af47f0e700",homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.1"}},{}],269:[function(e,t,r){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function c(e){return"function"==typeof e}function u(e){return"object"===(void 0===e?"undefined":_typeof(e))&&null!==e}function f(e){return void 0===e}((t.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},i.prototype.emit=function(e){var t,r,i,n,a,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(f(r=this._events[e]))return!1;if(c(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=Array.prototype.slice.call(arguments,1),r.apply(this,n)}else if(u(r))for(n=Array.prototype.slice.call(arguments,1),i=(o=r.slice()).length,a=0;ar&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!c(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,a;if(!c(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||c(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(r)){for(a=n;0=this._blockSize;){for(var n=this._blockOffset;n=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=n.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,a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":310}],310:[function(e,t,r){"use strict";var u=e("minimalistic-assert"),i=e("inherits");function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function o(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}r.inherits=i,r.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:320,"minimalistic-assert":353}],311:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),i=o.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length1e3*t.clockSkew)throw new E("clock skew of "+g/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach(function(e){if(u.params.headers.indexOf(e.toLowerCase())<0)throw new P(e+" was not a signed header")}),t.algorithms&&-1===t.algorithms.indexOf(u.params.algorithm))throw new I(u.params.algorithm+" is not a supported algorithm");return u.algorithm=u.params.algorithm.toUpperCase(),u.keyId=u.params.keyId,u}}},{"./utils":315,"assert-plus":66,util:505}],314:[function(n,a,e){(function(l){var d=n("assert-plus"),m=n("crypto"),e=(n("http"),n("util")),g=n("sshpk"),v=n("jsprim"),t=n("./utils"),b=n("util").format,y=t.HASH_ALGOS,_=t.PK_ALGOS,w=t.InvalidAlgorithmError,r=t.HttpSignatureError,k=t.validateAlgorithm,x='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';function S(e){r.call(this,e,S)}function j(e){r.call(this,e,j)}function i(e){d.object(e,"options");var t=[];if(void 0!==e.algorithm&&(d.string(e.algorithm,"options.algorithm"),t=k(e.algorithm)),this.rs_alg=t,void 0!==e.sign)d.func(e.sign,"options.sign"),this.rs_signFunc=e.sign;else if("hmac"===t[0]&&void 0!==e.key){if(d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,"string"!=typeof e.key&&!l.isBuffer(e.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=m.createHmac(t[1].toUpperCase(),e.key),this.rs_signer.sign=function(){var e=this.digest("base64");return{hashAlgorithm:t[1],toString:function(){return e}}}}else{if(void 0===e.key)throw new TypeError("options.sign (func) or options.key is required");var r=e.key;if(("string"==typeof r||l.isBuffer(r))&&(r=g.parsePrivateKey(r)),d.ok(g.PrivateKey.isPrivateKey(r,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=r,d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,!_[r.type])throw new w(r.type.toUpperCase()+" type keys are not supported");if(void 0!==t[0]&&r.type!==t[0])throw new w("options.key must be a "+t[0].toUpperCase()+" key, was given a "+r.type.toUpperCase()+" key instead");this.rs_signer=r.createSign(t[1])}this.rs_headers=[],this.rs_lines=[]}e.inherits(S,r),e.inherits(j,r),i.prototype.writeHeader=function(e,t){if(d.string(e,"header"),e=e.toLowerCase(),d.string(t,"value"),this.rs_headers.push(e),this.rs_signFunc)this.rs_lines.push(e+": "+t);else{var r=e+": "+t;0>1,f=-7,p=r?n-1:0,h=r?-1:1,l=e[t+p];for(p+=h,a=l&(1<<-f)-1,l>>=-f,f+=s;0>=-f,f+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:a-1,d=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),2<=(t+=1<=o+p?h/c:h*Math.pow(2,1-p))*c&&(o++,c/=2),f<=o+p?(s=0,o=f):1<=o+p?(s=(t*c-1)*Math.pow(2,n),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,n),o=0));8<=n;e[r+l]=255&s,l+=d,s/=256,n-=8);for(o=o<>15;0<=--a;){var c=32767&this[e],u=this[e++]>>15,f=s*c+u*o;n=((c=o*c+((32767&f)<<15)+r[i]+(1073741823&n))>>>30)+(f>>>15)+s*u+(n>>>30),r[i++]=1073741823&c}return n},30):t&&"Netscape"!=navigator.appName?(y.prototype.am=function(e,t,r,i,n,a){for(;0<=--a;){var o=t*this[e++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},26):(y.prototype.am=function(e,t,r,i,n,a){for(var o=16383&t,s=t>>14;0<=--a;){var c=16383&this[e],u=this[e++]>>14,f=s*c+u*o;n=((c=o*c+((16383&f)<<14)+r[i]+n)>>28)+(f>>14)+s*u,r[i++]=268435455&c}return n},28),y.prototype.DB=e,y.prototype.DM=(1<>>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 v(e){this.m=e}function b(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 l(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function d(){}function m(e){return e}function k(e){this.r2=_(),this.q3=_(),y.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},b.prototype.convert=function(e){var t=_();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&0>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),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},b.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.copyTo=function(e){for(var t=this.t-1;0<=t;--t)e[t]=this[t];e.t=this.t,e.s=this.s},y.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0this.DB?(this[this.t-1]|=(o&(1<>this.DB-a):this[this.t-1]|=o<=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,0>n|s,s=(this[r]&a)<=this.t)t.t=0;else{var i=e%this.DB,n=this.DB-i,a=(1<>i;for(var o=r+1;o>i;0>=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:0=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}0>this.F2:0),h=this.FV/p,l=(1<>s)&&(n=!0,a=c(r));0<=o;)s>(s+=this.DB-t)):(r=this[o]>>(s-=t)&i,s<=0&&(s+=this.DB,--o)),02*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=_();return e.copyTo(t),this.reduce(t),t},k.prototype.revert=function(e){return e},k.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);0<=e.compareTo(this.m);)e.subTo(this.m,e)},k.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},k.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x,S,j,E=[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],A=(1<<26)/E[E.length-1];function I(){var e;e=(new Date).getTime(),S[j++]^=255&e,S[j++]^=e>>8&255,S[j++]^=e>>16&255,S[j++]^=e>>24&255,R<=j&&(j-=R)}if(y.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},y.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||36=r&&(this.dMultiply(i),this.dAddOffset(o,0),o=a=0))}0e&&this.subTo(y.ONE.shiftLeft(e-1),this);else{var i=new Array,n=7&e;i.length=1+(e>>3),t.nextBytes(i),0>=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,0=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},y.prototype.multiplyLowerTo=function(e,t,r){var i,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;0>1)>E.length&&(e=E.length);for(var n=_(),a=0;a>24},y.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},y.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},y.prototype.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(0>i)!=(this.s&this.DM)>>i&&(t[n++]=r|this.s<>(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,(0=this.t?0!=this.s:0!=(this[t]&1<>n-c&u:(p=(e[l]&(1<>this.DB+n-c)),s=r;0==(1&p);)p>>=1,--s;if((n-=s)<0&&(n+=this.DB,--l),d)o[p].copyTo(a),d=!1;else{for(;1>>8,S[j++]=255&P;j=0,I()}function B(){if(null==x){for(I(),(x=new F).init(S),j=0;jt.maxItems&&n("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&m.concat(function(e,t,r,i){if("object"==(void 0===t?"undefined":_typeof(t)))for(var n in("object"!=(void 0===e?"undefined":_typeof(e))||e instanceof Array)&&m.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(n)){var a=e[n];if(void 0===a&&h.existingOnly)continue;var o=t[n];void 0===a&&o.default&&(a=e[n]=o.default),h.coerce&&n in e&&(a=e[n]=h.coerce(a,o)),g(a,o,r,n)}for(n in e){if(e.hasOwnProperty(n)&&("_"!=n.charAt(0)||"_"!=n.charAt(1))&&t&&!t[n]&&!1===i){if(h.filter){delete e[n];continue}m.push({property:r,message:(void 0===a?"undefined":_typeof(a))+"The property "+n+" is not defined in the schema and the schema does not allow additional properties"})}var s=t&&t[n]&&t[n].requires;!s||s in e||m.push({property:r,message:"the presence of the property "+n+" requires that "+s+" also be present"}),a=e[n],!i||t&&"object"==(void 0===t?"undefined":_typeof(t))&&n in t||(h.coerce&&(a=e[n]=h.coerce(a,i)),g(a,i,r,n)),!l&&a&&a.$schema&&(m=m.concat(g(a,a.$schema,r,n)))}return m}(e,t.properties,o,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&n("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&n("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.lengthe&&n("must have a minimum value of "+t.minimum),void 0!==_typeof(t.maximum)&&(void 0===e?"undefined":_typeof(e))==_typeof(t.maximum)&&t.maximum= 2"),d.ok(n.base<=36,"options.base <= 36"),d.bool(n.allowSign,"options.allowSign"),d.bool(n.allowPrefix,"options.allowPrefix"),d.bool(n.allowTrailing,"options.allowTrailing"),d.bool(n.allowImprecise,"options.allowImprecise"),d.bool(n.trimWhitespace,"options.trimWhitespace"),d.bool(n.leadingZeroIsOctal,"options.leadingZeroIsOctal"),n.leadingZeroIsOctal&&d.ok(!i,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var a,o=-1,s=n.base,c=1,u=0,f=0,p=e.length;if(n.trimWhitespace)for(;ft[0]||e[0]==t[0]&&e[1]>=t[1],"negative differences not allowed");var r=[e[0]-t[0],0];return e[1]>=t[1]?r[1]=e[1]-t[1]:(r[0]--,r[1]=1e9-(t[1]-e[1])),r}function R(e,t){return C(e),C(t),e[1]+=t[1],1e9<=e[1]&&(e[0]++,e[1]-=1e9),e[0]+=t[0],e}function z(e,t,r){var i,n;if(i={},r)for(n in r)i[n]=r[n];if(e)for(n in e)i[n]=e[n];if(t)for(n in t)i[n]=t[n];return i}},{"assert-plus":66,extsprintf:272,"json-schema":327,util:505,verror:509}],330:[function(e,t,r){"use strict";t.exports=e("./lib/api")(e("./lib/keccak"))},{"./lib/api":331,"./lib/keccak":335}],331:[function(e,t,r){"use strict";var n=e("./keccak"),a=e("./shake");t.exports=function(e){var r=n(e),i=a(e);return function(e,t){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new r(1152,448,null,224,t);case"keccak256":return new r(1088,512,null,256,t);case"keccak384":return new r(832,768,null,384,t);case"keccak512":return new r(576,1024,null,512,t);case"sha3-224":return new r(1152,448,6,224,t);case"sha3-256":return new r(1088,512,6,256,t);case"sha3-384":return new r(832,768,6,384,t);case"sha3-512":return new r(576,1024,6,512,t);case"shake128":return new i(1344,256,31,t);case"shake256":return new i(1088,512,31,t);default:throw new Error("Invald algorithm: "+e)}}}},{"./keccak":332,"./shake":333}],332:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,o=e("stream").Transform,n=e("inherits");t.exports=function(a){function t(e,t,r,i,n){o.call(this,n),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._hashBitLength=i,this._options=n,this._state=new a,this._state.initialize(e,t),this._finalized=!1}return n(t,o),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],333:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("stream").Transform,o=e("inherits");t.exports=function(n){function t(e,t,r,i){a.call(this,i),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._options=i,this._state=new n,this._state.initialize(e,t),this._finalized=!1}return o(t,a),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],334:[function(e,t,r){"use strict";var ot=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];r.p1600=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],n=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],h=f^(n<<1|a>>>31),l=p^(a<<1|n>>>31),d=e[0]^h,m=e[1]^l,g=e[10]^h,v=e[11]^l,b=e[20]^h,y=e[21]^l,_=e[30]^h,w=e[31]^l,k=e[40]^h,x=e[41]^l;h=r^(o<<1|s>>>31),l=i^(s<<1|o>>>31);var S=e[2]^h,j=e[3]^l,E=e[12]^h,A=e[13]^l,I=e[22]^h,P=e[23]^l,O=e[32]^h,T=e[33]^l,B=e[42]^h,C=e[43]^l;h=n^(c<<1|u>>>31),l=a^(u<<1|c>>>31);var F=e[4]^h,R=e[5]^l,z=e[14]^h,M=e[15]^l,N=e[24]^h,D=e[25]^l,q=e[34]^h,L=e[35]^l,U=e[44]^h,H=e[45]^l;h=o^(f<<1|p>>>31),l=s^(p<<1|f>>>31);var K=e[6]^h,V=e[7]^l,G=e[16]^h,$=e[17]^l,W=e[26]^h,Z=e[27]^l,Y=e[36]^h,X=e[37]^l,J=e[46]^h,Q=e[47]^l;h=c^(r<<1|i>>>31),l=u^(i<<1|r>>>31);var ee=e[8]^h,te=e[9]^l,re=e[18]^h,ie=e[19]^l,ne=e[28]^h,ae=e[29]^l,oe=e[38]^h,se=e[39]^l,ce=e[48]^h,ue=e[49]^l,fe=d,pe=m,he=v<<4|g>>>28,le=g<<4|v>>>28,de=b<<3|y>>>29,me=y<<3|b>>>29,ge=w<<9|_>>>23,ve=_<<9|w>>>23,be=k<<18|x>>>14,ye=x<<18|k>>>14,_e=S<<1|j>>>31,we=j<<1|S>>>31,ke=A<<12|E>>>20,xe=E<<12|A>>>20,Se=I<<10|P>>>22,je=P<<10|I>>>22,Ee=T<<13|O>>>19,Ae=O<<13|T>>>19,Ie=B<<2|C>>>30,Pe=C<<2|B>>>30,Oe=R<<30|F>>>2,Te=F<<30|R>>>2,Be=z<<6|M>>>26,Ce=M<<6|z>>>26,Fe=D<<11|N>>>21,Re=N<<11|D>>>21,ze=q<<15|L>>>17,Me=L<<15|q>>>17,Ne=H<<29|U>>>3,De=U<<29|H>>>3,qe=K<<28|V>>>4,Le=V<<28|K>>>4,Ue=$<<23|G>>>9,He=G<<23|$>>>9,Ke=W<<25|Z>>>7,Ve=Z<<25|W>>>7,Ge=Y<<21|X>>>11,$e=X<<21|Y>>>11,We=Q<<24|J>>>8,Ze=J<<24|Q>>>8,Ye=ee<<27|te>>>5,Xe=te<<27|ee>>>5,Je=re<<20|ie>>>12,Qe=ie<<20|re>>>12,et=ae<<7|ne>>>25,tt=ne<<7|ae>>>25,rt=oe<<8|se>>>24,it=se<<8|oe>>>24,nt=ce<<14|ue>>>18,at=ue<<14|ce>>>18;e[0]=fe^~ke&Fe,e[1]=pe^~xe&Re,e[10]=qe^~Je&de,e[11]=Le^~Qe&me,e[20]=_e^~Be&Ke,e[21]=we^~Ce&Ve,e[30]=Ye^~he&Se,e[31]=Xe^~le&je,e[40]=Oe^~Ue&et,e[41]=Te^~He&tt,e[2]=ke^~Fe&Ge,e[3]=xe^~Re&$e,e[12]=Je^~de&Ee,e[13]=Qe^~me&Ae,e[22]=Be^~Ke&rt,e[23]=Ce^~Ve&it,e[32]=he^~Se&ze,e[33]=le^~je&Me,e[42]=Ue^~et&ge,e[43]=He^~tt&ve,e[4]=Fe^~Ge&nt,e[5]=Re^~$e&at,e[14]=de^~Ee&Ne,e[15]=me^~Ae&De,e[24]=Ke^~rt&be,e[25]=Ve^~it&ye,e[34]=Se^~ze&We,e[35]=je^~Me&Ze,e[44]=et^~ge&Ie,e[45]=tt^~ve&Pe,e[6]=Ge^~nt&fe,e[7]=$e^~at&pe,e[16]=Ee^~Ne&qe,e[17]=Ae^~De&Le,e[26]=rt^~be&_e,e[27]=it^~ye&we,e[36]=ze^~We&Ye,e[37]=Me^~Ze&Xe,e[46]=ge^~Ie&Oe,e[47]=ve^~Pe&Te,e[8]=nt^~fe&ke,e[9]=at^~pe&xe,e[18]=Ne^~qe&Je,e[19]=De^~Le&Qe,e[28]=be^~_e&Be,e[29]=ye^~we&Ce,e[38]=We^~Ye&he,e[39]=Ze^~Xe&le,e[48]=Ie^~Oe&Ue,e[49]=Pe^~Te&He,e[0]^=ot[2*t],e[1]^=ot[2*t+1]}}},{}],335:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=e("./keccak-state-unroll");function a(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}a.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},a.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},a.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},t.exports=a},{"./keccak-state-unroll":334,"safe-buffer":447}],336:[function(e,t,r){var i=e("./_root").Symbol;t.exports=i},{"./_root":341}],337:[function(e,t,r){var i=e("./_Symbol"),n=e("./_getRawTag"),a=e("./_objectToString"),o=i?i.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},{"./_Symbol":336,"./_getRawTag":339,"./_objectToString":340}],338:[function(e,r,t){(function(e){var t="object"==(void 0===e?"undefined":_typeof(e))&&e&&e.Object===Object&&e;r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],339:[function(e,t,r){var i=e("./_Symbol"),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,s=i?i.toStringTag:void 0;t.exports=function(e){var t=a.call(e,s),r=e[s];try{var i=!(e[s]=void 0)}catch(e){}var n=o.call(e);return i&&(t?e[s]=r:delete e[s]),n}},{"./_Symbol":336}],340:[function(e,t,r){var i=Object.prototype.toString;t.exports=function(e){return i.call(e)}},{}],341:[function(e,t,r){var i=e("./_freeGlobal"),n="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,a=i||n||Function("return this")();t.exports=a},{"./_freeGlobal":338}],342:[function(e,t,r){var i=Array.isArray;t.exports=i},{}],343:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isObject");t.exports=function(e){if(!n(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},{"./_baseGetTag":337,"./isObject":344}],344:[function(e,t,r){t.exports=function(e){var t=void 0===e?"undefined":_typeof(e);return null!=e&&("object"==t||"function"==t)}},{}],345:[function(e,t,r){t.exports=function(e){return null!=e&&"object"==(void 0===e?"undefined":_typeof(e))}},{}],346:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isArray"),a=e("./isObjectLike");t.exports=function(e){return"string"==typeof e||!n(e)&&a(e)&&"[object String]"==i(e)}},{"./_baseGetTag":337,"./isArray":342,"./isObjectLike":345}],347:[function(e,t,r){t.exports=function(e){return void 0===e}},{}],348:[function(e,t,r){"use strict";var i=e("inherits"),n=e("hash-base"),a=e("safe-buffer").Buffer,o=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,r,i,n,a,o){return c(e+(t&r|~t&i)+n+a|0,o)+t|0}function f(e,t,r,i,n,a,o){return c(e+(t&i|r&~i)+n+a|0,o)+t|0}function p(e,t,r,i,n,a,o){return c(e+(t^r^i)+n+a|0,o)+t|0}function h(e,t,r,i,n,a,o){return c(e+(r^(t|~i))+n+a|0,o)+t|0}i(s,n),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,a=this._d;i=h(i=h(i=h(i=h(i=p(i=p(i=p(i=p(i=f(i=f(i=f(i=f(i=u(i=u(i=u(i=u(i,n=u(n,a=u(a,r=u(r,i,n,a,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),a,r,e[3],3250441966,22),n=u(n,a=u(a,r=u(r,i,n,a,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),a,r,e[7],4249261313,22),n=u(n,a=u(a,r=u(r,i,n,a,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),a,r,e[11],2304563134,22),n=u(n,a=u(a,r=u(r,i,n,a,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),a,r,e[15],1236535329,22),n=f(n,a=f(a,r=f(r,i,n,a,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),a,r,e[0],3921069994,20),n=f(n,a=f(a,r=f(r,i,n,a,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),a,r,e[4],3889429448,20),n=f(n,a=f(a,r=f(r,i,n,a,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),a,r,e[8],1163531501,20),n=f(n,a=f(a,r=f(r,i,n,a,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),a,r,e[12],2368359562,20),n=p(n,a=p(a,r=p(r,i,n,a,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),a,r,e[14],4259657740,23),n=p(n,a=p(a,r=p(r,i,n,a,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),a,r,e[10],3200236656,23),n=p(n,a=p(a,r=p(r,i,n,a,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),a,r,e[6],76029189,23),n=p(n,a=p(a,r=p(r,i,n,a,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),a,r,e[2],3299628645,23),n=h(n,a=h(a,r=h(r,i,n,a,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),a,r,e[5],4237533241,21),n=h(n,a=h(a,r=h(r,i,n,a,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),a,r,e[1],2240044497,21),n=h(n,a=h(a,r=h(r,i,n,a,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),a,r,e[13],1309151649,21),n=h(n,a=h(a,r=h(r,i,n,a,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),a,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+a|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e}},{}],355:[function(e,t,r){(t.exports=o).Minimatch=n;var u={sep:"/"};try{u=e("path")}catch(e){}var z=o.GLOBSTAR=n.GLOBSTAR={},i=e("brace-expansion"),M={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},N="[^/]*?",D="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{});var f=/\/+/;function a(t,r){t=t||{},r=r||{};var i={};return Object.keys(r).forEach(function(e){i[e]=r[e]}),Object.keys(t).forEach(function(e){i[e]=t[e]}),i}function o(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new n(t,r).match(e))}function n(e,t){if(!(this instanceof n))return new n(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==u.sep&&(e=e.split(u.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function s(e,t){if(t||(t=this instanceof n?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:i(e)}o.filter=function(i,n){return n=n||{},function(e,t,r){return o(e,i,n)}},o.defaults=function(i){if(!i||!Object.keys(i).length)return o;var n=o,e=function(e,t,r){return n.minimatch(e,t,a(i,r))};return e.Minimatch=function(e,t){return new n.Minimatch(e,a(i,t))},e},n.defaults=function(e){return e&&Object.keys(e).length?o.defaults(e).Minimatch:n},n.prototype.debug=function(){},n.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(f)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r},n.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=this.options,i=0;if(r.nonegate)return;for(var n=0,a=e.length;n>> no match, partial?",e,p,t,h),p!==o))}if("string"==typeof u?(c=i.nocase?f.toLowerCase()===u.toLowerCase():f===u,this.debug("string match",u,f,c)):(c=f.match(u),this.debug("pattern match",u,f,c)),!c)return!1}if(n===o&&a===s)return!0;if(n===o)return r;if(a===s)return n===o-1&&""===e[n];throw new Error("wtf?")}},{"brace-expansion":155,path:374}],356:[function(e,t,r){var c=e("crypto");function o(e,t,r){return c.createHmac(r,e).update(t).digest("base64")}function s(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function n(e,t){return t>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var n=s,a=i+r;e^=-1;for(var o=i;o>>8^n[255&(e^t[o])];return-1^e}},{}],362:[function(e,t,r){"use strict";var c,h=e("../utils/common"),u=e("./trees"),l=e("./adler32"),d=e("./crc32"),i=e("./messages"),f=0,p=4,m=0,g=-2,v=-1,b=4,n=2,y=8,_=9,a=286,o=30,s=19,w=2*a+1,k=15,x=3,S=258,j=S+x+1,E=42,A=113,I=1,P=2,O=3,T=4;function B(e,t){return e.msg=i[t],t}function C(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(h.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function z(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,R(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function N(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function D(e,t){var r,i,n=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-j?e.strstart-(e.w_size-j):0,u=e.window,f=e.w_mask,p=e.prev,h=e.strstart+S,l=u[a+o-1],d=u[a+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===d&&u[r+o-1]===l&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ac&&0!=--n);return o<=e.lookahead?o:e.lookahead}function q(e){var t,r,i,n,a,o,s,c,u,f,p=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-j)){for(h.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;i=e.head[--t],e.head[t]=p<=i?i-p:0,--r;);for(t=r=p;i=e.prev[--t],e.prev[t]=p<=i?i-p:0,--r;);n+=p}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,c=e.strstart+e.lookahead,u=n,f=void 0,f=o.avail_in,u=x)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(i=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(n=e.strstart+e.lookahead-x,i=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=n&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(q(e),0===e.lookahead&&t===f)return I;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,z(e,!1),0===e.strm.avail_out))return I;if(e.strstart-e.block_start>=e.w_size-j&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):(e.strstart>e.block_start&&(z(e,!1),e.strm.avail_out),I)}),new H(4,4,8,4,L),new H(4,5,16,8,L),new H(4,6,32,32,L),new H(4,4,16,16,U),new H(8,16,32,32,U),new H(8,16,128,128,U),new H(8,32,128,256,U),new H(32,128,258,1024,U),new H(32,258,258,4096,U)],r.deflateInit=function(e,t){return $(e,t,y,15,8,0)},r.deflateInit2=$,r.deflateReset=G,r.deflateResetKeep=V,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,m):g},r.deflate=function(e,t){var r,i,n,a;if(!e||!e.state||5>8&255),M(i,i.gzhead.time>>16&255),M(i,i.gzhead.time>>24&255),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(M(i,255&i.gzhead.extra.length),M(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=d(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(M(i,0),M(i,0),M(i,0),M(i,0),M(i,0),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,3),i.status=A);else{var o=y+(i.w_bits-8<<4)<<8;o|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(o|=32),o+=31-o%31,i.status=A,N(i,o),0!==i.strstart&&(N(i,e.adler>>>16),N(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending!==i.pending_buf_size));)M(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&R(e),i.pending+2<=i.pending_buf_size&&(M(i,255&e.adler),M(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(R(e),0===e.avail_out)return i.last_flush=-1,m}else if(0===e.avail_in&&C(t)<=C(r)&&t!==p)return B(e,-5);if(666===i.status&&0!==e.avail_in)return B(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==f&&666!==i.status){var s=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(q(e),0===e.lookahead)){if(t===f)return I;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):3===i.strategy?function(e,t){for(var r,i,n,a,o=e.window;;){if(e.lookahead<=S){if(q(e),e.lookahead<=S&&t===f)return I;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):c[i.level].func(i,t);if(s!==O&&s!==T||(i.status=666),s===I||s===O)return 0===e.avail_out&&(i.last_flush=-1),m;if(s===P&&(1===t?u._tr_align(i):5!==t&&(u._tr_stored_block(i,0,0,!1),3===t&&(F(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),R(e),0===e.avail_out))return i.last_flush=-1,m}return t!==p?m:i.wrap<=0?1:(2===i.wrap?(M(i,255&e.adler),M(i,e.adler>>8&255),M(i,e.adler>>16&255),M(i,e.adler>>24&255),M(i,255&e.total_in),M(i,e.total_in>>8&255),M(i,e.total_in>>16&255),M(i,e.total_in>>24&255)):(N(i,e.adler>>>16),N(i,65535&e.adler)),R(e),0=r.w_size&&(0===a&&(F(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new h.Buf8(r.w_size),h.arraySet(u,t,f-r.w_size,r.w_size,0),t=u,f=r.w_size),o=e.avail_in,s=e.next_in,c=e.input,e.avail_in=f,e.next_in=0,e.input=t,q(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=_=y>>>24,d-=_,0===(_=y>>>16&255))E[a++]=65535&y;else{if(!(16&_)){if(0==(64&_)){y=m[(65535&y)+(l&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&y,(_&=15)&&(d<_&&(l+=j[i++]<>>=_,d-=_),d<15&&(l+=j[i++]<>>=_=y>>>24,d-=_,!(16&(_=y>>>16&255))){if(0==(64&_)){y=g[(65535&y)+(l&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&y,d<(_&=15)&&(l+=j[i++]<>>=_,d-=_,(_=a-o)>3,l&=(1<<(d-=w<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new P.Buf16(320),this.work=new P.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=N,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new P.Buf32(i),t.distcode=t.distdyn=new P.Buf32(n),t.sane=1,t.back=-1,z):M}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):M}function c(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=a.wsize?(P.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(n=a.wsize-a.wnext)&&(n=i),P.arraySet(a.window,t,r-i,n,a.wnext),(i-=n)?(P.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=T(r.check,A,2,0),f=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(f-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=3;case 3:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>8&255,A[2]=u>>>16&255,A[3]=u>>>24&255,r.check=T(r.check,A,4,0)),f=u=0,r.mode=4;case 4:for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>8),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>>8&255,r.check=T(r.check,A,2,0)),f=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(s<(l=r.length)&&(l=s),l&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),P.arraySet(r.head.extra,i,a,l,k)),512&r.flags&&(r.check=T(r.check,i,l,a)),s-=l,a+=l,r.length-=l),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;for(l=0;k=i[a+l++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&l>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>=7&f,f-=7&f,r.mode=27;break}for(;f<3;){if(0===s)break e;s--,u+=i[a++]<>>=1)){case 0:r.mode=14;break;case 1:if(q(r),r.mode=20,6!==t)break;u>>>=2,f-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,f-=2;break;case 14:for(u>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,u+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,f=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(l=r.length){if(s>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,286>>=3,f-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=C(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=g,f-=g,r.lens[r.have++]=b;else{if(16===b){for(j=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],l=3+(3&u),u>>>=2,f-=2}else if(17===b){for(j=g+3;f>>=g)),u>>>=3,f-=3}else{for(j=g+7;f>>=g)),u>>>=7,f-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;l--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=C(F,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=C(R,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=s&&258<=c){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,r.hold=u,r.bits=f,B(e,h),o=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,u=r.hold,f=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;v=(E=r.lencode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,r.length=b,0===v){r.mode=26;break}if(32&v){r.back=-1,r.mode=12;break}if(64&v){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&v,r.mode=22;case 22:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=(E=r.distcode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&v,r.mode=24;case 24:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===c)break e;if(l=h-c,r.offset>l){if((l=r.offset-l)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d=l>r.wnext?(l-=r.wnext,r.wsize-l):r.wnext-l,l>r.length&&(l=r.length),m=r.window}else m=n,d=o-r.offset,l=r.length;for(cl?(m=B[C+o[y]],I[P+o[y]]):(m=96,0),c=1<>S)+(u-=c)]=d<<24|m<<16|g|0,0!==u;);for(c=1<>=1;if(0!==c?(A&=c-1,A+=c):A=0,y++,0==--O[b]){if(b===w)break;b=t[r+o[y]]}if(k>>7)]}function M(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function N(e,t,r){e.bi_valid>n-r?(e.bi_buf|=t<>n-e.bi_valid,e.bi_valid+=r-n):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function L(e,t,r){var i,n,a=new Array(v+1),o=0;for(i=1;i<=v;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=q(a[s]++,s))}}function U(e){var t;for(t=0;t>1;1<=r;r--)V(e,a,r);for(n=c;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],V(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,a[2*n]=a[2*r]+a[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,a[2*r+1]=a[2*i+1]=n,e.heap[1]=n++,V(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,n,a,o,s,c=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,p=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(a=0;a<=v;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return s;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return u;for(t=32;t>>3,(a=e.static_len+3+7>>>3)<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==t?X(e,t,r,i):4===e.strategy||a===n?(N(e,2+(i?1:0),3),G(e,E,A)):(N(e,4+(i?1:0),3),function(e,t,r,i){var n;for(N(e,t-257,5),N(e,r-1,5),N(e,i-4,4),n=0;n>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(P[r]+p+1)]++,e.dyn_dtree[2*z(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;N(e,2,3),D(e,b,E),16===(t=e).bi_valid?(M(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":358}],368:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],369:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],370:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var a=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=a;var o=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=o;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var f=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=f,r.DSAparam=i.define("DSAparam",function(){this.int()});var p=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=p;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":371,"asn1.js":46}],371:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),a=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(a)}),u=i.define("RDNSequence",function(){this.seqof(c)}),f=i.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),p=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(f),this.key("validity").use(p),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),d=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=d},{"asn1.js":46}],372:[function(e,t,r){(function(h){var l=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,d=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m,m=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,g=e("evp_bytestokey"),v=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(l);if(n){var a="aes"+n[1],o=new h(n[2],"hex"),s=new h(n[3].replace(/[\r\n]/g,""),"base64"),c=g(t,o.slice(0,8),parseInt(n[1],10)).key,u=[],f=v.createDecipheriv(a,c,o);u.push(f.update(s)),u.push(f.final()),r=h.concat(u)}else{var p=i.match(m);r=new h(p[2].replace(/[\r\n]/g,""),"base64")}return{tag:i.match(d)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":160,buffer:191,evp_bytestokey:270}],373:[function(t,r,e){(function(b){var y=t("./asn1"),_=t("./aesid.json"),w=t("./fixProc"),k=t("browserify-aes"),x=t("pbkdf2");function e(e){var t;"object"!==(void 0===e?"undefined":_typeof(e))||b.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new b(e));var r,i,n,a,o,s,c,u,f,p,h,l,d,m=w(e,t),g=m.tag,v=m.data;switch(g){case"CERTIFICATE":i=y.certificate.decode(v,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=y.PublicKey.decode(v,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=y.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"ENCRYPTED PRIVATE KEY":v=y.EncryptedPrivateKey.decode(v,"der"),a=t,o=(n=v).algorithm.decrypt.kde.kdeparams.salt,s=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=_[n.algorithm.decrypt.cipher.algo.join(".")],u=n.algorithm.decrypt.cipher.iv,f=n.subjectPrivateKey,p=parseInt(c.split("-")[1],10)/8,h=x.pbkdf2Sync(a,o,s,p),l=k.createDecipheriv(c,h,u),(d=[]).push(l.update(f)),d.push(l.final()),v=b.concat(d);case"PRIVATE KEY":switch(r=(i=y.PrivateKey.decode(v,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:y.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=y.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"RSA PUBLIC KEY":return y.RSAPublicKey.decode(v,"der");case"RSA PRIVATE KEY":return y.RSAPrivateKey.decode(v,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:y.DSAPrivateKey.decode(v,"der")};case"EC PRIVATE KEY":return{curve:(v=y.ECPrivateKey.decode(v,"der")).parameters.value,privateKey:v.privateKey};default:throw new Error("unknown key type "+g)}}(r.exports=e).signature=y.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":369,"./asn1":370,"./fixProc":372,"browserify-aes":160,buffer:191,pbkdf2:375}],374:[function(e,t,u){(function(n){function a(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function o(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;ia?t=n(t):t.length "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+o+";","var res;","switch (argLength) {",r.concat(["extra"]).map(function(e,t){return"case "+t+":res = fn.call("+["self"].concat(r.slice(0,t)).concat("cb").join(",")+");break;"}).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],n)(a,e)}(e)};var o="function (err, res) {if (err) { rj(err); } else { rs(res); }}";a.nodeify=function(r){return function(){var e=Array.prototype.slice.call(arguments),t="function"==typeof e[e.length-1]?e.pop():null,i=this;try{return r.apply(this,arguments).nodeify(t,i)}catch(r){if(null==t)return new a(function(e,t){t(r)});n(function(){t.call(i,r)})}}},a.prototype.nodeify=function(t,r){if("function"!=typeof t)return this;this.then(function(e){n(function(){t.call(r,null,e)})},function(e){n(function(){t.call(r,e)})})}},{"./core.js":384,asap:44}],390:[function(e,t,r){"use strict";var i=e("./core.js");(t.exports=i).enableSynchronous=function(){i.prototype.isPending=function(){return 0==this.getState()},i.prototype.isFulfilled=function(){return 1==this.getState()},i.prototype.isRejected=function(){return 2==this.getState()},i.prototype.getValue=function(){if(3===this._65)return this._55.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._55},i.prototype.getReason=function(){if(3===this._65)return this._55.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._55},i.prototype.getState=function(){return 3===this._65?this._55.getState():-1===this._65||-2===this._65?0:this._65}},i.disableSynchronous=function(){i.prototype.isPending=void 0,i.prototype.isFulfilled=void 0,i.prototype.isRejected=void 0,i.prototype.getValue=void 0,i.prototype.getReason=void 0,i.prototype.getState=void 0}},{"./core.js":384}],391:[function(e,t,r){"use strict";var n=function(e){for(var t=e.toString(16);4!==t.length;)t="0"+t;return"\\u"+t};t.exports=function(e,t,r,i){return!r.key||61!==t&&58!==t&&t!==r.separator?31o||0<=new u(t).cmp(a.modulus))throw new Error("decryption error");n=r?d(new u(t),a):h(t,a);var s=m.alloc(o-n.length);if(n=m.concat([s,n],o),4===i)return function(e,t){var r=e.modulus.byteLength(),i=l("sha1").update(m.alloc(0)).digest(),n=i.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,n+1),o=t.slice(n+1),s=p(a,f(o,n)),c=p(o,f(s,r-n-1));if(function(e,t){e=m.from(e),t=m.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){a++;break}var o=t.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&a++;o.length<8&&a++;if(a)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}},{"./mgf":401,"./withPublic":404,"./xor":405,"bn.js":154,"browserify-rsa":178,"create-hash":200,"parse-asn1":373,"safe-buffer":447}],403:[function(e,t,r){var o=e("parse-asn1"),h=e("randombytes"),l=e("create-hash"),d=e("./mgf"),m=e("./xor"),g=e("bn.js"),s=e("./withPublic"),c=e("browserify-rsa"),v=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,a=o(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=l("sha1").update(v.alloc(0)).digest(),a=n.length,o=2*a;if(r-o-2>6]+a[128|63&n]:n<55296||57344<=n?r+=a[224|n>>12]+a[128|n>>6&63]+a[128|63&n]:(i+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),r+=a[240|n>>18]+a[128|n>>12&63]+a[128|n>>6&63]+a[128|63&n])}return r},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function i(r,n,a){if(!n)return r;if("object"!==(void 0===n?"undefined":_typeof(n))){if(Array.isArray(r))r.push(n);else{if("object"!==(void 0===r?"undefined":_typeof(r)))return[r,n];(a.plainObjects||a.allowPrototypes||!o.call(Object.prototype,n))&&(r[n]=!0)}return r}if("object"!==(void 0===r?"undefined":_typeof(r)))return[r].concat(n);var e=r;return Array.isArray(r)&&!Array.isArray(n)&&(e=s(r,a)),Array.isArray(r)&&Array.isArray(n)?(n.forEach(function(e,t){o.call(r,t)?r[t]&&"object"===_typeof(r[t])?r[t]=i(r[t],e,a):r.push(e):r[t]=e}),r):Object.keys(n).reduce(function(e,t){var r=n[t];return o.call(e,t)?e[t]=i(e[t],r,a):e[t]=r,e},e)}}},{}],411:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var a=/\+/g;e=e.split(t);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var s,c,u=e.length;0t.highWaterMark&&(t.highWaterMark=(m<=(r=e)?r=m:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(_("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?v.nextTick(x,e):x(e))}function x(e){_("emit readable"),e.emit("readable"),I(e)}function S(e,t){t.readingMore||(t.readingMore=!0,v.nextTick(j,e,t))}function j(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;ea.length?a.length:e;if(o===a.length?n+=a:n+=a.slice(0,e),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=a.slice(o);break}++i}return t.length-=i,n}(e,t):function(e,t){var r=u.allocUnsafe(e),i=t.head,n=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i).data=a.slice(o);break}++n}return t.length-=n,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return _("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):k(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,n=t.needReadable;return _("need readable",n),(0===t.length||t.length-e>>0),a=this.head,o=0;a;)t=a.data,r=n,i=o,t.copy(r,i),o+=a.data.length,a=a.next;return n},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":447,util:157}],423:[function(e,t,r){"use strict";var a=e("process-nextick-args");function o(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a.nextTick(o,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(o,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":381}],424:[function(e,t,r){t.exports=e("events").EventEmitter},{events:269}],425:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":426}],426:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":417,"./lib/_stream_passthrough.js":418,"./lib/_stream_readable.js":419,"./lib/_stream_transform.js":420,"./lib/_stream_writable.js":421}],427:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":426}],428:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":421}],429:[function(e,t,r){"use strict";var s=e("../"),c=e("lodash/isArray"),u=e("lodash/isFunction"),f=e("lodash/isObjectLike");t.exports=function(e){var t="Please verify options";if(!f(e))throw new TypeError(t);if(!u(e.request))throw new TypeError(t+".request");if(!c(e.expose)||0===e.expose.length)throw new TypeError(t+".expose");for(var r=s({PromiseImpl:e.PromiseImpl,constructorMixin:e.constructorMixin}),i=e.request.Request.prototype.init,n=!(e.request.Request.prototype.init=function(e){return!f(e)||this._callback||this._rp_promise||r.init.call(this,e),i.apply(this,arguments)}),a=0;a=t.maxRedirects)return r.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+r.uri.href)),!1;t.redirectsFollowed+=1,o.test(i)||(i=a.resolve(r.uri.href,i));var n=r.uri;return r.uri=a.parse(i),r.uri.protocol!==n.protocol&&delete r.agent,t.redirects.push({statusCode:e.statusCode,redirectUri:i}),t.followAllRedirects&&"HEAD"!==r.method&&401!==e.statusCode&&307!==e.statusCode&&(r.method=t.followOriginalHttpMethod?r.method:"GET"),delete r.src,delete r.req,delete r._started,401!==e.statusCode&&307!==e.statusCode&&(delete r.body,delete r._form,r.headers&&(r.removeHeader("host"),r.removeHeader("content-type"),r.removeHeader("content-length"),r.uri.hostname!==r.originalHost.split(":")[0]&&r.removeHeader("authorization"))),t.removeRefererHeader||r.setHeader("referer",n.href),r.emit("redirect"),r.init(),!0},r.Redirect=i},{url:500}],444:[function(e,t,r){"use strict";var w=e("url"),k=e("tunnel-agent"),i=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],x=["proxy-authorization"];function n(e){this.request=e,this.proxyHeaderWhiteList=i,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}n.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},n.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=w.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,i,n,a,o,s,c=this.proxyHeaderExclusiveList.concat(x),u=this.proxyHeaderWhiteList.concat(c),f=(r=t.headers,i=u.reduce(function(e,t){return e[t.toLowerCase()]=!0,e},{}),Object.keys(r).filter(function(e){return i[e.toLowerCase()]}).reduce(function(e,t){return e[t]=r[t],e},{}));f.host=(n=t.uri,a=n.port,o=n.protocol,s=n.hostname+":",s+=a||("https:"===o?"443":"80")),c.forEach(t.removeHeader,t);var p,h,l,d,m,g,v,b,y=(l=(p=t).uri,d=p.proxy,h=d,m=["https:"===l.protocol?"https":"http","https:"===h.protocol?"Https":"Http"].join("Over"),k[m]),_=(v=f,{proxy:{host:(b=(g=t).proxy).hostname,port:+b.port,proxyAuth:b.auth,headers:v},headers:g.headers,ca:g.ca,cert:g.cert,key:g.key,passphrase:g.passphrase,pfx:g.pfx,ciphers:g.ciphers,rejectUnauthorized:g.rejectUnauthorized,secureOptions:g.secureOptions,secureProtocol:g.secureProtocol});return t.agent=y(_),!0},n.defaultProxyHeaderWhiteList=i,n.defaultProxyHeaderExclusiveList=x,r.Tunnel=n},{"tunnel-agent":497,url:500}],445:[function(U,H,e){(function(e){"use strict";var w=U("http"),k=U("https"),x=U("url"),t=U("util"),n=U("stream"),f=U("zlib"),c=U("aws-sign2"),u=U("aws4"),i=U("http-signature"),S=U("mime-types"),j=U("caseless"),E=U("forever-agent"),r=U("form-data"),a=U("extend"),A=U("isstream"),I=U("is-typedarray").strict,o=U("./lib/helpers"),s=U("./lib/cookies"),P=U("./lib/getProxyFromURI"),p=U("./lib/querystring").Querystring,h=U("./lib/har").Har,l=U("./lib/auth").Auth,d=U("./lib/oauth").OAuth,m=U("./lib/hawk"),g=U("./lib/multipart").Multipart,v=U("./lib/redirect").Redirect,b=U("./lib/tunnel").Tunnel,y=U("performance-now"),O=U("safe-buffer").Buffer,_=o.safeStringify,T=o.isReadStream,B=o.toBase64,C=o.defer,F=o.copy,R=o.version,z=s.jar(),M={};function N(){return{uri:this.uri,method:this.method,headers:this.headers}}function D(){return{statusCode:this.statusCode,body:this.body,headers:this.headers,request:N.call(this.request)}}function q(e){var t=this;e.har&&(t._har=new h(t),e=t._har.options(e)),n.Stream.call(t);var r=Object.keys(q.prototype),i=function(e,t){var r={};for(var i in t)-1===e.indexOf(i)&&(r[i]=t[i]);return r}(r,e);a(t,i),e=function(e,t){var r={};for(var i in t){var n=!(-1===e.indexOf(i)),a="function"==typeof t[i];n&&a||(r[i]=t[i])}return r}(r,e),t.readable=!0,t.writable=!0,e.method&&(t.explicitMethod=!0),t._qs=new p(t),t._auth=new l(t),t._oauth=new d(t),t._multipart=new g(t),t._redirect=new v(t),t._tunnel=new b(t),t.init(e)}function L(){q.debug&&console.error("REQUEST %s",t.format.apply(t,arguments))}t.inherits(q,n.Stream),q.debug=e.env.NODE_DEBUG&&/\brequest\b/.test(e.env.NODE_DEBUG),q.prototype.debug=L,q.prototype.init=function(e){var i=this;for(var t in e||(e={}),i.headers=i.headers?F(i.headers):{},i.headers)void 0===i.headers[t]&&delete i.headers[t];if(j.httpify(i,i.headers),i.method||(i.method=e.method||"GET"),i.localAddress||(i.localAddress=e.localAddress),i._qs.init(e),L(e),i.pool||!1===i.pool||(i.pool=M),i.dests=i.dests||[],i.__isRequestRequest=!0,!i._callback&&i.callback&&(i._callback=i.callback,i.callback=function(){i._callbackCalled||(i._callbackCalled=!0,i._callback.apply(i,arguments))},i.on("error",i.callback.bind()),i.on("complete",i.callback.bind(i,null))),!i.uri&&i.url&&(i.uri=i.url,delete i.url),i.baseUrl){if("string"!=typeof i.baseUrl)return i.emit("error",new Error("options.baseUrl must be a string"));if("string"!=typeof i.uri)return i.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(0===i.uri.indexOf("//")||-1!==i.uri.indexOf("://"))return i.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var r=i.baseUrl.lastIndexOf("/")===i.baseUrl.length-1,n=0===i.uri.indexOf("/");r&&n?i.uri=i.baseUrl+i.uri.slice(1):r||n?i.uri=i.baseUrl+i.uri:""===i.uri?i.uri=i.baseUrl:i.uri=i.baseUrl+"/"+i.uri,delete i.baseUrl}if(!i.uri)return i.emit("error",new Error("options.uri is a required argument"));if("string"==typeof i.uri&&(i.uri=x.parse(i.uri)),i.uri.href||(i.uri.href=x.format(i.uri)),"unix:"===i.uri.protocol)return i.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if("unix"===i.uri.host&&i.enableUnixSocket(),!1===i.strictSSL&&(i.rejectUnauthorized=!1),i.uri.pathname||(i.uri.pathname="/"),!(i.uri.host||i.uri.hostname&&i.uri.port||i.uri.isUnix)){var a='Invalid URI "'+x.format(i.uri)+'"';return 0===Object.keys(e).length&&(a+=". This can be caused by a crappy redirection."),i.abort(),i.emit("error",new Error(a))}if(i.hasOwnProperty("proxy")||(i.proxy=P(i.uri)),i.tunnel=i._tunnel.isEnabled(),i.proxy&&i._tunnel.setup(e),i._redirect.onRequest(e),i.setHost=!1,!i.hasHeader("host")){var o=i.originalHostHeaderName||"host";i.setHeader(o,i.uri.host),i.uri.port&&("80"===i.uri.port&&"http:"===i.uri.protocol||"443"===i.uri.port&&"https:"===i.uri.protocol)&&i.setHeader(o,i.uri.hostname),i.setHost=!0}if(i.jar(i._jar||e.jar),i.uri.port||("http:"===i.uri.protocol?i.uri.port=80:"https:"===i.uri.protocol&&(i.uri.port=443)),i.proxy&&!i.tunnel?(i.port=i.proxy.port,i.host=i.proxy.hostname):(i.port=i.uri.port,i.host=i.uri.hostname),e.form&&i.form(e.form),e.formData){var s=e.formData,c=i.form(),u=function(e,t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?c.append(e,t.value,t.options):c.append(e,t)};for(var f in s)if(s.hasOwnProperty(f)){var p=s[f];if(p instanceof Array)for(var h=0;h>>32-t}function S(e,t,r,i,n,a,o,s){return x(e+(t^r^i)+a+o|0,s)+n|0}function j(e,t,r,i,n,a,o,s){return x(e+(t&r|~t&i)+a+o|0,s)+n|0}function E(e,t,r,i,n,a,o,s){return x(e+((t|~r)^i)+a+o|0,s)+n|0}function A(e,t,r,i,n,a,o,s){return x(e+(t&i|r&~i)+a+o|0,s)+n|0}function I(e,t,r,i,n,a,o,s){return x(e+(t^(r|~i))+a+o|0,s)+n|0}n(o,a),o.prototype._update=function(){for(var e=g,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,a=0|this._d,o=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,f=0|this._d,p=0|this._e,h=0;h<80;h+=1){var l,d;d=h<16?(l=S(r,i,n,a,o,e[v[h]],w[0],y[h]),I(s,c,u,f,p,e[b[h]],k[0],_[h])):h<32?(l=j(r,i,n,a,o,e[v[h]],w[1],y[h]),A(s,c,u,f,p,e[b[h]],k[1],_[h])):h<48?(l=E(r,i,n,a,o,e[v[h]],w[2],y[h]),E(s,c,u,f,p,e[b[h]],k[2],_[h])):h<64?(l=A(r,i,n,a,o,e[v[h]],w[3],y[h]),j(s,c,u,f,p,e[b[h]],k[3],_[h])):(l=I(r,i,n,a,o,e[v[h]],w[4],y[h]),S(s,c,u,f,p,e[b[h]],k[4],_[h])),r=o,o=a,a=x(n,10),n=i,i=l,s=p,p=f,f=x(u,10),u=c,c=d}var m=this._b+n+f|0;this._b=this._c+a+p|0,this._c=this._d+o+s|0,this._d=this._e+r+c|0,this._e=this._a+i+u|0,this._a=m},o.prototype._digest=function(){this._block[this._blockOffset++]=128,56=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 a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":447}],450:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":451,"./sha1":452,"./sha224":453,"./sha256":454,"./sha384":455,"./sha512":456}],451:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,v=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s=this._w,c=0|this._a,u=0|this._b,f=0|this._c,p=0|this._d,h=0|this._e,l=0;l<16;++l)s[l]=e.readInt32BE(4*l);for(;l<80;++l)s[l]=s[l-3]^s[l-8]^s[l-14]^s[l-16];for(var d=0;d<80;++d){var m=~~(d/20),g=0|((o=c)<<5|o>>>27)+(i=u,n=f,a=p,0===(r=m)?i&n|~i&a:2===r?i&n|i&a|n&a:i^n^a)+h+s[d]+v[m];h=p,p=f,f=(t=u)<<30|t>>>2,u=c,c=g}this._a=c+this._a|0,this._b=u+this._b|0,this._c=f+this._c|0,this._d=p+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],452:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0;d<16;++d)c[d]=e.readInt32BE(4*d);for(;d<80;++d)c[d]=(t=c[d-3]^c[d-8]^c[d-14]^c[d-16])<<1|t>>>31;for(var m=0;m<80;++m){var g=~~(m/20),v=0|((s=u)<<5|s>>>27)+(n=f,a=p,o=h,0===(i=g)?n&a|~n&o:2===i?n&a|n&o|a&o:n^a^o)+l+c[m]+b[g];l=h,h=p,p=(r=f)<<30|r>>>2,f=u,u=v}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],453:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}i(c,n),c.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},c.prototype._hash=function(){var e=o.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},t.exports=c},{"./hash":449,"./sha256":454,inherits:320,"safe-buffer":447}],454:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,w=[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],o=new Array(64);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0|this._f,m=0|this._g,g=0|this._h,v=0;v<16;++v)c[v]=e.readInt32BE(4*v);for(;v<64;++v)c[v]=0|(((r=c[v-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+c[v-7]+(((t=c[v-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+c[v-16];for(var b=0;b<64;++b){var y=g+(((s=l)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((o=m)^l&(d^o))+w[b]+c[b]|0,_=0|(((a=u)>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+((i=u)&(n=f)|p&(i|n));g=m,m=d,d=l,l=h+y|0,h=p,p=f,f=u,u=y+_|0}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],455:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(160);function c(){this.init(),this._w=s,a.call(this,128,112)}i(c,n),c.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},c.prototype._hash=function(){var i=o.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=c},{"./hash":449,"./sha512":456,inherits:320,"safe-buffer":447}],456:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,ee=[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],o=new Array(160);function s(){this.init(),this._w=o,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ae(e,t){return e>>>0>>0?1:0}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c,u=this._w,f=0|this._ah,p=0|this._bh,h=0|this._ch,l=0|this._dh,d=0|this._eh,m=0|this._fh,g=0|this._gh,v=0|this._hh,b=0|this._al,y=0|this._bl,_=0|this._cl,w=0|this._dl,k=0|this._el,x=0|this._fl,S=0|this._gl,j=0|this._hl,E=0;E<32;E+=2)u[E]=e.readInt32BE(4*E),u[E+1]=e.readInt32BE(4*E+4);for(;E<160;E+=2){var A=u[E-30],I=u[E-30+1],P=((s=A)>>>1|(c=I)<<31)^(s>>>8|c<<24)^s>>>7,O=((a=I)>>>1|(o=A)<<31)^(a>>>8|o<<24)^(a>>>7|o<<25);A=u[E-4],I=u[E-4+1];var T=((i=A)>>>19|(n=I)<<13)^(n>>>29|i<<3)^i>>>6,B=((t=I)>>>19|(r=A)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),C=u[E-14],F=u[E-14+1],R=u[E-32],z=u[E-32+1],M=O+F|0,N=P+C+ae(M,O)|0;N=(N=N+T+ae(M=M+B|0,B)|0)+R+ae(M=M+z|0,z)|0,u[E]=N,u[E+1]=M}for(var D=0;D<160;D+=2){N=u[D],M=u[D+1];var q=re(f,p,h),L=re(b,y,_),U=ie(f,b),H=ie(b,f),K=ne(d,k),V=ne(k,d),G=ee[D],$=ee[D+1],W=te(d,m,g),Z=te(k,x,S),Y=j+V|0,X=v+K+ae(Y,j)|0;X=(X=(X=X+W+ae(Y=Y+Z|0,Z)|0)+G+ae(Y=Y+$|0,$)|0)+N+ae(Y=Y+M|0,M)|0;var J=H+L|0,Q=U+q+ae(J,H)|0;v=g,j=S,g=m,S=x,m=d,x=k,d=l+X+ae(k=w+Y|0,w)|0,l=h,w=_,h=p,_=y,p=f,y=b,f=X+Q+ae(b=Y+J|0,Y)|0}this._al=this._al+b|0,this._bl=this._bl+y|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+k|0,this._fl=this._fl+x|0,this._gl=this._gl+S|0,this._hl=this._hl+j|0,this._ah=this._ah+f+ae(this._al,b)|0,this._bh=this._bh+p+ae(this._bl,y)|0,this._ch=this._ch+h+ae(this._cl,_)|0,this._dh=this._dh+l+ae(this._dl,w)|0,this._eh=this._eh+d+ae(this._el,k)|0,this._fh=this._fh+m+ae(this._fl,x)|0,this._gh=this._gh+g+ae(this._gl,S)|0,this._hh=this._hh+v+ae(this._hl,j)|0},s.prototype._hash=function(){var i=a.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],457:[function(e,t,r){var i=e("safer-buffer").Buffer,n={dsa:{parts:["p","q","g","y"],sizePart:"p"},rsa:{parts:["e","n"],sizePart:"n"},ecdsa:{parts:["curve","Q"],sizePart:"Q"},ed25519:{parts:["A"],sizePart:"A"}};n.curve25519=n.ed25519;var a={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};a.curve25519=a.ed25519;var o={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:i.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g,""),"hex"),s:i.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g,""),"hex"),n:i.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g,""),"hex"),G:i.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g,""),"hex"),s:i.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g,""),"hex"),n:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g,""),"hex"),G:i.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:i.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g,""),"hex"),a:i.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g,""),"hex"),s:i.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g,""),"hex"),n:i.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g,""),"hex"),G:i.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g,""),"hex")}};t.exports={info:n,privInfo:a,hashAlgs:{md5:!0,sha1:!0,sha256:!0,sha384:!0,sha512:!0},curves:o}},{"safer-buffer":448}],458:[function(e,t,r){t.exports=_;var d=e("assert-plus"),m=e("safer-buffer").Buffer,i=e("./algs"),n=e("crypto"),a=e("./fingerprint"),o=(e("./signature"),e("./errors")),g=(e("util"),e("./utils")),v=e("./key"),b=e("./private-key"),y=e("./identity"),s={};s.openssh=e("./formats/openssh-cert"),s.x509=e("./formats/x509"),s.pem=e("./formats/x509-pem");var c=o.CertificateParseError,u=o.InvalidAlgorithmError;function _(e){d.object(e,"options"),d.arrayOfObject(e.subjects,"options.subjects"),g.assertCompatible(e.subjects[0],y,[1,0],"options.subjects"),g.assertCompatible(e.subjectKey,v,[1,0],"options.subjectKey"),g.assertCompatible(e.issuer,y,[1,0],"options.issuer"),void 0!==e.issuerKey&&g.assertCompatible(e.issuerKey,v,[1,0],"options.issuerKey"),d.object(e.signatures,"options.signatures"),d.buffer(e.serial,"options.serial"),d.date(e.validFrom,"options.validFrom"),d.date(e.validUntil,"optons.validUntil"),d.optionalArrayOfString(e.purposes,"options.purposes"),this._hashCache={},this.subjects=e.subjects,this.issuer=e.issuer,this.subjectKey=e.subjectKey,this.issuerKey=e.issuerKey,this.signatures=e.signatures,this.serial=e.serial,this.validFrom=e.validFrom,this.validUntil=e.validUntil,this.purposes=e.purposes}_.formats=s,_.prototype.toBuffer=function(e,t){return void 0===e&&(e="x509"),d.string(e,"format"),d.object(s[e],"formats[format]"),d.optionalObject(t,"options"),s[e].write(this,t)},_.prototype.toString=function(e,t){return void 0===e&&(e="pem"),this.toBuffer(e,t).toString()},_.prototype.fingerprint=function(e){void 0===e&&(e="sha256"),d.string(e,"algorithm");var t={type:"certificate",hash:this.hash(e),algorithm:e};return new a(t)},_.prototype.hash=function(e){if(d.string(e,"algorithm"),e=e.toLowerCase(),void 0===i.hashAlgs[e])throw new u(e);if(this._hashCache[e])return this._hashCache[e];var t=n.createHash(e).update(this.toBuffer("x509")).digest();return this._hashCache[e]=t},_.prototype.isExpired=function(e){return void 0===e&&(e=new Date),!(e.getTime()>=this.validFrom.getTime()&&e.getTime()e.length||"BEGIN"!==e.slice(t,t+5).toString("ascii"))}(e))return a.read(e,t);if(function(e){var t=0;for(;to.length&&(p=o.length),u+=c.write(o.slice(f,p),u),c[u++]=10,f=p}return u+=c.write("-----END "+i+"-----\n",u),c.slice(0,u)}};var b=e("assert-plus"),y=e("asn1"),_=e("crypto"),w=e("safer-buffer").Buffer,k=(e("../algs"),e("../utils")),h=e("../key"),l=e("../private-key"),x=e("./pkcs1"),S=e("./pkcs8"),j=e("./ssh-private"),E=e("./rfc4253"),A=e("../errors")},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../utils":480,"./pkcs1":467,"./pkcs8":468,"./rfc4253":469,"./ssh-private":470,asn1:65,"assert-plus":66,crypto:204,"safer-buffer":448}],467:[function(e,t,r){t.exports={read:function(e,t){return i.read(e,t,"pkcs1")},readPkcs1:function(e,t,r){switch(e){case"RSA":if("public"===t)return u=y(c=r,"modulus"),f=y(c,"exponent"),new p({type:"rsa",parts:[{name:"e",data:f},{name:"n",data:u}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t[0],0);var r=y(e,"modulus"),i=y(e,"public exponent"),n=y(e,"private exponent"),a=y(e,"prime1"),o=y(e,"prime2"),s=y(e,"exponent1"),c=y(e,"exponent2"),u=y(e,"iqmp");return new v({type:"rsa",parts:[{name:"n",data:r},{name:"e",data:i},{name:"d",data:n},{name:"iqmp",data:u},{name:"p",data:a},{name:"q",data:o},{name:"dmodp",data:s},{name:"dmodq",data:c}]})}(r);throw new Error("Unknown key type: "+t);case"DSA":if("public"===t)return n=y(i=r,"y"),a=y(i,"p"),o=y(i,"q"),s=y(i,"g"),new p({type:"dsa",parts:[{name:"y",data:n},{name:"p",data:a},{name:"q",data:o},{name:"g",data:s}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),0);var r=y(e,"p"),i=y(e,"q"),n=y(e,"g"),a=y(e,"y"),o=y(e,"x");return new v({type:"dsa",parts:[{name:"p",data:r},{name:"q",data:i},{name:"g",data:n},{name:"y",data:a},{name:"x",data:o}]})}(r);throw new Error("Unknown key type: "+t);case"EC":case"ECDSA":if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),1);var r=e.readString(l.Ber.OctetString,!0);e.readSequence(160);var i=b(e);h.string(i,"a known elliptic curve"),e.readSequence(161);var n=e.readString(l.Ber.BitString,!0);n=g.ecNormalize(n);var a={type:"ecdsa",parts:[{name:"curve",data:d.from(i)},{name:"Q",data:n},{name:"d",data:r}]};return new v(a)}(r);if("public"===t)return function(e){e.readSequence();var t=e.readOID();h.strictEqual(t,"1.2.840.10045.2.1","must be ecPublicKey");for(var r,i=e.readOID(),n=Object.keys(m.curves),a=0;aS.length&&(I=S.length),E+=x.write(S.slice(A,I),E),x[E++]=10,A=I}return E+=x.write("-----END "+k+"-----\n",E),x.slice(0,E)}};var O,T=P("assert-plus"),B=(P("asn1"),P("safer-buffer").Buffer),C=(P("../algs"),P("../utils")),F=P("crypto"),R=(P("../key"),P("../private-key")),r=P("./pem"),A=P("./rfc4253"),z=P("../ssh-buffer"),I=P("../errors");var M="openssh-key-v1"},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../ssh-buffer":479,"../utils":480,"./pem":466,"./rfc4253":469,asn1:65,"assert-plus":66,"bcrypt-pbkdf":76,crypto:204,"safer-buffer":448}],471:[function(e,t,r){t.exports={read:function(e,t){"string"!=typeof e&&(h.buffer(e,"buf"),e=e.toString("ascii"));var r=e.trim().replace(/[\\\r]/g,""),i=r.match(m);i||(i=r.match(g));h.ok(i,"key must match regex");var n,a=d.algToKeyType(i[1]),o=l.from(i[2],"base64"),s={};if(i[4])try{n=d.read(o)}catch(e){i=r.match(g),h.ok(i,"key must match regex"),o=l.from(i[2],"base64"),n=d.readInternal(s,"public",o)}else n=d.readInternal(s,"public",o);if(h.strictEqual(a,n.type),i[4]&&0n.length&&(u=n.length),s+=o.write(n.slice(c,u),s),o[s++]=10,c=u}return s+=o.write("-----END "+i+"-----\n",s),o.slice(0,s)}};var o=e("assert-plus"),p=(e("asn1"),e("safer-buffer").Buffer);e("../algs"),e("../utils"),e("../key"),e("../private-key"),e("./pem"),e("../identity"),e("../signature"),e("../certificate")},{"../algs":457,"../certificate":458,"../identity":474,"../key":476,"../private-key":477,"../signature":478,"../utils":480,"./pem":466,"./x509":473,asn1:65,"assert-plus":66,"safer-buffer":448}],473:[function(e,t,r){t.exports={read:function(e,t){"string"==typeof e&&(e=_.from(e,"binary"));b.buffer(e,"buf");var r=new y.BerReader(e);if(r.readSequence(),1=this._buffer.length},a.prototype.remainder=function(){return this._buffer.slice(this._offset)},a.prototype.skip=function(e){this._offset+=e},a.prototype.expand=function(){this._size*=2;var e=n.alloc(this._size);this._buffer.copy(e,0),this._buffer=e},a.prototype.readPart=function(){return{data:this.readBuffer()}},a.prototype.readBuffer=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4,i.ok(this._offset+e<=this._buffer.length,"length out of bounds at +0x"+this._offset.toString(16)+" (data truncated?)");var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t},a.prototype.readString=function(){return this.readBuffer().toString()},a.prototype.readCString=function(){for(var e=this._offset;ethis._size;)this.expand();this._buffer.writeUInt32BE(e.length,this._offset),this._offset+=4,e.copy(this._buffer,this._offset),this._offset+=e.length},a.prototype.writeString=function(e){this.writeBuffer(n.from(e,"utf8"))},a.prototype.writeCString=function(e){for(;this._offset+1+e.length>this._size;)this.expand();this._buffer.write(e,this._offset),this._offset+=e.length,this._buffer[this._offset++]=0},a.prototype.writeInt=function(e){for(;this._offset+4>this._size;)this.expand();this._buffer.writeUInt32BE(e,this._offset),this._offset+=4},a.prototype.writeInt64=function(e){if(i.buffer(e,"value"),8this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=8},a.prototype.writeChar=function(e){for(;this._offset+1>this._size;)this.expand();this._buffer[this._offset++]=e},a.prototype.writePart=function(e){this.writeBuffer(e.data)},a.prototype.write=function(e){for(;this._offset+e.length>this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=e.length}},{"assert-plus":66,"safer-buffer":448}],480:[function(e,t,r){t.exports={bufferSplit:function(e,t){p.buffer(e),p.string(t);for(var r=[],i=0,n=0,a=0;a=t.length){var o=a+1;r.push(e.slice(i,o-n)),i=o,n=0}i<=e.length&&r.push(e.slice(i,e.length));return r},addRSAMissing:function(e){p.object(e),u(e,s,[1,1]);var t,r=new g(e.part.d.data);if(!e.part.dmodp){var i=new g(e.part.p.data),n=r.mod(i.subtract(1));t=_(n),e.part.dmodp={name:"dmodp",data:t},e.parts.push(e.part.dmodp)}if(!e.part.dmodq){var a=new g(e.part.q.data),o=r.mod(a.subtract(1));t=_(o),e.part.dmodq={name:"dmodq",data:t},e.parts.push(e.part.dmodq)}},calculateDSAPublic:function(e,t,r){return p.buffer(e),p.buffer(t),p.buffer(r),e=new g(e),t=new g(t),r=new g(r),_(e.modPow(r,t))},calculateED25519Public:function(e){p.buffer(e);var t=i.sign.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},calculateX25519Public:function(e){p.buffer(e);var t=i.box.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},mpNormalize:y,mpDenormalize:function(e){p.buffer(e);for(;1c)return!1;if(i.constructor.name!==t.name)return!1;var a=i._sshpkApiVersion;void 0===a&&(a=t._oldVersionDetect(e));return!(a[0]!=r[0]||a[1]t;)p.equal(e[0],0),e=e.slice(1);for(;e.length=r[1],i+" must be compatible with "+t.name+" klass version "+r[0]+"."+r[1])}}var v={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}},b=8;function y(e){for(p.buffer(e);1t._pos){var i=r.substr(t._pos);if("x-user-defined"===t._charset){for(var n=new p(i.length),a=0;at._pos&&(t.push(new p(new Uint8Array(o.result.slice(t._pos)))),t._pos=o.result.byteLength)},o.onload=function(){t.push(null)},o.readAsArrayBuffer(r)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":484,_process:382,buffer:191,inherits:320,"readable-stream":426}],487:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=p,t=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1=2.4.3 <2.5.0",_id:"tough-cookie@2.4.3",_inCache:!0,_installable:!0,_location:"/tough-cookie",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/tough-cookie_2.4.3_1529960207843_0.4882910670728131"},_npmUser:{email:"jstash@gmail.com",name:"jstash"},_npmVersion:"6.1.0",_phantomChildren:{},_requested:{name:"tough-cookie",raw:"tough-cookie@~2.4.3",rawSpec:"~2.4.3",scope:null,spec:">=2.4.3 <2.5.0",type:"range"},_requiredBy:["/request","/request-promise"],_resolved:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",_shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",_shrinkwrap:null,_spec:"tough-cookie@~2.4.3",_where:"/home/administrator/javascript-opentimestamps/node_modules/request",author:{email:"jstash@gmail.com",name:"Jeremy Stashewsky"},bugs:{url:"https://github.com/salesforce/tough-cookie/issues"},contributors:[{name:"Alexander Savin"},{name:"Ian Livingstone"},{name:"Ivan Nikulin"},{name:"Lalit Kapoor"},{name:"Sam Thompson"},{name:"Sebastian Mayr"}],dependencies:{psl:"^1.1.24",punycode:"^1.4.1"},description:"RFC6265 Cookies and Cookie Jar for node.js",devDependencies:{async:"^1.4.2",nyc:"^11.6.0","string.prototype.repeat":"^0.2.0",vows:"^0.8.1"},directories:{},dist:{fileCount:9,integrity:"sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMVcQCRA9TVsSAnZWagAAzX0P/2COkbzb3dOX/FTOYIVL\n7oHge7BvGODNkEHTjBtNsR0jO/AA/gVcUOq6CSmFH+UC14LrmCyNDemQvD15\njnYuJXUIiZsSZO7BGGbOFYrQF+DKLiwgf0LokrIM8KasZ5nxc5xS1jYHG5o+\nwCqutfhlRTqlPbZsexB+eRlIuYNvpsbRAdSDYXrhLJNMZgx49g/SZ7IwunGN\nJ/5Fe041MZqqdi7MAavM3T7vX9IvVRJJ3f4xAEVxY1vh4s0dN+h4fG2eMQzL\nOiaulRUIahs4xmJUYHZgZESc9eTIrI8K+YT7i3r35TGc0Du7ueB2KYxBqy7q\n6AUFbdX9Ep308kTVsTf/h4wE0RvdxKLfZ0ww7T1ivADX9xMi2oIvVtyhCQHo\nSIpyBhaav/fTufF0/Fu4Lcr7PMJxyvF0UcNRqrPmEQTw4UZkFKfT8HN2P5cH\nBvJsFwpeEjt84tt5pJ/bmD0j0EUCLUXLGH6fbA84fHpZGifO239zSf262Qdv\nSXeygU7YxnK8wOCnvlauZx/gp+/WTMfMdODxiX0QnqwS5BctiPCgGG1cKJcC\nqvTECaAEmxMVf/gEW73oxVXJgUO7f6jJaWoawV7ka+wR91W9Bp0pKGOOAxAG\nU72rmnwQKid9U7ly5833sb3D+lbzKJXGNIqohegP4daKZfNNTaLWZXmKE+Iy\n7Vml\r\n=8KpS\r\n-----END PGP SIGNATURE-----\r\n",shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",tarball:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",unpackedSize:83959},engines:{node:">=0.8"},files:["lib"],gitHead:"671ad413b38d7464352886772f57a7ec417d4760",homepage:"https://github.com/salesforce/tough-cookie",keywords:["HTTP","RFC2965","RFC6265","cookie","cookiejar","cookies","jar","set-cookie"],license:"BSD-3-Clause",main:"./lib/cookie",maintainers:[{name:"awaterma",email:"awaterma@awaterma.net"},{name:"jstash",email:"jstash@gmail.com"},{name:"maratto",email:"marat+npm@salesforce.com"},{name:"ruoho",email:"clint@ruoho.org"}],name:"tough-cookie",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/salesforce/tough-cookie.git"},scripts:{cover:"nyc --reporter=lcov --reporter=html vows test/*_test.js",test:"vows test/*_test.js"},version:"2.4.3"}},{}],497:[function(s,e,c){(function(u){"use strict";s("net");var f,a=s("tls"),r=s("http"),i=s("https"),e=s("events"),p=s("assert"),t=s("util"),h=s("safe-buffer").Buffer;function o(e){var o=this;o.options=e||{},o.proxyOptions=o.options.proxy||{},o.maxSockets=o.options.maxSockets||r.Agent.defaultMaxSockets,o.requests=[],o.sockets=[],o.on("free",function(e,t,r){for(var i=0,n=o.requests.length;i=this.maxSockets?this.requests.push({host:t.host,port:t.port,request:e}):this.createConnection({host:t.host,port:t.port,request:e})},o.prototype.createConnection=function(e){var n=this;n.createSocket(e,function(t){function r(){n.emit("free",t,e.host,e.port)}function i(e){n.removeSocket(t),t.removeListener("free",r),t.removeListener("close",i),t.removeListener("agentRemove",i)}t.on("free",r),t.on("close",i),t.on("agentRemove",i),e.request.onSocket(t)})},o.prototype.createSocket=function(n,a){var o=this,s={};o.sockets.push(s);var e=l({},o.proxyOptions,{method:"CONNECT",path:n.host+":"+n.port,agent:!1});e.proxyAuth&&(e.headers=e.headers||{},e.headers["Proxy-Authorization"]="Basic "+h.from(e.proxyAuth).toString("base64")),f("making CONNECT request");var c=o.request(e);function i(e,t,r){if(c.removeAllListeners(),t.removeAllListeners(),200===e.statusCode)p.equal(r.length,0),f("tunneling connection has established"),o.sockets[o.sockets.indexOf(s)]=t,a(t);else{f("tunneling socket could not be established, statusCode=%d",e.statusCode);var i=new Error("tunneling socket could not be established, statusCode="+e.statusCode);i.code="ECONNRESET",n.request.emit("error",i),o.removeSocket(s)}}c.useChunkedEncodingByDefault=!1,c.once("response",function(e){e.upgrade=!0}),c.once("upgrade",function(e,t,r){u.nextTick(function(){i(e,t,r)})}),c.once("connect",i),c.once("error",function(e){c.removeAllListeners(),f("tunneling socket could not be established, cause=%s\n",e.message,e.stack);var t=new Error("tunneling socket could not be established, cause="+e.message);t.code="ECONNRESET",n.request.emit("error",t),o.removeSocket(s)}),c.end()},o.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},f=u.env.NODE_DEBUG&&/\btunnel\b/.test(u.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},c.debug=f}).call(this,s("_process"))},{_process:382,assert:67,events:269,http:483,https:317,net:187,"safe-buffer":447,tls:187,util:505}],498:[function(e,t,r){!function(a){"use strict";var m=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function d(e,t,r,i,n){var a,o=0;for(a=0;a>>8)-1}function v(e,t,r,i){return d(e,t,r,i,16)}function b(e,t,r,i){return d(e,t,r,i,32)}function y(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=a,k=o,x=s,S=c,j=u,E=f,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=0;M<20;M+=2)w^=(n=(C^=(n=(P^=(n=(j^=(n=w+C|0)<<7|n>>>25)+w|0)<<9|n>>>23)+j|0)<<13|n>>>19)+P|0)<<18|n>>>14,E^=(n=(k^=(n=(F^=(n=(O^=(n=E+k|0)<<7|n>>>25)+E|0)<<9|n>>>23)+O|0)<<13|n>>>19)+F|0)<<18|n>>>14,T^=(n=(A^=(n=(x^=(n=(R^=(n=T+A|0)<<7|n>>>25)+T|0)<<9|n>>>23)+R|0)<<13|n>>>19)+x|0)<<18|n>>>14,z^=(n=(B^=(n=(I^=(n=(S^=(n=z+B|0)<<7|n>>>25)+z|0)<<9|n>>>23)+S|0)<<13|n>>>19)+I|0)<<18|n>>>14,w^=(n=(S^=(n=(x^=(n=(k^=(n=w+S|0)<<7|n>>>25)+w|0)<<9|n>>>23)+k|0)<<13|n>>>19)+x|0)<<18|n>>>14,E^=(n=(j^=(n=(I^=(n=(A^=(n=E+j|0)<<7|n>>>25)+E|0)<<9|n>>>23)+A|0)<<13|n>>>19)+I|0)<<18|n>>>14,T^=(n=(O^=(n=(P^=(n=(B^=(n=T+O|0)<<7|n>>>25)+T|0)<<9|n>>>23)+B|0)<<13|n>>>19)+P|0)<<18|n>>>14,z^=(n=(R^=(n=(F^=(n=(C^=(n=z+R|0)<<7|n>>>25)+z|0)<<9|n>>>23)+C|0)<<13|n>>>19)+F|0)<<18|n>>>14;w=w+a|0,k=k+o|0,x=x+s|0,S=S+c|0,j=j+u|0,E=E+f|0,A=A+p|0,I=I+h|0,P=P+l|0,O=O+d|0,T=T+m|0,B=B+g|0,C=C+v|0,F=F+b|0,R=R+y|0,z=z+_|0,e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=x>>>0&255,e[9]=x>>>8&255,e[10]=x>>>16&255,e[11]=x>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=j>>>0&255,e[17]=j>>>8&255,e[18]=j>>>16&255,e[19]=j>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=B>>>0&255,e[45]=B>>>8&255,e[46]=B>>>16&255,e[47]=B>>>24&255,e[48]=C>>>0&255,e[49]=C>>>8&255,e[50]=C>>>16&255,e[51]=C>>>24&255,e[52]=F>>>0&255,e[53]=F>>>8&255,e[54]=F>>>16&255,e[55]=F>>>24&255,e[56]=R>>>0&255,e[57]=R>>>8&255,e[58]=R>>>16&255,e[59]=R>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,i)}function _(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=0;w<20;w+=2)a^=(n=(v^=(n=(l^=(n=(u^=(n=a+v|0)<<7|n>>>25)+a|0)<<9|n>>>23)+u|0)<<13|n>>>19)+l|0)<<18|n>>>14,f^=(n=(o^=(n=(b^=(n=(d^=(n=f+o|0)<<7|n>>>25)+f|0)<<9|n>>>23)+d|0)<<13|n>>>19)+b|0)<<18|n>>>14,m^=(n=(p^=(n=(s^=(n=(y^=(n=m+p|0)<<7|n>>>25)+m|0)<<9|n>>>23)+y|0)<<13|n>>>19)+s|0)<<18|n>>>14,_^=(n=(g^=(n=(h^=(n=(c^=(n=_+g|0)<<7|n>>>25)+_|0)<<9|n>>>23)+c|0)<<13|n>>>19)+h|0)<<18|n>>>14,a^=(n=(c^=(n=(s^=(n=(o^=(n=a+c|0)<<7|n>>>25)+a|0)<<9|n>>>23)+o|0)<<13|n>>>19)+s|0)<<18|n>>>14,f^=(n=(u^=(n=(h^=(n=(p^=(n=f+u|0)<<7|n>>>25)+f|0)<<9|n>>>23)+p|0)<<13|n>>>19)+h|0)<<18|n>>>14,m^=(n=(d^=(n=(l^=(n=(g^=(n=m+d|0)<<7|n>>>25)+m|0)<<9|n>>>23)+g|0)<<13|n>>>19)+l|0)<<18|n>>>14,_^=(n=(y^=(n=(b^=(n=(v^=(n=_+y|0)<<7|n>>>25)+_|0)<<9|n>>>23)+v|0)<<13|n>>>19)+b|0)<<18|n>>>14;e[0]=a>>>0&255,e[1]=a>>>8&255,e[2]=a>>>16&255,e[3]=a>>>24&255,e[4]=f>>>0&255,e[5]=f>>>8&255,e[6]=f>>>16&255,e[7]=f>>>24&255,e[8]=m>>>0&255,e[9]=m>>>8&255,e[10]=m>>>16&255,e[11]=m>>>24&255,e[12]=_>>>0&255,e[13]=_>>>8&255,e[14]=_>>>16&255,e[15]=_>>>24&255,e[16]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255}(e,t,r,i)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function k(e,t,r,i,n,a,o){var s,c,u=new Uint8Array(16),f=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=a[c];for(;64<=n;){for(y(f,u,o,w),c=0;c<64;c++)e[t+c]=r[i+c]^f[c];for(s=1,c=8;c<16;c++)s=s+(255&u[c])|0,u[c]=255&s,s>>>=8;n-=64,t+=64,i+=64}if(0>>=8;r-=64,t+=64}if(0>>13|r<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|i<<6),n=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|n<<9),a=255&e[8]|(255&e[9])<<8,this.r[4]=255&(n>>>4|a<<12),this.r[5]=a>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(a>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,r,i,n,a){var o=new E(a);return o.update(r,i,n),o.finish(e,t),0}function I(e,t,r,i,n,a){var o=new Uint8Array(16);return A(o,0,r,i,n,a),v(e,t,o,0)}function P(e,t,r,i,n){var a;if(r<32)return-1;for(j(e,0,t,0,r,i,n),A(e,16,e,32,r-32,e),a=0;a<16;a++)e[a]=0;return 0}function O(e,t,r,i,n){var a,o=new Uint8Array(32);if(r<32)return-1;if(S(o,0,32,i,n),0!==I(t,16,t,32,r-32,o))return-1;for(j(e,0,t,0,r,i,n),a=0;a<32;a++)e[a]=0;return 0}function T(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function C(e,t,r){for(var i,n=~(r-1),a=0;a<16;a++)i=n&(e[a]^t[a]),e[a]^=i,t[a]^=i}function F(e,t){var r,i,n,a=m(),o=m();for(r=0;r<16;r++)o[r]=t[r];for(B(o),B(o),B(o),i=0;i<2;i++){for(a[0]=o[0]-65517,r=1;r<15;r++)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),n=a[15]>>16&1,a[14]&=65535,C(o,a,1-n)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function R(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return F(r,e),F(i,t),b(r,0,i,0)}function z(e){var t=new Uint8Array(32);return F(t,e),1&t[0]}function M(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function N(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function D(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function q(e,t,r){var i,n,a=0,o=0,s=0,c=0,u=0,f=0,p=0,h=0,l=0,d=0,m=0,g=0,v=0,b=0,y=0,_=0,w=0,k=0,x=0,S=0,j=0,E=0,A=0,I=0,P=0,O=0,T=0,B=0,C=0,F=0,R=0,z=r[0],M=r[1],N=r[2],D=r[3],q=r[4],L=r[5],U=r[6],H=r[7],K=r[8],V=r[9],G=r[10],$=r[11],W=r[12],Z=r[13],Y=r[14],X=r[15];a+=(i=t[0])*z,o+=i*M,s+=i*N,c+=i*D,u+=i*q,f+=i*L,p+=i*U,h+=i*H,l+=i*K,d+=i*V,m+=i*G,g+=i*$,v+=i*W,b+=i*Z,y+=i*Y,_+=i*X,o+=(i=t[1])*z,s+=i*M,c+=i*N,u+=i*D,f+=i*q,p+=i*L,h+=i*U,l+=i*H,d+=i*K,m+=i*V,g+=i*G,v+=i*$,b+=i*W,y+=i*Z,_+=i*Y,w+=i*X,s+=(i=t[2])*z,c+=i*M,u+=i*N,f+=i*D,p+=i*q,h+=i*L,l+=i*U,d+=i*H,m+=i*K,g+=i*V,v+=i*G,b+=i*$,y+=i*W,_+=i*Z,w+=i*Y,k+=i*X,c+=(i=t[3])*z,u+=i*M,f+=i*N,p+=i*D,h+=i*q,l+=i*L,d+=i*U,m+=i*H,g+=i*K,v+=i*V,b+=i*G,y+=i*$,_+=i*W,w+=i*Z,k+=i*Y,x+=i*X,u+=(i=t[4])*z,f+=i*M,p+=i*N,h+=i*D,l+=i*q,d+=i*L,m+=i*U,g+=i*H,v+=i*K,b+=i*V,y+=i*G,_+=i*$,w+=i*W,k+=i*Z,x+=i*Y,S+=i*X,f+=(i=t[5])*z,p+=i*M,h+=i*N,l+=i*D,d+=i*q,m+=i*L,g+=i*U,v+=i*H,b+=i*K,y+=i*V,_+=i*G,w+=i*$,k+=i*W,x+=i*Z,S+=i*Y,j+=i*X,p+=(i=t[6])*z,h+=i*M,l+=i*N,d+=i*D,m+=i*q,g+=i*L,v+=i*U,b+=i*H,y+=i*K,_+=i*V,w+=i*G,k+=i*$,x+=i*W,S+=i*Z,j+=i*Y,E+=i*X,h+=(i=t[7])*z,l+=i*M,d+=i*N,m+=i*D,g+=i*q,v+=i*L,b+=i*U,y+=i*H,_+=i*K,w+=i*V,k+=i*G,x+=i*$,S+=i*W,j+=i*Z,E+=i*Y,A+=i*X,l+=(i=t[8])*z,d+=i*M,m+=i*N,g+=i*D,v+=i*q,b+=i*L,y+=i*U,_+=i*H,w+=i*K,k+=i*V,x+=i*G,S+=i*$,j+=i*W,E+=i*Z,A+=i*Y,I+=i*X,d+=(i=t[9])*z,m+=i*M,g+=i*N,v+=i*D,b+=i*q,y+=i*L,_+=i*U,w+=i*H,k+=i*K,x+=i*V,S+=i*G,j+=i*$,E+=i*W,A+=i*Z,I+=i*Y,P+=i*X,m+=(i=t[10])*z,g+=i*M,v+=i*N,b+=i*D,y+=i*q,_+=i*L,w+=i*U,k+=i*H,x+=i*K,S+=i*V,j+=i*G,E+=i*$,A+=i*W,I+=i*Z,P+=i*Y,O+=i*X,g+=(i=t[11])*z,v+=i*M,b+=i*N,y+=i*D,_+=i*q,w+=i*L,k+=i*U,x+=i*H,S+=i*K,j+=i*V,E+=i*G,A+=i*$,I+=i*W,P+=i*Z,O+=i*Y,T+=i*X,v+=(i=t[12])*z,b+=i*M,y+=i*N,_+=i*D,w+=i*q,k+=i*L,x+=i*U,S+=i*H,j+=i*K,E+=i*V,A+=i*G,I+=i*$,P+=i*W,O+=i*Z,T+=i*Y,B+=i*X,b+=(i=t[13])*z,y+=i*M,_+=i*N,w+=i*D,k+=i*q,x+=i*L,S+=i*U,j+=i*H,E+=i*K,A+=i*V,I+=i*G,P+=i*$,O+=i*W,T+=i*Z,B+=i*Y,C+=i*X,y+=(i=t[14])*z,_+=i*M,w+=i*N,k+=i*D,x+=i*q,S+=i*L,j+=i*U,E+=i*H,A+=i*K,I+=i*V,P+=i*G,O+=i*$,T+=i*W,B+=i*Z,C+=i*Y,F+=i*X,_+=(i=t[15])*z,o+=38*(k+=i*N),s+=38*(x+=i*D),c+=38*(S+=i*q),u+=38*(j+=i*L),f+=38*(E+=i*U),p+=38*(A+=i*H),h+=38*(I+=i*K),l+=38*(P+=i*V),d+=38*(O+=i*G),m+=38*(T+=i*$),g+=38*(B+=i*W),v+=38*(C+=i*Z),b+=38*(F+=i*Y),y+=38*(R+=i*X),a=(i=(a+=38*(w+=i*M))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a=(i=(a+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a+=n-1+37*(n-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=h,e[8]=l,e[9]=d,e[10]=m,e[11]=g,e[12]=v,e[13]=b,e[14]=y,e[15]=_}function L(e,t){q(e,t,t)}function U(e,t){var r,i=m();for(r=0;r<16;r++)i[r]=t[r];for(r=253;0<=r;r--)L(i,i),2!==r&&4!==r&&q(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function H(e,t,r){var i,n,a=new Uint8Array(32),o=new Float64Array(80),s=m(),c=m(),u=m(),f=m(),p=m(),h=m();for(n=0;n<31;n++)a[n]=t[n];for(a[31]=127&t[31]|64,a[0]&=248,M(o,r),n=0;n<16;n++)c[n]=o[n],f[n]=s[n]=u[n]=0;for(s[0]=f[0]=1,n=254;0<=n;--n)C(s,c,i=a[n>>>3]>>>(7&n)&1),C(u,f,i),N(p,s,u),D(s,s,u),N(u,c,f),D(c,c,f),L(f,p),L(h,s),q(s,u,s),q(u,c,p),N(p,s,u),D(s,s,u),L(c,s),D(u,f,h),q(s,u,g),N(s,s,f),q(u,u,s),q(s,f,h),q(f,c,o),L(c,p),C(s,c,i),C(u,f,i);for(n=0;n<16;n++)o[n+16]=s[n],o[n+32]=u[n],o[n+48]=c[n],o[n+64]=f[n];var l=o.subarray(32),d=o.subarray(16);return U(l,l),q(d,d,l),F(e,d),0}function K(e,t){return H(e,t,r)}function V(e,t){return o(t,32),K(e,t)}function G(e,t,r){var i=new Uint8Array(32);return H(i,r,t),_(e,n,i,w)}E.prototype.blocks=function(e,t,r){for(var i,n,a,o,s,c,u,f,p,h,l,d,m,g,v,b,y,_,w,k=this.fin?0:2048,x=this.h[0],S=this.h[1],j=this.h[2],E=this.h[3],A=this.h[4],I=this.h[5],P=this.h[6],O=this.h[7],T=this.h[8],B=this.h[9],C=this.r[0],F=this.r[1],R=this.r[2],z=this.r[3],M=this.r[4],N=this.r[5],D=this.r[6],q=this.r[7],L=this.r[8],U=this.r[9];16<=r;)h=p=0,h+=(x+=8191&(i=255&e[t+0]|(255&e[t+1])<<8))*C,h+=(S+=8191&(i>>>13|(n=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*U),h+=(j+=8191&(n>>>10|(a=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*L),h+=(E+=8191&(a>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*q),p=(h+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*D))>>>13,h&=8191,h+=(I+=s>>>1&8191)*(5*N),h+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*M),h+=(O+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),h+=(T+=8191&(u>>>8|(f=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*R),l=p+=(h+=(B+=f>>>5|k)*(5*F))>>>13,l+=x*F,l+=S*C,l+=j*(5*U),l+=E*(5*L),p=(l+=A*(5*q))>>>13,l&=8191,l+=I*(5*D),l+=P*(5*N),l+=O*(5*M),l+=T*(5*z),p+=(l+=B*(5*R))>>>13,l&=8191,d=p,d+=x*R,d+=S*F,d+=j*C,d+=E*(5*U),p=(d+=A*(5*L))>>>13,d&=8191,d+=I*(5*q),d+=P*(5*D),d+=O*(5*N),d+=T*(5*M),m=p+=(d+=B*(5*z))>>>13,m+=x*z,m+=S*R,m+=j*F,m+=E*C,p=(m+=A*(5*U))>>>13,m&=8191,m+=I*(5*L),m+=P*(5*q),m+=O*(5*D),m+=T*(5*N),g=p+=(m+=B*(5*M))>>>13,g+=x*M,g+=S*z,g+=j*R,g+=E*F,p=(g+=A*C)>>>13,g&=8191,g+=I*(5*U),g+=P*(5*L),g+=O*(5*q),g+=T*(5*D),v=p+=(g+=B*(5*N))>>>13,v+=x*N,v+=S*M,v+=j*z,v+=E*R,p=(v+=A*F)>>>13,v&=8191,v+=I*C,v+=P*(5*U),v+=O*(5*L),v+=T*(5*q),b=p+=(v+=B*(5*D))>>>13,b+=x*D,b+=S*N,b+=j*M,b+=E*z,p=(b+=A*R)>>>13,b&=8191,b+=I*F,b+=P*C,b+=O*(5*U),b+=T*(5*L),y=p+=(b+=B*(5*q))>>>13,y+=x*q,y+=S*D,y+=j*N,y+=E*M,p=(y+=A*z)>>>13,y&=8191,y+=I*R,y+=P*F,y+=O*C,y+=T*(5*U),_=p+=(y+=B*(5*L))>>>13,_+=x*L,_+=S*q,_+=j*D,_+=E*N,p=(_+=A*M)>>>13,_&=8191,_+=I*z,_+=P*R,_+=O*F,_+=T*C,w=p+=(_+=B*(5*U))>>>13,w+=x*U,w+=S*L,w+=j*q,w+=E*D,p=(w+=A*N)>>>13,w&=8191,w+=I*M,w+=P*z,w+=O*R,w+=T*F,x=h=8191&(p=(p=((p+=(w+=B*C)>>>13)<<2)+p|0)+(h&=8191)|0),S=l+=p>>>=13,j=d&=8191,E=m&=8191,A=g&=8191,I=v&=8191,P=b&=8191,O=y&=8191,T=_&=8191,B=w&=8191,t+=16,r-=16;this.h[0]=x,this.h[1]=S,this.h[2]=j,this.h[3]=E,this.h[4]=A,this.h[5]=I,this.h[6]=P,this.h[7]=O,this.h[8]=T,this.h[9]=B},E.prototype.finish=function(e,t){var r,i,n,a,o=new Uint16Array(10);if(this.leftover){for(a=this.leftover,this.buffer[a++]=1;a<16;a++)this.buffer[a]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=r,r=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this.h[a]+r,r=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,i=(1^r)-1,a=0;a<10;a++)o[a]&=i;for(i=~i,a=0;a<10;a++)this.h[a]=this.h[a]&i|o[a];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,a=1;a<8;a++)n=(this.h[a]+this.pad[a]|0)+(n>>>16)|0,this.h[a]=65535&n;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var i,n;if(this.leftover){for(r<(n=16-this.leftover)&&(n=r),i=0;i>>16,I=65535&(S=D),P=S>>>16,E+=65535&(j=((g=K)>>>14|(c=z)<<18)^(K>>>18|z<<14)^(z>>>9|K<<23)),A+=j>>>16,I+=65535&(S=(z>>>14|K<<18)^(z>>>18|K<<14)^(K>>>9|z<<23)),P+=S>>>16,E+=65535&(j=K&(v=V)^~K&(b=G)),A+=j>>>16,I+=65535&(S=z&(u=M)^~z&(f=N)),P+=S>>>16,S=Z[2*k],E+=65535&(j=Z[2*k+1]),A+=j>>>16,I+=65535&S,P+=S>>>16,S=O[k%16],A+=(j=T[k%16])>>>16,I+=65535&S,P+=S>>>16,I+=(A+=(E+=65535&j)>>>16)>>>16,E=65535&(j=w=65535&E|A<<16),A=j>>>16,I=65535&(S=_=65535&I|(P+=I>>>16)<<16),P=S>>>16,E+=65535&(j=(q>>>28|B<<4)^(B>>>2|q<<30)^(B>>>7|q<<25)),A+=j>>>16,I+=65535&(S=(B>>>28|q<<4)^(q>>>2|B<<30)^(q>>>7|B<<25)),P+=S>>>16,A+=(j=q&L^q&U^L&U)>>>16,I+=65535&(S=B&C^B&F^C&F),P+=S>>>16,p=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,y=65535&E|A<<16,E=65535&(j=m),A=j>>>16,I=65535&(S=s),P=S>>>16,A+=(j=w)>>>16,I+=65535&(S=_),P+=S>>>16,C=n,F=a,R=o,z=s=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,M=c,N=u,D=f,B=p,L=h,U=l,H=d,K=m=65535&E|A<<16,V=g,G=v,$=b,q=y,k%16==15)for(x=0;x<16;x++)S=O[x],E=65535&(j=T[x]),A=j>>>16,I=65535&S,P=S>>>16,S=O[(x+9)%16],E+=65535&(j=T[(x+9)%16]),A+=j>>>16,I+=65535&S,P+=S>>>16,_=O[(x+1)%16],E+=65535&(j=((w=T[(x+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),A+=j>>>16,I+=65535&(S=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),P+=S>>>16,_=O[(x+14)%16],A+=(j=((w=T[(x+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,I+=65535&(S=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,O[x]=65535&I|P<<16,T[x]=65535&E|A<<16;E=65535&(j=q),A=j>>>16,I=65535&(S=B),P=S>>>16,S=e[0],A+=(j=t[0])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[0]=B=65535&I|P<<16,t[0]=q=65535&E|A<<16,E=65535&(j=L),A=j>>>16,I=65535&(S=C),P=S>>>16,S=e[1],A+=(j=t[1])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[1]=C=65535&I|P<<16,t[1]=L=65535&E|A<<16,E=65535&(j=U),A=j>>>16,I=65535&(S=F),P=S>>>16,S=e[2],A+=(j=t[2])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[2]=F=65535&I|P<<16,t[2]=U=65535&E|A<<16,E=65535&(j=H),A=j>>>16,I=65535&(S=R),P=S>>>16,S=e[3],A+=(j=t[3])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[3]=R=65535&I|P<<16,t[3]=H=65535&E|A<<16,E=65535&(j=K),A=j>>>16,I=65535&(S=z),P=S>>>16,S=e[4],A+=(j=t[4])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[4]=z=65535&I|P<<16,t[4]=K=65535&E|A<<16,E=65535&(j=V),A=j>>>16,I=65535&(S=M),P=S>>>16,S=e[5],A+=(j=t[5])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[5]=M=65535&I|P<<16,t[5]=V=65535&E|A<<16,E=65535&(j=G),A=j>>>16,I=65535&(S=N),P=S>>>16,S=e[6],A+=(j=t[6])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[6]=N=65535&I|P<<16,t[6]=G=65535&E|A<<16,E=65535&(j=$),A=j>>>16,I=65535&(S=D),P=S>>>16,S=e[7],A+=(j=t[7])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[7]=D=65535&I|P<<16,t[7]=$=65535&E|A<<16,W+=128,i-=128}return i}function X(e,t,r){var i,n=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,Y(n,a,t,r),r%=128,i=0;i>(7&n)&1),J(t,e),J(e,e),Q(e,t,i)}function re(e,t){var r=[m(),m(),m(),m()];T(r[0],i),T(r[1],s),T(r[2],f),q(r[3],i,s),te(e,r,t)}function ie(e,t,r){var i,n=new Uint8Array(64),a=[m(),m(),m(),m()];for(r||o(t,32),X(n,t,32),n[0]&=248,n[31]&=127,n[31]|=64,re(a,n),ee(e,a),i=0;i<32;i++)t[i+32]=e[i];return 0}var ne=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var r,i,n,a;for(i=63;32<=i;--i){for(r=0,n=i-32,a=i-12;n>8,t[n]-=256*r;t[n]+=r,t[i]=0}for(n=r=0;n<32;n++)t[n]+=r-(t[31]>>4)*ne[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*ne[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function oe(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function se(e,t,r,i){var n,a,o=new Uint8Array(64),s=new Uint8Array(64),c=new Uint8Array(64),u=new Float64Array(64),f=[m(),m(),m(),m()];X(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var p=r+64;for(n=0;n>7&&D(e[0],u,e[0]),q(e[3],e[0],e[1]),0)}function ue(e,t,r,i){var n,a=new Uint8Array(32),o=new Uint8Array(64),s=[m(),m(),m(),m()],c=[m(),m(),m(),m()];if(-1,r<64)return-1;if(ce(c,i))return-1;for(n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,M=String.fromCharCode;function N(e){throw new RangeError(o[e])}function s(e,t){var r=e.split("@"),i="";return 1>1,e+=z(e/t);455z((C-n)/p))&&N("overflow"),n+=l*p;var d=h<=o?1:o+26<=h?26:h-o;if(lz(C/m)&&N("overflow"),p*=m}var g=r.length+1;o=L(n-f,g,0==f),z(n/g)>C-a&&N("overflow"),a+=z(n/g),n%=g,r.splice(n++,0,a)}return String.fromCodePoint.apply(String,r)},u=function(e){var t=[],r=(e=D(e)).length,i=128,n=0,a=72,o=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(o=(u=f.next()).done);o=!0){var p=u.value;p<128&&t.push(M(p))}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}var h=t.length,l=h;for(h&&t.push("-");lz((C-n)/w)&&N("overflow"),n+=(d-i)*w,i=d;var k=!0,x=!1,S=void 0;try{for(var j,E=e[Symbol.iterator]();!(k=(j=E.next()).done);k=!0){var A=j.value;if(AC&&N("overflow"),A==i){for(var I=n,P=36;;P+=36){var O=P<=a?1:a+26<=P?26:P-a;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function l(e){for(var t="",r=0,i=e.length;rA-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(V,"g"),Y=new RegExp($,"g"),X=new RegExp(F("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',W),"g"),J=new RegExp(F("[^]",V,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),Q=J;function ee(e){var t=l(e);return t.match(Z)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,a={},o=r.query.split("&"),s=0,c=o.length;s",'"',"`"," ","\r","\n","\t"]),M=["'"].concat(n),N=["%","/","?",";","#"].concat(M),D=["/","?","#"],q=/^[+a-z0-9A-Z_-]{0,63}$/,L=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,U={javascript:!0,"javascript:":!0},H={javascript:!0,"javascript:":!0},K={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},V=e("querystring");function a(e,t,r){if(e&&F.isObject(e)&&e instanceof A)return e;var i=new A;return i.parse(e,t,r),i}A.prototype.parse=function(e,t,r){if(!F.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===e?"undefined":_typeof(e)));var i=e.indexOf("?"),n=-1!==i&&i>t&63|128)}function p(e){if(0==(4294967168&e))return s(e);var t="";return 0==(4294965248&e)?t=s(e>>6&31|192):0==(4294901760&e)?(u(e),t=s(e>>12&15|224),t+=f(e,6)):0==(4292870144&e)&&(t=s(e>>18&7|240),t+=f(e,12),t+=f(e,6)),t+=s(63&e|128)}function h(){if(a<=o)throw Error("Invalid byte index");var e=255&n[o];if(o++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,t;if(a>>10&1023|55296),t=56320|1023&t),n+=s(t);return n}(r)}};if("function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define(function(){return d});else if(t&&!t.nodeType)if(r)r.exports=d;else{var m={}.hasOwnProperty;for(var g in d)m.call(d,g)&&(t[g]=d[g])}else e.utf8=d}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],503:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],504:[function(e,t,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],505:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{"./support/isBuffer":504,_process:382,dup:70,inherits:320}],506:[function(e,t,r){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},{}],507:[function(e,t,r){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var n=new Uint8Array(16);t.exports=function(){return i(n),n}}else{var a=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}},{}],508:[function(e,t,r){var o=e("./lib/rng"),s=e("./lib/bytesToUuid");t.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var a=0;a<16;++a)t[i+a]=n[a];return t||s(n)}},{"./lib/bytesToUuid":506,"./lib/rng":507}],509:[function(e,t,r){var s=e("assert-plus"),i=e("util"),n=e("extsprintf"),c=e("core-util-is").isError,a=n.sprintf;function u(e){var t,r,i,n;if(s.object(e,"args"),s.bool(e.strict,"args.strict"),s.array(e.argv,"args.argv"),0===(t=e.argv).length)r={},i=[];else if(c(t[0]))r={cause:t[0]},i=t.slice(1);else if("object"===_typeof(t[0])){for(n in r={},t[0])r[n]=t[0][n];i=t.slice(1)}else s.string(t[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},i=t;return s.object(r),r.strict||e.strict||(i=i.map(function(e){return null===e?"null":void 0===e?"undefined":e})),{options:r,shortmessage:0===i.length?"":a.apply(null,i)}}function f(){var e,t,r,i,n,a,o;if(e=Array.prototype.slice.call(arguments,0),!(this instanceof f))return t=Object.create(f.prototype),f.apply(t,arguments),t;if((r=u({argv:e,strict:!1})).options.name&&(s.string(r.options.name,'error\'s "name" must be a string'),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,a=r.shortmessage,(i=r.options.cause)&&(s.ok(c(i),"cause is not an Error"),this.jse_cause=i,r.options.skipCauseMessage||(a+=": "+i.message)),this.jse_info={},r.options.info)for(o in r.options.info)this.jse_info[o]=r.options.info[o];return this.message=a,Error.call(this,a),Error.captureStackTrace&&(n=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,n)),this}function o(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof o?(i=(r=u({argv:e,strict:!0})).options,f.call(this,i,"%s",r.shortmessage),this):(t=Object.create(o.prototype),o.apply(t,arguments),t)}function p(e){s.array(e,"list of errors"),s.ok(0this._inputTypes.length&&!n.isObject(e[e.length-1]))return a.inputDefaultBlockNumberFormatter(e.pop())},s.prototype.toPayload=function(e){var t={};return e.length>this._inputTypes.length&&n.isObject(e[e.length-1])&&(t=e[e.length-1]),t.to=this._address,t.data="0x"+this.signature()+i.encodeParams(this._inputTypes,e),t},s.prototype.signature=function(){return o(this._name).slice(0,8)},s.prototype.unpackOutput=function(e){if(e){e=2<=e.length?e.slice(2):e;var t=i.decodeParams(this._outputTypes,e);return 1===t.length?t[0]:t}},s.prototype.call=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),i=this.extractCallback(e),t=this.extractDefaultBlock(e),r=this.toPayload(e);if(!i){var n=this._eth.call(r,t);return this.unpackOutput(n)}var a=this;this._eth.call(r,t,function(t,e){if(t)return i(t,null);var r=null;try{r=a.unpackOutput(e)}catch(e){t=e}i(t,r)})},s.prototype.sendTransaction=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),t=this.extractCallback(e),r=this.toPayload(e);if(0=this.buffer.length)){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,t}}},{key:"read",value:function(e){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,Array.from(t)}},{key:"readBool",value:function(){var e=this.read(1)[0];if(255===e)return!0;if(0===e)return!1;throw new n("read_bool() expected 0xff or 0x00; got +"+e)}},{key:"readVaruint",value:function(){for(var e=0,t=0,r=void 0;e|=(127&(r=this.read(1)[0]))< "+e);if(r>=7}}},{key:"writeByte",value:function(e){if(this.length>=this.buffer.length){var t=2*this.length,r=new Uint8Array(t);r.set(this.buffer,0),this.buffer=r}isNaN(e)?this.buffer[this.length]=e.codePointAt():this.buffer[this.length]=e,this.length++}},{key:"writeBytes",value:function(e){var t=this;e.forEach(function(e){t.writeByte(e)})}},{key:"writeVarbytes",value:function(e){this.writeVaruint(e.length),this.writeBytes(e)}},{key:"toString",value:function(){return this.buffer.toHex(0)}}]),e}();m.exports={StreamDeserialization:h,StreamSerialization:l,DeserializationError:n,BadMagicError:a,UnsupportedMajorVersion:o,TruncationError:s,TrailingGarbageError:c,RecursionLimitError:u,SerializerTypeError:f,SerializerValueError:p,ValueError:e,TypeError:t}}).call(this,d("buffer").Buffer)},{"./extend-error.js":568,"./utils.js":574,buffer:191}],567:[function(e,t,r){"use strict";var s=e("./ops.js"),c=e("./timestamp.js"),i=e("./utils.js"),u=e("./context.js"),f=[0,79,112,101,110,84,105,109,101,115,116,97,109,112,115,0,0,80,114,111,111,102,0,191,137,226,232,132,232,146,148],n=function(){function o(e,t){if(_classCallCheck2(this,o),!(e instanceof s.Op&&t instanceof c))throw new u.ValueError("Invalid Timestamp or fileHashOp");if(t.msg.length!==e._DIGEST_LENGTH())throw new u.ValueError("Timestamp message length and fileHashOp digest length differ");this.fileHashOp=e,this.timestamp=t}return _createClass(o,[{key:"fileDigest",value:function(){return this.timestamp.msg}},{key:"serialize",value:function(e){e.writeBytes(f),e.writeVaruint(1),this.fileHashOp.serialize(e),e.writeBytes(this.timestamp.msg),this.timestamp.serialize(e)}},{key:"serializeToBytes",value:function(){var e=new u.StreamSerialization;return this.serialize(e),e.getOutput()}},{key:"toString",value:function(){var e="DetachedTimestampFile\n";return e+="fileHashOp: "+this.fileHashOp.toString()+"\n",e+="timestamp: "+this.timestamp.toString()+"\n"}},{key:"toJson",value:function(){var e={};e.hash=i.bytesToHex(this.fileDigest()),e.op=this.fileHashOp._HASHLIB_NAME(),e.timestamp=this.timestamp.toJson()}},{key:"equals",value:function(e){return e instanceof o&&(!!e.fileHashOp.equals(this.fileHashOp)&&!!e.timestamp.equals(this.timestamp))}}],[{key:"deserialize",value:function(e){var t=void 0;if(e instanceof u.StreamDeserialization)t=e;else if(e instanceof Array)t=new u.StreamDeserialization(e);else if(e instanceof Uint8Array)t=new u.StreamDeserialization(Array.from(e));else{if(!(e instanceof ArrayBuffer))throw new Error("StreamDeserialization deserialize: Invalid param");t=new u.StreamDeserialization(Array.from(e))}t.assertMagic(f);var r=t.readVaruint();if(1!==r)throw new u.UnsupportedMajorVersion("Version "+r+" detached timestamp files are not supported");var i=s.CryptOp.deserialize(t),n=t.readBytes(i._DIGEST_LENGTH()),a=c.deserialize(t,n);return t.assertEof(),new o(i,a)}},{key:"fromBytes",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOp param");var r=void 0;if(t instanceof u.StreamDeserialization)r=e.hashFd(t);else if(t instanceof Array){var i=new u.StreamDeserialization(t);r=e.hashFd(i)}else if(t instanceof Uint8Array){var n=new u.StreamDeserialization(Array.from(t));r=e.hashFd(n)}else{if(!(t instanceof ArrayBuffer))throw new Error("DetachedTimestampFile: Invalid buffer param");var a=new u.StreamDeserialization(Array.from(t));r=e.hashFd(a)}return new o(e,new c(r))}},{key:"fromHash",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOpss param");if(t instanceof Array)return new o(e,new c(t));if(t instanceof ArrayBuffer||t instanceof Uint8Array)return new o(e,new c(Array.from(t)));throw new Error("DetachedTimestampFile: Invalid fdHash param")}}]),o}();t.exports=n},{"./context.js":566,"./ops.js":572,"./timestamp.js":573,"./utils.js":574}],568:[function(e,t,r){var n=e("util"),a=e("assert");Error.extend=function(r,i){a(r,"subTypeName is required");var e=function e(t){if(!(this instanceof e))return new e(t);try{Error.captureStackTrace(this,this.constructor)}catch(e){}this.name=r,this.code=i,this.message=t||"",this.stack=this.stack.replace("Error",this.toString())};return n.inherits(e,this),e.prototype.toString=function(){return this.name+": "+n.inspect(this.message)},e.extend=this.extend,e}},{assert:67,util:505}],569:[function(e,t,r){"use strict";var a=e("./timestamp.js"),o=e("./ops.js"),i=function(){function h(){_classCallCheck2(this,h)}return _createClass(h,null,[{key:"catThenUnaryOp",value:function(e,t,r){t instanceof a||(t=new a(t)),r instanceof a||(r=new a(r));var i=r.add(new o.OpPrepend(t.msg));return t.ops.set(new o.OpAppend(r.msg),i),i.add(new o.OpSHA256)}},{key:"catSha256",value:function(e,t){return h.catThenUnaryOp(o.OpSHA256,e,t)}},{key:"catSha256d",value:function(e,t){var r=h.catSha256(e,t),i=new o.OpSHA256,n=r.ops.get(i);return void 0===n&&(n=new a(i.call(r.msg)),r.ops.set(i,n)),n}},{key:"makeMerkleTreeIterator",value:function(e){var t=e,r=[],i=void 0;do{t=t[Symbol.iterator](),i=void 0;try{i=t.next().value}catch(e){return"Need at least one timestamp"}var n=!0,a=!(r=[]),o=void 0;try{for(var s,c=t[Symbol.iterator]();!(n=(s=c.next()).done);n=!0){var u=s.value;i=void 0===i?u:void r.push(h.catSha256(i,u))}}catch(e){a=!0,o=e}finally{try{!n&&c.return&&c.return()}finally{if(a)throw o}}0(new i)._MAX_URI_LENGTH())return console.error("URI exceeds maximum length"),!1;for(var t=0;ta.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=a.privateCalendars.length;else if(a.privateCalendars=[],a.calendars&&0!==a.calendars.length||(a.calendars=c.DEFAULT_AGGREGATORS),a.m&&0!==a.m){if(a.m<0||a.m>a.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=1,2<=a.calendars.length&&(a.m=2);o.createTimestamp(i,a.calendars,a.m,a.privateCalendars).then(function(e){if(void 0===e)return r(new Error("Error on timestamp creation"));t()}).catch(function(e){r(e)})})},createTimestamp:function(i,e,t,r){var n=[];return e&&e.forEach(function(e){var t=new c.RemoteCalendar(e);n.push(t.submit(i.msg)),console.log("Submitting to remote calendar "+e)}),r&&r.forEach(function(e,t){var r=new c.RemoteCalendar(t);r.setKey(e),n.push(r.submit(i.msg)),console.log("Submitting to remote calendar "+t)}),new Promise(function(t,r){Promise.all(n.map(u.softFail)).then(function(e){return e.filter(function(e){return!(e instanceof Error)&&void 0!==e}).forEach(function(e){i.merge(e)}),t(i)}).catch(function(e){r(e)})})},makeMerkleTree:function(e){var i=[];return e.forEach(function(e){if(e instanceof s)try{var t=u.randBytes(16),r=e.timestamp.add(new n.OpAppend(u.arrayToBytes(t))).add(new n.OpSHA256);i.push(r)}catch(e){return}else console.error("Invalid input")}),f.makeMerkleTree(i)},verify:function(e,t,i){if(!u.arrEq(e.fileDigest(),t.fileDigest()))return console.error("Expected digest "+u.bytesToHex(e.fileDigest())),console.error("File does not match original!"),new Promise(function(e,t){t(new Error("File does not match original!"))});var n=this;return new Promise(function(t,r){n.upgradeTimestamp(e.timestamp,i).then(function(){n.verifyTimestamp(e.timestamp,i).then(function(e){return t(e)}).catch(function(e){return r(e)})})})},verifyTimestamp:function(e,r){var i=[],n=this;function c(e,t){return e.attestedTimet.attestedTime?1:0}return e.allAttestations().forEach(function(e,t){i.push(n.verifyAttestation(e,t,r))}),new Promise(function(o,s){Promise.all(i.map(u.softFail)).then(function(e){var t=e.filter(function(e){return e.constructor===h.VerificationError?e:void 0});if(0this._MAX_MSG_LENGTH())){var t=this.call(e);return t.length>this._MAX_RESULT_LENGTH()&&console.error("Error : Result too long;"),t}console.error("Error : Message too long;")}}],[{key:"deserialize",value:function(e){return this.tag=e.readBytes(1)[0],t.deserializeFromTag(e,this.tag)}},{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return n.get(t).deserializeFromTag(e,t);console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),t=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t.arg=void 0===e?[]:e,t}return _inherits(r,c),_createClass(r,[{key:"serialize",value:function(e){_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"serialize",this).call(this,e),e.writeVarbytes(this.arg)}},{key:"toString",value:function(){return this._TAG_NAME()+" "+i.bytesToHex(this.arg)}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t)){var r=e.readVarbytes((new c)._MAX_RESULT_LENGTH(),1);return new(n.get(t))(r)}}}]),r}(),e=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 240}},{key:"_TAG_NAME",value:function(){return"append"}},{key:"call",value:function(e){return e.concat(this.arg)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),r=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 241}},{key:"_TAG_NAME",value:function(){return"prepend"}},{key:"call",value:function(e){return this.arg.concat(e)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),u=function(e){function t(){return _classCallCheck2(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,c),_createClass(t,[{key:"toString",value:function(){return this._TAG_NAME()}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return new(n.get(t));console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),f=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 242}},{key:"_TAG_NAME",value:function(){return"reverse"}},{key:"call",value:function(e){return 0===e.length&&console.error("Can't reverse an empty message"),e.reverse()}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),p=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 243}},{key:"_TAG_NAME",value:function(){return"hexlify"}},{key:"_MAX_MSG_LENGTH",value:function(){return u._MAX_RESULT_LENGTH()}},{key:"call",value:function(e){0===e.length&&console.error("Can't hexlify an empty message")}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),h=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_HASHLIB_NAME",value:function(){return 0}},{key:"call",value:function(e,t){for(var r=("keccak256"===e._HASHLIB_NAME()?s(e._HASHLIB_NAME()).update(a.from(t)):o.createHash(e._HASHLIB_NAME()).update(a.from(t))).digest(),i=[r.length],n=0;n(new m.Op)._MAX_MSG_LENGTH())throw new TypeError("Message exceeds Op length limit; "+e.length+" > "+(new m.Op)._MAX_MSG_LENGTH());this.msg=e,this.attestations=[],this.ops=new Map}return _createClass(h,[{key:"getDigest",value:function(){return this.msg}},{key:"serialize",value:function(r){var i=this;if(!this.attestations&&!this.ops)throw new a.ValueError("An empty timestamp can't be serialized");var e=this.attestations;if(e.sort(function(e,t){return e.compareTo(t)}),1 "+t.toString()+u(o,n,i)+"\n",f+=e.strTree(a+1,o)});else if(0>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},r.charsToHex=function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&i).toString(16))}return t.join("")},r.charToByte=function(e){return e.charCodeAt(0)},r.charsToBytes=function(e){for(var t=[],r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,f=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,p=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,l=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",i.copy(m[e])}function g(e){var t=e.match(o);if(!t)return!1;var r,i=+t[1],n=+t[2],a=+t[3];return 1<=n&&n<=12&&1<=a&&a<=(2!=n||((r=i)%4!=0||r%100==0&&r%400!=0)?s[n]:29)}function v(e,t){var r=e.match(c);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return(i<=23&&n<=59&&a<=59||23==i&&59==n&&60==a)&&(!t||o)}(t.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d},m.full={date:g,time:v,"date-time":function(e){var t=e.split(b);return 2==t.length&&g(t[0])&&v(t[1],!0)},uri:function(e){return y.test(e)&&a.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&n.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d};var b=/t|\s/i;var y=/\/|:/;var _=/[^\\]\\Z/;function w(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":12}],7:[function(e,t,r){"use strict";var I=e("./resolve"),P=e("./util"),O=e("./error_classes"),T=e("fast-json-stable-stringify"),B=e("../dotjs/validate"),C=P.ucs2length,F=e("fast-deep-equal"),R=O.Validation;function z(e,t,r){var i=n.call(this,e,t,r);return 0<=i?{index:i,compiling:!0}:{index:i=this._compilations.length,compiling:!(this._compilations[i]={schema:e,root:t,baseId:r})}}function M(e,t,r){var i=n.call(this,e,t,r);0<=i&&this._compilations.splice(i,1)}function n(e,t,r){for(var i=0;i",b=l?">":"<",y=void 0;if(g){var _=e.util.getData(m.$data,o,e.dataPathArr),w="exclusive"+a,k="exclType"+a,x="exclIsNumber"+a,S="' + "+(A="op"+a)+" + '";n+=" var schemaExcl"+a+" = "+_+"; ",n+=" var "+w+"; var "+k+" = typeof "+(_="schemaExcl"+a)+"; if ("+k+" != 'boolean' && "+k+" != 'undefined' && "+k+" != 'number') { ";var j;y=d;(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var E=n;n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+k+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+_+" "+v+"= "+i+") ? "+p+" "+b+"= "+_+" : "+p+" "+b+" "+i+" ) : ( ("+w+" = "+_+" === true) ? "+p+" "+b+"= "+i+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { var op"+a+" = "+w+" ? '"+v+"' : '"+v+"='; ",void 0===s&&(y=d,u=e.errSchemaPath+"/"+d,i=_,h=g)}else{S=v;if((x="number"==typeof m)&&h){var A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ( "+i+" === undefined || "+m+" "+v+"= "+i+" ? "+p+" "+b+"= "+m+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { "}else{x&&void 0===s?(w=!0,y=d,u=e.errSchemaPath+"/"+d,i=m,b+="="):(x&&(i=Math[l?"min":"max"](m,s)),m===(!x||i)?(w=!0,y=d,u=e.errSchemaPath+"/"+d,b+="="):(w=!1,S+="="));A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+" "+b+" "+i+" || "+p+" !== "+p+") { "}}y=y||t,(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+A+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+S+" ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";E=n;return n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s;var l="maxLength"==t?">":"<";n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+p+".length ":n+=" ucs2length("+p+") ",n+=" "+l+" "+i+") { ";var d=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+p+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.schema[t],a=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var f="valid"+c.level,p=c.baseId,h=!0,l=n;if(l)for(var d,m=-1,g=l.length-1;m "+E+") { ";var I=f+"["+E+"]";l.schema=j,l.schemaPath=s+"["+E+"]",l.errSchemaPath=c+"/"+E,l.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),l.dataPathArr[v]=E;var P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",i+=" } ",u&&(i+=" if ("+m+") { ",d+="}")}if("object"==(void 0===_?"undefined":_typeof(_))&&e.util.schemaHasRules(_,e.RULES.all)){l.schema=_,l.schemaPath=e.schemaPath+".additionalItems",l.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+f+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" } } ",u&&(i+=" if ("+m+") { ",d+="}")}}else if(e.util.schemaHasRules(o,e.RULES.all)){l.schema=o,l.schemaPath=s,l.errSchemaPath=c,i+=" for (var "+g+" = 0; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+d+" if ("+h+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],30:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="var division"+a+";if (",h&&(n+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),n+=" (division"+a+" = "+p+" / "+i+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var l=l||[];l.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var d=n;return n=l.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+d+"]); ":n+=" validate.errors = ["+d+"]; return false; ":n+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="errs__"+n,h=e.util.copy(e);h.level++;var l="valid"+h.level;if(e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+p+" = errors; ";var d,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(d=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,d&&(h.opts.allErrors=d),e.compositeRule=h.compositeRule=m,i+=" if ("+l+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var v=i;i=g.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ");return i}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="valid"+n,h="errs__"+n,l=e.util.copy(e),d="";l.level++;var m="valid"+l.level,g=l.baseId,v="prevValid"+n,b="passingSchemas"+n;i+="var "+h+" = errors , "+v+" = false , "+p+" = false , "+b+" = null; ";var y=e.compositeRule;e.compositeRule=l.compositeRule=!0;var _=o;if(_)for(var w,k=-1,x=_.length-1;k=e.opts.loopRequired,k=e.opts.ownProperties;if(u)if(i+=" var missing"+n+"; ",w){h||(i+=" var "+l+" = validate.schema"+s+"; ");var x="' + "+(P="schema"+n+"["+(E="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(_,P,e.opts.jsonPointers)),i+=" var "+p+" = true; ",h&&(i+=" if (schema"+n+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+n+")) "+p+" = false; else {"),i+=" for (var "+E+" = 0; "+E+" < "+l+".length; "+E+"++) { "+p+" = "+f+"["+l+"["+E+"]] !== undefined ",k&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", "+l+"["+E+"]) "),i+="; if (!"+p+") break; } ",h&&(i+=" } "),i+=" if (!"+p+") { ",(I=I||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+x+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var S=i;i=I.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var j=d;if(j)for(var E=-1,A=j.length-1;E 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(0<=d.indexOf("object")||0<=d.indexOf("array")))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var g="checkDataType"+(m?"s":"");n+=" if ("+e.util[g](d,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",l&&(n+=" } "),n+=" if (!"+h+") { ";var v=v||[];v.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var b=n;n=v.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { ")}else f&&(n+=" if (true) { ");return n}},{}],39:[function(e,t,r){"use strict";t.exports=function(i,e,t){var r="",n=!0===i.schema.$async,a=i.util.schemaHasRulesExcept(i.schema,i.RULES.all,"$ref"),o=i.self._getId(i.schema);if(i.isTop&&(r+=" var validate = ",n&&(i.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(i.opts.sourceCode||i.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof i.schema||!a&&!i.schema.$ref){e="false schema";var s=i.level,c=i.dataLevel,u=i.schema[e],f=i.schemaPath+i.util.getProperty(e),p=i.errSchemaPath+"/"+e,h=!i.opts.allErrors,l="data"+(c||""),d="valid"+s;if(!1===i.schema){i.isTop?h=!0:r+=" var "+d+" = false; ",(W=W||[]).push(r),r="",!1!==i.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(p)+" , params: {} ",!1!==i.opts.messages&&(r+=" , message: 'boolean schema is false' "),i.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+i.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var m=r;r=W.pop(),!i.compositeRule&&h?i.async?r+=" throw new ValidationError(["+m+"]); ":r+=" validate.errors = ["+m+"]; return false; ":r+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else i.isTop?r+=n?" return data; ":" validate.errors = null; return true; ":r+=" var "+d+" = true; ";return i.isTop&&(r+=" }; return validate; "),r}if(i.isTop){var g=i.isTop;s=i.level=0,c=i.dataLevel=0,l="data";i.rootId=i.resolve.fullPath(i.self._getId(i.root.schema)),i.baseId=i.baseId||i.rootId,delete i.isTop,i.dataPathArr=[void 0],r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{s=i.level,l="data"+((c=i.dataLevel)||"");if(o&&(i.baseId=i.resolve.url(i.baseId,o)),n&&!i.async)throw new Error("async schema in sync schema");r+=" var errs_"+s+" = errors;"}d="valid"+s,h=!i.opts.allErrors;var v="",b="",y=i.schema.type,_=Array.isArray(y);if(_&&1==y.length&&(y=y[0],_=!1),i.schema.$ref&&a){if("fail"==i.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+i.errSchemaPath+'" (see option extendRefs)');!0!==i.opts.extendRefs&&(a=!1,i.logger.warn('$ref: keywords ignored in schema at path "'+i.errSchemaPath+'"'))}if(i.schema.$comment&&i.opts.$comment&&(r+=" "+i.RULES.all.$comment.code(i,"$comment")),y){if(i.opts.coerceTypes)var w=i.util.coerceToTypes(i.opts.coerceTypes,y);var k=i.RULES.types[y];if(w||_||!0===k||k&&!Z(k)){f=i.schemaPath+".type",p=i.errSchemaPath+"/type",f=i.schemaPath+".type",p=i.errSchemaPath+"/type";var x=_?"checkDataTypes":"checkDataType";if(r+=" if ("+i.util[x](y,l,!0)+") { ",w){var S="dataType"+s,j="coerced"+s;r+=" var "+S+" = typeof "+l+"; ","array"==i.opts.coerceTypes&&(r+=" if ("+S+" == 'object' && Array.isArray("+l+")) "+S+" = 'array'; "),r+=" var "+j+" = undefined; ";var E="",A=w;if(A)for(var I,P=-1,O=A.length-1;P>6],n=0==(32&r);if(31==(31&r)){var a=r;for(r=0;128==(128&a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function p(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)o++;(n=new u(2+o))[0]=a,n[1]=128|o;s=1+o;for(var c=i.length;0>=8)n[s]=255&c;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new u(2*e.length),i=0;i>=7)n++}var o=new u(n),s=o.length-1;for(i=e.length-1;0<=i;i--){a=e[i];for(o[s--]=127&a;0<(a>>=7);)o[s--]=128|127&a}return this._createEncoderBuffer(o)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[c(i.getFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(i.getFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.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&&!u.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new u(r)}if(u.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new u(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var a=e;256<=a;a>>=8)i++;for(a=(n=new Array(i)).length-1;0<=a;a--)n[a]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new u(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var a=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),a.length!==n.defaultBuffer.length)return!1;for(i=0;i=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0===(t&=127))throw c("Indefinite length not supported");if(4this._size-i)return null;if(this._offset=i,0===this.length)return t?a.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?n:n.toString("utf8")},i.prototype.readOID=function(e){e||(e=s.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],i=0,n=0;n>0),r.join(".")},i.prototype._readTag=function(e){o.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw c("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(4this._size-r)return null;this._offset=r;for(var i=this._buf[this._offset],n=0,a=0;a>0},t.exports=i},{"./errors":60,"./types":63,assert:67,"safer-buffer":448}],63:[function(e,t,r){t.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},{}],64:[function(e,t,r){var n=e("assert"),a=e("safer-buffer").Buffer,o=e("./types"),i=e("./errors").newInvalidAsn1Error,s={size:1024,growthFactor:8};function c(e){var r,i;r=s,i=e||{},n.ok(r),n.equal(void 0===r?"undefined":_typeof(r),"object"),n.ok(i),n.equal(void 0===i?"undefined":_typeof(i),"object"),Object.getOwnPropertyNames(r).forEach(function(e){if(!i[e]){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,t)}}),e=i,this._buf=a.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw i(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},c.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=o.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&1 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;0>>24,e<<=8},c.prototype.writeNull=function(){this.writeByte(o.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=o.Enumeration),this.writeInt(e,t)},c.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=o.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},c.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+(void 0===e?"undefined":_typeof(e))+")");"number"!=typeof t&&(t=o.OctetString);var r=a.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},c.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!a.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},c.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(e){t.writeString(e)})},c.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=o.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),i=[];i.push(40*parseInt(r[0],10)+parseInt(r[1],10)),r.slice(2).forEach(function(e){var t,r;t=i,(r=parseInt(e,10))<128?t.push(r):(r<16384?t.push(r>>>7|128):(r<2097152?t.push(r>>>14|128):(r<268435456?t.push(r>>>21|128):(t.push(255&(r>>>28|128)),t.push(255&(r>>>21|128))),t.push(255&(r>>>14|128))),t.push(255&(r>>>7|128))),t.push(127&r))});var n=this;this._ensure(2+i.length),this.writeByte(t),this.writeLength(i.length),i.forEach(function(e){n.writeByte(e)})},c.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw i("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},c.prototype.startSequence=function(e){"number"!=typeof e&&(e=o.Sequence|o.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw i("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},c.prototype._shift=function(e,t,r){n.ok(void 0!==e),n.ok(void 0!==t),n.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},c.prototype._ensure=function(e){if(n.ok(e),this._size-this._offset>16&255,a[o++]=t>>8&255,a[o++]=255&t;var u,f;2===n&&(t=p[e.charCodeAt(c)]<<2|p[e.charCodeAt(c+1)]>>4,a[o++]=255&t);1===n&&(t=p[e.charCodeAt(c)]<<10|p[e.charCodeAt(c+1)]<<4|p[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],a=0,o=r-i;a>2]+s[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],p=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,a=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return a.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},{}],76:[function(e,t,r){"use strict";var y=e("tweetnacl").lowlevel.crypto_hash,s=0,c=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};function n(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}function u(e,t){var r,i=0;for(r=0;r<4;r++,s++)t<=s&&(s=0),i=i<<8|e[s];return i}c.prototype.encipher=function(e,t){void 0===t&&(t=new Uint8Array(e.buffer),0!==e.byteOffset&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=n(this.S,t,0)^this.P[r],e[0]^=n(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i},c.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);0!==e.byteOffset&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;0>>24,r[4*i+2]=a[i]>>>16,r[4*i+1]=a[i]>>>8,r[4*i+0]=a[i]}t.exports={BLOCKS:f,HASHSIZE:32,hash:_,pbkdf:function(e,t,r,i,n,a,o){var s,c,u,f,p,h,l=new Uint8Array(64),d=new Uint8Array(64),m=new Uint8Array(32),g=new Uint8Array(32),v=new Uint8Array(i+4),b=a;if(o<1)return-1;if(0===t||0===i||0===a||a>m.byteLength*m.byteLength||1<<20>>24,v[i+1]=h>>>16,v[i+2]=h>>>8,v[i+3]=h,y(d,v,i+4),_(l,d,g),s=m.byteLength;s--;)m[s]=g[s];for(s=1;sa[o]^r?1:-1;return c==u?0:u=t&&e<=r}function J(e){return"[object Array]"==Object.prototype.toString.call(e)}function Q(e,t,r){for(var i,n,a=[0],o=0,s=e.length;or-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}function ee(e,t){return(1(r=e.length)){for(i="0",t-=r;--t;i+="0");e+=i}else tt;)u[n]=0,n||(++a,u.unshift(1));for(o=u.length;!u[--o];);for(p=0,e="";p<=o;e+=U.charAt(u[p++]));e=te(e,a)}return e}function P(e,t,r,i){var n,a,o,s,c;if(r=null!=r&&k(r,0,8,i,q)?0|r:b,!e.c)return e.toString();if(n=e.c[0],o=e.e,null==t)c=Z(e.c),c=19==i||24==i&&o<=h?ee(c,o):te(c,o);else if(a=(e=C(new I(e),t,r)).e,s=(c=Z(e.c)).length,19==i||24==i&&(t<=a||a<=h)){for(;sy?e.c=e.e=null:e.c=r=p.length){if(!i)break e;for(;p.length<=u;p.push(0));c=f=0,o=(a%=K)-K+(n=1)}else{for(c=s=p[u],n=1;10<=s;s/=10,n++);f=(o=(a%=K)-K+n)<0?0:c/h[n-o-1]%10|0}if(i=i||t<0||null!=p[u+1]||(o<0?c:c%h[n-o-1]),i=r<4?(f||i)&&(0==r||r==(e.s<0?3:2)):5y?e.c=e.e=null:e.er)return null!=(e=n[r++])};return o(t="DECIMAL_PLACES")&&k(e,0,$,2,t)&&(d=0|e),i[t]=d,o(t="ROUNDING_MODE")&&k(e,0,8,2,t)&&(b=0|e),i[t]=b,o(t="EXPONENTIAL_AT")&&(J(e)?k(e[0],-$,0,2,t)&&k(e[1],0,$,2,t)&&(h=0|e[0],l=0|e[1]):k(e,-$,$,2,t)&&(h=-(l=0|(e<0?-e:e)))),i[t]=[h,l],o(t="RANGE")&&(J(e)?k(e[0],-$,-1,2,t)&&k(e[1],1,$,2,t)&&(m=0|e[0],y=0|e[1]):k(e,-$,$,2,t)&&(0|e?m=-(y=0|(e<0?-e:e)):w&&B(2,t+" cannot be zero",e))),i[t]=[m,y],o(t="ERRORS")&&(e===!!e||1===e||0===e?(_=0,k=(w=!!e)?O:X):w&&B(2,t+D,e)),i[t]=w,o(t="CRYPTO")&&(e===!!e||1===e||0===e?(x=!(!e||!F||"object"!=(void 0===F?"undefined":_typeof(F))),e&&!x&&w&&B(2,"crypto unavailable",F)):w&&B(2,t+D,e)),i[t]=x,o(t="MODULO_MODE")&&k(e,0,9,2,t)&&(S=0|e),i[t]=S,o(t="POW_PRECISION")&&k(e,0,$,2,t)&&(j=0|e),i[t]=j,o(t="FORMAT")&&("object"==(void 0===e?"undefined":_typeof(e))?E=e:w&&B(2,t+" not an object",e)),i[t]=E,i},I.max=function(){return n(arguments,i.lt)},I.min=function(){return n(arguments,i.gt)},I.random=(r=9007199254740992,u=Math.random()*r&2097151?function(){return N(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,n,a,o=0,s=[],c=new I(v);if(e=null!=e&&k(e,0,$,14)?0|e:d,n=M(e/K),x)if(F&&F.getRandomValues){for(t=F.getRandomValues(new Uint32Array(n*=2));o>>11))?(r=F.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(s.push(a%1e14),o+=2);o=n/2}else if(F&&F.randomBytes){for(t=F.randomBytes(n*=7);ot[n]?1:-1;break}return a}function A(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r](x[s]||0)&&o--,k<0)l.push(1),c=!0;else{for(b=x.length,_=S.length,k+=2,1<(u=N(n/(S[s=0]+1)))&&(S=j(S,u,n),x=j(x,u,n),_=S.length,b=x.length),v=_,m=(d=x.slice(0,_)).length;m<_;d[m++]=0);(w=S.slice()).unshift(0),y=S[0],S[1]>=n/2&&y++;do{if(u=0,(a=E(S,d,_,m))<0){if(g=d[0],_!=m&&(g=g*n+(d[1]||0)),1<(u=N(g/y)))for(n<=u&&(u=n-1),p=(f=j(S,u,n)).length,m=d.length;1==E(f,d,p,m);)u--,A(f,_this.c.length-2},i.isNaN=function(){return!this.s},i.isNegative=i.isNeg=function(){return this.s<0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.lessThan=i.lt=function(e,t){return _=8,Y(this,new I(e,t))<0},i.lessThanOrEqualTo=i.lte=function(e,t){return _=9,-1===(t=Y(this,new I(e,t)))||0===t},i.minus=i.sub=function(e,t){var r,i,n,a,o=this,s=o.s;if(_=10,t=(e=new I(e,t)).s,!s||!t)return new I(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/K,u=e.e/K,f=o.c,p=e.c;if(!c||!u){if(!f||!p)return f?(e.s=-t,e):new I(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new I(f[0]?o:3==b?-0:0)}if(c=W(c),u=W(u),f=f.slice(),s=c-u){for((n=(a=s<0)?(s=-s,f):(u=c,p)).reverse(),t=s;t--;n.push(0));n.reverse()}else for(i=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;tt&&(t=this.e+1),t},i.round=function(e,t){var r=new I(this);return(null==e||k(e,0,$,15))&&C(r,~~e+this.e+1,null!=t&&k(t,0,8,15,q)?0|t:b),r},i.shift=function(e){var t=this;return k(e,-a,a,16,"argument")?t.times("1e"+re(e)):new I(t.c&&t.c[0]&&(e<-a||at&&(r.c.length=t)}if(!(i=N(i/2)))break;n=n.times(n),t&&n.c&&n.c.length>t&&(n.c.length=t)}return e<0&&(r=v.div(r)),t?C(r,j,b):r},i.toPrecision=function(e,t){return P(this,null!=e&&k(e,1,$,24,"precision")?0|e:null,t,24)},i.toString=function(e){var t,r=this.s,i=this.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=Z(this.c),t=null!=e&&k(e,2,64,25,"base")?A(te(t,i),0|e,10,r):i<=h||l<=i?ee(t,i):te(t,i),r<0&&this.c[0]&&(t="-"+t)),t},i.truncated=i.trunc=function(){return C(new I(this),this.e+1,1)},i.valueOf=i.toJSON=function(){return this.toString()},null!=t&&I.config(t),I}(),"function"==typeof define&&define.amd)define(function(){return t});else if(void 0!==i&&i.exports){if(i.exports=t,!F)try{F=r("crypto")}catch(e){}}else e.BigNumber=t}(this)},{crypto:204}],78:[function(i,n,e){(function(e,t){"use strict";var r=n.exports;r.version="v"+i("./package.json").version,r.versionGuard=function(e){if(void 0!==e){throw new Error("More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.")}},r.versionGuard(e._bitcore),e._bitcore=r.version,r.crypto={},r.crypto.BN=i("./lib/crypto/bn"),r.crypto.ECDSA=i("./lib/crypto/ecdsa"),r.crypto.Hash=i("./lib/crypto/hash"),r.crypto.Random=i("./lib/crypto/random"),r.crypto.Point=i("./lib/crypto/point"),r.crypto.Signature=i("./lib/crypto/signature"),r.encoding={},r.encoding.Base58=i("./lib/encoding/base58"),r.encoding.Base58Check=i("./lib/encoding/base58check"),r.encoding.BufferReader=i("./lib/encoding/bufferreader"),r.encoding.BufferWriter=i("./lib/encoding/bufferwriter"),r.encoding.Varint=i("./lib/encoding/varint"),r.util={},r.util.buffer=i("./lib/util/buffer"),r.util.js=i("./lib/util/js"),r.util.preconditions=i("./lib/util/preconditions"),r.errors=i("./lib/errors"),r.Address=i("./lib/address"),r.Block=i("./lib/block"),r.MerkleBlock=i("./lib/block/merkleblock"),r.BlockHeader=i("./lib/block/blockheader"),r.HDPrivateKey=i("./lib/hdprivatekey.js"),r.HDPublicKey=i("./lib/hdpublickey.js"),r.Networks=i("./lib/networks"),r.Opcode=i("./lib/opcode"),r.PrivateKey=i("./lib/privatekey"),r.PublicKey=i("./lib/publickey"),r.Script=i("./lib/script"),r.Transaction=i("./lib/transaction"),r.URI=i("./lib/uri"),r.Unit=i("./lib/unit"),r.deps={},r.deps.bnjs=i("bn.js"),r.deps.bs58=i("bs58"),r.deps.Buffer=t,r.deps.elliptic=i("elliptic"),r.deps._=i("lodash"),r._HDKeyCache=i("./lib/hdkeycache"),r.Transaction.sighash=i("./lib/transaction/sighash")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i("buffer").Buffer)},{"./lib/address":79,"./lib/block":82,"./lib/block/blockheader":81,"./lib/block/merkleblock":83,"./lib/crypto/bn":84,"./lib/crypto/ecdsa":85,"./lib/crypto/hash":86,"./lib/crypto/point":87,"./lib/crypto/random":88,"./lib/crypto/signature":89,"./lib/encoding/base58":90,"./lib/encoding/base58check":91,"./lib/encoding/bufferreader":92,"./lib/encoding/bufferwriter":93,"./lib/encoding/varint":94,"./lib/errors":95,"./lib/hdkeycache":97,"./lib/hdprivatekey.js":98,"./lib/hdpublickey.js":99,"./lib/networks":100,"./lib/opcode":101,"./lib/privatekey":102,"./lib/publickey":103,"./lib/script":104,"./lib/transaction":107,"./lib/transaction/sighash":115,"./lib/unit":119,"./lib/uri":120,"./lib/util/buffer":121,"./lib/util/js":122,"./lib/util/preconditions":123,"./package.json":150,"bn.js":124,bs58:125,buffer:191,elliptic:127,lodash:149}],79:[function(e,t,r){(function(a){"use strict";var n=e("lodash"),o=e("./util/preconditions"),i=e("./errors"),s=e("./encoding/base58check"),c=e("./networks"),r=e("./crypto/hash"),u=e("./util/js"),f=e("./publickey");function p(e,t,r){if(!(this instanceof p))return new p(e,t,r);if(n.isArray(e)&&n.isNumber(t))return p.createMultisig(e,t,r);if(e instanceof p)return e;if(o.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!c.get(t))throw new TypeError('Second argument must be "livenet" or "testnet".');if(r&&r!==p.PayToPublicKeyHash&&r!==p.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||c.get(t)||c.defaultNetwork,i.type=i.type||r||p.PayToPublicKeyHash,u.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}p.prototype._classifyArguments=function(e,t,r){if((e instanceof a||e instanceof Uint8Array)&&20===e.length)return p._transformHash(e);if((e instanceof a||e instanceof Uint8Array)&&21===e.length)return p._transformBuffer(e,t,r);if(e instanceof f)return p._transformPublicKey(e);if(e instanceof h)return p._transformScript(e,t);if("string"==typeof e)return p._transformString(e,t,r);if(n.isObject(e))return p._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")},p.PayToPublicKeyHash="pubkeyhash",p.PayToScriptHash="scripthash",p._transformHash=function(e){var t={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==e.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t},p._transformObject=function(e){return o.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),o.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?new a(e.hash,"hex"):e.hashBuffer,network:c.get(e.network)||c.defaultNetwork,type:e.type}},p._classifyFromVersion=function(e){var t={},r=c.get(e[0],"pubkeyhash"),i=c.get(e[0],"scripthash");return r?(t.network=r,t.type=p.PayToPublicKeyHash):i&&(t.network=i,t.type=p.PayToScriptHash),t},p._transformBuffer=function(e,t,r){var i={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==e.length)throw new TypeError("Address buffers must be exactly 21 bytes.");t=c.get(t);var n=p._classifyFromVersion(e);if(!n.network||t&&t!==n.network)throw new TypeError("Address has mismatched network type.");if(!n.type||r&&r!==n.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=n.network,i.type=n.type,i},p._transformPublicKey=function(e){var t={};if(!(e instanceof f))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=r.sha256ripemd160(e.toBuffer()),t.type=p.PayToPublicKeyHash,t},p._transformScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new i.Script.CantDeriveAddress(e);return r},p.createMultisig=function(e,t,r){return r=r||e[0].network||c.defaultNetwork,p.payingTo(h.buildMultisigOut(e,t),r)},p._transformString=function(e,t,r){if("string"!=typeof e)throw new TypeError("data parameter supplied is not a string.");e=e.trim();var i=s.decode(e);return p._transformBuffer(i,t,r)},p.fromPublicKey=function(e,t){var r=p._transformPublicKey(e);return t=t||c.defaultNetwork,new p(r.hashBuffer,t,r.type)},p.fromPublicKeyHash=function(e,t){return new p(p._transformHash(e).hashBuffer,t,p.PayToPublicKeyHash)},p.fromScriptHash=function(e,t){return o.checkArgument(e,"hash parameter is required"),new p(p._transformHash(e).hashBuffer,t,p.PayToScriptHash)},p.payingTo=function(e,t){return o.checkArgument(e,"script is required"),o.checkArgument(e instanceof h,"script must be instance of Script"),p.fromScriptHash(r.sha256ripemd160(e.toBuffer()),t)},p.fromScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=p._transformScript(e,t);return new p(r.hashBuffer,t,r.type)},p.fromBuffer=function(e,t,r){var i=p._transformBuffer(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromString=function(e,t,r){var i=p._transformString(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromObject=function(e){return o.checkState(u.isHexa(e.hash),'Unexpected hash property, "'+e.hash+'", expected to be hex.'),new p(new a(e.hash,"hex"),e.network,e.type)},p.getValidationError=function(e,t,r){var i;try{new p(e,t,r)}catch(e){i=e}return i},p.isValid=function(e,t,r){return!p.getValidationError(e,t,r)},p.prototype.isPayToPublicKeyHash=function(){return this.type===p.PayToPublicKeyHash},p.prototype.isPayToScriptHash=function(){return this.type===p.PayToScriptHash},p.prototype.toBuffer=function(){var e=new a([this.network[this.type]]);return a.concat([e,this.hashBuffer])},p.prototype.toObject=p.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},p.prototype.toString=function(){return s.encode(this.toBuffer())},p.prototype.inspect=function(){return""},t.exports=p;var h=e("./script")}).call(this,e("buffer").Buffer)},{"./crypto/hash":86,"./encoding/base58check":91,"./errors":95,"./networks":100,"./publickey":103,"./script":104,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],80:[function(t,l,e){(function(o){"use strict";var r=t("lodash"),n=t("./blockheader"),i=t("../crypto/bn"),a=t("../util/buffer"),s=t("../encoding/bufferreader"),c=t("../encoding/bufferwriter"),u=t("../crypto/hash"),f=t("../transaction"),p=t("../util/preconditions");function h(e){return this instanceof h?(r.extend(this,h._from(e)),this):new h(e)}h.MAX_BLOCK_SIZE=1e6,h._from=function(e){var t={};if(a.isBuffer(e))t=h._fromBufferReader(s(e));else{if(!r.isObject(e))throw new TypeError("Unrecognized argument for Block");t=h._fromObject(e)}return t},h._fromObject=function(e){var t=[];return e.transactions.forEach(function(e){e instanceof f?t.push(e):t.push(f().fromObject(e))}),{header:n.fromObject(e.header),transactions:t}},h.fromObject=function(e){return new h(h._fromObject(e))},h._fromBufferReader=function(e){var t={};p.checkState(!e.finished(),"No block data received"),t.header=n.fromBufferReader(e);var r=e.readVarintNum();t.transactions=[];for(var i=0;i"},h.Values={START_OF_BLOCK:8,NULL_HASH:new o("0000000000000000000000000000000000000000000000000000000000000000","hex")},l.exports=h}).call(this,t("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../transaction":107,"../util/buffer":121,"../util/preconditions":123,"./blockheader":81,buffer:191,lodash:149}],81:[function(f,p,e){(function(i){"use strict";var n=f("lodash"),a=f("../crypto/bn"),o=f("../util/buffer"),s=f("../encoding/bufferreader"),t=f("../encoding/bufferwriter"),r=f("../crypto/hash"),c=(f("../util/js"),f("../util/preconditions")),u=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&c.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};u._from=function(e){var t={};if(o.isBuffer(e))t=u._fromBufferReader(s(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for BlockHeader");t=u._fromObject(e)}return t},u._fromObject=function(e){c.checkArgument(e,"data is required");var t=e.prevHash,r=e.merkleRoot;return n.isString(e.prevHash)&&(t=o.reverse(new i(e.prevHash,"hex"))),n.isString(e.merkleRoot)&&(r=o.reverse(new i(e.merkleRoot,"hex"))),{hash:e.hash,version:e.version,prevHash:t,merkleRoot:r,time:e.time,timestamp:e.time,bits:e.bits,nonce:e.nonce}},u.fromObject=function(e){var t=u._fromObject(e);return new u(t)},u.fromRawBlock=function(e){o.isBuffer(e)||(e=new i(e,"binary"));var t=s(e);t.pos=u.Constants.START_OF_HEADER;var r=u._fromBufferReader(t);return new u(r)},u.fromBuffer=function(e){var t=u._fromBufferReader(s(e));return new u(t)},u.fromString=function(e){var t=new i(e,"hex");return u.fromBuffer(t)},u._fromBufferReader=function(e){var t={};return t.version=e.readUInt32LE(),t.prevHash=e.read(32),t.merkleRoot=e.read(32),t.time=e.readUInt32LE(),t.bits=e.readUInt32LE(),t.nonce=e.readUInt32LE(),t},u.fromBufferReader=function(e){var t=u._fromBufferReader(e);return new u(t)},u.prototype.toObject=u.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:o.reverse(this.prevHash).toString("hex"),merkleRoot:o.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},u.prototype.toBuffer=function(){return this.toBufferWriter().concat()},u.prototype.toString=function(){return this.toBuffer().toString("hex")},u.prototype.toBufferWriter=function(e){return e||(e=new t),e.writeUInt32LE(this.version),e.write(this.prevHash),e.write(this.merkleRoot),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e},u.prototype.getTargetDifficulty=function(e){e=e||this.bits;for(var t=new a(16777215&e),r=8*((e>>>24)-3);0e+u.Constants.MAX_TIME_OFFSET)},u.prototype.validProofOfWork=function(){var e=new a(this.id,"hex"),t=this.getTargetDifficulty();return!(0"},u.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new a("10000000000000000000000000000000000000000000000000000000000000000","hex")},p.exports=u}).call(this,f("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],82:[function(e,t,r){t.exports=e("./block"),t.exports.BlockHeader=e("./blockheader"),t.exports.MerkleBlock=e("./merkleblock")},{"./block":80,"./blockheader":81,"./merkleblock":83}],83:[function(e,t,r){(function(s){"use strict";var n=e("lodash"),a=e("./blockheader"),o=e("../util/buffer"),r=e("../encoding/bufferreader"),i=e("../encoding/bufferwriter"),c=e("../crypto/hash"),u=(e("../util/js"),e("../transaction")),f=e("../util/preconditions");function p(e){if(!(this instanceof p))return new p(e);var t={};if(o.isBuffer(e))t=p._fromBufferReader(r(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for MerkleBlock");t={header:e.header instanceof a?e.header:a.fromObject(e.header),numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}return n.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}p.fromBuffer=function(e){return p.fromBufferReader(r(e))},p.fromBufferReader=function(e){return new p(p._fromBufferReader(e))},p.prototype.toBuffer=function(){return this.toBufferWriter().concat()},p.prototype.toBufferWriter=function(e){e||(e=new i),e.write(this.header.toBuffer()),e.writeUInt32LE(this.numTransactions),e.writeVarintNum(this.hashes.length);for(var t=0;tthis.numTransactions)return!1;if(8*this.flags.length8*this.flags.length)return null;var i=this.flags[r.flagBitsUsed>>3]>>>(7&r.flagBitsUsed++)&1;if(0!==e&&i){var n=this._traverseMerkleTree(e-1,2*t,r),a=n;return 2*t+1=this.hashes.length)return null;var o=this.hashes[r.hashesUsed++];return 0===e&&i&&r.txs.push(o),new s(o,"hex")},p.prototype._calcTreeWidth=function(e){return this.numTransactions+(1<>e},p.prototype._calcTreeHeight=function(){for(var e=0;1e.size?t=n.trim(t,i):i>1,o=d.getN(),s=d.getG(),c=a?r.add(o):r,u=d.fromX(n,c);if(!u.mul(o).isInfinity())throw new Error("nR is not a valid curve point");var f=t.neg().mod(o),p=r.invm(o),h=u.mul(i).add(s.mul(f)).mul(p);return m.fromPoint(h,this.sig.compressed)},h.prototype.sigError=function(){if(!f.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s;if(!(e.gt(l.Zero)&&e.lt(d.getN())&&t.gt(l.Zero)&&t.lt(d.getN())))return"r and s not in range";var r=l.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),i=d.getN(),n=t.invm(i),a=n.mul(r).mod(i),o=n.mul(e).mod(i),s=d.getG().mulAdd(a,this.pubkey.point,o);return s.isInfinity()?"p is infinity":0!==s.getX().mod(i).cmp(e)&&"Invalid signature"},h.toLowS=function(e){return e.gt(l.fromBuffer(new c("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=d.getN().sub(e)),e},h.prototype._findSignature=function(e,t){for(var r,i,n,a=d.getN(),o=d.getG(),s=0;(!this.k||0i)r=e(r);else if(r>>=8)}return r},e.exports=r}).call(this,i("_process"),i("buffer").Buffer)},{_process:382,buffer:191,crypto:204}],89:[function(e,r,t){(function(u){"use strict";var g=e("./bn"),v=e("lodash"),b=e("../util/preconditions"),y=e("../util/buffer"),t=e("../util/js"),o=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof g)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};o.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=void 0!==e.i?e.i:this.i,this.compressed=void 0!==e.compressed?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this},o.fromCompact=function(e){b.checkArgument(y.isBuffer(e),"Argument is expected to be a Buffer");var t=new o,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i+=4);var n=e.slice(1,33),a=e.slice(33,65);return b.checkArgument(0===i||1===i||2===i||3===i,new Error("i must be 0, 1, 2, or 3")),b.checkArgument(32===n.length,new Error("r must be 32 bytes")),b.checkArgument(32===a.length,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=g.fromBuffer(n),t.s=g.fromBuffer(a),t},o.fromDER=o.fromBuffer=function(e,t){var r=o.parseDER(e,t),i=new o;return i.r=r.r,i.s=r.s,i},o.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=new o.fromDER(r,!1);return i.nhashtype=t,i},o.fromString=function(e){var t=new u(e,"hex");return o.fromDER(t)},o.parseDER=function(e,t){b.checkArgument(y.isBuffer(e),new Error("DER formatted signature should be a buffer")),v.isUndefined(t)&&(t=!0);var r=e[0];b.checkArgument(48===r,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;b.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(2!==e[2])return!1;if(0===t)return!1;if(128&i[0])return!1;if(1=this.buf.length},e.prototype.read=function(e){r.checkArgument(!n.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t},e.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e},e.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e},e.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=o.fromBuffer(e);return this.pos=this.pos+8,t},e.prototype.readUInt64LEBN=function(){var e,t=this.buf.readUInt32LE(this.pos),r=4294967296*this.buf.readUInt32LE(this.pos+4)+t;if(r<=9007199254740991)e=new o(r);else{var i=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);e=new o(i,10,"le")}return this.pos=this.pos+8,e},e.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN().toNumber();if(t<=Math.pow(2,53))return t;throw new Error("number too large to retain precision - use readVarintBN");default:return e}},e.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return r.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t},e.prototype.readVarintBuf=function(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},e.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new o(this.readUInt16LE());case 254:return new o(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new o(e)}},e.prototype.reverse=function(){for(var e=new i(this.buf.length),t=0;t"},k.prototype.toObject=k.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:_.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},k.fromBuffer=function(e){return new k(e.toString())},k.prototype.toBuffer=function(){return _.copy(this._buffers.xprivkey)},k.DefaultDepth=0,k.DefaultFingerprint=0,k.DefaultChildIndex=0,k.MaxIndex=2*(k.Hardened=2147483648),k.RootElementAlias=["m","M","m'","M'"],k.VersionSize=4,k.DepthSize=1,k.ParentFingerPrintSize=4,k.ChildIndexSize=4,k.ChainCodeSize=32,k.PrivateKeySize=32,k.CheckSumSize=4,k.DataLength=78,k.SerializedByteSize=82,n((k.ChecksumEnd=(k.ChecksumStart=k.PrivateKeyEnd=(k.PrivateKeyStart=(k.ChainCodeEnd=(k.ChainCodeStart=k.ChildIndexEnd=(k.ChildIndexStart=k.ParentFingerPrintEnd=(k.ParentFingerPrintStart=k.DepthEnd=(k.DepthStart=k.VersionEnd=(k.VersionStart=0)+k.VersionSize)+k.DepthSize)+k.ParentFingerPrintSize)+k.ChildIndexSize)+k.ChainCodeSize)+1)+k.PrivateKeySize)+k.CheckSumSize)===k.SerializedByteSize),e.exports=k}).call(this,o("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./crypto/random":88,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdpublickey":99,"./networks":100,"./privatekey":102,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],99:[function(i,s,e){(function(u){"use strict";var n=i("lodash"),t=i("./util/preconditions"),f=i("./crypto/bn"),a=i("./encoding/base58"),p=i("./encoding/base58check"),h=i("./crypto/hash"),r=i("./hdprivatekey"),l=i("./hdkeycache"),d=i("./networks"),m=i("./crypto/point"),g=i("./publickey"),e=i("./errors"),v=e,b=e.HDPublicKey,o=i("assert"),y=i("./util/js"),_=i("./util/buffer");function w(e){if(e instanceof w)return e;if(!(this instanceof w))return new w(e);if(e){if(n.isString(e)||_.isBuffer(e)){var t=w.getSerializedError(e);if(t){if(_.isBuffer(e)&&!w.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof b.ArgumentIsPrivateExtended)return new r(e).hdPublicKey;throw t}return this._buildFromSerialized(e)}if(n.isObject(e))return e instanceof r?this._buildFromPrivate(e):this._buildFromObject(e);throw new b.UnrecognizedArgument(e)}throw new b.MustSupplyArgument}w.isValidPath=function(e){if(n.isString(e)){var t=r._getDerivationIndexes(e);return null!==t&&n.all(t,w.isValidPath)}return!!n.isNumber(e)&&(0<=e&&e"},w.prototype.toObject=w.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version)).name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:_.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},w.fromBuffer=function(e){return new w(e)},w.prototype.toBuffer=function(){return _.copy(this._buffers.xpubkey)},w.Hardened=2147483648,w.RootElementAlias=["m","M"],w.VersionSize=4,w.DepthSize=1,w.ParentFingerPrintSize=4,w.ChildIndexSize=4,w.ChainCodeSize=32,w.PublicKeySize=33,w.CheckSumSize=4,w.DataSize=78,w.SerializedByteSize=82,w.ChecksumEnd=(w.ChecksumStart=w.PublicKeyEnd=(w.PublicKeyStart=w.ChainCodeEnd=(w.ChainCodeStart=w.ChildIndexEnd=(w.ChildIndexStart=w.ParentFingerPrintEnd=(w.ParentFingerPrintStart=w.DepthEnd=(w.DepthStart=w.VersionEnd=(w.VersionStart=0)+w.VersionSize)+w.DepthSize)+w.ParentFingerPrintSize)+w.ChildIndexSize)+w.ChainCodeSize)+w.PublicKeySize)+w.CheckSumSize,o(w.PublicKeyEnd===w.DataSize),o(w.ChecksumEnd===w.SerializedByteSize),s.exports=w}).call(this,i("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdprivatekey":98,"./networks":100,"./publickey":103,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],100:[function(e,t,r){"use strict";var n=e("lodash"),i=e("./util/buffer"),a=e("./util/js"),o=[],s={};function c(){}function u(t,e){if(~o.indexOf(t))return t;if(!e)return s[t];n.isArray(e)||(e=[e]);var r=function(e){return o[i][e]===t};for(var i in o)if(n.any(e,r))return o[i]}function f(e){var t=new c;return a.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey}),e.networkMagic&&a.defineImmutable(t,{networkMagic:i.integerAsBuffer(e.networkMagic)}),e.port&&a.defineImmutable(t,{port:e.port}),e.dnsSeeds&&a.defineImmutable(t,{dnsSeeds:e.dnsSeeds}),n.each(t,function(e){n.isUndefined(e)||n.isObject(e)||(s[e]=t)}),o.push(t),t}c.prototype.toString=function(){return this.name},f({name:"livenet",alias:"mainnet",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var p=u("livenet");f({name:"testnet",alias:"regtest",pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956});var h=u("testnet"),l={PORT:18333,NETWORK_MAGIC:i.integerAsBuffer(185665799),DNS_SEEDS:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]};for(var d in l)n.isObject(l[d])||(s[l[d]]=h);var m={PORT:18444,NETWORK_MAGIC:i.integerAsBuffer(4206867930),DNS_SEEDS:[]};for(var d in m)n.isObject(m[d])||(s[m[d]]=h);Object.defineProperty(h,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.PORT:l.PORT}}),Object.defineProperty(h,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.NETWORK_MAGIC:l.NETWORK_MAGIC}}),Object.defineProperty(h,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.DNS_SEEDS:l.DNS_SEEDS}}),t.exports={add:f,remove:function(e){for(var t=0;t=a.map.OP_1&&e<=a.map.OP_16},a.prototype.inspect=function(){return""},c.exports=a}).call(this,s("buffer").Buffer)},{"./util/buffer":121,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],102:[function(h,l,e){(function(i){"use strict";var n=h("lodash"),r=h("./address"),a=h("./encoding/base58check"),o=h("./crypto/bn"),s=h("./util/js"),c=h("./networks"),u=h("./crypto/point"),e=h("./publickey"),f=h("./crypto/random"),t=h("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(e instanceof p)return e;var r=this._classifyArguments(e,t);if(!r.bn||0===r.bn.cmp(new o(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(u.getN()))throw new TypeError("Number must be less than N");if(void 0===r.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return s.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}p.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?c.get(t):c.defaultNetwork};if(n.isUndefined(e)||n.isNull(e))r.bn=p._getRandomBN();else if(e instanceof o)r.bn=e;else if(e instanceof i||e instanceof Uint8Array)r=p._transformBuffer(e,t);else if(e.bn&&e.network)r=p._transformObject(e);else if(!t&&c.get(e))r.bn=p._getRandomBN(),r.network=c.get(e);else{if("string"!=typeof e)throw new TypeError("First argument is an unrecognized data type.");s.isHexa(e)?r.bn=new o(new i(e,"hex")):r=p._transformWIF(e,t)}return r},p._getRandomBN=function(){var e,t;do{var r=f.getRandomBuffer(32);e=(t=o.fromBuffer(r)).lt(u.getN())}while(!e);return t},p._transformBuffer=function(e,t){var r={};if(32===e.length)return p._transformBNBuffer(e,t);if(r.network=c.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==c.get(t))throw new TypeError("Private key network mismatch");if(34===e.length&&1===e[33])r.compressed=!0;else{if(33!==e.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");r.compressed=!1}return r.bn=o.fromBuffer(e.slice(1,33)),r},p._transformBNBuffer=function(e,t){var r={};return r.network=c.get(t)||c.defaultNetwork,r.bn=o.fromBuffer(e),r.compressed=!1,r},p._transformWIF=function(e,t){return p._transformBuffer(a.decode(e),t)},p.fromBuffer=function(e,t){return new p(e,t)},p._transformObject=function(e){return{bn:new o(e.bn,"hex"),network:c.get(e.network),compressed:e.compressed}},p.fromString=p.fromWIF=function(e){return t.checkArgument(n.isString(e),"First argument is expected to be a string."),new p(e)},p.fromObject=function(e){return t.checkArgument(n.isObject(e),"First argument is expected to be an object."),new p(e)},p.fromRandom=function(e){return new p(p._getRandomBN(),e)},p.getValidationError=function(e,t){var r;try{new p(e,t)}catch(e){r=e}return r},p.isValid=function(e,t){return!!e&&!p.getValidationError(e,t)},p.prototype.toString=function(){return this.toBuffer().toString("hex")},p.prototype.toWIF=function(){var e,t=this.network;return e=this.compressed?i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32}),new i([1])]):i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32})]),a.encode(e)},p.prototype.toBigNumber=function(){return this.bn},p.prototype.toBuffer=function(){return this.bn.toBuffer()},p.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=e.fromPrivateKey(this)),this._pubkey},p.prototype.toAddress=function(e){var t=this.toPublicKey();return r.fromPublicKey(t,e||this.network)},p.prototype.toObject=p.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},p.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return""},l.exports=p}).call(this,h("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/point":87,"./crypto/random":88,"./encoding/base58check":91,"./networks":100,"./publickey":103,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],103:[function(t,r,e){(function(o){"use strict";var s=t("./crypto/bn"),c=t("./crypto/point"),e=t("./crypto/hash"),i=t("./util/js"),n=t("./networks"),u=t("lodash"),f=t("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(f.checkArgument(e,"First argument is required, please include public key data."),e instanceof p)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),i.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||n.defaultNetwork}),this}p.prototype._classifyArgs=function(e,t){var r={compressed:u.isUndefined(t.compressed)||t.compressed};if(e instanceof c)r.point=e;else if(e.x&&e.y)r=p._transformObject(e);else if("string"==typeof e)r=p._transformDER(new o(e,"hex"));else if(p._isBuffer(e))r=p._transformDER(e);else{if(!p._isPrivateKey(e))throw new TypeError("First argument is an unrecognized data format.");r=p._transformPrivateKey(e)}return r.network||(r.network=u.isUndefined(t.network)?void 0:n.get(t.network)),r},p._isPrivateKey=function(e){return e instanceof t("./privatekey")},p._isBuffer=function(e){return e instanceof o||e instanceof Uint8Array},p._transformPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=c.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t},p._transformDER=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r,i,n,a,o={};if(t=!!u.isUndefined(t)||t,4!==e[0]&&(t||6!==e[0]&&7!==e[0]))if(3===e[0])n=e.slice(1),r=new s(n),(o=p._transformX(!0,r)).compressed=!0;else{if(2!==e[0])throw new TypeError("Invalid DER format public key");n=e.slice(1),r=new s(n),(o=p._transformX(!1,r)).compressed=!0}else{if(n=e.slice(1,33),a=e.slice(33,65),32!==n.length||32!==a.length||65!==e.length)throw new TypeError("Length of x and y must be 32 bytes");r=new s(n),i=new s(a),o.point=new c(r,i),o.compressed=!1}return o},p._transformX=function(e,t){f.checkArgument("boolean"==typeof e,"Must specify whether y is odd or not (true or false)");var r={};return r.point=c.fromX(e,t),r},p._transformObject=function(e){var t=new s(e.x,"hex"),r=new s(e.y,"hex");return new p(new c(t,r),{compressed:e.compressed})},p.fromPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t=p._transformPrivateKey(e);return new p(t.point,{compressed:t.compressed,network:t.network})},p.fromDER=p.fromBuffer=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r=p._transformDER(e,t);return new p(r.point,{compressed:r.compressed})},p.fromPoint=function(e,t){return f.checkArgument(e instanceof c,"First argument must be an instance of Point."),new p(e,{compressed:t})},p.fromString=function(e,t){var r=new o(e,t||"hex"),i=p._transformDER(r);return new p(i.point,{compressed:i.compressed})},p.fromX=function(e,t){var r=p._transformX(e,t);return new p(r.point,{compressed:r.compressed})},p.getValidationError=function(e){var t;try{new p(e)}catch(e){t=e}return t},p.isValid=function(e){return!p.getValidationError(e)},p.prototype.toObject=p.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},p.prototype.toBuffer=p.prototype.toDER=function(){var e,t=this.point.getX(),r=this.point.getY(),i=t.toBuffer({size:32}),n=r.toBuffer({size:32});if(this.compressed){var a=n[n.length-1]%2;return e=new o(a?[3]:[2]),o.concat([e,i])}return e=new o([4]),o.concat([e,i,n])},p.prototype._getID=function(){return e.sha256ripemd160(this.toBuffer())},p.prototype.toAddress=function(e){return t("./address").fromPublicKey(this,e||this.network)},p.prototype.toString=function(){return this.toDER().toString("hex")},p.prototype.inspect=function(){return""},r.exports=p}).call(this,t("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./networks":100,"./privatekey":102,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],104:[function(e,t,r){t.exports=e("./script"),t.exports.Interpreter=e("./interpreter")},{"./interpreter":105,"./script":106}],105:[function(p,t,e){(function(e){"use strict";var R=p("lodash"),z=p("./script"),M=p("../opcode"),N=p("../crypto/bn"),D=p("../crypto/hash"),q=p("../crypto/signature"),L=p("../publickey"),U=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};U.prototype.verify=function(e,t,r,i,n){var a,o=p("../transaction");if(R.isUndefined(r)&&(r=new o),R.isUndefined(i)&&(i=0),R.isUndefined(n)&&(n=0),this.set({script:e,tx:r,nin:i,flags:n}),0!=(n&U.SCRIPT_VERIFY_SIGPUSHONLY)&&!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(!this.evaluate())return!1;n&U.SCRIPT_VERIFY_P2SH&&(a=this.stack.slice());var s=this.stack;if(this.initialize(),this.set({script:t,stack:s,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(0===this.stack.length)return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT");var c=this.stack[this.stack.length-1];if(!U.castToBool(c))return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK");if(n&U.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(0===a.length)throw new Error("internal error - stack copy empty");var u=a[a.length-1],f=z.fromBuffer(u);return a.pop(),this.initialize(),this.set({script:f,stack:a,tx:r,nin:i,flags:n}),!!this.evaluate()&&(0===a.length?!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK"):!!U.castToBool(a[a.length-1])||!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK"))}return!0},(t.exports=U).prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},U.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=void 0!==e.nin?e.nin:this.nin,this.stack=e.stack||this.stack,this.altstack=e.altack||this.altstack,this.pc=void 0!==e.pc?e.pc:this.pc,this.pbegincodehash=void 0!==e.pbegincodehash?e.pbegincodehash:this.pbegincodehash,this.nOpCount=void 0!==e.nOpCount?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=void 0!==e.flags?e.flags:this.flags},U.true=new e([1]),U.false=new e([]),U.MAX_SCRIPT_ELEMENT_SIZE=520,U.LOCKTIME_THRESHOLD_BN=new N(U.LOCKTIME_THRESHOLD=5e8),U.SCRIPT_VERIFY_NONE=0,U.SCRIPT_VERIFY_P2SH=1,U.SCRIPT_VERIFY_STRICTENC=2,U.SCRIPT_VERIFY_DERSIG=4,U.SCRIPT_VERIFY_LOW_S=8,U.SCRIPT_VERIFY_NULLDUMMY=16,U.SCRIPT_VERIFY_SIGPUSHONLY=32,U.SCRIPT_VERIFY_MINIMALDATA=64,U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,U.castToBool=function(e){for(var t=0;t=U.LOCKTIME_THRESHOLD&&e.gte(U.LOCKTIME_THRESHOLD_BN))&&(!e.gt(new N(this.tx.nLockTime))&&!!this.tx.inputs[this.nin].isFinal())},U.prototype.step=function(){var e,t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g,v=0!=(this.flags&U.SCRIPT_VERIFY_MINIMALDATA),b=-1===this.vfExec.indexOf(!1),y=this.script.chunks[this.pc];this.pc++;var _=y.opcodenum;if(R.isUndefined(_))return!(this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE");if(y.buf&&y.buf.length>U.MAX_SCRIPT_ELEMENT_SIZE)return!(this.errstr="SCRIPT_ERR_PUSH_SIZE");if(_>M.OP_16&&201<++this.nOpCount)return!(this.errstr="SCRIPT_ERR_OP_COUNT");if(_===M.OP_CAT||_===M.OP_SUBSTR||_===M.OP_LEFT||_===M.OP_RIGHT||_===M.OP_INVERT||_===M.OP_AND||_===M.OP_OR||_===M.OP_XOR||_===M.OP_2MUL||_===M.OP_2DIV||_===M.OP_MUL||_===M.OP_DIV||_===M.OP_MOD||_===M.OP_LSHIFT||_===M.OP_RSHIFT)return!(this.errstr="SCRIPT_ERR_DISABLED_OPCODE");if(b&&0<=_&&_<=M.OP_PUSHDATA4){if(v&&!this.script.checkMinimalPush(this.pc-1))return!(this.errstr="SCRIPT_ERR_MINIMALDATA");if(y.buf){if(y.len!==y.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(y.buf)}else this.stack.push(U.false)}else if(b||M.OP_IF<=_&&_<=M.OP_ENDIF)switch(_){case M.OP_1NEGATE:case M.OP_1:case M.OP_2:case M.OP_3:case M.OP_4:case M.OP_5:case M.OP_6:case M.OP_7:case M.OP_8:case M.OP_9:case M.OP_10:case M.OP_11:case M.OP_12:case M.OP_13:case M.OP_14:case M.OP_15:case M.OP_16:n=_-(M.OP_1-1),e=new N(n).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_NOP:break;case M.OP_NOP2:case M.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break}if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");var w=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v,5);if(w.lt(new N(0)))return!(this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME");if(!this.checkLockTime(w))return!(this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME");break;case M.OP_NOP1:case M.OP_NOP3:case M.OP_NOP4:case M.OP_NOP5:case M.OP_NOP6:case M.OP_NOP7:case M.OP_NOP8:case M.OP_NOP9:case M.OP_NOP10:if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break;case M.OP_IF:case M.OP_NOTIF:if(m=!1,b){if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");e=this.stack.pop(),m=U.castToBool(e),_===M.OP_NOTIF&&(m=!m)}this.vfExec.push(m);break;case M.OP_ELSE:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case M.OP_ENDIF:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec.pop();break;case M.OP_VERIFY:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],!(m=U.castToBool(e)))return!(this.errstr="SCRIPT_ERR_VERIFY");this.stack.pop();break;case M.OP_RETURN:return!(this.errstr="SCRIPT_ERR_OP_RETURN");case M.OP_TOALTSTACK:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.altstack.push(this.stack.pop());break;case M.OP_FROMALTSTACK:if(this.altstack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION");this.stack.push(this.altstack.pop());break;case M.OP_2DROP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop(),this.stack.pop();break;case M.OP_2DUP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1],this.stack.push(t),this.stack.push(r);break;case M.OP_3DUP:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-3],r=this.stack[this.stack.length-2];var k=this.stack[this.stack.length-1];this.stack.push(t),this.stack.push(r),this.stack.push(k);break;case M.OP_2OVER:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-4],r=this.stack[this.stack.length-3],this.stack.push(t),this.stack.push(r);break;case M.OP_2ROT:if(this.stack.length<6)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-6,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_2SWAP:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-4,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_IFDUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-1],(m=U.castToBool(e))&&this.stack.push(e);break;case M.OP_DEPTH:e=new N(this.stack.length).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_DROP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop();break;case M.OP_DUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-1]);break;case M.OP_NIP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,1);break;case M.OP_OVER:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-2]);break;case M.OP_PICK:case M.OP_ROLL:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],n=(s=N.fromScriptNumBuffer(e,v)).toNumber(),this.stack.pop(),n<0||n>=this.stack.length)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-n-1],_===M.OP_ROLL&&this.stack.splice(this.stack.length-n-1,1),this.stack.push(e);break;case M.OP_ROT:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-3],o=this.stack[this.stack.length-2];var x=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=o,this.stack[this.stack.length-2]=x,this.stack[this.stack.length-1]=a;break;case M.OP_SWAP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-2],o=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=o,this.stack[this.stack.length-1]=a;break;case M.OP_TUCK:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case M.OP_SIZE:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");s=new N(this.stack[this.stack.length-1].length),this.stack.push(s.toScriptNumBuffer());break;case M.OP_EQUAL:case M.OP_EQUALVERIFY:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1];var S=t.toString("hex")===r.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(S?U.true:U.false),_===M.OP_EQUALVERIFY){if(!S)return!(this.errstr="SCRIPT_ERR_EQUALVERIFY");this.stack.pop()}break;case M.OP_1ADD:case M.OP_1SUB:case M.OP_NEGATE:case M.OP_ABS:case M.OP_NOT:case M.OP_0NOTEQUAL:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(e=this.stack[this.stack.length-1],s=N.fromScriptNumBuffer(e,v),_){case M.OP_1ADD:s=s.add(N.One);break;case M.OP_1SUB:s=s.sub(N.One);break;case M.OP_NEGATE:s=s.neg();break;case M.OP_ABS:s.cmp(N.Zero)<0&&(s=s.neg());break;case M.OP_NOT:s=new N((0===s.cmp(N.Zero))+0);break;case M.OP_0NOTEQUAL:s=new N((0!==s.cmp(N.Zero))+0)}this.stack.pop(),this.stack.push(s.toScriptNumBuffer());break;case M.OP_ADD:case M.OP_SUB:case M.OP_BOOLAND:case M.OP_BOOLOR:case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:case M.OP_NUMNOTEQUAL:case M.OP_LESSTHAN:case M.OP_GREATERTHAN:case M.OP_LESSTHANOREQUAL:case M.OP_GREATERTHANOREQUAL:case M.OP_MIN:case M.OP_MAX:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(c=N.fromScriptNumBuffer(this.stack[this.stack.length-2],v),u=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v),s=new N(0),_){case M.OP_ADD:s=c.add(u);break;case M.OP_SUB:s=c.sub(u);break;case M.OP_BOOLAND:s=new N((0!==c.cmp(N.Zero)&&0!==u.cmp(N.Zero))+0);break;case M.OP_BOOLOR:s=new N((0!==c.cmp(N.Zero)||0!==u.cmp(N.Zero))+0);break;case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:s=new N((0===c.cmp(u))+0);break;case M.OP_NUMNOTEQUAL:s=new N((0!==c.cmp(u))+0);break;case M.OP_LESSTHAN:s=new N((c.cmp(u)<0)+0);break;case M.OP_GREATERTHAN:s=new N((0"},v.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==c.OP_DUP||this.chunks[1].opcodenum!==c.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==c.OP_EQUALVERIFY||this.chunks[4].opcodenum!==c.OP_CHECKSIG)},v.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&48===e[0]&&t&&t.length){var r=t[0];if((4===r||6===r||7===r)&&65===t.length)return!0;if((3===r||2===r)&&33===t.length)return!0}}return!1},v.prototype.getPublicKey=function(){return p.checkState(this.isPublicKeyOut(),"Can't retreive PublicKey from a non-PK output"),this.chunks[0].buf},v.prototype.getPublicKeyHash=function(){return p.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},v.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===c.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if((4!==t&&6!==t&&7!==t||65!==e.length)&&(3!==t&&2!==t||33!==e.length)||(r=!0),r)return u.isValid(e)}return!1},v.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var e=this.chunks[0].buf;if(e&&e.length&&48===e[0])return!0}return!1},v.prototype.isScriptHashOut=function(){var e=this.toBuffer();return 23===e.length&&e[0]===c.OP_HASH160&&20===e[1]&&e[e.length-1]===c.OP_EQUAL},v.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e,t=this.chunks[this.chunks.length-1].buf;if(!t)return!1;try{e=v.fromBuffer(t)}catch(e){if(e instanceof l.Script.InvalidBuffer)return!1;throw e}return e.classify()!==v.types.UNKNOWN},v.prototype.isMultisigOut=function(){return 3=c.OP_1&&e<=c.OP_16)return e-(c.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))},v.prototype.getSignatureOperationsCount=function(r){r=!!h.isUndefined(r)||r;var i=this,n=0,a=c.OP_INVALIDOPCODE;return h.each(i.chunks,function(e){var t=e.opcodenum;t==c.OP_CHECKSIG||t==c.OP_CHECKSIGVERIFY?n++:t!=c.OP_CHECKMULTISIG&&t!=c.OP_CHECKMULTISIGVERIFY||(r&&a>=c.OP_1&&a<=c.OP_16?n+=i._decodeOP_N(a):n+=20),a=t}),n},t.exports=v}).call(this,e("buffer").Buffer)},{"../address":79,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../networks":100,"../opcode":101,"../publickey":103,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],107:[function(e,t,r){t.exports=e("./transaction"),t.exports.Input=e("./input"),t.exports.Output=e("./output"),t.exports.UnspentOutput=e("./unspentoutput"),t.exports.Signature=e("./signature"),t.exports.Sighash=e("./sighash")},{"./input":108,"./output":114,"./sighash":115,"./signature":116,"./transaction":117,"./unspentoutput":118}],108:[function(e,t,r){t.exports=e("./input"),t.exports.PublicKey=e("./publickey"),t.exports.PublicKeyHash=e("./publickeyhash"),t.exports.MultiSig=e("./multisig.js"),t.exports.MultiSigScriptHash=e("./multisigscripthash.js")},{"./input":109,"./multisig.js":110,"./multisigscripthash.js":111,"./publickey":112,"./publickeyhash":113}],109:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../../util/preconditions"),a=e("../../errors"),o=e("../../encoding/bufferwriter"),s=e("buffer"),c=e("../../util/buffer"),u=e("../../util/js"),f=e("../../script"),p=e("../sighash"),h=e("../output"),l=4294967295;function d(e){return this instanceof d?e?this._fromObject(e):void 0:new d(e)}d.MAXINT=l,d.DEFAULT_SEQNUMBER=4294967295,d.DEFAULT_LOCKTIME_SEQNUMBER=4294967294,d.DEFAULT_RBF_SEQNUMBER=4294967293,Object.defineProperty(d.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new f(this._scriptBuffer),this._script._isInput=!0),this._script)}}),d.fromObject=function(e){return n.checkArgument(i.isObject(e)),(new d)._fromObject(e)},d.prototype._fromObject=function(e){var t;if(t=i.isString(e.prevTxId)&&u.isHexa(e.prevTxId)?new s.Buffer(e.prevTxId,"hex"):e.prevTxId,this.output=e.output?e.output instanceof h?e.output:new h(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=i.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=i.isUndefined(e.sequenceNumber)?i.isUndefined(e.seqnum)?4294967295:e.seqnum:e.sequenceNumber,i.isUndefined(e.script)&&i.isUndefined(e.scriptBuffer))throw new a.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this},d.prototype.toObject=d.prototype.toJSON=function(){var e={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(e.scriptString=this.script.toString()),this.output&&(e.output=this.output.toObject()),e},d.fromBufferReader=function(e){var t=new d;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t},d.prototype.toBufferWriter=function(e){e||(e=new o),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e},d.prototype.setScript=function(e){if(this._script=null,e instanceof f)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(u.isHexa(e))this._scriptBuffer=new s.Buffer(e,"hex");else if(i.isString(e))this._script=new f(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!c.isBuffer(e))throw new TypeError("Invalid argument type: script");this._scriptBuffer=new s.Buffer(e)}return this},d.prototype.getSignatures=function(){throw new a.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},d.prototype.isFullySigned=function(){throw new a.AbstractMethodInvoked("Input#isFullySigned")},d.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},d.prototype.addSignature=function(){throw new a.AbstractMethodInvoked("Input#addSignature")},d.prototype.clearSignatures=function(){throw new a.AbstractMethodInvoked("Input#clearSignatures")},d.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},d.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},d.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},t.exports=d},{"../../encoding/bufferwriter":93,"../../errors":95,"../../script":104,"../../util/buffer":121,"../../util/js":122,"../../util/preconditions":123,"../output":114,"../sighash":115,buffer:191,lodash:149}],110:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=(e("../transaction"),e("./input")),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),u.checkState(o.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.output.script),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},l.normalizeSignatures=function(n,a,o,e,t){return t.map(function(r){var i=null;return e=e.filter(function(e){if(i)return!0;var t=new h({signature:f.fromTxFormat(e),publicKey:r,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:o,sigtype:f.SIGHASH_ALL});return t.signature.nhashtype=t.sigtype,!p.verify(n,t.signature,t.publicKey,t.inputIndex,a.output.script)||(i=t,!1)}),i||null})},l.OPCODES_SIZE=1,l.SIGNATURE_SIZE=73,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"../transaction":117,"./input":109,inherits:148,lodash:149}],111:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=e("./input"),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),this.redeemScript=o.buildMultisigOut(this.publicKeys,r),u.checkState(o.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.redeemScript),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript)},l.OPCODES_SIZE=7,l.SIGNATURE_SIZE=74,l.PUBKEY_SIZE=34,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE+this.publicKeys.length*l.PUBKEY_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148,lodash:149}],112:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),n=(e("../../util/buffer"),e("./input")),o=e("../output"),s=e("../sighash"),c=e("../../script"),u=e("../../crypto/signature"),f=e("../signature");function p(){n.apply(this,arguments)}i(p,n),p.prototype.getSignatures=function(e,t,r,i){a.checkState(this.output instanceof o),i=i||u.SIGHASH_ALL;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new f({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:s.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},p.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(c.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this},p.prototype.clearSignatures=function(){return this.setScript(c.empty()),this},p.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},p.SCRIPT_MAX_SIZE=73,p.prototype._estimateSize=function(){return p.SCRIPT_MAX_SIZE},t.exports=p},{"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],113:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),o=e("../../util/buffer"),s=e("../../crypto/hash"),n=e("./input"),c=e("../output"),u=e("../sighash"),f=e("../../script"),p=e("../../crypto/signature"),h=e("../signature");function l(){n.apply(this,arguments)}i(l,n),l.prototype.getSignatures=function(e,t,r,i,n){return a.checkState(this.output instanceof c),n=n||s.sha256ripemd160(t.publicKey.toBuffer()),i=i||p.SIGHASH_ALL,o.equals(n,this.output.script.getPublicKeyHash())?[new h({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:u.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},l.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(f.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this},l.prototype.clearSignatures=function(){return this.setScript(f.empty()),this},l.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()},l.SCRIPT_MAX_SIZE=107,l.prototype._estimateSize=function(){return l.SCRIPT_MAX_SIZE},t.exports=l},{"../../crypto/hash":86,"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],114:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../crypto/bn"),a=e("buffer"),o=e("../util/buffer"),s=e("../util/js"),c=e("../encoding/bufferwriter"),u=e("../script"),f=e("../util/preconditions"),p=e("../errors");function h(e){if(!(this instanceof h))return new h(e);if(!i.isObject(e))throw new TypeError("Unrecognized argument for Output");var t;this.satoshis=e.satoshis,o.isBuffer(e.script)?this._scriptBuffer=e.script:(t=i.isString(e.script)&&s.isHexa(e.script)?new a.Buffer(e.script,"hex"):e.script,this.setScript(t))}Object.defineProperty(h.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script||this.setScriptFromBuffer(this._scriptBuffer),this._script}}),Object.defineProperty(h.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof n?(this._satoshisBN=e,this._satoshis=e.toNumber()):i.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=n.fromNumber(this._satoshis)):(f.checkArgument(s.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=n.fromNumber(e),this._satoshis=e),f.checkState(s.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),h.prototype.invalidSatoshis=function(){return 9007199254740991"},h.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return t.script=0!==r?e.read(r):new a.Buffer([]),new h(t)},h.prototype.toBufferWriter=function(e){e||(e=new c),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e},t.exports=h},{"../crypto/bn":84,"../encoding/bufferwriter":93,"../errors":95,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],115:[function(y,e,t){(function(f){"use strict";var p=y("buffer"),h=y("../crypto/signature"),l=y("../script"),d=y("./output"),m=y("../encoding/bufferreader"),g=y("../encoding/bufferwriter"),v=y("../crypto/bn"),b=y("../crypto/hash"),o=y("../crypto/ecdsa"),s=y("../util/preconditions"),c=y("lodash"),u=function(e,t,r,i){var n,a=y("./transaction"),o=y("./input"),s=a.shallowCopy(e);for((i=new l(i)).removeCodeseparators(),n=0;n=s.outputs.length)return new f("0000000000000000000000000000000000000000000000000000000000000001","hex");for(s.outputs.length=r+1,n=0;n"},S.prototype.toBuffer=function(){var e=new u;return this.toBufferWriter(e).toBuffer()},S.prototype.toBufferWriter=function(t){return t.writeUInt32LE(this.version),t.writeVarintNum(this.inputs.length),s.each(this.inputs,function(e){e.toBufferWriter(t)}),t.writeVarintNum(this.outputs.length),s.each(this.outputs,function(e){e.toBufferWriter(t)}),t.writeUInt32LE(this.nLockTime),t},S.prototype.fromBuffer=function(e){var t=new c(e);return this.fromBufferReader(t)},S.prototype.fromBufferReader=function(e){var t,r,i;for(a.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readUInt32LE(),r=e.readVarintNum(),t=0;t=this.inputs.length)throw new n.Transaction.InvalidIndex(e,this.inputs.length);var i=this.inputs[e];this.inputs=s.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()},S.prototype.sign=function(e,t){a.checkState(this.hasAllUtxoInfo());var r=this;return s.isArray(e)?s.each(e,function(e){r.sign(e,t)}):s.each(this.getSignatures(e,t),function(e){r.applySignature(e)}),this},S.prototype.getSignatures=function(r,i){r=new k(r),i=i||p.SIGHASH_ALL;var n=this,a=[],o=f.sha256ripemd160(r.publicKey.toBuffer());return s.each(this.inputs,function(e,t){s.each(e.getSignatures(n,r,t,i,o),function(e){a.push(e)})}),a},S.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this},S.prototype.isFullySigned=function(){return s.each(this.inputs,function(e){if(e.isFullySigned===m.prototype.isFullySigned)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),s.all(s.map(this.inputs,function(e){return e.isFullySigned()}))},S.prototype.isValidSignature=function(e){if(this.inputs[e.inputIndex].isValidSignature===m.prototype.isValidSignature)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e)},S.prototype.verifySignature=function(e,t,r,i){return h.verify(this,e,t,r,i)},S.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var e=new x(0),t=0;t=m.MAXINT-1&&(t.sequenceNumber=m.DEFAULT_RBF_SEQNUMBER)}return this},I.exports=S}).call(this,A("buffer").Buffer)},{"../address":79,"../crypto/bn":84,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../privatekey":102,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"./input":108,"./output":114,"./sighash":115,"./unspentoutput":118,buffer:191,"buffer-compare":126,lodash:149}],118:[function(e,t,r){"use strict";var o=e("lodash"),s=e("../util/preconditions"),c=e("../util/js"),u=e("../script"),f=e("../address"),p=e("../unit");function h(e){if(!(this instanceof h))return new h(e);s.checkArgument(o.isObject(e),"Must provide an object from where to extract data");var t=e.address?new f(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!c.isHexaString(r)||64"},h.prototype.toString=function(){return this.txId+":"+this.outputIndex},h.fromObject=function(e){return new h(e)},h.prototype.toObject=h.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:p.fromSatoshis(this.satoshis).toBTC()}},t.exports=h},{"../address":79,"../script":104,"../unit":119,"../util/js":122,"../util/preconditions":123,lodash:149}],119:[function(e,t,r){"use strict";var i=e("lodash"),n=e("./errors"),a=e("./util/preconditions"),o={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function s(e,t){if(!(this instanceof s))return new s(e,t);if(i.isNumber(t)){if(t<=0)throw new n.Unit.InvalidRate(t);e/=t,t=s.BTC}this._value=this._from(e,t);var r=this;Object.keys(o).forEach(function(e){Object.defineProperty(r,e,{get:function(){return r.to(e)},enumerable:!0})})}Object.keys(o).forEach(function(e){s[e]=e}),s.fromObject=function(e){return a.checkArgument(i.isObject(e),"Argument is expected to be an object"),new s(e.amount,e.code)},s.fromBTC=function(e){return new s(e,s.BTC)},s.fromMillis=s.fromMilis=function(e){return new s(e,s.mBTC)},s.fromMicros=s.fromBits=function(e){return new s(e,s.bits)},s.fromSatoshis=function(e){return new s(e,s.satoshis)},s.fromFiat=function(e,t){return new s(e,t)},s.prototype._from=function(e,t){if(!o[t])throw new n.Unit.UnknownCode(t);return parseInt((e*o[t][0]).toFixed())},s.prototype.to=function(e){if(i.isNumber(e)){if(e<=0)throw new n.Unit.InvalidRate(e);return parseFloat((this.BTC*e).toFixed(2))}if(!o[e])throw new n.Unit.UnknownCode(e);var t=this._value/o[e][0];return parseFloat(t.toFixed(o[e][1]))},s.prototype.toBTC=function(){return this.to(s.BTC)},s.prototype.toMillis=s.prototype.toMilis=function(){return this.to(s.mBTC)},s.prototype.toMicros=s.prototype.toBits=function(){return this.to(s.bits)},s.prototype.toSatoshis=function(){return this.to(s.satoshis)},s.prototype.atRate=function(e){return this.to(e)},s.prototype.toString=function(){return this.satoshis+" satoshis"},s.prototype.toObject=s.prototype.toJSON=function(){return{amount:this.BTC,code:s.BTC}},s.prototype.inspect=function(){return""},t.exports=s},{"./errors":95,"./util/preconditions":123,lodash:149}],120:[function(e,t,r){"use strict";var i=e("lodash"),n=e("url"),a=e("./address"),o=e("./unit"),s=function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.extras={},this.knownParams=r||[],this.address=this.network=this.amount=this.message=null,"string"==typeof t){var i=e.parse(t);i.amount&&(i.amount=this._parseAmount(i.amount)),this._fromObject(i)}else{if("object"!==(void 0===t?"undefined":_typeof(t)))throw new TypeError("Unrecognized data format.");this._fromObject(t)}};s.fromString=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return new s(e)},s.fromObject=function(e){return new s(e)},s.isValid=function(e,t){try{new s(e,t)}catch(e){return!1}return!0},s.parse=function(e){var t=n.parse(e,!0);if("bitcoin:"!==t.protocol)throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(e);return t.query.address=r&&r[1]||void 0,t.query},s.Members=["address","amount","message","label","r"],s.prototype._fromObject=function(e){if(!a.isValid(e.address))throw new TypeError("Invalid bitcoin address");for(var t in this.address=new a(e.address),this.network=this.address.network,this.amount=e.amount,e)if("address"!==t&&"amount"!==t){if(/^req-/.exec(t)&&-1===this.knownParams.indexOf(t))throw Error("Unknown required argument "+t);(-1"},t.exports=s},{"./address":79,"./unit":119,lodash:149,url:500}],121:[function(o,s,e){(function(r){"use strict";var i=o("buffer"),t=o("assert"),n=o("./js"),a=o("./preconditions");function e(e,t){if(e.length!==t.length)return!1;for(var r=e.length,i=0;i>24&255),t.push(e>>16&255),t.push(e>>8&255),t.push(255&e),new r(t)},integerFromBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]<<24|e[1]<<16|e[2]<<8|e[3]},integerFromSingleByteBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]},bufferToHex:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e.toString("hex")},reverse:function(e){for(var t=new i.Buffer(e.length),r=0;r>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}}else if("le"===r)for(i=0,a=0;i>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-i&4194303,26<=(i+=24)&&(i-=26,n++)}if(r+6!==t){a=o(e,t,r+6);this.words[n]|=a<>>26-i&4194303}this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];v.prototype.toString=function(e,t){if(16===(e=e||10)||"hex"===e){for(var r="",i=0,n=(t=0|t||1,0),a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return this.sign&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var c=l[e],u=d[e],f=(r="",this.clone());for(f.sign=!1;0!==f.cmpn(0);){var p=f.modn(u).toString(e);r=0!==(f=f.idivn(u)).cmpn(0)?h[c-p.length]+p+r:p+r}return 0===this.cmpn(0)&&(r="0"+r),this.sign&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.prototype.toJSON=function(){return this.toString(16)},v.prototype.toArray=function(){this.strip();var e=new Array(this.byteLength());e[0]=0;for(var t=this.clone(),r=0;0!==t.cmpn(0);r++){var i=t.andln(255);t.ishrn(8),e[e.length-r-1]=i}return e},v.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return 4096<=t&&(r+=13,t>>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.iand=function(e){var t;this.sign=this.sign&&e.sign,t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},v.prototype.ixor=function(e){var t,r;this.sign=this.sign||e.sign,r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);for(var r=e/26|0,i=e%26;this.length<=r;)this.words[this.length++]=0;return this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,a=0;a>>26}for(;0!==n&&a>>26}if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this);this.sign=!1;t=e.sub(this);return this.sign=!0,t},v.prototype.isub=function(e){if(e.sign){e.sign=!1;var t=this.iadd(e);return e.sign=!0,t._normSign()}if(this.sign)return this.sign=!1,this.iadd(e),this.sign=!0,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.sign=!1,this.length=1,this.words[0]=0,this;i=0>26,this.words[o]=67108863&t}for(;0!==a&&o>26,this.words[o]=67108863&t}if(0===a&&o>>26,a=67108863&r,o=Math.min(i,e.length-1),s=Math.max(0,i-this.length+1);s<=o;s++){var c=i-s,u=(0|this.words[c])*(0|e.words[s]),f=67108863&u;a=67108863&(f=f+a|0),n=(n=n+(u/67108864|0)|0)+(f>>>26)|0}t.words[i]=a,r=n}return 0!==r?t.words[i]=r:t.length--,t.strip()},v.prototype._bigMulTo=function(e,t){t.sign=e.sign!==this.sign,t.length=this.length+e.length;for(var r=0,i=0,n=0;n>>26)|0)>>>26,a&=67108863}t.words[n]=o,r=a,a=i}return 0!==r?t.words[n]=r:t.length--,t.strip()},v.prototype.mulTo=function(e,t){return this.length+e.length<63?this._smallMulTo(e,t):this._bigMulTo(e,t)},v.prototype.mul=function(e){var t=new v(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},v.prototype.imul=function(e){if(0===this.cmpn(0)||0===e.cmpn(0))return this.words[0]=0,this.length=1,this;var t=this.length,r=e.length;this.sign=e.sign!==this.sign,this.length=this.length+e.length,this.words[this.length-1]=0;for(var i=this.length-2;0<=i;i--){for(var n=0,a=0,o=Math.min(i,r-1),s=Math.max(0,i-t+1);s<=o;s++){var c=i-s,u=this.words[c]*e.words[s],f=67108863&u;n+=u/67108864|0,a=67108863&(f+=a),n+=f>>>26}this.words[i]=a,this.words[i+1]+=n,n=0}for(n=0,c=1;c>>26}return this.strip()},v.prototype.imuln=function(e){g("number"==typeof e);for(var t=0,r=0;r>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.mul(this)},v.prototype.ishln=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){for(var n=0,a=0;a>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;a>>n<a){this.length-=a;for(c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(c/67108864|0),this.words[a+r]=67108863&s}for(;a>26,this.words[a+r]=67108863&s}if(0===o)return this.strip();g(-1===o);for(a=o=0;a>26,this.words[a]=67108863&s}return this.sign=!0,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.shln(r),i.ishln(r),a=n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var n;i=this.divmod(e.neg(),t);return"mod"!==t&&(n=i.div.neg()),{div:n,mod:i.mod}},v.prototype.div=function(e){return this.divmod(e,"div").div},v.prototype.mod=function(e){return this.divmod(e,"mod").mod},v.prototype.divRound=function(e){var t=this.divmod(e);if(0===t.mod.cmpn(0))return t.div;var r=t.div.sign?t.mod.isub(e):t.mod,i=e.shrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:t.div.sign?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+this.words[i])%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=this.words[r]+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.ishrn(1),r.ishrn(1),++s;for(var c=r.clone(),u=t.clone();0!==t.cmpn(0);){for(;t.isEven();)t.ishrn(1),i.isEven()&&n.isEven()?(i.ishrn(1),n.ishrn(1)):(i.iadd(c).ishrn(1),n.isub(u).ishrn(1));for(;r.isEven();)r.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(u).ishrn(1));0<=t.cmp(r)?(t.isub(r),i.isub(a),n.isub(o)):(r.isub(t),a.isub(i),o.isub(n))}return{a:a,b:o,gcd:r.ishln(s)}},v.prototype._invmp=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=r.clone();0>>26,o&=67108863,this.words[n]=o}return 0!==a&&(this.words[n]=a,this.length++),this},v.prototype.cmpn=function(e){var t,r=e<0;if(r&&(e=-e),this.sign&&!r)return-1;if(!this.sign&&r)return 1;if(e&=67108863,this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}e.words[i-10]=n>>>22,e.length-=9},a.prototype.imulK=function(e){var t;e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(i[e])return i[e];var t;if("k256"===e)t=new a;else if("p224"===e)t=new s;else if("p192"===e)t=new c;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new u}return i[e]=t},f.prototype._verify1=function(e){g(!e.sign,"red works only with positives"),g(e.red,"red works only with red numbers")},f.prototype._verify2=function(e,t){g(!e.sign&&!t.sign,"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},f.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.mod(this.m)._forceRed(this)},f.prototype.neg=function(e){var t=e.clone();return t.sign=!t.sign,t.iadd(this.m)._forceRed(this)},f.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},f.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},f.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)},f.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.shln(t))},f.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},f.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},f.prototype.isqr=function(e){return this.imul(e,e)},f.prototype.sqr=function(e){return this.mul(e,e)},f.prototype.sqrt=function(e){if(0===e.cmpn(0))return e.clone();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).ishrn(2);return f=this.pow(e,r)}for(var i=this.m.subn(1),n=0;0!==i.cmpn(0)&&0===i.andln(1);)n++,i.ishrn(1);g(0!==i.cmpn(0));var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).ishrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).ishrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>8,i[r]&=255;for(;a;)i.push(255&a),a>>=8}for(t=0;"1"===e[t]&&tt[i]?1:0);++i);return 0==r&&(t.length>e.length?r=-1:e.length>t.length&&(r=1)),r}},{}],127:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.hmacDRBG=e("./elliptic/hmac-drbg"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec")},{"../package.json":147,"./elliptic/curve":130,"./elliptic/curves":133,"./elliptic/ec":134,"./elliptic/hmac-drbg":137,"./elliptic/utils":139,brorand:140}],128:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic"),S=n.utils.getNAF,j=n.utils.getJSF,u=n.utils.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function o(e,t){this.curve=e,this.type=t,this.precomputed=null}(t.exports=a).prototype.point=function(){throw new Error("Not implemented")},a.prototype.validate=function(){throw new Error("Not implemented")},a.prototype._fixedNafMul=function(e,t){var r=e._getDoubles(),i=S(t,1),n=(1<>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i){for(var n=this._wnafT1,a=this._wnafT2,o=this._wnafT3,s=0,c=0;c>1]:x<0&&(k=a[m][-x-1>>1].neg()),b="affine"===k.type?b.mixedAdd(k):b.add(k))}}for(c=0;c":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],130:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":128,"./edwards":129,"./mont":131,"./short":132}],131:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base;function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(s,o),(t.exports=s).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)},a(c,o.BasePoint),s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.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)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.ishrn(1))n.push(t.andln(1));for(var a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../curve":130,"bn.js":124,inherits:148}],132:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.shrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.sign&&(i=i.neg(),n=n.neg()),a.sign&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(t=new w(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b).redSqrt(),i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},c.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)},c.prototype._endoWnafMulAdd=function(e,t){for(var r=this._endoWnafT1,i=this._endoWnafT2,n=0;n":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],133:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":127,"./precomputed/secp256k1":138,"hash.js":141}],134:[function(e,t,r){"use strict";var d=e("bn.js"),m=e("../../elliptic"),i=m.utils.assert,n=e("./key"),g=e("./signature");function a(e){if(!(this instanceof a))return new a(e);"string"==typeof e&&(i(m.curves.hasOwnProperty(e),"Unknown curve "+e),e=m.curves[e]),e instanceof m.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(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}(t.exports=a).prototype.keyPair=function(e){return new n(this,e)},a.prototype.keyFromPrivate=function(e,t){return n.fromPrivate(this,e,t)},a.prototype.keyFromPublic=function(e,t){return n.fromPublic(this,e,t)},a.prototype.genKeyPair=function(e){e||(e={});for(var t=new m.hmacDRBG({hash:this.hash,pers:e.pers,entropy:e.entropy||m.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new d(2));;){var n=new d(t.generate(r));if(!(0"}},{"../../elliptic":127,"bn.js":124}],136:[function(e,t,r){"use strict";var n=e("bn.js"),a=e("../../elliptic").utils,i=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16))}(t.exports=o).prototype._importDER=function(e,t){if((e=a.toArray(e,t)).length<6||48!==e[0]||2!==e[2])return!1;if(1+e[1]>e.length)return!1;var r=e[3];if(128<=r)return!1;if(4+r+2>=e.length)return!1;if(2!==e[4+r])return!1;var i=e[5+r];return!(128<=i)&&(!(4+r+2+i>e.length)&&(this.r=new n(e.slice(4,4+r)),this.s=new n(e.slice(4+r+2,4+r+2+i)),!0))},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r));var i=[48,t.length+r.length+4,2,t.length];return i=i.concat(t,[2,r.length],r),a.encode(i,e)}},{"../../elliptic":127,"bn.js":124}],137:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("../elliptic").utils,n=o.assert;function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc),r=o.toArray(e.nonce,e.nonceEnc),i=o.toArray(e.pers,e.persEnc);n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this.reseed=1},a.prototype.generate=function(e,t,r,i){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i),this._update(r));for(var n=[];n.length>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e},i.getNAF=function(e,t){for(var r=[],i=1<>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=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=n.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{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;for(a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>10),n[a-7],(r=n[a-15],b(r,7)^b(r,18)^r>>>3),n[a-16]);var o,s,c=this.h[0],u=this.h[1],f=this.h[2],p=this.h[3],h=this.h[4],l=this.h[5],d=this.h[6],m=this.h[7];F(this.k.length===n.length);for(a=0;a>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function s(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}function u(e,t){if(!e)throw new Error(t||"Assertion failed")}i.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},i.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,r){return e+t+r>>>0},i.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},i.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},i.assert=u,i.inherits=n,r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:148}],147:[function(e,t,r){t.exports={_args:[["elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib"]],_from:"elliptic@=3.0.3",_id:"elliptic@3.0.3",_inCache:!0,_location:"/bitcore-lib/elliptic",_phantomChildren:{inherits:"2.0.1"},_requested:{name:"elliptic",raw:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",rawSpec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",scope:null,spec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",type:"remote"},_requiredBy:["/bitcore-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_shasum:"865c9b420bfbe55006b9f969f97a0d2c44966595",_shrinkwrap:null,_spec:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_where:"/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^2.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},description:"EC cryptography",devDependencies:{browserify:"^3.44.2",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",optionalDependencies:{},readme:"# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic)\n\nFast elliptic-curve cryptography in a plain javascript implementation.\n\nNOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve\nfor your cryptography operations.\n\n## Incentive\n\nECC is much slower than regular RSA cryptography, the JS implementations are\neven more slower.\n\n## Benchmarks\n\n```bash\n$ node benchmarks/index.js\nBenchmarking: sign\nelliptic#sign x 262 ops/sec ±0.51% (177 runs sampled)\neccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled)\n------------------------\nFastest is elliptic#sign\n========================\nBenchmarking: verify\nelliptic#verify x 113 ops/sec ±0.50% (166 runs sampled)\neccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled)\n------------------------\nFastest is elliptic#verify\n========================\nBenchmarking: gen\nelliptic#gen x 294 ops/sec ±0.43% (176 runs sampled)\neccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled)\n------------------------\nFastest is elliptic#gen\n========================\nBenchmarking: ecdh\nelliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled)\n------------------------\nFastest is elliptic#ecdh\n========================\n```\n\n## API\n\n### ECDSA\n\n```javascript\nvar EC = require('elliptic').ec;\n\n// Create and initialize EC context\n// (better do it once and reuse it)\nvar ec = new EC('secp256k1');\n\n// Generate keys\nvar key = ec.genKeyPair();\n\n// Sign message (must be an array, or it'll be treated as a hex sequence)\nvar msg = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];\nvar signature = key.sign(msg);\n\n// Export DER encoded signature in Array\nvar derSign = signature.toDER();\n\n// Verify signature\nconsole.log(key.verify(msg, derSign));\n```\n\n### ECDH\n\n```javascript\n// Generate keys\nvar key1 = ec.genKeyPair();\nvar key2 = ec.genKeyPair();\n\nvar shared1 = key1.derive(key2.getPublic());\nvar shared2 = key2.derive(key1.getPublic());\n\nconsole.log('Both shared secrets are BN instances');\nconsole.log(shared1.toString(16));\nconsole.log(shared2.toString(16));\n```\n\nNOTE: `.derive()` returns a [BN][1] instance.\n\n## Supported curves\n\nElliptic.js support following curve types:\n\n* Short Weierstrass\n* Montgomery\n* Edwards\n* Twisted Edwards\n\nFollowing curve 'presets' are embedded into the library:\n\n* `secp256k1`\n* `p192`\n* `p224`\n* `p256`\n* `curve25519`\n* `ed25519`\n\nNOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead.\n\n### Implementation details\n\nECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of\nthe curve operations are performed on non-affine coordinates (either projective\nor extended), various windowing techniques are used for different cases.\n\nAll operations are performed in reduction context using [bn.js][1], hashing is\nprovided by [hash.js][2]\n\n### Related projects\n\n* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both\n browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for\n node)\n\n#### LICENSE\n\nThis software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2014.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://tools.ietf.org/html/rfc6979\n[1]: https://github.com/indutny/bn.js\n[2]: https://github.com/indutny/hash.js\n[3]: https://github.com/bitchan/eccrypto\n[4]: https://github.com/wanderer/secp256k1-node\n",readmeFilename:"README.md",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{test:"make lint && mocha --reporter=spec test/*-test.js"},version:"3.0.3"}},{}],148:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{dup:68}],149:[function(e,y,_){(function(b){(function(){var dn,e,t,mn="3.10.1",gn=1,vn=2,bn=4,yn=8,_n=16,wn=32,kn=64,xn=128,Sn=256,jn=30,En="...",An=150,In=16,Pn=200,On=1,Tn=2,Bn="Expected a function",Cn="__lodash_placeholder__",Fn="[object Arguments]",Rn="[object Array]",zn="[object Boolean]",Mn="[object Date]",Nn="[object Error]",Dn="[object Function]",r="[object Map]",qn="[object Number]",Ln="[object Object]",Un="[object RegExp]",i="[object Set]",Hn="[object String]",n="[object WeakMap]",Kn="[object ArrayBuffer]",Vn="[object Float32Array]",Gn="[object Float64Array]",$n="[object Int8Array]",Wn="[object Int16Array]",Zn="[object Int32Array]",Yn="[object Uint8Array]",Xn="[object Uint8ClampedArray]",Jn="[object Uint16Array]",Qn="[object Uint32Array]",ea=/\b__p \+= '';/g,ta=/\b(__p \+=) '' \+/g,ra=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ia=/&(?:amp|lt|gt|quot|#39|#96);/g,na=/[&<>"'`]/g,aa=RegExp(ia.source),oa=RegExp(na.source),sa=/<%-([\s\S]+?)%>/g,ca=/<%([\s\S]+?)%>/g,ua=/<%=([\s\S]+?)%>/g,fa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,pa=/^\w*$/,ha=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,la=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,da=RegExp(la.source),ma=/[\u0300-\u036f\ufe20-\ufe23]/g,ga=/\\(\\)?/g,va=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ba=/\w*$/,ya=/^0[xX]/,_a=/^\[object .+?Constructor\]$/,wa=/^\d+$/,ka=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xa=/($^)/,Sa=/['\n\r\u2028\u2029\\]/g,ja=(e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",t="[a-z\\xdf-\\xf6\\xf8-\\xff]+",RegExp(e+"+(?="+e+t+")|"+e+"?"+t+"|"+e+"+|[0-9]+","g")),Ea=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Aa=-1,Ia={};Ia[Vn]=Ia[Gn]=Ia[$n]=Ia[Wn]=Ia[Zn]=Ia[Yn]=Ia[Xn]=Ia[Jn]=Ia[Qn]=!0,Ia[Fn]=Ia[Rn]=Ia[Kn]=Ia[zn]=Ia[Mn]=Ia[Nn]=Ia[Dn]=Ia[r]=Ia[qn]=Ia[Ln]=Ia[Un]=Ia[i]=Ia[Hn]=Ia[n]=!1;var Pa={};Pa[Fn]=Pa[Rn]=Pa[Kn]=Pa[zn]=Pa[Mn]=Pa[Vn]=Pa[Gn]=Pa[$n]=Pa[Wn]=Pa[Zn]=Pa[qn]=Pa[Ln]=Pa[Un]=Pa[Hn]=Pa[Yn]=Pa[Xn]=Pa[Jn]=Pa[Qn]=!0,Pa[Nn]=Pa[Dn]=Pa[r]=Pa[i]=Pa[n]=!1;var a={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},o={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},s={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},c={function:!0,object:!0},u={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},f={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},p=c[void 0===_?"undefined":_typeof(_)]&&_&&!_.nodeType&&_,h=c[void 0===y?"undefined":_typeof(y)]&&y&&!y.nodeType&&y,l=p&&h&&"object"==(void 0===b?"undefined":_typeof(b))&&b&&b.Object&&b,d=c["undefined"==typeof self?"undefined":_typeof(self)]&&self&&self.Object&&self,m=c["undefined"==typeof window?"undefined":_typeof(window)]&&window&&window.Object&&window,g=h&&h.exports===p&&p,Oa=l||m!==(this&&this.window)&&m||d||this;function Ta(e,t){if(e!==t){var r=null===e,i=e===dn,n=e==e,a=null===t,o=t===dn,s=t==t;if(t>>1,$=9007199254740991,W=O&&new O,Z={};function Y(e){if(Ka(e)&&!ui(e)&&!(e instanceof Q)){if(e instanceof J)return e;if(_.call(e,"__chain__")&&_.call(e,"__wrapped__"))return Qt(e)}return new J(e)}function X(){}function J(e,t,r){this.__wrapped__=e,this.__actions__=r||[],this.__chain__=!!t}Y.support={};function Q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function ee(){this.__data__={}}function te(e){var t=e?e.length:0;for(this.data={hash:B(null),set:new j};t--;)this.push(e[t])}function re(e,t){var r=e.data;return("string"==typeof t||li(t)?r.set.has(t):r.hash[t])?0:-1}function ie(e,t){var r=-1,i=e.length;for(t||(t=P(i));++r=Pn?st(t):null,c=t.length;s&&(a=re,o=!1,t=s);e:for(;++n>>0,t>>>=0;for(var a=P(n);++i>>1,o=e[a];(r?o<=t:o=Pn)return n.plant(t).value();for(var r=0,i=a?o[r].apply(this,e):t;++r=An)return e}else Gt=0;return Ue(e,t)});function Zt(e){for(var t=Ri(e),r=t.length,i=r&&e.length,n=!!i&&Ut(i)&&(ui(e)||ci(e)),a=-1,o=[];++a>>0,r>>>=0;r=N(t,r)&&e=(e=Ra(e)).length)return e;var o=i-n.length;if(o<1)return n;var s=e.slice(0,o);if(null==a)return s+n;if(vi(a)){if(e.slice(o).search(a)){var c,u,f=e.slice(0,o);for(a.global||(a=b(a.source,(ba.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(f);)u=c.index;s=s.slice(0,null==u?o:u)}}else if(e.indexOf(a,o)!=o){var p=s.lastIndexOf(a);-1=0.13.7 <0.14.0",_id:"bitcore-lib@0.13.19",_inCache:!0,_installable:!0,_location:"/bitcore-lib",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/bitcore-lib-0.13.19.tgz_1470850061596_0.2146058666985482"},_npmUser:{email:"braydon@bitpay.com",name:"braydonf"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{name:"bitcore-lib",raw:"bitcore-lib@^0.13.7",rawSpec:"^0.13.7",scope:null,spec:">=0.13.7 <0.14.0",type:"range"},_requiredBy:["/","/bitcore-message"],_resolved:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz",_shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",_shrinkwrap:{dependencies:{"bn.js":{from:"bn.js@=2.0.4",resolved:"https://registry.npmjs.org/bn.js/-/bn.js-2.0.4.tgz",version:"2.0.4"},bs58:{from:"bs58@=2.0.0",resolved:"https://registry.npmjs.org/bs58/-/bs58-2.0.0.tgz",version:"2.0.0"},"buffer-compare":{from:"buffer-compare@=1.0.0",resolved:"https://registry.npmjs.org/buffer-compare/-/buffer-compare-1.0.0.tgz",version:"1.0.0"},elliptic:{dependencies:{brorand:{from:"brorand@^1.0.1",resolved:"https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz",version:"1.0.5"},"hash.js":{from:"hash.js@=1.0.3",resolved:"https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz",version:"1.0.3"}},from:"elliptic@=3.0.3",resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",version:"3.0.3"},inherits:{from:"inherits@=2.0.1",resolved:"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",version:"2.0.1"},lodash:{from:"lodash@=3.10.1",resolved:"https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",version:"3.10.1"}},name:"bitcore",version:"0.13.18"},_spec:"bitcore-lib@^0.13.7",_where:"/home/administrator/javascript-opentimestamps",author:{email:"dev@bitpay.com",name:"BitPay"},browser:{request:"browser-request"},bugs:{url:"https://github.com/bitpay/bitcore-lib/issues"},contributors:[{name:"Manuel Araoz",email:"manuelaraoz@gmail.com"},{name:"Daniel Cousens",email:"bitcoin@dcousens.com"},{name:"Gordon Hall",email:"gordon@bitpay.com"},{name:"Jeff Garzik",email:"jgarzik@bitpay.com"},{name:"Kyle Drake",email:"kyle@kyledrake.net"},{name:"Esteban Ordano",email:"eordano@gmail.com"},{name:"Matias Alejo Garcia",email:"ematiu@gmail.com"},{name:"Ryan X. Charles",email:"ryanxcharles@gmail.com"},{name:"Stefan Thomas",email:"moon@justmoon.net"},{name:"Stephen Pair",email:"stephen@bitpay.com"},{name:"Wei Lu",email:"luwei.here@gmail.com"}],dependencies:{"bn.js":"=2.0.4",bs58:"=2.0.0","buffer-compare":"=1.0.0",elliptic:"=3.0.3",inherits:"=2.0.1",lodash:"=3.10.1"},description:"A pure and powerful JavaScript Bitcoin library.",devDependencies:{"bitcore-build":"github:bitpay/bitcore-build",brfs:"^1.2.0",chai:"^1.10.0",gulp:"^3.8.10",sinon:"^1.13.0"},directories:{},dist:{shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",tarball:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz"},gitHead:"9517864f14d09700f3fd02ff61173003c0280774",homepage:"https://github.com/bitpay/bitcore-lib#readme",keywords:["address","bip21","bip32","bip37","bip69","bip70","bitcoin","blockchain","cryptocurrency","ecies","multisig","p2p","payment","transaction"],license:"MIT",main:"index.js",maintainers:[{name:"braydonf",email:"braydon@bitpay.com"},{name:"gabegattis",email:"gabegattis@gmail.com"},{name:"gasteve",email:"stephen@pairhome.net"},{name:"patrickbitpay",email:"patrick@bitpay.com"}],name:"bitcore-lib",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/bitpay/bitcore-lib.git"},scripts:{build:"gulp",coverage:"gulp coverage",lint:"gulp lint",test:"gulp test"},version:"0.13.19"}},{}],151:[function(e,t,r){var i=e("bitcore-lib");i.Message=e("./lib/message"),t.exports=i.Message},{"./lib/message":152,"bitcore-lib":78}],152:[function(r,d,e){(function(o){"use strict";var e=r("bitcore-lib"),s=e.deps._,i=e.PrivateKey,n=e.PublicKey,c=e.Address,a=e.encoding.BufferWriter,u=e.crypto.ECDSA,f=e.crypto.Signature,p=e.crypto.Hash.sha256sha256,t=e.util.js,h=e.util.preconditions,l=function e(t){return this instanceof e?(h.checkArgument(s.isString(t),"First argument should be a string"),this.message=t,this):new e(t)};l.MAGIC_BYTES=new o("Bitcoin Signed Message:\n"),l.prototype.magicHash=function(){var e=a.varintBufNum(l.MAGIC_BYTES.length),t=new o(this.message),r=a.varintBufNum(t.length),i=o.concat([e,l.MAGIC_BYTES,r,t]);return p(i)},l.prototype._sign=function(e){h.checkArgument(e instanceof i,"First argument should be an instance of PrivateKey");var t=this.magicHash(),r=new u;return r.hashbuf=t,r.privkey=e,r.pubkey=e.toPublicKey(),r.signRandomK(),r.calci(),r.sig},l.prototype.sign=function(e){return this._sign(e).toCompact().toString("base64")},l.prototype._verify=function(e,t){h.checkArgument(e instanceof n,"First argument should be an instance of PublicKey"),h.checkArgument(t instanceof f,"Second argument should be an instance of Signature");var r=this.magicHash(),i=u.verify(r,t,e);return i||(this.error="The signature was invalid"),i},l.prototype.verify=function(e,t){h.checkArgument(e),h.checkArgument(t&&s.isString(t)),s.isString(e)&&(e=c.fromString(e));var r=f.fromCompact(new o(t,"base64")),i=new u;i.hashbuf=this.magicHash(),i.sig=r;var n=i.toPublicKey(),a=c.fromPublicKey(n,e.network);return e.toString()!==a.toString()?!(this.error="The signature did not match the message digest"):this._verify(n,r)},l.fromString=function(e){return new l(e)},l.fromJSON=function(e){return t.isValidJSON(e)&&(e=JSON.parse(e)),new l(e.message)},l.prototype.toObject=function(){return{message:this.message}},l.prototype.toJSON=function(){return JSON.stringify(this.toObject())},l.prototype.toString=function(){return this.message},l.prototype.inspect=function(){return""},d.exports=l}).call(this,r("buffer").Buffer)},{"bitcore-lib":78,buffer:191}],153:[function(e,r,i){(function(Q,U,u){!function(e){if("object"==(void 0===i?"undefined":_typeof(i))&&void 0!==r)r.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:void 0!==U?t=U:"undefined"!=typeof self&&(t=self),t.Promise=e()}}(function(){var e,t,r;return function a(o,s,c){function u(r,e){if(!s[r]){if(!o[r]){var t="function"==typeof _dereq_&&_dereq_;if(!e&&t)return t(r,!0);if(f)return f(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[r]={exports:{}};o[r][0].call(n.exports,function(e){var t=o[r][1][e];return u(t||e)},n,n.exports,a,o,s,c)}return s[r].exports}for(var f="function"==typeof _dereq_&&_dereq_,e=0;e, no stack trace)"}function V(){return"function"==typeof Y}var G=function(){return!1},$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function W(e){var t=e.match($);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function Z(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);Y(this,Z),32=a)return r[t]=e,this._queue.push(t),!1;null!==n&&(n[t]=e);var o=this._promise,s=this._callback,c=o._boundValue();o._pushContext();var u=g(s).call(c,e,t,i),f=o._popContext();if(m.checkForgottenReturns(u,f,null!==n?"Promise.filter":"Promise.map",o),u===v)return this._reject(u.e),!0;var p=d(u,this._promise);if(p instanceof l){var h=(p=p._target())._bitField;if(0==(50397184&h))return 1<=a&&this._inFlight++,(r[t]=p)._proxy(this,-1*(t+1)),!1;if(0==(33554432&h))return 0!=(16777216&h)?this._reject(p._reason()):this._cancel(),!0;u=p._value()}r[t]=u}return i<=++this._totalResolved&&(null!==n?this._filter(r,n):this._resolve(r),!0)},f.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;0>>16)){if(e===this){var r=c();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,0<(65535&t)&&(0!=(134217728&t)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},E.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,d.isNode);0<(65535&t)?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},E.prototype._fulfillPromises=function(e,t){for(var r=1;r=this._length&&(this._resolve(this._values),!0)},t.prototype._promiseCancelled=function(){return this._cancel(),!0},t.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},t.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof s)e.cancel();else for(var t=0;t=this._length){var r;if(this._isMap)r=function(e){for(var t=new s,r=e.length/2|0,i=0;i>1},i.prototype.props=function(){return r(this)},i.props=function(e){return r(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function i(e){this._capacity=e,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},n.prototype._promiseFulfilled=function(e,t){var r=new i;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},n.prototype._promiseRejected=function(e,t){var r=new i;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},e.settle=function(e){return r.deprecated(".settle()",".reflect()"),new n(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(f,e,t){"use strict";e.exports=function(e,t,n){var r=f("./util"),i=f("./errors").RangeError,a=f("./errors").AggregateError,o=r.isArray,s={};function c(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function u(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new c(e),i=r.promise();return r.setHowMany(t),r.init(),i}r.inherits(c,t),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=o(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(e){this._howMany=e},c.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(s),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);else if("le"===r)for(n=i=0;i>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-a&4194303,26<=(a+=24)&&(a-=26,i++);r+6!==t&&(n=o(e,t,r+6),this.words[i]|=n<>>26-a&4194303),this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=67108863&o,c=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,p=67108863&c,h=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=h;l++){var d=u-l|0;f+=(o=(n=0|e.words[d])*(a=0|t.words[l])+p)/67108864|0,p=67108863&o}r.words[u]=0|p,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}v.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,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}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)&&2<=e&&e<=36){var c=l[e],u=d[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var p=f.modn(u).toString(e);r=(f=f.idivn(u)).isZero()?p+r:h[c-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.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]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},v.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)},v.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},v.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},v.prototype.inotn=function(e){g("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},v.prototype.notn=function(e){return this.clone().inotn(e)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);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,e):(r=e,this);for(var n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},v.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;i=0>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],d=8191&l,m=l>>>13,g=0|o[2],v=8191&g,b=g>>>13,y=0|o[3],_=8191&y,w=y>>>13,k=0|o[4],x=8191&k,S=k>>>13,j=0|o[5],E=8191&j,A=j>>>13,I=0|o[6],P=8191&I,O=I>>>13,T=0|o[7],B=8191&T,C=T>>>13,F=0|o[8],R=8191&F,z=F>>>13,M=0|o[9],N=8191&M,D=M>>>13,q=0|s[0],L=8191&q,U=q>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],$=8191&G,W=G>>>13,Z=0|s[3],Y=8191&Z,X=Z>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],ae=8191&ne,oe=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],pe=8191&fe,he=fe>>>13,le=0|s[9],de=8191&le,me=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(p,L))|0)+((8191&(n=(n=Math.imul(p,U))+Math.imul(h,L)|0))<<13)|0;u=((a=Math.imul(h,U))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,L),n=(n=Math.imul(d,U))+Math.imul(m,L)|0,a=Math.imul(m,U);var ve=(u+(i=i+Math.imul(p,K)|0)|0)+((8191&(n=(n=n+Math.imul(p,V)|0)+Math.imul(h,K)|0))<<13)|0;u=((a=a+Math.imul(h,V)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(b,L)|0,a=Math.imul(b,U),i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,V)|0;var be=(u+(i=i+Math.imul(p,$)|0)|0)+((8191&(n=(n=n+Math.imul(p,W)|0)+Math.imul(h,$)|0))<<13)|0;u=((a=a+Math.imul(h,W)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(_,L),n=(n=Math.imul(_,U))+Math.imul(w,L)|0,a=Math.imul(w,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,i=i+Math.imul(d,$)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,W)|0;var ye=(u+(i=i+Math.imul(p,Y)|0)|0)+((8191&(n=(n=n+Math.imul(p,X)|0)+Math.imul(h,Y)|0))<<13)|0;u=((a=a+Math.imul(h,X)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(x,L),n=(n=Math.imul(x,U))+Math.imul(S,L)|0,a=Math.imul(S,U),i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,W)|0,i=i+Math.imul(d,Y)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,X)|0;var _e=(u+(i=i+Math.imul(p,Q)|0)|0)+((8191&(n=(n=n+Math.imul(p,ee)|0)+Math.imul(h,Q)|0))<<13)|0;u=((a=a+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(A,L)|0,a=Math.imul(A,U),i=i+Math.imul(x,K)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,V)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,W)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(b,Y)|0,a=a+Math.imul(b,X)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0;var we=(u+(i=i+Math.imul(p,re)|0)|0)+((8191&(n=(n=n+Math.imul(p,ie)|0)+Math.imul(h,re)|0))<<13)|0;u=((a=a+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(O,L)|0,a=Math.imul(O,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,V)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,W)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,X)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0;var ke=(u+(i=i+Math.imul(p,ae)|0)|0)+((8191&(n=(n=n+Math.imul(p,oe)|0)+Math.imul(h,ae)|0))<<13)|0;u=((a=a+Math.imul(h,oe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(C,L)|0,a=Math.imul(C,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(O,K)|0,a=a+Math.imul(O,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,W)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(S,Y)|0,a=a+Math.imul(S,X)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ie)|0,i=i+Math.imul(d,ae)|0,n=(n=n+Math.imul(d,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var xe=(u+(i=i+Math.imul(p,ce)|0)|0)+((8191&(n=(n=n+Math.imul(p,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((a=a+Math.imul(h,ue)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(R,L),n=(n=Math.imul(R,U))+Math.imul(z,L)|0,a=Math.imul(z,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,W)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ie)|0,i=i+Math.imul(v,ae)|0,n=(n=n+Math.imul(v,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,i=i+Math.imul(d,ce)|0,n=(n=n+Math.imul(d,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0;var Se=(u+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,he)|0)+Math.imul(h,pe)|0))<<13)|0;u=((a=a+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,U))+Math.imul(D,L)|0,a=Math.imul(D,U),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(z,K)|0,a=a+Math.imul(z,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,W)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,Y)|0,a=a+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ie)|0,i=i+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,i=i+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,ue)|0,i=i+Math.imul(d,pe)|0,n=(n=n+Math.imul(d,he)|0)+Math.imul(m,pe)|0,a=a+Math.imul(m,he)|0;var je=(u+(i=i+Math.imul(p,de)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(h,de)|0))<<13)|0;u=((a=a+Math.imul(h,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(N,K),n=(n=Math.imul(N,V))+Math.imul(D,K)|0,a=Math.imul(D,V),i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,W)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,W)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(C,Y)|0,a=a+Math.imul(C,X)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ie)|0,i=i+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,ue)|0,i=i+Math.imul(v,pe)|0,n=(n=n+Math.imul(v,he)|0)+Math.imul(b,pe)|0,a=a+Math.imul(b,he)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;u=((a=a+Math.imul(m,me)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(N,$),n=(n=Math.imul(N,W))+Math.imul(D,$)|0,a=Math.imul(D,W),i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,X)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ie)|0,i=i+Math.imul(E,ae)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,i=i+Math.imul(x,ce)|0,n=(n=n+Math.imul(x,ue)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,ue)|0,i=i+Math.imul(_,pe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,pe)|0,a=a+Math.imul(w,he)|0;var Ae=(u+(i=i+Math.imul(v,de)|0)|0)+((8191&(n=(n=n+Math.imul(v,me)|0)+Math.imul(b,de)|0))<<13)|0;u=((a=a+Math.imul(b,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(N,Y),n=(n=Math.imul(N,X))+Math.imul(D,Y)|0,a=Math.imul(D,X),i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ie)|0,i=i+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,i=i+Math.imul(x,pe)|0,n=(n=n+Math.imul(x,he)|0)+Math.imul(S,pe)|0,a=a+Math.imul(S,he)|0;var Ie=(u+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,me)|0)+Math.imul(w,de)|0))<<13)|0;u=((a=a+Math.imul(w,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(N,Q),n=(n=Math.imul(N,ee))+Math.imul(D,Q)|0,a=Math.imul(D,ee),i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ie)|0,i=i+Math.imul(B,ae)|0,n=(n=n+Math.imul(B,oe)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,ue)|0,i=i+Math.imul(E,pe)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(A,pe)|0,a=a+Math.imul(A,he)|0;var Pe=(u+(i=i+Math.imul(x,de)|0)|0)+((8191&(n=(n=n+Math.imul(x,me)|0)+Math.imul(S,de)|0))<<13)|0;u=((a=a+Math.imul(S,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(N,re),n=(n=Math.imul(N,ie))+Math.imul(D,re)|0,a=Math.imul(D,ie),i=i+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,i=i+Math.imul(B,ce)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,ue)|0,i=i+Math.imul(P,pe)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(O,pe)|0,a=a+Math.imul(O,he)|0;var Oe=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(A,de)|0))<<13)|0;u=((a=a+Math.imul(A,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(N,ae),n=(n=Math.imul(N,oe))+Math.imul(D,ae)|0,a=Math.imul(D,oe),i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(z,ce)|0,a=a+Math.imul(z,ue)|0,i=i+Math.imul(B,pe)|0,n=(n=n+Math.imul(B,he)|0)+Math.imul(C,pe)|0,a=a+Math.imul(C,he)|0;var Te=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(O,de)|0))<<13)|0;u=((a=a+Math.imul(O,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(N,ce),n=(n=Math.imul(N,ue))+Math.imul(D,ce)|0,a=Math.imul(D,ue),i=i+Math.imul(R,pe)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(z,pe)|0,a=a+Math.imul(z,he)|0;var Be=(u+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,me)|0)+Math.imul(C,de)|0))<<13)|0;u=((a=a+Math.imul(C,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(N,pe),n=(n=Math.imul(N,he))+Math.imul(D,pe)|0,a=Math.imul(D,he);var Ce=(u+(i=i+Math.imul(R,de)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(z,de)|0))<<13)|0;u=((a=a+Math.imul(z,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Fe=(u+(i=Math.imul(N,de))|0)+((8191&(n=(n=Math.imul(N,me))+Math.imul(D,de)|0))<<13)|0;return u=((a=Math.imul(D,me))+(n>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,c[0]=ge,c[1]=ve,c[2]=be,c[3]=ye,c[4]=_e,c[5]=we,c[6]=ke,c[7]=xe,c[8]=Se,c[9]=je,c[10]=Ee,c[11]=Ae,c[12]=Ie,c[13]=Pe,c[14]=Oe,c[15]=Te,c[16]=Be,c[17]=Ce,c[18]=Fe,0!==u&&(c[19]=u,r.length++),r};function s(e,t,r){return(new c).mulp(e,t,r)}function c(e,t){this.x=e,this.y=t}Math.imul||(a=n),v.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?a(this,e,t):r<63?n(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,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},c.prototype.makeRBT=function(e){for(var t=new Array(e),r=v.prototype._countBits(e)-1,i=0;i>=1;return i},c.prototype.permute=function(e,t,r,i,n,a){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*a+1]=8191&n,n>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.muln=function(e){return this.clone().imuln(e)},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.imul(this.clone())},v.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 v(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<a)for(this.length-=a,c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},v.prototype.ishrn=function(e,t,r){return g(0===this.negative),this.iushrn(e,t,r)},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.ushln=function(e){return this.clone().iushln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.ushrn=function(e){return this.clone().iushrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===o)return this.strip();for(g(-1===o),i=o=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,a},v.prototype.div=function(e){return this.divmod(e,"div",!1).div},v.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},v.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},v.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),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(0===e.negative),g(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var c=r.clone(),u=t.clone();!t.isZero();){for(var f=0,p=1;0==(t.words[0]&p)&&f<26;++f,p<<=1);if(0>>26,o&=67108863,this.words[a]=o}return 0!==n&&(this.words[a]=n,this.length++),this},v.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},v.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(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(u[e])return u[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new b;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return u[e]=t},w.prototype._verify1=function(e){g(0===e.negative,"red works only with positives"),g(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){g(0==(e.negative|t.negative),"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},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 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&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();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);g(!i.isZero());var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==a?(a<<=1,a|=f,(4===++o||0===i&&0===u)&&(n=this.mul(n,r[a]),a=o=0)):o=0}s=26}return n},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},v.mont=function(e){return new k(e)},r(k,w),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.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),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new v(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:157}],155:[function(e,t,r){var A=e("concat-map"),I=e("balanced-match");t.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function t(e,r){var i=[];var n=I("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var s=a||o;var c=0<=n.body.indexOf(",");if(!s&&!c)return n.post.match(/,.*\}/)?(e=n.pre+"{"+n.body+P+n.post,t(e)):[e];var u;if(s)u=n.body.split(/\.\./);else if(1===(u=T(n.body)).length&&1===(u=t(u[0],!1).map(B)).length){var f=n.post.length?t(n.post,!1):[""];return f.map(function(e){return n.pre+u[0]+e})}var p=n.pre;var f=n.post.length?t(n.post,!1):[""];var h;if(s){var l=O(u[0]),d=O(u[1]),m=Math.max(u[0].length,u[1].length),g=3==u.length?Math.abs(O(u[2])):1,v=F,b=d>>24]^f[d>>>16&255]^p[m>>>8&255]^h[255&g]^t[v++],o=u[d>>>24]^f[m>>>16&255]^p[g>>>8&255]^h[255&l]^t[v++],s=u[m>>>24]^f[g>>>16&255]^p[l>>>8&255]^h[255&d]^t[v++],c=u[g>>>24]^f[l>>>16&255]^p[d>>>8&255]^h[255&m]^t[v++],l=a,d=o,m=s,g=c;return a=(i[l>>>24]<<24|i[d>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[v++],o=(i[d>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&l])^t[v++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[l>>>8&255]<<8|i[255&d])^t[v++],c=(i[g>>>24]<<24|i[l>>>16&255]<<16|i[d>>>8&255]<<8|i[255&m])^t[v++],[a>>>=0,o>>>=0,s>>>=0,c>>>=0]}var p=[0,1,2,4,8,16,32,64,128,27,54],h=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=[[],[],[],[]],a=[[],[],[],[]],o=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;var f=e[i[r[o]=u]=o],p=e[f],h=e[p],l=257*e[u]^16843008*u;n[0][o]=l<<24|l>>>8,n[1][o]=l<<16|l>>>16,n[2][o]=l<<8|l>>>24,n[3][o]=l,l=16843009*h^65537*p^257*f^16843008*o,a[0][u]=l<<24|l>>>8,a[1][u]=l<<16|l>>>16,a[2][u]=l<<8|l>>>24,a[3][u]=l,0===o?o=s=1:(o=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();function s(e){this._key=a(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],a=0;a>>24,o=h.SBOX[o>>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o],o^=p[a/t|0]<<24):6>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o]),n[a]=n[a-t]^o}for(var s=[],c=0;c>>24]]^h.INV_SUB_MIX[1][h.SBOX[f>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[f>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return o(e=a(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=a(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":447}],159:[function(e,t,r){var o=e("./aes"),u=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),f=e("./ghash"),n=e("buffer-xor"),p=e("./incr32");function a(e,t,r,i){s.call(this);var n=u.alloc(4,0);this._cipher=new o.AES(t);var a=this._cipher.encryptBlock(n);this._ghash=new f(a),r=function(e,t,r){if(12===t.length)return e._finID=u.concat([t,u.from([0,0,0,1])]),u.concat([t,u.from([0,0,0,2])]);var i=new f(r),n=t.length,a=n%16;i.update(t),a&&(a=16-a,i.update(u.alloc(a,0))),i.update(u.alloc(8,0));var o=8*n,s=u.alloc(8);s.writeUIntBE(o,0,8),i.update(s),e._finID=i.state;var c=u.from(e._finID);return p(c),c}(this,r,a),this._prev=u.from(r),this._cache=u.allocUnsafe(0),this._secCache=u.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(a,s),a.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=u.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},a.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(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;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":447}],164:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],165:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":190}],166:[function(e,t,r){var a=e("safe-buffer").Buffer,o=e("buffer-xor");function s(e,t,r){var i=t.length,n=o(t,e._cache);return e._cache=e._cache.slice(i),e._prev=a.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=a.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=a.allocUnsafe(0)),!(e._cache.length<=t.length)){n=a.concat([n,s(e,t,r)]);break}i=e._cache.length,n=a.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":190,"safe-buffer":447}],167:[function(e,t,r){var o=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,a=-1,o=0;++a<8;)i=t&1<<7-a?128:0,o+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>a%8,e._prev=c(e._prev,r?i:n);return o}function c(e,t){var r=e.length,i=-1,n=o.allocUnsafe(e.length);for(e=o.concat([e,o.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=o.allocUnsafe(i),a=-1;++a=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var a=m(r);if("ec"===a.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=g[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new d(i),a=r.data.subjectPrivateKey.data;return n.verify(t,e,a)}(e,t,a)}if("dsa"===a.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,a=r.data.g,o=r.data.pub_key,s=m.signature.decode(e,"der"),c=s.s,u=s.r;v(c,n),v(u,n);var f=l.mont(i),p=c.invm(n);return 0===a.toRed(f).redPow(new l(t).mul(p).mod(n)).fromRed().mul(o.toRed(f).redPow(u.mul(p).mod(n)).fromRed()).mod(i).mod(n).cmp(u)}(e,t,a)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var o=a.modulus.byteLength(),s=[1],c=0;t.length+s.length+2l.UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function h(e,t){for(var r=0;rm.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsm.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelm.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelm.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=m.Z_FILTERED&&e.strategy!=m.Z_HUFFMAN_ONLY&&e.strategy!=m.Z_RLE&&e.strategy!=m.Z_FIXED&&e.strategy!=m.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!g.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new o.Zlib(t);var i=this;this._hadError=!1,this._binding.onerror=function(e,t){i._binding=null,i._hadError=!0;var r=new Error(e);r.errno=t,r.code=m.codes[t],i.emit("error",r)};var r=m.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(r=e.level);var n=m.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(n=e.strategy),this._binding.init(e.windowBits||m.Z_DEFAULT_WINDOWBITS,r,e.memLevel||m.Z_DEFAULT_MEMLEVEL,n,e.dictionary),this._buffer=new g(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=n,this.once("end",this.close)}o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION,Object.keys(o).forEach(function(e){e.match(/^Z/)&&(m[e]=o[e])}),m.codes={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},Object.keys(m.codes).forEach(function(e){m.codes[m.codes[e]]=e}),m.Deflate=s,m.Inflate=c,m.Gzip=u,m.Gunzip=f,m.DeflateRaw=p,m.InflateRaw=h,m.Unzip=l,m.createDeflate=function(e){return new s(e)},m.createInflate=function(e){return new c(e)},m.createDeflateRaw=function(e){return new p(e)},m.createInflateRaw=function(e){return new h(e)},m.createGzip=function(e){return new u(e)},m.createGunzip=function(e){return new f(e)},m.createUnzip=function(e){return new l(e)},m.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new s(t),e,r)},m.deflateSync=function(e,t){return r(new s(t),e)},m.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new u(t),e,r)},m.gzipSync=function(e,t){return r(new u(t),e)},m.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new p(t),e,r)},m.deflateRawSync=function(e,t){return r(new p(t),e)},m.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new l(t),e,r)},m.unzipSync=function(e,t){return r(new l(t),e)},m.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new c(t),e,r)},m.inflateSync=function(e,t){return r(new c(t),e)},m.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new f(t),e,r)},m.gunzipSync=function(e,t){return r(new f(t),e)},m.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new h(t),e,r)},m.inflateRawSync=function(e,t){return r(new h(t),e)},e.inherits(t,a),t.prototype.params=function(e,t,r){if(em.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=m.Z_FILTERED&&t!=m.Z_HUFFMAN_ONLY&&t!=m.Z_RLE&&t!=m.Z_FIXED&&t!=m.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var i=this;this.flush(o.Z_SYNC_FLUSH,function(){i._binding.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())})}else n.nextTick(r)},t.prototype.reset=function(){return this._binding.reset()},t.prototype._flush=function(e){this._transform(new g(0),"",e)},t.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=o.Z_FULL_FLUSH),r.ended)t&&n.nextTick(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var i=this;this.once("drain",function(){i.flush(t)})}else this._flushFlag=e,this.write(new g(0),"",t)},t.prototype.close=function(e){if(e&&n.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;n.nextTick(function(){t.emit("close")})}},t.prototype._transform=function(e,t,r){var i,n=this._writableState,a=(n.ending||n.ended)&&(!e||n.length===e.length);if(null===!e&&!g.isBuffer(e))return r(new Error("invalid input"));a?i=o.Z_FINISH:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH));this._processChunk(e,i,r)},t.prototype._processChunk=function(a,o,s){var c=a&&a.length,u=this._chunkSize-this._offset,f=0,p=this,h="function"==typeof s;if(!h){var t,l=[],d=0;this.on("error",function(e){t=e});do{var e=this._binding.writeSync(o,a,f,c,this._buffer,this._offset,u)}while(!this._hadError&&m(e[0],e[1]));if(this._hadError)throw t;var r=g.concat(l,d);return this.close(),r}var i=this._binding.write(o,a,f,c,this._buffer,this._offset,u);function m(e,t){if(!p._hadError){var r=u-t;if(v(0<=r,"have should not go down"),0=p._chunkSize)&&(u=p._chunkSize,p._offset=0,p._buffer=new g(p._chunkSize)),0===t){if(f+=c-e,c=e,!h)return!0;var n=p._binding.write(o,a,f,c,p._buffer,p._offset,p._chunkSize);return n.callback=m,void(n.buffer=a)}if(!h)return!1;s()}}i.buffer=a,i.callback=m},e.inherits(s,t),e.inherits(c,t),e.inherits(u,t),e.inherits(f,t),e.inherits(p,t),e.inherits(h,t),e.inherits(l,t)}).call(this,d("_process"),d("buffer").Buffer)},{"./binding":185,_process:382,_stream_transform:427,assert:67,buffer:191,util:505}],187:[function(e,t,r){arguments[4][157][0].apply(r,arguments)},{dup:157}],188:[function(e,B,C){(function(T){!function(e){var t="object"==(void 0===C?"undefined":_typeof(C))&&C&&!C.nodeType&&C,r="object"==(void 0===B?"undefined":_typeof(B))&&B&&!B.nodeType&&B,i="object"==(void 0===T?"undefined":_typeof(T))&&T;i.global!==i&&i.window!==i&&i.self!==i||(e=i);var n,a,v=2147483647,b=36,y=1,_=26,o=38,s=700,w=72,k=128,x="-",c=/^xn--/,u=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=b-y,S=Math.floor,j=String.fromCharCode;function E(e){throw new RangeError(p[e])}function l(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function d(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((v-d)/o))&&E("overflow"),d+=c*o,!(c<(u=s<=g?y:g+_<=s?_:s-g));s+=b)o>S(v/(f=b-u))&&E("overflow"),o*=f;g=O(d-a,t=h.length+1,0==a),S(d/t)>v-m&&E("overflow"),m+=S(d/t),d%=t,h.splice(d++,0,m)}return I(h)}function g(e){var t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g=[];for(h=(e=A(e)).length,t=k,a=w,o=r=0;oS((v-r)/(l=i+1))&&E("overflow"),r+=(s-t)*l,t=s,o=0;ov&&E("overflow"),p==t){for(c=r,u=b;!(c<(f=u<=a?y:a+_<=u?_:u-a));u+=b)m=c-f,d=b-f,g.push(j(P(f+m%d,0))),c=S(m/d);g.push(j(P(c,0))),a=O(r,l,i==n),r=0,++i}++r,++t}return g.join("")}if(n={version:"1.4.1",ucs2:{decode:A,encode:I},decode:m,encode:g,toASCII:function(e){return d(e,function(e){return u.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return d(e,function(e){return c.test(e)?m(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",function(){return n});else if(t&&r)if(B.exports==t)r.exports=n;else for(a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],189:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var a=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=c;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function c(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}a.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},a.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:191}],190:[function(e,t,r){(function(a){t.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new a(r),n=0;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function l(e,t){if(p.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return R(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=p.from(t,i)),p.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,n);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,n){var a,o=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;s/=o=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var f=-1;for(a=r;a>>10&1023|55296),f=56320|1023&f),i.push(f),n+=p}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;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 S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===p.compare(this,e)},p.prototype.inspect=function(){var e="",t=N.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,i,n){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(i,n),u=e.slice(t,r),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a,o,s,c,u,f,p,h,l,d=!1;;)switch(i){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return h=t,l=r,M(R(e,(p=this).length-h),p,h,l);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return c=this,u=t,f=r,M(z(e),c,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=t,s=r,M(function(e,t){for(var r,i,n,a=[],o=0;o>8,n=r%256,a.push(n),a.push(i);return a}(e,(a=this).length-o),a,o,s);default:if(d)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function k(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function I(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function P(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function O(e,t,r,i,n,a){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(e,t,r,i,n){return n||O(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function B(e,t,r,i,n){return n||O(e,0,r,8),a.write(e,t,r,i,52,8),r+8}p.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):I(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;0<=--a&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function z(e){return i.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function M(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":75,ieee754:318,isarray:323}],192:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],193:[function(e,t,r){function n(e){this.dict=e||{}}n.prototype.set=function(e,t,r){if("object"!==(void 0===e?"undefined":_typeof(e))){void 0===r&&(r=!0);var i=this.has(e);return!r&&i?this.dict[i]=this.dict[i]+","+t:this.dict[i||e]=t,i}for(var n in e)this.set(n,e[n],t)},n.prototype.has=function(e){for(var t=Object.keys(this.dict),r=(e=e.toLowerCase(),0);rr)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>8^255&n^99,u[r]=n;var a=e[f[n]=r],o=e[a],s=e[o],c=257*e[n]^16843008*n;p[r]=c<<24|c>>>8,h[r]=c<<16|c>>>16,l[r]=c<<8|c>>>24,d[r]=c;c=16843009*s^65537*o^257*a^16843008*r;m[n]=c<<24|c>>>8,g[n]=c<<16|c>>>16,v[n]=c<<8|c>>>24,b[n]=c,r?(r=a^e[e[e[s^a]]],i^=e[e[i]]):r=i=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],i=r.AES=t.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),n=this._keySchedule=[],a=0;a>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o]):(o=u[(o=o<<8|o>>>24)>>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o],o^=y[a/r|0]<<24),n[a]=n[a-r]^o}for(var s=this._invKeySchedule=[],c=0;c>>24]]^g[u[o>>>16&255]]^v[u[o>>>8&255]]^b[u[255&o]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,p,h,l,d,u)},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,m,g,v,b,f);r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,a,o,s){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],p=e[t+2]^r[2],h=e[t+3]^r[3],l=4,d=1;d>>24]^n[f>>>16&255]^a[p>>>8&255]^o[255&h]^r[l++],g=i[f>>>24]^n[p>>>16&255]^a[h>>>8&255]^o[255&u]^r[l++],v=i[p>>>24]^n[h>>>16&255]^a[u>>>8&255]^o[255&f]^r[l++],b=i[h>>>24]^n[u>>>16&255]^a[f>>>8&255]^o[255&p]^r[l++];u=m,f=g,p=v,h=b}m=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&h])^r[l++],g=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[h>>>8&255]<<8|s[255&u])^r[l++],v=(s[p>>>24]<<24|s[h>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^r[l++],b=(s[h>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^r[l++];e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=b},keySize:8});e.AES=t._createHelper(i)}(),n.AES},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],206:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,c,n,a,o,s,u,f,p,h,l,d,m,g,v,b;e.lib.Cipher||(r=(t=e).lib,i=r.Base,c=r.WordArray,n=r.BufferedBlockAlgorithm,(a=t.enc).Utf8,o=a.Base64,s=t.algo.EvpKDF,u=r.Cipher=n.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function n(e){return"string"==typeof e?b:g}return function(i){return{encrypt:function(e,t,r){return n(t).encrypt(i,e,t,r)},decrypt:function(e,t,r){return n(t).decrypt(i,e,t,r)}}}}()}),r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),f=t.mode={},p=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var e=p.extend();function a(e,t,r){var i=this._iv;if(i){var n=i;this._iv=void 0}else n=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:l}),reset:function(){u.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else{i=r.createDecryptor;this._minBufferSize=1}this._mode=i.call(r,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),d=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var i=c.create([1398893684,1701076831]).concat(r).concat(t);else i=t;return i.toString(o)},parse:function(e){var t=o.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var i=c.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return d.create({ciphertext:t,salt:i})}},g=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),a=n.finalize(t),o=n.cfg;return d.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.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}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=c.random(8));var n=s.create({keySize:t+r}).compute(e,i),a=c.create(n.words.slice(t),4*r);return n.sigBytes=4*t,d.create({key:n,iv:a,salt:i})}},b=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),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 a=g.encrypt.call(this,e,t,n.key,i);return a.mixIn(n),a},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,g.decrypt.call(this,e,t,n.key,i)}}))},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],207:[function(e,t,r){var i,n;i=this,n=function(){var f,r,e,t,i,p,n,a,o,s,c,u,h=h||(f=Math,r=Object.create||function(){function r(){}return function(e){var t;return r.prototype=e,t=new r,r.prototype=null,t}}(),t=(e={}).lib={},i=t.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$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)}},p=t.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).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 a=0;a>>2]>>>24-a%4*8&255;t[i+a>>>2]|=o<<24-(i+a)%4*8}else for(a=0;a>>2]=r[a>>>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=f.ceil(t/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,r=[],i=function(t){t=t;var r=987654321,i=4294967295;return function(){var e=((r=36969*(65535&r)+(r>>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return e/=4294967296,(e+=.5)*(.5>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).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 p.init(r,t/2)}},o=n.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(a))}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 p.init(r,t)}},s=n.Utf8={stringify:function(e){try{return decodeURIComponent(escape(o.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return o.parse(unescape(encodeURIComponent(e)))}},c=t.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=s.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,n=this.blockSize,a=i/(4*n),o=(a=e?f.ceil(a):f.max((0|a)-this._minBufferSize,0))*n,s=f.min(4*o,i);if(o){for(var c=0;c>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.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,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var n=0;n>>6-a%4*2;i[n>>>2]|=(o|s)<<24-n%4*8,n++}return c.create(i,n)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],209:[function(e,t,r){var i,n;i=this,n=function(r){return function(){var e=r,n=e.lib.WordArray,t=e.enc;t.Utf16=t.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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}};function o(e){return e<<8&4278255360|e>>>8&16711935}t.Utf16LE={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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return n.create(r,2*t)}}}(),r.enc.Utf16},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],210:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,f,n,a,o;return r=(t=e).lib,i=r.Base,f=r.WordArray,n=t.algo,a=n.MD5,o=n.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=r.hasher.create(),n=f.create(),a=n.words,o=r.keySize,s=r.iterations;a.lengthi&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),a=this._iKey=t.clone(),o=n.words,s=a.words,c=0;c>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)}).prototype=e}}(),t.lib.WordArray},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],215:[function(e,t,r){var i,n;i=this,n=function(o){return function(f){var e=o,t=e.lib,r=t.WordArray,i=t.Hasher,n=e.algo,E=[];!function(){for(var e=0;e<64;e++)E[e]=4294967296*f.abs(f.sin(e+1))|0}();var a=n.MD5=i.extend({_doReset:function(){this._hash=new r.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 a=this._hash.words,o=e[t+0],s=e[t+1],c=e[t+2],u=e[t+3],f=e[t+4],p=e[t+5],h=e[t+6],l=e[t+7],d=e[t+8],m=e[t+9],g=e[t+10],v=e[t+11],b=e[t+12],y=e[t+13],_=e[t+14],w=e[t+15],k=a[0],x=a[1],S=a[2],j=a[3];x=O(x=O(x=O(x=O(x=P(x=P(x=P(x=P(x=I(x=I(x=I(x=I(x=A(x=A(x=A(x=A(x,S=A(S,j=A(j,k=A(k,x,S,j,o,7,E[0]),x,S,s,12,E[1]),k,x,c,17,E[2]),j,k,u,22,E[3]),S=A(S,j=A(j,k=A(k,x,S,j,f,7,E[4]),x,S,p,12,E[5]),k,x,h,17,E[6]),j,k,l,22,E[7]),S=A(S,j=A(j,k=A(k,x,S,j,d,7,E[8]),x,S,m,12,E[9]),k,x,g,17,E[10]),j,k,v,22,E[11]),S=A(S,j=A(j,k=A(k,x,S,j,b,7,E[12]),x,S,y,12,E[13]),k,x,_,17,E[14]),j,k,w,22,E[15]),S=I(S,j=I(j,k=I(k,x,S,j,s,5,E[16]),x,S,h,9,E[17]),k,x,v,14,E[18]),j,k,o,20,E[19]),S=I(S,j=I(j,k=I(k,x,S,j,p,5,E[20]),x,S,g,9,E[21]),k,x,w,14,E[22]),j,k,f,20,E[23]),S=I(S,j=I(j,k=I(k,x,S,j,m,5,E[24]),x,S,_,9,E[25]),k,x,u,14,E[26]),j,k,d,20,E[27]),S=I(S,j=I(j,k=I(k,x,S,j,y,5,E[28]),x,S,c,9,E[29]),k,x,l,14,E[30]),j,k,b,20,E[31]),S=P(S,j=P(j,k=P(k,x,S,j,p,4,E[32]),x,S,d,11,E[33]),k,x,v,16,E[34]),j,k,_,23,E[35]),S=P(S,j=P(j,k=P(k,x,S,j,s,4,E[36]),x,S,f,11,E[37]),k,x,l,16,E[38]),j,k,g,23,E[39]),S=P(S,j=P(j,k=P(k,x,S,j,y,4,E[40]),x,S,o,11,E[41]),k,x,u,16,E[42]),j,k,h,23,E[43]),S=P(S,j=P(j,k=P(k,x,S,j,m,4,E[44]),x,S,b,11,E[45]),k,x,w,16,E[46]),j,k,c,23,E[47]),S=O(S,j=O(j,k=O(k,x,S,j,o,6,E[48]),x,S,l,10,E[49]),k,x,_,15,E[50]),j,k,p,21,E[51]),S=O(S,j=O(j,k=O(k,x,S,j,b,6,E[52]),x,S,u,10,E[53]),k,x,g,15,E[54]),j,k,s,21,E[55]),S=O(S,j=O(j,k=O(k,x,S,j,d,6,E[56]),x,S,w,10,E[57]),k,x,h,15,E[58]),j,k,y,21,E[59]),S=O(S,j=O(j,k=O(k,x,S,j,f,6,E[60]),x,S,v,10,E[61]),k,x,c,15,E[62]),j,k,m,21,E[63]),a[0]=a[0]+k|0,a[1]=a[1]+x|0,a[2]=a[2]+S|0,a[3]=a[3]+j|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var n=f.floor(r/4294967296),a=r;t[15+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,s=o.words,c=0;c<4;c++){var u=s[c];s[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function A(e,t,r,i,n,a,o){var s=e+(t&r|~t&i)+n+o;return(s<>>32-a)+t}function I(e,t,r,i,n,a,o){var s=e+(t&i|r&~i)+n+o;return(s<>>32-a)+t}function P(e,t,r,i,n,a,o){var s=e+(t^r^i)+n+o;return(s<>>32-a)+t}function O(e,t,r,i,n,a,o){var s=e+(r^(t|~i))+n+o;return(s<>>32-a)+t}e.MD5=i._createHelper(a),e.HmacMD5=i._createHmacHelper(a)}(Math),o.MD5},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],216:[function(e,t,r){var i,n;i=this,n=function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function a(e,t,r,i){var n=this._iv;if(n){var a=n.slice(0);this._iv=void 0}else a=this._prevBlock;i.encryptBlock(a,0);for(var o=0;o>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 t=e.Encryptor=e.extend({processBlock:function(e,t){var r,i=this._cipher,n=i.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),0===((r=o)[0]=u(r[0]))&&(r[1]=u(r[1]));var s=o.slice(0);i.encryptBlock(s,0);for(var c=0;c>>2]|=n<<24-a%4*8,e.sigBytes+=n},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],222:[function(e,t,r){var i,n;i=this,n=function(n){return n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],223:[function(e,t,r){var i,n;i=this,n=function(r){return r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],224:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],225:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],226:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,v,n,a,b,o;return r=(t=e).lib,i=r.Base,v=r.WordArray,n=t.algo,a=n.SHA1,b=n.HMAC,o=n.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=b.create(r.hasher,e),n=v.create(),a=v.create([1]),o=n.words,s=a.words,c=r.keySize,u=r.iterations;o.length>>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]],n=this._b=0;n<4;n++)h.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;i[0]^=c,i[1]^=f,i[2]^=u,i[3]^=p,i[4]^=c,i[5]^=f,i[6]^=u,i[7]^=p;for(n=0;n<4;n++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.RabbitLegacy=t._createHelper(i)}(),a.RabbitLegacy},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],228:[function(e,t,r){var i,n;i=this,n=function(a){return function(){var e=a,t=e.lib.StreamCipher,r=e.algo,n=[],c=[],u=[],i=r.Rabbit=t.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(r=this._b=0;r<4;r++)h.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;n[0]^=c,n[1]^=f,n[2]^=u,n[3]^=p,n[4]^=c,n[5]^=f,n[6]^=u,n[7]^=p;for(r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.Rabbit=t._createHelper(i)}(),a.Rabbit},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],229:[function(e,t,r){var i,n;i=this,n=function(o){return function(){var e=o,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.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 a=0;n<256;n++){var o=n%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+i[n]+s)%256;var c=i[n];i[n]=i[a],i[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=n.call(this)},keySize:8,ivSize:0});function n(){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 a=e[t];e[t]=e[r],e[r]=a,i|=e[(e[t]+e[r])%256]<<24-8*n}return this._i=t,this._j=r,i}e.RC4=t._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;0>>24)|4278255360&(n<<24|n>>>8)}var a,o,s,c,u,f,p,h,l,d,m,g=this._hash.words,v=A.words,b=I.words,y=x.words,_=S.words,w=j.words,k=E.words;f=a=g[0],p=o=g[1],h=s=g[2],l=c=g[3],d=u=g[4];for(r=0;r<80;r+=1)m=a+e[t+y[r]]|0,m+=r<16?P(o,s,c)+v[0]:r<32?O(o,s,c)+v[1]:r<48?T(o,s,c)+v[2]:r<64?B(o,s,c)+v[3]:C(o,s,c)+v[4],m=(m=F(m|=0,w[r]))+u|0,a=u,u=c,c=F(s,10),s=o,o=m,m=f+e[t+_[r]]|0,m+=r<16?C(p,h,l)+b[0]:r<32?B(p,h,l)+b[1]:r<48?T(p,h,l)+b[2]:r<64?O(p,h,l)+b[3]:P(p,h,l)+b[4],m=(m=F(m|=0,k[r]))+d|0,f=d,d=l,l=F(h,10),h=p,p=m;m=g[1]+s+l|0,g[1]=g[2]+c+d|0,g[2]=g[3]+u+f|0,g[3]=g[4]+a+p|0,g[4]=g[0]+o+h|0,g[0]=m},_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,a=n.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function P(e,t,r){return e^t^r}function O(e,t,r){return e&t|~e&r}function T(e,t,r){return(e|~t)^r}function B(e,t,r){return e&r|t&~r}function C(e,t,r){return e^(t|~r)}function F(e,t){return e<>>32-t}t.RIPEMD160=n._createHelper(o),t.HmacRIPEMD160=n._createHmacHelper(o)}(Math),s.RIPEMD160},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],231:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,p,o;return r=(t=e).lib,i=r.WordArray,n=r.Hasher,a=t.algo,p=[],o=a.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],a=r[2],o=r[3],s=r[4],c=0;c<80;c++){if(c<16)p[c]=0|e[t+c];else{var u=p[c-3]^p[c-8]^p[c-14]^p[c-16];p[c]=u<<1|u>>>31}var f=(i<<5|i>>>27)+s+p[c];f+=c<20?1518500249+(n&a|~n&o):c<40?1859775393+(n^a^o):c<60?(n&a|n&o|a&o)-1894007588:(n^a^o)-899497514,s=o,o=a,a=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|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(o),t.HmacSHA1=n._createHmacHelper(o),e.SHA1},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],232:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a;return r=(t=e).lib.WordArray,i=t.algo,n=i.SHA256,a=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(a),t.HmacSHA224=n._createHmacHelper(a),e.SHA224},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],n):n(i.CryptoJS)},{"./core":207,"./sha256":233}],233:[function(e,t,r){var i,n;i=this,n=function(c){return function(n){var e=c,t=e.lib,r=t.WordArray,i=t.Hasher,a=e.algo,o=[],y=[];!function(){function e(e){for(var t=n.sqrt(e),r=2;r<=t;r++)if(!(e%r))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(o[i]=t(n.pow(r,.5))),y[i]=t(n.pow(r,1/3)),i++),r++}();var _=[],s=a.SHA256=i.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=0;p<64;p++){if(p<16)_[p]=0|e[t+p];else{var h=_[p-15],l=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,d=_[p-2],m=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;_[p]=l+_[p-7]+m+_[p-16]}var g=i&n^i&a^n&a,v=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&u)+y[p]+_[p];f=u,u=c,c=s,s=o+b|0,o=a,a=n,n=i,i=b+(v+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+u|0,r[7]=r[7]+f|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)]=n.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA256=i._createHelper(s),e.HmacSHA256=i._createHmacHelper(s)}(Math),c.SHA256},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],234:[function(e,t,r){var i,n;i=this,n=function(a){return function(h){var e=a,t=e.lib,l=t.WordArray,i=t.Hasher,f=e.x64.Word,r=e.algo,P=[],O=[],T=[];!function(){for(var e=1,t=0,r=0;r<24;r++){P[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++)O[e+5*t]=t+(2*e+3*t)%5*5;for(var n=1,a=0;a<24;a++){for(var o=0,s=0,c=0;c<7;c++){if(1&n){var u=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(S=r[n]).high^=o,S.low^=a}for(var s=0;s<24;s++){for(var c=0;c<5;c++){for(var u=0,f=0,p=0;p<5;p++){u^=(S=r[c+5*p]).high,f^=S.low}var h=B[c];h.high=u,h.low=f}for(c=0;c<5;c++){var l=B[(c+4)%5],d=B[(c+1)%5],m=d.high,g=d.low;for(u=l.high^(m<<1|g>>>31),f=l.low^(g<<1|m>>>31),p=0;p<5;p++){(S=r[c+5*p]).high^=u,S.low^=f}}for(var v=1;v<25;v++){var b=(S=r[v]).high,y=S.low,_=P[v];if(_<32)u=b<<_|y>>>32-_,f=y<<_|b>>>32-_;else u=y<<_-32|b>>>64-_,f=b<<_-32|y>>>64-_;var w=B[O[v]];w.high=u,w.low=f}var k=B[0],x=r[0];k.high=x.high,k.low=x.low;for(c=0;c<5;c++)for(p=0;p<5;p++){var S=r[v=c+5*p],j=B[v],E=B[(c+1)%5+5*p],A=B[(c+2)%5+5*p];S.high=j.high^~E.high&A.high,S.low=j.low^~E.low&A.low}S=r[0];var I=T[s];S.high^=I.high,S.low^=I.low}},_doFinalize:function(){var e=this._data,t=e.words,r=(this._nDataBytes,8*e.sigBytes),i=32*this.blockSize;t[r>>>5]|=1<<24-r%32,t[(h.ceil((r+1)/i)*i>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();for(var n=this._state,a=this.cfg.outputLength/8,o=a/8,s=[],c=0;c>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),s.push(p),s.push(f)}return new l.init(s,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});e.SHA3=i._createHelper(n),e.HmacSHA3=i._createHmacHelper(n)}(Math),a.SHA3},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],235:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,o,s;return r=(t=e).x64,i=r.Word,n=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.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=o._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s),e.SHA384},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core"),e("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],n):n(i.CryptoJS)},{"./core":207,"./sha512":236,"./x64-core":238}],236:[function(e,t,r){var i,n;i=this,n=function(c){return function(){var e=c,t=e.lib.Hasher,r=e.x64,i=r.Word,n=r.WordArray,a=e.algo;function o(){return i.create.apply(i,arguments)}var xe=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],Se=[];!function(){for(var e=0;e<80;e++)Se[e]=o()}();var s=a.SHA512=t.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=i.high,h=i.low,l=n.high,d=n.low,m=a.high,g=a.low,v=o.high,b=o.low,y=s.high,_=s.low,w=c.high,k=c.low,x=u.high,S=u.low,j=f.high,E=f.low,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=w,N=k,D=x,q=S,L=j,U=E,H=0;H<80;H++){var K=Se[H];if(H<16)var V=K.high=0|e[t+2*H],G=K.low=0|e[t+2*H+1];else{var $=Se[H-15],W=$.high,Z=$.low,Y=(W>>>1|Z<<31)^(W>>>8|Z<<24)^W>>>7,X=(Z>>>1|W<<31)^(Z>>>8|W<<24)^(Z>>>7|W<<25),J=Se[H-2],Q=J.high,ee=J.low,te=(Q>>>19|ee<<13)^(Q<<3|ee>>>29)^Q>>>6,re=(ee>>>19|Q<<13)^(ee<<3|Q>>>29)^(ee>>>6|Q<<26),ie=Se[H-7],ne=ie.high,ae=ie.low,oe=Se[H-16],se=oe.high,ce=oe.low;V=(V=(V=Y+ne+((G=X+ae)>>>0>>0?1:0))+te+((G=G+re)>>>0>>0?1:0))+se+((G=G+ce)>>>0>>0?1:0);K.high=V,K.low=G}var ue,fe=R&M^~R&D,pe=z&N^~z&q,he=A&P^A&T^P&T,le=I&O^I&B^O&B,de=(A>>>28|I<<4)^(A<<30|I>>>2)^(A<<25|I>>>7),me=(I>>>28|A<<4)^(I<<30|A>>>2)^(I<<25|A>>>7),ge=(R>>>14|z<<18)^(R>>>18|z<<14)^(R<<23|z>>>9),ve=(z>>>14|R<<18)^(z>>>18|R<<14)^(z<<23|R>>>9),be=xe[H],ye=be.high,_e=be.low,we=L+ge+((ue=U+ve)>>>0>>0?1:0),ke=me+le;L=D,U=q,D=M,q=N,M=R,N=z,R=C+(we=(we=(we=we+fe+((ue=ue+pe)>>>0>>0?1:0))+ye+((ue=ue+_e)>>>0<_e>>>0?1:0))+V+((ue=ue+G)>>>0>>0?1:0))+((z=F+ue|0)>>>0>>0?1:0)|0,C=T,F=B,T=P,B=O,P=A,O=I,A=we+(de+he+(ke>>>0>>0?1:0))+((I=ue+ke|0)>>>0>>0?1:0)|0}h=i.low=h+I,i.high=p+A+(h>>>0>>0?1:0),d=n.low=d+O,n.high=l+P+(d>>>0>>0?1:0),g=a.low=g+B,a.high=m+T+(g>>>0>>0?1:0),b=o.low=b+F,o.high=v+C+(b>>>0>>0?1:0),_=s.low=_+z,s.high=y+R+(_>>>0>>0?1:0),k=c.low=k+N,c.high=w+M+(k>>>0>>0?1:0),S=u.low=S+q,u.high=x+D+(S>>>0>>0?1:0),E=f.low=E+U,f.high=j+L+(E>>>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=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(s),e.HmacSHA512=t._createHmacHelper(s)}(),c.SHA512},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],237:[function(e,t,r){var i,n;i=this,n=function(s){return function(){var e=s,t=e.lib,r=t.WordArray,i=t.BlockCipher,n=e.algo,u=[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],f=[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],p=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],a=n.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var i=u[r]-1;t[r]=e[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var o=n[a]=[],s=p[a];for(r=0;r<24;r++)o[r/6|0]|=t[(f[r]-1+s)%28]<<31-r%6,o[4+(r/6|0)]|=t[28+(f[r+24]-1+s)%28]<<31-r%6;o[0]=o[0]<<1|o[0]>>>31;for(r=1;r<7;r++)o[r]=o[r]>>>4*(r-1)+3;o[7]=o[7]<<5|o[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[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],d.call(this,4,252645135),d.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),d.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=h[c][((o^n[c])&l[c])>>>0];this._lBlock=o,this._rBlock=a^s}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,d.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(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<>>1];r=h.r28shl(r,a),i=h.r28shl(i,a),h.pc2(r,i,e.keys,n)}},c.prototype._update=function(e,t,r,i){var n=this._desState,a=h.readUInt32BE(e,t),o=h.readUInt32BE(e,t+4);h.ip(a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,o,n.tmp,0):this._decrypt(n,a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],h.writeUInt32BE(r,a,i),h.writeUInt32BE(r,o,i+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,a=p}h.rip(o,a,i,n)},c.prototype._decrypt=function(e,t,r,i,n){for(var a=r,o=t,s=e.keys.length-2;0<=s;s-=2){var c=e.keys[s],u=e.keys[s+1];h.expand(a,e.tmp,0),c^=e.tmp[0],u^=e.tmp[1];var f=h.substitute(c,u),p=a;a=(o^h.permute(f))>>>0,o=p}h.rip(a,o,i,n)}},{"../des":240,inherits:320,"minimalistic-assert":353}],244:[function(e,t,r){"use strict";var a=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),o=n.Cipher,s=n.DES;function c(e,t){a.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new c(this.type,this.options.key);this._edeState=t}i(u,o),(t.exports=u).create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":240,inherits:320,"minimalistic-assert":353}],245:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.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},r.ip=function(e,t,r,i){for(var n=0,a=0,o=6;0<=o;o-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+o&1}for(o=6;0<=o;o-=2){for(s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1;for(s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1}r[i+0]=n>>>0,r[i+1]=a>>>0},r.rip=function(e,t,r,i){for(var n=0,a=0,o=0;o<4;o++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+o&1,n<<=1,n|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;0<=s;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.pc1=function(e,t,r,i){for(var n=0,a=0,o=7;5<=o;o--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.r28shl=function(e,t){return e<>>28-t};var c=[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];r.pc2=function(e,t,r,i){for(var n=0,a=0,o=c.length>>>1,s=0;s>>c[s]&1;for(s=o;s>>c[s]&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var a=23;15<=a;a-=4)i<<=6,i|=e>>>a&63;for(a=11;3<=a;a-=4)n|=e>>>a&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[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];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[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];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(c),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;r.mod(p).cmp(h);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(i=r.shrn(1))&&g(r)&&v(i)&&v(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":154,"miller-rabin":349,randombytes:414}],249:[function(e,t,r){t.exports={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"}}},{}],250:[function(e,t,r){var u=e("crypto"),f=e("jsbn").BigInteger,p=(e("./lib/ec.js").ECPointFp,e("safer-buffer").Buffer);function h(e,t){return e.length>=t?e:h("0"+e,t)}r.ECCurves=e("./lib/sec.js"),r.ECKey=function(e,t,r){var i,n=e(),a=n.getN(),o=Math.floor(a.bitLength()/8);if(t)if(r){e=n.getCurve();this.P=e.decodePointHex(t.toString("hex"))}else{if(t.length!=o)return!1;i=new f(t.toString("hex"),16)}else{var s=a.subtract(f.ONE),c=new f(u.randomBytes(a.bitLength()));i=c.mod(s).add(f.ONE),this.P=n.getG().multiply(i)}this.P&&(this.PublicKey=p.from(n.getCurve().encodeCompressedPointHex(this.P),"hex")),i&&(this.PrivateKey=p.from(h(i.toString(16),2*o),"hex"),this.deriveSharedSecret=function(e){if(!e||!e.P)return!1;var t=e.P.multiply(i);return p.from(h(t.getX().toBigInteger().toString(16),2*o),"hex")})}},{"./lib/ec.js":251,"./lib/sec.js":252,crypto:204,jsbn:325,"safer-buffer":448}],251:[function(e,t,r){var l=e("jsbn").BigInteger,i=l.prototype.Barrett;function f(e,t){this.x=t,this.q=e}function d(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=null==i?l.ONE:i,this.zinv=null}function n(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new d(this,null,null),this.reducer=new i(this.q)}f.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},f.prototype.toBigInteger=function(){return this.x},f.prototype.negate=function(){return new f(this.q,this.x.negate().mod(this.q))},f.prototype.add=function(e){return new f(this.q,this.x.add(e.toBigInteger()).mod(this.q))},f.prototype.subtract=function(e){return new f(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},f.prototype.multiply=function(e){return new f(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},f.prototype.square=function(){return new f(this.q,this.x.square().mod(this.q))},f.prototype.divide=function(e){return new f(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},d.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO))},d.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(l.ZERO)&&!this.y.toBigInteger().equals(l.ZERO)},d.prototype.negate=function(){return new d(this.curve,this.x,this.y.negate(),this.z)},d.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(l.ZERO.equals(r))return l.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new l("3"),n=this.x.toBigInteger(),a=this.y.toBigInteger(),o=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),s=o.multiply(r),c=n.multiply(o),u=t.square().multiply(this.z),f=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(s).multiply(r).mod(this.curve.q),p=c.multiply(i).multiply(t).subtract(a.multiply(s)).subtract(u.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),h=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(p),h)},d.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new l("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),n=i.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),o=t.square().multiply(e);l.ZERO.equals(a)||(o=o.add(this.z.square().multiply(a)));var s=(o=o.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(i).mod(this.curve.q),c=o.multiply(e).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(o.square().multiply(o)).mod(this.curve.q),u=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(c),u)},d.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new l("3")),n=this.negate(),a=this;for(t=i.bitLength()-2;0r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var n=this.curve.getInfinity(),a=this.add(t);0<=i;)n=n.twice(),e.testBit(i)?n=r.testBit(i)?n.add(a):n.add(this):r.testBit(i)&&(n=n.add(t)),--i;return n},n.prototype.getQ=function(){return this.q},n.prototype.getA=function(){return this.a},n.prototype.getB=function(){return this.b},n.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},n.prototype.getInfinity=function(){return this.infinity},n.prototype.fromBigInteger=function(e){return new f(this.q,e)},n.prototype.reduce=function(e){this.reducer.reduce(e)},n.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;t.lengtht+1;){var r=e.shiftRight(t),i=e.subtract(r.shiftLeft(t));this.getR().equals(l.ONE)||(r=r.multiply(this.getR())),e=r.add(i)}for(;0<=e.compareTo(q);)e=e.subtract(q)}else e=e.mod(q);return e},f.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var e=new f(this.q,this.x.modPow(this.q.shiftRight(2).add(l.ONE),this.q));return e.square().equals(this)?e:null}var t=this.q.subtract(l.ONE),r=t.shiftRight(1);if(!this.x.modPow(r,this.q).equals(l.ONE))return null;var i,n,a=t.shiftRight(2).shiftLeft(1).add(l.ONE),o=this.x,s=modDouble(modDouble(o));do{for(var c;0<=(c=new l(this.q.bitLength(),new SecureRandom)).compareTo(this.q)||!c.multiply(c).subtract(s).modPow(r,this.q).equals(t););var u=this.lucasSequence(c,o,a);if(i=u[0],n=u[1],this.modMult(n,n).equals(s))return n.testBit(0)&&(n=n.add(q)),n=n.shiftRight(1),new f(q,n)}while(i.equals(l.ONE)||i.equals(t));return null},f.prototype.lucasSequence=function(e,t,r){for(var i=r.bitLength(),n=r.getLowestSetBit(),a=l.ONE,o=l.TWO,s=e,c=l.ONE,u=l.ONE,f=i-1;n+1<=f;--f)c=this.modMult(c,u),r.testBit(f)?(u=this.modMult(c,t),a=this.modMult(a,s),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1)))):(u=c,a=this.modReduce(a.multiply(o).subtract(c)),s=this.modReduce(s.multiply(o).subtract(e.multiply(c))),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))));c=this.modMult(c,u),u=this.modMult(c,t),a=this.modReduce(a.multiply(o).subtract(c)),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),c=this.modMult(c,u);for(f=1;f<=n;++f)a=this.modMult(a,o),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))),c=this.modMult(c,c);return[a,o]};r={ECCurveFp:n,ECPointFp:d,ECFieldElementFp:f};t.exports=r},{jsbn:325}],252:[function(e,t,r){var o=e("jsbn").BigInteger,s=e("./ec.js").ECCurveFp;function c(e,t,r,i){this.curve=e,this.g=t,this.n=r,this.h=i}function u(e){return new o(e,16)}function i(){var e=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),r=u("E87579C11079F43DD824993C2CEE5ED3"),i=u("FFFFFFFE0000000075A30D1B9038A115"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83"),i,n)}function n(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=o.ZERO,r=u("7"),i=u("0100000000000000000001B8FA16DFAB9ACA16B6B3"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE"),i,n)}function a(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),r=u("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),i=u("0100000000000000000001F4C8F927AED3CA752257"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32"),i,n)}function f(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=o.ZERO,r=u("3"),i=u("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"),i,n)}function p(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),r=u("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),i=u("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811"),i,n)}function h(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),r=u("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),i=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"),i,n)}function l(){var e=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),r=u("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),i=u("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),i,n)}c.prototype.getCurve=function(){return this.curve},c.prototype.getG=function(){return this.g},c.prototype.getN=function(){return this.n},c.prototype.getH=function(){return this.h},t.exports={secp128r1:i,secp160k1:n,secp160r1:a,secp192k1:f,secp192r1:p,secp224r1:h,secp256r1:l}},{"./ec.js":251,jsbn:325}],253:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":268,"./elliptic/curve":256,"./elliptic/curves":259,"./elliptic/ec":260,"./elliptic/eddsa":263,"./elliptic/utils":267,brorand:156}],254:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,j=n.getNAF,E=n.getJSF,p=n.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i,n){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,c=0,u=0;u>1]:S<0&&(x=o[g][-S-1>>1].neg()),y="affine"===x.type?y.mixedAdd(x):y.add(x))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},o.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.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),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],256:[function(e,t,r){arguments[4][130][0].apply(r,arguments)},{"./base":254,"./edwards":255,"./mont":257,"./short":258,dup:130}],257:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base,s=e("../../elliptic").utils;function c(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(c,o),(t.exports=c).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)},a(u,o.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},c.prototype.point=function(e,t){return new u(this,e,t)},c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.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)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},u.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 a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],258:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new w(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)},c.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)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],259:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":253,"./precomputed/secp256k1":266,"hash.js":299}],260:[function(e,t,r){"use strict";var g=e("bn.js"),v=e("hmac-drbg"),a=e("../../elliptic"),l=a.utils.assert,i=e("./key"),b=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(l(a.curves.hasOwnProperty(e),"Unknown curve "+e),e=a.curves[e]),e instanceof a.curves.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}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new v({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new g(2));;){var n=new g(t.generate(r));if(!(0>1;if(0<=o.cmp(this.curve.p.umod(this.curve.n))&&u)throw new Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var f=t.r.invm(n),p=n.sub(a).mul(f).umod(n),h=s.mul(f).umod(n);return this.g.mulAdd(p,o,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new b(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":253,"./key":261,"./signature":262,"bn.js":154,"hmac-drbg":311}],261:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=a).fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},{"../../elliptic":253,"bn.js":154}],262:[function(e,t,r){"use strict";var s=e("bn.js"),c=e("../../elliptic").utils,i=c.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=c.toArray(e,t);var r=new u;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=f(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=f(e,r);if(e.length!==a+r.place)return!1;var o=e.slice(r.place,a+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===o[0]&&128&o[1]&&(o=o.slice(1)),this.r=new s(n),this.s=new s(o),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];p(i,t.length),(i=i.concat(t)).push(2),p(i,r.length);var n=i.concat(r),a=[48];return p(a,n.length),a=a.concat(n),c.encode(a,e)}},{"../../elliptic":253,"bn.js":154}],263:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),a=n.utils,o=a.assert,c=a.parseBytes,s=e("./key"),u=e("./signature");function f(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=f).prototype.sign=function(e,t){e=c(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),a=this.encodePoint(n),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:a})},f.prototype.verify=function(e,t,r){e=c(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(a)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=6.0.0 <7.0.0",_id:"elliptic@6.4.1",_inCache:!0,_installable:!0,_location:"/elliptic",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/elliptic_6.4.1_1533787091502_0.6309761823717674"},_npmUser:{email:"fedor@indutny.com",name:"indutny"},_npmVersion:"6.3.0",_phantomChildren:{},_requested:{name:"elliptic",raw:"elliptic@^6.0.0",rawSpec:"^6.0.0",scope:null,spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/home/administrator/javascript-opentimestamps/node_modules/browserify-sign",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{fileCount:17,integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJba7vUCRA9TVsSAnZWagAA+gcP/jWaj5GmDZ0YFi/X4g5O\nx+pxu9i3HbP9YqywT7rz3XFXSaytu0LQDeDEbddl523X69tsbKfzHRTcnW8n\n2r0VjPhttRm+0RpEhBwjSIK34VkQA1xIWh2ugOToKXVCFVLM5VFDPGzbiN6x\n/hpL7gj1hoCRVmuhjnqFQ+vPKACKfv1Eq4CsRmu2focmP37kQpWQlweD/z4V\nJF4NxA33Fvp13Fl+9g4sPHyhUVsW9ojVaG3Ijn70pCaGQM18UPlbODkWQ1QX\nAgteOFjkIOtcalJk3B3qsM8GZeHEcAFvt2T73miJkHdCGNmRQS45Ede+gnj0\nlLlZJsCCKUHtTqrlprHo6AgMnBZufmytyozYAHC1/JYniazSBi2yPHtQeniR\nl69BfiRBdD2rNrMPwmCNRkMqrgel5WMGpaD0xdaFAHF1Ru2ZQFKsA7KvPGgp\nA20+LN11cCib67Pg5XDyrZ92T3yXec+6gQ3iq9d9UBZKFGl0P8ebVqq1LrUJ\na6nekwMpRISWnKcqV72XVmQdBmUWHq9VfVLsWJzVIJqtpHmUO7q74ACP3i4W\n0/F1REeI0YEhh3NjeStdDecfjlu7PY0pLQpbk2I3ms+6DO+cAfeDEev5jFBK\nwQabRNhITeT1FVtxZAcApj33fnCdqwaWr1NS00K5ZRqhDTTzPr/O4KRN4CR1\npstU\r\n=UVBB\r\n-----END PGP SIGNATURE-----\r\n",shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",unpackedSize:118371},files:["lib"],gitHead:"523da1cf71ddcfd607fbdee1858bc2af47f0e700",homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.1"}},{}],269:[function(e,t,r){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function c(e){return"function"==typeof e}function u(e){return"object"===(void 0===e?"undefined":_typeof(e))&&null!==e}function f(e){return void 0===e}((t.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},i.prototype.emit=function(e){var t,r,i,n,a,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(f(r=this._events[e]))return!1;if(c(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=Array.prototype.slice.call(arguments,1),r.apply(this,n)}else if(u(r))for(n=Array.prototype.slice.call(arguments,1),i=(o=r.slice()).length,a=0;ar&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!c(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,a;if(!c(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||c(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(r)){for(a=n;0=this._blockSize;){for(var n=this._blockOffset;n=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=n.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,a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":310}],310:[function(e,t,r){"use strict";var u=e("minimalistic-assert"),i=e("inherits");function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function o(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}r.inherits=i,r.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:320,"minimalistic-assert":353}],311:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),i=o.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length1e3*t.clockSkew)throw new E("clock skew of "+g/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach(function(e){if(u.params.headers.indexOf(e.toLowerCase())<0)throw new P(e+" was not a signed header")}),t.algorithms&&-1===t.algorithms.indexOf(u.params.algorithm))throw new I(u.params.algorithm+" is not a supported algorithm");return u.algorithm=u.params.algorithm.toUpperCase(),u.keyId=u.params.keyId,u}}},{"./utils":315,"assert-plus":66,util:505}],314:[function(n,a,e){(function(l){var d=n("assert-plus"),m=n("crypto"),e=(n("http"),n("util")),g=n("sshpk"),v=n("jsprim"),t=n("./utils"),b=n("util").format,y=t.HASH_ALGOS,_=t.PK_ALGOS,w=t.InvalidAlgorithmError,r=t.HttpSignatureError,k=t.validateAlgorithm,x='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';function S(e){r.call(this,e,S)}function j(e){r.call(this,e,j)}function i(e){d.object(e,"options");var t=[];if(void 0!==e.algorithm&&(d.string(e.algorithm,"options.algorithm"),t=k(e.algorithm)),this.rs_alg=t,void 0!==e.sign)d.func(e.sign,"options.sign"),this.rs_signFunc=e.sign;else if("hmac"===t[0]&&void 0!==e.key){if(d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,"string"!=typeof e.key&&!l.isBuffer(e.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=m.createHmac(t[1].toUpperCase(),e.key),this.rs_signer.sign=function(){var e=this.digest("base64");return{hashAlgorithm:t[1],toString:function(){return e}}}}else{if(void 0===e.key)throw new TypeError("options.sign (func) or options.key is required");var r=e.key;if(("string"==typeof r||l.isBuffer(r))&&(r=g.parsePrivateKey(r)),d.ok(g.PrivateKey.isPrivateKey(r,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=r,d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,!_[r.type])throw new w(r.type.toUpperCase()+" type keys are not supported");if(void 0!==t[0]&&r.type!==t[0])throw new w("options.key must be a "+t[0].toUpperCase()+" key, was given a "+r.type.toUpperCase()+" key instead");this.rs_signer=r.createSign(t[1])}this.rs_headers=[],this.rs_lines=[]}e.inherits(S,r),e.inherits(j,r),i.prototype.writeHeader=function(e,t){if(d.string(e,"header"),e=e.toLowerCase(),d.string(t,"value"),this.rs_headers.push(e),this.rs_signFunc)this.rs_lines.push(e+": "+t);else{var r=e+": "+t;0>1,f=-7,p=r?n-1:0,h=r?-1:1,l=e[t+p];for(p+=h,a=l&(1<<-f)-1,l>>=-f,f+=s;0>=-f,f+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:a-1,d=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),2<=(t+=1<=o+p?h/c:h*Math.pow(2,1-p))*c&&(o++,c/=2),f<=o+p?(s=0,o=f):1<=o+p?(s=(t*c-1)*Math.pow(2,n),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,n),o=0));8<=n;e[r+l]=255&s,l+=d,s/=256,n-=8);for(o=o<>15;0<=--a;){var c=32767&this[e],u=this[e++]>>15,f=s*c+u*o;n=((c=o*c+((32767&f)<<15)+r[i]+(1073741823&n))>>>30)+(f>>>15)+s*u+(n>>>30),r[i++]=1073741823&c}return n},30):t&&"Netscape"!=navigator.appName?(y.prototype.am=function(e,t,r,i,n,a){for(;0<=--a;){var o=t*this[e++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},26):(y.prototype.am=function(e,t,r,i,n,a){for(var o=16383&t,s=t>>14;0<=--a;){var c=16383&this[e],u=this[e++]>>14,f=s*c+u*o;n=((c=o*c+((16383&f)<<14)+r[i]+n)>>28)+(f>>14)+s*u,r[i++]=268435455&c}return n},28),y.prototype.DB=e,y.prototype.DM=(1<>>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 v(e){this.m=e}function b(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 l(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function d(){}function m(e){return e}function k(e){this.r2=_(),this.q3=_(),y.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},b.prototype.convert=function(e){var t=_();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&0>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),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},b.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.copyTo=function(e){for(var t=this.t-1;0<=t;--t)e[t]=this[t];e.t=this.t,e.s=this.s},y.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0this.DB?(this[this.t-1]|=(o&(1<>this.DB-a):this[this.t-1]|=o<=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,0>n|s,s=(this[r]&a)<=this.t)t.t=0;else{var i=e%this.DB,n=this.DB-i,a=(1<>i;for(var o=r+1;o>i;0>=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:0=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}0>this.F2:0),h=this.FV/p,l=(1<>s)&&(n=!0,a=c(r));0<=o;)s>(s+=this.DB-t)):(r=this[o]>>(s-=t)&i,s<=0&&(s+=this.DB,--o)),02*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=_();return e.copyTo(t),this.reduce(t),t},k.prototype.revert=function(e){return e},k.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);0<=e.compareTo(this.m);)e.subTo(this.m,e)},k.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},k.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x,S,j,E=[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],A=(1<<26)/E[E.length-1];function I(){var e;e=(new Date).getTime(),S[j++]^=255&e,S[j++]^=e>>8&255,S[j++]^=e>>16&255,S[j++]^=e>>24&255,R<=j&&(j-=R)}if(y.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},y.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||36=r&&(this.dMultiply(i),this.dAddOffset(o,0),o=a=0))}0e&&this.subTo(y.ONE.shiftLeft(e-1),this);else{var i=new Array,n=7&e;i.length=1+(e>>3),t.nextBytes(i),0>=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,0=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},y.prototype.multiplyLowerTo=function(e,t,r){var i,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;0>1)>E.length&&(e=E.length);for(var n=_(),a=0;a>24},y.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},y.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},y.prototype.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(0>i)!=(this.s&this.DM)>>i&&(t[n++]=r|this.s<>(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,(0=this.t?0!=this.s:0!=(this[t]&1<>n-c&u:(p=(e[l]&(1<>this.DB+n-c)),s=r;0==(1&p);)p>>=1,--s;if((n-=s)<0&&(n+=this.DB,--l),d)o[p].copyTo(a),d=!1;else{for(;1>>8,S[j++]=255&P;j=0,I()}function B(){if(null==x){for(I(),(x=new F).init(S),j=0;jt.maxItems&&n("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&m.concat(function(e,t,r,i){if("object"==(void 0===t?"undefined":_typeof(t)))for(var n in("object"!=(void 0===e?"undefined":_typeof(e))||e instanceof Array)&&m.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(n)){var a=e[n];if(void 0===a&&h.existingOnly)continue;var o=t[n];void 0===a&&o.default&&(a=e[n]=o.default),h.coerce&&n in e&&(a=e[n]=h.coerce(a,o)),g(a,o,r,n)}for(n in e){if(e.hasOwnProperty(n)&&("_"!=n.charAt(0)||"_"!=n.charAt(1))&&t&&!t[n]&&!1===i){if(h.filter){delete e[n];continue}m.push({property:r,message:(void 0===a?"undefined":_typeof(a))+"The property "+n+" is not defined in the schema and the schema does not allow additional properties"})}var s=t&&t[n]&&t[n].requires;!s||s in e||m.push({property:r,message:"the presence of the property "+n+" requires that "+s+" also be present"}),a=e[n],!i||t&&"object"==(void 0===t?"undefined":_typeof(t))&&n in t||(h.coerce&&(a=e[n]=h.coerce(a,i)),g(a,i,r,n)),!l&&a&&a.$schema&&(m=m.concat(g(a,a.$schema,r,n)))}return m}(e,t.properties,o,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&n("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&n("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.lengthe&&n("must have a minimum value of "+t.minimum),void 0!==_typeof(t.maximum)&&(void 0===e?"undefined":_typeof(e))==_typeof(t.maximum)&&t.maximum= 2"),d.ok(n.base<=36,"options.base <= 36"),d.bool(n.allowSign,"options.allowSign"),d.bool(n.allowPrefix,"options.allowPrefix"),d.bool(n.allowTrailing,"options.allowTrailing"),d.bool(n.allowImprecise,"options.allowImprecise"),d.bool(n.trimWhitespace,"options.trimWhitespace"),d.bool(n.leadingZeroIsOctal,"options.leadingZeroIsOctal"),n.leadingZeroIsOctal&&d.ok(!i,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var a,o=-1,s=n.base,c=1,u=0,f=0,p=e.length;if(n.trimWhitespace)for(;ft[0]||e[0]==t[0]&&e[1]>=t[1],"negative differences not allowed");var r=[e[0]-t[0],0];return e[1]>=t[1]?r[1]=e[1]-t[1]:(r[0]--,r[1]=1e9-(t[1]-e[1])),r}function R(e,t){return C(e),C(t),e[1]+=t[1],1e9<=e[1]&&(e[0]++,e[1]-=1e9),e[0]+=t[0],e}function z(e,t,r){var i,n;if(i={},r)for(n in r)i[n]=r[n];if(e)for(n in e)i[n]=e[n];if(t)for(n in t)i[n]=t[n];return i}},{"assert-plus":66,extsprintf:272,"json-schema":327,util:505,verror:509}],330:[function(e,t,r){"use strict";t.exports=e("./lib/api")(e("./lib/keccak"))},{"./lib/api":331,"./lib/keccak":335}],331:[function(e,t,r){"use strict";var n=e("./keccak"),a=e("./shake");t.exports=function(e){var r=n(e),i=a(e);return function(e,t){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new r(1152,448,null,224,t);case"keccak256":return new r(1088,512,null,256,t);case"keccak384":return new r(832,768,null,384,t);case"keccak512":return new r(576,1024,null,512,t);case"sha3-224":return new r(1152,448,6,224,t);case"sha3-256":return new r(1088,512,6,256,t);case"sha3-384":return new r(832,768,6,384,t);case"sha3-512":return new r(576,1024,6,512,t);case"shake128":return new i(1344,256,31,t);case"shake256":return new i(1088,512,31,t);default:throw new Error("Invald algorithm: "+e)}}}},{"./keccak":332,"./shake":333}],332:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,o=e("stream").Transform,n=e("inherits");t.exports=function(a){function t(e,t,r,i,n){o.call(this,n),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._hashBitLength=i,this._options=n,this._state=new a,this._state.initialize(e,t),this._finalized=!1}return n(t,o),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],333:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("stream").Transform,o=e("inherits");t.exports=function(n){function t(e,t,r,i){a.call(this,i),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._options=i,this._state=new n,this._state.initialize(e,t),this._finalized=!1}return o(t,a),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],334:[function(e,t,r){"use strict";var ot=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];r.p1600=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],n=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],h=f^(n<<1|a>>>31),l=p^(a<<1|n>>>31),d=e[0]^h,m=e[1]^l,g=e[10]^h,v=e[11]^l,b=e[20]^h,y=e[21]^l,_=e[30]^h,w=e[31]^l,k=e[40]^h,x=e[41]^l;h=r^(o<<1|s>>>31),l=i^(s<<1|o>>>31);var S=e[2]^h,j=e[3]^l,E=e[12]^h,A=e[13]^l,I=e[22]^h,P=e[23]^l,O=e[32]^h,T=e[33]^l,B=e[42]^h,C=e[43]^l;h=n^(c<<1|u>>>31),l=a^(u<<1|c>>>31);var F=e[4]^h,R=e[5]^l,z=e[14]^h,M=e[15]^l,N=e[24]^h,D=e[25]^l,q=e[34]^h,L=e[35]^l,U=e[44]^h,H=e[45]^l;h=o^(f<<1|p>>>31),l=s^(p<<1|f>>>31);var K=e[6]^h,V=e[7]^l,G=e[16]^h,$=e[17]^l,W=e[26]^h,Z=e[27]^l,Y=e[36]^h,X=e[37]^l,J=e[46]^h,Q=e[47]^l;h=c^(r<<1|i>>>31),l=u^(i<<1|r>>>31);var ee=e[8]^h,te=e[9]^l,re=e[18]^h,ie=e[19]^l,ne=e[28]^h,ae=e[29]^l,oe=e[38]^h,se=e[39]^l,ce=e[48]^h,ue=e[49]^l,fe=d,pe=m,he=v<<4|g>>>28,le=g<<4|v>>>28,de=b<<3|y>>>29,me=y<<3|b>>>29,ge=w<<9|_>>>23,ve=_<<9|w>>>23,be=k<<18|x>>>14,ye=x<<18|k>>>14,_e=S<<1|j>>>31,we=j<<1|S>>>31,ke=A<<12|E>>>20,xe=E<<12|A>>>20,Se=I<<10|P>>>22,je=P<<10|I>>>22,Ee=T<<13|O>>>19,Ae=O<<13|T>>>19,Ie=B<<2|C>>>30,Pe=C<<2|B>>>30,Oe=R<<30|F>>>2,Te=F<<30|R>>>2,Be=z<<6|M>>>26,Ce=M<<6|z>>>26,Fe=D<<11|N>>>21,Re=N<<11|D>>>21,ze=q<<15|L>>>17,Me=L<<15|q>>>17,Ne=H<<29|U>>>3,De=U<<29|H>>>3,qe=K<<28|V>>>4,Le=V<<28|K>>>4,Ue=$<<23|G>>>9,He=G<<23|$>>>9,Ke=W<<25|Z>>>7,Ve=Z<<25|W>>>7,Ge=Y<<21|X>>>11,$e=X<<21|Y>>>11,We=Q<<24|J>>>8,Ze=J<<24|Q>>>8,Ye=ee<<27|te>>>5,Xe=te<<27|ee>>>5,Je=re<<20|ie>>>12,Qe=ie<<20|re>>>12,et=ae<<7|ne>>>25,tt=ne<<7|ae>>>25,rt=oe<<8|se>>>24,it=se<<8|oe>>>24,nt=ce<<14|ue>>>18,at=ue<<14|ce>>>18;e[0]=fe^~ke&Fe,e[1]=pe^~xe&Re,e[10]=qe^~Je&de,e[11]=Le^~Qe&me,e[20]=_e^~Be&Ke,e[21]=we^~Ce&Ve,e[30]=Ye^~he&Se,e[31]=Xe^~le&je,e[40]=Oe^~Ue&et,e[41]=Te^~He&tt,e[2]=ke^~Fe&Ge,e[3]=xe^~Re&$e,e[12]=Je^~de&Ee,e[13]=Qe^~me&Ae,e[22]=Be^~Ke&rt,e[23]=Ce^~Ve&it,e[32]=he^~Se&ze,e[33]=le^~je&Me,e[42]=Ue^~et&ge,e[43]=He^~tt&ve,e[4]=Fe^~Ge&nt,e[5]=Re^~$e&at,e[14]=de^~Ee&Ne,e[15]=me^~Ae&De,e[24]=Ke^~rt&be,e[25]=Ve^~it&ye,e[34]=Se^~ze&We,e[35]=je^~Me&Ze,e[44]=et^~ge&Ie,e[45]=tt^~ve&Pe,e[6]=Ge^~nt&fe,e[7]=$e^~at&pe,e[16]=Ee^~Ne&qe,e[17]=Ae^~De&Le,e[26]=rt^~be&_e,e[27]=it^~ye&we,e[36]=ze^~We&Ye,e[37]=Me^~Ze&Xe,e[46]=ge^~Ie&Oe,e[47]=ve^~Pe&Te,e[8]=nt^~fe&ke,e[9]=at^~pe&xe,e[18]=Ne^~qe&Je,e[19]=De^~Le&Qe,e[28]=be^~_e&Be,e[29]=ye^~we&Ce,e[38]=We^~Ye&he,e[39]=Ze^~Xe&le,e[48]=Ie^~Oe&Ue,e[49]=Pe^~Te&He,e[0]^=ot[2*t],e[1]^=ot[2*t+1]}}},{}],335:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=e("./keccak-state-unroll");function a(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}a.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},a.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},a.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},t.exports=a},{"./keccak-state-unroll":334,"safe-buffer":447}],336:[function(e,t,r){var i=e("./_root").Symbol;t.exports=i},{"./_root":341}],337:[function(e,t,r){var i=e("./_Symbol"),n=e("./_getRawTag"),a=e("./_objectToString"),o=i?i.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},{"./_Symbol":336,"./_getRawTag":339,"./_objectToString":340}],338:[function(e,r,t){(function(e){var t="object"==(void 0===e?"undefined":_typeof(e))&&e&&e.Object===Object&&e;r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],339:[function(e,t,r){var i=e("./_Symbol"),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,s=i?i.toStringTag:void 0;t.exports=function(e){var t=a.call(e,s),r=e[s];try{var i=!(e[s]=void 0)}catch(e){}var n=o.call(e);return i&&(t?e[s]=r:delete e[s]),n}},{"./_Symbol":336}],340:[function(e,t,r){var i=Object.prototype.toString;t.exports=function(e){return i.call(e)}},{}],341:[function(e,t,r){var i=e("./_freeGlobal"),n="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,a=i||n||Function("return this")();t.exports=a},{"./_freeGlobal":338}],342:[function(e,t,r){var i=Array.isArray;t.exports=i},{}],343:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isObject");t.exports=function(e){if(!n(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},{"./_baseGetTag":337,"./isObject":344}],344:[function(e,t,r){t.exports=function(e){var t=void 0===e?"undefined":_typeof(e);return null!=e&&("object"==t||"function"==t)}},{}],345:[function(e,t,r){t.exports=function(e){return null!=e&&"object"==(void 0===e?"undefined":_typeof(e))}},{}],346:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isArray"),a=e("./isObjectLike");t.exports=function(e){return"string"==typeof e||!n(e)&&a(e)&&"[object String]"==i(e)}},{"./_baseGetTag":337,"./isArray":342,"./isObjectLike":345}],347:[function(e,t,r){t.exports=function(e){return void 0===e}},{}],348:[function(e,t,r){"use strict";var i=e("inherits"),n=e("hash-base"),a=e("safe-buffer").Buffer,o=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,r,i,n,a,o){return c(e+(t&r|~t&i)+n+a|0,o)+t|0}function f(e,t,r,i,n,a,o){return c(e+(t&i|r&~i)+n+a|0,o)+t|0}function p(e,t,r,i,n,a,o){return c(e+(t^r^i)+n+a|0,o)+t|0}function h(e,t,r,i,n,a,o){return c(e+(r^(t|~i))+n+a|0,o)+t|0}i(s,n),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,a=this._d;i=h(i=h(i=h(i=h(i=p(i=p(i=p(i=p(i=f(i=f(i=f(i=f(i=u(i=u(i=u(i=u(i,n=u(n,a=u(a,r=u(r,i,n,a,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),a,r,e[3],3250441966,22),n=u(n,a=u(a,r=u(r,i,n,a,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),a,r,e[7],4249261313,22),n=u(n,a=u(a,r=u(r,i,n,a,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),a,r,e[11],2304563134,22),n=u(n,a=u(a,r=u(r,i,n,a,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),a,r,e[15],1236535329,22),n=f(n,a=f(a,r=f(r,i,n,a,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),a,r,e[0],3921069994,20),n=f(n,a=f(a,r=f(r,i,n,a,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),a,r,e[4],3889429448,20),n=f(n,a=f(a,r=f(r,i,n,a,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),a,r,e[8],1163531501,20),n=f(n,a=f(a,r=f(r,i,n,a,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),a,r,e[12],2368359562,20),n=p(n,a=p(a,r=p(r,i,n,a,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),a,r,e[14],4259657740,23),n=p(n,a=p(a,r=p(r,i,n,a,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),a,r,e[10],3200236656,23),n=p(n,a=p(a,r=p(r,i,n,a,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),a,r,e[6],76029189,23),n=p(n,a=p(a,r=p(r,i,n,a,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),a,r,e[2],3299628645,23),n=h(n,a=h(a,r=h(r,i,n,a,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),a,r,e[5],4237533241,21),n=h(n,a=h(a,r=h(r,i,n,a,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),a,r,e[1],2240044497,21),n=h(n,a=h(a,r=h(r,i,n,a,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),a,r,e[13],1309151649,21),n=h(n,a=h(a,r=h(r,i,n,a,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),a,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+a|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e}},{}],355:[function(e,t,r){(t.exports=o).Minimatch=n;var u={sep:"/"};try{u=e("path")}catch(e){}var z=o.GLOBSTAR=n.GLOBSTAR={},i=e("brace-expansion"),M={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},N="[^/]*?",D="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{});var f=/\/+/;function a(t,r){t=t||{},r=r||{};var i={};return Object.keys(r).forEach(function(e){i[e]=r[e]}),Object.keys(t).forEach(function(e){i[e]=t[e]}),i}function o(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new n(t,r).match(e))}function n(e,t){if(!(this instanceof n))return new n(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==u.sep&&(e=e.split(u.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function s(e,t){if(t||(t=this instanceof n?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:i(e)}o.filter=function(i,n){return n=n||{},function(e,t,r){return o(e,i,n)}},o.defaults=function(i){if(!i||!Object.keys(i).length)return o;var n=o,e=function(e,t,r){return n.minimatch(e,t,a(i,r))};return e.Minimatch=function(e,t){return new n.Minimatch(e,a(i,t))},e},n.defaults=function(e){return e&&Object.keys(e).length?o.defaults(e).Minimatch:n},n.prototype.debug=function(){},n.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(f)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r},n.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=this.options,i=0;if(r.nonegate)return;for(var n=0,a=e.length;n>> no match, partial?",e,p,t,h),p!==o))}if("string"==typeof u?(c=i.nocase?f.toLowerCase()===u.toLowerCase():f===u,this.debug("string match",u,f,c)):(c=f.match(u),this.debug("pattern match",u,f,c)),!c)return!1}if(n===o&&a===s)return!0;if(n===o)return r;if(a===s)return n===o-1&&""===e[n];throw new Error("wtf?")}},{"brace-expansion":155,path:374}],356:[function(e,t,r){var c=e("crypto");function o(e,t,r){return c.createHmac(r,e).update(t).digest("base64")}function s(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function n(e,t){return t>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var n=s,a=i+r;e^=-1;for(var o=i;o>>8^n[255&(e^t[o])];return-1^e}},{}],362:[function(e,t,r){"use strict";var c,h=e("../utils/common"),u=e("./trees"),l=e("./adler32"),d=e("./crc32"),i=e("./messages"),f=0,p=4,m=0,g=-2,v=-1,b=4,n=2,y=8,_=9,a=286,o=30,s=19,w=2*a+1,k=15,x=3,S=258,j=S+x+1,E=42,A=113,I=1,P=2,O=3,T=4;function B(e,t){return e.msg=i[t],t}function C(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(h.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function z(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,R(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function N(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function D(e,t){var r,i,n=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-j?e.strstart-(e.w_size-j):0,u=e.window,f=e.w_mask,p=e.prev,h=e.strstart+S,l=u[a+o-1],d=u[a+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===d&&u[r+o-1]===l&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ac&&0!=--n);return o<=e.lookahead?o:e.lookahead}function q(e){var t,r,i,n,a,o,s,c,u,f,p=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-j)){for(h.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;i=e.head[--t],e.head[t]=p<=i?i-p:0,--r;);for(t=r=p;i=e.prev[--t],e.prev[t]=p<=i?i-p:0,--r;);n+=p}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,c=e.strstart+e.lookahead,u=n,f=void 0,f=o.avail_in,u=x)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(i=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(n=e.strstart+e.lookahead-x,i=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=n&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(q(e),0===e.lookahead&&t===f)return I;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,z(e,!1),0===e.strm.avail_out))return I;if(e.strstart-e.block_start>=e.w_size-j&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):(e.strstart>e.block_start&&(z(e,!1),e.strm.avail_out),I)}),new H(4,4,8,4,L),new H(4,5,16,8,L),new H(4,6,32,32,L),new H(4,4,16,16,U),new H(8,16,32,32,U),new H(8,16,128,128,U),new H(8,32,128,256,U),new H(32,128,258,1024,U),new H(32,258,258,4096,U)],r.deflateInit=function(e,t){return $(e,t,y,15,8,0)},r.deflateInit2=$,r.deflateReset=G,r.deflateResetKeep=V,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,m):g},r.deflate=function(e,t){var r,i,n,a;if(!e||!e.state||5>8&255),M(i,i.gzhead.time>>16&255),M(i,i.gzhead.time>>24&255),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(M(i,255&i.gzhead.extra.length),M(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=d(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(M(i,0),M(i,0),M(i,0),M(i,0),M(i,0),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,3),i.status=A);else{var o=y+(i.w_bits-8<<4)<<8;o|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(o|=32),o+=31-o%31,i.status=A,N(i,o),0!==i.strstart&&(N(i,e.adler>>>16),N(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending!==i.pending_buf_size));)M(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&R(e),i.pending+2<=i.pending_buf_size&&(M(i,255&e.adler),M(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(R(e),0===e.avail_out)return i.last_flush=-1,m}else if(0===e.avail_in&&C(t)<=C(r)&&t!==p)return B(e,-5);if(666===i.status&&0!==e.avail_in)return B(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==f&&666!==i.status){var s=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(q(e),0===e.lookahead)){if(t===f)return I;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):3===i.strategy?function(e,t){for(var r,i,n,a,o=e.window;;){if(e.lookahead<=S){if(q(e),e.lookahead<=S&&t===f)return I;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):c[i.level].func(i,t);if(s!==O&&s!==T||(i.status=666),s===I||s===O)return 0===e.avail_out&&(i.last_flush=-1),m;if(s===P&&(1===t?u._tr_align(i):5!==t&&(u._tr_stored_block(i,0,0,!1),3===t&&(F(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),R(e),0===e.avail_out))return i.last_flush=-1,m}return t!==p?m:i.wrap<=0?1:(2===i.wrap?(M(i,255&e.adler),M(i,e.adler>>8&255),M(i,e.adler>>16&255),M(i,e.adler>>24&255),M(i,255&e.total_in),M(i,e.total_in>>8&255),M(i,e.total_in>>16&255),M(i,e.total_in>>24&255)):(N(i,e.adler>>>16),N(i,65535&e.adler)),R(e),0=r.w_size&&(0===a&&(F(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new h.Buf8(r.w_size),h.arraySet(u,t,f-r.w_size,r.w_size,0),t=u,f=r.w_size),o=e.avail_in,s=e.next_in,c=e.input,e.avail_in=f,e.next_in=0,e.input=t,q(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=_=y>>>24,d-=_,0===(_=y>>>16&255))E[a++]=65535&y;else{if(!(16&_)){if(0==(64&_)){y=m[(65535&y)+(l&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&y,(_&=15)&&(d<_&&(l+=j[i++]<>>=_,d-=_),d<15&&(l+=j[i++]<>>=_=y>>>24,d-=_,!(16&(_=y>>>16&255))){if(0==(64&_)){y=g[(65535&y)+(l&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&y,d<(_&=15)&&(l+=j[i++]<>>=_,d-=_,(_=a-o)>3,l&=(1<<(d-=w<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new P.Buf16(320),this.work=new P.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=N,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new P.Buf32(i),t.distcode=t.distdyn=new P.Buf32(n),t.sane=1,t.back=-1,z):M}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):M}function c(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=a.wsize?(P.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(n=a.wsize-a.wnext)&&(n=i),P.arraySet(a.window,t,r-i,n,a.wnext),(i-=n)?(P.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=T(r.check,A,2,0),f=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(f-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=3;case 3:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>8&255,A[2]=u>>>16&255,A[3]=u>>>24&255,r.check=T(r.check,A,4,0)),f=u=0,r.mode=4;case 4:for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>8),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>>8&255,r.check=T(r.check,A,2,0)),f=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(s<(l=r.length)&&(l=s),l&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),P.arraySet(r.head.extra,i,a,l,k)),512&r.flags&&(r.check=T(r.check,i,l,a)),s-=l,a+=l,r.length-=l),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;for(l=0;k=i[a+l++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&l>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>=7&f,f-=7&f,r.mode=27;break}for(;f<3;){if(0===s)break e;s--,u+=i[a++]<>>=1)){case 0:r.mode=14;break;case 1:if(q(r),r.mode=20,6!==t)break;u>>>=2,f-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,f-=2;break;case 14:for(u>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,u+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,f=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(l=r.length){if(s>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,286>>=3,f-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=C(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=g,f-=g,r.lens[r.have++]=b;else{if(16===b){for(j=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],l=3+(3&u),u>>>=2,f-=2}else if(17===b){for(j=g+3;f>>=g)),u>>>=3,f-=3}else{for(j=g+7;f>>=g)),u>>>=7,f-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;l--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=C(F,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=C(R,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=s&&258<=c){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,r.hold=u,r.bits=f,B(e,h),o=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,u=r.hold,f=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;v=(E=r.lencode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,r.length=b,0===v){r.mode=26;break}if(32&v){r.back=-1,r.mode=12;break}if(64&v){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&v,r.mode=22;case 22:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=(E=r.distcode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&v,r.mode=24;case 24:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===c)break e;if(l=h-c,r.offset>l){if((l=r.offset-l)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d=l>r.wnext?(l-=r.wnext,r.wsize-l):r.wnext-l,l>r.length&&(l=r.length),m=r.window}else m=n,d=o-r.offset,l=r.length;for(cl?(m=B[C+o[y]],I[P+o[y]]):(m=96,0),c=1<>S)+(u-=c)]=d<<24|m<<16|g|0,0!==u;);for(c=1<>=1;if(0!==c?(A&=c-1,A+=c):A=0,y++,0==--O[b]){if(b===w)break;b=t[r+o[y]]}if(k>>7)]}function M(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function N(e,t,r){e.bi_valid>n-r?(e.bi_buf|=t<>n-e.bi_valid,e.bi_valid+=r-n):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function L(e,t,r){var i,n,a=new Array(v+1),o=0;for(i=1;i<=v;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=q(a[s]++,s))}}function U(e){var t;for(t=0;t>1;1<=r;r--)V(e,a,r);for(n=c;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],V(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,a[2*n]=a[2*r]+a[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,a[2*r+1]=a[2*i+1]=n,e.heap[1]=n++,V(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,n,a,o,s,c=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,p=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(a=0;a<=v;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return s;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return u;for(t=32;t>>3,(a=e.static_len+3+7>>>3)<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==t?X(e,t,r,i):4===e.strategy||a===n?(N(e,2+(i?1:0),3),G(e,E,A)):(N(e,4+(i?1:0),3),function(e,t,r,i){var n;for(N(e,t-257,5),N(e,r-1,5),N(e,i-4,4),n=0;n>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(P[r]+p+1)]++,e.dyn_dtree[2*z(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;N(e,2,3),D(e,b,E),16===(t=e).bi_valid?(M(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":358}],368:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],369:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],370:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var a=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=a;var o=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=o;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var f=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=f,r.DSAparam=i.define("DSAparam",function(){this.int()});var p=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=p;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":371,"asn1.js":46}],371:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),a=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(a)}),u=i.define("RDNSequence",function(){this.seqof(c)}),f=i.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),p=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(f),this.key("validity").use(p),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),d=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=d},{"asn1.js":46}],372:[function(e,t,r){(function(h){var l=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,d=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m,m=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,g=e("evp_bytestokey"),v=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(l);if(n){var a="aes"+n[1],o=new h(n[2],"hex"),s=new h(n[3].replace(/[\r\n]/g,""),"base64"),c=g(t,o.slice(0,8),parseInt(n[1],10)).key,u=[],f=v.createDecipheriv(a,c,o);u.push(f.update(s)),u.push(f.final()),r=h.concat(u)}else{var p=i.match(m);r=new h(p[2].replace(/[\r\n]/g,""),"base64")}return{tag:i.match(d)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":160,buffer:191,evp_bytestokey:270}],373:[function(t,r,e){(function(b){var y=t("./asn1"),_=t("./aesid.json"),w=t("./fixProc"),k=t("browserify-aes"),x=t("pbkdf2");function e(e){var t;"object"!==(void 0===e?"undefined":_typeof(e))||b.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new b(e));var r,i,n,a,o,s,c,u,f,p,h,l,d,m=w(e,t),g=m.tag,v=m.data;switch(g){case"CERTIFICATE":i=y.certificate.decode(v,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=y.PublicKey.decode(v,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=y.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"ENCRYPTED PRIVATE KEY":v=y.EncryptedPrivateKey.decode(v,"der"),a=t,o=(n=v).algorithm.decrypt.kde.kdeparams.salt,s=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=_[n.algorithm.decrypt.cipher.algo.join(".")],u=n.algorithm.decrypt.cipher.iv,f=n.subjectPrivateKey,p=parseInt(c.split("-")[1],10)/8,h=x.pbkdf2Sync(a,o,s,p),l=k.createDecipheriv(c,h,u),(d=[]).push(l.update(f)),d.push(l.final()),v=b.concat(d);case"PRIVATE KEY":switch(r=(i=y.PrivateKey.decode(v,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:y.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=y.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"RSA PUBLIC KEY":return y.RSAPublicKey.decode(v,"der");case"RSA PRIVATE KEY":return y.RSAPrivateKey.decode(v,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:y.DSAPrivateKey.decode(v,"der")};case"EC PRIVATE KEY":return{curve:(v=y.ECPrivateKey.decode(v,"der")).parameters.value,privateKey:v.privateKey};default:throw new Error("unknown key type "+g)}}(r.exports=e).signature=y.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":369,"./asn1":370,"./fixProc":372,"browserify-aes":160,buffer:191,pbkdf2:375}],374:[function(e,t,u){(function(n){function a(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function o(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;ia?t=n(t):t.length "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+o+";","var res;","switch (argLength) {",r.concat(["extra"]).map(function(e,t){return"case "+t+":res = fn.call("+["self"].concat(r.slice(0,t)).concat("cb").join(",")+");break;"}).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],n)(a,e)}(e)};var o="function (err, res) {if (err) { rj(err); } else { rs(res); }}";a.nodeify=function(r){return function(){var e=Array.prototype.slice.call(arguments),t="function"==typeof e[e.length-1]?e.pop():null,i=this;try{return r.apply(this,arguments).nodeify(t,i)}catch(r){if(null==t)return new a(function(e,t){t(r)});n(function(){t.call(i,r)})}}},a.prototype.nodeify=function(t,r){if("function"!=typeof t)return this;this.then(function(e){n(function(){t.call(r,null,e)})},function(e){n(function(){t.call(r,e)})})}},{"./core.js":384,asap:44}],390:[function(e,t,r){"use strict";var i=e("./core.js");(t.exports=i).enableSynchronous=function(){i.prototype.isPending=function(){return 0==this.getState()},i.prototype.isFulfilled=function(){return 1==this.getState()},i.prototype.isRejected=function(){return 2==this.getState()},i.prototype.getValue=function(){if(3===this._65)return this._55.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._55},i.prototype.getReason=function(){if(3===this._65)return this._55.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._55},i.prototype.getState=function(){return 3===this._65?this._55.getState():-1===this._65||-2===this._65?0:this._65}},i.disableSynchronous=function(){i.prototype.isPending=void 0,i.prototype.isFulfilled=void 0,i.prototype.isRejected=void 0,i.prototype.getValue=void 0,i.prototype.getReason=void 0,i.prototype.getState=void 0}},{"./core.js":384}],391:[function(e,t,r){"use strict";var n=function(e){for(var t=e.toString(16);4!==t.length;)t="0"+t;return"\\u"+t};t.exports=function(e,t,r,i){return!r.key||61!==t&&58!==t&&t!==r.separator?31o||0<=new u(t).cmp(a.modulus))throw new Error("decryption error");n=r?d(new u(t),a):h(t,a);var s=m.alloc(o-n.length);if(n=m.concat([s,n],o),4===i)return function(e,t){var r=e.modulus.byteLength(),i=l("sha1").update(m.alloc(0)).digest(),n=i.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,n+1),o=t.slice(n+1),s=p(a,f(o,n)),c=p(o,f(s,r-n-1));if(function(e,t){e=m.from(e),t=m.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){a++;break}var o=t.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&a++;o.length<8&&a++;if(a)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}},{"./mgf":401,"./withPublic":404,"./xor":405,"bn.js":154,"browserify-rsa":178,"create-hash":200,"parse-asn1":373,"safe-buffer":447}],403:[function(e,t,r){var o=e("parse-asn1"),h=e("randombytes"),l=e("create-hash"),d=e("./mgf"),m=e("./xor"),g=e("bn.js"),s=e("./withPublic"),c=e("browserify-rsa"),v=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,a=o(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=l("sha1").update(v.alloc(0)).digest(),a=n.length,o=2*a;if(r-o-2>6]+a[128|63&n]:n<55296||57344<=n?r+=a[224|n>>12]+a[128|n>>6&63]+a[128|63&n]:(i+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),r+=a[240|n>>18]+a[128|n>>12&63]+a[128|n>>6&63]+a[128|63&n])}return r},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function i(r,n,a){if(!n)return r;if("object"!==(void 0===n?"undefined":_typeof(n))){if(Array.isArray(r))r.push(n);else{if("object"!==(void 0===r?"undefined":_typeof(r)))return[r,n];(a.plainObjects||a.allowPrototypes||!o.call(Object.prototype,n))&&(r[n]=!0)}return r}if("object"!==(void 0===r?"undefined":_typeof(r)))return[r].concat(n);var e=r;return Array.isArray(r)&&!Array.isArray(n)&&(e=s(r,a)),Array.isArray(r)&&Array.isArray(n)?(n.forEach(function(e,t){o.call(r,t)?r[t]&&"object"===_typeof(r[t])?r[t]=i(r[t],e,a):r.push(e):r[t]=e}),r):Object.keys(n).reduce(function(e,t){var r=n[t];return o.call(e,t)?e[t]=i(e[t],r,a):e[t]=r,e},e)}}},{}],411:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var a=/\+/g;e=e.split(t);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var s,c,u=e.length;0t.highWaterMark&&(t.highWaterMark=(m<=(r=e)?r=m:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(_("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?v.nextTick(x,e):x(e))}function x(e){_("emit readable"),e.emit("readable"),I(e)}function S(e,t){t.readingMore||(t.readingMore=!0,v.nextTick(j,e,t))}function j(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;ea.length?a.length:e;if(o===a.length?n+=a:n+=a.slice(0,e),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=a.slice(o);break}++i}return t.length-=i,n}(e,t):function(e,t){var r=u.allocUnsafe(e),i=t.head,n=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i).data=a.slice(o);break}++n}return t.length-=n,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return _("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):k(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,n=t.needReadable;return _("need readable",n),(0===t.length||t.length-e>>0),a=this.head,o=0;a;)t=a.data,r=n,i=o,t.copy(r,i),o+=a.data.length,a=a.next;return n},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":447,util:157}],423:[function(e,t,r){"use strict";var a=e("process-nextick-args");function o(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a.nextTick(o,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(o,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":381}],424:[function(e,t,r){t.exports=e("events").EventEmitter},{events:269}],425:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":426}],426:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":417,"./lib/_stream_passthrough.js":418,"./lib/_stream_readable.js":419,"./lib/_stream_transform.js":420,"./lib/_stream_writable.js":421}],427:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":426}],428:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":421}],429:[function(e,t,r){"use strict";var s=e("../"),c=e("lodash/isArray"),u=e("lodash/isFunction"),f=e("lodash/isObjectLike");t.exports=function(e){var t="Please verify options";if(!f(e))throw new TypeError(t);if(!u(e.request))throw new TypeError(t+".request");if(!c(e.expose)||0===e.expose.length)throw new TypeError(t+".expose");for(var r=s({PromiseImpl:e.PromiseImpl,constructorMixin:e.constructorMixin}),i=e.request.Request.prototype.init,n=!(e.request.Request.prototype.init=function(e){return!f(e)||this._callback||this._rp_promise||r.init.call(this,e),i.apply(this,arguments)}),a=0;a=t.maxRedirects)return r.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+r.uri.href)),!1;t.redirectsFollowed+=1,o.test(i)||(i=a.resolve(r.uri.href,i));var n=r.uri;return r.uri=a.parse(i),r.uri.protocol!==n.protocol&&delete r.agent,t.redirects.push({statusCode:e.statusCode,redirectUri:i}),t.followAllRedirects&&"HEAD"!==r.method&&401!==e.statusCode&&307!==e.statusCode&&(r.method=t.followOriginalHttpMethod?r.method:"GET"),delete r.src,delete r.req,delete r._started,401!==e.statusCode&&307!==e.statusCode&&(delete r.body,delete r._form,r.headers&&(r.removeHeader("host"),r.removeHeader("content-type"),r.removeHeader("content-length"),r.uri.hostname!==r.originalHost.split(":")[0]&&r.removeHeader("authorization"))),t.removeRefererHeader||r.setHeader("referer",n.href),r.emit("redirect"),r.init(),!0},r.Redirect=i},{url:500}],444:[function(e,t,r){"use strict";var w=e("url"),k=e("tunnel-agent"),i=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],x=["proxy-authorization"];function n(e){this.request=e,this.proxyHeaderWhiteList=i,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}n.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},n.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=w.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,i,n,a,o,s,c=this.proxyHeaderExclusiveList.concat(x),u=this.proxyHeaderWhiteList.concat(c),f=(r=t.headers,i=u.reduce(function(e,t){return e[t.toLowerCase()]=!0,e},{}),Object.keys(r).filter(function(e){return i[e.toLowerCase()]}).reduce(function(e,t){return e[t]=r[t],e},{}));f.host=(n=t.uri,a=n.port,o=n.protocol,s=n.hostname+":",s+=a||("https:"===o?"443":"80")),c.forEach(t.removeHeader,t);var p,h,l,d,m,g,v,b,y=(l=(p=t).uri,d=p.proxy,h=d,m=["https:"===l.protocol?"https":"http","https:"===h.protocol?"Https":"Http"].join("Over"),k[m]),_=(v=f,{proxy:{host:(b=(g=t).proxy).hostname,port:+b.port,proxyAuth:b.auth,headers:v},headers:g.headers,ca:g.ca,cert:g.cert,key:g.key,passphrase:g.passphrase,pfx:g.pfx,ciphers:g.ciphers,rejectUnauthorized:g.rejectUnauthorized,secureOptions:g.secureOptions,secureProtocol:g.secureProtocol});return t.agent=y(_),!0},n.defaultProxyHeaderWhiteList=i,n.defaultProxyHeaderExclusiveList=x,r.Tunnel=n},{"tunnel-agent":497,url:500}],445:[function(U,H,e){(function(e){"use strict";var w=U("http"),k=U("https"),x=U("url"),t=U("util"),n=U("stream"),f=U("zlib"),c=U("aws-sign2"),u=U("aws4"),i=U("http-signature"),S=U("mime-types"),j=U("caseless"),E=U("forever-agent"),r=U("form-data"),a=U("extend"),A=U("isstream"),I=U("is-typedarray").strict,o=U("./lib/helpers"),s=U("./lib/cookies"),P=U("./lib/getProxyFromURI"),p=U("./lib/querystring").Querystring,h=U("./lib/har").Har,l=U("./lib/auth").Auth,d=U("./lib/oauth").OAuth,m=U("./lib/hawk"),g=U("./lib/multipart").Multipart,v=U("./lib/redirect").Redirect,b=U("./lib/tunnel").Tunnel,y=U("performance-now"),O=U("safe-buffer").Buffer,_=o.safeStringify,T=o.isReadStream,B=o.toBase64,C=o.defer,F=o.copy,R=o.version,z=s.jar(),M={};function N(){return{uri:this.uri,method:this.method,headers:this.headers}}function D(){return{statusCode:this.statusCode,body:this.body,headers:this.headers,request:N.call(this.request)}}function q(e){var t=this;e.har&&(t._har=new h(t),e=t._har.options(e)),n.Stream.call(t);var r=Object.keys(q.prototype),i=function(e,t){var r={};for(var i in t)-1===e.indexOf(i)&&(r[i]=t[i]);return r}(r,e);a(t,i),e=function(e,t){var r={};for(var i in t){var n=!(-1===e.indexOf(i)),a="function"==typeof t[i];n&&a||(r[i]=t[i])}return r}(r,e),t.readable=!0,t.writable=!0,e.method&&(t.explicitMethod=!0),t._qs=new p(t),t._auth=new l(t),t._oauth=new d(t),t._multipart=new g(t),t._redirect=new v(t),t._tunnel=new b(t),t.init(e)}function L(){q.debug&&console.error("REQUEST %s",t.format.apply(t,arguments))}t.inherits(q,n.Stream),q.debug=e.env.NODE_DEBUG&&/\brequest\b/.test(e.env.NODE_DEBUG),q.prototype.debug=L,q.prototype.init=function(e){var i=this;for(var t in e||(e={}),i.headers=i.headers?F(i.headers):{},i.headers)void 0===i.headers[t]&&delete i.headers[t];if(j.httpify(i,i.headers),i.method||(i.method=e.method||"GET"),i.localAddress||(i.localAddress=e.localAddress),i._qs.init(e),L(e),i.pool||!1===i.pool||(i.pool=M),i.dests=i.dests||[],i.__isRequestRequest=!0,!i._callback&&i.callback&&(i._callback=i.callback,i.callback=function(){i._callbackCalled||(i._callbackCalled=!0,i._callback.apply(i,arguments))},i.on("error",i.callback.bind()),i.on("complete",i.callback.bind(i,null))),!i.uri&&i.url&&(i.uri=i.url,delete i.url),i.baseUrl){if("string"!=typeof i.baseUrl)return i.emit("error",new Error("options.baseUrl must be a string"));if("string"!=typeof i.uri)return i.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(0===i.uri.indexOf("//")||-1!==i.uri.indexOf("://"))return i.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var r=i.baseUrl.lastIndexOf("/")===i.baseUrl.length-1,n=0===i.uri.indexOf("/");r&&n?i.uri=i.baseUrl+i.uri.slice(1):r||n?i.uri=i.baseUrl+i.uri:""===i.uri?i.uri=i.baseUrl:i.uri=i.baseUrl+"/"+i.uri,delete i.baseUrl}if(!i.uri)return i.emit("error",new Error("options.uri is a required argument"));if("string"==typeof i.uri&&(i.uri=x.parse(i.uri)),i.uri.href||(i.uri.href=x.format(i.uri)),"unix:"===i.uri.protocol)return i.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if("unix"===i.uri.host&&i.enableUnixSocket(),!1===i.strictSSL&&(i.rejectUnauthorized=!1),i.uri.pathname||(i.uri.pathname="/"),!(i.uri.host||i.uri.hostname&&i.uri.port||i.uri.isUnix)){var a='Invalid URI "'+x.format(i.uri)+'"';return 0===Object.keys(e).length&&(a+=". This can be caused by a crappy redirection."),i.abort(),i.emit("error",new Error(a))}if(i.hasOwnProperty("proxy")||(i.proxy=P(i.uri)),i.tunnel=i._tunnel.isEnabled(),i.proxy&&i._tunnel.setup(e),i._redirect.onRequest(e),i.setHost=!1,!i.hasHeader("host")){var o=i.originalHostHeaderName||"host";i.setHeader(o,i.uri.host),i.uri.port&&("80"===i.uri.port&&"http:"===i.uri.protocol||"443"===i.uri.port&&"https:"===i.uri.protocol)&&i.setHeader(o,i.uri.hostname),i.setHost=!0}if(i.jar(i._jar||e.jar),i.uri.port||("http:"===i.uri.protocol?i.uri.port=80:"https:"===i.uri.protocol&&(i.uri.port=443)),i.proxy&&!i.tunnel?(i.port=i.proxy.port,i.host=i.proxy.hostname):(i.port=i.uri.port,i.host=i.uri.hostname),e.form&&i.form(e.form),e.formData){var s=e.formData,c=i.form(),u=function(e,t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?c.append(e,t.value,t.options):c.append(e,t)};for(var f in s)if(s.hasOwnProperty(f)){var p=s[f];if(p instanceof Array)for(var h=0;h>>32-t}function S(e,t,r,i,n,a,o,s){return x(e+(t^r^i)+a+o|0,s)+n|0}function j(e,t,r,i,n,a,o,s){return x(e+(t&r|~t&i)+a+o|0,s)+n|0}function E(e,t,r,i,n,a,o,s){return x(e+((t|~r)^i)+a+o|0,s)+n|0}function A(e,t,r,i,n,a,o,s){return x(e+(t&i|r&~i)+a+o|0,s)+n|0}function I(e,t,r,i,n,a,o,s){return x(e+(t^(r|~i))+a+o|0,s)+n|0}n(o,a),o.prototype._update=function(){for(var e=g,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,a=0|this._d,o=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,f=0|this._d,p=0|this._e,h=0;h<80;h+=1){var l,d;d=h<16?(l=S(r,i,n,a,o,e[v[h]],w[0],y[h]),I(s,c,u,f,p,e[b[h]],k[0],_[h])):h<32?(l=j(r,i,n,a,o,e[v[h]],w[1],y[h]),A(s,c,u,f,p,e[b[h]],k[1],_[h])):h<48?(l=E(r,i,n,a,o,e[v[h]],w[2],y[h]),E(s,c,u,f,p,e[b[h]],k[2],_[h])):h<64?(l=A(r,i,n,a,o,e[v[h]],w[3],y[h]),j(s,c,u,f,p,e[b[h]],k[3],_[h])):(l=I(r,i,n,a,o,e[v[h]],w[4],y[h]),S(s,c,u,f,p,e[b[h]],k[4],_[h])),r=o,o=a,a=x(n,10),n=i,i=l,s=p,p=f,f=x(u,10),u=c,c=d}var m=this._b+n+f|0;this._b=this._c+a+p|0,this._c=this._d+o+s|0,this._d=this._e+r+c|0,this._e=this._a+i+u|0,this._a=m},o.prototype._digest=function(){this._block[this._blockOffset++]=128,56=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 a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":447}],450:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":451,"./sha1":452,"./sha224":453,"./sha256":454,"./sha384":455,"./sha512":456}],451:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,v=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s=this._w,c=0|this._a,u=0|this._b,f=0|this._c,p=0|this._d,h=0|this._e,l=0;l<16;++l)s[l]=e.readInt32BE(4*l);for(;l<80;++l)s[l]=s[l-3]^s[l-8]^s[l-14]^s[l-16];for(var d=0;d<80;++d){var m=~~(d/20),g=0|((o=c)<<5|o>>>27)+(i=u,n=f,a=p,0===(r=m)?i&n|~i&a:2===r?i&n|i&a|n&a:i^n^a)+h+s[d]+v[m];h=p,p=f,f=(t=u)<<30|t>>>2,u=c,c=g}this._a=c+this._a|0,this._b=u+this._b|0,this._c=f+this._c|0,this._d=p+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],452:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0;d<16;++d)c[d]=e.readInt32BE(4*d);for(;d<80;++d)c[d]=(t=c[d-3]^c[d-8]^c[d-14]^c[d-16])<<1|t>>>31;for(var m=0;m<80;++m){var g=~~(m/20),v=0|((s=u)<<5|s>>>27)+(n=f,a=p,o=h,0===(i=g)?n&a|~n&o:2===i?n&a|n&o|a&o:n^a^o)+l+c[m]+b[g];l=h,h=p,p=(r=f)<<30|r>>>2,f=u,u=v}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],453:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}i(c,n),c.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},c.prototype._hash=function(){var e=o.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},t.exports=c},{"./hash":449,"./sha256":454,inherits:320,"safe-buffer":447}],454:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,w=[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],o=new Array(64);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0|this._f,m=0|this._g,g=0|this._h,v=0;v<16;++v)c[v]=e.readInt32BE(4*v);for(;v<64;++v)c[v]=0|(((r=c[v-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+c[v-7]+(((t=c[v-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+c[v-16];for(var b=0;b<64;++b){var y=g+(((s=l)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((o=m)^l&(d^o))+w[b]+c[b]|0,_=0|(((a=u)>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+((i=u)&(n=f)|p&(i|n));g=m,m=d,d=l,l=h+y|0,h=p,p=f,f=u,u=y+_|0}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],455:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(160);function c(){this.init(),this._w=s,a.call(this,128,112)}i(c,n),c.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},c.prototype._hash=function(){var i=o.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=c},{"./hash":449,"./sha512":456,inherits:320,"safe-buffer":447}],456:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,ee=[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],o=new Array(160);function s(){this.init(),this._w=o,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ae(e,t){return e>>>0>>0?1:0}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c,u=this._w,f=0|this._ah,p=0|this._bh,h=0|this._ch,l=0|this._dh,d=0|this._eh,m=0|this._fh,g=0|this._gh,v=0|this._hh,b=0|this._al,y=0|this._bl,_=0|this._cl,w=0|this._dl,k=0|this._el,x=0|this._fl,S=0|this._gl,j=0|this._hl,E=0;E<32;E+=2)u[E]=e.readInt32BE(4*E),u[E+1]=e.readInt32BE(4*E+4);for(;E<160;E+=2){var A=u[E-30],I=u[E-30+1],P=((s=A)>>>1|(c=I)<<31)^(s>>>8|c<<24)^s>>>7,O=((a=I)>>>1|(o=A)<<31)^(a>>>8|o<<24)^(a>>>7|o<<25);A=u[E-4],I=u[E-4+1];var T=((i=A)>>>19|(n=I)<<13)^(n>>>29|i<<3)^i>>>6,B=((t=I)>>>19|(r=A)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),C=u[E-14],F=u[E-14+1],R=u[E-32],z=u[E-32+1],M=O+F|0,N=P+C+ae(M,O)|0;N=(N=N+T+ae(M=M+B|0,B)|0)+R+ae(M=M+z|0,z)|0,u[E]=N,u[E+1]=M}for(var D=0;D<160;D+=2){N=u[D],M=u[D+1];var q=re(f,p,h),L=re(b,y,_),U=ie(f,b),H=ie(b,f),K=ne(d,k),V=ne(k,d),G=ee[D],$=ee[D+1],W=te(d,m,g),Z=te(k,x,S),Y=j+V|0,X=v+K+ae(Y,j)|0;X=(X=(X=X+W+ae(Y=Y+Z|0,Z)|0)+G+ae(Y=Y+$|0,$)|0)+N+ae(Y=Y+M|0,M)|0;var J=H+L|0,Q=U+q+ae(J,H)|0;v=g,j=S,g=m,S=x,m=d,x=k,d=l+X+ae(k=w+Y|0,w)|0,l=h,w=_,h=p,_=y,p=f,y=b,f=X+Q+ae(b=Y+J|0,Y)|0}this._al=this._al+b|0,this._bl=this._bl+y|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+k|0,this._fl=this._fl+x|0,this._gl=this._gl+S|0,this._hl=this._hl+j|0,this._ah=this._ah+f+ae(this._al,b)|0,this._bh=this._bh+p+ae(this._bl,y)|0,this._ch=this._ch+h+ae(this._cl,_)|0,this._dh=this._dh+l+ae(this._dl,w)|0,this._eh=this._eh+d+ae(this._el,k)|0,this._fh=this._fh+m+ae(this._fl,x)|0,this._gh=this._gh+g+ae(this._gl,S)|0,this._hh=this._hh+v+ae(this._hl,j)|0},s.prototype._hash=function(){var i=a.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],457:[function(e,t,r){var i=e("safer-buffer").Buffer,n={dsa:{parts:["p","q","g","y"],sizePart:"p"},rsa:{parts:["e","n"],sizePart:"n"},ecdsa:{parts:["curve","Q"],sizePart:"Q"},ed25519:{parts:["A"],sizePart:"A"}};n.curve25519=n.ed25519;var a={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};a.curve25519=a.ed25519;var o={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:i.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g,""),"hex"),s:i.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g,""),"hex"),n:i.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g,""),"hex"),G:i.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g,""),"hex"),s:i.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g,""),"hex"),n:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g,""),"hex"),G:i.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:i.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g,""),"hex"),a:i.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g,""),"hex"),s:i.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g,""),"hex"),n:i.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g,""),"hex"),G:i.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g,""),"hex")}};t.exports={info:n,privInfo:a,hashAlgs:{md5:!0,sha1:!0,sha256:!0,sha384:!0,sha512:!0},curves:o}},{"safer-buffer":448}],458:[function(e,t,r){t.exports=_;var d=e("assert-plus"),m=e("safer-buffer").Buffer,i=e("./algs"),n=e("crypto"),a=e("./fingerprint"),o=(e("./signature"),e("./errors")),g=(e("util"),e("./utils")),v=e("./key"),b=e("./private-key"),y=e("./identity"),s={};s.openssh=e("./formats/openssh-cert"),s.x509=e("./formats/x509"),s.pem=e("./formats/x509-pem");var c=o.CertificateParseError,u=o.InvalidAlgorithmError;function _(e){d.object(e,"options"),d.arrayOfObject(e.subjects,"options.subjects"),g.assertCompatible(e.subjects[0],y,[1,0],"options.subjects"),g.assertCompatible(e.subjectKey,v,[1,0],"options.subjectKey"),g.assertCompatible(e.issuer,y,[1,0],"options.issuer"),void 0!==e.issuerKey&&g.assertCompatible(e.issuerKey,v,[1,0],"options.issuerKey"),d.object(e.signatures,"options.signatures"),d.buffer(e.serial,"options.serial"),d.date(e.validFrom,"options.validFrom"),d.date(e.validUntil,"optons.validUntil"),d.optionalArrayOfString(e.purposes,"options.purposes"),this._hashCache={},this.subjects=e.subjects,this.issuer=e.issuer,this.subjectKey=e.subjectKey,this.issuerKey=e.issuerKey,this.signatures=e.signatures,this.serial=e.serial,this.validFrom=e.validFrom,this.validUntil=e.validUntil,this.purposes=e.purposes}_.formats=s,_.prototype.toBuffer=function(e,t){return void 0===e&&(e="x509"),d.string(e,"format"),d.object(s[e],"formats[format]"),d.optionalObject(t,"options"),s[e].write(this,t)},_.prototype.toString=function(e,t){return void 0===e&&(e="pem"),this.toBuffer(e,t).toString()},_.prototype.fingerprint=function(e){void 0===e&&(e="sha256"),d.string(e,"algorithm");var t={type:"certificate",hash:this.hash(e),algorithm:e};return new a(t)},_.prototype.hash=function(e){if(d.string(e,"algorithm"),e=e.toLowerCase(),void 0===i.hashAlgs[e])throw new u(e);if(this._hashCache[e])return this._hashCache[e];var t=n.createHash(e).update(this.toBuffer("x509")).digest();return this._hashCache[e]=t},_.prototype.isExpired=function(e){return void 0===e&&(e=new Date),!(e.getTime()>=this.validFrom.getTime()&&e.getTime()e.length||"BEGIN"!==e.slice(t,t+5).toString("ascii"))}(e))return a.read(e,t);if(function(e){var t=0;for(;to.length&&(p=o.length),u+=c.write(o.slice(f,p),u),c[u++]=10,f=p}return u+=c.write("-----END "+i+"-----\n",u),c.slice(0,u)}};var b=e("assert-plus"),y=e("asn1"),_=e("crypto"),w=e("safer-buffer").Buffer,k=(e("../algs"),e("../utils")),h=e("../key"),l=e("../private-key"),x=e("./pkcs1"),S=e("./pkcs8"),j=e("./ssh-private"),E=e("./rfc4253"),A=e("../errors")},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../utils":480,"./pkcs1":467,"./pkcs8":468,"./rfc4253":469,"./ssh-private":470,asn1:65,"assert-plus":66,crypto:204,"safer-buffer":448}],467:[function(e,t,r){t.exports={read:function(e,t){return i.read(e,t,"pkcs1")},readPkcs1:function(e,t,r){switch(e){case"RSA":if("public"===t)return u=y(c=r,"modulus"),f=y(c,"exponent"),new p({type:"rsa",parts:[{name:"e",data:f},{name:"n",data:u}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t[0],0);var r=y(e,"modulus"),i=y(e,"public exponent"),n=y(e,"private exponent"),a=y(e,"prime1"),o=y(e,"prime2"),s=y(e,"exponent1"),c=y(e,"exponent2"),u=y(e,"iqmp");return new v({type:"rsa",parts:[{name:"n",data:r},{name:"e",data:i},{name:"d",data:n},{name:"iqmp",data:u},{name:"p",data:a},{name:"q",data:o},{name:"dmodp",data:s},{name:"dmodq",data:c}]})}(r);throw new Error("Unknown key type: "+t);case"DSA":if("public"===t)return n=y(i=r,"y"),a=y(i,"p"),o=y(i,"q"),s=y(i,"g"),new p({type:"dsa",parts:[{name:"y",data:n},{name:"p",data:a},{name:"q",data:o},{name:"g",data:s}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),0);var r=y(e,"p"),i=y(e,"q"),n=y(e,"g"),a=y(e,"y"),o=y(e,"x");return new v({type:"dsa",parts:[{name:"p",data:r},{name:"q",data:i},{name:"g",data:n},{name:"y",data:a},{name:"x",data:o}]})}(r);throw new Error("Unknown key type: "+t);case"EC":case"ECDSA":if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),1);var r=e.readString(l.Ber.OctetString,!0);e.readSequence(160);var i=b(e);h.string(i,"a known elliptic curve"),e.readSequence(161);var n=e.readString(l.Ber.BitString,!0);n=g.ecNormalize(n);var a={type:"ecdsa",parts:[{name:"curve",data:d.from(i)},{name:"Q",data:n},{name:"d",data:r}]};return new v(a)}(r);if("public"===t)return function(e){e.readSequence();var t=e.readOID();h.strictEqual(t,"1.2.840.10045.2.1","must be ecPublicKey");for(var r,i=e.readOID(),n=Object.keys(m.curves),a=0;aS.length&&(I=S.length),E+=x.write(S.slice(A,I),E),x[E++]=10,A=I}return E+=x.write("-----END "+k+"-----\n",E),x.slice(0,E)}};var O,T=P("assert-plus"),B=(P("asn1"),P("safer-buffer").Buffer),C=(P("../algs"),P("../utils")),F=P("crypto"),R=(P("../key"),P("../private-key")),r=P("./pem"),A=P("./rfc4253"),z=P("../ssh-buffer"),I=P("../errors");var M="openssh-key-v1"},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../ssh-buffer":479,"../utils":480,"./pem":466,"./rfc4253":469,asn1:65,"assert-plus":66,"bcrypt-pbkdf":76,crypto:204,"safer-buffer":448}],471:[function(e,t,r){t.exports={read:function(e,t){"string"!=typeof e&&(h.buffer(e,"buf"),e=e.toString("ascii"));var r=e.trim().replace(/[\\\r]/g,""),i=r.match(m);i||(i=r.match(g));h.ok(i,"key must match regex");var n,a=d.algToKeyType(i[1]),o=l.from(i[2],"base64"),s={};if(i[4])try{n=d.read(o)}catch(e){i=r.match(g),h.ok(i,"key must match regex"),o=l.from(i[2],"base64"),n=d.readInternal(s,"public",o)}else n=d.readInternal(s,"public",o);if(h.strictEqual(a,n.type),i[4]&&0n.length&&(u=n.length),s+=o.write(n.slice(c,u),s),o[s++]=10,c=u}return s+=o.write("-----END "+i+"-----\n",s),o.slice(0,s)}};var o=e("assert-plus"),p=(e("asn1"),e("safer-buffer").Buffer);e("../algs"),e("../utils"),e("../key"),e("../private-key"),e("./pem"),e("../identity"),e("../signature"),e("../certificate")},{"../algs":457,"../certificate":458,"../identity":474,"../key":476,"../private-key":477,"../signature":478,"../utils":480,"./pem":466,"./x509":473,asn1:65,"assert-plus":66,"safer-buffer":448}],473:[function(e,t,r){t.exports={read:function(e,t){"string"==typeof e&&(e=_.from(e,"binary"));b.buffer(e,"buf");var r=new y.BerReader(e);if(r.readSequence(),1=this._buffer.length},a.prototype.remainder=function(){return this._buffer.slice(this._offset)},a.prototype.skip=function(e){this._offset+=e},a.prototype.expand=function(){this._size*=2;var e=n.alloc(this._size);this._buffer.copy(e,0),this._buffer=e},a.prototype.readPart=function(){return{data:this.readBuffer()}},a.prototype.readBuffer=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4,i.ok(this._offset+e<=this._buffer.length,"length out of bounds at +0x"+this._offset.toString(16)+" (data truncated?)");var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t},a.prototype.readString=function(){return this.readBuffer().toString()},a.prototype.readCString=function(){for(var e=this._offset;ethis._size;)this.expand();this._buffer.writeUInt32BE(e.length,this._offset),this._offset+=4,e.copy(this._buffer,this._offset),this._offset+=e.length},a.prototype.writeString=function(e){this.writeBuffer(n.from(e,"utf8"))},a.prototype.writeCString=function(e){for(;this._offset+1+e.length>this._size;)this.expand();this._buffer.write(e,this._offset),this._offset+=e.length,this._buffer[this._offset++]=0},a.prototype.writeInt=function(e){for(;this._offset+4>this._size;)this.expand();this._buffer.writeUInt32BE(e,this._offset),this._offset+=4},a.prototype.writeInt64=function(e){if(i.buffer(e,"value"),8this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=8},a.prototype.writeChar=function(e){for(;this._offset+1>this._size;)this.expand();this._buffer[this._offset++]=e},a.prototype.writePart=function(e){this.writeBuffer(e.data)},a.prototype.write=function(e){for(;this._offset+e.length>this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=e.length}},{"assert-plus":66,"safer-buffer":448}],480:[function(e,t,r){t.exports={bufferSplit:function(e,t){p.buffer(e),p.string(t);for(var r=[],i=0,n=0,a=0;a=t.length){var o=a+1;r.push(e.slice(i,o-n)),i=o,n=0}i<=e.length&&r.push(e.slice(i,e.length));return r},addRSAMissing:function(e){p.object(e),u(e,s,[1,1]);var t,r=new g(e.part.d.data);if(!e.part.dmodp){var i=new g(e.part.p.data),n=r.mod(i.subtract(1));t=_(n),e.part.dmodp={name:"dmodp",data:t},e.parts.push(e.part.dmodp)}if(!e.part.dmodq){var a=new g(e.part.q.data),o=r.mod(a.subtract(1));t=_(o),e.part.dmodq={name:"dmodq",data:t},e.parts.push(e.part.dmodq)}},calculateDSAPublic:function(e,t,r){return p.buffer(e),p.buffer(t),p.buffer(r),e=new g(e),t=new g(t),r=new g(r),_(e.modPow(r,t))},calculateED25519Public:function(e){p.buffer(e);var t=i.sign.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},calculateX25519Public:function(e){p.buffer(e);var t=i.box.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},mpNormalize:y,mpDenormalize:function(e){p.buffer(e);for(;1c)return!1;if(i.constructor.name!==t.name)return!1;var a=i._sshpkApiVersion;void 0===a&&(a=t._oldVersionDetect(e));return!(a[0]!=r[0]||a[1]t;)p.equal(e[0],0),e=e.slice(1);for(;e.length=r[1],i+" must be compatible with "+t.name+" klass version "+r[0]+"."+r[1])}}var v={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}},b=8;function y(e){for(p.buffer(e);1t._pos){var i=r.substr(t._pos);if("x-user-defined"===t._charset){for(var n=new p(i.length),a=0;at._pos&&(t.push(new p(new Uint8Array(o.result.slice(t._pos)))),t._pos=o.result.byteLength)},o.onload=function(){t.push(null)},o.readAsArrayBuffer(r)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":484,_process:382,buffer:191,inherits:320,"readable-stream":426}],487:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=p,t=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1=2.4.3 <2.5.0",_id:"tough-cookie@2.4.3",_inCache:!0,_installable:!0,_location:"/tough-cookie",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/tough-cookie_2.4.3_1529960207843_0.4882910670728131"},_npmUser:{email:"jstash@gmail.com",name:"jstash"},_npmVersion:"6.1.0",_phantomChildren:{},_requested:{name:"tough-cookie",raw:"tough-cookie@~2.4.3",rawSpec:"~2.4.3",scope:null,spec:">=2.4.3 <2.5.0",type:"range"},_requiredBy:["/request","/request-promise"],_resolved:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",_shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",_shrinkwrap:null,_spec:"tough-cookie@~2.4.3",_where:"/home/administrator/javascript-opentimestamps/node_modules/request",author:{email:"jstash@gmail.com",name:"Jeremy Stashewsky"},bugs:{url:"https://github.com/salesforce/tough-cookie/issues"},contributors:[{name:"Alexander Savin"},{name:"Ian Livingstone"},{name:"Ivan Nikulin"},{name:"Lalit Kapoor"},{name:"Sam Thompson"},{name:"Sebastian Mayr"}],dependencies:{psl:"^1.1.24",punycode:"^1.4.1"},description:"RFC6265 Cookies and Cookie Jar for node.js",devDependencies:{async:"^1.4.2",nyc:"^11.6.0","string.prototype.repeat":"^0.2.0",vows:"^0.8.1"},directories:{},dist:{fileCount:9,integrity:"sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMVcQCRA9TVsSAnZWagAAzX0P/2COkbzb3dOX/FTOYIVL\n7oHge7BvGODNkEHTjBtNsR0jO/AA/gVcUOq6CSmFH+UC14LrmCyNDemQvD15\njnYuJXUIiZsSZO7BGGbOFYrQF+DKLiwgf0LokrIM8KasZ5nxc5xS1jYHG5o+\nwCqutfhlRTqlPbZsexB+eRlIuYNvpsbRAdSDYXrhLJNMZgx49g/SZ7IwunGN\nJ/5Fe041MZqqdi7MAavM3T7vX9IvVRJJ3f4xAEVxY1vh4s0dN+h4fG2eMQzL\nOiaulRUIahs4xmJUYHZgZESc9eTIrI8K+YT7i3r35TGc0Du7ueB2KYxBqy7q\n6AUFbdX9Ep308kTVsTf/h4wE0RvdxKLfZ0ww7T1ivADX9xMi2oIvVtyhCQHo\nSIpyBhaav/fTufF0/Fu4Lcr7PMJxyvF0UcNRqrPmEQTw4UZkFKfT8HN2P5cH\nBvJsFwpeEjt84tt5pJ/bmD0j0EUCLUXLGH6fbA84fHpZGifO239zSf262Qdv\nSXeygU7YxnK8wOCnvlauZx/gp+/WTMfMdODxiX0QnqwS5BctiPCgGG1cKJcC\nqvTECaAEmxMVf/gEW73oxVXJgUO7f6jJaWoawV7ka+wR91W9Bp0pKGOOAxAG\nU72rmnwQKid9U7ly5833sb3D+lbzKJXGNIqohegP4daKZfNNTaLWZXmKE+Iy\n7Vml\r\n=8KpS\r\n-----END PGP SIGNATURE-----\r\n",shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",tarball:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",unpackedSize:83959},engines:{node:">=0.8"},files:["lib"],gitHead:"671ad413b38d7464352886772f57a7ec417d4760",homepage:"https://github.com/salesforce/tough-cookie",keywords:["HTTP","RFC2965","RFC6265","cookie","cookiejar","cookies","jar","set-cookie"],license:"BSD-3-Clause",main:"./lib/cookie",maintainers:[{name:"awaterma",email:"awaterma@awaterma.net"},{name:"jstash",email:"jstash@gmail.com"},{name:"maratto",email:"marat+npm@salesforce.com"},{name:"ruoho",email:"clint@ruoho.org"}],name:"tough-cookie",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/salesforce/tough-cookie.git"},scripts:{cover:"nyc --reporter=lcov --reporter=html vows test/*_test.js",test:"vows test/*_test.js"},version:"2.4.3"}},{}],497:[function(s,e,c){(function(u){"use strict";s("net");var f,a=s("tls"),r=s("http"),i=s("https"),e=s("events"),p=s("assert"),t=s("util"),h=s("safe-buffer").Buffer;function o(e){var o=this;o.options=e||{},o.proxyOptions=o.options.proxy||{},o.maxSockets=o.options.maxSockets||r.Agent.defaultMaxSockets,o.requests=[],o.sockets=[],o.on("free",function(e,t,r){for(var i=0,n=o.requests.length;i=this.maxSockets?this.requests.push({host:t.host,port:t.port,request:e}):this.createConnection({host:t.host,port:t.port,request:e})},o.prototype.createConnection=function(e){var n=this;n.createSocket(e,function(t){function r(){n.emit("free",t,e.host,e.port)}function i(e){n.removeSocket(t),t.removeListener("free",r),t.removeListener("close",i),t.removeListener("agentRemove",i)}t.on("free",r),t.on("close",i),t.on("agentRemove",i),e.request.onSocket(t)})},o.prototype.createSocket=function(n,a){var o=this,s={};o.sockets.push(s);var e=l({},o.proxyOptions,{method:"CONNECT",path:n.host+":"+n.port,agent:!1});e.proxyAuth&&(e.headers=e.headers||{},e.headers["Proxy-Authorization"]="Basic "+h.from(e.proxyAuth).toString("base64")),f("making CONNECT request");var c=o.request(e);function i(e,t,r){if(c.removeAllListeners(),t.removeAllListeners(),200===e.statusCode)p.equal(r.length,0),f("tunneling connection has established"),o.sockets[o.sockets.indexOf(s)]=t,a(t);else{f("tunneling socket could not be established, statusCode=%d",e.statusCode);var i=new Error("tunneling socket could not be established, statusCode="+e.statusCode);i.code="ECONNRESET",n.request.emit("error",i),o.removeSocket(s)}}c.useChunkedEncodingByDefault=!1,c.once("response",function(e){e.upgrade=!0}),c.once("upgrade",function(e,t,r){u.nextTick(function(){i(e,t,r)})}),c.once("connect",i),c.once("error",function(e){c.removeAllListeners(),f("tunneling socket could not be established, cause=%s\n",e.message,e.stack);var t=new Error("tunneling socket could not be established, cause="+e.message);t.code="ECONNRESET",n.request.emit("error",t),o.removeSocket(s)}),c.end()},o.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},f=u.env.NODE_DEBUG&&/\btunnel\b/.test(u.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},c.debug=f}).call(this,s("_process"))},{_process:382,assert:67,events:269,http:483,https:317,net:187,"safe-buffer":447,tls:187,util:505}],498:[function(e,t,r){!function(a){"use strict";var m=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function d(e,t,r,i,n){var a,o=0;for(a=0;a>>8)-1}function v(e,t,r,i){return d(e,t,r,i,16)}function b(e,t,r,i){return d(e,t,r,i,32)}function y(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=a,k=o,x=s,S=c,j=u,E=f,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=0;M<20;M+=2)w^=(n=(C^=(n=(P^=(n=(j^=(n=w+C|0)<<7|n>>>25)+w|0)<<9|n>>>23)+j|0)<<13|n>>>19)+P|0)<<18|n>>>14,E^=(n=(k^=(n=(F^=(n=(O^=(n=E+k|0)<<7|n>>>25)+E|0)<<9|n>>>23)+O|0)<<13|n>>>19)+F|0)<<18|n>>>14,T^=(n=(A^=(n=(x^=(n=(R^=(n=T+A|0)<<7|n>>>25)+T|0)<<9|n>>>23)+R|0)<<13|n>>>19)+x|0)<<18|n>>>14,z^=(n=(B^=(n=(I^=(n=(S^=(n=z+B|0)<<7|n>>>25)+z|0)<<9|n>>>23)+S|0)<<13|n>>>19)+I|0)<<18|n>>>14,w^=(n=(S^=(n=(x^=(n=(k^=(n=w+S|0)<<7|n>>>25)+w|0)<<9|n>>>23)+k|0)<<13|n>>>19)+x|0)<<18|n>>>14,E^=(n=(j^=(n=(I^=(n=(A^=(n=E+j|0)<<7|n>>>25)+E|0)<<9|n>>>23)+A|0)<<13|n>>>19)+I|0)<<18|n>>>14,T^=(n=(O^=(n=(P^=(n=(B^=(n=T+O|0)<<7|n>>>25)+T|0)<<9|n>>>23)+B|0)<<13|n>>>19)+P|0)<<18|n>>>14,z^=(n=(R^=(n=(F^=(n=(C^=(n=z+R|0)<<7|n>>>25)+z|0)<<9|n>>>23)+C|0)<<13|n>>>19)+F|0)<<18|n>>>14;w=w+a|0,k=k+o|0,x=x+s|0,S=S+c|0,j=j+u|0,E=E+f|0,A=A+p|0,I=I+h|0,P=P+l|0,O=O+d|0,T=T+m|0,B=B+g|0,C=C+v|0,F=F+b|0,R=R+y|0,z=z+_|0,e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=x>>>0&255,e[9]=x>>>8&255,e[10]=x>>>16&255,e[11]=x>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=j>>>0&255,e[17]=j>>>8&255,e[18]=j>>>16&255,e[19]=j>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=B>>>0&255,e[45]=B>>>8&255,e[46]=B>>>16&255,e[47]=B>>>24&255,e[48]=C>>>0&255,e[49]=C>>>8&255,e[50]=C>>>16&255,e[51]=C>>>24&255,e[52]=F>>>0&255,e[53]=F>>>8&255,e[54]=F>>>16&255,e[55]=F>>>24&255,e[56]=R>>>0&255,e[57]=R>>>8&255,e[58]=R>>>16&255,e[59]=R>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,i)}function _(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=0;w<20;w+=2)a^=(n=(v^=(n=(l^=(n=(u^=(n=a+v|0)<<7|n>>>25)+a|0)<<9|n>>>23)+u|0)<<13|n>>>19)+l|0)<<18|n>>>14,f^=(n=(o^=(n=(b^=(n=(d^=(n=f+o|0)<<7|n>>>25)+f|0)<<9|n>>>23)+d|0)<<13|n>>>19)+b|0)<<18|n>>>14,m^=(n=(p^=(n=(s^=(n=(y^=(n=m+p|0)<<7|n>>>25)+m|0)<<9|n>>>23)+y|0)<<13|n>>>19)+s|0)<<18|n>>>14,_^=(n=(g^=(n=(h^=(n=(c^=(n=_+g|0)<<7|n>>>25)+_|0)<<9|n>>>23)+c|0)<<13|n>>>19)+h|0)<<18|n>>>14,a^=(n=(c^=(n=(s^=(n=(o^=(n=a+c|0)<<7|n>>>25)+a|0)<<9|n>>>23)+o|0)<<13|n>>>19)+s|0)<<18|n>>>14,f^=(n=(u^=(n=(h^=(n=(p^=(n=f+u|0)<<7|n>>>25)+f|0)<<9|n>>>23)+p|0)<<13|n>>>19)+h|0)<<18|n>>>14,m^=(n=(d^=(n=(l^=(n=(g^=(n=m+d|0)<<7|n>>>25)+m|0)<<9|n>>>23)+g|0)<<13|n>>>19)+l|0)<<18|n>>>14,_^=(n=(y^=(n=(b^=(n=(v^=(n=_+y|0)<<7|n>>>25)+_|0)<<9|n>>>23)+v|0)<<13|n>>>19)+b|0)<<18|n>>>14;e[0]=a>>>0&255,e[1]=a>>>8&255,e[2]=a>>>16&255,e[3]=a>>>24&255,e[4]=f>>>0&255,e[5]=f>>>8&255,e[6]=f>>>16&255,e[7]=f>>>24&255,e[8]=m>>>0&255,e[9]=m>>>8&255,e[10]=m>>>16&255,e[11]=m>>>24&255,e[12]=_>>>0&255,e[13]=_>>>8&255,e[14]=_>>>16&255,e[15]=_>>>24&255,e[16]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255}(e,t,r,i)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function k(e,t,r,i,n,a,o){var s,c,u=new Uint8Array(16),f=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=a[c];for(;64<=n;){for(y(f,u,o,w),c=0;c<64;c++)e[t+c]=r[i+c]^f[c];for(s=1,c=8;c<16;c++)s=s+(255&u[c])|0,u[c]=255&s,s>>>=8;n-=64,t+=64,i+=64}if(0>>=8;r-=64,t+=64}if(0>>13|r<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|i<<6),n=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|n<<9),a=255&e[8]|(255&e[9])<<8,this.r[4]=255&(n>>>4|a<<12),this.r[5]=a>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(a>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,r,i,n,a){var o=new E(a);return o.update(r,i,n),o.finish(e,t),0}function I(e,t,r,i,n,a){var o=new Uint8Array(16);return A(o,0,r,i,n,a),v(e,t,o,0)}function P(e,t,r,i,n){var a;if(r<32)return-1;for(j(e,0,t,0,r,i,n),A(e,16,e,32,r-32,e),a=0;a<16;a++)e[a]=0;return 0}function O(e,t,r,i,n){var a,o=new Uint8Array(32);if(r<32)return-1;if(S(o,0,32,i,n),0!==I(t,16,t,32,r-32,o))return-1;for(j(e,0,t,0,r,i,n),a=0;a<32;a++)e[a]=0;return 0}function T(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function C(e,t,r){for(var i,n=~(r-1),a=0;a<16;a++)i=n&(e[a]^t[a]),e[a]^=i,t[a]^=i}function F(e,t){var r,i,n,a=m(),o=m();for(r=0;r<16;r++)o[r]=t[r];for(B(o),B(o),B(o),i=0;i<2;i++){for(a[0]=o[0]-65517,r=1;r<15;r++)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),n=a[15]>>16&1,a[14]&=65535,C(o,a,1-n)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function R(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return F(r,e),F(i,t),b(r,0,i,0)}function z(e){var t=new Uint8Array(32);return F(t,e),1&t[0]}function M(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function N(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function D(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function q(e,t,r){var i,n,a=0,o=0,s=0,c=0,u=0,f=0,p=0,h=0,l=0,d=0,m=0,g=0,v=0,b=0,y=0,_=0,w=0,k=0,x=0,S=0,j=0,E=0,A=0,I=0,P=0,O=0,T=0,B=0,C=0,F=0,R=0,z=r[0],M=r[1],N=r[2],D=r[3],q=r[4],L=r[5],U=r[6],H=r[7],K=r[8],V=r[9],G=r[10],$=r[11],W=r[12],Z=r[13],Y=r[14],X=r[15];a+=(i=t[0])*z,o+=i*M,s+=i*N,c+=i*D,u+=i*q,f+=i*L,p+=i*U,h+=i*H,l+=i*K,d+=i*V,m+=i*G,g+=i*$,v+=i*W,b+=i*Z,y+=i*Y,_+=i*X,o+=(i=t[1])*z,s+=i*M,c+=i*N,u+=i*D,f+=i*q,p+=i*L,h+=i*U,l+=i*H,d+=i*K,m+=i*V,g+=i*G,v+=i*$,b+=i*W,y+=i*Z,_+=i*Y,w+=i*X,s+=(i=t[2])*z,c+=i*M,u+=i*N,f+=i*D,p+=i*q,h+=i*L,l+=i*U,d+=i*H,m+=i*K,g+=i*V,v+=i*G,b+=i*$,y+=i*W,_+=i*Z,w+=i*Y,k+=i*X,c+=(i=t[3])*z,u+=i*M,f+=i*N,p+=i*D,h+=i*q,l+=i*L,d+=i*U,m+=i*H,g+=i*K,v+=i*V,b+=i*G,y+=i*$,_+=i*W,w+=i*Z,k+=i*Y,x+=i*X,u+=(i=t[4])*z,f+=i*M,p+=i*N,h+=i*D,l+=i*q,d+=i*L,m+=i*U,g+=i*H,v+=i*K,b+=i*V,y+=i*G,_+=i*$,w+=i*W,k+=i*Z,x+=i*Y,S+=i*X,f+=(i=t[5])*z,p+=i*M,h+=i*N,l+=i*D,d+=i*q,m+=i*L,g+=i*U,v+=i*H,b+=i*K,y+=i*V,_+=i*G,w+=i*$,k+=i*W,x+=i*Z,S+=i*Y,j+=i*X,p+=(i=t[6])*z,h+=i*M,l+=i*N,d+=i*D,m+=i*q,g+=i*L,v+=i*U,b+=i*H,y+=i*K,_+=i*V,w+=i*G,k+=i*$,x+=i*W,S+=i*Z,j+=i*Y,E+=i*X,h+=(i=t[7])*z,l+=i*M,d+=i*N,m+=i*D,g+=i*q,v+=i*L,b+=i*U,y+=i*H,_+=i*K,w+=i*V,k+=i*G,x+=i*$,S+=i*W,j+=i*Z,E+=i*Y,A+=i*X,l+=(i=t[8])*z,d+=i*M,m+=i*N,g+=i*D,v+=i*q,b+=i*L,y+=i*U,_+=i*H,w+=i*K,k+=i*V,x+=i*G,S+=i*$,j+=i*W,E+=i*Z,A+=i*Y,I+=i*X,d+=(i=t[9])*z,m+=i*M,g+=i*N,v+=i*D,b+=i*q,y+=i*L,_+=i*U,w+=i*H,k+=i*K,x+=i*V,S+=i*G,j+=i*$,E+=i*W,A+=i*Z,I+=i*Y,P+=i*X,m+=(i=t[10])*z,g+=i*M,v+=i*N,b+=i*D,y+=i*q,_+=i*L,w+=i*U,k+=i*H,x+=i*K,S+=i*V,j+=i*G,E+=i*$,A+=i*W,I+=i*Z,P+=i*Y,O+=i*X,g+=(i=t[11])*z,v+=i*M,b+=i*N,y+=i*D,_+=i*q,w+=i*L,k+=i*U,x+=i*H,S+=i*K,j+=i*V,E+=i*G,A+=i*$,I+=i*W,P+=i*Z,O+=i*Y,T+=i*X,v+=(i=t[12])*z,b+=i*M,y+=i*N,_+=i*D,w+=i*q,k+=i*L,x+=i*U,S+=i*H,j+=i*K,E+=i*V,A+=i*G,I+=i*$,P+=i*W,O+=i*Z,T+=i*Y,B+=i*X,b+=(i=t[13])*z,y+=i*M,_+=i*N,w+=i*D,k+=i*q,x+=i*L,S+=i*U,j+=i*H,E+=i*K,A+=i*V,I+=i*G,P+=i*$,O+=i*W,T+=i*Z,B+=i*Y,C+=i*X,y+=(i=t[14])*z,_+=i*M,w+=i*N,k+=i*D,x+=i*q,S+=i*L,j+=i*U,E+=i*H,A+=i*K,I+=i*V,P+=i*G,O+=i*$,T+=i*W,B+=i*Z,C+=i*Y,F+=i*X,_+=(i=t[15])*z,o+=38*(k+=i*N),s+=38*(x+=i*D),c+=38*(S+=i*q),u+=38*(j+=i*L),f+=38*(E+=i*U),p+=38*(A+=i*H),h+=38*(I+=i*K),l+=38*(P+=i*V),d+=38*(O+=i*G),m+=38*(T+=i*$),g+=38*(B+=i*W),v+=38*(C+=i*Z),b+=38*(F+=i*Y),y+=38*(R+=i*X),a=(i=(a+=38*(w+=i*M))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a=(i=(a+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a+=n-1+37*(n-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=h,e[8]=l,e[9]=d,e[10]=m,e[11]=g,e[12]=v,e[13]=b,e[14]=y,e[15]=_}function L(e,t){q(e,t,t)}function U(e,t){var r,i=m();for(r=0;r<16;r++)i[r]=t[r];for(r=253;0<=r;r--)L(i,i),2!==r&&4!==r&&q(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function H(e,t,r){var i,n,a=new Uint8Array(32),o=new Float64Array(80),s=m(),c=m(),u=m(),f=m(),p=m(),h=m();for(n=0;n<31;n++)a[n]=t[n];for(a[31]=127&t[31]|64,a[0]&=248,M(o,r),n=0;n<16;n++)c[n]=o[n],f[n]=s[n]=u[n]=0;for(s[0]=f[0]=1,n=254;0<=n;--n)C(s,c,i=a[n>>>3]>>>(7&n)&1),C(u,f,i),N(p,s,u),D(s,s,u),N(u,c,f),D(c,c,f),L(f,p),L(h,s),q(s,u,s),q(u,c,p),N(p,s,u),D(s,s,u),L(c,s),D(u,f,h),q(s,u,g),N(s,s,f),q(u,u,s),q(s,f,h),q(f,c,o),L(c,p),C(s,c,i),C(u,f,i);for(n=0;n<16;n++)o[n+16]=s[n],o[n+32]=u[n],o[n+48]=c[n],o[n+64]=f[n];var l=o.subarray(32),d=o.subarray(16);return U(l,l),q(d,d,l),F(e,d),0}function K(e,t){return H(e,t,r)}function V(e,t){return o(t,32),K(e,t)}function G(e,t,r){var i=new Uint8Array(32);return H(i,r,t),_(e,n,i,w)}E.prototype.blocks=function(e,t,r){for(var i,n,a,o,s,c,u,f,p,h,l,d,m,g,v,b,y,_,w,k=this.fin?0:2048,x=this.h[0],S=this.h[1],j=this.h[2],E=this.h[3],A=this.h[4],I=this.h[5],P=this.h[6],O=this.h[7],T=this.h[8],B=this.h[9],C=this.r[0],F=this.r[1],R=this.r[2],z=this.r[3],M=this.r[4],N=this.r[5],D=this.r[6],q=this.r[7],L=this.r[8],U=this.r[9];16<=r;)h=p=0,h+=(x+=8191&(i=255&e[t+0]|(255&e[t+1])<<8))*C,h+=(S+=8191&(i>>>13|(n=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*U),h+=(j+=8191&(n>>>10|(a=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*L),h+=(E+=8191&(a>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*q),p=(h+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*D))>>>13,h&=8191,h+=(I+=s>>>1&8191)*(5*N),h+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*M),h+=(O+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),h+=(T+=8191&(u>>>8|(f=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*R),l=p+=(h+=(B+=f>>>5|k)*(5*F))>>>13,l+=x*F,l+=S*C,l+=j*(5*U),l+=E*(5*L),p=(l+=A*(5*q))>>>13,l&=8191,l+=I*(5*D),l+=P*(5*N),l+=O*(5*M),l+=T*(5*z),p+=(l+=B*(5*R))>>>13,l&=8191,d=p,d+=x*R,d+=S*F,d+=j*C,d+=E*(5*U),p=(d+=A*(5*L))>>>13,d&=8191,d+=I*(5*q),d+=P*(5*D),d+=O*(5*N),d+=T*(5*M),m=p+=(d+=B*(5*z))>>>13,m+=x*z,m+=S*R,m+=j*F,m+=E*C,p=(m+=A*(5*U))>>>13,m&=8191,m+=I*(5*L),m+=P*(5*q),m+=O*(5*D),m+=T*(5*N),g=p+=(m+=B*(5*M))>>>13,g+=x*M,g+=S*z,g+=j*R,g+=E*F,p=(g+=A*C)>>>13,g&=8191,g+=I*(5*U),g+=P*(5*L),g+=O*(5*q),g+=T*(5*D),v=p+=(g+=B*(5*N))>>>13,v+=x*N,v+=S*M,v+=j*z,v+=E*R,p=(v+=A*F)>>>13,v&=8191,v+=I*C,v+=P*(5*U),v+=O*(5*L),v+=T*(5*q),b=p+=(v+=B*(5*D))>>>13,b+=x*D,b+=S*N,b+=j*M,b+=E*z,p=(b+=A*R)>>>13,b&=8191,b+=I*F,b+=P*C,b+=O*(5*U),b+=T*(5*L),y=p+=(b+=B*(5*q))>>>13,y+=x*q,y+=S*D,y+=j*N,y+=E*M,p=(y+=A*z)>>>13,y&=8191,y+=I*R,y+=P*F,y+=O*C,y+=T*(5*U),_=p+=(y+=B*(5*L))>>>13,_+=x*L,_+=S*q,_+=j*D,_+=E*N,p=(_+=A*M)>>>13,_&=8191,_+=I*z,_+=P*R,_+=O*F,_+=T*C,w=p+=(_+=B*(5*U))>>>13,w+=x*U,w+=S*L,w+=j*q,w+=E*D,p=(w+=A*N)>>>13,w&=8191,w+=I*M,w+=P*z,w+=O*R,w+=T*F,x=h=8191&(p=(p=((p+=(w+=B*C)>>>13)<<2)+p|0)+(h&=8191)|0),S=l+=p>>>=13,j=d&=8191,E=m&=8191,A=g&=8191,I=v&=8191,P=b&=8191,O=y&=8191,T=_&=8191,B=w&=8191,t+=16,r-=16;this.h[0]=x,this.h[1]=S,this.h[2]=j,this.h[3]=E,this.h[4]=A,this.h[5]=I,this.h[6]=P,this.h[7]=O,this.h[8]=T,this.h[9]=B},E.prototype.finish=function(e,t){var r,i,n,a,o=new Uint16Array(10);if(this.leftover){for(a=this.leftover,this.buffer[a++]=1;a<16;a++)this.buffer[a]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=r,r=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this.h[a]+r,r=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,i=(1^r)-1,a=0;a<10;a++)o[a]&=i;for(i=~i,a=0;a<10;a++)this.h[a]=this.h[a]&i|o[a];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,a=1;a<8;a++)n=(this.h[a]+this.pad[a]|0)+(n>>>16)|0,this.h[a]=65535&n;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var i,n;if(this.leftover){for(r<(n=16-this.leftover)&&(n=r),i=0;i>>16,I=65535&(S=D),P=S>>>16,E+=65535&(j=((g=K)>>>14|(c=z)<<18)^(K>>>18|z<<14)^(z>>>9|K<<23)),A+=j>>>16,I+=65535&(S=(z>>>14|K<<18)^(z>>>18|K<<14)^(K>>>9|z<<23)),P+=S>>>16,E+=65535&(j=K&(v=V)^~K&(b=G)),A+=j>>>16,I+=65535&(S=z&(u=M)^~z&(f=N)),P+=S>>>16,S=Z[2*k],E+=65535&(j=Z[2*k+1]),A+=j>>>16,I+=65535&S,P+=S>>>16,S=O[k%16],A+=(j=T[k%16])>>>16,I+=65535&S,P+=S>>>16,I+=(A+=(E+=65535&j)>>>16)>>>16,E=65535&(j=w=65535&E|A<<16),A=j>>>16,I=65535&(S=_=65535&I|(P+=I>>>16)<<16),P=S>>>16,E+=65535&(j=(q>>>28|B<<4)^(B>>>2|q<<30)^(B>>>7|q<<25)),A+=j>>>16,I+=65535&(S=(B>>>28|q<<4)^(q>>>2|B<<30)^(q>>>7|B<<25)),P+=S>>>16,A+=(j=q&L^q&U^L&U)>>>16,I+=65535&(S=B&C^B&F^C&F),P+=S>>>16,p=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,y=65535&E|A<<16,E=65535&(j=m),A=j>>>16,I=65535&(S=s),P=S>>>16,A+=(j=w)>>>16,I+=65535&(S=_),P+=S>>>16,C=n,F=a,R=o,z=s=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,M=c,N=u,D=f,B=p,L=h,U=l,H=d,K=m=65535&E|A<<16,V=g,G=v,$=b,q=y,k%16==15)for(x=0;x<16;x++)S=O[x],E=65535&(j=T[x]),A=j>>>16,I=65535&S,P=S>>>16,S=O[(x+9)%16],E+=65535&(j=T[(x+9)%16]),A+=j>>>16,I+=65535&S,P+=S>>>16,_=O[(x+1)%16],E+=65535&(j=((w=T[(x+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),A+=j>>>16,I+=65535&(S=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),P+=S>>>16,_=O[(x+14)%16],A+=(j=((w=T[(x+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,I+=65535&(S=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,O[x]=65535&I|P<<16,T[x]=65535&E|A<<16;E=65535&(j=q),A=j>>>16,I=65535&(S=B),P=S>>>16,S=e[0],A+=(j=t[0])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[0]=B=65535&I|P<<16,t[0]=q=65535&E|A<<16,E=65535&(j=L),A=j>>>16,I=65535&(S=C),P=S>>>16,S=e[1],A+=(j=t[1])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[1]=C=65535&I|P<<16,t[1]=L=65535&E|A<<16,E=65535&(j=U),A=j>>>16,I=65535&(S=F),P=S>>>16,S=e[2],A+=(j=t[2])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[2]=F=65535&I|P<<16,t[2]=U=65535&E|A<<16,E=65535&(j=H),A=j>>>16,I=65535&(S=R),P=S>>>16,S=e[3],A+=(j=t[3])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[3]=R=65535&I|P<<16,t[3]=H=65535&E|A<<16,E=65535&(j=K),A=j>>>16,I=65535&(S=z),P=S>>>16,S=e[4],A+=(j=t[4])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[4]=z=65535&I|P<<16,t[4]=K=65535&E|A<<16,E=65535&(j=V),A=j>>>16,I=65535&(S=M),P=S>>>16,S=e[5],A+=(j=t[5])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[5]=M=65535&I|P<<16,t[5]=V=65535&E|A<<16,E=65535&(j=G),A=j>>>16,I=65535&(S=N),P=S>>>16,S=e[6],A+=(j=t[6])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[6]=N=65535&I|P<<16,t[6]=G=65535&E|A<<16,E=65535&(j=$),A=j>>>16,I=65535&(S=D),P=S>>>16,S=e[7],A+=(j=t[7])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[7]=D=65535&I|P<<16,t[7]=$=65535&E|A<<16,W+=128,i-=128}return i}function X(e,t,r){var i,n=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,Y(n,a,t,r),r%=128,i=0;i>(7&n)&1),J(t,e),J(e,e),Q(e,t,i)}function re(e,t){var r=[m(),m(),m(),m()];T(r[0],i),T(r[1],s),T(r[2],f),q(r[3],i,s),te(e,r,t)}function ie(e,t,r){var i,n=new Uint8Array(64),a=[m(),m(),m(),m()];for(r||o(t,32),X(n,t,32),n[0]&=248,n[31]&=127,n[31]|=64,re(a,n),ee(e,a),i=0;i<32;i++)t[i+32]=e[i];return 0}var ne=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var r,i,n,a;for(i=63;32<=i;--i){for(r=0,n=i-32,a=i-12;n>8,t[n]-=256*r;t[n]+=r,t[i]=0}for(n=r=0;n<32;n++)t[n]+=r-(t[31]>>4)*ne[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*ne[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function oe(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function se(e,t,r,i){var n,a,o=new Uint8Array(64),s=new Uint8Array(64),c=new Uint8Array(64),u=new Float64Array(64),f=[m(),m(),m(),m()];X(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var p=r+64;for(n=0;n>7&&D(e[0],u,e[0]),q(e[3],e[0],e[1]),0)}function ue(e,t,r,i){var n,a=new Uint8Array(32),o=new Uint8Array(64),s=[m(),m(),m(),m()],c=[m(),m(),m(),m()];if(-1,r<64)return-1;if(ce(c,i))return-1;for(n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,M=String.fromCharCode;function N(e){throw new RangeError(o[e])}function s(e,t){var r=e.split("@"),i="";return 1>1,e+=z(e/t);455z((C-n)/p))&&N("overflow"),n+=l*p;var d=h<=o?1:o+26<=h?26:h-o;if(lz(C/m)&&N("overflow"),p*=m}var g=r.length+1;o=L(n-f,g,0==f),z(n/g)>C-a&&N("overflow"),a+=z(n/g),n%=g,r.splice(n++,0,a)}return String.fromCodePoint.apply(String,r)},u=function(e){var t=[],r=(e=D(e)).length,i=128,n=0,a=72,o=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(o=(u=f.next()).done);o=!0){var p=u.value;p<128&&t.push(M(p))}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}var h=t.length,l=h;for(h&&t.push("-");lz((C-n)/w)&&N("overflow"),n+=(d-i)*w,i=d;var k=!0,x=!1,S=void 0;try{for(var j,E=e[Symbol.iterator]();!(k=(j=E.next()).done);k=!0){var A=j.value;if(AC&&N("overflow"),A==i){for(var I=n,P=36;;P+=36){var O=P<=a?1:a+26<=P?26:P-a;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function l(e){for(var t="",r=0,i=e.length;rA-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(V,"g"),Y=new RegExp($,"g"),X=new RegExp(F("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',W),"g"),J=new RegExp(F("[^]",V,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),Q=J;function ee(e){var t=l(e);return t.match(Z)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,a={},o=r.query.split("&"),s=0,c=o.length;s",'"',"`"," ","\r","\n","\t"]),M=["'"].concat(n),N=["%","/","?",";","#"].concat(M),D=["/","?","#"],q=/^[+a-z0-9A-Z_-]{0,63}$/,L=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,U={javascript:!0,"javascript:":!0},H={javascript:!0,"javascript:":!0},K={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},V=e("querystring");function a(e,t,r){if(e&&F.isObject(e)&&e instanceof A)return e;var i=new A;return i.parse(e,t,r),i}A.prototype.parse=function(e,t,r){if(!F.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===e?"undefined":_typeof(e)));var i=e.indexOf("?"),n=-1!==i&&i>t&63|128)}function p(e){if(0==(4294967168&e))return s(e);var t="";return 0==(4294965248&e)?t=s(e>>6&31|192):0==(4294901760&e)?(u(e),t=s(e>>12&15|224),t+=f(e,6)):0==(4292870144&e)&&(t=s(e>>18&7|240),t+=f(e,12),t+=f(e,6)),t+=s(63&e|128)}function h(){if(a<=o)throw Error("Invalid byte index");var e=255&n[o];if(o++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,t;if(a>>10&1023|55296),t=56320|1023&t),n+=s(t);return n}(r)}};if("function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define(function(){return d});else if(t&&!t.nodeType)if(r)r.exports=d;else{var m={}.hasOwnProperty;for(var g in d)m.call(d,g)&&(t[g]=d[g])}else e.utf8=d}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],503:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],504:[function(e,t,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],505:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{"./support/isBuffer":504,_process:382,dup:70,inherits:320}],506:[function(e,t,r){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},{}],507:[function(e,t,r){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var n=new Uint8Array(16);t.exports=function(){return i(n),n}}else{var a=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}},{}],508:[function(e,t,r){var o=e("./lib/rng"),s=e("./lib/bytesToUuid");t.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var a=0;a<16;++a)t[i+a]=n[a];return t||s(n)}},{"./lib/bytesToUuid":506,"./lib/rng":507}],509:[function(e,t,r){var s=e("assert-plus"),i=e("util"),n=e("extsprintf"),c=e("core-util-is").isError,a=n.sprintf;function u(e){var t,r,i,n;if(s.object(e,"args"),s.bool(e.strict,"args.strict"),s.array(e.argv,"args.argv"),0===(t=e.argv).length)r={},i=[];else if(c(t[0]))r={cause:t[0]},i=t.slice(1);else if("object"===_typeof(t[0])){for(n in r={},t[0])r[n]=t[0][n];i=t.slice(1)}else s.string(t[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},i=t;return s.object(r),r.strict||e.strict||(i=i.map(function(e){return null===e?"null":void 0===e?"undefined":e})),{options:r,shortmessage:0===i.length?"":a.apply(null,i)}}function f(){var e,t,r,i,n,a,o;if(e=Array.prototype.slice.call(arguments,0),!(this instanceof f))return t=Object.create(f.prototype),f.apply(t,arguments),t;if((r=u({argv:e,strict:!1})).options.name&&(s.string(r.options.name,'error\'s "name" must be a string'),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,a=r.shortmessage,(i=r.options.cause)&&(s.ok(c(i),"cause is not an Error"),this.jse_cause=i,r.options.skipCauseMessage||(a+=": "+i.message)),this.jse_info={},r.options.info)for(o in r.options.info)this.jse_info[o]=r.options.info[o];return this.message=a,Error.call(this,a),Error.captureStackTrace&&(n=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,n)),this}function o(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof o?(i=(r=u({argv:e,strict:!0})).options,f.call(this,i,"%s",r.shortmessage),this):(t=Object.create(o.prototype),o.apply(t,arguments),t)}function p(e){s.array(e,"list of errors"),s.ok(0this._inputTypes.length&&!n.isObject(e[e.length-1]))return a.inputDefaultBlockNumberFormatter(e.pop())},s.prototype.toPayload=function(e){var t={};return e.length>this._inputTypes.length&&n.isObject(e[e.length-1])&&(t=e[e.length-1]),t.to=this._address,t.data="0x"+this.signature()+i.encodeParams(this._inputTypes,e),t},s.prototype.signature=function(){return o(this._name).slice(0,8)},s.prototype.unpackOutput=function(e){if(e){e=2<=e.length?e.slice(2):e;var t=i.decodeParams(this._outputTypes,e);return 1===t.length?t[0]:t}},s.prototype.call=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),i=this.extractCallback(e),t=this.extractDefaultBlock(e),r=this.toPayload(e);if(!i){var n=this._eth.call(r,t);return this.unpackOutput(n)}var a=this;this._eth.call(r,t,function(t,e){if(t)return i(t,null);var r=null;try{r=a.unpackOutput(e)}catch(e){t=e}i(t,r)})},s.prototype.sendTransaction=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),t=this.extractCallback(e),r=this.toPayload(e);if(0=this.buffer.length)){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,t}}},{key:"read",value:function(e){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,Array.from(t)}},{key:"readBool",value:function(){var e=this.read(1)[0];if(255===e)return!0;if(0===e)return!1;throw new n("read_bool() expected 0xff or 0x00; got +"+e)}},{key:"readVaruint",value:function(){for(var e=0,t=0,r=void 0;e|=(127&(r=this.read(1)[0]))< "+e);if(r>=7}}},{key:"writeByte",value:function(e){if(this.length>=this.buffer.length){var t=2*this.length,r=new Uint8Array(t);r.set(this.buffer,0),this.buffer=r}isNaN(e)?this.buffer[this.length]=e.codePointAt():this.buffer[this.length]=e,this.length++}},{key:"writeBytes",value:function(e){var t=this;e.forEach(function(e){t.writeByte(e)})}},{key:"writeVarbytes",value:function(e){this.writeVaruint(e.length),this.writeBytes(e)}},{key:"toString",value:function(){return this.buffer.toHex(0)}}]),e}();m.exports={StreamDeserialization:h,StreamSerialization:l,DeserializationError:n,BadMagicError:a,UnsupportedMajorVersion:o,TruncationError:s,TrailingGarbageError:c,RecursionLimitError:u,SerializerTypeError:f,SerializerValueError:p,ValueError:e,TypeError:t}}).call(this,d("buffer").Buffer)},{"./extend-error.js":568,"./utils.js":574,buffer:191}],567:[function(e,t,r){"use strict";var s=e("./ops.js"),c=e("./timestamp.js"),i=e("./utils.js"),u=e("./context.js"),f=[0,79,112,101,110,84,105,109,101,115,116,97,109,112,115,0,0,80,114,111,111,102,0,191,137,226,232,132,232,146,148],n=function(){function o(e,t){if(_classCallCheck2(this,o),!(e instanceof s.Op&&t instanceof c))throw new u.ValueError("Invalid Timestamp or fileHashOp");if(t.msg.length!==e._DIGEST_LENGTH())throw new u.ValueError("Timestamp message length and fileHashOp digest length differ");this.fileHashOp=e,this.timestamp=t}return _createClass(o,[{key:"fileDigest",value:function(){return this.timestamp.msg}},{key:"serialize",value:function(e){e.writeBytes(f),e.writeVaruint(1),this.fileHashOp.serialize(e),e.writeBytes(this.timestamp.msg),this.timestamp.serialize(e)}},{key:"serializeToBytes",value:function(){var e=new u.StreamSerialization;return this.serialize(e),e.getOutput()}},{key:"toString",value:function(){var e="DetachedTimestampFile\n";return e+="fileHashOp: "+this.fileHashOp.toString()+"\n",e+="timestamp: "+this.timestamp.toString()+"\n"}},{key:"toJson",value:function(){var e={};e.hash=i.bytesToHex(this.fileDigest()),e.op=this.fileHashOp._HASHLIB_NAME(),e.timestamp=this.timestamp.toJson()}},{key:"equals",value:function(e){return e instanceof o&&(!!e.fileHashOp.equals(this.fileHashOp)&&!!e.timestamp.equals(this.timestamp))}}],[{key:"deserialize",value:function(e){var t=void 0;if(e instanceof u.StreamDeserialization)t=e;else if(e instanceof Array)t=new u.StreamDeserialization(e);else if(e instanceof Uint8Array)t=new u.StreamDeserialization(Array.from(e));else{if(!(e instanceof ArrayBuffer))throw new Error("StreamDeserialization deserialize: Invalid param");t=new u.StreamDeserialization(Array.from(e))}t.assertMagic(f);var r=t.readVaruint();if(1!==r)throw new u.UnsupportedMajorVersion("Version "+r+" detached timestamp files are not supported");var i=s.CryptOp.deserialize(t),n=t.readBytes(i._DIGEST_LENGTH()),a=c.deserialize(t,n);return t.assertEof(),new o(i,a)}},{key:"fromBytes",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOp param");var r=void 0;if(t instanceof u.StreamDeserialization)r=e.hashFd(t);else if(t instanceof Array){var i=new u.StreamDeserialization(t);r=e.hashFd(i)}else if(t instanceof Uint8Array){var n=new u.StreamDeserialization(Array.from(t));r=e.hashFd(n)}else{if(!(t instanceof ArrayBuffer))throw new Error("DetachedTimestampFile: Invalid buffer param");var a=new u.StreamDeserialization(Array.from(t));r=e.hashFd(a)}return new o(e,new c(r))}},{key:"fromHash",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOpss param");if(t instanceof Array)return new o(e,new c(t));if(t instanceof ArrayBuffer||t instanceof Uint8Array)return new o(e,new c(Array.from(t)));throw new Error("DetachedTimestampFile: Invalid fdHash param")}}]),o}();t.exports=n},{"./context.js":566,"./ops.js":572,"./timestamp.js":573,"./utils.js":574}],568:[function(e,t,r){var n=e("util"),a=e("assert");Error.extend=function(r,i){a(r,"subTypeName is required");var e=function e(t){if(!(this instanceof e))return new e(t);try{Error.captureStackTrace(this,this.constructor)}catch(e){}this.name=r,this.code=i,this.message=t||"",this.stack=this.stack.replace("Error",this.toString())};return n.inherits(e,this),e.prototype.toString=function(){return this.name+": "+n.inspect(this.message)},e.extend=this.extend,e}},{assert:67,util:505}],569:[function(e,t,r){"use strict";var a=e("./timestamp.js"),o=e("./ops.js"),i=function(){function h(){_classCallCheck2(this,h)}return _createClass(h,null,[{key:"catThenUnaryOp",value:function(e,t,r){t instanceof a||(t=new a(t)),r instanceof a||(r=new a(r));var i=r.add(new o.OpPrepend(t.msg));return t.ops.set(new o.OpAppend(r.msg),i),i.add(new o.OpSHA256)}},{key:"catSha256",value:function(e,t){return h.catThenUnaryOp(o.OpSHA256,e,t)}},{key:"catSha256d",value:function(e,t){var r=h.catSha256(e,t),i=new o.OpSHA256,n=r.ops.get(i);return void 0===n&&(n=new a(i.call(r.msg)),r.ops.set(i,n)),n}},{key:"makeMerkleTreeIterator",value:function(e){var t=e,r=[],i=void 0;do{t=t[Symbol.iterator](),i=void 0;try{i=t.next().value}catch(e){return"Need at least one timestamp"}var n=!0,a=!(r=[]),o=void 0;try{for(var s,c=t[Symbol.iterator]();!(n=(s=c.next()).done);n=!0){var u=s.value;i=void 0===i?u:void r.push(h.catSha256(i,u))}}catch(e){a=!0,o=e}finally{try{!n&&c.return&&c.return()}finally{if(a)throw o}}0(new i)._MAX_URI_LENGTH())return console.error("URI exceeds maximum length"),!1;for(var t=0;ta.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=a.privateCalendars.length;else if(a.privateCalendars=[],a.calendars&&0!==a.calendars.length||(a.calendars=c.DEFAULT_AGGREGATORS),a.m&&0!==a.m){if(a.m<0||a.m>a.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=1,2<=a.calendars.length&&(a.m=2);o.createTimestamp(i,a.calendars,a.m,a.privateCalendars).then(function(e){if(void 0===e)return r(new Error("Error on timestamp creation"));t()}).catch(function(e){r(e)})})},createTimestamp:function(i,e,t,r){var n=[];return e&&e.forEach(function(e){var t=new c.RemoteCalendar(e);n.push(t.submit(i.msg)),console.log("Submitting to remote calendar "+e)}),r&&r.forEach(function(e,t){var r=new c.RemoteCalendar(t);r.setKey(e),n.push(r.submit(i.msg)),console.log("Submitting to remote calendar "+t)}),new Promise(function(t,r){Promise.all(n.map(u.softFail)).then(function(e){return e.filter(function(e){return!(e instanceof Error)&&void 0!==e}).forEach(function(e){i.merge(e)}),t(i)}).catch(function(e){r(e)})})},makeMerkleTree:function(e){var i=[];return e.forEach(function(e){if(e instanceof s)try{var t=u.randBytes(16),r=e.timestamp.add(new n.OpAppend(u.arrayToBytes(t))).add(new n.OpSHA256);i.push(r)}catch(e){return}else console.error("Invalid input")}),f.makeMerkleTree(i)},verify:function(e,t,i){if(!u.arrEq(e.fileDigest(),t.fileDigest()))return console.error("Expected digest "+u.bytesToHex(e.fileDigest())),console.error("File does not match original!"),new Promise(function(e,t){t(new Error("File does not match original!"))});var n=this;return new Promise(function(t,r){n.upgradeTimestamp(e.timestamp,i).then(function(){n.verifyTimestamp(e.timestamp,i).then(function(e){return t(e)}).catch(function(e){return r(e)})})})},verifyTimestamp:function(e,r){var i=[],n=this;function c(e,t){return e.attestedTimet.attestedTime?1:0}return e.allAttestations().forEach(function(e,t){i.push(n.verifyAttestation(e,t,r))}),new Promise(function(o,s){Promise.all(i.map(u.softFail)).then(function(e){var t=e.filter(function(e){return e.constructor===h.VerificationError?e:void 0});if(0this._MAX_MSG_LENGTH())){var t=this.call(e);return t.length>this._MAX_RESULT_LENGTH()&&console.error("Error : Result too long;"),t}console.error("Error : Message too long;")}}],[{key:"deserialize",value:function(e){return this.tag=e.readBytes(1)[0],t.deserializeFromTag(e,this.tag)}},{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return n.get(t).deserializeFromTag(e,t);console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),t=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t.arg=void 0===e?[]:e,t}return _inherits(r,c),_createClass(r,[{key:"serialize",value:function(e){_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"serialize",this).call(this,e),e.writeVarbytes(this.arg)}},{key:"toString",value:function(){return this._TAG_NAME()+" "+i.bytesToHex(this.arg)}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t)){var r=e.readVarbytes((new c)._MAX_RESULT_LENGTH(),1);return new(n.get(t))(r)}}}]),r}(),e=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 240}},{key:"_TAG_NAME",value:function(){return"append"}},{key:"call",value:function(e){return e.concat(this.arg)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),r=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 241}},{key:"_TAG_NAME",value:function(){return"prepend"}},{key:"call",value:function(e){return this.arg.concat(e)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),u=function(e){function t(){return _classCallCheck2(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,c),_createClass(t,[{key:"toString",value:function(){return this._TAG_NAME()}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return new(n.get(t));console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),f=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 242}},{key:"_TAG_NAME",value:function(){return"reverse"}},{key:"call",value:function(e){return 0===e.length&&console.error("Can't reverse an empty message"),e.reverse()}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),p=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 243}},{key:"_TAG_NAME",value:function(){return"hexlify"}},{key:"_MAX_MSG_LENGTH",value:function(){return u._MAX_RESULT_LENGTH()}},{key:"call",value:function(e){0===e.length&&console.error("Can't hexlify an empty message")}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),h=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_HASHLIB_NAME",value:function(){return 0}},{key:"call",value:function(e,t){for(var r=("keccak256"===e._HASHLIB_NAME()?s(e._HASHLIB_NAME()).update(a.from(t)):o.createHash(e._HASHLIB_NAME()).update(a.from(t))).digest(),i=[r.length],n=0;n(new m.Op)._MAX_MSG_LENGTH())throw new TypeError("Message exceeds Op length limit; "+e.length+" > "+(new m.Op)._MAX_MSG_LENGTH());this.msg=e,this.attestations=[],this.ops=new Map}return _createClass(h,[{key:"getDigest",value:function(){return this.msg}},{key:"serialize",value:function(r){var i=this;if(!this.attestations&&!this.ops)throw new a.ValueError("An empty timestamp can't be serialized");var e=this.attestations;if(e.sort(function(e,t){return e.compareTo(t)}),1 "+t.toString()+u(o,n,i)+"\n",f+=e.strTree(a+1,o)});else if(0>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},r.charsToHex=function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&i).toString(16))}return t.join("")},r.charToByte=function(e){return e.charCodeAt(0)},r.charsToBytes=function(e){for(var t=[],r=0;r Date: Thu, 17 Jan 2019 13:49:11 +0100 Subject: [PATCH 06/16] added calendars --- index.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 2eedf60..913cdbe 100644 --- a/index.js +++ b/index.js @@ -2,18 +2,22 @@ const OpenTimestamps = window.OpenTimestamps // an empty list would be equivalent to the default calendars const calendarsList = [ - 'http://calendar.irsa.it:80' - //'https://alice.btc.calendar.opentimestamps.org', - //'https://bob.btc.calendar.opentimestamps.org', - //'https://finney.calendar.eternitywall.com' + //'http://test-calendar.aniasafe.it:80', // testnet + //'http://calendar.aniasafe.it:80', // mainet + 'http://calendar.irsa.it:80', // testnet + 'https://alice.btc.calendar.opentimestamps.org', + 'https://bob.btc.calendar.opentimestamps.org', + 'https://finney.calendar.eternitywall.com' ] // an empty list is not acceptable here const wcalendars = [ - 'http://calendar.irsa.it:80' - //'https://alice.btc.calendar.opentimestamps.org' - //'https://bob.btc.calendar.opentimestamps.org', - //'https://finney.calendar.eternitywall.com' + //'http://test-calendar.aniasafe.it:80', // testnet + //'http://calendar.aniasafe.it:80', // mainet + 'http://calendar.irsa.it:80', // testnet + 'https://alice.btc.calendar.opentimestamps.org', + 'https://bob.btc.calendar.opentimestamps.org', + 'https://finney.calendar.eternitywall.com' ] const whitelistedCalendars = new OpenTimestamps.Calendar.UrlWhitelist(wcalendars) From ba1bb4c2310c93303860043d6e86816dffbe883e Mon Sep 17 00:00:00 2001 From: "Ferdinando M. Ametrano" Date: Thu, 17 Jan 2019 17:18:53 +0100 Subject: [PATCH 07/16] updated calendars --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 913cdbe..1b8f40e 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ const OpenTimestamps = window.OpenTimestamps const calendarsList = [ //'http://test-calendar.aniasafe.it:80', // testnet //'http://calendar.aniasafe.it:80', // mainet - 'http://calendar.irsa.it:80', // testnet + //'http://calendar.irsa.it:80', // testnet 'https://alice.btc.calendar.opentimestamps.org', 'https://bob.btc.calendar.opentimestamps.org', 'https://finney.calendar.eternitywall.com' @@ -14,7 +14,7 @@ const calendarsList = [ const wcalendars = [ //'http://test-calendar.aniasafe.it:80', // testnet //'http://calendar.aniasafe.it:80', // mainet - 'http://calendar.irsa.it:80', // testnet + //'http://calendar.irsa.it:80', // testnet 'https://alice.btc.calendar.opentimestamps.org', 'https://bob.btc.calendar.opentimestamps.org', 'https://finney.calendar.eternitywall.com' From 1b9d5505f0e5801b256020f6e8a08d82d6441c38 Mon Sep 17 00:00:00 2001 From: "Ferdinando M. Ametrano" Date: Thu, 17 Jan 2019 18:22:54 +0100 Subject: [PATCH 08/16] gemneralized for other calendars --- index.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 913cdbe..8d6a8ad 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,5 @@ +/* OpenTimestamps functions */ + const OpenTimestamps = window.OpenTimestamps // an empty list would be equivalent to the default calendars @@ -100,11 +102,13 @@ $("#btn-stamp").click(function(event) { const hashValue = $("#stamp-hashValue").val() const hashData = hexToBytes(hashValue) - const detachedOriginal = OpenTimestamps.DetachedTimestampFile.fromHash(op, hashData) const filename = $("#stamp-filename").val() - OpenTimestamps.stamp(detachedOriginal).then( () => { + const detachedOriginal = OpenTimestamps.DetachedTimestampFile.fromHash(op, hashData) + const options = { calendars: calendarsList } + + OpenTimestamps.stamp(detachedOriginal, options).then( () => { const byteots = detachedOriginal.serializeToBytes() const hexots = bytesToHex(byteots) $("#stamp-output").val(hexots) @@ -202,7 +206,8 @@ $("#btn-upgrade").click(function(event) { const filename = $("#upgrade-filename").val() $("#verify-filename").val(filename) - OpenTimestamps.upgrade(detachedStamped).then( (changed)=>{ + const upgradeOptions = { whitelist: whitelistedCalendars } + OpenTimestamps.upgrade(detachedStamped, upgradeOptions).then( (changed)=>{ const timestampBytes = detachedStamped.serializeToBytes() const hexots = bytesToHex(timestampBytes) if (changed === true) { @@ -242,7 +247,8 @@ $("#btn-verify").click(function(event) { const filename = $("#verify-filename").val() var outputText = "" - OpenTimestamps.upgrade(detachedStamped).then( (changed)=>{ + const upgradeOptions = { whitelist: whitelistedCalendars } + OpenTimestamps.upgrade(detachedStamped, upgradeOptions).then( (changed)=>{ const timestampBytes = detachedStamped.serializeToBytes() hexots = bytesToHex(timestampBytes) if (changed === true) { From 85f479625c78527cbbeb342e255db3f98eb384c0 Mon Sep 17 00:00:00 2001 From: federicoon Date: Thu, 17 Jan 2019 18:41:43 +0100 Subject: [PATCH 09/16] renamed testnet Ania calendar server --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 5c324c0..d07a121 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ const OpenTimestamps = window.OpenTimestamps // an empty list would be equivalent to the default calendars const calendarsList = [ - 'http://calendar.irsa.it:80' + 'http://test-calendar.aniasafe.it:80' //'https://alice.btc.calendar.opentimestamps.org', //'https://bob.btc.calendar.opentimestamps.org', //'https://finney.calendar.eternitywall.com' @@ -10,7 +10,7 @@ const calendarsList = [ // an empty list is not acceptable here const wcalendars = [ - 'http://calendar.irsa.it:80' + 'http://test-calendar.aniasafe.it:80' //'https://alice.btc.calendar.opentimestamps.org' //'https://bob.btc.calendar.opentimestamps.org', //'https://finney.calendar.eternitywall.com' From 7f5cfa5436a0caedc1d9472a599067a9bfd343ae Mon Sep 17 00:00:00 2001 From: federicoon Date: Fri, 18 Jan 2019 12:52:12 +0100 Subject: [PATCH 10/16] updated javascript-opentimestamps dependancy --- .gitignore | 3 ++- opentimestamps.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c88e5e8..0858631 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ bower_components -.idea \ No newline at end of file +.idea +/.project diff --git a/opentimestamps.js b/opentimestamps.js index a4b4541..856d127 100644 --- a/opentimestamps.js +++ b/opentimestamps.js @@ -1,2 +1,2 @@ // javascript-opentimestamps v.0.4.4-dev -var _get=function e(t,r,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,r);if(void 0===n){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,i)}if("value"in n)return n.value;var o=n.get;return void 0!==o?o.call(i):void 0},_createClass=function(){function i(e,t){for(var r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,f=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,p=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,l=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",i.copy(m[e])}function g(e){var t=e.match(o);if(!t)return!1;var r,i=+t[1],n=+t[2],a=+t[3];return 1<=n&&n<=12&&1<=a&&a<=(2!=n||((r=i)%4!=0||r%100==0&&r%400!=0)?s[n]:29)}function v(e,t){var r=e.match(c);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return(i<=23&&n<=59&&a<=59||23==i&&59==n&&60==a)&&(!t||o)}(t.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d},m.full={date:g,time:v,"date-time":function(e){var t=e.split(b);return 2==t.length&&g(t[0])&&v(t[1],!0)},uri:function(e){return y.test(e)&&a.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&n.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d};var b=/t|\s/i;var y=/\/|:/;var _=/[^\\]\\Z/;function w(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":12}],7:[function(e,t,r){"use strict";var I=e("./resolve"),P=e("./util"),O=e("./error_classes"),T=e("fast-json-stable-stringify"),B=e("../dotjs/validate"),C=P.ucs2length,F=e("fast-deep-equal"),R=O.Validation;function z(e,t,r){var i=n.call(this,e,t,r);return 0<=i?{index:i,compiling:!0}:{index:i=this._compilations.length,compiling:!(this._compilations[i]={schema:e,root:t,baseId:r})}}function M(e,t,r){var i=n.call(this,e,t,r);0<=i&&this._compilations.splice(i,1)}function n(e,t,r){for(var i=0;i",b=l?">":"<",y=void 0;if(g){var _=e.util.getData(m.$data,o,e.dataPathArr),w="exclusive"+a,k="exclType"+a,x="exclIsNumber"+a,S="' + "+(A="op"+a)+" + '";n+=" var schemaExcl"+a+" = "+_+"; ",n+=" var "+w+"; var "+k+" = typeof "+(_="schemaExcl"+a)+"; if ("+k+" != 'boolean' && "+k+" != 'undefined' && "+k+" != 'number') { ";var j;y=d;(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var E=n;n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+k+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+_+" "+v+"= "+i+") ? "+p+" "+b+"= "+_+" : "+p+" "+b+" "+i+" ) : ( ("+w+" = "+_+" === true) ? "+p+" "+b+"= "+i+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { var op"+a+" = "+w+" ? '"+v+"' : '"+v+"='; ",void 0===s&&(y=d,u=e.errSchemaPath+"/"+d,i=_,h=g)}else{S=v;if((x="number"==typeof m)&&h){var A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ( "+i+" === undefined || "+m+" "+v+"= "+i+" ? "+p+" "+b+"= "+m+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { "}else{x&&void 0===s?(w=!0,y=d,u=e.errSchemaPath+"/"+d,i=m,b+="="):(x&&(i=Math[l?"min":"max"](m,s)),m===(!x||i)?(w=!0,y=d,u=e.errSchemaPath+"/"+d,b+="="):(w=!1,S+="="));A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+" "+b+" "+i+" || "+p+" !== "+p+") { "}}y=y||t,(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+A+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+S+" ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";E=n;return n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s;var l="maxLength"==t?">":"<";n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+p+".length ":n+=" ucs2length("+p+") ",n+=" "+l+" "+i+") { ";var d=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+p+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.schema[t],a=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var f="valid"+c.level,p=c.baseId,h=!0,l=n;if(l)for(var d,m=-1,g=l.length-1;m "+E+") { ";var I=f+"["+E+"]";l.schema=j,l.schemaPath=s+"["+E+"]",l.errSchemaPath=c+"/"+E,l.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),l.dataPathArr[v]=E;var P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",i+=" } ",u&&(i+=" if ("+m+") { ",d+="}")}if("object"==(void 0===_?"undefined":_typeof(_))&&e.util.schemaHasRules(_,e.RULES.all)){l.schema=_,l.schemaPath=e.schemaPath+".additionalItems",l.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+f+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" } } ",u&&(i+=" if ("+m+") { ",d+="}")}}else if(e.util.schemaHasRules(o,e.RULES.all)){l.schema=o,l.schemaPath=s,l.errSchemaPath=c,i+=" for (var "+g+" = 0; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+d+" if ("+h+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],30:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="var division"+a+";if (",h&&(n+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),n+=" (division"+a+" = "+p+" / "+i+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var l=l||[];l.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var d=n;return n=l.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+d+"]); ":n+=" validate.errors = ["+d+"]; return false; ":n+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="errs__"+n,h=e.util.copy(e);h.level++;var l="valid"+h.level;if(e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+p+" = errors; ";var d,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(d=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,d&&(h.opts.allErrors=d),e.compositeRule=h.compositeRule=m,i+=" if ("+l+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var v=i;i=g.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ");return i}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="valid"+n,h="errs__"+n,l=e.util.copy(e),d="";l.level++;var m="valid"+l.level,g=l.baseId,v="prevValid"+n,b="passingSchemas"+n;i+="var "+h+" = errors , "+v+" = false , "+p+" = false , "+b+" = null; ";var y=e.compositeRule;e.compositeRule=l.compositeRule=!0;var _=o;if(_)for(var w,k=-1,x=_.length-1;k=e.opts.loopRequired,k=e.opts.ownProperties;if(u)if(i+=" var missing"+n+"; ",w){h||(i+=" var "+l+" = validate.schema"+s+"; ");var x="' + "+(P="schema"+n+"["+(E="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(_,P,e.opts.jsonPointers)),i+=" var "+p+" = true; ",h&&(i+=" if (schema"+n+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+n+")) "+p+" = false; else {"),i+=" for (var "+E+" = 0; "+E+" < "+l+".length; "+E+"++) { "+p+" = "+f+"["+l+"["+E+"]] !== undefined ",k&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", "+l+"["+E+"]) "),i+="; if (!"+p+") break; } ",h&&(i+=" } "),i+=" if (!"+p+") { ",(I=I||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+x+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var S=i;i=I.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var j=d;if(j)for(var E=-1,A=j.length-1;E 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(0<=d.indexOf("object")||0<=d.indexOf("array")))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var g="checkDataType"+(m?"s":"");n+=" if ("+e.util[g](d,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",l&&(n+=" } "),n+=" if (!"+h+") { ";var v=v||[];v.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var b=n;n=v.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { ")}else f&&(n+=" if (true) { ");return n}},{}],39:[function(e,t,r){"use strict";t.exports=function(i,e,t){var r="",n=!0===i.schema.$async,a=i.util.schemaHasRulesExcept(i.schema,i.RULES.all,"$ref"),o=i.self._getId(i.schema);if(i.isTop&&(r+=" var validate = ",n&&(i.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(i.opts.sourceCode||i.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof i.schema||!a&&!i.schema.$ref){e="false schema";var s=i.level,c=i.dataLevel,u=i.schema[e],f=i.schemaPath+i.util.getProperty(e),p=i.errSchemaPath+"/"+e,h=!i.opts.allErrors,l="data"+(c||""),d="valid"+s;if(!1===i.schema){i.isTop?h=!0:r+=" var "+d+" = false; ",(W=W||[]).push(r),r="",!1!==i.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(p)+" , params: {} ",!1!==i.opts.messages&&(r+=" , message: 'boolean schema is false' "),i.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+i.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var m=r;r=W.pop(),!i.compositeRule&&h?i.async?r+=" throw new ValidationError(["+m+"]); ":r+=" validate.errors = ["+m+"]; return false; ":r+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else i.isTop?r+=n?" return data; ":" validate.errors = null; return true; ":r+=" var "+d+" = true; ";return i.isTop&&(r+=" }; return validate; "),r}if(i.isTop){var g=i.isTop;s=i.level=0,c=i.dataLevel=0,l="data";i.rootId=i.resolve.fullPath(i.self._getId(i.root.schema)),i.baseId=i.baseId||i.rootId,delete i.isTop,i.dataPathArr=[void 0],r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{s=i.level,l="data"+((c=i.dataLevel)||"");if(o&&(i.baseId=i.resolve.url(i.baseId,o)),n&&!i.async)throw new Error("async schema in sync schema");r+=" var errs_"+s+" = errors;"}d="valid"+s,h=!i.opts.allErrors;var v="",b="",y=i.schema.type,_=Array.isArray(y);if(_&&1==y.length&&(y=y[0],_=!1),i.schema.$ref&&a){if("fail"==i.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+i.errSchemaPath+'" (see option extendRefs)');!0!==i.opts.extendRefs&&(a=!1,i.logger.warn('$ref: keywords ignored in schema at path "'+i.errSchemaPath+'"'))}if(i.schema.$comment&&i.opts.$comment&&(r+=" "+i.RULES.all.$comment.code(i,"$comment")),y){if(i.opts.coerceTypes)var w=i.util.coerceToTypes(i.opts.coerceTypes,y);var k=i.RULES.types[y];if(w||_||!0===k||k&&!Z(k)){f=i.schemaPath+".type",p=i.errSchemaPath+"/type",f=i.schemaPath+".type",p=i.errSchemaPath+"/type";var x=_?"checkDataTypes":"checkDataType";if(r+=" if ("+i.util[x](y,l,!0)+") { ",w){var S="dataType"+s,j="coerced"+s;r+=" var "+S+" = typeof "+l+"; ","array"==i.opts.coerceTypes&&(r+=" if ("+S+" == 'object' && Array.isArray("+l+")) "+S+" = 'array'; "),r+=" var "+j+" = undefined; ";var E="",A=w;if(A)for(var I,P=-1,O=A.length-1;P>6],n=0==(32&r);if(31==(31&r)){var a=r;for(r=0;128==(128&a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function p(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)o++;(n=new u(2+o))[0]=a,n[1]=128|o;s=1+o;for(var c=i.length;0>=8)n[s]=255&c;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new u(2*e.length),i=0;i>=7)n++}var o=new u(n),s=o.length-1;for(i=e.length-1;0<=i;i--){a=e[i];for(o[s--]=127&a;0<(a>>=7);)o[s--]=128|127&a}return this._createEncoderBuffer(o)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[c(i.getFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(i.getFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.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&&!u.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new u(r)}if(u.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new u(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var a=e;256<=a;a>>=8)i++;for(a=(n=new Array(i)).length-1;0<=a;a--)n[a]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new u(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var a=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),a.length!==n.defaultBuffer.length)return!1;for(i=0;i=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0===(t&=127))throw c("Indefinite length not supported");if(4this._size-i)return null;if(this._offset=i,0===this.length)return t?a.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?n:n.toString("utf8")},i.prototype.readOID=function(e){e||(e=s.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],i=0,n=0;n>0),r.join(".")},i.prototype._readTag=function(e){o.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw c("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(4this._size-r)return null;this._offset=r;for(var i=this._buf[this._offset],n=0,a=0;a>0},t.exports=i},{"./errors":60,"./types":63,assert:67,"safer-buffer":448}],63:[function(e,t,r){t.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},{}],64:[function(e,t,r){var n=e("assert"),a=e("safer-buffer").Buffer,o=e("./types"),i=e("./errors").newInvalidAsn1Error,s={size:1024,growthFactor:8};function c(e){var r,i;r=s,i=e||{},n.ok(r),n.equal(void 0===r?"undefined":_typeof(r),"object"),n.ok(i),n.equal(void 0===i?"undefined":_typeof(i),"object"),Object.getOwnPropertyNames(r).forEach(function(e){if(!i[e]){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,t)}}),e=i,this._buf=a.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw i(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},c.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=o.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&1 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;0>>24,e<<=8},c.prototype.writeNull=function(){this.writeByte(o.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=o.Enumeration),this.writeInt(e,t)},c.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=o.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},c.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+(void 0===e?"undefined":_typeof(e))+")");"number"!=typeof t&&(t=o.OctetString);var r=a.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},c.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!a.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},c.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(e){t.writeString(e)})},c.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=o.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),i=[];i.push(40*parseInt(r[0],10)+parseInt(r[1],10)),r.slice(2).forEach(function(e){var t,r;t=i,(r=parseInt(e,10))<128?t.push(r):(r<16384?t.push(r>>>7|128):(r<2097152?t.push(r>>>14|128):(r<268435456?t.push(r>>>21|128):(t.push(255&(r>>>28|128)),t.push(255&(r>>>21|128))),t.push(255&(r>>>14|128))),t.push(255&(r>>>7|128))),t.push(127&r))});var n=this;this._ensure(2+i.length),this.writeByte(t),this.writeLength(i.length),i.forEach(function(e){n.writeByte(e)})},c.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw i("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},c.prototype.startSequence=function(e){"number"!=typeof e&&(e=o.Sequence|o.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw i("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},c.prototype._shift=function(e,t,r){n.ok(void 0!==e),n.ok(void 0!==t),n.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},c.prototype._ensure=function(e){if(n.ok(e),this._size-this._offset>16&255,a[o++]=t>>8&255,a[o++]=255&t;var u,f;2===n&&(t=p[e.charCodeAt(c)]<<2|p[e.charCodeAt(c+1)]>>4,a[o++]=255&t);1===n&&(t=p[e.charCodeAt(c)]<<10|p[e.charCodeAt(c+1)]<<4|p[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],a=0,o=r-i;a>2]+s[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],p=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,a=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return a.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},{}],76:[function(e,t,r){"use strict";var y=e("tweetnacl").lowlevel.crypto_hash,s=0,c=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};function n(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}function u(e,t){var r,i=0;for(r=0;r<4;r++,s++)t<=s&&(s=0),i=i<<8|e[s];return i}c.prototype.encipher=function(e,t){void 0===t&&(t=new Uint8Array(e.buffer),0!==e.byteOffset&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=n(this.S,t,0)^this.P[r],e[0]^=n(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i},c.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);0!==e.byteOffset&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;0>>24,r[4*i+2]=a[i]>>>16,r[4*i+1]=a[i]>>>8,r[4*i+0]=a[i]}t.exports={BLOCKS:f,HASHSIZE:32,hash:_,pbkdf:function(e,t,r,i,n,a,o){var s,c,u,f,p,h,l=new Uint8Array(64),d=new Uint8Array(64),m=new Uint8Array(32),g=new Uint8Array(32),v=new Uint8Array(i+4),b=a;if(o<1)return-1;if(0===t||0===i||0===a||a>m.byteLength*m.byteLength||1<<20>>24,v[i+1]=h>>>16,v[i+2]=h>>>8,v[i+3]=h,y(d,v,i+4),_(l,d,g),s=m.byteLength;s--;)m[s]=g[s];for(s=1;sa[o]^r?1:-1;return c==u?0:u=t&&e<=r}function J(e){return"[object Array]"==Object.prototype.toString.call(e)}function Q(e,t,r){for(var i,n,a=[0],o=0,s=e.length;or-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}function ee(e,t){return(1(r=e.length)){for(i="0",t-=r;--t;i+="0");e+=i}else tt;)u[n]=0,n||(++a,u.unshift(1));for(o=u.length;!u[--o];);for(p=0,e="";p<=o;e+=U.charAt(u[p++]));e=te(e,a)}return e}function P(e,t,r,i){var n,a,o,s,c;if(r=null!=r&&k(r,0,8,i,q)?0|r:b,!e.c)return e.toString();if(n=e.c[0],o=e.e,null==t)c=Z(e.c),c=19==i||24==i&&o<=h?ee(c,o):te(c,o);else if(a=(e=C(new I(e),t,r)).e,s=(c=Z(e.c)).length,19==i||24==i&&(t<=a||a<=h)){for(;sy?e.c=e.e=null:e.c=r=p.length){if(!i)break e;for(;p.length<=u;p.push(0));c=f=0,o=(a%=K)-K+(n=1)}else{for(c=s=p[u],n=1;10<=s;s/=10,n++);f=(o=(a%=K)-K+n)<0?0:c/h[n-o-1]%10|0}if(i=i||t<0||null!=p[u+1]||(o<0?c:c%h[n-o-1]),i=r<4?(f||i)&&(0==r||r==(e.s<0?3:2)):5y?e.c=e.e=null:e.er)return null!=(e=n[r++])};return o(t="DECIMAL_PLACES")&&k(e,0,$,2,t)&&(d=0|e),i[t]=d,o(t="ROUNDING_MODE")&&k(e,0,8,2,t)&&(b=0|e),i[t]=b,o(t="EXPONENTIAL_AT")&&(J(e)?k(e[0],-$,0,2,t)&&k(e[1],0,$,2,t)&&(h=0|e[0],l=0|e[1]):k(e,-$,$,2,t)&&(h=-(l=0|(e<0?-e:e)))),i[t]=[h,l],o(t="RANGE")&&(J(e)?k(e[0],-$,-1,2,t)&&k(e[1],1,$,2,t)&&(m=0|e[0],y=0|e[1]):k(e,-$,$,2,t)&&(0|e?m=-(y=0|(e<0?-e:e)):w&&B(2,t+" cannot be zero",e))),i[t]=[m,y],o(t="ERRORS")&&(e===!!e||1===e||0===e?(_=0,k=(w=!!e)?O:X):w&&B(2,t+D,e)),i[t]=w,o(t="CRYPTO")&&(e===!!e||1===e||0===e?(x=!(!e||!F||"object"!=(void 0===F?"undefined":_typeof(F))),e&&!x&&w&&B(2,"crypto unavailable",F)):w&&B(2,t+D,e)),i[t]=x,o(t="MODULO_MODE")&&k(e,0,9,2,t)&&(S=0|e),i[t]=S,o(t="POW_PRECISION")&&k(e,0,$,2,t)&&(j=0|e),i[t]=j,o(t="FORMAT")&&("object"==(void 0===e?"undefined":_typeof(e))?E=e:w&&B(2,t+" not an object",e)),i[t]=E,i},I.max=function(){return n(arguments,i.lt)},I.min=function(){return n(arguments,i.gt)},I.random=(r=9007199254740992,u=Math.random()*r&2097151?function(){return N(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,n,a,o=0,s=[],c=new I(v);if(e=null!=e&&k(e,0,$,14)?0|e:d,n=M(e/K),x)if(F&&F.getRandomValues){for(t=F.getRandomValues(new Uint32Array(n*=2));o>>11))?(r=F.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(s.push(a%1e14),o+=2);o=n/2}else if(F&&F.randomBytes){for(t=F.randomBytes(n*=7);ot[n]?1:-1;break}return a}function A(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r](x[s]||0)&&o--,k<0)l.push(1),c=!0;else{for(b=x.length,_=S.length,k+=2,1<(u=N(n/(S[s=0]+1)))&&(S=j(S,u,n),x=j(x,u,n),_=S.length,b=x.length),v=_,m=(d=x.slice(0,_)).length;m<_;d[m++]=0);(w=S.slice()).unshift(0),y=S[0],S[1]>=n/2&&y++;do{if(u=0,(a=E(S,d,_,m))<0){if(g=d[0],_!=m&&(g=g*n+(d[1]||0)),1<(u=N(g/y)))for(n<=u&&(u=n-1),p=(f=j(S,u,n)).length,m=d.length;1==E(f,d,p,m);)u--,A(f,_this.c.length-2},i.isNaN=function(){return!this.s},i.isNegative=i.isNeg=function(){return this.s<0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.lessThan=i.lt=function(e,t){return _=8,Y(this,new I(e,t))<0},i.lessThanOrEqualTo=i.lte=function(e,t){return _=9,-1===(t=Y(this,new I(e,t)))||0===t},i.minus=i.sub=function(e,t){var r,i,n,a,o=this,s=o.s;if(_=10,t=(e=new I(e,t)).s,!s||!t)return new I(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/K,u=e.e/K,f=o.c,p=e.c;if(!c||!u){if(!f||!p)return f?(e.s=-t,e):new I(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new I(f[0]?o:3==b?-0:0)}if(c=W(c),u=W(u),f=f.slice(),s=c-u){for((n=(a=s<0)?(s=-s,f):(u=c,p)).reverse(),t=s;t--;n.push(0));n.reverse()}else for(i=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;tt&&(t=this.e+1),t},i.round=function(e,t){var r=new I(this);return(null==e||k(e,0,$,15))&&C(r,~~e+this.e+1,null!=t&&k(t,0,8,15,q)?0|t:b),r},i.shift=function(e){var t=this;return k(e,-a,a,16,"argument")?t.times("1e"+re(e)):new I(t.c&&t.c[0]&&(e<-a||at&&(r.c.length=t)}if(!(i=N(i/2)))break;n=n.times(n),t&&n.c&&n.c.length>t&&(n.c.length=t)}return e<0&&(r=v.div(r)),t?C(r,j,b):r},i.toPrecision=function(e,t){return P(this,null!=e&&k(e,1,$,24,"precision")?0|e:null,t,24)},i.toString=function(e){var t,r=this.s,i=this.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=Z(this.c),t=null!=e&&k(e,2,64,25,"base")?A(te(t,i),0|e,10,r):i<=h||l<=i?ee(t,i):te(t,i),r<0&&this.c[0]&&(t="-"+t)),t},i.truncated=i.trunc=function(){return C(new I(this),this.e+1,1)},i.valueOf=i.toJSON=function(){return this.toString()},null!=t&&I.config(t),I}(),"function"==typeof define&&define.amd)define(function(){return t});else if(void 0!==i&&i.exports){if(i.exports=t,!F)try{F=r("crypto")}catch(e){}}else e.BigNumber=t}(this)},{crypto:204}],78:[function(i,n,e){(function(e,t){"use strict";var r=n.exports;r.version="v"+i("./package.json").version,r.versionGuard=function(e){if(void 0!==e){throw new Error("More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.")}},r.versionGuard(e._bitcore),e._bitcore=r.version,r.crypto={},r.crypto.BN=i("./lib/crypto/bn"),r.crypto.ECDSA=i("./lib/crypto/ecdsa"),r.crypto.Hash=i("./lib/crypto/hash"),r.crypto.Random=i("./lib/crypto/random"),r.crypto.Point=i("./lib/crypto/point"),r.crypto.Signature=i("./lib/crypto/signature"),r.encoding={},r.encoding.Base58=i("./lib/encoding/base58"),r.encoding.Base58Check=i("./lib/encoding/base58check"),r.encoding.BufferReader=i("./lib/encoding/bufferreader"),r.encoding.BufferWriter=i("./lib/encoding/bufferwriter"),r.encoding.Varint=i("./lib/encoding/varint"),r.util={},r.util.buffer=i("./lib/util/buffer"),r.util.js=i("./lib/util/js"),r.util.preconditions=i("./lib/util/preconditions"),r.errors=i("./lib/errors"),r.Address=i("./lib/address"),r.Block=i("./lib/block"),r.MerkleBlock=i("./lib/block/merkleblock"),r.BlockHeader=i("./lib/block/blockheader"),r.HDPrivateKey=i("./lib/hdprivatekey.js"),r.HDPublicKey=i("./lib/hdpublickey.js"),r.Networks=i("./lib/networks"),r.Opcode=i("./lib/opcode"),r.PrivateKey=i("./lib/privatekey"),r.PublicKey=i("./lib/publickey"),r.Script=i("./lib/script"),r.Transaction=i("./lib/transaction"),r.URI=i("./lib/uri"),r.Unit=i("./lib/unit"),r.deps={},r.deps.bnjs=i("bn.js"),r.deps.bs58=i("bs58"),r.deps.Buffer=t,r.deps.elliptic=i("elliptic"),r.deps._=i("lodash"),r._HDKeyCache=i("./lib/hdkeycache"),r.Transaction.sighash=i("./lib/transaction/sighash")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i("buffer").Buffer)},{"./lib/address":79,"./lib/block":82,"./lib/block/blockheader":81,"./lib/block/merkleblock":83,"./lib/crypto/bn":84,"./lib/crypto/ecdsa":85,"./lib/crypto/hash":86,"./lib/crypto/point":87,"./lib/crypto/random":88,"./lib/crypto/signature":89,"./lib/encoding/base58":90,"./lib/encoding/base58check":91,"./lib/encoding/bufferreader":92,"./lib/encoding/bufferwriter":93,"./lib/encoding/varint":94,"./lib/errors":95,"./lib/hdkeycache":97,"./lib/hdprivatekey.js":98,"./lib/hdpublickey.js":99,"./lib/networks":100,"./lib/opcode":101,"./lib/privatekey":102,"./lib/publickey":103,"./lib/script":104,"./lib/transaction":107,"./lib/transaction/sighash":115,"./lib/unit":119,"./lib/uri":120,"./lib/util/buffer":121,"./lib/util/js":122,"./lib/util/preconditions":123,"./package.json":150,"bn.js":124,bs58:125,buffer:191,elliptic:127,lodash:149}],79:[function(e,t,r){(function(a){"use strict";var n=e("lodash"),o=e("./util/preconditions"),i=e("./errors"),s=e("./encoding/base58check"),c=e("./networks"),r=e("./crypto/hash"),u=e("./util/js"),f=e("./publickey");function p(e,t,r){if(!(this instanceof p))return new p(e,t,r);if(n.isArray(e)&&n.isNumber(t))return p.createMultisig(e,t,r);if(e instanceof p)return e;if(o.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!c.get(t))throw new TypeError('Second argument must be "livenet" or "testnet".');if(r&&r!==p.PayToPublicKeyHash&&r!==p.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||c.get(t)||c.defaultNetwork,i.type=i.type||r||p.PayToPublicKeyHash,u.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}p.prototype._classifyArguments=function(e,t,r){if((e instanceof a||e instanceof Uint8Array)&&20===e.length)return p._transformHash(e);if((e instanceof a||e instanceof Uint8Array)&&21===e.length)return p._transformBuffer(e,t,r);if(e instanceof f)return p._transformPublicKey(e);if(e instanceof h)return p._transformScript(e,t);if("string"==typeof e)return p._transformString(e,t,r);if(n.isObject(e))return p._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")},p.PayToPublicKeyHash="pubkeyhash",p.PayToScriptHash="scripthash",p._transformHash=function(e){var t={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==e.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t},p._transformObject=function(e){return o.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),o.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?new a(e.hash,"hex"):e.hashBuffer,network:c.get(e.network)||c.defaultNetwork,type:e.type}},p._classifyFromVersion=function(e){var t={},r=c.get(e[0],"pubkeyhash"),i=c.get(e[0],"scripthash");return r?(t.network=r,t.type=p.PayToPublicKeyHash):i&&(t.network=i,t.type=p.PayToScriptHash),t},p._transformBuffer=function(e,t,r){var i={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==e.length)throw new TypeError("Address buffers must be exactly 21 bytes.");t=c.get(t);var n=p._classifyFromVersion(e);if(!n.network||t&&t!==n.network)throw new TypeError("Address has mismatched network type.");if(!n.type||r&&r!==n.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=n.network,i.type=n.type,i},p._transformPublicKey=function(e){var t={};if(!(e instanceof f))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=r.sha256ripemd160(e.toBuffer()),t.type=p.PayToPublicKeyHash,t},p._transformScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new i.Script.CantDeriveAddress(e);return r},p.createMultisig=function(e,t,r){return r=r||e[0].network||c.defaultNetwork,p.payingTo(h.buildMultisigOut(e,t),r)},p._transformString=function(e,t,r){if("string"!=typeof e)throw new TypeError("data parameter supplied is not a string.");e=e.trim();var i=s.decode(e);return p._transformBuffer(i,t,r)},p.fromPublicKey=function(e,t){var r=p._transformPublicKey(e);return t=t||c.defaultNetwork,new p(r.hashBuffer,t,r.type)},p.fromPublicKeyHash=function(e,t){return new p(p._transformHash(e).hashBuffer,t,p.PayToPublicKeyHash)},p.fromScriptHash=function(e,t){return o.checkArgument(e,"hash parameter is required"),new p(p._transformHash(e).hashBuffer,t,p.PayToScriptHash)},p.payingTo=function(e,t){return o.checkArgument(e,"script is required"),o.checkArgument(e instanceof h,"script must be instance of Script"),p.fromScriptHash(r.sha256ripemd160(e.toBuffer()),t)},p.fromScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=p._transformScript(e,t);return new p(r.hashBuffer,t,r.type)},p.fromBuffer=function(e,t,r){var i=p._transformBuffer(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromString=function(e,t,r){var i=p._transformString(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromObject=function(e){return o.checkState(u.isHexa(e.hash),'Unexpected hash property, "'+e.hash+'", expected to be hex.'),new p(new a(e.hash,"hex"),e.network,e.type)},p.getValidationError=function(e,t,r){var i;try{new p(e,t,r)}catch(e){i=e}return i},p.isValid=function(e,t,r){return!p.getValidationError(e,t,r)},p.prototype.isPayToPublicKeyHash=function(){return this.type===p.PayToPublicKeyHash},p.prototype.isPayToScriptHash=function(){return this.type===p.PayToScriptHash},p.prototype.toBuffer=function(){var e=new a([this.network[this.type]]);return a.concat([e,this.hashBuffer])},p.prototype.toObject=p.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},p.prototype.toString=function(){return s.encode(this.toBuffer())},p.prototype.inspect=function(){return""},t.exports=p;var h=e("./script")}).call(this,e("buffer").Buffer)},{"./crypto/hash":86,"./encoding/base58check":91,"./errors":95,"./networks":100,"./publickey":103,"./script":104,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],80:[function(t,l,e){(function(o){"use strict";var r=t("lodash"),n=t("./blockheader"),i=t("../crypto/bn"),a=t("../util/buffer"),s=t("../encoding/bufferreader"),c=t("../encoding/bufferwriter"),u=t("../crypto/hash"),f=t("../transaction"),p=t("../util/preconditions");function h(e){return this instanceof h?(r.extend(this,h._from(e)),this):new h(e)}h.MAX_BLOCK_SIZE=1e6,h._from=function(e){var t={};if(a.isBuffer(e))t=h._fromBufferReader(s(e));else{if(!r.isObject(e))throw new TypeError("Unrecognized argument for Block");t=h._fromObject(e)}return t},h._fromObject=function(e){var t=[];return e.transactions.forEach(function(e){e instanceof f?t.push(e):t.push(f().fromObject(e))}),{header:n.fromObject(e.header),transactions:t}},h.fromObject=function(e){return new h(h._fromObject(e))},h._fromBufferReader=function(e){var t={};p.checkState(!e.finished(),"No block data received"),t.header=n.fromBufferReader(e);var r=e.readVarintNum();t.transactions=[];for(var i=0;i"},h.Values={START_OF_BLOCK:8,NULL_HASH:new o("0000000000000000000000000000000000000000000000000000000000000000","hex")},l.exports=h}).call(this,t("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../transaction":107,"../util/buffer":121,"../util/preconditions":123,"./blockheader":81,buffer:191,lodash:149}],81:[function(f,p,e){(function(i){"use strict";var n=f("lodash"),a=f("../crypto/bn"),o=f("../util/buffer"),s=f("../encoding/bufferreader"),t=f("../encoding/bufferwriter"),r=f("../crypto/hash"),c=(f("../util/js"),f("../util/preconditions")),u=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&c.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};u._from=function(e){var t={};if(o.isBuffer(e))t=u._fromBufferReader(s(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for BlockHeader");t=u._fromObject(e)}return t},u._fromObject=function(e){c.checkArgument(e,"data is required");var t=e.prevHash,r=e.merkleRoot;return n.isString(e.prevHash)&&(t=o.reverse(new i(e.prevHash,"hex"))),n.isString(e.merkleRoot)&&(r=o.reverse(new i(e.merkleRoot,"hex"))),{hash:e.hash,version:e.version,prevHash:t,merkleRoot:r,time:e.time,timestamp:e.time,bits:e.bits,nonce:e.nonce}},u.fromObject=function(e){var t=u._fromObject(e);return new u(t)},u.fromRawBlock=function(e){o.isBuffer(e)||(e=new i(e,"binary"));var t=s(e);t.pos=u.Constants.START_OF_HEADER;var r=u._fromBufferReader(t);return new u(r)},u.fromBuffer=function(e){var t=u._fromBufferReader(s(e));return new u(t)},u.fromString=function(e){var t=new i(e,"hex");return u.fromBuffer(t)},u._fromBufferReader=function(e){var t={};return t.version=e.readUInt32LE(),t.prevHash=e.read(32),t.merkleRoot=e.read(32),t.time=e.readUInt32LE(),t.bits=e.readUInt32LE(),t.nonce=e.readUInt32LE(),t},u.fromBufferReader=function(e){var t=u._fromBufferReader(e);return new u(t)},u.prototype.toObject=u.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:o.reverse(this.prevHash).toString("hex"),merkleRoot:o.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},u.prototype.toBuffer=function(){return this.toBufferWriter().concat()},u.prototype.toString=function(){return this.toBuffer().toString("hex")},u.prototype.toBufferWriter=function(e){return e||(e=new t),e.writeUInt32LE(this.version),e.write(this.prevHash),e.write(this.merkleRoot),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e},u.prototype.getTargetDifficulty=function(e){e=e||this.bits;for(var t=new a(16777215&e),r=8*((e>>>24)-3);0e+u.Constants.MAX_TIME_OFFSET)},u.prototype.validProofOfWork=function(){var e=new a(this.id,"hex"),t=this.getTargetDifficulty();return!(0"},u.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new a("10000000000000000000000000000000000000000000000000000000000000000","hex")},p.exports=u}).call(this,f("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],82:[function(e,t,r){t.exports=e("./block"),t.exports.BlockHeader=e("./blockheader"),t.exports.MerkleBlock=e("./merkleblock")},{"./block":80,"./blockheader":81,"./merkleblock":83}],83:[function(e,t,r){(function(s){"use strict";var n=e("lodash"),a=e("./blockheader"),o=e("../util/buffer"),r=e("../encoding/bufferreader"),i=e("../encoding/bufferwriter"),c=e("../crypto/hash"),u=(e("../util/js"),e("../transaction")),f=e("../util/preconditions");function p(e){if(!(this instanceof p))return new p(e);var t={};if(o.isBuffer(e))t=p._fromBufferReader(r(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for MerkleBlock");t={header:e.header instanceof a?e.header:a.fromObject(e.header),numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}return n.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}p.fromBuffer=function(e){return p.fromBufferReader(r(e))},p.fromBufferReader=function(e){return new p(p._fromBufferReader(e))},p.prototype.toBuffer=function(){return this.toBufferWriter().concat()},p.prototype.toBufferWriter=function(e){e||(e=new i),e.write(this.header.toBuffer()),e.writeUInt32LE(this.numTransactions),e.writeVarintNum(this.hashes.length);for(var t=0;tthis.numTransactions)return!1;if(8*this.flags.length8*this.flags.length)return null;var i=this.flags[r.flagBitsUsed>>3]>>>(7&r.flagBitsUsed++)&1;if(0!==e&&i){var n=this._traverseMerkleTree(e-1,2*t,r),a=n;return 2*t+1=this.hashes.length)return null;var o=this.hashes[r.hashesUsed++];return 0===e&&i&&r.txs.push(o),new s(o,"hex")},p.prototype._calcTreeWidth=function(e){return this.numTransactions+(1<>e},p.prototype._calcTreeHeight=function(){for(var e=0;1e.size?t=n.trim(t,i):i>1,o=d.getN(),s=d.getG(),c=a?r.add(o):r,u=d.fromX(n,c);if(!u.mul(o).isInfinity())throw new Error("nR is not a valid curve point");var f=t.neg().mod(o),p=r.invm(o),h=u.mul(i).add(s.mul(f)).mul(p);return m.fromPoint(h,this.sig.compressed)},h.prototype.sigError=function(){if(!f.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s;if(!(e.gt(l.Zero)&&e.lt(d.getN())&&t.gt(l.Zero)&&t.lt(d.getN())))return"r and s not in range";var r=l.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),i=d.getN(),n=t.invm(i),a=n.mul(r).mod(i),o=n.mul(e).mod(i),s=d.getG().mulAdd(a,this.pubkey.point,o);return s.isInfinity()?"p is infinity":0!==s.getX().mod(i).cmp(e)&&"Invalid signature"},h.toLowS=function(e){return e.gt(l.fromBuffer(new c("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=d.getN().sub(e)),e},h.prototype._findSignature=function(e,t){for(var r,i,n,a=d.getN(),o=d.getG(),s=0;(!this.k||0i)r=e(r);else if(r>>=8)}return r},e.exports=r}).call(this,i("_process"),i("buffer").Buffer)},{_process:382,buffer:191,crypto:204}],89:[function(e,r,t){(function(u){"use strict";var g=e("./bn"),v=e("lodash"),b=e("../util/preconditions"),y=e("../util/buffer"),t=e("../util/js"),o=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof g)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};o.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=void 0!==e.i?e.i:this.i,this.compressed=void 0!==e.compressed?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this},o.fromCompact=function(e){b.checkArgument(y.isBuffer(e),"Argument is expected to be a Buffer");var t=new o,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i+=4);var n=e.slice(1,33),a=e.slice(33,65);return b.checkArgument(0===i||1===i||2===i||3===i,new Error("i must be 0, 1, 2, or 3")),b.checkArgument(32===n.length,new Error("r must be 32 bytes")),b.checkArgument(32===a.length,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=g.fromBuffer(n),t.s=g.fromBuffer(a),t},o.fromDER=o.fromBuffer=function(e,t){var r=o.parseDER(e,t),i=new o;return i.r=r.r,i.s=r.s,i},o.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=new o.fromDER(r,!1);return i.nhashtype=t,i},o.fromString=function(e){var t=new u(e,"hex");return o.fromDER(t)},o.parseDER=function(e,t){b.checkArgument(y.isBuffer(e),new Error("DER formatted signature should be a buffer")),v.isUndefined(t)&&(t=!0);var r=e[0];b.checkArgument(48===r,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;b.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(2!==e[2])return!1;if(0===t)return!1;if(128&i[0])return!1;if(1=this.buf.length},e.prototype.read=function(e){r.checkArgument(!n.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t},e.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e},e.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e},e.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=o.fromBuffer(e);return this.pos=this.pos+8,t},e.prototype.readUInt64LEBN=function(){var e,t=this.buf.readUInt32LE(this.pos),r=4294967296*this.buf.readUInt32LE(this.pos+4)+t;if(r<=9007199254740991)e=new o(r);else{var i=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);e=new o(i,10,"le")}return this.pos=this.pos+8,e},e.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN().toNumber();if(t<=Math.pow(2,53))return t;throw new Error("number too large to retain precision - use readVarintBN");default:return e}},e.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return r.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t},e.prototype.readVarintBuf=function(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},e.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new o(this.readUInt16LE());case 254:return new o(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new o(e)}},e.prototype.reverse=function(){for(var e=new i(this.buf.length),t=0;t"},k.prototype.toObject=k.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:_.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},k.fromBuffer=function(e){return new k(e.toString())},k.prototype.toBuffer=function(){return _.copy(this._buffers.xprivkey)},k.DefaultDepth=0,k.DefaultFingerprint=0,k.DefaultChildIndex=0,k.MaxIndex=2*(k.Hardened=2147483648),k.RootElementAlias=["m","M","m'","M'"],k.VersionSize=4,k.DepthSize=1,k.ParentFingerPrintSize=4,k.ChildIndexSize=4,k.ChainCodeSize=32,k.PrivateKeySize=32,k.CheckSumSize=4,k.DataLength=78,k.SerializedByteSize=82,n((k.ChecksumEnd=(k.ChecksumStart=k.PrivateKeyEnd=(k.PrivateKeyStart=(k.ChainCodeEnd=(k.ChainCodeStart=k.ChildIndexEnd=(k.ChildIndexStart=k.ParentFingerPrintEnd=(k.ParentFingerPrintStart=k.DepthEnd=(k.DepthStart=k.VersionEnd=(k.VersionStart=0)+k.VersionSize)+k.DepthSize)+k.ParentFingerPrintSize)+k.ChildIndexSize)+k.ChainCodeSize)+1)+k.PrivateKeySize)+k.CheckSumSize)===k.SerializedByteSize),e.exports=k}).call(this,o("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./crypto/random":88,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdpublickey":99,"./networks":100,"./privatekey":102,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],99:[function(i,s,e){(function(u){"use strict";var n=i("lodash"),t=i("./util/preconditions"),f=i("./crypto/bn"),a=i("./encoding/base58"),p=i("./encoding/base58check"),h=i("./crypto/hash"),r=i("./hdprivatekey"),l=i("./hdkeycache"),d=i("./networks"),m=i("./crypto/point"),g=i("./publickey"),e=i("./errors"),v=e,b=e.HDPublicKey,o=i("assert"),y=i("./util/js"),_=i("./util/buffer");function w(e){if(e instanceof w)return e;if(!(this instanceof w))return new w(e);if(e){if(n.isString(e)||_.isBuffer(e)){var t=w.getSerializedError(e);if(t){if(_.isBuffer(e)&&!w.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof b.ArgumentIsPrivateExtended)return new r(e).hdPublicKey;throw t}return this._buildFromSerialized(e)}if(n.isObject(e))return e instanceof r?this._buildFromPrivate(e):this._buildFromObject(e);throw new b.UnrecognizedArgument(e)}throw new b.MustSupplyArgument}w.isValidPath=function(e){if(n.isString(e)){var t=r._getDerivationIndexes(e);return null!==t&&n.all(t,w.isValidPath)}return!!n.isNumber(e)&&(0<=e&&e"},w.prototype.toObject=w.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version)).name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:_.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},w.fromBuffer=function(e){return new w(e)},w.prototype.toBuffer=function(){return _.copy(this._buffers.xpubkey)},w.Hardened=2147483648,w.RootElementAlias=["m","M"],w.VersionSize=4,w.DepthSize=1,w.ParentFingerPrintSize=4,w.ChildIndexSize=4,w.ChainCodeSize=32,w.PublicKeySize=33,w.CheckSumSize=4,w.DataSize=78,w.SerializedByteSize=82,w.ChecksumEnd=(w.ChecksumStart=w.PublicKeyEnd=(w.PublicKeyStart=w.ChainCodeEnd=(w.ChainCodeStart=w.ChildIndexEnd=(w.ChildIndexStart=w.ParentFingerPrintEnd=(w.ParentFingerPrintStart=w.DepthEnd=(w.DepthStart=w.VersionEnd=(w.VersionStart=0)+w.VersionSize)+w.DepthSize)+w.ParentFingerPrintSize)+w.ChildIndexSize)+w.ChainCodeSize)+w.PublicKeySize)+w.CheckSumSize,o(w.PublicKeyEnd===w.DataSize),o(w.ChecksumEnd===w.SerializedByteSize),s.exports=w}).call(this,i("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdprivatekey":98,"./networks":100,"./publickey":103,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],100:[function(e,t,r){"use strict";var n=e("lodash"),i=e("./util/buffer"),a=e("./util/js"),o=[],s={};function c(){}function u(t,e){if(~o.indexOf(t))return t;if(!e)return s[t];n.isArray(e)||(e=[e]);var r=function(e){return o[i][e]===t};for(var i in o)if(n.any(e,r))return o[i]}function f(e){var t=new c;return a.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey}),e.networkMagic&&a.defineImmutable(t,{networkMagic:i.integerAsBuffer(e.networkMagic)}),e.port&&a.defineImmutable(t,{port:e.port}),e.dnsSeeds&&a.defineImmutable(t,{dnsSeeds:e.dnsSeeds}),n.each(t,function(e){n.isUndefined(e)||n.isObject(e)||(s[e]=t)}),o.push(t),t}c.prototype.toString=function(){return this.name},f({name:"livenet",alias:"mainnet",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var p=u("livenet");f({name:"testnet",alias:"regtest",pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956});var h=u("testnet"),l={PORT:18333,NETWORK_MAGIC:i.integerAsBuffer(185665799),DNS_SEEDS:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]};for(var d in l)n.isObject(l[d])||(s[l[d]]=h);var m={PORT:18444,NETWORK_MAGIC:i.integerAsBuffer(4206867930),DNS_SEEDS:[]};for(var d in m)n.isObject(m[d])||(s[m[d]]=h);Object.defineProperty(h,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.PORT:l.PORT}}),Object.defineProperty(h,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.NETWORK_MAGIC:l.NETWORK_MAGIC}}),Object.defineProperty(h,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.DNS_SEEDS:l.DNS_SEEDS}}),t.exports={add:f,remove:function(e){for(var t=0;t=a.map.OP_1&&e<=a.map.OP_16},a.prototype.inspect=function(){return""},c.exports=a}).call(this,s("buffer").Buffer)},{"./util/buffer":121,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],102:[function(h,l,e){(function(i){"use strict";var n=h("lodash"),r=h("./address"),a=h("./encoding/base58check"),o=h("./crypto/bn"),s=h("./util/js"),c=h("./networks"),u=h("./crypto/point"),e=h("./publickey"),f=h("./crypto/random"),t=h("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(e instanceof p)return e;var r=this._classifyArguments(e,t);if(!r.bn||0===r.bn.cmp(new o(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(u.getN()))throw new TypeError("Number must be less than N");if(void 0===r.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return s.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}p.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?c.get(t):c.defaultNetwork};if(n.isUndefined(e)||n.isNull(e))r.bn=p._getRandomBN();else if(e instanceof o)r.bn=e;else if(e instanceof i||e instanceof Uint8Array)r=p._transformBuffer(e,t);else if(e.bn&&e.network)r=p._transformObject(e);else if(!t&&c.get(e))r.bn=p._getRandomBN(),r.network=c.get(e);else{if("string"!=typeof e)throw new TypeError("First argument is an unrecognized data type.");s.isHexa(e)?r.bn=new o(new i(e,"hex")):r=p._transformWIF(e,t)}return r},p._getRandomBN=function(){var e,t;do{var r=f.getRandomBuffer(32);e=(t=o.fromBuffer(r)).lt(u.getN())}while(!e);return t},p._transformBuffer=function(e,t){var r={};if(32===e.length)return p._transformBNBuffer(e,t);if(r.network=c.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==c.get(t))throw new TypeError("Private key network mismatch");if(34===e.length&&1===e[33])r.compressed=!0;else{if(33!==e.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");r.compressed=!1}return r.bn=o.fromBuffer(e.slice(1,33)),r},p._transformBNBuffer=function(e,t){var r={};return r.network=c.get(t)||c.defaultNetwork,r.bn=o.fromBuffer(e),r.compressed=!1,r},p._transformWIF=function(e,t){return p._transformBuffer(a.decode(e),t)},p.fromBuffer=function(e,t){return new p(e,t)},p._transformObject=function(e){return{bn:new o(e.bn,"hex"),network:c.get(e.network),compressed:e.compressed}},p.fromString=p.fromWIF=function(e){return t.checkArgument(n.isString(e),"First argument is expected to be a string."),new p(e)},p.fromObject=function(e){return t.checkArgument(n.isObject(e),"First argument is expected to be an object."),new p(e)},p.fromRandom=function(e){return new p(p._getRandomBN(),e)},p.getValidationError=function(e,t){var r;try{new p(e,t)}catch(e){r=e}return r},p.isValid=function(e,t){return!!e&&!p.getValidationError(e,t)},p.prototype.toString=function(){return this.toBuffer().toString("hex")},p.prototype.toWIF=function(){var e,t=this.network;return e=this.compressed?i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32}),new i([1])]):i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32})]),a.encode(e)},p.prototype.toBigNumber=function(){return this.bn},p.prototype.toBuffer=function(){return this.bn.toBuffer()},p.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=e.fromPrivateKey(this)),this._pubkey},p.prototype.toAddress=function(e){var t=this.toPublicKey();return r.fromPublicKey(t,e||this.network)},p.prototype.toObject=p.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},p.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return""},l.exports=p}).call(this,h("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/point":87,"./crypto/random":88,"./encoding/base58check":91,"./networks":100,"./publickey":103,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],103:[function(t,r,e){(function(o){"use strict";var s=t("./crypto/bn"),c=t("./crypto/point"),e=t("./crypto/hash"),i=t("./util/js"),n=t("./networks"),u=t("lodash"),f=t("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(f.checkArgument(e,"First argument is required, please include public key data."),e instanceof p)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),i.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||n.defaultNetwork}),this}p.prototype._classifyArgs=function(e,t){var r={compressed:u.isUndefined(t.compressed)||t.compressed};if(e instanceof c)r.point=e;else if(e.x&&e.y)r=p._transformObject(e);else if("string"==typeof e)r=p._transformDER(new o(e,"hex"));else if(p._isBuffer(e))r=p._transformDER(e);else{if(!p._isPrivateKey(e))throw new TypeError("First argument is an unrecognized data format.");r=p._transformPrivateKey(e)}return r.network||(r.network=u.isUndefined(t.network)?void 0:n.get(t.network)),r},p._isPrivateKey=function(e){return e instanceof t("./privatekey")},p._isBuffer=function(e){return e instanceof o||e instanceof Uint8Array},p._transformPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=c.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t},p._transformDER=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r,i,n,a,o={};if(t=!!u.isUndefined(t)||t,4!==e[0]&&(t||6!==e[0]&&7!==e[0]))if(3===e[0])n=e.slice(1),r=new s(n),(o=p._transformX(!0,r)).compressed=!0;else{if(2!==e[0])throw new TypeError("Invalid DER format public key");n=e.slice(1),r=new s(n),(o=p._transformX(!1,r)).compressed=!0}else{if(n=e.slice(1,33),a=e.slice(33,65),32!==n.length||32!==a.length||65!==e.length)throw new TypeError("Length of x and y must be 32 bytes");r=new s(n),i=new s(a),o.point=new c(r,i),o.compressed=!1}return o},p._transformX=function(e,t){f.checkArgument("boolean"==typeof e,"Must specify whether y is odd or not (true or false)");var r={};return r.point=c.fromX(e,t),r},p._transformObject=function(e){var t=new s(e.x,"hex"),r=new s(e.y,"hex");return new p(new c(t,r),{compressed:e.compressed})},p.fromPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t=p._transformPrivateKey(e);return new p(t.point,{compressed:t.compressed,network:t.network})},p.fromDER=p.fromBuffer=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r=p._transformDER(e,t);return new p(r.point,{compressed:r.compressed})},p.fromPoint=function(e,t){return f.checkArgument(e instanceof c,"First argument must be an instance of Point."),new p(e,{compressed:t})},p.fromString=function(e,t){var r=new o(e,t||"hex"),i=p._transformDER(r);return new p(i.point,{compressed:i.compressed})},p.fromX=function(e,t){var r=p._transformX(e,t);return new p(r.point,{compressed:r.compressed})},p.getValidationError=function(e){var t;try{new p(e)}catch(e){t=e}return t},p.isValid=function(e){return!p.getValidationError(e)},p.prototype.toObject=p.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},p.prototype.toBuffer=p.prototype.toDER=function(){var e,t=this.point.getX(),r=this.point.getY(),i=t.toBuffer({size:32}),n=r.toBuffer({size:32});if(this.compressed){var a=n[n.length-1]%2;return e=new o(a?[3]:[2]),o.concat([e,i])}return e=new o([4]),o.concat([e,i,n])},p.prototype._getID=function(){return e.sha256ripemd160(this.toBuffer())},p.prototype.toAddress=function(e){return t("./address").fromPublicKey(this,e||this.network)},p.prototype.toString=function(){return this.toDER().toString("hex")},p.prototype.inspect=function(){return""},r.exports=p}).call(this,t("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./networks":100,"./privatekey":102,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],104:[function(e,t,r){t.exports=e("./script"),t.exports.Interpreter=e("./interpreter")},{"./interpreter":105,"./script":106}],105:[function(p,t,e){(function(e){"use strict";var R=p("lodash"),z=p("./script"),M=p("../opcode"),N=p("../crypto/bn"),D=p("../crypto/hash"),q=p("../crypto/signature"),L=p("../publickey"),U=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};U.prototype.verify=function(e,t,r,i,n){var a,o=p("../transaction");if(R.isUndefined(r)&&(r=new o),R.isUndefined(i)&&(i=0),R.isUndefined(n)&&(n=0),this.set({script:e,tx:r,nin:i,flags:n}),0!=(n&U.SCRIPT_VERIFY_SIGPUSHONLY)&&!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(!this.evaluate())return!1;n&U.SCRIPT_VERIFY_P2SH&&(a=this.stack.slice());var s=this.stack;if(this.initialize(),this.set({script:t,stack:s,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(0===this.stack.length)return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT");var c=this.stack[this.stack.length-1];if(!U.castToBool(c))return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK");if(n&U.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(0===a.length)throw new Error("internal error - stack copy empty");var u=a[a.length-1],f=z.fromBuffer(u);return a.pop(),this.initialize(),this.set({script:f,stack:a,tx:r,nin:i,flags:n}),!!this.evaluate()&&(0===a.length?!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK"):!!U.castToBool(a[a.length-1])||!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK"))}return!0},(t.exports=U).prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},U.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=void 0!==e.nin?e.nin:this.nin,this.stack=e.stack||this.stack,this.altstack=e.altack||this.altstack,this.pc=void 0!==e.pc?e.pc:this.pc,this.pbegincodehash=void 0!==e.pbegincodehash?e.pbegincodehash:this.pbegincodehash,this.nOpCount=void 0!==e.nOpCount?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=void 0!==e.flags?e.flags:this.flags},U.true=new e([1]),U.false=new e([]),U.MAX_SCRIPT_ELEMENT_SIZE=520,U.LOCKTIME_THRESHOLD_BN=new N(U.LOCKTIME_THRESHOLD=5e8),U.SCRIPT_VERIFY_NONE=0,U.SCRIPT_VERIFY_P2SH=1,U.SCRIPT_VERIFY_STRICTENC=2,U.SCRIPT_VERIFY_DERSIG=4,U.SCRIPT_VERIFY_LOW_S=8,U.SCRIPT_VERIFY_NULLDUMMY=16,U.SCRIPT_VERIFY_SIGPUSHONLY=32,U.SCRIPT_VERIFY_MINIMALDATA=64,U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,U.castToBool=function(e){for(var t=0;t=U.LOCKTIME_THRESHOLD&&e.gte(U.LOCKTIME_THRESHOLD_BN))&&(!e.gt(new N(this.tx.nLockTime))&&!!this.tx.inputs[this.nin].isFinal())},U.prototype.step=function(){var e,t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g,v=0!=(this.flags&U.SCRIPT_VERIFY_MINIMALDATA),b=-1===this.vfExec.indexOf(!1),y=this.script.chunks[this.pc];this.pc++;var _=y.opcodenum;if(R.isUndefined(_))return!(this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE");if(y.buf&&y.buf.length>U.MAX_SCRIPT_ELEMENT_SIZE)return!(this.errstr="SCRIPT_ERR_PUSH_SIZE");if(_>M.OP_16&&201<++this.nOpCount)return!(this.errstr="SCRIPT_ERR_OP_COUNT");if(_===M.OP_CAT||_===M.OP_SUBSTR||_===M.OP_LEFT||_===M.OP_RIGHT||_===M.OP_INVERT||_===M.OP_AND||_===M.OP_OR||_===M.OP_XOR||_===M.OP_2MUL||_===M.OP_2DIV||_===M.OP_MUL||_===M.OP_DIV||_===M.OP_MOD||_===M.OP_LSHIFT||_===M.OP_RSHIFT)return!(this.errstr="SCRIPT_ERR_DISABLED_OPCODE");if(b&&0<=_&&_<=M.OP_PUSHDATA4){if(v&&!this.script.checkMinimalPush(this.pc-1))return!(this.errstr="SCRIPT_ERR_MINIMALDATA");if(y.buf){if(y.len!==y.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(y.buf)}else this.stack.push(U.false)}else if(b||M.OP_IF<=_&&_<=M.OP_ENDIF)switch(_){case M.OP_1NEGATE:case M.OP_1:case M.OP_2:case M.OP_3:case M.OP_4:case M.OP_5:case M.OP_6:case M.OP_7:case M.OP_8:case M.OP_9:case M.OP_10:case M.OP_11:case M.OP_12:case M.OP_13:case M.OP_14:case M.OP_15:case M.OP_16:n=_-(M.OP_1-1),e=new N(n).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_NOP:break;case M.OP_NOP2:case M.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break}if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");var w=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v,5);if(w.lt(new N(0)))return!(this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME");if(!this.checkLockTime(w))return!(this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME");break;case M.OP_NOP1:case M.OP_NOP3:case M.OP_NOP4:case M.OP_NOP5:case M.OP_NOP6:case M.OP_NOP7:case M.OP_NOP8:case M.OP_NOP9:case M.OP_NOP10:if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break;case M.OP_IF:case M.OP_NOTIF:if(m=!1,b){if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");e=this.stack.pop(),m=U.castToBool(e),_===M.OP_NOTIF&&(m=!m)}this.vfExec.push(m);break;case M.OP_ELSE:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case M.OP_ENDIF:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec.pop();break;case M.OP_VERIFY:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],!(m=U.castToBool(e)))return!(this.errstr="SCRIPT_ERR_VERIFY");this.stack.pop();break;case M.OP_RETURN:return!(this.errstr="SCRIPT_ERR_OP_RETURN");case M.OP_TOALTSTACK:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.altstack.push(this.stack.pop());break;case M.OP_FROMALTSTACK:if(this.altstack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION");this.stack.push(this.altstack.pop());break;case M.OP_2DROP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop(),this.stack.pop();break;case M.OP_2DUP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1],this.stack.push(t),this.stack.push(r);break;case M.OP_3DUP:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-3],r=this.stack[this.stack.length-2];var k=this.stack[this.stack.length-1];this.stack.push(t),this.stack.push(r),this.stack.push(k);break;case M.OP_2OVER:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-4],r=this.stack[this.stack.length-3],this.stack.push(t),this.stack.push(r);break;case M.OP_2ROT:if(this.stack.length<6)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-6,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_2SWAP:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-4,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_IFDUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-1],(m=U.castToBool(e))&&this.stack.push(e);break;case M.OP_DEPTH:e=new N(this.stack.length).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_DROP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop();break;case M.OP_DUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-1]);break;case M.OP_NIP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,1);break;case M.OP_OVER:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-2]);break;case M.OP_PICK:case M.OP_ROLL:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],n=(s=N.fromScriptNumBuffer(e,v)).toNumber(),this.stack.pop(),n<0||n>=this.stack.length)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-n-1],_===M.OP_ROLL&&this.stack.splice(this.stack.length-n-1,1),this.stack.push(e);break;case M.OP_ROT:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-3],o=this.stack[this.stack.length-2];var x=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=o,this.stack[this.stack.length-2]=x,this.stack[this.stack.length-1]=a;break;case M.OP_SWAP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-2],o=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=o,this.stack[this.stack.length-1]=a;break;case M.OP_TUCK:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case M.OP_SIZE:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");s=new N(this.stack[this.stack.length-1].length),this.stack.push(s.toScriptNumBuffer());break;case M.OP_EQUAL:case M.OP_EQUALVERIFY:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1];var S=t.toString("hex")===r.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(S?U.true:U.false),_===M.OP_EQUALVERIFY){if(!S)return!(this.errstr="SCRIPT_ERR_EQUALVERIFY");this.stack.pop()}break;case M.OP_1ADD:case M.OP_1SUB:case M.OP_NEGATE:case M.OP_ABS:case M.OP_NOT:case M.OP_0NOTEQUAL:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(e=this.stack[this.stack.length-1],s=N.fromScriptNumBuffer(e,v),_){case M.OP_1ADD:s=s.add(N.One);break;case M.OP_1SUB:s=s.sub(N.One);break;case M.OP_NEGATE:s=s.neg();break;case M.OP_ABS:s.cmp(N.Zero)<0&&(s=s.neg());break;case M.OP_NOT:s=new N((0===s.cmp(N.Zero))+0);break;case M.OP_0NOTEQUAL:s=new N((0!==s.cmp(N.Zero))+0)}this.stack.pop(),this.stack.push(s.toScriptNumBuffer());break;case M.OP_ADD:case M.OP_SUB:case M.OP_BOOLAND:case M.OP_BOOLOR:case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:case M.OP_NUMNOTEQUAL:case M.OP_LESSTHAN:case M.OP_GREATERTHAN:case M.OP_LESSTHANOREQUAL:case M.OP_GREATERTHANOREQUAL:case M.OP_MIN:case M.OP_MAX:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(c=N.fromScriptNumBuffer(this.stack[this.stack.length-2],v),u=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v),s=new N(0),_){case M.OP_ADD:s=c.add(u);break;case M.OP_SUB:s=c.sub(u);break;case M.OP_BOOLAND:s=new N((0!==c.cmp(N.Zero)&&0!==u.cmp(N.Zero))+0);break;case M.OP_BOOLOR:s=new N((0!==c.cmp(N.Zero)||0!==u.cmp(N.Zero))+0);break;case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:s=new N((0===c.cmp(u))+0);break;case M.OP_NUMNOTEQUAL:s=new N((0!==c.cmp(u))+0);break;case M.OP_LESSTHAN:s=new N((c.cmp(u)<0)+0);break;case M.OP_GREATERTHAN:s=new N((0"},v.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==c.OP_DUP||this.chunks[1].opcodenum!==c.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==c.OP_EQUALVERIFY||this.chunks[4].opcodenum!==c.OP_CHECKSIG)},v.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&48===e[0]&&t&&t.length){var r=t[0];if((4===r||6===r||7===r)&&65===t.length)return!0;if((3===r||2===r)&&33===t.length)return!0}}return!1},v.prototype.getPublicKey=function(){return p.checkState(this.isPublicKeyOut(),"Can't retreive PublicKey from a non-PK output"),this.chunks[0].buf},v.prototype.getPublicKeyHash=function(){return p.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},v.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===c.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if((4!==t&&6!==t&&7!==t||65!==e.length)&&(3!==t&&2!==t||33!==e.length)||(r=!0),r)return u.isValid(e)}return!1},v.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var e=this.chunks[0].buf;if(e&&e.length&&48===e[0])return!0}return!1},v.prototype.isScriptHashOut=function(){var e=this.toBuffer();return 23===e.length&&e[0]===c.OP_HASH160&&20===e[1]&&e[e.length-1]===c.OP_EQUAL},v.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e,t=this.chunks[this.chunks.length-1].buf;if(!t)return!1;try{e=v.fromBuffer(t)}catch(e){if(e instanceof l.Script.InvalidBuffer)return!1;throw e}return e.classify()!==v.types.UNKNOWN},v.prototype.isMultisigOut=function(){return 3=c.OP_1&&e<=c.OP_16)return e-(c.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))},v.prototype.getSignatureOperationsCount=function(r){r=!!h.isUndefined(r)||r;var i=this,n=0,a=c.OP_INVALIDOPCODE;return h.each(i.chunks,function(e){var t=e.opcodenum;t==c.OP_CHECKSIG||t==c.OP_CHECKSIGVERIFY?n++:t!=c.OP_CHECKMULTISIG&&t!=c.OP_CHECKMULTISIGVERIFY||(r&&a>=c.OP_1&&a<=c.OP_16?n+=i._decodeOP_N(a):n+=20),a=t}),n},t.exports=v}).call(this,e("buffer").Buffer)},{"../address":79,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../networks":100,"../opcode":101,"../publickey":103,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],107:[function(e,t,r){t.exports=e("./transaction"),t.exports.Input=e("./input"),t.exports.Output=e("./output"),t.exports.UnspentOutput=e("./unspentoutput"),t.exports.Signature=e("./signature"),t.exports.Sighash=e("./sighash")},{"./input":108,"./output":114,"./sighash":115,"./signature":116,"./transaction":117,"./unspentoutput":118}],108:[function(e,t,r){t.exports=e("./input"),t.exports.PublicKey=e("./publickey"),t.exports.PublicKeyHash=e("./publickeyhash"),t.exports.MultiSig=e("./multisig.js"),t.exports.MultiSigScriptHash=e("./multisigscripthash.js")},{"./input":109,"./multisig.js":110,"./multisigscripthash.js":111,"./publickey":112,"./publickeyhash":113}],109:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../../util/preconditions"),a=e("../../errors"),o=e("../../encoding/bufferwriter"),s=e("buffer"),c=e("../../util/buffer"),u=e("../../util/js"),f=e("../../script"),p=e("../sighash"),h=e("../output"),l=4294967295;function d(e){return this instanceof d?e?this._fromObject(e):void 0:new d(e)}d.MAXINT=l,d.DEFAULT_SEQNUMBER=4294967295,d.DEFAULT_LOCKTIME_SEQNUMBER=4294967294,d.DEFAULT_RBF_SEQNUMBER=4294967293,Object.defineProperty(d.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new f(this._scriptBuffer),this._script._isInput=!0),this._script)}}),d.fromObject=function(e){return n.checkArgument(i.isObject(e)),(new d)._fromObject(e)},d.prototype._fromObject=function(e){var t;if(t=i.isString(e.prevTxId)&&u.isHexa(e.prevTxId)?new s.Buffer(e.prevTxId,"hex"):e.prevTxId,this.output=e.output?e.output instanceof h?e.output:new h(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=i.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=i.isUndefined(e.sequenceNumber)?i.isUndefined(e.seqnum)?4294967295:e.seqnum:e.sequenceNumber,i.isUndefined(e.script)&&i.isUndefined(e.scriptBuffer))throw new a.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this},d.prototype.toObject=d.prototype.toJSON=function(){var e={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(e.scriptString=this.script.toString()),this.output&&(e.output=this.output.toObject()),e},d.fromBufferReader=function(e){var t=new d;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t},d.prototype.toBufferWriter=function(e){e||(e=new o),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e},d.prototype.setScript=function(e){if(this._script=null,e instanceof f)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(u.isHexa(e))this._scriptBuffer=new s.Buffer(e,"hex");else if(i.isString(e))this._script=new f(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!c.isBuffer(e))throw new TypeError("Invalid argument type: script");this._scriptBuffer=new s.Buffer(e)}return this},d.prototype.getSignatures=function(){throw new a.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},d.prototype.isFullySigned=function(){throw new a.AbstractMethodInvoked("Input#isFullySigned")},d.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},d.prototype.addSignature=function(){throw new a.AbstractMethodInvoked("Input#addSignature")},d.prototype.clearSignatures=function(){throw new a.AbstractMethodInvoked("Input#clearSignatures")},d.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},d.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},d.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},t.exports=d},{"../../encoding/bufferwriter":93,"../../errors":95,"../../script":104,"../../util/buffer":121,"../../util/js":122,"../../util/preconditions":123,"../output":114,"../sighash":115,buffer:191,lodash:149}],110:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=(e("../transaction"),e("./input")),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),u.checkState(o.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.output.script),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},l.normalizeSignatures=function(n,a,o,e,t){return t.map(function(r){var i=null;return e=e.filter(function(e){if(i)return!0;var t=new h({signature:f.fromTxFormat(e),publicKey:r,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:o,sigtype:f.SIGHASH_ALL});return t.signature.nhashtype=t.sigtype,!p.verify(n,t.signature,t.publicKey,t.inputIndex,a.output.script)||(i=t,!1)}),i||null})},l.OPCODES_SIZE=1,l.SIGNATURE_SIZE=73,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"../transaction":117,"./input":109,inherits:148,lodash:149}],111:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=e("./input"),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),this.redeemScript=o.buildMultisigOut(this.publicKeys,r),u.checkState(o.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.redeemScript),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript)},l.OPCODES_SIZE=7,l.SIGNATURE_SIZE=74,l.PUBKEY_SIZE=34,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE+this.publicKeys.length*l.PUBKEY_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148,lodash:149}],112:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),n=(e("../../util/buffer"),e("./input")),o=e("../output"),s=e("../sighash"),c=e("../../script"),u=e("../../crypto/signature"),f=e("../signature");function p(){n.apply(this,arguments)}i(p,n),p.prototype.getSignatures=function(e,t,r,i){a.checkState(this.output instanceof o),i=i||u.SIGHASH_ALL;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new f({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:s.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},p.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(c.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this},p.prototype.clearSignatures=function(){return this.setScript(c.empty()),this},p.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},p.SCRIPT_MAX_SIZE=73,p.prototype._estimateSize=function(){return p.SCRIPT_MAX_SIZE},t.exports=p},{"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],113:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),o=e("../../util/buffer"),s=e("../../crypto/hash"),n=e("./input"),c=e("../output"),u=e("../sighash"),f=e("../../script"),p=e("../../crypto/signature"),h=e("../signature");function l(){n.apply(this,arguments)}i(l,n),l.prototype.getSignatures=function(e,t,r,i,n){return a.checkState(this.output instanceof c),n=n||s.sha256ripemd160(t.publicKey.toBuffer()),i=i||p.SIGHASH_ALL,o.equals(n,this.output.script.getPublicKeyHash())?[new h({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:u.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},l.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(f.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this},l.prototype.clearSignatures=function(){return this.setScript(f.empty()),this},l.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()},l.SCRIPT_MAX_SIZE=107,l.prototype._estimateSize=function(){return l.SCRIPT_MAX_SIZE},t.exports=l},{"../../crypto/hash":86,"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],114:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../crypto/bn"),a=e("buffer"),o=e("../util/buffer"),s=e("../util/js"),c=e("../encoding/bufferwriter"),u=e("../script"),f=e("../util/preconditions"),p=e("../errors");function h(e){if(!(this instanceof h))return new h(e);if(!i.isObject(e))throw new TypeError("Unrecognized argument for Output");var t;this.satoshis=e.satoshis,o.isBuffer(e.script)?this._scriptBuffer=e.script:(t=i.isString(e.script)&&s.isHexa(e.script)?new a.Buffer(e.script,"hex"):e.script,this.setScript(t))}Object.defineProperty(h.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script||this.setScriptFromBuffer(this._scriptBuffer),this._script}}),Object.defineProperty(h.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof n?(this._satoshisBN=e,this._satoshis=e.toNumber()):i.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=n.fromNumber(this._satoshis)):(f.checkArgument(s.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=n.fromNumber(e),this._satoshis=e),f.checkState(s.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),h.prototype.invalidSatoshis=function(){return 9007199254740991"},h.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return t.script=0!==r?e.read(r):new a.Buffer([]),new h(t)},h.prototype.toBufferWriter=function(e){e||(e=new c),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e},t.exports=h},{"../crypto/bn":84,"../encoding/bufferwriter":93,"../errors":95,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],115:[function(y,e,t){(function(f){"use strict";var p=y("buffer"),h=y("../crypto/signature"),l=y("../script"),d=y("./output"),m=y("../encoding/bufferreader"),g=y("../encoding/bufferwriter"),v=y("../crypto/bn"),b=y("../crypto/hash"),o=y("../crypto/ecdsa"),s=y("../util/preconditions"),c=y("lodash"),u=function(e,t,r,i){var n,a=y("./transaction"),o=y("./input"),s=a.shallowCopy(e);for((i=new l(i)).removeCodeseparators(),n=0;n=s.outputs.length)return new f("0000000000000000000000000000000000000000000000000000000000000001","hex");for(s.outputs.length=r+1,n=0;n"},S.prototype.toBuffer=function(){var e=new u;return this.toBufferWriter(e).toBuffer()},S.prototype.toBufferWriter=function(t){return t.writeUInt32LE(this.version),t.writeVarintNum(this.inputs.length),s.each(this.inputs,function(e){e.toBufferWriter(t)}),t.writeVarintNum(this.outputs.length),s.each(this.outputs,function(e){e.toBufferWriter(t)}),t.writeUInt32LE(this.nLockTime),t},S.prototype.fromBuffer=function(e){var t=new c(e);return this.fromBufferReader(t)},S.prototype.fromBufferReader=function(e){var t,r,i;for(a.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readUInt32LE(),r=e.readVarintNum(),t=0;t=this.inputs.length)throw new n.Transaction.InvalidIndex(e,this.inputs.length);var i=this.inputs[e];this.inputs=s.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()},S.prototype.sign=function(e,t){a.checkState(this.hasAllUtxoInfo());var r=this;return s.isArray(e)?s.each(e,function(e){r.sign(e,t)}):s.each(this.getSignatures(e,t),function(e){r.applySignature(e)}),this},S.prototype.getSignatures=function(r,i){r=new k(r),i=i||p.SIGHASH_ALL;var n=this,a=[],o=f.sha256ripemd160(r.publicKey.toBuffer());return s.each(this.inputs,function(e,t){s.each(e.getSignatures(n,r,t,i,o),function(e){a.push(e)})}),a},S.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this},S.prototype.isFullySigned=function(){return s.each(this.inputs,function(e){if(e.isFullySigned===m.prototype.isFullySigned)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),s.all(s.map(this.inputs,function(e){return e.isFullySigned()}))},S.prototype.isValidSignature=function(e){if(this.inputs[e.inputIndex].isValidSignature===m.prototype.isValidSignature)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e)},S.prototype.verifySignature=function(e,t,r,i){return h.verify(this,e,t,r,i)},S.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var e=new x(0),t=0;t=m.MAXINT-1&&(t.sequenceNumber=m.DEFAULT_RBF_SEQNUMBER)}return this},I.exports=S}).call(this,A("buffer").Buffer)},{"../address":79,"../crypto/bn":84,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../privatekey":102,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"./input":108,"./output":114,"./sighash":115,"./unspentoutput":118,buffer:191,"buffer-compare":126,lodash:149}],118:[function(e,t,r){"use strict";var o=e("lodash"),s=e("../util/preconditions"),c=e("../util/js"),u=e("../script"),f=e("../address"),p=e("../unit");function h(e){if(!(this instanceof h))return new h(e);s.checkArgument(o.isObject(e),"Must provide an object from where to extract data");var t=e.address?new f(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!c.isHexaString(r)||64"},h.prototype.toString=function(){return this.txId+":"+this.outputIndex},h.fromObject=function(e){return new h(e)},h.prototype.toObject=h.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:p.fromSatoshis(this.satoshis).toBTC()}},t.exports=h},{"../address":79,"../script":104,"../unit":119,"../util/js":122,"../util/preconditions":123,lodash:149}],119:[function(e,t,r){"use strict";var i=e("lodash"),n=e("./errors"),a=e("./util/preconditions"),o={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function s(e,t){if(!(this instanceof s))return new s(e,t);if(i.isNumber(t)){if(t<=0)throw new n.Unit.InvalidRate(t);e/=t,t=s.BTC}this._value=this._from(e,t);var r=this;Object.keys(o).forEach(function(e){Object.defineProperty(r,e,{get:function(){return r.to(e)},enumerable:!0})})}Object.keys(o).forEach(function(e){s[e]=e}),s.fromObject=function(e){return a.checkArgument(i.isObject(e),"Argument is expected to be an object"),new s(e.amount,e.code)},s.fromBTC=function(e){return new s(e,s.BTC)},s.fromMillis=s.fromMilis=function(e){return new s(e,s.mBTC)},s.fromMicros=s.fromBits=function(e){return new s(e,s.bits)},s.fromSatoshis=function(e){return new s(e,s.satoshis)},s.fromFiat=function(e,t){return new s(e,t)},s.prototype._from=function(e,t){if(!o[t])throw new n.Unit.UnknownCode(t);return parseInt((e*o[t][0]).toFixed())},s.prototype.to=function(e){if(i.isNumber(e)){if(e<=0)throw new n.Unit.InvalidRate(e);return parseFloat((this.BTC*e).toFixed(2))}if(!o[e])throw new n.Unit.UnknownCode(e);var t=this._value/o[e][0];return parseFloat(t.toFixed(o[e][1]))},s.prototype.toBTC=function(){return this.to(s.BTC)},s.prototype.toMillis=s.prototype.toMilis=function(){return this.to(s.mBTC)},s.prototype.toMicros=s.prototype.toBits=function(){return this.to(s.bits)},s.prototype.toSatoshis=function(){return this.to(s.satoshis)},s.prototype.atRate=function(e){return this.to(e)},s.prototype.toString=function(){return this.satoshis+" satoshis"},s.prototype.toObject=s.prototype.toJSON=function(){return{amount:this.BTC,code:s.BTC}},s.prototype.inspect=function(){return""},t.exports=s},{"./errors":95,"./util/preconditions":123,lodash:149}],120:[function(e,t,r){"use strict";var i=e("lodash"),n=e("url"),a=e("./address"),o=e("./unit"),s=function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.extras={},this.knownParams=r||[],this.address=this.network=this.amount=this.message=null,"string"==typeof t){var i=e.parse(t);i.amount&&(i.amount=this._parseAmount(i.amount)),this._fromObject(i)}else{if("object"!==(void 0===t?"undefined":_typeof(t)))throw new TypeError("Unrecognized data format.");this._fromObject(t)}};s.fromString=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return new s(e)},s.fromObject=function(e){return new s(e)},s.isValid=function(e,t){try{new s(e,t)}catch(e){return!1}return!0},s.parse=function(e){var t=n.parse(e,!0);if("bitcoin:"!==t.protocol)throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(e);return t.query.address=r&&r[1]||void 0,t.query},s.Members=["address","amount","message","label","r"],s.prototype._fromObject=function(e){if(!a.isValid(e.address))throw new TypeError("Invalid bitcoin address");for(var t in this.address=new a(e.address),this.network=this.address.network,this.amount=e.amount,e)if("address"!==t&&"amount"!==t){if(/^req-/.exec(t)&&-1===this.knownParams.indexOf(t))throw Error("Unknown required argument "+t);(-1"},t.exports=s},{"./address":79,"./unit":119,lodash:149,url:500}],121:[function(o,s,e){(function(r){"use strict";var i=o("buffer"),t=o("assert"),n=o("./js"),a=o("./preconditions");function e(e,t){if(e.length!==t.length)return!1;for(var r=e.length,i=0;i>24&255),t.push(e>>16&255),t.push(e>>8&255),t.push(255&e),new r(t)},integerFromBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]<<24|e[1]<<16|e[2]<<8|e[3]},integerFromSingleByteBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]},bufferToHex:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e.toString("hex")},reverse:function(e){for(var t=new i.Buffer(e.length),r=0;r>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}}else if("le"===r)for(i=0,a=0;i>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-i&4194303,26<=(i+=24)&&(i-=26,n++)}if(r+6!==t){a=o(e,t,r+6);this.words[n]|=a<>>26-i&4194303}this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];v.prototype.toString=function(e,t){if(16===(e=e||10)||"hex"===e){for(var r="",i=0,n=(t=0|t||1,0),a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return this.sign&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var c=l[e],u=d[e],f=(r="",this.clone());for(f.sign=!1;0!==f.cmpn(0);){var p=f.modn(u).toString(e);r=0!==(f=f.idivn(u)).cmpn(0)?h[c-p.length]+p+r:p+r}return 0===this.cmpn(0)&&(r="0"+r),this.sign&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.prototype.toJSON=function(){return this.toString(16)},v.prototype.toArray=function(){this.strip();var e=new Array(this.byteLength());e[0]=0;for(var t=this.clone(),r=0;0!==t.cmpn(0);r++){var i=t.andln(255);t.ishrn(8),e[e.length-r-1]=i}return e},v.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return 4096<=t&&(r+=13,t>>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.iand=function(e){var t;this.sign=this.sign&&e.sign,t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},v.prototype.ixor=function(e){var t,r;this.sign=this.sign||e.sign,r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);for(var r=e/26|0,i=e%26;this.length<=r;)this.words[this.length++]=0;return this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,a=0;a>>26}for(;0!==n&&a>>26}if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this);this.sign=!1;t=e.sub(this);return this.sign=!0,t},v.prototype.isub=function(e){if(e.sign){e.sign=!1;var t=this.iadd(e);return e.sign=!0,t._normSign()}if(this.sign)return this.sign=!1,this.iadd(e),this.sign=!0,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.sign=!1,this.length=1,this.words[0]=0,this;i=0>26,this.words[o]=67108863&t}for(;0!==a&&o>26,this.words[o]=67108863&t}if(0===a&&o>>26,a=67108863&r,o=Math.min(i,e.length-1),s=Math.max(0,i-this.length+1);s<=o;s++){var c=i-s,u=(0|this.words[c])*(0|e.words[s]),f=67108863&u;a=67108863&(f=f+a|0),n=(n=n+(u/67108864|0)|0)+(f>>>26)|0}t.words[i]=a,r=n}return 0!==r?t.words[i]=r:t.length--,t.strip()},v.prototype._bigMulTo=function(e,t){t.sign=e.sign!==this.sign,t.length=this.length+e.length;for(var r=0,i=0,n=0;n>>26)|0)>>>26,a&=67108863}t.words[n]=o,r=a,a=i}return 0!==r?t.words[n]=r:t.length--,t.strip()},v.prototype.mulTo=function(e,t){return this.length+e.length<63?this._smallMulTo(e,t):this._bigMulTo(e,t)},v.prototype.mul=function(e){var t=new v(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},v.prototype.imul=function(e){if(0===this.cmpn(0)||0===e.cmpn(0))return this.words[0]=0,this.length=1,this;var t=this.length,r=e.length;this.sign=e.sign!==this.sign,this.length=this.length+e.length,this.words[this.length-1]=0;for(var i=this.length-2;0<=i;i--){for(var n=0,a=0,o=Math.min(i,r-1),s=Math.max(0,i-t+1);s<=o;s++){var c=i-s,u=this.words[c]*e.words[s],f=67108863&u;n+=u/67108864|0,a=67108863&(f+=a),n+=f>>>26}this.words[i]=a,this.words[i+1]+=n,n=0}for(n=0,c=1;c>>26}return this.strip()},v.prototype.imuln=function(e){g("number"==typeof e);for(var t=0,r=0;r>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.mul(this)},v.prototype.ishln=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){for(var n=0,a=0;a>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;a>>n<a){this.length-=a;for(c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(c/67108864|0),this.words[a+r]=67108863&s}for(;a>26,this.words[a+r]=67108863&s}if(0===o)return this.strip();g(-1===o);for(a=o=0;a>26,this.words[a]=67108863&s}return this.sign=!0,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.shln(r),i.ishln(r),a=n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var n;i=this.divmod(e.neg(),t);return"mod"!==t&&(n=i.div.neg()),{div:n,mod:i.mod}},v.prototype.div=function(e){return this.divmod(e,"div").div},v.prototype.mod=function(e){return this.divmod(e,"mod").mod},v.prototype.divRound=function(e){var t=this.divmod(e);if(0===t.mod.cmpn(0))return t.div;var r=t.div.sign?t.mod.isub(e):t.mod,i=e.shrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:t.div.sign?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+this.words[i])%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=this.words[r]+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.ishrn(1),r.ishrn(1),++s;for(var c=r.clone(),u=t.clone();0!==t.cmpn(0);){for(;t.isEven();)t.ishrn(1),i.isEven()&&n.isEven()?(i.ishrn(1),n.ishrn(1)):(i.iadd(c).ishrn(1),n.isub(u).ishrn(1));for(;r.isEven();)r.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(u).ishrn(1));0<=t.cmp(r)?(t.isub(r),i.isub(a),n.isub(o)):(r.isub(t),a.isub(i),o.isub(n))}return{a:a,b:o,gcd:r.ishln(s)}},v.prototype._invmp=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=r.clone();0>>26,o&=67108863,this.words[n]=o}return 0!==a&&(this.words[n]=a,this.length++),this},v.prototype.cmpn=function(e){var t,r=e<0;if(r&&(e=-e),this.sign&&!r)return-1;if(!this.sign&&r)return 1;if(e&=67108863,this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}e.words[i-10]=n>>>22,e.length-=9},a.prototype.imulK=function(e){var t;e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(i[e])return i[e];var t;if("k256"===e)t=new a;else if("p224"===e)t=new s;else if("p192"===e)t=new c;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new u}return i[e]=t},f.prototype._verify1=function(e){g(!e.sign,"red works only with positives"),g(e.red,"red works only with red numbers")},f.prototype._verify2=function(e,t){g(!e.sign&&!t.sign,"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},f.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.mod(this.m)._forceRed(this)},f.prototype.neg=function(e){var t=e.clone();return t.sign=!t.sign,t.iadd(this.m)._forceRed(this)},f.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},f.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},f.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)},f.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.shln(t))},f.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},f.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},f.prototype.isqr=function(e){return this.imul(e,e)},f.prototype.sqr=function(e){return this.mul(e,e)},f.prototype.sqrt=function(e){if(0===e.cmpn(0))return e.clone();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).ishrn(2);return f=this.pow(e,r)}for(var i=this.m.subn(1),n=0;0!==i.cmpn(0)&&0===i.andln(1);)n++,i.ishrn(1);g(0!==i.cmpn(0));var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).ishrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).ishrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>8,i[r]&=255;for(;a;)i.push(255&a),a>>=8}for(t=0;"1"===e[t]&&tt[i]?1:0);++i);return 0==r&&(t.length>e.length?r=-1:e.length>t.length&&(r=1)),r}},{}],127:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.hmacDRBG=e("./elliptic/hmac-drbg"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec")},{"../package.json":147,"./elliptic/curve":130,"./elliptic/curves":133,"./elliptic/ec":134,"./elliptic/hmac-drbg":137,"./elliptic/utils":139,brorand:140}],128:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic"),S=n.utils.getNAF,j=n.utils.getJSF,u=n.utils.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function o(e,t){this.curve=e,this.type=t,this.precomputed=null}(t.exports=a).prototype.point=function(){throw new Error("Not implemented")},a.prototype.validate=function(){throw new Error("Not implemented")},a.prototype._fixedNafMul=function(e,t){var r=e._getDoubles(),i=S(t,1),n=(1<>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i){for(var n=this._wnafT1,a=this._wnafT2,o=this._wnafT3,s=0,c=0;c>1]:x<0&&(k=a[m][-x-1>>1].neg()),b="affine"===k.type?b.mixedAdd(k):b.add(k))}}for(c=0;c":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],130:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":128,"./edwards":129,"./mont":131,"./short":132}],131:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base;function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(s,o),(t.exports=s).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)},a(c,o.BasePoint),s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.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)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.ishrn(1))n.push(t.andln(1));for(var a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../curve":130,"bn.js":124,inherits:148}],132:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.shrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.sign&&(i=i.neg(),n=n.neg()),a.sign&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(t=new w(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b).redSqrt(),i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},c.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)},c.prototype._endoWnafMulAdd=function(e,t){for(var r=this._endoWnafT1,i=this._endoWnafT2,n=0;n":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],133:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":127,"./precomputed/secp256k1":138,"hash.js":141}],134:[function(e,t,r){"use strict";var d=e("bn.js"),m=e("../../elliptic"),i=m.utils.assert,n=e("./key"),g=e("./signature");function a(e){if(!(this instanceof a))return new a(e);"string"==typeof e&&(i(m.curves.hasOwnProperty(e),"Unknown curve "+e),e=m.curves[e]),e instanceof m.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(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}(t.exports=a).prototype.keyPair=function(e){return new n(this,e)},a.prototype.keyFromPrivate=function(e,t){return n.fromPrivate(this,e,t)},a.prototype.keyFromPublic=function(e,t){return n.fromPublic(this,e,t)},a.prototype.genKeyPair=function(e){e||(e={});for(var t=new m.hmacDRBG({hash:this.hash,pers:e.pers,entropy:e.entropy||m.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new d(2));;){var n=new d(t.generate(r));if(!(0"}},{"../../elliptic":127,"bn.js":124}],136:[function(e,t,r){"use strict";var n=e("bn.js"),a=e("../../elliptic").utils,i=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16))}(t.exports=o).prototype._importDER=function(e,t){if((e=a.toArray(e,t)).length<6||48!==e[0]||2!==e[2])return!1;if(1+e[1]>e.length)return!1;var r=e[3];if(128<=r)return!1;if(4+r+2>=e.length)return!1;if(2!==e[4+r])return!1;var i=e[5+r];return!(128<=i)&&(!(4+r+2+i>e.length)&&(this.r=new n(e.slice(4,4+r)),this.s=new n(e.slice(4+r+2,4+r+2+i)),!0))},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r));var i=[48,t.length+r.length+4,2,t.length];return i=i.concat(t,[2,r.length],r),a.encode(i,e)}},{"../../elliptic":127,"bn.js":124}],137:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("../elliptic").utils,n=o.assert;function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc),r=o.toArray(e.nonce,e.nonceEnc),i=o.toArray(e.pers,e.persEnc);n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this.reseed=1},a.prototype.generate=function(e,t,r,i){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i),this._update(r));for(var n=[];n.length>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e},i.getNAF=function(e,t){for(var r=[],i=1<>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=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=n.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{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;for(a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>10),n[a-7],(r=n[a-15],b(r,7)^b(r,18)^r>>>3),n[a-16]);var o,s,c=this.h[0],u=this.h[1],f=this.h[2],p=this.h[3],h=this.h[4],l=this.h[5],d=this.h[6],m=this.h[7];F(this.k.length===n.length);for(a=0;a>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function s(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}function u(e,t){if(!e)throw new Error(t||"Assertion failed")}i.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},i.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,r){return e+t+r>>>0},i.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},i.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},i.assert=u,i.inherits=n,r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:148}],147:[function(e,t,r){t.exports={_args:[["elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib"]],_from:"elliptic@=3.0.3",_id:"elliptic@3.0.3",_inCache:!0,_location:"/bitcore-lib/elliptic",_phantomChildren:{inherits:"2.0.1"},_requested:{name:"elliptic",raw:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",rawSpec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",scope:null,spec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",type:"remote"},_requiredBy:["/bitcore-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_shasum:"865c9b420bfbe55006b9f969f97a0d2c44966595",_shrinkwrap:null,_spec:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_where:"/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^2.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},description:"EC cryptography",devDependencies:{browserify:"^3.44.2",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",optionalDependencies:{},readme:"# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic)\n\nFast elliptic-curve cryptography in a plain javascript implementation.\n\nNOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve\nfor your cryptography operations.\n\n## Incentive\n\nECC is much slower than regular RSA cryptography, the JS implementations are\neven more slower.\n\n## Benchmarks\n\n```bash\n$ node benchmarks/index.js\nBenchmarking: sign\nelliptic#sign x 262 ops/sec ±0.51% (177 runs sampled)\neccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled)\n------------------------\nFastest is elliptic#sign\n========================\nBenchmarking: verify\nelliptic#verify x 113 ops/sec ±0.50% (166 runs sampled)\neccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled)\n------------------------\nFastest is elliptic#verify\n========================\nBenchmarking: gen\nelliptic#gen x 294 ops/sec ±0.43% (176 runs sampled)\neccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled)\n------------------------\nFastest is elliptic#gen\n========================\nBenchmarking: ecdh\nelliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled)\n------------------------\nFastest is elliptic#ecdh\n========================\n```\n\n## API\n\n### ECDSA\n\n```javascript\nvar EC = require('elliptic').ec;\n\n// Create and initialize EC context\n// (better do it once and reuse it)\nvar ec = new EC('secp256k1');\n\n// Generate keys\nvar key = ec.genKeyPair();\n\n// Sign message (must be an array, or it'll be treated as a hex sequence)\nvar msg = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];\nvar signature = key.sign(msg);\n\n// Export DER encoded signature in Array\nvar derSign = signature.toDER();\n\n// Verify signature\nconsole.log(key.verify(msg, derSign));\n```\n\n### ECDH\n\n```javascript\n// Generate keys\nvar key1 = ec.genKeyPair();\nvar key2 = ec.genKeyPair();\n\nvar shared1 = key1.derive(key2.getPublic());\nvar shared2 = key2.derive(key1.getPublic());\n\nconsole.log('Both shared secrets are BN instances');\nconsole.log(shared1.toString(16));\nconsole.log(shared2.toString(16));\n```\n\nNOTE: `.derive()` returns a [BN][1] instance.\n\n## Supported curves\n\nElliptic.js support following curve types:\n\n* Short Weierstrass\n* Montgomery\n* Edwards\n* Twisted Edwards\n\nFollowing curve 'presets' are embedded into the library:\n\n* `secp256k1`\n* `p192`\n* `p224`\n* `p256`\n* `curve25519`\n* `ed25519`\n\nNOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead.\n\n### Implementation details\n\nECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of\nthe curve operations are performed on non-affine coordinates (either projective\nor extended), various windowing techniques are used for different cases.\n\nAll operations are performed in reduction context using [bn.js][1], hashing is\nprovided by [hash.js][2]\n\n### Related projects\n\n* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both\n browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for\n node)\n\n#### LICENSE\n\nThis software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2014.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://tools.ietf.org/html/rfc6979\n[1]: https://github.com/indutny/bn.js\n[2]: https://github.com/indutny/hash.js\n[3]: https://github.com/bitchan/eccrypto\n[4]: https://github.com/wanderer/secp256k1-node\n",readmeFilename:"README.md",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{test:"make lint && mocha --reporter=spec test/*-test.js"},version:"3.0.3"}},{}],148:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{dup:68}],149:[function(e,y,_){(function(b){(function(){var dn,e,t,mn="3.10.1",gn=1,vn=2,bn=4,yn=8,_n=16,wn=32,kn=64,xn=128,Sn=256,jn=30,En="...",An=150,In=16,Pn=200,On=1,Tn=2,Bn="Expected a function",Cn="__lodash_placeholder__",Fn="[object Arguments]",Rn="[object Array]",zn="[object Boolean]",Mn="[object Date]",Nn="[object Error]",Dn="[object Function]",r="[object Map]",qn="[object Number]",Ln="[object Object]",Un="[object RegExp]",i="[object Set]",Hn="[object String]",n="[object WeakMap]",Kn="[object ArrayBuffer]",Vn="[object Float32Array]",Gn="[object Float64Array]",$n="[object Int8Array]",Wn="[object Int16Array]",Zn="[object Int32Array]",Yn="[object Uint8Array]",Xn="[object Uint8ClampedArray]",Jn="[object Uint16Array]",Qn="[object Uint32Array]",ea=/\b__p \+= '';/g,ta=/\b(__p \+=) '' \+/g,ra=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ia=/&(?:amp|lt|gt|quot|#39|#96);/g,na=/[&<>"'`]/g,aa=RegExp(ia.source),oa=RegExp(na.source),sa=/<%-([\s\S]+?)%>/g,ca=/<%([\s\S]+?)%>/g,ua=/<%=([\s\S]+?)%>/g,fa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,pa=/^\w*$/,ha=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,la=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,da=RegExp(la.source),ma=/[\u0300-\u036f\ufe20-\ufe23]/g,ga=/\\(\\)?/g,va=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ba=/\w*$/,ya=/^0[xX]/,_a=/^\[object .+?Constructor\]$/,wa=/^\d+$/,ka=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xa=/($^)/,Sa=/['\n\r\u2028\u2029\\]/g,ja=(e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",t="[a-z\\xdf-\\xf6\\xf8-\\xff]+",RegExp(e+"+(?="+e+t+")|"+e+"?"+t+"|"+e+"+|[0-9]+","g")),Ea=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Aa=-1,Ia={};Ia[Vn]=Ia[Gn]=Ia[$n]=Ia[Wn]=Ia[Zn]=Ia[Yn]=Ia[Xn]=Ia[Jn]=Ia[Qn]=!0,Ia[Fn]=Ia[Rn]=Ia[Kn]=Ia[zn]=Ia[Mn]=Ia[Nn]=Ia[Dn]=Ia[r]=Ia[qn]=Ia[Ln]=Ia[Un]=Ia[i]=Ia[Hn]=Ia[n]=!1;var Pa={};Pa[Fn]=Pa[Rn]=Pa[Kn]=Pa[zn]=Pa[Mn]=Pa[Vn]=Pa[Gn]=Pa[$n]=Pa[Wn]=Pa[Zn]=Pa[qn]=Pa[Ln]=Pa[Un]=Pa[Hn]=Pa[Yn]=Pa[Xn]=Pa[Jn]=Pa[Qn]=!0,Pa[Nn]=Pa[Dn]=Pa[r]=Pa[i]=Pa[n]=!1;var a={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},o={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},s={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},c={function:!0,object:!0},u={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},f={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},p=c[void 0===_?"undefined":_typeof(_)]&&_&&!_.nodeType&&_,h=c[void 0===y?"undefined":_typeof(y)]&&y&&!y.nodeType&&y,l=p&&h&&"object"==(void 0===b?"undefined":_typeof(b))&&b&&b.Object&&b,d=c["undefined"==typeof self?"undefined":_typeof(self)]&&self&&self.Object&&self,m=c["undefined"==typeof window?"undefined":_typeof(window)]&&window&&window.Object&&window,g=h&&h.exports===p&&p,Oa=l||m!==(this&&this.window)&&m||d||this;function Ta(e,t){if(e!==t){var r=null===e,i=e===dn,n=e==e,a=null===t,o=t===dn,s=t==t;if(t>>1,$=9007199254740991,W=O&&new O,Z={};function Y(e){if(Ka(e)&&!ui(e)&&!(e instanceof Q)){if(e instanceof J)return e;if(_.call(e,"__chain__")&&_.call(e,"__wrapped__"))return Qt(e)}return new J(e)}function X(){}function J(e,t,r){this.__wrapped__=e,this.__actions__=r||[],this.__chain__=!!t}Y.support={};function Q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function ee(){this.__data__={}}function te(e){var t=e?e.length:0;for(this.data={hash:B(null),set:new j};t--;)this.push(e[t])}function re(e,t){var r=e.data;return("string"==typeof t||li(t)?r.set.has(t):r.hash[t])?0:-1}function ie(e,t){var r=-1,i=e.length;for(t||(t=P(i));++r=Pn?st(t):null,c=t.length;s&&(a=re,o=!1,t=s);e:for(;++n>>0,t>>>=0;for(var a=P(n);++i>>1,o=e[a];(r?o<=t:o=Pn)return n.plant(t).value();for(var r=0,i=a?o[r].apply(this,e):t;++r=An)return e}else Gt=0;return Ue(e,t)});function Zt(e){for(var t=Ri(e),r=t.length,i=r&&e.length,n=!!i&&Ut(i)&&(ui(e)||ci(e)),a=-1,o=[];++a>>0,r>>>=0;r=N(t,r)&&e=(e=Ra(e)).length)return e;var o=i-n.length;if(o<1)return n;var s=e.slice(0,o);if(null==a)return s+n;if(vi(a)){if(e.slice(o).search(a)){var c,u,f=e.slice(0,o);for(a.global||(a=b(a.source,(ba.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(f);)u=c.index;s=s.slice(0,null==u?o:u)}}else if(e.indexOf(a,o)!=o){var p=s.lastIndexOf(a);-1=0.13.7 <0.14.0",_id:"bitcore-lib@0.13.19",_inCache:!0,_installable:!0,_location:"/bitcore-lib",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/bitcore-lib-0.13.19.tgz_1470850061596_0.2146058666985482"},_npmUser:{email:"braydon@bitpay.com",name:"braydonf"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{name:"bitcore-lib",raw:"bitcore-lib@^0.13.7",rawSpec:"^0.13.7",scope:null,spec:">=0.13.7 <0.14.0",type:"range"},_requiredBy:["/","/bitcore-message"],_resolved:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz",_shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",_shrinkwrap:{dependencies:{"bn.js":{from:"bn.js@=2.0.4",resolved:"https://registry.npmjs.org/bn.js/-/bn.js-2.0.4.tgz",version:"2.0.4"},bs58:{from:"bs58@=2.0.0",resolved:"https://registry.npmjs.org/bs58/-/bs58-2.0.0.tgz",version:"2.0.0"},"buffer-compare":{from:"buffer-compare@=1.0.0",resolved:"https://registry.npmjs.org/buffer-compare/-/buffer-compare-1.0.0.tgz",version:"1.0.0"},elliptic:{dependencies:{brorand:{from:"brorand@^1.0.1",resolved:"https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz",version:"1.0.5"},"hash.js":{from:"hash.js@=1.0.3",resolved:"https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz",version:"1.0.3"}},from:"elliptic@=3.0.3",resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",version:"3.0.3"},inherits:{from:"inherits@=2.0.1",resolved:"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",version:"2.0.1"},lodash:{from:"lodash@=3.10.1",resolved:"https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",version:"3.10.1"}},name:"bitcore",version:"0.13.18"},_spec:"bitcore-lib@^0.13.7",_where:"/home/administrator/javascript-opentimestamps",author:{email:"dev@bitpay.com",name:"BitPay"},browser:{request:"browser-request"},bugs:{url:"https://github.com/bitpay/bitcore-lib/issues"},contributors:[{name:"Manuel Araoz",email:"manuelaraoz@gmail.com"},{name:"Daniel Cousens",email:"bitcoin@dcousens.com"},{name:"Gordon Hall",email:"gordon@bitpay.com"},{name:"Jeff Garzik",email:"jgarzik@bitpay.com"},{name:"Kyle Drake",email:"kyle@kyledrake.net"},{name:"Esteban Ordano",email:"eordano@gmail.com"},{name:"Matias Alejo Garcia",email:"ematiu@gmail.com"},{name:"Ryan X. Charles",email:"ryanxcharles@gmail.com"},{name:"Stefan Thomas",email:"moon@justmoon.net"},{name:"Stephen Pair",email:"stephen@bitpay.com"},{name:"Wei Lu",email:"luwei.here@gmail.com"}],dependencies:{"bn.js":"=2.0.4",bs58:"=2.0.0","buffer-compare":"=1.0.0",elliptic:"=3.0.3",inherits:"=2.0.1",lodash:"=3.10.1"},description:"A pure and powerful JavaScript Bitcoin library.",devDependencies:{"bitcore-build":"github:bitpay/bitcore-build",brfs:"^1.2.0",chai:"^1.10.0",gulp:"^3.8.10",sinon:"^1.13.0"},directories:{},dist:{shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",tarball:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz"},gitHead:"9517864f14d09700f3fd02ff61173003c0280774",homepage:"https://github.com/bitpay/bitcore-lib#readme",keywords:["address","bip21","bip32","bip37","bip69","bip70","bitcoin","blockchain","cryptocurrency","ecies","multisig","p2p","payment","transaction"],license:"MIT",main:"index.js",maintainers:[{name:"braydonf",email:"braydon@bitpay.com"},{name:"gabegattis",email:"gabegattis@gmail.com"},{name:"gasteve",email:"stephen@pairhome.net"},{name:"patrickbitpay",email:"patrick@bitpay.com"}],name:"bitcore-lib",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/bitpay/bitcore-lib.git"},scripts:{build:"gulp",coverage:"gulp coverage",lint:"gulp lint",test:"gulp test"},version:"0.13.19"}},{}],151:[function(e,t,r){var i=e("bitcore-lib");i.Message=e("./lib/message"),t.exports=i.Message},{"./lib/message":152,"bitcore-lib":78}],152:[function(r,d,e){(function(o){"use strict";var e=r("bitcore-lib"),s=e.deps._,i=e.PrivateKey,n=e.PublicKey,c=e.Address,a=e.encoding.BufferWriter,u=e.crypto.ECDSA,f=e.crypto.Signature,p=e.crypto.Hash.sha256sha256,t=e.util.js,h=e.util.preconditions,l=function e(t){return this instanceof e?(h.checkArgument(s.isString(t),"First argument should be a string"),this.message=t,this):new e(t)};l.MAGIC_BYTES=new o("Bitcoin Signed Message:\n"),l.prototype.magicHash=function(){var e=a.varintBufNum(l.MAGIC_BYTES.length),t=new o(this.message),r=a.varintBufNum(t.length),i=o.concat([e,l.MAGIC_BYTES,r,t]);return p(i)},l.prototype._sign=function(e){h.checkArgument(e instanceof i,"First argument should be an instance of PrivateKey");var t=this.magicHash(),r=new u;return r.hashbuf=t,r.privkey=e,r.pubkey=e.toPublicKey(),r.signRandomK(),r.calci(),r.sig},l.prototype.sign=function(e){return this._sign(e).toCompact().toString("base64")},l.prototype._verify=function(e,t){h.checkArgument(e instanceof n,"First argument should be an instance of PublicKey"),h.checkArgument(t instanceof f,"Second argument should be an instance of Signature");var r=this.magicHash(),i=u.verify(r,t,e);return i||(this.error="The signature was invalid"),i},l.prototype.verify=function(e,t){h.checkArgument(e),h.checkArgument(t&&s.isString(t)),s.isString(e)&&(e=c.fromString(e));var r=f.fromCompact(new o(t,"base64")),i=new u;i.hashbuf=this.magicHash(),i.sig=r;var n=i.toPublicKey(),a=c.fromPublicKey(n,e.network);return e.toString()!==a.toString()?!(this.error="The signature did not match the message digest"):this._verify(n,r)},l.fromString=function(e){return new l(e)},l.fromJSON=function(e){return t.isValidJSON(e)&&(e=JSON.parse(e)),new l(e.message)},l.prototype.toObject=function(){return{message:this.message}},l.prototype.toJSON=function(){return JSON.stringify(this.toObject())},l.prototype.toString=function(){return this.message},l.prototype.inspect=function(){return""},d.exports=l}).call(this,r("buffer").Buffer)},{"bitcore-lib":78,buffer:191}],153:[function(e,r,i){(function(Q,U,u){!function(e){if("object"==(void 0===i?"undefined":_typeof(i))&&void 0!==r)r.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:void 0!==U?t=U:"undefined"!=typeof self&&(t=self),t.Promise=e()}}(function(){var e,t,r;return function a(o,s,c){function u(r,e){if(!s[r]){if(!o[r]){var t="function"==typeof _dereq_&&_dereq_;if(!e&&t)return t(r,!0);if(f)return f(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[r]={exports:{}};o[r][0].call(n.exports,function(e){var t=o[r][1][e];return u(t||e)},n,n.exports,a,o,s,c)}return s[r].exports}for(var f="function"==typeof _dereq_&&_dereq_,e=0;e, no stack trace)"}function V(){return"function"==typeof Y}var G=function(){return!1},$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function W(e){var t=e.match($);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function Z(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);Y(this,Z),32=a)return r[t]=e,this._queue.push(t),!1;null!==n&&(n[t]=e);var o=this._promise,s=this._callback,c=o._boundValue();o._pushContext();var u=g(s).call(c,e,t,i),f=o._popContext();if(m.checkForgottenReturns(u,f,null!==n?"Promise.filter":"Promise.map",o),u===v)return this._reject(u.e),!0;var p=d(u,this._promise);if(p instanceof l){var h=(p=p._target())._bitField;if(0==(50397184&h))return 1<=a&&this._inFlight++,(r[t]=p)._proxy(this,-1*(t+1)),!1;if(0==(33554432&h))return 0!=(16777216&h)?this._reject(p._reason()):this._cancel(),!0;u=p._value()}r[t]=u}return i<=++this._totalResolved&&(null!==n?this._filter(r,n):this._resolve(r),!0)},f.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;0>>16)){if(e===this){var r=c();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,0<(65535&t)&&(0!=(134217728&t)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},E.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,d.isNode);0<(65535&t)?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},E.prototype._fulfillPromises=function(e,t){for(var r=1;r=this._length&&(this._resolve(this._values),!0)},t.prototype._promiseCancelled=function(){return this._cancel(),!0},t.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},t.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof s)e.cancel();else for(var t=0;t=this._length){var r;if(this._isMap)r=function(e){for(var t=new s,r=e.length/2|0,i=0;i>1},i.prototype.props=function(){return r(this)},i.props=function(e){return r(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function i(e){this._capacity=e,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},n.prototype._promiseFulfilled=function(e,t){var r=new i;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},n.prototype._promiseRejected=function(e,t){var r=new i;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},e.settle=function(e){return r.deprecated(".settle()",".reflect()"),new n(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(f,e,t){"use strict";e.exports=function(e,t,n){var r=f("./util"),i=f("./errors").RangeError,a=f("./errors").AggregateError,o=r.isArray,s={};function c(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function u(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new c(e),i=r.promise();return r.setHowMany(t),r.init(),i}r.inherits(c,t),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=o(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(e){this._howMany=e},c.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(s),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);else if("le"===r)for(n=i=0;i>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-a&4194303,26<=(a+=24)&&(a-=26,i++);r+6!==t&&(n=o(e,t,r+6),this.words[i]|=n<>>26-a&4194303),this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=67108863&o,c=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,p=67108863&c,h=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=h;l++){var d=u-l|0;f+=(o=(n=0|e.words[d])*(a=0|t.words[l])+p)/67108864|0,p=67108863&o}r.words[u]=0|p,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}v.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,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}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)&&2<=e&&e<=36){var c=l[e],u=d[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var p=f.modn(u).toString(e);r=(f=f.idivn(u)).isZero()?p+r:h[c-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.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]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},v.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)},v.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},v.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},v.prototype.inotn=function(e){g("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},v.prototype.notn=function(e){return this.clone().inotn(e)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);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,e):(r=e,this);for(var n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},v.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;i=0>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],d=8191&l,m=l>>>13,g=0|o[2],v=8191&g,b=g>>>13,y=0|o[3],_=8191&y,w=y>>>13,k=0|o[4],x=8191&k,S=k>>>13,j=0|o[5],E=8191&j,A=j>>>13,I=0|o[6],P=8191&I,O=I>>>13,T=0|o[7],B=8191&T,C=T>>>13,F=0|o[8],R=8191&F,z=F>>>13,M=0|o[9],N=8191&M,D=M>>>13,q=0|s[0],L=8191&q,U=q>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],$=8191&G,W=G>>>13,Z=0|s[3],Y=8191&Z,X=Z>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],ae=8191&ne,oe=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],pe=8191&fe,he=fe>>>13,le=0|s[9],de=8191&le,me=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(p,L))|0)+((8191&(n=(n=Math.imul(p,U))+Math.imul(h,L)|0))<<13)|0;u=((a=Math.imul(h,U))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,L),n=(n=Math.imul(d,U))+Math.imul(m,L)|0,a=Math.imul(m,U);var ve=(u+(i=i+Math.imul(p,K)|0)|0)+((8191&(n=(n=n+Math.imul(p,V)|0)+Math.imul(h,K)|0))<<13)|0;u=((a=a+Math.imul(h,V)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(b,L)|0,a=Math.imul(b,U),i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,V)|0;var be=(u+(i=i+Math.imul(p,$)|0)|0)+((8191&(n=(n=n+Math.imul(p,W)|0)+Math.imul(h,$)|0))<<13)|0;u=((a=a+Math.imul(h,W)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(_,L),n=(n=Math.imul(_,U))+Math.imul(w,L)|0,a=Math.imul(w,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,i=i+Math.imul(d,$)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,W)|0;var ye=(u+(i=i+Math.imul(p,Y)|0)|0)+((8191&(n=(n=n+Math.imul(p,X)|0)+Math.imul(h,Y)|0))<<13)|0;u=((a=a+Math.imul(h,X)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(x,L),n=(n=Math.imul(x,U))+Math.imul(S,L)|0,a=Math.imul(S,U),i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,W)|0,i=i+Math.imul(d,Y)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,X)|0;var _e=(u+(i=i+Math.imul(p,Q)|0)|0)+((8191&(n=(n=n+Math.imul(p,ee)|0)+Math.imul(h,Q)|0))<<13)|0;u=((a=a+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(A,L)|0,a=Math.imul(A,U),i=i+Math.imul(x,K)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,V)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,W)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(b,Y)|0,a=a+Math.imul(b,X)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0;var we=(u+(i=i+Math.imul(p,re)|0)|0)+((8191&(n=(n=n+Math.imul(p,ie)|0)+Math.imul(h,re)|0))<<13)|0;u=((a=a+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(O,L)|0,a=Math.imul(O,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,V)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,W)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,X)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0;var ke=(u+(i=i+Math.imul(p,ae)|0)|0)+((8191&(n=(n=n+Math.imul(p,oe)|0)+Math.imul(h,ae)|0))<<13)|0;u=((a=a+Math.imul(h,oe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(C,L)|0,a=Math.imul(C,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(O,K)|0,a=a+Math.imul(O,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,W)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(S,Y)|0,a=a+Math.imul(S,X)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ie)|0,i=i+Math.imul(d,ae)|0,n=(n=n+Math.imul(d,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var xe=(u+(i=i+Math.imul(p,ce)|0)|0)+((8191&(n=(n=n+Math.imul(p,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((a=a+Math.imul(h,ue)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(R,L),n=(n=Math.imul(R,U))+Math.imul(z,L)|0,a=Math.imul(z,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,W)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ie)|0,i=i+Math.imul(v,ae)|0,n=(n=n+Math.imul(v,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,i=i+Math.imul(d,ce)|0,n=(n=n+Math.imul(d,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0;var Se=(u+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,he)|0)+Math.imul(h,pe)|0))<<13)|0;u=((a=a+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,U))+Math.imul(D,L)|0,a=Math.imul(D,U),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(z,K)|0,a=a+Math.imul(z,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,W)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,Y)|0,a=a+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ie)|0,i=i+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,i=i+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,ue)|0,i=i+Math.imul(d,pe)|0,n=(n=n+Math.imul(d,he)|0)+Math.imul(m,pe)|0,a=a+Math.imul(m,he)|0;var je=(u+(i=i+Math.imul(p,de)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(h,de)|0))<<13)|0;u=((a=a+Math.imul(h,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(N,K),n=(n=Math.imul(N,V))+Math.imul(D,K)|0,a=Math.imul(D,V),i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,W)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,W)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(C,Y)|0,a=a+Math.imul(C,X)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ie)|0,i=i+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,ue)|0,i=i+Math.imul(v,pe)|0,n=(n=n+Math.imul(v,he)|0)+Math.imul(b,pe)|0,a=a+Math.imul(b,he)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;u=((a=a+Math.imul(m,me)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(N,$),n=(n=Math.imul(N,W))+Math.imul(D,$)|0,a=Math.imul(D,W),i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,X)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ie)|0,i=i+Math.imul(E,ae)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,i=i+Math.imul(x,ce)|0,n=(n=n+Math.imul(x,ue)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,ue)|0,i=i+Math.imul(_,pe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,pe)|0,a=a+Math.imul(w,he)|0;var Ae=(u+(i=i+Math.imul(v,de)|0)|0)+((8191&(n=(n=n+Math.imul(v,me)|0)+Math.imul(b,de)|0))<<13)|0;u=((a=a+Math.imul(b,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(N,Y),n=(n=Math.imul(N,X))+Math.imul(D,Y)|0,a=Math.imul(D,X),i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ie)|0,i=i+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,i=i+Math.imul(x,pe)|0,n=(n=n+Math.imul(x,he)|0)+Math.imul(S,pe)|0,a=a+Math.imul(S,he)|0;var Ie=(u+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,me)|0)+Math.imul(w,de)|0))<<13)|0;u=((a=a+Math.imul(w,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(N,Q),n=(n=Math.imul(N,ee))+Math.imul(D,Q)|0,a=Math.imul(D,ee),i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ie)|0,i=i+Math.imul(B,ae)|0,n=(n=n+Math.imul(B,oe)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,ue)|0,i=i+Math.imul(E,pe)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(A,pe)|0,a=a+Math.imul(A,he)|0;var Pe=(u+(i=i+Math.imul(x,de)|0)|0)+((8191&(n=(n=n+Math.imul(x,me)|0)+Math.imul(S,de)|0))<<13)|0;u=((a=a+Math.imul(S,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(N,re),n=(n=Math.imul(N,ie))+Math.imul(D,re)|0,a=Math.imul(D,ie),i=i+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,i=i+Math.imul(B,ce)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,ue)|0,i=i+Math.imul(P,pe)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(O,pe)|0,a=a+Math.imul(O,he)|0;var Oe=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(A,de)|0))<<13)|0;u=((a=a+Math.imul(A,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(N,ae),n=(n=Math.imul(N,oe))+Math.imul(D,ae)|0,a=Math.imul(D,oe),i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(z,ce)|0,a=a+Math.imul(z,ue)|0,i=i+Math.imul(B,pe)|0,n=(n=n+Math.imul(B,he)|0)+Math.imul(C,pe)|0,a=a+Math.imul(C,he)|0;var Te=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(O,de)|0))<<13)|0;u=((a=a+Math.imul(O,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(N,ce),n=(n=Math.imul(N,ue))+Math.imul(D,ce)|0,a=Math.imul(D,ue),i=i+Math.imul(R,pe)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(z,pe)|0,a=a+Math.imul(z,he)|0;var Be=(u+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,me)|0)+Math.imul(C,de)|0))<<13)|0;u=((a=a+Math.imul(C,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(N,pe),n=(n=Math.imul(N,he))+Math.imul(D,pe)|0,a=Math.imul(D,he);var Ce=(u+(i=i+Math.imul(R,de)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(z,de)|0))<<13)|0;u=((a=a+Math.imul(z,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Fe=(u+(i=Math.imul(N,de))|0)+((8191&(n=(n=Math.imul(N,me))+Math.imul(D,de)|0))<<13)|0;return u=((a=Math.imul(D,me))+(n>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,c[0]=ge,c[1]=ve,c[2]=be,c[3]=ye,c[4]=_e,c[5]=we,c[6]=ke,c[7]=xe,c[8]=Se,c[9]=je,c[10]=Ee,c[11]=Ae,c[12]=Ie,c[13]=Pe,c[14]=Oe,c[15]=Te,c[16]=Be,c[17]=Ce,c[18]=Fe,0!==u&&(c[19]=u,r.length++),r};function s(e,t,r){return(new c).mulp(e,t,r)}function c(e,t){this.x=e,this.y=t}Math.imul||(a=n),v.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?a(this,e,t):r<63?n(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,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},c.prototype.makeRBT=function(e){for(var t=new Array(e),r=v.prototype._countBits(e)-1,i=0;i>=1;return i},c.prototype.permute=function(e,t,r,i,n,a){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*a+1]=8191&n,n>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.muln=function(e){return this.clone().imuln(e)},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.imul(this.clone())},v.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 v(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<a)for(this.length-=a,c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},v.prototype.ishrn=function(e,t,r){return g(0===this.negative),this.iushrn(e,t,r)},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.ushln=function(e){return this.clone().iushln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.ushrn=function(e){return this.clone().iushrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===o)return this.strip();for(g(-1===o),i=o=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,a},v.prototype.div=function(e){return this.divmod(e,"div",!1).div},v.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},v.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},v.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),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(0===e.negative),g(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var c=r.clone(),u=t.clone();!t.isZero();){for(var f=0,p=1;0==(t.words[0]&p)&&f<26;++f,p<<=1);if(0>>26,o&=67108863,this.words[a]=o}return 0!==n&&(this.words[a]=n,this.length++),this},v.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},v.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(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(u[e])return u[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new b;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return u[e]=t},w.prototype._verify1=function(e){g(0===e.negative,"red works only with positives"),g(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){g(0==(e.negative|t.negative),"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},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 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&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();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);g(!i.isZero());var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==a?(a<<=1,a|=f,(4===++o||0===i&&0===u)&&(n=this.mul(n,r[a]),a=o=0)):o=0}s=26}return n},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},v.mont=function(e){return new k(e)},r(k,w),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.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),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new v(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:157}],155:[function(e,t,r){var A=e("concat-map"),I=e("balanced-match");t.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function t(e,r){var i=[];var n=I("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var s=a||o;var c=0<=n.body.indexOf(",");if(!s&&!c)return n.post.match(/,.*\}/)?(e=n.pre+"{"+n.body+P+n.post,t(e)):[e];var u;if(s)u=n.body.split(/\.\./);else if(1===(u=T(n.body)).length&&1===(u=t(u[0],!1).map(B)).length){var f=n.post.length?t(n.post,!1):[""];return f.map(function(e){return n.pre+u[0]+e})}var p=n.pre;var f=n.post.length?t(n.post,!1):[""];var h;if(s){var l=O(u[0]),d=O(u[1]),m=Math.max(u[0].length,u[1].length),g=3==u.length?Math.abs(O(u[2])):1,v=F,b=d>>24]^f[d>>>16&255]^p[m>>>8&255]^h[255&g]^t[v++],o=u[d>>>24]^f[m>>>16&255]^p[g>>>8&255]^h[255&l]^t[v++],s=u[m>>>24]^f[g>>>16&255]^p[l>>>8&255]^h[255&d]^t[v++],c=u[g>>>24]^f[l>>>16&255]^p[d>>>8&255]^h[255&m]^t[v++],l=a,d=o,m=s,g=c;return a=(i[l>>>24]<<24|i[d>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[v++],o=(i[d>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&l])^t[v++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[l>>>8&255]<<8|i[255&d])^t[v++],c=(i[g>>>24]<<24|i[l>>>16&255]<<16|i[d>>>8&255]<<8|i[255&m])^t[v++],[a>>>=0,o>>>=0,s>>>=0,c>>>=0]}var p=[0,1,2,4,8,16,32,64,128,27,54],h=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=[[],[],[],[]],a=[[],[],[],[]],o=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;var f=e[i[r[o]=u]=o],p=e[f],h=e[p],l=257*e[u]^16843008*u;n[0][o]=l<<24|l>>>8,n[1][o]=l<<16|l>>>16,n[2][o]=l<<8|l>>>24,n[3][o]=l,l=16843009*h^65537*p^257*f^16843008*o,a[0][u]=l<<24|l>>>8,a[1][u]=l<<16|l>>>16,a[2][u]=l<<8|l>>>24,a[3][u]=l,0===o?o=s=1:(o=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();function s(e){this._key=a(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],a=0;a>>24,o=h.SBOX[o>>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o],o^=p[a/t|0]<<24):6>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o]),n[a]=n[a-t]^o}for(var s=[],c=0;c>>24]]^h.INV_SUB_MIX[1][h.SBOX[f>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[f>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return o(e=a(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=a(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":447}],159:[function(e,t,r){var o=e("./aes"),u=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),f=e("./ghash"),n=e("buffer-xor"),p=e("./incr32");function a(e,t,r,i){s.call(this);var n=u.alloc(4,0);this._cipher=new o.AES(t);var a=this._cipher.encryptBlock(n);this._ghash=new f(a),r=function(e,t,r){if(12===t.length)return e._finID=u.concat([t,u.from([0,0,0,1])]),u.concat([t,u.from([0,0,0,2])]);var i=new f(r),n=t.length,a=n%16;i.update(t),a&&(a=16-a,i.update(u.alloc(a,0))),i.update(u.alloc(8,0));var o=8*n,s=u.alloc(8);s.writeUIntBE(o,0,8),i.update(s),e._finID=i.state;var c=u.from(e._finID);return p(c),c}(this,r,a),this._prev=u.from(r),this._cache=u.allocUnsafe(0),this._secCache=u.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(a,s),a.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=u.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},a.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(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;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":447}],164:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],165:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":190}],166:[function(e,t,r){var a=e("safe-buffer").Buffer,o=e("buffer-xor");function s(e,t,r){var i=t.length,n=o(t,e._cache);return e._cache=e._cache.slice(i),e._prev=a.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=a.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=a.allocUnsafe(0)),!(e._cache.length<=t.length)){n=a.concat([n,s(e,t,r)]);break}i=e._cache.length,n=a.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":190,"safe-buffer":447}],167:[function(e,t,r){var o=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,a=-1,o=0;++a<8;)i=t&1<<7-a?128:0,o+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>a%8,e._prev=c(e._prev,r?i:n);return o}function c(e,t){var r=e.length,i=-1,n=o.allocUnsafe(e.length);for(e=o.concat([e,o.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=o.allocUnsafe(i),a=-1;++a=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var a=m(r);if("ec"===a.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=g[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new d(i),a=r.data.subjectPrivateKey.data;return n.verify(t,e,a)}(e,t,a)}if("dsa"===a.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,a=r.data.g,o=r.data.pub_key,s=m.signature.decode(e,"der"),c=s.s,u=s.r;v(c,n),v(u,n);var f=l.mont(i),p=c.invm(n);return 0===a.toRed(f).redPow(new l(t).mul(p).mod(n)).fromRed().mul(o.toRed(f).redPow(u.mul(p).mod(n)).fromRed()).mod(i).mod(n).cmp(u)}(e,t,a)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var o=a.modulus.byteLength(),s=[1],c=0;t.length+s.length+2l.UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function h(e,t){for(var r=0;rm.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsm.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelm.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelm.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=m.Z_FILTERED&&e.strategy!=m.Z_HUFFMAN_ONLY&&e.strategy!=m.Z_RLE&&e.strategy!=m.Z_FIXED&&e.strategy!=m.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!g.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new o.Zlib(t);var i=this;this._hadError=!1,this._binding.onerror=function(e,t){i._binding=null,i._hadError=!0;var r=new Error(e);r.errno=t,r.code=m.codes[t],i.emit("error",r)};var r=m.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(r=e.level);var n=m.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(n=e.strategy),this._binding.init(e.windowBits||m.Z_DEFAULT_WINDOWBITS,r,e.memLevel||m.Z_DEFAULT_MEMLEVEL,n,e.dictionary),this._buffer=new g(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=n,this.once("end",this.close)}o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION,Object.keys(o).forEach(function(e){e.match(/^Z/)&&(m[e]=o[e])}),m.codes={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},Object.keys(m.codes).forEach(function(e){m.codes[m.codes[e]]=e}),m.Deflate=s,m.Inflate=c,m.Gzip=u,m.Gunzip=f,m.DeflateRaw=p,m.InflateRaw=h,m.Unzip=l,m.createDeflate=function(e){return new s(e)},m.createInflate=function(e){return new c(e)},m.createDeflateRaw=function(e){return new p(e)},m.createInflateRaw=function(e){return new h(e)},m.createGzip=function(e){return new u(e)},m.createGunzip=function(e){return new f(e)},m.createUnzip=function(e){return new l(e)},m.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new s(t),e,r)},m.deflateSync=function(e,t){return r(new s(t),e)},m.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new u(t),e,r)},m.gzipSync=function(e,t){return r(new u(t),e)},m.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new p(t),e,r)},m.deflateRawSync=function(e,t){return r(new p(t),e)},m.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new l(t),e,r)},m.unzipSync=function(e,t){return r(new l(t),e)},m.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new c(t),e,r)},m.inflateSync=function(e,t){return r(new c(t),e)},m.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new f(t),e,r)},m.gunzipSync=function(e,t){return r(new f(t),e)},m.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new h(t),e,r)},m.inflateRawSync=function(e,t){return r(new h(t),e)},e.inherits(t,a),t.prototype.params=function(e,t,r){if(em.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=m.Z_FILTERED&&t!=m.Z_HUFFMAN_ONLY&&t!=m.Z_RLE&&t!=m.Z_FIXED&&t!=m.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var i=this;this.flush(o.Z_SYNC_FLUSH,function(){i._binding.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())})}else n.nextTick(r)},t.prototype.reset=function(){return this._binding.reset()},t.prototype._flush=function(e){this._transform(new g(0),"",e)},t.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=o.Z_FULL_FLUSH),r.ended)t&&n.nextTick(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var i=this;this.once("drain",function(){i.flush(t)})}else this._flushFlag=e,this.write(new g(0),"",t)},t.prototype.close=function(e){if(e&&n.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;n.nextTick(function(){t.emit("close")})}},t.prototype._transform=function(e,t,r){var i,n=this._writableState,a=(n.ending||n.ended)&&(!e||n.length===e.length);if(null===!e&&!g.isBuffer(e))return r(new Error("invalid input"));a?i=o.Z_FINISH:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH));this._processChunk(e,i,r)},t.prototype._processChunk=function(a,o,s){var c=a&&a.length,u=this._chunkSize-this._offset,f=0,p=this,h="function"==typeof s;if(!h){var t,l=[],d=0;this.on("error",function(e){t=e});do{var e=this._binding.writeSync(o,a,f,c,this._buffer,this._offset,u)}while(!this._hadError&&m(e[0],e[1]));if(this._hadError)throw t;var r=g.concat(l,d);return this.close(),r}var i=this._binding.write(o,a,f,c,this._buffer,this._offset,u);function m(e,t){if(!p._hadError){var r=u-t;if(v(0<=r,"have should not go down"),0=p._chunkSize)&&(u=p._chunkSize,p._offset=0,p._buffer=new g(p._chunkSize)),0===t){if(f+=c-e,c=e,!h)return!0;var n=p._binding.write(o,a,f,c,p._buffer,p._offset,p._chunkSize);return n.callback=m,void(n.buffer=a)}if(!h)return!1;s()}}i.buffer=a,i.callback=m},e.inherits(s,t),e.inherits(c,t),e.inherits(u,t),e.inherits(f,t),e.inherits(p,t),e.inherits(h,t),e.inherits(l,t)}).call(this,d("_process"),d("buffer").Buffer)},{"./binding":185,_process:382,_stream_transform:427,assert:67,buffer:191,util:505}],187:[function(e,t,r){arguments[4][157][0].apply(r,arguments)},{dup:157}],188:[function(e,B,C){(function(T){!function(e){var t="object"==(void 0===C?"undefined":_typeof(C))&&C&&!C.nodeType&&C,r="object"==(void 0===B?"undefined":_typeof(B))&&B&&!B.nodeType&&B,i="object"==(void 0===T?"undefined":_typeof(T))&&T;i.global!==i&&i.window!==i&&i.self!==i||(e=i);var n,a,v=2147483647,b=36,y=1,_=26,o=38,s=700,w=72,k=128,x="-",c=/^xn--/,u=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=b-y,S=Math.floor,j=String.fromCharCode;function E(e){throw new RangeError(p[e])}function l(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function d(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((v-d)/o))&&E("overflow"),d+=c*o,!(c<(u=s<=g?y:g+_<=s?_:s-g));s+=b)o>S(v/(f=b-u))&&E("overflow"),o*=f;g=O(d-a,t=h.length+1,0==a),S(d/t)>v-m&&E("overflow"),m+=S(d/t),d%=t,h.splice(d++,0,m)}return I(h)}function g(e){var t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g=[];for(h=(e=A(e)).length,t=k,a=w,o=r=0;oS((v-r)/(l=i+1))&&E("overflow"),r+=(s-t)*l,t=s,o=0;ov&&E("overflow"),p==t){for(c=r,u=b;!(c<(f=u<=a?y:a+_<=u?_:u-a));u+=b)m=c-f,d=b-f,g.push(j(P(f+m%d,0))),c=S(m/d);g.push(j(P(c,0))),a=O(r,l,i==n),r=0,++i}++r,++t}return g.join("")}if(n={version:"1.4.1",ucs2:{decode:A,encode:I},decode:m,encode:g,toASCII:function(e){return d(e,function(e){return u.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return d(e,function(e){return c.test(e)?m(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",function(){return n});else if(t&&r)if(B.exports==t)r.exports=n;else for(a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],189:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var a=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=c;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function c(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}a.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},a.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:191}],190:[function(e,t,r){(function(a){t.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new a(r),n=0;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function l(e,t){if(p.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return R(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=p.from(t,i)),p.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,n);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,n){var a,o=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;s/=o=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var f=-1;for(a=r;a>>10&1023|55296),f=56320|1023&f),i.push(f),n+=p}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;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 S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===p.compare(this,e)},p.prototype.inspect=function(){var e="",t=N.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,i,n){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(i,n),u=e.slice(t,r),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a,o,s,c,u,f,p,h,l,d=!1;;)switch(i){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return h=t,l=r,M(R(e,(p=this).length-h),p,h,l);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return c=this,u=t,f=r,M(z(e),c,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=t,s=r,M(function(e,t){for(var r,i,n,a=[],o=0;o>8,n=r%256,a.push(n),a.push(i);return a}(e,(a=this).length-o),a,o,s);default:if(d)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function k(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function I(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function P(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function O(e,t,r,i,n,a){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(e,t,r,i,n){return n||O(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function B(e,t,r,i,n){return n||O(e,0,r,8),a.write(e,t,r,i,52,8),r+8}p.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):I(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;0<=--a&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function z(e){return i.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function M(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":75,ieee754:318,isarray:323}],192:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],193:[function(e,t,r){function n(e){this.dict=e||{}}n.prototype.set=function(e,t,r){if("object"!==(void 0===e?"undefined":_typeof(e))){void 0===r&&(r=!0);var i=this.has(e);return!r&&i?this.dict[i]=this.dict[i]+","+t:this.dict[i||e]=t,i}for(var n in e)this.set(n,e[n],t)},n.prototype.has=function(e){for(var t=Object.keys(this.dict),r=(e=e.toLowerCase(),0);rr)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>8^255&n^99,u[r]=n;var a=e[f[n]=r],o=e[a],s=e[o],c=257*e[n]^16843008*n;p[r]=c<<24|c>>>8,h[r]=c<<16|c>>>16,l[r]=c<<8|c>>>24,d[r]=c;c=16843009*s^65537*o^257*a^16843008*r;m[n]=c<<24|c>>>8,g[n]=c<<16|c>>>16,v[n]=c<<8|c>>>24,b[n]=c,r?(r=a^e[e[e[s^a]]],i^=e[e[i]]):r=i=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],i=r.AES=t.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),n=this._keySchedule=[],a=0;a>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o]):(o=u[(o=o<<8|o>>>24)>>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o],o^=y[a/r|0]<<24),n[a]=n[a-r]^o}for(var s=this._invKeySchedule=[],c=0;c>>24]]^g[u[o>>>16&255]]^v[u[o>>>8&255]]^b[u[255&o]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,p,h,l,d,u)},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,m,g,v,b,f);r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,a,o,s){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],p=e[t+2]^r[2],h=e[t+3]^r[3],l=4,d=1;d>>24]^n[f>>>16&255]^a[p>>>8&255]^o[255&h]^r[l++],g=i[f>>>24]^n[p>>>16&255]^a[h>>>8&255]^o[255&u]^r[l++],v=i[p>>>24]^n[h>>>16&255]^a[u>>>8&255]^o[255&f]^r[l++],b=i[h>>>24]^n[u>>>16&255]^a[f>>>8&255]^o[255&p]^r[l++];u=m,f=g,p=v,h=b}m=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&h])^r[l++],g=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[h>>>8&255]<<8|s[255&u])^r[l++],v=(s[p>>>24]<<24|s[h>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^r[l++],b=(s[h>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^r[l++];e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=b},keySize:8});e.AES=t._createHelper(i)}(),n.AES},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],206:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,c,n,a,o,s,u,f,p,h,l,d,m,g,v,b;e.lib.Cipher||(r=(t=e).lib,i=r.Base,c=r.WordArray,n=r.BufferedBlockAlgorithm,(a=t.enc).Utf8,o=a.Base64,s=t.algo.EvpKDF,u=r.Cipher=n.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function n(e){return"string"==typeof e?b:g}return function(i){return{encrypt:function(e,t,r){return n(t).encrypt(i,e,t,r)},decrypt:function(e,t,r){return n(t).decrypt(i,e,t,r)}}}}()}),r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),f=t.mode={},p=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var e=p.extend();function a(e,t,r){var i=this._iv;if(i){var n=i;this._iv=void 0}else n=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:l}),reset:function(){u.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else{i=r.createDecryptor;this._minBufferSize=1}this._mode=i.call(r,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),d=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var i=c.create([1398893684,1701076831]).concat(r).concat(t);else i=t;return i.toString(o)},parse:function(e){var t=o.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var i=c.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return d.create({ciphertext:t,salt:i})}},g=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),a=n.finalize(t),o=n.cfg;return d.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.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}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=c.random(8));var n=s.create({keySize:t+r}).compute(e,i),a=c.create(n.words.slice(t),4*r);return n.sigBytes=4*t,d.create({key:n,iv:a,salt:i})}},b=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),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 a=g.encrypt.call(this,e,t,n.key,i);return a.mixIn(n),a},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,g.decrypt.call(this,e,t,n.key,i)}}))},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],207:[function(e,t,r){var i,n;i=this,n=function(){var f,r,e,t,i,p,n,a,o,s,c,u,h=h||(f=Math,r=Object.create||function(){function r(){}return function(e){var t;return r.prototype=e,t=new r,r.prototype=null,t}}(),t=(e={}).lib={},i=t.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$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)}},p=t.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).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 a=0;a>>2]>>>24-a%4*8&255;t[i+a>>>2]|=o<<24-(i+a)%4*8}else for(a=0;a>>2]=r[a>>>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=f.ceil(t/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,r=[],i=function(t){t=t;var r=987654321,i=4294967295;return function(){var e=((r=36969*(65535&r)+(r>>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return e/=4294967296,(e+=.5)*(.5>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).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 p.init(r,t/2)}},o=n.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(a))}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 p.init(r,t)}},s=n.Utf8={stringify:function(e){try{return decodeURIComponent(escape(o.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return o.parse(unescape(encodeURIComponent(e)))}},c=t.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=s.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,n=this.blockSize,a=i/(4*n),o=(a=e?f.ceil(a):f.max((0|a)-this._minBufferSize,0))*n,s=f.min(4*o,i);if(o){for(var c=0;c>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.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,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var n=0;n>>6-a%4*2;i[n>>>2]|=(o|s)<<24-n%4*8,n++}return c.create(i,n)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],209:[function(e,t,r){var i,n;i=this,n=function(r){return function(){var e=r,n=e.lib.WordArray,t=e.enc;t.Utf16=t.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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}};function o(e){return e<<8&4278255360|e>>>8&16711935}t.Utf16LE={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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return n.create(r,2*t)}}}(),r.enc.Utf16},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],210:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,f,n,a,o;return r=(t=e).lib,i=r.Base,f=r.WordArray,n=t.algo,a=n.MD5,o=n.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=r.hasher.create(),n=f.create(),a=n.words,o=r.keySize,s=r.iterations;a.lengthi&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),a=this._iKey=t.clone(),o=n.words,s=a.words,c=0;c>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)}).prototype=e}}(),t.lib.WordArray},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],215:[function(e,t,r){var i,n;i=this,n=function(o){return function(f){var e=o,t=e.lib,r=t.WordArray,i=t.Hasher,n=e.algo,E=[];!function(){for(var e=0;e<64;e++)E[e]=4294967296*f.abs(f.sin(e+1))|0}();var a=n.MD5=i.extend({_doReset:function(){this._hash=new r.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 a=this._hash.words,o=e[t+0],s=e[t+1],c=e[t+2],u=e[t+3],f=e[t+4],p=e[t+5],h=e[t+6],l=e[t+7],d=e[t+8],m=e[t+9],g=e[t+10],v=e[t+11],b=e[t+12],y=e[t+13],_=e[t+14],w=e[t+15],k=a[0],x=a[1],S=a[2],j=a[3];x=O(x=O(x=O(x=O(x=P(x=P(x=P(x=P(x=I(x=I(x=I(x=I(x=A(x=A(x=A(x=A(x,S=A(S,j=A(j,k=A(k,x,S,j,o,7,E[0]),x,S,s,12,E[1]),k,x,c,17,E[2]),j,k,u,22,E[3]),S=A(S,j=A(j,k=A(k,x,S,j,f,7,E[4]),x,S,p,12,E[5]),k,x,h,17,E[6]),j,k,l,22,E[7]),S=A(S,j=A(j,k=A(k,x,S,j,d,7,E[8]),x,S,m,12,E[9]),k,x,g,17,E[10]),j,k,v,22,E[11]),S=A(S,j=A(j,k=A(k,x,S,j,b,7,E[12]),x,S,y,12,E[13]),k,x,_,17,E[14]),j,k,w,22,E[15]),S=I(S,j=I(j,k=I(k,x,S,j,s,5,E[16]),x,S,h,9,E[17]),k,x,v,14,E[18]),j,k,o,20,E[19]),S=I(S,j=I(j,k=I(k,x,S,j,p,5,E[20]),x,S,g,9,E[21]),k,x,w,14,E[22]),j,k,f,20,E[23]),S=I(S,j=I(j,k=I(k,x,S,j,m,5,E[24]),x,S,_,9,E[25]),k,x,u,14,E[26]),j,k,d,20,E[27]),S=I(S,j=I(j,k=I(k,x,S,j,y,5,E[28]),x,S,c,9,E[29]),k,x,l,14,E[30]),j,k,b,20,E[31]),S=P(S,j=P(j,k=P(k,x,S,j,p,4,E[32]),x,S,d,11,E[33]),k,x,v,16,E[34]),j,k,_,23,E[35]),S=P(S,j=P(j,k=P(k,x,S,j,s,4,E[36]),x,S,f,11,E[37]),k,x,l,16,E[38]),j,k,g,23,E[39]),S=P(S,j=P(j,k=P(k,x,S,j,y,4,E[40]),x,S,o,11,E[41]),k,x,u,16,E[42]),j,k,h,23,E[43]),S=P(S,j=P(j,k=P(k,x,S,j,m,4,E[44]),x,S,b,11,E[45]),k,x,w,16,E[46]),j,k,c,23,E[47]),S=O(S,j=O(j,k=O(k,x,S,j,o,6,E[48]),x,S,l,10,E[49]),k,x,_,15,E[50]),j,k,p,21,E[51]),S=O(S,j=O(j,k=O(k,x,S,j,b,6,E[52]),x,S,u,10,E[53]),k,x,g,15,E[54]),j,k,s,21,E[55]),S=O(S,j=O(j,k=O(k,x,S,j,d,6,E[56]),x,S,w,10,E[57]),k,x,h,15,E[58]),j,k,y,21,E[59]),S=O(S,j=O(j,k=O(k,x,S,j,f,6,E[60]),x,S,v,10,E[61]),k,x,c,15,E[62]),j,k,m,21,E[63]),a[0]=a[0]+k|0,a[1]=a[1]+x|0,a[2]=a[2]+S|0,a[3]=a[3]+j|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var n=f.floor(r/4294967296),a=r;t[15+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,s=o.words,c=0;c<4;c++){var u=s[c];s[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function A(e,t,r,i,n,a,o){var s=e+(t&r|~t&i)+n+o;return(s<>>32-a)+t}function I(e,t,r,i,n,a,o){var s=e+(t&i|r&~i)+n+o;return(s<>>32-a)+t}function P(e,t,r,i,n,a,o){var s=e+(t^r^i)+n+o;return(s<>>32-a)+t}function O(e,t,r,i,n,a,o){var s=e+(r^(t|~i))+n+o;return(s<>>32-a)+t}e.MD5=i._createHelper(a),e.HmacMD5=i._createHmacHelper(a)}(Math),o.MD5},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],216:[function(e,t,r){var i,n;i=this,n=function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function a(e,t,r,i){var n=this._iv;if(n){var a=n.slice(0);this._iv=void 0}else a=this._prevBlock;i.encryptBlock(a,0);for(var o=0;o>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 t=e.Encryptor=e.extend({processBlock:function(e,t){var r,i=this._cipher,n=i.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),0===((r=o)[0]=u(r[0]))&&(r[1]=u(r[1]));var s=o.slice(0);i.encryptBlock(s,0);for(var c=0;c>>2]|=n<<24-a%4*8,e.sigBytes+=n},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],222:[function(e,t,r){var i,n;i=this,n=function(n){return n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],223:[function(e,t,r){var i,n;i=this,n=function(r){return r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],224:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],225:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],226:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,v,n,a,b,o;return r=(t=e).lib,i=r.Base,v=r.WordArray,n=t.algo,a=n.SHA1,b=n.HMAC,o=n.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=b.create(r.hasher,e),n=v.create(),a=v.create([1]),o=n.words,s=a.words,c=r.keySize,u=r.iterations;o.length>>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]],n=this._b=0;n<4;n++)h.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;i[0]^=c,i[1]^=f,i[2]^=u,i[3]^=p,i[4]^=c,i[5]^=f,i[6]^=u,i[7]^=p;for(n=0;n<4;n++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.RabbitLegacy=t._createHelper(i)}(),a.RabbitLegacy},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],228:[function(e,t,r){var i,n;i=this,n=function(a){return function(){var e=a,t=e.lib.StreamCipher,r=e.algo,n=[],c=[],u=[],i=r.Rabbit=t.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(r=this._b=0;r<4;r++)h.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;n[0]^=c,n[1]^=f,n[2]^=u,n[3]^=p,n[4]^=c,n[5]^=f,n[6]^=u,n[7]^=p;for(r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.Rabbit=t._createHelper(i)}(),a.Rabbit},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],229:[function(e,t,r){var i,n;i=this,n=function(o){return function(){var e=o,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.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 a=0;n<256;n++){var o=n%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+i[n]+s)%256;var c=i[n];i[n]=i[a],i[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=n.call(this)},keySize:8,ivSize:0});function n(){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 a=e[t];e[t]=e[r],e[r]=a,i|=e[(e[t]+e[r])%256]<<24-8*n}return this._i=t,this._j=r,i}e.RC4=t._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;0>>24)|4278255360&(n<<24|n>>>8)}var a,o,s,c,u,f,p,h,l,d,m,g=this._hash.words,v=A.words,b=I.words,y=x.words,_=S.words,w=j.words,k=E.words;f=a=g[0],p=o=g[1],h=s=g[2],l=c=g[3],d=u=g[4];for(r=0;r<80;r+=1)m=a+e[t+y[r]]|0,m+=r<16?P(o,s,c)+v[0]:r<32?O(o,s,c)+v[1]:r<48?T(o,s,c)+v[2]:r<64?B(o,s,c)+v[3]:C(o,s,c)+v[4],m=(m=F(m|=0,w[r]))+u|0,a=u,u=c,c=F(s,10),s=o,o=m,m=f+e[t+_[r]]|0,m+=r<16?C(p,h,l)+b[0]:r<32?B(p,h,l)+b[1]:r<48?T(p,h,l)+b[2]:r<64?O(p,h,l)+b[3]:P(p,h,l)+b[4],m=(m=F(m|=0,k[r]))+d|0,f=d,d=l,l=F(h,10),h=p,p=m;m=g[1]+s+l|0,g[1]=g[2]+c+d|0,g[2]=g[3]+u+f|0,g[3]=g[4]+a+p|0,g[4]=g[0]+o+h|0,g[0]=m},_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,a=n.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function P(e,t,r){return e^t^r}function O(e,t,r){return e&t|~e&r}function T(e,t,r){return(e|~t)^r}function B(e,t,r){return e&r|t&~r}function C(e,t,r){return e^(t|~r)}function F(e,t){return e<>>32-t}t.RIPEMD160=n._createHelper(o),t.HmacRIPEMD160=n._createHmacHelper(o)}(Math),s.RIPEMD160},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],231:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,p,o;return r=(t=e).lib,i=r.WordArray,n=r.Hasher,a=t.algo,p=[],o=a.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],a=r[2],o=r[3],s=r[4],c=0;c<80;c++){if(c<16)p[c]=0|e[t+c];else{var u=p[c-3]^p[c-8]^p[c-14]^p[c-16];p[c]=u<<1|u>>>31}var f=(i<<5|i>>>27)+s+p[c];f+=c<20?1518500249+(n&a|~n&o):c<40?1859775393+(n^a^o):c<60?(n&a|n&o|a&o)-1894007588:(n^a^o)-899497514,s=o,o=a,a=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|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(o),t.HmacSHA1=n._createHmacHelper(o),e.SHA1},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],232:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a;return r=(t=e).lib.WordArray,i=t.algo,n=i.SHA256,a=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(a),t.HmacSHA224=n._createHmacHelper(a),e.SHA224},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],n):n(i.CryptoJS)},{"./core":207,"./sha256":233}],233:[function(e,t,r){var i,n;i=this,n=function(c){return function(n){var e=c,t=e.lib,r=t.WordArray,i=t.Hasher,a=e.algo,o=[],y=[];!function(){function e(e){for(var t=n.sqrt(e),r=2;r<=t;r++)if(!(e%r))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(o[i]=t(n.pow(r,.5))),y[i]=t(n.pow(r,1/3)),i++),r++}();var _=[],s=a.SHA256=i.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=0;p<64;p++){if(p<16)_[p]=0|e[t+p];else{var h=_[p-15],l=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,d=_[p-2],m=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;_[p]=l+_[p-7]+m+_[p-16]}var g=i&n^i&a^n&a,v=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&u)+y[p]+_[p];f=u,u=c,c=s,s=o+b|0,o=a,a=n,n=i,i=b+(v+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+u|0,r[7]=r[7]+f|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)]=n.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA256=i._createHelper(s),e.HmacSHA256=i._createHmacHelper(s)}(Math),c.SHA256},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],234:[function(e,t,r){var i,n;i=this,n=function(a){return function(h){var e=a,t=e.lib,l=t.WordArray,i=t.Hasher,f=e.x64.Word,r=e.algo,P=[],O=[],T=[];!function(){for(var e=1,t=0,r=0;r<24;r++){P[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++)O[e+5*t]=t+(2*e+3*t)%5*5;for(var n=1,a=0;a<24;a++){for(var o=0,s=0,c=0;c<7;c++){if(1&n){var u=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(S=r[n]).high^=o,S.low^=a}for(var s=0;s<24;s++){for(var c=0;c<5;c++){for(var u=0,f=0,p=0;p<5;p++){u^=(S=r[c+5*p]).high,f^=S.low}var h=B[c];h.high=u,h.low=f}for(c=0;c<5;c++){var l=B[(c+4)%5],d=B[(c+1)%5],m=d.high,g=d.low;for(u=l.high^(m<<1|g>>>31),f=l.low^(g<<1|m>>>31),p=0;p<5;p++){(S=r[c+5*p]).high^=u,S.low^=f}}for(var v=1;v<25;v++){var b=(S=r[v]).high,y=S.low,_=P[v];if(_<32)u=b<<_|y>>>32-_,f=y<<_|b>>>32-_;else u=y<<_-32|b>>>64-_,f=b<<_-32|y>>>64-_;var w=B[O[v]];w.high=u,w.low=f}var k=B[0],x=r[0];k.high=x.high,k.low=x.low;for(c=0;c<5;c++)for(p=0;p<5;p++){var S=r[v=c+5*p],j=B[v],E=B[(c+1)%5+5*p],A=B[(c+2)%5+5*p];S.high=j.high^~E.high&A.high,S.low=j.low^~E.low&A.low}S=r[0];var I=T[s];S.high^=I.high,S.low^=I.low}},_doFinalize:function(){var e=this._data,t=e.words,r=(this._nDataBytes,8*e.sigBytes),i=32*this.blockSize;t[r>>>5]|=1<<24-r%32,t[(h.ceil((r+1)/i)*i>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();for(var n=this._state,a=this.cfg.outputLength/8,o=a/8,s=[],c=0;c>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),s.push(p),s.push(f)}return new l.init(s,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});e.SHA3=i._createHelper(n),e.HmacSHA3=i._createHmacHelper(n)}(Math),a.SHA3},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],235:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,o,s;return r=(t=e).x64,i=r.Word,n=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.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=o._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s),e.SHA384},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core"),e("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],n):n(i.CryptoJS)},{"./core":207,"./sha512":236,"./x64-core":238}],236:[function(e,t,r){var i,n;i=this,n=function(c){return function(){var e=c,t=e.lib.Hasher,r=e.x64,i=r.Word,n=r.WordArray,a=e.algo;function o(){return i.create.apply(i,arguments)}var xe=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],Se=[];!function(){for(var e=0;e<80;e++)Se[e]=o()}();var s=a.SHA512=t.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=i.high,h=i.low,l=n.high,d=n.low,m=a.high,g=a.low,v=o.high,b=o.low,y=s.high,_=s.low,w=c.high,k=c.low,x=u.high,S=u.low,j=f.high,E=f.low,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=w,N=k,D=x,q=S,L=j,U=E,H=0;H<80;H++){var K=Se[H];if(H<16)var V=K.high=0|e[t+2*H],G=K.low=0|e[t+2*H+1];else{var $=Se[H-15],W=$.high,Z=$.low,Y=(W>>>1|Z<<31)^(W>>>8|Z<<24)^W>>>7,X=(Z>>>1|W<<31)^(Z>>>8|W<<24)^(Z>>>7|W<<25),J=Se[H-2],Q=J.high,ee=J.low,te=(Q>>>19|ee<<13)^(Q<<3|ee>>>29)^Q>>>6,re=(ee>>>19|Q<<13)^(ee<<3|Q>>>29)^(ee>>>6|Q<<26),ie=Se[H-7],ne=ie.high,ae=ie.low,oe=Se[H-16],se=oe.high,ce=oe.low;V=(V=(V=Y+ne+((G=X+ae)>>>0>>0?1:0))+te+((G=G+re)>>>0>>0?1:0))+se+((G=G+ce)>>>0>>0?1:0);K.high=V,K.low=G}var ue,fe=R&M^~R&D,pe=z&N^~z&q,he=A&P^A&T^P&T,le=I&O^I&B^O&B,de=(A>>>28|I<<4)^(A<<30|I>>>2)^(A<<25|I>>>7),me=(I>>>28|A<<4)^(I<<30|A>>>2)^(I<<25|A>>>7),ge=(R>>>14|z<<18)^(R>>>18|z<<14)^(R<<23|z>>>9),ve=(z>>>14|R<<18)^(z>>>18|R<<14)^(z<<23|R>>>9),be=xe[H],ye=be.high,_e=be.low,we=L+ge+((ue=U+ve)>>>0>>0?1:0),ke=me+le;L=D,U=q,D=M,q=N,M=R,N=z,R=C+(we=(we=(we=we+fe+((ue=ue+pe)>>>0>>0?1:0))+ye+((ue=ue+_e)>>>0<_e>>>0?1:0))+V+((ue=ue+G)>>>0>>0?1:0))+((z=F+ue|0)>>>0>>0?1:0)|0,C=T,F=B,T=P,B=O,P=A,O=I,A=we+(de+he+(ke>>>0>>0?1:0))+((I=ue+ke|0)>>>0>>0?1:0)|0}h=i.low=h+I,i.high=p+A+(h>>>0>>0?1:0),d=n.low=d+O,n.high=l+P+(d>>>0>>0?1:0),g=a.low=g+B,a.high=m+T+(g>>>0>>0?1:0),b=o.low=b+F,o.high=v+C+(b>>>0>>0?1:0),_=s.low=_+z,s.high=y+R+(_>>>0>>0?1:0),k=c.low=k+N,c.high=w+M+(k>>>0>>0?1:0),S=u.low=S+q,u.high=x+D+(S>>>0>>0?1:0),E=f.low=E+U,f.high=j+L+(E>>>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=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(s),e.HmacSHA512=t._createHmacHelper(s)}(),c.SHA512},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],237:[function(e,t,r){var i,n;i=this,n=function(s){return function(){var e=s,t=e.lib,r=t.WordArray,i=t.BlockCipher,n=e.algo,u=[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],f=[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],p=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],a=n.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var i=u[r]-1;t[r]=e[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var o=n[a]=[],s=p[a];for(r=0;r<24;r++)o[r/6|0]|=t[(f[r]-1+s)%28]<<31-r%6,o[4+(r/6|0)]|=t[28+(f[r+24]-1+s)%28]<<31-r%6;o[0]=o[0]<<1|o[0]>>>31;for(r=1;r<7;r++)o[r]=o[r]>>>4*(r-1)+3;o[7]=o[7]<<5|o[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[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],d.call(this,4,252645135),d.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),d.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=h[c][((o^n[c])&l[c])>>>0];this._lBlock=o,this._rBlock=a^s}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,d.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(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<>>1];r=h.r28shl(r,a),i=h.r28shl(i,a),h.pc2(r,i,e.keys,n)}},c.prototype._update=function(e,t,r,i){var n=this._desState,a=h.readUInt32BE(e,t),o=h.readUInt32BE(e,t+4);h.ip(a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,o,n.tmp,0):this._decrypt(n,a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],h.writeUInt32BE(r,a,i),h.writeUInt32BE(r,o,i+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,a=p}h.rip(o,a,i,n)},c.prototype._decrypt=function(e,t,r,i,n){for(var a=r,o=t,s=e.keys.length-2;0<=s;s-=2){var c=e.keys[s],u=e.keys[s+1];h.expand(a,e.tmp,0),c^=e.tmp[0],u^=e.tmp[1];var f=h.substitute(c,u),p=a;a=(o^h.permute(f))>>>0,o=p}h.rip(a,o,i,n)}},{"../des":240,inherits:320,"minimalistic-assert":353}],244:[function(e,t,r){"use strict";var a=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),o=n.Cipher,s=n.DES;function c(e,t){a.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new c(this.type,this.options.key);this._edeState=t}i(u,o),(t.exports=u).create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":240,inherits:320,"minimalistic-assert":353}],245:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.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},r.ip=function(e,t,r,i){for(var n=0,a=0,o=6;0<=o;o-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+o&1}for(o=6;0<=o;o-=2){for(s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1;for(s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1}r[i+0]=n>>>0,r[i+1]=a>>>0},r.rip=function(e,t,r,i){for(var n=0,a=0,o=0;o<4;o++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+o&1,n<<=1,n|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;0<=s;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.pc1=function(e,t,r,i){for(var n=0,a=0,o=7;5<=o;o--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.r28shl=function(e,t){return e<>>28-t};var c=[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];r.pc2=function(e,t,r,i){for(var n=0,a=0,o=c.length>>>1,s=0;s>>c[s]&1;for(s=o;s>>c[s]&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var a=23;15<=a;a-=4)i<<=6,i|=e>>>a&63;for(a=11;3<=a;a-=4)n|=e>>>a&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[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];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[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];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(c),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;r.mod(p).cmp(h);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(i=r.shrn(1))&&g(r)&&v(i)&&v(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":154,"miller-rabin":349,randombytes:414}],249:[function(e,t,r){t.exports={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"}}},{}],250:[function(e,t,r){var u=e("crypto"),f=e("jsbn").BigInteger,p=(e("./lib/ec.js").ECPointFp,e("safer-buffer").Buffer);function h(e,t){return e.length>=t?e:h("0"+e,t)}r.ECCurves=e("./lib/sec.js"),r.ECKey=function(e,t,r){var i,n=e(),a=n.getN(),o=Math.floor(a.bitLength()/8);if(t)if(r){e=n.getCurve();this.P=e.decodePointHex(t.toString("hex"))}else{if(t.length!=o)return!1;i=new f(t.toString("hex"),16)}else{var s=a.subtract(f.ONE),c=new f(u.randomBytes(a.bitLength()));i=c.mod(s).add(f.ONE),this.P=n.getG().multiply(i)}this.P&&(this.PublicKey=p.from(n.getCurve().encodeCompressedPointHex(this.P),"hex")),i&&(this.PrivateKey=p.from(h(i.toString(16),2*o),"hex"),this.deriveSharedSecret=function(e){if(!e||!e.P)return!1;var t=e.P.multiply(i);return p.from(h(t.getX().toBigInteger().toString(16),2*o),"hex")})}},{"./lib/ec.js":251,"./lib/sec.js":252,crypto:204,jsbn:325,"safer-buffer":448}],251:[function(e,t,r){var l=e("jsbn").BigInteger,i=l.prototype.Barrett;function f(e,t){this.x=t,this.q=e}function d(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=null==i?l.ONE:i,this.zinv=null}function n(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new d(this,null,null),this.reducer=new i(this.q)}f.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},f.prototype.toBigInteger=function(){return this.x},f.prototype.negate=function(){return new f(this.q,this.x.negate().mod(this.q))},f.prototype.add=function(e){return new f(this.q,this.x.add(e.toBigInteger()).mod(this.q))},f.prototype.subtract=function(e){return new f(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},f.prototype.multiply=function(e){return new f(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},f.prototype.square=function(){return new f(this.q,this.x.square().mod(this.q))},f.prototype.divide=function(e){return new f(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},d.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO))},d.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(l.ZERO)&&!this.y.toBigInteger().equals(l.ZERO)},d.prototype.negate=function(){return new d(this.curve,this.x,this.y.negate(),this.z)},d.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(l.ZERO.equals(r))return l.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new l("3"),n=this.x.toBigInteger(),a=this.y.toBigInteger(),o=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),s=o.multiply(r),c=n.multiply(o),u=t.square().multiply(this.z),f=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(s).multiply(r).mod(this.curve.q),p=c.multiply(i).multiply(t).subtract(a.multiply(s)).subtract(u.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),h=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(p),h)},d.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new l("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),n=i.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),o=t.square().multiply(e);l.ZERO.equals(a)||(o=o.add(this.z.square().multiply(a)));var s=(o=o.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(i).mod(this.curve.q),c=o.multiply(e).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(o.square().multiply(o)).mod(this.curve.q),u=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(c),u)},d.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new l("3")),n=this.negate(),a=this;for(t=i.bitLength()-2;0r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var n=this.curve.getInfinity(),a=this.add(t);0<=i;)n=n.twice(),e.testBit(i)?n=r.testBit(i)?n.add(a):n.add(this):r.testBit(i)&&(n=n.add(t)),--i;return n},n.prototype.getQ=function(){return this.q},n.prototype.getA=function(){return this.a},n.prototype.getB=function(){return this.b},n.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},n.prototype.getInfinity=function(){return this.infinity},n.prototype.fromBigInteger=function(e){return new f(this.q,e)},n.prototype.reduce=function(e){this.reducer.reduce(e)},n.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;t.lengtht+1;){var r=e.shiftRight(t),i=e.subtract(r.shiftLeft(t));this.getR().equals(l.ONE)||(r=r.multiply(this.getR())),e=r.add(i)}for(;0<=e.compareTo(q);)e=e.subtract(q)}else e=e.mod(q);return e},f.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var e=new f(this.q,this.x.modPow(this.q.shiftRight(2).add(l.ONE),this.q));return e.square().equals(this)?e:null}var t=this.q.subtract(l.ONE),r=t.shiftRight(1);if(!this.x.modPow(r,this.q).equals(l.ONE))return null;var i,n,a=t.shiftRight(2).shiftLeft(1).add(l.ONE),o=this.x,s=modDouble(modDouble(o));do{for(var c;0<=(c=new l(this.q.bitLength(),new SecureRandom)).compareTo(this.q)||!c.multiply(c).subtract(s).modPow(r,this.q).equals(t););var u=this.lucasSequence(c,o,a);if(i=u[0],n=u[1],this.modMult(n,n).equals(s))return n.testBit(0)&&(n=n.add(q)),n=n.shiftRight(1),new f(q,n)}while(i.equals(l.ONE)||i.equals(t));return null},f.prototype.lucasSequence=function(e,t,r){for(var i=r.bitLength(),n=r.getLowestSetBit(),a=l.ONE,o=l.TWO,s=e,c=l.ONE,u=l.ONE,f=i-1;n+1<=f;--f)c=this.modMult(c,u),r.testBit(f)?(u=this.modMult(c,t),a=this.modMult(a,s),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1)))):(u=c,a=this.modReduce(a.multiply(o).subtract(c)),s=this.modReduce(s.multiply(o).subtract(e.multiply(c))),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))));c=this.modMult(c,u),u=this.modMult(c,t),a=this.modReduce(a.multiply(o).subtract(c)),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),c=this.modMult(c,u);for(f=1;f<=n;++f)a=this.modMult(a,o),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))),c=this.modMult(c,c);return[a,o]};r={ECCurveFp:n,ECPointFp:d,ECFieldElementFp:f};t.exports=r},{jsbn:325}],252:[function(e,t,r){var o=e("jsbn").BigInteger,s=e("./ec.js").ECCurveFp;function c(e,t,r,i){this.curve=e,this.g=t,this.n=r,this.h=i}function u(e){return new o(e,16)}function i(){var e=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),r=u("E87579C11079F43DD824993C2CEE5ED3"),i=u("FFFFFFFE0000000075A30D1B9038A115"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83"),i,n)}function n(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=o.ZERO,r=u("7"),i=u("0100000000000000000001B8FA16DFAB9ACA16B6B3"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE"),i,n)}function a(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),r=u("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),i=u("0100000000000000000001F4C8F927AED3CA752257"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32"),i,n)}function f(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=o.ZERO,r=u("3"),i=u("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"),i,n)}function p(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),r=u("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),i=u("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811"),i,n)}function h(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),r=u("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),i=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"),i,n)}function l(){var e=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),r=u("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),i=u("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),i,n)}c.prototype.getCurve=function(){return this.curve},c.prototype.getG=function(){return this.g},c.prototype.getN=function(){return this.n},c.prototype.getH=function(){return this.h},t.exports={secp128r1:i,secp160k1:n,secp160r1:a,secp192k1:f,secp192r1:p,secp224r1:h,secp256r1:l}},{"./ec.js":251,jsbn:325}],253:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":268,"./elliptic/curve":256,"./elliptic/curves":259,"./elliptic/ec":260,"./elliptic/eddsa":263,"./elliptic/utils":267,brorand:156}],254:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,j=n.getNAF,E=n.getJSF,p=n.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i,n){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,c=0,u=0;u>1]:S<0&&(x=o[g][-S-1>>1].neg()),y="affine"===x.type?y.mixedAdd(x):y.add(x))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},o.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.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),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],256:[function(e,t,r){arguments[4][130][0].apply(r,arguments)},{"./base":254,"./edwards":255,"./mont":257,"./short":258,dup:130}],257:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base,s=e("../../elliptic").utils;function c(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(c,o),(t.exports=c).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)},a(u,o.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},c.prototype.point=function(e,t){return new u(this,e,t)},c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.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)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},u.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 a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],258:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new w(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)},c.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)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],259:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":253,"./precomputed/secp256k1":266,"hash.js":299}],260:[function(e,t,r){"use strict";var g=e("bn.js"),v=e("hmac-drbg"),a=e("../../elliptic"),l=a.utils.assert,i=e("./key"),b=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(l(a.curves.hasOwnProperty(e),"Unknown curve "+e),e=a.curves[e]),e instanceof a.curves.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}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new v({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new g(2));;){var n=new g(t.generate(r));if(!(0>1;if(0<=o.cmp(this.curve.p.umod(this.curve.n))&&u)throw new Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var f=t.r.invm(n),p=n.sub(a).mul(f).umod(n),h=s.mul(f).umod(n);return this.g.mulAdd(p,o,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new b(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":253,"./key":261,"./signature":262,"bn.js":154,"hmac-drbg":311}],261:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=a).fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},{"../../elliptic":253,"bn.js":154}],262:[function(e,t,r){"use strict";var s=e("bn.js"),c=e("../../elliptic").utils,i=c.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=c.toArray(e,t);var r=new u;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=f(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=f(e,r);if(e.length!==a+r.place)return!1;var o=e.slice(r.place,a+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===o[0]&&128&o[1]&&(o=o.slice(1)),this.r=new s(n),this.s=new s(o),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];p(i,t.length),(i=i.concat(t)).push(2),p(i,r.length);var n=i.concat(r),a=[48];return p(a,n.length),a=a.concat(n),c.encode(a,e)}},{"../../elliptic":253,"bn.js":154}],263:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),a=n.utils,o=a.assert,c=a.parseBytes,s=e("./key"),u=e("./signature");function f(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=f).prototype.sign=function(e,t){e=c(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),a=this.encodePoint(n),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:a})},f.prototype.verify=function(e,t,r){e=c(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(a)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=6.0.0 <7.0.0",_id:"elliptic@6.4.1",_inCache:!0,_installable:!0,_location:"/elliptic",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/elliptic_6.4.1_1533787091502_0.6309761823717674"},_npmUser:{email:"fedor@indutny.com",name:"indutny"},_npmVersion:"6.3.0",_phantomChildren:{},_requested:{name:"elliptic",raw:"elliptic@^6.0.0",rawSpec:"^6.0.0",scope:null,spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/home/administrator/javascript-opentimestamps/node_modules/browserify-sign",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{fileCount:17,integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJba7vUCRA9TVsSAnZWagAA+gcP/jWaj5GmDZ0YFi/X4g5O\nx+pxu9i3HbP9YqywT7rz3XFXSaytu0LQDeDEbddl523X69tsbKfzHRTcnW8n\n2r0VjPhttRm+0RpEhBwjSIK34VkQA1xIWh2ugOToKXVCFVLM5VFDPGzbiN6x\n/hpL7gj1hoCRVmuhjnqFQ+vPKACKfv1Eq4CsRmu2focmP37kQpWQlweD/z4V\nJF4NxA33Fvp13Fl+9g4sPHyhUVsW9ojVaG3Ijn70pCaGQM18UPlbODkWQ1QX\nAgteOFjkIOtcalJk3B3qsM8GZeHEcAFvt2T73miJkHdCGNmRQS45Ede+gnj0\nlLlZJsCCKUHtTqrlprHo6AgMnBZufmytyozYAHC1/JYniazSBi2yPHtQeniR\nl69BfiRBdD2rNrMPwmCNRkMqrgel5WMGpaD0xdaFAHF1Ru2ZQFKsA7KvPGgp\nA20+LN11cCib67Pg5XDyrZ92T3yXec+6gQ3iq9d9UBZKFGl0P8ebVqq1LrUJ\na6nekwMpRISWnKcqV72XVmQdBmUWHq9VfVLsWJzVIJqtpHmUO7q74ACP3i4W\n0/F1REeI0YEhh3NjeStdDecfjlu7PY0pLQpbk2I3ms+6DO+cAfeDEev5jFBK\nwQabRNhITeT1FVtxZAcApj33fnCdqwaWr1NS00K5ZRqhDTTzPr/O4KRN4CR1\npstU\r\n=UVBB\r\n-----END PGP SIGNATURE-----\r\n",shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",unpackedSize:118371},files:["lib"],gitHead:"523da1cf71ddcfd607fbdee1858bc2af47f0e700",homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.1"}},{}],269:[function(e,t,r){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function c(e){return"function"==typeof e}function u(e){return"object"===(void 0===e?"undefined":_typeof(e))&&null!==e}function f(e){return void 0===e}((t.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},i.prototype.emit=function(e){var t,r,i,n,a,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(f(r=this._events[e]))return!1;if(c(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=Array.prototype.slice.call(arguments,1),r.apply(this,n)}else if(u(r))for(n=Array.prototype.slice.call(arguments,1),i=(o=r.slice()).length,a=0;ar&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!c(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,a;if(!c(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||c(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(r)){for(a=n;0=this._blockSize;){for(var n=this._blockOffset;n=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=n.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,a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":310}],310:[function(e,t,r){"use strict";var u=e("minimalistic-assert"),i=e("inherits");function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function o(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}r.inherits=i,r.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:320,"minimalistic-assert":353}],311:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),i=o.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length1e3*t.clockSkew)throw new E("clock skew of "+g/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach(function(e){if(u.params.headers.indexOf(e.toLowerCase())<0)throw new P(e+" was not a signed header")}),t.algorithms&&-1===t.algorithms.indexOf(u.params.algorithm))throw new I(u.params.algorithm+" is not a supported algorithm");return u.algorithm=u.params.algorithm.toUpperCase(),u.keyId=u.params.keyId,u}}},{"./utils":315,"assert-plus":66,util:505}],314:[function(n,a,e){(function(l){var d=n("assert-plus"),m=n("crypto"),e=(n("http"),n("util")),g=n("sshpk"),v=n("jsprim"),t=n("./utils"),b=n("util").format,y=t.HASH_ALGOS,_=t.PK_ALGOS,w=t.InvalidAlgorithmError,r=t.HttpSignatureError,k=t.validateAlgorithm,x='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';function S(e){r.call(this,e,S)}function j(e){r.call(this,e,j)}function i(e){d.object(e,"options");var t=[];if(void 0!==e.algorithm&&(d.string(e.algorithm,"options.algorithm"),t=k(e.algorithm)),this.rs_alg=t,void 0!==e.sign)d.func(e.sign,"options.sign"),this.rs_signFunc=e.sign;else if("hmac"===t[0]&&void 0!==e.key){if(d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,"string"!=typeof e.key&&!l.isBuffer(e.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=m.createHmac(t[1].toUpperCase(),e.key),this.rs_signer.sign=function(){var e=this.digest("base64");return{hashAlgorithm:t[1],toString:function(){return e}}}}else{if(void 0===e.key)throw new TypeError("options.sign (func) or options.key is required");var r=e.key;if(("string"==typeof r||l.isBuffer(r))&&(r=g.parsePrivateKey(r)),d.ok(g.PrivateKey.isPrivateKey(r,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=r,d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,!_[r.type])throw new w(r.type.toUpperCase()+" type keys are not supported");if(void 0!==t[0]&&r.type!==t[0])throw new w("options.key must be a "+t[0].toUpperCase()+" key, was given a "+r.type.toUpperCase()+" key instead");this.rs_signer=r.createSign(t[1])}this.rs_headers=[],this.rs_lines=[]}e.inherits(S,r),e.inherits(j,r),i.prototype.writeHeader=function(e,t){if(d.string(e,"header"),e=e.toLowerCase(),d.string(t,"value"),this.rs_headers.push(e),this.rs_signFunc)this.rs_lines.push(e+": "+t);else{var r=e+": "+t;0>1,f=-7,p=r?n-1:0,h=r?-1:1,l=e[t+p];for(p+=h,a=l&(1<<-f)-1,l>>=-f,f+=s;0>=-f,f+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:a-1,d=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),2<=(t+=1<=o+p?h/c:h*Math.pow(2,1-p))*c&&(o++,c/=2),f<=o+p?(s=0,o=f):1<=o+p?(s=(t*c-1)*Math.pow(2,n),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,n),o=0));8<=n;e[r+l]=255&s,l+=d,s/=256,n-=8);for(o=o<>15;0<=--a;){var c=32767&this[e],u=this[e++]>>15,f=s*c+u*o;n=((c=o*c+((32767&f)<<15)+r[i]+(1073741823&n))>>>30)+(f>>>15)+s*u+(n>>>30),r[i++]=1073741823&c}return n},30):t&&"Netscape"!=navigator.appName?(y.prototype.am=function(e,t,r,i,n,a){for(;0<=--a;){var o=t*this[e++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},26):(y.prototype.am=function(e,t,r,i,n,a){for(var o=16383&t,s=t>>14;0<=--a;){var c=16383&this[e],u=this[e++]>>14,f=s*c+u*o;n=((c=o*c+((16383&f)<<14)+r[i]+n)>>28)+(f>>14)+s*u,r[i++]=268435455&c}return n},28),y.prototype.DB=e,y.prototype.DM=(1<>>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 v(e){this.m=e}function b(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 l(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function d(){}function m(e){return e}function k(e){this.r2=_(),this.q3=_(),y.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},b.prototype.convert=function(e){var t=_();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&0>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),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},b.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.copyTo=function(e){for(var t=this.t-1;0<=t;--t)e[t]=this[t];e.t=this.t,e.s=this.s},y.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0this.DB?(this[this.t-1]|=(o&(1<>this.DB-a):this[this.t-1]|=o<=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,0>n|s,s=(this[r]&a)<=this.t)t.t=0;else{var i=e%this.DB,n=this.DB-i,a=(1<>i;for(var o=r+1;o>i;0>=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:0=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}0>this.F2:0),h=this.FV/p,l=(1<>s)&&(n=!0,a=c(r));0<=o;)s>(s+=this.DB-t)):(r=this[o]>>(s-=t)&i,s<=0&&(s+=this.DB,--o)),02*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=_();return e.copyTo(t),this.reduce(t),t},k.prototype.revert=function(e){return e},k.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);0<=e.compareTo(this.m);)e.subTo(this.m,e)},k.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},k.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x,S,j,E=[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],A=(1<<26)/E[E.length-1];function I(){var e;e=(new Date).getTime(),S[j++]^=255&e,S[j++]^=e>>8&255,S[j++]^=e>>16&255,S[j++]^=e>>24&255,R<=j&&(j-=R)}if(y.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},y.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||36=r&&(this.dMultiply(i),this.dAddOffset(o,0),o=a=0))}0e&&this.subTo(y.ONE.shiftLeft(e-1),this);else{var i=new Array,n=7&e;i.length=1+(e>>3),t.nextBytes(i),0>=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,0=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},y.prototype.multiplyLowerTo=function(e,t,r){var i,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;0>1)>E.length&&(e=E.length);for(var n=_(),a=0;a>24},y.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},y.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},y.prototype.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(0>i)!=(this.s&this.DM)>>i&&(t[n++]=r|this.s<>(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,(0=this.t?0!=this.s:0!=(this[t]&1<>n-c&u:(p=(e[l]&(1<>this.DB+n-c)),s=r;0==(1&p);)p>>=1,--s;if((n-=s)<0&&(n+=this.DB,--l),d)o[p].copyTo(a),d=!1;else{for(;1>>8,S[j++]=255&P;j=0,I()}function B(){if(null==x){for(I(),(x=new F).init(S),j=0;jt.maxItems&&n("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&m.concat(function(e,t,r,i){if("object"==(void 0===t?"undefined":_typeof(t)))for(var n in("object"!=(void 0===e?"undefined":_typeof(e))||e instanceof Array)&&m.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(n)){var a=e[n];if(void 0===a&&h.existingOnly)continue;var o=t[n];void 0===a&&o.default&&(a=e[n]=o.default),h.coerce&&n in e&&(a=e[n]=h.coerce(a,o)),g(a,o,r,n)}for(n in e){if(e.hasOwnProperty(n)&&("_"!=n.charAt(0)||"_"!=n.charAt(1))&&t&&!t[n]&&!1===i){if(h.filter){delete e[n];continue}m.push({property:r,message:(void 0===a?"undefined":_typeof(a))+"The property "+n+" is not defined in the schema and the schema does not allow additional properties"})}var s=t&&t[n]&&t[n].requires;!s||s in e||m.push({property:r,message:"the presence of the property "+n+" requires that "+s+" also be present"}),a=e[n],!i||t&&"object"==(void 0===t?"undefined":_typeof(t))&&n in t||(h.coerce&&(a=e[n]=h.coerce(a,i)),g(a,i,r,n)),!l&&a&&a.$schema&&(m=m.concat(g(a,a.$schema,r,n)))}return m}(e,t.properties,o,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&n("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&n("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.lengthe&&n("must have a minimum value of "+t.minimum),void 0!==_typeof(t.maximum)&&(void 0===e?"undefined":_typeof(e))==_typeof(t.maximum)&&t.maximum= 2"),d.ok(n.base<=36,"options.base <= 36"),d.bool(n.allowSign,"options.allowSign"),d.bool(n.allowPrefix,"options.allowPrefix"),d.bool(n.allowTrailing,"options.allowTrailing"),d.bool(n.allowImprecise,"options.allowImprecise"),d.bool(n.trimWhitespace,"options.trimWhitespace"),d.bool(n.leadingZeroIsOctal,"options.leadingZeroIsOctal"),n.leadingZeroIsOctal&&d.ok(!i,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var a,o=-1,s=n.base,c=1,u=0,f=0,p=e.length;if(n.trimWhitespace)for(;ft[0]||e[0]==t[0]&&e[1]>=t[1],"negative differences not allowed");var r=[e[0]-t[0],0];return e[1]>=t[1]?r[1]=e[1]-t[1]:(r[0]--,r[1]=1e9-(t[1]-e[1])),r}function R(e,t){return C(e),C(t),e[1]+=t[1],1e9<=e[1]&&(e[0]++,e[1]-=1e9),e[0]+=t[0],e}function z(e,t,r){var i,n;if(i={},r)for(n in r)i[n]=r[n];if(e)for(n in e)i[n]=e[n];if(t)for(n in t)i[n]=t[n];return i}},{"assert-plus":66,extsprintf:272,"json-schema":327,util:505,verror:509}],330:[function(e,t,r){"use strict";t.exports=e("./lib/api")(e("./lib/keccak"))},{"./lib/api":331,"./lib/keccak":335}],331:[function(e,t,r){"use strict";var n=e("./keccak"),a=e("./shake");t.exports=function(e){var r=n(e),i=a(e);return function(e,t){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new r(1152,448,null,224,t);case"keccak256":return new r(1088,512,null,256,t);case"keccak384":return new r(832,768,null,384,t);case"keccak512":return new r(576,1024,null,512,t);case"sha3-224":return new r(1152,448,6,224,t);case"sha3-256":return new r(1088,512,6,256,t);case"sha3-384":return new r(832,768,6,384,t);case"sha3-512":return new r(576,1024,6,512,t);case"shake128":return new i(1344,256,31,t);case"shake256":return new i(1088,512,31,t);default:throw new Error("Invald algorithm: "+e)}}}},{"./keccak":332,"./shake":333}],332:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,o=e("stream").Transform,n=e("inherits");t.exports=function(a){function t(e,t,r,i,n){o.call(this,n),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._hashBitLength=i,this._options=n,this._state=new a,this._state.initialize(e,t),this._finalized=!1}return n(t,o),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],333:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("stream").Transform,o=e("inherits");t.exports=function(n){function t(e,t,r,i){a.call(this,i),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._options=i,this._state=new n,this._state.initialize(e,t),this._finalized=!1}return o(t,a),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],334:[function(e,t,r){"use strict";var ot=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];r.p1600=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],n=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],h=f^(n<<1|a>>>31),l=p^(a<<1|n>>>31),d=e[0]^h,m=e[1]^l,g=e[10]^h,v=e[11]^l,b=e[20]^h,y=e[21]^l,_=e[30]^h,w=e[31]^l,k=e[40]^h,x=e[41]^l;h=r^(o<<1|s>>>31),l=i^(s<<1|o>>>31);var S=e[2]^h,j=e[3]^l,E=e[12]^h,A=e[13]^l,I=e[22]^h,P=e[23]^l,O=e[32]^h,T=e[33]^l,B=e[42]^h,C=e[43]^l;h=n^(c<<1|u>>>31),l=a^(u<<1|c>>>31);var F=e[4]^h,R=e[5]^l,z=e[14]^h,M=e[15]^l,N=e[24]^h,D=e[25]^l,q=e[34]^h,L=e[35]^l,U=e[44]^h,H=e[45]^l;h=o^(f<<1|p>>>31),l=s^(p<<1|f>>>31);var K=e[6]^h,V=e[7]^l,G=e[16]^h,$=e[17]^l,W=e[26]^h,Z=e[27]^l,Y=e[36]^h,X=e[37]^l,J=e[46]^h,Q=e[47]^l;h=c^(r<<1|i>>>31),l=u^(i<<1|r>>>31);var ee=e[8]^h,te=e[9]^l,re=e[18]^h,ie=e[19]^l,ne=e[28]^h,ae=e[29]^l,oe=e[38]^h,se=e[39]^l,ce=e[48]^h,ue=e[49]^l,fe=d,pe=m,he=v<<4|g>>>28,le=g<<4|v>>>28,de=b<<3|y>>>29,me=y<<3|b>>>29,ge=w<<9|_>>>23,ve=_<<9|w>>>23,be=k<<18|x>>>14,ye=x<<18|k>>>14,_e=S<<1|j>>>31,we=j<<1|S>>>31,ke=A<<12|E>>>20,xe=E<<12|A>>>20,Se=I<<10|P>>>22,je=P<<10|I>>>22,Ee=T<<13|O>>>19,Ae=O<<13|T>>>19,Ie=B<<2|C>>>30,Pe=C<<2|B>>>30,Oe=R<<30|F>>>2,Te=F<<30|R>>>2,Be=z<<6|M>>>26,Ce=M<<6|z>>>26,Fe=D<<11|N>>>21,Re=N<<11|D>>>21,ze=q<<15|L>>>17,Me=L<<15|q>>>17,Ne=H<<29|U>>>3,De=U<<29|H>>>3,qe=K<<28|V>>>4,Le=V<<28|K>>>4,Ue=$<<23|G>>>9,He=G<<23|$>>>9,Ke=W<<25|Z>>>7,Ve=Z<<25|W>>>7,Ge=Y<<21|X>>>11,$e=X<<21|Y>>>11,We=Q<<24|J>>>8,Ze=J<<24|Q>>>8,Ye=ee<<27|te>>>5,Xe=te<<27|ee>>>5,Je=re<<20|ie>>>12,Qe=ie<<20|re>>>12,et=ae<<7|ne>>>25,tt=ne<<7|ae>>>25,rt=oe<<8|se>>>24,it=se<<8|oe>>>24,nt=ce<<14|ue>>>18,at=ue<<14|ce>>>18;e[0]=fe^~ke&Fe,e[1]=pe^~xe&Re,e[10]=qe^~Je&de,e[11]=Le^~Qe&me,e[20]=_e^~Be&Ke,e[21]=we^~Ce&Ve,e[30]=Ye^~he&Se,e[31]=Xe^~le&je,e[40]=Oe^~Ue&et,e[41]=Te^~He&tt,e[2]=ke^~Fe&Ge,e[3]=xe^~Re&$e,e[12]=Je^~de&Ee,e[13]=Qe^~me&Ae,e[22]=Be^~Ke&rt,e[23]=Ce^~Ve&it,e[32]=he^~Se&ze,e[33]=le^~je&Me,e[42]=Ue^~et&ge,e[43]=He^~tt&ve,e[4]=Fe^~Ge&nt,e[5]=Re^~$e&at,e[14]=de^~Ee&Ne,e[15]=me^~Ae&De,e[24]=Ke^~rt&be,e[25]=Ve^~it&ye,e[34]=Se^~ze&We,e[35]=je^~Me&Ze,e[44]=et^~ge&Ie,e[45]=tt^~ve&Pe,e[6]=Ge^~nt&fe,e[7]=$e^~at&pe,e[16]=Ee^~Ne&qe,e[17]=Ae^~De&Le,e[26]=rt^~be&_e,e[27]=it^~ye&we,e[36]=ze^~We&Ye,e[37]=Me^~Ze&Xe,e[46]=ge^~Ie&Oe,e[47]=ve^~Pe&Te,e[8]=nt^~fe&ke,e[9]=at^~pe&xe,e[18]=Ne^~qe&Je,e[19]=De^~Le&Qe,e[28]=be^~_e&Be,e[29]=ye^~we&Ce,e[38]=We^~Ye&he,e[39]=Ze^~Xe&le,e[48]=Ie^~Oe&Ue,e[49]=Pe^~Te&He,e[0]^=ot[2*t],e[1]^=ot[2*t+1]}}},{}],335:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=e("./keccak-state-unroll");function a(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}a.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},a.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},a.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},t.exports=a},{"./keccak-state-unroll":334,"safe-buffer":447}],336:[function(e,t,r){var i=e("./_root").Symbol;t.exports=i},{"./_root":341}],337:[function(e,t,r){var i=e("./_Symbol"),n=e("./_getRawTag"),a=e("./_objectToString"),o=i?i.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},{"./_Symbol":336,"./_getRawTag":339,"./_objectToString":340}],338:[function(e,r,t){(function(e){var t="object"==(void 0===e?"undefined":_typeof(e))&&e&&e.Object===Object&&e;r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],339:[function(e,t,r){var i=e("./_Symbol"),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,s=i?i.toStringTag:void 0;t.exports=function(e){var t=a.call(e,s),r=e[s];try{var i=!(e[s]=void 0)}catch(e){}var n=o.call(e);return i&&(t?e[s]=r:delete e[s]),n}},{"./_Symbol":336}],340:[function(e,t,r){var i=Object.prototype.toString;t.exports=function(e){return i.call(e)}},{}],341:[function(e,t,r){var i=e("./_freeGlobal"),n="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,a=i||n||Function("return this")();t.exports=a},{"./_freeGlobal":338}],342:[function(e,t,r){var i=Array.isArray;t.exports=i},{}],343:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isObject");t.exports=function(e){if(!n(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},{"./_baseGetTag":337,"./isObject":344}],344:[function(e,t,r){t.exports=function(e){var t=void 0===e?"undefined":_typeof(e);return null!=e&&("object"==t||"function"==t)}},{}],345:[function(e,t,r){t.exports=function(e){return null!=e&&"object"==(void 0===e?"undefined":_typeof(e))}},{}],346:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isArray"),a=e("./isObjectLike");t.exports=function(e){return"string"==typeof e||!n(e)&&a(e)&&"[object String]"==i(e)}},{"./_baseGetTag":337,"./isArray":342,"./isObjectLike":345}],347:[function(e,t,r){t.exports=function(e){return void 0===e}},{}],348:[function(e,t,r){"use strict";var i=e("inherits"),n=e("hash-base"),a=e("safe-buffer").Buffer,o=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,r,i,n,a,o){return c(e+(t&r|~t&i)+n+a|0,o)+t|0}function f(e,t,r,i,n,a,o){return c(e+(t&i|r&~i)+n+a|0,o)+t|0}function p(e,t,r,i,n,a,o){return c(e+(t^r^i)+n+a|0,o)+t|0}function h(e,t,r,i,n,a,o){return c(e+(r^(t|~i))+n+a|0,o)+t|0}i(s,n),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,a=this._d;i=h(i=h(i=h(i=h(i=p(i=p(i=p(i=p(i=f(i=f(i=f(i=f(i=u(i=u(i=u(i=u(i,n=u(n,a=u(a,r=u(r,i,n,a,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),a,r,e[3],3250441966,22),n=u(n,a=u(a,r=u(r,i,n,a,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),a,r,e[7],4249261313,22),n=u(n,a=u(a,r=u(r,i,n,a,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),a,r,e[11],2304563134,22),n=u(n,a=u(a,r=u(r,i,n,a,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),a,r,e[15],1236535329,22),n=f(n,a=f(a,r=f(r,i,n,a,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),a,r,e[0],3921069994,20),n=f(n,a=f(a,r=f(r,i,n,a,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),a,r,e[4],3889429448,20),n=f(n,a=f(a,r=f(r,i,n,a,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),a,r,e[8],1163531501,20),n=f(n,a=f(a,r=f(r,i,n,a,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),a,r,e[12],2368359562,20),n=p(n,a=p(a,r=p(r,i,n,a,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),a,r,e[14],4259657740,23),n=p(n,a=p(a,r=p(r,i,n,a,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),a,r,e[10],3200236656,23),n=p(n,a=p(a,r=p(r,i,n,a,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),a,r,e[6],76029189,23),n=p(n,a=p(a,r=p(r,i,n,a,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),a,r,e[2],3299628645,23),n=h(n,a=h(a,r=h(r,i,n,a,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),a,r,e[5],4237533241,21),n=h(n,a=h(a,r=h(r,i,n,a,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),a,r,e[1],2240044497,21),n=h(n,a=h(a,r=h(r,i,n,a,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),a,r,e[13],1309151649,21),n=h(n,a=h(a,r=h(r,i,n,a,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),a,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+a|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e}},{}],355:[function(e,t,r){(t.exports=o).Minimatch=n;var u={sep:"/"};try{u=e("path")}catch(e){}var z=o.GLOBSTAR=n.GLOBSTAR={},i=e("brace-expansion"),M={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},N="[^/]*?",D="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{});var f=/\/+/;function a(t,r){t=t||{},r=r||{};var i={};return Object.keys(r).forEach(function(e){i[e]=r[e]}),Object.keys(t).forEach(function(e){i[e]=t[e]}),i}function o(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new n(t,r).match(e))}function n(e,t){if(!(this instanceof n))return new n(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==u.sep&&(e=e.split(u.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function s(e,t){if(t||(t=this instanceof n?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:i(e)}o.filter=function(i,n){return n=n||{},function(e,t,r){return o(e,i,n)}},o.defaults=function(i){if(!i||!Object.keys(i).length)return o;var n=o,e=function(e,t,r){return n.minimatch(e,t,a(i,r))};return e.Minimatch=function(e,t){return new n.Minimatch(e,a(i,t))},e},n.defaults=function(e){return e&&Object.keys(e).length?o.defaults(e).Minimatch:n},n.prototype.debug=function(){},n.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(f)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r},n.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=this.options,i=0;if(r.nonegate)return;for(var n=0,a=e.length;n>> no match, partial?",e,p,t,h),p!==o))}if("string"==typeof u?(c=i.nocase?f.toLowerCase()===u.toLowerCase():f===u,this.debug("string match",u,f,c)):(c=f.match(u),this.debug("pattern match",u,f,c)),!c)return!1}if(n===o&&a===s)return!0;if(n===o)return r;if(a===s)return n===o-1&&""===e[n];throw new Error("wtf?")}},{"brace-expansion":155,path:374}],356:[function(e,t,r){var c=e("crypto");function o(e,t,r){return c.createHmac(r,e).update(t).digest("base64")}function s(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function n(e,t){return t>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var n=s,a=i+r;e^=-1;for(var o=i;o>>8^n[255&(e^t[o])];return-1^e}},{}],362:[function(e,t,r){"use strict";var c,h=e("../utils/common"),u=e("./trees"),l=e("./adler32"),d=e("./crc32"),i=e("./messages"),f=0,p=4,m=0,g=-2,v=-1,b=4,n=2,y=8,_=9,a=286,o=30,s=19,w=2*a+1,k=15,x=3,S=258,j=S+x+1,E=42,A=113,I=1,P=2,O=3,T=4;function B(e,t){return e.msg=i[t],t}function C(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(h.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function z(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,R(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function N(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function D(e,t){var r,i,n=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-j?e.strstart-(e.w_size-j):0,u=e.window,f=e.w_mask,p=e.prev,h=e.strstart+S,l=u[a+o-1],d=u[a+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===d&&u[r+o-1]===l&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ac&&0!=--n);return o<=e.lookahead?o:e.lookahead}function q(e){var t,r,i,n,a,o,s,c,u,f,p=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-j)){for(h.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;i=e.head[--t],e.head[t]=p<=i?i-p:0,--r;);for(t=r=p;i=e.prev[--t],e.prev[t]=p<=i?i-p:0,--r;);n+=p}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,c=e.strstart+e.lookahead,u=n,f=void 0,f=o.avail_in,u=x)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(i=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(n=e.strstart+e.lookahead-x,i=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=n&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(q(e),0===e.lookahead&&t===f)return I;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,z(e,!1),0===e.strm.avail_out))return I;if(e.strstart-e.block_start>=e.w_size-j&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):(e.strstart>e.block_start&&(z(e,!1),e.strm.avail_out),I)}),new H(4,4,8,4,L),new H(4,5,16,8,L),new H(4,6,32,32,L),new H(4,4,16,16,U),new H(8,16,32,32,U),new H(8,16,128,128,U),new H(8,32,128,256,U),new H(32,128,258,1024,U),new H(32,258,258,4096,U)],r.deflateInit=function(e,t){return $(e,t,y,15,8,0)},r.deflateInit2=$,r.deflateReset=G,r.deflateResetKeep=V,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,m):g},r.deflate=function(e,t){var r,i,n,a;if(!e||!e.state||5>8&255),M(i,i.gzhead.time>>16&255),M(i,i.gzhead.time>>24&255),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(M(i,255&i.gzhead.extra.length),M(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=d(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(M(i,0),M(i,0),M(i,0),M(i,0),M(i,0),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,3),i.status=A);else{var o=y+(i.w_bits-8<<4)<<8;o|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(o|=32),o+=31-o%31,i.status=A,N(i,o),0!==i.strstart&&(N(i,e.adler>>>16),N(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending!==i.pending_buf_size));)M(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&R(e),i.pending+2<=i.pending_buf_size&&(M(i,255&e.adler),M(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(R(e),0===e.avail_out)return i.last_flush=-1,m}else if(0===e.avail_in&&C(t)<=C(r)&&t!==p)return B(e,-5);if(666===i.status&&0!==e.avail_in)return B(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==f&&666!==i.status){var s=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(q(e),0===e.lookahead)){if(t===f)return I;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):3===i.strategy?function(e,t){for(var r,i,n,a,o=e.window;;){if(e.lookahead<=S){if(q(e),e.lookahead<=S&&t===f)return I;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):c[i.level].func(i,t);if(s!==O&&s!==T||(i.status=666),s===I||s===O)return 0===e.avail_out&&(i.last_flush=-1),m;if(s===P&&(1===t?u._tr_align(i):5!==t&&(u._tr_stored_block(i,0,0,!1),3===t&&(F(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),R(e),0===e.avail_out))return i.last_flush=-1,m}return t!==p?m:i.wrap<=0?1:(2===i.wrap?(M(i,255&e.adler),M(i,e.adler>>8&255),M(i,e.adler>>16&255),M(i,e.adler>>24&255),M(i,255&e.total_in),M(i,e.total_in>>8&255),M(i,e.total_in>>16&255),M(i,e.total_in>>24&255)):(N(i,e.adler>>>16),N(i,65535&e.adler)),R(e),0=r.w_size&&(0===a&&(F(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new h.Buf8(r.w_size),h.arraySet(u,t,f-r.w_size,r.w_size,0),t=u,f=r.w_size),o=e.avail_in,s=e.next_in,c=e.input,e.avail_in=f,e.next_in=0,e.input=t,q(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=_=y>>>24,d-=_,0===(_=y>>>16&255))E[a++]=65535&y;else{if(!(16&_)){if(0==(64&_)){y=m[(65535&y)+(l&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&y,(_&=15)&&(d<_&&(l+=j[i++]<>>=_,d-=_),d<15&&(l+=j[i++]<>>=_=y>>>24,d-=_,!(16&(_=y>>>16&255))){if(0==(64&_)){y=g[(65535&y)+(l&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&y,d<(_&=15)&&(l+=j[i++]<>>=_,d-=_,(_=a-o)>3,l&=(1<<(d-=w<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new P.Buf16(320),this.work=new P.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=N,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new P.Buf32(i),t.distcode=t.distdyn=new P.Buf32(n),t.sane=1,t.back=-1,z):M}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):M}function c(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=a.wsize?(P.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(n=a.wsize-a.wnext)&&(n=i),P.arraySet(a.window,t,r-i,n,a.wnext),(i-=n)?(P.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=T(r.check,A,2,0),f=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(f-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=3;case 3:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>8&255,A[2]=u>>>16&255,A[3]=u>>>24&255,r.check=T(r.check,A,4,0)),f=u=0,r.mode=4;case 4:for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>8),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>>8&255,r.check=T(r.check,A,2,0)),f=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(s<(l=r.length)&&(l=s),l&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),P.arraySet(r.head.extra,i,a,l,k)),512&r.flags&&(r.check=T(r.check,i,l,a)),s-=l,a+=l,r.length-=l),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;for(l=0;k=i[a+l++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&l>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>=7&f,f-=7&f,r.mode=27;break}for(;f<3;){if(0===s)break e;s--,u+=i[a++]<>>=1)){case 0:r.mode=14;break;case 1:if(q(r),r.mode=20,6!==t)break;u>>>=2,f-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,f-=2;break;case 14:for(u>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,u+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,f=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(l=r.length){if(s>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,286>>=3,f-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=C(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=g,f-=g,r.lens[r.have++]=b;else{if(16===b){for(j=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],l=3+(3&u),u>>>=2,f-=2}else if(17===b){for(j=g+3;f>>=g)),u>>>=3,f-=3}else{for(j=g+7;f>>=g)),u>>>=7,f-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;l--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=C(F,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=C(R,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=s&&258<=c){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,r.hold=u,r.bits=f,B(e,h),o=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,u=r.hold,f=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;v=(E=r.lencode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,r.length=b,0===v){r.mode=26;break}if(32&v){r.back=-1,r.mode=12;break}if(64&v){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&v,r.mode=22;case 22:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=(E=r.distcode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&v,r.mode=24;case 24:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===c)break e;if(l=h-c,r.offset>l){if((l=r.offset-l)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d=l>r.wnext?(l-=r.wnext,r.wsize-l):r.wnext-l,l>r.length&&(l=r.length),m=r.window}else m=n,d=o-r.offset,l=r.length;for(cl?(m=B[C+o[y]],I[P+o[y]]):(m=96,0),c=1<>S)+(u-=c)]=d<<24|m<<16|g|0,0!==u;);for(c=1<>=1;if(0!==c?(A&=c-1,A+=c):A=0,y++,0==--O[b]){if(b===w)break;b=t[r+o[y]]}if(k>>7)]}function M(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function N(e,t,r){e.bi_valid>n-r?(e.bi_buf|=t<>n-e.bi_valid,e.bi_valid+=r-n):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function L(e,t,r){var i,n,a=new Array(v+1),o=0;for(i=1;i<=v;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=q(a[s]++,s))}}function U(e){var t;for(t=0;t>1;1<=r;r--)V(e,a,r);for(n=c;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],V(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,a[2*n]=a[2*r]+a[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,a[2*r+1]=a[2*i+1]=n,e.heap[1]=n++,V(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,n,a,o,s,c=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,p=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(a=0;a<=v;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return s;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return u;for(t=32;t>>3,(a=e.static_len+3+7>>>3)<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==t?X(e,t,r,i):4===e.strategy||a===n?(N(e,2+(i?1:0),3),G(e,E,A)):(N(e,4+(i?1:0),3),function(e,t,r,i){var n;for(N(e,t-257,5),N(e,r-1,5),N(e,i-4,4),n=0;n>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(P[r]+p+1)]++,e.dyn_dtree[2*z(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;N(e,2,3),D(e,b,E),16===(t=e).bi_valid?(M(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":358}],368:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],369:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],370:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var a=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=a;var o=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=o;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var f=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=f,r.DSAparam=i.define("DSAparam",function(){this.int()});var p=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=p;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":371,"asn1.js":46}],371:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),a=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(a)}),u=i.define("RDNSequence",function(){this.seqof(c)}),f=i.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),p=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(f),this.key("validity").use(p),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),d=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=d},{"asn1.js":46}],372:[function(e,t,r){(function(h){var l=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,d=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m,m=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,g=e("evp_bytestokey"),v=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(l);if(n){var a="aes"+n[1],o=new h(n[2],"hex"),s=new h(n[3].replace(/[\r\n]/g,""),"base64"),c=g(t,o.slice(0,8),parseInt(n[1],10)).key,u=[],f=v.createDecipheriv(a,c,o);u.push(f.update(s)),u.push(f.final()),r=h.concat(u)}else{var p=i.match(m);r=new h(p[2].replace(/[\r\n]/g,""),"base64")}return{tag:i.match(d)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":160,buffer:191,evp_bytestokey:270}],373:[function(t,r,e){(function(b){var y=t("./asn1"),_=t("./aesid.json"),w=t("./fixProc"),k=t("browserify-aes"),x=t("pbkdf2");function e(e){var t;"object"!==(void 0===e?"undefined":_typeof(e))||b.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new b(e));var r,i,n,a,o,s,c,u,f,p,h,l,d,m=w(e,t),g=m.tag,v=m.data;switch(g){case"CERTIFICATE":i=y.certificate.decode(v,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=y.PublicKey.decode(v,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=y.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"ENCRYPTED PRIVATE KEY":v=y.EncryptedPrivateKey.decode(v,"der"),a=t,o=(n=v).algorithm.decrypt.kde.kdeparams.salt,s=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=_[n.algorithm.decrypt.cipher.algo.join(".")],u=n.algorithm.decrypt.cipher.iv,f=n.subjectPrivateKey,p=parseInt(c.split("-")[1],10)/8,h=x.pbkdf2Sync(a,o,s,p),l=k.createDecipheriv(c,h,u),(d=[]).push(l.update(f)),d.push(l.final()),v=b.concat(d);case"PRIVATE KEY":switch(r=(i=y.PrivateKey.decode(v,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:y.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=y.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"RSA PUBLIC KEY":return y.RSAPublicKey.decode(v,"der");case"RSA PRIVATE KEY":return y.RSAPrivateKey.decode(v,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:y.DSAPrivateKey.decode(v,"der")};case"EC PRIVATE KEY":return{curve:(v=y.ECPrivateKey.decode(v,"der")).parameters.value,privateKey:v.privateKey};default:throw new Error("unknown key type "+g)}}(r.exports=e).signature=y.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":369,"./asn1":370,"./fixProc":372,"browserify-aes":160,buffer:191,pbkdf2:375}],374:[function(e,t,u){(function(n){function a(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function o(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;ia?t=n(t):t.length "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+o+";","var res;","switch (argLength) {",r.concat(["extra"]).map(function(e,t){return"case "+t+":res = fn.call("+["self"].concat(r.slice(0,t)).concat("cb").join(",")+");break;"}).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],n)(a,e)}(e)};var o="function (err, res) {if (err) { rj(err); } else { rs(res); }}";a.nodeify=function(r){return function(){var e=Array.prototype.slice.call(arguments),t="function"==typeof e[e.length-1]?e.pop():null,i=this;try{return r.apply(this,arguments).nodeify(t,i)}catch(r){if(null==t)return new a(function(e,t){t(r)});n(function(){t.call(i,r)})}}},a.prototype.nodeify=function(t,r){if("function"!=typeof t)return this;this.then(function(e){n(function(){t.call(r,null,e)})},function(e){n(function(){t.call(r,e)})})}},{"./core.js":384,asap:44}],390:[function(e,t,r){"use strict";var i=e("./core.js");(t.exports=i).enableSynchronous=function(){i.prototype.isPending=function(){return 0==this.getState()},i.prototype.isFulfilled=function(){return 1==this.getState()},i.prototype.isRejected=function(){return 2==this.getState()},i.prototype.getValue=function(){if(3===this._65)return this._55.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._55},i.prototype.getReason=function(){if(3===this._65)return this._55.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._55},i.prototype.getState=function(){return 3===this._65?this._55.getState():-1===this._65||-2===this._65?0:this._65}},i.disableSynchronous=function(){i.prototype.isPending=void 0,i.prototype.isFulfilled=void 0,i.prototype.isRejected=void 0,i.prototype.getValue=void 0,i.prototype.getReason=void 0,i.prototype.getState=void 0}},{"./core.js":384}],391:[function(e,t,r){"use strict";var n=function(e){for(var t=e.toString(16);4!==t.length;)t="0"+t;return"\\u"+t};t.exports=function(e,t,r,i){return!r.key||61!==t&&58!==t&&t!==r.separator?31o||0<=new u(t).cmp(a.modulus))throw new Error("decryption error");n=r?d(new u(t),a):h(t,a);var s=m.alloc(o-n.length);if(n=m.concat([s,n],o),4===i)return function(e,t){var r=e.modulus.byteLength(),i=l("sha1").update(m.alloc(0)).digest(),n=i.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,n+1),o=t.slice(n+1),s=p(a,f(o,n)),c=p(o,f(s,r-n-1));if(function(e,t){e=m.from(e),t=m.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){a++;break}var o=t.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&a++;o.length<8&&a++;if(a)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}},{"./mgf":401,"./withPublic":404,"./xor":405,"bn.js":154,"browserify-rsa":178,"create-hash":200,"parse-asn1":373,"safe-buffer":447}],403:[function(e,t,r){var o=e("parse-asn1"),h=e("randombytes"),l=e("create-hash"),d=e("./mgf"),m=e("./xor"),g=e("bn.js"),s=e("./withPublic"),c=e("browserify-rsa"),v=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,a=o(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=l("sha1").update(v.alloc(0)).digest(),a=n.length,o=2*a;if(r-o-2>6]+a[128|63&n]:n<55296||57344<=n?r+=a[224|n>>12]+a[128|n>>6&63]+a[128|63&n]:(i+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),r+=a[240|n>>18]+a[128|n>>12&63]+a[128|n>>6&63]+a[128|63&n])}return r},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function i(r,n,a){if(!n)return r;if("object"!==(void 0===n?"undefined":_typeof(n))){if(Array.isArray(r))r.push(n);else{if("object"!==(void 0===r?"undefined":_typeof(r)))return[r,n];(a.plainObjects||a.allowPrototypes||!o.call(Object.prototype,n))&&(r[n]=!0)}return r}if("object"!==(void 0===r?"undefined":_typeof(r)))return[r].concat(n);var e=r;return Array.isArray(r)&&!Array.isArray(n)&&(e=s(r,a)),Array.isArray(r)&&Array.isArray(n)?(n.forEach(function(e,t){o.call(r,t)?r[t]&&"object"===_typeof(r[t])?r[t]=i(r[t],e,a):r.push(e):r[t]=e}),r):Object.keys(n).reduce(function(e,t){var r=n[t];return o.call(e,t)?e[t]=i(e[t],r,a):e[t]=r,e},e)}}},{}],411:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var a=/\+/g;e=e.split(t);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var s,c,u=e.length;0t.highWaterMark&&(t.highWaterMark=(m<=(r=e)?r=m:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(_("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?v.nextTick(x,e):x(e))}function x(e){_("emit readable"),e.emit("readable"),I(e)}function S(e,t){t.readingMore||(t.readingMore=!0,v.nextTick(j,e,t))}function j(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;ea.length?a.length:e;if(o===a.length?n+=a:n+=a.slice(0,e),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=a.slice(o);break}++i}return t.length-=i,n}(e,t):function(e,t){var r=u.allocUnsafe(e),i=t.head,n=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i).data=a.slice(o);break}++n}return t.length-=n,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return _("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):k(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,n=t.needReadable;return _("need readable",n),(0===t.length||t.length-e>>0),a=this.head,o=0;a;)t=a.data,r=n,i=o,t.copy(r,i),o+=a.data.length,a=a.next;return n},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":447,util:157}],423:[function(e,t,r){"use strict";var a=e("process-nextick-args");function o(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a.nextTick(o,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(o,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":381}],424:[function(e,t,r){t.exports=e("events").EventEmitter},{events:269}],425:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":426}],426:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":417,"./lib/_stream_passthrough.js":418,"./lib/_stream_readable.js":419,"./lib/_stream_transform.js":420,"./lib/_stream_writable.js":421}],427:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":426}],428:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":421}],429:[function(e,t,r){"use strict";var s=e("../"),c=e("lodash/isArray"),u=e("lodash/isFunction"),f=e("lodash/isObjectLike");t.exports=function(e){var t="Please verify options";if(!f(e))throw new TypeError(t);if(!u(e.request))throw new TypeError(t+".request");if(!c(e.expose)||0===e.expose.length)throw new TypeError(t+".expose");for(var r=s({PromiseImpl:e.PromiseImpl,constructorMixin:e.constructorMixin}),i=e.request.Request.prototype.init,n=!(e.request.Request.prototype.init=function(e){return!f(e)||this._callback||this._rp_promise||r.init.call(this,e),i.apply(this,arguments)}),a=0;a=t.maxRedirects)return r.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+r.uri.href)),!1;t.redirectsFollowed+=1,o.test(i)||(i=a.resolve(r.uri.href,i));var n=r.uri;return r.uri=a.parse(i),r.uri.protocol!==n.protocol&&delete r.agent,t.redirects.push({statusCode:e.statusCode,redirectUri:i}),t.followAllRedirects&&"HEAD"!==r.method&&401!==e.statusCode&&307!==e.statusCode&&(r.method=t.followOriginalHttpMethod?r.method:"GET"),delete r.src,delete r.req,delete r._started,401!==e.statusCode&&307!==e.statusCode&&(delete r.body,delete r._form,r.headers&&(r.removeHeader("host"),r.removeHeader("content-type"),r.removeHeader("content-length"),r.uri.hostname!==r.originalHost.split(":")[0]&&r.removeHeader("authorization"))),t.removeRefererHeader||r.setHeader("referer",n.href),r.emit("redirect"),r.init(),!0},r.Redirect=i},{url:500}],444:[function(e,t,r){"use strict";var w=e("url"),k=e("tunnel-agent"),i=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],x=["proxy-authorization"];function n(e){this.request=e,this.proxyHeaderWhiteList=i,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}n.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},n.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=w.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,i,n,a,o,s,c=this.proxyHeaderExclusiveList.concat(x),u=this.proxyHeaderWhiteList.concat(c),f=(r=t.headers,i=u.reduce(function(e,t){return e[t.toLowerCase()]=!0,e},{}),Object.keys(r).filter(function(e){return i[e.toLowerCase()]}).reduce(function(e,t){return e[t]=r[t],e},{}));f.host=(n=t.uri,a=n.port,o=n.protocol,s=n.hostname+":",s+=a||("https:"===o?"443":"80")),c.forEach(t.removeHeader,t);var p,h,l,d,m,g,v,b,y=(l=(p=t).uri,d=p.proxy,h=d,m=["https:"===l.protocol?"https":"http","https:"===h.protocol?"Https":"Http"].join("Over"),k[m]),_=(v=f,{proxy:{host:(b=(g=t).proxy).hostname,port:+b.port,proxyAuth:b.auth,headers:v},headers:g.headers,ca:g.ca,cert:g.cert,key:g.key,passphrase:g.passphrase,pfx:g.pfx,ciphers:g.ciphers,rejectUnauthorized:g.rejectUnauthorized,secureOptions:g.secureOptions,secureProtocol:g.secureProtocol});return t.agent=y(_),!0},n.defaultProxyHeaderWhiteList=i,n.defaultProxyHeaderExclusiveList=x,r.Tunnel=n},{"tunnel-agent":497,url:500}],445:[function(U,H,e){(function(e){"use strict";var w=U("http"),k=U("https"),x=U("url"),t=U("util"),n=U("stream"),f=U("zlib"),c=U("aws-sign2"),u=U("aws4"),i=U("http-signature"),S=U("mime-types"),j=U("caseless"),E=U("forever-agent"),r=U("form-data"),a=U("extend"),A=U("isstream"),I=U("is-typedarray").strict,o=U("./lib/helpers"),s=U("./lib/cookies"),P=U("./lib/getProxyFromURI"),p=U("./lib/querystring").Querystring,h=U("./lib/har").Har,l=U("./lib/auth").Auth,d=U("./lib/oauth").OAuth,m=U("./lib/hawk"),g=U("./lib/multipart").Multipart,v=U("./lib/redirect").Redirect,b=U("./lib/tunnel").Tunnel,y=U("performance-now"),O=U("safe-buffer").Buffer,_=o.safeStringify,T=o.isReadStream,B=o.toBase64,C=o.defer,F=o.copy,R=o.version,z=s.jar(),M={};function N(){return{uri:this.uri,method:this.method,headers:this.headers}}function D(){return{statusCode:this.statusCode,body:this.body,headers:this.headers,request:N.call(this.request)}}function q(e){var t=this;e.har&&(t._har=new h(t),e=t._har.options(e)),n.Stream.call(t);var r=Object.keys(q.prototype),i=function(e,t){var r={};for(var i in t)-1===e.indexOf(i)&&(r[i]=t[i]);return r}(r,e);a(t,i),e=function(e,t){var r={};for(var i in t){var n=!(-1===e.indexOf(i)),a="function"==typeof t[i];n&&a||(r[i]=t[i])}return r}(r,e),t.readable=!0,t.writable=!0,e.method&&(t.explicitMethod=!0),t._qs=new p(t),t._auth=new l(t),t._oauth=new d(t),t._multipart=new g(t),t._redirect=new v(t),t._tunnel=new b(t),t.init(e)}function L(){q.debug&&console.error("REQUEST %s",t.format.apply(t,arguments))}t.inherits(q,n.Stream),q.debug=e.env.NODE_DEBUG&&/\brequest\b/.test(e.env.NODE_DEBUG),q.prototype.debug=L,q.prototype.init=function(e){var i=this;for(var t in e||(e={}),i.headers=i.headers?F(i.headers):{},i.headers)void 0===i.headers[t]&&delete i.headers[t];if(j.httpify(i,i.headers),i.method||(i.method=e.method||"GET"),i.localAddress||(i.localAddress=e.localAddress),i._qs.init(e),L(e),i.pool||!1===i.pool||(i.pool=M),i.dests=i.dests||[],i.__isRequestRequest=!0,!i._callback&&i.callback&&(i._callback=i.callback,i.callback=function(){i._callbackCalled||(i._callbackCalled=!0,i._callback.apply(i,arguments))},i.on("error",i.callback.bind()),i.on("complete",i.callback.bind(i,null))),!i.uri&&i.url&&(i.uri=i.url,delete i.url),i.baseUrl){if("string"!=typeof i.baseUrl)return i.emit("error",new Error("options.baseUrl must be a string"));if("string"!=typeof i.uri)return i.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(0===i.uri.indexOf("//")||-1!==i.uri.indexOf("://"))return i.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var r=i.baseUrl.lastIndexOf("/")===i.baseUrl.length-1,n=0===i.uri.indexOf("/");r&&n?i.uri=i.baseUrl+i.uri.slice(1):r||n?i.uri=i.baseUrl+i.uri:""===i.uri?i.uri=i.baseUrl:i.uri=i.baseUrl+"/"+i.uri,delete i.baseUrl}if(!i.uri)return i.emit("error",new Error("options.uri is a required argument"));if("string"==typeof i.uri&&(i.uri=x.parse(i.uri)),i.uri.href||(i.uri.href=x.format(i.uri)),"unix:"===i.uri.protocol)return i.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if("unix"===i.uri.host&&i.enableUnixSocket(),!1===i.strictSSL&&(i.rejectUnauthorized=!1),i.uri.pathname||(i.uri.pathname="/"),!(i.uri.host||i.uri.hostname&&i.uri.port||i.uri.isUnix)){var a='Invalid URI "'+x.format(i.uri)+'"';return 0===Object.keys(e).length&&(a+=". This can be caused by a crappy redirection."),i.abort(),i.emit("error",new Error(a))}if(i.hasOwnProperty("proxy")||(i.proxy=P(i.uri)),i.tunnel=i._tunnel.isEnabled(),i.proxy&&i._tunnel.setup(e),i._redirect.onRequest(e),i.setHost=!1,!i.hasHeader("host")){var o=i.originalHostHeaderName||"host";i.setHeader(o,i.uri.host),i.uri.port&&("80"===i.uri.port&&"http:"===i.uri.protocol||"443"===i.uri.port&&"https:"===i.uri.protocol)&&i.setHeader(o,i.uri.hostname),i.setHost=!0}if(i.jar(i._jar||e.jar),i.uri.port||("http:"===i.uri.protocol?i.uri.port=80:"https:"===i.uri.protocol&&(i.uri.port=443)),i.proxy&&!i.tunnel?(i.port=i.proxy.port,i.host=i.proxy.hostname):(i.port=i.uri.port,i.host=i.uri.hostname),e.form&&i.form(e.form),e.formData){var s=e.formData,c=i.form(),u=function(e,t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?c.append(e,t.value,t.options):c.append(e,t)};for(var f in s)if(s.hasOwnProperty(f)){var p=s[f];if(p instanceof Array)for(var h=0;h>>32-t}function S(e,t,r,i,n,a,o,s){return x(e+(t^r^i)+a+o|0,s)+n|0}function j(e,t,r,i,n,a,o,s){return x(e+(t&r|~t&i)+a+o|0,s)+n|0}function E(e,t,r,i,n,a,o,s){return x(e+((t|~r)^i)+a+o|0,s)+n|0}function A(e,t,r,i,n,a,o,s){return x(e+(t&i|r&~i)+a+o|0,s)+n|0}function I(e,t,r,i,n,a,o,s){return x(e+(t^(r|~i))+a+o|0,s)+n|0}n(o,a),o.prototype._update=function(){for(var e=g,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,a=0|this._d,o=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,f=0|this._d,p=0|this._e,h=0;h<80;h+=1){var l,d;d=h<16?(l=S(r,i,n,a,o,e[v[h]],w[0],y[h]),I(s,c,u,f,p,e[b[h]],k[0],_[h])):h<32?(l=j(r,i,n,a,o,e[v[h]],w[1],y[h]),A(s,c,u,f,p,e[b[h]],k[1],_[h])):h<48?(l=E(r,i,n,a,o,e[v[h]],w[2],y[h]),E(s,c,u,f,p,e[b[h]],k[2],_[h])):h<64?(l=A(r,i,n,a,o,e[v[h]],w[3],y[h]),j(s,c,u,f,p,e[b[h]],k[3],_[h])):(l=I(r,i,n,a,o,e[v[h]],w[4],y[h]),S(s,c,u,f,p,e[b[h]],k[4],_[h])),r=o,o=a,a=x(n,10),n=i,i=l,s=p,p=f,f=x(u,10),u=c,c=d}var m=this._b+n+f|0;this._b=this._c+a+p|0,this._c=this._d+o+s|0,this._d=this._e+r+c|0,this._e=this._a+i+u|0,this._a=m},o.prototype._digest=function(){this._block[this._blockOffset++]=128,56=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 a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":447}],450:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":451,"./sha1":452,"./sha224":453,"./sha256":454,"./sha384":455,"./sha512":456}],451:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,v=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s=this._w,c=0|this._a,u=0|this._b,f=0|this._c,p=0|this._d,h=0|this._e,l=0;l<16;++l)s[l]=e.readInt32BE(4*l);for(;l<80;++l)s[l]=s[l-3]^s[l-8]^s[l-14]^s[l-16];for(var d=0;d<80;++d){var m=~~(d/20),g=0|((o=c)<<5|o>>>27)+(i=u,n=f,a=p,0===(r=m)?i&n|~i&a:2===r?i&n|i&a|n&a:i^n^a)+h+s[d]+v[m];h=p,p=f,f=(t=u)<<30|t>>>2,u=c,c=g}this._a=c+this._a|0,this._b=u+this._b|0,this._c=f+this._c|0,this._d=p+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],452:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0;d<16;++d)c[d]=e.readInt32BE(4*d);for(;d<80;++d)c[d]=(t=c[d-3]^c[d-8]^c[d-14]^c[d-16])<<1|t>>>31;for(var m=0;m<80;++m){var g=~~(m/20),v=0|((s=u)<<5|s>>>27)+(n=f,a=p,o=h,0===(i=g)?n&a|~n&o:2===i?n&a|n&o|a&o:n^a^o)+l+c[m]+b[g];l=h,h=p,p=(r=f)<<30|r>>>2,f=u,u=v}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],453:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}i(c,n),c.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},c.prototype._hash=function(){var e=o.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},t.exports=c},{"./hash":449,"./sha256":454,inherits:320,"safe-buffer":447}],454:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,w=[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],o=new Array(64);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0|this._f,m=0|this._g,g=0|this._h,v=0;v<16;++v)c[v]=e.readInt32BE(4*v);for(;v<64;++v)c[v]=0|(((r=c[v-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+c[v-7]+(((t=c[v-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+c[v-16];for(var b=0;b<64;++b){var y=g+(((s=l)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((o=m)^l&(d^o))+w[b]+c[b]|0,_=0|(((a=u)>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+((i=u)&(n=f)|p&(i|n));g=m,m=d,d=l,l=h+y|0,h=p,p=f,f=u,u=y+_|0}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],455:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(160);function c(){this.init(),this._w=s,a.call(this,128,112)}i(c,n),c.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},c.prototype._hash=function(){var i=o.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=c},{"./hash":449,"./sha512":456,inherits:320,"safe-buffer":447}],456:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,ee=[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],o=new Array(160);function s(){this.init(),this._w=o,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ae(e,t){return e>>>0>>0?1:0}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c,u=this._w,f=0|this._ah,p=0|this._bh,h=0|this._ch,l=0|this._dh,d=0|this._eh,m=0|this._fh,g=0|this._gh,v=0|this._hh,b=0|this._al,y=0|this._bl,_=0|this._cl,w=0|this._dl,k=0|this._el,x=0|this._fl,S=0|this._gl,j=0|this._hl,E=0;E<32;E+=2)u[E]=e.readInt32BE(4*E),u[E+1]=e.readInt32BE(4*E+4);for(;E<160;E+=2){var A=u[E-30],I=u[E-30+1],P=((s=A)>>>1|(c=I)<<31)^(s>>>8|c<<24)^s>>>7,O=((a=I)>>>1|(o=A)<<31)^(a>>>8|o<<24)^(a>>>7|o<<25);A=u[E-4],I=u[E-4+1];var T=((i=A)>>>19|(n=I)<<13)^(n>>>29|i<<3)^i>>>6,B=((t=I)>>>19|(r=A)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),C=u[E-14],F=u[E-14+1],R=u[E-32],z=u[E-32+1],M=O+F|0,N=P+C+ae(M,O)|0;N=(N=N+T+ae(M=M+B|0,B)|0)+R+ae(M=M+z|0,z)|0,u[E]=N,u[E+1]=M}for(var D=0;D<160;D+=2){N=u[D],M=u[D+1];var q=re(f,p,h),L=re(b,y,_),U=ie(f,b),H=ie(b,f),K=ne(d,k),V=ne(k,d),G=ee[D],$=ee[D+1],W=te(d,m,g),Z=te(k,x,S),Y=j+V|0,X=v+K+ae(Y,j)|0;X=(X=(X=X+W+ae(Y=Y+Z|0,Z)|0)+G+ae(Y=Y+$|0,$)|0)+N+ae(Y=Y+M|0,M)|0;var J=H+L|0,Q=U+q+ae(J,H)|0;v=g,j=S,g=m,S=x,m=d,x=k,d=l+X+ae(k=w+Y|0,w)|0,l=h,w=_,h=p,_=y,p=f,y=b,f=X+Q+ae(b=Y+J|0,Y)|0}this._al=this._al+b|0,this._bl=this._bl+y|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+k|0,this._fl=this._fl+x|0,this._gl=this._gl+S|0,this._hl=this._hl+j|0,this._ah=this._ah+f+ae(this._al,b)|0,this._bh=this._bh+p+ae(this._bl,y)|0,this._ch=this._ch+h+ae(this._cl,_)|0,this._dh=this._dh+l+ae(this._dl,w)|0,this._eh=this._eh+d+ae(this._el,k)|0,this._fh=this._fh+m+ae(this._fl,x)|0,this._gh=this._gh+g+ae(this._gl,S)|0,this._hh=this._hh+v+ae(this._hl,j)|0},s.prototype._hash=function(){var i=a.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],457:[function(e,t,r){var i=e("safer-buffer").Buffer,n={dsa:{parts:["p","q","g","y"],sizePart:"p"},rsa:{parts:["e","n"],sizePart:"n"},ecdsa:{parts:["curve","Q"],sizePart:"Q"},ed25519:{parts:["A"],sizePart:"A"}};n.curve25519=n.ed25519;var a={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};a.curve25519=a.ed25519;var o={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:i.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g,""),"hex"),s:i.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g,""),"hex"),n:i.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g,""),"hex"),G:i.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g,""),"hex"),s:i.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g,""),"hex"),n:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g,""),"hex"),G:i.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:i.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g,""),"hex"),a:i.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g,""),"hex"),s:i.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g,""),"hex"),n:i.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g,""),"hex"),G:i.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g,""),"hex")}};t.exports={info:n,privInfo:a,hashAlgs:{md5:!0,sha1:!0,sha256:!0,sha384:!0,sha512:!0},curves:o}},{"safer-buffer":448}],458:[function(e,t,r){t.exports=_;var d=e("assert-plus"),m=e("safer-buffer").Buffer,i=e("./algs"),n=e("crypto"),a=e("./fingerprint"),o=(e("./signature"),e("./errors")),g=(e("util"),e("./utils")),v=e("./key"),b=e("./private-key"),y=e("./identity"),s={};s.openssh=e("./formats/openssh-cert"),s.x509=e("./formats/x509"),s.pem=e("./formats/x509-pem");var c=o.CertificateParseError,u=o.InvalidAlgorithmError;function _(e){d.object(e,"options"),d.arrayOfObject(e.subjects,"options.subjects"),g.assertCompatible(e.subjects[0],y,[1,0],"options.subjects"),g.assertCompatible(e.subjectKey,v,[1,0],"options.subjectKey"),g.assertCompatible(e.issuer,y,[1,0],"options.issuer"),void 0!==e.issuerKey&&g.assertCompatible(e.issuerKey,v,[1,0],"options.issuerKey"),d.object(e.signatures,"options.signatures"),d.buffer(e.serial,"options.serial"),d.date(e.validFrom,"options.validFrom"),d.date(e.validUntil,"optons.validUntil"),d.optionalArrayOfString(e.purposes,"options.purposes"),this._hashCache={},this.subjects=e.subjects,this.issuer=e.issuer,this.subjectKey=e.subjectKey,this.issuerKey=e.issuerKey,this.signatures=e.signatures,this.serial=e.serial,this.validFrom=e.validFrom,this.validUntil=e.validUntil,this.purposes=e.purposes}_.formats=s,_.prototype.toBuffer=function(e,t){return void 0===e&&(e="x509"),d.string(e,"format"),d.object(s[e],"formats[format]"),d.optionalObject(t,"options"),s[e].write(this,t)},_.prototype.toString=function(e,t){return void 0===e&&(e="pem"),this.toBuffer(e,t).toString()},_.prototype.fingerprint=function(e){void 0===e&&(e="sha256"),d.string(e,"algorithm");var t={type:"certificate",hash:this.hash(e),algorithm:e};return new a(t)},_.prototype.hash=function(e){if(d.string(e,"algorithm"),e=e.toLowerCase(),void 0===i.hashAlgs[e])throw new u(e);if(this._hashCache[e])return this._hashCache[e];var t=n.createHash(e).update(this.toBuffer("x509")).digest();return this._hashCache[e]=t},_.prototype.isExpired=function(e){return void 0===e&&(e=new Date),!(e.getTime()>=this.validFrom.getTime()&&e.getTime()e.length||"BEGIN"!==e.slice(t,t+5).toString("ascii"))}(e))return a.read(e,t);if(function(e){var t=0;for(;to.length&&(p=o.length),u+=c.write(o.slice(f,p),u),c[u++]=10,f=p}return u+=c.write("-----END "+i+"-----\n",u),c.slice(0,u)}};var b=e("assert-plus"),y=e("asn1"),_=e("crypto"),w=e("safer-buffer").Buffer,k=(e("../algs"),e("../utils")),h=e("../key"),l=e("../private-key"),x=e("./pkcs1"),S=e("./pkcs8"),j=e("./ssh-private"),E=e("./rfc4253"),A=e("../errors")},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../utils":480,"./pkcs1":467,"./pkcs8":468,"./rfc4253":469,"./ssh-private":470,asn1:65,"assert-plus":66,crypto:204,"safer-buffer":448}],467:[function(e,t,r){t.exports={read:function(e,t){return i.read(e,t,"pkcs1")},readPkcs1:function(e,t,r){switch(e){case"RSA":if("public"===t)return u=y(c=r,"modulus"),f=y(c,"exponent"),new p({type:"rsa",parts:[{name:"e",data:f},{name:"n",data:u}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t[0],0);var r=y(e,"modulus"),i=y(e,"public exponent"),n=y(e,"private exponent"),a=y(e,"prime1"),o=y(e,"prime2"),s=y(e,"exponent1"),c=y(e,"exponent2"),u=y(e,"iqmp");return new v({type:"rsa",parts:[{name:"n",data:r},{name:"e",data:i},{name:"d",data:n},{name:"iqmp",data:u},{name:"p",data:a},{name:"q",data:o},{name:"dmodp",data:s},{name:"dmodq",data:c}]})}(r);throw new Error("Unknown key type: "+t);case"DSA":if("public"===t)return n=y(i=r,"y"),a=y(i,"p"),o=y(i,"q"),s=y(i,"g"),new p({type:"dsa",parts:[{name:"y",data:n},{name:"p",data:a},{name:"q",data:o},{name:"g",data:s}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),0);var r=y(e,"p"),i=y(e,"q"),n=y(e,"g"),a=y(e,"y"),o=y(e,"x");return new v({type:"dsa",parts:[{name:"p",data:r},{name:"q",data:i},{name:"g",data:n},{name:"y",data:a},{name:"x",data:o}]})}(r);throw new Error("Unknown key type: "+t);case"EC":case"ECDSA":if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),1);var r=e.readString(l.Ber.OctetString,!0);e.readSequence(160);var i=b(e);h.string(i,"a known elliptic curve"),e.readSequence(161);var n=e.readString(l.Ber.BitString,!0);n=g.ecNormalize(n);var a={type:"ecdsa",parts:[{name:"curve",data:d.from(i)},{name:"Q",data:n},{name:"d",data:r}]};return new v(a)}(r);if("public"===t)return function(e){e.readSequence();var t=e.readOID();h.strictEqual(t,"1.2.840.10045.2.1","must be ecPublicKey");for(var r,i=e.readOID(),n=Object.keys(m.curves),a=0;aS.length&&(I=S.length),E+=x.write(S.slice(A,I),E),x[E++]=10,A=I}return E+=x.write("-----END "+k+"-----\n",E),x.slice(0,E)}};var O,T=P("assert-plus"),B=(P("asn1"),P("safer-buffer").Buffer),C=(P("../algs"),P("../utils")),F=P("crypto"),R=(P("../key"),P("../private-key")),r=P("./pem"),A=P("./rfc4253"),z=P("../ssh-buffer"),I=P("../errors");var M="openssh-key-v1"},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../ssh-buffer":479,"../utils":480,"./pem":466,"./rfc4253":469,asn1:65,"assert-plus":66,"bcrypt-pbkdf":76,crypto:204,"safer-buffer":448}],471:[function(e,t,r){t.exports={read:function(e,t){"string"!=typeof e&&(h.buffer(e,"buf"),e=e.toString("ascii"));var r=e.trim().replace(/[\\\r]/g,""),i=r.match(m);i||(i=r.match(g));h.ok(i,"key must match regex");var n,a=d.algToKeyType(i[1]),o=l.from(i[2],"base64"),s={};if(i[4])try{n=d.read(o)}catch(e){i=r.match(g),h.ok(i,"key must match regex"),o=l.from(i[2],"base64"),n=d.readInternal(s,"public",o)}else n=d.readInternal(s,"public",o);if(h.strictEqual(a,n.type),i[4]&&0n.length&&(u=n.length),s+=o.write(n.slice(c,u),s),o[s++]=10,c=u}return s+=o.write("-----END "+i+"-----\n",s),o.slice(0,s)}};var o=e("assert-plus"),p=(e("asn1"),e("safer-buffer").Buffer);e("../algs"),e("../utils"),e("../key"),e("../private-key"),e("./pem"),e("../identity"),e("../signature"),e("../certificate")},{"../algs":457,"../certificate":458,"../identity":474,"../key":476,"../private-key":477,"../signature":478,"../utils":480,"./pem":466,"./x509":473,asn1:65,"assert-plus":66,"safer-buffer":448}],473:[function(e,t,r){t.exports={read:function(e,t){"string"==typeof e&&(e=_.from(e,"binary"));b.buffer(e,"buf");var r=new y.BerReader(e);if(r.readSequence(),1=this._buffer.length},a.prototype.remainder=function(){return this._buffer.slice(this._offset)},a.prototype.skip=function(e){this._offset+=e},a.prototype.expand=function(){this._size*=2;var e=n.alloc(this._size);this._buffer.copy(e,0),this._buffer=e},a.prototype.readPart=function(){return{data:this.readBuffer()}},a.prototype.readBuffer=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4,i.ok(this._offset+e<=this._buffer.length,"length out of bounds at +0x"+this._offset.toString(16)+" (data truncated?)");var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t},a.prototype.readString=function(){return this.readBuffer().toString()},a.prototype.readCString=function(){for(var e=this._offset;ethis._size;)this.expand();this._buffer.writeUInt32BE(e.length,this._offset),this._offset+=4,e.copy(this._buffer,this._offset),this._offset+=e.length},a.prototype.writeString=function(e){this.writeBuffer(n.from(e,"utf8"))},a.prototype.writeCString=function(e){for(;this._offset+1+e.length>this._size;)this.expand();this._buffer.write(e,this._offset),this._offset+=e.length,this._buffer[this._offset++]=0},a.prototype.writeInt=function(e){for(;this._offset+4>this._size;)this.expand();this._buffer.writeUInt32BE(e,this._offset),this._offset+=4},a.prototype.writeInt64=function(e){if(i.buffer(e,"value"),8this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=8},a.prototype.writeChar=function(e){for(;this._offset+1>this._size;)this.expand();this._buffer[this._offset++]=e},a.prototype.writePart=function(e){this.writeBuffer(e.data)},a.prototype.write=function(e){for(;this._offset+e.length>this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=e.length}},{"assert-plus":66,"safer-buffer":448}],480:[function(e,t,r){t.exports={bufferSplit:function(e,t){p.buffer(e),p.string(t);for(var r=[],i=0,n=0,a=0;a=t.length){var o=a+1;r.push(e.slice(i,o-n)),i=o,n=0}i<=e.length&&r.push(e.slice(i,e.length));return r},addRSAMissing:function(e){p.object(e),u(e,s,[1,1]);var t,r=new g(e.part.d.data);if(!e.part.dmodp){var i=new g(e.part.p.data),n=r.mod(i.subtract(1));t=_(n),e.part.dmodp={name:"dmodp",data:t},e.parts.push(e.part.dmodp)}if(!e.part.dmodq){var a=new g(e.part.q.data),o=r.mod(a.subtract(1));t=_(o),e.part.dmodq={name:"dmodq",data:t},e.parts.push(e.part.dmodq)}},calculateDSAPublic:function(e,t,r){return p.buffer(e),p.buffer(t),p.buffer(r),e=new g(e),t=new g(t),r=new g(r),_(e.modPow(r,t))},calculateED25519Public:function(e){p.buffer(e);var t=i.sign.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},calculateX25519Public:function(e){p.buffer(e);var t=i.box.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},mpNormalize:y,mpDenormalize:function(e){p.buffer(e);for(;1c)return!1;if(i.constructor.name!==t.name)return!1;var a=i._sshpkApiVersion;void 0===a&&(a=t._oldVersionDetect(e));return!(a[0]!=r[0]||a[1]t;)p.equal(e[0],0),e=e.slice(1);for(;e.length=r[1],i+" must be compatible with "+t.name+" klass version "+r[0]+"."+r[1])}}var v={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}},b=8;function y(e){for(p.buffer(e);1t._pos){var i=r.substr(t._pos);if("x-user-defined"===t._charset){for(var n=new p(i.length),a=0;at._pos&&(t.push(new p(new Uint8Array(o.result.slice(t._pos)))),t._pos=o.result.byteLength)},o.onload=function(){t.push(null)},o.readAsArrayBuffer(r)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":484,_process:382,buffer:191,inherits:320,"readable-stream":426}],487:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=p,t=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1=2.4.3 <2.5.0",_id:"tough-cookie@2.4.3",_inCache:!0,_installable:!0,_location:"/tough-cookie",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/tough-cookie_2.4.3_1529960207843_0.4882910670728131"},_npmUser:{email:"jstash@gmail.com",name:"jstash"},_npmVersion:"6.1.0",_phantomChildren:{},_requested:{name:"tough-cookie",raw:"tough-cookie@~2.4.3",rawSpec:"~2.4.3",scope:null,spec:">=2.4.3 <2.5.0",type:"range"},_requiredBy:["/request","/request-promise"],_resolved:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",_shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",_shrinkwrap:null,_spec:"tough-cookie@~2.4.3",_where:"/home/administrator/javascript-opentimestamps/node_modules/request",author:{email:"jstash@gmail.com",name:"Jeremy Stashewsky"},bugs:{url:"https://github.com/salesforce/tough-cookie/issues"},contributors:[{name:"Alexander Savin"},{name:"Ian Livingstone"},{name:"Ivan Nikulin"},{name:"Lalit Kapoor"},{name:"Sam Thompson"},{name:"Sebastian Mayr"}],dependencies:{psl:"^1.1.24",punycode:"^1.4.1"},description:"RFC6265 Cookies and Cookie Jar for node.js",devDependencies:{async:"^1.4.2",nyc:"^11.6.0","string.prototype.repeat":"^0.2.0",vows:"^0.8.1"},directories:{},dist:{fileCount:9,integrity:"sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMVcQCRA9TVsSAnZWagAAzX0P/2COkbzb3dOX/FTOYIVL\n7oHge7BvGODNkEHTjBtNsR0jO/AA/gVcUOq6CSmFH+UC14LrmCyNDemQvD15\njnYuJXUIiZsSZO7BGGbOFYrQF+DKLiwgf0LokrIM8KasZ5nxc5xS1jYHG5o+\nwCqutfhlRTqlPbZsexB+eRlIuYNvpsbRAdSDYXrhLJNMZgx49g/SZ7IwunGN\nJ/5Fe041MZqqdi7MAavM3T7vX9IvVRJJ3f4xAEVxY1vh4s0dN+h4fG2eMQzL\nOiaulRUIahs4xmJUYHZgZESc9eTIrI8K+YT7i3r35TGc0Du7ueB2KYxBqy7q\n6AUFbdX9Ep308kTVsTf/h4wE0RvdxKLfZ0ww7T1ivADX9xMi2oIvVtyhCQHo\nSIpyBhaav/fTufF0/Fu4Lcr7PMJxyvF0UcNRqrPmEQTw4UZkFKfT8HN2P5cH\nBvJsFwpeEjt84tt5pJ/bmD0j0EUCLUXLGH6fbA84fHpZGifO239zSf262Qdv\nSXeygU7YxnK8wOCnvlauZx/gp+/WTMfMdODxiX0QnqwS5BctiPCgGG1cKJcC\nqvTECaAEmxMVf/gEW73oxVXJgUO7f6jJaWoawV7ka+wR91W9Bp0pKGOOAxAG\nU72rmnwQKid9U7ly5833sb3D+lbzKJXGNIqohegP4daKZfNNTaLWZXmKE+Iy\n7Vml\r\n=8KpS\r\n-----END PGP SIGNATURE-----\r\n",shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",tarball:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",unpackedSize:83959},engines:{node:">=0.8"},files:["lib"],gitHead:"671ad413b38d7464352886772f57a7ec417d4760",homepage:"https://github.com/salesforce/tough-cookie",keywords:["HTTP","RFC2965","RFC6265","cookie","cookiejar","cookies","jar","set-cookie"],license:"BSD-3-Clause",main:"./lib/cookie",maintainers:[{name:"awaterma",email:"awaterma@awaterma.net"},{name:"jstash",email:"jstash@gmail.com"},{name:"maratto",email:"marat+npm@salesforce.com"},{name:"ruoho",email:"clint@ruoho.org"}],name:"tough-cookie",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/salesforce/tough-cookie.git"},scripts:{cover:"nyc --reporter=lcov --reporter=html vows test/*_test.js",test:"vows test/*_test.js"},version:"2.4.3"}},{}],497:[function(s,e,c){(function(u){"use strict";s("net");var f,a=s("tls"),r=s("http"),i=s("https"),e=s("events"),p=s("assert"),t=s("util"),h=s("safe-buffer").Buffer;function o(e){var o=this;o.options=e||{},o.proxyOptions=o.options.proxy||{},o.maxSockets=o.options.maxSockets||r.Agent.defaultMaxSockets,o.requests=[],o.sockets=[],o.on("free",function(e,t,r){for(var i=0,n=o.requests.length;i=this.maxSockets?this.requests.push({host:t.host,port:t.port,request:e}):this.createConnection({host:t.host,port:t.port,request:e})},o.prototype.createConnection=function(e){var n=this;n.createSocket(e,function(t){function r(){n.emit("free",t,e.host,e.port)}function i(e){n.removeSocket(t),t.removeListener("free",r),t.removeListener("close",i),t.removeListener("agentRemove",i)}t.on("free",r),t.on("close",i),t.on("agentRemove",i),e.request.onSocket(t)})},o.prototype.createSocket=function(n,a){var o=this,s={};o.sockets.push(s);var e=l({},o.proxyOptions,{method:"CONNECT",path:n.host+":"+n.port,agent:!1});e.proxyAuth&&(e.headers=e.headers||{},e.headers["Proxy-Authorization"]="Basic "+h.from(e.proxyAuth).toString("base64")),f("making CONNECT request");var c=o.request(e);function i(e,t,r){if(c.removeAllListeners(),t.removeAllListeners(),200===e.statusCode)p.equal(r.length,0),f("tunneling connection has established"),o.sockets[o.sockets.indexOf(s)]=t,a(t);else{f("tunneling socket could not be established, statusCode=%d",e.statusCode);var i=new Error("tunneling socket could not be established, statusCode="+e.statusCode);i.code="ECONNRESET",n.request.emit("error",i),o.removeSocket(s)}}c.useChunkedEncodingByDefault=!1,c.once("response",function(e){e.upgrade=!0}),c.once("upgrade",function(e,t,r){u.nextTick(function(){i(e,t,r)})}),c.once("connect",i),c.once("error",function(e){c.removeAllListeners(),f("tunneling socket could not be established, cause=%s\n",e.message,e.stack);var t=new Error("tunneling socket could not be established, cause="+e.message);t.code="ECONNRESET",n.request.emit("error",t),o.removeSocket(s)}),c.end()},o.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},f=u.env.NODE_DEBUG&&/\btunnel\b/.test(u.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},c.debug=f}).call(this,s("_process"))},{_process:382,assert:67,events:269,http:483,https:317,net:187,"safe-buffer":447,tls:187,util:505}],498:[function(e,t,r){!function(a){"use strict";var m=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function d(e,t,r,i,n){var a,o=0;for(a=0;a>>8)-1}function v(e,t,r,i){return d(e,t,r,i,16)}function b(e,t,r,i){return d(e,t,r,i,32)}function y(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=a,k=o,x=s,S=c,j=u,E=f,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=0;M<20;M+=2)w^=(n=(C^=(n=(P^=(n=(j^=(n=w+C|0)<<7|n>>>25)+w|0)<<9|n>>>23)+j|0)<<13|n>>>19)+P|0)<<18|n>>>14,E^=(n=(k^=(n=(F^=(n=(O^=(n=E+k|0)<<7|n>>>25)+E|0)<<9|n>>>23)+O|0)<<13|n>>>19)+F|0)<<18|n>>>14,T^=(n=(A^=(n=(x^=(n=(R^=(n=T+A|0)<<7|n>>>25)+T|0)<<9|n>>>23)+R|0)<<13|n>>>19)+x|0)<<18|n>>>14,z^=(n=(B^=(n=(I^=(n=(S^=(n=z+B|0)<<7|n>>>25)+z|0)<<9|n>>>23)+S|0)<<13|n>>>19)+I|0)<<18|n>>>14,w^=(n=(S^=(n=(x^=(n=(k^=(n=w+S|0)<<7|n>>>25)+w|0)<<9|n>>>23)+k|0)<<13|n>>>19)+x|0)<<18|n>>>14,E^=(n=(j^=(n=(I^=(n=(A^=(n=E+j|0)<<7|n>>>25)+E|0)<<9|n>>>23)+A|0)<<13|n>>>19)+I|0)<<18|n>>>14,T^=(n=(O^=(n=(P^=(n=(B^=(n=T+O|0)<<7|n>>>25)+T|0)<<9|n>>>23)+B|0)<<13|n>>>19)+P|0)<<18|n>>>14,z^=(n=(R^=(n=(F^=(n=(C^=(n=z+R|0)<<7|n>>>25)+z|0)<<9|n>>>23)+C|0)<<13|n>>>19)+F|0)<<18|n>>>14;w=w+a|0,k=k+o|0,x=x+s|0,S=S+c|0,j=j+u|0,E=E+f|0,A=A+p|0,I=I+h|0,P=P+l|0,O=O+d|0,T=T+m|0,B=B+g|0,C=C+v|0,F=F+b|0,R=R+y|0,z=z+_|0,e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=x>>>0&255,e[9]=x>>>8&255,e[10]=x>>>16&255,e[11]=x>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=j>>>0&255,e[17]=j>>>8&255,e[18]=j>>>16&255,e[19]=j>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=B>>>0&255,e[45]=B>>>8&255,e[46]=B>>>16&255,e[47]=B>>>24&255,e[48]=C>>>0&255,e[49]=C>>>8&255,e[50]=C>>>16&255,e[51]=C>>>24&255,e[52]=F>>>0&255,e[53]=F>>>8&255,e[54]=F>>>16&255,e[55]=F>>>24&255,e[56]=R>>>0&255,e[57]=R>>>8&255,e[58]=R>>>16&255,e[59]=R>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,i)}function _(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=0;w<20;w+=2)a^=(n=(v^=(n=(l^=(n=(u^=(n=a+v|0)<<7|n>>>25)+a|0)<<9|n>>>23)+u|0)<<13|n>>>19)+l|0)<<18|n>>>14,f^=(n=(o^=(n=(b^=(n=(d^=(n=f+o|0)<<7|n>>>25)+f|0)<<9|n>>>23)+d|0)<<13|n>>>19)+b|0)<<18|n>>>14,m^=(n=(p^=(n=(s^=(n=(y^=(n=m+p|0)<<7|n>>>25)+m|0)<<9|n>>>23)+y|0)<<13|n>>>19)+s|0)<<18|n>>>14,_^=(n=(g^=(n=(h^=(n=(c^=(n=_+g|0)<<7|n>>>25)+_|0)<<9|n>>>23)+c|0)<<13|n>>>19)+h|0)<<18|n>>>14,a^=(n=(c^=(n=(s^=(n=(o^=(n=a+c|0)<<7|n>>>25)+a|0)<<9|n>>>23)+o|0)<<13|n>>>19)+s|0)<<18|n>>>14,f^=(n=(u^=(n=(h^=(n=(p^=(n=f+u|0)<<7|n>>>25)+f|0)<<9|n>>>23)+p|0)<<13|n>>>19)+h|0)<<18|n>>>14,m^=(n=(d^=(n=(l^=(n=(g^=(n=m+d|0)<<7|n>>>25)+m|0)<<9|n>>>23)+g|0)<<13|n>>>19)+l|0)<<18|n>>>14,_^=(n=(y^=(n=(b^=(n=(v^=(n=_+y|0)<<7|n>>>25)+_|0)<<9|n>>>23)+v|0)<<13|n>>>19)+b|0)<<18|n>>>14;e[0]=a>>>0&255,e[1]=a>>>8&255,e[2]=a>>>16&255,e[3]=a>>>24&255,e[4]=f>>>0&255,e[5]=f>>>8&255,e[6]=f>>>16&255,e[7]=f>>>24&255,e[8]=m>>>0&255,e[9]=m>>>8&255,e[10]=m>>>16&255,e[11]=m>>>24&255,e[12]=_>>>0&255,e[13]=_>>>8&255,e[14]=_>>>16&255,e[15]=_>>>24&255,e[16]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255}(e,t,r,i)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function k(e,t,r,i,n,a,o){var s,c,u=new Uint8Array(16),f=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=a[c];for(;64<=n;){for(y(f,u,o,w),c=0;c<64;c++)e[t+c]=r[i+c]^f[c];for(s=1,c=8;c<16;c++)s=s+(255&u[c])|0,u[c]=255&s,s>>>=8;n-=64,t+=64,i+=64}if(0>>=8;r-=64,t+=64}if(0>>13|r<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|i<<6),n=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|n<<9),a=255&e[8]|(255&e[9])<<8,this.r[4]=255&(n>>>4|a<<12),this.r[5]=a>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(a>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,r,i,n,a){var o=new E(a);return o.update(r,i,n),o.finish(e,t),0}function I(e,t,r,i,n,a){var o=new Uint8Array(16);return A(o,0,r,i,n,a),v(e,t,o,0)}function P(e,t,r,i,n){var a;if(r<32)return-1;for(j(e,0,t,0,r,i,n),A(e,16,e,32,r-32,e),a=0;a<16;a++)e[a]=0;return 0}function O(e,t,r,i,n){var a,o=new Uint8Array(32);if(r<32)return-1;if(S(o,0,32,i,n),0!==I(t,16,t,32,r-32,o))return-1;for(j(e,0,t,0,r,i,n),a=0;a<32;a++)e[a]=0;return 0}function T(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function C(e,t,r){for(var i,n=~(r-1),a=0;a<16;a++)i=n&(e[a]^t[a]),e[a]^=i,t[a]^=i}function F(e,t){var r,i,n,a=m(),o=m();for(r=0;r<16;r++)o[r]=t[r];for(B(o),B(o),B(o),i=0;i<2;i++){for(a[0]=o[0]-65517,r=1;r<15;r++)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),n=a[15]>>16&1,a[14]&=65535,C(o,a,1-n)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function R(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return F(r,e),F(i,t),b(r,0,i,0)}function z(e){var t=new Uint8Array(32);return F(t,e),1&t[0]}function M(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function N(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function D(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function q(e,t,r){var i,n,a=0,o=0,s=0,c=0,u=0,f=0,p=0,h=0,l=0,d=0,m=0,g=0,v=0,b=0,y=0,_=0,w=0,k=0,x=0,S=0,j=0,E=0,A=0,I=0,P=0,O=0,T=0,B=0,C=0,F=0,R=0,z=r[0],M=r[1],N=r[2],D=r[3],q=r[4],L=r[5],U=r[6],H=r[7],K=r[8],V=r[9],G=r[10],$=r[11],W=r[12],Z=r[13],Y=r[14],X=r[15];a+=(i=t[0])*z,o+=i*M,s+=i*N,c+=i*D,u+=i*q,f+=i*L,p+=i*U,h+=i*H,l+=i*K,d+=i*V,m+=i*G,g+=i*$,v+=i*W,b+=i*Z,y+=i*Y,_+=i*X,o+=(i=t[1])*z,s+=i*M,c+=i*N,u+=i*D,f+=i*q,p+=i*L,h+=i*U,l+=i*H,d+=i*K,m+=i*V,g+=i*G,v+=i*$,b+=i*W,y+=i*Z,_+=i*Y,w+=i*X,s+=(i=t[2])*z,c+=i*M,u+=i*N,f+=i*D,p+=i*q,h+=i*L,l+=i*U,d+=i*H,m+=i*K,g+=i*V,v+=i*G,b+=i*$,y+=i*W,_+=i*Z,w+=i*Y,k+=i*X,c+=(i=t[3])*z,u+=i*M,f+=i*N,p+=i*D,h+=i*q,l+=i*L,d+=i*U,m+=i*H,g+=i*K,v+=i*V,b+=i*G,y+=i*$,_+=i*W,w+=i*Z,k+=i*Y,x+=i*X,u+=(i=t[4])*z,f+=i*M,p+=i*N,h+=i*D,l+=i*q,d+=i*L,m+=i*U,g+=i*H,v+=i*K,b+=i*V,y+=i*G,_+=i*$,w+=i*W,k+=i*Z,x+=i*Y,S+=i*X,f+=(i=t[5])*z,p+=i*M,h+=i*N,l+=i*D,d+=i*q,m+=i*L,g+=i*U,v+=i*H,b+=i*K,y+=i*V,_+=i*G,w+=i*$,k+=i*W,x+=i*Z,S+=i*Y,j+=i*X,p+=(i=t[6])*z,h+=i*M,l+=i*N,d+=i*D,m+=i*q,g+=i*L,v+=i*U,b+=i*H,y+=i*K,_+=i*V,w+=i*G,k+=i*$,x+=i*W,S+=i*Z,j+=i*Y,E+=i*X,h+=(i=t[7])*z,l+=i*M,d+=i*N,m+=i*D,g+=i*q,v+=i*L,b+=i*U,y+=i*H,_+=i*K,w+=i*V,k+=i*G,x+=i*$,S+=i*W,j+=i*Z,E+=i*Y,A+=i*X,l+=(i=t[8])*z,d+=i*M,m+=i*N,g+=i*D,v+=i*q,b+=i*L,y+=i*U,_+=i*H,w+=i*K,k+=i*V,x+=i*G,S+=i*$,j+=i*W,E+=i*Z,A+=i*Y,I+=i*X,d+=(i=t[9])*z,m+=i*M,g+=i*N,v+=i*D,b+=i*q,y+=i*L,_+=i*U,w+=i*H,k+=i*K,x+=i*V,S+=i*G,j+=i*$,E+=i*W,A+=i*Z,I+=i*Y,P+=i*X,m+=(i=t[10])*z,g+=i*M,v+=i*N,b+=i*D,y+=i*q,_+=i*L,w+=i*U,k+=i*H,x+=i*K,S+=i*V,j+=i*G,E+=i*$,A+=i*W,I+=i*Z,P+=i*Y,O+=i*X,g+=(i=t[11])*z,v+=i*M,b+=i*N,y+=i*D,_+=i*q,w+=i*L,k+=i*U,x+=i*H,S+=i*K,j+=i*V,E+=i*G,A+=i*$,I+=i*W,P+=i*Z,O+=i*Y,T+=i*X,v+=(i=t[12])*z,b+=i*M,y+=i*N,_+=i*D,w+=i*q,k+=i*L,x+=i*U,S+=i*H,j+=i*K,E+=i*V,A+=i*G,I+=i*$,P+=i*W,O+=i*Z,T+=i*Y,B+=i*X,b+=(i=t[13])*z,y+=i*M,_+=i*N,w+=i*D,k+=i*q,x+=i*L,S+=i*U,j+=i*H,E+=i*K,A+=i*V,I+=i*G,P+=i*$,O+=i*W,T+=i*Z,B+=i*Y,C+=i*X,y+=(i=t[14])*z,_+=i*M,w+=i*N,k+=i*D,x+=i*q,S+=i*L,j+=i*U,E+=i*H,A+=i*K,I+=i*V,P+=i*G,O+=i*$,T+=i*W,B+=i*Z,C+=i*Y,F+=i*X,_+=(i=t[15])*z,o+=38*(k+=i*N),s+=38*(x+=i*D),c+=38*(S+=i*q),u+=38*(j+=i*L),f+=38*(E+=i*U),p+=38*(A+=i*H),h+=38*(I+=i*K),l+=38*(P+=i*V),d+=38*(O+=i*G),m+=38*(T+=i*$),g+=38*(B+=i*W),v+=38*(C+=i*Z),b+=38*(F+=i*Y),y+=38*(R+=i*X),a=(i=(a+=38*(w+=i*M))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a=(i=(a+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a+=n-1+37*(n-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=h,e[8]=l,e[9]=d,e[10]=m,e[11]=g,e[12]=v,e[13]=b,e[14]=y,e[15]=_}function L(e,t){q(e,t,t)}function U(e,t){var r,i=m();for(r=0;r<16;r++)i[r]=t[r];for(r=253;0<=r;r--)L(i,i),2!==r&&4!==r&&q(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function H(e,t,r){var i,n,a=new Uint8Array(32),o=new Float64Array(80),s=m(),c=m(),u=m(),f=m(),p=m(),h=m();for(n=0;n<31;n++)a[n]=t[n];for(a[31]=127&t[31]|64,a[0]&=248,M(o,r),n=0;n<16;n++)c[n]=o[n],f[n]=s[n]=u[n]=0;for(s[0]=f[0]=1,n=254;0<=n;--n)C(s,c,i=a[n>>>3]>>>(7&n)&1),C(u,f,i),N(p,s,u),D(s,s,u),N(u,c,f),D(c,c,f),L(f,p),L(h,s),q(s,u,s),q(u,c,p),N(p,s,u),D(s,s,u),L(c,s),D(u,f,h),q(s,u,g),N(s,s,f),q(u,u,s),q(s,f,h),q(f,c,o),L(c,p),C(s,c,i),C(u,f,i);for(n=0;n<16;n++)o[n+16]=s[n],o[n+32]=u[n],o[n+48]=c[n],o[n+64]=f[n];var l=o.subarray(32),d=o.subarray(16);return U(l,l),q(d,d,l),F(e,d),0}function K(e,t){return H(e,t,r)}function V(e,t){return o(t,32),K(e,t)}function G(e,t,r){var i=new Uint8Array(32);return H(i,r,t),_(e,n,i,w)}E.prototype.blocks=function(e,t,r){for(var i,n,a,o,s,c,u,f,p,h,l,d,m,g,v,b,y,_,w,k=this.fin?0:2048,x=this.h[0],S=this.h[1],j=this.h[2],E=this.h[3],A=this.h[4],I=this.h[5],P=this.h[6],O=this.h[7],T=this.h[8],B=this.h[9],C=this.r[0],F=this.r[1],R=this.r[2],z=this.r[3],M=this.r[4],N=this.r[5],D=this.r[6],q=this.r[7],L=this.r[8],U=this.r[9];16<=r;)h=p=0,h+=(x+=8191&(i=255&e[t+0]|(255&e[t+1])<<8))*C,h+=(S+=8191&(i>>>13|(n=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*U),h+=(j+=8191&(n>>>10|(a=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*L),h+=(E+=8191&(a>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*q),p=(h+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*D))>>>13,h&=8191,h+=(I+=s>>>1&8191)*(5*N),h+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*M),h+=(O+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),h+=(T+=8191&(u>>>8|(f=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*R),l=p+=(h+=(B+=f>>>5|k)*(5*F))>>>13,l+=x*F,l+=S*C,l+=j*(5*U),l+=E*(5*L),p=(l+=A*(5*q))>>>13,l&=8191,l+=I*(5*D),l+=P*(5*N),l+=O*(5*M),l+=T*(5*z),p+=(l+=B*(5*R))>>>13,l&=8191,d=p,d+=x*R,d+=S*F,d+=j*C,d+=E*(5*U),p=(d+=A*(5*L))>>>13,d&=8191,d+=I*(5*q),d+=P*(5*D),d+=O*(5*N),d+=T*(5*M),m=p+=(d+=B*(5*z))>>>13,m+=x*z,m+=S*R,m+=j*F,m+=E*C,p=(m+=A*(5*U))>>>13,m&=8191,m+=I*(5*L),m+=P*(5*q),m+=O*(5*D),m+=T*(5*N),g=p+=(m+=B*(5*M))>>>13,g+=x*M,g+=S*z,g+=j*R,g+=E*F,p=(g+=A*C)>>>13,g&=8191,g+=I*(5*U),g+=P*(5*L),g+=O*(5*q),g+=T*(5*D),v=p+=(g+=B*(5*N))>>>13,v+=x*N,v+=S*M,v+=j*z,v+=E*R,p=(v+=A*F)>>>13,v&=8191,v+=I*C,v+=P*(5*U),v+=O*(5*L),v+=T*(5*q),b=p+=(v+=B*(5*D))>>>13,b+=x*D,b+=S*N,b+=j*M,b+=E*z,p=(b+=A*R)>>>13,b&=8191,b+=I*F,b+=P*C,b+=O*(5*U),b+=T*(5*L),y=p+=(b+=B*(5*q))>>>13,y+=x*q,y+=S*D,y+=j*N,y+=E*M,p=(y+=A*z)>>>13,y&=8191,y+=I*R,y+=P*F,y+=O*C,y+=T*(5*U),_=p+=(y+=B*(5*L))>>>13,_+=x*L,_+=S*q,_+=j*D,_+=E*N,p=(_+=A*M)>>>13,_&=8191,_+=I*z,_+=P*R,_+=O*F,_+=T*C,w=p+=(_+=B*(5*U))>>>13,w+=x*U,w+=S*L,w+=j*q,w+=E*D,p=(w+=A*N)>>>13,w&=8191,w+=I*M,w+=P*z,w+=O*R,w+=T*F,x=h=8191&(p=(p=((p+=(w+=B*C)>>>13)<<2)+p|0)+(h&=8191)|0),S=l+=p>>>=13,j=d&=8191,E=m&=8191,A=g&=8191,I=v&=8191,P=b&=8191,O=y&=8191,T=_&=8191,B=w&=8191,t+=16,r-=16;this.h[0]=x,this.h[1]=S,this.h[2]=j,this.h[3]=E,this.h[4]=A,this.h[5]=I,this.h[6]=P,this.h[7]=O,this.h[8]=T,this.h[9]=B},E.prototype.finish=function(e,t){var r,i,n,a,o=new Uint16Array(10);if(this.leftover){for(a=this.leftover,this.buffer[a++]=1;a<16;a++)this.buffer[a]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=r,r=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this.h[a]+r,r=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,i=(1^r)-1,a=0;a<10;a++)o[a]&=i;for(i=~i,a=0;a<10;a++)this.h[a]=this.h[a]&i|o[a];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,a=1;a<8;a++)n=(this.h[a]+this.pad[a]|0)+(n>>>16)|0,this.h[a]=65535&n;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var i,n;if(this.leftover){for(r<(n=16-this.leftover)&&(n=r),i=0;i>>16,I=65535&(S=D),P=S>>>16,E+=65535&(j=((g=K)>>>14|(c=z)<<18)^(K>>>18|z<<14)^(z>>>9|K<<23)),A+=j>>>16,I+=65535&(S=(z>>>14|K<<18)^(z>>>18|K<<14)^(K>>>9|z<<23)),P+=S>>>16,E+=65535&(j=K&(v=V)^~K&(b=G)),A+=j>>>16,I+=65535&(S=z&(u=M)^~z&(f=N)),P+=S>>>16,S=Z[2*k],E+=65535&(j=Z[2*k+1]),A+=j>>>16,I+=65535&S,P+=S>>>16,S=O[k%16],A+=(j=T[k%16])>>>16,I+=65535&S,P+=S>>>16,I+=(A+=(E+=65535&j)>>>16)>>>16,E=65535&(j=w=65535&E|A<<16),A=j>>>16,I=65535&(S=_=65535&I|(P+=I>>>16)<<16),P=S>>>16,E+=65535&(j=(q>>>28|B<<4)^(B>>>2|q<<30)^(B>>>7|q<<25)),A+=j>>>16,I+=65535&(S=(B>>>28|q<<4)^(q>>>2|B<<30)^(q>>>7|B<<25)),P+=S>>>16,A+=(j=q&L^q&U^L&U)>>>16,I+=65535&(S=B&C^B&F^C&F),P+=S>>>16,p=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,y=65535&E|A<<16,E=65535&(j=m),A=j>>>16,I=65535&(S=s),P=S>>>16,A+=(j=w)>>>16,I+=65535&(S=_),P+=S>>>16,C=n,F=a,R=o,z=s=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,M=c,N=u,D=f,B=p,L=h,U=l,H=d,K=m=65535&E|A<<16,V=g,G=v,$=b,q=y,k%16==15)for(x=0;x<16;x++)S=O[x],E=65535&(j=T[x]),A=j>>>16,I=65535&S,P=S>>>16,S=O[(x+9)%16],E+=65535&(j=T[(x+9)%16]),A+=j>>>16,I+=65535&S,P+=S>>>16,_=O[(x+1)%16],E+=65535&(j=((w=T[(x+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),A+=j>>>16,I+=65535&(S=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),P+=S>>>16,_=O[(x+14)%16],A+=(j=((w=T[(x+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,I+=65535&(S=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,O[x]=65535&I|P<<16,T[x]=65535&E|A<<16;E=65535&(j=q),A=j>>>16,I=65535&(S=B),P=S>>>16,S=e[0],A+=(j=t[0])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[0]=B=65535&I|P<<16,t[0]=q=65535&E|A<<16,E=65535&(j=L),A=j>>>16,I=65535&(S=C),P=S>>>16,S=e[1],A+=(j=t[1])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[1]=C=65535&I|P<<16,t[1]=L=65535&E|A<<16,E=65535&(j=U),A=j>>>16,I=65535&(S=F),P=S>>>16,S=e[2],A+=(j=t[2])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[2]=F=65535&I|P<<16,t[2]=U=65535&E|A<<16,E=65535&(j=H),A=j>>>16,I=65535&(S=R),P=S>>>16,S=e[3],A+=(j=t[3])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[3]=R=65535&I|P<<16,t[3]=H=65535&E|A<<16,E=65535&(j=K),A=j>>>16,I=65535&(S=z),P=S>>>16,S=e[4],A+=(j=t[4])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[4]=z=65535&I|P<<16,t[4]=K=65535&E|A<<16,E=65535&(j=V),A=j>>>16,I=65535&(S=M),P=S>>>16,S=e[5],A+=(j=t[5])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[5]=M=65535&I|P<<16,t[5]=V=65535&E|A<<16,E=65535&(j=G),A=j>>>16,I=65535&(S=N),P=S>>>16,S=e[6],A+=(j=t[6])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[6]=N=65535&I|P<<16,t[6]=G=65535&E|A<<16,E=65535&(j=$),A=j>>>16,I=65535&(S=D),P=S>>>16,S=e[7],A+=(j=t[7])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[7]=D=65535&I|P<<16,t[7]=$=65535&E|A<<16,W+=128,i-=128}return i}function X(e,t,r){var i,n=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,Y(n,a,t,r),r%=128,i=0;i>(7&n)&1),J(t,e),J(e,e),Q(e,t,i)}function re(e,t){var r=[m(),m(),m(),m()];T(r[0],i),T(r[1],s),T(r[2],f),q(r[3],i,s),te(e,r,t)}function ie(e,t,r){var i,n=new Uint8Array(64),a=[m(),m(),m(),m()];for(r||o(t,32),X(n,t,32),n[0]&=248,n[31]&=127,n[31]|=64,re(a,n),ee(e,a),i=0;i<32;i++)t[i+32]=e[i];return 0}var ne=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var r,i,n,a;for(i=63;32<=i;--i){for(r=0,n=i-32,a=i-12;n>8,t[n]-=256*r;t[n]+=r,t[i]=0}for(n=r=0;n<32;n++)t[n]+=r-(t[31]>>4)*ne[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*ne[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function oe(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function se(e,t,r,i){var n,a,o=new Uint8Array(64),s=new Uint8Array(64),c=new Uint8Array(64),u=new Float64Array(64),f=[m(),m(),m(),m()];X(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var p=r+64;for(n=0;n>7&&D(e[0],u,e[0]),q(e[3],e[0],e[1]),0)}function ue(e,t,r,i){var n,a=new Uint8Array(32),o=new Uint8Array(64),s=[m(),m(),m(),m()],c=[m(),m(),m(),m()];if(-1,r<64)return-1;if(ce(c,i))return-1;for(n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,M=String.fromCharCode;function N(e){throw new RangeError(o[e])}function s(e,t){var r=e.split("@"),i="";return 1>1,e+=z(e/t);455z((C-n)/p))&&N("overflow"),n+=l*p;var d=h<=o?1:o+26<=h?26:h-o;if(lz(C/m)&&N("overflow"),p*=m}var g=r.length+1;o=L(n-f,g,0==f),z(n/g)>C-a&&N("overflow"),a+=z(n/g),n%=g,r.splice(n++,0,a)}return String.fromCodePoint.apply(String,r)},u=function(e){var t=[],r=(e=D(e)).length,i=128,n=0,a=72,o=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(o=(u=f.next()).done);o=!0){var p=u.value;p<128&&t.push(M(p))}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}var h=t.length,l=h;for(h&&t.push("-");lz((C-n)/w)&&N("overflow"),n+=(d-i)*w,i=d;var k=!0,x=!1,S=void 0;try{for(var j,E=e[Symbol.iterator]();!(k=(j=E.next()).done);k=!0){var A=j.value;if(AC&&N("overflow"),A==i){for(var I=n,P=36;;P+=36){var O=P<=a?1:a+26<=P?26:P-a;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function l(e){for(var t="",r=0,i=e.length;rA-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(V,"g"),Y=new RegExp($,"g"),X=new RegExp(F("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',W),"g"),J=new RegExp(F("[^]",V,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),Q=J;function ee(e){var t=l(e);return t.match(Z)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,a={},o=r.query.split("&"),s=0,c=o.length;s",'"',"`"," ","\r","\n","\t"]),M=["'"].concat(n),N=["%","/","?",";","#"].concat(M),D=["/","?","#"],q=/^[+a-z0-9A-Z_-]{0,63}$/,L=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,U={javascript:!0,"javascript:":!0},H={javascript:!0,"javascript:":!0},K={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},V=e("querystring");function a(e,t,r){if(e&&F.isObject(e)&&e instanceof A)return e;var i=new A;return i.parse(e,t,r),i}A.prototype.parse=function(e,t,r){if(!F.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===e?"undefined":_typeof(e)));var i=e.indexOf("?"),n=-1!==i&&i>t&63|128)}function p(e){if(0==(4294967168&e))return s(e);var t="";return 0==(4294965248&e)?t=s(e>>6&31|192):0==(4294901760&e)?(u(e),t=s(e>>12&15|224),t+=f(e,6)):0==(4292870144&e)&&(t=s(e>>18&7|240),t+=f(e,12),t+=f(e,6)),t+=s(63&e|128)}function h(){if(a<=o)throw Error("Invalid byte index");var e=255&n[o];if(o++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,t;if(a>>10&1023|55296),t=56320|1023&t),n+=s(t);return n}(r)}};if("function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define(function(){return d});else if(t&&!t.nodeType)if(r)r.exports=d;else{var m={}.hasOwnProperty;for(var g in d)m.call(d,g)&&(t[g]=d[g])}else e.utf8=d}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],503:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],504:[function(e,t,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],505:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{"./support/isBuffer":504,_process:382,dup:70,inherits:320}],506:[function(e,t,r){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},{}],507:[function(e,t,r){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var n=new Uint8Array(16);t.exports=function(){return i(n),n}}else{var a=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}},{}],508:[function(e,t,r){var o=e("./lib/rng"),s=e("./lib/bytesToUuid");t.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var a=0;a<16;++a)t[i+a]=n[a];return t||s(n)}},{"./lib/bytesToUuid":506,"./lib/rng":507}],509:[function(e,t,r){var s=e("assert-plus"),i=e("util"),n=e("extsprintf"),c=e("core-util-is").isError,a=n.sprintf;function u(e){var t,r,i,n;if(s.object(e,"args"),s.bool(e.strict,"args.strict"),s.array(e.argv,"args.argv"),0===(t=e.argv).length)r={},i=[];else if(c(t[0]))r={cause:t[0]},i=t.slice(1);else if("object"===_typeof(t[0])){for(n in r={},t[0])r[n]=t[0][n];i=t.slice(1)}else s.string(t[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},i=t;return s.object(r),r.strict||e.strict||(i=i.map(function(e){return null===e?"null":void 0===e?"undefined":e})),{options:r,shortmessage:0===i.length?"":a.apply(null,i)}}function f(){var e,t,r,i,n,a,o;if(e=Array.prototype.slice.call(arguments,0),!(this instanceof f))return t=Object.create(f.prototype),f.apply(t,arguments),t;if((r=u({argv:e,strict:!1})).options.name&&(s.string(r.options.name,'error\'s "name" must be a string'),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,a=r.shortmessage,(i=r.options.cause)&&(s.ok(c(i),"cause is not an Error"),this.jse_cause=i,r.options.skipCauseMessage||(a+=": "+i.message)),this.jse_info={},r.options.info)for(o in r.options.info)this.jse_info[o]=r.options.info[o];return this.message=a,Error.call(this,a),Error.captureStackTrace&&(n=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,n)),this}function o(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof o?(i=(r=u({argv:e,strict:!0})).options,f.call(this,i,"%s",r.shortmessage),this):(t=Object.create(o.prototype),o.apply(t,arguments),t)}function p(e){s.array(e,"list of errors"),s.ok(0this._inputTypes.length&&!n.isObject(e[e.length-1]))return a.inputDefaultBlockNumberFormatter(e.pop())},s.prototype.toPayload=function(e){var t={};return e.length>this._inputTypes.length&&n.isObject(e[e.length-1])&&(t=e[e.length-1]),t.to=this._address,t.data="0x"+this.signature()+i.encodeParams(this._inputTypes,e),t},s.prototype.signature=function(){return o(this._name).slice(0,8)},s.prototype.unpackOutput=function(e){if(e){e=2<=e.length?e.slice(2):e;var t=i.decodeParams(this._outputTypes,e);return 1===t.length?t[0]:t}},s.prototype.call=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),i=this.extractCallback(e),t=this.extractDefaultBlock(e),r=this.toPayload(e);if(!i){var n=this._eth.call(r,t);return this.unpackOutput(n)}var a=this;this._eth.call(r,t,function(t,e){if(t)return i(t,null);var r=null;try{r=a.unpackOutput(e)}catch(e){t=e}i(t,r)})},s.prototype.sendTransaction=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),t=this.extractCallback(e),r=this.toPayload(e);if(0=this.buffer.length)){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,t}}},{key:"read",value:function(e){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,Array.from(t)}},{key:"readBool",value:function(){var e=this.read(1)[0];if(255===e)return!0;if(0===e)return!1;throw new n("read_bool() expected 0xff or 0x00; got +"+e)}},{key:"readVaruint",value:function(){for(var e=0,t=0,r=void 0;e|=(127&(r=this.read(1)[0]))< "+e);if(r>=7}}},{key:"writeByte",value:function(e){if(this.length>=this.buffer.length){var t=2*this.length,r=new Uint8Array(t);r.set(this.buffer,0),this.buffer=r}isNaN(e)?this.buffer[this.length]=e.codePointAt():this.buffer[this.length]=e,this.length++}},{key:"writeBytes",value:function(e){var t=this;e.forEach(function(e){t.writeByte(e)})}},{key:"writeVarbytes",value:function(e){this.writeVaruint(e.length),this.writeBytes(e)}},{key:"toString",value:function(){return this.buffer.toHex(0)}}]),e}();m.exports={StreamDeserialization:h,StreamSerialization:l,DeserializationError:n,BadMagicError:a,UnsupportedMajorVersion:o,TruncationError:s,TrailingGarbageError:c,RecursionLimitError:u,SerializerTypeError:f,SerializerValueError:p,ValueError:e,TypeError:t}}).call(this,d("buffer").Buffer)},{"./extend-error.js":568,"./utils.js":575,buffer:191}],567:[function(e,t,r){"use strict";var s=e("./ops.js"),c=e("./timestamp.js"),i=e("./utils.js"),u=e("./context.js"),f=[0,79,112,101,110,84,105,109,101,115,116,97,109,112,115,0,0,80,114,111,111,102,0,191,137,226,232,132,232,146,148],n=function(){function o(e,t){if(_classCallCheck2(this,o),!(e instanceof s.Op&&t instanceof c))throw new u.ValueError("Invalid Timestamp or fileHashOp");if(t.msg.length!==e._DIGEST_LENGTH())throw new u.ValueError("Timestamp message length and fileHashOp digest length differ");this.fileHashOp=e,this.timestamp=t}return _createClass(o,[{key:"fileDigest",value:function(){return this.timestamp.msg}},{key:"serialize",value:function(e){e.writeBytes(f),e.writeVaruint(1),this.fileHashOp.serialize(e),e.writeBytes(this.timestamp.msg),this.timestamp.serialize(e)}},{key:"serializeToBytes",value:function(){var e=new u.StreamSerialization;return this.serialize(e),e.getOutput()}},{key:"toString",value:function(){var e="DetachedTimestampFile\n";return e+="fileHashOp: "+this.fileHashOp.toString()+"\n",e+="timestamp: "+this.timestamp.toString()+"\n"}},{key:"toJson",value:function(){var e={};e.hash=i.bytesToHex(this.fileDigest()),e.op=this.fileHashOp._HASHLIB_NAME(),e.timestamp=this.timestamp.toJson()}},{key:"equals",value:function(e){return e instanceof o&&(!!e.fileHashOp.equals(this.fileHashOp)&&!!e.timestamp.equals(this.timestamp))}}],[{key:"deserialize",value:function(e){var t=void 0;if(e instanceof u.StreamDeserialization)t=e;else if(e instanceof Array)t=new u.StreamDeserialization(e);else if(e instanceof Uint8Array)t=new u.StreamDeserialization(Array.from(e));else{if(!(e instanceof ArrayBuffer))throw new Error("StreamDeserialization deserialize: Invalid param");t=new u.StreamDeserialization(Array.from(e))}t.assertMagic(f);var r=t.readVaruint();if(1!==r)throw new u.UnsupportedMajorVersion("Version "+r+" detached timestamp files are not supported");var i=s.CryptOp.deserialize(t),n=t.readBytes(i._DIGEST_LENGTH()),a=c.deserialize(t,n);return t.assertEof(),new o(i,a)}},{key:"fromBytes",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOp param");var r=void 0;if(t instanceof u.StreamDeserialization)r=e.hashFd(t);else if(t instanceof Array){var i=new u.StreamDeserialization(t);r=e.hashFd(i)}else if(t instanceof Uint8Array){var n=new u.StreamDeserialization(Array.from(t));r=e.hashFd(n)}else{if(!(t instanceof ArrayBuffer))throw new Error("DetachedTimestampFile: Invalid buffer param");var a=new u.StreamDeserialization(Array.from(t));r=e.hashFd(a)}return new o(e,new c(r))}},{key:"fromHash",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOpss param");if(t instanceof Array)return new o(e,new c(t));if(t instanceof ArrayBuffer||t instanceof Uint8Array)return new o(e,new c(Array.from(t)));throw new Error("DetachedTimestampFile: Invalid fdHash param")}}]),o}();t.exports=n},{"./context.js":566,"./ops.js":573,"./timestamp.js":574,"./utils.js":575}],568:[function(e,t,r){var n=e("util"),a=e("assert");Error.extend=function(r,i){a(r,"subTypeName is required");var e=function e(t){if(!(this instanceof e))return new e(t);try{Error.captureStackTrace(this,this.constructor)}catch(e){}this.name=r,this.code=i,this.message=t||"",this.stack=this.stack.replace("Error",this.toString())};return n.inherits(e,this),e.prototype.toString=function(){return this.name+": "+n.inspect(this.message)},e.extend=this.extend,e}},{assert:67,util:505}],569:[function(e,t,r){"use strict";var n=e("request-promise"),a=e("promise"),o=e("./blockstream.js"),s=e("./utils.js"),c=function(){function r(e,t){_classCallCheck2(this,r),this.urlBlockindex=e+"/block-index",this.urlBlock=e+"/block",this.timeout=1e3*t}return _createClass(r,[{key:"blockhash",value:function(e){var i={url:this.urlBlockindex+"/"+e,method:"GET",headers:{Accept:"application/json","User-Agent":"javascript-opentimestamps","Content-Type":"application/x-www-form-urlencoded"},json:!0,timeout:this.timeout};return new a(function(t,r){n(i).then(function(e){if(0===e.size)return console.error("Insight response error body "),void r(new Error("Insight response error body "));t(e.blockHash)}).catch(function(e){console.error("Insight response error: "+e.toString().substr(0,100)),r(e)})})}},{key:"block",value:function(e){var i={url:this.urlBlock+"/"+e,method:"GET",headers:{Accept:"application/json","User-Agent":"javascript-opentimestamps","Content-Type":"application/x-www-form-urlencoded"},json:!0,timeout:this.timeout};return new a(function(t,r){n(i).then(function(e){return e?e.merkleroot&&e.time?void t({merkleroot:e.merkleroot,time:e.time}):r(new Error("Insight response error body ")):(console.error("Insight response error body "),r(new Error("Insight response error body ")))}).catch(function(e){console.error("Insight response error: "+e.toString().substr(0,100)),r(e)})})}}]),r}(),u={bitcoin:["https://insight.bitpay.com/api","https://btc-bitcore1.trezor.io/api","https://btc-bitcore4.trezor.io/api","https://blockexplorer.com/api","https://bitcore.schmoock.net/insight-api"],litecoin:["https://ltc-bitcore1.trezor.io/api","https://insight.litecore.io/api"]},i=function(){function n(e){var r=this;_classCallCheck2(this,n),this.insights=[];var i=e&&Object.prototype.hasOwnProperty.call(e,"timeout")?e.timeout:10,t=e&&Object.prototype.hasOwnProperty.call(e,"chain")?e.chain:"bitcoin";(e&&Object.prototype.hasOwnProperty.call(e,"urls")&&1(new i)._MAX_URI_LENGTH())return console.error("URI exceeds maximum length"),!1;for(var t=0;ta.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=a.privateCalendars.length;else if(a.privateCalendars=[],a.calendars&&0!==a.calendars.length||(a.calendars=c.DEFAULT_AGGREGATORS),a.m&&0!==a.m){if(a.m<0||a.m>a.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=1,2<=a.calendars.length&&(a.m=2);o.createTimestamp(i,a.calendars,a.m,a.privateCalendars).then(function(e){if(void 0===e)return r(new Error("Error on timestamp creation"));t()}).catch(function(e){r(e)})})},createTimestamp:function(i,e,t,r){var n=[];return e&&e.forEach(function(e){var t=new c.RemoteCalendar(e);n.push(t.submit(i.msg)),console.log("Submitting to remote calendar "+e)}),r&&r.forEach(function(e,t){var r=new c.RemoteCalendar(t);r.setKey(e),n.push(r.submit(i.msg)),console.log("Submitting to remote calendar "+t)}),new Promise(function(t,r){Promise.all(n.map(f.softFail)).then(function(e){return e.filter(function(e){return!(e instanceof Error)&&void 0!==e}).forEach(function(e){i.merge(e)}),t(i)}).catch(function(e){r(e)})})},makeMerkleTree:function(e){var i=[];return e.forEach(function(e){if(e instanceof s)try{var t=f.randBytes(16),r=e.timestamp.add(new n.OpAppend(f.arrayToBytes(t))).add(new n.OpSHA256);i.push(r)}catch(e){return}else console.error("Invalid input")}),l.makeMerkleTree(i)},verify:function(e,t,i){if(!f.arrEq(e.fileDigest(),t.fileDigest()))return console.error("Expected digest "+f.bytesToHex(e.fileDigest())),console.error("File does not match original!"),new Promise(function(e,t){t(new Error("File does not match original!"))});var n=this;return new Promise(function(t,r){n.upgradeTimestamp(e.timestamp,i).then(function(){n.verifyTimestamp(e.timestamp,i).then(function(e){return t(e)}).catch(function(e){return r(e)})})})},verifyTimestamp:function(e,r){var i=[],n=this;function c(e,t){return e.attestedTimet.attestedTime?1:0}return e.allAttestations().forEach(function(e,t){i.push(n.verifyAttestation(e,t,r))}),new Promise(function(o,s){Promise.all(i.map(f.softFail)).then(function(e){var t=e.filter(function(e){return e.constructor===p.VerificationError?e:void 0});if(0this._MAX_MSG_LENGTH())){var t=this.call(e);return t.length>this._MAX_RESULT_LENGTH()&&console.error("Error : Result too long;"),t}console.error("Error : Message too long;")}}],[{key:"deserialize",value:function(e){return this.tag=e.readBytes(1)[0],t.deserializeFromTag(e,this.tag)}},{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return n.get(t).deserializeFromTag(e,t);console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),t=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t.arg=void 0===e?[]:e,t}return _inherits(r,c),_createClass(r,[{key:"serialize",value:function(e){_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"serialize",this).call(this,e),e.writeVarbytes(this.arg)}},{key:"toString",value:function(){return this._TAG_NAME()+" "+i.bytesToHex(this.arg)}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t)){var r=e.readVarbytes((new c)._MAX_RESULT_LENGTH(),1);return new(n.get(t))(r)}}}]),r}(),e=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 240}},{key:"_TAG_NAME",value:function(){return"append"}},{key:"call",value:function(e){return e.concat(this.arg)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),r=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 241}},{key:"_TAG_NAME",value:function(){return"prepend"}},{key:"call",value:function(e){return this.arg.concat(e)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),u=function(e){function t(){return _classCallCheck2(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,c),_createClass(t,[{key:"toString",value:function(){return this._TAG_NAME()}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return new(n.get(t));console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),f=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 242}},{key:"_TAG_NAME",value:function(){return"reverse"}},{key:"call",value:function(e){return 0===e.length&&console.error("Can't reverse an empty message"),e.reverse()}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),p=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 243}},{key:"_TAG_NAME",value:function(){return"hexlify"}},{key:"_MAX_MSG_LENGTH",value:function(){return u._MAX_RESULT_LENGTH()}},{key:"call",value:function(e){0===e.length&&console.error("Can't hexlify an empty message")}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),h=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_HASHLIB_NAME",value:function(){return 0}},{key:"call",value:function(e,t){for(var r=("keccak256"===e._HASHLIB_NAME()?s(e._HASHLIB_NAME()).update(a.from(t)):o.createHash(e._HASHLIB_NAME()).update(a.from(t))).digest(),i=[r.length],n=0;n(new m.Op)._MAX_MSG_LENGTH())throw new TypeError("Message exceeds Op length limit; "+e.length+" > "+(new m.Op)._MAX_MSG_LENGTH());this.msg=e,this.attestations=[],this.ops=new Map}return _createClass(h,[{key:"getDigest",value:function(){return this.msg}},{key:"serialize",value:function(r){var i=this;if(!this.attestations&&!this.ops)throw new a.ValueError("An empty timestamp can't be serialized");var e=this.attestations;if(e.sort(function(e,t){return e.compareTo(t)}),1 "+t.toString()+u(o,n,i)+"\n",f+=e.strTree(a+1,o)});else if(0>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},r.charsToHex=function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&i).toString(16))}return t.join("")},r.charToByte=function(e){return e.charCodeAt(0)},r.charsToBytes=function(e){for(var t=[],r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,f=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,p=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,l=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",i.copy(m[e])}function g(e){var t=e.match(o);if(!t)return!1;var r,i=+t[1],n=+t[2],a=+t[3];return 1<=n&&n<=12&&1<=a&&a<=(2!=n||((r=i)%4!=0||r%100==0&&r%400!=0)?s[n]:29)}function v(e,t){var r=e.match(c);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return(i<=23&&n<=59&&a<=59||23==i&&59==n&&60==a)&&(!t||o)}(t.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d},m.full={date:g,time:v,"date-time":function(e){var t=e.split(b);return 2==t.length&&g(t[0])&&v(t[1],!0)},uri:function(e){return y.test(e)&&a.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&n.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d};var b=/t|\s/i;var y=/\/|:/;var _=/[^\\]\\Z/;function w(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":12}],7:[function(e,t,r){"use strict";var I=e("./resolve"),P=e("./util"),O=e("./error_classes"),T=e("fast-json-stable-stringify"),B=e("../dotjs/validate"),C=P.ucs2length,F=e("fast-deep-equal"),R=O.Validation;function z(e,t,r){var i=n.call(this,e,t,r);return 0<=i?{index:i,compiling:!0}:{index:i=this._compilations.length,compiling:!(this._compilations[i]={schema:e,root:t,baseId:r})}}function M(e,t,r){var i=n.call(this,e,t,r);0<=i&&this._compilations.splice(i,1)}function n(e,t,r){for(var i=0;i",b=l?">":"<",y=void 0;if(g){var _=e.util.getData(m.$data,o,e.dataPathArr),w="exclusive"+a,k="exclType"+a,x="exclIsNumber"+a,S="' + "+(A="op"+a)+" + '";n+=" var schemaExcl"+a+" = "+_+"; ",n+=" var "+w+"; var "+k+" = typeof "+(_="schemaExcl"+a)+"; if ("+k+" != 'boolean' && "+k+" != 'undefined' && "+k+" != 'number') { ";var j;y=d;(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var E=n;n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+k+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+_+" "+v+"= "+i+") ? "+p+" "+b+"= "+_+" : "+p+" "+b+" "+i+" ) : ( ("+w+" = "+_+" === true) ? "+p+" "+b+"= "+i+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { var op"+a+" = "+w+" ? '"+v+"' : '"+v+"='; ",void 0===s&&(y=d,u=e.errSchemaPath+"/"+d,i=_,h=g)}else{S=v;if((x="number"==typeof m)&&h){var A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ( "+i+" === undefined || "+m+" "+v+"= "+i+" ? "+p+" "+b+"= "+m+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { "}else{x&&void 0===s?(w=!0,y=d,u=e.errSchemaPath+"/"+d,i=m,b+="="):(x&&(i=Math[l?"min":"max"](m,s)),m===(!x||i)?(w=!0,y=d,u=e.errSchemaPath+"/"+d,b+="="):(w=!1,S+="="));A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+" "+b+" "+i+" || "+p+" !== "+p+") { "}}y=y||t,(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+A+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+S+" ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";E=n;return n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s;var l="maxLength"==t?">":"<";n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+p+".length ":n+=" ucs2length("+p+") ",n+=" "+l+" "+i+") { ";var d=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+p+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.schema[t],a=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var f="valid"+c.level,p=c.baseId,h=!0,l=n;if(l)for(var d,m=-1,g=l.length-1;m "+E+") { ";var I=f+"["+E+"]";l.schema=j,l.schemaPath=s+"["+E+"]",l.errSchemaPath=c+"/"+E,l.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),l.dataPathArr[v]=E;var P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",i+=" } ",u&&(i+=" if ("+m+") { ",d+="}")}if("object"==(void 0===_?"undefined":_typeof(_))&&e.util.schemaHasRules(_,e.RULES.all)){l.schema=_,l.schemaPath=e.schemaPath+".additionalItems",l.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+f+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" } } ",u&&(i+=" if ("+m+") { ",d+="}")}}else if(e.util.schemaHasRules(o,e.RULES.all)){l.schema=o,l.schemaPath=s,l.errSchemaPath=c,i+=" for (var "+g+" = 0; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+d+" if ("+h+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],30:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="var division"+a+";if (",h&&(n+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),n+=" (division"+a+" = "+p+" / "+i+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var l=l||[];l.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var d=n;return n=l.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+d+"]); ":n+=" validate.errors = ["+d+"]; return false; ":n+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="errs__"+n,h=e.util.copy(e);h.level++;var l="valid"+h.level;if(e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+p+" = errors; ";var d,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(d=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,d&&(h.opts.allErrors=d),e.compositeRule=h.compositeRule=m,i+=" if ("+l+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var v=i;i=g.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ");return i}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="valid"+n,h="errs__"+n,l=e.util.copy(e),d="";l.level++;var m="valid"+l.level,g=l.baseId,v="prevValid"+n,b="passingSchemas"+n;i+="var "+h+" = errors , "+v+" = false , "+p+" = false , "+b+" = null; ";var y=e.compositeRule;e.compositeRule=l.compositeRule=!0;var _=o;if(_)for(var w,k=-1,x=_.length-1;k=e.opts.loopRequired,k=e.opts.ownProperties;if(u)if(i+=" var missing"+n+"; ",w){h||(i+=" var "+l+" = validate.schema"+s+"; ");var x="' + "+(P="schema"+n+"["+(E="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(_,P,e.opts.jsonPointers)),i+=" var "+p+" = true; ",h&&(i+=" if (schema"+n+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+n+")) "+p+" = false; else {"),i+=" for (var "+E+" = 0; "+E+" < "+l+".length; "+E+"++) { "+p+" = "+f+"["+l+"["+E+"]] !== undefined ",k&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", "+l+"["+E+"]) "),i+="; if (!"+p+") break; } ",h&&(i+=" } "),i+=" if (!"+p+") { ",(I=I||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+x+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var S=i;i=I.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var j=d;if(j)for(var E=-1,A=j.length-1;E 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(0<=d.indexOf("object")||0<=d.indexOf("array")))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var g="checkDataType"+(m?"s":"");n+=" if ("+e.util[g](d,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",l&&(n+=" } "),n+=" if (!"+h+") { ";var v=v||[];v.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var b=n;n=v.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { ")}else f&&(n+=" if (true) { ");return n}},{}],39:[function(e,t,r){"use strict";t.exports=function(i,e,t){var r="",n=!0===i.schema.$async,a=i.util.schemaHasRulesExcept(i.schema,i.RULES.all,"$ref"),o=i.self._getId(i.schema);if(i.isTop&&(r+=" var validate = ",n&&(i.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(i.opts.sourceCode||i.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof i.schema||!a&&!i.schema.$ref){e="false schema";var s=i.level,c=i.dataLevel,u=i.schema[e],f=i.schemaPath+i.util.getProperty(e),p=i.errSchemaPath+"/"+e,h=!i.opts.allErrors,l="data"+(c||""),d="valid"+s;if(!1===i.schema){i.isTop?h=!0:r+=" var "+d+" = false; ",(W=W||[]).push(r),r="",!1!==i.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(p)+" , params: {} ",!1!==i.opts.messages&&(r+=" , message: 'boolean schema is false' "),i.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+i.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var m=r;r=W.pop(),!i.compositeRule&&h?i.async?r+=" throw new ValidationError(["+m+"]); ":r+=" validate.errors = ["+m+"]; return false; ":r+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else i.isTop?r+=n?" return data; ":" validate.errors = null; return true; ":r+=" var "+d+" = true; ";return i.isTop&&(r+=" }; return validate; "),r}if(i.isTop){var g=i.isTop;s=i.level=0,c=i.dataLevel=0,l="data";i.rootId=i.resolve.fullPath(i.self._getId(i.root.schema)),i.baseId=i.baseId||i.rootId,delete i.isTop,i.dataPathArr=[void 0],r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{s=i.level,l="data"+((c=i.dataLevel)||"");if(o&&(i.baseId=i.resolve.url(i.baseId,o)),n&&!i.async)throw new Error("async schema in sync schema");r+=" var errs_"+s+" = errors;"}d="valid"+s,h=!i.opts.allErrors;var v="",b="",y=i.schema.type,_=Array.isArray(y);if(_&&1==y.length&&(y=y[0],_=!1),i.schema.$ref&&a){if("fail"==i.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+i.errSchemaPath+'" (see option extendRefs)');!0!==i.opts.extendRefs&&(a=!1,i.logger.warn('$ref: keywords ignored in schema at path "'+i.errSchemaPath+'"'))}if(i.schema.$comment&&i.opts.$comment&&(r+=" "+i.RULES.all.$comment.code(i,"$comment")),y){if(i.opts.coerceTypes)var w=i.util.coerceToTypes(i.opts.coerceTypes,y);var k=i.RULES.types[y];if(w||_||!0===k||k&&!Z(k)){f=i.schemaPath+".type",p=i.errSchemaPath+"/type",f=i.schemaPath+".type",p=i.errSchemaPath+"/type";var x=_?"checkDataTypes":"checkDataType";if(r+=" if ("+i.util[x](y,l,!0)+") { ",w){var S="dataType"+s,j="coerced"+s;r+=" var "+S+" = typeof "+l+"; ","array"==i.opts.coerceTypes&&(r+=" if ("+S+" == 'object' && Array.isArray("+l+")) "+S+" = 'array'; "),r+=" var "+j+" = undefined; ";var E="",A=w;if(A)for(var I,P=-1,O=A.length-1;P>6],n=0==(32&r);if(31==(31&r)){var a=r;for(r=0;128==(128&a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function p(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)o++;(n=new u(2+o))[0]=a,n[1]=128|o;s=1+o;for(var c=i.length;0>=8)n[s]=255&c;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new u(2*e.length),i=0;i>=7)n++}var o=new u(n),s=o.length-1;for(i=e.length-1;0<=i;i--){a=e[i];for(o[s--]=127&a;0<(a>>=7);)o[s--]=128|127&a}return this._createEncoderBuffer(o)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[c(i.getFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(i.getFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.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&&!u.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new u(r)}if(u.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new u(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var a=e;256<=a;a>>=8)i++;for(a=(n=new Array(i)).length-1;0<=a;a--)n[a]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new u(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var a=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),a.length!==n.defaultBuffer.length)return!1;for(i=0;i=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0===(t&=127))throw c("Indefinite length not supported");if(4this._size-i)return null;if(this._offset=i,0===this.length)return t?a.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?n:n.toString("utf8")},i.prototype.readOID=function(e){e||(e=s.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],i=0,n=0;n>0),r.join(".")},i.prototype._readTag=function(e){o.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw c("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(4this._size-r)return null;this._offset=r;for(var i=this._buf[this._offset],n=0,a=0;a>0},t.exports=i},{"./errors":60,"./types":63,assert:67,"safer-buffer":448}],63:[function(e,t,r){t.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},{}],64:[function(e,t,r){var n=e("assert"),a=e("safer-buffer").Buffer,o=e("./types"),i=e("./errors").newInvalidAsn1Error,s={size:1024,growthFactor:8};function c(e){var r,i;r=s,i=e||{},n.ok(r),n.equal(void 0===r?"undefined":_typeof(r),"object"),n.ok(i),n.equal(void 0===i?"undefined":_typeof(i),"object"),Object.getOwnPropertyNames(r).forEach(function(e){if(!i[e]){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,t)}}),e=i,this._buf=a.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw i(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},c.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=o.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&1 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;0>>24,e<<=8},c.prototype.writeNull=function(){this.writeByte(o.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=o.Enumeration),this.writeInt(e,t)},c.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=o.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},c.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+(void 0===e?"undefined":_typeof(e))+")");"number"!=typeof t&&(t=o.OctetString);var r=a.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},c.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!a.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},c.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(e){t.writeString(e)})},c.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=o.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),i=[];i.push(40*parseInt(r[0],10)+parseInt(r[1],10)),r.slice(2).forEach(function(e){var t,r;t=i,(r=parseInt(e,10))<128?t.push(r):(r<16384?t.push(r>>>7|128):(r<2097152?t.push(r>>>14|128):(r<268435456?t.push(r>>>21|128):(t.push(255&(r>>>28|128)),t.push(255&(r>>>21|128))),t.push(255&(r>>>14|128))),t.push(255&(r>>>7|128))),t.push(127&r))});var n=this;this._ensure(2+i.length),this.writeByte(t),this.writeLength(i.length),i.forEach(function(e){n.writeByte(e)})},c.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw i("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},c.prototype.startSequence=function(e){"number"!=typeof e&&(e=o.Sequence|o.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw i("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},c.prototype._shift=function(e,t,r){n.ok(void 0!==e),n.ok(void 0!==t),n.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},c.prototype._ensure=function(e){if(n.ok(e),this._size-this._offset>16&255,a[o++]=t>>8&255,a[o++]=255&t;var u,f;2===n&&(t=p[e.charCodeAt(c)]<<2|p[e.charCodeAt(c+1)]>>4,a[o++]=255&t);1===n&&(t=p[e.charCodeAt(c)]<<10|p[e.charCodeAt(c+1)]<<4|p[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],a=0,o=r-i;a>2]+s[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],p=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,a=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return a.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},{}],76:[function(e,t,r){"use strict";var y=e("tweetnacl").lowlevel.crypto_hash,s=0,c=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};function n(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}function u(e,t){var r,i=0;for(r=0;r<4;r++,s++)t<=s&&(s=0),i=i<<8|e[s];return i}c.prototype.encipher=function(e,t){void 0===t&&(t=new Uint8Array(e.buffer),0!==e.byteOffset&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=n(this.S,t,0)^this.P[r],e[0]^=n(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i},c.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);0!==e.byteOffset&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;0>>24,r[4*i+2]=a[i]>>>16,r[4*i+1]=a[i]>>>8,r[4*i+0]=a[i]}t.exports={BLOCKS:f,HASHSIZE:32,hash:_,pbkdf:function(e,t,r,i,n,a,o){var s,c,u,f,p,h,l=new Uint8Array(64),d=new Uint8Array(64),m=new Uint8Array(32),g=new Uint8Array(32),v=new Uint8Array(i+4),b=a;if(o<1)return-1;if(0===t||0===i||0===a||a>m.byteLength*m.byteLength||1<<20>>24,v[i+1]=h>>>16,v[i+2]=h>>>8,v[i+3]=h,y(d,v,i+4),_(l,d,g),s=m.byteLength;s--;)m[s]=g[s];for(s=1;sa[o]^r?1:-1;return c==u?0:u=t&&e<=r}function J(e){return"[object Array]"==Object.prototype.toString.call(e)}function Q(e,t,r){for(var i,n,a=[0],o=0,s=e.length;or-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}function ee(e,t){return(1(r=e.length)){for(i="0",t-=r;--t;i+="0");e+=i}else tt;)u[n]=0,n||(++a,u.unshift(1));for(o=u.length;!u[--o];);for(p=0,e="";p<=o;e+=U.charAt(u[p++]));e=te(e,a)}return e}function P(e,t,r,i){var n,a,o,s,c;if(r=null!=r&&k(r,0,8,i,q)?0|r:b,!e.c)return e.toString();if(n=e.c[0],o=e.e,null==t)c=Z(e.c),c=19==i||24==i&&o<=h?ee(c,o):te(c,o);else if(a=(e=C(new I(e),t,r)).e,s=(c=Z(e.c)).length,19==i||24==i&&(t<=a||a<=h)){for(;sy?e.c=e.e=null:e.c=r=p.length){if(!i)break e;for(;p.length<=u;p.push(0));c=f=0,o=(a%=K)-K+(n=1)}else{for(c=s=p[u],n=1;10<=s;s/=10,n++);f=(o=(a%=K)-K+n)<0?0:c/h[n-o-1]%10|0}if(i=i||t<0||null!=p[u+1]||(o<0?c:c%h[n-o-1]),i=r<4?(f||i)&&(0==r||r==(e.s<0?3:2)):5y?e.c=e.e=null:e.er)return null!=(e=n[r++])};return o(t="DECIMAL_PLACES")&&k(e,0,$,2,t)&&(d=0|e),i[t]=d,o(t="ROUNDING_MODE")&&k(e,0,8,2,t)&&(b=0|e),i[t]=b,o(t="EXPONENTIAL_AT")&&(J(e)?k(e[0],-$,0,2,t)&&k(e[1],0,$,2,t)&&(h=0|e[0],l=0|e[1]):k(e,-$,$,2,t)&&(h=-(l=0|(e<0?-e:e)))),i[t]=[h,l],o(t="RANGE")&&(J(e)?k(e[0],-$,-1,2,t)&&k(e[1],1,$,2,t)&&(m=0|e[0],y=0|e[1]):k(e,-$,$,2,t)&&(0|e?m=-(y=0|(e<0?-e:e)):w&&B(2,t+" cannot be zero",e))),i[t]=[m,y],o(t="ERRORS")&&(e===!!e||1===e||0===e?(_=0,k=(w=!!e)?O:X):w&&B(2,t+N,e)),i[t]=w,o(t="CRYPTO")&&(e===!!e||1===e||0===e?(x=!(!e||!F||"object"!=(void 0===F?"undefined":_typeof(F))),e&&!x&&w&&B(2,"crypto unavailable",F)):w&&B(2,t+N,e)),i[t]=x,o(t="MODULO_MODE")&&k(e,0,9,2,t)&&(S=0|e),i[t]=S,o(t="POW_PRECISION")&&k(e,0,$,2,t)&&(j=0|e),i[t]=j,o(t="FORMAT")&&("object"==(void 0===e?"undefined":_typeof(e))?E=e:w&&B(2,t+" not an object",e)),i[t]=E,i},I.max=function(){return n(arguments,i.lt)},I.min=function(){return n(arguments,i.gt)},I.random=(r=9007199254740992,u=Math.random()*r&2097151?function(){return D(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,n,a,o=0,s=[],c=new I(v);if(e=null!=e&&k(e,0,$,14)?0|e:d,n=M(e/K),x)if(F&&F.getRandomValues){for(t=F.getRandomValues(new Uint32Array(n*=2));o>>11))?(r=F.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(s.push(a%1e14),o+=2);o=n/2}else if(F&&F.randomBytes){for(t=F.randomBytes(n*=7);ot[n]?1:-1;break}return a}function A(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r](x[s]||0)&&o--,k<0)l.push(1),c=!0;else{for(b=x.length,_=S.length,k+=2,1<(u=D(n/(S[s=0]+1)))&&(S=j(S,u,n),x=j(x,u,n),_=S.length,b=x.length),v=_,m=(d=x.slice(0,_)).length;m<_;d[m++]=0);(w=S.slice()).unshift(0),y=S[0],S[1]>=n/2&&y++;do{if(u=0,(a=E(S,d,_,m))<0){if(g=d[0],_!=m&&(g=g*n+(d[1]||0)),1<(u=D(g/y)))for(n<=u&&(u=n-1),p=(f=j(S,u,n)).length,m=d.length;1==E(f,d,p,m);)u--,A(f,_this.c.length-2},i.isNaN=function(){return!this.s},i.isNegative=i.isNeg=function(){return this.s<0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.lessThan=i.lt=function(e,t){return _=8,Y(this,new I(e,t))<0},i.lessThanOrEqualTo=i.lte=function(e,t){return _=9,-1===(t=Y(this,new I(e,t)))||0===t},i.minus=i.sub=function(e,t){var r,i,n,a,o=this,s=o.s;if(_=10,t=(e=new I(e,t)).s,!s||!t)return new I(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/K,u=e.e/K,f=o.c,p=e.c;if(!c||!u){if(!f||!p)return f?(e.s=-t,e):new I(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new I(f[0]?o:3==b?-0:0)}if(c=W(c),u=W(u),f=f.slice(),s=c-u){for((n=(a=s<0)?(s=-s,f):(u=c,p)).reverse(),t=s;t--;n.push(0));n.reverse()}else for(i=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;tt&&(t=this.e+1),t},i.round=function(e,t){var r=new I(this);return(null==e||k(e,0,$,15))&&C(r,~~e+this.e+1,null!=t&&k(t,0,8,15,q)?0|t:b),r},i.shift=function(e){var t=this;return k(e,-a,a,16,"argument")?t.times("1e"+re(e)):new I(t.c&&t.c[0]&&(e<-a||at&&(r.c.length=t)}if(!(i=D(i/2)))break;n=n.times(n),t&&n.c&&n.c.length>t&&(n.c.length=t)}return e<0&&(r=v.div(r)),t?C(r,j,b):r},i.toPrecision=function(e,t){return P(this,null!=e&&k(e,1,$,24,"precision")?0|e:null,t,24)},i.toString=function(e){var t,r=this.s,i=this.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=Z(this.c),t=null!=e&&k(e,2,64,25,"base")?A(te(t,i),0|e,10,r):i<=h||l<=i?ee(t,i):te(t,i),r<0&&this.c[0]&&(t="-"+t)),t},i.truncated=i.trunc=function(){return C(new I(this),this.e+1,1)},i.valueOf=i.toJSON=function(){return this.toString()},null!=t&&I.config(t),I}(),"function"==typeof define&&define.amd)define(function(){return t});else if(void 0!==i&&i.exports){if(i.exports=t,!F)try{F=r("crypto")}catch(e){}}else e.BigNumber=t}(this)},{crypto:204}],78:[function(i,n,e){(function(e,t){"use strict";var r=n.exports;r.version="v"+i("./package.json").version,r.versionGuard=function(e){if(void 0!==e){throw new Error("More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.")}},r.versionGuard(e._bitcore),e._bitcore=r.version,r.crypto={},r.crypto.BN=i("./lib/crypto/bn"),r.crypto.ECDSA=i("./lib/crypto/ecdsa"),r.crypto.Hash=i("./lib/crypto/hash"),r.crypto.Random=i("./lib/crypto/random"),r.crypto.Point=i("./lib/crypto/point"),r.crypto.Signature=i("./lib/crypto/signature"),r.encoding={},r.encoding.Base58=i("./lib/encoding/base58"),r.encoding.Base58Check=i("./lib/encoding/base58check"),r.encoding.BufferReader=i("./lib/encoding/bufferreader"),r.encoding.BufferWriter=i("./lib/encoding/bufferwriter"),r.encoding.Varint=i("./lib/encoding/varint"),r.util={},r.util.buffer=i("./lib/util/buffer"),r.util.js=i("./lib/util/js"),r.util.preconditions=i("./lib/util/preconditions"),r.errors=i("./lib/errors"),r.Address=i("./lib/address"),r.Block=i("./lib/block"),r.MerkleBlock=i("./lib/block/merkleblock"),r.BlockHeader=i("./lib/block/blockheader"),r.HDPrivateKey=i("./lib/hdprivatekey.js"),r.HDPublicKey=i("./lib/hdpublickey.js"),r.Networks=i("./lib/networks"),r.Opcode=i("./lib/opcode"),r.PrivateKey=i("./lib/privatekey"),r.PublicKey=i("./lib/publickey"),r.Script=i("./lib/script"),r.Transaction=i("./lib/transaction"),r.URI=i("./lib/uri"),r.Unit=i("./lib/unit"),r.deps={},r.deps.bnjs=i("bn.js"),r.deps.bs58=i("bs58"),r.deps.Buffer=t,r.deps.elliptic=i("elliptic"),r.deps._=i("lodash"),r._HDKeyCache=i("./lib/hdkeycache"),r.Transaction.sighash=i("./lib/transaction/sighash")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i("buffer").Buffer)},{"./lib/address":79,"./lib/block":82,"./lib/block/blockheader":81,"./lib/block/merkleblock":83,"./lib/crypto/bn":84,"./lib/crypto/ecdsa":85,"./lib/crypto/hash":86,"./lib/crypto/point":87,"./lib/crypto/random":88,"./lib/crypto/signature":89,"./lib/encoding/base58":90,"./lib/encoding/base58check":91,"./lib/encoding/bufferreader":92,"./lib/encoding/bufferwriter":93,"./lib/encoding/varint":94,"./lib/errors":95,"./lib/hdkeycache":97,"./lib/hdprivatekey.js":98,"./lib/hdpublickey.js":99,"./lib/networks":100,"./lib/opcode":101,"./lib/privatekey":102,"./lib/publickey":103,"./lib/script":104,"./lib/transaction":107,"./lib/transaction/sighash":115,"./lib/unit":119,"./lib/uri":120,"./lib/util/buffer":121,"./lib/util/js":122,"./lib/util/preconditions":123,"./package.json":150,"bn.js":124,bs58:125,buffer:191,elliptic:127,lodash:149}],79:[function(e,t,r){(function(a){"use strict";var n=e("lodash"),o=e("./util/preconditions"),i=e("./errors"),s=e("./encoding/base58check"),c=e("./networks"),r=e("./crypto/hash"),u=e("./util/js"),f=e("./publickey");function p(e,t,r){if(!(this instanceof p))return new p(e,t,r);if(n.isArray(e)&&n.isNumber(t))return p.createMultisig(e,t,r);if(e instanceof p)return e;if(o.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!c.get(t))throw new TypeError('Second argument must be "livenet" or "testnet".');if(r&&r!==p.PayToPublicKeyHash&&r!==p.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||c.get(t)||c.defaultNetwork,i.type=i.type||r||p.PayToPublicKeyHash,u.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}p.prototype._classifyArguments=function(e,t,r){if((e instanceof a||e instanceof Uint8Array)&&20===e.length)return p._transformHash(e);if((e instanceof a||e instanceof Uint8Array)&&21===e.length)return p._transformBuffer(e,t,r);if(e instanceof f)return p._transformPublicKey(e);if(e instanceof h)return p._transformScript(e,t);if("string"==typeof e)return p._transformString(e,t,r);if(n.isObject(e))return p._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")},p.PayToPublicKeyHash="pubkeyhash",p.PayToScriptHash="scripthash",p._transformHash=function(e){var t={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==e.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t},p._transformObject=function(e){return o.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),o.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?new a(e.hash,"hex"):e.hashBuffer,network:c.get(e.network)||c.defaultNetwork,type:e.type}},p._classifyFromVersion=function(e){var t={},r=c.get(e[0],"pubkeyhash"),i=c.get(e[0],"scripthash");return r?(t.network=r,t.type=p.PayToPublicKeyHash):i&&(t.network=i,t.type=p.PayToScriptHash),t},p._transformBuffer=function(e,t,r){var i={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==e.length)throw new TypeError("Address buffers must be exactly 21 bytes.");t=c.get(t);var n=p._classifyFromVersion(e);if(!n.network||t&&t!==n.network)throw new TypeError("Address has mismatched network type.");if(!n.type||r&&r!==n.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=n.network,i.type=n.type,i},p._transformPublicKey=function(e){var t={};if(!(e instanceof f))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=r.sha256ripemd160(e.toBuffer()),t.type=p.PayToPublicKeyHash,t},p._transformScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new i.Script.CantDeriveAddress(e);return r},p.createMultisig=function(e,t,r){return r=r||e[0].network||c.defaultNetwork,p.payingTo(h.buildMultisigOut(e,t),r)},p._transformString=function(e,t,r){if("string"!=typeof e)throw new TypeError("data parameter supplied is not a string.");e=e.trim();var i=s.decode(e);return p._transformBuffer(i,t,r)},p.fromPublicKey=function(e,t){var r=p._transformPublicKey(e);return t=t||c.defaultNetwork,new p(r.hashBuffer,t,r.type)},p.fromPublicKeyHash=function(e,t){return new p(p._transformHash(e).hashBuffer,t,p.PayToPublicKeyHash)},p.fromScriptHash=function(e,t){return o.checkArgument(e,"hash parameter is required"),new p(p._transformHash(e).hashBuffer,t,p.PayToScriptHash)},p.payingTo=function(e,t){return o.checkArgument(e,"script is required"),o.checkArgument(e instanceof h,"script must be instance of Script"),p.fromScriptHash(r.sha256ripemd160(e.toBuffer()),t)},p.fromScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=p._transformScript(e,t);return new p(r.hashBuffer,t,r.type)},p.fromBuffer=function(e,t,r){var i=p._transformBuffer(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromString=function(e,t,r){var i=p._transformString(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromObject=function(e){return o.checkState(u.isHexa(e.hash),'Unexpected hash property, "'+e.hash+'", expected to be hex.'),new p(new a(e.hash,"hex"),e.network,e.type)},p.getValidationError=function(e,t,r){var i;try{new p(e,t,r)}catch(e){i=e}return i},p.isValid=function(e,t,r){return!p.getValidationError(e,t,r)},p.prototype.isPayToPublicKeyHash=function(){return this.type===p.PayToPublicKeyHash},p.prototype.isPayToScriptHash=function(){return this.type===p.PayToScriptHash},p.prototype.toBuffer=function(){var e=new a([this.network[this.type]]);return a.concat([e,this.hashBuffer])},p.prototype.toObject=p.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},p.prototype.toString=function(){return s.encode(this.toBuffer())},p.prototype.inspect=function(){return""},t.exports=p;var h=e("./script")}).call(this,e("buffer").Buffer)},{"./crypto/hash":86,"./encoding/base58check":91,"./errors":95,"./networks":100,"./publickey":103,"./script":104,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],80:[function(t,l,e){(function(o){"use strict";var r=t("lodash"),n=t("./blockheader"),i=t("../crypto/bn"),a=t("../util/buffer"),s=t("../encoding/bufferreader"),c=t("../encoding/bufferwriter"),u=t("../crypto/hash"),f=t("../transaction"),p=t("../util/preconditions");function h(e){return this instanceof h?(r.extend(this,h._from(e)),this):new h(e)}h.MAX_BLOCK_SIZE=1e6,h._from=function(e){var t={};if(a.isBuffer(e))t=h._fromBufferReader(s(e));else{if(!r.isObject(e))throw new TypeError("Unrecognized argument for Block");t=h._fromObject(e)}return t},h._fromObject=function(e){var t=[];return e.transactions.forEach(function(e){e instanceof f?t.push(e):t.push(f().fromObject(e))}),{header:n.fromObject(e.header),transactions:t}},h.fromObject=function(e){return new h(h._fromObject(e))},h._fromBufferReader=function(e){var t={};p.checkState(!e.finished(),"No block data received"),t.header=n.fromBufferReader(e);var r=e.readVarintNum();t.transactions=[];for(var i=0;i"},h.Values={START_OF_BLOCK:8,NULL_HASH:new o("0000000000000000000000000000000000000000000000000000000000000000","hex")},l.exports=h}).call(this,t("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../transaction":107,"../util/buffer":121,"../util/preconditions":123,"./blockheader":81,buffer:191,lodash:149}],81:[function(f,p,e){(function(i){"use strict";var n=f("lodash"),a=f("../crypto/bn"),o=f("../util/buffer"),s=f("../encoding/bufferreader"),t=f("../encoding/bufferwriter"),r=f("../crypto/hash"),c=(f("../util/js"),f("../util/preconditions")),u=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&c.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};u._from=function(e){var t={};if(o.isBuffer(e))t=u._fromBufferReader(s(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for BlockHeader");t=u._fromObject(e)}return t},u._fromObject=function(e){c.checkArgument(e,"data is required");var t=e.prevHash,r=e.merkleRoot;return n.isString(e.prevHash)&&(t=o.reverse(new i(e.prevHash,"hex"))),n.isString(e.merkleRoot)&&(r=o.reverse(new i(e.merkleRoot,"hex"))),{hash:e.hash,version:e.version,prevHash:t,merkleRoot:r,time:e.time,timestamp:e.time,bits:e.bits,nonce:e.nonce}},u.fromObject=function(e){var t=u._fromObject(e);return new u(t)},u.fromRawBlock=function(e){o.isBuffer(e)||(e=new i(e,"binary"));var t=s(e);t.pos=u.Constants.START_OF_HEADER;var r=u._fromBufferReader(t);return new u(r)},u.fromBuffer=function(e){var t=u._fromBufferReader(s(e));return new u(t)},u.fromString=function(e){var t=new i(e,"hex");return u.fromBuffer(t)},u._fromBufferReader=function(e){var t={};return t.version=e.readUInt32LE(),t.prevHash=e.read(32),t.merkleRoot=e.read(32),t.time=e.readUInt32LE(),t.bits=e.readUInt32LE(),t.nonce=e.readUInt32LE(),t},u.fromBufferReader=function(e){var t=u._fromBufferReader(e);return new u(t)},u.prototype.toObject=u.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:o.reverse(this.prevHash).toString("hex"),merkleRoot:o.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},u.prototype.toBuffer=function(){return this.toBufferWriter().concat()},u.prototype.toString=function(){return this.toBuffer().toString("hex")},u.prototype.toBufferWriter=function(e){return e||(e=new t),e.writeUInt32LE(this.version),e.write(this.prevHash),e.write(this.merkleRoot),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e},u.prototype.getTargetDifficulty=function(e){e=e||this.bits;for(var t=new a(16777215&e),r=8*((e>>>24)-3);0e+u.Constants.MAX_TIME_OFFSET)},u.prototype.validProofOfWork=function(){var e=new a(this.id,"hex"),t=this.getTargetDifficulty();return!(0"},u.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new a("10000000000000000000000000000000000000000000000000000000000000000","hex")},p.exports=u}).call(this,f("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],82:[function(e,t,r){t.exports=e("./block"),t.exports.BlockHeader=e("./blockheader"),t.exports.MerkleBlock=e("./merkleblock")},{"./block":80,"./blockheader":81,"./merkleblock":83}],83:[function(e,t,r){(function(s){"use strict";var n=e("lodash"),a=e("./blockheader"),o=e("../util/buffer"),r=e("../encoding/bufferreader"),i=e("../encoding/bufferwriter"),c=e("../crypto/hash"),u=(e("../util/js"),e("../transaction")),f=e("../util/preconditions");function p(e){if(!(this instanceof p))return new p(e);var t={};if(o.isBuffer(e))t=p._fromBufferReader(r(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for MerkleBlock");t={header:e.header instanceof a?e.header:a.fromObject(e.header),numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}return n.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}p.fromBuffer=function(e){return p.fromBufferReader(r(e))},p.fromBufferReader=function(e){return new p(p._fromBufferReader(e))},p.prototype.toBuffer=function(){return this.toBufferWriter().concat()},p.prototype.toBufferWriter=function(e){e||(e=new i),e.write(this.header.toBuffer()),e.writeUInt32LE(this.numTransactions),e.writeVarintNum(this.hashes.length);for(var t=0;tthis.numTransactions)return!1;if(8*this.flags.length8*this.flags.length)return null;var i=this.flags[r.flagBitsUsed>>3]>>>(7&r.flagBitsUsed++)&1;if(0!==e&&i){var n=this._traverseMerkleTree(e-1,2*t,r),a=n;return 2*t+1=this.hashes.length)return null;var o=this.hashes[r.hashesUsed++];return 0===e&&i&&r.txs.push(o),new s(o,"hex")},p.prototype._calcTreeWidth=function(e){return this.numTransactions+(1<>e},p.prototype._calcTreeHeight=function(){for(var e=0;1e.size?t=n.trim(t,i):i>1,o=d.getN(),s=d.getG(),c=a?r.add(o):r,u=d.fromX(n,c);if(!u.mul(o).isInfinity())throw new Error("nR is not a valid curve point");var f=t.neg().mod(o),p=r.invm(o),h=u.mul(i).add(s.mul(f)).mul(p);return m.fromPoint(h,this.sig.compressed)},h.prototype.sigError=function(){if(!f.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s;if(!(e.gt(l.Zero)&&e.lt(d.getN())&&t.gt(l.Zero)&&t.lt(d.getN())))return"r and s not in range";var r=l.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),i=d.getN(),n=t.invm(i),a=n.mul(r).mod(i),o=n.mul(e).mod(i),s=d.getG().mulAdd(a,this.pubkey.point,o);return s.isInfinity()?"p is infinity":0!==s.getX().mod(i).cmp(e)&&"Invalid signature"},h.toLowS=function(e){return e.gt(l.fromBuffer(new c("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=d.getN().sub(e)),e},h.prototype._findSignature=function(e,t){for(var r,i,n,a=d.getN(),o=d.getG(),s=0;(!this.k||0i)r=e(r);else if(r>>=8)}return r},e.exports=r}).call(this,i("_process"),i("buffer").Buffer)},{_process:382,buffer:191,crypto:204}],89:[function(e,r,t){(function(u){"use strict";var g=e("./bn"),v=e("lodash"),b=e("../util/preconditions"),y=e("../util/buffer"),t=e("../util/js"),o=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof g)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};o.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=void 0!==e.i?e.i:this.i,this.compressed=void 0!==e.compressed?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this},o.fromCompact=function(e){b.checkArgument(y.isBuffer(e),"Argument is expected to be a Buffer");var t=new o,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i+=4);var n=e.slice(1,33),a=e.slice(33,65);return b.checkArgument(0===i||1===i||2===i||3===i,new Error("i must be 0, 1, 2, or 3")),b.checkArgument(32===n.length,new Error("r must be 32 bytes")),b.checkArgument(32===a.length,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=g.fromBuffer(n),t.s=g.fromBuffer(a),t},o.fromDER=o.fromBuffer=function(e,t){var r=o.parseDER(e,t),i=new o;return i.r=r.r,i.s=r.s,i},o.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=new o.fromDER(r,!1);return i.nhashtype=t,i},o.fromString=function(e){var t=new u(e,"hex");return o.fromDER(t)},o.parseDER=function(e,t){b.checkArgument(y.isBuffer(e),new Error("DER formatted signature should be a buffer")),v.isUndefined(t)&&(t=!0);var r=e[0];b.checkArgument(48===r,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;b.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(2!==e[2])return!1;if(0===t)return!1;if(128&i[0])return!1;if(1=this.buf.length},e.prototype.read=function(e){r.checkArgument(!n.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t},e.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e},e.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e},e.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=o.fromBuffer(e);return this.pos=this.pos+8,t},e.prototype.readUInt64LEBN=function(){var e,t=this.buf.readUInt32LE(this.pos),r=4294967296*this.buf.readUInt32LE(this.pos+4)+t;if(r<=9007199254740991)e=new o(r);else{var i=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);e=new o(i,10,"le")}return this.pos=this.pos+8,e},e.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN().toNumber();if(t<=Math.pow(2,53))return t;throw new Error("number too large to retain precision - use readVarintBN");default:return e}},e.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return r.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t},e.prototype.readVarintBuf=function(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},e.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new o(this.readUInt16LE());case 254:return new o(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new o(e)}},e.prototype.reverse=function(){for(var e=new i(this.buf.length),t=0;t"},k.prototype.toObject=k.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:_.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},k.fromBuffer=function(e){return new k(e.toString())},k.prototype.toBuffer=function(){return _.copy(this._buffers.xprivkey)},k.DefaultDepth=0,k.DefaultFingerprint=0,k.DefaultChildIndex=0,k.MaxIndex=2*(k.Hardened=2147483648),k.RootElementAlias=["m","M","m'","M'"],k.VersionSize=4,k.DepthSize=1,k.ParentFingerPrintSize=4,k.ChildIndexSize=4,k.ChainCodeSize=32,k.PrivateKeySize=32,k.CheckSumSize=4,k.DataLength=78,k.SerializedByteSize=82,n((k.ChecksumEnd=(k.ChecksumStart=k.PrivateKeyEnd=(k.PrivateKeyStart=(k.ChainCodeEnd=(k.ChainCodeStart=k.ChildIndexEnd=(k.ChildIndexStart=k.ParentFingerPrintEnd=(k.ParentFingerPrintStart=k.DepthEnd=(k.DepthStart=k.VersionEnd=(k.VersionStart=0)+k.VersionSize)+k.DepthSize)+k.ParentFingerPrintSize)+k.ChildIndexSize)+k.ChainCodeSize)+1)+k.PrivateKeySize)+k.CheckSumSize)===k.SerializedByteSize),e.exports=k}).call(this,o("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./crypto/random":88,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdpublickey":99,"./networks":100,"./privatekey":102,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],99:[function(i,s,e){(function(u){"use strict";var n=i("lodash"),t=i("./util/preconditions"),f=i("./crypto/bn"),a=i("./encoding/base58"),p=i("./encoding/base58check"),h=i("./crypto/hash"),r=i("./hdprivatekey"),l=i("./hdkeycache"),d=i("./networks"),m=i("./crypto/point"),g=i("./publickey"),e=i("./errors"),v=e,b=e.HDPublicKey,o=i("assert"),y=i("./util/js"),_=i("./util/buffer");function w(e){if(e instanceof w)return e;if(!(this instanceof w))return new w(e);if(e){if(n.isString(e)||_.isBuffer(e)){var t=w.getSerializedError(e);if(t){if(_.isBuffer(e)&&!w.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof b.ArgumentIsPrivateExtended)return new r(e).hdPublicKey;throw t}return this._buildFromSerialized(e)}if(n.isObject(e))return e instanceof r?this._buildFromPrivate(e):this._buildFromObject(e);throw new b.UnrecognizedArgument(e)}throw new b.MustSupplyArgument}w.isValidPath=function(e){if(n.isString(e)){var t=r._getDerivationIndexes(e);return null!==t&&n.all(t,w.isValidPath)}return!!n.isNumber(e)&&(0<=e&&e"},w.prototype.toObject=w.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version)).name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:_.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},w.fromBuffer=function(e){return new w(e)},w.prototype.toBuffer=function(){return _.copy(this._buffers.xpubkey)},w.Hardened=2147483648,w.RootElementAlias=["m","M"],w.VersionSize=4,w.DepthSize=1,w.ParentFingerPrintSize=4,w.ChildIndexSize=4,w.ChainCodeSize=32,w.PublicKeySize=33,w.CheckSumSize=4,w.DataSize=78,w.SerializedByteSize=82,w.ChecksumEnd=(w.ChecksumStart=w.PublicKeyEnd=(w.PublicKeyStart=w.ChainCodeEnd=(w.ChainCodeStart=w.ChildIndexEnd=(w.ChildIndexStart=w.ParentFingerPrintEnd=(w.ParentFingerPrintStart=w.DepthEnd=(w.DepthStart=w.VersionEnd=(w.VersionStart=0)+w.VersionSize)+w.DepthSize)+w.ParentFingerPrintSize)+w.ChildIndexSize)+w.ChainCodeSize)+w.PublicKeySize)+w.CheckSumSize,o(w.PublicKeyEnd===w.DataSize),o(w.ChecksumEnd===w.SerializedByteSize),s.exports=w}).call(this,i("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdprivatekey":98,"./networks":100,"./publickey":103,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],100:[function(e,t,r){"use strict";var n=e("lodash"),i=e("./util/buffer"),a=e("./util/js"),o=[],s={};function c(){}function u(t,e){if(~o.indexOf(t))return t;if(!e)return s[t];n.isArray(e)||(e=[e]);var r=function(e){return o[i][e]===t};for(var i in o)if(n.any(e,r))return o[i]}function f(e){var t=new c;return a.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey}),e.networkMagic&&a.defineImmutable(t,{networkMagic:i.integerAsBuffer(e.networkMagic)}),e.port&&a.defineImmutable(t,{port:e.port}),e.dnsSeeds&&a.defineImmutable(t,{dnsSeeds:e.dnsSeeds}),n.each(t,function(e){n.isUndefined(e)||n.isObject(e)||(s[e]=t)}),o.push(t),t}c.prototype.toString=function(){return this.name},f({name:"livenet",alias:"mainnet",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var p=u("livenet");f({name:"testnet",alias:"regtest",pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956});var h=u("testnet"),l={PORT:18333,NETWORK_MAGIC:i.integerAsBuffer(185665799),DNS_SEEDS:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]};for(var d in l)n.isObject(l[d])||(s[l[d]]=h);var m={PORT:18444,NETWORK_MAGIC:i.integerAsBuffer(4206867930),DNS_SEEDS:[]};for(var d in m)n.isObject(m[d])||(s[m[d]]=h);Object.defineProperty(h,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.PORT:l.PORT}}),Object.defineProperty(h,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.NETWORK_MAGIC:l.NETWORK_MAGIC}}),Object.defineProperty(h,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.DNS_SEEDS:l.DNS_SEEDS}}),t.exports={add:f,remove:function(e){for(var t=0;t=a.map.OP_1&&e<=a.map.OP_16},a.prototype.inspect=function(){return""},c.exports=a}).call(this,s("buffer").Buffer)},{"./util/buffer":121,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],102:[function(h,l,e){(function(i){"use strict";var n=h("lodash"),r=h("./address"),a=h("./encoding/base58check"),o=h("./crypto/bn"),s=h("./util/js"),c=h("./networks"),u=h("./crypto/point"),e=h("./publickey"),f=h("./crypto/random"),t=h("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(e instanceof p)return e;var r=this._classifyArguments(e,t);if(!r.bn||0===r.bn.cmp(new o(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(u.getN()))throw new TypeError("Number must be less than N");if(void 0===r.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return s.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}p.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?c.get(t):c.defaultNetwork};if(n.isUndefined(e)||n.isNull(e))r.bn=p._getRandomBN();else if(e instanceof o)r.bn=e;else if(e instanceof i||e instanceof Uint8Array)r=p._transformBuffer(e,t);else if(e.bn&&e.network)r=p._transformObject(e);else if(!t&&c.get(e))r.bn=p._getRandomBN(),r.network=c.get(e);else{if("string"!=typeof e)throw new TypeError("First argument is an unrecognized data type.");s.isHexa(e)?r.bn=new o(new i(e,"hex")):r=p._transformWIF(e,t)}return r},p._getRandomBN=function(){var e,t;do{var r=f.getRandomBuffer(32);e=(t=o.fromBuffer(r)).lt(u.getN())}while(!e);return t},p._transformBuffer=function(e,t){var r={};if(32===e.length)return p._transformBNBuffer(e,t);if(r.network=c.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==c.get(t))throw new TypeError("Private key network mismatch");if(34===e.length&&1===e[33])r.compressed=!0;else{if(33!==e.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");r.compressed=!1}return r.bn=o.fromBuffer(e.slice(1,33)),r},p._transformBNBuffer=function(e,t){var r={};return r.network=c.get(t)||c.defaultNetwork,r.bn=o.fromBuffer(e),r.compressed=!1,r},p._transformWIF=function(e,t){return p._transformBuffer(a.decode(e),t)},p.fromBuffer=function(e,t){return new p(e,t)},p._transformObject=function(e){return{bn:new o(e.bn,"hex"),network:c.get(e.network),compressed:e.compressed}},p.fromString=p.fromWIF=function(e){return t.checkArgument(n.isString(e),"First argument is expected to be a string."),new p(e)},p.fromObject=function(e){return t.checkArgument(n.isObject(e),"First argument is expected to be an object."),new p(e)},p.fromRandom=function(e){return new p(p._getRandomBN(),e)},p.getValidationError=function(e,t){var r;try{new p(e,t)}catch(e){r=e}return r},p.isValid=function(e,t){return!!e&&!p.getValidationError(e,t)},p.prototype.toString=function(){return this.toBuffer().toString("hex")},p.prototype.toWIF=function(){var e,t=this.network;return e=this.compressed?i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32}),new i([1])]):i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32})]),a.encode(e)},p.prototype.toBigNumber=function(){return this.bn},p.prototype.toBuffer=function(){return this.bn.toBuffer()},p.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=e.fromPrivateKey(this)),this._pubkey},p.prototype.toAddress=function(e){var t=this.toPublicKey();return r.fromPublicKey(t,e||this.network)},p.prototype.toObject=p.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},p.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return""},l.exports=p}).call(this,h("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/point":87,"./crypto/random":88,"./encoding/base58check":91,"./networks":100,"./publickey":103,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],103:[function(t,r,e){(function(o){"use strict";var s=t("./crypto/bn"),c=t("./crypto/point"),e=t("./crypto/hash"),i=t("./util/js"),n=t("./networks"),u=t("lodash"),f=t("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(f.checkArgument(e,"First argument is required, please include public key data."),e instanceof p)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),i.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||n.defaultNetwork}),this}p.prototype._classifyArgs=function(e,t){var r={compressed:u.isUndefined(t.compressed)||t.compressed};if(e instanceof c)r.point=e;else if(e.x&&e.y)r=p._transformObject(e);else if("string"==typeof e)r=p._transformDER(new o(e,"hex"));else if(p._isBuffer(e))r=p._transformDER(e);else{if(!p._isPrivateKey(e))throw new TypeError("First argument is an unrecognized data format.");r=p._transformPrivateKey(e)}return r.network||(r.network=u.isUndefined(t.network)?void 0:n.get(t.network)),r},p._isPrivateKey=function(e){return e instanceof t("./privatekey")},p._isBuffer=function(e){return e instanceof o||e instanceof Uint8Array},p._transformPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=c.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t},p._transformDER=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r,i,n,a,o={};if(t=!!u.isUndefined(t)||t,4!==e[0]&&(t||6!==e[0]&&7!==e[0]))if(3===e[0])n=e.slice(1),r=new s(n),(o=p._transformX(!0,r)).compressed=!0;else{if(2!==e[0])throw new TypeError("Invalid DER format public key");n=e.slice(1),r=new s(n),(o=p._transformX(!1,r)).compressed=!0}else{if(n=e.slice(1,33),a=e.slice(33,65),32!==n.length||32!==a.length||65!==e.length)throw new TypeError("Length of x and y must be 32 bytes");r=new s(n),i=new s(a),o.point=new c(r,i),o.compressed=!1}return o},p._transformX=function(e,t){f.checkArgument("boolean"==typeof e,"Must specify whether y is odd or not (true or false)");var r={};return r.point=c.fromX(e,t),r},p._transformObject=function(e){var t=new s(e.x,"hex"),r=new s(e.y,"hex");return new p(new c(t,r),{compressed:e.compressed})},p.fromPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t=p._transformPrivateKey(e);return new p(t.point,{compressed:t.compressed,network:t.network})},p.fromDER=p.fromBuffer=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r=p._transformDER(e,t);return new p(r.point,{compressed:r.compressed})},p.fromPoint=function(e,t){return f.checkArgument(e instanceof c,"First argument must be an instance of Point."),new p(e,{compressed:t})},p.fromString=function(e,t){var r=new o(e,t||"hex"),i=p._transformDER(r);return new p(i.point,{compressed:i.compressed})},p.fromX=function(e,t){var r=p._transformX(e,t);return new p(r.point,{compressed:r.compressed})},p.getValidationError=function(e){var t;try{new p(e)}catch(e){t=e}return t},p.isValid=function(e){return!p.getValidationError(e)},p.prototype.toObject=p.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},p.prototype.toBuffer=p.prototype.toDER=function(){var e,t=this.point.getX(),r=this.point.getY(),i=t.toBuffer({size:32}),n=r.toBuffer({size:32});if(this.compressed){var a=n[n.length-1]%2;return e=new o(a?[3]:[2]),o.concat([e,i])}return e=new o([4]),o.concat([e,i,n])},p.prototype._getID=function(){return e.sha256ripemd160(this.toBuffer())},p.prototype.toAddress=function(e){return t("./address").fromPublicKey(this,e||this.network)},p.prototype.toString=function(){return this.toDER().toString("hex")},p.prototype.inspect=function(){return""},r.exports=p}).call(this,t("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./networks":100,"./privatekey":102,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],104:[function(e,t,r){t.exports=e("./script"),t.exports.Interpreter=e("./interpreter")},{"./interpreter":105,"./script":106}],105:[function(p,t,e){(function(e){"use strict";var R=p("lodash"),z=p("./script"),M=p("../opcode"),D=p("../crypto/bn"),N=p("../crypto/hash"),q=p("../crypto/signature"),L=p("../publickey"),U=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};U.prototype.verify=function(e,t,r,i,n){var a,o=p("../transaction");if(R.isUndefined(r)&&(r=new o),R.isUndefined(i)&&(i=0),R.isUndefined(n)&&(n=0),this.set({script:e,tx:r,nin:i,flags:n}),0!=(n&U.SCRIPT_VERIFY_SIGPUSHONLY)&&!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(!this.evaluate())return!1;n&U.SCRIPT_VERIFY_P2SH&&(a=this.stack.slice());var s=this.stack;if(this.initialize(),this.set({script:t,stack:s,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(0===this.stack.length)return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT");var c=this.stack[this.stack.length-1];if(!U.castToBool(c))return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK");if(n&U.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(0===a.length)throw new Error("internal error - stack copy empty");var u=a[a.length-1],f=z.fromBuffer(u);return a.pop(),this.initialize(),this.set({script:f,stack:a,tx:r,nin:i,flags:n}),!!this.evaluate()&&(0===a.length?!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK"):!!U.castToBool(a[a.length-1])||!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK"))}return!0},(t.exports=U).prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},U.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=void 0!==e.nin?e.nin:this.nin,this.stack=e.stack||this.stack,this.altstack=e.altack||this.altstack,this.pc=void 0!==e.pc?e.pc:this.pc,this.pbegincodehash=void 0!==e.pbegincodehash?e.pbegincodehash:this.pbegincodehash,this.nOpCount=void 0!==e.nOpCount?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=void 0!==e.flags?e.flags:this.flags},U.true=new e([1]),U.false=new e([]),U.MAX_SCRIPT_ELEMENT_SIZE=520,U.LOCKTIME_THRESHOLD_BN=new D(U.LOCKTIME_THRESHOLD=5e8),U.SCRIPT_VERIFY_NONE=0,U.SCRIPT_VERIFY_P2SH=1,U.SCRIPT_VERIFY_STRICTENC=2,U.SCRIPT_VERIFY_DERSIG=4,U.SCRIPT_VERIFY_LOW_S=8,U.SCRIPT_VERIFY_NULLDUMMY=16,U.SCRIPT_VERIFY_SIGPUSHONLY=32,U.SCRIPT_VERIFY_MINIMALDATA=64,U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,U.castToBool=function(e){for(var t=0;t=U.LOCKTIME_THRESHOLD&&e.gte(U.LOCKTIME_THRESHOLD_BN))&&(!e.gt(new D(this.tx.nLockTime))&&!!this.tx.inputs[this.nin].isFinal())},U.prototype.step=function(){var e,t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g,v=0!=(this.flags&U.SCRIPT_VERIFY_MINIMALDATA),b=-1===this.vfExec.indexOf(!1),y=this.script.chunks[this.pc];this.pc++;var _=y.opcodenum;if(R.isUndefined(_))return!(this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE");if(y.buf&&y.buf.length>U.MAX_SCRIPT_ELEMENT_SIZE)return!(this.errstr="SCRIPT_ERR_PUSH_SIZE");if(_>M.OP_16&&201<++this.nOpCount)return!(this.errstr="SCRIPT_ERR_OP_COUNT");if(_===M.OP_CAT||_===M.OP_SUBSTR||_===M.OP_LEFT||_===M.OP_RIGHT||_===M.OP_INVERT||_===M.OP_AND||_===M.OP_OR||_===M.OP_XOR||_===M.OP_2MUL||_===M.OP_2DIV||_===M.OP_MUL||_===M.OP_DIV||_===M.OP_MOD||_===M.OP_LSHIFT||_===M.OP_RSHIFT)return!(this.errstr="SCRIPT_ERR_DISABLED_OPCODE");if(b&&0<=_&&_<=M.OP_PUSHDATA4){if(v&&!this.script.checkMinimalPush(this.pc-1))return!(this.errstr="SCRIPT_ERR_MINIMALDATA");if(y.buf){if(y.len!==y.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(y.buf)}else this.stack.push(U.false)}else if(b||M.OP_IF<=_&&_<=M.OP_ENDIF)switch(_){case M.OP_1NEGATE:case M.OP_1:case M.OP_2:case M.OP_3:case M.OP_4:case M.OP_5:case M.OP_6:case M.OP_7:case M.OP_8:case M.OP_9:case M.OP_10:case M.OP_11:case M.OP_12:case M.OP_13:case M.OP_14:case M.OP_15:case M.OP_16:n=_-(M.OP_1-1),e=new D(n).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_NOP:break;case M.OP_NOP2:case M.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break}if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");var w=D.fromScriptNumBuffer(this.stack[this.stack.length-1],v,5);if(w.lt(new D(0)))return!(this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME");if(!this.checkLockTime(w))return!(this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME");break;case M.OP_NOP1:case M.OP_NOP3:case M.OP_NOP4:case M.OP_NOP5:case M.OP_NOP6:case M.OP_NOP7:case M.OP_NOP8:case M.OP_NOP9:case M.OP_NOP10:if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break;case M.OP_IF:case M.OP_NOTIF:if(m=!1,b){if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");e=this.stack.pop(),m=U.castToBool(e),_===M.OP_NOTIF&&(m=!m)}this.vfExec.push(m);break;case M.OP_ELSE:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case M.OP_ENDIF:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec.pop();break;case M.OP_VERIFY:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],!(m=U.castToBool(e)))return!(this.errstr="SCRIPT_ERR_VERIFY");this.stack.pop();break;case M.OP_RETURN:return!(this.errstr="SCRIPT_ERR_OP_RETURN");case M.OP_TOALTSTACK:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.altstack.push(this.stack.pop());break;case M.OP_FROMALTSTACK:if(this.altstack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION");this.stack.push(this.altstack.pop());break;case M.OP_2DROP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop(),this.stack.pop();break;case M.OP_2DUP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1],this.stack.push(t),this.stack.push(r);break;case M.OP_3DUP:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-3],r=this.stack[this.stack.length-2];var k=this.stack[this.stack.length-1];this.stack.push(t),this.stack.push(r),this.stack.push(k);break;case M.OP_2OVER:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-4],r=this.stack[this.stack.length-3],this.stack.push(t),this.stack.push(r);break;case M.OP_2ROT:if(this.stack.length<6)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-6,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_2SWAP:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-4,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_IFDUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-1],(m=U.castToBool(e))&&this.stack.push(e);break;case M.OP_DEPTH:e=new D(this.stack.length).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_DROP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop();break;case M.OP_DUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-1]);break;case M.OP_NIP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,1);break;case M.OP_OVER:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-2]);break;case M.OP_PICK:case M.OP_ROLL:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],n=(s=D.fromScriptNumBuffer(e,v)).toNumber(),this.stack.pop(),n<0||n>=this.stack.length)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-n-1],_===M.OP_ROLL&&this.stack.splice(this.stack.length-n-1,1),this.stack.push(e);break;case M.OP_ROT:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-3],o=this.stack[this.stack.length-2];var x=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=o,this.stack[this.stack.length-2]=x,this.stack[this.stack.length-1]=a;break;case M.OP_SWAP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-2],o=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=o,this.stack[this.stack.length-1]=a;break;case M.OP_TUCK:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case M.OP_SIZE:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");s=new D(this.stack[this.stack.length-1].length),this.stack.push(s.toScriptNumBuffer());break;case M.OP_EQUAL:case M.OP_EQUALVERIFY:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1];var S=t.toString("hex")===r.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(S?U.true:U.false),_===M.OP_EQUALVERIFY){if(!S)return!(this.errstr="SCRIPT_ERR_EQUALVERIFY");this.stack.pop()}break;case M.OP_1ADD:case M.OP_1SUB:case M.OP_NEGATE:case M.OP_ABS:case M.OP_NOT:case M.OP_0NOTEQUAL:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(e=this.stack[this.stack.length-1],s=D.fromScriptNumBuffer(e,v),_){case M.OP_1ADD:s=s.add(D.One);break;case M.OP_1SUB:s=s.sub(D.One);break;case M.OP_NEGATE:s=s.neg();break;case M.OP_ABS:s.cmp(D.Zero)<0&&(s=s.neg());break;case M.OP_NOT:s=new D((0===s.cmp(D.Zero))+0);break;case M.OP_0NOTEQUAL:s=new D((0!==s.cmp(D.Zero))+0)}this.stack.pop(),this.stack.push(s.toScriptNumBuffer());break;case M.OP_ADD:case M.OP_SUB:case M.OP_BOOLAND:case M.OP_BOOLOR:case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:case M.OP_NUMNOTEQUAL:case M.OP_LESSTHAN:case M.OP_GREATERTHAN:case M.OP_LESSTHANOREQUAL:case M.OP_GREATERTHANOREQUAL:case M.OP_MIN:case M.OP_MAX:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(c=D.fromScriptNumBuffer(this.stack[this.stack.length-2],v),u=D.fromScriptNumBuffer(this.stack[this.stack.length-1],v),s=new D(0),_){case M.OP_ADD:s=c.add(u);break;case M.OP_SUB:s=c.sub(u);break;case M.OP_BOOLAND:s=new D((0!==c.cmp(D.Zero)&&0!==u.cmp(D.Zero))+0);break;case M.OP_BOOLOR:s=new D((0!==c.cmp(D.Zero)||0!==u.cmp(D.Zero))+0);break;case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:s=new D((0===c.cmp(u))+0);break;case M.OP_NUMNOTEQUAL:s=new D((0!==c.cmp(u))+0);break;case M.OP_LESSTHAN:s=new D((c.cmp(u)<0)+0);break;case M.OP_GREATERTHAN:s=new D((0"},v.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==c.OP_DUP||this.chunks[1].opcodenum!==c.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==c.OP_EQUALVERIFY||this.chunks[4].opcodenum!==c.OP_CHECKSIG)},v.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&48===e[0]&&t&&t.length){var r=t[0];if((4===r||6===r||7===r)&&65===t.length)return!0;if((3===r||2===r)&&33===t.length)return!0}}return!1},v.prototype.getPublicKey=function(){return p.checkState(this.isPublicKeyOut(),"Can't retreive PublicKey from a non-PK output"),this.chunks[0].buf},v.prototype.getPublicKeyHash=function(){return p.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},v.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===c.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if((4!==t&&6!==t&&7!==t||65!==e.length)&&(3!==t&&2!==t||33!==e.length)||(r=!0),r)return u.isValid(e)}return!1},v.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var e=this.chunks[0].buf;if(e&&e.length&&48===e[0])return!0}return!1},v.prototype.isScriptHashOut=function(){var e=this.toBuffer();return 23===e.length&&e[0]===c.OP_HASH160&&20===e[1]&&e[e.length-1]===c.OP_EQUAL},v.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e,t=this.chunks[this.chunks.length-1].buf;if(!t)return!1;try{e=v.fromBuffer(t)}catch(e){if(e instanceof l.Script.InvalidBuffer)return!1;throw e}return e.classify()!==v.types.UNKNOWN},v.prototype.isMultisigOut=function(){return 3=c.OP_1&&e<=c.OP_16)return e-(c.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))},v.prototype.getSignatureOperationsCount=function(r){r=!!h.isUndefined(r)||r;var i=this,n=0,a=c.OP_INVALIDOPCODE;return h.each(i.chunks,function(e){var t=e.opcodenum;t==c.OP_CHECKSIG||t==c.OP_CHECKSIGVERIFY?n++:t!=c.OP_CHECKMULTISIG&&t!=c.OP_CHECKMULTISIGVERIFY||(r&&a>=c.OP_1&&a<=c.OP_16?n+=i._decodeOP_N(a):n+=20),a=t}),n},t.exports=v}).call(this,e("buffer").Buffer)},{"../address":79,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../networks":100,"../opcode":101,"../publickey":103,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],107:[function(e,t,r){t.exports=e("./transaction"),t.exports.Input=e("./input"),t.exports.Output=e("./output"),t.exports.UnspentOutput=e("./unspentoutput"),t.exports.Signature=e("./signature"),t.exports.Sighash=e("./sighash")},{"./input":108,"./output":114,"./sighash":115,"./signature":116,"./transaction":117,"./unspentoutput":118}],108:[function(e,t,r){t.exports=e("./input"),t.exports.PublicKey=e("./publickey"),t.exports.PublicKeyHash=e("./publickeyhash"),t.exports.MultiSig=e("./multisig.js"),t.exports.MultiSigScriptHash=e("./multisigscripthash.js")},{"./input":109,"./multisig.js":110,"./multisigscripthash.js":111,"./publickey":112,"./publickeyhash":113}],109:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../../util/preconditions"),a=e("../../errors"),o=e("../../encoding/bufferwriter"),s=e("buffer"),c=e("../../util/buffer"),u=e("../../util/js"),f=e("../../script"),p=e("../sighash"),h=e("../output"),l=4294967295;function d(e){return this instanceof d?e?this._fromObject(e):void 0:new d(e)}d.MAXINT=l,d.DEFAULT_SEQNUMBER=4294967295,d.DEFAULT_LOCKTIME_SEQNUMBER=4294967294,d.DEFAULT_RBF_SEQNUMBER=4294967293,Object.defineProperty(d.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new f(this._scriptBuffer),this._script._isInput=!0),this._script)}}),d.fromObject=function(e){return n.checkArgument(i.isObject(e)),(new d)._fromObject(e)},d.prototype._fromObject=function(e){var t;if(t=i.isString(e.prevTxId)&&u.isHexa(e.prevTxId)?new s.Buffer(e.prevTxId,"hex"):e.prevTxId,this.output=e.output?e.output instanceof h?e.output:new h(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=i.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=i.isUndefined(e.sequenceNumber)?i.isUndefined(e.seqnum)?4294967295:e.seqnum:e.sequenceNumber,i.isUndefined(e.script)&&i.isUndefined(e.scriptBuffer))throw new a.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this},d.prototype.toObject=d.prototype.toJSON=function(){var e={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(e.scriptString=this.script.toString()),this.output&&(e.output=this.output.toObject()),e},d.fromBufferReader=function(e){var t=new d;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t},d.prototype.toBufferWriter=function(e){e||(e=new o),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e},d.prototype.setScript=function(e){if(this._script=null,e instanceof f)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(u.isHexa(e))this._scriptBuffer=new s.Buffer(e,"hex");else if(i.isString(e))this._script=new f(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!c.isBuffer(e))throw new TypeError("Invalid argument type: script");this._scriptBuffer=new s.Buffer(e)}return this},d.prototype.getSignatures=function(){throw new a.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},d.prototype.isFullySigned=function(){throw new a.AbstractMethodInvoked("Input#isFullySigned")},d.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},d.prototype.addSignature=function(){throw new a.AbstractMethodInvoked("Input#addSignature")},d.prototype.clearSignatures=function(){throw new a.AbstractMethodInvoked("Input#clearSignatures")},d.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},d.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},d.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},t.exports=d},{"../../encoding/bufferwriter":93,"../../errors":95,"../../script":104,"../../util/buffer":121,"../../util/js":122,"../../util/preconditions":123,"../output":114,"../sighash":115,buffer:191,lodash:149}],110:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=(e("../transaction"),e("./input")),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),u.checkState(o.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.output.script),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},l.normalizeSignatures=function(n,a,o,e,t){return t.map(function(r){var i=null;return e=e.filter(function(e){if(i)return!0;var t=new h({signature:f.fromTxFormat(e),publicKey:r,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:o,sigtype:f.SIGHASH_ALL});return t.signature.nhashtype=t.sigtype,!p.verify(n,t.signature,t.publicKey,t.inputIndex,a.output.script)||(i=t,!1)}),i||null})},l.OPCODES_SIZE=1,l.SIGNATURE_SIZE=73,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"../transaction":117,"./input":109,inherits:148,lodash:149}],111:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=e("./input"),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),this.redeemScript=o.buildMultisigOut(this.publicKeys,r),u.checkState(o.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.redeemScript),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript)},l.OPCODES_SIZE=7,l.SIGNATURE_SIZE=74,l.PUBKEY_SIZE=34,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE+this.publicKeys.length*l.PUBKEY_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148,lodash:149}],112:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),n=(e("../../util/buffer"),e("./input")),o=e("../output"),s=e("../sighash"),c=e("../../script"),u=e("../../crypto/signature"),f=e("../signature");function p(){n.apply(this,arguments)}i(p,n),p.prototype.getSignatures=function(e,t,r,i){a.checkState(this.output instanceof o),i=i||u.SIGHASH_ALL;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new f({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:s.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},p.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(c.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this},p.prototype.clearSignatures=function(){return this.setScript(c.empty()),this},p.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},p.SCRIPT_MAX_SIZE=73,p.prototype._estimateSize=function(){return p.SCRIPT_MAX_SIZE},t.exports=p},{"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],113:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),o=e("../../util/buffer"),s=e("../../crypto/hash"),n=e("./input"),c=e("../output"),u=e("../sighash"),f=e("../../script"),p=e("../../crypto/signature"),h=e("../signature");function l(){n.apply(this,arguments)}i(l,n),l.prototype.getSignatures=function(e,t,r,i,n){return a.checkState(this.output instanceof c),n=n||s.sha256ripemd160(t.publicKey.toBuffer()),i=i||p.SIGHASH_ALL,o.equals(n,this.output.script.getPublicKeyHash())?[new h({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:u.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},l.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(f.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this},l.prototype.clearSignatures=function(){return this.setScript(f.empty()),this},l.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()},l.SCRIPT_MAX_SIZE=107,l.prototype._estimateSize=function(){return l.SCRIPT_MAX_SIZE},t.exports=l},{"../../crypto/hash":86,"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],114:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../crypto/bn"),a=e("buffer"),o=e("../util/buffer"),s=e("../util/js"),c=e("../encoding/bufferwriter"),u=e("../script"),f=e("../util/preconditions"),p=e("../errors");function h(e){if(!(this instanceof h))return new h(e);if(!i.isObject(e))throw new TypeError("Unrecognized argument for Output");var t;this.satoshis=e.satoshis,o.isBuffer(e.script)?this._scriptBuffer=e.script:(t=i.isString(e.script)&&s.isHexa(e.script)?new a.Buffer(e.script,"hex"):e.script,this.setScript(t))}Object.defineProperty(h.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script||this.setScriptFromBuffer(this._scriptBuffer),this._script}}),Object.defineProperty(h.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof n?(this._satoshisBN=e,this._satoshis=e.toNumber()):i.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=n.fromNumber(this._satoshis)):(f.checkArgument(s.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=n.fromNumber(e),this._satoshis=e),f.checkState(s.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),h.prototype.invalidSatoshis=function(){return 9007199254740991"},h.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return t.script=0!==r?e.read(r):new a.Buffer([]),new h(t)},h.prototype.toBufferWriter=function(e){e||(e=new c),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e},t.exports=h},{"../crypto/bn":84,"../encoding/bufferwriter":93,"../errors":95,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],115:[function(y,e,t){(function(f){"use strict";var p=y("buffer"),h=y("../crypto/signature"),l=y("../script"),d=y("./output"),m=y("../encoding/bufferreader"),g=y("../encoding/bufferwriter"),v=y("../crypto/bn"),b=y("../crypto/hash"),o=y("../crypto/ecdsa"),s=y("../util/preconditions"),c=y("lodash"),u=function(e,t,r,i){var n,a=y("./transaction"),o=y("./input"),s=a.shallowCopy(e);for((i=new l(i)).removeCodeseparators(),n=0;n=s.outputs.length)return new f("0000000000000000000000000000000000000000000000000000000000000001","hex");for(s.outputs.length=r+1,n=0;n"},S.prototype.toBuffer=function(){var e=new u;return this.toBufferWriter(e).toBuffer()},S.prototype.toBufferWriter=function(t){return t.writeUInt32LE(this.version),t.writeVarintNum(this.inputs.length),s.each(this.inputs,function(e){e.toBufferWriter(t)}),t.writeVarintNum(this.outputs.length),s.each(this.outputs,function(e){e.toBufferWriter(t)}),t.writeUInt32LE(this.nLockTime),t},S.prototype.fromBuffer=function(e){var t=new c(e);return this.fromBufferReader(t)},S.prototype.fromBufferReader=function(e){var t,r,i;for(a.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readUInt32LE(),r=e.readVarintNum(),t=0;t=this.inputs.length)throw new n.Transaction.InvalidIndex(e,this.inputs.length);var i=this.inputs[e];this.inputs=s.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()},S.prototype.sign=function(e,t){a.checkState(this.hasAllUtxoInfo());var r=this;return s.isArray(e)?s.each(e,function(e){r.sign(e,t)}):s.each(this.getSignatures(e,t),function(e){r.applySignature(e)}),this},S.prototype.getSignatures=function(r,i){r=new k(r),i=i||p.SIGHASH_ALL;var n=this,a=[],o=f.sha256ripemd160(r.publicKey.toBuffer());return s.each(this.inputs,function(e,t){s.each(e.getSignatures(n,r,t,i,o),function(e){a.push(e)})}),a},S.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this},S.prototype.isFullySigned=function(){return s.each(this.inputs,function(e){if(e.isFullySigned===m.prototype.isFullySigned)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),s.all(s.map(this.inputs,function(e){return e.isFullySigned()}))},S.prototype.isValidSignature=function(e){if(this.inputs[e.inputIndex].isValidSignature===m.prototype.isValidSignature)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e)},S.prototype.verifySignature=function(e,t,r,i){return h.verify(this,e,t,r,i)},S.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var e=new x(0),t=0;t=m.MAXINT-1&&(t.sequenceNumber=m.DEFAULT_RBF_SEQNUMBER)}return this},I.exports=S}).call(this,A("buffer").Buffer)},{"../address":79,"../crypto/bn":84,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../privatekey":102,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"./input":108,"./output":114,"./sighash":115,"./unspentoutput":118,buffer:191,"buffer-compare":126,lodash:149}],118:[function(e,t,r){"use strict";var o=e("lodash"),s=e("../util/preconditions"),c=e("../util/js"),u=e("../script"),f=e("../address"),p=e("../unit");function h(e){if(!(this instanceof h))return new h(e);s.checkArgument(o.isObject(e),"Must provide an object from where to extract data");var t=e.address?new f(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!c.isHexaString(r)||64"},h.prototype.toString=function(){return this.txId+":"+this.outputIndex},h.fromObject=function(e){return new h(e)},h.prototype.toObject=h.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:p.fromSatoshis(this.satoshis).toBTC()}},t.exports=h},{"../address":79,"../script":104,"../unit":119,"../util/js":122,"../util/preconditions":123,lodash:149}],119:[function(e,t,r){"use strict";var i=e("lodash"),n=e("./errors"),a=e("./util/preconditions"),o={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function s(e,t){if(!(this instanceof s))return new s(e,t);if(i.isNumber(t)){if(t<=0)throw new n.Unit.InvalidRate(t);e/=t,t=s.BTC}this._value=this._from(e,t);var r=this;Object.keys(o).forEach(function(e){Object.defineProperty(r,e,{get:function(){return r.to(e)},enumerable:!0})})}Object.keys(o).forEach(function(e){s[e]=e}),s.fromObject=function(e){return a.checkArgument(i.isObject(e),"Argument is expected to be an object"),new s(e.amount,e.code)},s.fromBTC=function(e){return new s(e,s.BTC)},s.fromMillis=s.fromMilis=function(e){return new s(e,s.mBTC)},s.fromMicros=s.fromBits=function(e){return new s(e,s.bits)},s.fromSatoshis=function(e){return new s(e,s.satoshis)},s.fromFiat=function(e,t){return new s(e,t)},s.prototype._from=function(e,t){if(!o[t])throw new n.Unit.UnknownCode(t);return parseInt((e*o[t][0]).toFixed())},s.prototype.to=function(e){if(i.isNumber(e)){if(e<=0)throw new n.Unit.InvalidRate(e);return parseFloat((this.BTC*e).toFixed(2))}if(!o[e])throw new n.Unit.UnknownCode(e);var t=this._value/o[e][0];return parseFloat(t.toFixed(o[e][1]))},s.prototype.toBTC=function(){return this.to(s.BTC)},s.prototype.toMillis=s.prototype.toMilis=function(){return this.to(s.mBTC)},s.prototype.toMicros=s.prototype.toBits=function(){return this.to(s.bits)},s.prototype.toSatoshis=function(){return this.to(s.satoshis)},s.prototype.atRate=function(e){return this.to(e)},s.prototype.toString=function(){return this.satoshis+" satoshis"},s.prototype.toObject=s.prototype.toJSON=function(){return{amount:this.BTC,code:s.BTC}},s.prototype.inspect=function(){return""},t.exports=s},{"./errors":95,"./util/preconditions":123,lodash:149}],120:[function(e,t,r){"use strict";var i=e("lodash"),n=e("url"),a=e("./address"),o=e("./unit"),s=function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.extras={},this.knownParams=r||[],this.address=this.network=this.amount=this.message=null,"string"==typeof t){var i=e.parse(t);i.amount&&(i.amount=this._parseAmount(i.amount)),this._fromObject(i)}else{if("object"!==(void 0===t?"undefined":_typeof(t)))throw new TypeError("Unrecognized data format.");this._fromObject(t)}};s.fromString=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return new s(e)},s.fromObject=function(e){return new s(e)},s.isValid=function(e,t){try{new s(e,t)}catch(e){return!1}return!0},s.parse=function(e){var t=n.parse(e,!0);if("bitcoin:"!==t.protocol)throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(e);return t.query.address=r&&r[1]||void 0,t.query},s.Members=["address","amount","message","label","r"],s.prototype._fromObject=function(e){if(!a.isValid(e.address))throw new TypeError("Invalid bitcoin address");for(var t in this.address=new a(e.address),this.network=this.address.network,this.amount=e.amount,e)if("address"!==t&&"amount"!==t){if(/^req-/.exec(t)&&-1===this.knownParams.indexOf(t))throw Error("Unknown required argument "+t);(-1"},t.exports=s},{"./address":79,"./unit":119,lodash:149,url:500}],121:[function(o,s,e){(function(r){"use strict";var i=o("buffer"),t=o("assert"),n=o("./js"),a=o("./preconditions");function e(e,t){if(e.length!==t.length)return!1;for(var r=e.length,i=0;i>24&255),t.push(e>>16&255),t.push(e>>8&255),t.push(255&e),new r(t)},integerFromBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]<<24|e[1]<<16|e[2]<<8|e[3]},integerFromSingleByteBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]},bufferToHex:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e.toString("hex")},reverse:function(e){for(var t=new i.Buffer(e.length),r=0;r>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}}else if("le"===r)for(i=0,a=0;i>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-i&4194303,26<=(i+=24)&&(i-=26,n++)}if(r+6!==t){a=o(e,t,r+6);this.words[n]|=a<>>26-i&4194303}this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];v.prototype.toString=function(e,t){if(16===(e=e||10)||"hex"===e){for(var r="",i=0,n=(t=0|t||1,0),a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return this.sign&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var c=l[e],u=d[e],f=(r="",this.clone());for(f.sign=!1;0!==f.cmpn(0);){var p=f.modn(u).toString(e);r=0!==(f=f.idivn(u)).cmpn(0)?h[c-p.length]+p+r:p+r}return 0===this.cmpn(0)&&(r="0"+r),this.sign&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.prototype.toJSON=function(){return this.toString(16)},v.prototype.toArray=function(){this.strip();var e=new Array(this.byteLength());e[0]=0;for(var t=this.clone(),r=0;0!==t.cmpn(0);r++){var i=t.andln(255);t.ishrn(8),e[e.length-r-1]=i}return e},v.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return 4096<=t&&(r+=13,t>>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.iand=function(e){var t;this.sign=this.sign&&e.sign,t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},v.prototype.ixor=function(e){var t,r;this.sign=this.sign||e.sign,r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);for(var r=e/26|0,i=e%26;this.length<=r;)this.words[this.length++]=0;return this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,a=0;a>>26}for(;0!==n&&a>>26}if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this);this.sign=!1;t=e.sub(this);return this.sign=!0,t},v.prototype.isub=function(e){if(e.sign){e.sign=!1;var t=this.iadd(e);return e.sign=!0,t._normSign()}if(this.sign)return this.sign=!1,this.iadd(e),this.sign=!0,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.sign=!1,this.length=1,this.words[0]=0,this;i=0>26,this.words[o]=67108863&t}for(;0!==a&&o>26,this.words[o]=67108863&t}if(0===a&&o>>26,a=67108863&r,o=Math.min(i,e.length-1),s=Math.max(0,i-this.length+1);s<=o;s++){var c=i-s,u=(0|this.words[c])*(0|e.words[s]),f=67108863&u;a=67108863&(f=f+a|0),n=(n=n+(u/67108864|0)|0)+(f>>>26)|0}t.words[i]=a,r=n}return 0!==r?t.words[i]=r:t.length--,t.strip()},v.prototype._bigMulTo=function(e,t){t.sign=e.sign!==this.sign,t.length=this.length+e.length;for(var r=0,i=0,n=0;n>>26)|0)>>>26,a&=67108863}t.words[n]=o,r=a,a=i}return 0!==r?t.words[n]=r:t.length--,t.strip()},v.prototype.mulTo=function(e,t){return this.length+e.length<63?this._smallMulTo(e,t):this._bigMulTo(e,t)},v.prototype.mul=function(e){var t=new v(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},v.prototype.imul=function(e){if(0===this.cmpn(0)||0===e.cmpn(0))return this.words[0]=0,this.length=1,this;var t=this.length,r=e.length;this.sign=e.sign!==this.sign,this.length=this.length+e.length,this.words[this.length-1]=0;for(var i=this.length-2;0<=i;i--){for(var n=0,a=0,o=Math.min(i,r-1),s=Math.max(0,i-t+1);s<=o;s++){var c=i-s,u=this.words[c]*e.words[s],f=67108863&u;n+=u/67108864|0,a=67108863&(f+=a),n+=f>>>26}this.words[i]=a,this.words[i+1]+=n,n=0}for(n=0,c=1;c>>26}return this.strip()},v.prototype.imuln=function(e){g("number"==typeof e);for(var t=0,r=0;r>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.mul(this)},v.prototype.ishln=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){for(var n=0,a=0;a>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;a>>n<a){this.length-=a;for(c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(c/67108864|0),this.words[a+r]=67108863&s}for(;a>26,this.words[a+r]=67108863&s}if(0===o)return this.strip();g(-1===o);for(a=o=0;a>26,this.words[a]=67108863&s}return this.sign=!0,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.shln(r),i.ishln(r),a=n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var n;i=this.divmod(e.neg(),t);return"mod"!==t&&(n=i.div.neg()),{div:n,mod:i.mod}},v.prototype.div=function(e){return this.divmod(e,"div").div},v.prototype.mod=function(e){return this.divmod(e,"mod").mod},v.prototype.divRound=function(e){var t=this.divmod(e);if(0===t.mod.cmpn(0))return t.div;var r=t.div.sign?t.mod.isub(e):t.mod,i=e.shrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:t.div.sign?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+this.words[i])%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=this.words[r]+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.ishrn(1),r.ishrn(1),++s;for(var c=r.clone(),u=t.clone();0!==t.cmpn(0);){for(;t.isEven();)t.ishrn(1),i.isEven()&&n.isEven()?(i.ishrn(1),n.ishrn(1)):(i.iadd(c).ishrn(1),n.isub(u).ishrn(1));for(;r.isEven();)r.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(u).ishrn(1));0<=t.cmp(r)?(t.isub(r),i.isub(a),n.isub(o)):(r.isub(t),a.isub(i),o.isub(n))}return{a:a,b:o,gcd:r.ishln(s)}},v.prototype._invmp=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=r.clone();0>>26,o&=67108863,this.words[n]=o}return 0!==a&&(this.words[n]=a,this.length++),this},v.prototype.cmpn=function(e){var t,r=e<0;if(r&&(e=-e),this.sign&&!r)return-1;if(!this.sign&&r)return 1;if(e&=67108863,this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}e.words[i-10]=n>>>22,e.length-=9},a.prototype.imulK=function(e){var t;e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(i[e])return i[e];var t;if("k256"===e)t=new a;else if("p224"===e)t=new s;else if("p192"===e)t=new c;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new u}return i[e]=t},f.prototype._verify1=function(e){g(!e.sign,"red works only with positives"),g(e.red,"red works only with red numbers")},f.prototype._verify2=function(e,t){g(!e.sign&&!t.sign,"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},f.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.mod(this.m)._forceRed(this)},f.prototype.neg=function(e){var t=e.clone();return t.sign=!t.sign,t.iadd(this.m)._forceRed(this)},f.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},f.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},f.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)},f.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.shln(t))},f.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},f.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},f.prototype.isqr=function(e){return this.imul(e,e)},f.prototype.sqr=function(e){return this.mul(e,e)},f.prototype.sqrt=function(e){if(0===e.cmpn(0))return e.clone();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).ishrn(2);return f=this.pow(e,r)}for(var i=this.m.subn(1),n=0;0!==i.cmpn(0)&&0===i.andln(1);)n++,i.ishrn(1);g(0!==i.cmpn(0));var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).ishrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).ishrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>8,i[r]&=255;for(;a;)i.push(255&a),a>>=8}for(t=0;"1"===e[t]&&tt[i]?1:0);++i);return 0==r&&(t.length>e.length?r=-1:e.length>t.length&&(r=1)),r}},{}],127:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.hmacDRBG=e("./elliptic/hmac-drbg"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec")},{"../package.json":147,"./elliptic/curve":130,"./elliptic/curves":133,"./elliptic/ec":134,"./elliptic/hmac-drbg":137,"./elliptic/utils":139,brorand:140}],128:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic"),S=n.utils.getNAF,j=n.utils.getJSF,u=n.utils.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function o(e,t){this.curve=e,this.type=t,this.precomputed=null}(t.exports=a).prototype.point=function(){throw new Error("Not implemented")},a.prototype.validate=function(){throw new Error("Not implemented")},a.prototype._fixedNafMul=function(e,t){var r=e._getDoubles(),i=S(t,1),n=(1<>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i){for(var n=this._wnafT1,a=this._wnafT2,o=this._wnafT3,s=0,c=0;c>1]:x<0&&(k=a[m][-x-1>>1].neg()),b="affine"===k.type?b.mixedAdd(k):b.add(k))}}for(c=0;c":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],130:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":128,"./edwards":129,"./mont":131,"./short":132}],131:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base;function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(s,o),(t.exports=s).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)},a(c,o.BasePoint),s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.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)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.ishrn(1))n.push(t.andln(1));for(var a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../curve":130,"bn.js":124,inherits:148}],132:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.shrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.sign&&(i=i.neg(),n=n.neg()),a.sign&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(t=new w(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b).redSqrt(),i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},c.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)},c.prototype._endoWnafMulAdd=function(e,t){for(var r=this._endoWnafT1,i=this._endoWnafT2,n=0;n":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],133:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":127,"./precomputed/secp256k1":138,"hash.js":141}],134:[function(e,t,r){"use strict";var d=e("bn.js"),m=e("../../elliptic"),i=m.utils.assert,n=e("./key"),g=e("./signature");function a(e){if(!(this instanceof a))return new a(e);"string"==typeof e&&(i(m.curves.hasOwnProperty(e),"Unknown curve "+e),e=m.curves[e]),e instanceof m.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(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}(t.exports=a).prototype.keyPair=function(e){return new n(this,e)},a.prototype.keyFromPrivate=function(e,t){return n.fromPrivate(this,e,t)},a.prototype.keyFromPublic=function(e,t){return n.fromPublic(this,e,t)},a.prototype.genKeyPair=function(e){e||(e={});for(var t=new m.hmacDRBG({hash:this.hash,pers:e.pers,entropy:e.entropy||m.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new d(2));;){var n=new d(t.generate(r));if(!(0"}},{"../../elliptic":127,"bn.js":124}],136:[function(e,t,r){"use strict";var n=e("bn.js"),a=e("../../elliptic").utils,i=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16))}(t.exports=o).prototype._importDER=function(e,t){if((e=a.toArray(e,t)).length<6||48!==e[0]||2!==e[2])return!1;if(1+e[1]>e.length)return!1;var r=e[3];if(128<=r)return!1;if(4+r+2>=e.length)return!1;if(2!==e[4+r])return!1;var i=e[5+r];return!(128<=i)&&(!(4+r+2+i>e.length)&&(this.r=new n(e.slice(4,4+r)),this.s=new n(e.slice(4+r+2,4+r+2+i)),!0))},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r));var i=[48,t.length+r.length+4,2,t.length];return i=i.concat(t,[2,r.length],r),a.encode(i,e)}},{"../../elliptic":127,"bn.js":124}],137:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("../elliptic").utils,n=o.assert;function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc),r=o.toArray(e.nonce,e.nonceEnc),i=o.toArray(e.pers,e.persEnc);n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this.reseed=1},a.prototype.generate=function(e,t,r,i){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i),this._update(r));for(var n=[];n.length>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e},i.getNAF=function(e,t){for(var r=[],i=1<>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=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=n.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{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;for(a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>10),n[a-7],(r=n[a-15],b(r,7)^b(r,18)^r>>>3),n[a-16]);var o,s,c=this.h[0],u=this.h[1],f=this.h[2],p=this.h[3],h=this.h[4],l=this.h[5],d=this.h[6],m=this.h[7];F(this.k.length===n.length);for(a=0;a>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function s(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}function u(e,t){if(!e)throw new Error(t||"Assertion failed")}i.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},i.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,r){return e+t+r>>>0},i.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},i.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},i.assert=u,i.inherits=n,r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:148}],147:[function(e,t,r){t.exports={_args:[["elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","/home/giacof/Download/javascript-opentimestamps/node_modules/bitcore-lib"]],_from:"elliptic@=3.0.3",_id:"elliptic@3.0.3",_inCache:!0,_location:"/bitcore-lib/elliptic",_phantomChildren:{inherits:"2.0.1"},_requested:{name:"elliptic",raw:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",rawSpec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",scope:null,spec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",type:"remote"},_requiredBy:["/bitcore-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_shasum:"865c9b420bfbe55006b9f969f97a0d2c44966595",_shrinkwrap:null,_spec:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_where:"/home/giacof/Download/javascript-opentimestamps/node_modules/bitcore-lib",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^2.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},description:"EC cryptography",devDependencies:{browserify:"^3.44.2",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",optionalDependencies:{},readme:"# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic)\n\nFast elliptic-curve cryptography in a plain javascript implementation.\n\nNOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve\nfor your cryptography operations.\n\n## Incentive\n\nECC is much slower than regular RSA cryptography, the JS implementations are\neven more slower.\n\n## Benchmarks\n\n```bash\n$ node benchmarks/index.js\nBenchmarking: sign\nelliptic#sign x 262 ops/sec ±0.51% (177 runs sampled)\neccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled)\n------------------------\nFastest is elliptic#sign\n========================\nBenchmarking: verify\nelliptic#verify x 113 ops/sec ±0.50% (166 runs sampled)\neccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled)\n------------------------\nFastest is elliptic#verify\n========================\nBenchmarking: gen\nelliptic#gen x 294 ops/sec ±0.43% (176 runs sampled)\neccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled)\n------------------------\nFastest is elliptic#gen\n========================\nBenchmarking: ecdh\nelliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled)\n------------------------\nFastest is elliptic#ecdh\n========================\n```\n\n## API\n\n### ECDSA\n\n```javascript\nvar EC = require('elliptic').ec;\n\n// Create and initialize EC context\n// (better do it once and reuse it)\nvar ec = new EC('secp256k1');\n\n// Generate keys\nvar key = ec.genKeyPair();\n\n// Sign message (must be an array, or it'll be treated as a hex sequence)\nvar msg = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];\nvar signature = key.sign(msg);\n\n// Export DER encoded signature in Array\nvar derSign = signature.toDER();\n\n// Verify signature\nconsole.log(key.verify(msg, derSign));\n```\n\n### ECDH\n\n```javascript\n// Generate keys\nvar key1 = ec.genKeyPair();\nvar key2 = ec.genKeyPair();\n\nvar shared1 = key1.derive(key2.getPublic());\nvar shared2 = key2.derive(key1.getPublic());\n\nconsole.log('Both shared secrets are BN instances');\nconsole.log(shared1.toString(16));\nconsole.log(shared2.toString(16));\n```\n\nNOTE: `.derive()` returns a [BN][1] instance.\n\n## Supported curves\n\nElliptic.js support following curve types:\n\n* Short Weierstrass\n* Montgomery\n* Edwards\n* Twisted Edwards\n\nFollowing curve 'presets' are embedded into the library:\n\n* `secp256k1`\n* `p192`\n* `p224`\n* `p256`\n* `curve25519`\n* `ed25519`\n\nNOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead.\n\n### Implementation details\n\nECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of\nthe curve operations are performed on non-affine coordinates (either projective\nor extended), various windowing techniques are used for different cases.\n\nAll operations are performed in reduction context using [bn.js][1], hashing is\nprovided by [hash.js][2]\n\n### Related projects\n\n* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both\n browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for\n node)\n\n#### LICENSE\n\nThis software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2014.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://tools.ietf.org/html/rfc6979\n[1]: https://github.com/indutny/bn.js\n[2]: https://github.com/indutny/hash.js\n[3]: https://github.com/bitchan/eccrypto\n[4]: https://github.com/wanderer/secp256k1-node\n",readmeFilename:"README.md",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{test:"make lint && mocha --reporter=spec test/*-test.js"},version:"3.0.3"}},{}],148:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{dup:68}],149:[function(e,y,_){(function(b){(function(){var dn,e,t,mn="3.10.1",gn=1,vn=2,bn=4,yn=8,_n=16,wn=32,kn=64,xn=128,Sn=256,jn=30,En="...",An=150,In=16,Pn=200,On=1,Tn=2,Bn="Expected a function",Cn="__lodash_placeholder__",Fn="[object Arguments]",Rn="[object Array]",zn="[object Boolean]",Mn="[object Date]",Dn="[object Error]",Nn="[object Function]",r="[object Map]",qn="[object Number]",Ln="[object Object]",Un="[object RegExp]",i="[object Set]",Hn="[object String]",n="[object WeakMap]",Kn="[object ArrayBuffer]",Vn="[object Float32Array]",Gn="[object Float64Array]",$n="[object Int8Array]",Wn="[object Int16Array]",Zn="[object Int32Array]",Yn="[object Uint8Array]",Xn="[object Uint8ClampedArray]",Jn="[object Uint16Array]",Qn="[object Uint32Array]",ea=/\b__p \+= '';/g,ta=/\b(__p \+=) '' \+/g,ra=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ia=/&(?:amp|lt|gt|quot|#39|#96);/g,na=/[&<>"'`]/g,aa=RegExp(ia.source),oa=RegExp(na.source),sa=/<%-([\s\S]+?)%>/g,ca=/<%([\s\S]+?)%>/g,ua=/<%=([\s\S]+?)%>/g,fa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,pa=/^\w*$/,ha=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,la=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,da=RegExp(la.source),ma=/[\u0300-\u036f\ufe20-\ufe23]/g,ga=/\\(\\)?/g,va=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ba=/\w*$/,ya=/^0[xX]/,_a=/^\[object .+?Constructor\]$/,wa=/^\d+$/,ka=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xa=/($^)/,Sa=/['\n\r\u2028\u2029\\]/g,ja=(e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",t="[a-z\\xdf-\\xf6\\xf8-\\xff]+",RegExp(e+"+(?="+e+t+")|"+e+"?"+t+"|"+e+"+|[0-9]+","g")),Ea=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Aa=-1,Ia={};Ia[Vn]=Ia[Gn]=Ia[$n]=Ia[Wn]=Ia[Zn]=Ia[Yn]=Ia[Xn]=Ia[Jn]=Ia[Qn]=!0,Ia[Fn]=Ia[Rn]=Ia[Kn]=Ia[zn]=Ia[Mn]=Ia[Dn]=Ia[Nn]=Ia[r]=Ia[qn]=Ia[Ln]=Ia[Un]=Ia[i]=Ia[Hn]=Ia[n]=!1;var Pa={};Pa[Fn]=Pa[Rn]=Pa[Kn]=Pa[zn]=Pa[Mn]=Pa[Vn]=Pa[Gn]=Pa[$n]=Pa[Wn]=Pa[Zn]=Pa[qn]=Pa[Ln]=Pa[Un]=Pa[Hn]=Pa[Yn]=Pa[Xn]=Pa[Jn]=Pa[Qn]=!0,Pa[Dn]=Pa[Nn]=Pa[r]=Pa[i]=Pa[n]=!1;var a={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},o={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},s={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},c={function:!0,object:!0},u={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},f={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},p=c[void 0===_?"undefined":_typeof(_)]&&_&&!_.nodeType&&_,h=c[void 0===y?"undefined":_typeof(y)]&&y&&!y.nodeType&&y,l=p&&h&&"object"==(void 0===b?"undefined":_typeof(b))&&b&&b.Object&&b,d=c["undefined"==typeof self?"undefined":_typeof(self)]&&self&&self.Object&&self,m=c["undefined"==typeof window?"undefined":_typeof(window)]&&window&&window.Object&&window,g=h&&h.exports===p&&p,Oa=l||m!==(this&&this.window)&&m||d||this;function Ta(e,t){if(e!==t){var r=null===e,i=e===dn,n=e==e,a=null===t,o=t===dn,s=t==t;if(t>>1,$=9007199254740991,W=O&&new O,Z={};function Y(e){if(Ka(e)&&!ui(e)&&!(e instanceof Q)){if(e instanceof J)return e;if(_.call(e,"__chain__")&&_.call(e,"__wrapped__"))return Qt(e)}return new J(e)}function X(){}function J(e,t,r){this.__wrapped__=e,this.__actions__=r||[],this.__chain__=!!t}Y.support={};function Q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function ee(){this.__data__={}}function te(e){var t=e?e.length:0;for(this.data={hash:B(null),set:new j};t--;)this.push(e[t])}function re(e,t){var r=e.data;return("string"==typeof t||li(t)?r.set.has(t):r.hash[t])?0:-1}function ie(e,t){var r=-1,i=e.length;for(t||(t=P(i));++r=Pn?st(t):null,c=t.length;s&&(a=re,o=!1,t=s);e:for(;++n>>0,t>>>=0;for(var a=P(n);++i>>1,o=e[a];(r?o<=t:o=Pn)return n.plant(t).value();for(var r=0,i=a?o[r].apply(this,e):t;++r=An)return e}else Gt=0;return Ue(e,t)});function Zt(e){for(var t=Ri(e),r=t.length,i=r&&e.length,n=!!i&&Ut(i)&&(ui(e)||ci(e)),a=-1,o=[];++a>>0,r>>>=0;r=D(t,r)&&e=(e=Ra(e)).length)return e;var o=i-n.length;if(o<1)return n;var s=e.slice(0,o);if(null==a)return s+n;if(vi(a)){if(e.slice(o).search(a)){var c,u,f=e.slice(0,o);for(a.global||(a=b(a.source,(ba.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(f);)u=c.index;s=s.slice(0,null==u?o:u)}}else if(e.indexOf(a,o)!=o){var p=s.lastIndexOf(a);-1=0.13.7 <0.14.0",_id:"bitcore-lib@0.13.19",_inCache:!0,_installable:!0,_location:"/bitcore-lib",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/bitcore-lib-0.13.19.tgz_1470850061596_0.2146058666985482"},_npmUser:{email:"braydon@bitpay.com",name:"braydonf"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{name:"bitcore-lib",raw:"bitcore-lib@^0.13.7",rawSpec:"^0.13.7",scope:null,spec:">=0.13.7 <0.14.0",type:"range"},_requiredBy:["/","/bitcore-message"],_resolved:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz",_shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",_shrinkwrap:{dependencies:{"bn.js":{from:"bn.js@=2.0.4",resolved:"https://registry.npmjs.org/bn.js/-/bn.js-2.0.4.tgz",version:"2.0.4"},bs58:{from:"bs58@=2.0.0",resolved:"https://registry.npmjs.org/bs58/-/bs58-2.0.0.tgz",version:"2.0.0"},"buffer-compare":{from:"buffer-compare@=1.0.0",resolved:"https://registry.npmjs.org/buffer-compare/-/buffer-compare-1.0.0.tgz",version:"1.0.0"},elliptic:{dependencies:{brorand:{from:"brorand@^1.0.1",resolved:"https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz",version:"1.0.5"},"hash.js":{from:"hash.js@=1.0.3",resolved:"https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz",version:"1.0.3"}},from:"elliptic@=3.0.3",resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",version:"3.0.3"},inherits:{from:"inherits@=2.0.1",resolved:"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",version:"2.0.1"},lodash:{from:"lodash@=3.10.1",resolved:"https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",version:"3.10.1"}},name:"bitcore",version:"0.13.18"},_spec:"bitcore-lib@^0.13.7",_where:"/home/giacof/Download/javascript-opentimestamps",author:{email:"dev@bitpay.com",name:"BitPay"},browser:{request:"browser-request"},bugs:{url:"https://github.com/bitpay/bitcore-lib/issues"},contributors:[{name:"Manuel Araoz",email:"manuelaraoz@gmail.com"},{name:"Daniel Cousens",email:"bitcoin@dcousens.com"},{name:"Gordon Hall",email:"gordon@bitpay.com"},{name:"Jeff Garzik",email:"jgarzik@bitpay.com"},{name:"Kyle Drake",email:"kyle@kyledrake.net"},{name:"Esteban Ordano",email:"eordano@gmail.com"},{name:"Matias Alejo Garcia",email:"ematiu@gmail.com"},{name:"Ryan X. Charles",email:"ryanxcharles@gmail.com"},{name:"Stefan Thomas",email:"moon@justmoon.net"},{name:"Stephen Pair",email:"stephen@bitpay.com"},{name:"Wei Lu",email:"luwei.here@gmail.com"}],dependencies:{"bn.js":"=2.0.4",bs58:"=2.0.0","buffer-compare":"=1.0.0",elliptic:"=3.0.3",inherits:"=2.0.1",lodash:"=3.10.1"},description:"A pure and powerful JavaScript Bitcoin library.",devDependencies:{"bitcore-build":"github:bitpay/bitcore-build",brfs:"^1.2.0",chai:"^1.10.0",gulp:"^3.8.10",sinon:"^1.13.0"},directories:{},dist:{shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",tarball:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz"},gitHead:"9517864f14d09700f3fd02ff61173003c0280774",homepage:"https://github.com/bitpay/bitcore-lib#readme",keywords:["address","bip21","bip32","bip37","bip69","bip70","bitcoin","blockchain","cryptocurrency","ecies","multisig","p2p","payment","transaction"],license:"MIT",main:"index.js",maintainers:[{name:"braydonf",email:"braydon@bitpay.com"},{name:"gabegattis",email:"gabegattis@gmail.com"},{name:"gasteve",email:"stephen@pairhome.net"},{name:"patrickbitpay",email:"patrick@bitpay.com"}],name:"bitcore-lib",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/bitpay/bitcore-lib.git"},scripts:{build:"gulp",coverage:"gulp coverage",lint:"gulp lint",test:"gulp test"},version:"0.13.19"}},{}],151:[function(e,t,r){var i=e("bitcore-lib");i.Message=e("./lib/message"),t.exports=i.Message},{"./lib/message":152,"bitcore-lib":78}],152:[function(r,d,e){(function(o){"use strict";var e=r("bitcore-lib"),s=e.deps._,i=e.PrivateKey,n=e.PublicKey,c=e.Address,a=e.encoding.BufferWriter,u=e.crypto.ECDSA,f=e.crypto.Signature,p=e.crypto.Hash.sha256sha256,t=e.util.js,h=e.util.preconditions,l=function e(t){return this instanceof e?(h.checkArgument(s.isString(t),"First argument should be a string"),this.message=t,this):new e(t)};l.MAGIC_BYTES=new o("Bitcoin Signed Message:\n"),l.prototype.magicHash=function(){var e=a.varintBufNum(l.MAGIC_BYTES.length),t=new o(this.message),r=a.varintBufNum(t.length),i=o.concat([e,l.MAGIC_BYTES,r,t]);return p(i)},l.prototype._sign=function(e){h.checkArgument(e instanceof i,"First argument should be an instance of PrivateKey");var t=this.magicHash(),r=new u;return r.hashbuf=t,r.privkey=e,r.pubkey=e.toPublicKey(),r.signRandomK(),r.calci(),r.sig},l.prototype.sign=function(e){return this._sign(e).toCompact().toString("base64")},l.prototype._verify=function(e,t){h.checkArgument(e instanceof n,"First argument should be an instance of PublicKey"),h.checkArgument(t instanceof f,"Second argument should be an instance of Signature");var r=this.magicHash(),i=u.verify(r,t,e);return i||(this.error="The signature was invalid"),i},l.prototype.verify=function(e,t){h.checkArgument(e),h.checkArgument(t&&s.isString(t)),s.isString(e)&&(e=c.fromString(e));var r=f.fromCompact(new o(t,"base64")),i=new u;i.hashbuf=this.magicHash(),i.sig=r;var n=i.toPublicKey(),a=c.fromPublicKey(n,e.network);return e.toString()!==a.toString()?!(this.error="The signature did not match the message digest"):this._verify(n,r)},l.fromString=function(e){return new l(e)},l.fromJSON=function(e){return t.isValidJSON(e)&&(e=JSON.parse(e)),new l(e.message)},l.prototype.toObject=function(){return{message:this.message}},l.prototype.toJSON=function(){return JSON.stringify(this.toObject())},l.prototype.toString=function(){return this.message},l.prototype.inspect=function(){return""},d.exports=l}).call(this,r("buffer").Buffer)},{"bitcore-lib":78,buffer:191}],153:[function(e,r,i){(function(Q,U,u){!function(e){if("object"==(void 0===i?"undefined":_typeof(i))&&void 0!==r)r.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:void 0!==U?t=U:"undefined"!=typeof self&&(t=self),t.Promise=e()}}(function(){var e,t,r;return function a(o,s,c){function u(r,e){if(!s[r]){if(!o[r]){var t="function"==typeof _dereq_&&_dereq_;if(!e&&t)return t(r,!0);if(f)return f(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[r]={exports:{}};o[r][0].call(n.exports,function(e){var t=o[r][1][e];return u(t||e)},n,n.exports,a,o,s,c)}return s[r].exports}for(var f="function"==typeof _dereq_&&_dereq_,e=0;e, no stack trace)"}function V(){return"function"==typeof Y}var G=function(){return!1},$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function W(e){var t=e.match($);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function Z(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);Y(this,Z),32=a)return r[t]=e,this._queue.push(t),!1;null!==n&&(n[t]=e);var o=this._promise,s=this._callback,c=o._boundValue();o._pushContext();var u=g(s).call(c,e,t,i),f=o._popContext();if(m.checkForgottenReturns(u,f,null!==n?"Promise.filter":"Promise.map",o),u===v)return this._reject(u.e),!0;var p=d(u,this._promise);if(p instanceof l){var h=(p=p._target())._bitField;if(0==(50397184&h))return 1<=a&&this._inFlight++,(r[t]=p)._proxy(this,-1*(t+1)),!1;if(0==(33554432&h))return 0!=(16777216&h)?this._reject(p._reason()):this._cancel(),!0;u=p._value()}r[t]=u}return i<=++this._totalResolved&&(null!==n?this._filter(r,n):this._resolve(r),!0)},f.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;0>>16)){if(e===this){var r=c();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,0<(65535&t)&&(0!=(134217728&t)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},E.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,d.isNode);0<(65535&t)?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},E.prototype._fulfillPromises=function(e,t){for(var r=1;r=this._length&&(this._resolve(this._values),!0)},t.prototype._promiseCancelled=function(){return this._cancel(),!0},t.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},t.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof s)e.cancel();else for(var t=0;t=this._length){var r;if(this._isMap)r=function(e){for(var t=new s,r=e.length/2|0,i=0;i>1},i.prototype.props=function(){return r(this)},i.props=function(e){return r(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function i(e){this._capacity=e,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},n.prototype._promiseFulfilled=function(e,t){var r=new i;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},n.prototype._promiseRejected=function(e,t){var r=new i;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},e.settle=function(e){return r.deprecated(".settle()",".reflect()"),new n(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(f,e,t){"use strict";e.exports=function(e,t,n){var r=f("./util"),i=f("./errors").RangeError,a=f("./errors").AggregateError,o=r.isArray,s={};function c(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function u(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new c(e),i=r.promise();return r.setHowMany(t),r.init(),i}r.inherits(c,t),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=o(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(e){this._howMany=e},c.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(s),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);else if("le"===r)for(n=i=0;i>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-a&4194303,26<=(a+=24)&&(a-=26,i++);r+6!==t&&(n=o(e,t,r+6),this.words[i]|=n<>>26-a&4194303),this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=67108863&o,c=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,p=67108863&c,h=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=h;l++){var d=u-l|0;f+=(o=(n=0|e.words[d])*(a=0|t.words[l])+p)/67108864|0,p=67108863&o}r.words[u]=0|p,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}v.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,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}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)&&2<=e&&e<=36){var c=l[e],u=d[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var p=f.modn(u).toString(e);r=(f=f.idivn(u)).isZero()?p+r:h[c-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.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]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},v.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)},v.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},v.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},v.prototype.inotn=function(e){g("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},v.prototype.notn=function(e){return this.clone().inotn(e)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);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,e):(r=e,this);for(var n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},v.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;i=0>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],d=8191&l,m=l>>>13,g=0|o[2],v=8191&g,b=g>>>13,y=0|o[3],_=8191&y,w=y>>>13,k=0|o[4],x=8191&k,S=k>>>13,j=0|o[5],E=8191&j,A=j>>>13,I=0|o[6],P=8191&I,O=I>>>13,T=0|o[7],B=8191&T,C=T>>>13,F=0|o[8],R=8191&F,z=F>>>13,M=0|o[9],D=8191&M,N=M>>>13,q=0|s[0],L=8191&q,U=q>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],$=8191&G,W=G>>>13,Z=0|s[3],Y=8191&Z,X=Z>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],ae=8191&ne,oe=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],pe=8191&fe,he=fe>>>13,le=0|s[9],de=8191&le,me=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(p,L))|0)+((8191&(n=(n=Math.imul(p,U))+Math.imul(h,L)|0))<<13)|0;u=((a=Math.imul(h,U))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,L),n=(n=Math.imul(d,U))+Math.imul(m,L)|0,a=Math.imul(m,U);var ve=(u+(i=i+Math.imul(p,K)|0)|0)+((8191&(n=(n=n+Math.imul(p,V)|0)+Math.imul(h,K)|0))<<13)|0;u=((a=a+Math.imul(h,V)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(b,L)|0,a=Math.imul(b,U),i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,V)|0;var be=(u+(i=i+Math.imul(p,$)|0)|0)+((8191&(n=(n=n+Math.imul(p,W)|0)+Math.imul(h,$)|0))<<13)|0;u=((a=a+Math.imul(h,W)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(_,L),n=(n=Math.imul(_,U))+Math.imul(w,L)|0,a=Math.imul(w,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,i=i+Math.imul(d,$)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,W)|0;var ye=(u+(i=i+Math.imul(p,Y)|0)|0)+((8191&(n=(n=n+Math.imul(p,X)|0)+Math.imul(h,Y)|0))<<13)|0;u=((a=a+Math.imul(h,X)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(x,L),n=(n=Math.imul(x,U))+Math.imul(S,L)|0,a=Math.imul(S,U),i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,W)|0,i=i+Math.imul(d,Y)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,X)|0;var _e=(u+(i=i+Math.imul(p,Q)|0)|0)+((8191&(n=(n=n+Math.imul(p,ee)|0)+Math.imul(h,Q)|0))<<13)|0;u=((a=a+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(A,L)|0,a=Math.imul(A,U),i=i+Math.imul(x,K)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,V)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,W)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(b,Y)|0,a=a+Math.imul(b,X)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0;var we=(u+(i=i+Math.imul(p,re)|0)|0)+((8191&(n=(n=n+Math.imul(p,ie)|0)+Math.imul(h,re)|0))<<13)|0;u=((a=a+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(O,L)|0,a=Math.imul(O,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,V)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,W)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,X)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0;var ke=(u+(i=i+Math.imul(p,ae)|0)|0)+((8191&(n=(n=n+Math.imul(p,oe)|0)+Math.imul(h,ae)|0))<<13)|0;u=((a=a+Math.imul(h,oe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(C,L)|0,a=Math.imul(C,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(O,K)|0,a=a+Math.imul(O,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,W)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(S,Y)|0,a=a+Math.imul(S,X)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ie)|0,i=i+Math.imul(d,ae)|0,n=(n=n+Math.imul(d,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var xe=(u+(i=i+Math.imul(p,ce)|0)|0)+((8191&(n=(n=n+Math.imul(p,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((a=a+Math.imul(h,ue)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(R,L),n=(n=Math.imul(R,U))+Math.imul(z,L)|0,a=Math.imul(z,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,W)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ie)|0,i=i+Math.imul(v,ae)|0,n=(n=n+Math.imul(v,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,i=i+Math.imul(d,ce)|0,n=(n=n+Math.imul(d,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0;var Se=(u+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,he)|0)+Math.imul(h,pe)|0))<<13)|0;u=((a=a+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(D,L),n=(n=Math.imul(D,U))+Math.imul(N,L)|0,a=Math.imul(N,U),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(z,K)|0,a=a+Math.imul(z,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,W)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,Y)|0,a=a+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ie)|0,i=i+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,i=i+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,ue)|0,i=i+Math.imul(d,pe)|0,n=(n=n+Math.imul(d,he)|0)+Math.imul(m,pe)|0,a=a+Math.imul(m,he)|0;var je=(u+(i=i+Math.imul(p,de)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(h,de)|0))<<13)|0;u=((a=a+Math.imul(h,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,V))+Math.imul(N,K)|0,a=Math.imul(N,V),i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,W)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,W)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(C,Y)|0,a=a+Math.imul(C,X)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ie)|0,i=i+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,ue)|0,i=i+Math.imul(v,pe)|0,n=(n=n+Math.imul(v,he)|0)+Math.imul(b,pe)|0,a=a+Math.imul(b,he)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;u=((a=a+Math.imul(m,me)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(D,$),n=(n=Math.imul(D,W))+Math.imul(N,$)|0,a=Math.imul(N,W),i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,X)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ie)|0,i=i+Math.imul(E,ae)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,i=i+Math.imul(x,ce)|0,n=(n=n+Math.imul(x,ue)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,ue)|0,i=i+Math.imul(_,pe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,pe)|0,a=a+Math.imul(w,he)|0;var Ae=(u+(i=i+Math.imul(v,de)|0)|0)+((8191&(n=(n=n+Math.imul(v,me)|0)+Math.imul(b,de)|0))<<13)|0;u=((a=a+Math.imul(b,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,X))+Math.imul(N,Y)|0,a=Math.imul(N,X),i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ie)|0,i=i+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,i=i+Math.imul(x,pe)|0,n=(n=n+Math.imul(x,he)|0)+Math.imul(S,pe)|0,a=a+Math.imul(S,he)|0;var Ie=(u+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,me)|0)+Math.imul(w,de)|0))<<13)|0;u=((a=a+Math.imul(w,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,ee))+Math.imul(N,Q)|0,a=Math.imul(N,ee),i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ie)|0,i=i+Math.imul(B,ae)|0,n=(n=n+Math.imul(B,oe)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,ue)|0,i=i+Math.imul(E,pe)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(A,pe)|0,a=a+Math.imul(A,he)|0;var Pe=(u+(i=i+Math.imul(x,de)|0)|0)+((8191&(n=(n=n+Math.imul(x,me)|0)+Math.imul(S,de)|0))<<13)|0;u=((a=a+Math.imul(S,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(D,re),n=(n=Math.imul(D,ie))+Math.imul(N,re)|0,a=Math.imul(N,ie),i=i+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,i=i+Math.imul(B,ce)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,ue)|0,i=i+Math.imul(P,pe)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(O,pe)|0,a=a+Math.imul(O,he)|0;var Oe=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(A,de)|0))<<13)|0;u=((a=a+Math.imul(A,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(D,ae),n=(n=Math.imul(D,oe))+Math.imul(N,ae)|0,a=Math.imul(N,oe),i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(z,ce)|0,a=a+Math.imul(z,ue)|0,i=i+Math.imul(B,pe)|0,n=(n=n+Math.imul(B,he)|0)+Math.imul(C,pe)|0,a=a+Math.imul(C,he)|0;var Te=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(O,de)|0))<<13)|0;u=((a=a+Math.imul(O,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(D,ce),n=(n=Math.imul(D,ue))+Math.imul(N,ce)|0,a=Math.imul(N,ue),i=i+Math.imul(R,pe)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(z,pe)|0,a=a+Math.imul(z,he)|0;var Be=(u+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,me)|0)+Math.imul(C,de)|0))<<13)|0;u=((a=a+Math.imul(C,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(D,pe),n=(n=Math.imul(D,he))+Math.imul(N,pe)|0,a=Math.imul(N,he);var Ce=(u+(i=i+Math.imul(R,de)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(z,de)|0))<<13)|0;u=((a=a+Math.imul(z,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Fe=(u+(i=Math.imul(D,de))|0)+((8191&(n=(n=Math.imul(D,me))+Math.imul(N,de)|0))<<13)|0;return u=((a=Math.imul(N,me))+(n>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,c[0]=ge,c[1]=ve,c[2]=be,c[3]=ye,c[4]=_e,c[5]=we,c[6]=ke,c[7]=xe,c[8]=Se,c[9]=je,c[10]=Ee,c[11]=Ae,c[12]=Ie,c[13]=Pe,c[14]=Oe,c[15]=Te,c[16]=Be,c[17]=Ce,c[18]=Fe,0!==u&&(c[19]=u,r.length++),r};function s(e,t,r){return(new c).mulp(e,t,r)}function c(e,t){this.x=e,this.y=t}Math.imul||(a=n),v.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?a(this,e,t):r<63?n(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,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},c.prototype.makeRBT=function(e){for(var t=new Array(e),r=v.prototype._countBits(e)-1,i=0;i>=1;return i},c.prototype.permute=function(e,t,r,i,n,a){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*a+1]=8191&n,n>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.muln=function(e){return this.clone().imuln(e)},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.imul(this.clone())},v.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 v(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<a)for(this.length-=a,c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},v.prototype.ishrn=function(e,t,r){return g(0===this.negative),this.iushrn(e,t,r)},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.ushln=function(e){return this.clone().iushln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.ushrn=function(e){return this.clone().iushrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===o)return this.strip();for(g(-1===o),i=o=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,a},v.prototype.div=function(e){return this.divmod(e,"div",!1).div},v.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},v.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},v.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),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(0===e.negative),g(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var c=r.clone(),u=t.clone();!t.isZero();){for(var f=0,p=1;0==(t.words[0]&p)&&f<26;++f,p<<=1);if(0>>26,o&=67108863,this.words[a]=o}return 0!==n&&(this.words[a]=n,this.length++),this},v.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},v.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(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(u[e])return u[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new b;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return u[e]=t},w.prototype._verify1=function(e){g(0===e.negative,"red works only with positives"),g(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){g(0==(e.negative|t.negative),"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},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 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&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();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);g(!i.isZero());var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==a?(a<<=1,a|=f,(4===++o||0===i&&0===u)&&(n=this.mul(n,r[a]),a=o=0)):o=0}s=26}return n},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},v.mont=function(e){return new k(e)},r(k,w),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.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),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new v(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:157}],155:[function(e,t,r){var A=e("concat-map"),I=e("balanced-match");t.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function t(e,r){var i=[];var n=I("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var s=a||o;var c=0<=n.body.indexOf(",");if(!s&&!c)return n.post.match(/,.*\}/)?(e=n.pre+"{"+n.body+P+n.post,t(e)):[e];var u;if(s)u=n.body.split(/\.\./);else if(1===(u=T(n.body)).length&&1===(u=t(u[0],!1).map(B)).length){var f=n.post.length?t(n.post,!1):[""];return f.map(function(e){return n.pre+u[0]+e})}var p=n.pre;var f=n.post.length?t(n.post,!1):[""];var h;if(s){var l=O(u[0]),d=O(u[1]),m=Math.max(u[0].length,u[1].length),g=3==u.length?Math.abs(O(u[2])):1,v=F,b=d>>24]^f[d>>>16&255]^p[m>>>8&255]^h[255&g]^t[v++],o=u[d>>>24]^f[m>>>16&255]^p[g>>>8&255]^h[255&l]^t[v++],s=u[m>>>24]^f[g>>>16&255]^p[l>>>8&255]^h[255&d]^t[v++],c=u[g>>>24]^f[l>>>16&255]^p[d>>>8&255]^h[255&m]^t[v++],l=a,d=o,m=s,g=c;return a=(i[l>>>24]<<24|i[d>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[v++],o=(i[d>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&l])^t[v++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[l>>>8&255]<<8|i[255&d])^t[v++],c=(i[g>>>24]<<24|i[l>>>16&255]<<16|i[d>>>8&255]<<8|i[255&m])^t[v++],[a>>>=0,o>>>=0,s>>>=0,c>>>=0]}var p=[0,1,2,4,8,16,32,64,128,27,54],h=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=[[],[],[],[]],a=[[],[],[],[]],o=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;var f=e[i[r[o]=u]=o],p=e[f],h=e[p],l=257*e[u]^16843008*u;n[0][o]=l<<24|l>>>8,n[1][o]=l<<16|l>>>16,n[2][o]=l<<8|l>>>24,n[3][o]=l,l=16843009*h^65537*p^257*f^16843008*o,a[0][u]=l<<24|l>>>8,a[1][u]=l<<16|l>>>16,a[2][u]=l<<8|l>>>24,a[3][u]=l,0===o?o=s=1:(o=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();function s(e){this._key=a(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],a=0;a>>24,o=h.SBOX[o>>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o],o^=p[a/t|0]<<24):6>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o]),n[a]=n[a-t]^o}for(var s=[],c=0;c>>24]]^h.INV_SUB_MIX[1][h.SBOX[f>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[f>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return o(e=a(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=a(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":447}],159:[function(e,t,r){var o=e("./aes"),u=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),f=e("./ghash"),n=e("buffer-xor"),p=e("./incr32");function a(e,t,r,i){s.call(this);var n=u.alloc(4,0);this._cipher=new o.AES(t);var a=this._cipher.encryptBlock(n);this._ghash=new f(a),r=function(e,t,r){if(12===t.length)return e._finID=u.concat([t,u.from([0,0,0,1])]),u.concat([t,u.from([0,0,0,2])]);var i=new f(r),n=t.length,a=n%16;i.update(t),a&&(a=16-a,i.update(u.alloc(a,0))),i.update(u.alloc(8,0));var o=8*n,s=u.alloc(8);s.writeUIntBE(o,0,8),i.update(s),e._finID=i.state;var c=u.from(e._finID);return p(c),c}(this,r,a),this._prev=u.from(r),this._cache=u.allocUnsafe(0),this._secCache=u.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(a,s),a.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=u.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},a.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(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;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":447}],164:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],165:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":190}],166:[function(e,t,r){var a=e("safe-buffer").Buffer,o=e("buffer-xor");function s(e,t,r){var i=t.length,n=o(t,e._cache);return e._cache=e._cache.slice(i),e._prev=a.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=a.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=a.allocUnsafe(0)),!(e._cache.length<=t.length)){n=a.concat([n,s(e,t,r)]);break}i=e._cache.length,n=a.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":190,"safe-buffer":447}],167:[function(e,t,r){var o=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,a=-1,o=0;++a<8;)i=t&1<<7-a?128:0,o+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>a%8,e._prev=c(e._prev,r?i:n);return o}function c(e,t){var r=e.length,i=-1,n=o.allocUnsafe(e.length);for(e=o.concat([e,o.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=o.allocUnsafe(i),a=-1;++a=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var a=m(r);if("ec"===a.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=g[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new d(i),a=r.data.subjectPrivateKey.data;return n.verify(t,e,a)}(e,t,a)}if("dsa"===a.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,a=r.data.g,o=r.data.pub_key,s=m.signature.decode(e,"der"),c=s.s,u=s.r;v(c,n),v(u,n);var f=l.mont(i),p=c.invm(n);return 0===a.toRed(f).redPow(new l(t).mul(p).mod(n)).fromRed().mul(o.toRed(f).redPow(u.mul(p).mod(n)).fromRed()).mod(i).mod(n).cmp(u)}(e,t,a)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var o=a.modulus.byteLength(),s=[1],c=0;t.length+s.length+2l.UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function h(e,t){for(var r=0;rm.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsm.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelm.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelm.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=m.Z_FILTERED&&e.strategy!=m.Z_HUFFMAN_ONLY&&e.strategy!=m.Z_RLE&&e.strategy!=m.Z_FIXED&&e.strategy!=m.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!g.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new o.Zlib(t);var i=this;this._hadError=!1,this._binding.onerror=function(e,t){i._binding=null,i._hadError=!0;var r=new Error(e);r.errno=t,r.code=m.codes[t],i.emit("error",r)};var r=m.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(r=e.level);var n=m.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(n=e.strategy),this._binding.init(e.windowBits||m.Z_DEFAULT_WINDOWBITS,r,e.memLevel||m.Z_DEFAULT_MEMLEVEL,n,e.dictionary),this._buffer=new g(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=n,this.once("end",this.close)}o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION,Object.keys(o).forEach(function(e){e.match(/^Z/)&&(m[e]=o[e])}),m.codes={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},Object.keys(m.codes).forEach(function(e){m.codes[m.codes[e]]=e}),m.Deflate=s,m.Inflate=c,m.Gzip=u,m.Gunzip=f,m.DeflateRaw=p,m.InflateRaw=h,m.Unzip=l,m.createDeflate=function(e){return new s(e)},m.createInflate=function(e){return new c(e)},m.createDeflateRaw=function(e){return new p(e)},m.createInflateRaw=function(e){return new h(e)},m.createGzip=function(e){return new u(e)},m.createGunzip=function(e){return new f(e)},m.createUnzip=function(e){return new l(e)},m.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new s(t),e,r)},m.deflateSync=function(e,t){return r(new s(t),e)},m.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new u(t),e,r)},m.gzipSync=function(e,t){return r(new u(t),e)},m.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new p(t),e,r)},m.deflateRawSync=function(e,t){return r(new p(t),e)},m.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new l(t),e,r)},m.unzipSync=function(e,t){return r(new l(t),e)},m.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new c(t),e,r)},m.inflateSync=function(e,t){return r(new c(t),e)},m.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new f(t),e,r)},m.gunzipSync=function(e,t){return r(new f(t),e)},m.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new h(t),e,r)},m.inflateRawSync=function(e,t){return r(new h(t),e)},e.inherits(t,a),t.prototype.params=function(e,t,r){if(em.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=m.Z_FILTERED&&t!=m.Z_HUFFMAN_ONLY&&t!=m.Z_RLE&&t!=m.Z_FIXED&&t!=m.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var i=this;this.flush(o.Z_SYNC_FLUSH,function(){i._binding.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())})}else n.nextTick(r)},t.prototype.reset=function(){return this._binding.reset()},t.prototype._flush=function(e){this._transform(new g(0),"",e)},t.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=o.Z_FULL_FLUSH),r.ended)t&&n.nextTick(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var i=this;this.once("drain",function(){i.flush(t)})}else this._flushFlag=e,this.write(new g(0),"",t)},t.prototype.close=function(e){if(e&&n.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;n.nextTick(function(){t.emit("close")})}},t.prototype._transform=function(e,t,r){var i,n=this._writableState,a=(n.ending||n.ended)&&(!e||n.length===e.length);if(null===!e&&!g.isBuffer(e))return r(new Error("invalid input"));a?i=o.Z_FINISH:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH));this._processChunk(e,i,r)},t.prototype._processChunk=function(a,o,s){var c=a&&a.length,u=this._chunkSize-this._offset,f=0,p=this,h="function"==typeof s;if(!h){var t,l=[],d=0;this.on("error",function(e){t=e});do{var e=this._binding.writeSync(o,a,f,c,this._buffer,this._offset,u)}while(!this._hadError&&m(e[0],e[1]));if(this._hadError)throw t;var r=g.concat(l,d);return this.close(),r}var i=this._binding.write(o,a,f,c,this._buffer,this._offset,u);function m(e,t){if(!p._hadError){var r=u-t;if(v(0<=r,"have should not go down"),0=p._chunkSize)&&(u=p._chunkSize,p._offset=0,p._buffer=new g(p._chunkSize)),0===t){if(f+=c-e,c=e,!h)return!0;var n=p._binding.write(o,a,f,c,p._buffer,p._offset,p._chunkSize);return n.callback=m,void(n.buffer=a)}if(!h)return!1;s()}}i.buffer=a,i.callback=m},e.inherits(s,t),e.inherits(c,t),e.inherits(u,t),e.inherits(f,t),e.inherits(p,t),e.inherits(h,t),e.inherits(l,t)}).call(this,d("_process"),d("buffer").Buffer)},{"./binding":185,_process:382,_stream_transform:427,assert:67,buffer:191,util:505}],187:[function(e,t,r){arguments[4][157][0].apply(r,arguments)},{dup:157}],188:[function(e,B,C){(function(T){!function(e){var t="object"==(void 0===C?"undefined":_typeof(C))&&C&&!C.nodeType&&C,r="object"==(void 0===B?"undefined":_typeof(B))&&B&&!B.nodeType&&B,i="object"==(void 0===T?"undefined":_typeof(T))&&T;i.global!==i&&i.window!==i&&i.self!==i||(e=i);var n,a,v=2147483647,b=36,y=1,_=26,o=38,s=700,w=72,k=128,x="-",c=/^xn--/,u=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=b-y,S=Math.floor,j=String.fromCharCode;function E(e){throw new RangeError(p[e])}function l(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function d(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((v-d)/o))&&E("overflow"),d+=c*o,!(c<(u=s<=g?y:g+_<=s?_:s-g));s+=b)o>S(v/(f=b-u))&&E("overflow"),o*=f;g=O(d-a,t=h.length+1,0==a),S(d/t)>v-m&&E("overflow"),m+=S(d/t),d%=t,h.splice(d++,0,m)}return I(h)}function g(e){var t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g=[];for(h=(e=A(e)).length,t=k,a=w,o=r=0;oS((v-r)/(l=i+1))&&E("overflow"),r+=(s-t)*l,t=s,o=0;ov&&E("overflow"),p==t){for(c=r,u=b;!(c<(f=u<=a?y:a+_<=u?_:u-a));u+=b)m=c-f,d=b-f,g.push(j(P(f+m%d,0))),c=S(m/d);g.push(j(P(c,0))),a=O(r,l,i==n),r=0,++i}++r,++t}return g.join("")}if(n={version:"1.4.1",ucs2:{decode:A,encode:I},decode:m,encode:g,toASCII:function(e){return d(e,function(e){return u.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return d(e,function(e){return c.test(e)?m(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",function(){return n});else if(t&&r)if(B.exports==t)r.exports=n;else for(a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],189:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var a=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=c;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function c(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}a.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},a.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:191}],190:[function(e,t,r){(function(a){t.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new a(r),n=0;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function l(e,t){if(p.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return R(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=p.from(t,i)),p.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,n);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,n){var a,o=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;s/=o=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var f=-1;for(a=r;a>>10&1023|55296),f=56320|1023&f),i.push(f),n+=p}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;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 S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===p.compare(this,e)},p.prototype.inspect=function(){var e="",t=D.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,i,n){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(i,n),u=e.slice(t,r),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a,o,s,c,u,f,p,h,l,d=!1;;)switch(i){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return h=t,l=r,M(R(e,(p=this).length-h),p,h,l);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return c=this,u=t,f=r,M(z(e),c,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=t,s=r,M(function(e,t){for(var r,i,n,a=[],o=0;o>8,n=r%256,a.push(n),a.push(i);return a}(e,(a=this).length-o),a,o,s);default:if(d)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function k(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function I(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function P(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function O(e,t,r,i,n,a){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(e,t,r,i,n){return n||O(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function B(e,t,r,i,n){return n||O(e,0,r,8),a.write(e,t,r,i,52,8),r+8}p.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):I(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;0<=--a&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function z(e){return i.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function M(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":75,ieee754:318,isarray:323}],192:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],193:[function(e,t,r){function n(e){this.dict=e||{}}n.prototype.set=function(e,t,r){if("object"!==(void 0===e?"undefined":_typeof(e))){void 0===r&&(r=!0);var i=this.has(e);return!r&&i?this.dict[i]=this.dict[i]+","+t:this.dict[i||e]=t,i}for(var n in e)this.set(n,e[n],t)},n.prototype.has=function(e){for(var t=Object.keys(this.dict),r=(e=e.toLowerCase(),0);rr)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>8^255&n^99,u[r]=n;var a=e[f[n]=r],o=e[a],s=e[o],c=257*e[n]^16843008*n;p[r]=c<<24|c>>>8,h[r]=c<<16|c>>>16,l[r]=c<<8|c>>>24,d[r]=c;c=16843009*s^65537*o^257*a^16843008*r;m[n]=c<<24|c>>>8,g[n]=c<<16|c>>>16,v[n]=c<<8|c>>>24,b[n]=c,r?(r=a^e[e[e[s^a]]],i^=e[e[i]]):r=i=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],i=r.AES=t.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),n=this._keySchedule=[],a=0;a>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o]):(o=u[(o=o<<8|o>>>24)>>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o],o^=y[a/r|0]<<24),n[a]=n[a-r]^o}for(var s=this._invKeySchedule=[],c=0;c>>24]]^g[u[o>>>16&255]]^v[u[o>>>8&255]]^b[u[255&o]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,p,h,l,d,u)},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,m,g,v,b,f);r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,a,o,s){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],p=e[t+2]^r[2],h=e[t+3]^r[3],l=4,d=1;d>>24]^n[f>>>16&255]^a[p>>>8&255]^o[255&h]^r[l++],g=i[f>>>24]^n[p>>>16&255]^a[h>>>8&255]^o[255&u]^r[l++],v=i[p>>>24]^n[h>>>16&255]^a[u>>>8&255]^o[255&f]^r[l++],b=i[h>>>24]^n[u>>>16&255]^a[f>>>8&255]^o[255&p]^r[l++];u=m,f=g,p=v,h=b}m=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&h])^r[l++],g=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[h>>>8&255]<<8|s[255&u])^r[l++],v=(s[p>>>24]<<24|s[h>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^r[l++],b=(s[h>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^r[l++];e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=b},keySize:8});e.AES=t._createHelper(i)}(),n.AES},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],206:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,c,n,a,o,s,u,f,p,h,l,d,m,g,v,b;e.lib.Cipher||(r=(t=e).lib,i=r.Base,c=r.WordArray,n=r.BufferedBlockAlgorithm,(a=t.enc).Utf8,o=a.Base64,s=t.algo.EvpKDF,u=r.Cipher=n.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function n(e){return"string"==typeof e?b:g}return function(i){return{encrypt:function(e,t,r){return n(t).encrypt(i,e,t,r)},decrypt:function(e,t,r){return n(t).decrypt(i,e,t,r)}}}}()}),r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),f=t.mode={},p=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var e=p.extend();function a(e,t,r){var i=this._iv;if(i){var n=i;this._iv=void 0}else n=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:l}),reset:function(){u.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else{i=r.createDecryptor;this._minBufferSize=1}this._mode=i.call(r,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),d=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var i=c.create([1398893684,1701076831]).concat(r).concat(t);else i=t;return i.toString(o)},parse:function(e){var t=o.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var i=c.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return d.create({ciphertext:t,salt:i})}},g=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),a=n.finalize(t),o=n.cfg;return d.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.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}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=c.random(8));var n=s.create({keySize:t+r}).compute(e,i),a=c.create(n.words.slice(t),4*r);return n.sigBytes=4*t,d.create({key:n,iv:a,salt:i})}},b=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),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 a=g.encrypt.call(this,e,t,n.key,i);return a.mixIn(n),a},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,g.decrypt.call(this,e,t,n.key,i)}}))},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],207:[function(e,t,r){var i,n;i=this,n=function(){var f,r,e,t,i,p,n,a,o,s,c,u,h=h||(f=Math,r=Object.create||function(){function r(){}return function(e){var t;return r.prototype=e,t=new r,r.prototype=null,t}}(),t=(e={}).lib={},i=t.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$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)}},p=t.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).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 a=0;a>>2]>>>24-a%4*8&255;t[i+a>>>2]|=o<<24-(i+a)%4*8}else for(a=0;a>>2]=r[a>>>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=f.ceil(t/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,r=[],i=function(t){t=t;var r=987654321,i=4294967295;return function(){var e=((r=36969*(65535&r)+(r>>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return e/=4294967296,(e+=.5)*(.5>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).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 p.init(r,t/2)}},o=n.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(a))}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 p.init(r,t)}},s=n.Utf8={stringify:function(e){try{return decodeURIComponent(escape(o.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return o.parse(unescape(encodeURIComponent(e)))}},c=t.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=s.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,n=this.blockSize,a=i/(4*n),o=(a=e?f.ceil(a):f.max((0|a)-this._minBufferSize,0))*n,s=f.min(4*o,i);if(o){for(var c=0;c>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.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,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var n=0;n>>6-a%4*2;i[n>>>2]|=(o|s)<<24-n%4*8,n++}return c.create(i,n)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],209:[function(e,t,r){var i,n;i=this,n=function(r){return function(){var e=r,n=e.lib.WordArray,t=e.enc;t.Utf16=t.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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}};function o(e){return e<<8&4278255360|e>>>8&16711935}t.Utf16LE={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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return n.create(r,2*t)}}}(),r.enc.Utf16},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],210:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,f,n,a,o;return r=(t=e).lib,i=r.Base,f=r.WordArray,n=t.algo,a=n.MD5,o=n.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=r.hasher.create(),n=f.create(),a=n.words,o=r.keySize,s=r.iterations;a.lengthi&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),a=this._iKey=t.clone(),o=n.words,s=a.words,c=0;c>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)}).prototype=e}}(),t.lib.WordArray},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],215:[function(e,t,r){var i,n;i=this,n=function(o){return function(f){var e=o,t=e.lib,r=t.WordArray,i=t.Hasher,n=e.algo,E=[];!function(){for(var e=0;e<64;e++)E[e]=4294967296*f.abs(f.sin(e+1))|0}();var a=n.MD5=i.extend({_doReset:function(){this._hash=new r.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 a=this._hash.words,o=e[t+0],s=e[t+1],c=e[t+2],u=e[t+3],f=e[t+4],p=e[t+5],h=e[t+6],l=e[t+7],d=e[t+8],m=e[t+9],g=e[t+10],v=e[t+11],b=e[t+12],y=e[t+13],_=e[t+14],w=e[t+15],k=a[0],x=a[1],S=a[2],j=a[3];x=O(x=O(x=O(x=O(x=P(x=P(x=P(x=P(x=I(x=I(x=I(x=I(x=A(x=A(x=A(x=A(x,S=A(S,j=A(j,k=A(k,x,S,j,o,7,E[0]),x,S,s,12,E[1]),k,x,c,17,E[2]),j,k,u,22,E[3]),S=A(S,j=A(j,k=A(k,x,S,j,f,7,E[4]),x,S,p,12,E[5]),k,x,h,17,E[6]),j,k,l,22,E[7]),S=A(S,j=A(j,k=A(k,x,S,j,d,7,E[8]),x,S,m,12,E[9]),k,x,g,17,E[10]),j,k,v,22,E[11]),S=A(S,j=A(j,k=A(k,x,S,j,b,7,E[12]),x,S,y,12,E[13]),k,x,_,17,E[14]),j,k,w,22,E[15]),S=I(S,j=I(j,k=I(k,x,S,j,s,5,E[16]),x,S,h,9,E[17]),k,x,v,14,E[18]),j,k,o,20,E[19]),S=I(S,j=I(j,k=I(k,x,S,j,p,5,E[20]),x,S,g,9,E[21]),k,x,w,14,E[22]),j,k,f,20,E[23]),S=I(S,j=I(j,k=I(k,x,S,j,m,5,E[24]),x,S,_,9,E[25]),k,x,u,14,E[26]),j,k,d,20,E[27]),S=I(S,j=I(j,k=I(k,x,S,j,y,5,E[28]),x,S,c,9,E[29]),k,x,l,14,E[30]),j,k,b,20,E[31]),S=P(S,j=P(j,k=P(k,x,S,j,p,4,E[32]),x,S,d,11,E[33]),k,x,v,16,E[34]),j,k,_,23,E[35]),S=P(S,j=P(j,k=P(k,x,S,j,s,4,E[36]),x,S,f,11,E[37]),k,x,l,16,E[38]),j,k,g,23,E[39]),S=P(S,j=P(j,k=P(k,x,S,j,y,4,E[40]),x,S,o,11,E[41]),k,x,u,16,E[42]),j,k,h,23,E[43]),S=P(S,j=P(j,k=P(k,x,S,j,m,4,E[44]),x,S,b,11,E[45]),k,x,w,16,E[46]),j,k,c,23,E[47]),S=O(S,j=O(j,k=O(k,x,S,j,o,6,E[48]),x,S,l,10,E[49]),k,x,_,15,E[50]),j,k,p,21,E[51]),S=O(S,j=O(j,k=O(k,x,S,j,b,6,E[52]),x,S,u,10,E[53]),k,x,g,15,E[54]),j,k,s,21,E[55]),S=O(S,j=O(j,k=O(k,x,S,j,d,6,E[56]),x,S,w,10,E[57]),k,x,h,15,E[58]),j,k,y,21,E[59]),S=O(S,j=O(j,k=O(k,x,S,j,f,6,E[60]),x,S,v,10,E[61]),k,x,c,15,E[62]),j,k,m,21,E[63]),a[0]=a[0]+k|0,a[1]=a[1]+x|0,a[2]=a[2]+S|0,a[3]=a[3]+j|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var n=f.floor(r/4294967296),a=r;t[15+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,s=o.words,c=0;c<4;c++){var u=s[c];s[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function A(e,t,r,i,n,a,o){var s=e+(t&r|~t&i)+n+o;return(s<>>32-a)+t}function I(e,t,r,i,n,a,o){var s=e+(t&i|r&~i)+n+o;return(s<>>32-a)+t}function P(e,t,r,i,n,a,o){var s=e+(t^r^i)+n+o;return(s<>>32-a)+t}function O(e,t,r,i,n,a,o){var s=e+(r^(t|~i))+n+o;return(s<>>32-a)+t}e.MD5=i._createHelper(a),e.HmacMD5=i._createHmacHelper(a)}(Math),o.MD5},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],216:[function(e,t,r){var i,n;i=this,n=function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function a(e,t,r,i){var n=this._iv;if(n){var a=n.slice(0);this._iv=void 0}else a=this._prevBlock;i.encryptBlock(a,0);for(var o=0;o>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 t=e.Encryptor=e.extend({processBlock:function(e,t){var r,i=this._cipher,n=i.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),0===((r=o)[0]=u(r[0]))&&(r[1]=u(r[1]));var s=o.slice(0);i.encryptBlock(s,0);for(var c=0;c>>2]|=n<<24-a%4*8,e.sigBytes+=n},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],222:[function(e,t,r){var i,n;i=this,n=function(n){return n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],223:[function(e,t,r){var i,n;i=this,n=function(r){return r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],224:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],225:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],226:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,v,n,a,b,o;return r=(t=e).lib,i=r.Base,v=r.WordArray,n=t.algo,a=n.SHA1,b=n.HMAC,o=n.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=b.create(r.hasher,e),n=v.create(),a=v.create([1]),o=n.words,s=a.words,c=r.keySize,u=r.iterations;o.length>>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]],n=this._b=0;n<4;n++)h.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;i[0]^=c,i[1]^=f,i[2]^=u,i[3]^=p,i[4]^=c,i[5]^=f,i[6]^=u,i[7]^=p;for(n=0;n<4;n++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.RabbitLegacy=t._createHelper(i)}(),a.RabbitLegacy},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],228:[function(e,t,r){var i,n;i=this,n=function(a){return function(){var e=a,t=e.lib.StreamCipher,r=e.algo,n=[],c=[],u=[],i=r.Rabbit=t.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(r=this._b=0;r<4;r++)h.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;n[0]^=c,n[1]^=f,n[2]^=u,n[3]^=p,n[4]^=c,n[5]^=f,n[6]^=u,n[7]^=p;for(r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.Rabbit=t._createHelper(i)}(),a.Rabbit},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],229:[function(e,t,r){var i,n;i=this,n=function(o){return function(){var e=o,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.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 a=0;n<256;n++){var o=n%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+i[n]+s)%256;var c=i[n];i[n]=i[a],i[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=n.call(this)},keySize:8,ivSize:0});function n(){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 a=e[t];e[t]=e[r],e[r]=a,i|=e[(e[t]+e[r])%256]<<24-8*n}return this._i=t,this._j=r,i}e.RC4=t._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;0>>24)|4278255360&(n<<24|n>>>8)}var a,o,s,c,u,f,p,h,l,d,m,g=this._hash.words,v=A.words,b=I.words,y=x.words,_=S.words,w=j.words,k=E.words;f=a=g[0],p=o=g[1],h=s=g[2],l=c=g[3],d=u=g[4];for(r=0;r<80;r+=1)m=a+e[t+y[r]]|0,m+=r<16?P(o,s,c)+v[0]:r<32?O(o,s,c)+v[1]:r<48?T(o,s,c)+v[2]:r<64?B(o,s,c)+v[3]:C(o,s,c)+v[4],m=(m=F(m|=0,w[r]))+u|0,a=u,u=c,c=F(s,10),s=o,o=m,m=f+e[t+_[r]]|0,m+=r<16?C(p,h,l)+b[0]:r<32?B(p,h,l)+b[1]:r<48?T(p,h,l)+b[2]:r<64?O(p,h,l)+b[3]:P(p,h,l)+b[4],m=(m=F(m|=0,k[r]))+d|0,f=d,d=l,l=F(h,10),h=p,p=m;m=g[1]+s+l|0,g[1]=g[2]+c+d|0,g[2]=g[3]+u+f|0,g[3]=g[4]+a+p|0,g[4]=g[0]+o+h|0,g[0]=m},_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,a=n.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function P(e,t,r){return e^t^r}function O(e,t,r){return e&t|~e&r}function T(e,t,r){return(e|~t)^r}function B(e,t,r){return e&r|t&~r}function C(e,t,r){return e^(t|~r)}function F(e,t){return e<>>32-t}t.RIPEMD160=n._createHelper(o),t.HmacRIPEMD160=n._createHmacHelper(o)}(Math),s.RIPEMD160},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],231:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,p,o;return r=(t=e).lib,i=r.WordArray,n=r.Hasher,a=t.algo,p=[],o=a.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],a=r[2],o=r[3],s=r[4],c=0;c<80;c++){if(c<16)p[c]=0|e[t+c];else{var u=p[c-3]^p[c-8]^p[c-14]^p[c-16];p[c]=u<<1|u>>>31}var f=(i<<5|i>>>27)+s+p[c];f+=c<20?1518500249+(n&a|~n&o):c<40?1859775393+(n^a^o):c<60?(n&a|n&o|a&o)-1894007588:(n^a^o)-899497514,s=o,o=a,a=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|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(o),t.HmacSHA1=n._createHmacHelper(o),e.SHA1},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],232:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a;return r=(t=e).lib.WordArray,i=t.algo,n=i.SHA256,a=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(a),t.HmacSHA224=n._createHmacHelper(a),e.SHA224},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],n):n(i.CryptoJS)},{"./core":207,"./sha256":233}],233:[function(e,t,r){var i,n;i=this,n=function(c){return function(n){var e=c,t=e.lib,r=t.WordArray,i=t.Hasher,a=e.algo,o=[],y=[];!function(){function e(e){for(var t=n.sqrt(e),r=2;r<=t;r++)if(!(e%r))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(o[i]=t(n.pow(r,.5))),y[i]=t(n.pow(r,1/3)),i++),r++}();var _=[],s=a.SHA256=i.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=0;p<64;p++){if(p<16)_[p]=0|e[t+p];else{var h=_[p-15],l=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,d=_[p-2],m=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;_[p]=l+_[p-7]+m+_[p-16]}var g=i&n^i&a^n&a,v=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&u)+y[p]+_[p];f=u,u=c,c=s,s=o+b|0,o=a,a=n,n=i,i=b+(v+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+u|0,r[7]=r[7]+f|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)]=n.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA256=i._createHelper(s),e.HmacSHA256=i._createHmacHelper(s)}(Math),c.SHA256},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],234:[function(e,t,r){var i,n;i=this,n=function(a){return function(h){var e=a,t=e.lib,l=t.WordArray,i=t.Hasher,f=e.x64.Word,r=e.algo,P=[],O=[],T=[];!function(){for(var e=1,t=0,r=0;r<24;r++){P[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++)O[e+5*t]=t+(2*e+3*t)%5*5;for(var n=1,a=0;a<24;a++){for(var o=0,s=0,c=0;c<7;c++){if(1&n){var u=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(S=r[n]).high^=o,S.low^=a}for(var s=0;s<24;s++){for(var c=0;c<5;c++){for(var u=0,f=0,p=0;p<5;p++){u^=(S=r[c+5*p]).high,f^=S.low}var h=B[c];h.high=u,h.low=f}for(c=0;c<5;c++){var l=B[(c+4)%5],d=B[(c+1)%5],m=d.high,g=d.low;for(u=l.high^(m<<1|g>>>31),f=l.low^(g<<1|m>>>31),p=0;p<5;p++){(S=r[c+5*p]).high^=u,S.low^=f}}for(var v=1;v<25;v++){var b=(S=r[v]).high,y=S.low,_=P[v];if(_<32)u=b<<_|y>>>32-_,f=y<<_|b>>>32-_;else u=y<<_-32|b>>>64-_,f=b<<_-32|y>>>64-_;var w=B[O[v]];w.high=u,w.low=f}var k=B[0],x=r[0];k.high=x.high,k.low=x.low;for(c=0;c<5;c++)for(p=0;p<5;p++){var S=r[v=c+5*p],j=B[v],E=B[(c+1)%5+5*p],A=B[(c+2)%5+5*p];S.high=j.high^~E.high&A.high,S.low=j.low^~E.low&A.low}S=r[0];var I=T[s];S.high^=I.high,S.low^=I.low}},_doFinalize:function(){var e=this._data,t=e.words,r=(this._nDataBytes,8*e.sigBytes),i=32*this.blockSize;t[r>>>5]|=1<<24-r%32,t[(h.ceil((r+1)/i)*i>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();for(var n=this._state,a=this.cfg.outputLength/8,o=a/8,s=[],c=0;c>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),s.push(p),s.push(f)}return new l.init(s,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});e.SHA3=i._createHelper(n),e.HmacSHA3=i._createHmacHelper(n)}(Math),a.SHA3},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],235:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,o,s;return r=(t=e).x64,i=r.Word,n=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.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=o._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s),e.SHA384},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core"),e("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],n):n(i.CryptoJS)},{"./core":207,"./sha512":236,"./x64-core":238}],236:[function(e,t,r){var i,n;i=this,n=function(c){return function(){var e=c,t=e.lib.Hasher,r=e.x64,i=r.Word,n=r.WordArray,a=e.algo;function o(){return i.create.apply(i,arguments)}var xe=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],Se=[];!function(){for(var e=0;e<80;e++)Se[e]=o()}();var s=a.SHA512=t.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=i.high,h=i.low,l=n.high,d=n.low,m=a.high,g=a.low,v=o.high,b=o.low,y=s.high,_=s.low,w=c.high,k=c.low,x=u.high,S=u.low,j=f.high,E=f.low,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=w,D=k,N=x,q=S,L=j,U=E,H=0;H<80;H++){var K=Se[H];if(H<16)var V=K.high=0|e[t+2*H],G=K.low=0|e[t+2*H+1];else{var $=Se[H-15],W=$.high,Z=$.low,Y=(W>>>1|Z<<31)^(W>>>8|Z<<24)^W>>>7,X=(Z>>>1|W<<31)^(Z>>>8|W<<24)^(Z>>>7|W<<25),J=Se[H-2],Q=J.high,ee=J.low,te=(Q>>>19|ee<<13)^(Q<<3|ee>>>29)^Q>>>6,re=(ee>>>19|Q<<13)^(ee<<3|Q>>>29)^(ee>>>6|Q<<26),ie=Se[H-7],ne=ie.high,ae=ie.low,oe=Se[H-16],se=oe.high,ce=oe.low;V=(V=(V=Y+ne+((G=X+ae)>>>0>>0?1:0))+te+((G=G+re)>>>0>>0?1:0))+se+((G=G+ce)>>>0>>0?1:0);K.high=V,K.low=G}var ue,fe=R&M^~R&N,pe=z&D^~z&q,he=A&P^A&T^P&T,le=I&O^I&B^O&B,de=(A>>>28|I<<4)^(A<<30|I>>>2)^(A<<25|I>>>7),me=(I>>>28|A<<4)^(I<<30|A>>>2)^(I<<25|A>>>7),ge=(R>>>14|z<<18)^(R>>>18|z<<14)^(R<<23|z>>>9),ve=(z>>>14|R<<18)^(z>>>18|R<<14)^(z<<23|R>>>9),be=xe[H],ye=be.high,_e=be.low,we=L+ge+((ue=U+ve)>>>0>>0?1:0),ke=me+le;L=N,U=q,N=M,q=D,M=R,D=z,R=C+(we=(we=(we=we+fe+((ue=ue+pe)>>>0>>0?1:0))+ye+((ue=ue+_e)>>>0<_e>>>0?1:0))+V+((ue=ue+G)>>>0>>0?1:0))+((z=F+ue|0)>>>0>>0?1:0)|0,C=T,F=B,T=P,B=O,P=A,O=I,A=we+(de+he+(ke>>>0>>0?1:0))+((I=ue+ke|0)>>>0>>0?1:0)|0}h=i.low=h+I,i.high=p+A+(h>>>0>>0?1:0),d=n.low=d+O,n.high=l+P+(d>>>0>>0?1:0),g=a.low=g+B,a.high=m+T+(g>>>0>>0?1:0),b=o.low=b+F,o.high=v+C+(b>>>0>>0?1:0),_=s.low=_+z,s.high=y+R+(_>>>0>>0?1:0),k=c.low=k+D,c.high=w+M+(k>>>0>>0?1:0),S=u.low=S+q,u.high=x+N+(S>>>0>>0?1:0),E=f.low=E+U,f.high=j+L+(E>>>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=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(s),e.HmacSHA512=t._createHmacHelper(s)}(),c.SHA512},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],237:[function(e,t,r){var i,n;i=this,n=function(s){return function(){var e=s,t=e.lib,r=t.WordArray,i=t.BlockCipher,n=e.algo,u=[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],f=[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],p=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],a=n.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var i=u[r]-1;t[r]=e[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var o=n[a]=[],s=p[a];for(r=0;r<24;r++)o[r/6|0]|=t[(f[r]-1+s)%28]<<31-r%6,o[4+(r/6|0)]|=t[28+(f[r+24]-1+s)%28]<<31-r%6;o[0]=o[0]<<1|o[0]>>>31;for(r=1;r<7;r++)o[r]=o[r]>>>4*(r-1)+3;o[7]=o[7]<<5|o[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[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],d.call(this,4,252645135),d.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),d.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=h[c][((o^n[c])&l[c])>>>0];this._lBlock=o,this._rBlock=a^s}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,d.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(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<>>1];r=h.r28shl(r,a),i=h.r28shl(i,a),h.pc2(r,i,e.keys,n)}},c.prototype._update=function(e,t,r,i){var n=this._desState,a=h.readUInt32BE(e,t),o=h.readUInt32BE(e,t+4);h.ip(a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,o,n.tmp,0):this._decrypt(n,a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],h.writeUInt32BE(r,a,i),h.writeUInt32BE(r,o,i+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,a=p}h.rip(o,a,i,n)},c.prototype._decrypt=function(e,t,r,i,n){for(var a=r,o=t,s=e.keys.length-2;0<=s;s-=2){var c=e.keys[s],u=e.keys[s+1];h.expand(a,e.tmp,0),c^=e.tmp[0],u^=e.tmp[1];var f=h.substitute(c,u),p=a;a=(o^h.permute(f))>>>0,o=p}h.rip(a,o,i,n)}},{"../des":240,inherits:320,"minimalistic-assert":353}],244:[function(e,t,r){"use strict";var a=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),o=n.Cipher,s=n.DES;function c(e,t){a.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new c(this.type,this.options.key);this._edeState=t}i(u,o),(t.exports=u).create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":240,inherits:320,"minimalistic-assert":353}],245:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.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},r.ip=function(e,t,r,i){for(var n=0,a=0,o=6;0<=o;o-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+o&1}for(o=6;0<=o;o-=2){for(s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1;for(s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1}r[i+0]=n>>>0,r[i+1]=a>>>0},r.rip=function(e,t,r,i){for(var n=0,a=0,o=0;o<4;o++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+o&1,n<<=1,n|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;0<=s;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.pc1=function(e,t,r,i){for(var n=0,a=0,o=7;5<=o;o--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.r28shl=function(e,t){return e<>>28-t};var c=[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];r.pc2=function(e,t,r,i){for(var n=0,a=0,o=c.length>>>1,s=0;s>>c[s]&1;for(s=o;s>>c[s]&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var a=23;15<=a;a-=4)i<<=6,i|=e>>>a&63;for(a=11;3<=a;a-=4)n|=e>>>a&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[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];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[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];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(c),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;r.mod(p).cmp(h);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(i=r.shrn(1))&&g(r)&&v(i)&&v(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":154,"miller-rabin":349,randombytes:414}],249:[function(e,t,r){t.exports={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"}}},{}],250:[function(e,t,r){var u=e("crypto"),f=e("jsbn").BigInteger,p=(e("./lib/ec.js").ECPointFp,e("safer-buffer").Buffer);function h(e,t){return e.length>=t?e:h("0"+e,t)}r.ECCurves=e("./lib/sec.js"),r.ECKey=function(e,t,r){var i,n=e(),a=n.getN(),o=Math.floor(a.bitLength()/8);if(t)if(r){e=n.getCurve();this.P=e.decodePointHex(t.toString("hex"))}else{if(t.length!=o)return!1;i=new f(t.toString("hex"),16)}else{var s=a.subtract(f.ONE),c=new f(u.randomBytes(a.bitLength()));i=c.mod(s).add(f.ONE),this.P=n.getG().multiply(i)}this.P&&(this.PublicKey=p.from(n.getCurve().encodeCompressedPointHex(this.P),"hex")),i&&(this.PrivateKey=p.from(h(i.toString(16),2*o),"hex"),this.deriveSharedSecret=function(e){if(!e||!e.P)return!1;var t=e.P.multiply(i);return p.from(h(t.getX().toBigInteger().toString(16),2*o),"hex")})}},{"./lib/ec.js":251,"./lib/sec.js":252,crypto:204,jsbn:325,"safer-buffer":448}],251:[function(e,t,r){var l=e("jsbn").BigInteger,i=l.prototype.Barrett;function f(e,t){this.x=t,this.q=e}function d(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=null==i?l.ONE:i,this.zinv=null}function n(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new d(this,null,null),this.reducer=new i(this.q)}f.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},f.prototype.toBigInteger=function(){return this.x},f.prototype.negate=function(){return new f(this.q,this.x.negate().mod(this.q))},f.prototype.add=function(e){return new f(this.q,this.x.add(e.toBigInteger()).mod(this.q))},f.prototype.subtract=function(e){return new f(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},f.prototype.multiply=function(e){return new f(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},f.prototype.square=function(){return new f(this.q,this.x.square().mod(this.q))},f.prototype.divide=function(e){return new f(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},d.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO))},d.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(l.ZERO)&&!this.y.toBigInteger().equals(l.ZERO)},d.prototype.negate=function(){return new d(this.curve,this.x,this.y.negate(),this.z)},d.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(l.ZERO.equals(r))return l.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new l("3"),n=this.x.toBigInteger(),a=this.y.toBigInteger(),o=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),s=o.multiply(r),c=n.multiply(o),u=t.square().multiply(this.z),f=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(s).multiply(r).mod(this.curve.q),p=c.multiply(i).multiply(t).subtract(a.multiply(s)).subtract(u.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),h=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(p),h)},d.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new l("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),n=i.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),o=t.square().multiply(e);l.ZERO.equals(a)||(o=o.add(this.z.square().multiply(a)));var s=(o=o.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(i).mod(this.curve.q),c=o.multiply(e).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(o.square().multiply(o)).mod(this.curve.q),u=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(c),u)},d.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new l("3")),n=this.negate(),a=this;for(t=i.bitLength()-2;0r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var n=this.curve.getInfinity(),a=this.add(t);0<=i;)n=n.twice(),e.testBit(i)?n=r.testBit(i)?n.add(a):n.add(this):r.testBit(i)&&(n=n.add(t)),--i;return n},n.prototype.getQ=function(){return this.q},n.prototype.getA=function(){return this.a},n.prototype.getB=function(){return this.b},n.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},n.prototype.getInfinity=function(){return this.infinity},n.prototype.fromBigInteger=function(e){return new f(this.q,e)},n.prototype.reduce=function(e){this.reducer.reduce(e)},n.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;t.lengtht+1;){var r=e.shiftRight(t),i=e.subtract(r.shiftLeft(t));this.getR().equals(l.ONE)||(r=r.multiply(this.getR())),e=r.add(i)}for(;0<=e.compareTo(q);)e=e.subtract(q)}else e=e.mod(q);return e},f.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var e=new f(this.q,this.x.modPow(this.q.shiftRight(2).add(l.ONE),this.q));return e.square().equals(this)?e:null}var t=this.q.subtract(l.ONE),r=t.shiftRight(1);if(!this.x.modPow(r,this.q).equals(l.ONE))return null;var i,n,a=t.shiftRight(2).shiftLeft(1).add(l.ONE),o=this.x,s=modDouble(modDouble(o));do{for(var c;0<=(c=new l(this.q.bitLength(),new SecureRandom)).compareTo(this.q)||!c.multiply(c).subtract(s).modPow(r,this.q).equals(t););var u=this.lucasSequence(c,o,a);if(i=u[0],n=u[1],this.modMult(n,n).equals(s))return n.testBit(0)&&(n=n.add(q)),n=n.shiftRight(1),new f(q,n)}while(i.equals(l.ONE)||i.equals(t));return null},f.prototype.lucasSequence=function(e,t,r){for(var i=r.bitLength(),n=r.getLowestSetBit(),a=l.ONE,o=l.TWO,s=e,c=l.ONE,u=l.ONE,f=i-1;n+1<=f;--f)c=this.modMult(c,u),r.testBit(f)?(u=this.modMult(c,t),a=this.modMult(a,s),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1)))):(u=c,a=this.modReduce(a.multiply(o).subtract(c)),s=this.modReduce(s.multiply(o).subtract(e.multiply(c))),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))));c=this.modMult(c,u),u=this.modMult(c,t),a=this.modReduce(a.multiply(o).subtract(c)),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),c=this.modMult(c,u);for(f=1;f<=n;++f)a=this.modMult(a,o),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))),c=this.modMult(c,c);return[a,o]};r={ECCurveFp:n,ECPointFp:d,ECFieldElementFp:f};t.exports=r},{jsbn:325}],252:[function(e,t,r){var o=e("jsbn").BigInteger,s=e("./ec.js").ECCurveFp;function c(e,t,r,i){this.curve=e,this.g=t,this.n=r,this.h=i}function u(e){return new o(e,16)}function i(){var e=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),r=u("E87579C11079F43DD824993C2CEE5ED3"),i=u("FFFFFFFE0000000075A30D1B9038A115"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83"),i,n)}function n(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=o.ZERO,r=u("7"),i=u("0100000000000000000001B8FA16DFAB9ACA16B6B3"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE"),i,n)}function a(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),r=u("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),i=u("0100000000000000000001F4C8F927AED3CA752257"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32"),i,n)}function f(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=o.ZERO,r=u("3"),i=u("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"),i,n)}function p(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),r=u("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),i=u("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811"),i,n)}function h(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),r=u("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),i=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"),i,n)}function l(){var e=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),r=u("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),i=u("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),i,n)}c.prototype.getCurve=function(){return this.curve},c.prototype.getG=function(){return this.g},c.prototype.getN=function(){return this.n},c.prototype.getH=function(){return this.h},t.exports={secp128r1:i,secp160k1:n,secp160r1:a,secp192k1:f,secp192r1:p,secp224r1:h,secp256r1:l}},{"./ec.js":251,jsbn:325}],253:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":268,"./elliptic/curve":256,"./elliptic/curves":259,"./elliptic/ec":260,"./elliptic/eddsa":263,"./elliptic/utils":267,brorand:156}],254:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,j=n.getNAF,E=n.getJSF,p=n.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i,n){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,c=0,u=0;u>1]:S<0&&(x=o[g][-S-1>>1].neg()),y="affine"===x.type?y.mixedAdd(x):y.add(x))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},o.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.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),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],256:[function(e,t,r){arguments[4][130][0].apply(r,arguments)},{"./base":254,"./edwards":255,"./mont":257,"./short":258,dup:130}],257:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base,s=e("../../elliptic").utils;function c(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(c,o),(t.exports=c).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)},a(u,o.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},c.prototype.point=function(e,t){return new u(this,e,t)},c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.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)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},u.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 a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],258:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new w(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)},c.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)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],259:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":253,"./precomputed/secp256k1":266,"hash.js":299}],260:[function(e,t,r){"use strict";var g=e("bn.js"),v=e("hmac-drbg"),a=e("../../elliptic"),l=a.utils.assert,i=e("./key"),b=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(l(a.curves.hasOwnProperty(e),"Unknown curve "+e),e=a.curves[e]),e instanceof a.curves.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}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new v({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new g(2));;){var n=new g(t.generate(r));if(!(0>1;if(0<=o.cmp(this.curve.p.umod(this.curve.n))&&u)throw new Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var f=t.r.invm(n),p=n.sub(a).mul(f).umod(n),h=s.mul(f).umod(n);return this.g.mulAdd(p,o,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new b(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":253,"./key":261,"./signature":262,"bn.js":154,"hmac-drbg":311}],261:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=a).fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},{"../../elliptic":253,"bn.js":154}],262:[function(e,t,r){"use strict";var s=e("bn.js"),c=e("../../elliptic").utils,i=c.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=c.toArray(e,t);var r=new u;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=f(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=f(e,r);if(e.length!==a+r.place)return!1;var o=e.slice(r.place,a+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===o[0]&&128&o[1]&&(o=o.slice(1)),this.r=new s(n),this.s=new s(o),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];p(i,t.length),(i=i.concat(t)).push(2),p(i,r.length);var n=i.concat(r),a=[48];return p(a,n.length),a=a.concat(n),c.encode(a,e)}},{"../../elliptic":253,"bn.js":154}],263:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),a=n.utils,o=a.assert,c=a.parseBytes,s=e("./key"),u=e("./signature");function f(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=f).prototype.sign=function(e,t){e=c(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),a=this.encodePoint(n),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:a})},f.prototype.verify=function(e,t,r){e=c(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(a)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=6.0.0 <7.0.0",_id:"elliptic@6.4.1",_inCache:!0,_installable:!0,_location:"/elliptic",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/elliptic_6.4.1_1533787091502_0.6309761823717674"},_npmUser:{email:"fedor@indutny.com",name:"indutny"},_npmVersion:"6.3.0",_phantomChildren:{},_requested:{name:"elliptic",raw:"elliptic@^6.0.0",rawSpec:"^6.0.0",scope:null,spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/home/giacof/Download/javascript-opentimestamps/node_modules/browserify-sign",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{fileCount:17,integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJba7vUCRA9TVsSAnZWagAA+gcP/jWaj5GmDZ0YFi/X4g5O\nx+pxu9i3HbP9YqywT7rz3XFXSaytu0LQDeDEbddl523X69tsbKfzHRTcnW8n\n2r0VjPhttRm+0RpEhBwjSIK34VkQA1xIWh2ugOToKXVCFVLM5VFDPGzbiN6x\n/hpL7gj1hoCRVmuhjnqFQ+vPKACKfv1Eq4CsRmu2focmP37kQpWQlweD/z4V\nJF4NxA33Fvp13Fl+9g4sPHyhUVsW9ojVaG3Ijn70pCaGQM18UPlbODkWQ1QX\nAgteOFjkIOtcalJk3B3qsM8GZeHEcAFvt2T73miJkHdCGNmRQS45Ede+gnj0\nlLlZJsCCKUHtTqrlprHo6AgMnBZufmytyozYAHC1/JYniazSBi2yPHtQeniR\nl69BfiRBdD2rNrMPwmCNRkMqrgel5WMGpaD0xdaFAHF1Ru2ZQFKsA7KvPGgp\nA20+LN11cCib67Pg5XDyrZ92T3yXec+6gQ3iq9d9UBZKFGl0P8ebVqq1LrUJ\na6nekwMpRISWnKcqV72XVmQdBmUWHq9VfVLsWJzVIJqtpHmUO7q74ACP3i4W\n0/F1REeI0YEhh3NjeStdDecfjlu7PY0pLQpbk2I3ms+6DO+cAfeDEev5jFBK\nwQabRNhITeT1FVtxZAcApj33fnCdqwaWr1NS00K5ZRqhDTTzPr/O4KRN4CR1\npstU\r\n=UVBB\r\n-----END PGP SIGNATURE-----\r\n",shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",unpackedSize:118371},files:["lib"],gitHead:"523da1cf71ddcfd607fbdee1858bc2af47f0e700",homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.1"}},{}],269:[function(e,t,r){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function c(e){return"function"==typeof e}function u(e){return"object"===(void 0===e?"undefined":_typeof(e))&&null!==e}function f(e){return void 0===e}((t.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},i.prototype.emit=function(e){var t,r,i,n,a,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(f(r=this._events[e]))return!1;if(c(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=Array.prototype.slice.call(arguments,1),r.apply(this,n)}else if(u(r))for(n=Array.prototype.slice.call(arguments,1),i=(o=r.slice()).length,a=0;ar&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!c(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,a;if(!c(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||c(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(r)){for(a=n;0=this._blockSize;){for(var n=this._blockOffset;n=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=n.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,a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":310}],310:[function(e,t,r){"use strict";var u=e("minimalistic-assert"),i=e("inherits");function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function o(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}r.inherits=i,r.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:320,"minimalistic-assert":353}],311:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),i=o.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length1e3*t.clockSkew)throw new E("clock skew of "+g/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach(function(e){if(u.params.headers.indexOf(e.toLowerCase())<0)throw new P(e+" was not a signed header")}),t.algorithms&&-1===t.algorithms.indexOf(u.params.algorithm))throw new I(u.params.algorithm+" is not a supported algorithm");return u.algorithm=u.params.algorithm.toUpperCase(),u.keyId=u.params.keyId,u}}},{"./utils":315,"assert-plus":66,util:505}],314:[function(n,a,e){(function(l){var d=n("assert-plus"),m=n("crypto"),e=(n("http"),n("util")),g=n("sshpk"),v=n("jsprim"),t=n("./utils"),b=n("util").format,y=t.HASH_ALGOS,_=t.PK_ALGOS,w=t.InvalidAlgorithmError,r=t.HttpSignatureError,k=t.validateAlgorithm,x='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';function S(e){r.call(this,e,S)}function j(e){r.call(this,e,j)}function i(e){d.object(e,"options");var t=[];if(void 0!==e.algorithm&&(d.string(e.algorithm,"options.algorithm"),t=k(e.algorithm)),this.rs_alg=t,void 0!==e.sign)d.func(e.sign,"options.sign"),this.rs_signFunc=e.sign;else if("hmac"===t[0]&&void 0!==e.key){if(d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,"string"!=typeof e.key&&!l.isBuffer(e.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=m.createHmac(t[1].toUpperCase(),e.key),this.rs_signer.sign=function(){var e=this.digest("base64");return{hashAlgorithm:t[1],toString:function(){return e}}}}else{if(void 0===e.key)throw new TypeError("options.sign (func) or options.key is required");var r=e.key;if(("string"==typeof r||l.isBuffer(r))&&(r=g.parsePrivateKey(r)),d.ok(g.PrivateKey.isPrivateKey(r,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=r,d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,!_[r.type])throw new w(r.type.toUpperCase()+" type keys are not supported");if(void 0!==t[0]&&r.type!==t[0])throw new w("options.key must be a "+t[0].toUpperCase()+" key, was given a "+r.type.toUpperCase()+" key instead");this.rs_signer=r.createSign(t[1])}this.rs_headers=[],this.rs_lines=[]}e.inherits(S,r),e.inherits(j,r),i.prototype.writeHeader=function(e,t){if(d.string(e,"header"),e=e.toLowerCase(),d.string(t,"value"),this.rs_headers.push(e),this.rs_signFunc)this.rs_lines.push(e+": "+t);else{var r=e+": "+t;0>1,f=-7,p=r?n-1:0,h=r?-1:1,l=e[t+p];for(p+=h,a=l&(1<<-f)-1,l>>=-f,f+=s;0>=-f,f+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:a-1,d=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),2<=(t+=1<=o+p?h/c:h*Math.pow(2,1-p))*c&&(o++,c/=2),f<=o+p?(s=0,o=f):1<=o+p?(s=(t*c-1)*Math.pow(2,n),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,n),o=0));8<=n;e[r+l]=255&s,l+=d,s/=256,n-=8);for(o=o<>15;0<=--a;){var c=32767&this[e],u=this[e++]>>15,f=s*c+u*o;n=((c=o*c+((32767&f)<<15)+r[i]+(1073741823&n))>>>30)+(f>>>15)+s*u+(n>>>30),r[i++]=1073741823&c}return n},30):t&&"Netscape"!=navigator.appName?(y.prototype.am=function(e,t,r,i,n,a){for(;0<=--a;){var o=t*this[e++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},26):(y.prototype.am=function(e,t,r,i,n,a){for(var o=16383&t,s=t>>14;0<=--a;){var c=16383&this[e],u=this[e++]>>14,f=s*c+u*o;n=((c=o*c+((16383&f)<<14)+r[i]+n)>>28)+(f>>14)+s*u,r[i++]=268435455&c}return n},28),y.prototype.DB=e,y.prototype.DM=(1<>>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 v(e){this.m=e}function b(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 l(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function d(){}function m(e){return e}function k(e){this.r2=_(),this.q3=_(),y.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},b.prototype.convert=function(e){var t=_();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&0>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),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},b.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.copyTo=function(e){for(var t=this.t-1;0<=t;--t)e[t]=this[t];e.t=this.t,e.s=this.s},y.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0this.DB?(this[this.t-1]|=(o&(1<>this.DB-a):this[this.t-1]|=o<=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,0>n|s,s=(this[r]&a)<=this.t)t.t=0;else{var i=e%this.DB,n=this.DB-i,a=(1<>i;for(var o=r+1;o>i;0>=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:0=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}0>this.F2:0),h=this.FV/p,l=(1<>s)&&(n=!0,a=c(r));0<=o;)s>(s+=this.DB-t)):(r=this[o]>>(s-=t)&i,s<=0&&(s+=this.DB,--o)),02*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=_();return e.copyTo(t),this.reduce(t),t},k.prototype.revert=function(e){return e},k.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);0<=e.compareTo(this.m);)e.subTo(this.m,e)},k.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},k.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x,S,j,E=[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],A=(1<<26)/E[E.length-1];function I(){var e;e=(new Date).getTime(),S[j++]^=255&e,S[j++]^=e>>8&255,S[j++]^=e>>16&255,S[j++]^=e>>24&255,R<=j&&(j-=R)}if(y.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},y.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||36=r&&(this.dMultiply(i),this.dAddOffset(o,0),o=a=0))}0e&&this.subTo(y.ONE.shiftLeft(e-1),this);else{var i=new Array,n=7&e;i.length=1+(e>>3),t.nextBytes(i),0>=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,0=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},y.prototype.multiplyLowerTo=function(e,t,r){var i,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;0>1)>E.length&&(e=E.length);for(var n=_(),a=0;a>24},y.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},y.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},y.prototype.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(0>i)!=(this.s&this.DM)>>i&&(t[n++]=r|this.s<>(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,(0=this.t?0!=this.s:0!=(this[t]&1<>n-c&u:(p=(e[l]&(1<>this.DB+n-c)),s=r;0==(1&p);)p>>=1,--s;if((n-=s)<0&&(n+=this.DB,--l),d)o[p].copyTo(a),d=!1;else{for(;1>>8,S[j++]=255&P;j=0,I()}function B(){if(null==x){for(I(),(x=new F).init(S),j=0;jt.maxItems&&n("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&m.concat(function(e,t,r,i){if("object"==(void 0===t?"undefined":_typeof(t)))for(var n in("object"!=(void 0===e?"undefined":_typeof(e))||e instanceof Array)&&m.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(n)){var a=e[n];if(void 0===a&&h.existingOnly)continue;var o=t[n];void 0===a&&o.default&&(a=e[n]=o.default),h.coerce&&n in e&&(a=e[n]=h.coerce(a,o)),g(a,o,r,n)}for(n in e){if(e.hasOwnProperty(n)&&("_"!=n.charAt(0)||"_"!=n.charAt(1))&&t&&!t[n]&&!1===i){if(h.filter){delete e[n];continue}m.push({property:r,message:(void 0===a?"undefined":_typeof(a))+"The property "+n+" is not defined in the schema and the schema does not allow additional properties"})}var s=t&&t[n]&&t[n].requires;!s||s in e||m.push({property:r,message:"the presence of the property "+n+" requires that "+s+" also be present"}),a=e[n],!i||t&&"object"==(void 0===t?"undefined":_typeof(t))&&n in t||(h.coerce&&(a=e[n]=h.coerce(a,i)),g(a,i,r,n)),!l&&a&&a.$schema&&(m=m.concat(g(a,a.$schema,r,n)))}return m}(e,t.properties,o,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&n("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&n("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.lengthe&&n("must have a minimum value of "+t.minimum),void 0!==_typeof(t.maximum)&&(void 0===e?"undefined":_typeof(e))==_typeof(t.maximum)&&t.maximum= 2"),d.ok(n.base<=36,"options.base <= 36"),d.bool(n.allowSign,"options.allowSign"),d.bool(n.allowPrefix,"options.allowPrefix"),d.bool(n.allowTrailing,"options.allowTrailing"),d.bool(n.allowImprecise,"options.allowImprecise"),d.bool(n.trimWhitespace,"options.trimWhitespace"),d.bool(n.leadingZeroIsOctal,"options.leadingZeroIsOctal"),n.leadingZeroIsOctal&&d.ok(!i,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var a,o=-1,s=n.base,c=1,u=0,f=0,p=e.length;if(n.trimWhitespace)for(;ft[0]||e[0]==t[0]&&e[1]>=t[1],"negative differences not allowed");var r=[e[0]-t[0],0];return e[1]>=t[1]?r[1]=e[1]-t[1]:(r[0]--,r[1]=1e9-(t[1]-e[1])),r}function R(e,t){return C(e),C(t),e[1]+=t[1],1e9<=e[1]&&(e[0]++,e[1]-=1e9),e[0]+=t[0],e}function z(e,t,r){var i,n;if(i={},r)for(n in r)i[n]=r[n];if(e)for(n in e)i[n]=e[n];if(t)for(n in t)i[n]=t[n];return i}},{"assert-plus":66,extsprintf:272,"json-schema":327,util:505,verror:509}],330:[function(e,t,r){"use strict";t.exports=e("./lib/api")(e("./lib/keccak"))},{"./lib/api":331,"./lib/keccak":335}],331:[function(e,t,r){"use strict";var n=e("./keccak"),a=e("./shake");t.exports=function(e){var r=n(e),i=a(e);return function(e,t){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new r(1152,448,null,224,t);case"keccak256":return new r(1088,512,null,256,t);case"keccak384":return new r(832,768,null,384,t);case"keccak512":return new r(576,1024,null,512,t);case"sha3-224":return new r(1152,448,6,224,t);case"sha3-256":return new r(1088,512,6,256,t);case"sha3-384":return new r(832,768,6,384,t);case"sha3-512":return new r(576,1024,6,512,t);case"shake128":return new i(1344,256,31,t);case"shake256":return new i(1088,512,31,t);default:throw new Error("Invald algorithm: "+e)}}}},{"./keccak":332,"./shake":333}],332:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,o=e("stream").Transform,n=e("inherits");t.exports=function(a){function t(e,t,r,i,n){o.call(this,n),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._hashBitLength=i,this._options=n,this._state=new a,this._state.initialize(e,t),this._finalized=!1}return n(t,o),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],333:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("stream").Transform,o=e("inherits");t.exports=function(n){function t(e,t,r,i){a.call(this,i),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._options=i,this._state=new n,this._state.initialize(e,t),this._finalized=!1}return o(t,a),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],334:[function(e,t,r){"use strict";var ot=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];r.p1600=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],n=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],h=f^(n<<1|a>>>31),l=p^(a<<1|n>>>31),d=e[0]^h,m=e[1]^l,g=e[10]^h,v=e[11]^l,b=e[20]^h,y=e[21]^l,_=e[30]^h,w=e[31]^l,k=e[40]^h,x=e[41]^l;h=r^(o<<1|s>>>31),l=i^(s<<1|o>>>31);var S=e[2]^h,j=e[3]^l,E=e[12]^h,A=e[13]^l,I=e[22]^h,P=e[23]^l,O=e[32]^h,T=e[33]^l,B=e[42]^h,C=e[43]^l;h=n^(c<<1|u>>>31),l=a^(u<<1|c>>>31);var F=e[4]^h,R=e[5]^l,z=e[14]^h,M=e[15]^l,D=e[24]^h,N=e[25]^l,q=e[34]^h,L=e[35]^l,U=e[44]^h,H=e[45]^l;h=o^(f<<1|p>>>31),l=s^(p<<1|f>>>31);var K=e[6]^h,V=e[7]^l,G=e[16]^h,$=e[17]^l,W=e[26]^h,Z=e[27]^l,Y=e[36]^h,X=e[37]^l,J=e[46]^h,Q=e[47]^l;h=c^(r<<1|i>>>31),l=u^(i<<1|r>>>31);var ee=e[8]^h,te=e[9]^l,re=e[18]^h,ie=e[19]^l,ne=e[28]^h,ae=e[29]^l,oe=e[38]^h,se=e[39]^l,ce=e[48]^h,ue=e[49]^l,fe=d,pe=m,he=v<<4|g>>>28,le=g<<4|v>>>28,de=b<<3|y>>>29,me=y<<3|b>>>29,ge=w<<9|_>>>23,ve=_<<9|w>>>23,be=k<<18|x>>>14,ye=x<<18|k>>>14,_e=S<<1|j>>>31,we=j<<1|S>>>31,ke=A<<12|E>>>20,xe=E<<12|A>>>20,Se=I<<10|P>>>22,je=P<<10|I>>>22,Ee=T<<13|O>>>19,Ae=O<<13|T>>>19,Ie=B<<2|C>>>30,Pe=C<<2|B>>>30,Oe=R<<30|F>>>2,Te=F<<30|R>>>2,Be=z<<6|M>>>26,Ce=M<<6|z>>>26,Fe=N<<11|D>>>21,Re=D<<11|N>>>21,ze=q<<15|L>>>17,Me=L<<15|q>>>17,De=H<<29|U>>>3,Ne=U<<29|H>>>3,qe=K<<28|V>>>4,Le=V<<28|K>>>4,Ue=$<<23|G>>>9,He=G<<23|$>>>9,Ke=W<<25|Z>>>7,Ve=Z<<25|W>>>7,Ge=Y<<21|X>>>11,$e=X<<21|Y>>>11,We=Q<<24|J>>>8,Ze=J<<24|Q>>>8,Ye=ee<<27|te>>>5,Xe=te<<27|ee>>>5,Je=re<<20|ie>>>12,Qe=ie<<20|re>>>12,et=ae<<7|ne>>>25,tt=ne<<7|ae>>>25,rt=oe<<8|se>>>24,it=se<<8|oe>>>24,nt=ce<<14|ue>>>18,at=ue<<14|ce>>>18;e[0]=fe^~ke&Fe,e[1]=pe^~xe&Re,e[10]=qe^~Je&de,e[11]=Le^~Qe&me,e[20]=_e^~Be&Ke,e[21]=we^~Ce&Ve,e[30]=Ye^~he&Se,e[31]=Xe^~le&je,e[40]=Oe^~Ue&et,e[41]=Te^~He&tt,e[2]=ke^~Fe&Ge,e[3]=xe^~Re&$e,e[12]=Je^~de&Ee,e[13]=Qe^~me&Ae,e[22]=Be^~Ke&rt,e[23]=Ce^~Ve&it,e[32]=he^~Se&ze,e[33]=le^~je&Me,e[42]=Ue^~et&ge,e[43]=He^~tt&ve,e[4]=Fe^~Ge&nt,e[5]=Re^~$e&at,e[14]=de^~Ee&De,e[15]=me^~Ae&Ne,e[24]=Ke^~rt&be,e[25]=Ve^~it&ye,e[34]=Se^~ze&We,e[35]=je^~Me&Ze,e[44]=et^~ge&Ie,e[45]=tt^~ve&Pe,e[6]=Ge^~nt&fe,e[7]=$e^~at&pe,e[16]=Ee^~De&qe,e[17]=Ae^~Ne&Le,e[26]=rt^~be&_e,e[27]=it^~ye&we,e[36]=ze^~We&Ye,e[37]=Me^~Ze&Xe,e[46]=ge^~Ie&Oe,e[47]=ve^~Pe&Te,e[8]=nt^~fe&ke,e[9]=at^~pe&xe,e[18]=De^~qe&Je,e[19]=Ne^~Le&Qe,e[28]=be^~_e&Be,e[29]=ye^~we&Ce,e[38]=We^~Ye&he,e[39]=Ze^~Xe&le,e[48]=Ie^~Oe&Ue,e[49]=Pe^~Te&He,e[0]^=ot[2*t],e[1]^=ot[2*t+1]}}},{}],335:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=e("./keccak-state-unroll");function a(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}a.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},a.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},a.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},t.exports=a},{"./keccak-state-unroll":334,"safe-buffer":447}],336:[function(e,t,r){var i=e("./_root").Symbol;t.exports=i},{"./_root":341}],337:[function(e,t,r){var i=e("./_Symbol"),n=e("./_getRawTag"),a=e("./_objectToString"),o=i?i.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},{"./_Symbol":336,"./_getRawTag":339,"./_objectToString":340}],338:[function(e,r,t){(function(e){var t="object"==(void 0===e?"undefined":_typeof(e))&&e&&e.Object===Object&&e;r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],339:[function(e,t,r){var i=e("./_Symbol"),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,s=i?i.toStringTag:void 0;t.exports=function(e){var t=a.call(e,s),r=e[s];try{var i=!(e[s]=void 0)}catch(e){}var n=o.call(e);return i&&(t?e[s]=r:delete e[s]),n}},{"./_Symbol":336}],340:[function(e,t,r){var i=Object.prototype.toString;t.exports=function(e){return i.call(e)}},{}],341:[function(e,t,r){var i=e("./_freeGlobal"),n="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,a=i||n||Function("return this")();t.exports=a},{"./_freeGlobal":338}],342:[function(e,t,r){var i=Array.isArray;t.exports=i},{}],343:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isObject");t.exports=function(e){if(!n(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},{"./_baseGetTag":337,"./isObject":344}],344:[function(e,t,r){t.exports=function(e){var t=void 0===e?"undefined":_typeof(e);return null!=e&&("object"==t||"function"==t)}},{}],345:[function(e,t,r){t.exports=function(e){return null!=e&&"object"==(void 0===e?"undefined":_typeof(e))}},{}],346:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isArray"),a=e("./isObjectLike");t.exports=function(e){return"string"==typeof e||!n(e)&&a(e)&&"[object String]"==i(e)}},{"./_baseGetTag":337,"./isArray":342,"./isObjectLike":345}],347:[function(e,t,r){t.exports=function(e){return void 0===e}},{}],348:[function(e,t,r){"use strict";var i=e("inherits"),n=e("hash-base"),a=e("safe-buffer").Buffer,o=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,r,i,n,a,o){return c(e+(t&r|~t&i)+n+a|0,o)+t|0}function f(e,t,r,i,n,a,o){return c(e+(t&i|r&~i)+n+a|0,o)+t|0}function p(e,t,r,i,n,a,o){return c(e+(t^r^i)+n+a|0,o)+t|0}function h(e,t,r,i,n,a,o){return c(e+(r^(t|~i))+n+a|0,o)+t|0}i(s,n),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,a=this._d;i=h(i=h(i=h(i=h(i=p(i=p(i=p(i=p(i=f(i=f(i=f(i=f(i=u(i=u(i=u(i=u(i,n=u(n,a=u(a,r=u(r,i,n,a,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),a,r,e[3],3250441966,22),n=u(n,a=u(a,r=u(r,i,n,a,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),a,r,e[7],4249261313,22),n=u(n,a=u(a,r=u(r,i,n,a,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),a,r,e[11],2304563134,22),n=u(n,a=u(a,r=u(r,i,n,a,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),a,r,e[15],1236535329,22),n=f(n,a=f(a,r=f(r,i,n,a,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),a,r,e[0],3921069994,20),n=f(n,a=f(a,r=f(r,i,n,a,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),a,r,e[4],3889429448,20),n=f(n,a=f(a,r=f(r,i,n,a,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),a,r,e[8],1163531501,20),n=f(n,a=f(a,r=f(r,i,n,a,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),a,r,e[12],2368359562,20),n=p(n,a=p(a,r=p(r,i,n,a,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),a,r,e[14],4259657740,23),n=p(n,a=p(a,r=p(r,i,n,a,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),a,r,e[10],3200236656,23),n=p(n,a=p(a,r=p(r,i,n,a,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),a,r,e[6],76029189,23),n=p(n,a=p(a,r=p(r,i,n,a,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),a,r,e[2],3299628645,23),n=h(n,a=h(a,r=h(r,i,n,a,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),a,r,e[5],4237533241,21),n=h(n,a=h(a,r=h(r,i,n,a,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),a,r,e[1],2240044497,21),n=h(n,a=h(a,r=h(r,i,n,a,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),a,r,e[13],1309151649,21),n=h(n,a=h(a,r=h(r,i,n,a,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),a,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+a|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e}},{}],355:[function(e,t,r){(t.exports=o).Minimatch=n;var u={sep:"/"};try{u=e("path")}catch(e){}var z=o.GLOBSTAR=n.GLOBSTAR={},i=e("brace-expansion"),M={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},D="[^/]*?",N="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{});var f=/\/+/;function a(t,r){t=t||{},r=r||{};var i={};return Object.keys(r).forEach(function(e){i[e]=r[e]}),Object.keys(t).forEach(function(e){i[e]=t[e]}),i}function o(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new n(t,r).match(e))}function n(e,t){if(!(this instanceof n))return new n(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==u.sep&&(e=e.split(u.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function s(e,t){if(t||(t=this instanceof n?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:i(e)}o.filter=function(i,n){return n=n||{},function(e,t,r){return o(e,i,n)}},o.defaults=function(i){if(!i||!Object.keys(i).length)return o;var n=o,e=function(e,t,r){return n.minimatch(e,t,a(i,r))};return e.Minimatch=function(e,t){return new n.Minimatch(e,a(i,t))},e},n.defaults=function(e){return e&&Object.keys(e).length?o.defaults(e).Minimatch:n},n.prototype.debug=function(){},n.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(f)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r},n.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=this.options,i=0;if(r.nonegate)return;for(var n=0,a=e.length;n>> no match, partial?",e,p,t,h),p!==o))}if("string"==typeof u?(c=i.nocase?f.toLowerCase()===u.toLowerCase():f===u,this.debug("string match",u,f,c)):(c=f.match(u),this.debug("pattern match",u,f,c)),!c)return!1}if(n===o&&a===s)return!0;if(n===o)return r;if(a===s)return n===o-1&&""===e[n];throw new Error("wtf?")}},{"brace-expansion":155,path:374}],356:[function(e,t,r){var c=e("crypto");function o(e,t,r){return c.createHmac(r,e).update(t).digest("base64")}function s(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function n(e,t){return t>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var n=s,a=i+r;e^=-1;for(var o=i;o>>8^n[255&(e^t[o])];return-1^e}},{}],362:[function(e,t,r){"use strict";var c,h=e("../utils/common"),u=e("./trees"),l=e("./adler32"),d=e("./crc32"),i=e("./messages"),f=0,p=4,m=0,g=-2,v=-1,b=4,n=2,y=8,_=9,a=286,o=30,s=19,w=2*a+1,k=15,x=3,S=258,j=S+x+1,E=42,A=113,I=1,P=2,O=3,T=4;function B(e,t){return e.msg=i[t],t}function C(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(h.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function z(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,R(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function D(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function N(e,t){var r,i,n=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-j?e.strstart-(e.w_size-j):0,u=e.window,f=e.w_mask,p=e.prev,h=e.strstart+S,l=u[a+o-1],d=u[a+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===d&&u[r+o-1]===l&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ac&&0!=--n);return o<=e.lookahead?o:e.lookahead}function q(e){var t,r,i,n,a,o,s,c,u,f,p=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-j)){for(h.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;i=e.head[--t],e.head[t]=p<=i?i-p:0,--r;);for(t=r=p;i=e.prev[--t],e.prev[t]=p<=i?i-p:0,--r;);n+=p}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,c=e.strstart+e.lookahead,u=n,f=void 0,f=o.avail_in,u=x)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(i=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(n=e.strstart+e.lookahead-x,i=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=n&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(q(e),0===e.lookahead&&t===f)return I;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,z(e,!1),0===e.strm.avail_out))return I;if(e.strstart-e.block_start>=e.w_size-j&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):(e.strstart>e.block_start&&(z(e,!1),e.strm.avail_out),I)}),new H(4,4,8,4,L),new H(4,5,16,8,L),new H(4,6,32,32,L),new H(4,4,16,16,U),new H(8,16,32,32,U),new H(8,16,128,128,U),new H(8,32,128,256,U),new H(32,128,258,1024,U),new H(32,258,258,4096,U)],r.deflateInit=function(e,t){return $(e,t,y,15,8,0)},r.deflateInit2=$,r.deflateReset=G,r.deflateResetKeep=V,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,m):g},r.deflate=function(e,t){var r,i,n,a;if(!e||!e.state||5>8&255),M(i,i.gzhead.time>>16&255),M(i,i.gzhead.time>>24&255),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(M(i,255&i.gzhead.extra.length),M(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=d(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(M(i,0),M(i,0),M(i,0),M(i,0),M(i,0),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,3),i.status=A);else{var o=y+(i.w_bits-8<<4)<<8;o|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(o|=32),o+=31-o%31,i.status=A,D(i,o),0!==i.strstart&&(D(i,e.adler>>>16),D(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending!==i.pending_buf_size));)M(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&R(e),i.pending+2<=i.pending_buf_size&&(M(i,255&e.adler),M(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(R(e),0===e.avail_out)return i.last_flush=-1,m}else if(0===e.avail_in&&C(t)<=C(r)&&t!==p)return B(e,-5);if(666===i.status&&0!==e.avail_in)return B(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==f&&666!==i.status){var s=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(q(e),0===e.lookahead)){if(t===f)return I;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):3===i.strategy?function(e,t){for(var r,i,n,a,o=e.window;;){if(e.lookahead<=S){if(q(e),e.lookahead<=S&&t===f)return I;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):c[i.level].func(i,t);if(s!==O&&s!==T||(i.status=666),s===I||s===O)return 0===e.avail_out&&(i.last_flush=-1),m;if(s===P&&(1===t?u._tr_align(i):5!==t&&(u._tr_stored_block(i,0,0,!1),3===t&&(F(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),R(e),0===e.avail_out))return i.last_flush=-1,m}return t!==p?m:i.wrap<=0?1:(2===i.wrap?(M(i,255&e.adler),M(i,e.adler>>8&255),M(i,e.adler>>16&255),M(i,e.adler>>24&255),M(i,255&e.total_in),M(i,e.total_in>>8&255),M(i,e.total_in>>16&255),M(i,e.total_in>>24&255)):(D(i,e.adler>>>16),D(i,65535&e.adler)),R(e),0=r.w_size&&(0===a&&(F(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new h.Buf8(r.w_size),h.arraySet(u,t,f-r.w_size,r.w_size,0),t=u,f=r.w_size),o=e.avail_in,s=e.next_in,c=e.input,e.avail_in=f,e.next_in=0,e.input=t,q(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=_=y>>>24,d-=_,0===(_=y>>>16&255))E[a++]=65535&y;else{if(!(16&_)){if(0==(64&_)){y=m[(65535&y)+(l&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&y,(_&=15)&&(d<_&&(l+=j[i++]<>>=_,d-=_),d<15&&(l+=j[i++]<>>=_=y>>>24,d-=_,!(16&(_=y>>>16&255))){if(0==(64&_)){y=g[(65535&y)+(l&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&y,d<(_&=15)&&(l+=j[i++]<>>=_,d-=_,(_=a-o)>3,l&=(1<<(d-=w<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new P.Buf16(320),this.work=new P.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=D,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new P.Buf32(i),t.distcode=t.distdyn=new P.Buf32(n),t.sane=1,t.back=-1,z):M}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):M}function c(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=a.wsize?(P.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(n=a.wsize-a.wnext)&&(n=i),P.arraySet(a.window,t,r-i,n,a.wnext),(i-=n)?(P.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=T(r.check,A,2,0),f=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(f-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=3;case 3:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>8&255,A[2]=u>>>16&255,A[3]=u>>>24&255,r.check=T(r.check,A,4,0)),f=u=0,r.mode=4;case 4:for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>8),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>>8&255,r.check=T(r.check,A,2,0)),f=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(s<(l=r.length)&&(l=s),l&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),P.arraySet(r.head.extra,i,a,l,k)),512&r.flags&&(r.check=T(r.check,i,l,a)),s-=l,a+=l,r.length-=l),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;for(l=0;k=i[a+l++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&l>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>=7&f,f-=7&f,r.mode=27;break}for(;f<3;){if(0===s)break e;s--,u+=i[a++]<>>=1)){case 0:r.mode=14;break;case 1:if(q(r),r.mode=20,6!==t)break;u>>>=2,f-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,f-=2;break;case 14:for(u>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,u+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,f=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(l=r.length){if(s>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,286>>=3,f-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=C(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=g,f-=g,r.lens[r.have++]=b;else{if(16===b){for(j=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],l=3+(3&u),u>>>=2,f-=2}else if(17===b){for(j=g+3;f>>=g)),u>>>=3,f-=3}else{for(j=g+7;f>>=g)),u>>>=7,f-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;l--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=C(F,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=C(R,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=s&&258<=c){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,r.hold=u,r.bits=f,B(e,h),o=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,u=r.hold,f=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;v=(E=r.lencode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,r.length=b,0===v){r.mode=26;break}if(32&v){r.back=-1,r.mode=12;break}if(64&v){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&v,r.mode=22;case 22:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=(E=r.distcode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&v,r.mode=24;case 24:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===c)break e;if(l=h-c,r.offset>l){if((l=r.offset-l)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d=l>r.wnext?(l-=r.wnext,r.wsize-l):r.wnext-l,l>r.length&&(l=r.length),m=r.window}else m=n,d=o-r.offset,l=r.length;for(cl?(m=B[C+o[y]],I[P+o[y]]):(m=96,0),c=1<>S)+(u-=c)]=d<<24|m<<16|g|0,0!==u;);for(c=1<>=1;if(0!==c?(A&=c-1,A+=c):A=0,y++,0==--O[b]){if(b===w)break;b=t[r+o[y]]}if(k>>7)]}function M(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function D(e,t,r){e.bi_valid>n-r?(e.bi_buf|=t<>n-e.bi_valid,e.bi_valid+=r-n):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function L(e,t,r){var i,n,a=new Array(v+1),o=0;for(i=1;i<=v;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=q(a[s]++,s))}}function U(e){var t;for(t=0;t>1;1<=r;r--)V(e,a,r);for(n=c;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],V(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,a[2*n]=a[2*r]+a[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,a[2*r+1]=a[2*i+1]=n,e.heap[1]=n++,V(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,n,a,o,s,c=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,p=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(a=0;a<=v;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return s;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return u;for(t=32;t>>3,(a=e.static_len+3+7>>>3)<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==t?X(e,t,r,i):4===e.strategy||a===n?(D(e,2+(i?1:0),3),G(e,E,A)):(D(e,4+(i?1:0),3),function(e,t,r,i){var n;for(D(e,t-257,5),D(e,r-1,5),D(e,i-4,4),n=0;n>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(P[r]+p+1)]++,e.dyn_dtree[2*z(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;D(e,2,3),N(e,b,E),16===(t=e).bi_valid?(M(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":358}],368:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],369:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],370:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var a=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=a;var o=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=o;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var f=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=f,r.DSAparam=i.define("DSAparam",function(){this.int()});var p=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=p;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":371,"asn1.js":46}],371:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),a=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(a)}),u=i.define("RDNSequence",function(){this.seqof(c)}),f=i.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),p=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(f),this.key("validity").use(p),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),d=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=d},{"asn1.js":46}],372:[function(e,t,r){(function(h){var l=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,d=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m,m=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,g=e("evp_bytestokey"),v=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(l);if(n){var a="aes"+n[1],o=new h(n[2],"hex"),s=new h(n[3].replace(/[\r\n]/g,""),"base64"),c=g(t,o.slice(0,8),parseInt(n[1],10)).key,u=[],f=v.createDecipheriv(a,c,o);u.push(f.update(s)),u.push(f.final()),r=h.concat(u)}else{var p=i.match(m);r=new h(p[2].replace(/[\r\n]/g,""),"base64")}return{tag:i.match(d)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":160,buffer:191,evp_bytestokey:270}],373:[function(t,r,e){(function(b){var y=t("./asn1"),_=t("./aesid.json"),w=t("./fixProc"),k=t("browserify-aes"),x=t("pbkdf2");function e(e){var t;"object"!==(void 0===e?"undefined":_typeof(e))||b.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new b(e));var r,i,n,a,o,s,c,u,f,p,h,l,d,m=w(e,t),g=m.tag,v=m.data;switch(g){case"CERTIFICATE":i=y.certificate.decode(v,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=y.PublicKey.decode(v,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=y.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"ENCRYPTED PRIVATE KEY":v=y.EncryptedPrivateKey.decode(v,"der"),a=t,o=(n=v).algorithm.decrypt.kde.kdeparams.salt,s=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=_[n.algorithm.decrypt.cipher.algo.join(".")],u=n.algorithm.decrypt.cipher.iv,f=n.subjectPrivateKey,p=parseInt(c.split("-")[1],10)/8,h=x.pbkdf2Sync(a,o,s,p),l=k.createDecipheriv(c,h,u),(d=[]).push(l.update(f)),d.push(l.final()),v=b.concat(d);case"PRIVATE KEY":switch(r=(i=y.PrivateKey.decode(v,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:y.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=y.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"RSA PUBLIC KEY":return y.RSAPublicKey.decode(v,"der");case"RSA PRIVATE KEY":return y.RSAPrivateKey.decode(v,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:y.DSAPrivateKey.decode(v,"der")};case"EC PRIVATE KEY":return{curve:(v=y.ECPrivateKey.decode(v,"der")).parameters.value,privateKey:v.privateKey};default:throw new Error("unknown key type "+g)}}(r.exports=e).signature=y.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":369,"./asn1":370,"./fixProc":372,"browserify-aes":160,buffer:191,pbkdf2:375}],374:[function(e,t,u){(function(n){function a(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function o(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;ia?t=n(t):t.length "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+o+";","var res;","switch (argLength) {",r.concat(["extra"]).map(function(e,t){return"case "+t+":res = fn.call("+["self"].concat(r.slice(0,t)).concat("cb").join(",")+");break;"}).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],n)(a,e)}(e)};var o="function (err, res) {if (err) { rj(err); } else { rs(res); }}";a.nodeify=function(r){return function(){var e=Array.prototype.slice.call(arguments),t="function"==typeof e[e.length-1]?e.pop():null,i=this;try{return r.apply(this,arguments).nodeify(t,i)}catch(r){if(null==t)return new a(function(e,t){t(r)});n(function(){t.call(i,r)})}}},a.prototype.nodeify=function(t,r){if("function"!=typeof t)return this;this.then(function(e){n(function(){t.call(r,null,e)})},function(e){n(function(){t.call(r,e)})})}},{"./core.js":384,asap:44}],390:[function(e,t,r){"use strict";var i=e("./core.js");(t.exports=i).enableSynchronous=function(){i.prototype.isPending=function(){return 0==this.getState()},i.prototype.isFulfilled=function(){return 1==this.getState()},i.prototype.isRejected=function(){return 2==this.getState()},i.prototype.getValue=function(){if(3===this._65)return this._55.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._55},i.prototype.getReason=function(){if(3===this._65)return this._55.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._55},i.prototype.getState=function(){return 3===this._65?this._55.getState():-1===this._65||-2===this._65?0:this._65}},i.disableSynchronous=function(){i.prototype.isPending=void 0,i.prototype.isFulfilled=void 0,i.prototype.isRejected=void 0,i.prototype.getValue=void 0,i.prototype.getReason=void 0,i.prototype.getState=void 0}},{"./core.js":384}],391:[function(e,t,r){"use strict";var n=function(e){for(var t=e.toString(16);4!==t.length;)t="0"+t;return"\\u"+t};t.exports=function(e,t,r,i){return!r.key||61!==t&&58!==t&&t!==r.separator?31o||0<=new u(t).cmp(a.modulus))throw new Error("decryption error");n=r?d(new u(t),a):h(t,a);var s=m.alloc(o-n.length);if(n=m.concat([s,n],o),4===i)return function(e,t){var r=e.modulus.byteLength(),i=l("sha1").update(m.alloc(0)).digest(),n=i.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,n+1),o=t.slice(n+1),s=p(a,f(o,n)),c=p(o,f(s,r-n-1));if(function(e,t){e=m.from(e),t=m.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){a++;break}var o=t.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&a++;o.length<8&&a++;if(a)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}},{"./mgf":401,"./withPublic":404,"./xor":405,"bn.js":154,"browserify-rsa":178,"create-hash":200,"parse-asn1":373,"safe-buffer":447}],403:[function(e,t,r){var o=e("parse-asn1"),h=e("randombytes"),l=e("create-hash"),d=e("./mgf"),m=e("./xor"),g=e("bn.js"),s=e("./withPublic"),c=e("browserify-rsa"),v=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,a=o(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=l("sha1").update(v.alloc(0)).digest(),a=n.length,o=2*a;if(r-o-2>6]+a[128|63&n]:n<55296||57344<=n?r+=a[224|n>>12]+a[128|n>>6&63]+a[128|63&n]:(i+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),r+=a[240|n>>18]+a[128|n>>12&63]+a[128|n>>6&63]+a[128|63&n])}return r},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function i(r,n,a){if(!n)return r;if("object"!==(void 0===n?"undefined":_typeof(n))){if(Array.isArray(r))r.push(n);else{if("object"!==(void 0===r?"undefined":_typeof(r)))return[r,n];(a.plainObjects||a.allowPrototypes||!o.call(Object.prototype,n))&&(r[n]=!0)}return r}if("object"!==(void 0===r?"undefined":_typeof(r)))return[r].concat(n);var e=r;return Array.isArray(r)&&!Array.isArray(n)&&(e=s(r,a)),Array.isArray(r)&&Array.isArray(n)?(n.forEach(function(e,t){o.call(r,t)?r[t]&&"object"===_typeof(r[t])?r[t]=i(r[t],e,a):r.push(e):r[t]=e}),r):Object.keys(n).reduce(function(e,t){var r=n[t];return o.call(e,t)?e[t]=i(e[t],r,a):e[t]=r,e},e)}}},{}],411:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var a=/\+/g;e=e.split(t);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var s,c,u=e.length;0t.highWaterMark&&(t.highWaterMark=(m<=(r=e)?r=m:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(_("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?v.nextTick(x,e):x(e))}function x(e){_("emit readable"),e.emit("readable"),I(e)}function S(e,t){t.readingMore||(t.readingMore=!0,v.nextTick(j,e,t))}function j(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;ea.length?a.length:e;if(o===a.length?n+=a:n+=a.slice(0,e),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=a.slice(o);break}++i}return t.length-=i,n}(e,t):function(e,t){var r=u.allocUnsafe(e),i=t.head,n=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i).data=a.slice(o);break}++n}return t.length-=n,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return _("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):k(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,n=t.needReadable;return _("need readable",n),(0===t.length||t.length-e>>0),a=this.head,o=0;a;)t=a.data,r=n,i=o,t.copy(r,i),o+=a.data.length,a=a.next;return n},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":447,util:157}],423:[function(e,t,r){"use strict";var a=e("process-nextick-args");function o(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a.nextTick(o,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(o,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":381}],424:[function(e,t,r){t.exports=e("events").EventEmitter},{events:269}],425:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":426}],426:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":417,"./lib/_stream_passthrough.js":418,"./lib/_stream_readable.js":419,"./lib/_stream_transform.js":420,"./lib/_stream_writable.js":421}],427:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":426}],428:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":421}],429:[function(e,t,r){"use strict";var s=e("../"),c=e("lodash/isArray"),u=e("lodash/isFunction"),f=e("lodash/isObjectLike");t.exports=function(e){var t="Please verify options";if(!f(e))throw new TypeError(t);if(!u(e.request))throw new TypeError(t+".request");if(!c(e.expose)||0===e.expose.length)throw new TypeError(t+".expose");for(var r=s({PromiseImpl:e.PromiseImpl,constructorMixin:e.constructorMixin}),i=e.request.Request.prototype.init,n=!(e.request.Request.prototype.init=function(e){return!f(e)||this._callback||this._rp_promise||r.init.call(this,e),i.apply(this,arguments)}),a=0;a=t.maxRedirects)return r.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+r.uri.href)),!1;t.redirectsFollowed+=1,o.test(i)||(i=a.resolve(r.uri.href,i));var n=r.uri;return r.uri=a.parse(i),r.uri.protocol!==n.protocol&&delete r.agent,t.redirects.push({statusCode:e.statusCode,redirectUri:i}),t.followAllRedirects&&"HEAD"!==r.method&&401!==e.statusCode&&307!==e.statusCode&&(r.method=t.followOriginalHttpMethod?r.method:"GET"),delete r.src,delete r.req,delete r._started,401!==e.statusCode&&307!==e.statusCode&&(delete r.body,delete r._form,r.headers&&(r.removeHeader("host"),r.removeHeader("content-type"),r.removeHeader("content-length"),r.uri.hostname!==r.originalHost.split(":")[0]&&r.removeHeader("authorization"))),t.removeRefererHeader||r.setHeader("referer",n.href),r.emit("redirect"),r.init(),!0},r.Redirect=i},{url:500}],444:[function(e,t,r){"use strict";var w=e("url"),k=e("tunnel-agent"),i=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],x=["proxy-authorization"];function n(e){this.request=e,this.proxyHeaderWhiteList=i,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}n.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},n.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=w.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,i,n,a,o,s,c=this.proxyHeaderExclusiveList.concat(x),u=this.proxyHeaderWhiteList.concat(c),f=(r=t.headers,i=u.reduce(function(e,t){return e[t.toLowerCase()]=!0,e},{}),Object.keys(r).filter(function(e){return i[e.toLowerCase()]}).reduce(function(e,t){return e[t]=r[t],e},{}));f.host=(n=t.uri,a=n.port,o=n.protocol,s=n.hostname+":",s+=a||("https:"===o?"443":"80")),c.forEach(t.removeHeader,t);var p,h,l,d,m,g,v,b,y=(l=(p=t).uri,d=p.proxy,h=d,m=["https:"===l.protocol?"https":"http","https:"===h.protocol?"Https":"Http"].join("Over"),k[m]),_=(v=f,{proxy:{host:(b=(g=t).proxy).hostname,port:+b.port,proxyAuth:b.auth,headers:v},headers:g.headers,ca:g.ca,cert:g.cert,key:g.key,passphrase:g.passphrase,pfx:g.pfx,ciphers:g.ciphers,rejectUnauthorized:g.rejectUnauthorized,secureOptions:g.secureOptions,secureProtocol:g.secureProtocol});return t.agent=y(_),!0},n.defaultProxyHeaderWhiteList=i,n.defaultProxyHeaderExclusiveList=x,r.Tunnel=n},{"tunnel-agent":497,url:500}],445:[function(U,H,e){(function(e){"use strict";var w=U("http"),k=U("https"),x=U("url"),t=U("util"),n=U("stream"),f=U("zlib"),c=U("aws-sign2"),u=U("aws4"),i=U("http-signature"),S=U("mime-types"),j=U("caseless"),E=U("forever-agent"),r=U("form-data"),a=U("extend"),A=U("isstream"),I=U("is-typedarray").strict,o=U("./lib/helpers"),s=U("./lib/cookies"),P=U("./lib/getProxyFromURI"),p=U("./lib/querystring").Querystring,h=U("./lib/har").Har,l=U("./lib/auth").Auth,d=U("./lib/oauth").OAuth,m=U("./lib/hawk"),g=U("./lib/multipart").Multipart,v=U("./lib/redirect").Redirect,b=U("./lib/tunnel").Tunnel,y=U("performance-now"),O=U("safe-buffer").Buffer,_=o.safeStringify,T=o.isReadStream,B=o.toBase64,C=o.defer,F=o.copy,R=o.version,z=s.jar(),M={};function D(){return{uri:this.uri,method:this.method,headers:this.headers}}function N(){return{statusCode:this.statusCode,body:this.body,headers:this.headers,request:D.call(this.request)}}function q(e){var t=this;e.har&&(t._har=new h(t),e=t._har.options(e)),n.Stream.call(t);var r=Object.keys(q.prototype),i=function(e,t){var r={};for(var i in t)-1===e.indexOf(i)&&(r[i]=t[i]);return r}(r,e);a(t,i),e=function(e,t){var r={};for(var i in t){var n=!(-1===e.indexOf(i)),a="function"==typeof t[i];n&&a||(r[i]=t[i])}return r}(r,e),t.readable=!0,t.writable=!0,e.method&&(t.explicitMethod=!0),t._qs=new p(t),t._auth=new l(t),t._oauth=new d(t),t._multipart=new g(t),t._redirect=new v(t),t._tunnel=new b(t),t.init(e)}function L(){q.debug&&console.error("REQUEST %s",t.format.apply(t,arguments))}t.inherits(q,n.Stream),q.debug=e.env.NODE_DEBUG&&/\brequest\b/.test(e.env.NODE_DEBUG),q.prototype.debug=L,q.prototype.init=function(e){var i=this;for(var t in e||(e={}),i.headers=i.headers?F(i.headers):{},i.headers)void 0===i.headers[t]&&delete i.headers[t];if(j.httpify(i,i.headers),i.method||(i.method=e.method||"GET"),i.localAddress||(i.localAddress=e.localAddress),i._qs.init(e),L(e),i.pool||!1===i.pool||(i.pool=M),i.dests=i.dests||[],i.__isRequestRequest=!0,!i._callback&&i.callback&&(i._callback=i.callback,i.callback=function(){i._callbackCalled||(i._callbackCalled=!0,i._callback.apply(i,arguments))},i.on("error",i.callback.bind()),i.on("complete",i.callback.bind(i,null))),!i.uri&&i.url&&(i.uri=i.url,delete i.url),i.baseUrl){if("string"!=typeof i.baseUrl)return i.emit("error",new Error("options.baseUrl must be a string"));if("string"!=typeof i.uri)return i.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(0===i.uri.indexOf("//")||-1!==i.uri.indexOf("://"))return i.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var r=i.baseUrl.lastIndexOf("/")===i.baseUrl.length-1,n=0===i.uri.indexOf("/");r&&n?i.uri=i.baseUrl+i.uri.slice(1):r||n?i.uri=i.baseUrl+i.uri:""===i.uri?i.uri=i.baseUrl:i.uri=i.baseUrl+"/"+i.uri,delete i.baseUrl}if(!i.uri)return i.emit("error",new Error("options.uri is a required argument"));if("string"==typeof i.uri&&(i.uri=x.parse(i.uri)),i.uri.href||(i.uri.href=x.format(i.uri)),"unix:"===i.uri.protocol)return i.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if("unix"===i.uri.host&&i.enableUnixSocket(),!1===i.strictSSL&&(i.rejectUnauthorized=!1),i.uri.pathname||(i.uri.pathname="/"),!(i.uri.host||i.uri.hostname&&i.uri.port||i.uri.isUnix)){var a='Invalid URI "'+x.format(i.uri)+'"';return 0===Object.keys(e).length&&(a+=". This can be caused by a crappy redirection."),i.abort(),i.emit("error",new Error(a))}if(i.hasOwnProperty("proxy")||(i.proxy=P(i.uri)),i.tunnel=i._tunnel.isEnabled(),i.proxy&&i._tunnel.setup(e),i._redirect.onRequest(e),i.setHost=!1,!i.hasHeader("host")){var o=i.originalHostHeaderName||"host";i.setHeader(o,i.uri.host),i.uri.port&&("80"===i.uri.port&&"http:"===i.uri.protocol||"443"===i.uri.port&&"https:"===i.uri.protocol)&&i.setHeader(o,i.uri.hostname),i.setHost=!0}if(i.jar(i._jar||e.jar),i.uri.port||("http:"===i.uri.protocol?i.uri.port=80:"https:"===i.uri.protocol&&(i.uri.port=443)),i.proxy&&!i.tunnel?(i.port=i.proxy.port,i.host=i.proxy.hostname):(i.port=i.uri.port,i.host=i.uri.hostname),e.form&&i.form(e.form),e.formData){var s=e.formData,c=i.form(),u=function(e,t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?c.append(e,t.value,t.options):c.append(e,t)};for(var f in s)if(s.hasOwnProperty(f)){var p=s[f];if(p instanceof Array)for(var h=0;h>>32-t}function S(e,t,r,i,n,a,o,s){return x(e+(t^r^i)+a+o|0,s)+n|0}function j(e,t,r,i,n,a,o,s){return x(e+(t&r|~t&i)+a+o|0,s)+n|0}function E(e,t,r,i,n,a,o,s){return x(e+((t|~r)^i)+a+o|0,s)+n|0}function A(e,t,r,i,n,a,o,s){return x(e+(t&i|r&~i)+a+o|0,s)+n|0}function I(e,t,r,i,n,a,o,s){return x(e+(t^(r|~i))+a+o|0,s)+n|0}n(o,a),o.prototype._update=function(){for(var e=g,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,a=0|this._d,o=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,f=0|this._d,p=0|this._e,h=0;h<80;h+=1){var l,d;d=h<16?(l=S(r,i,n,a,o,e[v[h]],w[0],y[h]),I(s,c,u,f,p,e[b[h]],k[0],_[h])):h<32?(l=j(r,i,n,a,o,e[v[h]],w[1],y[h]),A(s,c,u,f,p,e[b[h]],k[1],_[h])):h<48?(l=E(r,i,n,a,o,e[v[h]],w[2],y[h]),E(s,c,u,f,p,e[b[h]],k[2],_[h])):h<64?(l=A(r,i,n,a,o,e[v[h]],w[3],y[h]),j(s,c,u,f,p,e[b[h]],k[3],_[h])):(l=I(r,i,n,a,o,e[v[h]],w[4],y[h]),S(s,c,u,f,p,e[b[h]],k[4],_[h])),r=o,o=a,a=x(n,10),n=i,i=l,s=p,p=f,f=x(u,10),u=c,c=d}var m=this._b+n+f|0;this._b=this._c+a+p|0,this._c=this._d+o+s|0,this._d=this._e+r+c|0,this._e=this._a+i+u|0,this._a=m},o.prototype._digest=function(){this._block[this._blockOffset++]=128,56=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 a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":447}],450:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":451,"./sha1":452,"./sha224":453,"./sha256":454,"./sha384":455,"./sha512":456}],451:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,v=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s=this._w,c=0|this._a,u=0|this._b,f=0|this._c,p=0|this._d,h=0|this._e,l=0;l<16;++l)s[l]=e.readInt32BE(4*l);for(;l<80;++l)s[l]=s[l-3]^s[l-8]^s[l-14]^s[l-16];for(var d=0;d<80;++d){var m=~~(d/20),g=0|((o=c)<<5|o>>>27)+(i=u,n=f,a=p,0===(r=m)?i&n|~i&a:2===r?i&n|i&a|n&a:i^n^a)+h+s[d]+v[m];h=p,p=f,f=(t=u)<<30|t>>>2,u=c,c=g}this._a=c+this._a|0,this._b=u+this._b|0,this._c=f+this._c|0,this._d=p+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],452:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0;d<16;++d)c[d]=e.readInt32BE(4*d);for(;d<80;++d)c[d]=(t=c[d-3]^c[d-8]^c[d-14]^c[d-16])<<1|t>>>31;for(var m=0;m<80;++m){var g=~~(m/20),v=0|((s=u)<<5|s>>>27)+(n=f,a=p,o=h,0===(i=g)?n&a|~n&o:2===i?n&a|n&o|a&o:n^a^o)+l+c[m]+b[g];l=h,h=p,p=(r=f)<<30|r>>>2,f=u,u=v}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],453:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}i(c,n),c.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},c.prototype._hash=function(){var e=o.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},t.exports=c},{"./hash":449,"./sha256":454,inherits:320,"safe-buffer":447}],454:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,w=[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],o=new Array(64);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0|this._f,m=0|this._g,g=0|this._h,v=0;v<16;++v)c[v]=e.readInt32BE(4*v);for(;v<64;++v)c[v]=0|(((r=c[v-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+c[v-7]+(((t=c[v-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+c[v-16];for(var b=0;b<64;++b){var y=g+(((s=l)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((o=m)^l&(d^o))+w[b]+c[b]|0,_=0|(((a=u)>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+((i=u)&(n=f)|p&(i|n));g=m,m=d,d=l,l=h+y|0,h=p,p=f,f=u,u=y+_|0}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],455:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(160);function c(){this.init(),this._w=s,a.call(this,128,112)}i(c,n),c.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},c.prototype._hash=function(){var i=o.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=c},{"./hash":449,"./sha512":456,inherits:320,"safe-buffer":447}],456:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,ee=[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],o=new Array(160);function s(){this.init(),this._w=o,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ae(e,t){return e>>>0>>0?1:0}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c,u=this._w,f=0|this._ah,p=0|this._bh,h=0|this._ch,l=0|this._dh,d=0|this._eh,m=0|this._fh,g=0|this._gh,v=0|this._hh,b=0|this._al,y=0|this._bl,_=0|this._cl,w=0|this._dl,k=0|this._el,x=0|this._fl,S=0|this._gl,j=0|this._hl,E=0;E<32;E+=2)u[E]=e.readInt32BE(4*E),u[E+1]=e.readInt32BE(4*E+4);for(;E<160;E+=2){var A=u[E-30],I=u[E-30+1],P=((s=A)>>>1|(c=I)<<31)^(s>>>8|c<<24)^s>>>7,O=((a=I)>>>1|(o=A)<<31)^(a>>>8|o<<24)^(a>>>7|o<<25);A=u[E-4],I=u[E-4+1];var T=((i=A)>>>19|(n=I)<<13)^(n>>>29|i<<3)^i>>>6,B=((t=I)>>>19|(r=A)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),C=u[E-14],F=u[E-14+1],R=u[E-32],z=u[E-32+1],M=O+F|0,D=P+C+ae(M,O)|0;D=(D=D+T+ae(M=M+B|0,B)|0)+R+ae(M=M+z|0,z)|0,u[E]=D,u[E+1]=M}for(var N=0;N<160;N+=2){D=u[N],M=u[N+1];var q=re(f,p,h),L=re(b,y,_),U=ie(f,b),H=ie(b,f),K=ne(d,k),V=ne(k,d),G=ee[N],$=ee[N+1],W=te(d,m,g),Z=te(k,x,S),Y=j+V|0,X=v+K+ae(Y,j)|0;X=(X=(X=X+W+ae(Y=Y+Z|0,Z)|0)+G+ae(Y=Y+$|0,$)|0)+D+ae(Y=Y+M|0,M)|0;var J=H+L|0,Q=U+q+ae(J,H)|0;v=g,j=S,g=m,S=x,m=d,x=k,d=l+X+ae(k=w+Y|0,w)|0,l=h,w=_,h=p,_=y,p=f,y=b,f=X+Q+ae(b=Y+J|0,Y)|0}this._al=this._al+b|0,this._bl=this._bl+y|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+k|0,this._fl=this._fl+x|0,this._gl=this._gl+S|0,this._hl=this._hl+j|0,this._ah=this._ah+f+ae(this._al,b)|0,this._bh=this._bh+p+ae(this._bl,y)|0,this._ch=this._ch+h+ae(this._cl,_)|0,this._dh=this._dh+l+ae(this._dl,w)|0,this._eh=this._eh+d+ae(this._el,k)|0,this._fh=this._fh+m+ae(this._fl,x)|0,this._gh=this._gh+g+ae(this._gl,S)|0,this._hh=this._hh+v+ae(this._hl,j)|0},s.prototype._hash=function(){var i=a.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],457:[function(e,t,r){var i=e("safer-buffer").Buffer,n={dsa:{parts:["p","q","g","y"],sizePart:"p"},rsa:{parts:["e","n"],sizePart:"n"},ecdsa:{parts:["curve","Q"],sizePart:"Q"},ed25519:{parts:["A"],sizePart:"A"}};n.curve25519=n.ed25519;var a={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};a.curve25519=a.ed25519;var o={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:i.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g,""),"hex"),s:i.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g,""),"hex"),n:i.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g,""),"hex"),G:i.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g,""),"hex"),s:i.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g,""),"hex"),n:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g,""),"hex"),G:i.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:i.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g,""),"hex"),a:i.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g,""),"hex"),s:i.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g,""),"hex"),n:i.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g,""),"hex"),G:i.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g,""),"hex")}};t.exports={info:n,privInfo:a,hashAlgs:{md5:!0,sha1:!0,sha256:!0,sha384:!0,sha512:!0},curves:o}},{"safer-buffer":448}],458:[function(e,t,r){t.exports=_;var d=e("assert-plus"),m=e("safer-buffer").Buffer,i=e("./algs"),n=e("crypto"),a=e("./fingerprint"),o=(e("./signature"),e("./errors")),g=(e("util"),e("./utils")),v=e("./key"),b=e("./private-key"),y=e("./identity"),s={};s.openssh=e("./formats/openssh-cert"),s.x509=e("./formats/x509"),s.pem=e("./formats/x509-pem");var c=o.CertificateParseError,u=o.InvalidAlgorithmError;function _(e){d.object(e,"options"),d.arrayOfObject(e.subjects,"options.subjects"),g.assertCompatible(e.subjects[0],y,[1,0],"options.subjects"),g.assertCompatible(e.subjectKey,v,[1,0],"options.subjectKey"),g.assertCompatible(e.issuer,y,[1,0],"options.issuer"),void 0!==e.issuerKey&&g.assertCompatible(e.issuerKey,v,[1,0],"options.issuerKey"),d.object(e.signatures,"options.signatures"),d.buffer(e.serial,"options.serial"),d.date(e.validFrom,"options.validFrom"),d.date(e.validUntil,"optons.validUntil"),d.optionalArrayOfString(e.purposes,"options.purposes"),this._hashCache={},this.subjects=e.subjects,this.issuer=e.issuer,this.subjectKey=e.subjectKey,this.issuerKey=e.issuerKey,this.signatures=e.signatures,this.serial=e.serial,this.validFrom=e.validFrom,this.validUntil=e.validUntil,this.purposes=e.purposes}_.formats=s,_.prototype.toBuffer=function(e,t){return void 0===e&&(e="x509"),d.string(e,"format"),d.object(s[e],"formats[format]"),d.optionalObject(t,"options"),s[e].write(this,t)},_.prototype.toString=function(e,t){return void 0===e&&(e="pem"),this.toBuffer(e,t).toString()},_.prototype.fingerprint=function(e){void 0===e&&(e="sha256"),d.string(e,"algorithm");var t={type:"certificate",hash:this.hash(e),algorithm:e};return new a(t)},_.prototype.hash=function(e){if(d.string(e,"algorithm"),e=e.toLowerCase(),void 0===i.hashAlgs[e])throw new u(e);if(this._hashCache[e])return this._hashCache[e];var t=n.createHash(e).update(this.toBuffer("x509")).digest();return this._hashCache[e]=t},_.prototype.isExpired=function(e){return void 0===e&&(e=new Date),!(e.getTime()>=this.validFrom.getTime()&&e.getTime()e.length||"BEGIN"!==e.slice(t,t+5).toString("ascii"))}(e))return a.read(e,t);if(function(e){var t=0;for(;to.length&&(p=o.length),u+=c.write(o.slice(f,p),u),c[u++]=10,f=p}return u+=c.write("-----END "+i+"-----\n",u),c.slice(0,u)}};var b=e("assert-plus"),y=e("asn1"),_=e("crypto"),w=e("safer-buffer").Buffer,k=(e("../algs"),e("../utils")),h=e("../key"),l=e("../private-key"),x=e("./pkcs1"),S=e("./pkcs8"),j=e("./ssh-private"),E=e("./rfc4253"),A=e("../errors")},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../utils":480,"./pkcs1":467,"./pkcs8":468,"./rfc4253":469,"./ssh-private":470,asn1:65,"assert-plus":66,crypto:204,"safer-buffer":448}],467:[function(e,t,r){t.exports={read:function(e,t){return i.read(e,t,"pkcs1")},readPkcs1:function(e,t,r){switch(e){case"RSA":if("public"===t)return u=y(c=r,"modulus"),f=y(c,"exponent"),new p({type:"rsa",parts:[{name:"e",data:f},{name:"n",data:u}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t[0],0);var r=y(e,"modulus"),i=y(e,"public exponent"),n=y(e,"private exponent"),a=y(e,"prime1"),o=y(e,"prime2"),s=y(e,"exponent1"),c=y(e,"exponent2"),u=y(e,"iqmp");return new v({type:"rsa",parts:[{name:"n",data:r},{name:"e",data:i},{name:"d",data:n},{name:"iqmp",data:u},{name:"p",data:a},{name:"q",data:o},{name:"dmodp",data:s},{name:"dmodq",data:c}]})}(r);throw new Error("Unknown key type: "+t);case"DSA":if("public"===t)return n=y(i=r,"y"),a=y(i,"p"),o=y(i,"q"),s=y(i,"g"),new p({type:"dsa",parts:[{name:"y",data:n},{name:"p",data:a},{name:"q",data:o},{name:"g",data:s}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),0);var r=y(e,"p"),i=y(e,"q"),n=y(e,"g"),a=y(e,"y"),o=y(e,"x");return new v({type:"dsa",parts:[{name:"p",data:r},{name:"q",data:i},{name:"g",data:n},{name:"y",data:a},{name:"x",data:o}]})}(r);throw new Error("Unknown key type: "+t);case"EC":case"ECDSA":if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),1);var r=e.readString(l.Ber.OctetString,!0);e.readSequence(160);var i=b(e);h.string(i,"a known elliptic curve"),e.readSequence(161);var n=e.readString(l.Ber.BitString,!0);n=g.ecNormalize(n);var a={type:"ecdsa",parts:[{name:"curve",data:d.from(i)},{name:"Q",data:n},{name:"d",data:r}]};return new v(a)}(r);if("public"===t)return function(e){e.readSequence();var t=e.readOID();h.strictEqual(t,"1.2.840.10045.2.1","must be ecPublicKey");for(var r,i=e.readOID(),n=Object.keys(m.curves),a=0;aS.length&&(I=S.length),E+=x.write(S.slice(A,I),E),x[E++]=10,A=I}return E+=x.write("-----END "+k+"-----\n",E),x.slice(0,E)}};var O,T=P("assert-plus"),B=(P("asn1"),P("safer-buffer").Buffer),C=(P("../algs"),P("../utils")),F=P("crypto"),R=(P("../key"),P("../private-key")),r=P("./pem"),A=P("./rfc4253"),z=P("../ssh-buffer"),I=P("../errors");var M="openssh-key-v1"},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../ssh-buffer":479,"../utils":480,"./pem":466,"./rfc4253":469,asn1:65,"assert-plus":66,"bcrypt-pbkdf":76,crypto:204,"safer-buffer":448}],471:[function(e,t,r){t.exports={read:function(e,t){"string"!=typeof e&&(h.buffer(e,"buf"),e=e.toString("ascii"));var r=e.trim().replace(/[\\\r]/g,""),i=r.match(m);i||(i=r.match(g));h.ok(i,"key must match regex");var n,a=d.algToKeyType(i[1]),o=l.from(i[2],"base64"),s={};if(i[4])try{n=d.read(o)}catch(e){i=r.match(g),h.ok(i,"key must match regex"),o=l.from(i[2],"base64"),n=d.readInternal(s,"public",o)}else n=d.readInternal(s,"public",o);if(h.strictEqual(a,n.type),i[4]&&0n.length&&(u=n.length),s+=o.write(n.slice(c,u),s),o[s++]=10,c=u}return s+=o.write("-----END "+i+"-----\n",s),o.slice(0,s)}};var o=e("assert-plus"),p=(e("asn1"),e("safer-buffer").Buffer);e("../algs"),e("../utils"),e("../key"),e("../private-key"),e("./pem"),e("../identity"),e("../signature"),e("../certificate")},{"../algs":457,"../certificate":458,"../identity":474,"../key":476,"../private-key":477,"../signature":478,"../utils":480,"./pem":466,"./x509":473,asn1:65,"assert-plus":66,"safer-buffer":448}],473:[function(e,t,r){t.exports={read:function(e,t){"string"==typeof e&&(e=_.from(e,"binary"));b.buffer(e,"buf");var r=new y.BerReader(e);if(r.readSequence(),1=this._buffer.length},a.prototype.remainder=function(){return this._buffer.slice(this._offset)},a.prototype.skip=function(e){this._offset+=e},a.prototype.expand=function(){this._size*=2;var e=n.alloc(this._size);this._buffer.copy(e,0),this._buffer=e},a.prototype.readPart=function(){return{data:this.readBuffer()}},a.prototype.readBuffer=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4,i.ok(this._offset+e<=this._buffer.length,"length out of bounds at +0x"+this._offset.toString(16)+" (data truncated?)");var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t},a.prototype.readString=function(){return this.readBuffer().toString()},a.prototype.readCString=function(){for(var e=this._offset;ethis._size;)this.expand();this._buffer.writeUInt32BE(e.length,this._offset),this._offset+=4,e.copy(this._buffer,this._offset),this._offset+=e.length},a.prototype.writeString=function(e){this.writeBuffer(n.from(e,"utf8"))},a.prototype.writeCString=function(e){for(;this._offset+1+e.length>this._size;)this.expand();this._buffer.write(e,this._offset),this._offset+=e.length,this._buffer[this._offset++]=0},a.prototype.writeInt=function(e){for(;this._offset+4>this._size;)this.expand();this._buffer.writeUInt32BE(e,this._offset),this._offset+=4},a.prototype.writeInt64=function(e){if(i.buffer(e,"value"),8this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=8},a.prototype.writeChar=function(e){for(;this._offset+1>this._size;)this.expand();this._buffer[this._offset++]=e},a.prototype.writePart=function(e){this.writeBuffer(e.data)},a.prototype.write=function(e){for(;this._offset+e.length>this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=e.length}},{"assert-plus":66,"safer-buffer":448}],480:[function(e,t,r){t.exports={bufferSplit:function(e,t){p.buffer(e),p.string(t);for(var r=[],i=0,n=0,a=0;a=t.length){var o=a+1;r.push(e.slice(i,o-n)),i=o,n=0}i<=e.length&&r.push(e.slice(i,e.length));return r},addRSAMissing:function(e){p.object(e),u(e,s,[1,1]);var t,r=new g(e.part.d.data);if(!e.part.dmodp){var i=new g(e.part.p.data),n=r.mod(i.subtract(1));t=_(n),e.part.dmodp={name:"dmodp",data:t},e.parts.push(e.part.dmodp)}if(!e.part.dmodq){var a=new g(e.part.q.data),o=r.mod(a.subtract(1));t=_(o),e.part.dmodq={name:"dmodq",data:t},e.parts.push(e.part.dmodq)}},calculateDSAPublic:function(e,t,r){return p.buffer(e),p.buffer(t),p.buffer(r),e=new g(e),t=new g(t),r=new g(r),_(e.modPow(r,t))},calculateED25519Public:function(e){p.buffer(e);var t=i.sign.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},calculateX25519Public:function(e){p.buffer(e);var t=i.box.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},mpNormalize:y,mpDenormalize:function(e){p.buffer(e);for(;1c)return!1;if(i.constructor.name!==t.name)return!1;var a=i._sshpkApiVersion;void 0===a&&(a=t._oldVersionDetect(e));return!(a[0]!=r[0]||a[1]t;)p.equal(e[0],0),e=e.slice(1);for(;e.length=r[1],i+" must be compatible with "+t.name+" klass version "+r[0]+"."+r[1])}}var v={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}},b=8;function y(e){for(p.buffer(e);1t._pos){var i=r.substr(t._pos);if("x-user-defined"===t._charset){for(var n=new p(i.length),a=0;at._pos&&(t.push(new p(new Uint8Array(o.result.slice(t._pos)))),t._pos=o.result.byteLength)},o.onload=function(){t.push(null)},o.readAsArrayBuffer(r)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":484,_process:382,buffer:191,inherits:320,"readable-stream":426}],487:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=p,t=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1=2.4.3 <2.5.0",_hasShrinkwrap:!1,_id:"tough-cookie@2.4.3",_inCache:!0,_installable:!0,_location:"/tough-cookie",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/tough-cookie_2.4.3_1529960207843_0.4882910670728131"},_npmUser:{email:"jstash@gmail.com",name:"jstash"},_npmVersion:"6.1.0",_phantomChildren:{},_requested:{name:"tough-cookie",raw:"tough-cookie@~2.4.3",rawSpec:"~2.4.3",scope:null,spec:">=2.4.3 <2.5.0",type:"range"},_requiredBy:["/request","/request-promise"],_resolved:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",_shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",_shrinkwrap:null,_spec:"tough-cookie@~2.4.3",_where:"/home/giacof/Download/javascript-opentimestamps/node_modules/request",author:{email:"jstash@gmail.com",name:"Jeremy Stashewsky"},bugs:{url:"https://github.com/salesforce/tough-cookie/issues"},contributors:[{name:"Alexander Savin"},{name:"Ian Livingstone"},{name:"Ivan Nikulin"},{name:"Lalit Kapoor"},{name:"Sam Thompson"},{name:"Sebastian Mayr"}],dependencies:{psl:"^1.1.24",punycode:"^1.4.1"},description:"RFC6265 Cookies and Cookie Jar for node.js",devDependencies:{async:"^1.4.2",nyc:"^11.6.0","string.prototype.repeat":"^0.2.0",vows:"^0.8.1"},directories:{},dist:{fileCount:9,integrity:"sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMVcQCRA9TVsSAnZWagAAzX0P/2COkbzb3dOX/FTOYIVL\n7oHge7BvGODNkEHTjBtNsR0jO/AA/gVcUOq6CSmFH+UC14LrmCyNDemQvD15\njnYuJXUIiZsSZO7BGGbOFYrQF+DKLiwgf0LokrIM8KasZ5nxc5xS1jYHG5o+\nwCqutfhlRTqlPbZsexB+eRlIuYNvpsbRAdSDYXrhLJNMZgx49g/SZ7IwunGN\nJ/5Fe041MZqqdi7MAavM3T7vX9IvVRJJ3f4xAEVxY1vh4s0dN+h4fG2eMQzL\nOiaulRUIahs4xmJUYHZgZESc9eTIrI8K+YT7i3r35TGc0Du7ueB2KYxBqy7q\n6AUFbdX9Ep308kTVsTf/h4wE0RvdxKLfZ0ww7T1ivADX9xMi2oIvVtyhCQHo\nSIpyBhaav/fTufF0/Fu4Lcr7PMJxyvF0UcNRqrPmEQTw4UZkFKfT8HN2P5cH\nBvJsFwpeEjt84tt5pJ/bmD0j0EUCLUXLGH6fbA84fHpZGifO239zSf262Qdv\nSXeygU7YxnK8wOCnvlauZx/gp+/WTMfMdODxiX0QnqwS5BctiPCgGG1cKJcC\nqvTECaAEmxMVf/gEW73oxVXJgUO7f6jJaWoawV7ka+wR91W9Bp0pKGOOAxAG\nU72rmnwQKid9U7ly5833sb3D+lbzKJXGNIqohegP4daKZfNNTaLWZXmKE+Iy\n7Vml\r\n=8KpS\r\n-----END PGP SIGNATURE-----\r\n",shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",tarball:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",unpackedSize:83959},engines:{node:">=0.8"},files:["lib"],gitHead:"671ad413b38d7464352886772f57a7ec417d4760",homepage:"https://github.com/salesforce/tough-cookie",keywords:["HTTP","RFC2965","RFC6265","cookie","cookiejar","cookies","jar","set-cookie"],license:"BSD-3-Clause",main:"./lib/cookie",maintainers:[{name:"awaterma",email:"awaterma@awaterma.net"},{name:"jstash",email:"jstash@gmail.com"},{name:"maratto",email:"marat+npm@salesforce.com"},{name:"ruoho",email:"clint@ruoho.org"}],name:"tough-cookie",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/salesforce/tough-cookie.git"},scripts:{cover:"nyc --reporter=lcov --reporter=html vows test/*_test.js",test:"vows test/*_test.js"},version:"2.4.3"}},{}],497:[function(s,e,c){(function(u){"use strict";s("net");var f,a=s("tls"),r=s("http"),i=s("https"),e=s("events"),p=s("assert"),t=s("util"),h=s("safe-buffer").Buffer;function o(e){var o=this;o.options=e||{},o.proxyOptions=o.options.proxy||{},o.maxSockets=o.options.maxSockets||r.Agent.defaultMaxSockets,o.requests=[],o.sockets=[],o.on("free",function(e,t,r){for(var i=0,n=o.requests.length;i=this.maxSockets?this.requests.push({host:t.host,port:t.port,request:e}):this.createConnection({host:t.host,port:t.port,request:e})},o.prototype.createConnection=function(e){var n=this;n.createSocket(e,function(t){function r(){n.emit("free",t,e.host,e.port)}function i(e){n.removeSocket(t),t.removeListener("free",r),t.removeListener("close",i),t.removeListener("agentRemove",i)}t.on("free",r),t.on("close",i),t.on("agentRemove",i),e.request.onSocket(t)})},o.prototype.createSocket=function(n,a){var o=this,s={};o.sockets.push(s);var e=l({},o.proxyOptions,{method:"CONNECT",path:n.host+":"+n.port,agent:!1});e.proxyAuth&&(e.headers=e.headers||{},e.headers["Proxy-Authorization"]="Basic "+h.from(e.proxyAuth).toString("base64")),f("making CONNECT request");var c=o.request(e);function i(e,t,r){if(c.removeAllListeners(),t.removeAllListeners(),200===e.statusCode)p.equal(r.length,0),f("tunneling connection has established"),o.sockets[o.sockets.indexOf(s)]=t,a(t);else{f("tunneling socket could not be established, statusCode=%d",e.statusCode);var i=new Error("tunneling socket could not be established, statusCode="+e.statusCode);i.code="ECONNRESET",n.request.emit("error",i),o.removeSocket(s)}}c.useChunkedEncodingByDefault=!1,c.once("response",function(e){e.upgrade=!0}),c.once("upgrade",function(e,t,r){u.nextTick(function(){i(e,t,r)})}),c.once("connect",i),c.once("error",function(e){c.removeAllListeners(),f("tunneling socket could not be established, cause=%s\n",e.message,e.stack);var t=new Error("tunneling socket could not be established, cause="+e.message);t.code="ECONNRESET",n.request.emit("error",t),o.removeSocket(s)}),c.end()},o.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},f=u.env.NODE_DEBUG&&/\btunnel\b/.test(u.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},c.debug=f}).call(this,s("_process"))},{_process:382,assert:67,events:269,http:483,https:317,net:187,"safe-buffer":447,tls:187,util:505}],498:[function(e,t,r){!function(a){"use strict";var m=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function d(e,t,r,i,n){var a,o=0;for(a=0;a>>8)-1}function v(e,t,r,i){return d(e,t,r,i,16)}function b(e,t,r,i){return d(e,t,r,i,32)}function y(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=a,k=o,x=s,S=c,j=u,E=f,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=0;M<20;M+=2)w^=(n=(C^=(n=(P^=(n=(j^=(n=w+C|0)<<7|n>>>25)+w|0)<<9|n>>>23)+j|0)<<13|n>>>19)+P|0)<<18|n>>>14,E^=(n=(k^=(n=(F^=(n=(O^=(n=E+k|0)<<7|n>>>25)+E|0)<<9|n>>>23)+O|0)<<13|n>>>19)+F|0)<<18|n>>>14,T^=(n=(A^=(n=(x^=(n=(R^=(n=T+A|0)<<7|n>>>25)+T|0)<<9|n>>>23)+R|0)<<13|n>>>19)+x|0)<<18|n>>>14,z^=(n=(B^=(n=(I^=(n=(S^=(n=z+B|0)<<7|n>>>25)+z|0)<<9|n>>>23)+S|0)<<13|n>>>19)+I|0)<<18|n>>>14,w^=(n=(S^=(n=(x^=(n=(k^=(n=w+S|0)<<7|n>>>25)+w|0)<<9|n>>>23)+k|0)<<13|n>>>19)+x|0)<<18|n>>>14,E^=(n=(j^=(n=(I^=(n=(A^=(n=E+j|0)<<7|n>>>25)+E|0)<<9|n>>>23)+A|0)<<13|n>>>19)+I|0)<<18|n>>>14,T^=(n=(O^=(n=(P^=(n=(B^=(n=T+O|0)<<7|n>>>25)+T|0)<<9|n>>>23)+B|0)<<13|n>>>19)+P|0)<<18|n>>>14,z^=(n=(R^=(n=(F^=(n=(C^=(n=z+R|0)<<7|n>>>25)+z|0)<<9|n>>>23)+C|0)<<13|n>>>19)+F|0)<<18|n>>>14;w=w+a|0,k=k+o|0,x=x+s|0,S=S+c|0,j=j+u|0,E=E+f|0,A=A+p|0,I=I+h|0,P=P+l|0,O=O+d|0,T=T+m|0,B=B+g|0,C=C+v|0,F=F+b|0,R=R+y|0,z=z+_|0,e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=x>>>0&255,e[9]=x>>>8&255,e[10]=x>>>16&255,e[11]=x>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=j>>>0&255,e[17]=j>>>8&255,e[18]=j>>>16&255,e[19]=j>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=B>>>0&255,e[45]=B>>>8&255,e[46]=B>>>16&255,e[47]=B>>>24&255,e[48]=C>>>0&255,e[49]=C>>>8&255,e[50]=C>>>16&255,e[51]=C>>>24&255,e[52]=F>>>0&255,e[53]=F>>>8&255,e[54]=F>>>16&255,e[55]=F>>>24&255,e[56]=R>>>0&255,e[57]=R>>>8&255,e[58]=R>>>16&255,e[59]=R>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,i)}function _(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=0;w<20;w+=2)a^=(n=(v^=(n=(l^=(n=(u^=(n=a+v|0)<<7|n>>>25)+a|0)<<9|n>>>23)+u|0)<<13|n>>>19)+l|0)<<18|n>>>14,f^=(n=(o^=(n=(b^=(n=(d^=(n=f+o|0)<<7|n>>>25)+f|0)<<9|n>>>23)+d|0)<<13|n>>>19)+b|0)<<18|n>>>14,m^=(n=(p^=(n=(s^=(n=(y^=(n=m+p|0)<<7|n>>>25)+m|0)<<9|n>>>23)+y|0)<<13|n>>>19)+s|0)<<18|n>>>14,_^=(n=(g^=(n=(h^=(n=(c^=(n=_+g|0)<<7|n>>>25)+_|0)<<9|n>>>23)+c|0)<<13|n>>>19)+h|0)<<18|n>>>14,a^=(n=(c^=(n=(s^=(n=(o^=(n=a+c|0)<<7|n>>>25)+a|0)<<9|n>>>23)+o|0)<<13|n>>>19)+s|0)<<18|n>>>14,f^=(n=(u^=(n=(h^=(n=(p^=(n=f+u|0)<<7|n>>>25)+f|0)<<9|n>>>23)+p|0)<<13|n>>>19)+h|0)<<18|n>>>14,m^=(n=(d^=(n=(l^=(n=(g^=(n=m+d|0)<<7|n>>>25)+m|0)<<9|n>>>23)+g|0)<<13|n>>>19)+l|0)<<18|n>>>14,_^=(n=(y^=(n=(b^=(n=(v^=(n=_+y|0)<<7|n>>>25)+_|0)<<9|n>>>23)+v|0)<<13|n>>>19)+b|0)<<18|n>>>14;e[0]=a>>>0&255,e[1]=a>>>8&255,e[2]=a>>>16&255,e[3]=a>>>24&255,e[4]=f>>>0&255,e[5]=f>>>8&255,e[6]=f>>>16&255,e[7]=f>>>24&255,e[8]=m>>>0&255,e[9]=m>>>8&255,e[10]=m>>>16&255,e[11]=m>>>24&255,e[12]=_>>>0&255,e[13]=_>>>8&255,e[14]=_>>>16&255,e[15]=_>>>24&255,e[16]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255}(e,t,r,i)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function k(e,t,r,i,n,a,o){var s,c,u=new Uint8Array(16),f=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=a[c];for(;64<=n;){for(y(f,u,o,w),c=0;c<64;c++)e[t+c]=r[i+c]^f[c];for(s=1,c=8;c<16;c++)s=s+(255&u[c])|0,u[c]=255&s,s>>>=8;n-=64,t+=64,i+=64}if(0>>=8;r-=64,t+=64}if(0>>13|r<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|i<<6),n=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|n<<9),a=255&e[8]|(255&e[9])<<8,this.r[4]=255&(n>>>4|a<<12),this.r[5]=a>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(a>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,r,i,n,a){var o=new E(a);return o.update(r,i,n),o.finish(e,t),0}function I(e,t,r,i,n,a){var o=new Uint8Array(16);return A(o,0,r,i,n,a),v(e,t,o,0)}function P(e,t,r,i,n){var a;if(r<32)return-1;for(j(e,0,t,0,r,i,n),A(e,16,e,32,r-32,e),a=0;a<16;a++)e[a]=0;return 0}function O(e,t,r,i,n){var a,o=new Uint8Array(32);if(r<32)return-1;if(S(o,0,32,i,n),0!==I(t,16,t,32,r-32,o))return-1;for(j(e,0,t,0,r,i,n),a=0;a<32;a++)e[a]=0;return 0}function T(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function C(e,t,r){for(var i,n=~(r-1),a=0;a<16;a++)i=n&(e[a]^t[a]),e[a]^=i,t[a]^=i}function F(e,t){var r,i,n,a=m(),o=m();for(r=0;r<16;r++)o[r]=t[r];for(B(o),B(o),B(o),i=0;i<2;i++){for(a[0]=o[0]-65517,r=1;r<15;r++)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),n=a[15]>>16&1,a[14]&=65535,C(o,a,1-n)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function R(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return F(r,e),F(i,t),b(r,0,i,0)}function z(e){var t=new Uint8Array(32);return F(t,e),1&t[0]}function M(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function D(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function N(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function q(e,t,r){var i,n,a=0,o=0,s=0,c=0,u=0,f=0,p=0,h=0,l=0,d=0,m=0,g=0,v=0,b=0,y=0,_=0,w=0,k=0,x=0,S=0,j=0,E=0,A=0,I=0,P=0,O=0,T=0,B=0,C=0,F=0,R=0,z=r[0],M=r[1],D=r[2],N=r[3],q=r[4],L=r[5],U=r[6],H=r[7],K=r[8],V=r[9],G=r[10],$=r[11],W=r[12],Z=r[13],Y=r[14],X=r[15];a+=(i=t[0])*z,o+=i*M,s+=i*D,c+=i*N,u+=i*q,f+=i*L,p+=i*U,h+=i*H,l+=i*K,d+=i*V,m+=i*G,g+=i*$,v+=i*W,b+=i*Z,y+=i*Y,_+=i*X,o+=(i=t[1])*z,s+=i*M,c+=i*D,u+=i*N,f+=i*q,p+=i*L,h+=i*U,l+=i*H,d+=i*K,m+=i*V,g+=i*G,v+=i*$,b+=i*W,y+=i*Z,_+=i*Y,w+=i*X,s+=(i=t[2])*z,c+=i*M,u+=i*D,f+=i*N,p+=i*q,h+=i*L,l+=i*U,d+=i*H,m+=i*K,g+=i*V,v+=i*G,b+=i*$,y+=i*W,_+=i*Z,w+=i*Y,k+=i*X,c+=(i=t[3])*z,u+=i*M,f+=i*D,p+=i*N,h+=i*q,l+=i*L,d+=i*U,m+=i*H,g+=i*K,v+=i*V,b+=i*G,y+=i*$,_+=i*W,w+=i*Z,k+=i*Y,x+=i*X,u+=(i=t[4])*z,f+=i*M,p+=i*D,h+=i*N,l+=i*q,d+=i*L,m+=i*U,g+=i*H,v+=i*K,b+=i*V,y+=i*G,_+=i*$,w+=i*W,k+=i*Z,x+=i*Y,S+=i*X,f+=(i=t[5])*z,p+=i*M,h+=i*D,l+=i*N,d+=i*q,m+=i*L,g+=i*U,v+=i*H,b+=i*K,y+=i*V,_+=i*G,w+=i*$,k+=i*W,x+=i*Z,S+=i*Y,j+=i*X,p+=(i=t[6])*z,h+=i*M,l+=i*D,d+=i*N,m+=i*q,g+=i*L,v+=i*U,b+=i*H,y+=i*K,_+=i*V,w+=i*G,k+=i*$,x+=i*W,S+=i*Z,j+=i*Y,E+=i*X,h+=(i=t[7])*z,l+=i*M,d+=i*D,m+=i*N,g+=i*q,v+=i*L,b+=i*U,y+=i*H,_+=i*K,w+=i*V,k+=i*G,x+=i*$,S+=i*W,j+=i*Z,E+=i*Y,A+=i*X,l+=(i=t[8])*z,d+=i*M,m+=i*D,g+=i*N,v+=i*q,b+=i*L,y+=i*U,_+=i*H,w+=i*K,k+=i*V,x+=i*G,S+=i*$,j+=i*W,E+=i*Z,A+=i*Y,I+=i*X,d+=(i=t[9])*z,m+=i*M,g+=i*D,v+=i*N,b+=i*q,y+=i*L,_+=i*U,w+=i*H,k+=i*K,x+=i*V,S+=i*G,j+=i*$,E+=i*W,A+=i*Z,I+=i*Y,P+=i*X,m+=(i=t[10])*z,g+=i*M,v+=i*D,b+=i*N,y+=i*q,_+=i*L,w+=i*U,k+=i*H,x+=i*K,S+=i*V,j+=i*G,E+=i*$,A+=i*W,I+=i*Z,P+=i*Y,O+=i*X,g+=(i=t[11])*z,v+=i*M,b+=i*D,y+=i*N,_+=i*q,w+=i*L,k+=i*U,x+=i*H,S+=i*K,j+=i*V,E+=i*G,A+=i*$,I+=i*W,P+=i*Z,O+=i*Y,T+=i*X,v+=(i=t[12])*z,b+=i*M,y+=i*D,_+=i*N,w+=i*q,k+=i*L,x+=i*U,S+=i*H,j+=i*K,E+=i*V,A+=i*G,I+=i*$,P+=i*W,O+=i*Z,T+=i*Y,B+=i*X,b+=(i=t[13])*z,y+=i*M,_+=i*D,w+=i*N,k+=i*q,x+=i*L,S+=i*U,j+=i*H,E+=i*K,A+=i*V,I+=i*G,P+=i*$,O+=i*W,T+=i*Z,B+=i*Y,C+=i*X,y+=(i=t[14])*z,_+=i*M,w+=i*D,k+=i*N,x+=i*q,S+=i*L,j+=i*U,E+=i*H,A+=i*K,I+=i*V,P+=i*G,O+=i*$,T+=i*W,B+=i*Z,C+=i*Y,F+=i*X,_+=(i=t[15])*z,o+=38*(k+=i*D),s+=38*(x+=i*N),c+=38*(S+=i*q),u+=38*(j+=i*L),f+=38*(E+=i*U),p+=38*(A+=i*H),h+=38*(I+=i*K),l+=38*(P+=i*V),d+=38*(O+=i*G),m+=38*(T+=i*$),g+=38*(B+=i*W),v+=38*(C+=i*Z),b+=38*(F+=i*Y),y+=38*(R+=i*X),a=(i=(a+=38*(w+=i*M))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a=(i=(a+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a+=n-1+37*(n-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=h,e[8]=l,e[9]=d,e[10]=m,e[11]=g,e[12]=v,e[13]=b,e[14]=y,e[15]=_}function L(e,t){q(e,t,t)}function U(e,t){var r,i=m();for(r=0;r<16;r++)i[r]=t[r];for(r=253;0<=r;r--)L(i,i),2!==r&&4!==r&&q(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function H(e,t,r){var i,n,a=new Uint8Array(32),o=new Float64Array(80),s=m(),c=m(),u=m(),f=m(),p=m(),h=m();for(n=0;n<31;n++)a[n]=t[n];for(a[31]=127&t[31]|64,a[0]&=248,M(o,r),n=0;n<16;n++)c[n]=o[n],f[n]=s[n]=u[n]=0;for(s[0]=f[0]=1,n=254;0<=n;--n)C(s,c,i=a[n>>>3]>>>(7&n)&1),C(u,f,i),D(p,s,u),N(s,s,u),D(u,c,f),N(c,c,f),L(f,p),L(h,s),q(s,u,s),q(u,c,p),D(p,s,u),N(s,s,u),L(c,s),N(u,f,h),q(s,u,g),D(s,s,f),q(u,u,s),q(s,f,h),q(f,c,o),L(c,p),C(s,c,i),C(u,f,i);for(n=0;n<16;n++)o[n+16]=s[n],o[n+32]=u[n],o[n+48]=c[n],o[n+64]=f[n];var l=o.subarray(32),d=o.subarray(16);return U(l,l),q(d,d,l),F(e,d),0}function K(e,t){return H(e,t,r)}function V(e,t){return o(t,32),K(e,t)}function G(e,t,r){var i=new Uint8Array(32);return H(i,r,t),_(e,n,i,w)}E.prototype.blocks=function(e,t,r){for(var i,n,a,o,s,c,u,f,p,h,l,d,m,g,v,b,y,_,w,k=this.fin?0:2048,x=this.h[0],S=this.h[1],j=this.h[2],E=this.h[3],A=this.h[4],I=this.h[5],P=this.h[6],O=this.h[7],T=this.h[8],B=this.h[9],C=this.r[0],F=this.r[1],R=this.r[2],z=this.r[3],M=this.r[4],D=this.r[5],N=this.r[6],q=this.r[7],L=this.r[8],U=this.r[9];16<=r;)h=p=0,h+=(x+=8191&(i=255&e[t+0]|(255&e[t+1])<<8))*C,h+=(S+=8191&(i>>>13|(n=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*U),h+=(j+=8191&(n>>>10|(a=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*L),h+=(E+=8191&(a>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*q),p=(h+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*N))>>>13,h&=8191,h+=(I+=s>>>1&8191)*(5*D),h+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*M),h+=(O+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),h+=(T+=8191&(u>>>8|(f=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*R),l=p+=(h+=(B+=f>>>5|k)*(5*F))>>>13,l+=x*F,l+=S*C,l+=j*(5*U),l+=E*(5*L),p=(l+=A*(5*q))>>>13,l&=8191,l+=I*(5*N),l+=P*(5*D),l+=O*(5*M),l+=T*(5*z),p+=(l+=B*(5*R))>>>13,l&=8191,d=p,d+=x*R,d+=S*F,d+=j*C,d+=E*(5*U),p=(d+=A*(5*L))>>>13,d&=8191,d+=I*(5*q),d+=P*(5*N),d+=O*(5*D),d+=T*(5*M),m=p+=(d+=B*(5*z))>>>13,m+=x*z,m+=S*R,m+=j*F,m+=E*C,p=(m+=A*(5*U))>>>13,m&=8191,m+=I*(5*L),m+=P*(5*q),m+=O*(5*N),m+=T*(5*D),g=p+=(m+=B*(5*M))>>>13,g+=x*M,g+=S*z,g+=j*R,g+=E*F,p=(g+=A*C)>>>13,g&=8191,g+=I*(5*U),g+=P*(5*L),g+=O*(5*q),g+=T*(5*N),v=p+=(g+=B*(5*D))>>>13,v+=x*D,v+=S*M,v+=j*z,v+=E*R,p=(v+=A*F)>>>13,v&=8191,v+=I*C,v+=P*(5*U),v+=O*(5*L),v+=T*(5*q),b=p+=(v+=B*(5*N))>>>13,b+=x*N,b+=S*D,b+=j*M,b+=E*z,p=(b+=A*R)>>>13,b&=8191,b+=I*F,b+=P*C,b+=O*(5*U),b+=T*(5*L),y=p+=(b+=B*(5*q))>>>13,y+=x*q,y+=S*N,y+=j*D,y+=E*M,p=(y+=A*z)>>>13,y&=8191,y+=I*R,y+=P*F,y+=O*C,y+=T*(5*U),_=p+=(y+=B*(5*L))>>>13,_+=x*L,_+=S*q,_+=j*N,_+=E*D,p=(_+=A*M)>>>13,_&=8191,_+=I*z,_+=P*R,_+=O*F,_+=T*C,w=p+=(_+=B*(5*U))>>>13,w+=x*U,w+=S*L,w+=j*q,w+=E*N,p=(w+=A*D)>>>13,w&=8191,w+=I*M,w+=P*z,w+=O*R,w+=T*F,x=h=8191&(p=(p=((p+=(w+=B*C)>>>13)<<2)+p|0)+(h&=8191)|0),S=l+=p>>>=13,j=d&=8191,E=m&=8191,A=g&=8191,I=v&=8191,P=b&=8191,O=y&=8191,T=_&=8191,B=w&=8191,t+=16,r-=16;this.h[0]=x,this.h[1]=S,this.h[2]=j,this.h[3]=E,this.h[4]=A,this.h[5]=I,this.h[6]=P,this.h[7]=O,this.h[8]=T,this.h[9]=B},E.prototype.finish=function(e,t){var r,i,n,a,o=new Uint16Array(10);if(this.leftover){for(a=this.leftover,this.buffer[a++]=1;a<16;a++)this.buffer[a]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=r,r=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this.h[a]+r,r=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,i=(1^r)-1,a=0;a<10;a++)o[a]&=i;for(i=~i,a=0;a<10;a++)this.h[a]=this.h[a]&i|o[a];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,a=1;a<8;a++)n=(this.h[a]+this.pad[a]|0)+(n>>>16)|0,this.h[a]=65535&n;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var i,n;if(this.leftover){for(r<(n=16-this.leftover)&&(n=r),i=0;i>>16,I=65535&(S=N),P=S>>>16,E+=65535&(j=((g=K)>>>14|(c=z)<<18)^(K>>>18|z<<14)^(z>>>9|K<<23)),A+=j>>>16,I+=65535&(S=(z>>>14|K<<18)^(z>>>18|K<<14)^(K>>>9|z<<23)),P+=S>>>16,E+=65535&(j=K&(v=V)^~K&(b=G)),A+=j>>>16,I+=65535&(S=z&(u=M)^~z&(f=D)),P+=S>>>16,S=Z[2*k],E+=65535&(j=Z[2*k+1]),A+=j>>>16,I+=65535&S,P+=S>>>16,S=O[k%16],A+=(j=T[k%16])>>>16,I+=65535&S,P+=S>>>16,I+=(A+=(E+=65535&j)>>>16)>>>16,E=65535&(j=w=65535&E|A<<16),A=j>>>16,I=65535&(S=_=65535&I|(P+=I>>>16)<<16),P=S>>>16,E+=65535&(j=(q>>>28|B<<4)^(B>>>2|q<<30)^(B>>>7|q<<25)),A+=j>>>16,I+=65535&(S=(B>>>28|q<<4)^(q>>>2|B<<30)^(q>>>7|B<<25)),P+=S>>>16,A+=(j=q&L^q&U^L&U)>>>16,I+=65535&(S=B&C^B&F^C&F),P+=S>>>16,p=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,y=65535&E|A<<16,E=65535&(j=m),A=j>>>16,I=65535&(S=s),P=S>>>16,A+=(j=w)>>>16,I+=65535&(S=_),P+=S>>>16,C=n,F=a,R=o,z=s=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,M=c,D=u,N=f,B=p,L=h,U=l,H=d,K=m=65535&E|A<<16,V=g,G=v,$=b,q=y,k%16==15)for(x=0;x<16;x++)S=O[x],E=65535&(j=T[x]),A=j>>>16,I=65535&S,P=S>>>16,S=O[(x+9)%16],E+=65535&(j=T[(x+9)%16]),A+=j>>>16,I+=65535&S,P+=S>>>16,_=O[(x+1)%16],E+=65535&(j=((w=T[(x+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),A+=j>>>16,I+=65535&(S=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),P+=S>>>16,_=O[(x+14)%16],A+=(j=((w=T[(x+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,I+=65535&(S=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,O[x]=65535&I|P<<16,T[x]=65535&E|A<<16;E=65535&(j=q),A=j>>>16,I=65535&(S=B),P=S>>>16,S=e[0],A+=(j=t[0])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[0]=B=65535&I|P<<16,t[0]=q=65535&E|A<<16,E=65535&(j=L),A=j>>>16,I=65535&(S=C),P=S>>>16,S=e[1],A+=(j=t[1])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[1]=C=65535&I|P<<16,t[1]=L=65535&E|A<<16,E=65535&(j=U),A=j>>>16,I=65535&(S=F),P=S>>>16,S=e[2],A+=(j=t[2])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[2]=F=65535&I|P<<16,t[2]=U=65535&E|A<<16,E=65535&(j=H),A=j>>>16,I=65535&(S=R),P=S>>>16,S=e[3],A+=(j=t[3])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[3]=R=65535&I|P<<16,t[3]=H=65535&E|A<<16,E=65535&(j=K),A=j>>>16,I=65535&(S=z),P=S>>>16,S=e[4],A+=(j=t[4])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[4]=z=65535&I|P<<16,t[4]=K=65535&E|A<<16,E=65535&(j=V),A=j>>>16,I=65535&(S=M),P=S>>>16,S=e[5],A+=(j=t[5])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[5]=M=65535&I|P<<16,t[5]=V=65535&E|A<<16,E=65535&(j=G),A=j>>>16,I=65535&(S=D),P=S>>>16,S=e[6],A+=(j=t[6])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[6]=D=65535&I|P<<16,t[6]=G=65535&E|A<<16,E=65535&(j=$),A=j>>>16,I=65535&(S=N),P=S>>>16,S=e[7],A+=(j=t[7])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[7]=N=65535&I|P<<16,t[7]=$=65535&E|A<<16,W+=128,i-=128}return i}function X(e,t,r){var i,n=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,Y(n,a,t,r),r%=128,i=0;i>(7&n)&1),J(t,e),J(e,e),Q(e,t,i)}function re(e,t){var r=[m(),m(),m(),m()];T(r[0],i),T(r[1],s),T(r[2],f),q(r[3],i,s),te(e,r,t)}function ie(e,t,r){var i,n=new Uint8Array(64),a=[m(),m(),m(),m()];for(r||o(t,32),X(n,t,32),n[0]&=248,n[31]&=127,n[31]|=64,re(a,n),ee(e,a),i=0;i<32;i++)t[i+32]=e[i];return 0}var ne=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var r,i,n,a;for(i=63;32<=i;--i){for(r=0,n=i-32,a=i-12;n>8,t[n]-=256*r;t[n]+=r,t[i]=0}for(n=r=0;n<32;n++)t[n]+=r-(t[31]>>4)*ne[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*ne[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function oe(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function se(e,t,r,i){var n,a,o=new Uint8Array(64),s=new Uint8Array(64),c=new Uint8Array(64),u=new Float64Array(64),f=[m(),m(),m(),m()];X(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var p=r+64;for(n=0;n>7&&N(e[0],u,e[0]),q(e[3],e[0],e[1]),0)}function ue(e,t,r,i){var n,a=new Uint8Array(32),o=new Uint8Array(64),s=[m(),m(),m(),m()],c=[m(),m(),m(),m()];if(-1,r<64)return-1;if(ce(c,i))return-1;for(n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,M=String.fromCharCode;function D(e){throw new RangeError(o[e])}function s(e,t){var r=e.split("@"),i="";return 1>1,e+=z(e/t);455z((C-n)/p))&&D("overflow"),n+=l*p;var d=h<=o?1:o+26<=h?26:h-o;if(lz(C/m)&&D("overflow"),p*=m}var g=r.length+1;o=L(n-f,g,0==f),z(n/g)>C-a&&D("overflow"),a+=z(n/g),n%=g,r.splice(n++,0,a)}return String.fromCodePoint.apply(String,r)},u=function(e){var t=[],r=(e=N(e)).length,i=128,n=0,a=72,o=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(o=(u=f.next()).done);o=!0){var p=u.value;p<128&&t.push(M(p))}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}var h=t.length,l=h;for(h&&t.push("-");lz((C-n)/w)&&D("overflow"),n+=(d-i)*w,i=d;var k=!0,x=!1,S=void 0;try{for(var j,E=e[Symbol.iterator]();!(k=(j=E.next()).done);k=!0){var A=j.value;if(AC&&D("overflow"),A==i){for(var I=n,P=36;;P+=36){var O=P<=a?1:a+26<=P?26:P-a;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function l(e){for(var t="",r=0,i=e.length;rA-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(V,"g"),Y=new RegExp($,"g"),X=new RegExp(F("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',W),"g"),J=new RegExp(F("[^]",V,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),Q=J;function ee(e){var t=l(e);return t.match(Z)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,a={},o=r.query.split("&"),s=0,c=o.length;s",'"',"`"," ","\r","\n","\t"]),M=["'"].concat(n),D=["%","/","?",";","#"].concat(M),N=["/","?","#"],q=/^[+a-z0-9A-Z_-]{0,63}$/,L=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,U={javascript:!0,"javascript:":!0},H={javascript:!0,"javascript:":!0},K={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},V=e("querystring");function a(e,t,r){if(e&&F.isObject(e)&&e instanceof A)return e;var i=new A;return i.parse(e,t,r),i}A.prototype.parse=function(e,t,r){if(!F.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===e?"undefined":_typeof(e)));var i=e.indexOf("?"),n=-1!==i&&i>t&63|128)}function p(e){if(0==(4294967168&e))return s(e);var t="";return 0==(4294965248&e)?t=s(e>>6&31|192):0==(4294901760&e)?(u(e),t=s(e>>12&15|224),t+=f(e,6)):0==(4292870144&e)&&(t=s(e>>18&7|240),t+=f(e,12),t+=f(e,6)),t+=s(63&e|128)}function h(){if(a<=o)throw Error("Invalid byte index");var e=255&n[o];if(o++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,t;if(a>>10&1023|55296),t=56320|1023&t),n+=s(t);return n}(r)}};if("function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define(function(){return d});else if(t&&!t.nodeType)if(r)r.exports=d;else{var m={}.hasOwnProperty;for(var g in d)m.call(d,g)&&(t[g]=d[g])}else e.utf8=d}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],503:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],504:[function(e,t,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],505:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{"./support/isBuffer":504,_process:382,dup:70,inherits:320}],506:[function(e,t,r){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},{}],507:[function(e,t,r){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var n=new Uint8Array(16);t.exports=function(){return i(n),n}}else{var a=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}},{}],508:[function(e,t,r){var o=e("./lib/rng"),s=e("./lib/bytesToUuid");t.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var a=0;a<16;++a)t[i+a]=n[a];return t||s(n)}},{"./lib/bytesToUuid":506,"./lib/rng":507}],509:[function(e,t,r){var s=e("assert-plus"),i=e("util"),n=e("extsprintf"),c=e("core-util-is").isError,a=n.sprintf;function u(e){var t,r,i,n;if(s.object(e,"args"),s.bool(e.strict,"args.strict"),s.array(e.argv,"args.argv"),0===(t=e.argv).length)r={},i=[];else if(c(t[0]))r={cause:t[0]},i=t.slice(1);else if("object"===_typeof(t[0])){for(n in r={},t[0])r[n]=t[0][n];i=t.slice(1)}else s.string(t[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},i=t;return s.object(r),r.strict||e.strict||(i=i.map(function(e){return null===e?"null":void 0===e?"undefined":e})),{options:r,shortmessage:0===i.length?"":a.apply(null,i)}}function f(){var e,t,r,i,n,a,o;if(e=Array.prototype.slice.call(arguments,0),!(this instanceof f))return t=Object.create(f.prototype),f.apply(t,arguments),t;if((r=u({argv:e,strict:!1})).options.name&&(s.string(r.options.name,'error\'s "name" must be a string'),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,a=r.shortmessage,(i=r.options.cause)&&(s.ok(c(i),"cause is not an Error"),this.jse_cause=i,r.options.skipCauseMessage||(a+=": "+i.message)),this.jse_info={},r.options.info)for(o in r.options.info)this.jse_info[o]=r.options.info[o];return this.message=a,Error.call(this,a),Error.captureStackTrace&&(n=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,n)),this}function o(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof o?(i=(r=u({argv:e,strict:!0})).options,f.call(this,i,"%s",r.shortmessage),this):(t=Object.create(o.prototype),o.apply(t,arguments),t)}function p(e){s.array(e,"list of errors"),s.ok(0this._inputTypes.length&&!n.isObject(e[e.length-1]))return a.inputDefaultBlockNumberFormatter(e.pop())},s.prototype.toPayload=function(e){var t={};return e.length>this._inputTypes.length&&n.isObject(e[e.length-1])&&(t=e[e.length-1]),t.to=this._address,t.data="0x"+this.signature()+i.encodeParams(this._inputTypes,e),t},s.prototype.signature=function(){return o(this._name).slice(0,8)},s.prototype.unpackOutput=function(e){if(e){e=2<=e.length?e.slice(2):e;var t=i.decodeParams(this._outputTypes,e);return 1===t.length?t[0]:t}},s.prototype.call=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),i=this.extractCallback(e),t=this.extractDefaultBlock(e),r=this.toPayload(e);if(!i){var n=this._eth.call(r,t);return this.unpackOutput(n)}var a=this;this._eth.call(r,t,function(t,e){if(t)return i(t,null);var r=null;try{r=a.unpackOutput(e)}catch(e){t=e}i(t,r)})},s.prototype.sendTransaction=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),t=this.extractCallback(e),r=this.toPayload(e);if(0=this.buffer.length)){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,t}}},{key:"read",value:function(e){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,Array.from(t)}},{key:"readBool",value:function(){var e=this.read(1)[0];if(255===e)return!0;if(0===e)return!1;throw new n("read_bool() expected 0xff or 0x00; got +"+e)}},{key:"readVaruint",value:function(){for(var e=0,t=0,r=void 0;e|=(127&(r=this.read(1)[0]))< "+e);if(r>=7}}},{key:"writeByte",value:function(e){if(this.length>=this.buffer.length){var t=2*this.length,r=new Uint8Array(t);r.set(this.buffer,0),this.buffer=r}isNaN(e)?this.buffer[this.length]=e.codePointAt():this.buffer[this.length]=e,this.length++}},{key:"writeBytes",value:function(e){var t=this;e.forEach(function(e){t.writeByte(e)})}},{key:"writeVarbytes",value:function(e){this.writeVaruint(e.length),this.writeBytes(e)}},{key:"toString",value:function(){return this.buffer.toHex(0)}}]),e}();m.exports={StreamDeserialization:h,StreamSerialization:l,DeserializationError:n,BadMagicError:a,UnsupportedMajorVersion:o,TruncationError:s,TrailingGarbageError:c,RecursionLimitError:u,SerializerTypeError:f,SerializerValueError:p,ValueError:e,TypeError:t}}).call(this,d("buffer").Buffer)},{"./extend-error.js":570,"./utils.js":577,buffer:191}],568:[function(e,t,r){"use strict";var s=e("./ops.js"),c=e("./timestamp.js"),i=e("./utils.js"),u=e("./context.js"),f=[0,79,112,101,110,84,105,109,101,115,116,97,109,112,115,0,0,80,114,111,111,102,0,191,137,226,232,132,232,146,148],n=function(){function o(e,t){if(_classCallCheck2(this,o),!(e instanceof s.Op&&t instanceof c))throw new u.ValueError("Invalid Timestamp or fileHashOp");if(t.msg.length!==e._DIGEST_LENGTH())throw new u.ValueError("Timestamp message length and fileHashOp digest length differ");this.fileHashOp=e,this.timestamp=t}return _createClass(o,[{key:"fileDigest",value:function(){return this.timestamp.msg}},{key:"serialize",value:function(e){e.writeBytes(f),e.writeVaruint(1),this.fileHashOp.serialize(e),e.writeBytes(this.timestamp.msg),this.timestamp.serialize(e)}},{key:"serializeToBytes",value:function(){var e=new u.StreamSerialization;return this.serialize(e),e.getOutput()}},{key:"toString",value:function(){var e="DetachedTimestampFile\n";return e+="fileHashOp: "+this.fileHashOp.toString()+"\n",e+="timestamp: "+this.timestamp.toString()+"\n"}},{key:"toJson",value:function(){var e={};e.hash=i.bytesToHex(this.fileDigest()),e.op=this.fileHashOp._HASHLIB_NAME(),e.timestamp=this.timestamp.toJson()}},{key:"equals",value:function(e){return e instanceof o&&(!!e.fileHashOp.equals(this.fileHashOp)&&!!e.timestamp.equals(this.timestamp))}}],[{key:"deserialize",value:function(e){var t=void 0;if(e instanceof u.StreamDeserialization)t=e;else if(e instanceof Array)t=new u.StreamDeserialization(e);else if(e instanceof Uint8Array)t=new u.StreamDeserialization(Array.from(e));else{if(!(e instanceof ArrayBuffer))throw new Error("StreamDeserialization deserialize: Invalid param");t=new u.StreamDeserialization(Array.from(e))}t.assertMagic(f);var r=t.readVaruint();if(1!==r)throw new u.UnsupportedMajorVersion("Version "+r+" detached timestamp files are not supported");var i=s.CryptOp.deserialize(t),n=t.readBytes(i._DIGEST_LENGTH()),a=c.deserialize(t,n);return t.assertEof(),new o(i,a)}},{key:"fromBytes",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOp param");var r=void 0;if(t instanceof u.StreamDeserialization)r=e.hashFd(t);else if(t instanceof Array){var i=new u.StreamDeserialization(t);r=e.hashFd(i)}else if(t instanceof Uint8Array){var n=new u.StreamDeserialization(Array.from(t));r=e.hashFd(n)}else{if(!(t instanceof ArrayBuffer))throw new Error("DetachedTimestampFile: Invalid buffer param");var a=new u.StreamDeserialization(Array.from(t));r=e.hashFd(a)}return new o(e,new c(r))}},{key:"fromHash",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOpss param");if(t instanceof Array)return new o(e,new c(t));if(t instanceof ArrayBuffer||t instanceof Uint8Array)return new o(e,new c(Array.from(t)));throw new Error("DetachedTimestampFile: Invalid fdHash param")}}]),o}();t.exports=n},{"./context.js":567,"./ops.js":575,"./timestamp.js":576,"./utils.js":577}],569:[function(e,t,r){"use strict";var a=e("promise"),o=e("./utils.js"),s=e("./insight.js"),c=e("./blockstream.js"),u={bitcoin:[{url:"https://blockstream.info/api",type:"blockstream"},{url:"https://insight.bitpay.com/api",type:"insight"},{url:"https://blockexplorer.com/api",type:"insight"},{url:"https://bitcore.schmoock.net/insight-api",type:"insight"}],bitcoinTestnet:[{url:"https://blockstream.info/testnet/api",type:"blockstream"},{url:"https://test-insight.bitpay.com/api",type:"insight"}],litecoin:[{url:"https://ltc-bitcore1.trezor.io/api",type:"insight"},{url:"https://insight.litecore.io/api",type:"insight"}]},i=function(){function n(e){var r=this;_classCallCheck2(this,n),this.explorers=[];var t=e&&Object.prototype.hasOwnProperty.call(e,"chain")?e.chain:"bitcoin",i=e&&Object.prototype.hasOwnProperty.call(e,"timeout")?e.timeout:10;(e&&Object.prototype.hasOwnProperty.call(e,"explorers")&&1(new i)._MAX_URI_LENGTH())return console.error("URI exceeds maximum length"),!1;for(var t=0;ta.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=a.privateCalendars.length;else if(a.privateCalendars=[],a.calendars&&0!==a.calendars.length||(a.calendars=c.DEFAULT_AGGREGATORS),a.m&&0!==a.m){if(a.m<0||a.m>a.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=1,2<=a.calendars.length&&(a.m=2);o.createTimestamp(i,a.calendars,a.m,a.privateCalendars).then(function(e){if(void 0===e)return r(new Error("Error on timestamp creation"));t()}).catch(function(e){r(e)})})},createTimestamp:function(i,e,t,r){var n=[];return e&&e.forEach(function(e){var t=new c.RemoteCalendar(e);n.push(t.submit(i.msg)),console.log("Submitting to remote calendar "+e)}),r&&r.forEach(function(e,t){var r=new c.RemoteCalendar(t);r.setKey(e),n.push(r.submit(i.msg)),console.log("Submitting to remote calendar "+t)}),new Promise(function(t,r){Promise.all(n.map(u.softFail)).then(function(e){return e.filter(function(e){return!(e instanceof Error)&&void 0!==e}).forEach(function(e){i.merge(e)}),t(i)}).catch(function(e){r(e)})})},makeMerkleTree:function(e){var i=[];return e.forEach(function(e){if(e instanceof s)try{var t=u.randBytes(16),r=e.timestamp.add(new n.OpAppend(u.arrayToBytes(t))).add(new n.OpSHA256);i.push(r)}catch(e){return}else console.error("Invalid input")}),f.makeMerkleTree(i)},verify:function(e,t,i){if(!u.arrEq(e.fileDigest(),t.fileDigest()))return console.error("Expected digest "+u.bytesToHex(e.fileDigest())),console.error("File does not match original!"),new Promise(function(e,t){t(new Error("File does not match original!"))});var n=this;return new Promise(function(t,r){n.upgradeTimestamp(e.timestamp,i).then(function(){n.verifyTimestamp(e.timestamp,i).then(function(e){return t(e)}).catch(function(e){return r(e)})})})},verifyTimestamp:function(e,r){var i=[],n=this;function c(e,t){return e.attestedTimet.attestedTime?1:0}return e.allAttestations().forEach(function(e,t){i.push(n.verifyAttestation(e,t,r))}),new Promise(function(o,s){Promise.all(i.map(u.softFail)).then(function(e){var t=e.filter(function(e){return e.constructor===h.VerificationError?e:void 0});if(0this._MAX_MSG_LENGTH())){var t=this.call(e);return t.length>this._MAX_RESULT_LENGTH()&&console.error("Error : Result too long;"),t}console.error("Error : Message too long;")}}],[{key:"deserialize",value:function(e){return this.tag=e.readBytes(1)[0],t.deserializeFromTag(e,this.tag)}},{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return n.get(t).deserializeFromTag(e,t);console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),t=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t.arg=void 0===e?[]:e,t}return _inherits(r,c),_createClass(r,[{key:"serialize",value:function(e){_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"serialize",this).call(this,e),e.writeVarbytes(this.arg)}},{key:"toString",value:function(){return this._TAG_NAME()+" "+i.bytesToHex(this.arg)}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t)){var r=e.readVarbytes((new c)._MAX_RESULT_LENGTH(),1);return new(n.get(t))(r)}}}]),r}(),e=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 240}},{key:"_TAG_NAME",value:function(){return"append"}},{key:"call",value:function(e){return e.concat(this.arg)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),r=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 241}},{key:"_TAG_NAME",value:function(){return"prepend"}},{key:"call",value:function(e){return this.arg.concat(e)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),u=function(e){function t(){return _classCallCheck2(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,c),_createClass(t,[{key:"toString",value:function(){return this._TAG_NAME()}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return new(n.get(t));console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),f=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 242}},{key:"_TAG_NAME",value:function(){return"reverse"}},{key:"call",value:function(e){return 0===e.length&&console.error("Can't reverse an empty message"),e.reverse()}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),p=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 243}},{key:"_TAG_NAME",value:function(){return"hexlify"}},{key:"_MAX_MSG_LENGTH",value:function(){return u._MAX_RESULT_LENGTH()}},{key:"call",value:function(e){0===e.length&&console.error("Can't hexlify an empty message")}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),h=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_HASHLIB_NAME",value:function(){return 0}},{key:"call",value:function(e,t){for(var r=("keccak256"===e._HASHLIB_NAME()?s(e._HASHLIB_NAME()).update(a.from(t)):o.createHash(e._HASHLIB_NAME()).update(a.from(t))).digest(),i=[r.length],n=0;n(new m.Op)._MAX_MSG_LENGTH())throw new TypeError("Message exceeds Op length limit; "+e.length+" > "+(new m.Op)._MAX_MSG_LENGTH());this.msg=e,this.attestations=[],this.ops=new Map}return _createClass(h,[{key:"getDigest",value:function(){return this.msg}},{key:"serialize",value:function(r){var i=this;if(!this.attestations&&!this.ops)throw new a.ValueError("An empty timestamp can't be serialized");var e=this.attestations;if(e.sort(function(e,t){return e.compareTo(t)}),1 "+t.toString()+u(o,n,i)+"\n",f+=e.strTree(a+1,o)});else if(0>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},r.charsToHex=function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&i).toString(16))}return t.join("")},r.charToByte=function(e){return e.charCodeAt(0)},r.charsToBytes=function(e){for(var t=[],r=0;r Date: Fri, 18 Jan 2019 14:27:43 +0100 Subject: [PATCH 11/16] fixed javascript-opentimestamps lib dependancy --- .gitignore | 2 +- opentimestamps.js | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 0858631..1d13986 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ bower_components .idea -/.project +.project diff --git a/opentimestamps.js b/opentimestamps.js index 525105b..856d127 100644 --- a/opentimestamps.js +++ b/opentimestamps.js @@ -1,6 +1,2 @@ // javascript-opentimestamps v.0.4.4-dev -<<<<<<< HEAD -var _get=function e(t,r,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,r);if(void 0===n){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,i)}if("value"in n)return n.value;var o=n.get;return void 0!==o?o.call(i):void 0},_createClass=function(){function i(e,t){for(var r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,f=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,p=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,l=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",i.copy(m[e])}function g(e){var t=e.match(o);if(!t)return!1;var r,i=+t[1],n=+t[2],a=+t[3];return 1<=n&&n<=12&&1<=a&&a<=(2!=n||((r=i)%4!=0||r%100==0&&r%400!=0)?s[n]:29)}function v(e,t){var r=e.match(c);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return(i<=23&&n<=59&&a<=59||23==i&&59==n&&60==a)&&(!t||o)}(t.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d},m.full={date:g,time:v,"date-time":function(e){var t=e.split(b);return 2==t.length&&g(t[0])&&v(t[1],!0)},uri:function(e){return y.test(e)&&a.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&n.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d};var b=/t|\s/i;var y=/\/|:/;var _=/[^\\]\\Z/;function w(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":12}],7:[function(e,t,r){"use strict";var I=e("./resolve"),P=e("./util"),O=e("./error_classes"),T=e("fast-json-stable-stringify"),B=e("../dotjs/validate"),C=P.ucs2length,F=e("fast-deep-equal"),R=O.Validation;function z(e,t,r){var i=n.call(this,e,t,r);return 0<=i?{index:i,compiling:!0}:{index:i=this._compilations.length,compiling:!(this._compilations[i]={schema:e,root:t,baseId:r})}}function M(e,t,r){var i=n.call(this,e,t,r);0<=i&&this._compilations.splice(i,1)}function n(e,t,r){for(var i=0;i",b=l?">":"<",y=void 0;if(g){var _=e.util.getData(m.$data,o,e.dataPathArr),w="exclusive"+a,k="exclType"+a,x="exclIsNumber"+a,S="' + "+(A="op"+a)+" + '";n+=" var schemaExcl"+a+" = "+_+"; ",n+=" var "+w+"; var "+k+" = typeof "+(_="schemaExcl"+a)+"; if ("+k+" != 'boolean' && "+k+" != 'undefined' && "+k+" != 'number') { ";var j;y=d;(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var E=n;n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+k+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+_+" "+v+"= "+i+") ? "+p+" "+b+"= "+_+" : "+p+" "+b+" "+i+" ) : ( ("+w+" = "+_+" === true) ? "+p+" "+b+"= "+i+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { var op"+a+" = "+w+" ? '"+v+"' : '"+v+"='; ",void 0===s&&(y=d,u=e.errSchemaPath+"/"+d,i=_,h=g)}else{S=v;if((x="number"==typeof m)&&h){var A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ( "+i+" === undefined || "+m+" "+v+"= "+i+" ? "+p+" "+b+"= "+m+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { "}else{x&&void 0===s?(w=!0,y=d,u=e.errSchemaPath+"/"+d,i=m,b+="="):(x&&(i=Math[l?"min":"max"](m,s)),m===(!x||i)?(w=!0,y=d,u=e.errSchemaPath+"/"+d,b+="="):(w=!1,S+="="));A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+" "+b+" "+i+" || "+p+" !== "+p+") { "}}y=y||t,(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+A+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+S+" ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";E=n;return n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s;var l="maxLength"==t?">":"<";n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+p+".length ":n+=" ucs2length("+p+") ",n+=" "+l+" "+i+") { ";var d=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+p+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.schema[t],a=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var f="valid"+c.level,p=c.baseId,h=!0,l=n;if(l)for(var d,m=-1,g=l.length-1;m "+E+") { ";var I=f+"["+E+"]";l.schema=j,l.schemaPath=s+"["+E+"]",l.errSchemaPath=c+"/"+E,l.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),l.dataPathArr[v]=E;var P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",i+=" } ",u&&(i+=" if ("+m+") { ",d+="}")}if("object"==(void 0===_?"undefined":_typeof(_))&&e.util.schemaHasRules(_,e.RULES.all)){l.schema=_,l.schemaPath=e.schemaPath+".additionalItems",l.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+f+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" } } ",u&&(i+=" if ("+m+") { ",d+="}")}}else if(e.util.schemaHasRules(o,e.RULES.all)){l.schema=o,l.schemaPath=s,l.errSchemaPath=c,i+=" for (var "+g+" = 0; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+d+" if ("+h+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],30:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="var division"+a+";if (",h&&(n+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),n+=" (division"+a+" = "+p+" / "+i+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var l=l||[];l.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var d=n;return n=l.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+d+"]); ":n+=" validate.errors = ["+d+"]; return false; ":n+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="errs__"+n,h=e.util.copy(e);h.level++;var l="valid"+h.level;if(e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+p+" = errors; ";var d,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(d=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,d&&(h.opts.allErrors=d),e.compositeRule=h.compositeRule=m,i+=" if ("+l+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var v=i;i=g.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ");return i}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="valid"+n,h="errs__"+n,l=e.util.copy(e),d="";l.level++;var m="valid"+l.level,g=l.baseId,v="prevValid"+n,b="passingSchemas"+n;i+="var "+h+" = errors , "+v+" = false , "+p+" = false , "+b+" = null; ";var y=e.compositeRule;e.compositeRule=l.compositeRule=!0;var _=o;if(_)for(var w,k=-1,x=_.length-1;k=e.opts.loopRequired,k=e.opts.ownProperties;if(u)if(i+=" var missing"+n+"; ",w){h||(i+=" var "+l+" = validate.schema"+s+"; ");var x="' + "+(P="schema"+n+"["+(E="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(_,P,e.opts.jsonPointers)),i+=" var "+p+" = true; ",h&&(i+=" if (schema"+n+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+n+")) "+p+" = false; else {"),i+=" for (var "+E+" = 0; "+E+" < "+l+".length; "+E+"++) { "+p+" = "+f+"["+l+"["+E+"]] !== undefined ",k&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", "+l+"["+E+"]) "),i+="; if (!"+p+") break; } ",h&&(i+=" } "),i+=" if (!"+p+") { ",(I=I||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+x+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var S=i;i=I.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var j=d;if(j)for(var E=-1,A=j.length-1;E 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(0<=d.indexOf("object")||0<=d.indexOf("array")))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var g="checkDataType"+(m?"s":"");n+=" if ("+e.util[g](d,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",l&&(n+=" } "),n+=" if (!"+h+") { ";var v=v||[];v.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var b=n;n=v.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { ")}else f&&(n+=" if (true) { ");return n}},{}],39:[function(e,t,r){"use strict";t.exports=function(i,e,t){var r="",n=!0===i.schema.$async,a=i.util.schemaHasRulesExcept(i.schema,i.RULES.all,"$ref"),o=i.self._getId(i.schema);if(i.isTop&&(r+=" var validate = ",n&&(i.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(i.opts.sourceCode||i.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof i.schema||!a&&!i.schema.$ref){e="false schema";var s=i.level,c=i.dataLevel,u=i.schema[e],f=i.schemaPath+i.util.getProperty(e),p=i.errSchemaPath+"/"+e,h=!i.opts.allErrors,l="data"+(c||""),d="valid"+s;if(!1===i.schema){i.isTop?h=!0:r+=" var "+d+" = false; ",(W=W||[]).push(r),r="",!1!==i.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(p)+" , params: {} ",!1!==i.opts.messages&&(r+=" , message: 'boolean schema is false' "),i.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+i.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var m=r;r=W.pop(),!i.compositeRule&&h?i.async?r+=" throw new ValidationError(["+m+"]); ":r+=" validate.errors = ["+m+"]; return false; ":r+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else i.isTop?r+=n?" return data; ":" validate.errors = null; return true; ":r+=" var "+d+" = true; ";return i.isTop&&(r+=" }; return validate; "),r}if(i.isTop){var g=i.isTop;s=i.level=0,c=i.dataLevel=0,l="data";i.rootId=i.resolve.fullPath(i.self._getId(i.root.schema)),i.baseId=i.baseId||i.rootId,delete i.isTop,i.dataPathArr=[void 0],r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{s=i.level,l="data"+((c=i.dataLevel)||"");if(o&&(i.baseId=i.resolve.url(i.baseId,o)),n&&!i.async)throw new Error("async schema in sync schema");r+=" var errs_"+s+" = errors;"}d="valid"+s,h=!i.opts.allErrors;var v="",b="",y=i.schema.type,_=Array.isArray(y);if(_&&1==y.length&&(y=y[0],_=!1),i.schema.$ref&&a){if("fail"==i.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+i.errSchemaPath+'" (see option extendRefs)');!0!==i.opts.extendRefs&&(a=!1,i.logger.warn('$ref: keywords ignored in schema at path "'+i.errSchemaPath+'"'))}if(i.schema.$comment&&i.opts.$comment&&(r+=" "+i.RULES.all.$comment.code(i,"$comment")),y){if(i.opts.coerceTypes)var w=i.util.coerceToTypes(i.opts.coerceTypes,y);var k=i.RULES.types[y];if(w||_||!0===k||k&&!Z(k)){f=i.schemaPath+".type",p=i.errSchemaPath+"/type",f=i.schemaPath+".type",p=i.errSchemaPath+"/type";var x=_?"checkDataTypes":"checkDataType";if(r+=" if ("+i.util[x](y,l,!0)+") { ",w){var S="dataType"+s,j="coerced"+s;r+=" var "+S+" = typeof "+l+"; ","array"==i.opts.coerceTypes&&(r+=" if ("+S+" == 'object' && Array.isArray("+l+")) "+S+" = 'array'; "),r+=" var "+j+" = undefined; ";var E="",A=w;if(A)for(var I,P=-1,O=A.length-1;P>6],n=0==(32&r);if(31==(31&r)){var a=r;for(r=0;128==(128&a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function p(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)o++;(n=new u(2+o))[0]=a,n[1]=128|o;s=1+o;for(var c=i.length;0>=8)n[s]=255&c;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new u(2*e.length),i=0;i>=7)n++}var o=new u(n),s=o.length-1;for(i=e.length-1;0<=i;i--){a=e[i];for(o[s--]=127&a;0<(a>>=7);)o[s--]=128|127&a}return this._createEncoderBuffer(o)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[c(i.getFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(i.getFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.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&&!u.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new u(r)}if(u.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new u(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var a=e;256<=a;a>>=8)i++;for(a=(n=new Array(i)).length-1;0<=a;a--)n[a]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new u(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var a=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),a.length!==n.defaultBuffer.length)return!1;for(i=0;i=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0===(t&=127))throw c("Indefinite length not supported");if(4this._size-i)return null;if(this._offset=i,0===this.length)return t?a.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?n:n.toString("utf8")},i.prototype.readOID=function(e){e||(e=s.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],i=0,n=0;n>0),r.join(".")},i.prototype._readTag=function(e){o.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw c("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(4this._size-r)return null;this._offset=r;for(var i=this._buf[this._offset],n=0,a=0;a>0},t.exports=i},{"./errors":60,"./types":63,assert:67,"safer-buffer":448}],63:[function(e,t,r){t.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},{}],64:[function(e,t,r){var n=e("assert"),a=e("safer-buffer").Buffer,o=e("./types"),i=e("./errors").newInvalidAsn1Error,s={size:1024,growthFactor:8};function c(e){var r,i;r=s,i=e||{},n.ok(r),n.equal(void 0===r?"undefined":_typeof(r),"object"),n.ok(i),n.equal(void 0===i?"undefined":_typeof(i),"object"),Object.getOwnPropertyNames(r).forEach(function(e){if(!i[e]){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,t)}}),e=i,this._buf=a.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw i(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},c.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=o.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&1 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;0>>24,e<<=8},c.prototype.writeNull=function(){this.writeByte(o.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=o.Enumeration),this.writeInt(e,t)},c.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=o.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},c.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+(void 0===e?"undefined":_typeof(e))+")");"number"!=typeof t&&(t=o.OctetString);var r=a.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},c.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!a.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},c.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(e){t.writeString(e)})},c.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=o.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),i=[];i.push(40*parseInt(r[0],10)+parseInt(r[1],10)),r.slice(2).forEach(function(e){var t,r;t=i,(r=parseInt(e,10))<128?t.push(r):(r<16384?t.push(r>>>7|128):(r<2097152?t.push(r>>>14|128):(r<268435456?t.push(r>>>21|128):(t.push(255&(r>>>28|128)),t.push(255&(r>>>21|128))),t.push(255&(r>>>14|128))),t.push(255&(r>>>7|128))),t.push(127&r))});var n=this;this._ensure(2+i.length),this.writeByte(t),this.writeLength(i.length),i.forEach(function(e){n.writeByte(e)})},c.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw i("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},c.prototype.startSequence=function(e){"number"!=typeof e&&(e=o.Sequence|o.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw i("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},c.prototype._shift=function(e,t,r){n.ok(void 0!==e),n.ok(void 0!==t),n.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},c.prototype._ensure=function(e){if(n.ok(e),this._size-this._offset>16&255,a[o++]=t>>8&255,a[o++]=255&t;var u,f;2===n&&(t=p[e.charCodeAt(c)]<<2|p[e.charCodeAt(c+1)]>>4,a[o++]=255&t);1===n&&(t=p[e.charCodeAt(c)]<<10|p[e.charCodeAt(c+1)]<<4|p[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],a=0,o=r-i;a>2]+s[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],p=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,a=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return a.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},{}],76:[function(e,t,r){"use strict";var y=e("tweetnacl").lowlevel.crypto_hash,s=0,c=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};function n(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}function u(e,t){var r,i=0;for(r=0;r<4;r++,s++)t<=s&&(s=0),i=i<<8|e[s];return i}c.prototype.encipher=function(e,t){void 0===t&&(t=new Uint8Array(e.buffer),0!==e.byteOffset&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=n(this.S,t,0)^this.P[r],e[0]^=n(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i},c.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);0!==e.byteOffset&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;0>>24,r[4*i+2]=a[i]>>>16,r[4*i+1]=a[i]>>>8,r[4*i+0]=a[i]}t.exports={BLOCKS:f,HASHSIZE:32,hash:_,pbkdf:function(e,t,r,i,n,a,o){var s,c,u,f,p,h,l=new Uint8Array(64),d=new Uint8Array(64),m=new Uint8Array(32),g=new Uint8Array(32),v=new Uint8Array(i+4),b=a;if(o<1)return-1;if(0===t||0===i||0===a||a>m.byteLength*m.byteLength||1<<20>>24,v[i+1]=h>>>16,v[i+2]=h>>>8,v[i+3]=h,y(d,v,i+4),_(l,d,g),s=m.byteLength;s--;)m[s]=g[s];for(s=1;sa[o]^r?1:-1;return c==u?0:u=t&&e<=r}function J(e){return"[object Array]"==Object.prototype.toString.call(e)}function Q(e,t,r){for(var i,n,a=[0],o=0,s=e.length;or-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}function ee(e,t){return(1(r=e.length)){for(i="0",t-=r;--t;i+="0");e+=i}else tt;)u[n]=0,n||(++a,u.unshift(1));for(o=u.length;!u[--o];);for(p=0,e="";p<=o;e+=U.charAt(u[p++]));e=te(e,a)}return e}function P(e,t,r,i){var n,a,o,s,c;if(r=null!=r&&k(r,0,8,i,q)?0|r:b,!e.c)return e.toString();if(n=e.c[0],o=e.e,null==t)c=Z(e.c),c=19==i||24==i&&o<=h?ee(c,o):te(c,o);else if(a=(e=C(new I(e),t,r)).e,s=(c=Z(e.c)).length,19==i||24==i&&(t<=a||a<=h)){for(;sy?e.c=e.e=null:e.c=r=p.length){if(!i)break e;for(;p.length<=u;p.push(0));c=f=0,o=(a%=K)-K+(n=1)}else{for(c=s=p[u],n=1;10<=s;s/=10,n++);f=(o=(a%=K)-K+n)<0?0:c/h[n-o-1]%10|0}if(i=i||t<0||null!=p[u+1]||(o<0?c:c%h[n-o-1]),i=r<4?(f||i)&&(0==r||r==(e.s<0?3:2)):5y?e.c=e.e=null:e.er)return null!=(e=n[r++])};return o(t="DECIMAL_PLACES")&&k(e,0,$,2,t)&&(d=0|e),i[t]=d,o(t="ROUNDING_MODE")&&k(e,0,8,2,t)&&(b=0|e),i[t]=b,o(t="EXPONENTIAL_AT")&&(J(e)?k(e[0],-$,0,2,t)&&k(e[1],0,$,2,t)&&(h=0|e[0],l=0|e[1]):k(e,-$,$,2,t)&&(h=-(l=0|(e<0?-e:e)))),i[t]=[h,l],o(t="RANGE")&&(J(e)?k(e[0],-$,-1,2,t)&&k(e[1],1,$,2,t)&&(m=0|e[0],y=0|e[1]):k(e,-$,$,2,t)&&(0|e?m=-(y=0|(e<0?-e:e)):w&&B(2,t+" cannot be zero",e))),i[t]=[m,y],o(t="ERRORS")&&(e===!!e||1===e||0===e?(_=0,k=(w=!!e)?O:X):w&&B(2,t+N,e)),i[t]=w,o(t="CRYPTO")&&(e===!!e||1===e||0===e?(x=!(!e||!F||"object"!=(void 0===F?"undefined":_typeof(F))),e&&!x&&w&&B(2,"crypto unavailable",F)):w&&B(2,t+N,e)),i[t]=x,o(t="MODULO_MODE")&&k(e,0,9,2,t)&&(S=0|e),i[t]=S,o(t="POW_PRECISION")&&k(e,0,$,2,t)&&(j=0|e),i[t]=j,o(t="FORMAT")&&("object"==(void 0===e?"undefined":_typeof(e))?E=e:w&&B(2,t+" not an object",e)),i[t]=E,i},I.max=function(){return n(arguments,i.lt)},I.min=function(){return n(arguments,i.gt)},I.random=(r=9007199254740992,u=Math.random()*r&2097151?function(){return D(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,n,a,o=0,s=[],c=new I(v);if(e=null!=e&&k(e,0,$,14)?0|e:d,n=M(e/K),x)if(F&&F.getRandomValues){for(t=F.getRandomValues(new Uint32Array(n*=2));o>>11))?(r=F.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(s.push(a%1e14),o+=2);o=n/2}else if(F&&F.randomBytes){for(t=F.randomBytes(n*=7);ot[n]?1:-1;break}return a}function A(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r](x[s]||0)&&o--,k<0)l.push(1),c=!0;else{for(b=x.length,_=S.length,k+=2,1<(u=D(n/(S[s=0]+1)))&&(S=j(S,u,n),x=j(x,u,n),_=S.length,b=x.length),v=_,m=(d=x.slice(0,_)).length;m<_;d[m++]=0);(w=S.slice()).unshift(0),y=S[0],S[1]>=n/2&&y++;do{if(u=0,(a=E(S,d,_,m))<0){if(g=d[0],_!=m&&(g=g*n+(d[1]||0)),1<(u=D(g/y)))for(n<=u&&(u=n-1),p=(f=j(S,u,n)).length,m=d.length;1==E(f,d,p,m);)u--,A(f,_this.c.length-2},i.isNaN=function(){return!this.s},i.isNegative=i.isNeg=function(){return this.s<0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.lessThan=i.lt=function(e,t){return _=8,Y(this,new I(e,t))<0},i.lessThanOrEqualTo=i.lte=function(e,t){return _=9,-1===(t=Y(this,new I(e,t)))||0===t},i.minus=i.sub=function(e,t){var r,i,n,a,o=this,s=o.s;if(_=10,t=(e=new I(e,t)).s,!s||!t)return new I(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/K,u=e.e/K,f=o.c,p=e.c;if(!c||!u){if(!f||!p)return f?(e.s=-t,e):new I(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new I(f[0]?o:3==b?-0:0)}if(c=W(c),u=W(u),f=f.slice(),s=c-u){for((n=(a=s<0)?(s=-s,f):(u=c,p)).reverse(),t=s;t--;n.push(0));n.reverse()}else for(i=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;tt&&(t=this.e+1),t},i.round=function(e,t){var r=new I(this);return(null==e||k(e,0,$,15))&&C(r,~~e+this.e+1,null!=t&&k(t,0,8,15,q)?0|t:b),r},i.shift=function(e){var t=this;return k(e,-a,a,16,"argument")?t.times("1e"+re(e)):new I(t.c&&t.c[0]&&(e<-a||at&&(r.c.length=t)}if(!(i=D(i/2)))break;n=n.times(n),t&&n.c&&n.c.length>t&&(n.c.length=t)}return e<0&&(r=v.div(r)),t?C(r,j,b):r},i.toPrecision=function(e,t){return P(this,null!=e&&k(e,1,$,24,"precision")?0|e:null,t,24)},i.toString=function(e){var t,r=this.s,i=this.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=Z(this.c),t=null!=e&&k(e,2,64,25,"base")?A(te(t,i),0|e,10,r):i<=h||l<=i?ee(t,i):te(t,i),r<0&&this.c[0]&&(t="-"+t)),t},i.truncated=i.trunc=function(){return C(new I(this),this.e+1,1)},i.valueOf=i.toJSON=function(){return this.toString()},null!=t&&I.config(t),I}(),"function"==typeof define&&define.amd)define(function(){return t});else if(void 0!==i&&i.exports){if(i.exports=t,!F)try{F=r("crypto")}catch(e){}}else e.BigNumber=t}(this)},{crypto:204}],78:[function(i,n,e){(function(e,t){"use strict";var r=n.exports;r.version="v"+i("./package.json").version,r.versionGuard=function(e){if(void 0!==e){throw new Error("More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.")}},r.versionGuard(e._bitcore),e._bitcore=r.version,r.crypto={},r.crypto.BN=i("./lib/crypto/bn"),r.crypto.ECDSA=i("./lib/crypto/ecdsa"),r.crypto.Hash=i("./lib/crypto/hash"),r.crypto.Random=i("./lib/crypto/random"),r.crypto.Point=i("./lib/crypto/point"),r.crypto.Signature=i("./lib/crypto/signature"),r.encoding={},r.encoding.Base58=i("./lib/encoding/base58"),r.encoding.Base58Check=i("./lib/encoding/base58check"),r.encoding.BufferReader=i("./lib/encoding/bufferreader"),r.encoding.BufferWriter=i("./lib/encoding/bufferwriter"),r.encoding.Varint=i("./lib/encoding/varint"),r.util={},r.util.buffer=i("./lib/util/buffer"),r.util.js=i("./lib/util/js"),r.util.preconditions=i("./lib/util/preconditions"),r.errors=i("./lib/errors"),r.Address=i("./lib/address"),r.Block=i("./lib/block"),r.MerkleBlock=i("./lib/block/merkleblock"),r.BlockHeader=i("./lib/block/blockheader"),r.HDPrivateKey=i("./lib/hdprivatekey.js"),r.HDPublicKey=i("./lib/hdpublickey.js"),r.Networks=i("./lib/networks"),r.Opcode=i("./lib/opcode"),r.PrivateKey=i("./lib/privatekey"),r.PublicKey=i("./lib/publickey"),r.Script=i("./lib/script"),r.Transaction=i("./lib/transaction"),r.URI=i("./lib/uri"),r.Unit=i("./lib/unit"),r.deps={},r.deps.bnjs=i("bn.js"),r.deps.bs58=i("bs58"),r.deps.Buffer=t,r.deps.elliptic=i("elliptic"),r.deps._=i("lodash"),r._HDKeyCache=i("./lib/hdkeycache"),r.Transaction.sighash=i("./lib/transaction/sighash")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i("buffer").Buffer)},{"./lib/address":79,"./lib/block":82,"./lib/block/blockheader":81,"./lib/block/merkleblock":83,"./lib/crypto/bn":84,"./lib/crypto/ecdsa":85,"./lib/crypto/hash":86,"./lib/crypto/point":87,"./lib/crypto/random":88,"./lib/crypto/signature":89,"./lib/encoding/base58":90,"./lib/encoding/base58check":91,"./lib/encoding/bufferreader":92,"./lib/encoding/bufferwriter":93,"./lib/encoding/varint":94,"./lib/errors":95,"./lib/hdkeycache":97,"./lib/hdprivatekey.js":98,"./lib/hdpublickey.js":99,"./lib/networks":100,"./lib/opcode":101,"./lib/privatekey":102,"./lib/publickey":103,"./lib/script":104,"./lib/transaction":107,"./lib/transaction/sighash":115,"./lib/unit":119,"./lib/uri":120,"./lib/util/buffer":121,"./lib/util/js":122,"./lib/util/preconditions":123,"./package.json":150,"bn.js":124,bs58:125,buffer:191,elliptic:127,lodash:149}],79:[function(e,t,r){(function(a){"use strict";var n=e("lodash"),o=e("./util/preconditions"),i=e("./errors"),s=e("./encoding/base58check"),c=e("./networks"),r=e("./crypto/hash"),u=e("./util/js"),f=e("./publickey");function p(e,t,r){if(!(this instanceof p))return new p(e,t,r);if(n.isArray(e)&&n.isNumber(t))return p.createMultisig(e,t,r);if(e instanceof p)return e;if(o.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!c.get(t))throw new TypeError('Second argument must be "livenet" or "testnet".');if(r&&r!==p.PayToPublicKeyHash&&r!==p.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||c.get(t)||c.defaultNetwork,i.type=i.type||r||p.PayToPublicKeyHash,u.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}p.prototype._classifyArguments=function(e,t,r){if((e instanceof a||e instanceof Uint8Array)&&20===e.length)return p._transformHash(e);if((e instanceof a||e instanceof Uint8Array)&&21===e.length)return p._transformBuffer(e,t,r);if(e instanceof f)return p._transformPublicKey(e);if(e instanceof h)return p._transformScript(e,t);if("string"==typeof e)return p._transformString(e,t,r);if(n.isObject(e))return p._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")},p.PayToPublicKeyHash="pubkeyhash",p.PayToScriptHash="scripthash",p._transformHash=function(e){var t={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==e.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t},p._transformObject=function(e){return o.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),o.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?new a(e.hash,"hex"):e.hashBuffer,network:c.get(e.network)||c.defaultNetwork,type:e.type}},p._classifyFromVersion=function(e){var t={},r=c.get(e[0],"pubkeyhash"),i=c.get(e[0],"scripthash");return r?(t.network=r,t.type=p.PayToPublicKeyHash):i&&(t.network=i,t.type=p.PayToScriptHash),t},p._transformBuffer=function(e,t,r){var i={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==e.length)throw new TypeError("Address buffers must be exactly 21 bytes.");t=c.get(t);var n=p._classifyFromVersion(e);if(!n.network||t&&t!==n.network)throw new TypeError("Address has mismatched network type.");if(!n.type||r&&r!==n.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=n.network,i.type=n.type,i},p._transformPublicKey=function(e){var t={};if(!(e instanceof f))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=r.sha256ripemd160(e.toBuffer()),t.type=p.PayToPublicKeyHash,t},p._transformScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new i.Script.CantDeriveAddress(e);return r},p.createMultisig=function(e,t,r){return r=r||e[0].network||c.defaultNetwork,p.payingTo(h.buildMultisigOut(e,t),r)},p._transformString=function(e,t,r){if("string"!=typeof e)throw new TypeError("data parameter supplied is not a string.");e=e.trim();var i=s.decode(e);return p._transformBuffer(i,t,r)},p.fromPublicKey=function(e,t){var r=p._transformPublicKey(e);return t=t||c.defaultNetwork,new p(r.hashBuffer,t,r.type)},p.fromPublicKeyHash=function(e,t){return new p(p._transformHash(e).hashBuffer,t,p.PayToPublicKeyHash)},p.fromScriptHash=function(e,t){return o.checkArgument(e,"hash parameter is required"),new p(p._transformHash(e).hashBuffer,t,p.PayToScriptHash)},p.payingTo=function(e,t){return o.checkArgument(e,"script is required"),o.checkArgument(e instanceof h,"script must be instance of Script"),p.fromScriptHash(r.sha256ripemd160(e.toBuffer()),t)},p.fromScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=p._transformScript(e,t);return new p(r.hashBuffer,t,r.type)},p.fromBuffer=function(e,t,r){var i=p._transformBuffer(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromString=function(e,t,r){var i=p._transformString(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromObject=function(e){return o.checkState(u.isHexa(e.hash),'Unexpected hash property, "'+e.hash+'", expected to be hex.'),new p(new a(e.hash,"hex"),e.network,e.type)},p.getValidationError=function(e,t,r){var i;try{new p(e,t,r)}catch(e){i=e}return i},p.isValid=function(e,t,r){return!p.getValidationError(e,t,r)},p.prototype.isPayToPublicKeyHash=function(){return this.type===p.PayToPublicKeyHash},p.prototype.isPayToScriptHash=function(){return this.type===p.PayToScriptHash},p.prototype.toBuffer=function(){var e=new a([this.network[this.type]]);return a.concat([e,this.hashBuffer])},p.prototype.toObject=p.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},p.prototype.toString=function(){return s.encode(this.toBuffer())},p.prototype.inspect=function(){return""},t.exports=p;var h=e("./script")}).call(this,e("buffer").Buffer)},{"./crypto/hash":86,"./encoding/base58check":91,"./errors":95,"./networks":100,"./publickey":103,"./script":104,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],80:[function(t,l,e){(function(o){"use strict";var r=t("lodash"),n=t("./blockheader"),i=t("../crypto/bn"),a=t("../util/buffer"),s=t("../encoding/bufferreader"),c=t("../encoding/bufferwriter"),u=t("../crypto/hash"),f=t("../transaction"),p=t("../util/preconditions");function h(e){return this instanceof h?(r.extend(this,h._from(e)),this):new h(e)}h.MAX_BLOCK_SIZE=1e6,h._from=function(e){var t={};if(a.isBuffer(e))t=h._fromBufferReader(s(e));else{if(!r.isObject(e))throw new TypeError("Unrecognized argument for Block");t=h._fromObject(e)}return t},h._fromObject=function(e){var t=[];return e.transactions.forEach(function(e){e instanceof f?t.push(e):t.push(f().fromObject(e))}),{header:n.fromObject(e.header),transactions:t}},h.fromObject=function(e){return new h(h._fromObject(e))},h._fromBufferReader=function(e){var t={};p.checkState(!e.finished(),"No block data received"),t.header=n.fromBufferReader(e);var r=e.readVarintNum();t.transactions=[];for(var i=0;i"},h.Values={START_OF_BLOCK:8,NULL_HASH:new o("0000000000000000000000000000000000000000000000000000000000000000","hex")},l.exports=h}).call(this,t("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../transaction":107,"../util/buffer":121,"../util/preconditions":123,"./blockheader":81,buffer:191,lodash:149}],81:[function(f,p,e){(function(i){"use strict";var n=f("lodash"),a=f("../crypto/bn"),o=f("../util/buffer"),s=f("../encoding/bufferreader"),t=f("../encoding/bufferwriter"),r=f("../crypto/hash"),c=(f("../util/js"),f("../util/preconditions")),u=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&c.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};u._from=function(e){var t={};if(o.isBuffer(e))t=u._fromBufferReader(s(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for BlockHeader");t=u._fromObject(e)}return t},u._fromObject=function(e){c.checkArgument(e,"data is required");var t=e.prevHash,r=e.merkleRoot;return n.isString(e.prevHash)&&(t=o.reverse(new i(e.prevHash,"hex"))),n.isString(e.merkleRoot)&&(r=o.reverse(new i(e.merkleRoot,"hex"))),{hash:e.hash,version:e.version,prevHash:t,merkleRoot:r,time:e.time,timestamp:e.time,bits:e.bits,nonce:e.nonce}},u.fromObject=function(e){var t=u._fromObject(e);return new u(t)},u.fromRawBlock=function(e){o.isBuffer(e)||(e=new i(e,"binary"));var t=s(e);t.pos=u.Constants.START_OF_HEADER;var r=u._fromBufferReader(t);return new u(r)},u.fromBuffer=function(e){var t=u._fromBufferReader(s(e));return new u(t)},u.fromString=function(e){var t=new i(e,"hex");return u.fromBuffer(t)},u._fromBufferReader=function(e){var t={};return t.version=e.readUInt32LE(),t.prevHash=e.read(32),t.merkleRoot=e.read(32),t.time=e.readUInt32LE(),t.bits=e.readUInt32LE(),t.nonce=e.readUInt32LE(),t},u.fromBufferReader=function(e){var t=u._fromBufferReader(e);return new u(t)},u.prototype.toObject=u.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:o.reverse(this.prevHash).toString("hex"),merkleRoot:o.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},u.prototype.toBuffer=function(){return this.toBufferWriter().concat()},u.prototype.toString=function(){return this.toBuffer().toString("hex")},u.prototype.toBufferWriter=function(e){return e||(e=new t),e.writeUInt32LE(this.version),e.write(this.prevHash),e.write(this.merkleRoot),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e},u.prototype.getTargetDifficulty=function(e){e=e||this.bits;for(var t=new a(16777215&e),r=8*((e>>>24)-3);0e+u.Constants.MAX_TIME_OFFSET)},u.prototype.validProofOfWork=function(){var e=new a(this.id,"hex"),t=this.getTargetDifficulty();return!(0"},u.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new a("10000000000000000000000000000000000000000000000000000000000000000","hex")},p.exports=u}).call(this,f("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],82:[function(e,t,r){t.exports=e("./block"),t.exports.BlockHeader=e("./blockheader"),t.exports.MerkleBlock=e("./merkleblock")},{"./block":80,"./blockheader":81,"./merkleblock":83}],83:[function(e,t,r){(function(s){"use strict";var n=e("lodash"),a=e("./blockheader"),o=e("../util/buffer"),r=e("../encoding/bufferreader"),i=e("../encoding/bufferwriter"),c=e("../crypto/hash"),u=(e("../util/js"),e("../transaction")),f=e("../util/preconditions");function p(e){if(!(this instanceof p))return new p(e);var t={};if(o.isBuffer(e))t=p._fromBufferReader(r(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for MerkleBlock");t={header:e.header instanceof a?e.header:a.fromObject(e.header),numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}return n.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}p.fromBuffer=function(e){return p.fromBufferReader(r(e))},p.fromBufferReader=function(e){return new p(p._fromBufferReader(e))},p.prototype.toBuffer=function(){return this.toBufferWriter().concat()},p.prototype.toBufferWriter=function(e){e||(e=new i),e.write(this.header.toBuffer()),e.writeUInt32LE(this.numTransactions),e.writeVarintNum(this.hashes.length);for(var t=0;tthis.numTransactions)return!1;if(8*this.flags.length8*this.flags.length)return null;var i=this.flags[r.flagBitsUsed>>3]>>>(7&r.flagBitsUsed++)&1;if(0!==e&&i){var n=this._traverseMerkleTree(e-1,2*t,r),a=n;return 2*t+1=this.hashes.length)return null;var o=this.hashes[r.hashesUsed++];return 0===e&&i&&r.txs.push(o),new s(o,"hex")},p.prototype._calcTreeWidth=function(e){return this.numTransactions+(1<>e},p.prototype._calcTreeHeight=function(){for(var e=0;1e.size?t=n.trim(t,i):i>1,o=d.getN(),s=d.getG(),c=a?r.add(o):r,u=d.fromX(n,c);if(!u.mul(o).isInfinity())throw new Error("nR is not a valid curve point");var f=t.neg().mod(o),p=r.invm(o),h=u.mul(i).add(s.mul(f)).mul(p);return m.fromPoint(h,this.sig.compressed)},h.prototype.sigError=function(){if(!f.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s;if(!(e.gt(l.Zero)&&e.lt(d.getN())&&t.gt(l.Zero)&&t.lt(d.getN())))return"r and s not in range";var r=l.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),i=d.getN(),n=t.invm(i),a=n.mul(r).mod(i),o=n.mul(e).mod(i),s=d.getG().mulAdd(a,this.pubkey.point,o);return s.isInfinity()?"p is infinity":0!==s.getX().mod(i).cmp(e)&&"Invalid signature"},h.toLowS=function(e){return e.gt(l.fromBuffer(new c("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=d.getN().sub(e)),e},h.prototype._findSignature=function(e,t){for(var r,i,n,a=d.getN(),o=d.getG(),s=0;(!this.k||0i)r=e(r);else if(r>>=8)}return r},e.exports=r}).call(this,i("_process"),i("buffer").Buffer)},{_process:382,buffer:191,crypto:204}],89:[function(e,r,t){(function(u){"use strict";var g=e("./bn"),v=e("lodash"),b=e("../util/preconditions"),y=e("../util/buffer"),t=e("../util/js"),o=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof g)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};o.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=void 0!==e.i?e.i:this.i,this.compressed=void 0!==e.compressed?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this},o.fromCompact=function(e){b.checkArgument(y.isBuffer(e),"Argument is expected to be a Buffer");var t=new o,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i+=4);var n=e.slice(1,33),a=e.slice(33,65);return b.checkArgument(0===i||1===i||2===i||3===i,new Error("i must be 0, 1, 2, or 3")),b.checkArgument(32===n.length,new Error("r must be 32 bytes")),b.checkArgument(32===a.length,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=g.fromBuffer(n),t.s=g.fromBuffer(a),t},o.fromDER=o.fromBuffer=function(e,t){var r=o.parseDER(e,t),i=new o;return i.r=r.r,i.s=r.s,i},o.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=new o.fromDER(r,!1);return i.nhashtype=t,i},o.fromString=function(e){var t=new u(e,"hex");return o.fromDER(t)},o.parseDER=function(e,t){b.checkArgument(y.isBuffer(e),new Error("DER formatted signature should be a buffer")),v.isUndefined(t)&&(t=!0);var r=e[0];b.checkArgument(48===r,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;b.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(2!==e[2])return!1;if(0===t)return!1;if(128&i[0])return!1;if(1=this.buf.length},e.prototype.read=function(e){r.checkArgument(!n.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t},e.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e},e.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e},e.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=o.fromBuffer(e);return this.pos=this.pos+8,t},e.prototype.readUInt64LEBN=function(){var e,t=this.buf.readUInt32LE(this.pos),r=4294967296*this.buf.readUInt32LE(this.pos+4)+t;if(r<=9007199254740991)e=new o(r);else{var i=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);e=new o(i,10,"le")}return this.pos=this.pos+8,e},e.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN().toNumber();if(t<=Math.pow(2,53))return t;throw new Error("number too large to retain precision - use readVarintBN");default:return e}},e.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return r.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t},e.prototype.readVarintBuf=function(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},e.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new o(this.readUInt16LE());case 254:return new o(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new o(e)}},e.prototype.reverse=function(){for(var e=new i(this.buf.length),t=0;t"},k.prototype.toObject=k.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:_.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},k.fromBuffer=function(e){return new k(e.toString())},k.prototype.toBuffer=function(){return _.copy(this._buffers.xprivkey)},k.DefaultDepth=0,k.DefaultFingerprint=0,k.DefaultChildIndex=0,k.MaxIndex=2*(k.Hardened=2147483648),k.RootElementAlias=["m","M","m'","M'"],k.VersionSize=4,k.DepthSize=1,k.ParentFingerPrintSize=4,k.ChildIndexSize=4,k.ChainCodeSize=32,k.PrivateKeySize=32,k.CheckSumSize=4,k.DataLength=78,k.SerializedByteSize=82,n((k.ChecksumEnd=(k.ChecksumStart=k.PrivateKeyEnd=(k.PrivateKeyStart=(k.ChainCodeEnd=(k.ChainCodeStart=k.ChildIndexEnd=(k.ChildIndexStart=k.ParentFingerPrintEnd=(k.ParentFingerPrintStart=k.DepthEnd=(k.DepthStart=k.VersionEnd=(k.VersionStart=0)+k.VersionSize)+k.DepthSize)+k.ParentFingerPrintSize)+k.ChildIndexSize)+k.ChainCodeSize)+1)+k.PrivateKeySize)+k.CheckSumSize)===k.SerializedByteSize),e.exports=k}).call(this,o("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./crypto/random":88,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdpublickey":99,"./networks":100,"./privatekey":102,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],99:[function(i,s,e){(function(u){"use strict";var n=i("lodash"),t=i("./util/preconditions"),f=i("./crypto/bn"),a=i("./encoding/base58"),p=i("./encoding/base58check"),h=i("./crypto/hash"),r=i("./hdprivatekey"),l=i("./hdkeycache"),d=i("./networks"),m=i("./crypto/point"),g=i("./publickey"),e=i("./errors"),v=e,b=e.HDPublicKey,o=i("assert"),y=i("./util/js"),_=i("./util/buffer");function w(e){if(e instanceof w)return e;if(!(this instanceof w))return new w(e);if(e){if(n.isString(e)||_.isBuffer(e)){var t=w.getSerializedError(e);if(t){if(_.isBuffer(e)&&!w.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof b.ArgumentIsPrivateExtended)return new r(e).hdPublicKey;throw t}return this._buildFromSerialized(e)}if(n.isObject(e))return e instanceof r?this._buildFromPrivate(e):this._buildFromObject(e);throw new b.UnrecognizedArgument(e)}throw new b.MustSupplyArgument}w.isValidPath=function(e){if(n.isString(e)){var t=r._getDerivationIndexes(e);return null!==t&&n.all(t,w.isValidPath)}return!!n.isNumber(e)&&(0<=e&&e"},w.prototype.toObject=w.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version)).name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:_.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},w.fromBuffer=function(e){return new w(e)},w.prototype.toBuffer=function(){return _.copy(this._buffers.xpubkey)},w.Hardened=2147483648,w.RootElementAlias=["m","M"],w.VersionSize=4,w.DepthSize=1,w.ParentFingerPrintSize=4,w.ChildIndexSize=4,w.ChainCodeSize=32,w.PublicKeySize=33,w.CheckSumSize=4,w.DataSize=78,w.SerializedByteSize=82,w.ChecksumEnd=(w.ChecksumStart=w.PublicKeyEnd=(w.PublicKeyStart=w.ChainCodeEnd=(w.ChainCodeStart=w.ChildIndexEnd=(w.ChildIndexStart=w.ParentFingerPrintEnd=(w.ParentFingerPrintStart=w.DepthEnd=(w.DepthStart=w.VersionEnd=(w.VersionStart=0)+w.VersionSize)+w.DepthSize)+w.ParentFingerPrintSize)+w.ChildIndexSize)+w.ChainCodeSize)+w.PublicKeySize)+w.CheckSumSize,o(w.PublicKeyEnd===w.DataSize),o(w.ChecksumEnd===w.SerializedByteSize),s.exports=w}).call(this,i("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdprivatekey":98,"./networks":100,"./publickey":103,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],100:[function(e,t,r){"use strict";var n=e("lodash"),i=e("./util/buffer"),a=e("./util/js"),o=[],s={};function c(){}function u(t,e){if(~o.indexOf(t))return t;if(!e)return s[t];n.isArray(e)||(e=[e]);var r=function(e){return o[i][e]===t};for(var i in o)if(n.any(e,r))return o[i]}function f(e){var t=new c;return a.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey}),e.networkMagic&&a.defineImmutable(t,{networkMagic:i.integerAsBuffer(e.networkMagic)}),e.port&&a.defineImmutable(t,{port:e.port}),e.dnsSeeds&&a.defineImmutable(t,{dnsSeeds:e.dnsSeeds}),n.each(t,function(e){n.isUndefined(e)||n.isObject(e)||(s[e]=t)}),o.push(t),t}c.prototype.toString=function(){return this.name},f({name:"livenet",alias:"mainnet",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var p=u("livenet");f({name:"testnet",alias:"regtest",pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956});var h=u("testnet"),l={PORT:18333,NETWORK_MAGIC:i.integerAsBuffer(185665799),DNS_SEEDS:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]};for(var d in l)n.isObject(l[d])||(s[l[d]]=h);var m={PORT:18444,NETWORK_MAGIC:i.integerAsBuffer(4206867930),DNS_SEEDS:[]};for(var d in m)n.isObject(m[d])||(s[m[d]]=h);Object.defineProperty(h,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.PORT:l.PORT}}),Object.defineProperty(h,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.NETWORK_MAGIC:l.NETWORK_MAGIC}}),Object.defineProperty(h,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.DNS_SEEDS:l.DNS_SEEDS}}),t.exports={add:f,remove:function(e){for(var t=0;t=a.map.OP_1&&e<=a.map.OP_16},a.prototype.inspect=function(){return""},c.exports=a}).call(this,s("buffer").Buffer)},{"./util/buffer":121,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],102:[function(h,l,e){(function(i){"use strict";var n=h("lodash"),r=h("./address"),a=h("./encoding/base58check"),o=h("./crypto/bn"),s=h("./util/js"),c=h("./networks"),u=h("./crypto/point"),e=h("./publickey"),f=h("./crypto/random"),t=h("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(e instanceof p)return e;var r=this._classifyArguments(e,t);if(!r.bn||0===r.bn.cmp(new o(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(u.getN()))throw new TypeError("Number must be less than N");if(void 0===r.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return s.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}p.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?c.get(t):c.defaultNetwork};if(n.isUndefined(e)||n.isNull(e))r.bn=p._getRandomBN();else if(e instanceof o)r.bn=e;else if(e instanceof i||e instanceof Uint8Array)r=p._transformBuffer(e,t);else if(e.bn&&e.network)r=p._transformObject(e);else if(!t&&c.get(e))r.bn=p._getRandomBN(),r.network=c.get(e);else{if("string"!=typeof e)throw new TypeError("First argument is an unrecognized data type.");s.isHexa(e)?r.bn=new o(new i(e,"hex")):r=p._transformWIF(e,t)}return r},p._getRandomBN=function(){var e,t;do{var r=f.getRandomBuffer(32);e=(t=o.fromBuffer(r)).lt(u.getN())}while(!e);return t},p._transformBuffer=function(e,t){var r={};if(32===e.length)return p._transformBNBuffer(e,t);if(r.network=c.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==c.get(t))throw new TypeError("Private key network mismatch");if(34===e.length&&1===e[33])r.compressed=!0;else{if(33!==e.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");r.compressed=!1}return r.bn=o.fromBuffer(e.slice(1,33)),r},p._transformBNBuffer=function(e,t){var r={};return r.network=c.get(t)||c.defaultNetwork,r.bn=o.fromBuffer(e),r.compressed=!1,r},p._transformWIF=function(e,t){return p._transformBuffer(a.decode(e),t)},p.fromBuffer=function(e,t){return new p(e,t)},p._transformObject=function(e){return{bn:new o(e.bn,"hex"),network:c.get(e.network),compressed:e.compressed}},p.fromString=p.fromWIF=function(e){return t.checkArgument(n.isString(e),"First argument is expected to be a string."),new p(e)},p.fromObject=function(e){return t.checkArgument(n.isObject(e),"First argument is expected to be an object."),new p(e)},p.fromRandom=function(e){return new p(p._getRandomBN(),e)},p.getValidationError=function(e,t){var r;try{new p(e,t)}catch(e){r=e}return r},p.isValid=function(e,t){return!!e&&!p.getValidationError(e,t)},p.prototype.toString=function(){return this.toBuffer().toString("hex")},p.prototype.toWIF=function(){var e,t=this.network;return e=this.compressed?i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32}),new i([1])]):i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32})]),a.encode(e)},p.prototype.toBigNumber=function(){return this.bn},p.prototype.toBuffer=function(){return this.bn.toBuffer()},p.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=e.fromPrivateKey(this)),this._pubkey},p.prototype.toAddress=function(e){var t=this.toPublicKey();return r.fromPublicKey(t,e||this.network)},p.prototype.toObject=p.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},p.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return""},l.exports=p}).call(this,h("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/point":87,"./crypto/random":88,"./encoding/base58check":91,"./networks":100,"./publickey":103,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],103:[function(t,r,e){(function(o){"use strict";var s=t("./crypto/bn"),c=t("./crypto/point"),e=t("./crypto/hash"),i=t("./util/js"),n=t("./networks"),u=t("lodash"),f=t("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(f.checkArgument(e,"First argument is required, please include public key data."),e instanceof p)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),i.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||n.defaultNetwork}),this}p.prototype._classifyArgs=function(e,t){var r={compressed:u.isUndefined(t.compressed)||t.compressed};if(e instanceof c)r.point=e;else if(e.x&&e.y)r=p._transformObject(e);else if("string"==typeof e)r=p._transformDER(new o(e,"hex"));else if(p._isBuffer(e))r=p._transformDER(e);else{if(!p._isPrivateKey(e))throw new TypeError("First argument is an unrecognized data format.");r=p._transformPrivateKey(e)}return r.network||(r.network=u.isUndefined(t.network)?void 0:n.get(t.network)),r},p._isPrivateKey=function(e){return e instanceof t("./privatekey")},p._isBuffer=function(e){return e instanceof o||e instanceof Uint8Array},p._transformPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=c.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t},p._transformDER=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r,i,n,a,o={};if(t=!!u.isUndefined(t)||t,4!==e[0]&&(t||6!==e[0]&&7!==e[0]))if(3===e[0])n=e.slice(1),r=new s(n),(o=p._transformX(!0,r)).compressed=!0;else{if(2!==e[0])throw new TypeError("Invalid DER format public key");n=e.slice(1),r=new s(n),(o=p._transformX(!1,r)).compressed=!0}else{if(n=e.slice(1,33),a=e.slice(33,65),32!==n.length||32!==a.length||65!==e.length)throw new TypeError("Length of x and y must be 32 bytes");r=new s(n),i=new s(a),o.point=new c(r,i),o.compressed=!1}return o},p._transformX=function(e,t){f.checkArgument("boolean"==typeof e,"Must specify whether y is odd or not (true or false)");var r={};return r.point=c.fromX(e,t),r},p._transformObject=function(e){var t=new s(e.x,"hex"),r=new s(e.y,"hex");return new p(new c(t,r),{compressed:e.compressed})},p.fromPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t=p._transformPrivateKey(e);return new p(t.point,{compressed:t.compressed,network:t.network})},p.fromDER=p.fromBuffer=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r=p._transformDER(e,t);return new p(r.point,{compressed:r.compressed})},p.fromPoint=function(e,t){return f.checkArgument(e instanceof c,"First argument must be an instance of Point."),new p(e,{compressed:t})},p.fromString=function(e,t){var r=new o(e,t||"hex"),i=p._transformDER(r);return new p(i.point,{compressed:i.compressed})},p.fromX=function(e,t){var r=p._transformX(e,t);return new p(r.point,{compressed:r.compressed})},p.getValidationError=function(e){var t;try{new p(e)}catch(e){t=e}return t},p.isValid=function(e){return!p.getValidationError(e)},p.prototype.toObject=p.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},p.prototype.toBuffer=p.prototype.toDER=function(){var e,t=this.point.getX(),r=this.point.getY(),i=t.toBuffer({size:32}),n=r.toBuffer({size:32});if(this.compressed){var a=n[n.length-1]%2;return e=new o(a?[3]:[2]),o.concat([e,i])}return e=new o([4]),o.concat([e,i,n])},p.prototype._getID=function(){return e.sha256ripemd160(this.toBuffer())},p.prototype.toAddress=function(e){return t("./address").fromPublicKey(this,e||this.network)},p.prototype.toString=function(){return this.toDER().toString("hex")},p.prototype.inspect=function(){return""},r.exports=p}).call(this,t("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./networks":100,"./privatekey":102,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],104:[function(e,t,r){t.exports=e("./script"),t.exports.Interpreter=e("./interpreter")},{"./interpreter":105,"./script":106}],105:[function(p,t,e){(function(e){"use strict";var R=p("lodash"),z=p("./script"),M=p("../opcode"),D=p("../crypto/bn"),N=p("../crypto/hash"),q=p("../crypto/signature"),L=p("../publickey"),U=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};U.prototype.verify=function(e,t,r,i,n){var a,o=p("../transaction");if(R.isUndefined(r)&&(r=new o),R.isUndefined(i)&&(i=0),R.isUndefined(n)&&(n=0),this.set({script:e,tx:r,nin:i,flags:n}),0!=(n&U.SCRIPT_VERIFY_SIGPUSHONLY)&&!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(!this.evaluate())return!1;n&U.SCRIPT_VERIFY_P2SH&&(a=this.stack.slice());var s=this.stack;if(this.initialize(),this.set({script:t,stack:s,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(0===this.stack.length)return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT");var c=this.stack[this.stack.length-1];if(!U.castToBool(c))return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK");if(n&U.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(0===a.length)throw new Error("internal error - stack copy empty");var u=a[a.length-1],f=z.fromBuffer(u);return a.pop(),this.initialize(),this.set({script:f,stack:a,tx:r,nin:i,flags:n}),!!this.evaluate()&&(0===a.length?!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK"):!!U.castToBool(a[a.length-1])||!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK"))}return!0},(t.exports=U).prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},U.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=void 0!==e.nin?e.nin:this.nin,this.stack=e.stack||this.stack,this.altstack=e.altack||this.altstack,this.pc=void 0!==e.pc?e.pc:this.pc,this.pbegincodehash=void 0!==e.pbegincodehash?e.pbegincodehash:this.pbegincodehash,this.nOpCount=void 0!==e.nOpCount?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=void 0!==e.flags?e.flags:this.flags},U.true=new e([1]),U.false=new e([]),U.MAX_SCRIPT_ELEMENT_SIZE=520,U.LOCKTIME_THRESHOLD_BN=new D(U.LOCKTIME_THRESHOLD=5e8),U.SCRIPT_VERIFY_NONE=0,U.SCRIPT_VERIFY_P2SH=1,U.SCRIPT_VERIFY_STRICTENC=2,U.SCRIPT_VERIFY_DERSIG=4,U.SCRIPT_VERIFY_LOW_S=8,U.SCRIPT_VERIFY_NULLDUMMY=16,U.SCRIPT_VERIFY_SIGPUSHONLY=32,U.SCRIPT_VERIFY_MINIMALDATA=64,U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,U.castToBool=function(e){for(var t=0;t=U.LOCKTIME_THRESHOLD&&e.gte(U.LOCKTIME_THRESHOLD_BN))&&(!e.gt(new D(this.tx.nLockTime))&&!!this.tx.inputs[this.nin].isFinal())},U.prototype.step=function(){var e,t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g,v=0!=(this.flags&U.SCRIPT_VERIFY_MINIMALDATA),b=-1===this.vfExec.indexOf(!1),y=this.script.chunks[this.pc];this.pc++;var _=y.opcodenum;if(R.isUndefined(_))return!(this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE");if(y.buf&&y.buf.length>U.MAX_SCRIPT_ELEMENT_SIZE)return!(this.errstr="SCRIPT_ERR_PUSH_SIZE");if(_>M.OP_16&&201<++this.nOpCount)return!(this.errstr="SCRIPT_ERR_OP_COUNT");if(_===M.OP_CAT||_===M.OP_SUBSTR||_===M.OP_LEFT||_===M.OP_RIGHT||_===M.OP_INVERT||_===M.OP_AND||_===M.OP_OR||_===M.OP_XOR||_===M.OP_2MUL||_===M.OP_2DIV||_===M.OP_MUL||_===M.OP_DIV||_===M.OP_MOD||_===M.OP_LSHIFT||_===M.OP_RSHIFT)return!(this.errstr="SCRIPT_ERR_DISABLED_OPCODE");if(b&&0<=_&&_<=M.OP_PUSHDATA4){if(v&&!this.script.checkMinimalPush(this.pc-1))return!(this.errstr="SCRIPT_ERR_MINIMALDATA");if(y.buf){if(y.len!==y.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(y.buf)}else this.stack.push(U.false)}else if(b||M.OP_IF<=_&&_<=M.OP_ENDIF)switch(_){case M.OP_1NEGATE:case M.OP_1:case M.OP_2:case M.OP_3:case M.OP_4:case M.OP_5:case M.OP_6:case M.OP_7:case M.OP_8:case M.OP_9:case M.OP_10:case M.OP_11:case M.OP_12:case M.OP_13:case M.OP_14:case M.OP_15:case M.OP_16:n=_-(M.OP_1-1),e=new D(n).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_NOP:break;case M.OP_NOP2:case M.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break}if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");var w=D.fromScriptNumBuffer(this.stack[this.stack.length-1],v,5);if(w.lt(new D(0)))return!(this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME");if(!this.checkLockTime(w))return!(this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME");break;case M.OP_NOP1:case M.OP_NOP3:case M.OP_NOP4:case M.OP_NOP5:case M.OP_NOP6:case M.OP_NOP7:case M.OP_NOP8:case M.OP_NOP9:case M.OP_NOP10:if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break;case M.OP_IF:case M.OP_NOTIF:if(m=!1,b){if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");e=this.stack.pop(),m=U.castToBool(e),_===M.OP_NOTIF&&(m=!m)}this.vfExec.push(m);break;case M.OP_ELSE:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case M.OP_ENDIF:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec.pop();break;case M.OP_VERIFY:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],!(m=U.castToBool(e)))return!(this.errstr="SCRIPT_ERR_VERIFY");this.stack.pop();break;case M.OP_RETURN:return!(this.errstr="SCRIPT_ERR_OP_RETURN");case M.OP_TOALTSTACK:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.altstack.push(this.stack.pop());break;case M.OP_FROMALTSTACK:if(this.altstack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION");this.stack.push(this.altstack.pop());break;case M.OP_2DROP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop(),this.stack.pop();break;case M.OP_2DUP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1],this.stack.push(t),this.stack.push(r);break;case M.OP_3DUP:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-3],r=this.stack[this.stack.length-2];var k=this.stack[this.stack.length-1];this.stack.push(t),this.stack.push(r),this.stack.push(k);break;case M.OP_2OVER:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-4],r=this.stack[this.stack.length-3],this.stack.push(t),this.stack.push(r);break;case M.OP_2ROT:if(this.stack.length<6)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-6,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_2SWAP:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-4,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_IFDUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-1],(m=U.castToBool(e))&&this.stack.push(e);break;case M.OP_DEPTH:e=new D(this.stack.length).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_DROP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop();break;case M.OP_DUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-1]);break;case M.OP_NIP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,1);break;case M.OP_OVER:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-2]);break;case M.OP_PICK:case M.OP_ROLL:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],n=(s=D.fromScriptNumBuffer(e,v)).toNumber(),this.stack.pop(),n<0||n>=this.stack.length)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-n-1],_===M.OP_ROLL&&this.stack.splice(this.stack.length-n-1,1),this.stack.push(e);break;case M.OP_ROT:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-3],o=this.stack[this.stack.length-2];var x=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=o,this.stack[this.stack.length-2]=x,this.stack[this.stack.length-1]=a;break;case M.OP_SWAP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-2],o=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=o,this.stack[this.stack.length-1]=a;break;case M.OP_TUCK:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case M.OP_SIZE:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");s=new D(this.stack[this.stack.length-1].length),this.stack.push(s.toScriptNumBuffer());break;case M.OP_EQUAL:case M.OP_EQUALVERIFY:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1];var S=t.toString("hex")===r.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(S?U.true:U.false),_===M.OP_EQUALVERIFY){if(!S)return!(this.errstr="SCRIPT_ERR_EQUALVERIFY");this.stack.pop()}break;case M.OP_1ADD:case M.OP_1SUB:case M.OP_NEGATE:case M.OP_ABS:case M.OP_NOT:case M.OP_0NOTEQUAL:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(e=this.stack[this.stack.length-1],s=D.fromScriptNumBuffer(e,v),_){case M.OP_1ADD:s=s.add(D.One);break;case M.OP_1SUB:s=s.sub(D.One);break;case M.OP_NEGATE:s=s.neg();break;case M.OP_ABS:s.cmp(D.Zero)<0&&(s=s.neg());break;case M.OP_NOT:s=new D((0===s.cmp(D.Zero))+0);break;case M.OP_0NOTEQUAL:s=new D((0!==s.cmp(D.Zero))+0)}this.stack.pop(),this.stack.push(s.toScriptNumBuffer());break;case M.OP_ADD:case M.OP_SUB:case M.OP_BOOLAND:case M.OP_BOOLOR:case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:case M.OP_NUMNOTEQUAL:case M.OP_LESSTHAN:case M.OP_GREATERTHAN:case M.OP_LESSTHANOREQUAL:case M.OP_GREATERTHANOREQUAL:case M.OP_MIN:case M.OP_MAX:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(c=D.fromScriptNumBuffer(this.stack[this.stack.length-2],v),u=D.fromScriptNumBuffer(this.stack[this.stack.length-1],v),s=new D(0),_){case M.OP_ADD:s=c.add(u);break;case M.OP_SUB:s=c.sub(u);break;case M.OP_BOOLAND:s=new D((0!==c.cmp(D.Zero)&&0!==u.cmp(D.Zero))+0);break;case M.OP_BOOLOR:s=new D((0!==c.cmp(D.Zero)||0!==u.cmp(D.Zero))+0);break;case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:s=new D((0===c.cmp(u))+0);break;case M.OP_NUMNOTEQUAL:s=new D((0!==c.cmp(u))+0);break;case M.OP_LESSTHAN:s=new D((c.cmp(u)<0)+0);break;case M.OP_GREATERTHAN:s=new D((0"},v.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==c.OP_DUP||this.chunks[1].opcodenum!==c.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==c.OP_EQUALVERIFY||this.chunks[4].opcodenum!==c.OP_CHECKSIG)},v.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&48===e[0]&&t&&t.length){var r=t[0];if((4===r||6===r||7===r)&&65===t.length)return!0;if((3===r||2===r)&&33===t.length)return!0}}return!1},v.prototype.getPublicKey=function(){return p.checkState(this.isPublicKeyOut(),"Can't retreive PublicKey from a non-PK output"),this.chunks[0].buf},v.prototype.getPublicKeyHash=function(){return p.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},v.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===c.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if((4!==t&&6!==t&&7!==t||65!==e.length)&&(3!==t&&2!==t||33!==e.length)||(r=!0),r)return u.isValid(e)}return!1},v.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var e=this.chunks[0].buf;if(e&&e.length&&48===e[0])return!0}return!1},v.prototype.isScriptHashOut=function(){var e=this.toBuffer();return 23===e.length&&e[0]===c.OP_HASH160&&20===e[1]&&e[e.length-1]===c.OP_EQUAL},v.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e,t=this.chunks[this.chunks.length-1].buf;if(!t)return!1;try{e=v.fromBuffer(t)}catch(e){if(e instanceof l.Script.InvalidBuffer)return!1;throw e}return e.classify()!==v.types.UNKNOWN},v.prototype.isMultisigOut=function(){return 3=c.OP_1&&e<=c.OP_16)return e-(c.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))},v.prototype.getSignatureOperationsCount=function(r){r=!!h.isUndefined(r)||r;var i=this,n=0,a=c.OP_INVALIDOPCODE;return h.each(i.chunks,function(e){var t=e.opcodenum;t==c.OP_CHECKSIG||t==c.OP_CHECKSIGVERIFY?n++:t!=c.OP_CHECKMULTISIG&&t!=c.OP_CHECKMULTISIGVERIFY||(r&&a>=c.OP_1&&a<=c.OP_16?n+=i._decodeOP_N(a):n+=20),a=t}),n},t.exports=v}).call(this,e("buffer").Buffer)},{"../address":79,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../networks":100,"../opcode":101,"../publickey":103,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],107:[function(e,t,r){t.exports=e("./transaction"),t.exports.Input=e("./input"),t.exports.Output=e("./output"),t.exports.UnspentOutput=e("./unspentoutput"),t.exports.Signature=e("./signature"),t.exports.Sighash=e("./sighash")},{"./input":108,"./output":114,"./sighash":115,"./signature":116,"./transaction":117,"./unspentoutput":118}],108:[function(e,t,r){t.exports=e("./input"),t.exports.PublicKey=e("./publickey"),t.exports.PublicKeyHash=e("./publickeyhash"),t.exports.MultiSig=e("./multisig.js"),t.exports.MultiSigScriptHash=e("./multisigscripthash.js")},{"./input":109,"./multisig.js":110,"./multisigscripthash.js":111,"./publickey":112,"./publickeyhash":113}],109:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../../util/preconditions"),a=e("../../errors"),o=e("../../encoding/bufferwriter"),s=e("buffer"),c=e("../../util/buffer"),u=e("../../util/js"),f=e("../../script"),p=e("../sighash"),h=e("../output"),l=4294967295;function d(e){return this instanceof d?e?this._fromObject(e):void 0:new d(e)}d.MAXINT=l,d.DEFAULT_SEQNUMBER=4294967295,d.DEFAULT_LOCKTIME_SEQNUMBER=4294967294,d.DEFAULT_RBF_SEQNUMBER=4294967293,Object.defineProperty(d.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new f(this._scriptBuffer),this._script._isInput=!0),this._script)}}),d.fromObject=function(e){return n.checkArgument(i.isObject(e)),(new d)._fromObject(e)},d.prototype._fromObject=function(e){var t;if(t=i.isString(e.prevTxId)&&u.isHexa(e.prevTxId)?new s.Buffer(e.prevTxId,"hex"):e.prevTxId,this.output=e.output?e.output instanceof h?e.output:new h(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=i.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=i.isUndefined(e.sequenceNumber)?i.isUndefined(e.seqnum)?4294967295:e.seqnum:e.sequenceNumber,i.isUndefined(e.script)&&i.isUndefined(e.scriptBuffer))throw new a.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this},d.prototype.toObject=d.prototype.toJSON=function(){var e={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(e.scriptString=this.script.toString()),this.output&&(e.output=this.output.toObject()),e},d.fromBufferReader=function(e){var t=new d;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t},d.prototype.toBufferWriter=function(e){e||(e=new o),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e},d.prototype.setScript=function(e){if(this._script=null,e instanceof f)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(u.isHexa(e))this._scriptBuffer=new s.Buffer(e,"hex");else if(i.isString(e))this._script=new f(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!c.isBuffer(e))throw new TypeError("Invalid argument type: script");this._scriptBuffer=new s.Buffer(e)}return this},d.prototype.getSignatures=function(){throw new a.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},d.prototype.isFullySigned=function(){throw new a.AbstractMethodInvoked("Input#isFullySigned")},d.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},d.prototype.addSignature=function(){throw new a.AbstractMethodInvoked("Input#addSignature")},d.prototype.clearSignatures=function(){throw new a.AbstractMethodInvoked("Input#clearSignatures")},d.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},d.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},d.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},t.exports=d},{"../../encoding/bufferwriter":93,"../../errors":95,"../../script":104,"../../util/buffer":121,"../../util/js":122,"../../util/preconditions":123,"../output":114,"../sighash":115,buffer:191,lodash:149}],110:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=(e("../transaction"),e("./input")),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),u.checkState(o.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.output.script),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},l.normalizeSignatures=function(n,a,o,e,t){return t.map(function(r){var i=null;return e=e.filter(function(e){if(i)return!0;var t=new h({signature:f.fromTxFormat(e),publicKey:r,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:o,sigtype:f.SIGHASH_ALL});return t.signature.nhashtype=t.sigtype,!p.verify(n,t.signature,t.publicKey,t.inputIndex,a.output.script)||(i=t,!1)}),i||null})},l.OPCODES_SIZE=1,l.SIGNATURE_SIZE=73,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"../transaction":117,"./input":109,inherits:148,lodash:149}],111:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=e("./input"),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),this.redeemScript=o.buildMultisigOut(this.publicKeys,r),u.checkState(o.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.redeemScript),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript)},l.OPCODES_SIZE=7,l.SIGNATURE_SIZE=74,l.PUBKEY_SIZE=34,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE+this.publicKeys.length*l.PUBKEY_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148,lodash:149}],112:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),n=(e("../../util/buffer"),e("./input")),o=e("../output"),s=e("../sighash"),c=e("../../script"),u=e("../../crypto/signature"),f=e("../signature");function p(){n.apply(this,arguments)}i(p,n),p.prototype.getSignatures=function(e,t,r,i){a.checkState(this.output instanceof o),i=i||u.SIGHASH_ALL;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new f({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:s.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},p.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(c.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this},p.prototype.clearSignatures=function(){return this.setScript(c.empty()),this},p.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},p.SCRIPT_MAX_SIZE=73,p.prototype._estimateSize=function(){return p.SCRIPT_MAX_SIZE},t.exports=p},{"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],113:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),o=e("../../util/buffer"),s=e("../../crypto/hash"),n=e("./input"),c=e("../output"),u=e("../sighash"),f=e("../../script"),p=e("../../crypto/signature"),h=e("../signature");function l(){n.apply(this,arguments)}i(l,n),l.prototype.getSignatures=function(e,t,r,i,n){return a.checkState(this.output instanceof c),n=n||s.sha256ripemd160(t.publicKey.toBuffer()),i=i||p.SIGHASH_ALL,o.equals(n,this.output.script.getPublicKeyHash())?[new h({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:u.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},l.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(f.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this},l.prototype.clearSignatures=function(){return this.setScript(f.empty()),this},l.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()},l.SCRIPT_MAX_SIZE=107,l.prototype._estimateSize=function(){return l.SCRIPT_MAX_SIZE},t.exports=l},{"../../crypto/hash":86,"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],114:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../crypto/bn"),a=e("buffer"),o=e("../util/buffer"),s=e("../util/js"),c=e("../encoding/bufferwriter"),u=e("../script"),f=e("../util/preconditions"),p=e("../errors");function h(e){if(!(this instanceof h))return new h(e);if(!i.isObject(e))throw new TypeError("Unrecognized argument for Output");var t;this.satoshis=e.satoshis,o.isBuffer(e.script)?this._scriptBuffer=e.script:(t=i.isString(e.script)&&s.isHexa(e.script)?new a.Buffer(e.script,"hex"):e.script,this.setScript(t))}Object.defineProperty(h.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script||this.setScriptFromBuffer(this._scriptBuffer),this._script}}),Object.defineProperty(h.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof n?(this._satoshisBN=e,this._satoshis=e.toNumber()):i.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=n.fromNumber(this._satoshis)):(f.checkArgument(s.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=n.fromNumber(e),this._satoshis=e),f.checkState(s.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),h.prototype.invalidSatoshis=function(){return 9007199254740991"},h.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return t.script=0!==r?e.read(r):new a.Buffer([]),new h(t)},h.prototype.toBufferWriter=function(e){e||(e=new c),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e},t.exports=h},{"../crypto/bn":84,"../encoding/bufferwriter":93,"../errors":95,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],115:[function(y,e,t){(function(f){"use strict";var p=y("buffer"),h=y("../crypto/signature"),l=y("../script"),d=y("./output"),m=y("../encoding/bufferreader"),g=y("../encoding/bufferwriter"),v=y("../crypto/bn"),b=y("../crypto/hash"),o=y("../crypto/ecdsa"),s=y("../util/preconditions"),c=y("lodash"),u=function(e,t,r,i){var n,a=y("./transaction"),o=y("./input"),s=a.shallowCopy(e);for((i=new l(i)).removeCodeseparators(),n=0;n=s.outputs.length)return new f("0000000000000000000000000000000000000000000000000000000000000001","hex");for(s.outputs.length=r+1,n=0;n"},S.prototype.toBuffer=function(){var e=new u;return this.toBufferWriter(e).toBuffer()},S.prototype.toBufferWriter=function(t){return t.writeUInt32LE(this.version),t.writeVarintNum(this.inputs.length),s.each(this.inputs,function(e){e.toBufferWriter(t)}),t.writeVarintNum(this.outputs.length),s.each(this.outputs,function(e){e.toBufferWriter(t)}),t.writeUInt32LE(this.nLockTime),t},S.prototype.fromBuffer=function(e){var t=new c(e);return this.fromBufferReader(t)},S.prototype.fromBufferReader=function(e){var t,r,i;for(a.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readUInt32LE(),r=e.readVarintNum(),t=0;t=this.inputs.length)throw new n.Transaction.InvalidIndex(e,this.inputs.length);var i=this.inputs[e];this.inputs=s.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()},S.prototype.sign=function(e,t){a.checkState(this.hasAllUtxoInfo());var r=this;return s.isArray(e)?s.each(e,function(e){r.sign(e,t)}):s.each(this.getSignatures(e,t),function(e){r.applySignature(e)}),this},S.prototype.getSignatures=function(r,i){r=new k(r),i=i||p.SIGHASH_ALL;var n=this,a=[],o=f.sha256ripemd160(r.publicKey.toBuffer());return s.each(this.inputs,function(e,t){s.each(e.getSignatures(n,r,t,i,o),function(e){a.push(e)})}),a},S.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this},S.prototype.isFullySigned=function(){return s.each(this.inputs,function(e){if(e.isFullySigned===m.prototype.isFullySigned)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),s.all(s.map(this.inputs,function(e){return e.isFullySigned()}))},S.prototype.isValidSignature=function(e){if(this.inputs[e.inputIndex].isValidSignature===m.prototype.isValidSignature)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e)},S.prototype.verifySignature=function(e,t,r,i){return h.verify(this,e,t,r,i)},S.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var e=new x(0),t=0;t=m.MAXINT-1&&(t.sequenceNumber=m.DEFAULT_RBF_SEQNUMBER)}return this},I.exports=S}).call(this,A("buffer").Buffer)},{"../address":79,"../crypto/bn":84,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../privatekey":102,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"./input":108,"./output":114,"./sighash":115,"./unspentoutput":118,buffer:191,"buffer-compare":126,lodash:149}],118:[function(e,t,r){"use strict";var o=e("lodash"),s=e("../util/preconditions"),c=e("../util/js"),u=e("../script"),f=e("../address"),p=e("../unit");function h(e){if(!(this instanceof h))return new h(e);s.checkArgument(o.isObject(e),"Must provide an object from where to extract data");var t=e.address?new f(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!c.isHexaString(r)||64"},h.prototype.toString=function(){return this.txId+":"+this.outputIndex},h.fromObject=function(e){return new h(e)},h.prototype.toObject=h.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:p.fromSatoshis(this.satoshis).toBTC()}},t.exports=h},{"../address":79,"../script":104,"../unit":119,"../util/js":122,"../util/preconditions":123,lodash:149}],119:[function(e,t,r){"use strict";var i=e("lodash"),n=e("./errors"),a=e("./util/preconditions"),o={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function s(e,t){if(!(this instanceof s))return new s(e,t);if(i.isNumber(t)){if(t<=0)throw new n.Unit.InvalidRate(t);e/=t,t=s.BTC}this._value=this._from(e,t);var r=this;Object.keys(o).forEach(function(e){Object.defineProperty(r,e,{get:function(){return r.to(e)},enumerable:!0})})}Object.keys(o).forEach(function(e){s[e]=e}),s.fromObject=function(e){return a.checkArgument(i.isObject(e),"Argument is expected to be an object"),new s(e.amount,e.code)},s.fromBTC=function(e){return new s(e,s.BTC)},s.fromMillis=s.fromMilis=function(e){return new s(e,s.mBTC)},s.fromMicros=s.fromBits=function(e){return new s(e,s.bits)},s.fromSatoshis=function(e){return new s(e,s.satoshis)},s.fromFiat=function(e,t){return new s(e,t)},s.prototype._from=function(e,t){if(!o[t])throw new n.Unit.UnknownCode(t);return parseInt((e*o[t][0]).toFixed())},s.prototype.to=function(e){if(i.isNumber(e)){if(e<=0)throw new n.Unit.InvalidRate(e);return parseFloat((this.BTC*e).toFixed(2))}if(!o[e])throw new n.Unit.UnknownCode(e);var t=this._value/o[e][0];return parseFloat(t.toFixed(o[e][1]))},s.prototype.toBTC=function(){return this.to(s.BTC)},s.prototype.toMillis=s.prototype.toMilis=function(){return this.to(s.mBTC)},s.prototype.toMicros=s.prototype.toBits=function(){return this.to(s.bits)},s.prototype.toSatoshis=function(){return this.to(s.satoshis)},s.prototype.atRate=function(e){return this.to(e)},s.prototype.toString=function(){return this.satoshis+" satoshis"},s.prototype.toObject=s.prototype.toJSON=function(){return{amount:this.BTC,code:s.BTC}},s.prototype.inspect=function(){return""},t.exports=s},{"./errors":95,"./util/preconditions":123,lodash:149}],120:[function(e,t,r){"use strict";var i=e("lodash"),n=e("url"),a=e("./address"),o=e("./unit"),s=function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.extras={},this.knownParams=r||[],this.address=this.network=this.amount=this.message=null,"string"==typeof t){var i=e.parse(t);i.amount&&(i.amount=this._parseAmount(i.amount)),this._fromObject(i)}else{if("object"!==(void 0===t?"undefined":_typeof(t)))throw new TypeError("Unrecognized data format.");this._fromObject(t)}};s.fromString=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return new s(e)},s.fromObject=function(e){return new s(e)},s.isValid=function(e,t){try{new s(e,t)}catch(e){return!1}return!0},s.parse=function(e){var t=n.parse(e,!0);if("bitcoin:"!==t.protocol)throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(e);return t.query.address=r&&r[1]||void 0,t.query},s.Members=["address","amount","message","label","r"],s.prototype._fromObject=function(e){if(!a.isValid(e.address))throw new TypeError("Invalid bitcoin address");for(var t in this.address=new a(e.address),this.network=this.address.network,this.amount=e.amount,e)if("address"!==t&&"amount"!==t){if(/^req-/.exec(t)&&-1===this.knownParams.indexOf(t))throw Error("Unknown required argument "+t);(-1"},t.exports=s},{"./address":79,"./unit":119,lodash:149,url:500}],121:[function(o,s,e){(function(r){"use strict";var i=o("buffer"),t=o("assert"),n=o("./js"),a=o("./preconditions");function e(e,t){if(e.length!==t.length)return!1;for(var r=e.length,i=0;i>24&255),t.push(e>>16&255),t.push(e>>8&255),t.push(255&e),new r(t)},integerFromBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]<<24|e[1]<<16|e[2]<<8|e[3]},integerFromSingleByteBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]},bufferToHex:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e.toString("hex")},reverse:function(e){for(var t=new i.Buffer(e.length),r=0;r>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}}else if("le"===r)for(i=0,a=0;i>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-i&4194303,26<=(i+=24)&&(i-=26,n++)}if(r+6!==t){a=o(e,t,r+6);this.words[n]|=a<>>26-i&4194303}this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];v.prototype.toString=function(e,t){if(16===(e=e||10)||"hex"===e){for(var r="",i=0,n=(t=0|t||1,0),a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return this.sign&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var c=l[e],u=d[e],f=(r="",this.clone());for(f.sign=!1;0!==f.cmpn(0);){var p=f.modn(u).toString(e);r=0!==(f=f.idivn(u)).cmpn(0)?h[c-p.length]+p+r:p+r}return 0===this.cmpn(0)&&(r="0"+r),this.sign&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.prototype.toJSON=function(){return this.toString(16)},v.prototype.toArray=function(){this.strip();var e=new Array(this.byteLength());e[0]=0;for(var t=this.clone(),r=0;0!==t.cmpn(0);r++){var i=t.andln(255);t.ishrn(8),e[e.length-r-1]=i}return e},v.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return 4096<=t&&(r+=13,t>>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.iand=function(e){var t;this.sign=this.sign&&e.sign,t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},v.prototype.ixor=function(e){var t,r;this.sign=this.sign||e.sign,r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);for(var r=e/26|0,i=e%26;this.length<=r;)this.words[this.length++]=0;return this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,a=0;a>>26}for(;0!==n&&a>>26}if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this);this.sign=!1;t=e.sub(this);return this.sign=!0,t},v.prototype.isub=function(e){if(e.sign){e.sign=!1;var t=this.iadd(e);return e.sign=!0,t._normSign()}if(this.sign)return this.sign=!1,this.iadd(e),this.sign=!0,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.sign=!1,this.length=1,this.words[0]=0,this;i=0>26,this.words[o]=67108863&t}for(;0!==a&&o>26,this.words[o]=67108863&t}if(0===a&&o>>26,a=67108863&r,o=Math.min(i,e.length-1),s=Math.max(0,i-this.length+1);s<=o;s++){var c=i-s,u=(0|this.words[c])*(0|e.words[s]),f=67108863&u;a=67108863&(f=f+a|0),n=(n=n+(u/67108864|0)|0)+(f>>>26)|0}t.words[i]=a,r=n}return 0!==r?t.words[i]=r:t.length--,t.strip()},v.prototype._bigMulTo=function(e,t){t.sign=e.sign!==this.sign,t.length=this.length+e.length;for(var r=0,i=0,n=0;n>>26)|0)>>>26,a&=67108863}t.words[n]=o,r=a,a=i}return 0!==r?t.words[n]=r:t.length--,t.strip()},v.prototype.mulTo=function(e,t){return this.length+e.length<63?this._smallMulTo(e,t):this._bigMulTo(e,t)},v.prototype.mul=function(e){var t=new v(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},v.prototype.imul=function(e){if(0===this.cmpn(0)||0===e.cmpn(0))return this.words[0]=0,this.length=1,this;var t=this.length,r=e.length;this.sign=e.sign!==this.sign,this.length=this.length+e.length,this.words[this.length-1]=0;for(var i=this.length-2;0<=i;i--){for(var n=0,a=0,o=Math.min(i,r-1),s=Math.max(0,i-t+1);s<=o;s++){var c=i-s,u=this.words[c]*e.words[s],f=67108863&u;n+=u/67108864|0,a=67108863&(f+=a),n+=f>>>26}this.words[i]=a,this.words[i+1]+=n,n=0}for(n=0,c=1;c>>26}return this.strip()},v.prototype.imuln=function(e){g("number"==typeof e);for(var t=0,r=0;r>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.mul(this)},v.prototype.ishln=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){for(var n=0,a=0;a>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;a>>n<a){this.length-=a;for(c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(c/67108864|0),this.words[a+r]=67108863&s}for(;a>26,this.words[a+r]=67108863&s}if(0===o)return this.strip();g(-1===o);for(a=o=0;a>26,this.words[a]=67108863&s}return this.sign=!0,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.shln(r),i.ishln(r),a=n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var n;i=this.divmod(e.neg(),t);return"mod"!==t&&(n=i.div.neg()),{div:n,mod:i.mod}},v.prototype.div=function(e){return this.divmod(e,"div").div},v.prototype.mod=function(e){return this.divmod(e,"mod").mod},v.prototype.divRound=function(e){var t=this.divmod(e);if(0===t.mod.cmpn(0))return t.div;var r=t.div.sign?t.mod.isub(e):t.mod,i=e.shrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:t.div.sign?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+this.words[i])%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=this.words[r]+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.ishrn(1),r.ishrn(1),++s;for(var c=r.clone(),u=t.clone();0!==t.cmpn(0);){for(;t.isEven();)t.ishrn(1),i.isEven()&&n.isEven()?(i.ishrn(1),n.ishrn(1)):(i.iadd(c).ishrn(1),n.isub(u).ishrn(1));for(;r.isEven();)r.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(u).ishrn(1));0<=t.cmp(r)?(t.isub(r),i.isub(a),n.isub(o)):(r.isub(t),a.isub(i),o.isub(n))}return{a:a,b:o,gcd:r.ishln(s)}},v.prototype._invmp=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=r.clone();0>>26,o&=67108863,this.words[n]=o}return 0!==a&&(this.words[n]=a,this.length++),this},v.prototype.cmpn=function(e){var t,r=e<0;if(r&&(e=-e),this.sign&&!r)return-1;if(!this.sign&&r)return 1;if(e&=67108863,this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}e.words[i-10]=n>>>22,e.length-=9},a.prototype.imulK=function(e){var t;e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(i[e])return i[e];var t;if("k256"===e)t=new a;else if("p224"===e)t=new s;else if("p192"===e)t=new c;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new u}return i[e]=t},f.prototype._verify1=function(e){g(!e.sign,"red works only with positives"),g(e.red,"red works only with red numbers")},f.prototype._verify2=function(e,t){g(!e.sign&&!t.sign,"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},f.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.mod(this.m)._forceRed(this)},f.prototype.neg=function(e){var t=e.clone();return t.sign=!t.sign,t.iadd(this.m)._forceRed(this)},f.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},f.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},f.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)},f.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.shln(t))},f.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},f.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},f.prototype.isqr=function(e){return this.imul(e,e)},f.prototype.sqr=function(e){return this.mul(e,e)},f.prototype.sqrt=function(e){if(0===e.cmpn(0))return e.clone();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).ishrn(2);return f=this.pow(e,r)}for(var i=this.m.subn(1),n=0;0!==i.cmpn(0)&&0===i.andln(1);)n++,i.ishrn(1);g(0!==i.cmpn(0));var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).ishrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).ishrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>8,i[r]&=255;for(;a;)i.push(255&a),a>>=8}for(t=0;"1"===e[t]&&tt[i]?1:0);++i);return 0==r&&(t.length>e.length?r=-1:e.length>t.length&&(r=1)),r}},{}],127:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.hmacDRBG=e("./elliptic/hmac-drbg"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec")},{"../package.json":147,"./elliptic/curve":130,"./elliptic/curves":133,"./elliptic/ec":134,"./elliptic/hmac-drbg":137,"./elliptic/utils":139,brorand:140}],128:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic"),S=n.utils.getNAF,j=n.utils.getJSF,u=n.utils.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function o(e,t){this.curve=e,this.type=t,this.precomputed=null}(t.exports=a).prototype.point=function(){throw new Error("Not implemented")},a.prototype.validate=function(){throw new Error("Not implemented")},a.prototype._fixedNafMul=function(e,t){var r=e._getDoubles(),i=S(t,1),n=(1<>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i){for(var n=this._wnafT1,a=this._wnafT2,o=this._wnafT3,s=0,c=0;c>1]:x<0&&(k=a[m][-x-1>>1].neg()),b="affine"===k.type?b.mixedAdd(k):b.add(k))}}for(c=0;c":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],130:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":128,"./edwards":129,"./mont":131,"./short":132}],131:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base;function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(s,o),(t.exports=s).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)},a(c,o.BasePoint),s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.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)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.ishrn(1))n.push(t.andln(1));for(var a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../curve":130,"bn.js":124,inherits:148}],132:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.shrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.sign&&(i=i.neg(),n=n.neg()),a.sign&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(t=new w(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b).redSqrt(),i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},c.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)},c.prototype._endoWnafMulAdd=function(e,t){for(var r=this._endoWnafT1,i=this._endoWnafT2,n=0;n":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],133:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":127,"./precomputed/secp256k1":138,"hash.js":141}],134:[function(e,t,r){"use strict";var d=e("bn.js"),m=e("../../elliptic"),i=m.utils.assert,n=e("./key"),g=e("./signature");function a(e){if(!(this instanceof a))return new a(e);"string"==typeof e&&(i(m.curves.hasOwnProperty(e),"Unknown curve "+e),e=m.curves[e]),e instanceof m.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(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}(t.exports=a).prototype.keyPair=function(e){return new n(this,e)},a.prototype.keyFromPrivate=function(e,t){return n.fromPrivate(this,e,t)},a.prototype.keyFromPublic=function(e,t){return n.fromPublic(this,e,t)},a.prototype.genKeyPair=function(e){e||(e={});for(var t=new m.hmacDRBG({hash:this.hash,pers:e.pers,entropy:e.entropy||m.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new d(2));;){var n=new d(t.generate(r));if(!(0"}},{"../../elliptic":127,"bn.js":124}],136:[function(e,t,r){"use strict";var n=e("bn.js"),a=e("../../elliptic").utils,i=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16))}(t.exports=o).prototype._importDER=function(e,t){if((e=a.toArray(e,t)).length<6||48!==e[0]||2!==e[2])return!1;if(1+e[1]>e.length)return!1;var r=e[3];if(128<=r)return!1;if(4+r+2>=e.length)return!1;if(2!==e[4+r])return!1;var i=e[5+r];return!(128<=i)&&(!(4+r+2+i>e.length)&&(this.r=new n(e.slice(4,4+r)),this.s=new n(e.slice(4+r+2,4+r+2+i)),!0))},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r));var i=[48,t.length+r.length+4,2,t.length];return i=i.concat(t,[2,r.length],r),a.encode(i,e)}},{"../../elliptic":127,"bn.js":124}],137:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("../elliptic").utils,n=o.assert;function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc),r=o.toArray(e.nonce,e.nonceEnc),i=o.toArray(e.pers,e.persEnc);n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this.reseed=1},a.prototype.generate=function(e,t,r,i){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i),this._update(r));for(var n=[];n.length>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e},i.getNAF=function(e,t){for(var r=[],i=1<>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=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=n.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{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;for(a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>10),n[a-7],(r=n[a-15],b(r,7)^b(r,18)^r>>>3),n[a-16]);var o,s,c=this.h[0],u=this.h[1],f=this.h[2],p=this.h[3],h=this.h[4],l=this.h[5],d=this.h[6],m=this.h[7];F(this.k.length===n.length);for(a=0;a>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function s(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}function u(e,t){if(!e)throw new Error(t||"Assertion failed")}i.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},i.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,r){return e+t+r>>>0},i.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},i.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},i.assert=u,i.inherits=n,r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:148}],147:[function(e,t,r){t.exports={_args:[["elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","/home/giacof/Download/javascript-opentimestamps/node_modules/bitcore-lib"]],_from:"elliptic@=3.0.3",_id:"elliptic@3.0.3",_inCache:!0,_location:"/bitcore-lib/elliptic",_phantomChildren:{inherits:"2.0.1"},_requested:{name:"elliptic",raw:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",rawSpec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",scope:null,spec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",type:"remote"},_requiredBy:["/bitcore-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_shasum:"865c9b420bfbe55006b9f969f97a0d2c44966595",_shrinkwrap:null,_spec:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_where:"/home/giacof/Download/javascript-opentimestamps/node_modules/bitcore-lib",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^2.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},description:"EC cryptography",devDependencies:{browserify:"^3.44.2",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",optionalDependencies:{},readme:"# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic)\n\nFast elliptic-curve cryptography in a plain javascript implementation.\n\nNOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve\nfor your cryptography operations.\n\n## Incentive\n\nECC is much slower than regular RSA cryptography, the JS implementations are\neven more slower.\n\n## Benchmarks\n\n```bash\n$ node benchmarks/index.js\nBenchmarking: sign\nelliptic#sign x 262 ops/sec ±0.51% (177 runs sampled)\neccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled)\n------------------------\nFastest is elliptic#sign\n========================\nBenchmarking: verify\nelliptic#verify x 113 ops/sec ±0.50% (166 runs sampled)\neccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled)\n------------------------\nFastest is elliptic#verify\n========================\nBenchmarking: gen\nelliptic#gen x 294 ops/sec ±0.43% (176 runs sampled)\neccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled)\n------------------------\nFastest is elliptic#gen\n========================\nBenchmarking: ecdh\nelliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled)\n------------------------\nFastest is elliptic#ecdh\n========================\n```\n\n## API\n\n### ECDSA\n\n```javascript\nvar EC = require('elliptic').ec;\n\n// Create and initialize EC context\n// (better do it once and reuse it)\nvar ec = new EC('secp256k1');\n\n// Generate keys\nvar key = ec.genKeyPair();\n\n// Sign message (must be an array, or it'll be treated as a hex sequence)\nvar msg = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];\nvar signature = key.sign(msg);\n\n// Export DER encoded signature in Array\nvar derSign = signature.toDER();\n\n// Verify signature\nconsole.log(key.verify(msg, derSign));\n```\n\n### ECDH\n\n```javascript\n// Generate keys\nvar key1 = ec.genKeyPair();\nvar key2 = ec.genKeyPair();\n\nvar shared1 = key1.derive(key2.getPublic());\nvar shared2 = key2.derive(key1.getPublic());\n\nconsole.log('Both shared secrets are BN instances');\nconsole.log(shared1.toString(16));\nconsole.log(shared2.toString(16));\n```\n\nNOTE: `.derive()` returns a [BN][1] instance.\n\n## Supported curves\n\nElliptic.js support following curve types:\n\n* Short Weierstrass\n* Montgomery\n* Edwards\n* Twisted Edwards\n\nFollowing curve 'presets' are embedded into the library:\n\n* `secp256k1`\n* `p192`\n* `p224`\n* `p256`\n* `curve25519`\n* `ed25519`\n\nNOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead.\n\n### Implementation details\n\nECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of\nthe curve operations are performed on non-affine coordinates (either projective\nor extended), various windowing techniques are used for different cases.\n\nAll operations are performed in reduction context using [bn.js][1], hashing is\nprovided by [hash.js][2]\n\n### Related projects\n\n* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both\n browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for\n node)\n\n#### LICENSE\n\nThis software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2014.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://tools.ietf.org/html/rfc6979\n[1]: https://github.com/indutny/bn.js\n[2]: https://github.com/indutny/hash.js\n[3]: https://github.com/bitchan/eccrypto\n[4]: https://github.com/wanderer/secp256k1-node\n",readmeFilename:"README.md",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{test:"make lint && mocha --reporter=spec test/*-test.js"},version:"3.0.3"}},{}],148:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{dup:68}],149:[function(e,y,_){(function(b){(function(){var dn,e,t,mn="3.10.1",gn=1,vn=2,bn=4,yn=8,_n=16,wn=32,kn=64,xn=128,Sn=256,jn=30,En="...",An=150,In=16,Pn=200,On=1,Tn=2,Bn="Expected a function",Cn="__lodash_placeholder__",Fn="[object Arguments]",Rn="[object Array]",zn="[object Boolean]",Mn="[object Date]",Dn="[object Error]",Nn="[object Function]",r="[object Map]",qn="[object Number]",Ln="[object Object]",Un="[object RegExp]",i="[object Set]",Hn="[object String]",n="[object WeakMap]",Kn="[object ArrayBuffer]",Vn="[object Float32Array]",Gn="[object Float64Array]",$n="[object Int8Array]",Wn="[object Int16Array]",Zn="[object Int32Array]",Yn="[object Uint8Array]",Xn="[object Uint8ClampedArray]",Jn="[object Uint16Array]",Qn="[object Uint32Array]",ea=/\b__p \+= '';/g,ta=/\b(__p \+=) '' \+/g,ra=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ia=/&(?:amp|lt|gt|quot|#39|#96);/g,na=/[&<>"'`]/g,aa=RegExp(ia.source),oa=RegExp(na.source),sa=/<%-([\s\S]+?)%>/g,ca=/<%([\s\S]+?)%>/g,ua=/<%=([\s\S]+?)%>/g,fa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,pa=/^\w*$/,ha=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,la=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,da=RegExp(la.source),ma=/[\u0300-\u036f\ufe20-\ufe23]/g,ga=/\\(\\)?/g,va=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ba=/\w*$/,ya=/^0[xX]/,_a=/^\[object .+?Constructor\]$/,wa=/^\d+$/,ka=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xa=/($^)/,Sa=/['\n\r\u2028\u2029\\]/g,ja=(e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",t="[a-z\\xdf-\\xf6\\xf8-\\xff]+",RegExp(e+"+(?="+e+t+")|"+e+"?"+t+"|"+e+"+|[0-9]+","g")),Ea=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Aa=-1,Ia={};Ia[Vn]=Ia[Gn]=Ia[$n]=Ia[Wn]=Ia[Zn]=Ia[Yn]=Ia[Xn]=Ia[Jn]=Ia[Qn]=!0,Ia[Fn]=Ia[Rn]=Ia[Kn]=Ia[zn]=Ia[Mn]=Ia[Dn]=Ia[Nn]=Ia[r]=Ia[qn]=Ia[Ln]=Ia[Un]=Ia[i]=Ia[Hn]=Ia[n]=!1;var Pa={};Pa[Fn]=Pa[Rn]=Pa[Kn]=Pa[zn]=Pa[Mn]=Pa[Vn]=Pa[Gn]=Pa[$n]=Pa[Wn]=Pa[Zn]=Pa[qn]=Pa[Ln]=Pa[Un]=Pa[Hn]=Pa[Yn]=Pa[Xn]=Pa[Jn]=Pa[Qn]=!0,Pa[Dn]=Pa[Nn]=Pa[r]=Pa[i]=Pa[n]=!1;var a={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},o={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},s={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},c={function:!0,object:!0},u={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},f={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},p=c[void 0===_?"undefined":_typeof(_)]&&_&&!_.nodeType&&_,h=c[void 0===y?"undefined":_typeof(y)]&&y&&!y.nodeType&&y,l=p&&h&&"object"==(void 0===b?"undefined":_typeof(b))&&b&&b.Object&&b,d=c["undefined"==typeof self?"undefined":_typeof(self)]&&self&&self.Object&&self,m=c["undefined"==typeof window?"undefined":_typeof(window)]&&window&&window.Object&&window,g=h&&h.exports===p&&p,Oa=l||m!==(this&&this.window)&&m||d||this;function Ta(e,t){if(e!==t){var r=null===e,i=e===dn,n=e==e,a=null===t,o=t===dn,s=t==t;if(t>>1,$=9007199254740991,W=O&&new O,Z={};function Y(e){if(Ka(e)&&!ui(e)&&!(e instanceof Q)){if(e instanceof J)return e;if(_.call(e,"__chain__")&&_.call(e,"__wrapped__"))return Qt(e)}return new J(e)}function X(){}function J(e,t,r){this.__wrapped__=e,this.__actions__=r||[],this.__chain__=!!t}Y.support={};function Q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function ee(){this.__data__={}}function te(e){var t=e?e.length:0;for(this.data={hash:B(null),set:new j};t--;)this.push(e[t])}function re(e,t){var r=e.data;return("string"==typeof t||li(t)?r.set.has(t):r.hash[t])?0:-1}function ie(e,t){var r=-1,i=e.length;for(t||(t=P(i));++r=Pn?st(t):null,c=t.length;s&&(a=re,o=!1,t=s);e:for(;++n>>0,t>>>=0;for(var a=P(n);++i>>1,o=e[a];(r?o<=t:o=Pn)return n.plant(t).value();for(var r=0,i=a?o[r].apply(this,e):t;++r=An)return e}else Gt=0;return Ue(e,t)});function Zt(e){for(var t=Ri(e),r=t.length,i=r&&e.length,n=!!i&&Ut(i)&&(ui(e)||ci(e)),a=-1,o=[];++a>>0,r>>>=0;r=D(t,r)&&e=(e=Ra(e)).length)return e;var o=i-n.length;if(o<1)return n;var s=e.slice(0,o);if(null==a)return s+n;if(vi(a)){if(e.slice(o).search(a)){var c,u,f=e.slice(0,o);for(a.global||(a=b(a.source,(ba.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(f);)u=c.index;s=s.slice(0,null==u?o:u)}}else if(e.indexOf(a,o)!=o){var p=s.lastIndexOf(a);-1=0.13.7 <0.14.0",_id:"bitcore-lib@0.13.19",_inCache:!0,_installable:!0,_location:"/bitcore-lib",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/bitcore-lib-0.13.19.tgz_1470850061596_0.2146058666985482"},_npmUser:{email:"braydon@bitpay.com",name:"braydonf"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{name:"bitcore-lib",raw:"bitcore-lib@^0.13.7",rawSpec:"^0.13.7",scope:null,spec:">=0.13.7 <0.14.0",type:"range"},_requiredBy:["/","/bitcore-message"],_resolved:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz",_shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",_shrinkwrap:{dependencies:{"bn.js":{from:"bn.js@=2.0.4",resolved:"https://registry.npmjs.org/bn.js/-/bn.js-2.0.4.tgz",version:"2.0.4"},bs58:{from:"bs58@=2.0.0",resolved:"https://registry.npmjs.org/bs58/-/bs58-2.0.0.tgz",version:"2.0.0"},"buffer-compare":{from:"buffer-compare@=1.0.0",resolved:"https://registry.npmjs.org/buffer-compare/-/buffer-compare-1.0.0.tgz",version:"1.0.0"},elliptic:{dependencies:{brorand:{from:"brorand@^1.0.1",resolved:"https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz",version:"1.0.5"},"hash.js":{from:"hash.js@=1.0.3",resolved:"https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz",version:"1.0.3"}},from:"elliptic@=3.0.3",resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",version:"3.0.3"},inherits:{from:"inherits@=2.0.1",resolved:"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",version:"2.0.1"},lodash:{from:"lodash@=3.10.1",resolved:"https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",version:"3.10.1"}},name:"bitcore",version:"0.13.18"},_spec:"bitcore-lib@^0.13.7",_where:"/home/giacof/Download/javascript-opentimestamps",author:{email:"dev@bitpay.com",name:"BitPay"},browser:{request:"browser-request"},bugs:{url:"https://github.com/bitpay/bitcore-lib/issues"},contributors:[{name:"Manuel Araoz",email:"manuelaraoz@gmail.com"},{name:"Daniel Cousens",email:"bitcoin@dcousens.com"},{name:"Gordon Hall",email:"gordon@bitpay.com"},{name:"Jeff Garzik",email:"jgarzik@bitpay.com"},{name:"Kyle Drake",email:"kyle@kyledrake.net"},{name:"Esteban Ordano",email:"eordano@gmail.com"},{name:"Matias Alejo Garcia",email:"ematiu@gmail.com"},{name:"Ryan X. Charles",email:"ryanxcharles@gmail.com"},{name:"Stefan Thomas",email:"moon@justmoon.net"},{name:"Stephen Pair",email:"stephen@bitpay.com"},{name:"Wei Lu",email:"luwei.here@gmail.com"}],dependencies:{"bn.js":"=2.0.4",bs58:"=2.0.0","buffer-compare":"=1.0.0",elliptic:"=3.0.3",inherits:"=2.0.1",lodash:"=3.10.1"},description:"A pure and powerful JavaScript Bitcoin library.",devDependencies:{"bitcore-build":"github:bitpay/bitcore-build",brfs:"^1.2.0",chai:"^1.10.0",gulp:"^3.8.10",sinon:"^1.13.0"},directories:{},dist:{shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",tarball:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz"},gitHead:"9517864f14d09700f3fd02ff61173003c0280774",homepage:"https://github.com/bitpay/bitcore-lib#readme",keywords:["address","bip21","bip32","bip37","bip69","bip70","bitcoin","blockchain","cryptocurrency","ecies","multisig","p2p","payment","transaction"],license:"MIT",main:"index.js",maintainers:[{name:"braydonf",email:"braydon@bitpay.com"},{name:"gabegattis",email:"gabegattis@gmail.com"},{name:"gasteve",email:"stephen@pairhome.net"},{name:"patrickbitpay",email:"patrick@bitpay.com"}],name:"bitcore-lib",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/bitpay/bitcore-lib.git"},scripts:{build:"gulp",coverage:"gulp coverage",lint:"gulp lint",test:"gulp test"},version:"0.13.19"}},{}],151:[function(e,t,r){var i=e("bitcore-lib");i.Message=e("./lib/message"),t.exports=i.Message},{"./lib/message":152,"bitcore-lib":78}],152:[function(r,d,e){(function(o){"use strict";var e=r("bitcore-lib"),s=e.deps._,i=e.PrivateKey,n=e.PublicKey,c=e.Address,a=e.encoding.BufferWriter,u=e.crypto.ECDSA,f=e.crypto.Signature,p=e.crypto.Hash.sha256sha256,t=e.util.js,h=e.util.preconditions,l=function e(t){return this instanceof e?(h.checkArgument(s.isString(t),"First argument should be a string"),this.message=t,this):new e(t)};l.MAGIC_BYTES=new o("Bitcoin Signed Message:\n"),l.prototype.magicHash=function(){var e=a.varintBufNum(l.MAGIC_BYTES.length),t=new o(this.message),r=a.varintBufNum(t.length),i=o.concat([e,l.MAGIC_BYTES,r,t]);return p(i)},l.prototype._sign=function(e){h.checkArgument(e instanceof i,"First argument should be an instance of PrivateKey");var t=this.magicHash(),r=new u;return r.hashbuf=t,r.privkey=e,r.pubkey=e.toPublicKey(),r.signRandomK(),r.calci(),r.sig},l.prototype.sign=function(e){return this._sign(e).toCompact().toString("base64")},l.prototype._verify=function(e,t){h.checkArgument(e instanceof n,"First argument should be an instance of PublicKey"),h.checkArgument(t instanceof f,"Second argument should be an instance of Signature");var r=this.magicHash(),i=u.verify(r,t,e);return i||(this.error="The signature was invalid"),i},l.prototype.verify=function(e,t){h.checkArgument(e),h.checkArgument(t&&s.isString(t)),s.isString(e)&&(e=c.fromString(e));var r=f.fromCompact(new o(t,"base64")),i=new u;i.hashbuf=this.magicHash(),i.sig=r;var n=i.toPublicKey(),a=c.fromPublicKey(n,e.network);return e.toString()!==a.toString()?!(this.error="The signature did not match the message digest"):this._verify(n,r)},l.fromString=function(e){return new l(e)},l.fromJSON=function(e){return t.isValidJSON(e)&&(e=JSON.parse(e)),new l(e.message)},l.prototype.toObject=function(){return{message:this.message}},l.prototype.toJSON=function(){return JSON.stringify(this.toObject())},l.prototype.toString=function(){return this.message},l.prototype.inspect=function(){return""},d.exports=l}).call(this,r("buffer").Buffer)},{"bitcore-lib":78,buffer:191}],153:[function(e,r,i){(function(Q,U,u){!function(e){if("object"==(void 0===i?"undefined":_typeof(i))&&void 0!==r)r.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:void 0!==U?t=U:"undefined"!=typeof self&&(t=self),t.Promise=e()}}(function(){var e,t,r;return function a(o,s,c){function u(r,e){if(!s[r]){if(!o[r]){var t="function"==typeof _dereq_&&_dereq_;if(!e&&t)return t(r,!0);if(f)return f(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[r]={exports:{}};o[r][0].call(n.exports,function(e){var t=o[r][1][e];return u(t||e)},n,n.exports,a,o,s,c)}return s[r].exports}for(var f="function"==typeof _dereq_&&_dereq_,e=0;e, no stack trace)"}function V(){return"function"==typeof Y}var G=function(){return!1},$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function W(e){var t=e.match($);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function Z(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);Y(this,Z),32=a)return r[t]=e,this._queue.push(t),!1;null!==n&&(n[t]=e);var o=this._promise,s=this._callback,c=o._boundValue();o._pushContext();var u=g(s).call(c,e,t,i),f=o._popContext();if(m.checkForgottenReturns(u,f,null!==n?"Promise.filter":"Promise.map",o),u===v)return this._reject(u.e),!0;var p=d(u,this._promise);if(p instanceof l){var h=(p=p._target())._bitField;if(0==(50397184&h))return 1<=a&&this._inFlight++,(r[t]=p)._proxy(this,-1*(t+1)),!1;if(0==(33554432&h))return 0!=(16777216&h)?this._reject(p._reason()):this._cancel(),!0;u=p._value()}r[t]=u}return i<=++this._totalResolved&&(null!==n?this._filter(r,n):this._resolve(r),!0)},f.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;0>>16)){if(e===this){var r=c();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,0<(65535&t)&&(0!=(134217728&t)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},E.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,d.isNode);0<(65535&t)?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},E.prototype._fulfillPromises=function(e,t){for(var r=1;r=this._length&&(this._resolve(this._values),!0)},t.prototype._promiseCancelled=function(){return this._cancel(),!0},t.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},t.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof s)e.cancel();else for(var t=0;t=this._length){var r;if(this._isMap)r=function(e){for(var t=new s,r=e.length/2|0,i=0;i>1},i.prototype.props=function(){return r(this)},i.props=function(e){return r(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function i(e){this._capacity=e,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},n.prototype._promiseFulfilled=function(e,t){var r=new i;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},n.prototype._promiseRejected=function(e,t){var r=new i;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},e.settle=function(e){return r.deprecated(".settle()",".reflect()"),new n(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(f,e,t){"use strict";e.exports=function(e,t,n){var r=f("./util"),i=f("./errors").RangeError,a=f("./errors").AggregateError,o=r.isArray,s={};function c(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function u(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new c(e),i=r.promise();return r.setHowMany(t),r.init(),i}r.inherits(c,t),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=o(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(e){this._howMany=e},c.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(s),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);else if("le"===r)for(n=i=0;i>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-a&4194303,26<=(a+=24)&&(a-=26,i++);r+6!==t&&(n=o(e,t,r+6),this.words[i]|=n<>>26-a&4194303),this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=67108863&o,c=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,p=67108863&c,h=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=h;l++){var d=u-l|0;f+=(o=(n=0|e.words[d])*(a=0|t.words[l])+p)/67108864|0,p=67108863&o}r.words[u]=0|p,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}v.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,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}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)&&2<=e&&e<=36){var c=l[e],u=d[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var p=f.modn(u).toString(e);r=(f=f.idivn(u)).isZero()?p+r:h[c-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.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]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},v.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)},v.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},v.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},v.prototype.inotn=function(e){g("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},v.prototype.notn=function(e){return this.clone().inotn(e)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);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,e):(r=e,this);for(var n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},v.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;i=0>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],d=8191&l,m=l>>>13,g=0|o[2],v=8191&g,b=g>>>13,y=0|o[3],_=8191&y,w=y>>>13,k=0|o[4],x=8191&k,S=k>>>13,j=0|o[5],E=8191&j,A=j>>>13,I=0|o[6],P=8191&I,O=I>>>13,T=0|o[7],B=8191&T,C=T>>>13,F=0|o[8],R=8191&F,z=F>>>13,M=0|o[9],D=8191&M,N=M>>>13,q=0|s[0],L=8191&q,U=q>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],$=8191&G,W=G>>>13,Z=0|s[3],Y=8191&Z,X=Z>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],ae=8191&ne,oe=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],pe=8191&fe,he=fe>>>13,le=0|s[9],de=8191&le,me=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(p,L))|0)+((8191&(n=(n=Math.imul(p,U))+Math.imul(h,L)|0))<<13)|0;u=((a=Math.imul(h,U))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,L),n=(n=Math.imul(d,U))+Math.imul(m,L)|0,a=Math.imul(m,U);var ve=(u+(i=i+Math.imul(p,K)|0)|0)+((8191&(n=(n=n+Math.imul(p,V)|0)+Math.imul(h,K)|0))<<13)|0;u=((a=a+Math.imul(h,V)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(b,L)|0,a=Math.imul(b,U),i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,V)|0;var be=(u+(i=i+Math.imul(p,$)|0)|0)+((8191&(n=(n=n+Math.imul(p,W)|0)+Math.imul(h,$)|0))<<13)|0;u=((a=a+Math.imul(h,W)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(_,L),n=(n=Math.imul(_,U))+Math.imul(w,L)|0,a=Math.imul(w,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,i=i+Math.imul(d,$)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,W)|0;var ye=(u+(i=i+Math.imul(p,Y)|0)|0)+((8191&(n=(n=n+Math.imul(p,X)|0)+Math.imul(h,Y)|0))<<13)|0;u=((a=a+Math.imul(h,X)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(x,L),n=(n=Math.imul(x,U))+Math.imul(S,L)|0,a=Math.imul(S,U),i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,W)|0,i=i+Math.imul(d,Y)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,X)|0;var _e=(u+(i=i+Math.imul(p,Q)|0)|0)+((8191&(n=(n=n+Math.imul(p,ee)|0)+Math.imul(h,Q)|0))<<13)|0;u=((a=a+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(A,L)|0,a=Math.imul(A,U),i=i+Math.imul(x,K)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,V)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,W)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(b,Y)|0,a=a+Math.imul(b,X)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0;var we=(u+(i=i+Math.imul(p,re)|0)|0)+((8191&(n=(n=n+Math.imul(p,ie)|0)+Math.imul(h,re)|0))<<13)|0;u=((a=a+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(O,L)|0,a=Math.imul(O,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,V)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,W)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,X)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0;var ke=(u+(i=i+Math.imul(p,ae)|0)|0)+((8191&(n=(n=n+Math.imul(p,oe)|0)+Math.imul(h,ae)|0))<<13)|0;u=((a=a+Math.imul(h,oe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(C,L)|0,a=Math.imul(C,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(O,K)|0,a=a+Math.imul(O,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,W)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(S,Y)|0,a=a+Math.imul(S,X)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ie)|0,i=i+Math.imul(d,ae)|0,n=(n=n+Math.imul(d,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var xe=(u+(i=i+Math.imul(p,ce)|0)|0)+((8191&(n=(n=n+Math.imul(p,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((a=a+Math.imul(h,ue)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(R,L),n=(n=Math.imul(R,U))+Math.imul(z,L)|0,a=Math.imul(z,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,W)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ie)|0,i=i+Math.imul(v,ae)|0,n=(n=n+Math.imul(v,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,i=i+Math.imul(d,ce)|0,n=(n=n+Math.imul(d,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0;var Se=(u+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,he)|0)+Math.imul(h,pe)|0))<<13)|0;u=((a=a+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(D,L),n=(n=Math.imul(D,U))+Math.imul(N,L)|0,a=Math.imul(N,U),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(z,K)|0,a=a+Math.imul(z,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,W)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,Y)|0,a=a+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ie)|0,i=i+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,i=i+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,ue)|0,i=i+Math.imul(d,pe)|0,n=(n=n+Math.imul(d,he)|0)+Math.imul(m,pe)|0,a=a+Math.imul(m,he)|0;var je=(u+(i=i+Math.imul(p,de)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(h,de)|0))<<13)|0;u=((a=a+Math.imul(h,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,V))+Math.imul(N,K)|0,a=Math.imul(N,V),i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,W)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,W)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(C,Y)|0,a=a+Math.imul(C,X)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ie)|0,i=i+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,ue)|0,i=i+Math.imul(v,pe)|0,n=(n=n+Math.imul(v,he)|0)+Math.imul(b,pe)|0,a=a+Math.imul(b,he)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;u=((a=a+Math.imul(m,me)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(D,$),n=(n=Math.imul(D,W))+Math.imul(N,$)|0,a=Math.imul(N,W),i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,X)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ie)|0,i=i+Math.imul(E,ae)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,i=i+Math.imul(x,ce)|0,n=(n=n+Math.imul(x,ue)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,ue)|0,i=i+Math.imul(_,pe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,pe)|0,a=a+Math.imul(w,he)|0;var Ae=(u+(i=i+Math.imul(v,de)|0)|0)+((8191&(n=(n=n+Math.imul(v,me)|0)+Math.imul(b,de)|0))<<13)|0;u=((a=a+Math.imul(b,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,X))+Math.imul(N,Y)|0,a=Math.imul(N,X),i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ie)|0,i=i+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,i=i+Math.imul(x,pe)|0,n=(n=n+Math.imul(x,he)|0)+Math.imul(S,pe)|0,a=a+Math.imul(S,he)|0;var Ie=(u+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,me)|0)+Math.imul(w,de)|0))<<13)|0;u=((a=a+Math.imul(w,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,ee))+Math.imul(N,Q)|0,a=Math.imul(N,ee),i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ie)|0,i=i+Math.imul(B,ae)|0,n=(n=n+Math.imul(B,oe)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,ue)|0,i=i+Math.imul(E,pe)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(A,pe)|0,a=a+Math.imul(A,he)|0;var Pe=(u+(i=i+Math.imul(x,de)|0)|0)+((8191&(n=(n=n+Math.imul(x,me)|0)+Math.imul(S,de)|0))<<13)|0;u=((a=a+Math.imul(S,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(D,re),n=(n=Math.imul(D,ie))+Math.imul(N,re)|0,a=Math.imul(N,ie),i=i+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,i=i+Math.imul(B,ce)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,ue)|0,i=i+Math.imul(P,pe)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(O,pe)|0,a=a+Math.imul(O,he)|0;var Oe=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(A,de)|0))<<13)|0;u=((a=a+Math.imul(A,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(D,ae),n=(n=Math.imul(D,oe))+Math.imul(N,ae)|0,a=Math.imul(N,oe),i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(z,ce)|0,a=a+Math.imul(z,ue)|0,i=i+Math.imul(B,pe)|0,n=(n=n+Math.imul(B,he)|0)+Math.imul(C,pe)|0,a=a+Math.imul(C,he)|0;var Te=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(O,de)|0))<<13)|0;u=((a=a+Math.imul(O,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(D,ce),n=(n=Math.imul(D,ue))+Math.imul(N,ce)|0,a=Math.imul(N,ue),i=i+Math.imul(R,pe)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(z,pe)|0,a=a+Math.imul(z,he)|0;var Be=(u+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,me)|0)+Math.imul(C,de)|0))<<13)|0;u=((a=a+Math.imul(C,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(D,pe),n=(n=Math.imul(D,he))+Math.imul(N,pe)|0,a=Math.imul(N,he);var Ce=(u+(i=i+Math.imul(R,de)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(z,de)|0))<<13)|0;u=((a=a+Math.imul(z,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Fe=(u+(i=Math.imul(D,de))|0)+((8191&(n=(n=Math.imul(D,me))+Math.imul(N,de)|0))<<13)|0;return u=((a=Math.imul(N,me))+(n>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,c[0]=ge,c[1]=ve,c[2]=be,c[3]=ye,c[4]=_e,c[5]=we,c[6]=ke,c[7]=xe,c[8]=Se,c[9]=je,c[10]=Ee,c[11]=Ae,c[12]=Ie,c[13]=Pe,c[14]=Oe,c[15]=Te,c[16]=Be,c[17]=Ce,c[18]=Fe,0!==u&&(c[19]=u,r.length++),r};function s(e,t,r){return(new c).mulp(e,t,r)}function c(e,t){this.x=e,this.y=t}Math.imul||(a=n),v.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?a(this,e,t):r<63?n(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,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},c.prototype.makeRBT=function(e){for(var t=new Array(e),r=v.prototype._countBits(e)-1,i=0;i>=1;return i},c.prototype.permute=function(e,t,r,i,n,a){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*a+1]=8191&n,n>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.muln=function(e){return this.clone().imuln(e)},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.imul(this.clone())},v.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 v(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<a)for(this.length-=a,c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},v.prototype.ishrn=function(e,t,r){return g(0===this.negative),this.iushrn(e,t,r)},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.ushln=function(e){return this.clone().iushln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.ushrn=function(e){return this.clone().iushrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===o)return this.strip();for(g(-1===o),i=o=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,a},v.prototype.div=function(e){return this.divmod(e,"div",!1).div},v.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},v.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},v.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),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(0===e.negative),g(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var c=r.clone(),u=t.clone();!t.isZero();){for(var f=0,p=1;0==(t.words[0]&p)&&f<26;++f,p<<=1);if(0>>26,o&=67108863,this.words[a]=o}return 0!==n&&(this.words[a]=n,this.length++),this},v.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},v.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(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(u[e])return u[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new b;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return u[e]=t},w.prototype._verify1=function(e){g(0===e.negative,"red works only with positives"),g(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){g(0==(e.negative|t.negative),"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},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 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&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();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);g(!i.isZero());var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==a?(a<<=1,a|=f,(4===++o||0===i&&0===u)&&(n=this.mul(n,r[a]),a=o=0)):o=0}s=26}return n},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},v.mont=function(e){return new k(e)},r(k,w),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.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),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new v(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:157}],155:[function(e,t,r){var A=e("concat-map"),I=e("balanced-match");t.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function t(e,r){var i=[];var n=I("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var s=a||o;var c=0<=n.body.indexOf(",");if(!s&&!c)return n.post.match(/,.*\}/)?(e=n.pre+"{"+n.body+P+n.post,t(e)):[e];var u;if(s)u=n.body.split(/\.\./);else if(1===(u=T(n.body)).length&&1===(u=t(u[0],!1).map(B)).length){var f=n.post.length?t(n.post,!1):[""];return f.map(function(e){return n.pre+u[0]+e})}var p=n.pre;var f=n.post.length?t(n.post,!1):[""];var h;if(s){var l=O(u[0]),d=O(u[1]),m=Math.max(u[0].length,u[1].length),g=3==u.length?Math.abs(O(u[2])):1,v=F,b=d>>24]^f[d>>>16&255]^p[m>>>8&255]^h[255&g]^t[v++],o=u[d>>>24]^f[m>>>16&255]^p[g>>>8&255]^h[255&l]^t[v++],s=u[m>>>24]^f[g>>>16&255]^p[l>>>8&255]^h[255&d]^t[v++],c=u[g>>>24]^f[l>>>16&255]^p[d>>>8&255]^h[255&m]^t[v++],l=a,d=o,m=s,g=c;return a=(i[l>>>24]<<24|i[d>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[v++],o=(i[d>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&l])^t[v++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[l>>>8&255]<<8|i[255&d])^t[v++],c=(i[g>>>24]<<24|i[l>>>16&255]<<16|i[d>>>8&255]<<8|i[255&m])^t[v++],[a>>>=0,o>>>=0,s>>>=0,c>>>=0]}var p=[0,1,2,4,8,16,32,64,128,27,54],h=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=[[],[],[],[]],a=[[],[],[],[]],o=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;var f=e[i[r[o]=u]=o],p=e[f],h=e[p],l=257*e[u]^16843008*u;n[0][o]=l<<24|l>>>8,n[1][o]=l<<16|l>>>16,n[2][o]=l<<8|l>>>24,n[3][o]=l,l=16843009*h^65537*p^257*f^16843008*o,a[0][u]=l<<24|l>>>8,a[1][u]=l<<16|l>>>16,a[2][u]=l<<8|l>>>24,a[3][u]=l,0===o?o=s=1:(o=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();function s(e){this._key=a(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],a=0;a>>24,o=h.SBOX[o>>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o],o^=p[a/t|0]<<24):6>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o]),n[a]=n[a-t]^o}for(var s=[],c=0;c>>24]]^h.INV_SUB_MIX[1][h.SBOX[f>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[f>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return o(e=a(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=a(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":447}],159:[function(e,t,r){var o=e("./aes"),u=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),f=e("./ghash"),n=e("buffer-xor"),p=e("./incr32");function a(e,t,r,i){s.call(this);var n=u.alloc(4,0);this._cipher=new o.AES(t);var a=this._cipher.encryptBlock(n);this._ghash=new f(a),r=function(e,t,r){if(12===t.length)return e._finID=u.concat([t,u.from([0,0,0,1])]),u.concat([t,u.from([0,0,0,2])]);var i=new f(r),n=t.length,a=n%16;i.update(t),a&&(a=16-a,i.update(u.alloc(a,0))),i.update(u.alloc(8,0));var o=8*n,s=u.alloc(8);s.writeUIntBE(o,0,8),i.update(s),e._finID=i.state;var c=u.from(e._finID);return p(c),c}(this,r,a),this._prev=u.from(r),this._cache=u.allocUnsafe(0),this._secCache=u.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(a,s),a.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=u.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},a.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(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;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":447}],164:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],165:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":190}],166:[function(e,t,r){var a=e("safe-buffer").Buffer,o=e("buffer-xor");function s(e,t,r){var i=t.length,n=o(t,e._cache);return e._cache=e._cache.slice(i),e._prev=a.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=a.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=a.allocUnsafe(0)),!(e._cache.length<=t.length)){n=a.concat([n,s(e,t,r)]);break}i=e._cache.length,n=a.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":190,"safe-buffer":447}],167:[function(e,t,r){var o=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,a=-1,o=0;++a<8;)i=t&1<<7-a?128:0,o+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>a%8,e._prev=c(e._prev,r?i:n);return o}function c(e,t){var r=e.length,i=-1,n=o.allocUnsafe(e.length);for(e=o.concat([e,o.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=o.allocUnsafe(i),a=-1;++a=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var a=m(r);if("ec"===a.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=g[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new d(i),a=r.data.subjectPrivateKey.data;return n.verify(t,e,a)}(e,t,a)}if("dsa"===a.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,a=r.data.g,o=r.data.pub_key,s=m.signature.decode(e,"der"),c=s.s,u=s.r;v(c,n),v(u,n);var f=l.mont(i),p=c.invm(n);return 0===a.toRed(f).redPow(new l(t).mul(p).mod(n)).fromRed().mul(o.toRed(f).redPow(u.mul(p).mod(n)).fromRed()).mod(i).mod(n).cmp(u)}(e,t,a)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var o=a.modulus.byteLength(),s=[1],c=0;t.length+s.length+2l.UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function h(e,t){for(var r=0;rm.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsm.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelm.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelm.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=m.Z_FILTERED&&e.strategy!=m.Z_HUFFMAN_ONLY&&e.strategy!=m.Z_RLE&&e.strategy!=m.Z_FIXED&&e.strategy!=m.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!g.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new o.Zlib(t);var i=this;this._hadError=!1,this._binding.onerror=function(e,t){i._binding=null,i._hadError=!0;var r=new Error(e);r.errno=t,r.code=m.codes[t],i.emit("error",r)};var r=m.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(r=e.level);var n=m.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(n=e.strategy),this._binding.init(e.windowBits||m.Z_DEFAULT_WINDOWBITS,r,e.memLevel||m.Z_DEFAULT_MEMLEVEL,n,e.dictionary),this._buffer=new g(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=n,this.once("end",this.close)}o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION,Object.keys(o).forEach(function(e){e.match(/^Z/)&&(m[e]=o[e])}),m.codes={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},Object.keys(m.codes).forEach(function(e){m.codes[m.codes[e]]=e}),m.Deflate=s,m.Inflate=c,m.Gzip=u,m.Gunzip=f,m.DeflateRaw=p,m.InflateRaw=h,m.Unzip=l,m.createDeflate=function(e){return new s(e)},m.createInflate=function(e){return new c(e)},m.createDeflateRaw=function(e){return new p(e)},m.createInflateRaw=function(e){return new h(e)},m.createGzip=function(e){return new u(e)},m.createGunzip=function(e){return new f(e)},m.createUnzip=function(e){return new l(e)},m.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new s(t),e,r)},m.deflateSync=function(e,t){return r(new s(t),e)},m.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new u(t),e,r)},m.gzipSync=function(e,t){return r(new u(t),e)},m.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new p(t),e,r)},m.deflateRawSync=function(e,t){return r(new p(t),e)},m.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new l(t),e,r)},m.unzipSync=function(e,t){return r(new l(t),e)},m.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new c(t),e,r)},m.inflateSync=function(e,t){return r(new c(t),e)},m.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new f(t),e,r)},m.gunzipSync=function(e,t){return r(new f(t),e)},m.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new h(t),e,r)},m.inflateRawSync=function(e,t){return r(new h(t),e)},e.inherits(t,a),t.prototype.params=function(e,t,r){if(em.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=m.Z_FILTERED&&t!=m.Z_HUFFMAN_ONLY&&t!=m.Z_RLE&&t!=m.Z_FIXED&&t!=m.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var i=this;this.flush(o.Z_SYNC_FLUSH,function(){i._binding.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())})}else n.nextTick(r)},t.prototype.reset=function(){return this._binding.reset()},t.prototype._flush=function(e){this._transform(new g(0),"",e)},t.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=o.Z_FULL_FLUSH),r.ended)t&&n.nextTick(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var i=this;this.once("drain",function(){i.flush(t)})}else this._flushFlag=e,this.write(new g(0),"",t)},t.prototype.close=function(e){if(e&&n.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;n.nextTick(function(){t.emit("close")})}},t.prototype._transform=function(e,t,r){var i,n=this._writableState,a=(n.ending||n.ended)&&(!e||n.length===e.length);if(null===!e&&!g.isBuffer(e))return r(new Error("invalid input"));a?i=o.Z_FINISH:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH));this._processChunk(e,i,r)},t.prototype._processChunk=function(a,o,s){var c=a&&a.length,u=this._chunkSize-this._offset,f=0,p=this,h="function"==typeof s;if(!h){var t,l=[],d=0;this.on("error",function(e){t=e});do{var e=this._binding.writeSync(o,a,f,c,this._buffer,this._offset,u)}while(!this._hadError&&m(e[0],e[1]));if(this._hadError)throw t;var r=g.concat(l,d);return this.close(),r}var i=this._binding.write(o,a,f,c,this._buffer,this._offset,u);function m(e,t){if(!p._hadError){var r=u-t;if(v(0<=r,"have should not go down"),0=p._chunkSize)&&(u=p._chunkSize,p._offset=0,p._buffer=new g(p._chunkSize)),0===t){if(f+=c-e,c=e,!h)return!0;var n=p._binding.write(o,a,f,c,p._buffer,p._offset,p._chunkSize);return n.callback=m,void(n.buffer=a)}if(!h)return!1;s()}}i.buffer=a,i.callback=m},e.inherits(s,t),e.inherits(c,t),e.inherits(u,t),e.inherits(f,t),e.inherits(p,t),e.inherits(h,t),e.inherits(l,t)}).call(this,d("_process"),d("buffer").Buffer)},{"./binding":185,_process:382,_stream_transform:427,assert:67,buffer:191,util:505}],187:[function(e,t,r){arguments[4][157][0].apply(r,arguments)},{dup:157}],188:[function(e,B,C){(function(T){!function(e){var t="object"==(void 0===C?"undefined":_typeof(C))&&C&&!C.nodeType&&C,r="object"==(void 0===B?"undefined":_typeof(B))&&B&&!B.nodeType&&B,i="object"==(void 0===T?"undefined":_typeof(T))&&T;i.global!==i&&i.window!==i&&i.self!==i||(e=i);var n,a,v=2147483647,b=36,y=1,_=26,o=38,s=700,w=72,k=128,x="-",c=/^xn--/,u=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=b-y,S=Math.floor,j=String.fromCharCode;function E(e){throw new RangeError(p[e])}function l(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function d(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((v-d)/o))&&E("overflow"),d+=c*o,!(c<(u=s<=g?y:g+_<=s?_:s-g));s+=b)o>S(v/(f=b-u))&&E("overflow"),o*=f;g=O(d-a,t=h.length+1,0==a),S(d/t)>v-m&&E("overflow"),m+=S(d/t),d%=t,h.splice(d++,0,m)}return I(h)}function g(e){var t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g=[];for(h=(e=A(e)).length,t=k,a=w,o=r=0;oS((v-r)/(l=i+1))&&E("overflow"),r+=(s-t)*l,t=s,o=0;ov&&E("overflow"),p==t){for(c=r,u=b;!(c<(f=u<=a?y:a+_<=u?_:u-a));u+=b)m=c-f,d=b-f,g.push(j(P(f+m%d,0))),c=S(m/d);g.push(j(P(c,0))),a=O(r,l,i==n),r=0,++i}++r,++t}return g.join("")}if(n={version:"1.4.1",ucs2:{decode:A,encode:I},decode:m,encode:g,toASCII:function(e){return d(e,function(e){return u.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return d(e,function(e){return c.test(e)?m(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",function(){return n});else if(t&&r)if(B.exports==t)r.exports=n;else for(a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],189:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var a=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=c;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function c(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}a.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},a.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:191}],190:[function(e,t,r){(function(a){t.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new a(r),n=0;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function l(e,t){if(p.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return R(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=p.from(t,i)),p.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,n);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,n){var a,o=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;s/=o=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var f=-1;for(a=r;a>>10&1023|55296),f=56320|1023&f),i.push(f),n+=p}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;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 S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===p.compare(this,e)},p.prototype.inspect=function(){var e="",t=D.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,i,n){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(i,n),u=e.slice(t,r),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a,o,s,c,u,f,p,h,l,d=!1;;)switch(i){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return h=t,l=r,M(R(e,(p=this).length-h),p,h,l);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return c=this,u=t,f=r,M(z(e),c,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=t,s=r,M(function(e,t){for(var r,i,n,a=[],o=0;o>8,n=r%256,a.push(n),a.push(i);return a}(e,(a=this).length-o),a,o,s);default:if(d)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function k(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function I(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function P(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function O(e,t,r,i,n,a){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(e,t,r,i,n){return n||O(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function B(e,t,r,i,n){return n||O(e,0,r,8),a.write(e,t,r,i,52,8),r+8}p.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):I(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;0<=--a&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function z(e){return i.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function M(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":75,ieee754:318,isarray:323}],192:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],193:[function(e,t,r){function n(e){this.dict=e||{}}n.prototype.set=function(e,t,r){if("object"!==(void 0===e?"undefined":_typeof(e))){void 0===r&&(r=!0);var i=this.has(e);return!r&&i?this.dict[i]=this.dict[i]+","+t:this.dict[i||e]=t,i}for(var n in e)this.set(n,e[n],t)},n.prototype.has=function(e){for(var t=Object.keys(this.dict),r=(e=e.toLowerCase(),0);rr)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>8^255&n^99,u[r]=n;var a=e[f[n]=r],o=e[a],s=e[o],c=257*e[n]^16843008*n;p[r]=c<<24|c>>>8,h[r]=c<<16|c>>>16,l[r]=c<<8|c>>>24,d[r]=c;c=16843009*s^65537*o^257*a^16843008*r;m[n]=c<<24|c>>>8,g[n]=c<<16|c>>>16,v[n]=c<<8|c>>>24,b[n]=c,r?(r=a^e[e[e[s^a]]],i^=e[e[i]]):r=i=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],i=r.AES=t.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),n=this._keySchedule=[],a=0;a>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o]):(o=u[(o=o<<8|o>>>24)>>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o],o^=y[a/r|0]<<24),n[a]=n[a-r]^o}for(var s=this._invKeySchedule=[],c=0;c>>24]]^g[u[o>>>16&255]]^v[u[o>>>8&255]]^b[u[255&o]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,p,h,l,d,u)},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,m,g,v,b,f);r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,a,o,s){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],p=e[t+2]^r[2],h=e[t+3]^r[3],l=4,d=1;d>>24]^n[f>>>16&255]^a[p>>>8&255]^o[255&h]^r[l++],g=i[f>>>24]^n[p>>>16&255]^a[h>>>8&255]^o[255&u]^r[l++],v=i[p>>>24]^n[h>>>16&255]^a[u>>>8&255]^o[255&f]^r[l++],b=i[h>>>24]^n[u>>>16&255]^a[f>>>8&255]^o[255&p]^r[l++];u=m,f=g,p=v,h=b}m=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&h])^r[l++],g=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[h>>>8&255]<<8|s[255&u])^r[l++],v=(s[p>>>24]<<24|s[h>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^r[l++],b=(s[h>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^r[l++];e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=b},keySize:8});e.AES=t._createHelper(i)}(),n.AES},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],206:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,c,n,a,o,s,u,f,p,h,l,d,m,g,v,b;e.lib.Cipher||(r=(t=e).lib,i=r.Base,c=r.WordArray,n=r.BufferedBlockAlgorithm,(a=t.enc).Utf8,o=a.Base64,s=t.algo.EvpKDF,u=r.Cipher=n.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function n(e){return"string"==typeof e?b:g}return function(i){return{encrypt:function(e,t,r){return n(t).encrypt(i,e,t,r)},decrypt:function(e,t,r){return n(t).decrypt(i,e,t,r)}}}}()}),r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),f=t.mode={},p=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var e=p.extend();function a(e,t,r){var i=this._iv;if(i){var n=i;this._iv=void 0}else n=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:l}),reset:function(){u.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else{i=r.createDecryptor;this._minBufferSize=1}this._mode=i.call(r,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),d=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var i=c.create([1398893684,1701076831]).concat(r).concat(t);else i=t;return i.toString(o)},parse:function(e){var t=o.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var i=c.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return d.create({ciphertext:t,salt:i})}},g=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),a=n.finalize(t),o=n.cfg;return d.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.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}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=c.random(8));var n=s.create({keySize:t+r}).compute(e,i),a=c.create(n.words.slice(t),4*r);return n.sigBytes=4*t,d.create({key:n,iv:a,salt:i})}},b=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),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 a=g.encrypt.call(this,e,t,n.key,i);return a.mixIn(n),a},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,g.decrypt.call(this,e,t,n.key,i)}}))},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],207:[function(e,t,r){var i,n;i=this,n=function(){var f,r,e,t,i,p,n,a,o,s,c,u,h=h||(f=Math,r=Object.create||function(){function r(){}return function(e){var t;return r.prototype=e,t=new r,r.prototype=null,t}}(),t=(e={}).lib={},i=t.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$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)}},p=t.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).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 a=0;a>>2]>>>24-a%4*8&255;t[i+a>>>2]|=o<<24-(i+a)%4*8}else for(a=0;a>>2]=r[a>>>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=f.ceil(t/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,r=[],i=function(t){t=t;var r=987654321,i=4294967295;return function(){var e=((r=36969*(65535&r)+(r>>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return e/=4294967296,(e+=.5)*(.5>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).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 p.init(r,t/2)}},o=n.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(a))}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 p.init(r,t)}},s=n.Utf8={stringify:function(e){try{return decodeURIComponent(escape(o.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return o.parse(unescape(encodeURIComponent(e)))}},c=t.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=s.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,n=this.blockSize,a=i/(4*n),o=(a=e?f.ceil(a):f.max((0|a)-this._minBufferSize,0))*n,s=f.min(4*o,i);if(o){for(var c=0;c>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.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,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var n=0;n>>6-a%4*2;i[n>>>2]|=(o|s)<<24-n%4*8,n++}return c.create(i,n)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],209:[function(e,t,r){var i,n;i=this,n=function(r){return function(){var e=r,n=e.lib.WordArray,t=e.enc;t.Utf16=t.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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}};function o(e){return e<<8&4278255360|e>>>8&16711935}t.Utf16LE={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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return n.create(r,2*t)}}}(),r.enc.Utf16},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],210:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,f,n,a,o;return r=(t=e).lib,i=r.Base,f=r.WordArray,n=t.algo,a=n.MD5,o=n.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=r.hasher.create(),n=f.create(),a=n.words,o=r.keySize,s=r.iterations;a.lengthi&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),a=this._iKey=t.clone(),o=n.words,s=a.words,c=0;c>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)}).prototype=e}}(),t.lib.WordArray},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],215:[function(e,t,r){var i,n;i=this,n=function(o){return function(f){var e=o,t=e.lib,r=t.WordArray,i=t.Hasher,n=e.algo,E=[];!function(){for(var e=0;e<64;e++)E[e]=4294967296*f.abs(f.sin(e+1))|0}();var a=n.MD5=i.extend({_doReset:function(){this._hash=new r.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 a=this._hash.words,o=e[t+0],s=e[t+1],c=e[t+2],u=e[t+3],f=e[t+4],p=e[t+5],h=e[t+6],l=e[t+7],d=e[t+8],m=e[t+9],g=e[t+10],v=e[t+11],b=e[t+12],y=e[t+13],_=e[t+14],w=e[t+15],k=a[0],x=a[1],S=a[2],j=a[3];x=O(x=O(x=O(x=O(x=P(x=P(x=P(x=P(x=I(x=I(x=I(x=I(x=A(x=A(x=A(x=A(x,S=A(S,j=A(j,k=A(k,x,S,j,o,7,E[0]),x,S,s,12,E[1]),k,x,c,17,E[2]),j,k,u,22,E[3]),S=A(S,j=A(j,k=A(k,x,S,j,f,7,E[4]),x,S,p,12,E[5]),k,x,h,17,E[6]),j,k,l,22,E[7]),S=A(S,j=A(j,k=A(k,x,S,j,d,7,E[8]),x,S,m,12,E[9]),k,x,g,17,E[10]),j,k,v,22,E[11]),S=A(S,j=A(j,k=A(k,x,S,j,b,7,E[12]),x,S,y,12,E[13]),k,x,_,17,E[14]),j,k,w,22,E[15]),S=I(S,j=I(j,k=I(k,x,S,j,s,5,E[16]),x,S,h,9,E[17]),k,x,v,14,E[18]),j,k,o,20,E[19]),S=I(S,j=I(j,k=I(k,x,S,j,p,5,E[20]),x,S,g,9,E[21]),k,x,w,14,E[22]),j,k,f,20,E[23]),S=I(S,j=I(j,k=I(k,x,S,j,m,5,E[24]),x,S,_,9,E[25]),k,x,u,14,E[26]),j,k,d,20,E[27]),S=I(S,j=I(j,k=I(k,x,S,j,y,5,E[28]),x,S,c,9,E[29]),k,x,l,14,E[30]),j,k,b,20,E[31]),S=P(S,j=P(j,k=P(k,x,S,j,p,4,E[32]),x,S,d,11,E[33]),k,x,v,16,E[34]),j,k,_,23,E[35]),S=P(S,j=P(j,k=P(k,x,S,j,s,4,E[36]),x,S,f,11,E[37]),k,x,l,16,E[38]),j,k,g,23,E[39]),S=P(S,j=P(j,k=P(k,x,S,j,y,4,E[40]),x,S,o,11,E[41]),k,x,u,16,E[42]),j,k,h,23,E[43]),S=P(S,j=P(j,k=P(k,x,S,j,m,4,E[44]),x,S,b,11,E[45]),k,x,w,16,E[46]),j,k,c,23,E[47]),S=O(S,j=O(j,k=O(k,x,S,j,o,6,E[48]),x,S,l,10,E[49]),k,x,_,15,E[50]),j,k,p,21,E[51]),S=O(S,j=O(j,k=O(k,x,S,j,b,6,E[52]),x,S,u,10,E[53]),k,x,g,15,E[54]),j,k,s,21,E[55]),S=O(S,j=O(j,k=O(k,x,S,j,d,6,E[56]),x,S,w,10,E[57]),k,x,h,15,E[58]),j,k,y,21,E[59]),S=O(S,j=O(j,k=O(k,x,S,j,f,6,E[60]),x,S,v,10,E[61]),k,x,c,15,E[62]),j,k,m,21,E[63]),a[0]=a[0]+k|0,a[1]=a[1]+x|0,a[2]=a[2]+S|0,a[3]=a[3]+j|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var n=f.floor(r/4294967296),a=r;t[15+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,s=o.words,c=0;c<4;c++){var u=s[c];s[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function A(e,t,r,i,n,a,o){var s=e+(t&r|~t&i)+n+o;return(s<>>32-a)+t}function I(e,t,r,i,n,a,o){var s=e+(t&i|r&~i)+n+o;return(s<>>32-a)+t}function P(e,t,r,i,n,a,o){var s=e+(t^r^i)+n+o;return(s<>>32-a)+t}function O(e,t,r,i,n,a,o){var s=e+(r^(t|~i))+n+o;return(s<>>32-a)+t}e.MD5=i._createHelper(a),e.HmacMD5=i._createHmacHelper(a)}(Math),o.MD5},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],216:[function(e,t,r){var i,n;i=this,n=function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function a(e,t,r,i){var n=this._iv;if(n){var a=n.slice(0);this._iv=void 0}else a=this._prevBlock;i.encryptBlock(a,0);for(var o=0;o>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 t=e.Encryptor=e.extend({processBlock:function(e,t){var r,i=this._cipher,n=i.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),0===((r=o)[0]=u(r[0]))&&(r[1]=u(r[1]));var s=o.slice(0);i.encryptBlock(s,0);for(var c=0;c>>2]|=n<<24-a%4*8,e.sigBytes+=n},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],222:[function(e,t,r){var i,n;i=this,n=function(n){return n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],223:[function(e,t,r){var i,n;i=this,n=function(r){return r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],224:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],225:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],226:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,v,n,a,b,o;return r=(t=e).lib,i=r.Base,v=r.WordArray,n=t.algo,a=n.SHA1,b=n.HMAC,o=n.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=b.create(r.hasher,e),n=v.create(),a=v.create([1]),o=n.words,s=a.words,c=r.keySize,u=r.iterations;o.length>>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]],n=this._b=0;n<4;n++)h.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;i[0]^=c,i[1]^=f,i[2]^=u,i[3]^=p,i[4]^=c,i[5]^=f,i[6]^=u,i[7]^=p;for(n=0;n<4;n++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.RabbitLegacy=t._createHelper(i)}(),a.RabbitLegacy},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],228:[function(e,t,r){var i,n;i=this,n=function(a){return function(){var e=a,t=e.lib.StreamCipher,r=e.algo,n=[],c=[],u=[],i=r.Rabbit=t.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(r=this._b=0;r<4;r++)h.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;n[0]^=c,n[1]^=f,n[2]^=u,n[3]^=p,n[4]^=c,n[5]^=f,n[6]^=u,n[7]^=p;for(r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.Rabbit=t._createHelper(i)}(),a.Rabbit},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],229:[function(e,t,r){var i,n;i=this,n=function(o){return function(){var e=o,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.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 a=0;n<256;n++){var o=n%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+i[n]+s)%256;var c=i[n];i[n]=i[a],i[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=n.call(this)},keySize:8,ivSize:0});function n(){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 a=e[t];e[t]=e[r],e[r]=a,i|=e[(e[t]+e[r])%256]<<24-8*n}return this._i=t,this._j=r,i}e.RC4=t._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;0>>24)|4278255360&(n<<24|n>>>8)}var a,o,s,c,u,f,p,h,l,d,m,g=this._hash.words,v=A.words,b=I.words,y=x.words,_=S.words,w=j.words,k=E.words;f=a=g[0],p=o=g[1],h=s=g[2],l=c=g[3],d=u=g[4];for(r=0;r<80;r+=1)m=a+e[t+y[r]]|0,m+=r<16?P(o,s,c)+v[0]:r<32?O(o,s,c)+v[1]:r<48?T(o,s,c)+v[2]:r<64?B(o,s,c)+v[3]:C(o,s,c)+v[4],m=(m=F(m|=0,w[r]))+u|0,a=u,u=c,c=F(s,10),s=o,o=m,m=f+e[t+_[r]]|0,m+=r<16?C(p,h,l)+b[0]:r<32?B(p,h,l)+b[1]:r<48?T(p,h,l)+b[2]:r<64?O(p,h,l)+b[3]:P(p,h,l)+b[4],m=(m=F(m|=0,k[r]))+d|0,f=d,d=l,l=F(h,10),h=p,p=m;m=g[1]+s+l|0,g[1]=g[2]+c+d|0,g[2]=g[3]+u+f|0,g[3]=g[4]+a+p|0,g[4]=g[0]+o+h|0,g[0]=m},_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,a=n.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function P(e,t,r){return e^t^r}function O(e,t,r){return e&t|~e&r}function T(e,t,r){return(e|~t)^r}function B(e,t,r){return e&r|t&~r}function C(e,t,r){return e^(t|~r)}function F(e,t){return e<>>32-t}t.RIPEMD160=n._createHelper(o),t.HmacRIPEMD160=n._createHmacHelper(o)}(Math),s.RIPEMD160},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],231:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,p,o;return r=(t=e).lib,i=r.WordArray,n=r.Hasher,a=t.algo,p=[],o=a.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],a=r[2],o=r[3],s=r[4],c=0;c<80;c++){if(c<16)p[c]=0|e[t+c];else{var u=p[c-3]^p[c-8]^p[c-14]^p[c-16];p[c]=u<<1|u>>>31}var f=(i<<5|i>>>27)+s+p[c];f+=c<20?1518500249+(n&a|~n&o):c<40?1859775393+(n^a^o):c<60?(n&a|n&o|a&o)-1894007588:(n^a^o)-899497514,s=o,o=a,a=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|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(o),t.HmacSHA1=n._createHmacHelper(o),e.SHA1},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],232:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a;return r=(t=e).lib.WordArray,i=t.algo,n=i.SHA256,a=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(a),t.HmacSHA224=n._createHmacHelper(a),e.SHA224},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],n):n(i.CryptoJS)},{"./core":207,"./sha256":233}],233:[function(e,t,r){var i,n;i=this,n=function(c){return function(n){var e=c,t=e.lib,r=t.WordArray,i=t.Hasher,a=e.algo,o=[],y=[];!function(){function e(e){for(var t=n.sqrt(e),r=2;r<=t;r++)if(!(e%r))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(o[i]=t(n.pow(r,.5))),y[i]=t(n.pow(r,1/3)),i++),r++}();var _=[],s=a.SHA256=i.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=0;p<64;p++){if(p<16)_[p]=0|e[t+p];else{var h=_[p-15],l=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,d=_[p-2],m=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;_[p]=l+_[p-7]+m+_[p-16]}var g=i&n^i&a^n&a,v=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&u)+y[p]+_[p];f=u,u=c,c=s,s=o+b|0,o=a,a=n,n=i,i=b+(v+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+u|0,r[7]=r[7]+f|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)]=n.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA256=i._createHelper(s),e.HmacSHA256=i._createHmacHelper(s)}(Math),c.SHA256},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],234:[function(e,t,r){var i,n;i=this,n=function(a){return function(h){var e=a,t=e.lib,l=t.WordArray,i=t.Hasher,f=e.x64.Word,r=e.algo,P=[],O=[],T=[];!function(){for(var e=1,t=0,r=0;r<24;r++){P[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++)O[e+5*t]=t+(2*e+3*t)%5*5;for(var n=1,a=0;a<24;a++){for(var o=0,s=0,c=0;c<7;c++){if(1&n){var u=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(S=r[n]).high^=o,S.low^=a}for(var s=0;s<24;s++){for(var c=0;c<5;c++){for(var u=0,f=0,p=0;p<5;p++){u^=(S=r[c+5*p]).high,f^=S.low}var h=B[c];h.high=u,h.low=f}for(c=0;c<5;c++){var l=B[(c+4)%5],d=B[(c+1)%5],m=d.high,g=d.low;for(u=l.high^(m<<1|g>>>31),f=l.low^(g<<1|m>>>31),p=0;p<5;p++){(S=r[c+5*p]).high^=u,S.low^=f}}for(var v=1;v<25;v++){var b=(S=r[v]).high,y=S.low,_=P[v];if(_<32)u=b<<_|y>>>32-_,f=y<<_|b>>>32-_;else u=y<<_-32|b>>>64-_,f=b<<_-32|y>>>64-_;var w=B[O[v]];w.high=u,w.low=f}var k=B[0],x=r[0];k.high=x.high,k.low=x.low;for(c=0;c<5;c++)for(p=0;p<5;p++){var S=r[v=c+5*p],j=B[v],E=B[(c+1)%5+5*p],A=B[(c+2)%5+5*p];S.high=j.high^~E.high&A.high,S.low=j.low^~E.low&A.low}S=r[0];var I=T[s];S.high^=I.high,S.low^=I.low}},_doFinalize:function(){var e=this._data,t=e.words,r=(this._nDataBytes,8*e.sigBytes),i=32*this.blockSize;t[r>>>5]|=1<<24-r%32,t[(h.ceil((r+1)/i)*i>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();for(var n=this._state,a=this.cfg.outputLength/8,o=a/8,s=[],c=0;c>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),s.push(p),s.push(f)}return new l.init(s,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});e.SHA3=i._createHelper(n),e.HmacSHA3=i._createHmacHelper(n)}(Math),a.SHA3},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],235:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,o,s;return r=(t=e).x64,i=r.Word,n=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.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=o._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s),e.SHA384},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core"),e("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],n):n(i.CryptoJS)},{"./core":207,"./sha512":236,"./x64-core":238}],236:[function(e,t,r){var i,n;i=this,n=function(c){return function(){var e=c,t=e.lib.Hasher,r=e.x64,i=r.Word,n=r.WordArray,a=e.algo;function o(){return i.create.apply(i,arguments)}var xe=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],Se=[];!function(){for(var e=0;e<80;e++)Se[e]=o()}();var s=a.SHA512=t.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=i.high,h=i.low,l=n.high,d=n.low,m=a.high,g=a.low,v=o.high,b=o.low,y=s.high,_=s.low,w=c.high,k=c.low,x=u.high,S=u.low,j=f.high,E=f.low,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=w,D=k,N=x,q=S,L=j,U=E,H=0;H<80;H++){var K=Se[H];if(H<16)var V=K.high=0|e[t+2*H],G=K.low=0|e[t+2*H+1];else{var $=Se[H-15],W=$.high,Z=$.low,Y=(W>>>1|Z<<31)^(W>>>8|Z<<24)^W>>>7,X=(Z>>>1|W<<31)^(Z>>>8|W<<24)^(Z>>>7|W<<25),J=Se[H-2],Q=J.high,ee=J.low,te=(Q>>>19|ee<<13)^(Q<<3|ee>>>29)^Q>>>6,re=(ee>>>19|Q<<13)^(ee<<3|Q>>>29)^(ee>>>6|Q<<26),ie=Se[H-7],ne=ie.high,ae=ie.low,oe=Se[H-16],se=oe.high,ce=oe.low;V=(V=(V=Y+ne+((G=X+ae)>>>0>>0?1:0))+te+((G=G+re)>>>0>>0?1:0))+se+((G=G+ce)>>>0>>0?1:0);K.high=V,K.low=G}var ue,fe=R&M^~R&N,pe=z&D^~z&q,he=A&P^A&T^P&T,le=I&O^I&B^O&B,de=(A>>>28|I<<4)^(A<<30|I>>>2)^(A<<25|I>>>7),me=(I>>>28|A<<4)^(I<<30|A>>>2)^(I<<25|A>>>7),ge=(R>>>14|z<<18)^(R>>>18|z<<14)^(R<<23|z>>>9),ve=(z>>>14|R<<18)^(z>>>18|R<<14)^(z<<23|R>>>9),be=xe[H],ye=be.high,_e=be.low,we=L+ge+((ue=U+ve)>>>0>>0?1:0),ke=me+le;L=N,U=q,N=M,q=D,M=R,D=z,R=C+(we=(we=(we=we+fe+((ue=ue+pe)>>>0>>0?1:0))+ye+((ue=ue+_e)>>>0<_e>>>0?1:0))+V+((ue=ue+G)>>>0>>0?1:0))+((z=F+ue|0)>>>0>>0?1:0)|0,C=T,F=B,T=P,B=O,P=A,O=I,A=we+(de+he+(ke>>>0>>0?1:0))+((I=ue+ke|0)>>>0>>0?1:0)|0}h=i.low=h+I,i.high=p+A+(h>>>0>>0?1:0),d=n.low=d+O,n.high=l+P+(d>>>0>>0?1:0),g=a.low=g+B,a.high=m+T+(g>>>0>>0?1:0),b=o.low=b+F,o.high=v+C+(b>>>0>>0?1:0),_=s.low=_+z,s.high=y+R+(_>>>0>>0?1:0),k=c.low=k+D,c.high=w+M+(k>>>0>>0?1:0),S=u.low=S+q,u.high=x+N+(S>>>0>>0?1:0),E=f.low=E+U,f.high=j+L+(E>>>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=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(s),e.HmacSHA512=t._createHmacHelper(s)}(),c.SHA512},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],237:[function(e,t,r){var i,n;i=this,n=function(s){return function(){var e=s,t=e.lib,r=t.WordArray,i=t.BlockCipher,n=e.algo,u=[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],f=[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],p=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],a=n.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var i=u[r]-1;t[r]=e[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var o=n[a]=[],s=p[a];for(r=0;r<24;r++)o[r/6|0]|=t[(f[r]-1+s)%28]<<31-r%6,o[4+(r/6|0)]|=t[28+(f[r+24]-1+s)%28]<<31-r%6;o[0]=o[0]<<1|o[0]>>>31;for(r=1;r<7;r++)o[r]=o[r]>>>4*(r-1)+3;o[7]=o[7]<<5|o[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[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],d.call(this,4,252645135),d.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),d.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=h[c][((o^n[c])&l[c])>>>0];this._lBlock=o,this._rBlock=a^s}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,d.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(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<>>1];r=h.r28shl(r,a),i=h.r28shl(i,a),h.pc2(r,i,e.keys,n)}},c.prototype._update=function(e,t,r,i){var n=this._desState,a=h.readUInt32BE(e,t),o=h.readUInt32BE(e,t+4);h.ip(a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,o,n.tmp,0):this._decrypt(n,a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],h.writeUInt32BE(r,a,i),h.writeUInt32BE(r,o,i+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,a=p}h.rip(o,a,i,n)},c.prototype._decrypt=function(e,t,r,i,n){for(var a=r,o=t,s=e.keys.length-2;0<=s;s-=2){var c=e.keys[s],u=e.keys[s+1];h.expand(a,e.tmp,0),c^=e.tmp[0],u^=e.tmp[1];var f=h.substitute(c,u),p=a;a=(o^h.permute(f))>>>0,o=p}h.rip(a,o,i,n)}},{"../des":240,inherits:320,"minimalistic-assert":353}],244:[function(e,t,r){"use strict";var a=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),o=n.Cipher,s=n.DES;function c(e,t){a.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new c(this.type,this.options.key);this._edeState=t}i(u,o),(t.exports=u).create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":240,inherits:320,"minimalistic-assert":353}],245:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.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},r.ip=function(e,t,r,i){for(var n=0,a=0,o=6;0<=o;o-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+o&1}for(o=6;0<=o;o-=2){for(s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1;for(s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1}r[i+0]=n>>>0,r[i+1]=a>>>0},r.rip=function(e,t,r,i){for(var n=0,a=0,o=0;o<4;o++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+o&1,n<<=1,n|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;0<=s;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.pc1=function(e,t,r,i){for(var n=0,a=0,o=7;5<=o;o--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.r28shl=function(e,t){return e<>>28-t};var c=[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];r.pc2=function(e,t,r,i){for(var n=0,a=0,o=c.length>>>1,s=0;s>>c[s]&1;for(s=o;s>>c[s]&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var a=23;15<=a;a-=4)i<<=6,i|=e>>>a&63;for(a=11;3<=a;a-=4)n|=e>>>a&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[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];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[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];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(c),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;r.mod(p).cmp(h);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(i=r.shrn(1))&&g(r)&&v(i)&&v(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":154,"miller-rabin":349,randombytes:414}],249:[function(e,t,r){t.exports={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"}}},{}],250:[function(e,t,r){var u=e("crypto"),f=e("jsbn").BigInteger,p=(e("./lib/ec.js").ECPointFp,e("safer-buffer").Buffer);function h(e,t){return e.length>=t?e:h("0"+e,t)}r.ECCurves=e("./lib/sec.js"),r.ECKey=function(e,t,r){var i,n=e(),a=n.getN(),o=Math.floor(a.bitLength()/8);if(t)if(r){e=n.getCurve();this.P=e.decodePointHex(t.toString("hex"))}else{if(t.length!=o)return!1;i=new f(t.toString("hex"),16)}else{var s=a.subtract(f.ONE),c=new f(u.randomBytes(a.bitLength()));i=c.mod(s).add(f.ONE),this.P=n.getG().multiply(i)}this.P&&(this.PublicKey=p.from(n.getCurve().encodeCompressedPointHex(this.P),"hex")),i&&(this.PrivateKey=p.from(h(i.toString(16),2*o),"hex"),this.deriveSharedSecret=function(e){if(!e||!e.P)return!1;var t=e.P.multiply(i);return p.from(h(t.getX().toBigInteger().toString(16),2*o),"hex")})}},{"./lib/ec.js":251,"./lib/sec.js":252,crypto:204,jsbn:325,"safer-buffer":448}],251:[function(e,t,r){var l=e("jsbn").BigInteger,i=l.prototype.Barrett;function f(e,t){this.x=t,this.q=e}function d(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=null==i?l.ONE:i,this.zinv=null}function n(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new d(this,null,null),this.reducer=new i(this.q)}f.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},f.prototype.toBigInteger=function(){return this.x},f.prototype.negate=function(){return new f(this.q,this.x.negate().mod(this.q))},f.prototype.add=function(e){return new f(this.q,this.x.add(e.toBigInteger()).mod(this.q))},f.prototype.subtract=function(e){return new f(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},f.prototype.multiply=function(e){return new f(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},f.prototype.square=function(){return new f(this.q,this.x.square().mod(this.q))},f.prototype.divide=function(e){return new f(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},d.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO))},d.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(l.ZERO)&&!this.y.toBigInteger().equals(l.ZERO)},d.prototype.negate=function(){return new d(this.curve,this.x,this.y.negate(),this.z)},d.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(l.ZERO.equals(r))return l.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new l("3"),n=this.x.toBigInteger(),a=this.y.toBigInteger(),o=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),s=o.multiply(r),c=n.multiply(o),u=t.square().multiply(this.z),f=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(s).multiply(r).mod(this.curve.q),p=c.multiply(i).multiply(t).subtract(a.multiply(s)).subtract(u.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),h=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(p),h)},d.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new l("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),n=i.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),o=t.square().multiply(e);l.ZERO.equals(a)||(o=o.add(this.z.square().multiply(a)));var s=(o=o.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(i).mod(this.curve.q),c=o.multiply(e).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(o.square().multiply(o)).mod(this.curve.q),u=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(c),u)},d.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new l("3")),n=this.negate(),a=this;for(t=i.bitLength()-2;0r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var n=this.curve.getInfinity(),a=this.add(t);0<=i;)n=n.twice(),e.testBit(i)?n=r.testBit(i)?n.add(a):n.add(this):r.testBit(i)&&(n=n.add(t)),--i;return n},n.prototype.getQ=function(){return this.q},n.prototype.getA=function(){return this.a},n.prototype.getB=function(){return this.b},n.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},n.prototype.getInfinity=function(){return this.infinity},n.prototype.fromBigInteger=function(e){return new f(this.q,e)},n.prototype.reduce=function(e){this.reducer.reduce(e)},n.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;t.lengtht+1;){var r=e.shiftRight(t),i=e.subtract(r.shiftLeft(t));this.getR().equals(l.ONE)||(r=r.multiply(this.getR())),e=r.add(i)}for(;0<=e.compareTo(q);)e=e.subtract(q)}else e=e.mod(q);return e},f.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var e=new f(this.q,this.x.modPow(this.q.shiftRight(2).add(l.ONE),this.q));return e.square().equals(this)?e:null}var t=this.q.subtract(l.ONE),r=t.shiftRight(1);if(!this.x.modPow(r,this.q).equals(l.ONE))return null;var i,n,a=t.shiftRight(2).shiftLeft(1).add(l.ONE),o=this.x,s=modDouble(modDouble(o));do{for(var c;0<=(c=new l(this.q.bitLength(),new SecureRandom)).compareTo(this.q)||!c.multiply(c).subtract(s).modPow(r,this.q).equals(t););var u=this.lucasSequence(c,o,a);if(i=u[0],n=u[1],this.modMult(n,n).equals(s))return n.testBit(0)&&(n=n.add(q)),n=n.shiftRight(1),new f(q,n)}while(i.equals(l.ONE)||i.equals(t));return null},f.prototype.lucasSequence=function(e,t,r){for(var i=r.bitLength(),n=r.getLowestSetBit(),a=l.ONE,o=l.TWO,s=e,c=l.ONE,u=l.ONE,f=i-1;n+1<=f;--f)c=this.modMult(c,u),r.testBit(f)?(u=this.modMult(c,t),a=this.modMult(a,s),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1)))):(u=c,a=this.modReduce(a.multiply(o).subtract(c)),s=this.modReduce(s.multiply(o).subtract(e.multiply(c))),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))));c=this.modMult(c,u),u=this.modMult(c,t),a=this.modReduce(a.multiply(o).subtract(c)),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),c=this.modMult(c,u);for(f=1;f<=n;++f)a=this.modMult(a,o),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))),c=this.modMult(c,c);return[a,o]};r={ECCurveFp:n,ECPointFp:d,ECFieldElementFp:f};t.exports=r},{jsbn:325}],252:[function(e,t,r){var o=e("jsbn").BigInteger,s=e("./ec.js").ECCurveFp;function c(e,t,r,i){this.curve=e,this.g=t,this.n=r,this.h=i}function u(e){return new o(e,16)}function i(){var e=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),r=u("E87579C11079F43DD824993C2CEE5ED3"),i=u("FFFFFFFE0000000075A30D1B9038A115"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83"),i,n)}function n(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=o.ZERO,r=u("7"),i=u("0100000000000000000001B8FA16DFAB9ACA16B6B3"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE"),i,n)}function a(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),r=u("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),i=u("0100000000000000000001F4C8F927AED3CA752257"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32"),i,n)}function f(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=o.ZERO,r=u("3"),i=u("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"),i,n)}function p(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),r=u("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),i=u("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811"),i,n)}function h(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),r=u("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),i=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"),i,n)}function l(){var e=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),r=u("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),i=u("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),i,n)}c.prototype.getCurve=function(){return this.curve},c.prototype.getG=function(){return this.g},c.prototype.getN=function(){return this.n},c.prototype.getH=function(){return this.h},t.exports={secp128r1:i,secp160k1:n,secp160r1:a,secp192k1:f,secp192r1:p,secp224r1:h,secp256r1:l}},{"./ec.js":251,jsbn:325}],253:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":268,"./elliptic/curve":256,"./elliptic/curves":259,"./elliptic/ec":260,"./elliptic/eddsa":263,"./elliptic/utils":267,brorand:156}],254:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,j=n.getNAF,E=n.getJSF,p=n.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i,n){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,c=0,u=0;u>1]:S<0&&(x=o[g][-S-1>>1].neg()),y="affine"===x.type?y.mixedAdd(x):y.add(x))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},o.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.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),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],256:[function(e,t,r){arguments[4][130][0].apply(r,arguments)},{"./base":254,"./edwards":255,"./mont":257,"./short":258,dup:130}],257:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base,s=e("../../elliptic").utils;function c(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(c,o),(t.exports=c).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)},a(u,o.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},c.prototype.point=function(e,t){return new u(this,e,t)},c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.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)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},u.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 a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],258:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new w(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)},c.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)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],259:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":253,"./precomputed/secp256k1":266,"hash.js":299}],260:[function(e,t,r){"use strict";var g=e("bn.js"),v=e("hmac-drbg"),a=e("../../elliptic"),l=a.utils.assert,i=e("./key"),b=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(l(a.curves.hasOwnProperty(e),"Unknown curve "+e),e=a.curves[e]),e instanceof a.curves.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}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new v({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new g(2));;){var n=new g(t.generate(r));if(!(0>1;if(0<=o.cmp(this.curve.p.umod(this.curve.n))&&u)throw new Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var f=t.r.invm(n),p=n.sub(a).mul(f).umod(n),h=s.mul(f).umod(n);return this.g.mulAdd(p,o,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new b(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":253,"./key":261,"./signature":262,"bn.js":154,"hmac-drbg":311}],261:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=a).fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},{"../../elliptic":253,"bn.js":154}],262:[function(e,t,r){"use strict";var s=e("bn.js"),c=e("../../elliptic").utils,i=c.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=c.toArray(e,t);var r=new u;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=f(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=f(e,r);if(e.length!==a+r.place)return!1;var o=e.slice(r.place,a+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===o[0]&&128&o[1]&&(o=o.slice(1)),this.r=new s(n),this.s=new s(o),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];p(i,t.length),(i=i.concat(t)).push(2),p(i,r.length);var n=i.concat(r),a=[48];return p(a,n.length),a=a.concat(n),c.encode(a,e)}},{"../../elliptic":253,"bn.js":154}],263:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),a=n.utils,o=a.assert,c=a.parseBytes,s=e("./key"),u=e("./signature");function f(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=f).prototype.sign=function(e,t){e=c(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),a=this.encodePoint(n),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:a})},f.prototype.verify=function(e,t,r){e=c(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(a)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=6.0.0 <7.0.0",_id:"elliptic@6.4.1",_inCache:!0,_installable:!0,_location:"/elliptic",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/elliptic_6.4.1_1533787091502_0.6309761823717674"},_npmUser:{email:"fedor@indutny.com",name:"indutny"},_npmVersion:"6.3.0",_phantomChildren:{},_requested:{name:"elliptic",raw:"elliptic@^6.0.0",rawSpec:"^6.0.0",scope:null,spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/home/giacof/Download/javascript-opentimestamps/node_modules/browserify-sign",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{fileCount:17,integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJba7vUCRA9TVsSAnZWagAA+gcP/jWaj5GmDZ0YFi/X4g5O\nx+pxu9i3HbP9YqywT7rz3XFXSaytu0LQDeDEbddl523X69tsbKfzHRTcnW8n\n2r0VjPhttRm+0RpEhBwjSIK34VkQA1xIWh2ugOToKXVCFVLM5VFDPGzbiN6x\n/hpL7gj1hoCRVmuhjnqFQ+vPKACKfv1Eq4CsRmu2focmP37kQpWQlweD/z4V\nJF4NxA33Fvp13Fl+9g4sPHyhUVsW9ojVaG3Ijn70pCaGQM18UPlbODkWQ1QX\nAgteOFjkIOtcalJk3B3qsM8GZeHEcAFvt2T73miJkHdCGNmRQS45Ede+gnj0\nlLlZJsCCKUHtTqrlprHo6AgMnBZufmytyozYAHC1/JYniazSBi2yPHtQeniR\nl69BfiRBdD2rNrMPwmCNRkMqrgel5WMGpaD0xdaFAHF1Ru2ZQFKsA7KvPGgp\nA20+LN11cCib67Pg5XDyrZ92T3yXec+6gQ3iq9d9UBZKFGl0P8ebVqq1LrUJ\na6nekwMpRISWnKcqV72XVmQdBmUWHq9VfVLsWJzVIJqtpHmUO7q74ACP3i4W\n0/F1REeI0YEhh3NjeStdDecfjlu7PY0pLQpbk2I3ms+6DO+cAfeDEev5jFBK\nwQabRNhITeT1FVtxZAcApj33fnCdqwaWr1NS00K5ZRqhDTTzPr/O4KRN4CR1\npstU\r\n=UVBB\r\n-----END PGP SIGNATURE-----\r\n",shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",unpackedSize:118371},files:["lib"],gitHead:"523da1cf71ddcfd607fbdee1858bc2af47f0e700",homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.1"}},{}],269:[function(e,t,r){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function c(e){return"function"==typeof e}function u(e){return"object"===(void 0===e?"undefined":_typeof(e))&&null!==e}function f(e){return void 0===e}((t.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},i.prototype.emit=function(e){var t,r,i,n,a,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(f(r=this._events[e]))return!1;if(c(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=Array.prototype.slice.call(arguments,1),r.apply(this,n)}else if(u(r))for(n=Array.prototype.slice.call(arguments,1),i=(o=r.slice()).length,a=0;ar&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!c(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,a;if(!c(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||c(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(r)){for(a=n;0=this._blockSize;){for(var n=this._blockOffset;n=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=n.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,a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":310}],310:[function(e,t,r){"use strict";var u=e("minimalistic-assert"),i=e("inherits");function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function o(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}r.inherits=i,r.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:320,"minimalistic-assert":353}],311:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),i=o.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length1e3*t.clockSkew)throw new E("clock skew of "+g/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach(function(e){if(u.params.headers.indexOf(e.toLowerCase())<0)throw new P(e+" was not a signed header")}),t.algorithms&&-1===t.algorithms.indexOf(u.params.algorithm))throw new I(u.params.algorithm+" is not a supported algorithm");return u.algorithm=u.params.algorithm.toUpperCase(),u.keyId=u.params.keyId,u}}},{"./utils":315,"assert-plus":66,util:505}],314:[function(n,a,e){(function(l){var d=n("assert-plus"),m=n("crypto"),e=(n("http"),n("util")),g=n("sshpk"),v=n("jsprim"),t=n("./utils"),b=n("util").format,y=t.HASH_ALGOS,_=t.PK_ALGOS,w=t.InvalidAlgorithmError,r=t.HttpSignatureError,k=t.validateAlgorithm,x='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';function S(e){r.call(this,e,S)}function j(e){r.call(this,e,j)}function i(e){d.object(e,"options");var t=[];if(void 0!==e.algorithm&&(d.string(e.algorithm,"options.algorithm"),t=k(e.algorithm)),this.rs_alg=t,void 0!==e.sign)d.func(e.sign,"options.sign"),this.rs_signFunc=e.sign;else if("hmac"===t[0]&&void 0!==e.key){if(d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,"string"!=typeof e.key&&!l.isBuffer(e.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=m.createHmac(t[1].toUpperCase(),e.key),this.rs_signer.sign=function(){var e=this.digest("base64");return{hashAlgorithm:t[1],toString:function(){return e}}}}else{if(void 0===e.key)throw new TypeError("options.sign (func) or options.key is required");var r=e.key;if(("string"==typeof r||l.isBuffer(r))&&(r=g.parsePrivateKey(r)),d.ok(g.PrivateKey.isPrivateKey(r,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=r,d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,!_[r.type])throw new w(r.type.toUpperCase()+" type keys are not supported");if(void 0!==t[0]&&r.type!==t[0])throw new w("options.key must be a "+t[0].toUpperCase()+" key, was given a "+r.type.toUpperCase()+" key instead");this.rs_signer=r.createSign(t[1])}this.rs_headers=[],this.rs_lines=[]}e.inherits(S,r),e.inherits(j,r),i.prototype.writeHeader=function(e,t){if(d.string(e,"header"),e=e.toLowerCase(),d.string(t,"value"),this.rs_headers.push(e),this.rs_signFunc)this.rs_lines.push(e+": "+t);else{var r=e+": "+t;0>1,f=-7,p=r?n-1:0,h=r?-1:1,l=e[t+p];for(p+=h,a=l&(1<<-f)-1,l>>=-f,f+=s;0>=-f,f+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:a-1,d=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),2<=(t+=1<=o+p?h/c:h*Math.pow(2,1-p))*c&&(o++,c/=2),f<=o+p?(s=0,o=f):1<=o+p?(s=(t*c-1)*Math.pow(2,n),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,n),o=0));8<=n;e[r+l]=255&s,l+=d,s/=256,n-=8);for(o=o<>15;0<=--a;){var c=32767&this[e],u=this[e++]>>15,f=s*c+u*o;n=((c=o*c+((32767&f)<<15)+r[i]+(1073741823&n))>>>30)+(f>>>15)+s*u+(n>>>30),r[i++]=1073741823&c}return n},30):t&&"Netscape"!=navigator.appName?(y.prototype.am=function(e,t,r,i,n,a){for(;0<=--a;){var o=t*this[e++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},26):(y.prototype.am=function(e,t,r,i,n,a){for(var o=16383&t,s=t>>14;0<=--a;){var c=16383&this[e],u=this[e++]>>14,f=s*c+u*o;n=((c=o*c+((16383&f)<<14)+r[i]+n)>>28)+(f>>14)+s*u,r[i++]=268435455&c}return n},28),y.prototype.DB=e,y.prototype.DM=(1<>>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 v(e){this.m=e}function b(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 l(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function d(){}function m(e){return e}function k(e){this.r2=_(),this.q3=_(),y.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},b.prototype.convert=function(e){var t=_();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&0>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),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},b.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.copyTo=function(e){for(var t=this.t-1;0<=t;--t)e[t]=this[t];e.t=this.t,e.s=this.s},y.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0this.DB?(this[this.t-1]|=(o&(1<>this.DB-a):this[this.t-1]|=o<=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,0>n|s,s=(this[r]&a)<=this.t)t.t=0;else{var i=e%this.DB,n=this.DB-i,a=(1<>i;for(var o=r+1;o>i;0>=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:0=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}0>this.F2:0),h=this.FV/p,l=(1<>s)&&(n=!0,a=c(r));0<=o;)s>(s+=this.DB-t)):(r=this[o]>>(s-=t)&i,s<=0&&(s+=this.DB,--o)),02*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=_();return e.copyTo(t),this.reduce(t),t},k.prototype.revert=function(e){return e},k.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);0<=e.compareTo(this.m);)e.subTo(this.m,e)},k.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},k.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x,S,j,E=[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],A=(1<<26)/E[E.length-1];function I(){var e;e=(new Date).getTime(),S[j++]^=255&e,S[j++]^=e>>8&255,S[j++]^=e>>16&255,S[j++]^=e>>24&255,R<=j&&(j-=R)}if(y.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},y.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||36=r&&(this.dMultiply(i),this.dAddOffset(o,0),o=a=0))}0e&&this.subTo(y.ONE.shiftLeft(e-1),this);else{var i=new Array,n=7&e;i.length=1+(e>>3),t.nextBytes(i),0>=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,0=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},y.prototype.multiplyLowerTo=function(e,t,r){var i,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;0>1)>E.length&&(e=E.length);for(var n=_(),a=0;a>24},y.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},y.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},y.prototype.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(0>i)!=(this.s&this.DM)>>i&&(t[n++]=r|this.s<>(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,(0=this.t?0!=this.s:0!=(this[t]&1<>n-c&u:(p=(e[l]&(1<>this.DB+n-c)),s=r;0==(1&p);)p>>=1,--s;if((n-=s)<0&&(n+=this.DB,--l),d)o[p].copyTo(a),d=!1;else{for(;1>>8,S[j++]=255&P;j=0,I()}function B(){if(null==x){for(I(),(x=new F).init(S),j=0;jt.maxItems&&n("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&m.concat(function(e,t,r,i){if("object"==(void 0===t?"undefined":_typeof(t)))for(var n in("object"!=(void 0===e?"undefined":_typeof(e))||e instanceof Array)&&m.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(n)){var a=e[n];if(void 0===a&&h.existingOnly)continue;var o=t[n];void 0===a&&o.default&&(a=e[n]=o.default),h.coerce&&n in e&&(a=e[n]=h.coerce(a,o)),g(a,o,r,n)}for(n in e){if(e.hasOwnProperty(n)&&("_"!=n.charAt(0)||"_"!=n.charAt(1))&&t&&!t[n]&&!1===i){if(h.filter){delete e[n];continue}m.push({property:r,message:(void 0===a?"undefined":_typeof(a))+"The property "+n+" is not defined in the schema and the schema does not allow additional properties"})}var s=t&&t[n]&&t[n].requires;!s||s in e||m.push({property:r,message:"the presence of the property "+n+" requires that "+s+" also be present"}),a=e[n],!i||t&&"object"==(void 0===t?"undefined":_typeof(t))&&n in t||(h.coerce&&(a=e[n]=h.coerce(a,i)),g(a,i,r,n)),!l&&a&&a.$schema&&(m=m.concat(g(a,a.$schema,r,n)))}return m}(e,t.properties,o,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&n("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&n("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.lengthe&&n("must have a minimum value of "+t.minimum),void 0!==_typeof(t.maximum)&&(void 0===e?"undefined":_typeof(e))==_typeof(t.maximum)&&t.maximum= 2"),d.ok(n.base<=36,"options.base <= 36"),d.bool(n.allowSign,"options.allowSign"),d.bool(n.allowPrefix,"options.allowPrefix"),d.bool(n.allowTrailing,"options.allowTrailing"),d.bool(n.allowImprecise,"options.allowImprecise"),d.bool(n.trimWhitespace,"options.trimWhitespace"),d.bool(n.leadingZeroIsOctal,"options.leadingZeroIsOctal"),n.leadingZeroIsOctal&&d.ok(!i,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var a,o=-1,s=n.base,c=1,u=0,f=0,p=e.length;if(n.trimWhitespace)for(;ft[0]||e[0]==t[0]&&e[1]>=t[1],"negative differences not allowed");var r=[e[0]-t[0],0];return e[1]>=t[1]?r[1]=e[1]-t[1]:(r[0]--,r[1]=1e9-(t[1]-e[1])),r}function R(e,t){return C(e),C(t),e[1]+=t[1],1e9<=e[1]&&(e[0]++,e[1]-=1e9),e[0]+=t[0],e}function z(e,t,r){var i,n;if(i={},r)for(n in r)i[n]=r[n];if(e)for(n in e)i[n]=e[n];if(t)for(n in t)i[n]=t[n];return i}},{"assert-plus":66,extsprintf:272,"json-schema":327,util:505,verror:509}],330:[function(e,t,r){"use strict";t.exports=e("./lib/api")(e("./lib/keccak"))},{"./lib/api":331,"./lib/keccak":335}],331:[function(e,t,r){"use strict";var n=e("./keccak"),a=e("./shake");t.exports=function(e){var r=n(e),i=a(e);return function(e,t){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new r(1152,448,null,224,t);case"keccak256":return new r(1088,512,null,256,t);case"keccak384":return new r(832,768,null,384,t);case"keccak512":return new r(576,1024,null,512,t);case"sha3-224":return new r(1152,448,6,224,t);case"sha3-256":return new r(1088,512,6,256,t);case"sha3-384":return new r(832,768,6,384,t);case"sha3-512":return new r(576,1024,6,512,t);case"shake128":return new i(1344,256,31,t);case"shake256":return new i(1088,512,31,t);default:throw new Error("Invald algorithm: "+e)}}}},{"./keccak":332,"./shake":333}],332:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,o=e("stream").Transform,n=e("inherits");t.exports=function(a){function t(e,t,r,i,n){o.call(this,n),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._hashBitLength=i,this._options=n,this._state=new a,this._state.initialize(e,t),this._finalized=!1}return n(t,o),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],333:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("stream").Transform,o=e("inherits");t.exports=function(n){function t(e,t,r,i){a.call(this,i),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._options=i,this._state=new n,this._state.initialize(e,t),this._finalized=!1}return o(t,a),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],334:[function(e,t,r){"use strict";var ot=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];r.p1600=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],n=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],h=f^(n<<1|a>>>31),l=p^(a<<1|n>>>31),d=e[0]^h,m=e[1]^l,g=e[10]^h,v=e[11]^l,b=e[20]^h,y=e[21]^l,_=e[30]^h,w=e[31]^l,k=e[40]^h,x=e[41]^l;h=r^(o<<1|s>>>31),l=i^(s<<1|o>>>31);var S=e[2]^h,j=e[3]^l,E=e[12]^h,A=e[13]^l,I=e[22]^h,P=e[23]^l,O=e[32]^h,T=e[33]^l,B=e[42]^h,C=e[43]^l;h=n^(c<<1|u>>>31),l=a^(u<<1|c>>>31);var F=e[4]^h,R=e[5]^l,z=e[14]^h,M=e[15]^l,D=e[24]^h,N=e[25]^l,q=e[34]^h,L=e[35]^l,U=e[44]^h,H=e[45]^l;h=o^(f<<1|p>>>31),l=s^(p<<1|f>>>31);var K=e[6]^h,V=e[7]^l,G=e[16]^h,$=e[17]^l,W=e[26]^h,Z=e[27]^l,Y=e[36]^h,X=e[37]^l,J=e[46]^h,Q=e[47]^l;h=c^(r<<1|i>>>31),l=u^(i<<1|r>>>31);var ee=e[8]^h,te=e[9]^l,re=e[18]^h,ie=e[19]^l,ne=e[28]^h,ae=e[29]^l,oe=e[38]^h,se=e[39]^l,ce=e[48]^h,ue=e[49]^l,fe=d,pe=m,he=v<<4|g>>>28,le=g<<4|v>>>28,de=b<<3|y>>>29,me=y<<3|b>>>29,ge=w<<9|_>>>23,ve=_<<9|w>>>23,be=k<<18|x>>>14,ye=x<<18|k>>>14,_e=S<<1|j>>>31,we=j<<1|S>>>31,ke=A<<12|E>>>20,xe=E<<12|A>>>20,Se=I<<10|P>>>22,je=P<<10|I>>>22,Ee=T<<13|O>>>19,Ae=O<<13|T>>>19,Ie=B<<2|C>>>30,Pe=C<<2|B>>>30,Oe=R<<30|F>>>2,Te=F<<30|R>>>2,Be=z<<6|M>>>26,Ce=M<<6|z>>>26,Fe=N<<11|D>>>21,Re=D<<11|N>>>21,ze=q<<15|L>>>17,Me=L<<15|q>>>17,De=H<<29|U>>>3,Ne=U<<29|H>>>3,qe=K<<28|V>>>4,Le=V<<28|K>>>4,Ue=$<<23|G>>>9,He=G<<23|$>>>9,Ke=W<<25|Z>>>7,Ve=Z<<25|W>>>7,Ge=Y<<21|X>>>11,$e=X<<21|Y>>>11,We=Q<<24|J>>>8,Ze=J<<24|Q>>>8,Ye=ee<<27|te>>>5,Xe=te<<27|ee>>>5,Je=re<<20|ie>>>12,Qe=ie<<20|re>>>12,et=ae<<7|ne>>>25,tt=ne<<7|ae>>>25,rt=oe<<8|se>>>24,it=se<<8|oe>>>24,nt=ce<<14|ue>>>18,at=ue<<14|ce>>>18;e[0]=fe^~ke&Fe,e[1]=pe^~xe&Re,e[10]=qe^~Je&de,e[11]=Le^~Qe&me,e[20]=_e^~Be&Ke,e[21]=we^~Ce&Ve,e[30]=Ye^~he&Se,e[31]=Xe^~le&je,e[40]=Oe^~Ue&et,e[41]=Te^~He&tt,e[2]=ke^~Fe&Ge,e[3]=xe^~Re&$e,e[12]=Je^~de&Ee,e[13]=Qe^~me&Ae,e[22]=Be^~Ke&rt,e[23]=Ce^~Ve&it,e[32]=he^~Se&ze,e[33]=le^~je&Me,e[42]=Ue^~et&ge,e[43]=He^~tt&ve,e[4]=Fe^~Ge&nt,e[5]=Re^~$e&at,e[14]=de^~Ee&De,e[15]=me^~Ae&Ne,e[24]=Ke^~rt&be,e[25]=Ve^~it&ye,e[34]=Se^~ze&We,e[35]=je^~Me&Ze,e[44]=et^~ge&Ie,e[45]=tt^~ve&Pe,e[6]=Ge^~nt&fe,e[7]=$e^~at&pe,e[16]=Ee^~De&qe,e[17]=Ae^~Ne&Le,e[26]=rt^~be&_e,e[27]=it^~ye&we,e[36]=ze^~We&Ye,e[37]=Me^~Ze&Xe,e[46]=ge^~Ie&Oe,e[47]=ve^~Pe&Te,e[8]=nt^~fe&ke,e[9]=at^~pe&xe,e[18]=De^~qe&Je,e[19]=Ne^~Le&Qe,e[28]=be^~_e&Be,e[29]=ye^~we&Ce,e[38]=We^~Ye&he,e[39]=Ze^~Xe&le,e[48]=Ie^~Oe&Ue,e[49]=Pe^~Te&He,e[0]^=ot[2*t],e[1]^=ot[2*t+1]}}},{}],335:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=e("./keccak-state-unroll");function a(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}a.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},a.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},a.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},t.exports=a},{"./keccak-state-unroll":334,"safe-buffer":447}],336:[function(e,t,r){var i=e("./_root").Symbol;t.exports=i},{"./_root":341}],337:[function(e,t,r){var i=e("./_Symbol"),n=e("./_getRawTag"),a=e("./_objectToString"),o=i?i.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},{"./_Symbol":336,"./_getRawTag":339,"./_objectToString":340}],338:[function(e,r,t){(function(e){var t="object"==(void 0===e?"undefined":_typeof(e))&&e&&e.Object===Object&&e;r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],339:[function(e,t,r){var i=e("./_Symbol"),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,s=i?i.toStringTag:void 0;t.exports=function(e){var t=a.call(e,s),r=e[s];try{var i=!(e[s]=void 0)}catch(e){}var n=o.call(e);return i&&(t?e[s]=r:delete e[s]),n}},{"./_Symbol":336}],340:[function(e,t,r){var i=Object.prototype.toString;t.exports=function(e){return i.call(e)}},{}],341:[function(e,t,r){var i=e("./_freeGlobal"),n="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,a=i||n||Function("return this")();t.exports=a},{"./_freeGlobal":338}],342:[function(e,t,r){var i=Array.isArray;t.exports=i},{}],343:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isObject");t.exports=function(e){if(!n(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},{"./_baseGetTag":337,"./isObject":344}],344:[function(e,t,r){t.exports=function(e){var t=void 0===e?"undefined":_typeof(e);return null!=e&&("object"==t||"function"==t)}},{}],345:[function(e,t,r){t.exports=function(e){return null!=e&&"object"==(void 0===e?"undefined":_typeof(e))}},{}],346:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isArray"),a=e("./isObjectLike");t.exports=function(e){return"string"==typeof e||!n(e)&&a(e)&&"[object String]"==i(e)}},{"./_baseGetTag":337,"./isArray":342,"./isObjectLike":345}],347:[function(e,t,r){t.exports=function(e){return void 0===e}},{}],348:[function(e,t,r){"use strict";var i=e("inherits"),n=e("hash-base"),a=e("safe-buffer").Buffer,o=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,r,i,n,a,o){return c(e+(t&r|~t&i)+n+a|0,o)+t|0}function f(e,t,r,i,n,a,o){return c(e+(t&i|r&~i)+n+a|0,o)+t|0}function p(e,t,r,i,n,a,o){return c(e+(t^r^i)+n+a|0,o)+t|0}function h(e,t,r,i,n,a,o){return c(e+(r^(t|~i))+n+a|0,o)+t|0}i(s,n),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,a=this._d;i=h(i=h(i=h(i=h(i=p(i=p(i=p(i=p(i=f(i=f(i=f(i=f(i=u(i=u(i=u(i=u(i,n=u(n,a=u(a,r=u(r,i,n,a,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),a,r,e[3],3250441966,22),n=u(n,a=u(a,r=u(r,i,n,a,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),a,r,e[7],4249261313,22),n=u(n,a=u(a,r=u(r,i,n,a,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),a,r,e[11],2304563134,22),n=u(n,a=u(a,r=u(r,i,n,a,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),a,r,e[15],1236535329,22),n=f(n,a=f(a,r=f(r,i,n,a,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),a,r,e[0],3921069994,20),n=f(n,a=f(a,r=f(r,i,n,a,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),a,r,e[4],3889429448,20),n=f(n,a=f(a,r=f(r,i,n,a,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),a,r,e[8],1163531501,20),n=f(n,a=f(a,r=f(r,i,n,a,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),a,r,e[12],2368359562,20),n=p(n,a=p(a,r=p(r,i,n,a,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),a,r,e[14],4259657740,23),n=p(n,a=p(a,r=p(r,i,n,a,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),a,r,e[10],3200236656,23),n=p(n,a=p(a,r=p(r,i,n,a,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),a,r,e[6],76029189,23),n=p(n,a=p(a,r=p(r,i,n,a,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),a,r,e[2],3299628645,23),n=h(n,a=h(a,r=h(r,i,n,a,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),a,r,e[5],4237533241,21),n=h(n,a=h(a,r=h(r,i,n,a,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),a,r,e[1],2240044497,21),n=h(n,a=h(a,r=h(r,i,n,a,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),a,r,e[13],1309151649,21),n=h(n,a=h(a,r=h(r,i,n,a,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),a,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+a|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e}},{}],355:[function(e,t,r){(t.exports=o).Minimatch=n;var u={sep:"/"};try{u=e("path")}catch(e){}var z=o.GLOBSTAR=n.GLOBSTAR={},i=e("brace-expansion"),M={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},D="[^/]*?",N="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{});var f=/\/+/;function a(t,r){t=t||{},r=r||{};var i={};return Object.keys(r).forEach(function(e){i[e]=r[e]}),Object.keys(t).forEach(function(e){i[e]=t[e]}),i}function o(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new n(t,r).match(e))}function n(e,t){if(!(this instanceof n))return new n(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==u.sep&&(e=e.split(u.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function s(e,t){if(t||(t=this instanceof n?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:i(e)}o.filter=function(i,n){return n=n||{},function(e,t,r){return o(e,i,n)}},o.defaults=function(i){if(!i||!Object.keys(i).length)return o;var n=o,e=function(e,t,r){return n.minimatch(e,t,a(i,r))};return e.Minimatch=function(e,t){return new n.Minimatch(e,a(i,t))},e},n.defaults=function(e){return e&&Object.keys(e).length?o.defaults(e).Minimatch:n},n.prototype.debug=function(){},n.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(f)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r},n.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=this.options,i=0;if(r.nonegate)return;for(var n=0,a=e.length;n>> no match, partial?",e,p,t,h),p!==o))}if("string"==typeof u?(c=i.nocase?f.toLowerCase()===u.toLowerCase():f===u,this.debug("string match",u,f,c)):(c=f.match(u),this.debug("pattern match",u,f,c)),!c)return!1}if(n===o&&a===s)return!0;if(n===o)return r;if(a===s)return n===o-1&&""===e[n];throw new Error("wtf?")}},{"brace-expansion":155,path:374}],356:[function(e,t,r){var c=e("crypto");function o(e,t,r){return c.createHmac(r,e).update(t).digest("base64")}function s(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function n(e,t){return t>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var n=s,a=i+r;e^=-1;for(var o=i;o>>8^n[255&(e^t[o])];return-1^e}},{}],362:[function(e,t,r){"use strict";var c,h=e("../utils/common"),u=e("./trees"),l=e("./adler32"),d=e("./crc32"),i=e("./messages"),f=0,p=4,m=0,g=-2,v=-1,b=4,n=2,y=8,_=9,a=286,o=30,s=19,w=2*a+1,k=15,x=3,S=258,j=S+x+1,E=42,A=113,I=1,P=2,O=3,T=4;function B(e,t){return e.msg=i[t],t}function C(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(h.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function z(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,R(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function D(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function N(e,t){var r,i,n=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-j?e.strstart-(e.w_size-j):0,u=e.window,f=e.w_mask,p=e.prev,h=e.strstart+S,l=u[a+o-1],d=u[a+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===d&&u[r+o-1]===l&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ac&&0!=--n);return o<=e.lookahead?o:e.lookahead}function q(e){var t,r,i,n,a,o,s,c,u,f,p=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-j)){for(h.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;i=e.head[--t],e.head[t]=p<=i?i-p:0,--r;);for(t=r=p;i=e.prev[--t],e.prev[t]=p<=i?i-p:0,--r;);n+=p}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,c=e.strstart+e.lookahead,u=n,f=void 0,f=o.avail_in,u=x)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(i=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(n=e.strstart+e.lookahead-x,i=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=n&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(q(e),0===e.lookahead&&t===f)return I;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,z(e,!1),0===e.strm.avail_out))return I;if(e.strstart-e.block_start>=e.w_size-j&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):(e.strstart>e.block_start&&(z(e,!1),e.strm.avail_out),I)}),new H(4,4,8,4,L),new H(4,5,16,8,L),new H(4,6,32,32,L),new H(4,4,16,16,U),new H(8,16,32,32,U),new H(8,16,128,128,U),new H(8,32,128,256,U),new H(32,128,258,1024,U),new H(32,258,258,4096,U)],r.deflateInit=function(e,t){return $(e,t,y,15,8,0)},r.deflateInit2=$,r.deflateReset=G,r.deflateResetKeep=V,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,m):g},r.deflate=function(e,t){var r,i,n,a;if(!e||!e.state||5>8&255),M(i,i.gzhead.time>>16&255),M(i,i.gzhead.time>>24&255),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(M(i,255&i.gzhead.extra.length),M(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=d(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(M(i,0),M(i,0),M(i,0),M(i,0),M(i,0),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,3),i.status=A);else{var o=y+(i.w_bits-8<<4)<<8;o|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(o|=32),o+=31-o%31,i.status=A,D(i,o),0!==i.strstart&&(D(i,e.adler>>>16),D(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending!==i.pending_buf_size));)M(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&R(e),i.pending+2<=i.pending_buf_size&&(M(i,255&e.adler),M(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(R(e),0===e.avail_out)return i.last_flush=-1,m}else if(0===e.avail_in&&C(t)<=C(r)&&t!==p)return B(e,-5);if(666===i.status&&0!==e.avail_in)return B(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==f&&666!==i.status){var s=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(q(e),0===e.lookahead)){if(t===f)return I;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):3===i.strategy?function(e,t){for(var r,i,n,a,o=e.window;;){if(e.lookahead<=S){if(q(e),e.lookahead<=S&&t===f)return I;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):c[i.level].func(i,t);if(s!==O&&s!==T||(i.status=666),s===I||s===O)return 0===e.avail_out&&(i.last_flush=-1),m;if(s===P&&(1===t?u._tr_align(i):5!==t&&(u._tr_stored_block(i,0,0,!1),3===t&&(F(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),R(e),0===e.avail_out))return i.last_flush=-1,m}return t!==p?m:i.wrap<=0?1:(2===i.wrap?(M(i,255&e.adler),M(i,e.adler>>8&255),M(i,e.adler>>16&255),M(i,e.adler>>24&255),M(i,255&e.total_in),M(i,e.total_in>>8&255),M(i,e.total_in>>16&255),M(i,e.total_in>>24&255)):(D(i,e.adler>>>16),D(i,65535&e.adler)),R(e),0=r.w_size&&(0===a&&(F(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new h.Buf8(r.w_size),h.arraySet(u,t,f-r.w_size,r.w_size,0),t=u,f=r.w_size),o=e.avail_in,s=e.next_in,c=e.input,e.avail_in=f,e.next_in=0,e.input=t,q(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=_=y>>>24,d-=_,0===(_=y>>>16&255))E[a++]=65535&y;else{if(!(16&_)){if(0==(64&_)){y=m[(65535&y)+(l&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&y,(_&=15)&&(d<_&&(l+=j[i++]<>>=_,d-=_),d<15&&(l+=j[i++]<>>=_=y>>>24,d-=_,!(16&(_=y>>>16&255))){if(0==(64&_)){y=g[(65535&y)+(l&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&y,d<(_&=15)&&(l+=j[i++]<>>=_,d-=_,(_=a-o)>3,l&=(1<<(d-=w<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new P.Buf16(320),this.work=new P.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=D,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new P.Buf32(i),t.distcode=t.distdyn=new P.Buf32(n),t.sane=1,t.back=-1,z):M}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):M}function c(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=a.wsize?(P.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(n=a.wsize-a.wnext)&&(n=i),P.arraySet(a.window,t,r-i,n,a.wnext),(i-=n)?(P.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=T(r.check,A,2,0),f=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(f-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=3;case 3:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>8&255,A[2]=u>>>16&255,A[3]=u>>>24&255,r.check=T(r.check,A,4,0)),f=u=0,r.mode=4;case 4:for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>8),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>>8&255,r.check=T(r.check,A,2,0)),f=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(s<(l=r.length)&&(l=s),l&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),P.arraySet(r.head.extra,i,a,l,k)),512&r.flags&&(r.check=T(r.check,i,l,a)),s-=l,a+=l,r.length-=l),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;for(l=0;k=i[a+l++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&l>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>=7&f,f-=7&f,r.mode=27;break}for(;f<3;){if(0===s)break e;s--,u+=i[a++]<>>=1)){case 0:r.mode=14;break;case 1:if(q(r),r.mode=20,6!==t)break;u>>>=2,f-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,f-=2;break;case 14:for(u>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,u+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,f=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(l=r.length){if(s>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,286>>=3,f-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=C(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=g,f-=g,r.lens[r.have++]=b;else{if(16===b){for(j=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],l=3+(3&u),u>>>=2,f-=2}else if(17===b){for(j=g+3;f>>=g)),u>>>=3,f-=3}else{for(j=g+7;f>>=g)),u>>>=7,f-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;l--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=C(F,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=C(R,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=s&&258<=c){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,r.hold=u,r.bits=f,B(e,h),o=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,u=r.hold,f=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;v=(E=r.lencode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,r.length=b,0===v){r.mode=26;break}if(32&v){r.back=-1,r.mode=12;break}if(64&v){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&v,r.mode=22;case 22:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=(E=r.distcode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&v,r.mode=24;case 24:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===c)break e;if(l=h-c,r.offset>l){if((l=r.offset-l)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d=l>r.wnext?(l-=r.wnext,r.wsize-l):r.wnext-l,l>r.length&&(l=r.length),m=r.window}else m=n,d=o-r.offset,l=r.length;for(cl?(m=B[C+o[y]],I[P+o[y]]):(m=96,0),c=1<>S)+(u-=c)]=d<<24|m<<16|g|0,0!==u;);for(c=1<>=1;if(0!==c?(A&=c-1,A+=c):A=0,y++,0==--O[b]){if(b===w)break;b=t[r+o[y]]}if(k>>7)]}function M(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function D(e,t,r){e.bi_valid>n-r?(e.bi_buf|=t<>n-e.bi_valid,e.bi_valid+=r-n):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function L(e,t,r){var i,n,a=new Array(v+1),o=0;for(i=1;i<=v;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=q(a[s]++,s))}}function U(e){var t;for(t=0;t>1;1<=r;r--)V(e,a,r);for(n=c;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],V(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,a[2*n]=a[2*r]+a[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,a[2*r+1]=a[2*i+1]=n,e.heap[1]=n++,V(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,n,a,o,s,c=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,p=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(a=0;a<=v;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return s;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return u;for(t=32;t>>3,(a=e.static_len+3+7>>>3)<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==t?X(e,t,r,i):4===e.strategy||a===n?(D(e,2+(i?1:0),3),G(e,E,A)):(D(e,4+(i?1:0),3),function(e,t,r,i){var n;for(D(e,t-257,5),D(e,r-1,5),D(e,i-4,4),n=0;n>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(P[r]+p+1)]++,e.dyn_dtree[2*z(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;D(e,2,3),N(e,b,E),16===(t=e).bi_valid?(M(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":358}],368:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],369:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],370:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var a=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=a;var o=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=o;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var f=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=f,r.DSAparam=i.define("DSAparam",function(){this.int()});var p=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=p;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":371,"asn1.js":46}],371:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),a=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(a)}),u=i.define("RDNSequence",function(){this.seqof(c)}),f=i.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),p=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(f),this.key("validity").use(p),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),d=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=d},{"asn1.js":46}],372:[function(e,t,r){(function(h){var l=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,d=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m,m=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,g=e("evp_bytestokey"),v=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(l);if(n){var a="aes"+n[1],o=new h(n[2],"hex"),s=new h(n[3].replace(/[\r\n]/g,""),"base64"),c=g(t,o.slice(0,8),parseInt(n[1],10)).key,u=[],f=v.createDecipheriv(a,c,o);u.push(f.update(s)),u.push(f.final()),r=h.concat(u)}else{var p=i.match(m);r=new h(p[2].replace(/[\r\n]/g,""),"base64")}return{tag:i.match(d)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":160,buffer:191,evp_bytestokey:270}],373:[function(t,r,e){(function(b){var y=t("./asn1"),_=t("./aesid.json"),w=t("./fixProc"),k=t("browserify-aes"),x=t("pbkdf2");function e(e){var t;"object"!==(void 0===e?"undefined":_typeof(e))||b.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new b(e));var r,i,n,a,o,s,c,u,f,p,h,l,d,m=w(e,t),g=m.tag,v=m.data;switch(g){case"CERTIFICATE":i=y.certificate.decode(v,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=y.PublicKey.decode(v,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=y.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"ENCRYPTED PRIVATE KEY":v=y.EncryptedPrivateKey.decode(v,"der"),a=t,o=(n=v).algorithm.decrypt.kde.kdeparams.salt,s=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=_[n.algorithm.decrypt.cipher.algo.join(".")],u=n.algorithm.decrypt.cipher.iv,f=n.subjectPrivateKey,p=parseInt(c.split("-")[1],10)/8,h=x.pbkdf2Sync(a,o,s,p),l=k.createDecipheriv(c,h,u),(d=[]).push(l.update(f)),d.push(l.final()),v=b.concat(d);case"PRIVATE KEY":switch(r=(i=y.PrivateKey.decode(v,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:y.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=y.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"RSA PUBLIC KEY":return y.RSAPublicKey.decode(v,"der");case"RSA PRIVATE KEY":return y.RSAPrivateKey.decode(v,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:y.DSAPrivateKey.decode(v,"der")};case"EC PRIVATE KEY":return{curve:(v=y.ECPrivateKey.decode(v,"der")).parameters.value,privateKey:v.privateKey};default:throw new Error("unknown key type "+g)}}(r.exports=e).signature=y.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":369,"./asn1":370,"./fixProc":372,"browserify-aes":160,buffer:191,pbkdf2:375}],374:[function(e,t,u){(function(n){function a(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function o(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;ia?t=n(t):t.length "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+o+";","var res;","switch (argLength) {",r.concat(["extra"]).map(function(e,t){return"case "+t+":res = fn.call("+["self"].concat(r.slice(0,t)).concat("cb").join(",")+");break;"}).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],n)(a,e)}(e)};var o="function (err, res) {if (err) { rj(err); } else { rs(res); }}";a.nodeify=function(r){return function(){var e=Array.prototype.slice.call(arguments),t="function"==typeof e[e.length-1]?e.pop():null,i=this;try{return r.apply(this,arguments).nodeify(t,i)}catch(r){if(null==t)return new a(function(e,t){t(r)});n(function(){t.call(i,r)})}}},a.prototype.nodeify=function(t,r){if("function"!=typeof t)return this;this.then(function(e){n(function(){t.call(r,null,e)})},function(e){n(function(){t.call(r,e)})})}},{"./core.js":384,asap:44}],390:[function(e,t,r){"use strict";var i=e("./core.js");(t.exports=i).enableSynchronous=function(){i.prototype.isPending=function(){return 0==this.getState()},i.prototype.isFulfilled=function(){return 1==this.getState()},i.prototype.isRejected=function(){return 2==this.getState()},i.prototype.getValue=function(){if(3===this._65)return this._55.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._55},i.prototype.getReason=function(){if(3===this._65)return this._55.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._55},i.prototype.getState=function(){return 3===this._65?this._55.getState():-1===this._65||-2===this._65?0:this._65}},i.disableSynchronous=function(){i.prototype.isPending=void 0,i.prototype.isFulfilled=void 0,i.prototype.isRejected=void 0,i.prototype.getValue=void 0,i.prototype.getReason=void 0,i.prototype.getState=void 0}},{"./core.js":384}],391:[function(e,t,r){"use strict";var n=function(e){for(var t=e.toString(16);4!==t.length;)t="0"+t;return"\\u"+t};t.exports=function(e,t,r,i){return!r.key||61!==t&&58!==t&&t!==r.separator?31o||0<=new u(t).cmp(a.modulus))throw new Error("decryption error");n=r?d(new u(t),a):h(t,a);var s=m.alloc(o-n.length);if(n=m.concat([s,n],o),4===i)return function(e,t){var r=e.modulus.byteLength(),i=l("sha1").update(m.alloc(0)).digest(),n=i.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,n+1),o=t.slice(n+1),s=p(a,f(o,n)),c=p(o,f(s,r-n-1));if(function(e,t){e=m.from(e),t=m.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){a++;break}var o=t.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&a++;o.length<8&&a++;if(a)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}},{"./mgf":401,"./withPublic":404,"./xor":405,"bn.js":154,"browserify-rsa":178,"create-hash":200,"parse-asn1":373,"safe-buffer":447}],403:[function(e,t,r){var o=e("parse-asn1"),h=e("randombytes"),l=e("create-hash"),d=e("./mgf"),m=e("./xor"),g=e("bn.js"),s=e("./withPublic"),c=e("browserify-rsa"),v=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,a=o(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=l("sha1").update(v.alloc(0)).digest(),a=n.length,o=2*a;if(r-o-2>6]+a[128|63&n]:n<55296||57344<=n?r+=a[224|n>>12]+a[128|n>>6&63]+a[128|63&n]:(i+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),r+=a[240|n>>18]+a[128|n>>12&63]+a[128|n>>6&63]+a[128|63&n])}return r},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function i(r,n,a){if(!n)return r;if("object"!==(void 0===n?"undefined":_typeof(n))){if(Array.isArray(r))r.push(n);else{if("object"!==(void 0===r?"undefined":_typeof(r)))return[r,n];(a.plainObjects||a.allowPrototypes||!o.call(Object.prototype,n))&&(r[n]=!0)}return r}if("object"!==(void 0===r?"undefined":_typeof(r)))return[r].concat(n);var e=r;return Array.isArray(r)&&!Array.isArray(n)&&(e=s(r,a)),Array.isArray(r)&&Array.isArray(n)?(n.forEach(function(e,t){o.call(r,t)?r[t]&&"object"===_typeof(r[t])?r[t]=i(r[t],e,a):r.push(e):r[t]=e}),r):Object.keys(n).reduce(function(e,t){var r=n[t];return o.call(e,t)?e[t]=i(e[t],r,a):e[t]=r,e},e)}}},{}],411:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var a=/\+/g;e=e.split(t);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var s,c,u=e.length;0t.highWaterMark&&(t.highWaterMark=(m<=(r=e)?r=m:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(_("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?v.nextTick(x,e):x(e))}function x(e){_("emit readable"),e.emit("readable"),I(e)}function S(e,t){t.readingMore||(t.readingMore=!0,v.nextTick(j,e,t))}function j(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;ea.length?a.length:e;if(o===a.length?n+=a:n+=a.slice(0,e),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=a.slice(o);break}++i}return t.length-=i,n}(e,t):function(e,t){var r=u.allocUnsafe(e),i=t.head,n=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i).data=a.slice(o);break}++n}return t.length-=n,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return _("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):k(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,n=t.needReadable;return _("need readable",n),(0===t.length||t.length-e>>0),a=this.head,o=0;a;)t=a.data,r=n,i=o,t.copy(r,i),o+=a.data.length,a=a.next;return n},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":447,util:157}],423:[function(e,t,r){"use strict";var a=e("process-nextick-args");function o(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a.nextTick(o,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(o,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":381}],424:[function(e,t,r){t.exports=e("events").EventEmitter},{events:269}],425:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":426}],426:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":417,"./lib/_stream_passthrough.js":418,"./lib/_stream_readable.js":419,"./lib/_stream_transform.js":420,"./lib/_stream_writable.js":421}],427:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":426}],428:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":421}],429:[function(e,t,r){"use strict";var s=e("../"),c=e("lodash/isArray"),u=e("lodash/isFunction"),f=e("lodash/isObjectLike");t.exports=function(e){var t="Please verify options";if(!f(e))throw new TypeError(t);if(!u(e.request))throw new TypeError(t+".request");if(!c(e.expose)||0===e.expose.length)throw new TypeError(t+".expose");for(var r=s({PromiseImpl:e.PromiseImpl,constructorMixin:e.constructorMixin}),i=e.request.Request.prototype.init,n=!(e.request.Request.prototype.init=function(e){return!f(e)||this._callback||this._rp_promise||r.init.call(this,e),i.apply(this,arguments)}),a=0;a=t.maxRedirects)return r.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+r.uri.href)),!1;t.redirectsFollowed+=1,o.test(i)||(i=a.resolve(r.uri.href,i));var n=r.uri;return r.uri=a.parse(i),r.uri.protocol!==n.protocol&&delete r.agent,t.redirects.push({statusCode:e.statusCode,redirectUri:i}),t.followAllRedirects&&"HEAD"!==r.method&&401!==e.statusCode&&307!==e.statusCode&&(r.method=t.followOriginalHttpMethod?r.method:"GET"),delete r.src,delete r.req,delete r._started,401!==e.statusCode&&307!==e.statusCode&&(delete r.body,delete r._form,r.headers&&(r.removeHeader("host"),r.removeHeader("content-type"),r.removeHeader("content-length"),r.uri.hostname!==r.originalHost.split(":")[0]&&r.removeHeader("authorization"))),t.removeRefererHeader||r.setHeader("referer",n.href),r.emit("redirect"),r.init(),!0},r.Redirect=i},{url:500}],444:[function(e,t,r){"use strict";var w=e("url"),k=e("tunnel-agent"),i=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],x=["proxy-authorization"];function n(e){this.request=e,this.proxyHeaderWhiteList=i,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}n.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},n.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=w.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,i,n,a,o,s,c=this.proxyHeaderExclusiveList.concat(x),u=this.proxyHeaderWhiteList.concat(c),f=(r=t.headers,i=u.reduce(function(e,t){return e[t.toLowerCase()]=!0,e},{}),Object.keys(r).filter(function(e){return i[e.toLowerCase()]}).reduce(function(e,t){return e[t]=r[t],e},{}));f.host=(n=t.uri,a=n.port,o=n.protocol,s=n.hostname+":",s+=a||("https:"===o?"443":"80")),c.forEach(t.removeHeader,t);var p,h,l,d,m,g,v,b,y=(l=(p=t).uri,d=p.proxy,h=d,m=["https:"===l.protocol?"https":"http","https:"===h.protocol?"Https":"Http"].join("Over"),k[m]),_=(v=f,{proxy:{host:(b=(g=t).proxy).hostname,port:+b.port,proxyAuth:b.auth,headers:v},headers:g.headers,ca:g.ca,cert:g.cert,key:g.key,passphrase:g.passphrase,pfx:g.pfx,ciphers:g.ciphers,rejectUnauthorized:g.rejectUnauthorized,secureOptions:g.secureOptions,secureProtocol:g.secureProtocol});return t.agent=y(_),!0},n.defaultProxyHeaderWhiteList=i,n.defaultProxyHeaderExclusiveList=x,r.Tunnel=n},{"tunnel-agent":497,url:500}],445:[function(U,H,e){(function(e){"use strict";var w=U("http"),k=U("https"),x=U("url"),t=U("util"),n=U("stream"),f=U("zlib"),c=U("aws-sign2"),u=U("aws4"),i=U("http-signature"),S=U("mime-types"),j=U("caseless"),E=U("forever-agent"),r=U("form-data"),a=U("extend"),A=U("isstream"),I=U("is-typedarray").strict,o=U("./lib/helpers"),s=U("./lib/cookies"),P=U("./lib/getProxyFromURI"),p=U("./lib/querystring").Querystring,h=U("./lib/har").Har,l=U("./lib/auth").Auth,d=U("./lib/oauth").OAuth,m=U("./lib/hawk"),g=U("./lib/multipart").Multipart,v=U("./lib/redirect").Redirect,b=U("./lib/tunnel").Tunnel,y=U("performance-now"),O=U("safe-buffer").Buffer,_=o.safeStringify,T=o.isReadStream,B=o.toBase64,C=o.defer,F=o.copy,R=o.version,z=s.jar(),M={};function D(){return{uri:this.uri,method:this.method,headers:this.headers}}function N(){return{statusCode:this.statusCode,body:this.body,headers:this.headers,request:D.call(this.request)}}function q(e){var t=this;e.har&&(t._har=new h(t),e=t._har.options(e)),n.Stream.call(t);var r=Object.keys(q.prototype),i=function(e,t){var r={};for(var i in t)-1===e.indexOf(i)&&(r[i]=t[i]);return r}(r,e);a(t,i),e=function(e,t){var r={};for(var i in t){var n=!(-1===e.indexOf(i)),a="function"==typeof t[i];n&&a||(r[i]=t[i])}return r}(r,e),t.readable=!0,t.writable=!0,e.method&&(t.explicitMethod=!0),t._qs=new p(t),t._auth=new l(t),t._oauth=new d(t),t._multipart=new g(t),t._redirect=new v(t),t._tunnel=new b(t),t.init(e)}function L(){q.debug&&console.error("REQUEST %s",t.format.apply(t,arguments))}t.inherits(q,n.Stream),q.debug=e.env.NODE_DEBUG&&/\brequest\b/.test(e.env.NODE_DEBUG),q.prototype.debug=L,q.prototype.init=function(e){var i=this;for(var t in e||(e={}),i.headers=i.headers?F(i.headers):{},i.headers)void 0===i.headers[t]&&delete i.headers[t];if(j.httpify(i,i.headers),i.method||(i.method=e.method||"GET"),i.localAddress||(i.localAddress=e.localAddress),i._qs.init(e),L(e),i.pool||!1===i.pool||(i.pool=M),i.dests=i.dests||[],i.__isRequestRequest=!0,!i._callback&&i.callback&&(i._callback=i.callback,i.callback=function(){i._callbackCalled||(i._callbackCalled=!0,i._callback.apply(i,arguments))},i.on("error",i.callback.bind()),i.on("complete",i.callback.bind(i,null))),!i.uri&&i.url&&(i.uri=i.url,delete i.url),i.baseUrl){if("string"!=typeof i.baseUrl)return i.emit("error",new Error("options.baseUrl must be a string"));if("string"!=typeof i.uri)return i.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(0===i.uri.indexOf("//")||-1!==i.uri.indexOf("://"))return i.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var r=i.baseUrl.lastIndexOf("/")===i.baseUrl.length-1,n=0===i.uri.indexOf("/");r&&n?i.uri=i.baseUrl+i.uri.slice(1):r||n?i.uri=i.baseUrl+i.uri:""===i.uri?i.uri=i.baseUrl:i.uri=i.baseUrl+"/"+i.uri,delete i.baseUrl}if(!i.uri)return i.emit("error",new Error("options.uri is a required argument"));if("string"==typeof i.uri&&(i.uri=x.parse(i.uri)),i.uri.href||(i.uri.href=x.format(i.uri)),"unix:"===i.uri.protocol)return i.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if("unix"===i.uri.host&&i.enableUnixSocket(),!1===i.strictSSL&&(i.rejectUnauthorized=!1),i.uri.pathname||(i.uri.pathname="/"),!(i.uri.host||i.uri.hostname&&i.uri.port||i.uri.isUnix)){var a='Invalid URI "'+x.format(i.uri)+'"';return 0===Object.keys(e).length&&(a+=". This can be caused by a crappy redirection."),i.abort(),i.emit("error",new Error(a))}if(i.hasOwnProperty("proxy")||(i.proxy=P(i.uri)),i.tunnel=i._tunnel.isEnabled(),i.proxy&&i._tunnel.setup(e),i._redirect.onRequest(e),i.setHost=!1,!i.hasHeader("host")){var o=i.originalHostHeaderName||"host";i.setHeader(o,i.uri.host),i.uri.port&&("80"===i.uri.port&&"http:"===i.uri.protocol||"443"===i.uri.port&&"https:"===i.uri.protocol)&&i.setHeader(o,i.uri.hostname),i.setHost=!0}if(i.jar(i._jar||e.jar),i.uri.port||("http:"===i.uri.protocol?i.uri.port=80:"https:"===i.uri.protocol&&(i.uri.port=443)),i.proxy&&!i.tunnel?(i.port=i.proxy.port,i.host=i.proxy.hostname):(i.port=i.uri.port,i.host=i.uri.hostname),e.form&&i.form(e.form),e.formData){var s=e.formData,c=i.form(),u=function(e,t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?c.append(e,t.value,t.options):c.append(e,t)};for(var f in s)if(s.hasOwnProperty(f)){var p=s[f];if(p instanceof Array)for(var h=0;h>>32-t}function S(e,t,r,i,n,a,o,s){return x(e+(t^r^i)+a+o|0,s)+n|0}function j(e,t,r,i,n,a,o,s){return x(e+(t&r|~t&i)+a+o|0,s)+n|0}function E(e,t,r,i,n,a,o,s){return x(e+((t|~r)^i)+a+o|0,s)+n|0}function A(e,t,r,i,n,a,o,s){return x(e+(t&i|r&~i)+a+o|0,s)+n|0}function I(e,t,r,i,n,a,o,s){return x(e+(t^(r|~i))+a+o|0,s)+n|0}n(o,a),o.prototype._update=function(){for(var e=g,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,a=0|this._d,o=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,f=0|this._d,p=0|this._e,h=0;h<80;h+=1){var l,d;d=h<16?(l=S(r,i,n,a,o,e[v[h]],w[0],y[h]),I(s,c,u,f,p,e[b[h]],k[0],_[h])):h<32?(l=j(r,i,n,a,o,e[v[h]],w[1],y[h]),A(s,c,u,f,p,e[b[h]],k[1],_[h])):h<48?(l=E(r,i,n,a,o,e[v[h]],w[2],y[h]),E(s,c,u,f,p,e[b[h]],k[2],_[h])):h<64?(l=A(r,i,n,a,o,e[v[h]],w[3],y[h]),j(s,c,u,f,p,e[b[h]],k[3],_[h])):(l=I(r,i,n,a,o,e[v[h]],w[4],y[h]),S(s,c,u,f,p,e[b[h]],k[4],_[h])),r=o,o=a,a=x(n,10),n=i,i=l,s=p,p=f,f=x(u,10),u=c,c=d}var m=this._b+n+f|0;this._b=this._c+a+p|0,this._c=this._d+o+s|0,this._d=this._e+r+c|0,this._e=this._a+i+u|0,this._a=m},o.prototype._digest=function(){this._block[this._blockOffset++]=128,56=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 a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":447}],450:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":451,"./sha1":452,"./sha224":453,"./sha256":454,"./sha384":455,"./sha512":456}],451:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,v=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s=this._w,c=0|this._a,u=0|this._b,f=0|this._c,p=0|this._d,h=0|this._e,l=0;l<16;++l)s[l]=e.readInt32BE(4*l);for(;l<80;++l)s[l]=s[l-3]^s[l-8]^s[l-14]^s[l-16];for(var d=0;d<80;++d){var m=~~(d/20),g=0|((o=c)<<5|o>>>27)+(i=u,n=f,a=p,0===(r=m)?i&n|~i&a:2===r?i&n|i&a|n&a:i^n^a)+h+s[d]+v[m];h=p,p=f,f=(t=u)<<30|t>>>2,u=c,c=g}this._a=c+this._a|0,this._b=u+this._b|0,this._c=f+this._c|0,this._d=p+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],452:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0;d<16;++d)c[d]=e.readInt32BE(4*d);for(;d<80;++d)c[d]=(t=c[d-3]^c[d-8]^c[d-14]^c[d-16])<<1|t>>>31;for(var m=0;m<80;++m){var g=~~(m/20),v=0|((s=u)<<5|s>>>27)+(n=f,a=p,o=h,0===(i=g)?n&a|~n&o:2===i?n&a|n&o|a&o:n^a^o)+l+c[m]+b[g];l=h,h=p,p=(r=f)<<30|r>>>2,f=u,u=v}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],453:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}i(c,n),c.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},c.prototype._hash=function(){var e=o.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},t.exports=c},{"./hash":449,"./sha256":454,inherits:320,"safe-buffer":447}],454:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,w=[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],o=new Array(64);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0|this._f,m=0|this._g,g=0|this._h,v=0;v<16;++v)c[v]=e.readInt32BE(4*v);for(;v<64;++v)c[v]=0|(((r=c[v-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+c[v-7]+(((t=c[v-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+c[v-16];for(var b=0;b<64;++b){var y=g+(((s=l)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((o=m)^l&(d^o))+w[b]+c[b]|0,_=0|(((a=u)>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+((i=u)&(n=f)|p&(i|n));g=m,m=d,d=l,l=h+y|0,h=p,p=f,f=u,u=y+_|0}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],455:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(160);function c(){this.init(),this._w=s,a.call(this,128,112)}i(c,n),c.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},c.prototype._hash=function(){var i=o.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=c},{"./hash":449,"./sha512":456,inherits:320,"safe-buffer":447}],456:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,ee=[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],o=new Array(160);function s(){this.init(),this._w=o,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ae(e,t){return e>>>0>>0?1:0}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c,u=this._w,f=0|this._ah,p=0|this._bh,h=0|this._ch,l=0|this._dh,d=0|this._eh,m=0|this._fh,g=0|this._gh,v=0|this._hh,b=0|this._al,y=0|this._bl,_=0|this._cl,w=0|this._dl,k=0|this._el,x=0|this._fl,S=0|this._gl,j=0|this._hl,E=0;E<32;E+=2)u[E]=e.readInt32BE(4*E),u[E+1]=e.readInt32BE(4*E+4);for(;E<160;E+=2){var A=u[E-30],I=u[E-30+1],P=((s=A)>>>1|(c=I)<<31)^(s>>>8|c<<24)^s>>>7,O=((a=I)>>>1|(o=A)<<31)^(a>>>8|o<<24)^(a>>>7|o<<25);A=u[E-4],I=u[E-4+1];var T=((i=A)>>>19|(n=I)<<13)^(n>>>29|i<<3)^i>>>6,B=((t=I)>>>19|(r=A)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),C=u[E-14],F=u[E-14+1],R=u[E-32],z=u[E-32+1],M=O+F|0,D=P+C+ae(M,O)|0;D=(D=D+T+ae(M=M+B|0,B)|0)+R+ae(M=M+z|0,z)|0,u[E]=D,u[E+1]=M}for(var N=0;N<160;N+=2){D=u[N],M=u[N+1];var q=re(f,p,h),L=re(b,y,_),U=ie(f,b),H=ie(b,f),K=ne(d,k),V=ne(k,d),G=ee[N],$=ee[N+1],W=te(d,m,g),Z=te(k,x,S),Y=j+V|0,X=v+K+ae(Y,j)|0;X=(X=(X=X+W+ae(Y=Y+Z|0,Z)|0)+G+ae(Y=Y+$|0,$)|0)+D+ae(Y=Y+M|0,M)|0;var J=H+L|0,Q=U+q+ae(J,H)|0;v=g,j=S,g=m,S=x,m=d,x=k,d=l+X+ae(k=w+Y|0,w)|0,l=h,w=_,h=p,_=y,p=f,y=b,f=X+Q+ae(b=Y+J|0,Y)|0}this._al=this._al+b|0,this._bl=this._bl+y|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+k|0,this._fl=this._fl+x|0,this._gl=this._gl+S|0,this._hl=this._hl+j|0,this._ah=this._ah+f+ae(this._al,b)|0,this._bh=this._bh+p+ae(this._bl,y)|0,this._ch=this._ch+h+ae(this._cl,_)|0,this._dh=this._dh+l+ae(this._dl,w)|0,this._eh=this._eh+d+ae(this._el,k)|0,this._fh=this._fh+m+ae(this._fl,x)|0,this._gh=this._gh+g+ae(this._gl,S)|0,this._hh=this._hh+v+ae(this._hl,j)|0},s.prototype._hash=function(){var i=a.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],457:[function(e,t,r){var i=e("safer-buffer").Buffer,n={dsa:{parts:["p","q","g","y"],sizePart:"p"},rsa:{parts:["e","n"],sizePart:"n"},ecdsa:{parts:["curve","Q"],sizePart:"Q"},ed25519:{parts:["A"],sizePart:"A"}};n.curve25519=n.ed25519;var a={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};a.curve25519=a.ed25519;var o={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:i.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g,""),"hex"),s:i.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g,""),"hex"),n:i.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g,""),"hex"),G:i.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g,""),"hex"),s:i.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g,""),"hex"),n:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g,""),"hex"),G:i.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:i.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g,""),"hex"),a:i.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g,""),"hex"),s:i.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g,""),"hex"),n:i.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g,""),"hex"),G:i.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g,""),"hex")}};t.exports={info:n,privInfo:a,hashAlgs:{md5:!0,sha1:!0,sha256:!0,sha384:!0,sha512:!0},curves:o}},{"safer-buffer":448}],458:[function(e,t,r){t.exports=_;var d=e("assert-plus"),m=e("safer-buffer").Buffer,i=e("./algs"),n=e("crypto"),a=e("./fingerprint"),o=(e("./signature"),e("./errors")),g=(e("util"),e("./utils")),v=e("./key"),b=e("./private-key"),y=e("./identity"),s={};s.openssh=e("./formats/openssh-cert"),s.x509=e("./formats/x509"),s.pem=e("./formats/x509-pem");var c=o.CertificateParseError,u=o.InvalidAlgorithmError;function _(e){d.object(e,"options"),d.arrayOfObject(e.subjects,"options.subjects"),g.assertCompatible(e.subjects[0],y,[1,0],"options.subjects"),g.assertCompatible(e.subjectKey,v,[1,0],"options.subjectKey"),g.assertCompatible(e.issuer,y,[1,0],"options.issuer"),void 0!==e.issuerKey&&g.assertCompatible(e.issuerKey,v,[1,0],"options.issuerKey"),d.object(e.signatures,"options.signatures"),d.buffer(e.serial,"options.serial"),d.date(e.validFrom,"options.validFrom"),d.date(e.validUntil,"optons.validUntil"),d.optionalArrayOfString(e.purposes,"options.purposes"),this._hashCache={},this.subjects=e.subjects,this.issuer=e.issuer,this.subjectKey=e.subjectKey,this.issuerKey=e.issuerKey,this.signatures=e.signatures,this.serial=e.serial,this.validFrom=e.validFrom,this.validUntil=e.validUntil,this.purposes=e.purposes}_.formats=s,_.prototype.toBuffer=function(e,t){return void 0===e&&(e="x509"),d.string(e,"format"),d.object(s[e],"formats[format]"),d.optionalObject(t,"options"),s[e].write(this,t)},_.prototype.toString=function(e,t){return void 0===e&&(e="pem"),this.toBuffer(e,t).toString()},_.prototype.fingerprint=function(e){void 0===e&&(e="sha256"),d.string(e,"algorithm");var t={type:"certificate",hash:this.hash(e),algorithm:e};return new a(t)},_.prototype.hash=function(e){if(d.string(e,"algorithm"),e=e.toLowerCase(),void 0===i.hashAlgs[e])throw new u(e);if(this._hashCache[e])return this._hashCache[e];var t=n.createHash(e).update(this.toBuffer("x509")).digest();return this._hashCache[e]=t},_.prototype.isExpired=function(e){return void 0===e&&(e=new Date),!(e.getTime()>=this.validFrom.getTime()&&e.getTime()e.length||"BEGIN"!==e.slice(t,t+5).toString("ascii"))}(e))return a.read(e,t);if(function(e){var t=0;for(;to.length&&(p=o.length),u+=c.write(o.slice(f,p),u),c[u++]=10,f=p}return u+=c.write("-----END "+i+"-----\n",u),c.slice(0,u)}};var b=e("assert-plus"),y=e("asn1"),_=e("crypto"),w=e("safer-buffer").Buffer,k=(e("../algs"),e("../utils")),h=e("../key"),l=e("../private-key"),x=e("./pkcs1"),S=e("./pkcs8"),j=e("./ssh-private"),E=e("./rfc4253"),A=e("../errors")},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../utils":480,"./pkcs1":467,"./pkcs8":468,"./rfc4253":469,"./ssh-private":470,asn1:65,"assert-plus":66,crypto:204,"safer-buffer":448}],467:[function(e,t,r){t.exports={read:function(e,t){return i.read(e,t,"pkcs1")},readPkcs1:function(e,t,r){switch(e){case"RSA":if("public"===t)return u=y(c=r,"modulus"),f=y(c,"exponent"),new p({type:"rsa",parts:[{name:"e",data:f},{name:"n",data:u}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t[0],0);var r=y(e,"modulus"),i=y(e,"public exponent"),n=y(e,"private exponent"),a=y(e,"prime1"),o=y(e,"prime2"),s=y(e,"exponent1"),c=y(e,"exponent2"),u=y(e,"iqmp");return new v({type:"rsa",parts:[{name:"n",data:r},{name:"e",data:i},{name:"d",data:n},{name:"iqmp",data:u},{name:"p",data:a},{name:"q",data:o},{name:"dmodp",data:s},{name:"dmodq",data:c}]})}(r);throw new Error("Unknown key type: "+t);case"DSA":if("public"===t)return n=y(i=r,"y"),a=y(i,"p"),o=y(i,"q"),s=y(i,"g"),new p({type:"dsa",parts:[{name:"y",data:n},{name:"p",data:a},{name:"q",data:o},{name:"g",data:s}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),0);var r=y(e,"p"),i=y(e,"q"),n=y(e,"g"),a=y(e,"y"),o=y(e,"x");return new v({type:"dsa",parts:[{name:"p",data:r},{name:"q",data:i},{name:"g",data:n},{name:"y",data:a},{name:"x",data:o}]})}(r);throw new Error("Unknown key type: "+t);case"EC":case"ECDSA":if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),1);var r=e.readString(l.Ber.OctetString,!0);e.readSequence(160);var i=b(e);h.string(i,"a known elliptic curve"),e.readSequence(161);var n=e.readString(l.Ber.BitString,!0);n=g.ecNormalize(n);var a={type:"ecdsa",parts:[{name:"curve",data:d.from(i)},{name:"Q",data:n},{name:"d",data:r}]};return new v(a)}(r);if("public"===t)return function(e){e.readSequence();var t=e.readOID();h.strictEqual(t,"1.2.840.10045.2.1","must be ecPublicKey");for(var r,i=e.readOID(),n=Object.keys(m.curves),a=0;aS.length&&(I=S.length),E+=x.write(S.slice(A,I),E),x[E++]=10,A=I}return E+=x.write("-----END "+k+"-----\n",E),x.slice(0,E)}};var O,T=P("assert-plus"),B=(P("asn1"),P("safer-buffer").Buffer),C=(P("../algs"),P("../utils")),F=P("crypto"),R=(P("../key"),P("../private-key")),r=P("./pem"),A=P("./rfc4253"),z=P("../ssh-buffer"),I=P("../errors");var M="openssh-key-v1"},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../ssh-buffer":479,"../utils":480,"./pem":466,"./rfc4253":469,asn1:65,"assert-plus":66,"bcrypt-pbkdf":76,crypto:204,"safer-buffer":448}],471:[function(e,t,r){t.exports={read:function(e,t){"string"!=typeof e&&(h.buffer(e,"buf"),e=e.toString("ascii"));var r=e.trim().replace(/[\\\r]/g,""),i=r.match(m);i||(i=r.match(g));h.ok(i,"key must match regex");var n,a=d.algToKeyType(i[1]),o=l.from(i[2],"base64"),s={};if(i[4])try{n=d.read(o)}catch(e){i=r.match(g),h.ok(i,"key must match regex"),o=l.from(i[2],"base64"),n=d.readInternal(s,"public",o)}else n=d.readInternal(s,"public",o);if(h.strictEqual(a,n.type),i[4]&&0n.length&&(u=n.length),s+=o.write(n.slice(c,u),s),o[s++]=10,c=u}return s+=o.write("-----END "+i+"-----\n",s),o.slice(0,s)}};var o=e("assert-plus"),p=(e("asn1"),e("safer-buffer").Buffer);e("../algs"),e("../utils"),e("../key"),e("../private-key"),e("./pem"),e("../identity"),e("../signature"),e("../certificate")},{"../algs":457,"../certificate":458,"../identity":474,"../key":476,"../private-key":477,"../signature":478,"../utils":480,"./pem":466,"./x509":473,asn1:65,"assert-plus":66,"safer-buffer":448}],473:[function(e,t,r){t.exports={read:function(e,t){"string"==typeof e&&(e=_.from(e,"binary"));b.buffer(e,"buf");var r=new y.BerReader(e);if(r.readSequence(),1=this._buffer.length},a.prototype.remainder=function(){return this._buffer.slice(this._offset)},a.prototype.skip=function(e){this._offset+=e},a.prototype.expand=function(){this._size*=2;var e=n.alloc(this._size);this._buffer.copy(e,0),this._buffer=e},a.prototype.readPart=function(){return{data:this.readBuffer()}},a.prototype.readBuffer=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4,i.ok(this._offset+e<=this._buffer.length,"length out of bounds at +0x"+this._offset.toString(16)+" (data truncated?)");var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t},a.prototype.readString=function(){return this.readBuffer().toString()},a.prototype.readCString=function(){for(var e=this._offset;ethis._size;)this.expand();this._buffer.writeUInt32BE(e.length,this._offset),this._offset+=4,e.copy(this._buffer,this._offset),this._offset+=e.length},a.prototype.writeString=function(e){this.writeBuffer(n.from(e,"utf8"))},a.prototype.writeCString=function(e){for(;this._offset+1+e.length>this._size;)this.expand();this._buffer.write(e,this._offset),this._offset+=e.length,this._buffer[this._offset++]=0},a.prototype.writeInt=function(e){for(;this._offset+4>this._size;)this.expand();this._buffer.writeUInt32BE(e,this._offset),this._offset+=4},a.prototype.writeInt64=function(e){if(i.buffer(e,"value"),8this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=8},a.prototype.writeChar=function(e){for(;this._offset+1>this._size;)this.expand();this._buffer[this._offset++]=e},a.prototype.writePart=function(e){this.writeBuffer(e.data)},a.prototype.write=function(e){for(;this._offset+e.length>this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=e.length}},{"assert-plus":66,"safer-buffer":448}],480:[function(e,t,r){t.exports={bufferSplit:function(e,t){p.buffer(e),p.string(t);for(var r=[],i=0,n=0,a=0;a=t.length){var o=a+1;r.push(e.slice(i,o-n)),i=o,n=0}i<=e.length&&r.push(e.slice(i,e.length));return r},addRSAMissing:function(e){p.object(e),u(e,s,[1,1]);var t,r=new g(e.part.d.data);if(!e.part.dmodp){var i=new g(e.part.p.data),n=r.mod(i.subtract(1));t=_(n),e.part.dmodp={name:"dmodp",data:t},e.parts.push(e.part.dmodp)}if(!e.part.dmodq){var a=new g(e.part.q.data),o=r.mod(a.subtract(1));t=_(o),e.part.dmodq={name:"dmodq",data:t},e.parts.push(e.part.dmodq)}},calculateDSAPublic:function(e,t,r){return p.buffer(e),p.buffer(t),p.buffer(r),e=new g(e),t=new g(t),r=new g(r),_(e.modPow(r,t))},calculateED25519Public:function(e){p.buffer(e);var t=i.sign.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},calculateX25519Public:function(e){p.buffer(e);var t=i.box.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},mpNormalize:y,mpDenormalize:function(e){p.buffer(e);for(;1c)return!1;if(i.constructor.name!==t.name)return!1;var a=i._sshpkApiVersion;void 0===a&&(a=t._oldVersionDetect(e));return!(a[0]!=r[0]||a[1]t;)p.equal(e[0],0),e=e.slice(1);for(;e.length=r[1],i+" must be compatible with "+t.name+" klass version "+r[0]+"."+r[1])}}var v={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}},b=8;function y(e){for(p.buffer(e);1t._pos){var i=r.substr(t._pos);if("x-user-defined"===t._charset){for(var n=new p(i.length),a=0;at._pos&&(t.push(new p(new Uint8Array(o.result.slice(t._pos)))),t._pos=o.result.byteLength)},o.onload=function(){t.push(null)},o.readAsArrayBuffer(r)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":484,_process:382,buffer:191,inherits:320,"readable-stream":426}],487:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=p,t=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1=2.4.3 <2.5.0",_hasShrinkwrap:!1,_id:"tough-cookie@2.4.3",_inCache:!0,_installable:!0,_location:"/tough-cookie",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/tough-cookie_2.4.3_1529960207843_0.4882910670728131"},_npmUser:{email:"jstash@gmail.com",name:"jstash"},_npmVersion:"6.1.0",_phantomChildren:{},_requested:{name:"tough-cookie",raw:"tough-cookie@~2.4.3",rawSpec:"~2.4.3",scope:null,spec:">=2.4.3 <2.5.0",type:"range"},_requiredBy:["/request","/request-promise"],_resolved:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",_shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",_shrinkwrap:null,_spec:"tough-cookie@~2.4.3",_where:"/home/giacof/Download/javascript-opentimestamps/node_modules/request",author:{email:"jstash@gmail.com",name:"Jeremy Stashewsky"},bugs:{url:"https://github.com/salesforce/tough-cookie/issues"},contributors:[{name:"Alexander Savin"},{name:"Ian Livingstone"},{name:"Ivan Nikulin"},{name:"Lalit Kapoor"},{name:"Sam Thompson"},{name:"Sebastian Mayr"}],dependencies:{psl:"^1.1.24",punycode:"^1.4.1"},description:"RFC6265 Cookies and Cookie Jar for node.js",devDependencies:{async:"^1.4.2",nyc:"^11.6.0","string.prototype.repeat":"^0.2.0",vows:"^0.8.1"},directories:{},dist:{fileCount:9,integrity:"sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMVcQCRA9TVsSAnZWagAAzX0P/2COkbzb3dOX/FTOYIVL\n7oHge7BvGODNkEHTjBtNsR0jO/AA/gVcUOq6CSmFH+UC14LrmCyNDemQvD15\njnYuJXUIiZsSZO7BGGbOFYrQF+DKLiwgf0LokrIM8KasZ5nxc5xS1jYHG5o+\nwCqutfhlRTqlPbZsexB+eRlIuYNvpsbRAdSDYXrhLJNMZgx49g/SZ7IwunGN\nJ/5Fe041MZqqdi7MAavM3T7vX9IvVRJJ3f4xAEVxY1vh4s0dN+h4fG2eMQzL\nOiaulRUIahs4xmJUYHZgZESc9eTIrI8K+YT7i3r35TGc0Du7ueB2KYxBqy7q\n6AUFbdX9Ep308kTVsTf/h4wE0RvdxKLfZ0ww7T1ivADX9xMi2oIvVtyhCQHo\nSIpyBhaav/fTufF0/Fu4Lcr7PMJxyvF0UcNRqrPmEQTw4UZkFKfT8HN2P5cH\nBvJsFwpeEjt84tt5pJ/bmD0j0EUCLUXLGH6fbA84fHpZGifO239zSf262Qdv\nSXeygU7YxnK8wOCnvlauZx/gp+/WTMfMdODxiX0QnqwS5BctiPCgGG1cKJcC\nqvTECaAEmxMVf/gEW73oxVXJgUO7f6jJaWoawV7ka+wR91W9Bp0pKGOOAxAG\nU72rmnwQKid9U7ly5833sb3D+lbzKJXGNIqohegP4daKZfNNTaLWZXmKE+Iy\n7Vml\r\n=8KpS\r\n-----END PGP SIGNATURE-----\r\n",shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",tarball:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",unpackedSize:83959},engines:{node:">=0.8"},files:["lib"],gitHead:"671ad413b38d7464352886772f57a7ec417d4760",homepage:"https://github.com/salesforce/tough-cookie",keywords:["HTTP","RFC2965","RFC6265","cookie","cookiejar","cookies","jar","set-cookie"],license:"BSD-3-Clause",main:"./lib/cookie",maintainers:[{name:"awaterma",email:"awaterma@awaterma.net"},{name:"jstash",email:"jstash@gmail.com"},{name:"maratto",email:"marat+npm@salesforce.com"},{name:"ruoho",email:"clint@ruoho.org"}],name:"tough-cookie",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/salesforce/tough-cookie.git"},scripts:{cover:"nyc --reporter=lcov --reporter=html vows test/*_test.js",test:"vows test/*_test.js"},version:"2.4.3"}},{}],497:[function(s,e,c){(function(u){"use strict";s("net");var f,a=s("tls"),r=s("http"),i=s("https"),e=s("events"),p=s("assert"),t=s("util"),h=s("safe-buffer").Buffer;function o(e){var o=this;o.options=e||{},o.proxyOptions=o.options.proxy||{},o.maxSockets=o.options.maxSockets||r.Agent.defaultMaxSockets,o.requests=[],o.sockets=[],o.on("free",function(e,t,r){for(var i=0,n=o.requests.length;i=this.maxSockets?this.requests.push({host:t.host,port:t.port,request:e}):this.createConnection({host:t.host,port:t.port,request:e})},o.prototype.createConnection=function(e){var n=this;n.createSocket(e,function(t){function r(){n.emit("free",t,e.host,e.port)}function i(e){n.removeSocket(t),t.removeListener("free",r),t.removeListener("close",i),t.removeListener("agentRemove",i)}t.on("free",r),t.on("close",i),t.on("agentRemove",i),e.request.onSocket(t)})},o.prototype.createSocket=function(n,a){var o=this,s={};o.sockets.push(s);var e=l({},o.proxyOptions,{method:"CONNECT",path:n.host+":"+n.port,agent:!1});e.proxyAuth&&(e.headers=e.headers||{},e.headers["Proxy-Authorization"]="Basic "+h.from(e.proxyAuth).toString("base64")),f("making CONNECT request");var c=o.request(e);function i(e,t,r){if(c.removeAllListeners(),t.removeAllListeners(),200===e.statusCode)p.equal(r.length,0),f("tunneling connection has established"),o.sockets[o.sockets.indexOf(s)]=t,a(t);else{f("tunneling socket could not be established, statusCode=%d",e.statusCode);var i=new Error("tunneling socket could not be established, statusCode="+e.statusCode);i.code="ECONNRESET",n.request.emit("error",i),o.removeSocket(s)}}c.useChunkedEncodingByDefault=!1,c.once("response",function(e){e.upgrade=!0}),c.once("upgrade",function(e,t,r){u.nextTick(function(){i(e,t,r)})}),c.once("connect",i),c.once("error",function(e){c.removeAllListeners(),f("tunneling socket could not be established, cause=%s\n",e.message,e.stack);var t=new Error("tunneling socket could not be established, cause="+e.message);t.code="ECONNRESET",n.request.emit("error",t),o.removeSocket(s)}),c.end()},o.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},f=u.env.NODE_DEBUG&&/\btunnel\b/.test(u.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},c.debug=f}).call(this,s("_process"))},{_process:382,assert:67,events:269,http:483,https:317,net:187,"safe-buffer":447,tls:187,util:505}],498:[function(e,t,r){!function(a){"use strict";var m=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function d(e,t,r,i,n){var a,o=0;for(a=0;a>>8)-1}function v(e,t,r,i){return d(e,t,r,i,16)}function b(e,t,r,i){return d(e,t,r,i,32)}function y(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=a,k=o,x=s,S=c,j=u,E=f,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=0;M<20;M+=2)w^=(n=(C^=(n=(P^=(n=(j^=(n=w+C|0)<<7|n>>>25)+w|0)<<9|n>>>23)+j|0)<<13|n>>>19)+P|0)<<18|n>>>14,E^=(n=(k^=(n=(F^=(n=(O^=(n=E+k|0)<<7|n>>>25)+E|0)<<9|n>>>23)+O|0)<<13|n>>>19)+F|0)<<18|n>>>14,T^=(n=(A^=(n=(x^=(n=(R^=(n=T+A|0)<<7|n>>>25)+T|0)<<9|n>>>23)+R|0)<<13|n>>>19)+x|0)<<18|n>>>14,z^=(n=(B^=(n=(I^=(n=(S^=(n=z+B|0)<<7|n>>>25)+z|0)<<9|n>>>23)+S|0)<<13|n>>>19)+I|0)<<18|n>>>14,w^=(n=(S^=(n=(x^=(n=(k^=(n=w+S|0)<<7|n>>>25)+w|0)<<9|n>>>23)+k|0)<<13|n>>>19)+x|0)<<18|n>>>14,E^=(n=(j^=(n=(I^=(n=(A^=(n=E+j|0)<<7|n>>>25)+E|0)<<9|n>>>23)+A|0)<<13|n>>>19)+I|0)<<18|n>>>14,T^=(n=(O^=(n=(P^=(n=(B^=(n=T+O|0)<<7|n>>>25)+T|0)<<9|n>>>23)+B|0)<<13|n>>>19)+P|0)<<18|n>>>14,z^=(n=(R^=(n=(F^=(n=(C^=(n=z+R|0)<<7|n>>>25)+z|0)<<9|n>>>23)+C|0)<<13|n>>>19)+F|0)<<18|n>>>14;w=w+a|0,k=k+o|0,x=x+s|0,S=S+c|0,j=j+u|0,E=E+f|0,A=A+p|0,I=I+h|0,P=P+l|0,O=O+d|0,T=T+m|0,B=B+g|0,C=C+v|0,F=F+b|0,R=R+y|0,z=z+_|0,e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=x>>>0&255,e[9]=x>>>8&255,e[10]=x>>>16&255,e[11]=x>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=j>>>0&255,e[17]=j>>>8&255,e[18]=j>>>16&255,e[19]=j>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=B>>>0&255,e[45]=B>>>8&255,e[46]=B>>>16&255,e[47]=B>>>24&255,e[48]=C>>>0&255,e[49]=C>>>8&255,e[50]=C>>>16&255,e[51]=C>>>24&255,e[52]=F>>>0&255,e[53]=F>>>8&255,e[54]=F>>>16&255,e[55]=F>>>24&255,e[56]=R>>>0&255,e[57]=R>>>8&255,e[58]=R>>>16&255,e[59]=R>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,i)}function _(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=0;w<20;w+=2)a^=(n=(v^=(n=(l^=(n=(u^=(n=a+v|0)<<7|n>>>25)+a|0)<<9|n>>>23)+u|0)<<13|n>>>19)+l|0)<<18|n>>>14,f^=(n=(o^=(n=(b^=(n=(d^=(n=f+o|0)<<7|n>>>25)+f|0)<<9|n>>>23)+d|0)<<13|n>>>19)+b|0)<<18|n>>>14,m^=(n=(p^=(n=(s^=(n=(y^=(n=m+p|0)<<7|n>>>25)+m|0)<<9|n>>>23)+y|0)<<13|n>>>19)+s|0)<<18|n>>>14,_^=(n=(g^=(n=(h^=(n=(c^=(n=_+g|0)<<7|n>>>25)+_|0)<<9|n>>>23)+c|0)<<13|n>>>19)+h|0)<<18|n>>>14,a^=(n=(c^=(n=(s^=(n=(o^=(n=a+c|0)<<7|n>>>25)+a|0)<<9|n>>>23)+o|0)<<13|n>>>19)+s|0)<<18|n>>>14,f^=(n=(u^=(n=(h^=(n=(p^=(n=f+u|0)<<7|n>>>25)+f|0)<<9|n>>>23)+p|0)<<13|n>>>19)+h|0)<<18|n>>>14,m^=(n=(d^=(n=(l^=(n=(g^=(n=m+d|0)<<7|n>>>25)+m|0)<<9|n>>>23)+g|0)<<13|n>>>19)+l|0)<<18|n>>>14,_^=(n=(y^=(n=(b^=(n=(v^=(n=_+y|0)<<7|n>>>25)+_|0)<<9|n>>>23)+v|0)<<13|n>>>19)+b|0)<<18|n>>>14;e[0]=a>>>0&255,e[1]=a>>>8&255,e[2]=a>>>16&255,e[3]=a>>>24&255,e[4]=f>>>0&255,e[5]=f>>>8&255,e[6]=f>>>16&255,e[7]=f>>>24&255,e[8]=m>>>0&255,e[9]=m>>>8&255,e[10]=m>>>16&255,e[11]=m>>>24&255,e[12]=_>>>0&255,e[13]=_>>>8&255,e[14]=_>>>16&255,e[15]=_>>>24&255,e[16]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255}(e,t,r,i)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function k(e,t,r,i,n,a,o){var s,c,u=new Uint8Array(16),f=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=a[c];for(;64<=n;){for(y(f,u,o,w),c=0;c<64;c++)e[t+c]=r[i+c]^f[c];for(s=1,c=8;c<16;c++)s=s+(255&u[c])|0,u[c]=255&s,s>>>=8;n-=64,t+=64,i+=64}if(0>>=8;r-=64,t+=64}if(0>>13|r<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|i<<6),n=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|n<<9),a=255&e[8]|(255&e[9])<<8,this.r[4]=255&(n>>>4|a<<12),this.r[5]=a>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(a>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,r,i,n,a){var o=new E(a);return o.update(r,i,n),o.finish(e,t),0}function I(e,t,r,i,n,a){var o=new Uint8Array(16);return A(o,0,r,i,n,a),v(e,t,o,0)}function P(e,t,r,i,n){var a;if(r<32)return-1;for(j(e,0,t,0,r,i,n),A(e,16,e,32,r-32,e),a=0;a<16;a++)e[a]=0;return 0}function O(e,t,r,i,n){var a,o=new Uint8Array(32);if(r<32)return-1;if(S(o,0,32,i,n),0!==I(t,16,t,32,r-32,o))return-1;for(j(e,0,t,0,r,i,n),a=0;a<32;a++)e[a]=0;return 0}function T(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function C(e,t,r){for(var i,n=~(r-1),a=0;a<16;a++)i=n&(e[a]^t[a]),e[a]^=i,t[a]^=i}function F(e,t){var r,i,n,a=m(),o=m();for(r=0;r<16;r++)o[r]=t[r];for(B(o),B(o),B(o),i=0;i<2;i++){for(a[0]=o[0]-65517,r=1;r<15;r++)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),n=a[15]>>16&1,a[14]&=65535,C(o,a,1-n)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function R(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return F(r,e),F(i,t),b(r,0,i,0)}function z(e){var t=new Uint8Array(32);return F(t,e),1&t[0]}function M(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function D(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function N(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function q(e,t,r){var i,n,a=0,o=0,s=0,c=0,u=0,f=0,p=0,h=0,l=0,d=0,m=0,g=0,v=0,b=0,y=0,_=0,w=0,k=0,x=0,S=0,j=0,E=0,A=0,I=0,P=0,O=0,T=0,B=0,C=0,F=0,R=0,z=r[0],M=r[1],D=r[2],N=r[3],q=r[4],L=r[5],U=r[6],H=r[7],K=r[8],V=r[9],G=r[10],$=r[11],W=r[12],Z=r[13],Y=r[14],X=r[15];a+=(i=t[0])*z,o+=i*M,s+=i*D,c+=i*N,u+=i*q,f+=i*L,p+=i*U,h+=i*H,l+=i*K,d+=i*V,m+=i*G,g+=i*$,v+=i*W,b+=i*Z,y+=i*Y,_+=i*X,o+=(i=t[1])*z,s+=i*M,c+=i*D,u+=i*N,f+=i*q,p+=i*L,h+=i*U,l+=i*H,d+=i*K,m+=i*V,g+=i*G,v+=i*$,b+=i*W,y+=i*Z,_+=i*Y,w+=i*X,s+=(i=t[2])*z,c+=i*M,u+=i*D,f+=i*N,p+=i*q,h+=i*L,l+=i*U,d+=i*H,m+=i*K,g+=i*V,v+=i*G,b+=i*$,y+=i*W,_+=i*Z,w+=i*Y,k+=i*X,c+=(i=t[3])*z,u+=i*M,f+=i*D,p+=i*N,h+=i*q,l+=i*L,d+=i*U,m+=i*H,g+=i*K,v+=i*V,b+=i*G,y+=i*$,_+=i*W,w+=i*Z,k+=i*Y,x+=i*X,u+=(i=t[4])*z,f+=i*M,p+=i*D,h+=i*N,l+=i*q,d+=i*L,m+=i*U,g+=i*H,v+=i*K,b+=i*V,y+=i*G,_+=i*$,w+=i*W,k+=i*Z,x+=i*Y,S+=i*X,f+=(i=t[5])*z,p+=i*M,h+=i*D,l+=i*N,d+=i*q,m+=i*L,g+=i*U,v+=i*H,b+=i*K,y+=i*V,_+=i*G,w+=i*$,k+=i*W,x+=i*Z,S+=i*Y,j+=i*X,p+=(i=t[6])*z,h+=i*M,l+=i*D,d+=i*N,m+=i*q,g+=i*L,v+=i*U,b+=i*H,y+=i*K,_+=i*V,w+=i*G,k+=i*$,x+=i*W,S+=i*Z,j+=i*Y,E+=i*X,h+=(i=t[7])*z,l+=i*M,d+=i*D,m+=i*N,g+=i*q,v+=i*L,b+=i*U,y+=i*H,_+=i*K,w+=i*V,k+=i*G,x+=i*$,S+=i*W,j+=i*Z,E+=i*Y,A+=i*X,l+=(i=t[8])*z,d+=i*M,m+=i*D,g+=i*N,v+=i*q,b+=i*L,y+=i*U,_+=i*H,w+=i*K,k+=i*V,x+=i*G,S+=i*$,j+=i*W,E+=i*Z,A+=i*Y,I+=i*X,d+=(i=t[9])*z,m+=i*M,g+=i*D,v+=i*N,b+=i*q,y+=i*L,_+=i*U,w+=i*H,k+=i*K,x+=i*V,S+=i*G,j+=i*$,E+=i*W,A+=i*Z,I+=i*Y,P+=i*X,m+=(i=t[10])*z,g+=i*M,v+=i*D,b+=i*N,y+=i*q,_+=i*L,w+=i*U,k+=i*H,x+=i*K,S+=i*V,j+=i*G,E+=i*$,A+=i*W,I+=i*Z,P+=i*Y,O+=i*X,g+=(i=t[11])*z,v+=i*M,b+=i*D,y+=i*N,_+=i*q,w+=i*L,k+=i*U,x+=i*H,S+=i*K,j+=i*V,E+=i*G,A+=i*$,I+=i*W,P+=i*Z,O+=i*Y,T+=i*X,v+=(i=t[12])*z,b+=i*M,y+=i*D,_+=i*N,w+=i*q,k+=i*L,x+=i*U,S+=i*H,j+=i*K,E+=i*V,A+=i*G,I+=i*$,P+=i*W,O+=i*Z,T+=i*Y,B+=i*X,b+=(i=t[13])*z,y+=i*M,_+=i*D,w+=i*N,k+=i*q,x+=i*L,S+=i*U,j+=i*H,E+=i*K,A+=i*V,I+=i*G,P+=i*$,O+=i*W,T+=i*Z,B+=i*Y,C+=i*X,y+=(i=t[14])*z,_+=i*M,w+=i*D,k+=i*N,x+=i*q,S+=i*L,j+=i*U,E+=i*H,A+=i*K,I+=i*V,P+=i*G,O+=i*$,T+=i*W,B+=i*Z,C+=i*Y,F+=i*X,_+=(i=t[15])*z,o+=38*(k+=i*D),s+=38*(x+=i*N),c+=38*(S+=i*q),u+=38*(j+=i*L),f+=38*(E+=i*U),p+=38*(A+=i*H),h+=38*(I+=i*K),l+=38*(P+=i*V),d+=38*(O+=i*G),m+=38*(T+=i*$),g+=38*(B+=i*W),v+=38*(C+=i*Z),b+=38*(F+=i*Y),y+=38*(R+=i*X),a=(i=(a+=38*(w+=i*M))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a=(i=(a+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a+=n-1+37*(n-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=h,e[8]=l,e[9]=d,e[10]=m,e[11]=g,e[12]=v,e[13]=b,e[14]=y,e[15]=_}function L(e,t){q(e,t,t)}function U(e,t){var r,i=m();for(r=0;r<16;r++)i[r]=t[r];for(r=253;0<=r;r--)L(i,i),2!==r&&4!==r&&q(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function H(e,t,r){var i,n,a=new Uint8Array(32),o=new Float64Array(80),s=m(),c=m(),u=m(),f=m(),p=m(),h=m();for(n=0;n<31;n++)a[n]=t[n];for(a[31]=127&t[31]|64,a[0]&=248,M(o,r),n=0;n<16;n++)c[n]=o[n],f[n]=s[n]=u[n]=0;for(s[0]=f[0]=1,n=254;0<=n;--n)C(s,c,i=a[n>>>3]>>>(7&n)&1),C(u,f,i),D(p,s,u),N(s,s,u),D(u,c,f),N(c,c,f),L(f,p),L(h,s),q(s,u,s),q(u,c,p),D(p,s,u),N(s,s,u),L(c,s),N(u,f,h),q(s,u,g),D(s,s,f),q(u,u,s),q(s,f,h),q(f,c,o),L(c,p),C(s,c,i),C(u,f,i);for(n=0;n<16;n++)o[n+16]=s[n],o[n+32]=u[n],o[n+48]=c[n],o[n+64]=f[n];var l=o.subarray(32),d=o.subarray(16);return U(l,l),q(d,d,l),F(e,d),0}function K(e,t){return H(e,t,r)}function V(e,t){return o(t,32),K(e,t)}function G(e,t,r){var i=new Uint8Array(32);return H(i,r,t),_(e,n,i,w)}E.prototype.blocks=function(e,t,r){for(var i,n,a,o,s,c,u,f,p,h,l,d,m,g,v,b,y,_,w,k=this.fin?0:2048,x=this.h[0],S=this.h[1],j=this.h[2],E=this.h[3],A=this.h[4],I=this.h[5],P=this.h[6],O=this.h[7],T=this.h[8],B=this.h[9],C=this.r[0],F=this.r[1],R=this.r[2],z=this.r[3],M=this.r[4],D=this.r[5],N=this.r[6],q=this.r[7],L=this.r[8],U=this.r[9];16<=r;)h=p=0,h+=(x+=8191&(i=255&e[t+0]|(255&e[t+1])<<8))*C,h+=(S+=8191&(i>>>13|(n=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*U),h+=(j+=8191&(n>>>10|(a=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*L),h+=(E+=8191&(a>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*q),p=(h+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*N))>>>13,h&=8191,h+=(I+=s>>>1&8191)*(5*D),h+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*M),h+=(O+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),h+=(T+=8191&(u>>>8|(f=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*R),l=p+=(h+=(B+=f>>>5|k)*(5*F))>>>13,l+=x*F,l+=S*C,l+=j*(5*U),l+=E*(5*L),p=(l+=A*(5*q))>>>13,l&=8191,l+=I*(5*N),l+=P*(5*D),l+=O*(5*M),l+=T*(5*z),p+=(l+=B*(5*R))>>>13,l&=8191,d=p,d+=x*R,d+=S*F,d+=j*C,d+=E*(5*U),p=(d+=A*(5*L))>>>13,d&=8191,d+=I*(5*q),d+=P*(5*N),d+=O*(5*D),d+=T*(5*M),m=p+=(d+=B*(5*z))>>>13,m+=x*z,m+=S*R,m+=j*F,m+=E*C,p=(m+=A*(5*U))>>>13,m&=8191,m+=I*(5*L),m+=P*(5*q),m+=O*(5*N),m+=T*(5*D),g=p+=(m+=B*(5*M))>>>13,g+=x*M,g+=S*z,g+=j*R,g+=E*F,p=(g+=A*C)>>>13,g&=8191,g+=I*(5*U),g+=P*(5*L),g+=O*(5*q),g+=T*(5*N),v=p+=(g+=B*(5*D))>>>13,v+=x*D,v+=S*M,v+=j*z,v+=E*R,p=(v+=A*F)>>>13,v&=8191,v+=I*C,v+=P*(5*U),v+=O*(5*L),v+=T*(5*q),b=p+=(v+=B*(5*N))>>>13,b+=x*N,b+=S*D,b+=j*M,b+=E*z,p=(b+=A*R)>>>13,b&=8191,b+=I*F,b+=P*C,b+=O*(5*U),b+=T*(5*L),y=p+=(b+=B*(5*q))>>>13,y+=x*q,y+=S*N,y+=j*D,y+=E*M,p=(y+=A*z)>>>13,y&=8191,y+=I*R,y+=P*F,y+=O*C,y+=T*(5*U),_=p+=(y+=B*(5*L))>>>13,_+=x*L,_+=S*q,_+=j*N,_+=E*D,p=(_+=A*M)>>>13,_&=8191,_+=I*z,_+=P*R,_+=O*F,_+=T*C,w=p+=(_+=B*(5*U))>>>13,w+=x*U,w+=S*L,w+=j*q,w+=E*N,p=(w+=A*D)>>>13,w&=8191,w+=I*M,w+=P*z,w+=O*R,w+=T*F,x=h=8191&(p=(p=((p+=(w+=B*C)>>>13)<<2)+p|0)+(h&=8191)|0),S=l+=p>>>=13,j=d&=8191,E=m&=8191,A=g&=8191,I=v&=8191,P=b&=8191,O=y&=8191,T=_&=8191,B=w&=8191,t+=16,r-=16;this.h[0]=x,this.h[1]=S,this.h[2]=j,this.h[3]=E,this.h[4]=A,this.h[5]=I,this.h[6]=P,this.h[7]=O,this.h[8]=T,this.h[9]=B},E.prototype.finish=function(e,t){var r,i,n,a,o=new Uint16Array(10);if(this.leftover){for(a=this.leftover,this.buffer[a++]=1;a<16;a++)this.buffer[a]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=r,r=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this.h[a]+r,r=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,i=(1^r)-1,a=0;a<10;a++)o[a]&=i;for(i=~i,a=0;a<10;a++)this.h[a]=this.h[a]&i|o[a];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,a=1;a<8;a++)n=(this.h[a]+this.pad[a]|0)+(n>>>16)|0,this.h[a]=65535&n;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var i,n;if(this.leftover){for(r<(n=16-this.leftover)&&(n=r),i=0;i>>16,I=65535&(S=N),P=S>>>16,E+=65535&(j=((g=K)>>>14|(c=z)<<18)^(K>>>18|z<<14)^(z>>>9|K<<23)),A+=j>>>16,I+=65535&(S=(z>>>14|K<<18)^(z>>>18|K<<14)^(K>>>9|z<<23)),P+=S>>>16,E+=65535&(j=K&(v=V)^~K&(b=G)),A+=j>>>16,I+=65535&(S=z&(u=M)^~z&(f=D)),P+=S>>>16,S=Z[2*k],E+=65535&(j=Z[2*k+1]),A+=j>>>16,I+=65535&S,P+=S>>>16,S=O[k%16],A+=(j=T[k%16])>>>16,I+=65535&S,P+=S>>>16,I+=(A+=(E+=65535&j)>>>16)>>>16,E=65535&(j=w=65535&E|A<<16),A=j>>>16,I=65535&(S=_=65535&I|(P+=I>>>16)<<16),P=S>>>16,E+=65535&(j=(q>>>28|B<<4)^(B>>>2|q<<30)^(B>>>7|q<<25)),A+=j>>>16,I+=65535&(S=(B>>>28|q<<4)^(q>>>2|B<<30)^(q>>>7|B<<25)),P+=S>>>16,A+=(j=q&L^q&U^L&U)>>>16,I+=65535&(S=B&C^B&F^C&F),P+=S>>>16,p=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,y=65535&E|A<<16,E=65535&(j=m),A=j>>>16,I=65535&(S=s),P=S>>>16,A+=(j=w)>>>16,I+=65535&(S=_),P+=S>>>16,C=n,F=a,R=o,z=s=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,M=c,D=u,N=f,B=p,L=h,U=l,H=d,K=m=65535&E|A<<16,V=g,G=v,$=b,q=y,k%16==15)for(x=0;x<16;x++)S=O[x],E=65535&(j=T[x]),A=j>>>16,I=65535&S,P=S>>>16,S=O[(x+9)%16],E+=65535&(j=T[(x+9)%16]),A+=j>>>16,I+=65535&S,P+=S>>>16,_=O[(x+1)%16],E+=65535&(j=((w=T[(x+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),A+=j>>>16,I+=65535&(S=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),P+=S>>>16,_=O[(x+14)%16],A+=(j=((w=T[(x+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,I+=65535&(S=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,O[x]=65535&I|P<<16,T[x]=65535&E|A<<16;E=65535&(j=q),A=j>>>16,I=65535&(S=B),P=S>>>16,S=e[0],A+=(j=t[0])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[0]=B=65535&I|P<<16,t[0]=q=65535&E|A<<16,E=65535&(j=L),A=j>>>16,I=65535&(S=C),P=S>>>16,S=e[1],A+=(j=t[1])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[1]=C=65535&I|P<<16,t[1]=L=65535&E|A<<16,E=65535&(j=U),A=j>>>16,I=65535&(S=F),P=S>>>16,S=e[2],A+=(j=t[2])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[2]=F=65535&I|P<<16,t[2]=U=65535&E|A<<16,E=65535&(j=H),A=j>>>16,I=65535&(S=R),P=S>>>16,S=e[3],A+=(j=t[3])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[3]=R=65535&I|P<<16,t[3]=H=65535&E|A<<16,E=65535&(j=K),A=j>>>16,I=65535&(S=z),P=S>>>16,S=e[4],A+=(j=t[4])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[4]=z=65535&I|P<<16,t[4]=K=65535&E|A<<16,E=65535&(j=V),A=j>>>16,I=65535&(S=M),P=S>>>16,S=e[5],A+=(j=t[5])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[5]=M=65535&I|P<<16,t[5]=V=65535&E|A<<16,E=65535&(j=G),A=j>>>16,I=65535&(S=D),P=S>>>16,S=e[6],A+=(j=t[6])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[6]=D=65535&I|P<<16,t[6]=G=65535&E|A<<16,E=65535&(j=$),A=j>>>16,I=65535&(S=N),P=S>>>16,S=e[7],A+=(j=t[7])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[7]=N=65535&I|P<<16,t[7]=$=65535&E|A<<16,W+=128,i-=128}return i}function X(e,t,r){var i,n=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,Y(n,a,t,r),r%=128,i=0;i>(7&n)&1),J(t,e),J(e,e),Q(e,t,i)}function re(e,t){var r=[m(),m(),m(),m()];T(r[0],i),T(r[1],s),T(r[2],f),q(r[3],i,s),te(e,r,t)}function ie(e,t,r){var i,n=new Uint8Array(64),a=[m(),m(),m(),m()];for(r||o(t,32),X(n,t,32),n[0]&=248,n[31]&=127,n[31]|=64,re(a,n),ee(e,a),i=0;i<32;i++)t[i+32]=e[i];return 0}var ne=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var r,i,n,a;for(i=63;32<=i;--i){for(r=0,n=i-32,a=i-12;n>8,t[n]-=256*r;t[n]+=r,t[i]=0}for(n=r=0;n<32;n++)t[n]+=r-(t[31]>>4)*ne[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*ne[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function oe(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function se(e,t,r,i){var n,a,o=new Uint8Array(64),s=new Uint8Array(64),c=new Uint8Array(64),u=new Float64Array(64),f=[m(),m(),m(),m()];X(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var p=r+64;for(n=0;n>7&&N(e[0],u,e[0]),q(e[3],e[0],e[1]),0)}function ue(e,t,r,i){var n,a=new Uint8Array(32),o=new Uint8Array(64),s=[m(),m(),m(),m()],c=[m(),m(),m(),m()];if(-1,r<64)return-1;if(ce(c,i))return-1;for(n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,M=String.fromCharCode;function D(e){throw new RangeError(o[e])}function s(e,t){var r=e.split("@"),i="";return 1>1,e+=z(e/t);455z((C-n)/p))&&D("overflow"),n+=l*p;var d=h<=o?1:o+26<=h?26:h-o;if(lz(C/m)&&D("overflow"),p*=m}var g=r.length+1;o=L(n-f,g,0==f),z(n/g)>C-a&&D("overflow"),a+=z(n/g),n%=g,r.splice(n++,0,a)}return String.fromCodePoint.apply(String,r)},u=function(e){var t=[],r=(e=N(e)).length,i=128,n=0,a=72,o=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(o=(u=f.next()).done);o=!0){var p=u.value;p<128&&t.push(M(p))}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}var h=t.length,l=h;for(h&&t.push("-");lz((C-n)/w)&&D("overflow"),n+=(d-i)*w,i=d;var k=!0,x=!1,S=void 0;try{for(var j,E=e[Symbol.iterator]();!(k=(j=E.next()).done);k=!0){var A=j.value;if(AC&&D("overflow"),A==i){for(var I=n,P=36;;P+=36){var O=P<=a?1:a+26<=P?26:P-a;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function l(e){for(var t="",r=0,i=e.length;rA-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(V,"g"),Y=new RegExp($,"g"),X=new RegExp(F("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',W),"g"),J=new RegExp(F("[^]",V,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),Q=J;function ee(e){var t=l(e);return t.match(Z)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,a={},o=r.query.split("&"),s=0,c=o.length;s",'"',"`"," ","\r","\n","\t"]),M=["'"].concat(n),D=["%","/","?",";","#"].concat(M),N=["/","?","#"],q=/^[+a-z0-9A-Z_-]{0,63}$/,L=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,U={javascript:!0,"javascript:":!0},H={javascript:!0,"javascript:":!0},K={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},V=e("querystring");function a(e,t,r){if(e&&F.isObject(e)&&e instanceof A)return e;var i=new A;return i.parse(e,t,r),i}A.prototype.parse=function(e,t,r){if(!F.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===e?"undefined":_typeof(e)));var i=e.indexOf("?"),n=-1!==i&&i>t&63|128)}function p(e){if(0==(4294967168&e))return s(e);var t="";return 0==(4294965248&e)?t=s(e>>6&31|192):0==(4294901760&e)?(u(e),t=s(e>>12&15|224),t+=f(e,6)):0==(4292870144&e)&&(t=s(e>>18&7|240),t+=f(e,12),t+=f(e,6)),t+=s(63&e|128)}function h(){if(a<=o)throw Error("Invalid byte index");var e=255&n[o];if(o++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,t;if(a>>10&1023|55296),t=56320|1023&t),n+=s(t);return n}(r)}};if("function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define(function(){return d});else if(t&&!t.nodeType)if(r)r.exports=d;else{var m={}.hasOwnProperty;for(var g in d)m.call(d,g)&&(t[g]=d[g])}else e.utf8=d}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],503:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],504:[function(e,t,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],505:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{"./support/isBuffer":504,_process:382,dup:70,inherits:320}],506:[function(e,t,r){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},{}],507:[function(e,t,r){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var n=new Uint8Array(16);t.exports=function(){return i(n),n}}else{var a=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}},{}],508:[function(e,t,r){var o=e("./lib/rng"),s=e("./lib/bytesToUuid");t.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var a=0;a<16;++a)t[i+a]=n[a];return t||s(n)}},{"./lib/bytesToUuid":506,"./lib/rng":507}],509:[function(e,t,r){var s=e("assert-plus"),i=e("util"),n=e("extsprintf"),c=e("core-util-is").isError,a=n.sprintf;function u(e){var t,r,i,n;if(s.object(e,"args"),s.bool(e.strict,"args.strict"),s.array(e.argv,"args.argv"),0===(t=e.argv).length)r={},i=[];else if(c(t[0]))r={cause:t[0]},i=t.slice(1);else if("object"===_typeof(t[0])){for(n in r={},t[0])r[n]=t[0][n];i=t.slice(1)}else s.string(t[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},i=t;return s.object(r),r.strict||e.strict||(i=i.map(function(e){return null===e?"null":void 0===e?"undefined":e})),{options:r,shortmessage:0===i.length?"":a.apply(null,i)}}function f(){var e,t,r,i,n,a,o;if(e=Array.prototype.slice.call(arguments,0),!(this instanceof f))return t=Object.create(f.prototype),f.apply(t,arguments),t;if((r=u({argv:e,strict:!1})).options.name&&(s.string(r.options.name,'error\'s "name" must be a string'),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,a=r.shortmessage,(i=r.options.cause)&&(s.ok(c(i),"cause is not an Error"),this.jse_cause=i,r.options.skipCauseMessage||(a+=": "+i.message)),this.jse_info={},r.options.info)for(o in r.options.info)this.jse_info[o]=r.options.info[o];return this.message=a,Error.call(this,a),Error.captureStackTrace&&(n=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,n)),this}function o(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof o?(i=(r=u({argv:e,strict:!0})).options,f.call(this,i,"%s",r.shortmessage),this):(t=Object.create(o.prototype),o.apply(t,arguments),t)}function p(e){s.array(e,"list of errors"),s.ok(0this._inputTypes.length&&!n.isObject(e[e.length-1]))return a.inputDefaultBlockNumberFormatter(e.pop())},s.prototype.toPayload=function(e){var t={};return e.length>this._inputTypes.length&&n.isObject(e[e.length-1])&&(t=e[e.length-1]),t.to=this._address,t.data="0x"+this.signature()+i.encodeParams(this._inputTypes,e),t},s.prototype.signature=function(){return o(this._name).slice(0,8)},s.prototype.unpackOutput=function(e){if(e){e=2<=e.length?e.slice(2):e;var t=i.decodeParams(this._outputTypes,e);return 1===t.length?t[0]:t}},s.prototype.call=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),i=this.extractCallback(e),t=this.extractDefaultBlock(e),r=this.toPayload(e);if(!i){var n=this._eth.call(r,t);return this.unpackOutput(n)}var a=this;this._eth.call(r,t,function(t,e){if(t)return i(t,null);var r=null;try{r=a.unpackOutput(e)}catch(e){t=e}i(t,r)})},s.prototype.sendTransaction=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),t=this.extractCallback(e),r=this.toPayload(e);if(0=this.buffer.length)){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,t}}},{key:"read",value:function(e){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,Array.from(t)}},{key:"readBool",value:function(){var e=this.read(1)[0];if(255===e)return!0;if(0===e)return!1;throw new n("read_bool() expected 0xff or 0x00; got +"+e)}},{key:"readVaruint",value:function(){for(var e=0,t=0,r=void 0;e|=(127&(r=this.read(1)[0]))< "+e);if(r>=7}}},{key:"writeByte",value:function(e){if(this.length>=this.buffer.length){var t=2*this.length,r=new Uint8Array(t);r.set(this.buffer,0),this.buffer=r}isNaN(e)?this.buffer[this.length]=e.codePointAt():this.buffer[this.length]=e,this.length++}},{key:"writeBytes",value:function(e){var t=this;e.forEach(function(e){t.writeByte(e)})}},{key:"writeVarbytes",value:function(e){this.writeVaruint(e.length),this.writeBytes(e)}},{key:"toString",value:function(){return this.buffer.toHex(0)}}]),e}();m.exports={StreamDeserialization:h,StreamSerialization:l,DeserializationError:n,BadMagicError:a,UnsupportedMajorVersion:o,TruncationError:s,TrailingGarbageError:c,RecursionLimitError:u,SerializerTypeError:f,SerializerValueError:p,ValueError:e,TypeError:t}}).call(this,d("buffer").Buffer)},{"./extend-error.js":570,"./utils.js":577,buffer:191}],568:[function(e,t,r){"use strict";var s=e("./ops.js"),c=e("./timestamp.js"),i=e("./utils.js"),u=e("./context.js"),f=[0,79,112,101,110,84,105,109,101,115,116,97,109,112,115,0,0,80,114,111,111,102,0,191,137,226,232,132,232,146,148],n=function(){function o(e,t){if(_classCallCheck2(this,o),!(e instanceof s.Op&&t instanceof c))throw new u.ValueError("Invalid Timestamp or fileHashOp");if(t.msg.length!==e._DIGEST_LENGTH())throw new u.ValueError("Timestamp message length and fileHashOp digest length differ");this.fileHashOp=e,this.timestamp=t}return _createClass(o,[{key:"fileDigest",value:function(){return this.timestamp.msg}},{key:"serialize",value:function(e){e.writeBytes(f),e.writeVaruint(1),this.fileHashOp.serialize(e),e.writeBytes(this.timestamp.msg),this.timestamp.serialize(e)}},{key:"serializeToBytes",value:function(){var e=new u.StreamSerialization;return this.serialize(e),e.getOutput()}},{key:"toString",value:function(){var e="DetachedTimestampFile\n";return e+="fileHashOp: "+this.fileHashOp.toString()+"\n",e+="timestamp: "+this.timestamp.toString()+"\n"}},{key:"toJson",value:function(){var e={};e.hash=i.bytesToHex(this.fileDigest()),e.op=this.fileHashOp._HASHLIB_NAME(),e.timestamp=this.timestamp.toJson()}},{key:"equals",value:function(e){return e instanceof o&&(!!e.fileHashOp.equals(this.fileHashOp)&&!!e.timestamp.equals(this.timestamp))}}],[{key:"deserialize",value:function(e){var t=void 0;if(e instanceof u.StreamDeserialization)t=e;else if(e instanceof Array)t=new u.StreamDeserialization(e);else if(e instanceof Uint8Array)t=new u.StreamDeserialization(Array.from(e));else{if(!(e instanceof ArrayBuffer))throw new Error("StreamDeserialization deserialize: Invalid param");t=new u.StreamDeserialization(Array.from(e))}t.assertMagic(f);var r=t.readVaruint();if(1!==r)throw new u.UnsupportedMajorVersion("Version "+r+" detached timestamp files are not supported");var i=s.CryptOp.deserialize(t),n=t.readBytes(i._DIGEST_LENGTH()),a=c.deserialize(t,n);return t.assertEof(),new o(i,a)}},{key:"fromBytes",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOp param");var r=void 0;if(t instanceof u.StreamDeserialization)r=e.hashFd(t);else if(t instanceof Array){var i=new u.StreamDeserialization(t);r=e.hashFd(i)}else if(t instanceof Uint8Array){var n=new u.StreamDeserialization(Array.from(t));r=e.hashFd(n)}else{if(!(t instanceof ArrayBuffer))throw new Error("DetachedTimestampFile: Invalid buffer param");var a=new u.StreamDeserialization(Array.from(t));r=e.hashFd(a)}return new o(e,new c(r))}},{key:"fromHash",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOpss param");if(t instanceof Array)return new o(e,new c(t));if(t instanceof ArrayBuffer||t instanceof Uint8Array)return new o(e,new c(Array.from(t)));throw new Error("DetachedTimestampFile: Invalid fdHash param")}}]),o}();t.exports=n},{"./context.js":567,"./ops.js":575,"./timestamp.js":576,"./utils.js":577}],569:[function(e,t,r){"use strict";var a=e("promise"),o=e("./utils.js"),s=e("./insight.js"),c=e("./blockstream.js"),u={bitcoin:[{url:"https://blockstream.info/api",type:"blockstream"},{url:"https://insight.bitpay.com/api",type:"insight"},{url:"https://blockexplorer.com/api",type:"insight"},{url:"https://bitcore.schmoock.net/insight-api",type:"insight"}],bitcoinTestnet:[{url:"https://blockstream.info/testnet/api",type:"blockstream"},{url:"https://test-insight.bitpay.com/api",type:"insight"}],litecoin:[{url:"https://ltc-bitcore1.trezor.io/api",type:"insight"},{url:"https://insight.litecore.io/api",type:"insight"}]},i=function(){function n(e){var r=this;_classCallCheck2(this,n),this.explorers=[];var t=e&&Object.prototype.hasOwnProperty.call(e,"chain")?e.chain:"bitcoin",i=e&&Object.prototype.hasOwnProperty.call(e,"timeout")?e.timeout:10;(e&&Object.prototype.hasOwnProperty.call(e,"explorers")&&1(new i)._MAX_URI_LENGTH())return console.error("URI exceeds maximum length"),!1;for(var t=0;ta.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=a.privateCalendars.length;else if(a.privateCalendars=[],a.calendars&&0!==a.calendars.length||(a.calendars=c.DEFAULT_AGGREGATORS),a.m&&0!==a.m){if(a.m<0||a.m>a.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=1,2<=a.calendars.length&&(a.m=2);o.createTimestamp(i,a.calendars,a.m,a.privateCalendars).then(function(e){if(void 0===e)return r(new Error("Error on timestamp creation"));t()}).catch(function(e){r(e)})})},createTimestamp:function(i,e,t,r){var n=[];return e&&e.forEach(function(e){var t=new c.RemoteCalendar(e);n.push(t.submit(i.msg)),console.log("Submitting to remote calendar "+e)}),r&&r.forEach(function(e,t){var r=new c.RemoteCalendar(t);r.setKey(e),n.push(r.submit(i.msg)),console.log("Submitting to remote calendar "+t)}),new Promise(function(t,r){Promise.all(n.map(u.softFail)).then(function(e){return e.filter(function(e){return!(e instanceof Error)&&void 0!==e}).forEach(function(e){i.merge(e)}),t(i)}).catch(function(e){r(e)})})},makeMerkleTree:function(e){var i=[];return e.forEach(function(e){if(e instanceof s)try{var t=u.randBytes(16),r=e.timestamp.add(new n.OpAppend(u.arrayToBytes(t))).add(new n.OpSHA256);i.push(r)}catch(e){return}else console.error("Invalid input")}),f.makeMerkleTree(i)},verify:function(e,t,i){if(!u.arrEq(e.fileDigest(),t.fileDigest()))return console.error("Expected digest "+u.bytesToHex(e.fileDigest())),console.error("File does not match original!"),new Promise(function(e,t){t(new Error("File does not match original!"))});var n=this;return new Promise(function(t,r){n.upgradeTimestamp(e.timestamp,i).then(function(){n.verifyTimestamp(e.timestamp,i).then(function(e){return t(e)}).catch(function(e){return r(e)})})})},verifyTimestamp:function(e,r){var i=[],n=this;function c(e,t){return e.attestedTimet.attestedTime?1:0}return e.allAttestations().forEach(function(e,t){i.push(n.verifyAttestation(e,t,r))}),new Promise(function(o,s){Promise.all(i.map(u.softFail)).then(function(e){var t=e.filter(function(e){return e.constructor===h.VerificationError?e:void 0});if(0this._MAX_MSG_LENGTH())){var t=this.call(e);return t.length>this._MAX_RESULT_LENGTH()&&console.error("Error : Result too long;"),t}console.error("Error : Message too long;")}}],[{key:"deserialize",value:function(e){return this.tag=e.readBytes(1)[0],t.deserializeFromTag(e,this.tag)}},{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return n.get(t).deserializeFromTag(e,t);console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),t=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t.arg=void 0===e?[]:e,t}return _inherits(r,c),_createClass(r,[{key:"serialize",value:function(e){_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"serialize",this).call(this,e),e.writeVarbytes(this.arg)}},{key:"toString",value:function(){return this._TAG_NAME()+" "+i.bytesToHex(this.arg)}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t)){var r=e.readVarbytes((new c)._MAX_RESULT_LENGTH(),1);return new(n.get(t))(r)}}}]),r}(),e=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 240}},{key:"_TAG_NAME",value:function(){return"append"}},{key:"call",value:function(e){return e.concat(this.arg)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),r=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 241}},{key:"_TAG_NAME",value:function(){return"prepend"}},{key:"call",value:function(e){return this.arg.concat(e)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),u=function(e){function t(){return _classCallCheck2(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,c),_createClass(t,[{key:"toString",value:function(){return this._TAG_NAME()}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return new(n.get(t));console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),f=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 242}},{key:"_TAG_NAME",value:function(){return"reverse"}},{key:"call",value:function(e){return 0===e.length&&console.error("Can't reverse an empty message"),e.reverse()}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),p=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 243}},{key:"_TAG_NAME",value:function(){return"hexlify"}},{key:"_MAX_MSG_LENGTH",value:function(){return u._MAX_RESULT_LENGTH()}},{key:"call",value:function(e){0===e.length&&console.error("Can't hexlify an empty message")}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),h=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_HASHLIB_NAME",value:function(){return 0}},{key:"call",value:function(e,t){for(var r=("keccak256"===e._HASHLIB_NAME()?s(e._HASHLIB_NAME()).update(a.from(t)):o.createHash(e._HASHLIB_NAME()).update(a.from(t))).digest(),i=[r.length],n=0;n(new m.Op)._MAX_MSG_LENGTH())throw new TypeError("Message exceeds Op length limit; "+e.length+" > "+(new m.Op)._MAX_MSG_LENGTH());this.msg=e,this.attestations=[],this.ops=new Map}return _createClass(h,[{key:"getDigest",value:function(){return this.msg}},{key:"serialize",value:function(r){var i=this;if(!this.attestations&&!this.ops)throw new a.ValueError("An empty timestamp can't be serialized");var e=this.attestations;if(e.sort(function(e,t){return e.compareTo(t)}),1 "+t.toString()+u(o,n,i)+"\n",f+=e.strTree(a+1,o)});else if(0>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},r.charsToHex=function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&i).toString(16))}return t.join("")},r.charToByte=function(e){return e.charCodeAt(0)},r.charsToBytes=function(e){for(var t=[],r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,f=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,p=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,l=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",i.copy(m[e])}function g(e){var t=e.match(o);if(!t)return!1;var r,i=+t[1],n=+t[2],a=+t[3];return 1<=n&&n<=12&&1<=a&&a<=(2!=n||((r=i)%4!=0||r%100==0&&r%400!=0)?s[n]:29)}function v(e,t){var r=e.match(c);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return(i<=23&&n<=59&&a<=59||23==i&&59==n&&60==a)&&(!t||o)}(t.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d},m.full={date:g,time:v,"date-time":function(e){var t=e.split(b);return 2==t.length&&g(t[0])&&v(t[1],!0)},uri:function(e){return y.test(e)&&a.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&n.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d};var b=/t|\s/i;var y=/\/|:/;var _=/[^\\]\\Z/;function w(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":12}],7:[function(e,t,r){"use strict";var I=e("./resolve"),P=e("./util"),O=e("./error_classes"),T=e("fast-json-stable-stringify"),B=e("../dotjs/validate"),C=P.ucs2length,F=e("fast-deep-equal"),R=O.Validation;function z(e,t,r){var i=n.call(this,e,t,r);return 0<=i?{index:i,compiling:!0}:{index:i=this._compilations.length,compiling:!(this._compilations[i]={schema:e,root:t,baseId:r})}}function M(e,t,r){var i=n.call(this,e,t,r);0<=i&&this._compilations.splice(i,1)}function n(e,t,r){for(var i=0;i",b=l?">":"<",y=void 0;if(g){var _=e.util.getData(m.$data,o,e.dataPathArr),w="exclusive"+a,k="exclType"+a,x="exclIsNumber"+a,S="' + "+(A="op"+a)+" + '";n+=" var schemaExcl"+a+" = "+_+"; ",n+=" var "+w+"; var "+k+" = typeof "+(_="schemaExcl"+a)+"; if ("+k+" != 'boolean' && "+k+" != 'undefined' && "+k+" != 'number') { ";var j;y=d;(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var E=n;n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+k+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+_+" "+v+"= "+i+") ? "+p+" "+b+"= "+_+" : "+p+" "+b+" "+i+" ) : ( ("+w+" = "+_+" === true) ? "+p+" "+b+"= "+i+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { var op"+a+" = "+w+" ? '"+v+"' : '"+v+"='; ",void 0===s&&(y=d,u=e.errSchemaPath+"/"+d,i=_,h=g)}else{S=v;if((x="number"==typeof m)&&h){var A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ( "+i+" === undefined || "+m+" "+v+"= "+i+" ? "+p+" "+b+"= "+m+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { "}else{x&&void 0===s?(w=!0,y=d,u=e.errSchemaPath+"/"+d,i=m,b+="="):(x&&(i=Math[l?"min":"max"](m,s)),m===(!x||i)?(w=!0,y=d,u=e.errSchemaPath+"/"+d,b+="="):(w=!1,S+="="));A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+" "+b+" "+i+" || "+p+" !== "+p+") { "}}y=y||t,(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+A+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+S+" ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";E=n;return n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s;var l="maxLength"==t?">":"<";n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+p+".length ":n+=" ucs2length("+p+") ",n+=" "+l+" "+i+") { ";var d=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+p+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.schema[t],a=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var f="valid"+c.level,p=c.baseId,h=!0,l=n;if(l)for(var d,m=-1,g=l.length-1;m "+E+") { ";var I=f+"["+E+"]";l.schema=j,l.schemaPath=s+"["+E+"]",l.errSchemaPath=c+"/"+E,l.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),l.dataPathArr[v]=E;var P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",i+=" } ",u&&(i+=" if ("+m+") { ",d+="}")}if("object"==(void 0===_?"undefined":_typeof(_))&&e.util.schemaHasRules(_,e.RULES.all)){l.schema=_,l.schemaPath=e.schemaPath+".additionalItems",l.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+f+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" } } ",u&&(i+=" if ("+m+") { ",d+="}")}}else if(e.util.schemaHasRules(o,e.RULES.all)){l.schema=o,l.schemaPath=s,l.errSchemaPath=c,i+=" for (var "+g+" = 0; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+d+" if ("+h+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],30:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="var division"+a+";if (",h&&(n+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),n+=" (division"+a+" = "+p+" / "+i+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var l=l||[];l.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var d=n;return n=l.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+d+"]); ":n+=" validate.errors = ["+d+"]; return false; ":n+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="errs__"+n,h=e.util.copy(e);h.level++;var l="valid"+h.level;if(e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+p+" = errors; ";var d,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(d=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,d&&(h.opts.allErrors=d),e.compositeRule=h.compositeRule=m,i+=" if ("+l+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var v=i;i=g.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ");return i}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="valid"+n,h="errs__"+n,l=e.util.copy(e),d="";l.level++;var m="valid"+l.level,g=l.baseId,v="prevValid"+n,b="passingSchemas"+n;i+="var "+h+" = errors , "+v+" = false , "+p+" = false , "+b+" = null; ";var y=e.compositeRule;e.compositeRule=l.compositeRule=!0;var _=o;if(_)for(var w,k=-1,x=_.length-1;k=e.opts.loopRequired,k=e.opts.ownProperties;if(u)if(i+=" var missing"+n+"; ",w){h||(i+=" var "+l+" = validate.schema"+s+"; ");var x="' + "+(P="schema"+n+"["+(E="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(_,P,e.opts.jsonPointers)),i+=" var "+p+" = true; ",h&&(i+=" if (schema"+n+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+n+")) "+p+" = false; else {"),i+=" for (var "+E+" = 0; "+E+" < "+l+".length; "+E+"++) { "+p+" = "+f+"["+l+"["+E+"]] !== undefined ",k&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", "+l+"["+E+"]) "),i+="; if (!"+p+") break; } ",h&&(i+=" } "),i+=" if (!"+p+") { ",(I=I||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+x+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var S=i;i=I.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var j=d;if(j)for(var E=-1,A=j.length-1;E 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(0<=d.indexOf("object")||0<=d.indexOf("array")))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var g="checkDataType"+(m?"s":"");n+=" if ("+e.util[g](d,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",l&&(n+=" } "),n+=" if (!"+h+") { ";var v=v||[];v.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var b=n;n=v.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { ")}else f&&(n+=" if (true) { ");return n}},{}],39:[function(e,t,r){"use strict";t.exports=function(i,e,t){var r="",n=!0===i.schema.$async,a=i.util.schemaHasRulesExcept(i.schema,i.RULES.all,"$ref"),o=i.self._getId(i.schema);if(i.isTop&&(r+=" var validate = ",n&&(i.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(i.opts.sourceCode||i.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof i.schema||!a&&!i.schema.$ref){e="false schema";var s=i.level,c=i.dataLevel,u=i.schema[e],f=i.schemaPath+i.util.getProperty(e),p=i.errSchemaPath+"/"+e,h=!i.opts.allErrors,l="data"+(c||""),d="valid"+s;if(!1===i.schema){i.isTop?h=!0:r+=" var "+d+" = false; ",(W=W||[]).push(r),r="",!1!==i.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(p)+" , params: {} ",!1!==i.opts.messages&&(r+=" , message: 'boolean schema is false' "),i.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+i.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var m=r;r=W.pop(),!i.compositeRule&&h?i.async?r+=" throw new ValidationError(["+m+"]); ":r+=" validate.errors = ["+m+"]; return false; ":r+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else i.isTop?r+=n?" return data; ":" validate.errors = null; return true; ":r+=" var "+d+" = true; ";return i.isTop&&(r+=" }; return validate; "),r}if(i.isTop){var g=i.isTop;s=i.level=0,c=i.dataLevel=0,l="data";i.rootId=i.resolve.fullPath(i.self._getId(i.root.schema)),i.baseId=i.baseId||i.rootId,delete i.isTop,i.dataPathArr=[void 0],r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{s=i.level,l="data"+((c=i.dataLevel)||"");if(o&&(i.baseId=i.resolve.url(i.baseId,o)),n&&!i.async)throw new Error("async schema in sync schema");r+=" var errs_"+s+" = errors;"}d="valid"+s,h=!i.opts.allErrors;var v="",b="",y=i.schema.type,_=Array.isArray(y);if(_&&1==y.length&&(y=y[0],_=!1),i.schema.$ref&&a){if("fail"==i.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+i.errSchemaPath+'" (see option extendRefs)');!0!==i.opts.extendRefs&&(a=!1,i.logger.warn('$ref: keywords ignored in schema at path "'+i.errSchemaPath+'"'))}if(i.schema.$comment&&i.opts.$comment&&(r+=" "+i.RULES.all.$comment.code(i,"$comment")),y){if(i.opts.coerceTypes)var w=i.util.coerceToTypes(i.opts.coerceTypes,y);var k=i.RULES.types[y];if(w||_||!0===k||k&&!Z(k)){f=i.schemaPath+".type",p=i.errSchemaPath+"/type",f=i.schemaPath+".type",p=i.errSchemaPath+"/type";var x=_?"checkDataTypes":"checkDataType";if(r+=" if ("+i.util[x](y,l,!0)+") { ",w){var S="dataType"+s,j="coerced"+s;r+=" var "+S+" = typeof "+l+"; ","array"==i.opts.coerceTypes&&(r+=" if ("+S+" == 'object' && Array.isArray("+l+")) "+S+" = 'array'; "),r+=" var "+j+" = undefined; ";var E="",A=w;if(A)for(var I,P=-1,O=A.length-1;P>6],n=0==(32&r);if(31==(31&r)){var a=r;for(r=0;128==(128&a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function p(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)o++;(n=new u(2+o))[0]=a,n[1]=128|o;s=1+o;for(var c=i.length;0>=8)n[s]=255&c;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new u(2*e.length),i=0;i>=7)n++}var o=new u(n),s=o.length-1;for(i=e.length-1;0<=i;i--){a=e[i];for(o[s--]=127&a;0<(a>>=7);)o[s--]=128|127&a}return this._createEncoderBuffer(o)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[c(i.getFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(i.getFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.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&&!u.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new u(r)}if(u.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new u(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var a=e;256<=a;a>>=8)i++;for(a=(n=new Array(i)).length-1;0<=a;a--)n[a]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new u(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var a=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),a.length!==n.defaultBuffer.length)return!1;for(i=0;i=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0===(t&=127))throw c("Indefinite length not supported");if(4this._size-i)return null;if(this._offset=i,0===this.length)return t?a.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?n:n.toString("utf8")},i.prototype.readOID=function(e){e||(e=s.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],i=0,n=0;n>0),r.join(".")},i.prototype._readTag=function(e){o.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw c("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(4this._size-r)return null;this._offset=r;for(var i=this._buf[this._offset],n=0,a=0;a>0},t.exports=i},{"./errors":60,"./types":63,assert:67,"safer-buffer":448}],63:[function(e,t,r){t.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},{}],64:[function(e,t,r){var n=e("assert"),a=e("safer-buffer").Buffer,o=e("./types"),i=e("./errors").newInvalidAsn1Error,s={size:1024,growthFactor:8};function c(e){var r,i;r=s,i=e||{},n.ok(r),n.equal(void 0===r?"undefined":_typeof(r),"object"),n.ok(i),n.equal(void 0===i?"undefined":_typeof(i),"object"),Object.getOwnPropertyNames(r).forEach(function(e){if(!i[e]){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,t)}}),e=i,this._buf=a.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw i(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},c.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=o.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&1 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;0>>24,e<<=8},c.prototype.writeNull=function(){this.writeByte(o.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=o.Enumeration),this.writeInt(e,t)},c.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=o.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},c.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+(void 0===e?"undefined":_typeof(e))+")");"number"!=typeof t&&(t=o.OctetString);var r=a.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},c.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!a.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},c.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(e){t.writeString(e)})},c.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=o.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),i=[];i.push(40*parseInt(r[0],10)+parseInt(r[1],10)),r.slice(2).forEach(function(e){var t,r;t=i,(r=parseInt(e,10))<128?t.push(r):(r<16384?t.push(r>>>7|128):(r<2097152?t.push(r>>>14|128):(r<268435456?t.push(r>>>21|128):(t.push(255&(r>>>28|128)),t.push(255&(r>>>21|128))),t.push(255&(r>>>14|128))),t.push(255&(r>>>7|128))),t.push(127&r))});var n=this;this._ensure(2+i.length),this.writeByte(t),this.writeLength(i.length),i.forEach(function(e){n.writeByte(e)})},c.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw i("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},c.prototype.startSequence=function(e){"number"!=typeof e&&(e=o.Sequence|o.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw i("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},c.prototype._shift=function(e,t,r){n.ok(void 0!==e),n.ok(void 0!==t),n.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},c.prototype._ensure=function(e){if(n.ok(e),this._size-this._offset>16&255,a[o++]=t>>8&255,a[o++]=255&t;var u,f;2===n&&(t=p[e.charCodeAt(c)]<<2|p[e.charCodeAt(c+1)]>>4,a[o++]=255&t);1===n&&(t=p[e.charCodeAt(c)]<<10|p[e.charCodeAt(c+1)]<<4|p[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],a=0,o=r-i;a>2]+s[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],p=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,a=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return a.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},{}],76:[function(e,t,r){"use strict";var y=e("tweetnacl").lowlevel.crypto_hash,s=0,c=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};function n(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}function u(e,t){var r,i=0;for(r=0;r<4;r++,s++)t<=s&&(s=0),i=i<<8|e[s];return i}c.prototype.encipher=function(e,t){void 0===t&&(t=new Uint8Array(e.buffer),0!==e.byteOffset&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=n(this.S,t,0)^this.P[r],e[0]^=n(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i},c.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);0!==e.byteOffset&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;0>>24,r[4*i+2]=a[i]>>>16,r[4*i+1]=a[i]>>>8,r[4*i+0]=a[i]}t.exports={BLOCKS:f,HASHSIZE:32,hash:_,pbkdf:function(e,t,r,i,n,a,o){var s,c,u,f,p,h,l=new Uint8Array(64),d=new Uint8Array(64),m=new Uint8Array(32),g=new Uint8Array(32),v=new Uint8Array(i+4),b=a;if(o<1)return-1;if(0===t||0===i||0===a||a>m.byteLength*m.byteLength||1<<20>>24,v[i+1]=h>>>16,v[i+2]=h>>>8,v[i+3]=h,y(d,v,i+4),_(l,d,g),s=m.byteLength;s--;)m[s]=g[s];for(s=1;sa[o]^r?1:-1;return c==u?0:u=t&&e<=r}function J(e){return"[object Array]"==Object.prototype.toString.call(e)}function Q(e,t,r){for(var i,n,a=[0],o=0,s=e.length;or-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}function ee(e,t){return(1(r=e.length)){for(i="0",t-=r;--t;i+="0");e+=i}else tt;)u[n]=0,n||(++a,u.unshift(1));for(o=u.length;!u[--o];);for(p=0,e="";p<=o;e+=U.charAt(u[p++]));e=te(e,a)}return e}function P(e,t,r,i){var n,a,o,s,c;if(r=null!=r&&k(r,0,8,i,q)?0|r:b,!e.c)return e.toString();if(n=e.c[0],o=e.e,null==t)c=Z(e.c),c=19==i||24==i&&o<=h?ee(c,o):te(c,o);else if(a=(e=C(new I(e),t,r)).e,s=(c=Z(e.c)).length,19==i||24==i&&(t<=a||a<=h)){for(;sy?e.c=e.e=null:e.c=r=p.length){if(!i)break e;for(;p.length<=u;p.push(0));c=f=0,o=(a%=K)-K+(n=1)}else{for(c=s=p[u],n=1;10<=s;s/=10,n++);f=(o=(a%=K)-K+n)<0?0:c/h[n-o-1]%10|0}if(i=i||t<0||null!=p[u+1]||(o<0?c:c%h[n-o-1]),i=r<4?(f||i)&&(0==r||r==(e.s<0?3:2)):5y?e.c=e.e=null:e.er)return null!=(e=n[r++])};return o(t="DECIMAL_PLACES")&&k(e,0,$,2,t)&&(d=0|e),i[t]=d,o(t="ROUNDING_MODE")&&k(e,0,8,2,t)&&(b=0|e),i[t]=b,o(t="EXPONENTIAL_AT")&&(J(e)?k(e[0],-$,0,2,t)&&k(e[1],0,$,2,t)&&(h=0|e[0],l=0|e[1]):k(e,-$,$,2,t)&&(h=-(l=0|(e<0?-e:e)))),i[t]=[h,l],o(t="RANGE")&&(J(e)?k(e[0],-$,-1,2,t)&&k(e[1],1,$,2,t)&&(m=0|e[0],y=0|e[1]):k(e,-$,$,2,t)&&(0|e?m=-(y=0|(e<0?-e:e)):w&&B(2,t+" cannot be zero",e))),i[t]=[m,y],o(t="ERRORS")&&(e===!!e||1===e||0===e?(_=0,k=(w=!!e)?O:X):w&&B(2,t+D,e)),i[t]=w,o(t="CRYPTO")&&(e===!!e||1===e||0===e?(x=!(!e||!F||"object"!=(void 0===F?"undefined":_typeof(F))),e&&!x&&w&&B(2,"crypto unavailable",F)):w&&B(2,t+D,e)),i[t]=x,o(t="MODULO_MODE")&&k(e,0,9,2,t)&&(S=0|e),i[t]=S,o(t="POW_PRECISION")&&k(e,0,$,2,t)&&(j=0|e),i[t]=j,o(t="FORMAT")&&("object"==(void 0===e?"undefined":_typeof(e))?E=e:w&&B(2,t+" not an object",e)),i[t]=E,i},I.max=function(){return n(arguments,i.lt)},I.min=function(){return n(arguments,i.gt)},I.random=(r=9007199254740992,u=Math.random()*r&2097151?function(){return N(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,n,a,o=0,s=[],c=new I(v);if(e=null!=e&&k(e,0,$,14)?0|e:d,n=M(e/K),x)if(F&&F.getRandomValues){for(t=F.getRandomValues(new Uint32Array(n*=2));o>>11))?(r=F.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(s.push(a%1e14),o+=2);o=n/2}else if(F&&F.randomBytes){for(t=F.randomBytes(n*=7);ot[n]?1:-1;break}return a}function A(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r](x[s]||0)&&o--,k<0)l.push(1),c=!0;else{for(b=x.length,_=S.length,k+=2,1<(u=N(n/(S[s=0]+1)))&&(S=j(S,u,n),x=j(x,u,n),_=S.length,b=x.length),v=_,m=(d=x.slice(0,_)).length;m<_;d[m++]=0);(w=S.slice()).unshift(0),y=S[0],S[1]>=n/2&&y++;do{if(u=0,(a=E(S,d,_,m))<0){if(g=d[0],_!=m&&(g=g*n+(d[1]||0)),1<(u=N(g/y)))for(n<=u&&(u=n-1),p=(f=j(S,u,n)).length,m=d.length;1==E(f,d,p,m);)u--,A(f,_this.c.length-2},i.isNaN=function(){return!this.s},i.isNegative=i.isNeg=function(){return this.s<0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.lessThan=i.lt=function(e,t){return _=8,Y(this,new I(e,t))<0},i.lessThanOrEqualTo=i.lte=function(e,t){return _=9,-1===(t=Y(this,new I(e,t)))||0===t},i.minus=i.sub=function(e,t){var r,i,n,a,o=this,s=o.s;if(_=10,t=(e=new I(e,t)).s,!s||!t)return new I(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/K,u=e.e/K,f=o.c,p=e.c;if(!c||!u){if(!f||!p)return f?(e.s=-t,e):new I(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new I(f[0]?o:3==b?-0:0)}if(c=W(c),u=W(u),f=f.slice(),s=c-u){for((n=(a=s<0)?(s=-s,f):(u=c,p)).reverse(),t=s;t--;n.push(0));n.reverse()}else for(i=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;tt&&(t=this.e+1),t},i.round=function(e,t){var r=new I(this);return(null==e||k(e,0,$,15))&&C(r,~~e+this.e+1,null!=t&&k(t,0,8,15,q)?0|t:b),r},i.shift=function(e){var t=this;return k(e,-a,a,16,"argument")?t.times("1e"+re(e)):new I(t.c&&t.c[0]&&(e<-a||at&&(r.c.length=t)}if(!(i=N(i/2)))break;n=n.times(n),t&&n.c&&n.c.length>t&&(n.c.length=t)}return e<0&&(r=v.div(r)),t?C(r,j,b):r},i.toPrecision=function(e,t){return P(this,null!=e&&k(e,1,$,24,"precision")?0|e:null,t,24)},i.toString=function(e){var t,r=this.s,i=this.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=Z(this.c),t=null!=e&&k(e,2,64,25,"base")?A(te(t,i),0|e,10,r):i<=h||l<=i?ee(t,i):te(t,i),r<0&&this.c[0]&&(t="-"+t)),t},i.truncated=i.trunc=function(){return C(new I(this),this.e+1,1)},i.valueOf=i.toJSON=function(){return this.toString()},null!=t&&I.config(t),I}(),"function"==typeof define&&define.amd)define(function(){return t});else if(void 0!==i&&i.exports){if(i.exports=t,!F)try{F=r("crypto")}catch(e){}}else e.BigNumber=t}(this)},{crypto:204}],78:[function(i,n,e){(function(e,t){"use strict";var r=n.exports;r.version="v"+i("./package.json").version,r.versionGuard=function(e){if(void 0!==e){throw new Error("More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.")}},r.versionGuard(e._bitcore),e._bitcore=r.version,r.crypto={},r.crypto.BN=i("./lib/crypto/bn"),r.crypto.ECDSA=i("./lib/crypto/ecdsa"),r.crypto.Hash=i("./lib/crypto/hash"),r.crypto.Random=i("./lib/crypto/random"),r.crypto.Point=i("./lib/crypto/point"),r.crypto.Signature=i("./lib/crypto/signature"),r.encoding={},r.encoding.Base58=i("./lib/encoding/base58"),r.encoding.Base58Check=i("./lib/encoding/base58check"),r.encoding.BufferReader=i("./lib/encoding/bufferreader"),r.encoding.BufferWriter=i("./lib/encoding/bufferwriter"),r.encoding.Varint=i("./lib/encoding/varint"),r.util={},r.util.buffer=i("./lib/util/buffer"),r.util.js=i("./lib/util/js"),r.util.preconditions=i("./lib/util/preconditions"),r.errors=i("./lib/errors"),r.Address=i("./lib/address"),r.Block=i("./lib/block"),r.MerkleBlock=i("./lib/block/merkleblock"),r.BlockHeader=i("./lib/block/blockheader"),r.HDPrivateKey=i("./lib/hdprivatekey.js"),r.HDPublicKey=i("./lib/hdpublickey.js"),r.Networks=i("./lib/networks"),r.Opcode=i("./lib/opcode"),r.PrivateKey=i("./lib/privatekey"),r.PublicKey=i("./lib/publickey"),r.Script=i("./lib/script"),r.Transaction=i("./lib/transaction"),r.URI=i("./lib/uri"),r.Unit=i("./lib/unit"),r.deps={},r.deps.bnjs=i("bn.js"),r.deps.bs58=i("bs58"),r.deps.Buffer=t,r.deps.elliptic=i("elliptic"),r.deps._=i("lodash"),r._HDKeyCache=i("./lib/hdkeycache"),r.Transaction.sighash=i("./lib/transaction/sighash")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i("buffer").Buffer)},{"./lib/address":79,"./lib/block":82,"./lib/block/blockheader":81,"./lib/block/merkleblock":83,"./lib/crypto/bn":84,"./lib/crypto/ecdsa":85,"./lib/crypto/hash":86,"./lib/crypto/point":87,"./lib/crypto/random":88,"./lib/crypto/signature":89,"./lib/encoding/base58":90,"./lib/encoding/base58check":91,"./lib/encoding/bufferreader":92,"./lib/encoding/bufferwriter":93,"./lib/encoding/varint":94,"./lib/errors":95,"./lib/hdkeycache":97,"./lib/hdprivatekey.js":98,"./lib/hdpublickey.js":99,"./lib/networks":100,"./lib/opcode":101,"./lib/privatekey":102,"./lib/publickey":103,"./lib/script":104,"./lib/transaction":107,"./lib/transaction/sighash":115,"./lib/unit":119,"./lib/uri":120,"./lib/util/buffer":121,"./lib/util/js":122,"./lib/util/preconditions":123,"./package.json":150,"bn.js":124,bs58:125,buffer:191,elliptic:127,lodash:149}],79:[function(e,t,r){(function(a){"use strict";var n=e("lodash"),o=e("./util/preconditions"),i=e("./errors"),s=e("./encoding/base58check"),c=e("./networks"),r=e("./crypto/hash"),u=e("./util/js"),f=e("./publickey");function p(e,t,r){if(!(this instanceof p))return new p(e,t,r);if(n.isArray(e)&&n.isNumber(t))return p.createMultisig(e,t,r);if(e instanceof p)return e;if(o.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!c.get(t))throw new TypeError('Second argument must be "livenet" or "testnet".');if(r&&r!==p.PayToPublicKeyHash&&r!==p.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||c.get(t)||c.defaultNetwork,i.type=i.type||r||p.PayToPublicKeyHash,u.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}p.prototype._classifyArguments=function(e,t,r){if((e instanceof a||e instanceof Uint8Array)&&20===e.length)return p._transformHash(e);if((e instanceof a||e instanceof Uint8Array)&&21===e.length)return p._transformBuffer(e,t,r);if(e instanceof f)return p._transformPublicKey(e);if(e instanceof h)return p._transformScript(e,t);if("string"==typeof e)return p._transformString(e,t,r);if(n.isObject(e))return p._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")},p.PayToPublicKeyHash="pubkeyhash",p.PayToScriptHash="scripthash",p._transformHash=function(e){var t={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==e.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t},p._transformObject=function(e){return o.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),o.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?new a(e.hash,"hex"):e.hashBuffer,network:c.get(e.network)||c.defaultNetwork,type:e.type}},p._classifyFromVersion=function(e){var t={},r=c.get(e[0],"pubkeyhash"),i=c.get(e[0],"scripthash");return r?(t.network=r,t.type=p.PayToPublicKeyHash):i&&(t.network=i,t.type=p.PayToScriptHash),t},p._transformBuffer=function(e,t,r){var i={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==e.length)throw new TypeError("Address buffers must be exactly 21 bytes.");t=c.get(t);var n=p._classifyFromVersion(e);if(!n.network||t&&t!==n.network)throw new TypeError("Address has mismatched network type.");if(!n.type||r&&r!==n.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=n.network,i.type=n.type,i},p._transformPublicKey=function(e){var t={};if(!(e instanceof f))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=r.sha256ripemd160(e.toBuffer()),t.type=p.PayToPublicKeyHash,t},p._transformScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new i.Script.CantDeriveAddress(e);return r},p.createMultisig=function(e,t,r){return r=r||e[0].network||c.defaultNetwork,p.payingTo(h.buildMultisigOut(e,t),r)},p._transformString=function(e,t,r){if("string"!=typeof e)throw new TypeError("data parameter supplied is not a string.");e=e.trim();var i=s.decode(e);return p._transformBuffer(i,t,r)},p.fromPublicKey=function(e,t){var r=p._transformPublicKey(e);return t=t||c.defaultNetwork,new p(r.hashBuffer,t,r.type)},p.fromPublicKeyHash=function(e,t){return new p(p._transformHash(e).hashBuffer,t,p.PayToPublicKeyHash)},p.fromScriptHash=function(e,t){return o.checkArgument(e,"hash parameter is required"),new p(p._transformHash(e).hashBuffer,t,p.PayToScriptHash)},p.payingTo=function(e,t){return o.checkArgument(e,"script is required"),o.checkArgument(e instanceof h,"script must be instance of Script"),p.fromScriptHash(r.sha256ripemd160(e.toBuffer()),t)},p.fromScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=p._transformScript(e,t);return new p(r.hashBuffer,t,r.type)},p.fromBuffer=function(e,t,r){var i=p._transformBuffer(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromString=function(e,t,r){var i=p._transformString(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromObject=function(e){return o.checkState(u.isHexa(e.hash),'Unexpected hash property, "'+e.hash+'", expected to be hex.'),new p(new a(e.hash,"hex"),e.network,e.type)},p.getValidationError=function(e,t,r){var i;try{new p(e,t,r)}catch(e){i=e}return i},p.isValid=function(e,t,r){return!p.getValidationError(e,t,r)},p.prototype.isPayToPublicKeyHash=function(){return this.type===p.PayToPublicKeyHash},p.prototype.isPayToScriptHash=function(){return this.type===p.PayToScriptHash},p.prototype.toBuffer=function(){var e=new a([this.network[this.type]]);return a.concat([e,this.hashBuffer])},p.prototype.toObject=p.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},p.prototype.toString=function(){return s.encode(this.toBuffer())},p.prototype.inspect=function(){return""},t.exports=p;var h=e("./script")}).call(this,e("buffer").Buffer)},{"./crypto/hash":86,"./encoding/base58check":91,"./errors":95,"./networks":100,"./publickey":103,"./script":104,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],80:[function(t,l,e){(function(o){"use strict";var r=t("lodash"),n=t("./blockheader"),i=t("../crypto/bn"),a=t("../util/buffer"),s=t("../encoding/bufferreader"),c=t("../encoding/bufferwriter"),u=t("../crypto/hash"),f=t("../transaction"),p=t("../util/preconditions");function h(e){return this instanceof h?(r.extend(this,h._from(e)),this):new h(e)}h.MAX_BLOCK_SIZE=1e6,h._from=function(e){var t={};if(a.isBuffer(e))t=h._fromBufferReader(s(e));else{if(!r.isObject(e))throw new TypeError("Unrecognized argument for Block");t=h._fromObject(e)}return t},h._fromObject=function(e){var t=[];return e.transactions.forEach(function(e){e instanceof f?t.push(e):t.push(f().fromObject(e))}),{header:n.fromObject(e.header),transactions:t}},h.fromObject=function(e){return new h(h._fromObject(e))},h._fromBufferReader=function(e){var t={};p.checkState(!e.finished(),"No block data received"),t.header=n.fromBufferReader(e);var r=e.readVarintNum();t.transactions=[];for(var i=0;i"},h.Values={START_OF_BLOCK:8,NULL_HASH:new o("0000000000000000000000000000000000000000000000000000000000000000","hex")},l.exports=h}).call(this,t("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../transaction":107,"../util/buffer":121,"../util/preconditions":123,"./blockheader":81,buffer:191,lodash:149}],81:[function(f,p,e){(function(i){"use strict";var n=f("lodash"),a=f("../crypto/bn"),o=f("../util/buffer"),s=f("../encoding/bufferreader"),t=f("../encoding/bufferwriter"),r=f("../crypto/hash"),c=(f("../util/js"),f("../util/preconditions")),u=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&c.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};u._from=function(e){var t={};if(o.isBuffer(e))t=u._fromBufferReader(s(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for BlockHeader");t=u._fromObject(e)}return t},u._fromObject=function(e){c.checkArgument(e,"data is required");var t=e.prevHash,r=e.merkleRoot;return n.isString(e.prevHash)&&(t=o.reverse(new i(e.prevHash,"hex"))),n.isString(e.merkleRoot)&&(r=o.reverse(new i(e.merkleRoot,"hex"))),{hash:e.hash,version:e.version,prevHash:t,merkleRoot:r,time:e.time,timestamp:e.time,bits:e.bits,nonce:e.nonce}},u.fromObject=function(e){var t=u._fromObject(e);return new u(t)},u.fromRawBlock=function(e){o.isBuffer(e)||(e=new i(e,"binary"));var t=s(e);t.pos=u.Constants.START_OF_HEADER;var r=u._fromBufferReader(t);return new u(r)},u.fromBuffer=function(e){var t=u._fromBufferReader(s(e));return new u(t)},u.fromString=function(e){var t=new i(e,"hex");return u.fromBuffer(t)},u._fromBufferReader=function(e){var t={};return t.version=e.readUInt32LE(),t.prevHash=e.read(32),t.merkleRoot=e.read(32),t.time=e.readUInt32LE(),t.bits=e.readUInt32LE(),t.nonce=e.readUInt32LE(),t},u.fromBufferReader=function(e){var t=u._fromBufferReader(e);return new u(t)},u.prototype.toObject=u.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:o.reverse(this.prevHash).toString("hex"),merkleRoot:o.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},u.prototype.toBuffer=function(){return this.toBufferWriter().concat()},u.prototype.toString=function(){return this.toBuffer().toString("hex")},u.prototype.toBufferWriter=function(e){return e||(e=new t),e.writeUInt32LE(this.version),e.write(this.prevHash),e.write(this.merkleRoot),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e},u.prototype.getTargetDifficulty=function(e){e=e||this.bits;for(var t=new a(16777215&e),r=8*((e>>>24)-3);0e+u.Constants.MAX_TIME_OFFSET)},u.prototype.validProofOfWork=function(){var e=new a(this.id,"hex"),t=this.getTargetDifficulty();return!(0"},u.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new a("10000000000000000000000000000000000000000000000000000000000000000","hex")},p.exports=u}).call(this,f("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],82:[function(e,t,r){t.exports=e("./block"),t.exports.BlockHeader=e("./blockheader"),t.exports.MerkleBlock=e("./merkleblock")},{"./block":80,"./blockheader":81,"./merkleblock":83}],83:[function(e,t,r){(function(s){"use strict";var n=e("lodash"),a=e("./blockheader"),o=e("../util/buffer"),r=e("../encoding/bufferreader"),i=e("../encoding/bufferwriter"),c=e("../crypto/hash"),u=(e("../util/js"),e("../transaction")),f=e("../util/preconditions");function p(e){if(!(this instanceof p))return new p(e);var t={};if(o.isBuffer(e))t=p._fromBufferReader(r(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for MerkleBlock");t={header:e.header instanceof a?e.header:a.fromObject(e.header),numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}return n.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}p.fromBuffer=function(e){return p.fromBufferReader(r(e))},p.fromBufferReader=function(e){return new p(p._fromBufferReader(e))},p.prototype.toBuffer=function(){return this.toBufferWriter().concat()},p.prototype.toBufferWriter=function(e){e||(e=new i),e.write(this.header.toBuffer()),e.writeUInt32LE(this.numTransactions),e.writeVarintNum(this.hashes.length);for(var t=0;tthis.numTransactions)return!1;if(8*this.flags.length8*this.flags.length)return null;var i=this.flags[r.flagBitsUsed>>3]>>>(7&r.flagBitsUsed++)&1;if(0!==e&&i){var n=this._traverseMerkleTree(e-1,2*t,r),a=n;return 2*t+1=this.hashes.length)return null;var o=this.hashes[r.hashesUsed++];return 0===e&&i&&r.txs.push(o),new s(o,"hex")},p.prototype._calcTreeWidth=function(e){return this.numTransactions+(1<>e},p.prototype._calcTreeHeight=function(){for(var e=0;1e.size?t=n.trim(t,i):i>1,o=d.getN(),s=d.getG(),c=a?r.add(o):r,u=d.fromX(n,c);if(!u.mul(o).isInfinity())throw new Error("nR is not a valid curve point");var f=t.neg().mod(o),p=r.invm(o),h=u.mul(i).add(s.mul(f)).mul(p);return m.fromPoint(h,this.sig.compressed)},h.prototype.sigError=function(){if(!f.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s;if(!(e.gt(l.Zero)&&e.lt(d.getN())&&t.gt(l.Zero)&&t.lt(d.getN())))return"r and s not in range";var r=l.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),i=d.getN(),n=t.invm(i),a=n.mul(r).mod(i),o=n.mul(e).mod(i),s=d.getG().mulAdd(a,this.pubkey.point,o);return s.isInfinity()?"p is infinity":0!==s.getX().mod(i).cmp(e)&&"Invalid signature"},h.toLowS=function(e){return e.gt(l.fromBuffer(new c("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=d.getN().sub(e)),e},h.prototype._findSignature=function(e,t){for(var r,i,n,a=d.getN(),o=d.getG(),s=0;(!this.k||0i)r=e(r);else if(r>>=8)}return r},e.exports=r}).call(this,i("_process"),i("buffer").Buffer)},{_process:382,buffer:191,crypto:204}],89:[function(e,r,t){(function(u){"use strict";var g=e("./bn"),v=e("lodash"),b=e("../util/preconditions"),y=e("../util/buffer"),t=e("../util/js"),o=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof g)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};o.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=void 0!==e.i?e.i:this.i,this.compressed=void 0!==e.compressed?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this},o.fromCompact=function(e){b.checkArgument(y.isBuffer(e),"Argument is expected to be a Buffer");var t=new o,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i+=4);var n=e.slice(1,33),a=e.slice(33,65);return b.checkArgument(0===i||1===i||2===i||3===i,new Error("i must be 0, 1, 2, or 3")),b.checkArgument(32===n.length,new Error("r must be 32 bytes")),b.checkArgument(32===a.length,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=g.fromBuffer(n),t.s=g.fromBuffer(a),t},o.fromDER=o.fromBuffer=function(e,t){var r=o.parseDER(e,t),i=new o;return i.r=r.r,i.s=r.s,i},o.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=new o.fromDER(r,!1);return i.nhashtype=t,i},o.fromString=function(e){var t=new u(e,"hex");return o.fromDER(t)},o.parseDER=function(e,t){b.checkArgument(y.isBuffer(e),new Error("DER formatted signature should be a buffer")),v.isUndefined(t)&&(t=!0);var r=e[0];b.checkArgument(48===r,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;b.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(2!==e[2])return!1;if(0===t)return!1;if(128&i[0])return!1;if(1=this.buf.length},e.prototype.read=function(e){r.checkArgument(!n.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t},e.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e},e.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e},e.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=o.fromBuffer(e);return this.pos=this.pos+8,t},e.prototype.readUInt64LEBN=function(){var e,t=this.buf.readUInt32LE(this.pos),r=4294967296*this.buf.readUInt32LE(this.pos+4)+t;if(r<=9007199254740991)e=new o(r);else{var i=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);e=new o(i,10,"le")}return this.pos=this.pos+8,e},e.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN().toNumber();if(t<=Math.pow(2,53))return t;throw new Error("number too large to retain precision - use readVarintBN");default:return e}},e.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return r.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t},e.prototype.readVarintBuf=function(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},e.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new o(this.readUInt16LE());case 254:return new o(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new o(e)}},e.prototype.reverse=function(){for(var e=new i(this.buf.length),t=0;t"},k.prototype.toObject=k.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:_.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},k.fromBuffer=function(e){return new k(e.toString())},k.prototype.toBuffer=function(){return _.copy(this._buffers.xprivkey)},k.DefaultDepth=0,k.DefaultFingerprint=0,k.DefaultChildIndex=0,k.MaxIndex=2*(k.Hardened=2147483648),k.RootElementAlias=["m","M","m'","M'"],k.VersionSize=4,k.DepthSize=1,k.ParentFingerPrintSize=4,k.ChildIndexSize=4,k.ChainCodeSize=32,k.PrivateKeySize=32,k.CheckSumSize=4,k.DataLength=78,k.SerializedByteSize=82,n((k.ChecksumEnd=(k.ChecksumStart=k.PrivateKeyEnd=(k.PrivateKeyStart=(k.ChainCodeEnd=(k.ChainCodeStart=k.ChildIndexEnd=(k.ChildIndexStart=k.ParentFingerPrintEnd=(k.ParentFingerPrintStart=k.DepthEnd=(k.DepthStart=k.VersionEnd=(k.VersionStart=0)+k.VersionSize)+k.DepthSize)+k.ParentFingerPrintSize)+k.ChildIndexSize)+k.ChainCodeSize)+1)+k.PrivateKeySize)+k.CheckSumSize)===k.SerializedByteSize),e.exports=k}).call(this,o("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./crypto/random":88,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdpublickey":99,"./networks":100,"./privatekey":102,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],99:[function(i,s,e){(function(u){"use strict";var n=i("lodash"),t=i("./util/preconditions"),f=i("./crypto/bn"),a=i("./encoding/base58"),p=i("./encoding/base58check"),h=i("./crypto/hash"),r=i("./hdprivatekey"),l=i("./hdkeycache"),d=i("./networks"),m=i("./crypto/point"),g=i("./publickey"),e=i("./errors"),v=e,b=e.HDPublicKey,o=i("assert"),y=i("./util/js"),_=i("./util/buffer");function w(e){if(e instanceof w)return e;if(!(this instanceof w))return new w(e);if(e){if(n.isString(e)||_.isBuffer(e)){var t=w.getSerializedError(e);if(t){if(_.isBuffer(e)&&!w.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof b.ArgumentIsPrivateExtended)return new r(e).hdPublicKey;throw t}return this._buildFromSerialized(e)}if(n.isObject(e))return e instanceof r?this._buildFromPrivate(e):this._buildFromObject(e);throw new b.UnrecognizedArgument(e)}throw new b.MustSupplyArgument}w.isValidPath=function(e){if(n.isString(e)){var t=r._getDerivationIndexes(e);return null!==t&&n.all(t,w.isValidPath)}return!!n.isNumber(e)&&(0<=e&&e"},w.prototype.toObject=w.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version)).name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:_.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},w.fromBuffer=function(e){return new w(e)},w.prototype.toBuffer=function(){return _.copy(this._buffers.xpubkey)},w.Hardened=2147483648,w.RootElementAlias=["m","M"],w.VersionSize=4,w.DepthSize=1,w.ParentFingerPrintSize=4,w.ChildIndexSize=4,w.ChainCodeSize=32,w.PublicKeySize=33,w.CheckSumSize=4,w.DataSize=78,w.SerializedByteSize=82,w.ChecksumEnd=(w.ChecksumStart=w.PublicKeyEnd=(w.PublicKeyStart=w.ChainCodeEnd=(w.ChainCodeStart=w.ChildIndexEnd=(w.ChildIndexStart=w.ParentFingerPrintEnd=(w.ParentFingerPrintStart=w.DepthEnd=(w.DepthStart=w.VersionEnd=(w.VersionStart=0)+w.VersionSize)+w.DepthSize)+w.ParentFingerPrintSize)+w.ChildIndexSize)+w.ChainCodeSize)+w.PublicKeySize)+w.CheckSumSize,o(w.PublicKeyEnd===w.DataSize),o(w.ChecksumEnd===w.SerializedByteSize),s.exports=w}).call(this,i("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdprivatekey":98,"./networks":100,"./publickey":103,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],100:[function(e,t,r){"use strict";var n=e("lodash"),i=e("./util/buffer"),a=e("./util/js"),o=[],s={};function c(){}function u(t,e){if(~o.indexOf(t))return t;if(!e)return s[t];n.isArray(e)||(e=[e]);var r=function(e){return o[i][e]===t};for(var i in o)if(n.any(e,r))return o[i]}function f(e){var t=new c;return a.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey}),e.networkMagic&&a.defineImmutable(t,{networkMagic:i.integerAsBuffer(e.networkMagic)}),e.port&&a.defineImmutable(t,{port:e.port}),e.dnsSeeds&&a.defineImmutable(t,{dnsSeeds:e.dnsSeeds}),n.each(t,function(e){n.isUndefined(e)||n.isObject(e)||(s[e]=t)}),o.push(t),t}c.prototype.toString=function(){return this.name},f({name:"livenet",alias:"mainnet",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var p=u("livenet");f({name:"testnet",alias:"regtest",pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956});var h=u("testnet"),l={PORT:18333,NETWORK_MAGIC:i.integerAsBuffer(185665799),DNS_SEEDS:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]};for(var d in l)n.isObject(l[d])||(s[l[d]]=h);var m={PORT:18444,NETWORK_MAGIC:i.integerAsBuffer(4206867930),DNS_SEEDS:[]};for(var d in m)n.isObject(m[d])||(s[m[d]]=h);Object.defineProperty(h,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.PORT:l.PORT}}),Object.defineProperty(h,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.NETWORK_MAGIC:l.NETWORK_MAGIC}}),Object.defineProperty(h,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.DNS_SEEDS:l.DNS_SEEDS}}),t.exports={add:f,remove:function(e){for(var t=0;t=a.map.OP_1&&e<=a.map.OP_16},a.prototype.inspect=function(){return""},c.exports=a}).call(this,s("buffer").Buffer)},{"./util/buffer":121,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],102:[function(h,l,e){(function(i){"use strict";var n=h("lodash"),r=h("./address"),a=h("./encoding/base58check"),o=h("./crypto/bn"),s=h("./util/js"),c=h("./networks"),u=h("./crypto/point"),e=h("./publickey"),f=h("./crypto/random"),t=h("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(e instanceof p)return e;var r=this._classifyArguments(e,t);if(!r.bn||0===r.bn.cmp(new o(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(u.getN()))throw new TypeError("Number must be less than N");if(void 0===r.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return s.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}p.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?c.get(t):c.defaultNetwork};if(n.isUndefined(e)||n.isNull(e))r.bn=p._getRandomBN();else if(e instanceof o)r.bn=e;else if(e instanceof i||e instanceof Uint8Array)r=p._transformBuffer(e,t);else if(e.bn&&e.network)r=p._transformObject(e);else if(!t&&c.get(e))r.bn=p._getRandomBN(),r.network=c.get(e);else{if("string"!=typeof e)throw new TypeError("First argument is an unrecognized data type.");s.isHexa(e)?r.bn=new o(new i(e,"hex")):r=p._transformWIF(e,t)}return r},p._getRandomBN=function(){var e,t;do{var r=f.getRandomBuffer(32);e=(t=o.fromBuffer(r)).lt(u.getN())}while(!e);return t},p._transformBuffer=function(e,t){var r={};if(32===e.length)return p._transformBNBuffer(e,t);if(r.network=c.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==c.get(t))throw new TypeError("Private key network mismatch");if(34===e.length&&1===e[33])r.compressed=!0;else{if(33!==e.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");r.compressed=!1}return r.bn=o.fromBuffer(e.slice(1,33)),r},p._transformBNBuffer=function(e,t){var r={};return r.network=c.get(t)||c.defaultNetwork,r.bn=o.fromBuffer(e),r.compressed=!1,r},p._transformWIF=function(e,t){return p._transformBuffer(a.decode(e),t)},p.fromBuffer=function(e,t){return new p(e,t)},p._transformObject=function(e){return{bn:new o(e.bn,"hex"),network:c.get(e.network),compressed:e.compressed}},p.fromString=p.fromWIF=function(e){return t.checkArgument(n.isString(e),"First argument is expected to be a string."),new p(e)},p.fromObject=function(e){return t.checkArgument(n.isObject(e),"First argument is expected to be an object."),new p(e)},p.fromRandom=function(e){return new p(p._getRandomBN(),e)},p.getValidationError=function(e,t){var r;try{new p(e,t)}catch(e){r=e}return r},p.isValid=function(e,t){return!!e&&!p.getValidationError(e,t)},p.prototype.toString=function(){return this.toBuffer().toString("hex")},p.prototype.toWIF=function(){var e,t=this.network;return e=this.compressed?i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32}),new i([1])]):i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32})]),a.encode(e)},p.prototype.toBigNumber=function(){return this.bn},p.prototype.toBuffer=function(){return this.bn.toBuffer()},p.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=e.fromPrivateKey(this)),this._pubkey},p.prototype.toAddress=function(e){var t=this.toPublicKey();return r.fromPublicKey(t,e||this.network)},p.prototype.toObject=p.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},p.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return""},l.exports=p}).call(this,h("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/point":87,"./crypto/random":88,"./encoding/base58check":91,"./networks":100,"./publickey":103,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],103:[function(t,r,e){(function(o){"use strict";var s=t("./crypto/bn"),c=t("./crypto/point"),e=t("./crypto/hash"),i=t("./util/js"),n=t("./networks"),u=t("lodash"),f=t("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(f.checkArgument(e,"First argument is required, please include public key data."),e instanceof p)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),i.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||n.defaultNetwork}),this}p.prototype._classifyArgs=function(e,t){var r={compressed:u.isUndefined(t.compressed)||t.compressed};if(e instanceof c)r.point=e;else if(e.x&&e.y)r=p._transformObject(e);else if("string"==typeof e)r=p._transformDER(new o(e,"hex"));else if(p._isBuffer(e))r=p._transformDER(e);else{if(!p._isPrivateKey(e))throw new TypeError("First argument is an unrecognized data format.");r=p._transformPrivateKey(e)}return r.network||(r.network=u.isUndefined(t.network)?void 0:n.get(t.network)),r},p._isPrivateKey=function(e){return e instanceof t("./privatekey")},p._isBuffer=function(e){return e instanceof o||e instanceof Uint8Array},p._transformPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=c.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t},p._transformDER=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r,i,n,a,o={};if(t=!!u.isUndefined(t)||t,4!==e[0]&&(t||6!==e[0]&&7!==e[0]))if(3===e[0])n=e.slice(1),r=new s(n),(o=p._transformX(!0,r)).compressed=!0;else{if(2!==e[0])throw new TypeError("Invalid DER format public key");n=e.slice(1),r=new s(n),(o=p._transformX(!1,r)).compressed=!0}else{if(n=e.slice(1,33),a=e.slice(33,65),32!==n.length||32!==a.length||65!==e.length)throw new TypeError("Length of x and y must be 32 bytes");r=new s(n),i=new s(a),o.point=new c(r,i),o.compressed=!1}return o},p._transformX=function(e,t){f.checkArgument("boolean"==typeof e,"Must specify whether y is odd or not (true or false)");var r={};return r.point=c.fromX(e,t),r},p._transformObject=function(e){var t=new s(e.x,"hex"),r=new s(e.y,"hex");return new p(new c(t,r),{compressed:e.compressed})},p.fromPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t=p._transformPrivateKey(e);return new p(t.point,{compressed:t.compressed,network:t.network})},p.fromDER=p.fromBuffer=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r=p._transformDER(e,t);return new p(r.point,{compressed:r.compressed})},p.fromPoint=function(e,t){return f.checkArgument(e instanceof c,"First argument must be an instance of Point."),new p(e,{compressed:t})},p.fromString=function(e,t){var r=new o(e,t||"hex"),i=p._transformDER(r);return new p(i.point,{compressed:i.compressed})},p.fromX=function(e,t){var r=p._transformX(e,t);return new p(r.point,{compressed:r.compressed})},p.getValidationError=function(e){var t;try{new p(e)}catch(e){t=e}return t},p.isValid=function(e){return!p.getValidationError(e)},p.prototype.toObject=p.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},p.prototype.toBuffer=p.prototype.toDER=function(){var e,t=this.point.getX(),r=this.point.getY(),i=t.toBuffer({size:32}),n=r.toBuffer({size:32});if(this.compressed){var a=n[n.length-1]%2;return e=new o(a?[3]:[2]),o.concat([e,i])}return e=new o([4]),o.concat([e,i,n])},p.prototype._getID=function(){return e.sha256ripemd160(this.toBuffer())},p.prototype.toAddress=function(e){return t("./address").fromPublicKey(this,e||this.network)},p.prototype.toString=function(){return this.toDER().toString("hex")},p.prototype.inspect=function(){return""},r.exports=p}).call(this,t("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./networks":100,"./privatekey":102,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],104:[function(e,t,r){t.exports=e("./script"),t.exports.Interpreter=e("./interpreter")},{"./interpreter":105,"./script":106}],105:[function(p,t,e){(function(e){"use strict";var R=p("lodash"),z=p("./script"),M=p("../opcode"),N=p("../crypto/bn"),D=p("../crypto/hash"),q=p("../crypto/signature"),L=p("../publickey"),U=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};U.prototype.verify=function(e,t,r,i,n){var a,o=p("../transaction");if(R.isUndefined(r)&&(r=new o),R.isUndefined(i)&&(i=0),R.isUndefined(n)&&(n=0),this.set({script:e,tx:r,nin:i,flags:n}),0!=(n&U.SCRIPT_VERIFY_SIGPUSHONLY)&&!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(!this.evaluate())return!1;n&U.SCRIPT_VERIFY_P2SH&&(a=this.stack.slice());var s=this.stack;if(this.initialize(),this.set({script:t,stack:s,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(0===this.stack.length)return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT");var c=this.stack[this.stack.length-1];if(!U.castToBool(c))return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK");if(n&U.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(0===a.length)throw new Error("internal error - stack copy empty");var u=a[a.length-1],f=z.fromBuffer(u);return a.pop(),this.initialize(),this.set({script:f,stack:a,tx:r,nin:i,flags:n}),!!this.evaluate()&&(0===a.length?!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK"):!!U.castToBool(a[a.length-1])||!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK"))}return!0},(t.exports=U).prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},U.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=void 0!==e.nin?e.nin:this.nin,this.stack=e.stack||this.stack,this.altstack=e.altack||this.altstack,this.pc=void 0!==e.pc?e.pc:this.pc,this.pbegincodehash=void 0!==e.pbegincodehash?e.pbegincodehash:this.pbegincodehash,this.nOpCount=void 0!==e.nOpCount?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=void 0!==e.flags?e.flags:this.flags},U.true=new e([1]),U.false=new e([]),U.MAX_SCRIPT_ELEMENT_SIZE=520,U.LOCKTIME_THRESHOLD_BN=new N(U.LOCKTIME_THRESHOLD=5e8),U.SCRIPT_VERIFY_NONE=0,U.SCRIPT_VERIFY_P2SH=1,U.SCRIPT_VERIFY_STRICTENC=2,U.SCRIPT_VERIFY_DERSIG=4,U.SCRIPT_VERIFY_LOW_S=8,U.SCRIPT_VERIFY_NULLDUMMY=16,U.SCRIPT_VERIFY_SIGPUSHONLY=32,U.SCRIPT_VERIFY_MINIMALDATA=64,U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,U.castToBool=function(e){for(var t=0;t=U.LOCKTIME_THRESHOLD&&e.gte(U.LOCKTIME_THRESHOLD_BN))&&(!e.gt(new N(this.tx.nLockTime))&&!!this.tx.inputs[this.nin].isFinal())},U.prototype.step=function(){var e,t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g,v=0!=(this.flags&U.SCRIPT_VERIFY_MINIMALDATA),b=-1===this.vfExec.indexOf(!1),y=this.script.chunks[this.pc];this.pc++;var _=y.opcodenum;if(R.isUndefined(_))return!(this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE");if(y.buf&&y.buf.length>U.MAX_SCRIPT_ELEMENT_SIZE)return!(this.errstr="SCRIPT_ERR_PUSH_SIZE");if(_>M.OP_16&&201<++this.nOpCount)return!(this.errstr="SCRIPT_ERR_OP_COUNT");if(_===M.OP_CAT||_===M.OP_SUBSTR||_===M.OP_LEFT||_===M.OP_RIGHT||_===M.OP_INVERT||_===M.OP_AND||_===M.OP_OR||_===M.OP_XOR||_===M.OP_2MUL||_===M.OP_2DIV||_===M.OP_MUL||_===M.OP_DIV||_===M.OP_MOD||_===M.OP_LSHIFT||_===M.OP_RSHIFT)return!(this.errstr="SCRIPT_ERR_DISABLED_OPCODE");if(b&&0<=_&&_<=M.OP_PUSHDATA4){if(v&&!this.script.checkMinimalPush(this.pc-1))return!(this.errstr="SCRIPT_ERR_MINIMALDATA");if(y.buf){if(y.len!==y.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(y.buf)}else this.stack.push(U.false)}else if(b||M.OP_IF<=_&&_<=M.OP_ENDIF)switch(_){case M.OP_1NEGATE:case M.OP_1:case M.OP_2:case M.OP_3:case M.OP_4:case M.OP_5:case M.OP_6:case M.OP_7:case M.OP_8:case M.OP_9:case M.OP_10:case M.OP_11:case M.OP_12:case M.OP_13:case M.OP_14:case M.OP_15:case M.OP_16:n=_-(M.OP_1-1),e=new N(n).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_NOP:break;case M.OP_NOP2:case M.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break}if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");var w=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v,5);if(w.lt(new N(0)))return!(this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME");if(!this.checkLockTime(w))return!(this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME");break;case M.OP_NOP1:case M.OP_NOP3:case M.OP_NOP4:case M.OP_NOP5:case M.OP_NOP6:case M.OP_NOP7:case M.OP_NOP8:case M.OP_NOP9:case M.OP_NOP10:if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break;case M.OP_IF:case M.OP_NOTIF:if(m=!1,b){if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");e=this.stack.pop(),m=U.castToBool(e),_===M.OP_NOTIF&&(m=!m)}this.vfExec.push(m);break;case M.OP_ELSE:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case M.OP_ENDIF:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec.pop();break;case M.OP_VERIFY:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],!(m=U.castToBool(e)))return!(this.errstr="SCRIPT_ERR_VERIFY");this.stack.pop();break;case M.OP_RETURN:return!(this.errstr="SCRIPT_ERR_OP_RETURN");case M.OP_TOALTSTACK:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.altstack.push(this.stack.pop());break;case M.OP_FROMALTSTACK:if(this.altstack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION");this.stack.push(this.altstack.pop());break;case M.OP_2DROP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop(),this.stack.pop();break;case M.OP_2DUP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1],this.stack.push(t),this.stack.push(r);break;case M.OP_3DUP:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-3],r=this.stack[this.stack.length-2];var k=this.stack[this.stack.length-1];this.stack.push(t),this.stack.push(r),this.stack.push(k);break;case M.OP_2OVER:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-4],r=this.stack[this.stack.length-3],this.stack.push(t),this.stack.push(r);break;case M.OP_2ROT:if(this.stack.length<6)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-6,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_2SWAP:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-4,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_IFDUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-1],(m=U.castToBool(e))&&this.stack.push(e);break;case M.OP_DEPTH:e=new N(this.stack.length).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_DROP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop();break;case M.OP_DUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-1]);break;case M.OP_NIP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,1);break;case M.OP_OVER:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-2]);break;case M.OP_PICK:case M.OP_ROLL:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],n=(s=N.fromScriptNumBuffer(e,v)).toNumber(),this.stack.pop(),n<0||n>=this.stack.length)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-n-1],_===M.OP_ROLL&&this.stack.splice(this.stack.length-n-1,1),this.stack.push(e);break;case M.OP_ROT:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-3],o=this.stack[this.stack.length-2];var x=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=o,this.stack[this.stack.length-2]=x,this.stack[this.stack.length-1]=a;break;case M.OP_SWAP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-2],o=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=o,this.stack[this.stack.length-1]=a;break;case M.OP_TUCK:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case M.OP_SIZE:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");s=new N(this.stack[this.stack.length-1].length),this.stack.push(s.toScriptNumBuffer());break;case M.OP_EQUAL:case M.OP_EQUALVERIFY:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1];var S=t.toString("hex")===r.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(S?U.true:U.false),_===M.OP_EQUALVERIFY){if(!S)return!(this.errstr="SCRIPT_ERR_EQUALVERIFY");this.stack.pop()}break;case M.OP_1ADD:case M.OP_1SUB:case M.OP_NEGATE:case M.OP_ABS:case M.OP_NOT:case M.OP_0NOTEQUAL:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(e=this.stack[this.stack.length-1],s=N.fromScriptNumBuffer(e,v),_){case M.OP_1ADD:s=s.add(N.One);break;case M.OP_1SUB:s=s.sub(N.One);break;case M.OP_NEGATE:s=s.neg();break;case M.OP_ABS:s.cmp(N.Zero)<0&&(s=s.neg());break;case M.OP_NOT:s=new N((0===s.cmp(N.Zero))+0);break;case M.OP_0NOTEQUAL:s=new N((0!==s.cmp(N.Zero))+0)}this.stack.pop(),this.stack.push(s.toScriptNumBuffer());break;case M.OP_ADD:case M.OP_SUB:case M.OP_BOOLAND:case M.OP_BOOLOR:case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:case M.OP_NUMNOTEQUAL:case M.OP_LESSTHAN:case M.OP_GREATERTHAN:case M.OP_LESSTHANOREQUAL:case M.OP_GREATERTHANOREQUAL:case M.OP_MIN:case M.OP_MAX:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(c=N.fromScriptNumBuffer(this.stack[this.stack.length-2],v),u=N.fromScriptNumBuffer(this.stack[this.stack.length-1],v),s=new N(0),_){case M.OP_ADD:s=c.add(u);break;case M.OP_SUB:s=c.sub(u);break;case M.OP_BOOLAND:s=new N((0!==c.cmp(N.Zero)&&0!==u.cmp(N.Zero))+0);break;case M.OP_BOOLOR:s=new N((0!==c.cmp(N.Zero)||0!==u.cmp(N.Zero))+0);break;case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:s=new N((0===c.cmp(u))+0);break;case M.OP_NUMNOTEQUAL:s=new N((0!==c.cmp(u))+0);break;case M.OP_LESSTHAN:s=new N((c.cmp(u)<0)+0);break;case M.OP_GREATERTHAN:s=new N((0"},v.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==c.OP_DUP||this.chunks[1].opcodenum!==c.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==c.OP_EQUALVERIFY||this.chunks[4].opcodenum!==c.OP_CHECKSIG)},v.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&48===e[0]&&t&&t.length){var r=t[0];if((4===r||6===r||7===r)&&65===t.length)return!0;if((3===r||2===r)&&33===t.length)return!0}}return!1},v.prototype.getPublicKey=function(){return p.checkState(this.isPublicKeyOut(),"Can't retreive PublicKey from a non-PK output"),this.chunks[0].buf},v.prototype.getPublicKeyHash=function(){return p.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},v.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===c.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if((4!==t&&6!==t&&7!==t||65!==e.length)&&(3!==t&&2!==t||33!==e.length)||(r=!0),r)return u.isValid(e)}return!1},v.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var e=this.chunks[0].buf;if(e&&e.length&&48===e[0])return!0}return!1},v.prototype.isScriptHashOut=function(){var e=this.toBuffer();return 23===e.length&&e[0]===c.OP_HASH160&&20===e[1]&&e[e.length-1]===c.OP_EQUAL},v.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e,t=this.chunks[this.chunks.length-1].buf;if(!t)return!1;try{e=v.fromBuffer(t)}catch(e){if(e instanceof l.Script.InvalidBuffer)return!1;throw e}return e.classify()!==v.types.UNKNOWN},v.prototype.isMultisigOut=function(){return 3=c.OP_1&&e<=c.OP_16)return e-(c.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))},v.prototype.getSignatureOperationsCount=function(r){r=!!h.isUndefined(r)||r;var i=this,n=0,a=c.OP_INVALIDOPCODE;return h.each(i.chunks,function(e){var t=e.opcodenum;t==c.OP_CHECKSIG||t==c.OP_CHECKSIGVERIFY?n++:t!=c.OP_CHECKMULTISIG&&t!=c.OP_CHECKMULTISIGVERIFY||(r&&a>=c.OP_1&&a<=c.OP_16?n+=i._decodeOP_N(a):n+=20),a=t}),n},t.exports=v}).call(this,e("buffer").Buffer)},{"../address":79,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../networks":100,"../opcode":101,"../publickey":103,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],107:[function(e,t,r){t.exports=e("./transaction"),t.exports.Input=e("./input"),t.exports.Output=e("./output"),t.exports.UnspentOutput=e("./unspentoutput"),t.exports.Signature=e("./signature"),t.exports.Sighash=e("./sighash")},{"./input":108,"./output":114,"./sighash":115,"./signature":116,"./transaction":117,"./unspentoutput":118}],108:[function(e,t,r){t.exports=e("./input"),t.exports.PublicKey=e("./publickey"),t.exports.PublicKeyHash=e("./publickeyhash"),t.exports.MultiSig=e("./multisig.js"),t.exports.MultiSigScriptHash=e("./multisigscripthash.js")},{"./input":109,"./multisig.js":110,"./multisigscripthash.js":111,"./publickey":112,"./publickeyhash":113}],109:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../../util/preconditions"),a=e("../../errors"),o=e("../../encoding/bufferwriter"),s=e("buffer"),c=e("../../util/buffer"),u=e("../../util/js"),f=e("../../script"),p=e("../sighash"),h=e("../output"),l=4294967295;function d(e){return this instanceof d?e?this._fromObject(e):void 0:new d(e)}d.MAXINT=l,d.DEFAULT_SEQNUMBER=4294967295,d.DEFAULT_LOCKTIME_SEQNUMBER=4294967294,d.DEFAULT_RBF_SEQNUMBER=4294967293,Object.defineProperty(d.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new f(this._scriptBuffer),this._script._isInput=!0),this._script)}}),d.fromObject=function(e){return n.checkArgument(i.isObject(e)),(new d)._fromObject(e)},d.prototype._fromObject=function(e){var t;if(t=i.isString(e.prevTxId)&&u.isHexa(e.prevTxId)?new s.Buffer(e.prevTxId,"hex"):e.prevTxId,this.output=e.output?e.output instanceof h?e.output:new h(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=i.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=i.isUndefined(e.sequenceNumber)?i.isUndefined(e.seqnum)?4294967295:e.seqnum:e.sequenceNumber,i.isUndefined(e.script)&&i.isUndefined(e.scriptBuffer))throw new a.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this},d.prototype.toObject=d.prototype.toJSON=function(){var e={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(e.scriptString=this.script.toString()),this.output&&(e.output=this.output.toObject()),e},d.fromBufferReader=function(e){var t=new d;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t},d.prototype.toBufferWriter=function(e){e||(e=new o),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e},d.prototype.setScript=function(e){if(this._script=null,e instanceof f)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(u.isHexa(e))this._scriptBuffer=new s.Buffer(e,"hex");else if(i.isString(e))this._script=new f(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!c.isBuffer(e))throw new TypeError("Invalid argument type: script");this._scriptBuffer=new s.Buffer(e)}return this},d.prototype.getSignatures=function(){throw new a.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},d.prototype.isFullySigned=function(){throw new a.AbstractMethodInvoked("Input#isFullySigned")},d.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},d.prototype.addSignature=function(){throw new a.AbstractMethodInvoked("Input#addSignature")},d.prototype.clearSignatures=function(){throw new a.AbstractMethodInvoked("Input#clearSignatures")},d.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},d.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},d.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},t.exports=d},{"../../encoding/bufferwriter":93,"../../errors":95,"../../script":104,"../../util/buffer":121,"../../util/js":122,"../../util/preconditions":123,"../output":114,"../sighash":115,buffer:191,lodash:149}],110:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=(e("../transaction"),e("./input")),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),u.checkState(o.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.output.script),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},l.normalizeSignatures=function(n,a,o,e,t){return t.map(function(r){var i=null;return e=e.filter(function(e){if(i)return!0;var t=new h({signature:f.fromTxFormat(e),publicKey:r,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:o,sigtype:f.SIGHASH_ALL});return t.signature.nhashtype=t.sigtype,!p.verify(n,t.signature,t.publicKey,t.inputIndex,a.output.script)||(i=t,!1)}),i||null})},l.OPCODES_SIZE=1,l.SIGNATURE_SIZE=73,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"../transaction":117,"./input":109,inherits:148,lodash:149}],111:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=e("./input"),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),this.redeemScript=o.buildMultisigOut(this.publicKeys,r),u.checkState(o.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.redeemScript),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript)},l.OPCODES_SIZE=7,l.SIGNATURE_SIZE=74,l.PUBKEY_SIZE=34,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE+this.publicKeys.length*l.PUBKEY_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148,lodash:149}],112:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),n=(e("../../util/buffer"),e("./input")),o=e("../output"),s=e("../sighash"),c=e("../../script"),u=e("../../crypto/signature"),f=e("../signature");function p(){n.apply(this,arguments)}i(p,n),p.prototype.getSignatures=function(e,t,r,i){a.checkState(this.output instanceof o),i=i||u.SIGHASH_ALL;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new f({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:s.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},p.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(c.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this},p.prototype.clearSignatures=function(){return this.setScript(c.empty()),this},p.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},p.SCRIPT_MAX_SIZE=73,p.prototype._estimateSize=function(){return p.SCRIPT_MAX_SIZE},t.exports=p},{"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],113:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),o=e("../../util/buffer"),s=e("../../crypto/hash"),n=e("./input"),c=e("../output"),u=e("../sighash"),f=e("../../script"),p=e("../../crypto/signature"),h=e("../signature");function l(){n.apply(this,arguments)}i(l,n),l.prototype.getSignatures=function(e,t,r,i,n){return a.checkState(this.output instanceof c),n=n||s.sha256ripemd160(t.publicKey.toBuffer()),i=i||p.SIGHASH_ALL,o.equals(n,this.output.script.getPublicKeyHash())?[new h({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:u.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},l.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(f.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this},l.prototype.clearSignatures=function(){return this.setScript(f.empty()),this},l.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()},l.SCRIPT_MAX_SIZE=107,l.prototype._estimateSize=function(){return l.SCRIPT_MAX_SIZE},t.exports=l},{"../../crypto/hash":86,"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],114:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../crypto/bn"),a=e("buffer"),o=e("../util/buffer"),s=e("../util/js"),c=e("../encoding/bufferwriter"),u=e("../script"),f=e("../util/preconditions"),p=e("../errors");function h(e){if(!(this instanceof h))return new h(e);if(!i.isObject(e))throw new TypeError("Unrecognized argument for Output");var t;this.satoshis=e.satoshis,o.isBuffer(e.script)?this._scriptBuffer=e.script:(t=i.isString(e.script)&&s.isHexa(e.script)?new a.Buffer(e.script,"hex"):e.script,this.setScript(t))}Object.defineProperty(h.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script||this.setScriptFromBuffer(this._scriptBuffer),this._script}}),Object.defineProperty(h.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof n?(this._satoshisBN=e,this._satoshis=e.toNumber()):i.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=n.fromNumber(this._satoshis)):(f.checkArgument(s.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=n.fromNumber(e),this._satoshis=e),f.checkState(s.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),h.prototype.invalidSatoshis=function(){return 9007199254740991"},h.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return t.script=0!==r?e.read(r):new a.Buffer([]),new h(t)},h.prototype.toBufferWriter=function(e){e||(e=new c),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e},t.exports=h},{"../crypto/bn":84,"../encoding/bufferwriter":93,"../errors":95,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],115:[function(y,e,t){(function(f){"use strict";var p=y("buffer"),h=y("../crypto/signature"),l=y("../script"),d=y("./output"),m=y("../encoding/bufferreader"),g=y("../encoding/bufferwriter"),v=y("../crypto/bn"),b=y("../crypto/hash"),o=y("../crypto/ecdsa"),s=y("../util/preconditions"),c=y("lodash"),u=function(e,t,r,i){var n,a=y("./transaction"),o=y("./input"),s=a.shallowCopy(e);for((i=new l(i)).removeCodeseparators(),n=0;n=s.outputs.length)return new f("0000000000000000000000000000000000000000000000000000000000000001","hex");for(s.outputs.length=r+1,n=0;n"},S.prototype.toBuffer=function(){var e=new u;return this.toBufferWriter(e).toBuffer()},S.prototype.toBufferWriter=function(t){return t.writeUInt32LE(this.version),t.writeVarintNum(this.inputs.length),s.each(this.inputs,function(e){e.toBufferWriter(t)}),t.writeVarintNum(this.outputs.length),s.each(this.outputs,function(e){e.toBufferWriter(t)}),t.writeUInt32LE(this.nLockTime),t},S.prototype.fromBuffer=function(e){var t=new c(e);return this.fromBufferReader(t)},S.prototype.fromBufferReader=function(e){var t,r,i;for(a.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readUInt32LE(),r=e.readVarintNum(),t=0;t=this.inputs.length)throw new n.Transaction.InvalidIndex(e,this.inputs.length);var i=this.inputs[e];this.inputs=s.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()},S.prototype.sign=function(e,t){a.checkState(this.hasAllUtxoInfo());var r=this;return s.isArray(e)?s.each(e,function(e){r.sign(e,t)}):s.each(this.getSignatures(e,t),function(e){r.applySignature(e)}),this},S.prototype.getSignatures=function(r,i){r=new k(r),i=i||p.SIGHASH_ALL;var n=this,a=[],o=f.sha256ripemd160(r.publicKey.toBuffer());return s.each(this.inputs,function(e,t){s.each(e.getSignatures(n,r,t,i,o),function(e){a.push(e)})}),a},S.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this},S.prototype.isFullySigned=function(){return s.each(this.inputs,function(e){if(e.isFullySigned===m.prototype.isFullySigned)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),s.all(s.map(this.inputs,function(e){return e.isFullySigned()}))},S.prototype.isValidSignature=function(e){if(this.inputs[e.inputIndex].isValidSignature===m.prototype.isValidSignature)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e)},S.prototype.verifySignature=function(e,t,r,i){return h.verify(this,e,t,r,i)},S.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var e=new x(0),t=0;t=m.MAXINT-1&&(t.sequenceNumber=m.DEFAULT_RBF_SEQNUMBER)}return this},I.exports=S}).call(this,A("buffer").Buffer)},{"../address":79,"../crypto/bn":84,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../privatekey":102,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"./input":108,"./output":114,"./sighash":115,"./unspentoutput":118,buffer:191,"buffer-compare":126,lodash:149}],118:[function(e,t,r){"use strict";var o=e("lodash"),s=e("../util/preconditions"),c=e("../util/js"),u=e("../script"),f=e("../address"),p=e("../unit");function h(e){if(!(this instanceof h))return new h(e);s.checkArgument(o.isObject(e),"Must provide an object from where to extract data");var t=e.address?new f(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!c.isHexaString(r)||64"},h.prototype.toString=function(){return this.txId+":"+this.outputIndex},h.fromObject=function(e){return new h(e)},h.prototype.toObject=h.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:p.fromSatoshis(this.satoshis).toBTC()}},t.exports=h},{"../address":79,"../script":104,"../unit":119,"../util/js":122,"../util/preconditions":123,lodash:149}],119:[function(e,t,r){"use strict";var i=e("lodash"),n=e("./errors"),a=e("./util/preconditions"),o={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function s(e,t){if(!(this instanceof s))return new s(e,t);if(i.isNumber(t)){if(t<=0)throw new n.Unit.InvalidRate(t);e/=t,t=s.BTC}this._value=this._from(e,t);var r=this;Object.keys(o).forEach(function(e){Object.defineProperty(r,e,{get:function(){return r.to(e)},enumerable:!0})})}Object.keys(o).forEach(function(e){s[e]=e}),s.fromObject=function(e){return a.checkArgument(i.isObject(e),"Argument is expected to be an object"),new s(e.amount,e.code)},s.fromBTC=function(e){return new s(e,s.BTC)},s.fromMillis=s.fromMilis=function(e){return new s(e,s.mBTC)},s.fromMicros=s.fromBits=function(e){return new s(e,s.bits)},s.fromSatoshis=function(e){return new s(e,s.satoshis)},s.fromFiat=function(e,t){return new s(e,t)},s.prototype._from=function(e,t){if(!o[t])throw new n.Unit.UnknownCode(t);return parseInt((e*o[t][0]).toFixed())},s.prototype.to=function(e){if(i.isNumber(e)){if(e<=0)throw new n.Unit.InvalidRate(e);return parseFloat((this.BTC*e).toFixed(2))}if(!o[e])throw new n.Unit.UnknownCode(e);var t=this._value/o[e][0];return parseFloat(t.toFixed(o[e][1]))},s.prototype.toBTC=function(){return this.to(s.BTC)},s.prototype.toMillis=s.prototype.toMilis=function(){return this.to(s.mBTC)},s.prototype.toMicros=s.prototype.toBits=function(){return this.to(s.bits)},s.prototype.toSatoshis=function(){return this.to(s.satoshis)},s.prototype.atRate=function(e){return this.to(e)},s.prototype.toString=function(){return this.satoshis+" satoshis"},s.prototype.toObject=s.prototype.toJSON=function(){return{amount:this.BTC,code:s.BTC}},s.prototype.inspect=function(){return""},t.exports=s},{"./errors":95,"./util/preconditions":123,lodash:149}],120:[function(e,t,r){"use strict";var i=e("lodash"),n=e("url"),a=e("./address"),o=e("./unit"),s=function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.extras={},this.knownParams=r||[],this.address=this.network=this.amount=this.message=null,"string"==typeof t){var i=e.parse(t);i.amount&&(i.amount=this._parseAmount(i.amount)),this._fromObject(i)}else{if("object"!==(void 0===t?"undefined":_typeof(t)))throw new TypeError("Unrecognized data format.");this._fromObject(t)}};s.fromString=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return new s(e)},s.fromObject=function(e){return new s(e)},s.isValid=function(e,t){try{new s(e,t)}catch(e){return!1}return!0},s.parse=function(e){var t=n.parse(e,!0);if("bitcoin:"!==t.protocol)throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(e);return t.query.address=r&&r[1]||void 0,t.query},s.Members=["address","amount","message","label","r"],s.prototype._fromObject=function(e){if(!a.isValid(e.address))throw new TypeError("Invalid bitcoin address");for(var t in this.address=new a(e.address),this.network=this.address.network,this.amount=e.amount,e)if("address"!==t&&"amount"!==t){if(/^req-/.exec(t)&&-1===this.knownParams.indexOf(t))throw Error("Unknown required argument "+t);(-1"},t.exports=s},{"./address":79,"./unit":119,lodash:149,url:500}],121:[function(o,s,e){(function(r){"use strict";var i=o("buffer"),t=o("assert"),n=o("./js"),a=o("./preconditions");function e(e,t){if(e.length!==t.length)return!1;for(var r=e.length,i=0;i>24&255),t.push(e>>16&255),t.push(e>>8&255),t.push(255&e),new r(t)},integerFromBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]<<24|e[1]<<16|e[2]<<8|e[3]},integerFromSingleByteBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]},bufferToHex:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e.toString("hex")},reverse:function(e){for(var t=new i.Buffer(e.length),r=0;r>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}}else if("le"===r)for(i=0,a=0;i>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-i&4194303,26<=(i+=24)&&(i-=26,n++)}if(r+6!==t){a=o(e,t,r+6);this.words[n]|=a<>>26-i&4194303}this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];v.prototype.toString=function(e,t){if(16===(e=e||10)||"hex"===e){for(var r="",i=0,n=(t=0|t||1,0),a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return this.sign&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var c=l[e],u=d[e],f=(r="",this.clone());for(f.sign=!1;0!==f.cmpn(0);){var p=f.modn(u).toString(e);r=0!==(f=f.idivn(u)).cmpn(0)?h[c-p.length]+p+r:p+r}return 0===this.cmpn(0)&&(r="0"+r),this.sign&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.prototype.toJSON=function(){return this.toString(16)},v.prototype.toArray=function(){this.strip();var e=new Array(this.byteLength());e[0]=0;for(var t=this.clone(),r=0;0!==t.cmpn(0);r++){var i=t.andln(255);t.ishrn(8),e[e.length-r-1]=i}return e},v.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return 4096<=t&&(r+=13,t>>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.iand=function(e){var t;this.sign=this.sign&&e.sign,t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},v.prototype.ixor=function(e){var t,r;this.sign=this.sign||e.sign,r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);for(var r=e/26|0,i=e%26;this.length<=r;)this.words[this.length++]=0;return this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,a=0;a>>26}for(;0!==n&&a>>26}if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this);this.sign=!1;t=e.sub(this);return this.sign=!0,t},v.prototype.isub=function(e){if(e.sign){e.sign=!1;var t=this.iadd(e);return e.sign=!0,t._normSign()}if(this.sign)return this.sign=!1,this.iadd(e),this.sign=!0,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.sign=!1,this.length=1,this.words[0]=0,this;i=0>26,this.words[o]=67108863&t}for(;0!==a&&o>26,this.words[o]=67108863&t}if(0===a&&o>>26,a=67108863&r,o=Math.min(i,e.length-1),s=Math.max(0,i-this.length+1);s<=o;s++){var c=i-s,u=(0|this.words[c])*(0|e.words[s]),f=67108863&u;a=67108863&(f=f+a|0),n=(n=n+(u/67108864|0)|0)+(f>>>26)|0}t.words[i]=a,r=n}return 0!==r?t.words[i]=r:t.length--,t.strip()},v.prototype._bigMulTo=function(e,t){t.sign=e.sign!==this.sign,t.length=this.length+e.length;for(var r=0,i=0,n=0;n>>26)|0)>>>26,a&=67108863}t.words[n]=o,r=a,a=i}return 0!==r?t.words[n]=r:t.length--,t.strip()},v.prototype.mulTo=function(e,t){return this.length+e.length<63?this._smallMulTo(e,t):this._bigMulTo(e,t)},v.prototype.mul=function(e){var t=new v(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},v.prototype.imul=function(e){if(0===this.cmpn(0)||0===e.cmpn(0))return this.words[0]=0,this.length=1,this;var t=this.length,r=e.length;this.sign=e.sign!==this.sign,this.length=this.length+e.length,this.words[this.length-1]=0;for(var i=this.length-2;0<=i;i--){for(var n=0,a=0,o=Math.min(i,r-1),s=Math.max(0,i-t+1);s<=o;s++){var c=i-s,u=this.words[c]*e.words[s],f=67108863&u;n+=u/67108864|0,a=67108863&(f+=a),n+=f>>>26}this.words[i]=a,this.words[i+1]+=n,n=0}for(n=0,c=1;c>>26}return this.strip()},v.prototype.imuln=function(e){g("number"==typeof e);for(var t=0,r=0;r>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.mul(this)},v.prototype.ishln=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){for(var n=0,a=0;a>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;a>>n<a){this.length-=a;for(c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(c/67108864|0),this.words[a+r]=67108863&s}for(;a>26,this.words[a+r]=67108863&s}if(0===o)return this.strip();g(-1===o);for(a=o=0;a>26,this.words[a]=67108863&s}return this.sign=!0,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.shln(r),i.ishln(r),a=n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var n;i=this.divmod(e.neg(),t);return"mod"!==t&&(n=i.div.neg()),{div:n,mod:i.mod}},v.prototype.div=function(e){return this.divmod(e,"div").div},v.prototype.mod=function(e){return this.divmod(e,"mod").mod},v.prototype.divRound=function(e){var t=this.divmod(e);if(0===t.mod.cmpn(0))return t.div;var r=t.div.sign?t.mod.isub(e):t.mod,i=e.shrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:t.div.sign?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+this.words[i])%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=this.words[r]+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.ishrn(1),r.ishrn(1),++s;for(var c=r.clone(),u=t.clone();0!==t.cmpn(0);){for(;t.isEven();)t.ishrn(1),i.isEven()&&n.isEven()?(i.ishrn(1),n.ishrn(1)):(i.iadd(c).ishrn(1),n.isub(u).ishrn(1));for(;r.isEven();)r.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(u).ishrn(1));0<=t.cmp(r)?(t.isub(r),i.isub(a),n.isub(o)):(r.isub(t),a.isub(i),o.isub(n))}return{a:a,b:o,gcd:r.ishln(s)}},v.prototype._invmp=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=r.clone();0>>26,o&=67108863,this.words[n]=o}return 0!==a&&(this.words[n]=a,this.length++),this},v.prototype.cmpn=function(e){var t,r=e<0;if(r&&(e=-e),this.sign&&!r)return-1;if(!this.sign&&r)return 1;if(e&=67108863,this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}e.words[i-10]=n>>>22,e.length-=9},a.prototype.imulK=function(e){var t;e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(i[e])return i[e];var t;if("k256"===e)t=new a;else if("p224"===e)t=new s;else if("p192"===e)t=new c;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new u}return i[e]=t},f.prototype._verify1=function(e){g(!e.sign,"red works only with positives"),g(e.red,"red works only with red numbers")},f.prototype._verify2=function(e,t){g(!e.sign&&!t.sign,"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},f.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.mod(this.m)._forceRed(this)},f.prototype.neg=function(e){var t=e.clone();return t.sign=!t.sign,t.iadd(this.m)._forceRed(this)},f.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},f.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},f.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)},f.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.shln(t))},f.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},f.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},f.prototype.isqr=function(e){return this.imul(e,e)},f.prototype.sqr=function(e){return this.mul(e,e)},f.prototype.sqrt=function(e){if(0===e.cmpn(0))return e.clone();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).ishrn(2);return f=this.pow(e,r)}for(var i=this.m.subn(1),n=0;0!==i.cmpn(0)&&0===i.andln(1);)n++,i.ishrn(1);g(0!==i.cmpn(0));var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).ishrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).ishrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>8,i[r]&=255;for(;a;)i.push(255&a),a>>=8}for(t=0;"1"===e[t]&&tt[i]?1:0);++i);return 0==r&&(t.length>e.length?r=-1:e.length>t.length&&(r=1)),r}},{}],127:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.hmacDRBG=e("./elliptic/hmac-drbg"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec")},{"../package.json":147,"./elliptic/curve":130,"./elliptic/curves":133,"./elliptic/ec":134,"./elliptic/hmac-drbg":137,"./elliptic/utils":139,brorand:140}],128:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic"),S=n.utils.getNAF,j=n.utils.getJSF,u=n.utils.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function o(e,t){this.curve=e,this.type=t,this.precomputed=null}(t.exports=a).prototype.point=function(){throw new Error("Not implemented")},a.prototype.validate=function(){throw new Error("Not implemented")},a.prototype._fixedNafMul=function(e,t){var r=e._getDoubles(),i=S(t,1),n=(1<>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i){for(var n=this._wnafT1,a=this._wnafT2,o=this._wnafT3,s=0,c=0;c>1]:x<0&&(k=a[m][-x-1>>1].neg()),b="affine"===k.type?b.mixedAdd(k):b.add(k))}}for(c=0;c":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],130:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":128,"./edwards":129,"./mont":131,"./short":132}],131:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base;function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(s,o),(t.exports=s).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)},a(c,o.BasePoint),s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.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)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.ishrn(1))n.push(t.andln(1));for(var a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../curve":130,"bn.js":124,inherits:148}],132:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.shrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.sign&&(i=i.neg(),n=n.neg()),a.sign&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(t=new w(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b).redSqrt(),i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},c.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)},c.prototype._endoWnafMulAdd=function(e,t){for(var r=this._endoWnafT1,i=this._endoWnafT2,n=0;n":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],133:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":127,"./precomputed/secp256k1":138,"hash.js":141}],134:[function(e,t,r){"use strict";var d=e("bn.js"),m=e("../../elliptic"),i=m.utils.assert,n=e("./key"),g=e("./signature");function a(e){if(!(this instanceof a))return new a(e);"string"==typeof e&&(i(m.curves.hasOwnProperty(e),"Unknown curve "+e),e=m.curves[e]),e instanceof m.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(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}(t.exports=a).prototype.keyPair=function(e){return new n(this,e)},a.prototype.keyFromPrivate=function(e,t){return n.fromPrivate(this,e,t)},a.prototype.keyFromPublic=function(e,t){return n.fromPublic(this,e,t)},a.prototype.genKeyPair=function(e){e||(e={});for(var t=new m.hmacDRBG({hash:this.hash,pers:e.pers,entropy:e.entropy||m.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new d(2));;){var n=new d(t.generate(r));if(!(0"}},{"../../elliptic":127,"bn.js":124}],136:[function(e,t,r){"use strict";var n=e("bn.js"),a=e("../../elliptic").utils,i=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16))}(t.exports=o).prototype._importDER=function(e,t){if((e=a.toArray(e,t)).length<6||48!==e[0]||2!==e[2])return!1;if(1+e[1]>e.length)return!1;var r=e[3];if(128<=r)return!1;if(4+r+2>=e.length)return!1;if(2!==e[4+r])return!1;var i=e[5+r];return!(128<=i)&&(!(4+r+2+i>e.length)&&(this.r=new n(e.slice(4,4+r)),this.s=new n(e.slice(4+r+2,4+r+2+i)),!0))},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r));var i=[48,t.length+r.length+4,2,t.length];return i=i.concat(t,[2,r.length],r),a.encode(i,e)}},{"../../elliptic":127,"bn.js":124}],137:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("../elliptic").utils,n=o.assert;function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc),r=o.toArray(e.nonce,e.nonceEnc),i=o.toArray(e.pers,e.persEnc);n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this.reseed=1},a.prototype.generate=function(e,t,r,i){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i),this._update(r));for(var n=[];n.length>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e},i.getNAF=function(e,t){for(var r=[],i=1<>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=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=n.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{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;for(a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>10),n[a-7],(r=n[a-15],b(r,7)^b(r,18)^r>>>3),n[a-16]);var o,s,c=this.h[0],u=this.h[1],f=this.h[2],p=this.h[3],h=this.h[4],l=this.h[5],d=this.h[6],m=this.h[7];F(this.k.length===n.length);for(a=0;a>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function s(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}function u(e,t){if(!e)throw new Error(t||"Assertion failed")}i.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},i.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,r){return e+t+r>>>0},i.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},i.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},i.assert=u,i.inherits=n,r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:148}],147:[function(e,t,r){t.exports={_args:[["elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib"]],_from:"elliptic@=3.0.3",_id:"elliptic@3.0.3",_inCache:!0,_location:"/bitcore-lib/elliptic",_phantomChildren:{inherits:"2.0.1"},_requested:{name:"elliptic",raw:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",rawSpec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",scope:null,spec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",type:"remote"},_requiredBy:["/bitcore-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_shasum:"865c9b420bfbe55006b9f969f97a0d2c44966595",_shrinkwrap:null,_spec:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_where:"/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^2.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},description:"EC cryptography",devDependencies:{browserify:"^3.44.2",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",optionalDependencies:{},readme:"# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic)\n\nFast elliptic-curve cryptography in a plain javascript implementation.\n\nNOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve\nfor your cryptography operations.\n\n## Incentive\n\nECC is much slower than regular RSA cryptography, the JS implementations are\neven more slower.\n\n## Benchmarks\n\n```bash\n$ node benchmarks/index.js\nBenchmarking: sign\nelliptic#sign x 262 ops/sec ±0.51% (177 runs sampled)\neccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled)\n------------------------\nFastest is elliptic#sign\n========================\nBenchmarking: verify\nelliptic#verify x 113 ops/sec ±0.50% (166 runs sampled)\neccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled)\n------------------------\nFastest is elliptic#verify\n========================\nBenchmarking: gen\nelliptic#gen x 294 ops/sec ±0.43% (176 runs sampled)\neccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled)\n------------------------\nFastest is elliptic#gen\n========================\nBenchmarking: ecdh\nelliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled)\n------------------------\nFastest is elliptic#ecdh\n========================\n```\n\n## API\n\n### ECDSA\n\n```javascript\nvar EC = require('elliptic').ec;\n\n// Create and initialize EC context\n// (better do it once and reuse it)\nvar ec = new EC('secp256k1');\n\n// Generate keys\nvar key = ec.genKeyPair();\n\n// Sign message (must be an array, or it'll be treated as a hex sequence)\nvar msg = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];\nvar signature = key.sign(msg);\n\n// Export DER encoded signature in Array\nvar derSign = signature.toDER();\n\n// Verify signature\nconsole.log(key.verify(msg, derSign));\n```\n\n### ECDH\n\n```javascript\n// Generate keys\nvar key1 = ec.genKeyPair();\nvar key2 = ec.genKeyPair();\n\nvar shared1 = key1.derive(key2.getPublic());\nvar shared2 = key2.derive(key1.getPublic());\n\nconsole.log('Both shared secrets are BN instances');\nconsole.log(shared1.toString(16));\nconsole.log(shared2.toString(16));\n```\n\nNOTE: `.derive()` returns a [BN][1] instance.\n\n## Supported curves\n\nElliptic.js support following curve types:\n\n* Short Weierstrass\n* Montgomery\n* Edwards\n* Twisted Edwards\n\nFollowing curve 'presets' are embedded into the library:\n\n* `secp256k1`\n* `p192`\n* `p224`\n* `p256`\n* `curve25519`\n* `ed25519`\n\nNOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead.\n\n### Implementation details\n\nECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of\nthe curve operations are performed on non-affine coordinates (either projective\nor extended), various windowing techniques are used for different cases.\n\nAll operations are performed in reduction context using [bn.js][1], hashing is\nprovided by [hash.js][2]\n\n### Related projects\n\n* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both\n browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for\n node)\n\n#### LICENSE\n\nThis software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2014.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://tools.ietf.org/html/rfc6979\n[1]: https://github.com/indutny/bn.js\n[2]: https://github.com/indutny/hash.js\n[3]: https://github.com/bitchan/eccrypto\n[4]: https://github.com/wanderer/secp256k1-node\n",readmeFilename:"README.md",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{test:"make lint && mocha --reporter=spec test/*-test.js"},version:"3.0.3"}},{}],148:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{dup:68}],149:[function(e,y,_){(function(b){(function(){var dn,e,t,mn="3.10.1",gn=1,vn=2,bn=4,yn=8,_n=16,wn=32,kn=64,xn=128,Sn=256,jn=30,En="...",An=150,In=16,Pn=200,On=1,Tn=2,Bn="Expected a function",Cn="__lodash_placeholder__",Fn="[object Arguments]",Rn="[object Array]",zn="[object Boolean]",Mn="[object Date]",Nn="[object Error]",Dn="[object Function]",r="[object Map]",qn="[object Number]",Ln="[object Object]",Un="[object RegExp]",i="[object Set]",Hn="[object String]",n="[object WeakMap]",Kn="[object ArrayBuffer]",Vn="[object Float32Array]",Gn="[object Float64Array]",$n="[object Int8Array]",Wn="[object Int16Array]",Zn="[object Int32Array]",Yn="[object Uint8Array]",Xn="[object Uint8ClampedArray]",Jn="[object Uint16Array]",Qn="[object Uint32Array]",ea=/\b__p \+= '';/g,ta=/\b(__p \+=) '' \+/g,ra=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ia=/&(?:amp|lt|gt|quot|#39|#96);/g,na=/[&<>"'`]/g,aa=RegExp(ia.source),oa=RegExp(na.source),sa=/<%-([\s\S]+?)%>/g,ca=/<%([\s\S]+?)%>/g,ua=/<%=([\s\S]+?)%>/g,fa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,pa=/^\w*$/,ha=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,la=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,da=RegExp(la.source),ma=/[\u0300-\u036f\ufe20-\ufe23]/g,ga=/\\(\\)?/g,va=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ba=/\w*$/,ya=/^0[xX]/,_a=/^\[object .+?Constructor\]$/,wa=/^\d+$/,ka=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xa=/($^)/,Sa=/['\n\r\u2028\u2029\\]/g,ja=(e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",t="[a-z\\xdf-\\xf6\\xf8-\\xff]+",RegExp(e+"+(?="+e+t+")|"+e+"?"+t+"|"+e+"+|[0-9]+","g")),Ea=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Aa=-1,Ia={};Ia[Vn]=Ia[Gn]=Ia[$n]=Ia[Wn]=Ia[Zn]=Ia[Yn]=Ia[Xn]=Ia[Jn]=Ia[Qn]=!0,Ia[Fn]=Ia[Rn]=Ia[Kn]=Ia[zn]=Ia[Mn]=Ia[Nn]=Ia[Dn]=Ia[r]=Ia[qn]=Ia[Ln]=Ia[Un]=Ia[i]=Ia[Hn]=Ia[n]=!1;var Pa={};Pa[Fn]=Pa[Rn]=Pa[Kn]=Pa[zn]=Pa[Mn]=Pa[Vn]=Pa[Gn]=Pa[$n]=Pa[Wn]=Pa[Zn]=Pa[qn]=Pa[Ln]=Pa[Un]=Pa[Hn]=Pa[Yn]=Pa[Xn]=Pa[Jn]=Pa[Qn]=!0,Pa[Nn]=Pa[Dn]=Pa[r]=Pa[i]=Pa[n]=!1;var a={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},o={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},s={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},c={function:!0,object:!0},u={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},f={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},p=c[void 0===_?"undefined":_typeof(_)]&&_&&!_.nodeType&&_,h=c[void 0===y?"undefined":_typeof(y)]&&y&&!y.nodeType&&y,l=p&&h&&"object"==(void 0===b?"undefined":_typeof(b))&&b&&b.Object&&b,d=c["undefined"==typeof self?"undefined":_typeof(self)]&&self&&self.Object&&self,m=c["undefined"==typeof window?"undefined":_typeof(window)]&&window&&window.Object&&window,g=h&&h.exports===p&&p,Oa=l||m!==(this&&this.window)&&m||d||this;function Ta(e,t){if(e!==t){var r=null===e,i=e===dn,n=e==e,a=null===t,o=t===dn,s=t==t;if(t>>1,$=9007199254740991,W=O&&new O,Z={};function Y(e){if(Ka(e)&&!ui(e)&&!(e instanceof Q)){if(e instanceof J)return e;if(_.call(e,"__chain__")&&_.call(e,"__wrapped__"))return Qt(e)}return new J(e)}function X(){}function J(e,t,r){this.__wrapped__=e,this.__actions__=r||[],this.__chain__=!!t}Y.support={};function Q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function ee(){this.__data__={}}function te(e){var t=e?e.length:0;for(this.data={hash:B(null),set:new j};t--;)this.push(e[t])}function re(e,t){var r=e.data;return("string"==typeof t||li(t)?r.set.has(t):r.hash[t])?0:-1}function ie(e,t){var r=-1,i=e.length;for(t||(t=P(i));++r=Pn?st(t):null,c=t.length;s&&(a=re,o=!1,t=s);e:for(;++n>>0,t>>>=0;for(var a=P(n);++i>>1,o=e[a];(r?o<=t:o=Pn)return n.plant(t).value();for(var r=0,i=a?o[r].apply(this,e):t;++r=An)return e}else Gt=0;return Ue(e,t)});function Zt(e){for(var t=Ri(e),r=t.length,i=r&&e.length,n=!!i&&Ut(i)&&(ui(e)||ci(e)),a=-1,o=[];++a>>0,r>>>=0;r=N(t,r)&&e=(e=Ra(e)).length)return e;var o=i-n.length;if(o<1)return n;var s=e.slice(0,o);if(null==a)return s+n;if(vi(a)){if(e.slice(o).search(a)){var c,u,f=e.slice(0,o);for(a.global||(a=b(a.source,(ba.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(f);)u=c.index;s=s.slice(0,null==u?o:u)}}else if(e.indexOf(a,o)!=o){var p=s.lastIndexOf(a);-1=0.13.7 <0.14.0",_id:"bitcore-lib@0.13.19",_inCache:!0,_installable:!0,_location:"/bitcore-lib",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/bitcore-lib-0.13.19.tgz_1470850061596_0.2146058666985482"},_npmUser:{email:"braydon@bitpay.com",name:"braydonf"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{name:"bitcore-lib",raw:"bitcore-lib@^0.13.7",rawSpec:"^0.13.7",scope:null,spec:">=0.13.7 <0.14.0",type:"range"},_requiredBy:["/","/bitcore-message"],_resolved:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz",_shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",_shrinkwrap:{dependencies:{"bn.js":{from:"bn.js@=2.0.4",resolved:"https://registry.npmjs.org/bn.js/-/bn.js-2.0.4.tgz",version:"2.0.4"},bs58:{from:"bs58@=2.0.0",resolved:"https://registry.npmjs.org/bs58/-/bs58-2.0.0.tgz",version:"2.0.0"},"buffer-compare":{from:"buffer-compare@=1.0.0",resolved:"https://registry.npmjs.org/buffer-compare/-/buffer-compare-1.0.0.tgz",version:"1.0.0"},elliptic:{dependencies:{brorand:{from:"brorand@^1.0.1",resolved:"https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz",version:"1.0.5"},"hash.js":{from:"hash.js@=1.0.3",resolved:"https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz",version:"1.0.3"}},from:"elliptic@=3.0.3",resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",version:"3.0.3"},inherits:{from:"inherits@=2.0.1",resolved:"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",version:"2.0.1"},lodash:{from:"lodash@=3.10.1",resolved:"https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",version:"3.10.1"}},name:"bitcore",version:"0.13.18"},_spec:"bitcore-lib@^0.13.7",_where:"/home/administrator/javascript-opentimestamps",author:{email:"dev@bitpay.com",name:"BitPay"},browser:{request:"browser-request"},bugs:{url:"https://github.com/bitpay/bitcore-lib/issues"},contributors:[{name:"Manuel Araoz",email:"manuelaraoz@gmail.com"},{name:"Daniel Cousens",email:"bitcoin@dcousens.com"},{name:"Gordon Hall",email:"gordon@bitpay.com"},{name:"Jeff Garzik",email:"jgarzik@bitpay.com"},{name:"Kyle Drake",email:"kyle@kyledrake.net"},{name:"Esteban Ordano",email:"eordano@gmail.com"},{name:"Matias Alejo Garcia",email:"ematiu@gmail.com"},{name:"Ryan X. Charles",email:"ryanxcharles@gmail.com"},{name:"Stefan Thomas",email:"moon@justmoon.net"},{name:"Stephen Pair",email:"stephen@bitpay.com"},{name:"Wei Lu",email:"luwei.here@gmail.com"}],dependencies:{"bn.js":"=2.0.4",bs58:"=2.0.0","buffer-compare":"=1.0.0",elliptic:"=3.0.3",inherits:"=2.0.1",lodash:"=3.10.1"},description:"A pure and powerful JavaScript Bitcoin library.",devDependencies:{"bitcore-build":"github:bitpay/bitcore-build",brfs:"^1.2.0",chai:"^1.10.0",gulp:"^3.8.10",sinon:"^1.13.0"},directories:{},dist:{shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",tarball:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz"},gitHead:"9517864f14d09700f3fd02ff61173003c0280774",homepage:"https://github.com/bitpay/bitcore-lib#readme",keywords:["address","bip21","bip32","bip37","bip69","bip70","bitcoin","blockchain","cryptocurrency","ecies","multisig","p2p","payment","transaction"],license:"MIT",main:"index.js",maintainers:[{name:"braydonf",email:"braydon@bitpay.com"},{name:"gabegattis",email:"gabegattis@gmail.com"},{name:"gasteve",email:"stephen@pairhome.net"},{name:"patrickbitpay",email:"patrick@bitpay.com"}],name:"bitcore-lib",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/bitpay/bitcore-lib.git"},scripts:{build:"gulp",coverage:"gulp coverage",lint:"gulp lint",test:"gulp test"},version:"0.13.19"}},{}],151:[function(e,t,r){var i=e("bitcore-lib");i.Message=e("./lib/message"),t.exports=i.Message},{"./lib/message":152,"bitcore-lib":78}],152:[function(r,d,e){(function(o){"use strict";var e=r("bitcore-lib"),s=e.deps._,i=e.PrivateKey,n=e.PublicKey,c=e.Address,a=e.encoding.BufferWriter,u=e.crypto.ECDSA,f=e.crypto.Signature,p=e.crypto.Hash.sha256sha256,t=e.util.js,h=e.util.preconditions,l=function e(t){return this instanceof e?(h.checkArgument(s.isString(t),"First argument should be a string"),this.message=t,this):new e(t)};l.MAGIC_BYTES=new o("Bitcoin Signed Message:\n"),l.prototype.magicHash=function(){var e=a.varintBufNum(l.MAGIC_BYTES.length),t=new o(this.message),r=a.varintBufNum(t.length),i=o.concat([e,l.MAGIC_BYTES,r,t]);return p(i)},l.prototype._sign=function(e){h.checkArgument(e instanceof i,"First argument should be an instance of PrivateKey");var t=this.magicHash(),r=new u;return r.hashbuf=t,r.privkey=e,r.pubkey=e.toPublicKey(),r.signRandomK(),r.calci(),r.sig},l.prototype.sign=function(e){return this._sign(e).toCompact().toString("base64")},l.prototype._verify=function(e,t){h.checkArgument(e instanceof n,"First argument should be an instance of PublicKey"),h.checkArgument(t instanceof f,"Second argument should be an instance of Signature");var r=this.magicHash(),i=u.verify(r,t,e);return i||(this.error="The signature was invalid"),i},l.prototype.verify=function(e,t){h.checkArgument(e),h.checkArgument(t&&s.isString(t)),s.isString(e)&&(e=c.fromString(e));var r=f.fromCompact(new o(t,"base64")),i=new u;i.hashbuf=this.magicHash(),i.sig=r;var n=i.toPublicKey(),a=c.fromPublicKey(n,e.network);return e.toString()!==a.toString()?!(this.error="The signature did not match the message digest"):this._verify(n,r)},l.fromString=function(e){return new l(e)},l.fromJSON=function(e){return t.isValidJSON(e)&&(e=JSON.parse(e)),new l(e.message)},l.prototype.toObject=function(){return{message:this.message}},l.prototype.toJSON=function(){return JSON.stringify(this.toObject())},l.prototype.toString=function(){return this.message},l.prototype.inspect=function(){return""},d.exports=l}).call(this,r("buffer").Buffer)},{"bitcore-lib":78,buffer:191}],153:[function(e,r,i){(function(Q,U,u){!function(e){if("object"==(void 0===i?"undefined":_typeof(i))&&void 0!==r)r.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:void 0!==U?t=U:"undefined"!=typeof self&&(t=self),t.Promise=e()}}(function(){var e,t,r;return function a(o,s,c){function u(r,e){if(!s[r]){if(!o[r]){var t="function"==typeof _dereq_&&_dereq_;if(!e&&t)return t(r,!0);if(f)return f(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[r]={exports:{}};o[r][0].call(n.exports,function(e){var t=o[r][1][e];return u(t||e)},n,n.exports,a,o,s,c)}return s[r].exports}for(var f="function"==typeof _dereq_&&_dereq_,e=0;e, no stack trace)"}function V(){return"function"==typeof Y}var G=function(){return!1},$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function W(e){var t=e.match($);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function Z(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);Y(this,Z),32=a)return r[t]=e,this._queue.push(t),!1;null!==n&&(n[t]=e);var o=this._promise,s=this._callback,c=o._boundValue();o._pushContext();var u=g(s).call(c,e,t,i),f=o._popContext();if(m.checkForgottenReturns(u,f,null!==n?"Promise.filter":"Promise.map",o),u===v)return this._reject(u.e),!0;var p=d(u,this._promise);if(p instanceof l){var h=(p=p._target())._bitField;if(0==(50397184&h))return 1<=a&&this._inFlight++,(r[t]=p)._proxy(this,-1*(t+1)),!1;if(0==(33554432&h))return 0!=(16777216&h)?this._reject(p._reason()):this._cancel(),!0;u=p._value()}r[t]=u}return i<=++this._totalResolved&&(null!==n?this._filter(r,n):this._resolve(r),!0)},f.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;0>>16)){if(e===this){var r=c();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,0<(65535&t)&&(0!=(134217728&t)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},E.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,d.isNode);0<(65535&t)?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},E.prototype._fulfillPromises=function(e,t){for(var r=1;r=this._length&&(this._resolve(this._values),!0)},t.prototype._promiseCancelled=function(){return this._cancel(),!0},t.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},t.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof s)e.cancel();else for(var t=0;t=this._length){var r;if(this._isMap)r=function(e){for(var t=new s,r=e.length/2|0,i=0;i>1},i.prototype.props=function(){return r(this)},i.props=function(e){return r(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function i(e){this._capacity=e,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},n.prototype._promiseFulfilled=function(e,t){var r=new i;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},n.prototype._promiseRejected=function(e,t){var r=new i;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},e.settle=function(e){return r.deprecated(".settle()",".reflect()"),new n(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(f,e,t){"use strict";e.exports=function(e,t,n){var r=f("./util"),i=f("./errors").RangeError,a=f("./errors").AggregateError,o=r.isArray,s={};function c(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function u(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new c(e),i=r.promise();return r.setHowMany(t),r.init(),i}r.inherits(c,t),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=o(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(e){this._howMany=e},c.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(s),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);else if("le"===r)for(n=i=0;i>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-a&4194303,26<=(a+=24)&&(a-=26,i++);r+6!==t&&(n=o(e,t,r+6),this.words[i]|=n<>>26-a&4194303),this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=67108863&o,c=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,p=67108863&c,h=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=h;l++){var d=u-l|0;f+=(o=(n=0|e.words[d])*(a=0|t.words[l])+p)/67108864|0,p=67108863&o}r.words[u]=0|p,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}v.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,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}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)&&2<=e&&e<=36){var c=l[e],u=d[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var p=f.modn(u).toString(e);r=(f=f.idivn(u)).isZero()?p+r:h[c-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.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]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},v.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)},v.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},v.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},v.prototype.inotn=function(e){g("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},v.prototype.notn=function(e){return this.clone().inotn(e)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);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,e):(r=e,this);for(var n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},v.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;i=0>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],d=8191&l,m=l>>>13,g=0|o[2],v=8191&g,b=g>>>13,y=0|o[3],_=8191&y,w=y>>>13,k=0|o[4],x=8191&k,S=k>>>13,j=0|o[5],E=8191&j,A=j>>>13,I=0|o[6],P=8191&I,O=I>>>13,T=0|o[7],B=8191&T,C=T>>>13,F=0|o[8],R=8191&F,z=F>>>13,M=0|o[9],N=8191&M,D=M>>>13,q=0|s[0],L=8191&q,U=q>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],$=8191&G,W=G>>>13,Z=0|s[3],Y=8191&Z,X=Z>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],ae=8191&ne,oe=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],pe=8191&fe,he=fe>>>13,le=0|s[9],de=8191&le,me=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(p,L))|0)+((8191&(n=(n=Math.imul(p,U))+Math.imul(h,L)|0))<<13)|0;u=((a=Math.imul(h,U))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,L),n=(n=Math.imul(d,U))+Math.imul(m,L)|0,a=Math.imul(m,U);var ve=(u+(i=i+Math.imul(p,K)|0)|0)+((8191&(n=(n=n+Math.imul(p,V)|0)+Math.imul(h,K)|0))<<13)|0;u=((a=a+Math.imul(h,V)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(b,L)|0,a=Math.imul(b,U),i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,V)|0;var be=(u+(i=i+Math.imul(p,$)|0)|0)+((8191&(n=(n=n+Math.imul(p,W)|0)+Math.imul(h,$)|0))<<13)|0;u=((a=a+Math.imul(h,W)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(_,L),n=(n=Math.imul(_,U))+Math.imul(w,L)|0,a=Math.imul(w,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,i=i+Math.imul(d,$)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,W)|0;var ye=(u+(i=i+Math.imul(p,Y)|0)|0)+((8191&(n=(n=n+Math.imul(p,X)|0)+Math.imul(h,Y)|0))<<13)|0;u=((a=a+Math.imul(h,X)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(x,L),n=(n=Math.imul(x,U))+Math.imul(S,L)|0,a=Math.imul(S,U),i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,W)|0,i=i+Math.imul(d,Y)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,X)|0;var _e=(u+(i=i+Math.imul(p,Q)|0)|0)+((8191&(n=(n=n+Math.imul(p,ee)|0)+Math.imul(h,Q)|0))<<13)|0;u=((a=a+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(A,L)|0,a=Math.imul(A,U),i=i+Math.imul(x,K)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,V)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,W)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(b,Y)|0,a=a+Math.imul(b,X)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0;var we=(u+(i=i+Math.imul(p,re)|0)|0)+((8191&(n=(n=n+Math.imul(p,ie)|0)+Math.imul(h,re)|0))<<13)|0;u=((a=a+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(O,L)|0,a=Math.imul(O,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,V)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,W)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,X)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0;var ke=(u+(i=i+Math.imul(p,ae)|0)|0)+((8191&(n=(n=n+Math.imul(p,oe)|0)+Math.imul(h,ae)|0))<<13)|0;u=((a=a+Math.imul(h,oe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(C,L)|0,a=Math.imul(C,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(O,K)|0,a=a+Math.imul(O,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,W)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(S,Y)|0,a=a+Math.imul(S,X)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ie)|0,i=i+Math.imul(d,ae)|0,n=(n=n+Math.imul(d,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var xe=(u+(i=i+Math.imul(p,ce)|0)|0)+((8191&(n=(n=n+Math.imul(p,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((a=a+Math.imul(h,ue)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(R,L),n=(n=Math.imul(R,U))+Math.imul(z,L)|0,a=Math.imul(z,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,W)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ie)|0,i=i+Math.imul(v,ae)|0,n=(n=n+Math.imul(v,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,i=i+Math.imul(d,ce)|0,n=(n=n+Math.imul(d,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0;var Se=(u+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,he)|0)+Math.imul(h,pe)|0))<<13)|0;u=((a=a+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,U))+Math.imul(D,L)|0,a=Math.imul(D,U),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(z,K)|0,a=a+Math.imul(z,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,W)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,Y)|0,a=a+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ie)|0,i=i+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,i=i+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,ue)|0,i=i+Math.imul(d,pe)|0,n=(n=n+Math.imul(d,he)|0)+Math.imul(m,pe)|0,a=a+Math.imul(m,he)|0;var je=(u+(i=i+Math.imul(p,de)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(h,de)|0))<<13)|0;u=((a=a+Math.imul(h,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(N,K),n=(n=Math.imul(N,V))+Math.imul(D,K)|0,a=Math.imul(D,V),i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,W)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,W)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(C,Y)|0,a=a+Math.imul(C,X)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ie)|0,i=i+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,ue)|0,i=i+Math.imul(v,pe)|0,n=(n=n+Math.imul(v,he)|0)+Math.imul(b,pe)|0,a=a+Math.imul(b,he)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;u=((a=a+Math.imul(m,me)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(N,$),n=(n=Math.imul(N,W))+Math.imul(D,$)|0,a=Math.imul(D,W),i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,X)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ie)|0,i=i+Math.imul(E,ae)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,i=i+Math.imul(x,ce)|0,n=(n=n+Math.imul(x,ue)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,ue)|0,i=i+Math.imul(_,pe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,pe)|0,a=a+Math.imul(w,he)|0;var Ae=(u+(i=i+Math.imul(v,de)|0)|0)+((8191&(n=(n=n+Math.imul(v,me)|0)+Math.imul(b,de)|0))<<13)|0;u=((a=a+Math.imul(b,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(N,Y),n=(n=Math.imul(N,X))+Math.imul(D,Y)|0,a=Math.imul(D,X),i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ie)|0,i=i+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,i=i+Math.imul(x,pe)|0,n=(n=n+Math.imul(x,he)|0)+Math.imul(S,pe)|0,a=a+Math.imul(S,he)|0;var Ie=(u+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,me)|0)+Math.imul(w,de)|0))<<13)|0;u=((a=a+Math.imul(w,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(N,Q),n=(n=Math.imul(N,ee))+Math.imul(D,Q)|0,a=Math.imul(D,ee),i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ie)|0,i=i+Math.imul(B,ae)|0,n=(n=n+Math.imul(B,oe)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,ue)|0,i=i+Math.imul(E,pe)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(A,pe)|0,a=a+Math.imul(A,he)|0;var Pe=(u+(i=i+Math.imul(x,de)|0)|0)+((8191&(n=(n=n+Math.imul(x,me)|0)+Math.imul(S,de)|0))<<13)|0;u=((a=a+Math.imul(S,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(N,re),n=(n=Math.imul(N,ie))+Math.imul(D,re)|0,a=Math.imul(D,ie),i=i+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,i=i+Math.imul(B,ce)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,ue)|0,i=i+Math.imul(P,pe)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(O,pe)|0,a=a+Math.imul(O,he)|0;var Oe=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(A,de)|0))<<13)|0;u=((a=a+Math.imul(A,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(N,ae),n=(n=Math.imul(N,oe))+Math.imul(D,ae)|0,a=Math.imul(D,oe),i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(z,ce)|0,a=a+Math.imul(z,ue)|0,i=i+Math.imul(B,pe)|0,n=(n=n+Math.imul(B,he)|0)+Math.imul(C,pe)|0,a=a+Math.imul(C,he)|0;var Te=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(O,de)|0))<<13)|0;u=((a=a+Math.imul(O,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(N,ce),n=(n=Math.imul(N,ue))+Math.imul(D,ce)|0,a=Math.imul(D,ue),i=i+Math.imul(R,pe)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(z,pe)|0,a=a+Math.imul(z,he)|0;var Be=(u+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,me)|0)+Math.imul(C,de)|0))<<13)|0;u=((a=a+Math.imul(C,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(N,pe),n=(n=Math.imul(N,he))+Math.imul(D,pe)|0,a=Math.imul(D,he);var Ce=(u+(i=i+Math.imul(R,de)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(z,de)|0))<<13)|0;u=((a=a+Math.imul(z,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Fe=(u+(i=Math.imul(N,de))|0)+((8191&(n=(n=Math.imul(N,me))+Math.imul(D,de)|0))<<13)|0;return u=((a=Math.imul(D,me))+(n>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,c[0]=ge,c[1]=ve,c[2]=be,c[3]=ye,c[4]=_e,c[5]=we,c[6]=ke,c[7]=xe,c[8]=Se,c[9]=je,c[10]=Ee,c[11]=Ae,c[12]=Ie,c[13]=Pe,c[14]=Oe,c[15]=Te,c[16]=Be,c[17]=Ce,c[18]=Fe,0!==u&&(c[19]=u,r.length++),r};function s(e,t,r){return(new c).mulp(e,t,r)}function c(e,t){this.x=e,this.y=t}Math.imul||(a=n),v.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?a(this,e,t):r<63?n(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,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},c.prototype.makeRBT=function(e){for(var t=new Array(e),r=v.prototype._countBits(e)-1,i=0;i>=1;return i},c.prototype.permute=function(e,t,r,i,n,a){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*a+1]=8191&n,n>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.muln=function(e){return this.clone().imuln(e)},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.imul(this.clone())},v.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 v(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<a)for(this.length-=a,c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},v.prototype.ishrn=function(e,t,r){return g(0===this.negative),this.iushrn(e,t,r)},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.ushln=function(e){return this.clone().iushln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.ushrn=function(e){return this.clone().iushrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===o)return this.strip();for(g(-1===o),i=o=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,a},v.prototype.div=function(e){return this.divmod(e,"div",!1).div},v.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},v.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},v.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),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(0===e.negative),g(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var c=r.clone(),u=t.clone();!t.isZero();){for(var f=0,p=1;0==(t.words[0]&p)&&f<26;++f,p<<=1);if(0>>26,o&=67108863,this.words[a]=o}return 0!==n&&(this.words[a]=n,this.length++),this},v.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},v.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(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(u[e])return u[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new b;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return u[e]=t},w.prototype._verify1=function(e){g(0===e.negative,"red works only with positives"),g(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){g(0==(e.negative|t.negative),"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},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 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&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();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);g(!i.isZero());var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==a?(a<<=1,a|=f,(4===++o||0===i&&0===u)&&(n=this.mul(n,r[a]),a=o=0)):o=0}s=26}return n},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},v.mont=function(e){return new k(e)},r(k,w),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.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),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new v(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:157}],155:[function(e,t,r){var A=e("concat-map"),I=e("balanced-match");t.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function t(e,r){var i=[];var n=I("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var s=a||o;var c=0<=n.body.indexOf(",");if(!s&&!c)return n.post.match(/,.*\}/)?(e=n.pre+"{"+n.body+P+n.post,t(e)):[e];var u;if(s)u=n.body.split(/\.\./);else if(1===(u=T(n.body)).length&&1===(u=t(u[0],!1).map(B)).length){var f=n.post.length?t(n.post,!1):[""];return f.map(function(e){return n.pre+u[0]+e})}var p=n.pre;var f=n.post.length?t(n.post,!1):[""];var h;if(s){var l=O(u[0]),d=O(u[1]),m=Math.max(u[0].length,u[1].length),g=3==u.length?Math.abs(O(u[2])):1,v=F,b=d>>24]^f[d>>>16&255]^p[m>>>8&255]^h[255&g]^t[v++],o=u[d>>>24]^f[m>>>16&255]^p[g>>>8&255]^h[255&l]^t[v++],s=u[m>>>24]^f[g>>>16&255]^p[l>>>8&255]^h[255&d]^t[v++],c=u[g>>>24]^f[l>>>16&255]^p[d>>>8&255]^h[255&m]^t[v++],l=a,d=o,m=s,g=c;return a=(i[l>>>24]<<24|i[d>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[v++],o=(i[d>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&l])^t[v++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[l>>>8&255]<<8|i[255&d])^t[v++],c=(i[g>>>24]<<24|i[l>>>16&255]<<16|i[d>>>8&255]<<8|i[255&m])^t[v++],[a>>>=0,o>>>=0,s>>>=0,c>>>=0]}var p=[0,1,2,4,8,16,32,64,128,27,54],h=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=[[],[],[],[]],a=[[],[],[],[]],o=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;var f=e[i[r[o]=u]=o],p=e[f],h=e[p],l=257*e[u]^16843008*u;n[0][o]=l<<24|l>>>8,n[1][o]=l<<16|l>>>16,n[2][o]=l<<8|l>>>24,n[3][o]=l,l=16843009*h^65537*p^257*f^16843008*o,a[0][u]=l<<24|l>>>8,a[1][u]=l<<16|l>>>16,a[2][u]=l<<8|l>>>24,a[3][u]=l,0===o?o=s=1:(o=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();function s(e){this._key=a(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],a=0;a>>24,o=h.SBOX[o>>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o],o^=p[a/t|0]<<24):6>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o]),n[a]=n[a-t]^o}for(var s=[],c=0;c>>24]]^h.INV_SUB_MIX[1][h.SBOX[f>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[f>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return o(e=a(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=a(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":447}],159:[function(e,t,r){var o=e("./aes"),u=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),f=e("./ghash"),n=e("buffer-xor"),p=e("./incr32");function a(e,t,r,i){s.call(this);var n=u.alloc(4,0);this._cipher=new o.AES(t);var a=this._cipher.encryptBlock(n);this._ghash=new f(a),r=function(e,t,r){if(12===t.length)return e._finID=u.concat([t,u.from([0,0,0,1])]),u.concat([t,u.from([0,0,0,2])]);var i=new f(r),n=t.length,a=n%16;i.update(t),a&&(a=16-a,i.update(u.alloc(a,0))),i.update(u.alloc(8,0));var o=8*n,s=u.alloc(8);s.writeUIntBE(o,0,8),i.update(s),e._finID=i.state;var c=u.from(e._finID);return p(c),c}(this,r,a),this._prev=u.from(r),this._cache=u.allocUnsafe(0),this._secCache=u.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(a,s),a.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=u.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},a.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(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;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":447}],164:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],165:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":190}],166:[function(e,t,r){var a=e("safe-buffer").Buffer,o=e("buffer-xor");function s(e,t,r){var i=t.length,n=o(t,e._cache);return e._cache=e._cache.slice(i),e._prev=a.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=a.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=a.allocUnsafe(0)),!(e._cache.length<=t.length)){n=a.concat([n,s(e,t,r)]);break}i=e._cache.length,n=a.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":190,"safe-buffer":447}],167:[function(e,t,r){var o=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,a=-1,o=0;++a<8;)i=t&1<<7-a?128:0,o+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>a%8,e._prev=c(e._prev,r?i:n);return o}function c(e,t){var r=e.length,i=-1,n=o.allocUnsafe(e.length);for(e=o.concat([e,o.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=o.allocUnsafe(i),a=-1;++a=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var a=m(r);if("ec"===a.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=g[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new d(i),a=r.data.subjectPrivateKey.data;return n.verify(t,e,a)}(e,t,a)}if("dsa"===a.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,a=r.data.g,o=r.data.pub_key,s=m.signature.decode(e,"der"),c=s.s,u=s.r;v(c,n),v(u,n);var f=l.mont(i),p=c.invm(n);return 0===a.toRed(f).redPow(new l(t).mul(p).mod(n)).fromRed().mul(o.toRed(f).redPow(u.mul(p).mod(n)).fromRed()).mod(i).mod(n).cmp(u)}(e,t,a)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var o=a.modulus.byteLength(),s=[1],c=0;t.length+s.length+2l.UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function h(e,t){for(var r=0;rm.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsm.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelm.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelm.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=m.Z_FILTERED&&e.strategy!=m.Z_HUFFMAN_ONLY&&e.strategy!=m.Z_RLE&&e.strategy!=m.Z_FIXED&&e.strategy!=m.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!g.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new o.Zlib(t);var i=this;this._hadError=!1,this._binding.onerror=function(e,t){i._binding=null,i._hadError=!0;var r=new Error(e);r.errno=t,r.code=m.codes[t],i.emit("error",r)};var r=m.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(r=e.level);var n=m.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(n=e.strategy),this._binding.init(e.windowBits||m.Z_DEFAULT_WINDOWBITS,r,e.memLevel||m.Z_DEFAULT_MEMLEVEL,n,e.dictionary),this._buffer=new g(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=n,this.once("end",this.close)}o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION,Object.keys(o).forEach(function(e){e.match(/^Z/)&&(m[e]=o[e])}),m.codes={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},Object.keys(m.codes).forEach(function(e){m.codes[m.codes[e]]=e}),m.Deflate=s,m.Inflate=c,m.Gzip=u,m.Gunzip=f,m.DeflateRaw=p,m.InflateRaw=h,m.Unzip=l,m.createDeflate=function(e){return new s(e)},m.createInflate=function(e){return new c(e)},m.createDeflateRaw=function(e){return new p(e)},m.createInflateRaw=function(e){return new h(e)},m.createGzip=function(e){return new u(e)},m.createGunzip=function(e){return new f(e)},m.createUnzip=function(e){return new l(e)},m.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new s(t),e,r)},m.deflateSync=function(e,t){return r(new s(t),e)},m.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new u(t),e,r)},m.gzipSync=function(e,t){return r(new u(t),e)},m.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new p(t),e,r)},m.deflateRawSync=function(e,t){return r(new p(t),e)},m.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new l(t),e,r)},m.unzipSync=function(e,t){return r(new l(t),e)},m.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new c(t),e,r)},m.inflateSync=function(e,t){return r(new c(t),e)},m.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new f(t),e,r)},m.gunzipSync=function(e,t){return r(new f(t),e)},m.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new h(t),e,r)},m.inflateRawSync=function(e,t){return r(new h(t),e)},e.inherits(t,a),t.prototype.params=function(e,t,r){if(em.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=m.Z_FILTERED&&t!=m.Z_HUFFMAN_ONLY&&t!=m.Z_RLE&&t!=m.Z_FIXED&&t!=m.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var i=this;this.flush(o.Z_SYNC_FLUSH,function(){i._binding.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())})}else n.nextTick(r)},t.prototype.reset=function(){return this._binding.reset()},t.prototype._flush=function(e){this._transform(new g(0),"",e)},t.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=o.Z_FULL_FLUSH),r.ended)t&&n.nextTick(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var i=this;this.once("drain",function(){i.flush(t)})}else this._flushFlag=e,this.write(new g(0),"",t)},t.prototype.close=function(e){if(e&&n.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;n.nextTick(function(){t.emit("close")})}},t.prototype._transform=function(e,t,r){var i,n=this._writableState,a=(n.ending||n.ended)&&(!e||n.length===e.length);if(null===!e&&!g.isBuffer(e))return r(new Error("invalid input"));a?i=o.Z_FINISH:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH));this._processChunk(e,i,r)},t.prototype._processChunk=function(a,o,s){var c=a&&a.length,u=this._chunkSize-this._offset,f=0,p=this,h="function"==typeof s;if(!h){var t,l=[],d=0;this.on("error",function(e){t=e});do{var e=this._binding.writeSync(o,a,f,c,this._buffer,this._offset,u)}while(!this._hadError&&m(e[0],e[1]));if(this._hadError)throw t;var r=g.concat(l,d);return this.close(),r}var i=this._binding.write(o,a,f,c,this._buffer,this._offset,u);function m(e,t){if(!p._hadError){var r=u-t;if(v(0<=r,"have should not go down"),0=p._chunkSize)&&(u=p._chunkSize,p._offset=0,p._buffer=new g(p._chunkSize)),0===t){if(f+=c-e,c=e,!h)return!0;var n=p._binding.write(o,a,f,c,p._buffer,p._offset,p._chunkSize);return n.callback=m,void(n.buffer=a)}if(!h)return!1;s()}}i.buffer=a,i.callback=m},e.inherits(s,t),e.inherits(c,t),e.inherits(u,t),e.inherits(f,t),e.inherits(p,t),e.inherits(h,t),e.inherits(l,t)}).call(this,d("_process"),d("buffer").Buffer)},{"./binding":185,_process:382,_stream_transform:427,assert:67,buffer:191,util:505}],187:[function(e,t,r){arguments[4][157][0].apply(r,arguments)},{dup:157}],188:[function(e,B,C){(function(T){!function(e){var t="object"==(void 0===C?"undefined":_typeof(C))&&C&&!C.nodeType&&C,r="object"==(void 0===B?"undefined":_typeof(B))&&B&&!B.nodeType&&B,i="object"==(void 0===T?"undefined":_typeof(T))&&T;i.global!==i&&i.window!==i&&i.self!==i||(e=i);var n,a,v=2147483647,b=36,y=1,_=26,o=38,s=700,w=72,k=128,x="-",c=/^xn--/,u=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=b-y,S=Math.floor,j=String.fromCharCode;function E(e){throw new RangeError(p[e])}function l(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function d(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((v-d)/o))&&E("overflow"),d+=c*o,!(c<(u=s<=g?y:g+_<=s?_:s-g));s+=b)o>S(v/(f=b-u))&&E("overflow"),o*=f;g=O(d-a,t=h.length+1,0==a),S(d/t)>v-m&&E("overflow"),m+=S(d/t),d%=t,h.splice(d++,0,m)}return I(h)}function g(e){var t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g=[];for(h=(e=A(e)).length,t=k,a=w,o=r=0;oS((v-r)/(l=i+1))&&E("overflow"),r+=(s-t)*l,t=s,o=0;ov&&E("overflow"),p==t){for(c=r,u=b;!(c<(f=u<=a?y:a+_<=u?_:u-a));u+=b)m=c-f,d=b-f,g.push(j(P(f+m%d,0))),c=S(m/d);g.push(j(P(c,0))),a=O(r,l,i==n),r=0,++i}++r,++t}return g.join("")}if(n={version:"1.4.1",ucs2:{decode:A,encode:I},decode:m,encode:g,toASCII:function(e){return d(e,function(e){return u.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return d(e,function(e){return c.test(e)?m(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",function(){return n});else if(t&&r)if(B.exports==t)r.exports=n;else for(a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],189:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var a=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=c;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function c(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}a.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},a.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:191}],190:[function(e,t,r){(function(a){t.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new a(r),n=0;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function l(e,t){if(p.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return R(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=p.from(t,i)),p.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,n);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,n){var a,o=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;s/=o=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var f=-1;for(a=r;a>>10&1023|55296),f=56320|1023&f),i.push(f),n+=p}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;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 S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===p.compare(this,e)},p.prototype.inspect=function(){var e="",t=N.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,i,n){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(i,n),u=e.slice(t,r),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a,o,s,c,u,f,p,h,l,d=!1;;)switch(i){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return h=t,l=r,M(R(e,(p=this).length-h),p,h,l);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return c=this,u=t,f=r,M(z(e),c,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=t,s=r,M(function(e,t){for(var r,i,n,a=[],o=0;o>8,n=r%256,a.push(n),a.push(i);return a}(e,(a=this).length-o),a,o,s);default:if(d)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function k(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function I(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function P(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function O(e,t,r,i,n,a){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(e,t,r,i,n){return n||O(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function B(e,t,r,i,n){return n||O(e,0,r,8),a.write(e,t,r,i,52,8),r+8}p.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):I(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;0<=--a&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function z(e){return i.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function M(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":75,ieee754:318,isarray:323}],192:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],193:[function(e,t,r){function n(e){this.dict=e||{}}n.prototype.set=function(e,t,r){if("object"!==(void 0===e?"undefined":_typeof(e))){void 0===r&&(r=!0);var i=this.has(e);return!r&&i?this.dict[i]=this.dict[i]+","+t:this.dict[i||e]=t,i}for(var n in e)this.set(n,e[n],t)},n.prototype.has=function(e){for(var t=Object.keys(this.dict),r=(e=e.toLowerCase(),0);rr)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>8^255&n^99,u[r]=n;var a=e[f[n]=r],o=e[a],s=e[o],c=257*e[n]^16843008*n;p[r]=c<<24|c>>>8,h[r]=c<<16|c>>>16,l[r]=c<<8|c>>>24,d[r]=c;c=16843009*s^65537*o^257*a^16843008*r;m[n]=c<<24|c>>>8,g[n]=c<<16|c>>>16,v[n]=c<<8|c>>>24,b[n]=c,r?(r=a^e[e[e[s^a]]],i^=e[e[i]]):r=i=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],i=r.AES=t.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),n=this._keySchedule=[],a=0;a>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o]):(o=u[(o=o<<8|o>>>24)>>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o],o^=y[a/r|0]<<24),n[a]=n[a-r]^o}for(var s=this._invKeySchedule=[],c=0;c>>24]]^g[u[o>>>16&255]]^v[u[o>>>8&255]]^b[u[255&o]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,p,h,l,d,u)},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,m,g,v,b,f);r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,a,o,s){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],p=e[t+2]^r[2],h=e[t+3]^r[3],l=4,d=1;d>>24]^n[f>>>16&255]^a[p>>>8&255]^o[255&h]^r[l++],g=i[f>>>24]^n[p>>>16&255]^a[h>>>8&255]^o[255&u]^r[l++],v=i[p>>>24]^n[h>>>16&255]^a[u>>>8&255]^o[255&f]^r[l++],b=i[h>>>24]^n[u>>>16&255]^a[f>>>8&255]^o[255&p]^r[l++];u=m,f=g,p=v,h=b}m=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&h])^r[l++],g=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[h>>>8&255]<<8|s[255&u])^r[l++],v=(s[p>>>24]<<24|s[h>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^r[l++],b=(s[h>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^r[l++];e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=b},keySize:8});e.AES=t._createHelper(i)}(),n.AES},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],206:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,c,n,a,o,s,u,f,p,h,l,d,m,g,v,b;e.lib.Cipher||(r=(t=e).lib,i=r.Base,c=r.WordArray,n=r.BufferedBlockAlgorithm,(a=t.enc).Utf8,o=a.Base64,s=t.algo.EvpKDF,u=r.Cipher=n.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function n(e){return"string"==typeof e?b:g}return function(i){return{encrypt:function(e,t,r){return n(t).encrypt(i,e,t,r)},decrypt:function(e,t,r){return n(t).decrypt(i,e,t,r)}}}}()}),r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),f=t.mode={},p=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var e=p.extend();function a(e,t,r){var i=this._iv;if(i){var n=i;this._iv=void 0}else n=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:l}),reset:function(){u.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else{i=r.createDecryptor;this._minBufferSize=1}this._mode=i.call(r,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),d=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var i=c.create([1398893684,1701076831]).concat(r).concat(t);else i=t;return i.toString(o)},parse:function(e){var t=o.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var i=c.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return d.create({ciphertext:t,salt:i})}},g=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),a=n.finalize(t),o=n.cfg;return d.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.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}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=c.random(8));var n=s.create({keySize:t+r}).compute(e,i),a=c.create(n.words.slice(t),4*r);return n.sigBytes=4*t,d.create({key:n,iv:a,salt:i})}},b=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),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 a=g.encrypt.call(this,e,t,n.key,i);return a.mixIn(n),a},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,g.decrypt.call(this,e,t,n.key,i)}}))},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],207:[function(e,t,r){var i,n;i=this,n=function(){var f,r,e,t,i,p,n,a,o,s,c,u,h=h||(f=Math,r=Object.create||function(){function r(){}return function(e){var t;return r.prototype=e,t=new r,r.prototype=null,t}}(),t=(e={}).lib={},i=t.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$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)}},p=t.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).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 a=0;a>>2]>>>24-a%4*8&255;t[i+a>>>2]|=o<<24-(i+a)%4*8}else for(a=0;a>>2]=r[a>>>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=f.ceil(t/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,r=[],i=function(t){t=t;var r=987654321,i=4294967295;return function(){var e=((r=36969*(65535&r)+(r>>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return e/=4294967296,(e+=.5)*(.5>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).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 p.init(r,t/2)}},o=n.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(a))}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 p.init(r,t)}},s=n.Utf8={stringify:function(e){try{return decodeURIComponent(escape(o.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return o.parse(unescape(encodeURIComponent(e)))}},c=t.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=s.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,n=this.blockSize,a=i/(4*n),o=(a=e?f.ceil(a):f.max((0|a)-this._minBufferSize,0))*n,s=f.min(4*o,i);if(o){for(var c=0;c>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.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,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var n=0;n>>6-a%4*2;i[n>>>2]|=(o|s)<<24-n%4*8,n++}return c.create(i,n)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],209:[function(e,t,r){var i,n;i=this,n=function(r){return function(){var e=r,n=e.lib.WordArray,t=e.enc;t.Utf16=t.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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}};function o(e){return e<<8&4278255360|e>>>8&16711935}t.Utf16LE={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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return n.create(r,2*t)}}}(),r.enc.Utf16},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],210:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,f,n,a,o;return r=(t=e).lib,i=r.Base,f=r.WordArray,n=t.algo,a=n.MD5,o=n.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=r.hasher.create(),n=f.create(),a=n.words,o=r.keySize,s=r.iterations;a.lengthi&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),a=this._iKey=t.clone(),o=n.words,s=a.words,c=0;c>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)}).prototype=e}}(),t.lib.WordArray},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],215:[function(e,t,r){var i,n;i=this,n=function(o){return function(f){var e=o,t=e.lib,r=t.WordArray,i=t.Hasher,n=e.algo,E=[];!function(){for(var e=0;e<64;e++)E[e]=4294967296*f.abs(f.sin(e+1))|0}();var a=n.MD5=i.extend({_doReset:function(){this._hash=new r.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 a=this._hash.words,o=e[t+0],s=e[t+1],c=e[t+2],u=e[t+3],f=e[t+4],p=e[t+5],h=e[t+6],l=e[t+7],d=e[t+8],m=e[t+9],g=e[t+10],v=e[t+11],b=e[t+12],y=e[t+13],_=e[t+14],w=e[t+15],k=a[0],x=a[1],S=a[2],j=a[3];x=O(x=O(x=O(x=O(x=P(x=P(x=P(x=P(x=I(x=I(x=I(x=I(x=A(x=A(x=A(x=A(x,S=A(S,j=A(j,k=A(k,x,S,j,o,7,E[0]),x,S,s,12,E[1]),k,x,c,17,E[2]),j,k,u,22,E[3]),S=A(S,j=A(j,k=A(k,x,S,j,f,7,E[4]),x,S,p,12,E[5]),k,x,h,17,E[6]),j,k,l,22,E[7]),S=A(S,j=A(j,k=A(k,x,S,j,d,7,E[8]),x,S,m,12,E[9]),k,x,g,17,E[10]),j,k,v,22,E[11]),S=A(S,j=A(j,k=A(k,x,S,j,b,7,E[12]),x,S,y,12,E[13]),k,x,_,17,E[14]),j,k,w,22,E[15]),S=I(S,j=I(j,k=I(k,x,S,j,s,5,E[16]),x,S,h,9,E[17]),k,x,v,14,E[18]),j,k,o,20,E[19]),S=I(S,j=I(j,k=I(k,x,S,j,p,5,E[20]),x,S,g,9,E[21]),k,x,w,14,E[22]),j,k,f,20,E[23]),S=I(S,j=I(j,k=I(k,x,S,j,m,5,E[24]),x,S,_,9,E[25]),k,x,u,14,E[26]),j,k,d,20,E[27]),S=I(S,j=I(j,k=I(k,x,S,j,y,5,E[28]),x,S,c,9,E[29]),k,x,l,14,E[30]),j,k,b,20,E[31]),S=P(S,j=P(j,k=P(k,x,S,j,p,4,E[32]),x,S,d,11,E[33]),k,x,v,16,E[34]),j,k,_,23,E[35]),S=P(S,j=P(j,k=P(k,x,S,j,s,4,E[36]),x,S,f,11,E[37]),k,x,l,16,E[38]),j,k,g,23,E[39]),S=P(S,j=P(j,k=P(k,x,S,j,y,4,E[40]),x,S,o,11,E[41]),k,x,u,16,E[42]),j,k,h,23,E[43]),S=P(S,j=P(j,k=P(k,x,S,j,m,4,E[44]),x,S,b,11,E[45]),k,x,w,16,E[46]),j,k,c,23,E[47]),S=O(S,j=O(j,k=O(k,x,S,j,o,6,E[48]),x,S,l,10,E[49]),k,x,_,15,E[50]),j,k,p,21,E[51]),S=O(S,j=O(j,k=O(k,x,S,j,b,6,E[52]),x,S,u,10,E[53]),k,x,g,15,E[54]),j,k,s,21,E[55]),S=O(S,j=O(j,k=O(k,x,S,j,d,6,E[56]),x,S,w,10,E[57]),k,x,h,15,E[58]),j,k,y,21,E[59]),S=O(S,j=O(j,k=O(k,x,S,j,f,6,E[60]),x,S,v,10,E[61]),k,x,c,15,E[62]),j,k,m,21,E[63]),a[0]=a[0]+k|0,a[1]=a[1]+x|0,a[2]=a[2]+S|0,a[3]=a[3]+j|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var n=f.floor(r/4294967296),a=r;t[15+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,s=o.words,c=0;c<4;c++){var u=s[c];s[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function A(e,t,r,i,n,a,o){var s=e+(t&r|~t&i)+n+o;return(s<>>32-a)+t}function I(e,t,r,i,n,a,o){var s=e+(t&i|r&~i)+n+o;return(s<>>32-a)+t}function P(e,t,r,i,n,a,o){var s=e+(t^r^i)+n+o;return(s<>>32-a)+t}function O(e,t,r,i,n,a,o){var s=e+(r^(t|~i))+n+o;return(s<>>32-a)+t}e.MD5=i._createHelper(a),e.HmacMD5=i._createHmacHelper(a)}(Math),o.MD5},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],216:[function(e,t,r){var i,n;i=this,n=function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function a(e,t,r,i){var n=this._iv;if(n){var a=n.slice(0);this._iv=void 0}else a=this._prevBlock;i.encryptBlock(a,0);for(var o=0;o>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 t=e.Encryptor=e.extend({processBlock:function(e,t){var r,i=this._cipher,n=i.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),0===((r=o)[0]=u(r[0]))&&(r[1]=u(r[1]));var s=o.slice(0);i.encryptBlock(s,0);for(var c=0;c>>2]|=n<<24-a%4*8,e.sigBytes+=n},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],222:[function(e,t,r){var i,n;i=this,n=function(n){return n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],223:[function(e,t,r){var i,n;i=this,n=function(r){return r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],224:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],225:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],226:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,v,n,a,b,o;return r=(t=e).lib,i=r.Base,v=r.WordArray,n=t.algo,a=n.SHA1,b=n.HMAC,o=n.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=b.create(r.hasher,e),n=v.create(),a=v.create([1]),o=n.words,s=a.words,c=r.keySize,u=r.iterations;o.length>>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]],n=this._b=0;n<4;n++)h.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;i[0]^=c,i[1]^=f,i[2]^=u,i[3]^=p,i[4]^=c,i[5]^=f,i[6]^=u,i[7]^=p;for(n=0;n<4;n++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.RabbitLegacy=t._createHelper(i)}(),a.RabbitLegacy},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],228:[function(e,t,r){var i,n;i=this,n=function(a){return function(){var e=a,t=e.lib.StreamCipher,r=e.algo,n=[],c=[],u=[],i=r.Rabbit=t.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(r=this._b=0;r<4;r++)h.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;n[0]^=c,n[1]^=f,n[2]^=u,n[3]^=p,n[4]^=c,n[5]^=f,n[6]^=u,n[7]^=p;for(r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.Rabbit=t._createHelper(i)}(),a.Rabbit},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],229:[function(e,t,r){var i,n;i=this,n=function(o){return function(){var e=o,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.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 a=0;n<256;n++){var o=n%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+i[n]+s)%256;var c=i[n];i[n]=i[a],i[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=n.call(this)},keySize:8,ivSize:0});function n(){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 a=e[t];e[t]=e[r],e[r]=a,i|=e[(e[t]+e[r])%256]<<24-8*n}return this._i=t,this._j=r,i}e.RC4=t._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;0>>24)|4278255360&(n<<24|n>>>8)}var a,o,s,c,u,f,p,h,l,d,m,g=this._hash.words,v=A.words,b=I.words,y=x.words,_=S.words,w=j.words,k=E.words;f=a=g[0],p=o=g[1],h=s=g[2],l=c=g[3],d=u=g[4];for(r=0;r<80;r+=1)m=a+e[t+y[r]]|0,m+=r<16?P(o,s,c)+v[0]:r<32?O(o,s,c)+v[1]:r<48?T(o,s,c)+v[2]:r<64?B(o,s,c)+v[3]:C(o,s,c)+v[4],m=(m=F(m|=0,w[r]))+u|0,a=u,u=c,c=F(s,10),s=o,o=m,m=f+e[t+_[r]]|0,m+=r<16?C(p,h,l)+b[0]:r<32?B(p,h,l)+b[1]:r<48?T(p,h,l)+b[2]:r<64?O(p,h,l)+b[3]:P(p,h,l)+b[4],m=(m=F(m|=0,k[r]))+d|0,f=d,d=l,l=F(h,10),h=p,p=m;m=g[1]+s+l|0,g[1]=g[2]+c+d|0,g[2]=g[3]+u+f|0,g[3]=g[4]+a+p|0,g[4]=g[0]+o+h|0,g[0]=m},_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,a=n.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function P(e,t,r){return e^t^r}function O(e,t,r){return e&t|~e&r}function T(e,t,r){return(e|~t)^r}function B(e,t,r){return e&r|t&~r}function C(e,t,r){return e^(t|~r)}function F(e,t){return e<>>32-t}t.RIPEMD160=n._createHelper(o),t.HmacRIPEMD160=n._createHmacHelper(o)}(Math),s.RIPEMD160},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],231:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,p,o;return r=(t=e).lib,i=r.WordArray,n=r.Hasher,a=t.algo,p=[],o=a.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],a=r[2],o=r[3],s=r[4],c=0;c<80;c++){if(c<16)p[c]=0|e[t+c];else{var u=p[c-3]^p[c-8]^p[c-14]^p[c-16];p[c]=u<<1|u>>>31}var f=(i<<5|i>>>27)+s+p[c];f+=c<20?1518500249+(n&a|~n&o):c<40?1859775393+(n^a^o):c<60?(n&a|n&o|a&o)-1894007588:(n^a^o)-899497514,s=o,o=a,a=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|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(o),t.HmacSHA1=n._createHmacHelper(o),e.SHA1},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],232:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a;return r=(t=e).lib.WordArray,i=t.algo,n=i.SHA256,a=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(a),t.HmacSHA224=n._createHmacHelper(a),e.SHA224},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],n):n(i.CryptoJS)},{"./core":207,"./sha256":233}],233:[function(e,t,r){var i,n;i=this,n=function(c){return function(n){var e=c,t=e.lib,r=t.WordArray,i=t.Hasher,a=e.algo,o=[],y=[];!function(){function e(e){for(var t=n.sqrt(e),r=2;r<=t;r++)if(!(e%r))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(o[i]=t(n.pow(r,.5))),y[i]=t(n.pow(r,1/3)),i++),r++}();var _=[],s=a.SHA256=i.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=0;p<64;p++){if(p<16)_[p]=0|e[t+p];else{var h=_[p-15],l=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,d=_[p-2],m=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;_[p]=l+_[p-7]+m+_[p-16]}var g=i&n^i&a^n&a,v=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&u)+y[p]+_[p];f=u,u=c,c=s,s=o+b|0,o=a,a=n,n=i,i=b+(v+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+u|0,r[7]=r[7]+f|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)]=n.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA256=i._createHelper(s),e.HmacSHA256=i._createHmacHelper(s)}(Math),c.SHA256},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],234:[function(e,t,r){var i,n;i=this,n=function(a){return function(h){var e=a,t=e.lib,l=t.WordArray,i=t.Hasher,f=e.x64.Word,r=e.algo,P=[],O=[],T=[];!function(){for(var e=1,t=0,r=0;r<24;r++){P[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++)O[e+5*t]=t+(2*e+3*t)%5*5;for(var n=1,a=0;a<24;a++){for(var o=0,s=0,c=0;c<7;c++){if(1&n){var u=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(S=r[n]).high^=o,S.low^=a}for(var s=0;s<24;s++){for(var c=0;c<5;c++){for(var u=0,f=0,p=0;p<5;p++){u^=(S=r[c+5*p]).high,f^=S.low}var h=B[c];h.high=u,h.low=f}for(c=0;c<5;c++){var l=B[(c+4)%5],d=B[(c+1)%5],m=d.high,g=d.low;for(u=l.high^(m<<1|g>>>31),f=l.low^(g<<1|m>>>31),p=0;p<5;p++){(S=r[c+5*p]).high^=u,S.low^=f}}for(var v=1;v<25;v++){var b=(S=r[v]).high,y=S.low,_=P[v];if(_<32)u=b<<_|y>>>32-_,f=y<<_|b>>>32-_;else u=y<<_-32|b>>>64-_,f=b<<_-32|y>>>64-_;var w=B[O[v]];w.high=u,w.low=f}var k=B[0],x=r[0];k.high=x.high,k.low=x.low;for(c=0;c<5;c++)for(p=0;p<5;p++){var S=r[v=c+5*p],j=B[v],E=B[(c+1)%5+5*p],A=B[(c+2)%5+5*p];S.high=j.high^~E.high&A.high,S.low=j.low^~E.low&A.low}S=r[0];var I=T[s];S.high^=I.high,S.low^=I.low}},_doFinalize:function(){var e=this._data,t=e.words,r=(this._nDataBytes,8*e.sigBytes),i=32*this.blockSize;t[r>>>5]|=1<<24-r%32,t[(h.ceil((r+1)/i)*i>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();for(var n=this._state,a=this.cfg.outputLength/8,o=a/8,s=[],c=0;c>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),s.push(p),s.push(f)}return new l.init(s,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});e.SHA3=i._createHelper(n),e.HmacSHA3=i._createHmacHelper(n)}(Math),a.SHA3},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],235:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,o,s;return r=(t=e).x64,i=r.Word,n=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.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=o._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s),e.SHA384},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core"),e("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],n):n(i.CryptoJS)},{"./core":207,"./sha512":236,"./x64-core":238}],236:[function(e,t,r){var i,n;i=this,n=function(c){return function(){var e=c,t=e.lib.Hasher,r=e.x64,i=r.Word,n=r.WordArray,a=e.algo;function o(){return i.create.apply(i,arguments)}var xe=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],Se=[];!function(){for(var e=0;e<80;e++)Se[e]=o()}();var s=a.SHA512=t.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=i.high,h=i.low,l=n.high,d=n.low,m=a.high,g=a.low,v=o.high,b=o.low,y=s.high,_=s.low,w=c.high,k=c.low,x=u.high,S=u.low,j=f.high,E=f.low,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=w,N=k,D=x,q=S,L=j,U=E,H=0;H<80;H++){var K=Se[H];if(H<16)var V=K.high=0|e[t+2*H],G=K.low=0|e[t+2*H+1];else{var $=Se[H-15],W=$.high,Z=$.low,Y=(W>>>1|Z<<31)^(W>>>8|Z<<24)^W>>>7,X=(Z>>>1|W<<31)^(Z>>>8|W<<24)^(Z>>>7|W<<25),J=Se[H-2],Q=J.high,ee=J.low,te=(Q>>>19|ee<<13)^(Q<<3|ee>>>29)^Q>>>6,re=(ee>>>19|Q<<13)^(ee<<3|Q>>>29)^(ee>>>6|Q<<26),ie=Se[H-7],ne=ie.high,ae=ie.low,oe=Se[H-16],se=oe.high,ce=oe.low;V=(V=(V=Y+ne+((G=X+ae)>>>0>>0?1:0))+te+((G=G+re)>>>0>>0?1:0))+se+((G=G+ce)>>>0>>0?1:0);K.high=V,K.low=G}var ue,fe=R&M^~R&D,pe=z&N^~z&q,he=A&P^A&T^P&T,le=I&O^I&B^O&B,de=(A>>>28|I<<4)^(A<<30|I>>>2)^(A<<25|I>>>7),me=(I>>>28|A<<4)^(I<<30|A>>>2)^(I<<25|A>>>7),ge=(R>>>14|z<<18)^(R>>>18|z<<14)^(R<<23|z>>>9),ve=(z>>>14|R<<18)^(z>>>18|R<<14)^(z<<23|R>>>9),be=xe[H],ye=be.high,_e=be.low,we=L+ge+((ue=U+ve)>>>0>>0?1:0),ke=me+le;L=D,U=q,D=M,q=N,M=R,N=z,R=C+(we=(we=(we=we+fe+((ue=ue+pe)>>>0>>0?1:0))+ye+((ue=ue+_e)>>>0<_e>>>0?1:0))+V+((ue=ue+G)>>>0>>0?1:0))+((z=F+ue|0)>>>0>>0?1:0)|0,C=T,F=B,T=P,B=O,P=A,O=I,A=we+(de+he+(ke>>>0>>0?1:0))+((I=ue+ke|0)>>>0>>0?1:0)|0}h=i.low=h+I,i.high=p+A+(h>>>0>>0?1:0),d=n.low=d+O,n.high=l+P+(d>>>0>>0?1:0),g=a.low=g+B,a.high=m+T+(g>>>0>>0?1:0),b=o.low=b+F,o.high=v+C+(b>>>0>>0?1:0),_=s.low=_+z,s.high=y+R+(_>>>0>>0?1:0),k=c.low=k+N,c.high=w+M+(k>>>0>>0?1:0),S=u.low=S+q,u.high=x+D+(S>>>0>>0?1:0),E=f.low=E+U,f.high=j+L+(E>>>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=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(s),e.HmacSHA512=t._createHmacHelper(s)}(),c.SHA512},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],237:[function(e,t,r){var i,n;i=this,n=function(s){return function(){var e=s,t=e.lib,r=t.WordArray,i=t.BlockCipher,n=e.algo,u=[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],f=[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],p=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],a=n.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var i=u[r]-1;t[r]=e[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var o=n[a]=[],s=p[a];for(r=0;r<24;r++)o[r/6|0]|=t[(f[r]-1+s)%28]<<31-r%6,o[4+(r/6|0)]|=t[28+(f[r+24]-1+s)%28]<<31-r%6;o[0]=o[0]<<1|o[0]>>>31;for(r=1;r<7;r++)o[r]=o[r]>>>4*(r-1)+3;o[7]=o[7]<<5|o[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[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],d.call(this,4,252645135),d.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),d.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=h[c][((o^n[c])&l[c])>>>0];this._lBlock=o,this._rBlock=a^s}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,d.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(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<>>1];r=h.r28shl(r,a),i=h.r28shl(i,a),h.pc2(r,i,e.keys,n)}},c.prototype._update=function(e,t,r,i){var n=this._desState,a=h.readUInt32BE(e,t),o=h.readUInt32BE(e,t+4);h.ip(a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,o,n.tmp,0):this._decrypt(n,a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],h.writeUInt32BE(r,a,i),h.writeUInt32BE(r,o,i+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,a=p}h.rip(o,a,i,n)},c.prototype._decrypt=function(e,t,r,i,n){for(var a=r,o=t,s=e.keys.length-2;0<=s;s-=2){var c=e.keys[s],u=e.keys[s+1];h.expand(a,e.tmp,0),c^=e.tmp[0],u^=e.tmp[1];var f=h.substitute(c,u),p=a;a=(o^h.permute(f))>>>0,o=p}h.rip(a,o,i,n)}},{"../des":240,inherits:320,"minimalistic-assert":353}],244:[function(e,t,r){"use strict";var a=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),o=n.Cipher,s=n.DES;function c(e,t){a.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new c(this.type,this.options.key);this._edeState=t}i(u,o),(t.exports=u).create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":240,inherits:320,"minimalistic-assert":353}],245:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.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},r.ip=function(e,t,r,i){for(var n=0,a=0,o=6;0<=o;o-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+o&1}for(o=6;0<=o;o-=2){for(s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1;for(s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1}r[i+0]=n>>>0,r[i+1]=a>>>0},r.rip=function(e,t,r,i){for(var n=0,a=0,o=0;o<4;o++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+o&1,n<<=1,n|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;0<=s;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.pc1=function(e,t,r,i){for(var n=0,a=0,o=7;5<=o;o--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.r28shl=function(e,t){return e<>>28-t};var c=[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];r.pc2=function(e,t,r,i){for(var n=0,a=0,o=c.length>>>1,s=0;s>>c[s]&1;for(s=o;s>>c[s]&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var a=23;15<=a;a-=4)i<<=6,i|=e>>>a&63;for(a=11;3<=a;a-=4)n|=e>>>a&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[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];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[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];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(c),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;r.mod(p).cmp(h);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(i=r.shrn(1))&&g(r)&&v(i)&&v(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":154,"miller-rabin":349,randombytes:414}],249:[function(e,t,r){t.exports={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"}}},{}],250:[function(e,t,r){var u=e("crypto"),f=e("jsbn").BigInteger,p=(e("./lib/ec.js").ECPointFp,e("safer-buffer").Buffer);function h(e,t){return e.length>=t?e:h("0"+e,t)}r.ECCurves=e("./lib/sec.js"),r.ECKey=function(e,t,r){var i,n=e(),a=n.getN(),o=Math.floor(a.bitLength()/8);if(t)if(r){e=n.getCurve();this.P=e.decodePointHex(t.toString("hex"))}else{if(t.length!=o)return!1;i=new f(t.toString("hex"),16)}else{var s=a.subtract(f.ONE),c=new f(u.randomBytes(a.bitLength()));i=c.mod(s).add(f.ONE),this.P=n.getG().multiply(i)}this.P&&(this.PublicKey=p.from(n.getCurve().encodeCompressedPointHex(this.P),"hex")),i&&(this.PrivateKey=p.from(h(i.toString(16),2*o),"hex"),this.deriveSharedSecret=function(e){if(!e||!e.P)return!1;var t=e.P.multiply(i);return p.from(h(t.getX().toBigInteger().toString(16),2*o),"hex")})}},{"./lib/ec.js":251,"./lib/sec.js":252,crypto:204,jsbn:325,"safer-buffer":448}],251:[function(e,t,r){var l=e("jsbn").BigInteger,i=l.prototype.Barrett;function f(e,t){this.x=t,this.q=e}function d(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=null==i?l.ONE:i,this.zinv=null}function n(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new d(this,null,null),this.reducer=new i(this.q)}f.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},f.prototype.toBigInteger=function(){return this.x},f.prototype.negate=function(){return new f(this.q,this.x.negate().mod(this.q))},f.prototype.add=function(e){return new f(this.q,this.x.add(e.toBigInteger()).mod(this.q))},f.prototype.subtract=function(e){return new f(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},f.prototype.multiply=function(e){return new f(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},f.prototype.square=function(){return new f(this.q,this.x.square().mod(this.q))},f.prototype.divide=function(e){return new f(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},d.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO))},d.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(l.ZERO)&&!this.y.toBigInteger().equals(l.ZERO)},d.prototype.negate=function(){return new d(this.curve,this.x,this.y.negate(),this.z)},d.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(l.ZERO.equals(r))return l.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new l("3"),n=this.x.toBigInteger(),a=this.y.toBigInteger(),o=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),s=o.multiply(r),c=n.multiply(o),u=t.square().multiply(this.z),f=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(s).multiply(r).mod(this.curve.q),p=c.multiply(i).multiply(t).subtract(a.multiply(s)).subtract(u.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),h=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(p),h)},d.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new l("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),n=i.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),o=t.square().multiply(e);l.ZERO.equals(a)||(o=o.add(this.z.square().multiply(a)));var s=(o=o.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(i).mod(this.curve.q),c=o.multiply(e).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(o.square().multiply(o)).mod(this.curve.q),u=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(c),u)},d.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new l("3")),n=this.negate(),a=this;for(t=i.bitLength()-2;0r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var n=this.curve.getInfinity(),a=this.add(t);0<=i;)n=n.twice(),e.testBit(i)?n=r.testBit(i)?n.add(a):n.add(this):r.testBit(i)&&(n=n.add(t)),--i;return n},n.prototype.getQ=function(){return this.q},n.prototype.getA=function(){return this.a},n.prototype.getB=function(){return this.b},n.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},n.prototype.getInfinity=function(){return this.infinity},n.prototype.fromBigInteger=function(e){return new f(this.q,e)},n.prototype.reduce=function(e){this.reducer.reduce(e)},n.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;t.lengtht+1;){var r=e.shiftRight(t),i=e.subtract(r.shiftLeft(t));this.getR().equals(l.ONE)||(r=r.multiply(this.getR())),e=r.add(i)}for(;0<=e.compareTo(q);)e=e.subtract(q)}else e=e.mod(q);return e},f.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var e=new f(this.q,this.x.modPow(this.q.shiftRight(2).add(l.ONE),this.q));return e.square().equals(this)?e:null}var t=this.q.subtract(l.ONE),r=t.shiftRight(1);if(!this.x.modPow(r,this.q).equals(l.ONE))return null;var i,n,a=t.shiftRight(2).shiftLeft(1).add(l.ONE),o=this.x,s=modDouble(modDouble(o));do{for(var c;0<=(c=new l(this.q.bitLength(),new SecureRandom)).compareTo(this.q)||!c.multiply(c).subtract(s).modPow(r,this.q).equals(t););var u=this.lucasSequence(c,o,a);if(i=u[0],n=u[1],this.modMult(n,n).equals(s))return n.testBit(0)&&(n=n.add(q)),n=n.shiftRight(1),new f(q,n)}while(i.equals(l.ONE)||i.equals(t));return null},f.prototype.lucasSequence=function(e,t,r){for(var i=r.bitLength(),n=r.getLowestSetBit(),a=l.ONE,o=l.TWO,s=e,c=l.ONE,u=l.ONE,f=i-1;n+1<=f;--f)c=this.modMult(c,u),r.testBit(f)?(u=this.modMult(c,t),a=this.modMult(a,s),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1)))):(u=c,a=this.modReduce(a.multiply(o).subtract(c)),s=this.modReduce(s.multiply(o).subtract(e.multiply(c))),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))));c=this.modMult(c,u),u=this.modMult(c,t),a=this.modReduce(a.multiply(o).subtract(c)),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),c=this.modMult(c,u);for(f=1;f<=n;++f)a=this.modMult(a,o),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))),c=this.modMult(c,c);return[a,o]};r={ECCurveFp:n,ECPointFp:d,ECFieldElementFp:f};t.exports=r},{jsbn:325}],252:[function(e,t,r){var o=e("jsbn").BigInteger,s=e("./ec.js").ECCurveFp;function c(e,t,r,i){this.curve=e,this.g=t,this.n=r,this.h=i}function u(e){return new o(e,16)}function i(){var e=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),r=u("E87579C11079F43DD824993C2CEE5ED3"),i=u("FFFFFFFE0000000075A30D1B9038A115"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83"),i,n)}function n(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=o.ZERO,r=u("7"),i=u("0100000000000000000001B8FA16DFAB9ACA16B6B3"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE"),i,n)}function a(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),r=u("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),i=u("0100000000000000000001F4C8F927AED3CA752257"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32"),i,n)}function f(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=o.ZERO,r=u("3"),i=u("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"),i,n)}function p(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),r=u("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),i=u("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811"),i,n)}function h(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),r=u("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),i=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"),i,n)}function l(){var e=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),r=u("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),i=u("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),i,n)}c.prototype.getCurve=function(){return this.curve},c.prototype.getG=function(){return this.g},c.prototype.getN=function(){return this.n},c.prototype.getH=function(){return this.h},t.exports={secp128r1:i,secp160k1:n,secp160r1:a,secp192k1:f,secp192r1:p,secp224r1:h,secp256r1:l}},{"./ec.js":251,jsbn:325}],253:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":268,"./elliptic/curve":256,"./elliptic/curves":259,"./elliptic/ec":260,"./elliptic/eddsa":263,"./elliptic/utils":267,brorand:156}],254:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,j=n.getNAF,E=n.getJSF,p=n.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i,n){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,c=0,u=0;u>1]:S<0&&(x=o[g][-S-1>>1].neg()),y="affine"===x.type?y.mixedAdd(x):y.add(x))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},o.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.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),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],256:[function(e,t,r){arguments[4][130][0].apply(r,arguments)},{"./base":254,"./edwards":255,"./mont":257,"./short":258,dup:130}],257:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base,s=e("../../elliptic").utils;function c(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(c,o),(t.exports=c).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)},a(u,o.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},c.prototype.point=function(e,t){return new u(this,e,t)},c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.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)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},u.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 a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],258:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new w(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)},c.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)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],259:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":253,"./precomputed/secp256k1":266,"hash.js":299}],260:[function(e,t,r){"use strict";var g=e("bn.js"),v=e("hmac-drbg"),a=e("../../elliptic"),l=a.utils.assert,i=e("./key"),b=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(l(a.curves.hasOwnProperty(e),"Unknown curve "+e),e=a.curves[e]),e instanceof a.curves.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}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new v({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new g(2));;){var n=new g(t.generate(r));if(!(0>1;if(0<=o.cmp(this.curve.p.umod(this.curve.n))&&u)throw new Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var f=t.r.invm(n),p=n.sub(a).mul(f).umod(n),h=s.mul(f).umod(n);return this.g.mulAdd(p,o,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new b(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":253,"./key":261,"./signature":262,"bn.js":154,"hmac-drbg":311}],261:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=a).fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},{"../../elliptic":253,"bn.js":154}],262:[function(e,t,r){"use strict";var s=e("bn.js"),c=e("../../elliptic").utils,i=c.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=c.toArray(e,t);var r=new u;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=f(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=f(e,r);if(e.length!==a+r.place)return!1;var o=e.slice(r.place,a+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===o[0]&&128&o[1]&&(o=o.slice(1)),this.r=new s(n),this.s=new s(o),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];p(i,t.length),(i=i.concat(t)).push(2),p(i,r.length);var n=i.concat(r),a=[48];return p(a,n.length),a=a.concat(n),c.encode(a,e)}},{"../../elliptic":253,"bn.js":154}],263:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),a=n.utils,o=a.assert,c=a.parseBytes,s=e("./key"),u=e("./signature");function f(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=f).prototype.sign=function(e,t){e=c(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),a=this.encodePoint(n),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:a})},f.prototype.verify=function(e,t,r){e=c(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(a)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=6.0.0 <7.0.0",_id:"elliptic@6.4.1",_inCache:!0,_installable:!0,_location:"/elliptic",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/elliptic_6.4.1_1533787091502_0.6309761823717674"},_npmUser:{email:"fedor@indutny.com",name:"indutny"},_npmVersion:"6.3.0",_phantomChildren:{},_requested:{name:"elliptic",raw:"elliptic@^6.0.0",rawSpec:"^6.0.0",scope:null,spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/home/administrator/javascript-opentimestamps/node_modules/browserify-sign",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{fileCount:17,integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJba7vUCRA9TVsSAnZWagAA+gcP/jWaj5GmDZ0YFi/X4g5O\nx+pxu9i3HbP9YqywT7rz3XFXSaytu0LQDeDEbddl523X69tsbKfzHRTcnW8n\n2r0VjPhttRm+0RpEhBwjSIK34VkQA1xIWh2ugOToKXVCFVLM5VFDPGzbiN6x\n/hpL7gj1hoCRVmuhjnqFQ+vPKACKfv1Eq4CsRmu2focmP37kQpWQlweD/z4V\nJF4NxA33Fvp13Fl+9g4sPHyhUVsW9ojVaG3Ijn70pCaGQM18UPlbODkWQ1QX\nAgteOFjkIOtcalJk3B3qsM8GZeHEcAFvt2T73miJkHdCGNmRQS45Ede+gnj0\nlLlZJsCCKUHtTqrlprHo6AgMnBZufmytyozYAHC1/JYniazSBi2yPHtQeniR\nl69BfiRBdD2rNrMPwmCNRkMqrgel5WMGpaD0xdaFAHF1Ru2ZQFKsA7KvPGgp\nA20+LN11cCib67Pg5XDyrZ92T3yXec+6gQ3iq9d9UBZKFGl0P8ebVqq1LrUJ\na6nekwMpRISWnKcqV72XVmQdBmUWHq9VfVLsWJzVIJqtpHmUO7q74ACP3i4W\n0/F1REeI0YEhh3NjeStdDecfjlu7PY0pLQpbk2I3ms+6DO+cAfeDEev5jFBK\nwQabRNhITeT1FVtxZAcApj33fnCdqwaWr1NS00K5ZRqhDTTzPr/O4KRN4CR1\npstU\r\n=UVBB\r\n-----END PGP SIGNATURE-----\r\n",shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",unpackedSize:118371},files:["lib"],gitHead:"523da1cf71ddcfd607fbdee1858bc2af47f0e700",homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.1"}},{}],269:[function(e,t,r){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function c(e){return"function"==typeof e}function u(e){return"object"===(void 0===e?"undefined":_typeof(e))&&null!==e}function f(e){return void 0===e}((t.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},i.prototype.emit=function(e){var t,r,i,n,a,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(f(r=this._events[e]))return!1;if(c(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=Array.prototype.slice.call(arguments,1),r.apply(this,n)}else if(u(r))for(n=Array.prototype.slice.call(arguments,1),i=(o=r.slice()).length,a=0;ar&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!c(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,a;if(!c(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||c(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(r)){for(a=n;0=this._blockSize;){for(var n=this._blockOffset;n=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=n.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,a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":310}],310:[function(e,t,r){"use strict";var u=e("minimalistic-assert"),i=e("inherits");function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function o(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}r.inherits=i,r.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:320,"minimalistic-assert":353}],311:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),i=o.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length1e3*t.clockSkew)throw new E("clock skew of "+g/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach(function(e){if(u.params.headers.indexOf(e.toLowerCase())<0)throw new P(e+" was not a signed header")}),t.algorithms&&-1===t.algorithms.indexOf(u.params.algorithm))throw new I(u.params.algorithm+" is not a supported algorithm");return u.algorithm=u.params.algorithm.toUpperCase(),u.keyId=u.params.keyId,u}}},{"./utils":315,"assert-plus":66,util:505}],314:[function(n,a,e){(function(l){var d=n("assert-plus"),m=n("crypto"),e=(n("http"),n("util")),g=n("sshpk"),v=n("jsprim"),t=n("./utils"),b=n("util").format,y=t.HASH_ALGOS,_=t.PK_ALGOS,w=t.InvalidAlgorithmError,r=t.HttpSignatureError,k=t.validateAlgorithm,x='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';function S(e){r.call(this,e,S)}function j(e){r.call(this,e,j)}function i(e){d.object(e,"options");var t=[];if(void 0!==e.algorithm&&(d.string(e.algorithm,"options.algorithm"),t=k(e.algorithm)),this.rs_alg=t,void 0!==e.sign)d.func(e.sign,"options.sign"),this.rs_signFunc=e.sign;else if("hmac"===t[0]&&void 0!==e.key){if(d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,"string"!=typeof e.key&&!l.isBuffer(e.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=m.createHmac(t[1].toUpperCase(),e.key),this.rs_signer.sign=function(){var e=this.digest("base64");return{hashAlgorithm:t[1],toString:function(){return e}}}}else{if(void 0===e.key)throw new TypeError("options.sign (func) or options.key is required");var r=e.key;if(("string"==typeof r||l.isBuffer(r))&&(r=g.parsePrivateKey(r)),d.ok(g.PrivateKey.isPrivateKey(r,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=r,d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,!_[r.type])throw new w(r.type.toUpperCase()+" type keys are not supported");if(void 0!==t[0]&&r.type!==t[0])throw new w("options.key must be a "+t[0].toUpperCase()+" key, was given a "+r.type.toUpperCase()+" key instead");this.rs_signer=r.createSign(t[1])}this.rs_headers=[],this.rs_lines=[]}e.inherits(S,r),e.inherits(j,r),i.prototype.writeHeader=function(e,t){if(d.string(e,"header"),e=e.toLowerCase(),d.string(t,"value"),this.rs_headers.push(e),this.rs_signFunc)this.rs_lines.push(e+": "+t);else{var r=e+": "+t;0>1,f=-7,p=r?n-1:0,h=r?-1:1,l=e[t+p];for(p+=h,a=l&(1<<-f)-1,l>>=-f,f+=s;0>=-f,f+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:a-1,d=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),2<=(t+=1<=o+p?h/c:h*Math.pow(2,1-p))*c&&(o++,c/=2),f<=o+p?(s=0,o=f):1<=o+p?(s=(t*c-1)*Math.pow(2,n),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,n),o=0));8<=n;e[r+l]=255&s,l+=d,s/=256,n-=8);for(o=o<>15;0<=--a;){var c=32767&this[e],u=this[e++]>>15,f=s*c+u*o;n=((c=o*c+((32767&f)<<15)+r[i]+(1073741823&n))>>>30)+(f>>>15)+s*u+(n>>>30),r[i++]=1073741823&c}return n},30):t&&"Netscape"!=navigator.appName?(y.prototype.am=function(e,t,r,i,n,a){for(;0<=--a;){var o=t*this[e++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},26):(y.prototype.am=function(e,t,r,i,n,a){for(var o=16383&t,s=t>>14;0<=--a;){var c=16383&this[e],u=this[e++]>>14,f=s*c+u*o;n=((c=o*c+((16383&f)<<14)+r[i]+n)>>28)+(f>>14)+s*u,r[i++]=268435455&c}return n},28),y.prototype.DB=e,y.prototype.DM=(1<>>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 v(e){this.m=e}function b(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 l(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function d(){}function m(e){return e}function k(e){this.r2=_(),this.q3=_(),y.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},b.prototype.convert=function(e){var t=_();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&0>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),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},b.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.copyTo=function(e){for(var t=this.t-1;0<=t;--t)e[t]=this[t];e.t=this.t,e.s=this.s},y.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0this.DB?(this[this.t-1]|=(o&(1<>this.DB-a):this[this.t-1]|=o<=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,0>n|s,s=(this[r]&a)<=this.t)t.t=0;else{var i=e%this.DB,n=this.DB-i,a=(1<>i;for(var o=r+1;o>i;0>=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:0=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}0>this.F2:0),h=this.FV/p,l=(1<>s)&&(n=!0,a=c(r));0<=o;)s>(s+=this.DB-t)):(r=this[o]>>(s-=t)&i,s<=0&&(s+=this.DB,--o)),02*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=_();return e.copyTo(t),this.reduce(t),t},k.prototype.revert=function(e){return e},k.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);0<=e.compareTo(this.m);)e.subTo(this.m,e)},k.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},k.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x,S,j,E=[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],A=(1<<26)/E[E.length-1];function I(){var e;e=(new Date).getTime(),S[j++]^=255&e,S[j++]^=e>>8&255,S[j++]^=e>>16&255,S[j++]^=e>>24&255,R<=j&&(j-=R)}if(y.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},y.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||36=r&&(this.dMultiply(i),this.dAddOffset(o,0),o=a=0))}0e&&this.subTo(y.ONE.shiftLeft(e-1),this);else{var i=new Array,n=7&e;i.length=1+(e>>3),t.nextBytes(i),0>=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,0=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},y.prototype.multiplyLowerTo=function(e,t,r){var i,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;0>1)>E.length&&(e=E.length);for(var n=_(),a=0;a>24},y.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},y.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},y.prototype.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(0>i)!=(this.s&this.DM)>>i&&(t[n++]=r|this.s<>(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,(0=this.t?0!=this.s:0!=(this[t]&1<>n-c&u:(p=(e[l]&(1<>this.DB+n-c)),s=r;0==(1&p);)p>>=1,--s;if((n-=s)<0&&(n+=this.DB,--l),d)o[p].copyTo(a),d=!1;else{for(;1>>8,S[j++]=255&P;j=0,I()}function B(){if(null==x){for(I(),(x=new F).init(S),j=0;jt.maxItems&&n("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&m.concat(function(e,t,r,i){if("object"==(void 0===t?"undefined":_typeof(t)))for(var n in("object"!=(void 0===e?"undefined":_typeof(e))||e instanceof Array)&&m.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(n)){var a=e[n];if(void 0===a&&h.existingOnly)continue;var o=t[n];void 0===a&&o.default&&(a=e[n]=o.default),h.coerce&&n in e&&(a=e[n]=h.coerce(a,o)),g(a,o,r,n)}for(n in e){if(e.hasOwnProperty(n)&&("_"!=n.charAt(0)||"_"!=n.charAt(1))&&t&&!t[n]&&!1===i){if(h.filter){delete e[n];continue}m.push({property:r,message:(void 0===a?"undefined":_typeof(a))+"The property "+n+" is not defined in the schema and the schema does not allow additional properties"})}var s=t&&t[n]&&t[n].requires;!s||s in e||m.push({property:r,message:"the presence of the property "+n+" requires that "+s+" also be present"}),a=e[n],!i||t&&"object"==(void 0===t?"undefined":_typeof(t))&&n in t||(h.coerce&&(a=e[n]=h.coerce(a,i)),g(a,i,r,n)),!l&&a&&a.$schema&&(m=m.concat(g(a,a.$schema,r,n)))}return m}(e,t.properties,o,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&n("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&n("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.lengthe&&n("must have a minimum value of "+t.minimum),void 0!==_typeof(t.maximum)&&(void 0===e?"undefined":_typeof(e))==_typeof(t.maximum)&&t.maximum= 2"),d.ok(n.base<=36,"options.base <= 36"),d.bool(n.allowSign,"options.allowSign"),d.bool(n.allowPrefix,"options.allowPrefix"),d.bool(n.allowTrailing,"options.allowTrailing"),d.bool(n.allowImprecise,"options.allowImprecise"),d.bool(n.trimWhitespace,"options.trimWhitespace"),d.bool(n.leadingZeroIsOctal,"options.leadingZeroIsOctal"),n.leadingZeroIsOctal&&d.ok(!i,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var a,o=-1,s=n.base,c=1,u=0,f=0,p=e.length;if(n.trimWhitespace)for(;ft[0]||e[0]==t[0]&&e[1]>=t[1],"negative differences not allowed");var r=[e[0]-t[0],0];return e[1]>=t[1]?r[1]=e[1]-t[1]:(r[0]--,r[1]=1e9-(t[1]-e[1])),r}function R(e,t){return C(e),C(t),e[1]+=t[1],1e9<=e[1]&&(e[0]++,e[1]-=1e9),e[0]+=t[0],e}function z(e,t,r){var i,n;if(i={},r)for(n in r)i[n]=r[n];if(e)for(n in e)i[n]=e[n];if(t)for(n in t)i[n]=t[n];return i}},{"assert-plus":66,extsprintf:272,"json-schema":327,util:505,verror:509}],330:[function(e,t,r){"use strict";t.exports=e("./lib/api")(e("./lib/keccak"))},{"./lib/api":331,"./lib/keccak":335}],331:[function(e,t,r){"use strict";var n=e("./keccak"),a=e("./shake");t.exports=function(e){var r=n(e),i=a(e);return function(e,t){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new r(1152,448,null,224,t);case"keccak256":return new r(1088,512,null,256,t);case"keccak384":return new r(832,768,null,384,t);case"keccak512":return new r(576,1024,null,512,t);case"sha3-224":return new r(1152,448,6,224,t);case"sha3-256":return new r(1088,512,6,256,t);case"sha3-384":return new r(832,768,6,384,t);case"sha3-512":return new r(576,1024,6,512,t);case"shake128":return new i(1344,256,31,t);case"shake256":return new i(1088,512,31,t);default:throw new Error("Invald algorithm: "+e)}}}},{"./keccak":332,"./shake":333}],332:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,o=e("stream").Transform,n=e("inherits");t.exports=function(a){function t(e,t,r,i,n){o.call(this,n),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._hashBitLength=i,this._options=n,this._state=new a,this._state.initialize(e,t),this._finalized=!1}return n(t,o),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],333:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("stream").Transform,o=e("inherits");t.exports=function(n){function t(e,t,r,i){a.call(this,i),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._options=i,this._state=new n,this._state.initialize(e,t),this._finalized=!1}return o(t,a),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],334:[function(e,t,r){"use strict";var ot=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];r.p1600=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],n=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],h=f^(n<<1|a>>>31),l=p^(a<<1|n>>>31),d=e[0]^h,m=e[1]^l,g=e[10]^h,v=e[11]^l,b=e[20]^h,y=e[21]^l,_=e[30]^h,w=e[31]^l,k=e[40]^h,x=e[41]^l;h=r^(o<<1|s>>>31),l=i^(s<<1|o>>>31);var S=e[2]^h,j=e[3]^l,E=e[12]^h,A=e[13]^l,I=e[22]^h,P=e[23]^l,O=e[32]^h,T=e[33]^l,B=e[42]^h,C=e[43]^l;h=n^(c<<1|u>>>31),l=a^(u<<1|c>>>31);var F=e[4]^h,R=e[5]^l,z=e[14]^h,M=e[15]^l,N=e[24]^h,D=e[25]^l,q=e[34]^h,L=e[35]^l,U=e[44]^h,H=e[45]^l;h=o^(f<<1|p>>>31),l=s^(p<<1|f>>>31);var K=e[6]^h,V=e[7]^l,G=e[16]^h,$=e[17]^l,W=e[26]^h,Z=e[27]^l,Y=e[36]^h,X=e[37]^l,J=e[46]^h,Q=e[47]^l;h=c^(r<<1|i>>>31),l=u^(i<<1|r>>>31);var ee=e[8]^h,te=e[9]^l,re=e[18]^h,ie=e[19]^l,ne=e[28]^h,ae=e[29]^l,oe=e[38]^h,se=e[39]^l,ce=e[48]^h,ue=e[49]^l,fe=d,pe=m,he=v<<4|g>>>28,le=g<<4|v>>>28,de=b<<3|y>>>29,me=y<<3|b>>>29,ge=w<<9|_>>>23,ve=_<<9|w>>>23,be=k<<18|x>>>14,ye=x<<18|k>>>14,_e=S<<1|j>>>31,we=j<<1|S>>>31,ke=A<<12|E>>>20,xe=E<<12|A>>>20,Se=I<<10|P>>>22,je=P<<10|I>>>22,Ee=T<<13|O>>>19,Ae=O<<13|T>>>19,Ie=B<<2|C>>>30,Pe=C<<2|B>>>30,Oe=R<<30|F>>>2,Te=F<<30|R>>>2,Be=z<<6|M>>>26,Ce=M<<6|z>>>26,Fe=D<<11|N>>>21,Re=N<<11|D>>>21,ze=q<<15|L>>>17,Me=L<<15|q>>>17,Ne=H<<29|U>>>3,De=U<<29|H>>>3,qe=K<<28|V>>>4,Le=V<<28|K>>>4,Ue=$<<23|G>>>9,He=G<<23|$>>>9,Ke=W<<25|Z>>>7,Ve=Z<<25|W>>>7,Ge=Y<<21|X>>>11,$e=X<<21|Y>>>11,We=Q<<24|J>>>8,Ze=J<<24|Q>>>8,Ye=ee<<27|te>>>5,Xe=te<<27|ee>>>5,Je=re<<20|ie>>>12,Qe=ie<<20|re>>>12,et=ae<<7|ne>>>25,tt=ne<<7|ae>>>25,rt=oe<<8|se>>>24,it=se<<8|oe>>>24,nt=ce<<14|ue>>>18,at=ue<<14|ce>>>18;e[0]=fe^~ke&Fe,e[1]=pe^~xe&Re,e[10]=qe^~Je&de,e[11]=Le^~Qe&me,e[20]=_e^~Be&Ke,e[21]=we^~Ce&Ve,e[30]=Ye^~he&Se,e[31]=Xe^~le&je,e[40]=Oe^~Ue&et,e[41]=Te^~He&tt,e[2]=ke^~Fe&Ge,e[3]=xe^~Re&$e,e[12]=Je^~de&Ee,e[13]=Qe^~me&Ae,e[22]=Be^~Ke&rt,e[23]=Ce^~Ve&it,e[32]=he^~Se&ze,e[33]=le^~je&Me,e[42]=Ue^~et&ge,e[43]=He^~tt&ve,e[4]=Fe^~Ge&nt,e[5]=Re^~$e&at,e[14]=de^~Ee&Ne,e[15]=me^~Ae&De,e[24]=Ke^~rt&be,e[25]=Ve^~it&ye,e[34]=Se^~ze&We,e[35]=je^~Me&Ze,e[44]=et^~ge&Ie,e[45]=tt^~ve&Pe,e[6]=Ge^~nt&fe,e[7]=$e^~at&pe,e[16]=Ee^~Ne&qe,e[17]=Ae^~De&Le,e[26]=rt^~be&_e,e[27]=it^~ye&we,e[36]=ze^~We&Ye,e[37]=Me^~Ze&Xe,e[46]=ge^~Ie&Oe,e[47]=ve^~Pe&Te,e[8]=nt^~fe&ke,e[9]=at^~pe&xe,e[18]=Ne^~qe&Je,e[19]=De^~Le&Qe,e[28]=be^~_e&Be,e[29]=ye^~we&Ce,e[38]=We^~Ye&he,e[39]=Ze^~Xe&le,e[48]=Ie^~Oe&Ue,e[49]=Pe^~Te&He,e[0]^=ot[2*t],e[1]^=ot[2*t+1]}}},{}],335:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=e("./keccak-state-unroll");function a(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}a.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},a.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},a.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},t.exports=a},{"./keccak-state-unroll":334,"safe-buffer":447}],336:[function(e,t,r){var i=e("./_root").Symbol;t.exports=i},{"./_root":341}],337:[function(e,t,r){var i=e("./_Symbol"),n=e("./_getRawTag"),a=e("./_objectToString"),o=i?i.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},{"./_Symbol":336,"./_getRawTag":339,"./_objectToString":340}],338:[function(e,r,t){(function(e){var t="object"==(void 0===e?"undefined":_typeof(e))&&e&&e.Object===Object&&e;r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],339:[function(e,t,r){var i=e("./_Symbol"),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,s=i?i.toStringTag:void 0;t.exports=function(e){var t=a.call(e,s),r=e[s];try{var i=!(e[s]=void 0)}catch(e){}var n=o.call(e);return i&&(t?e[s]=r:delete e[s]),n}},{"./_Symbol":336}],340:[function(e,t,r){var i=Object.prototype.toString;t.exports=function(e){return i.call(e)}},{}],341:[function(e,t,r){var i=e("./_freeGlobal"),n="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,a=i||n||Function("return this")();t.exports=a},{"./_freeGlobal":338}],342:[function(e,t,r){var i=Array.isArray;t.exports=i},{}],343:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isObject");t.exports=function(e){if(!n(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},{"./_baseGetTag":337,"./isObject":344}],344:[function(e,t,r){t.exports=function(e){var t=void 0===e?"undefined":_typeof(e);return null!=e&&("object"==t||"function"==t)}},{}],345:[function(e,t,r){t.exports=function(e){return null!=e&&"object"==(void 0===e?"undefined":_typeof(e))}},{}],346:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isArray"),a=e("./isObjectLike");t.exports=function(e){return"string"==typeof e||!n(e)&&a(e)&&"[object String]"==i(e)}},{"./_baseGetTag":337,"./isArray":342,"./isObjectLike":345}],347:[function(e,t,r){t.exports=function(e){return void 0===e}},{}],348:[function(e,t,r){"use strict";var i=e("inherits"),n=e("hash-base"),a=e("safe-buffer").Buffer,o=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,r,i,n,a,o){return c(e+(t&r|~t&i)+n+a|0,o)+t|0}function f(e,t,r,i,n,a,o){return c(e+(t&i|r&~i)+n+a|0,o)+t|0}function p(e,t,r,i,n,a,o){return c(e+(t^r^i)+n+a|0,o)+t|0}function h(e,t,r,i,n,a,o){return c(e+(r^(t|~i))+n+a|0,o)+t|0}i(s,n),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,a=this._d;i=h(i=h(i=h(i=h(i=p(i=p(i=p(i=p(i=f(i=f(i=f(i=f(i=u(i=u(i=u(i=u(i,n=u(n,a=u(a,r=u(r,i,n,a,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),a,r,e[3],3250441966,22),n=u(n,a=u(a,r=u(r,i,n,a,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),a,r,e[7],4249261313,22),n=u(n,a=u(a,r=u(r,i,n,a,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),a,r,e[11],2304563134,22),n=u(n,a=u(a,r=u(r,i,n,a,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),a,r,e[15],1236535329,22),n=f(n,a=f(a,r=f(r,i,n,a,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),a,r,e[0],3921069994,20),n=f(n,a=f(a,r=f(r,i,n,a,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),a,r,e[4],3889429448,20),n=f(n,a=f(a,r=f(r,i,n,a,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),a,r,e[8],1163531501,20),n=f(n,a=f(a,r=f(r,i,n,a,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),a,r,e[12],2368359562,20),n=p(n,a=p(a,r=p(r,i,n,a,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),a,r,e[14],4259657740,23),n=p(n,a=p(a,r=p(r,i,n,a,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),a,r,e[10],3200236656,23),n=p(n,a=p(a,r=p(r,i,n,a,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),a,r,e[6],76029189,23),n=p(n,a=p(a,r=p(r,i,n,a,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),a,r,e[2],3299628645,23),n=h(n,a=h(a,r=h(r,i,n,a,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),a,r,e[5],4237533241,21),n=h(n,a=h(a,r=h(r,i,n,a,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),a,r,e[1],2240044497,21),n=h(n,a=h(a,r=h(r,i,n,a,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),a,r,e[13],1309151649,21),n=h(n,a=h(a,r=h(r,i,n,a,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),a,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+a|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e}},{}],355:[function(e,t,r){(t.exports=o).Minimatch=n;var u={sep:"/"};try{u=e("path")}catch(e){}var z=o.GLOBSTAR=n.GLOBSTAR={},i=e("brace-expansion"),M={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},N="[^/]*?",D="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{});var f=/\/+/;function a(t,r){t=t||{},r=r||{};var i={};return Object.keys(r).forEach(function(e){i[e]=r[e]}),Object.keys(t).forEach(function(e){i[e]=t[e]}),i}function o(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new n(t,r).match(e))}function n(e,t){if(!(this instanceof n))return new n(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==u.sep&&(e=e.split(u.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function s(e,t){if(t||(t=this instanceof n?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:i(e)}o.filter=function(i,n){return n=n||{},function(e,t,r){return o(e,i,n)}},o.defaults=function(i){if(!i||!Object.keys(i).length)return o;var n=o,e=function(e,t,r){return n.minimatch(e,t,a(i,r))};return e.Minimatch=function(e,t){return new n.Minimatch(e,a(i,t))},e},n.defaults=function(e){return e&&Object.keys(e).length?o.defaults(e).Minimatch:n},n.prototype.debug=function(){},n.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(f)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r},n.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=this.options,i=0;if(r.nonegate)return;for(var n=0,a=e.length;n>> no match, partial?",e,p,t,h),p!==o))}if("string"==typeof u?(c=i.nocase?f.toLowerCase()===u.toLowerCase():f===u,this.debug("string match",u,f,c)):(c=f.match(u),this.debug("pattern match",u,f,c)),!c)return!1}if(n===o&&a===s)return!0;if(n===o)return r;if(a===s)return n===o-1&&""===e[n];throw new Error("wtf?")}},{"brace-expansion":155,path:374}],356:[function(e,t,r){var c=e("crypto");function o(e,t,r){return c.createHmac(r,e).update(t).digest("base64")}function s(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function n(e,t){return t>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var n=s,a=i+r;e^=-1;for(var o=i;o>>8^n[255&(e^t[o])];return-1^e}},{}],362:[function(e,t,r){"use strict";var c,h=e("../utils/common"),u=e("./trees"),l=e("./adler32"),d=e("./crc32"),i=e("./messages"),f=0,p=4,m=0,g=-2,v=-1,b=4,n=2,y=8,_=9,a=286,o=30,s=19,w=2*a+1,k=15,x=3,S=258,j=S+x+1,E=42,A=113,I=1,P=2,O=3,T=4;function B(e,t){return e.msg=i[t],t}function C(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(h.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function z(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,R(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function N(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function D(e,t){var r,i,n=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-j?e.strstart-(e.w_size-j):0,u=e.window,f=e.w_mask,p=e.prev,h=e.strstart+S,l=u[a+o-1],d=u[a+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===d&&u[r+o-1]===l&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ac&&0!=--n);return o<=e.lookahead?o:e.lookahead}function q(e){var t,r,i,n,a,o,s,c,u,f,p=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-j)){for(h.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;i=e.head[--t],e.head[t]=p<=i?i-p:0,--r;);for(t=r=p;i=e.prev[--t],e.prev[t]=p<=i?i-p:0,--r;);n+=p}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,c=e.strstart+e.lookahead,u=n,f=void 0,f=o.avail_in,u=x)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(i=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(n=e.strstart+e.lookahead-x,i=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=n&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(q(e),0===e.lookahead&&t===f)return I;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,z(e,!1),0===e.strm.avail_out))return I;if(e.strstart-e.block_start>=e.w_size-j&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):(e.strstart>e.block_start&&(z(e,!1),e.strm.avail_out),I)}),new H(4,4,8,4,L),new H(4,5,16,8,L),new H(4,6,32,32,L),new H(4,4,16,16,U),new H(8,16,32,32,U),new H(8,16,128,128,U),new H(8,32,128,256,U),new H(32,128,258,1024,U),new H(32,258,258,4096,U)],r.deflateInit=function(e,t){return $(e,t,y,15,8,0)},r.deflateInit2=$,r.deflateReset=G,r.deflateResetKeep=V,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,m):g},r.deflate=function(e,t){var r,i,n,a;if(!e||!e.state||5>8&255),M(i,i.gzhead.time>>16&255),M(i,i.gzhead.time>>24&255),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(M(i,255&i.gzhead.extra.length),M(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=d(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(M(i,0),M(i,0),M(i,0),M(i,0),M(i,0),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,3),i.status=A);else{var o=y+(i.w_bits-8<<4)<<8;o|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(o|=32),o+=31-o%31,i.status=A,N(i,o),0!==i.strstart&&(N(i,e.adler>>>16),N(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending!==i.pending_buf_size));)M(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&R(e),i.pending+2<=i.pending_buf_size&&(M(i,255&e.adler),M(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(R(e),0===e.avail_out)return i.last_flush=-1,m}else if(0===e.avail_in&&C(t)<=C(r)&&t!==p)return B(e,-5);if(666===i.status&&0!==e.avail_in)return B(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==f&&666!==i.status){var s=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(q(e),0===e.lookahead)){if(t===f)return I;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):3===i.strategy?function(e,t){for(var r,i,n,a,o=e.window;;){if(e.lookahead<=S){if(q(e),e.lookahead<=S&&t===f)return I;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):c[i.level].func(i,t);if(s!==O&&s!==T||(i.status=666),s===I||s===O)return 0===e.avail_out&&(i.last_flush=-1),m;if(s===P&&(1===t?u._tr_align(i):5!==t&&(u._tr_stored_block(i,0,0,!1),3===t&&(F(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),R(e),0===e.avail_out))return i.last_flush=-1,m}return t!==p?m:i.wrap<=0?1:(2===i.wrap?(M(i,255&e.adler),M(i,e.adler>>8&255),M(i,e.adler>>16&255),M(i,e.adler>>24&255),M(i,255&e.total_in),M(i,e.total_in>>8&255),M(i,e.total_in>>16&255),M(i,e.total_in>>24&255)):(N(i,e.adler>>>16),N(i,65535&e.adler)),R(e),0=r.w_size&&(0===a&&(F(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new h.Buf8(r.w_size),h.arraySet(u,t,f-r.w_size,r.w_size,0),t=u,f=r.w_size),o=e.avail_in,s=e.next_in,c=e.input,e.avail_in=f,e.next_in=0,e.input=t,q(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=_=y>>>24,d-=_,0===(_=y>>>16&255))E[a++]=65535&y;else{if(!(16&_)){if(0==(64&_)){y=m[(65535&y)+(l&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&y,(_&=15)&&(d<_&&(l+=j[i++]<>>=_,d-=_),d<15&&(l+=j[i++]<>>=_=y>>>24,d-=_,!(16&(_=y>>>16&255))){if(0==(64&_)){y=g[(65535&y)+(l&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&y,d<(_&=15)&&(l+=j[i++]<>>=_,d-=_,(_=a-o)>3,l&=(1<<(d-=w<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new P.Buf16(320),this.work=new P.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=N,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new P.Buf32(i),t.distcode=t.distdyn=new P.Buf32(n),t.sane=1,t.back=-1,z):M}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):M}function c(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=a.wsize?(P.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(n=a.wsize-a.wnext)&&(n=i),P.arraySet(a.window,t,r-i,n,a.wnext),(i-=n)?(P.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=T(r.check,A,2,0),f=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(f-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=3;case 3:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>8&255,A[2]=u>>>16&255,A[3]=u>>>24&255,r.check=T(r.check,A,4,0)),f=u=0,r.mode=4;case 4:for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>8),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>>8&255,r.check=T(r.check,A,2,0)),f=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(s<(l=r.length)&&(l=s),l&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),P.arraySet(r.head.extra,i,a,l,k)),512&r.flags&&(r.check=T(r.check,i,l,a)),s-=l,a+=l,r.length-=l),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;for(l=0;k=i[a+l++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&l>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>=7&f,f-=7&f,r.mode=27;break}for(;f<3;){if(0===s)break e;s--,u+=i[a++]<>>=1)){case 0:r.mode=14;break;case 1:if(q(r),r.mode=20,6!==t)break;u>>>=2,f-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,f-=2;break;case 14:for(u>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,u+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,f=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(l=r.length){if(s>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,286>>=3,f-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=C(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=g,f-=g,r.lens[r.have++]=b;else{if(16===b){for(j=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],l=3+(3&u),u>>>=2,f-=2}else if(17===b){for(j=g+3;f>>=g)),u>>>=3,f-=3}else{for(j=g+7;f>>=g)),u>>>=7,f-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;l--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=C(F,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=C(R,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=s&&258<=c){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,r.hold=u,r.bits=f,B(e,h),o=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,u=r.hold,f=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;v=(E=r.lencode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,r.length=b,0===v){r.mode=26;break}if(32&v){r.back=-1,r.mode=12;break}if(64&v){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&v,r.mode=22;case 22:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=(E=r.distcode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&v,r.mode=24;case 24:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===c)break e;if(l=h-c,r.offset>l){if((l=r.offset-l)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d=l>r.wnext?(l-=r.wnext,r.wsize-l):r.wnext-l,l>r.length&&(l=r.length),m=r.window}else m=n,d=o-r.offset,l=r.length;for(cl?(m=B[C+o[y]],I[P+o[y]]):(m=96,0),c=1<>S)+(u-=c)]=d<<24|m<<16|g|0,0!==u;);for(c=1<>=1;if(0!==c?(A&=c-1,A+=c):A=0,y++,0==--O[b]){if(b===w)break;b=t[r+o[y]]}if(k>>7)]}function M(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function N(e,t,r){e.bi_valid>n-r?(e.bi_buf|=t<>n-e.bi_valid,e.bi_valid+=r-n):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function L(e,t,r){var i,n,a=new Array(v+1),o=0;for(i=1;i<=v;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=q(a[s]++,s))}}function U(e){var t;for(t=0;t>1;1<=r;r--)V(e,a,r);for(n=c;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],V(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,a[2*n]=a[2*r]+a[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,a[2*r+1]=a[2*i+1]=n,e.heap[1]=n++,V(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,n,a,o,s,c=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,p=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(a=0;a<=v;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return s;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return u;for(t=32;t>>3,(a=e.static_len+3+7>>>3)<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==t?X(e,t,r,i):4===e.strategy||a===n?(N(e,2+(i?1:0),3),G(e,E,A)):(N(e,4+(i?1:0),3),function(e,t,r,i){var n;for(N(e,t-257,5),N(e,r-1,5),N(e,i-4,4),n=0;n>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(P[r]+p+1)]++,e.dyn_dtree[2*z(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;N(e,2,3),D(e,b,E),16===(t=e).bi_valid?(M(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":358}],368:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],369:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],370:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var a=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=a;var o=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=o;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var f=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=f,r.DSAparam=i.define("DSAparam",function(){this.int()});var p=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=p;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":371,"asn1.js":46}],371:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),a=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(a)}),u=i.define("RDNSequence",function(){this.seqof(c)}),f=i.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),p=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(f),this.key("validity").use(p),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),d=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=d},{"asn1.js":46}],372:[function(e,t,r){(function(h){var l=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,d=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m,m=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,g=e("evp_bytestokey"),v=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(l);if(n){var a="aes"+n[1],o=new h(n[2],"hex"),s=new h(n[3].replace(/[\r\n]/g,""),"base64"),c=g(t,o.slice(0,8),parseInt(n[1],10)).key,u=[],f=v.createDecipheriv(a,c,o);u.push(f.update(s)),u.push(f.final()),r=h.concat(u)}else{var p=i.match(m);r=new h(p[2].replace(/[\r\n]/g,""),"base64")}return{tag:i.match(d)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":160,buffer:191,evp_bytestokey:270}],373:[function(t,r,e){(function(b){var y=t("./asn1"),_=t("./aesid.json"),w=t("./fixProc"),k=t("browserify-aes"),x=t("pbkdf2");function e(e){var t;"object"!==(void 0===e?"undefined":_typeof(e))||b.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new b(e));var r,i,n,a,o,s,c,u,f,p,h,l,d,m=w(e,t),g=m.tag,v=m.data;switch(g){case"CERTIFICATE":i=y.certificate.decode(v,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=y.PublicKey.decode(v,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=y.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"ENCRYPTED PRIVATE KEY":v=y.EncryptedPrivateKey.decode(v,"der"),a=t,o=(n=v).algorithm.decrypt.kde.kdeparams.salt,s=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=_[n.algorithm.decrypt.cipher.algo.join(".")],u=n.algorithm.decrypt.cipher.iv,f=n.subjectPrivateKey,p=parseInt(c.split("-")[1],10)/8,h=x.pbkdf2Sync(a,o,s,p),l=k.createDecipheriv(c,h,u),(d=[]).push(l.update(f)),d.push(l.final()),v=b.concat(d);case"PRIVATE KEY":switch(r=(i=y.PrivateKey.decode(v,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:y.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=y.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"RSA PUBLIC KEY":return y.RSAPublicKey.decode(v,"der");case"RSA PRIVATE KEY":return y.RSAPrivateKey.decode(v,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:y.DSAPrivateKey.decode(v,"der")};case"EC PRIVATE KEY":return{curve:(v=y.ECPrivateKey.decode(v,"der")).parameters.value,privateKey:v.privateKey};default:throw new Error("unknown key type "+g)}}(r.exports=e).signature=y.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":369,"./asn1":370,"./fixProc":372,"browserify-aes":160,buffer:191,pbkdf2:375}],374:[function(e,t,u){(function(n){function a(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function o(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;ia?t=n(t):t.length "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+o+";","var res;","switch (argLength) {",r.concat(["extra"]).map(function(e,t){return"case "+t+":res = fn.call("+["self"].concat(r.slice(0,t)).concat("cb").join(",")+");break;"}).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],n)(a,e)}(e)};var o="function (err, res) {if (err) { rj(err); } else { rs(res); }}";a.nodeify=function(r){return function(){var e=Array.prototype.slice.call(arguments),t="function"==typeof e[e.length-1]?e.pop():null,i=this;try{return r.apply(this,arguments).nodeify(t,i)}catch(r){if(null==t)return new a(function(e,t){t(r)});n(function(){t.call(i,r)})}}},a.prototype.nodeify=function(t,r){if("function"!=typeof t)return this;this.then(function(e){n(function(){t.call(r,null,e)})},function(e){n(function(){t.call(r,e)})})}},{"./core.js":384,asap:44}],390:[function(e,t,r){"use strict";var i=e("./core.js");(t.exports=i).enableSynchronous=function(){i.prototype.isPending=function(){return 0==this.getState()},i.prototype.isFulfilled=function(){return 1==this.getState()},i.prototype.isRejected=function(){return 2==this.getState()},i.prototype.getValue=function(){if(3===this._65)return this._55.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._55},i.prototype.getReason=function(){if(3===this._65)return this._55.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._55},i.prototype.getState=function(){return 3===this._65?this._55.getState():-1===this._65||-2===this._65?0:this._65}},i.disableSynchronous=function(){i.prototype.isPending=void 0,i.prototype.isFulfilled=void 0,i.prototype.isRejected=void 0,i.prototype.getValue=void 0,i.prototype.getReason=void 0,i.prototype.getState=void 0}},{"./core.js":384}],391:[function(e,t,r){"use strict";var n=function(e){for(var t=e.toString(16);4!==t.length;)t="0"+t;return"\\u"+t};t.exports=function(e,t,r,i){return!r.key||61!==t&&58!==t&&t!==r.separator?31o||0<=new u(t).cmp(a.modulus))throw new Error("decryption error");n=r?d(new u(t),a):h(t,a);var s=m.alloc(o-n.length);if(n=m.concat([s,n],o),4===i)return function(e,t){var r=e.modulus.byteLength(),i=l("sha1").update(m.alloc(0)).digest(),n=i.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,n+1),o=t.slice(n+1),s=p(a,f(o,n)),c=p(o,f(s,r-n-1));if(function(e,t){e=m.from(e),t=m.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){a++;break}var o=t.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&a++;o.length<8&&a++;if(a)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}},{"./mgf":401,"./withPublic":404,"./xor":405,"bn.js":154,"browserify-rsa":178,"create-hash":200,"parse-asn1":373,"safe-buffer":447}],403:[function(e,t,r){var o=e("parse-asn1"),h=e("randombytes"),l=e("create-hash"),d=e("./mgf"),m=e("./xor"),g=e("bn.js"),s=e("./withPublic"),c=e("browserify-rsa"),v=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,a=o(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=l("sha1").update(v.alloc(0)).digest(),a=n.length,o=2*a;if(r-o-2>6]+a[128|63&n]:n<55296||57344<=n?r+=a[224|n>>12]+a[128|n>>6&63]+a[128|63&n]:(i+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),r+=a[240|n>>18]+a[128|n>>12&63]+a[128|n>>6&63]+a[128|63&n])}return r},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function i(r,n,a){if(!n)return r;if("object"!==(void 0===n?"undefined":_typeof(n))){if(Array.isArray(r))r.push(n);else{if("object"!==(void 0===r?"undefined":_typeof(r)))return[r,n];(a.plainObjects||a.allowPrototypes||!o.call(Object.prototype,n))&&(r[n]=!0)}return r}if("object"!==(void 0===r?"undefined":_typeof(r)))return[r].concat(n);var e=r;return Array.isArray(r)&&!Array.isArray(n)&&(e=s(r,a)),Array.isArray(r)&&Array.isArray(n)?(n.forEach(function(e,t){o.call(r,t)?r[t]&&"object"===_typeof(r[t])?r[t]=i(r[t],e,a):r.push(e):r[t]=e}),r):Object.keys(n).reduce(function(e,t){var r=n[t];return o.call(e,t)?e[t]=i(e[t],r,a):e[t]=r,e},e)}}},{}],411:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var a=/\+/g;e=e.split(t);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var s,c,u=e.length;0t.highWaterMark&&(t.highWaterMark=(m<=(r=e)?r=m:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(_("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?v.nextTick(x,e):x(e))}function x(e){_("emit readable"),e.emit("readable"),I(e)}function S(e,t){t.readingMore||(t.readingMore=!0,v.nextTick(j,e,t))}function j(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;ea.length?a.length:e;if(o===a.length?n+=a:n+=a.slice(0,e),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=a.slice(o);break}++i}return t.length-=i,n}(e,t):function(e,t){var r=u.allocUnsafe(e),i=t.head,n=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i).data=a.slice(o);break}++n}return t.length-=n,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return _("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):k(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,n=t.needReadable;return _("need readable",n),(0===t.length||t.length-e>>0),a=this.head,o=0;a;)t=a.data,r=n,i=o,t.copy(r,i),o+=a.data.length,a=a.next;return n},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":447,util:157}],423:[function(e,t,r){"use strict";var a=e("process-nextick-args");function o(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a.nextTick(o,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(o,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":381}],424:[function(e,t,r){t.exports=e("events").EventEmitter},{events:269}],425:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":426}],426:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":417,"./lib/_stream_passthrough.js":418,"./lib/_stream_readable.js":419,"./lib/_stream_transform.js":420,"./lib/_stream_writable.js":421}],427:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":426}],428:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":421}],429:[function(e,t,r){"use strict";var s=e("../"),c=e("lodash/isArray"),u=e("lodash/isFunction"),f=e("lodash/isObjectLike");t.exports=function(e){var t="Please verify options";if(!f(e))throw new TypeError(t);if(!u(e.request))throw new TypeError(t+".request");if(!c(e.expose)||0===e.expose.length)throw new TypeError(t+".expose");for(var r=s({PromiseImpl:e.PromiseImpl,constructorMixin:e.constructorMixin}),i=e.request.Request.prototype.init,n=!(e.request.Request.prototype.init=function(e){return!f(e)||this._callback||this._rp_promise||r.init.call(this,e),i.apply(this,arguments)}),a=0;a=t.maxRedirects)return r.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+r.uri.href)),!1;t.redirectsFollowed+=1,o.test(i)||(i=a.resolve(r.uri.href,i));var n=r.uri;return r.uri=a.parse(i),r.uri.protocol!==n.protocol&&delete r.agent,t.redirects.push({statusCode:e.statusCode,redirectUri:i}),t.followAllRedirects&&"HEAD"!==r.method&&401!==e.statusCode&&307!==e.statusCode&&(r.method=t.followOriginalHttpMethod?r.method:"GET"),delete r.src,delete r.req,delete r._started,401!==e.statusCode&&307!==e.statusCode&&(delete r.body,delete r._form,r.headers&&(r.removeHeader("host"),r.removeHeader("content-type"),r.removeHeader("content-length"),r.uri.hostname!==r.originalHost.split(":")[0]&&r.removeHeader("authorization"))),t.removeRefererHeader||r.setHeader("referer",n.href),r.emit("redirect"),r.init(),!0},r.Redirect=i},{url:500}],444:[function(e,t,r){"use strict";var w=e("url"),k=e("tunnel-agent"),i=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],x=["proxy-authorization"];function n(e){this.request=e,this.proxyHeaderWhiteList=i,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}n.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},n.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=w.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,i,n,a,o,s,c=this.proxyHeaderExclusiveList.concat(x),u=this.proxyHeaderWhiteList.concat(c),f=(r=t.headers,i=u.reduce(function(e,t){return e[t.toLowerCase()]=!0,e},{}),Object.keys(r).filter(function(e){return i[e.toLowerCase()]}).reduce(function(e,t){return e[t]=r[t],e},{}));f.host=(n=t.uri,a=n.port,o=n.protocol,s=n.hostname+":",s+=a||("https:"===o?"443":"80")),c.forEach(t.removeHeader,t);var p,h,l,d,m,g,v,b,y=(l=(p=t).uri,d=p.proxy,h=d,m=["https:"===l.protocol?"https":"http","https:"===h.protocol?"Https":"Http"].join("Over"),k[m]),_=(v=f,{proxy:{host:(b=(g=t).proxy).hostname,port:+b.port,proxyAuth:b.auth,headers:v},headers:g.headers,ca:g.ca,cert:g.cert,key:g.key,passphrase:g.passphrase,pfx:g.pfx,ciphers:g.ciphers,rejectUnauthorized:g.rejectUnauthorized,secureOptions:g.secureOptions,secureProtocol:g.secureProtocol});return t.agent=y(_),!0},n.defaultProxyHeaderWhiteList=i,n.defaultProxyHeaderExclusiveList=x,r.Tunnel=n},{"tunnel-agent":497,url:500}],445:[function(U,H,e){(function(e){"use strict";var w=U("http"),k=U("https"),x=U("url"),t=U("util"),n=U("stream"),f=U("zlib"),c=U("aws-sign2"),u=U("aws4"),i=U("http-signature"),S=U("mime-types"),j=U("caseless"),E=U("forever-agent"),r=U("form-data"),a=U("extend"),A=U("isstream"),I=U("is-typedarray").strict,o=U("./lib/helpers"),s=U("./lib/cookies"),P=U("./lib/getProxyFromURI"),p=U("./lib/querystring").Querystring,h=U("./lib/har").Har,l=U("./lib/auth").Auth,d=U("./lib/oauth").OAuth,m=U("./lib/hawk"),g=U("./lib/multipart").Multipart,v=U("./lib/redirect").Redirect,b=U("./lib/tunnel").Tunnel,y=U("performance-now"),O=U("safe-buffer").Buffer,_=o.safeStringify,T=o.isReadStream,B=o.toBase64,C=o.defer,F=o.copy,R=o.version,z=s.jar(),M={};function N(){return{uri:this.uri,method:this.method,headers:this.headers}}function D(){return{statusCode:this.statusCode,body:this.body,headers:this.headers,request:N.call(this.request)}}function q(e){var t=this;e.har&&(t._har=new h(t),e=t._har.options(e)),n.Stream.call(t);var r=Object.keys(q.prototype),i=function(e,t){var r={};for(var i in t)-1===e.indexOf(i)&&(r[i]=t[i]);return r}(r,e);a(t,i),e=function(e,t){var r={};for(var i in t){var n=!(-1===e.indexOf(i)),a="function"==typeof t[i];n&&a||(r[i]=t[i])}return r}(r,e),t.readable=!0,t.writable=!0,e.method&&(t.explicitMethod=!0),t._qs=new p(t),t._auth=new l(t),t._oauth=new d(t),t._multipart=new g(t),t._redirect=new v(t),t._tunnel=new b(t),t.init(e)}function L(){q.debug&&console.error("REQUEST %s",t.format.apply(t,arguments))}t.inherits(q,n.Stream),q.debug=e.env.NODE_DEBUG&&/\brequest\b/.test(e.env.NODE_DEBUG),q.prototype.debug=L,q.prototype.init=function(e){var i=this;for(var t in e||(e={}),i.headers=i.headers?F(i.headers):{},i.headers)void 0===i.headers[t]&&delete i.headers[t];if(j.httpify(i,i.headers),i.method||(i.method=e.method||"GET"),i.localAddress||(i.localAddress=e.localAddress),i._qs.init(e),L(e),i.pool||!1===i.pool||(i.pool=M),i.dests=i.dests||[],i.__isRequestRequest=!0,!i._callback&&i.callback&&(i._callback=i.callback,i.callback=function(){i._callbackCalled||(i._callbackCalled=!0,i._callback.apply(i,arguments))},i.on("error",i.callback.bind()),i.on("complete",i.callback.bind(i,null))),!i.uri&&i.url&&(i.uri=i.url,delete i.url),i.baseUrl){if("string"!=typeof i.baseUrl)return i.emit("error",new Error("options.baseUrl must be a string"));if("string"!=typeof i.uri)return i.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(0===i.uri.indexOf("//")||-1!==i.uri.indexOf("://"))return i.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var r=i.baseUrl.lastIndexOf("/")===i.baseUrl.length-1,n=0===i.uri.indexOf("/");r&&n?i.uri=i.baseUrl+i.uri.slice(1):r||n?i.uri=i.baseUrl+i.uri:""===i.uri?i.uri=i.baseUrl:i.uri=i.baseUrl+"/"+i.uri,delete i.baseUrl}if(!i.uri)return i.emit("error",new Error("options.uri is a required argument"));if("string"==typeof i.uri&&(i.uri=x.parse(i.uri)),i.uri.href||(i.uri.href=x.format(i.uri)),"unix:"===i.uri.protocol)return i.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if("unix"===i.uri.host&&i.enableUnixSocket(),!1===i.strictSSL&&(i.rejectUnauthorized=!1),i.uri.pathname||(i.uri.pathname="/"),!(i.uri.host||i.uri.hostname&&i.uri.port||i.uri.isUnix)){var a='Invalid URI "'+x.format(i.uri)+'"';return 0===Object.keys(e).length&&(a+=". This can be caused by a crappy redirection."),i.abort(),i.emit("error",new Error(a))}if(i.hasOwnProperty("proxy")||(i.proxy=P(i.uri)),i.tunnel=i._tunnel.isEnabled(),i.proxy&&i._tunnel.setup(e),i._redirect.onRequest(e),i.setHost=!1,!i.hasHeader("host")){var o=i.originalHostHeaderName||"host";i.setHeader(o,i.uri.host),i.uri.port&&("80"===i.uri.port&&"http:"===i.uri.protocol||"443"===i.uri.port&&"https:"===i.uri.protocol)&&i.setHeader(o,i.uri.hostname),i.setHost=!0}if(i.jar(i._jar||e.jar),i.uri.port||("http:"===i.uri.protocol?i.uri.port=80:"https:"===i.uri.protocol&&(i.uri.port=443)),i.proxy&&!i.tunnel?(i.port=i.proxy.port,i.host=i.proxy.hostname):(i.port=i.uri.port,i.host=i.uri.hostname),e.form&&i.form(e.form),e.formData){var s=e.formData,c=i.form(),u=function(e,t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?c.append(e,t.value,t.options):c.append(e,t)};for(var f in s)if(s.hasOwnProperty(f)){var p=s[f];if(p instanceof Array)for(var h=0;h>>32-t}function S(e,t,r,i,n,a,o,s){return x(e+(t^r^i)+a+o|0,s)+n|0}function j(e,t,r,i,n,a,o,s){return x(e+(t&r|~t&i)+a+o|0,s)+n|0}function E(e,t,r,i,n,a,o,s){return x(e+((t|~r)^i)+a+o|0,s)+n|0}function A(e,t,r,i,n,a,o,s){return x(e+(t&i|r&~i)+a+o|0,s)+n|0}function I(e,t,r,i,n,a,o,s){return x(e+(t^(r|~i))+a+o|0,s)+n|0}n(o,a),o.prototype._update=function(){for(var e=g,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,a=0|this._d,o=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,f=0|this._d,p=0|this._e,h=0;h<80;h+=1){var l,d;d=h<16?(l=S(r,i,n,a,o,e[v[h]],w[0],y[h]),I(s,c,u,f,p,e[b[h]],k[0],_[h])):h<32?(l=j(r,i,n,a,o,e[v[h]],w[1],y[h]),A(s,c,u,f,p,e[b[h]],k[1],_[h])):h<48?(l=E(r,i,n,a,o,e[v[h]],w[2],y[h]),E(s,c,u,f,p,e[b[h]],k[2],_[h])):h<64?(l=A(r,i,n,a,o,e[v[h]],w[3],y[h]),j(s,c,u,f,p,e[b[h]],k[3],_[h])):(l=I(r,i,n,a,o,e[v[h]],w[4],y[h]),S(s,c,u,f,p,e[b[h]],k[4],_[h])),r=o,o=a,a=x(n,10),n=i,i=l,s=p,p=f,f=x(u,10),u=c,c=d}var m=this._b+n+f|0;this._b=this._c+a+p|0,this._c=this._d+o+s|0,this._d=this._e+r+c|0,this._e=this._a+i+u|0,this._a=m},o.prototype._digest=function(){this._block[this._blockOffset++]=128,56=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 a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":447}],450:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":451,"./sha1":452,"./sha224":453,"./sha256":454,"./sha384":455,"./sha512":456}],451:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,v=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s=this._w,c=0|this._a,u=0|this._b,f=0|this._c,p=0|this._d,h=0|this._e,l=0;l<16;++l)s[l]=e.readInt32BE(4*l);for(;l<80;++l)s[l]=s[l-3]^s[l-8]^s[l-14]^s[l-16];for(var d=0;d<80;++d){var m=~~(d/20),g=0|((o=c)<<5|o>>>27)+(i=u,n=f,a=p,0===(r=m)?i&n|~i&a:2===r?i&n|i&a|n&a:i^n^a)+h+s[d]+v[m];h=p,p=f,f=(t=u)<<30|t>>>2,u=c,c=g}this._a=c+this._a|0,this._b=u+this._b|0,this._c=f+this._c|0,this._d=p+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],452:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0;d<16;++d)c[d]=e.readInt32BE(4*d);for(;d<80;++d)c[d]=(t=c[d-3]^c[d-8]^c[d-14]^c[d-16])<<1|t>>>31;for(var m=0;m<80;++m){var g=~~(m/20),v=0|((s=u)<<5|s>>>27)+(n=f,a=p,o=h,0===(i=g)?n&a|~n&o:2===i?n&a|n&o|a&o:n^a^o)+l+c[m]+b[g];l=h,h=p,p=(r=f)<<30|r>>>2,f=u,u=v}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],453:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}i(c,n),c.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},c.prototype._hash=function(){var e=o.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},t.exports=c},{"./hash":449,"./sha256":454,inherits:320,"safe-buffer":447}],454:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,w=[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],o=new Array(64);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0|this._f,m=0|this._g,g=0|this._h,v=0;v<16;++v)c[v]=e.readInt32BE(4*v);for(;v<64;++v)c[v]=0|(((r=c[v-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+c[v-7]+(((t=c[v-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+c[v-16];for(var b=0;b<64;++b){var y=g+(((s=l)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((o=m)^l&(d^o))+w[b]+c[b]|0,_=0|(((a=u)>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+((i=u)&(n=f)|p&(i|n));g=m,m=d,d=l,l=h+y|0,h=p,p=f,f=u,u=y+_|0}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],455:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(160);function c(){this.init(),this._w=s,a.call(this,128,112)}i(c,n),c.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},c.prototype._hash=function(){var i=o.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=c},{"./hash":449,"./sha512":456,inherits:320,"safe-buffer":447}],456:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,ee=[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],o=new Array(160);function s(){this.init(),this._w=o,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ae(e,t){return e>>>0>>0?1:0}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c,u=this._w,f=0|this._ah,p=0|this._bh,h=0|this._ch,l=0|this._dh,d=0|this._eh,m=0|this._fh,g=0|this._gh,v=0|this._hh,b=0|this._al,y=0|this._bl,_=0|this._cl,w=0|this._dl,k=0|this._el,x=0|this._fl,S=0|this._gl,j=0|this._hl,E=0;E<32;E+=2)u[E]=e.readInt32BE(4*E),u[E+1]=e.readInt32BE(4*E+4);for(;E<160;E+=2){var A=u[E-30],I=u[E-30+1],P=((s=A)>>>1|(c=I)<<31)^(s>>>8|c<<24)^s>>>7,O=((a=I)>>>1|(o=A)<<31)^(a>>>8|o<<24)^(a>>>7|o<<25);A=u[E-4],I=u[E-4+1];var T=((i=A)>>>19|(n=I)<<13)^(n>>>29|i<<3)^i>>>6,B=((t=I)>>>19|(r=A)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),C=u[E-14],F=u[E-14+1],R=u[E-32],z=u[E-32+1],M=O+F|0,N=P+C+ae(M,O)|0;N=(N=N+T+ae(M=M+B|0,B)|0)+R+ae(M=M+z|0,z)|0,u[E]=N,u[E+1]=M}for(var D=0;D<160;D+=2){N=u[D],M=u[D+1];var q=re(f,p,h),L=re(b,y,_),U=ie(f,b),H=ie(b,f),K=ne(d,k),V=ne(k,d),G=ee[D],$=ee[D+1],W=te(d,m,g),Z=te(k,x,S),Y=j+V|0,X=v+K+ae(Y,j)|0;X=(X=(X=X+W+ae(Y=Y+Z|0,Z)|0)+G+ae(Y=Y+$|0,$)|0)+N+ae(Y=Y+M|0,M)|0;var J=H+L|0,Q=U+q+ae(J,H)|0;v=g,j=S,g=m,S=x,m=d,x=k,d=l+X+ae(k=w+Y|0,w)|0,l=h,w=_,h=p,_=y,p=f,y=b,f=X+Q+ae(b=Y+J|0,Y)|0}this._al=this._al+b|0,this._bl=this._bl+y|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+k|0,this._fl=this._fl+x|0,this._gl=this._gl+S|0,this._hl=this._hl+j|0,this._ah=this._ah+f+ae(this._al,b)|0,this._bh=this._bh+p+ae(this._bl,y)|0,this._ch=this._ch+h+ae(this._cl,_)|0,this._dh=this._dh+l+ae(this._dl,w)|0,this._eh=this._eh+d+ae(this._el,k)|0,this._fh=this._fh+m+ae(this._fl,x)|0,this._gh=this._gh+g+ae(this._gl,S)|0,this._hh=this._hh+v+ae(this._hl,j)|0},s.prototype._hash=function(){var i=a.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],457:[function(e,t,r){var i=e("safer-buffer").Buffer,n={dsa:{parts:["p","q","g","y"],sizePart:"p"},rsa:{parts:["e","n"],sizePart:"n"},ecdsa:{parts:["curve","Q"],sizePart:"Q"},ed25519:{parts:["A"],sizePart:"A"}};n.curve25519=n.ed25519;var a={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};a.curve25519=a.ed25519;var o={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:i.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g,""),"hex"),s:i.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g,""),"hex"),n:i.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g,""),"hex"),G:i.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g,""),"hex"),s:i.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g,""),"hex"),n:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g,""),"hex"),G:i.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:i.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g,""),"hex"),a:i.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g,""),"hex"),s:i.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g,""),"hex"),n:i.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g,""),"hex"),G:i.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g,""),"hex")}};t.exports={info:n,privInfo:a,hashAlgs:{md5:!0,sha1:!0,sha256:!0,sha384:!0,sha512:!0},curves:o}},{"safer-buffer":448}],458:[function(e,t,r){t.exports=_;var d=e("assert-plus"),m=e("safer-buffer").Buffer,i=e("./algs"),n=e("crypto"),a=e("./fingerprint"),o=(e("./signature"),e("./errors")),g=(e("util"),e("./utils")),v=e("./key"),b=e("./private-key"),y=e("./identity"),s={};s.openssh=e("./formats/openssh-cert"),s.x509=e("./formats/x509"),s.pem=e("./formats/x509-pem");var c=o.CertificateParseError,u=o.InvalidAlgorithmError;function _(e){d.object(e,"options"),d.arrayOfObject(e.subjects,"options.subjects"),g.assertCompatible(e.subjects[0],y,[1,0],"options.subjects"),g.assertCompatible(e.subjectKey,v,[1,0],"options.subjectKey"),g.assertCompatible(e.issuer,y,[1,0],"options.issuer"),void 0!==e.issuerKey&&g.assertCompatible(e.issuerKey,v,[1,0],"options.issuerKey"),d.object(e.signatures,"options.signatures"),d.buffer(e.serial,"options.serial"),d.date(e.validFrom,"options.validFrom"),d.date(e.validUntil,"optons.validUntil"),d.optionalArrayOfString(e.purposes,"options.purposes"),this._hashCache={},this.subjects=e.subjects,this.issuer=e.issuer,this.subjectKey=e.subjectKey,this.issuerKey=e.issuerKey,this.signatures=e.signatures,this.serial=e.serial,this.validFrom=e.validFrom,this.validUntil=e.validUntil,this.purposes=e.purposes}_.formats=s,_.prototype.toBuffer=function(e,t){return void 0===e&&(e="x509"),d.string(e,"format"),d.object(s[e],"formats[format]"),d.optionalObject(t,"options"),s[e].write(this,t)},_.prototype.toString=function(e,t){return void 0===e&&(e="pem"),this.toBuffer(e,t).toString()},_.prototype.fingerprint=function(e){void 0===e&&(e="sha256"),d.string(e,"algorithm");var t={type:"certificate",hash:this.hash(e),algorithm:e};return new a(t)},_.prototype.hash=function(e){if(d.string(e,"algorithm"),e=e.toLowerCase(),void 0===i.hashAlgs[e])throw new u(e);if(this._hashCache[e])return this._hashCache[e];var t=n.createHash(e).update(this.toBuffer("x509")).digest();return this._hashCache[e]=t},_.prototype.isExpired=function(e){return void 0===e&&(e=new Date),!(e.getTime()>=this.validFrom.getTime()&&e.getTime()e.length||"BEGIN"!==e.slice(t,t+5).toString("ascii"))}(e))return a.read(e,t);if(function(e){var t=0;for(;to.length&&(p=o.length),u+=c.write(o.slice(f,p),u),c[u++]=10,f=p}return u+=c.write("-----END "+i+"-----\n",u),c.slice(0,u)}};var b=e("assert-plus"),y=e("asn1"),_=e("crypto"),w=e("safer-buffer").Buffer,k=(e("../algs"),e("../utils")),h=e("../key"),l=e("../private-key"),x=e("./pkcs1"),S=e("./pkcs8"),j=e("./ssh-private"),E=e("./rfc4253"),A=e("../errors")},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../utils":480,"./pkcs1":467,"./pkcs8":468,"./rfc4253":469,"./ssh-private":470,asn1:65,"assert-plus":66,crypto:204,"safer-buffer":448}],467:[function(e,t,r){t.exports={read:function(e,t){return i.read(e,t,"pkcs1")},readPkcs1:function(e,t,r){switch(e){case"RSA":if("public"===t)return u=y(c=r,"modulus"),f=y(c,"exponent"),new p({type:"rsa",parts:[{name:"e",data:f},{name:"n",data:u}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t[0],0);var r=y(e,"modulus"),i=y(e,"public exponent"),n=y(e,"private exponent"),a=y(e,"prime1"),o=y(e,"prime2"),s=y(e,"exponent1"),c=y(e,"exponent2"),u=y(e,"iqmp");return new v({type:"rsa",parts:[{name:"n",data:r},{name:"e",data:i},{name:"d",data:n},{name:"iqmp",data:u},{name:"p",data:a},{name:"q",data:o},{name:"dmodp",data:s},{name:"dmodq",data:c}]})}(r);throw new Error("Unknown key type: "+t);case"DSA":if("public"===t)return n=y(i=r,"y"),a=y(i,"p"),o=y(i,"q"),s=y(i,"g"),new p({type:"dsa",parts:[{name:"y",data:n},{name:"p",data:a},{name:"q",data:o},{name:"g",data:s}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),0);var r=y(e,"p"),i=y(e,"q"),n=y(e,"g"),a=y(e,"y"),o=y(e,"x");return new v({type:"dsa",parts:[{name:"p",data:r},{name:"q",data:i},{name:"g",data:n},{name:"y",data:a},{name:"x",data:o}]})}(r);throw new Error("Unknown key type: "+t);case"EC":case"ECDSA":if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),1);var r=e.readString(l.Ber.OctetString,!0);e.readSequence(160);var i=b(e);h.string(i,"a known elliptic curve"),e.readSequence(161);var n=e.readString(l.Ber.BitString,!0);n=g.ecNormalize(n);var a={type:"ecdsa",parts:[{name:"curve",data:d.from(i)},{name:"Q",data:n},{name:"d",data:r}]};return new v(a)}(r);if("public"===t)return function(e){e.readSequence();var t=e.readOID();h.strictEqual(t,"1.2.840.10045.2.1","must be ecPublicKey");for(var r,i=e.readOID(),n=Object.keys(m.curves),a=0;aS.length&&(I=S.length),E+=x.write(S.slice(A,I),E),x[E++]=10,A=I}return E+=x.write("-----END "+k+"-----\n",E),x.slice(0,E)}};var O,T=P("assert-plus"),B=(P("asn1"),P("safer-buffer").Buffer),C=(P("../algs"),P("../utils")),F=P("crypto"),R=(P("../key"),P("../private-key")),r=P("./pem"),A=P("./rfc4253"),z=P("../ssh-buffer"),I=P("../errors");var M="openssh-key-v1"},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../ssh-buffer":479,"../utils":480,"./pem":466,"./rfc4253":469,asn1:65,"assert-plus":66,"bcrypt-pbkdf":76,crypto:204,"safer-buffer":448}],471:[function(e,t,r){t.exports={read:function(e,t){"string"!=typeof e&&(h.buffer(e,"buf"),e=e.toString("ascii"));var r=e.trim().replace(/[\\\r]/g,""),i=r.match(m);i||(i=r.match(g));h.ok(i,"key must match regex");var n,a=d.algToKeyType(i[1]),o=l.from(i[2],"base64"),s={};if(i[4])try{n=d.read(o)}catch(e){i=r.match(g),h.ok(i,"key must match regex"),o=l.from(i[2],"base64"),n=d.readInternal(s,"public",o)}else n=d.readInternal(s,"public",o);if(h.strictEqual(a,n.type),i[4]&&0n.length&&(u=n.length),s+=o.write(n.slice(c,u),s),o[s++]=10,c=u}return s+=o.write("-----END "+i+"-----\n",s),o.slice(0,s)}};var o=e("assert-plus"),p=(e("asn1"),e("safer-buffer").Buffer);e("../algs"),e("../utils"),e("../key"),e("../private-key"),e("./pem"),e("../identity"),e("../signature"),e("../certificate")},{"../algs":457,"../certificate":458,"../identity":474,"../key":476,"../private-key":477,"../signature":478,"../utils":480,"./pem":466,"./x509":473,asn1:65,"assert-plus":66,"safer-buffer":448}],473:[function(e,t,r){t.exports={read:function(e,t){"string"==typeof e&&(e=_.from(e,"binary"));b.buffer(e,"buf");var r=new y.BerReader(e);if(r.readSequence(),1=this._buffer.length},a.prototype.remainder=function(){return this._buffer.slice(this._offset)},a.prototype.skip=function(e){this._offset+=e},a.prototype.expand=function(){this._size*=2;var e=n.alloc(this._size);this._buffer.copy(e,0),this._buffer=e},a.prototype.readPart=function(){return{data:this.readBuffer()}},a.prototype.readBuffer=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4,i.ok(this._offset+e<=this._buffer.length,"length out of bounds at +0x"+this._offset.toString(16)+" (data truncated?)");var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t},a.prototype.readString=function(){return this.readBuffer().toString()},a.prototype.readCString=function(){for(var e=this._offset;ethis._size;)this.expand();this._buffer.writeUInt32BE(e.length,this._offset),this._offset+=4,e.copy(this._buffer,this._offset),this._offset+=e.length},a.prototype.writeString=function(e){this.writeBuffer(n.from(e,"utf8"))},a.prototype.writeCString=function(e){for(;this._offset+1+e.length>this._size;)this.expand();this._buffer.write(e,this._offset),this._offset+=e.length,this._buffer[this._offset++]=0},a.prototype.writeInt=function(e){for(;this._offset+4>this._size;)this.expand();this._buffer.writeUInt32BE(e,this._offset),this._offset+=4},a.prototype.writeInt64=function(e){if(i.buffer(e,"value"),8this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=8},a.prototype.writeChar=function(e){for(;this._offset+1>this._size;)this.expand();this._buffer[this._offset++]=e},a.prototype.writePart=function(e){this.writeBuffer(e.data)},a.prototype.write=function(e){for(;this._offset+e.length>this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=e.length}},{"assert-plus":66,"safer-buffer":448}],480:[function(e,t,r){t.exports={bufferSplit:function(e,t){p.buffer(e),p.string(t);for(var r=[],i=0,n=0,a=0;a=t.length){var o=a+1;r.push(e.slice(i,o-n)),i=o,n=0}i<=e.length&&r.push(e.slice(i,e.length));return r},addRSAMissing:function(e){p.object(e),u(e,s,[1,1]);var t,r=new g(e.part.d.data);if(!e.part.dmodp){var i=new g(e.part.p.data),n=r.mod(i.subtract(1));t=_(n),e.part.dmodp={name:"dmodp",data:t},e.parts.push(e.part.dmodp)}if(!e.part.dmodq){var a=new g(e.part.q.data),o=r.mod(a.subtract(1));t=_(o),e.part.dmodq={name:"dmodq",data:t},e.parts.push(e.part.dmodq)}},calculateDSAPublic:function(e,t,r){return p.buffer(e),p.buffer(t),p.buffer(r),e=new g(e),t=new g(t),r=new g(r),_(e.modPow(r,t))},calculateED25519Public:function(e){p.buffer(e);var t=i.sign.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},calculateX25519Public:function(e){p.buffer(e);var t=i.box.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},mpNormalize:y,mpDenormalize:function(e){p.buffer(e);for(;1c)return!1;if(i.constructor.name!==t.name)return!1;var a=i._sshpkApiVersion;void 0===a&&(a=t._oldVersionDetect(e));return!(a[0]!=r[0]||a[1]t;)p.equal(e[0],0),e=e.slice(1);for(;e.length=r[1],i+" must be compatible with "+t.name+" klass version "+r[0]+"."+r[1])}}var v={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}},b=8;function y(e){for(p.buffer(e);1t._pos){var i=r.substr(t._pos);if("x-user-defined"===t._charset){for(var n=new p(i.length),a=0;at._pos&&(t.push(new p(new Uint8Array(o.result.slice(t._pos)))),t._pos=o.result.byteLength)},o.onload=function(){t.push(null)},o.readAsArrayBuffer(r)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":484,_process:382,buffer:191,inherits:320,"readable-stream":426}],487:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=p,t=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1=2.4.3 <2.5.0",_id:"tough-cookie@2.4.3",_inCache:!0,_installable:!0,_location:"/tough-cookie",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/tough-cookie_2.4.3_1529960207843_0.4882910670728131"},_npmUser:{email:"jstash@gmail.com",name:"jstash"},_npmVersion:"6.1.0",_phantomChildren:{},_requested:{name:"tough-cookie",raw:"tough-cookie@~2.4.3",rawSpec:"~2.4.3",scope:null,spec:">=2.4.3 <2.5.0",type:"range"},_requiredBy:["/request","/request-promise"],_resolved:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",_shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",_shrinkwrap:null,_spec:"tough-cookie@~2.4.3",_where:"/home/administrator/javascript-opentimestamps/node_modules/request",author:{email:"jstash@gmail.com",name:"Jeremy Stashewsky"},bugs:{url:"https://github.com/salesforce/tough-cookie/issues"},contributors:[{name:"Alexander Savin"},{name:"Ian Livingstone"},{name:"Ivan Nikulin"},{name:"Lalit Kapoor"},{name:"Sam Thompson"},{name:"Sebastian Mayr"}],dependencies:{psl:"^1.1.24",punycode:"^1.4.1"},description:"RFC6265 Cookies and Cookie Jar for node.js",devDependencies:{async:"^1.4.2",nyc:"^11.6.0","string.prototype.repeat":"^0.2.0",vows:"^0.8.1"},directories:{},dist:{fileCount:9,integrity:"sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMVcQCRA9TVsSAnZWagAAzX0P/2COkbzb3dOX/FTOYIVL\n7oHge7BvGODNkEHTjBtNsR0jO/AA/gVcUOq6CSmFH+UC14LrmCyNDemQvD15\njnYuJXUIiZsSZO7BGGbOFYrQF+DKLiwgf0LokrIM8KasZ5nxc5xS1jYHG5o+\nwCqutfhlRTqlPbZsexB+eRlIuYNvpsbRAdSDYXrhLJNMZgx49g/SZ7IwunGN\nJ/5Fe041MZqqdi7MAavM3T7vX9IvVRJJ3f4xAEVxY1vh4s0dN+h4fG2eMQzL\nOiaulRUIahs4xmJUYHZgZESc9eTIrI8K+YT7i3r35TGc0Du7ueB2KYxBqy7q\n6AUFbdX9Ep308kTVsTf/h4wE0RvdxKLfZ0ww7T1ivADX9xMi2oIvVtyhCQHo\nSIpyBhaav/fTufF0/Fu4Lcr7PMJxyvF0UcNRqrPmEQTw4UZkFKfT8HN2P5cH\nBvJsFwpeEjt84tt5pJ/bmD0j0EUCLUXLGH6fbA84fHpZGifO239zSf262Qdv\nSXeygU7YxnK8wOCnvlauZx/gp+/WTMfMdODxiX0QnqwS5BctiPCgGG1cKJcC\nqvTECaAEmxMVf/gEW73oxVXJgUO7f6jJaWoawV7ka+wR91W9Bp0pKGOOAxAG\nU72rmnwQKid9U7ly5833sb3D+lbzKJXGNIqohegP4daKZfNNTaLWZXmKE+Iy\n7Vml\r\n=8KpS\r\n-----END PGP SIGNATURE-----\r\n",shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",tarball:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",unpackedSize:83959},engines:{node:">=0.8"},files:["lib"],gitHead:"671ad413b38d7464352886772f57a7ec417d4760",homepage:"https://github.com/salesforce/tough-cookie",keywords:["HTTP","RFC2965","RFC6265","cookie","cookiejar","cookies","jar","set-cookie"],license:"BSD-3-Clause",main:"./lib/cookie",maintainers:[{name:"awaterma",email:"awaterma@awaterma.net"},{name:"jstash",email:"jstash@gmail.com"},{name:"maratto",email:"marat+npm@salesforce.com"},{name:"ruoho",email:"clint@ruoho.org"}],name:"tough-cookie",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/salesforce/tough-cookie.git"},scripts:{cover:"nyc --reporter=lcov --reporter=html vows test/*_test.js",test:"vows test/*_test.js"},version:"2.4.3"}},{}],497:[function(s,e,c){(function(u){"use strict";s("net");var f,a=s("tls"),r=s("http"),i=s("https"),e=s("events"),p=s("assert"),t=s("util"),h=s("safe-buffer").Buffer;function o(e){var o=this;o.options=e||{},o.proxyOptions=o.options.proxy||{},o.maxSockets=o.options.maxSockets||r.Agent.defaultMaxSockets,o.requests=[],o.sockets=[],o.on("free",function(e,t,r){for(var i=0,n=o.requests.length;i=this.maxSockets?this.requests.push({host:t.host,port:t.port,request:e}):this.createConnection({host:t.host,port:t.port,request:e})},o.prototype.createConnection=function(e){var n=this;n.createSocket(e,function(t){function r(){n.emit("free",t,e.host,e.port)}function i(e){n.removeSocket(t),t.removeListener("free",r),t.removeListener("close",i),t.removeListener("agentRemove",i)}t.on("free",r),t.on("close",i),t.on("agentRemove",i),e.request.onSocket(t)})},o.prototype.createSocket=function(n,a){var o=this,s={};o.sockets.push(s);var e=l({},o.proxyOptions,{method:"CONNECT",path:n.host+":"+n.port,agent:!1});e.proxyAuth&&(e.headers=e.headers||{},e.headers["Proxy-Authorization"]="Basic "+h.from(e.proxyAuth).toString("base64")),f("making CONNECT request");var c=o.request(e);function i(e,t,r){if(c.removeAllListeners(),t.removeAllListeners(),200===e.statusCode)p.equal(r.length,0),f("tunneling connection has established"),o.sockets[o.sockets.indexOf(s)]=t,a(t);else{f("tunneling socket could not be established, statusCode=%d",e.statusCode);var i=new Error("tunneling socket could not be established, statusCode="+e.statusCode);i.code="ECONNRESET",n.request.emit("error",i),o.removeSocket(s)}}c.useChunkedEncodingByDefault=!1,c.once("response",function(e){e.upgrade=!0}),c.once("upgrade",function(e,t,r){u.nextTick(function(){i(e,t,r)})}),c.once("connect",i),c.once("error",function(e){c.removeAllListeners(),f("tunneling socket could not be established, cause=%s\n",e.message,e.stack);var t=new Error("tunneling socket could not be established, cause="+e.message);t.code="ECONNRESET",n.request.emit("error",t),o.removeSocket(s)}),c.end()},o.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},f=u.env.NODE_DEBUG&&/\btunnel\b/.test(u.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},c.debug=f}).call(this,s("_process"))},{_process:382,assert:67,events:269,http:483,https:317,net:187,"safe-buffer":447,tls:187,util:505}],498:[function(e,t,r){!function(a){"use strict";var m=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function d(e,t,r,i,n){var a,o=0;for(a=0;a>>8)-1}function v(e,t,r,i){return d(e,t,r,i,16)}function b(e,t,r,i){return d(e,t,r,i,32)}function y(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=a,k=o,x=s,S=c,j=u,E=f,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=0;M<20;M+=2)w^=(n=(C^=(n=(P^=(n=(j^=(n=w+C|0)<<7|n>>>25)+w|0)<<9|n>>>23)+j|0)<<13|n>>>19)+P|0)<<18|n>>>14,E^=(n=(k^=(n=(F^=(n=(O^=(n=E+k|0)<<7|n>>>25)+E|0)<<9|n>>>23)+O|0)<<13|n>>>19)+F|0)<<18|n>>>14,T^=(n=(A^=(n=(x^=(n=(R^=(n=T+A|0)<<7|n>>>25)+T|0)<<9|n>>>23)+R|0)<<13|n>>>19)+x|0)<<18|n>>>14,z^=(n=(B^=(n=(I^=(n=(S^=(n=z+B|0)<<7|n>>>25)+z|0)<<9|n>>>23)+S|0)<<13|n>>>19)+I|0)<<18|n>>>14,w^=(n=(S^=(n=(x^=(n=(k^=(n=w+S|0)<<7|n>>>25)+w|0)<<9|n>>>23)+k|0)<<13|n>>>19)+x|0)<<18|n>>>14,E^=(n=(j^=(n=(I^=(n=(A^=(n=E+j|0)<<7|n>>>25)+E|0)<<9|n>>>23)+A|0)<<13|n>>>19)+I|0)<<18|n>>>14,T^=(n=(O^=(n=(P^=(n=(B^=(n=T+O|0)<<7|n>>>25)+T|0)<<9|n>>>23)+B|0)<<13|n>>>19)+P|0)<<18|n>>>14,z^=(n=(R^=(n=(F^=(n=(C^=(n=z+R|0)<<7|n>>>25)+z|0)<<9|n>>>23)+C|0)<<13|n>>>19)+F|0)<<18|n>>>14;w=w+a|0,k=k+o|0,x=x+s|0,S=S+c|0,j=j+u|0,E=E+f|0,A=A+p|0,I=I+h|0,P=P+l|0,O=O+d|0,T=T+m|0,B=B+g|0,C=C+v|0,F=F+b|0,R=R+y|0,z=z+_|0,e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=x>>>0&255,e[9]=x>>>8&255,e[10]=x>>>16&255,e[11]=x>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=j>>>0&255,e[17]=j>>>8&255,e[18]=j>>>16&255,e[19]=j>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=B>>>0&255,e[45]=B>>>8&255,e[46]=B>>>16&255,e[47]=B>>>24&255,e[48]=C>>>0&255,e[49]=C>>>8&255,e[50]=C>>>16&255,e[51]=C>>>24&255,e[52]=F>>>0&255,e[53]=F>>>8&255,e[54]=F>>>16&255,e[55]=F>>>24&255,e[56]=R>>>0&255,e[57]=R>>>8&255,e[58]=R>>>16&255,e[59]=R>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,i)}function _(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=0;w<20;w+=2)a^=(n=(v^=(n=(l^=(n=(u^=(n=a+v|0)<<7|n>>>25)+a|0)<<9|n>>>23)+u|0)<<13|n>>>19)+l|0)<<18|n>>>14,f^=(n=(o^=(n=(b^=(n=(d^=(n=f+o|0)<<7|n>>>25)+f|0)<<9|n>>>23)+d|0)<<13|n>>>19)+b|0)<<18|n>>>14,m^=(n=(p^=(n=(s^=(n=(y^=(n=m+p|0)<<7|n>>>25)+m|0)<<9|n>>>23)+y|0)<<13|n>>>19)+s|0)<<18|n>>>14,_^=(n=(g^=(n=(h^=(n=(c^=(n=_+g|0)<<7|n>>>25)+_|0)<<9|n>>>23)+c|0)<<13|n>>>19)+h|0)<<18|n>>>14,a^=(n=(c^=(n=(s^=(n=(o^=(n=a+c|0)<<7|n>>>25)+a|0)<<9|n>>>23)+o|0)<<13|n>>>19)+s|0)<<18|n>>>14,f^=(n=(u^=(n=(h^=(n=(p^=(n=f+u|0)<<7|n>>>25)+f|0)<<9|n>>>23)+p|0)<<13|n>>>19)+h|0)<<18|n>>>14,m^=(n=(d^=(n=(l^=(n=(g^=(n=m+d|0)<<7|n>>>25)+m|0)<<9|n>>>23)+g|0)<<13|n>>>19)+l|0)<<18|n>>>14,_^=(n=(y^=(n=(b^=(n=(v^=(n=_+y|0)<<7|n>>>25)+_|0)<<9|n>>>23)+v|0)<<13|n>>>19)+b|0)<<18|n>>>14;e[0]=a>>>0&255,e[1]=a>>>8&255,e[2]=a>>>16&255,e[3]=a>>>24&255,e[4]=f>>>0&255,e[5]=f>>>8&255,e[6]=f>>>16&255,e[7]=f>>>24&255,e[8]=m>>>0&255,e[9]=m>>>8&255,e[10]=m>>>16&255,e[11]=m>>>24&255,e[12]=_>>>0&255,e[13]=_>>>8&255,e[14]=_>>>16&255,e[15]=_>>>24&255,e[16]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255}(e,t,r,i)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function k(e,t,r,i,n,a,o){var s,c,u=new Uint8Array(16),f=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=a[c];for(;64<=n;){for(y(f,u,o,w),c=0;c<64;c++)e[t+c]=r[i+c]^f[c];for(s=1,c=8;c<16;c++)s=s+(255&u[c])|0,u[c]=255&s,s>>>=8;n-=64,t+=64,i+=64}if(0>>=8;r-=64,t+=64}if(0>>13|r<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|i<<6),n=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|n<<9),a=255&e[8]|(255&e[9])<<8,this.r[4]=255&(n>>>4|a<<12),this.r[5]=a>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(a>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,r,i,n,a){var o=new E(a);return o.update(r,i,n),o.finish(e,t),0}function I(e,t,r,i,n,a){var o=new Uint8Array(16);return A(o,0,r,i,n,a),v(e,t,o,0)}function P(e,t,r,i,n){var a;if(r<32)return-1;for(j(e,0,t,0,r,i,n),A(e,16,e,32,r-32,e),a=0;a<16;a++)e[a]=0;return 0}function O(e,t,r,i,n){var a,o=new Uint8Array(32);if(r<32)return-1;if(S(o,0,32,i,n),0!==I(t,16,t,32,r-32,o))return-1;for(j(e,0,t,0,r,i,n),a=0;a<32;a++)e[a]=0;return 0}function T(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function C(e,t,r){for(var i,n=~(r-1),a=0;a<16;a++)i=n&(e[a]^t[a]),e[a]^=i,t[a]^=i}function F(e,t){var r,i,n,a=m(),o=m();for(r=0;r<16;r++)o[r]=t[r];for(B(o),B(o),B(o),i=0;i<2;i++){for(a[0]=o[0]-65517,r=1;r<15;r++)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),n=a[15]>>16&1,a[14]&=65535,C(o,a,1-n)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function R(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return F(r,e),F(i,t),b(r,0,i,0)}function z(e){var t=new Uint8Array(32);return F(t,e),1&t[0]}function M(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function N(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function D(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function q(e,t,r){var i,n,a=0,o=0,s=0,c=0,u=0,f=0,p=0,h=0,l=0,d=0,m=0,g=0,v=0,b=0,y=0,_=0,w=0,k=0,x=0,S=0,j=0,E=0,A=0,I=0,P=0,O=0,T=0,B=0,C=0,F=0,R=0,z=r[0],M=r[1],N=r[2],D=r[3],q=r[4],L=r[5],U=r[6],H=r[7],K=r[8],V=r[9],G=r[10],$=r[11],W=r[12],Z=r[13],Y=r[14],X=r[15];a+=(i=t[0])*z,o+=i*M,s+=i*N,c+=i*D,u+=i*q,f+=i*L,p+=i*U,h+=i*H,l+=i*K,d+=i*V,m+=i*G,g+=i*$,v+=i*W,b+=i*Z,y+=i*Y,_+=i*X,o+=(i=t[1])*z,s+=i*M,c+=i*N,u+=i*D,f+=i*q,p+=i*L,h+=i*U,l+=i*H,d+=i*K,m+=i*V,g+=i*G,v+=i*$,b+=i*W,y+=i*Z,_+=i*Y,w+=i*X,s+=(i=t[2])*z,c+=i*M,u+=i*N,f+=i*D,p+=i*q,h+=i*L,l+=i*U,d+=i*H,m+=i*K,g+=i*V,v+=i*G,b+=i*$,y+=i*W,_+=i*Z,w+=i*Y,k+=i*X,c+=(i=t[3])*z,u+=i*M,f+=i*N,p+=i*D,h+=i*q,l+=i*L,d+=i*U,m+=i*H,g+=i*K,v+=i*V,b+=i*G,y+=i*$,_+=i*W,w+=i*Z,k+=i*Y,x+=i*X,u+=(i=t[4])*z,f+=i*M,p+=i*N,h+=i*D,l+=i*q,d+=i*L,m+=i*U,g+=i*H,v+=i*K,b+=i*V,y+=i*G,_+=i*$,w+=i*W,k+=i*Z,x+=i*Y,S+=i*X,f+=(i=t[5])*z,p+=i*M,h+=i*N,l+=i*D,d+=i*q,m+=i*L,g+=i*U,v+=i*H,b+=i*K,y+=i*V,_+=i*G,w+=i*$,k+=i*W,x+=i*Z,S+=i*Y,j+=i*X,p+=(i=t[6])*z,h+=i*M,l+=i*N,d+=i*D,m+=i*q,g+=i*L,v+=i*U,b+=i*H,y+=i*K,_+=i*V,w+=i*G,k+=i*$,x+=i*W,S+=i*Z,j+=i*Y,E+=i*X,h+=(i=t[7])*z,l+=i*M,d+=i*N,m+=i*D,g+=i*q,v+=i*L,b+=i*U,y+=i*H,_+=i*K,w+=i*V,k+=i*G,x+=i*$,S+=i*W,j+=i*Z,E+=i*Y,A+=i*X,l+=(i=t[8])*z,d+=i*M,m+=i*N,g+=i*D,v+=i*q,b+=i*L,y+=i*U,_+=i*H,w+=i*K,k+=i*V,x+=i*G,S+=i*$,j+=i*W,E+=i*Z,A+=i*Y,I+=i*X,d+=(i=t[9])*z,m+=i*M,g+=i*N,v+=i*D,b+=i*q,y+=i*L,_+=i*U,w+=i*H,k+=i*K,x+=i*V,S+=i*G,j+=i*$,E+=i*W,A+=i*Z,I+=i*Y,P+=i*X,m+=(i=t[10])*z,g+=i*M,v+=i*N,b+=i*D,y+=i*q,_+=i*L,w+=i*U,k+=i*H,x+=i*K,S+=i*V,j+=i*G,E+=i*$,A+=i*W,I+=i*Z,P+=i*Y,O+=i*X,g+=(i=t[11])*z,v+=i*M,b+=i*N,y+=i*D,_+=i*q,w+=i*L,k+=i*U,x+=i*H,S+=i*K,j+=i*V,E+=i*G,A+=i*$,I+=i*W,P+=i*Z,O+=i*Y,T+=i*X,v+=(i=t[12])*z,b+=i*M,y+=i*N,_+=i*D,w+=i*q,k+=i*L,x+=i*U,S+=i*H,j+=i*K,E+=i*V,A+=i*G,I+=i*$,P+=i*W,O+=i*Z,T+=i*Y,B+=i*X,b+=(i=t[13])*z,y+=i*M,_+=i*N,w+=i*D,k+=i*q,x+=i*L,S+=i*U,j+=i*H,E+=i*K,A+=i*V,I+=i*G,P+=i*$,O+=i*W,T+=i*Z,B+=i*Y,C+=i*X,y+=(i=t[14])*z,_+=i*M,w+=i*N,k+=i*D,x+=i*q,S+=i*L,j+=i*U,E+=i*H,A+=i*K,I+=i*V,P+=i*G,O+=i*$,T+=i*W,B+=i*Z,C+=i*Y,F+=i*X,_+=(i=t[15])*z,o+=38*(k+=i*N),s+=38*(x+=i*D),c+=38*(S+=i*q),u+=38*(j+=i*L),f+=38*(E+=i*U),p+=38*(A+=i*H),h+=38*(I+=i*K),l+=38*(P+=i*V),d+=38*(O+=i*G),m+=38*(T+=i*$),g+=38*(B+=i*W),v+=38*(C+=i*Z),b+=38*(F+=i*Y),y+=38*(R+=i*X),a=(i=(a+=38*(w+=i*M))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a=(i=(a+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a+=n-1+37*(n-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=h,e[8]=l,e[9]=d,e[10]=m,e[11]=g,e[12]=v,e[13]=b,e[14]=y,e[15]=_}function L(e,t){q(e,t,t)}function U(e,t){var r,i=m();for(r=0;r<16;r++)i[r]=t[r];for(r=253;0<=r;r--)L(i,i),2!==r&&4!==r&&q(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function H(e,t,r){var i,n,a=new Uint8Array(32),o=new Float64Array(80),s=m(),c=m(),u=m(),f=m(),p=m(),h=m();for(n=0;n<31;n++)a[n]=t[n];for(a[31]=127&t[31]|64,a[0]&=248,M(o,r),n=0;n<16;n++)c[n]=o[n],f[n]=s[n]=u[n]=0;for(s[0]=f[0]=1,n=254;0<=n;--n)C(s,c,i=a[n>>>3]>>>(7&n)&1),C(u,f,i),N(p,s,u),D(s,s,u),N(u,c,f),D(c,c,f),L(f,p),L(h,s),q(s,u,s),q(u,c,p),N(p,s,u),D(s,s,u),L(c,s),D(u,f,h),q(s,u,g),N(s,s,f),q(u,u,s),q(s,f,h),q(f,c,o),L(c,p),C(s,c,i),C(u,f,i);for(n=0;n<16;n++)o[n+16]=s[n],o[n+32]=u[n],o[n+48]=c[n],o[n+64]=f[n];var l=o.subarray(32),d=o.subarray(16);return U(l,l),q(d,d,l),F(e,d),0}function K(e,t){return H(e,t,r)}function V(e,t){return o(t,32),K(e,t)}function G(e,t,r){var i=new Uint8Array(32);return H(i,r,t),_(e,n,i,w)}E.prototype.blocks=function(e,t,r){for(var i,n,a,o,s,c,u,f,p,h,l,d,m,g,v,b,y,_,w,k=this.fin?0:2048,x=this.h[0],S=this.h[1],j=this.h[2],E=this.h[3],A=this.h[4],I=this.h[5],P=this.h[6],O=this.h[7],T=this.h[8],B=this.h[9],C=this.r[0],F=this.r[1],R=this.r[2],z=this.r[3],M=this.r[4],N=this.r[5],D=this.r[6],q=this.r[7],L=this.r[8],U=this.r[9];16<=r;)h=p=0,h+=(x+=8191&(i=255&e[t+0]|(255&e[t+1])<<8))*C,h+=(S+=8191&(i>>>13|(n=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*U),h+=(j+=8191&(n>>>10|(a=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*L),h+=(E+=8191&(a>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*q),p=(h+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*D))>>>13,h&=8191,h+=(I+=s>>>1&8191)*(5*N),h+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*M),h+=(O+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),h+=(T+=8191&(u>>>8|(f=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*R),l=p+=(h+=(B+=f>>>5|k)*(5*F))>>>13,l+=x*F,l+=S*C,l+=j*(5*U),l+=E*(5*L),p=(l+=A*(5*q))>>>13,l&=8191,l+=I*(5*D),l+=P*(5*N),l+=O*(5*M),l+=T*(5*z),p+=(l+=B*(5*R))>>>13,l&=8191,d=p,d+=x*R,d+=S*F,d+=j*C,d+=E*(5*U),p=(d+=A*(5*L))>>>13,d&=8191,d+=I*(5*q),d+=P*(5*D),d+=O*(5*N),d+=T*(5*M),m=p+=(d+=B*(5*z))>>>13,m+=x*z,m+=S*R,m+=j*F,m+=E*C,p=(m+=A*(5*U))>>>13,m&=8191,m+=I*(5*L),m+=P*(5*q),m+=O*(5*D),m+=T*(5*N),g=p+=(m+=B*(5*M))>>>13,g+=x*M,g+=S*z,g+=j*R,g+=E*F,p=(g+=A*C)>>>13,g&=8191,g+=I*(5*U),g+=P*(5*L),g+=O*(5*q),g+=T*(5*D),v=p+=(g+=B*(5*N))>>>13,v+=x*N,v+=S*M,v+=j*z,v+=E*R,p=(v+=A*F)>>>13,v&=8191,v+=I*C,v+=P*(5*U),v+=O*(5*L),v+=T*(5*q),b=p+=(v+=B*(5*D))>>>13,b+=x*D,b+=S*N,b+=j*M,b+=E*z,p=(b+=A*R)>>>13,b&=8191,b+=I*F,b+=P*C,b+=O*(5*U),b+=T*(5*L),y=p+=(b+=B*(5*q))>>>13,y+=x*q,y+=S*D,y+=j*N,y+=E*M,p=(y+=A*z)>>>13,y&=8191,y+=I*R,y+=P*F,y+=O*C,y+=T*(5*U),_=p+=(y+=B*(5*L))>>>13,_+=x*L,_+=S*q,_+=j*D,_+=E*N,p=(_+=A*M)>>>13,_&=8191,_+=I*z,_+=P*R,_+=O*F,_+=T*C,w=p+=(_+=B*(5*U))>>>13,w+=x*U,w+=S*L,w+=j*q,w+=E*D,p=(w+=A*N)>>>13,w&=8191,w+=I*M,w+=P*z,w+=O*R,w+=T*F,x=h=8191&(p=(p=((p+=(w+=B*C)>>>13)<<2)+p|0)+(h&=8191)|0),S=l+=p>>>=13,j=d&=8191,E=m&=8191,A=g&=8191,I=v&=8191,P=b&=8191,O=y&=8191,T=_&=8191,B=w&=8191,t+=16,r-=16;this.h[0]=x,this.h[1]=S,this.h[2]=j,this.h[3]=E,this.h[4]=A,this.h[5]=I,this.h[6]=P,this.h[7]=O,this.h[8]=T,this.h[9]=B},E.prototype.finish=function(e,t){var r,i,n,a,o=new Uint16Array(10);if(this.leftover){for(a=this.leftover,this.buffer[a++]=1;a<16;a++)this.buffer[a]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=r,r=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this.h[a]+r,r=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,i=(1^r)-1,a=0;a<10;a++)o[a]&=i;for(i=~i,a=0;a<10;a++)this.h[a]=this.h[a]&i|o[a];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,a=1;a<8;a++)n=(this.h[a]+this.pad[a]|0)+(n>>>16)|0,this.h[a]=65535&n;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var i,n;if(this.leftover){for(r<(n=16-this.leftover)&&(n=r),i=0;i>>16,I=65535&(S=D),P=S>>>16,E+=65535&(j=((g=K)>>>14|(c=z)<<18)^(K>>>18|z<<14)^(z>>>9|K<<23)),A+=j>>>16,I+=65535&(S=(z>>>14|K<<18)^(z>>>18|K<<14)^(K>>>9|z<<23)),P+=S>>>16,E+=65535&(j=K&(v=V)^~K&(b=G)),A+=j>>>16,I+=65535&(S=z&(u=M)^~z&(f=N)),P+=S>>>16,S=Z[2*k],E+=65535&(j=Z[2*k+1]),A+=j>>>16,I+=65535&S,P+=S>>>16,S=O[k%16],A+=(j=T[k%16])>>>16,I+=65535&S,P+=S>>>16,I+=(A+=(E+=65535&j)>>>16)>>>16,E=65535&(j=w=65535&E|A<<16),A=j>>>16,I=65535&(S=_=65535&I|(P+=I>>>16)<<16),P=S>>>16,E+=65535&(j=(q>>>28|B<<4)^(B>>>2|q<<30)^(B>>>7|q<<25)),A+=j>>>16,I+=65535&(S=(B>>>28|q<<4)^(q>>>2|B<<30)^(q>>>7|B<<25)),P+=S>>>16,A+=(j=q&L^q&U^L&U)>>>16,I+=65535&(S=B&C^B&F^C&F),P+=S>>>16,p=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,y=65535&E|A<<16,E=65535&(j=m),A=j>>>16,I=65535&(S=s),P=S>>>16,A+=(j=w)>>>16,I+=65535&(S=_),P+=S>>>16,C=n,F=a,R=o,z=s=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,M=c,N=u,D=f,B=p,L=h,U=l,H=d,K=m=65535&E|A<<16,V=g,G=v,$=b,q=y,k%16==15)for(x=0;x<16;x++)S=O[x],E=65535&(j=T[x]),A=j>>>16,I=65535&S,P=S>>>16,S=O[(x+9)%16],E+=65535&(j=T[(x+9)%16]),A+=j>>>16,I+=65535&S,P+=S>>>16,_=O[(x+1)%16],E+=65535&(j=((w=T[(x+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),A+=j>>>16,I+=65535&(S=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),P+=S>>>16,_=O[(x+14)%16],A+=(j=((w=T[(x+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,I+=65535&(S=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,O[x]=65535&I|P<<16,T[x]=65535&E|A<<16;E=65535&(j=q),A=j>>>16,I=65535&(S=B),P=S>>>16,S=e[0],A+=(j=t[0])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[0]=B=65535&I|P<<16,t[0]=q=65535&E|A<<16,E=65535&(j=L),A=j>>>16,I=65535&(S=C),P=S>>>16,S=e[1],A+=(j=t[1])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[1]=C=65535&I|P<<16,t[1]=L=65535&E|A<<16,E=65535&(j=U),A=j>>>16,I=65535&(S=F),P=S>>>16,S=e[2],A+=(j=t[2])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[2]=F=65535&I|P<<16,t[2]=U=65535&E|A<<16,E=65535&(j=H),A=j>>>16,I=65535&(S=R),P=S>>>16,S=e[3],A+=(j=t[3])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[3]=R=65535&I|P<<16,t[3]=H=65535&E|A<<16,E=65535&(j=K),A=j>>>16,I=65535&(S=z),P=S>>>16,S=e[4],A+=(j=t[4])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[4]=z=65535&I|P<<16,t[4]=K=65535&E|A<<16,E=65535&(j=V),A=j>>>16,I=65535&(S=M),P=S>>>16,S=e[5],A+=(j=t[5])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[5]=M=65535&I|P<<16,t[5]=V=65535&E|A<<16,E=65535&(j=G),A=j>>>16,I=65535&(S=N),P=S>>>16,S=e[6],A+=(j=t[6])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[6]=N=65535&I|P<<16,t[6]=G=65535&E|A<<16,E=65535&(j=$),A=j>>>16,I=65535&(S=D),P=S>>>16,S=e[7],A+=(j=t[7])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[7]=D=65535&I|P<<16,t[7]=$=65535&E|A<<16,W+=128,i-=128}return i}function X(e,t,r){var i,n=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,Y(n,a,t,r),r%=128,i=0;i>(7&n)&1),J(t,e),J(e,e),Q(e,t,i)}function re(e,t){var r=[m(),m(),m(),m()];T(r[0],i),T(r[1],s),T(r[2],f),q(r[3],i,s),te(e,r,t)}function ie(e,t,r){var i,n=new Uint8Array(64),a=[m(),m(),m(),m()];for(r||o(t,32),X(n,t,32),n[0]&=248,n[31]&=127,n[31]|=64,re(a,n),ee(e,a),i=0;i<32;i++)t[i+32]=e[i];return 0}var ne=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var r,i,n,a;for(i=63;32<=i;--i){for(r=0,n=i-32,a=i-12;n>8,t[n]-=256*r;t[n]+=r,t[i]=0}for(n=r=0;n<32;n++)t[n]+=r-(t[31]>>4)*ne[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*ne[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function oe(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function se(e,t,r,i){var n,a,o=new Uint8Array(64),s=new Uint8Array(64),c=new Uint8Array(64),u=new Float64Array(64),f=[m(),m(),m(),m()];X(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var p=r+64;for(n=0;n>7&&D(e[0],u,e[0]),q(e[3],e[0],e[1]),0)}function ue(e,t,r,i){var n,a=new Uint8Array(32),o=new Uint8Array(64),s=[m(),m(),m(),m()],c=[m(),m(),m(),m()];if(-1,r<64)return-1;if(ce(c,i))return-1;for(n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,M=String.fromCharCode;function N(e){throw new RangeError(o[e])}function s(e,t){var r=e.split("@"),i="";return 1>1,e+=z(e/t);455z((C-n)/p))&&N("overflow"),n+=l*p;var d=h<=o?1:o+26<=h?26:h-o;if(lz(C/m)&&N("overflow"),p*=m}var g=r.length+1;o=L(n-f,g,0==f),z(n/g)>C-a&&N("overflow"),a+=z(n/g),n%=g,r.splice(n++,0,a)}return String.fromCodePoint.apply(String,r)},u=function(e){var t=[],r=(e=D(e)).length,i=128,n=0,a=72,o=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(o=(u=f.next()).done);o=!0){var p=u.value;p<128&&t.push(M(p))}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}var h=t.length,l=h;for(h&&t.push("-");lz((C-n)/w)&&N("overflow"),n+=(d-i)*w,i=d;var k=!0,x=!1,S=void 0;try{for(var j,E=e[Symbol.iterator]();!(k=(j=E.next()).done);k=!0){var A=j.value;if(AC&&N("overflow"),A==i){for(var I=n,P=36;;P+=36){var O=P<=a?1:a+26<=P?26:P-a;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function l(e){for(var t="",r=0,i=e.length;rA-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(V,"g"),Y=new RegExp($,"g"),X=new RegExp(F("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',W),"g"),J=new RegExp(F("[^]",V,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),Q=J;function ee(e){var t=l(e);return t.match(Z)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,a={},o=r.query.split("&"),s=0,c=o.length;s",'"',"`"," ","\r","\n","\t"]),M=["'"].concat(n),N=["%","/","?",";","#"].concat(M),D=["/","?","#"],q=/^[+a-z0-9A-Z_-]{0,63}$/,L=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,U={javascript:!0,"javascript:":!0},H={javascript:!0,"javascript:":!0},K={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},V=e("querystring");function a(e,t,r){if(e&&F.isObject(e)&&e instanceof A)return e;var i=new A;return i.parse(e,t,r),i}A.prototype.parse=function(e,t,r){if(!F.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===e?"undefined":_typeof(e)));var i=e.indexOf("?"),n=-1!==i&&i>t&63|128)}function p(e){if(0==(4294967168&e))return s(e);var t="";return 0==(4294965248&e)?t=s(e>>6&31|192):0==(4294901760&e)?(u(e),t=s(e>>12&15|224),t+=f(e,6)):0==(4292870144&e)&&(t=s(e>>18&7|240),t+=f(e,12),t+=f(e,6)),t+=s(63&e|128)}function h(){if(a<=o)throw Error("Invalid byte index");var e=255&n[o];if(o++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,t;if(a>>10&1023|55296),t=56320|1023&t),n+=s(t);return n}(r)}};if("function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define(function(){return d});else if(t&&!t.nodeType)if(r)r.exports=d;else{var m={}.hasOwnProperty;for(var g in d)m.call(d,g)&&(t[g]=d[g])}else e.utf8=d}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],503:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],504:[function(e,t,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],505:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{"./support/isBuffer":504,_process:382,dup:70,inherits:320}],506:[function(e,t,r){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},{}],507:[function(e,t,r){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var n=new Uint8Array(16);t.exports=function(){return i(n),n}}else{var a=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}},{}],508:[function(e,t,r){var o=e("./lib/rng"),s=e("./lib/bytesToUuid");t.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var a=0;a<16;++a)t[i+a]=n[a];return t||s(n)}},{"./lib/bytesToUuid":506,"./lib/rng":507}],509:[function(e,t,r){var s=e("assert-plus"),i=e("util"),n=e("extsprintf"),c=e("core-util-is").isError,a=n.sprintf;function u(e){var t,r,i,n;if(s.object(e,"args"),s.bool(e.strict,"args.strict"),s.array(e.argv,"args.argv"),0===(t=e.argv).length)r={},i=[];else if(c(t[0]))r={cause:t[0]},i=t.slice(1);else if("object"===_typeof(t[0])){for(n in r={},t[0])r[n]=t[0][n];i=t.slice(1)}else s.string(t[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},i=t;return s.object(r),r.strict||e.strict||(i=i.map(function(e){return null===e?"null":void 0===e?"undefined":e})),{options:r,shortmessage:0===i.length?"":a.apply(null,i)}}function f(){var e,t,r,i,n,a,o;if(e=Array.prototype.slice.call(arguments,0),!(this instanceof f))return t=Object.create(f.prototype),f.apply(t,arguments),t;if((r=u({argv:e,strict:!1})).options.name&&(s.string(r.options.name,'error\'s "name" must be a string'),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,a=r.shortmessage,(i=r.options.cause)&&(s.ok(c(i),"cause is not an Error"),this.jse_cause=i,r.options.skipCauseMessage||(a+=": "+i.message)),this.jse_info={},r.options.info)for(o in r.options.info)this.jse_info[o]=r.options.info[o];return this.message=a,Error.call(this,a),Error.captureStackTrace&&(n=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,n)),this}function o(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof o?(i=(r=u({argv:e,strict:!0})).options,f.call(this,i,"%s",r.shortmessage),this):(t=Object.create(o.prototype),o.apply(t,arguments),t)}function p(e){s.array(e,"list of errors"),s.ok(0this._inputTypes.length&&!n.isObject(e[e.length-1]))return a.inputDefaultBlockNumberFormatter(e.pop())},s.prototype.toPayload=function(e){var t={};return e.length>this._inputTypes.length&&n.isObject(e[e.length-1])&&(t=e[e.length-1]),t.to=this._address,t.data="0x"+this.signature()+i.encodeParams(this._inputTypes,e),t},s.prototype.signature=function(){return o(this._name).slice(0,8)},s.prototype.unpackOutput=function(e){if(e){e=2<=e.length?e.slice(2):e;var t=i.decodeParams(this._outputTypes,e);return 1===t.length?t[0]:t}},s.prototype.call=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),i=this.extractCallback(e),t=this.extractDefaultBlock(e),r=this.toPayload(e);if(!i){var n=this._eth.call(r,t);return this.unpackOutput(n)}var a=this;this._eth.call(r,t,function(t,e){if(t)return i(t,null);var r=null;try{r=a.unpackOutput(e)}catch(e){t=e}i(t,r)})},s.prototype.sendTransaction=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),t=this.extractCallback(e),r=this.toPayload(e);if(0=this.buffer.length)){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,t}}},{key:"read",value:function(e){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,Array.from(t)}},{key:"readBool",value:function(){var e=this.read(1)[0];if(255===e)return!0;if(0===e)return!1;throw new n("read_bool() expected 0xff or 0x00; got +"+e)}},{key:"readVaruint",value:function(){for(var e=0,t=0,r=void 0;e|=(127&(r=this.read(1)[0]))< "+e);if(r>=7}}},{key:"writeByte",value:function(e){if(this.length>=this.buffer.length){var t=2*this.length,r=new Uint8Array(t);r.set(this.buffer,0),this.buffer=r}isNaN(e)?this.buffer[this.length]=e.codePointAt():this.buffer[this.length]=e,this.length++}},{key:"writeBytes",value:function(e){var t=this;e.forEach(function(e){t.writeByte(e)})}},{key:"writeVarbytes",value:function(e){this.writeVaruint(e.length),this.writeBytes(e)}},{key:"toString",value:function(){return this.buffer.toHex(0)}}]),e}();m.exports={StreamDeserialization:h,StreamSerialization:l,DeserializationError:n,BadMagicError:a,UnsupportedMajorVersion:o,TruncationError:s,TrailingGarbageError:c,RecursionLimitError:u,SerializerTypeError:f,SerializerValueError:p,ValueError:e,TypeError:t}}).call(this,d("buffer").Buffer)},{"./extend-error.js":568,"./utils.js":574,buffer:191}],567:[function(e,t,r){"use strict";var s=e("./ops.js"),c=e("./timestamp.js"),i=e("./utils.js"),u=e("./context.js"),f=[0,79,112,101,110,84,105,109,101,115,116,97,109,112,115,0,0,80,114,111,111,102,0,191,137,226,232,132,232,146,148],n=function(){function o(e,t){if(_classCallCheck2(this,o),!(e instanceof s.Op&&t instanceof c))throw new u.ValueError("Invalid Timestamp or fileHashOp");if(t.msg.length!==e._DIGEST_LENGTH())throw new u.ValueError("Timestamp message length and fileHashOp digest length differ");this.fileHashOp=e,this.timestamp=t}return _createClass(o,[{key:"fileDigest",value:function(){return this.timestamp.msg}},{key:"serialize",value:function(e){e.writeBytes(f),e.writeVaruint(1),this.fileHashOp.serialize(e),e.writeBytes(this.timestamp.msg),this.timestamp.serialize(e)}},{key:"serializeToBytes",value:function(){var e=new u.StreamSerialization;return this.serialize(e),e.getOutput()}},{key:"toString",value:function(){var e="DetachedTimestampFile\n";return e+="fileHashOp: "+this.fileHashOp.toString()+"\n",e+="timestamp: "+this.timestamp.toString()+"\n"}},{key:"toJson",value:function(){var e={};e.hash=i.bytesToHex(this.fileDigest()),e.op=this.fileHashOp._HASHLIB_NAME(),e.timestamp=this.timestamp.toJson()}},{key:"equals",value:function(e){return e instanceof o&&(!!e.fileHashOp.equals(this.fileHashOp)&&!!e.timestamp.equals(this.timestamp))}}],[{key:"deserialize",value:function(e){var t=void 0;if(e instanceof u.StreamDeserialization)t=e;else if(e instanceof Array)t=new u.StreamDeserialization(e);else if(e instanceof Uint8Array)t=new u.StreamDeserialization(Array.from(e));else{if(!(e instanceof ArrayBuffer))throw new Error("StreamDeserialization deserialize: Invalid param");t=new u.StreamDeserialization(Array.from(e))}t.assertMagic(f);var r=t.readVaruint();if(1!==r)throw new u.UnsupportedMajorVersion("Version "+r+" detached timestamp files are not supported");var i=s.CryptOp.deserialize(t),n=t.readBytes(i._DIGEST_LENGTH()),a=c.deserialize(t,n);return t.assertEof(),new o(i,a)}},{key:"fromBytes",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOp param");var r=void 0;if(t instanceof u.StreamDeserialization)r=e.hashFd(t);else if(t instanceof Array){var i=new u.StreamDeserialization(t);r=e.hashFd(i)}else if(t instanceof Uint8Array){var n=new u.StreamDeserialization(Array.from(t));r=e.hashFd(n)}else{if(!(t instanceof ArrayBuffer))throw new Error("DetachedTimestampFile: Invalid buffer param");var a=new u.StreamDeserialization(Array.from(t));r=e.hashFd(a)}return new o(e,new c(r))}},{key:"fromHash",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOpss param");if(t instanceof Array)return new o(e,new c(t));if(t instanceof ArrayBuffer||t instanceof Uint8Array)return new o(e,new c(Array.from(t)));throw new Error("DetachedTimestampFile: Invalid fdHash param")}}]),o}();t.exports=n},{"./context.js":566,"./ops.js":572,"./timestamp.js":573,"./utils.js":574}],568:[function(e,t,r){var n=e("util"),a=e("assert");Error.extend=function(r,i){a(r,"subTypeName is required");var e=function e(t){if(!(this instanceof e))return new e(t);try{Error.captureStackTrace(this,this.constructor)}catch(e){}this.name=r,this.code=i,this.message=t||"",this.stack=this.stack.replace("Error",this.toString())};return n.inherits(e,this),e.prototype.toString=function(){return this.name+": "+n.inspect(this.message)},e.extend=this.extend,e}},{assert:67,util:505}],569:[function(e,t,r){"use strict";var a=e("./timestamp.js"),o=e("./ops.js"),i=function(){function h(){_classCallCheck2(this,h)}return _createClass(h,null,[{key:"catThenUnaryOp",value:function(e,t,r){t instanceof a||(t=new a(t)),r instanceof a||(r=new a(r));var i=r.add(new o.OpPrepend(t.msg));return t.ops.set(new o.OpAppend(r.msg),i),i.add(new o.OpSHA256)}},{key:"catSha256",value:function(e,t){return h.catThenUnaryOp(o.OpSHA256,e,t)}},{key:"catSha256d",value:function(e,t){var r=h.catSha256(e,t),i=new o.OpSHA256,n=r.ops.get(i);return void 0===n&&(n=new a(i.call(r.msg)),r.ops.set(i,n)),n}},{key:"makeMerkleTreeIterator",value:function(e){var t=e,r=[],i=void 0;do{t=t[Symbol.iterator](),i=void 0;try{i=t.next().value}catch(e){return"Need at least one timestamp"}var n=!0,a=!(r=[]),o=void 0;try{for(var s,c=t[Symbol.iterator]();!(n=(s=c.next()).done);n=!0){var u=s.value;i=void 0===i?u:void r.push(h.catSha256(i,u))}}catch(e){a=!0,o=e}finally{try{!n&&c.return&&c.return()}finally{if(a)throw o}}0(new i)._MAX_URI_LENGTH())return console.error("URI exceeds maximum length"),!1;for(var t=0;ta.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=a.privateCalendars.length;else if(a.privateCalendars=[],a.calendars&&0!==a.calendars.length||(a.calendars=c.DEFAULT_AGGREGATORS),a.m&&0!==a.m){if(a.m<0||a.m>a.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=1,2<=a.calendars.length&&(a.m=2);o.createTimestamp(i,a.calendars,a.m,a.privateCalendars).then(function(e){if(void 0===e)return r(new Error("Error on timestamp creation"));t()}).catch(function(e){r(e)})})},createTimestamp:function(i,e,t,r){var n=[];return e&&e.forEach(function(e){var t=new c.RemoteCalendar(e);n.push(t.submit(i.msg)),console.log("Submitting to remote calendar "+e)}),r&&r.forEach(function(e,t){var r=new c.RemoteCalendar(t);r.setKey(e),n.push(r.submit(i.msg)),console.log("Submitting to remote calendar "+t)}),new Promise(function(t,r){Promise.all(n.map(u.softFail)).then(function(e){return e.filter(function(e){return!(e instanceof Error)&&void 0!==e}).forEach(function(e){i.merge(e)}),t(i)}).catch(function(e){r(e)})})},makeMerkleTree:function(e){var i=[];return e.forEach(function(e){if(e instanceof s)try{var t=u.randBytes(16),r=e.timestamp.add(new n.OpAppend(u.arrayToBytes(t))).add(new n.OpSHA256);i.push(r)}catch(e){return}else console.error("Invalid input")}),f.makeMerkleTree(i)},verify:function(e,t,i){if(!u.arrEq(e.fileDigest(),t.fileDigest()))return console.error("Expected digest "+u.bytesToHex(e.fileDigest())),console.error("File does not match original!"),new Promise(function(e,t){t(new Error("File does not match original!"))});var n=this;return new Promise(function(t,r){n.upgradeTimestamp(e.timestamp,i).then(function(){n.verifyTimestamp(e.timestamp,i).then(function(e){return t(e)}).catch(function(e){return r(e)})})})},verifyTimestamp:function(e,r){var i=[],n=this;function c(e,t){return e.attestedTimet.attestedTime?1:0}return e.allAttestations().forEach(function(e,t){i.push(n.verifyAttestation(e,t,r))}),new Promise(function(o,s){Promise.all(i.map(u.softFail)).then(function(e){var t=e.filter(function(e){return e.constructor===h.VerificationError?e:void 0});if(0this._MAX_MSG_LENGTH())){var t=this.call(e);return t.length>this._MAX_RESULT_LENGTH()&&console.error("Error : Result too long;"),t}console.error("Error : Message too long;")}}],[{key:"deserialize",value:function(e){return this.tag=e.readBytes(1)[0],t.deserializeFromTag(e,this.tag)}},{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return n.get(t).deserializeFromTag(e,t);console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),t=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t.arg=void 0===e?[]:e,t}return _inherits(r,c),_createClass(r,[{key:"serialize",value:function(e){_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"serialize",this).call(this,e),e.writeVarbytes(this.arg)}},{key:"toString",value:function(){return this._TAG_NAME()+" "+i.bytesToHex(this.arg)}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t)){var r=e.readVarbytes((new c)._MAX_RESULT_LENGTH(),1);return new(n.get(t))(r)}}}]),r}(),e=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 240}},{key:"_TAG_NAME",value:function(){return"append"}},{key:"call",value:function(e){return e.concat(this.arg)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),r=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 241}},{key:"_TAG_NAME",value:function(){return"prepend"}},{key:"call",value:function(e){return this.arg.concat(e)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),u=function(e){function t(){return _classCallCheck2(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,c),_createClass(t,[{key:"toString",value:function(){return this._TAG_NAME()}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return new(n.get(t));console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),f=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 242}},{key:"_TAG_NAME",value:function(){return"reverse"}},{key:"call",value:function(e){return 0===e.length&&console.error("Can't reverse an empty message"),e.reverse()}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),p=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 243}},{key:"_TAG_NAME",value:function(){return"hexlify"}},{key:"_MAX_MSG_LENGTH",value:function(){return u._MAX_RESULT_LENGTH()}},{key:"call",value:function(e){0===e.length&&console.error("Can't hexlify an empty message")}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),h=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_HASHLIB_NAME",value:function(){return 0}},{key:"call",value:function(e,t){for(var r=("keccak256"===e._HASHLIB_NAME()?s(e._HASHLIB_NAME()).update(a.from(t)):o.createHash(e._HASHLIB_NAME()).update(a.from(t))).digest(),i=[r.length],n=0;n(new m.Op)._MAX_MSG_LENGTH())throw new TypeError("Message exceeds Op length limit; "+e.length+" > "+(new m.Op)._MAX_MSG_LENGTH());this.msg=e,this.attestations=[],this.ops=new Map}return _createClass(h,[{key:"getDigest",value:function(){return this.msg}},{key:"serialize",value:function(r){var i=this;if(!this.attestations&&!this.ops)throw new a.ValueError("An empty timestamp can't be serialized");var e=this.attestations;if(e.sort(function(e,t){return e.compareTo(t)}),1 "+t.toString()+u(o,n,i)+"\n",f+=e.strTree(a+1,o)});else if(0>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},r.charsToHex=function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&i).toString(16))}return t.join("")},r.charToByte=function(e){return e.charCodeAt(0)},r.charsToBytes=function(e){for(var t=[],r=0;r>>>>>> refs/remotes/origin/master +var _get=function e(t,r,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,r);if(void 0===n){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,i)}if("value"in n)return n.value;var o=n.get;return void 0!==o?o.call(i):void 0},_createClass=function(){function i(e,t){for(var r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,f=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,p=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,l=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",i.copy(m[e])}function g(e){var t=e.match(o);if(!t)return!1;var r,i=+t[1],n=+t[2],a=+t[3];return 1<=n&&n<=12&&1<=a&&a<=(2!=n||((r=i)%4!=0||r%100==0&&r%400!=0)?s[n]:29)}function v(e,t){var r=e.match(c);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return(i<=23&&n<=59&&a<=59||23==i&&59==n&&60==a)&&(!t||o)}(t.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d},m.full={date:g,time:v,"date-time":function(e){var t=e.split(b);return 2==t.length&&g(t[0])&&v(t[1],!0)},uri:function(e){return y.test(e)&&a.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&n.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d};var b=/t|\s/i;var y=/\/|:/;var _=/[^\\]\\Z/;function w(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":12}],7:[function(e,t,r){"use strict";var I=e("./resolve"),P=e("./util"),O=e("./error_classes"),T=e("fast-json-stable-stringify"),B=e("../dotjs/validate"),C=P.ucs2length,F=e("fast-deep-equal"),R=O.Validation;function z(e,t,r){var i=n.call(this,e,t,r);return 0<=i?{index:i,compiling:!0}:{index:i=this._compilations.length,compiling:!(this._compilations[i]={schema:e,root:t,baseId:r})}}function M(e,t,r){var i=n.call(this,e,t,r);0<=i&&this._compilations.splice(i,1)}function n(e,t,r){for(var i=0;i",b=l?">":"<",y=void 0;if(g){var _=e.util.getData(m.$data,o,e.dataPathArr),w="exclusive"+a,k="exclType"+a,x="exclIsNumber"+a,S="' + "+(A="op"+a)+" + '";n+=" var schemaExcl"+a+" = "+_+"; ",n+=" var "+w+"; var "+k+" = typeof "+(_="schemaExcl"+a)+"; if ("+k+" != 'boolean' && "+k+" != 'undefined' && "+k+" != 'number') { ";var j;y=d;(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var E=n;n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+k+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+_+" "+v+"= "+i+") ? "+p+" "+b+"= "+_+" : "+p+" "+b+" "+i+" ) : ( ("+w+" = "+_+" === true) ? "+p+" "+b+"= "+i+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { var op"+a+" = "+w+" ? '"+v+"' : '"+v+"='; ",void 0===s&&(y=d,u=e.errSchemaPath+"/"+d,i=_,h=g)}else{S=v;if((x="number"==typeof m)&&h){var A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ( "+i+" === undefined || "+m+" "+v+"= "+i+" ? "+p+" "+b+"= "+m+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { "}else{x&&void 0===s?(w=!0,y=d,u=e.errSchemaPath+"/"+d,i=m,b+="="):(x&&(i=Math[l?"min":"max"](m,s)),m===(!x||i)?(w=!0,y=d,u=e.errSchemaPath+"/"+d,b+="="):(w=!1,S+="="));A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+" "+b+" "+i+" || "+p+" !== "+p+") { "}}y=y||t,(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+A+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+S+" ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";E=n;return n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s;var l="maxLength"==t?">":"<";n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+p+".length ":n+=" ucs2length("+p+") ",n+=" "+l+" "+i+") { ";var d=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+p+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.schema[t],a=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var f="valid"+c.level,p=c.baseId,h=!0,l=n;if(l)for(var d,m=-1,g=l.length-1;m "+E+") { ";var I=f+"["+E+"]";l.schema=j,l.schemaPath=s+"["+E+"]",l.errSchemaPath=c+"/"+E,l.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),l.dataPathArr[v]=E;var P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",i+=" } ",u&&(i+=" if ("+m+") { ",d+="}")}if("object"==(void 0===_?"undefined":_typeof(_))&&e.util.schemaHasRules(_,e.RULES.all)){l.schema=_,l.schemaPath=e.schemaPath+".additionalItems",l.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+f+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" } } ",u&&(i+=" if ("+m+") { ",d+="}")}}else if(e.util.schemaHasRules(o,e.RULES.all)){l.schema=o,l.schemaPath=s,l.errSchemaPath=c,i+=" for (var "+g+" = 0; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+d+" if ("+h+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],30:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="var division"+a+";if (",h&&(n+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),n+=" (division"+a+" = "+p+" / "+i+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var l=l||[];l.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var d=n;return n=l.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+d+"]); ":n+=" validate.errors = ["+d+"]; return false; ":n+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="errs__"+n,h=e.util.copy(e);h.level++;var l="valid"+h.level;if(e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+p+" = errors; ";var d,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(d=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,d&&(h.opts.allErrors=d),e.compositeRule=h.compositeRule=m,i+=" if ("+l+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var v=i;i=g.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ");return i}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="valid"+n,h="errs__"+n,l=e.util.copy(e),d="";l.level++;var m="valid"+l.level,g=l.baseId,v="prevValid"+n,b="passingSchemas"+n;i+="var "+h+" = errors , "+v+" = false , "+p+" = false , "+b+" = null; ";var y=e.compositeRule;e.compositeRule=l.compositeRule=!0;var _=o;if(_)for(var w,k=-1,x=_.length-1;k=e.opts.loopRequired,k=e.opts.ownProperties;if(u)if(i+=" var missing"+n+"; ",w){h||(i+=" var "+l+" = validate.schema"+s+"; ");var x="' + "+(P="schema"+n+"["+(E="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(_,P,e.opts.jsonPointers)),i+=" var "+p+" = true; ",h&&(i+=" if (schema"+n+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+n+")) "+p+" = false; else {"),i+=" for (var "+E+" = 0; "+E+" < "+l+".length; "+E+"++) { "+p+" = "+f+"["+l+"["+E+"]] !== undefined ",k&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", "+l+"["+E+"]) "),i+="; if (!"+p+") break; } ",h&&(i+=" } "),i+=" if (!"+p+") { ",(I=I||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+x+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var S=i;i=I.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var j=d;if(j)for(var E=-1,A=j.length-1;E 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(0<=d.indexOf("object")||0<=d.indexOf("array")))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var g="checkDataType"+(m?"s":"");n+=" if ("+e.util[g](d,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",l&&(n+=" } "),n+=" if (!"+h+") { ";var v=v||[];v.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var b=n;n=v.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { ")}else f&&(n+=" if (true) { ");return n}},{}],39:[function(e,t,r){"use strict";t.exports=function(i,e,t){var r="",n=!0===i.schema.$async,a=i.util.schemaHasRulesExcept(i.schema,i.RULES.all,"$ref"),o=i.self._getId(i.schema);if(i.isTop&&(r+=" var validate = ",n&&(i.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(i.opts.sourceCode||i.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof i.schema||!a&&!i.schema.$ref){e="false schema";var s=i.level,c=i.dataLevel,u=i.schema[e],f=i.schemaPath+i.util.getProperty(e),p=i.errSchemaPath+"/"+e,h=!i.opts.allErrors,l="data"+(c||""),d="valid"+s;if(!1===i.schema){i.isTop?h=!0:r+=" var "+d+" = false; ",(W=W||[]).push(r),r="",!1!==i.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(p)+" , params: {} ",!1!==i.opts.messages&&(r+=" , message: 'boolean schema is false' "),i.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+i.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var m=r;r=W.pop(),!i.compositeRule&&h?i.async?r+=" throw new ValidationError(["+m+"]); ":r+=" validate.errors = ["+m+"]; return false; ":r+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else i.isTop?r+=n?" return data; ":" validate.errors = null; return true; ":r+=" var "+d+" = true; ";return i.isTop&&(r+=" }; return validate; "),r}if(i.isTop){var g=i.isTop;s=i.level=0,c=i.dataLevel=0,l="data";i.rootId=i.resolve.fullPath(i.self._getId(i.root.schema)),i.baseId=i.baseId||i.rootId,delete i.isTop,i.dataPathArr=[void 0],r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{s=i.level,l="data"+((c=i.dataLevel)||"");if(o&&(i.baseId=i.resolve.url(i.baseId,o)),n&&!i.async)throw new Error("async schema in sync schema");r+=" var errs_"+s+" = errors;"}d="valid"+s,h=!i.opts.allErrors;var v="",b="",y=i.schema.type,_=Array.isArray(y);if(_&&1==y.length&&(y=y[0],_=!1),i.schema.$ref&&a){if("fail"==i.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+i.errSchemaPath+'" (see option extendRefs)');!0!==i.opts.extendRefs&&(a=!1,i.logger.warn('$ref: keywords ignored in schema at path "'+i.errSchemaPath+'"'))}if(i.schema.$comment&&i.opts.$comment&&(r+=" "+i.RULES.all.$comment.code(i,"$comment")),y){if(i.opts.coerceTypes)var w=i.util.coerceToTypes(i.opts.coerceTypes,y);var k=i.RULES.types[y];if(w||_||!0===k||k&&!Z(k)){f=i.schemaPath+".type",p=i.errSchemaPath+"/type",f=i.schemaPath+".type",p=i.errSchemaPath+"/type";var x=_?"checkDataTypes":"checkDataType";if(r+=" if ("+i.util[x](y,l,!0)+") { ",w){var S="dataType"+s,j="coerced"+s;r+=" var "+S+" = typeof "+l+"; ","array"==i.opts.coerceTypes&&(r+=" if ("+S+" == 'object' && Array.isArray("+l+")) "+S+" = 'array'; "),r+=" var "+j+" = undefined; ";var E="",A=w;if(A)for(var I,P=-1,O=A.length-1;P>6],n=0==(32&r);if(31==(31&r)){var a=r;for(r=0;128==(128&a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function p(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)o++;(n=new u(2+o))[0]=a,n[1]=128|o;s=1+o;for(var c=i.length;0>=8)n[s]=255&c;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new u(2*e.length),i=0;i>=7)n++}var o=new u(n),s=o.length-1;for(i=e.length-1;0<=i;i--){a=e[i];for(o[s--]=127&a;0<(a>>=7);)o[s--]=128|127&a}return this._createEncoderBuffer(o)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[c(i.getFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(i.getFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.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&&!u.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new u(r)}if(u.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new u(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var a=e;256<=a;a>>=8)i++;for(a=(n=new Array(i)).length-1;0<=a;a--)n[a]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new u(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var a=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),a.length!==n.defaultBuffer.length)return!1;for(i=0;i=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0===(t&=127))throw c("Indefinite length not supported");if(4this._size-i)return null;if(this._offset=i,0===this.length)return t?a.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?n:n.toString("utf8")},i.prototype.readOID=function(e){e||(e=s.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],i=0,n=0;n>0),r.join(".")},i.prototype._readTag=function(e){o.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw c("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(4this._size-r)return null;this._offset=r;for(var i=this._buf[this._offset],n=0,a=0;a>0},t.exports=i},{"./errors":60,"./types":63,assert:67,"safer-buffer":448}],63:[function(e,t,r){t.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},{}],64:[function(e,t,r){var n=e("assert"),a=e("safer-buffer").Buffer,o=e("./types"),i=e("./errors").newInvalidAsn1Error,s={size:1024,growthFactor:8};function c(e){var r,i;r=s,i=e||{},n.ok(r),n.equal(void 0===r?"undefined":_typeof(r),"object"),n.ok(i),n.equal(void 0===i?"undefined":_typeof(i),"object"),Object.getOwnPropertyNames(r).forEach(function(e){if(!i[e]){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,t)}}),e=i,this._buf=a.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw i(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},c.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=o.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&1 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;0>>24,e<<=8},c.prototype.writeNull=function(){this.writeByte(o.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=o.Enumeration),this.writeInt(e,t)},c.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=o.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},c.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+(void 0===e?"undefined":_typeof(e))+")");"number"!=typeof t&&(t=o.OctetString);var r=a.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},c.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!a.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},c.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(e){t.writeString(e)})},c.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=o.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),i=[];i.push(40*parseInt(r[0],10)+parseInt(r[1],10)),r.slice(2).forEach(function(e){var t,r;t=i,(r=parseInt(e,10))<128?t.push(r):(r<16384?t.push(r>>>7|128):(r<2097152?t.push(r>>>14|128):(r<268435456?t.push(r>>>21|128):(t.push(255&(r>>>28|128)),t.push(255&(r>>>21|128))),t.push(255&(r>>>14|128))),t.push(255&(r>>>7|128))),t.push(127&r))});var n=this;this._ensure(2+i.length),this.writeByte(t),this.writeLength(i.length),i.forEach(function(e){n.writeByte(e)})},c.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw i("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},c.prototype.startSequence=function(e){"number"!=typeof e&&(e=o.Sequence|o.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw i("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},c.prototype._shift=function(e,t,r){n.ok(void 0!==e),n.ok(void 0!==t),n.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},c.prototype._ensure=function(e){if(n.ok(e),this._size-this._offset>16&255,a[o++]=t>>8&255,a[o++]=255&t;var u,f;2===n&&(t=p[e.charCodeAt(c)]<<2|p[e.charCodeAt(c+1)]>>4,a[o++]=255&t);1===n&&(t=p[e.charCodeAt(c)]<<10|p[e.charCodeAt(c+1)]<<4|p[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],a=0,o=r-i;a>2]+s[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],p=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,a=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return a.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},{}],76:[function(e,t,r){"use strict";var y=e("tweetnacl").lowlevel.crypto_hash,s=0,c=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};function n(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}function u(e,t){var r,i=0;for(r=0;r<4;r++,s++)t<=s&&(s=0),i=i<<8|e[s];return i}c.prototype.encipher=function(e,t){void 0===t&&(t=new Uint8Array(e.buffer),0!==e.byteOffset&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=n(this.S,t,0)^this.P[r],e[0]^=n(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i},c.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);0!==e.byteOffset&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;0>>24,r[4*i+2]=a[i]>>>16,r[4*i+1]=a[i]>>>8,r[4*i+0]=a[i]}t.exports={BLOCKS:f,HASHSIZE:32,hash:_,pbkdf:function(e,t,r,i,n,a,o){var s,c,u,f,p,h,l=new Uint8Array(64),d=new Uint8Array(64),m=new Uint8Array(32),g=new Uint8Array(32),v=new Uint8Array(i+4),b=a;if(o<1)return-1;if(0===t||0===i||0===a||a>m.byteLength*m.byteLength||1<<20>>24,v[i+1]=h>>>16,v[i+2]=h>>>8,v[i+3]=h,y(d,v,i+4),_(l,d,g),s=m.byteLength;s--;)m[s]=g[s];for(s=1;sa[o]^r?1:-1;return c==u?0:u=t&&e<=r}function J(e){return"[object Array]"==Object.prototype.toString.call(e)}function Q(e,t,r){for(var i,n,a=[0],o=0,s=e.length;or-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}function ee(e,t){return(1(r=e.length)){for(i="0",t-=r;--t;i+="0");e+=i}else tt;)u[n]=0,n||(++a,u.unshift(1));for(o=u.length;!u[--o];);for(p=0,e="";p<=o;e+=U.charAt(u[p++]));e=te(e,a)}return e}function P(e,t,r,i){var n,a,o,s,c;if(r=null!=r&&k(r,0,8,i,q)?0|r:b,!e.c)return e.toString();if(n=e.c[0],o=e.e,null==t)c=Z(e.c),c=19==i||24==i&&o<=h?ee(c,o):te(c,o);else if(a=(e=C(new I(e),t,r)).e,s=(c=Z(e.c)).length,19==i||24==i&&(t<=a||a<=h)){for(;sy?e.c=e.e=null:e.c=r=p.length){if(!i)break e;for(;p.length<=u;p.push(0));c=f=0,o=(a%=K)-K+(n=1)}else{for(c=s=p[u],n=1;10<=s;s/=10,n++);f=(o=(a%=K)-K+n)<0?0:c/h[n-o-1]%10|0}if(i=i||t<0||null!=p[u+1]||(o<0?c:c%h[n-o-1]),i=r<4?(f||i)&&(0==r||r==(e.s<0?3:2)):5y?e.c=e.e=null:e.er)return null!=(e=n[r++])};return o(t="DECIMAL_PLACES")&&k(e,0,$,2,t)&&(d=0|e),i[t]=d,o(t="ROUNDING_MODE")&&k(e,0,8,2,t)&&(b=0|e),i[t]=b,o(t="EXPONENTIAL_AT")&&(J(e)?k(e[0],-$,0,2,t)&&k(e[1],0,$,2,t)&&(h=0|e[0],l=0|e[1]):k(e,-$,$,2,t)&&(h=-(l=0|(e<0?-e:e)))),i[t]=[h,l],o(t="RANGE")&&(J(e)?k(e[0],-$,-1,2,t)&&k(e[1],1,$,2,t)&&(m=0|e[0],y=0|e[1]):k(e,-$,$,2,t)&&(0|e?m=-(y=0|(e<0?-e:e)):w&&B(2,t+" cannot be zero",e))),i[t]=[m,y],o(t="ERRORS")&&(e===!!e||1===e||0===e?(_=0,k=(w=!!e)?O:X):w&&B(2,t+N,e)),i[t]=w,o(t="CRYPTO")&&(e===!!e||1===e||0===e?(x=!(!e||!F||"object"!=(void 0===F?"undefined":_typeof(F))),e&&!x&&w&&B(2,"crypto unavailable",F)):w&&B(2,t+N,e)),i[t]=x,o(t="MODULO_MODE")&&k(e,0,9,2,t)&&(S=0|e),i[t]=S,o(t="POW_PRECISION")&&k(e,0,$,2,t)&&(j=0|e),i[t]=j,o(t="FORMAT")&&("object"==(void 0===e?"undefined":_typeof(e))?E=e:w&&B(2,t+" not an object",e)),i[t]=E,i},I.max=function(){return n(arguments,i.lt)},I.min=function(){return n(arguments,i.gt)},I.random=(r=9007199254740992,u=Math.random()*r&2097151?function(){return D(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,n,a,o=0,s=[],c=new I(v);if(e=null!=e&&k(e,0,$,14)?0|e:d,n=M(e/K),x)if(F&&F.getRandomValues){for(t=F.getRandomValues(new Uint32Array(n*=2));o>>11))?(r=F.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(s.push(a%1e14),o+=2);o=n/2}else if(F&&F.randomBytes){for(t=F.randomBytes(n*=7);ot[n]?1:-1;break}return a}function A(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r](x[s]||0)&&o--,k<0)l.push(1),c=!0;else{for(b=x.length,_=S.length,k+=2,1<(u=D(n/(S[s=0]+1)))&&(S=j(S,u,n),x=j(x,u,n),_=S.length,b=x.length),v=_,m=(d=x.slice(0,_)).length;m<_;d[m++]=0);(w=S.slice()).unshift(0),y=S[0],S[1]>=n/2&&y++;do{if(u=0,(a=E(S,d,_,m))<0){if(g=d[0],_!=m&&(g=g*n+(d[1]||0)),1<(u=D(g/y)))for(n<=u&&(u=n-1),p=(f=j(S,u,n)).length,m=d.length;1==E(f,d,p,m);)u--,A(f,_this.c.length-2},i.isNaN=function(){return!this.s},i.isNegative=i.isNeg=function(){return this.s<0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.lessThan=i.lt=function(e,t){return _=8,Y(this,new I(e,t))<0},i.lessThanOrEqualTo=i.lte=function(e,t){return _=9,-1===(t=Y(this,new I(e,t)))||0===t},i.minus=i.sub=function(e,t){var r,i,n,a,o=this,s=o.s;if(_=10,t=(e=new I(e,t)).s,!s||!t)return new I(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/K,u=e.e/K,f=o.c,p=e.c;if(!c||!u){if(!f||!p)return f?(e.s=-t,e):new I(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new I(f[0]?o:3==b?-0:0)}if(c=W(c),u=W(u),f=f.slice(),s=c-u){for((n=(a=s<0)?(s=-s,f):(u=c,p)).reverse(),t=s;t--;n.push(0));n.reverse()}else for(i=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;tt&&(t=this.e+1),t},i.round=function(e,t){var r=new I(this);return(null==e||k(e,0,$,15))&&C(r,~~e+this.e+1,null!=t&&k(t,0,8,15,q)?0|t:b),r},i.shift=function(e){var t=this;return k(e,-a,a,16,"argument")?t.times("1e"+re(e)):new I(t.c&&t.c[0]&&(e<-a||at&&(r.c.length=t)}if(!(i=D(i/2)))break;n=n.times(n),t&&n.c&&n.c.length>t&&(n.c.length=t)}return e<0&&(r=v.div(r)),t?C(r,j,b):r},i.toPrecision=function(e,t){return P(this,null!=e&&k(e,1,$,24,"precision")?0|e:null,t,24)},i.toString=function(e){var t,r=this.s,i=this.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=Z(this.c),t=null!=e&&k(e,2,64,25,"base")?A(te(t,i),0|e,10,r):i<=h||l<=i?ee(t,i):te(t,i),r<0&&this.c[0]&&(t="-"+t)),t},i.truncated=i.trunc=function(){return C(new I(this),this.e+1,1)},i.valueOf=i.toJSON=function(){return this.toString()},null!=t&&I.config(t),I}(),"function"==typeof define&&define.amd)define(function(){return t});else if(void 0!==i&&i.exports){if(i.exports=t,!F)try{F=r("crypto")}catch(e){}}else e.BigNumber=t}(this)},{crypto:204}],78:[function(i,n,e){(function(e,t){"use strict";var r=n.exports;r.version="v"+i("./package.json").version,r.versionGuard=function(e){if(void 0!==e){throw new Error("More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.")}},r.versionGuard(e._bitcore),e._bitcore=r.version,r.crypto={},r.crypto.BN=i("./lib/crypto/bn"),r.crypto.ECDSA=i("./lib/crypto/ecdsa"),r.crypto.Hash=i("./lib/crypto/hash"),r.crypto.Random=i("./lib/crypto/random"),r.crypto.Point=i("./lib/crypto/point"),r.crypto.Signature=i("./lib/crypto/signature"),r.encoding={},r.encoding.Base58=i("./lib/encoding/base58"),r.encoding.Base58Check=i("./lib/encoding/base58check"),r.encoding.BufferReader=i("./lib/encoding/bufferreader"),r.encoding.BufferWriter=i("./lib/encoding/bufferwriter"),r.encoding.Varint=i("./lib/encoding/varint"),r.util={},r.util.buffer=i("./lib/util/buffer"),r.util.js=i("./lib/util/js"),r.util.preconditions=i("./lib/util/preconditions"),r.errors=i("./lib/errors"),r.Address=i("./lib/address"),r.Block=i("./lib/block"),r.MerkleBlock=i("./lib/block/merkleblock"),r.BlockHeader=i("./lib/block/blockheader"),r.HDPrivateKey=i("./lib/hdprivatekey.js"),r.HDPublicKey=i("./lib/hdpublickey.js"),r.Networks=i("./lib/networks"),r.Opcode=i("./lib/opcode"),r.PrivateKey=i("./lib/privatekey"),r.PublicKey=i("./lib/publickey"),r.Script=i("./lib/script"),r.Transaction=i("./lib/transaction"),r.URI=i("./lib/uri"),r.Unit=i("./lib/unit"),r.deps={},r.deps.bnjs=i("bn.js"),r.deps.bs58=i("bs58"),r.deps.Buffer=t,r.deps.elliptic=i("elliptic"),r.deps._=i("lodash"),r._HDKeyCache=i("./lib/hdkeycache"),r.Transaction.sighash=i("./lib/transaction/sighash")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i("buffer").Buffer)},{"./lib/address":79,"./lib/block":82,"./lib/block/blockheader":81,"./lib/block/merkleblock":83,"./lib/crypto/bn":84,"./lib/crypto/ecdsa":85,"./lib/crypto/hash":86,"./lib/crypto/point":87,"./lib/crypto/random":88,"./lib/crypto/signature":89,"./lib/encoding/base58":90,"./lib/encoding/base58check":91,"./lib/encoding/bufferreader":92,"./lib/encoding/bufferwriter":93,"./lib/encoding/varint":94,"./lib/errors":95,"./lib/hdkeycache":97,"./lib/hdprivatekey.js":98,"./lib/hdpublickey.js":99,"./lib/networks":100,"./lib/opcode":101,"./lib/privatekey":102,"./lib/publickey":103,"./lib/script":104,"./lib/transaction":107,"./lib/transaction/sighash":115,"./lib/unit":119,"./lib/uri":120,"./lib/util/buffer":121,"./lib/util/js":122,"./lib/util/preconditions":123,"./package.json":150,"bn.js":124,bs58:125,buffer:191,elliptic:127,lodash:149}],79:[function(e,t,r){(function(a){"use strict";var n=e("lodash"),o=e("./util/preconditions"),i=e("./errors"),s=e("./encoding/base58check"),c=e("./networks"),r=e("./crypto/hash"),u=e("./util/js"),f=e("./publickey");function p(e,t,r){if(!(this instanceof p))return new p(e,t,r);if(n.isArray(e)&&n.isNumber(t))return p.createMultisig(e,t,r);if(e instanceof p)return e;if(o.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!c.get(t))throw new TypeError('Second argument must be "livenet" or "testnet".');if(r&&r!==p.PayToPublicKeyHash&&r!==p.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||c.get(t)||c.defaultNetwork,i.type=i.type||r||p.PayToPublicKeyHash,u.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}p.prototype._classifyArguments=function(e,t,r){if((e instanceof a||e instanceof Uint8Array)&&20===e.length)return p._transformHash(e);if((e instanceof a||e instanceof Uint8Array)&&21===e.length)return p._transformBuffer(e,t,r);if(e instanceof f)return p._transformPublicKey(e);if(e instanceof h)return p._transformScript(e,t);if("string"==typeof e)return p._transformString(e,t,r);if(n.isObject(e))return p._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")},p.PayToPublicKeyHash="pubkeyhash",p.PayToScriptHash="scripthash",p._transformHash=function(e){var t={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==e.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t},p._transformObject=function(e){return o.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),o.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?new a(e.hash,"hex"):e.hashBuffer,network:c.get(e.network)||c.defaultNetwork,type:e.type}},p._classifyFromVersion=function(e){var t={},r=c.get(e[0],"pubkeyhash"),i=c.get(e[0],"scripthash");return r?(t.network=r,t.type=p.PayToPublicKeyHash):i&&(t.network=i,t.type=p.PayToScriptHash),t},p._transformBuffer=function(e,t,r){var i={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==e.length)throw new TypeError("Address buffers must be exactly 21 bytes.");t=c.get(t);var n=p._classifyFromVersion(e);if(!n.network||t&&t!==n.network)throw new TypeError("Address has mismatched network type.");if(!n.type||r&&r!==n.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=n.network,i.type=n.type,i},p._transformPublicKey=function(e){var t={};if(!(e instanceof f))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=r.sha256ripemd160(e.toBuffer()),t.type=p.PayToPublicKeyHash,t},p._transformScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new i.Script.CantDeriveAddress(e);return r},p.createMultisig=function(e,t,r){return r=r||e[0].network||c.defaultNetwork,p.payingTo(h.buildMultisigOut(e,t),r)},p._transformString=function(e,t,r){if("string"!=typeof e)throw new TypeError("data parameter supplied is not a string.");e=e.trim();var i=s.decode(e);return p._transformBuffer(i,t,r)},p.fromPublicKey=function(e,t){var r=p._transformPublicKey(e);return t=t||c.defaultNetwork,new p(r.hashBuffer,t,r.type)},p.fromPublicKeyHash=function(e,t){return new p(p._transformHash(e).hashBuffer,t,p.PayToPublicKeyHash)},p.fromScriptHash=function(e,t){return o.checkArgument(e,"hash parameter is required"),new p(p._transformHash(e).hashBuffer,t,p.PayToScriptHash)},p.payingTo=function(e,t){return o.checkArgument(e,"script is required"),o.checkArgument(e instanceof h,"script must be instance of Script"),p.fromScriptHash(r.sha256ripemd160(e.toBuffer()),t)},p.fromScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=p._transformScript(e,t);return new p(r.hashBuffer,t,r.type)},p.fromBuffer=function(e,t,r){var i=p._transformBuffer(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromString=function(e,t,r){var i=p._transformString(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromObject=function(e){return o.checkState(u.isHexa(e.hash),'Unexpected hash property, "'+e.hash+'", expected to be hex.'),new p(new a(e.hash,"hex"),e.network,e.type)},p.getValidationError=function(e,t,r){var i;try{new p(e,t,r)}catch(e){i=e}return i},p.isValid=function(e,t,r){return!p.getValidationError(e,t,r)},p.prototype.isPayToPublicKeyHash=function(){return this.type===p.PayToPublicKeyHash},p.prototype.isPayToScriptHash=function(){return this.type===p.PayToScriptHash},p.prototype.toBuffer=function(){var e=new a([this.network[this.type]]);return a.concat([e,this.hashBuffer])},p.prototype.toObject=p.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},p.prototype.toString=function(){return s.encode(this.toBuffer())},p.prototype.inspect=function(){return""},t.exports=p;var h=e("./script")}).call(this,e("buffer").Buffer)},{"./crypto/hash":86,"./encoding/base58check":91,"./errors":95,"./networks":100,"./publickey":103,"./script":104,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],80:[function(t,l,e){(function(o){"use strict";var r=t("lodash"),n=t("./blockheader"),i=t("../crypto/bn"),a=t("../util/buffer"),s=t("../encoding/bufferreader"),c=t("../encoding/bufferwriter"),u=t("../crypto/hash"),f=t("../transaction"),p=t("../util/preconditions");function h(e){return this instanceof h?(r.extend(this,h._from(e)),this):new h(e)}h.MAX_BLOCK_SIZE=1e6,h._from=function(e){var t={};if(a.isBuffer(e))t=h._fromBufferReader(s(e));else{if(!r.isObject(e))throw new TypeError("Unrecognized argument for Block");t=h._fromObject(e)}return t},h._fromObject=function(e){var t=[];return e.transactions.forEach(function(e){e instanceof f?t.push(e):t.push(f().fromObject(e))}),{header:n.fromObject(e.header),transactions:t}},h.fromObject=function(e){return new h(h._fromObject(e))},h._fromBufferReader=function(e){var t={};p.checkState(!e.finished(),"No block data received"),t.header=n.fromBufferReader(e);var r=e.readVarintNum();t.transactions=[];for(var i=0;i"},h.Values={START_OF_BLOCK:8,NULL_HASH:new o("0000000000000000000000000000000000000000000000000000000000000000","hex")},l.exports=h}).call(this,t("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../transaction":107,"../util/buffer":121,"../util/preconditions":123,"./blockheader":81,buffer:191,lodash:149}],81:[function(f,p,e){(function(i){"use strict";var n=f("lodash"),a=f("../crypto/bn"),o=f("../util/buffer"),s=f("../encoding/bufferreader"),t=f("../encoding/bufferwriter"),r=f("../crypto/hash"),c=(f("../util/js"),f("../util/preconditions")),u=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&c.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};u._from=function(e){var t={};if(o.isBuffer(e))t=u._fromBufferReader(s(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for BlockHeader");t=u._fromObject(e)}return t},u._fromObject=function(e){c.checkArgument(e,"data is required");var t=e.prevHash,r=e.merkleRoot;return n.isString(e.prevHash)&&(t=o.reverse(new i(e.prevHash,"hex"))),n.isString(e.merkleRoot)&&(r=o.reverse(new i(e.merkleRoot,"hex"))),{hash:e.hash,version:e.version,prevHash:t,merkleRoot:r,time:e.time,timestamp:e.time,bits:e.bits,nonce:e.nonce}},u.fromObject=function(e){var t=u._fromObject(e);return new u(t)},u.fromRawBlock=function(e){o.isBuffer(e)||(e=new i(e,"binary"));var t=s(e);t.pos=u.Constants.START_OF_HEADER;var r=u._fromBufferReader(t);return new u(r)},u.fromBuffer=function(e){var t=u._fromBufferReader(s(e));return new u(t)},u.fromString=function(e){var t=new i(e,"hex");return u.fromBuffer(t)},u._fromBufferReader=function(e){var t={};return t.version=e.readUInt32LE(),t.prevHash=e.read(32),t.merkleRoot=e.read(32),t.time=e.readUInt32LE(),t.bits=e.readUInt32LE(),t.nonce=e.readUInt32LE(),t},u.fromBufferReader=function(e){var t=u._fromBufferReader(e);return new u(t)},u.prototype.toObject=u.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:o.reverse(this.prevHash).toString("hex"),merkleRoot:o.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},u.prototype.toBuffer=function(){return this.toBufferWriter().concat()},u.prototype.toString=function(){return this.toBuffer().toString("hex")},u.prototype.toBufferWriter=function(e){return e||(e=new t),e.writeUInt32LE(this.version),e.write(this.prevHash),e.write(this.merkleRoot),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e},u.prototype.getTargetDifficulty=function(e){e=e||this.bits;for(var t=new a(16777215&e),r=8*((e>>>24)-3);0e+u.Constants.MAX_TIME_OFFSET)},u.prototype.validProofOfWork=function(){var e=new a(this.id,"hex"),t=this.getTargetDifficulty();return!(0"},u.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new a("10000000000000000000000000000000000000000000000000000000000000000","hex")},p.exports=u}).call(this,f("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],82:[function(e,t,r){t.exports=e("./block"),t.exports.BlockHeader=e("./blockheader"),t.exports.MerkleBlock=e("./merkleblock")},{"./block":80,"./blockheader":81,"./merkleblock":83}],83:[function(e,t,r){(function(s){"use strict";var n=e("lodash"),a=e("./blockheader"),o=e("../util/buffer"),r=e("../encoding/bufferreader"),i=e("../encoding/bufferwriter"),c=e("../crypto/hash"),u=(e("../util/js"),e("../transaction")),f=e("../util/preconditions");function p(e){if(!(this instanceof p))return new p(e);var t={};if(o.isBuffer(e))t=p._fromBufferReader(r(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for MerkleBlock");t={header:e.header instanceof a?e.header:a.fromObject(e.header),numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}return n.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}p.fromBuffer=function(e){return p.fromBufferReader(r(e))},p.fromBufferReader=function(e){return new p(p._fromBufferReader(e))},p.prototype.toBuffer=function(){return this.toBufferWriter().concat()},p.prototype.toBufferWriter=function(e){e||(e=new i),e.write(this.header.toBuffer()),e.writeUInt32LE(this.numTransactions),e.writeVarintNum(this.hashes.length);for(var t=0;tthis.numTransactions)return!1;if(8*this.flags.length8*this.flags.length)return null;var i=this.flags[r.flagBitsUsed>>3]>>>(7&r.flagBitsUsed++)&1;if(0!==e&&i){var n=this._traverseMerkleTree(e-1,2*t,r),a=n;return 2*t+1=this.hashes.length)return null;var o=this.hashes[r.hashesUsed++];return 0===e&&i&&r.txs.push(o),new s(o,"hex")},p.prototype._calcTreeWidth=function(e){return this.numTransactions+(1<>e},p.prototype._calcTreeHeight=function(){for(var e=0;1e.size?t=n.trim(t,i):i>1,o=d.getN(),s=d.getG(),c=a?r.add(o):r,u=d.fromX(n,c);if(!u.mul(o).isInfinity())throw new Error("nR is not a valid curve point");var f=t.neg().mod(o),p=r.invm(o),h=u.mul(i).add(s.mul(f)).mul(p);return m.fromPoint(h,this.sig.compressed)},h.prototype.sigError=function(){if(!f.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s;if(!(e.gt(l.Zero)&&e.lt(d.getN())&&t.gt(l.Zero)&&t.lt(d.getN())))return"r and s not in range";var r=l.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),i=d.getN(),n=t.invm(i),a=n.mul(r).mod(i),o=n.mul(e).mod(i),s=d.getG().mulAdd(a,this.pubkey.point,o);return s.isInfinity()?"p is infinity":0!==s.getX().mod(i).cmp(e)&&"Invalid signature"},h.toLowS=function(e){return e.gt(l.fromBuffer(new c("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=d.getN().sub(e)),e},h.prototype._findSignature=function(e,t){for(var r,i,n,a=d.getN(),o=d.getG(),s=0;(!this.k||0i)r=e(r);else if(r>>=8)}return r},e.exports=r}).call(this,i("_process"),i("buffer").Buffer)},{_process:382,buffer:191,crypto:204}],89:[function(e,r,t){(function(u){"use strict";var g=e("./bn"),v=e("lodash"),b=e("../util/preconditions"),y=e("../util/buffer"),t=e("../util/js"),o=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof g)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};o.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=void 0!==e.i?e.i:this.i,this.compressed=void 0!==e.compressed?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this},o.fromCompact=function(e){b.checkArgument(y.isBuffer(e),"Argument is expected to be a Buffer");var t=new o,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i+=4);var n=e.slice(1,33),a=e.slice(33,65);return b.checkArgument(0===i||1===i||2===i||3===i,new Error("i must be 0, 1, 2, or 3")),b.checkArgument(32===n.length,new Error("r must be 32 bytes")),b.checkArgument(32===a.length,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=g.fromBuffer(n),t.s=g.fromBuffer(a),t},o.fromDER=o.fromBuffer=function(e,t){var r=o.parseDER(e,t),i=new o;return i.r=r.r,i.s=r.s,i},o.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=new o.fromDER(r,!1);return i.nhashtype=t,i},o.fromString=function(e){var t=new u(e,"hex");return o.fromDER(t)},o.parseDER=function(e,t){b.checkArgument(y.isBuffer(e),new Error("DER formatted signature should be a buffer")),v.isUndefined(t)&&(t=!0);var r=e[0];b.checkArgument(48===r,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;b.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(2!==e[2])return!1;if(0===t)return!1;if(128&i[0])return!1;if(1=this.buf.length},e.prototype.read=function(e){r.checkArgument(!n.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t},e.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e},e.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e},e.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=o.fromBuffer(e);return this.pos=this.pos+8,t},e.prototype.readUInt64LEBN=function(){var e,t=this.buf.readUInt32LE(this.pos),r=4294967296*this.buf.readUInt32LE(this.pos+4)+t;if(r<=9007199254740991)e=new o(r);else{var i=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);e=new o(i,10,"le")}return this.pos=this.pos+8,e},e.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN().toNumber();if(t<=Math.pow(2,53))return t;throw new Error("number too large to retain precision - use readVarintBN");default:return e}},e.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return r.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t},e.prototype.readVarintBuf=function(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},e.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new o(this.readUInt16LE());case 254:return new o(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new o(e)}},e.prototype.reverse=function(){for(var e=new i(this.buf.length),t=0;t"},k.prototype.toObject=k.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:_.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},k.fromBuffer=function(e){return new k(e.toString())},k.prototype.toBuffer=function(){return _.copy(this._buffers.xprivkey)},k.DefaultDepth=0,k.DefaultFingerprint=0,k.DefaultChildIndex=0,k.MaxIndex=2*(k.Hardened=2147483648),k.RootElementAlias=["m","M","m'","M'"],k.VersionSize=4,k.DepthSize=1,k.ParentFingerPrintSize=4,k.ChildIndexSize=4,k.ChainCodeSize=32,k.PrivateKeySize=32,k.CheckSumSize=4,k.DataLength=78,k.SerializedByteSize=82,n((k.ChecksumEnd=(k.ChecksumStart=k.PrivateKeyEnd=(k.PrivateKeyStart=(k.ChainCodeEnd=(k.ChainCodeStart=k.ChildIndexEnd=(k.ChildIndexStart=k.ParentFingerPrintEnd=(k.ParentFingerPrintStart=k.DepthEnd=(k.DepthStart=k.VersionEnd=(k.VersionStart=0)+k.VersionSize)+k.DepthSize)+k.ParentFingerPrintSize)+k.ChildIndexSize)+k.ChainCodeSize)+1)+k.PrivateKeySize)+k.CheckSumSize)===k.SerializedByteSize),e.exports=k}).call(this,o("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./crypto/random":88,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdpublickey":99,"./networks":100,"./privatekey":102,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],99:[function(i,s,e){(function(u){"use strict";var n=i("lodash"),t=i("./util/preconditions"),f=i("./crypto/bn"),a=i("./encoding/base58"),p=i("./encoding/base58check"),h=i("./crypto/hash"),r=i("./hdprivatekey"),l=i("./hdkeycache"),d=i("./networks"),m=i("./crypto/point"),g=i("./publickey"),e=i("./errors"),v=e,b=e.HDPublicKey,o=i("assert"),y=i("./util/js"),_=i("./util/buffer");function w(e){if(e instanceof w)return e;if(!(this instanceof w))return new w(e);if(e){if(n.isString(e)||_.isBuffer(e)){var t=w.getSerializedError(e);if(t){if(_.isBuffer(e)&&!w.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof b.ArgumentIsPrivateExtended)return new r(e).hdPublicKey;throw t}return this._buildFromSerialized(e)}if(n.isObject(e))return e instanceof r?this._buildFromPrivate(e):this._buildFromObject(e);throw new b.UnrecognizedArgument(e)}throw new b.MustSupplyArgument}w.isValidPath=function(e){if(n.isString(e)){var t=r._getDerivationIndexes(e);return null!==t&&n.all(t,w.isValidPath)}return!!n.isNumber(e)&&(0<=e&&e"},w.prototype.toObject=w.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version)).name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:_.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},w.fromBuffer=function(e){return new w(e)},w.prototype.toBuffer=function(){return _.copy(this._buffers.xpubkey)},w.Hardened=2147483648,w.RootElementAlias=["m","M"],w.VersionSize=4,w.DepthSize=1,w.ParentFingerPrintSize=4,w.ChildIndexSize=4,w.ChainCodeSize=32,w.PublicKeySize=33,w.CheckSumSize=4,w.DataSize=78,w.SerializedByteSize=82,w.ChecksumEnd=(w.ChecksumStart=w.PublicKeyEnd=(w.PublicKeyStart=w.ChainCodeEnd=(w.ChainCodeStart=w.ChildIndexEnd=(w.ChildIndexStart=w.ParentFingerPrintEnd=(w.ParentFingerPrintStart=w.DepthEnd=(w.DepthStart=w.VersionEnd=(w.VersionStart=0)+w.VersionSize)+w.DepthSize)+w.ParentFingerPrintSize)+w.ChildIndexSize)+w.ChainCodeSize)+w.PublicKeySize)+w.CheckSumSize,o(w.PublicKeyEnd===w.DataSize),o(w.ChecksumEnd===w.SerializedByteSize),s.exports=w}).call(this,i("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdprivatekey":98,"./networks":100,"./publickey":103,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],100:[function(e,t,r){"use strict";var n=e("lodash"),i=e("./util/buffer"),a=e("./util/js"),o=[],s={};function c(){}function u(t,e){if(~o.indexOf(t))return t;if(!e)return s[t];n.isArray(e)||(e=[e]);var r=function(e){return o[i][e]===t};for(var i in o)if(n.any(e,r))return o[i]}function f(e){var t=new c;return a.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey}),e.networkMagic&&a.defineImmutable(t,{networkMagic:i.integerAsBuffer(e.networkMagic)}),e.port&&a.defineImmutable(t,{port:e.port}),e.dnsSeeds&&a.defineImmutable(t,{dnsSeeds:e.dnsSeeds}),n.each(t,function(e){n.isUndefined(e)||n.isObject(e)||(s[e]=t)}),o.push(t),t}c.prototype.toString=function(){return this.name},f({name:"livenet",alias:"mainnet",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var p=u("livenet");f({name:"testnet",alias:"regtest",pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956});var h=u("testnet"),l={PORT:18333,NETWORK_MAGIC:i.integerAsBuffer(185665799),DNS_SEEDS:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]};for(var d in l)n.isObject(l[d])||(s[l[d]]=h);var m={PORT:18444,NETWORK_MAGIC:i.integerAsBuffer(4206867930),DNS_SEEDS:[]};for(var d in m)n.isObject(m[d])||(s[m[d]]=h);Object.defineProperty(h,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.PORT:l.PORT}}),Object.defineProperty(h,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.NETWORK_MAGIC:l.NETWORK_MAGIC}}),Object.defineProperty(h,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.DNS_SEEDS:l.DNS_SEEDS}}),t.exports={add:f,remove:function(e){for(var t=0;t=a.map.OP_1&&e<=a.map.OP_16},a.prototype.inspect=function(){return""},c.exports=a}).call(this,s("buffer").Buffer)},{"./util/buffer":121,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],102:[function(h,l,e){(function(i){"use strict";var n=h("lodash"),r=h("./address"),a=h("./encoding/base58check"),o=h("./crypto/bn"),s=h("./util/js"),c=h("./networks"),u=h("./crypto/point"),e=h("./publickey"),f=h("./crypto/random"),t=h("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(e instanceof p)return e;var r=this._classifyArguments(e,t);if(!r.bn||0===r.bn.cmp(new o(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(u.getN()))throw new TypeError("Number must be less than N");if(void 0===r.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return s.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}p.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?c.get(t):c.defaultNetwork};if(n.isUndefined(e)||n.isNull(e))r.bn=p._getRandomBN();else if(e instanceof o)r.bn=e;else if(e instanceof i||e instanceof Uint8Array)r=p._transformBuffer(e,t);else if(e.bn&&e.network)r=p._transformObject(e);else if(!t&&c.get(e))r.bn=p._getRandomBN(),r.network=c.get(e);else{if("string"!=typeof e)throw new TypeError("First argument is an unrecognized data type.");s.isHexa(e)?r.bn=new o(new i(e,"hex")):r=p._transformWIF(e,t)}return r},p._getRandomBN=function(){var e,t;do{var r=f.getRandomBuffer(32);e=(t=o.fromBuffer(r)).lt(u.getN())}while(!e);return t},p._transformBuffer=function(e,t){var r={};if(32===e.length)return p._transformBNBuffer(e,t);if(r.network=c.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==c.get(t))throw new TypeError("Private key network mismatch");if(34===e.length&&1===e[33])r.compressed=!0;else{if(33!==e.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");r.compressed=!1}return r.bn=o.fromBuffer(e.slice(1,33)),r},p._transformBNBuffer=function(e,t){var r={};return r.network=c.get(t)||c.defaultNetwork,r.bn=o.fromBuffer(e),r.compressed=!1,r},p._transformWIF=function(e,t){return p._transformBuffer(a.decode(e),t)},p.fromBuffer=function(e,t){return new p(e,t)},p._transformObject=function(e){return{bn:new o(e.bn,"hex"),network:c.get(e.network),compressed:e.compressed}},p.fromString=p.fromWIF=function(e){return t.checkArgument(n.isString(e),"First argument is expected to be a string."),new p(e)},p.fromObject=function(e){return t.checkArgument(n.isObject(e),"First argument is expected to be an object."),new p(e)},p.fromRandom=function(e){return new p(p._getRandomBN(),e)},p.getValidationError=function(e,t){var r;try{new p(e,t)}catch(e){r=e}return r},p.isValid=function(e,t){return!!e&&!p.getValidationError(e,t)},p.prototype.toString=function(){return this.toBuffer().toString("hex")},p.prototype.toWIF=function(){var e,t=this.network;return e=this.compressed?i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32}),new i([1])]):i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32})]),a.encode(e)},p.prototype.toBigNumber=function(){return this.bn},p.prototype.toBuffer=function(){return this.bn.toBuffer()},p.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=e.fromPrivateKey(this)),this._pubkey},p.prototype.toAddress=function(e){var t=this.toPublicKey();return r.fromPublicKey(t,e||this.network)},p.prototype.toObject=p.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},p.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return""},l.exports=p}).call(this,h("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/point":87,"./crypto/random":88,"./encoding/base58check":91,"./networks":100,"./publickey":103,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],103:[function(t,r,e){(function(o){"use strict";var s=t("./crypto/bn"),c=t("./crypto/point"),e=t("./crypto/hash"),i=t("./util/js"),n=t("./networks"),u=t("lodash"),f=t("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(f.checkArgument(e,"First argument is required, please include public key data."),e instanceof p)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),i.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||n.defaultNetwork}),this}p.prototype._classifyArgs=function(e,t){var r={compressed:u.isUndefined(t.compressed)||t.compressed};if(e instanceof c)r.point=e;else if(e.x&&e.y)r=p._transformObject(e);else if("string"==typeof e)r=p._transformDER(new o(e,"hex"));else if(p._isBuffer(e))r=p._transformDER(e);else{if(!p._isPrivateKey(e))throw new TypeError("First argument is an unrecognized data format.");r=p._transformPrivateKey(e)}return r.network||(r.network=u.isUndefined(t.network)?void 0:n.get(t.network)),r},p._isPrivateKey=function(e){return e instanceof t("./privatekey")},p._isBuffer=function(e){return e instanceof o||e instanceof Uint8Array},p._transformPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=c.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t},p._transformDER=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r,i,n,a,o={};if(t=!!u.isUndefined(t)||t,4!==e[0]&&(t||6!==e[0]&&7!==e[0]))if(3===e[0])n=e.slice(1),r=new s(n),(o=p._transformX(!0,r)).compressed=!0;else{if(2!==e[0])throw new TypeError("Invalid DER format public key");n=e.slice(1),r=new s(n),(o=p._transformX(!1,r)).compressed=!0}else{if(n=e.slice(1,33),a=e.slice(33,65),32!==n.length||32!==a.length||65!==e.length)throw new TypeError("Length of x and y must be 32 bytes");r=new s(n),i=new s(a),o.point=new c(r,i),o.compressed=!1}return o},p._transformX=function(e,t){f.checkArgument("boolean"==typeof e,"Must specify whether y is odd or not (true or false)");var r={};return r.point=c.fromX(e,t),r},p._transformObject=function(e){var t=new s(e.x,"hex"),r=new s(e.y,"hex");return new p(new c(t,r),{compressed:e.compressed})},p.fromPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t=p._transformPrivateKey(e);return new p(t.point,{compressed:t.compressed,network:t.network})},p.fromDER=p.fromBuffer=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r=p._transformDER(e,t);return new p(r.point,{compressed:r.compressed})},p.fromPoint=function(e,t){return f.checkArgument(e instanceof c,"First argument must be an instance of Point."),new p(e,{compressed:t})},p.fromString=function(e,t){var r=new o(e,t||"hex"),i=p._transformDER(r);return new p(i.point,{compressed:i.compressed})},p.fromX=function(e,t){var r=p._transformX(e,t);return new p(r.point,{compressed:r.compressed})},p.getValidationError=function(e){var t;try{new p(e)}catch(e){t=e}return t},p.isValid=function(e){return!p.getValidationError(e)},p.prototype.toObject=p.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},p.prototype.toBuffer=p.prototype.toDER=function(){var e,t=this.point.getX(),r=this.point.getY(),i=t.toBuffer({size:32}),n=r.toBuffer({size:32});if(this.compressed){var a=n[n.length-1]%2;return e=new o(a?[3]:[2]),o.concat([e,i])}return e=new o([4]),o.concat([e,i,n])},p.prototype._getID=function(){return e.sha256ripemd160(this.toBuffer())},p.prototype.toAddress=function(e){return t("./address").fromPublicKey(this,e||this.network)},p.prototype.toString=function(){return this.toDER().toString("hex")},p.prototype.inspect=function(){return""},r.exports=p}).call(this,t("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./networks":100,"./privatekey":102,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],104:[function(e,t,r){t.exports=e("./script"),t.exports.Interpreter=e("./interpreter")},{"./interpreter":105,"./script":106}],105:[function(p,t,e){(function(e){"use strict";var R=p("lodash"),z=p("./script"),M=p("../opcode"),D=p("../crypto/bn"),N=p("../crypto/hash"),q=p("../crypto/signature"),L=p("../publickey"),U=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};U.prototype.verify=function(e,t,r,i,n){var a,o=p("../transaction");if(R.isUndefined(r)&&(r=new o),R.isUndefined(i)&&(i=0),R.isUndefined(n)&&(n=0),this.set({script:e,tx:r,nin:i,flags:n}),0!=(n&U.SCRIPT_VERIFY_SIGPUSHONLY)&&!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(!this.evaluate())return!1;n&U.SCRIPT_VERIFY_P2SH&&(a=this.stack.slice());var s=this.stack;if(this.initialize(),this.set({script:t,stack:s,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(0===this.stack.length)return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT");var c=this.stack[this.stack.length-1];if(!U.castToBool(c))return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK");if(n&U.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(0===a.length)throw new Error("internal error - stack copy empty");var u=a[a.length-1],f=z.fromBuffer(u);return a.pop(),this.initialize(),this.set({script:f,stack:a,tx:r,nin:i,flags:n}),!!this.evaluate()&&(0===a.length?!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK"):!!U.castToBool(a[a.length-1])||!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK"))}return!0},(t.exports=U).prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},U.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=void 0!==e.nin?e.nin:this.nin,this.stack=e.stack||this.stack,this.altstack=e.altack||this.altstack,this.pc=void 0!==e.pc?e.pc:this.pc,this.pbegincodehash=void 0!==e.pbegincodehash?e.pbegincodehash:this.pbegincodehash,this.nOpCount=void 0!==e.nOpCount?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=void 0!==e.flags?e.flags:this.flags},U.true=new e([1]),U.false=new e([]),U.MAX_SCRIPT_ELEMENT_SIZE=520,U.LOCKTIME_THRESHOLD_BN=new D(U.LOCKTIME_THRESHOLD=5e8),U.SCRIPT_VERIFY_NONE=0,U.SCRIPT_VERIFY_P2SH=1,U.SCRIPT_VERIFY_STRICTENC=2,U.SCRIPT_VERIFY_DERSIG=4,U.SCRIPT_VERIFY_LOW_S=8,U.SCRIPT_VERIFY_NULLDUMMY=16,U.SCRIPT_VERIFY_SIGPUSHONLY=32,U.SCRIPT_VERIFY_MINIMALDATA=64,U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,U.castToBool=function(e){for(var t=0;t=U.LOCKTIME_THRESHOLD&&e.gte(U.LOCKTIME_THRESHOLD_BN))&&(!e.gt(new D(this.tx.nLockTime))&&!!this.tx.inputs[this.nin].isFinal())},U.prototype.step=function(){var e,t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g,v=0!=(this.flags&U.SCRIPT_VERIFY_MINIMALDATA),b=-1===this.vfExec.indexOf(!1),y=this.script.chunks[this.pc];this.pc++;var _=y.opcodenum;if(R.isUndefined(_))return!(this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE");if(y.buf&&y.buf.length>U.MAX_SCRIPT_ELEMENT_SIZE)return!(this.errstr="SCRIPT_ERR_PUSH_SIZE");if(_>M.OP_16&&201<++this.nOpCount)return!(this.errstr="SCRIPT_ERR_OP_COUNT");if(_===M.OP_CAT||_===M.OP_SUBSTR||_===M.OP_LEFT||_===M.OP_RIGHT||_===M.OP_INVERT||_===M.OP_AND||_===M.OP_OR||_===M.OP_XOR||_===M.OP_2MUL||_===M.OP_2DIV||_===M.OP_MUL||_===M.OP_DIV||_===M.OP_MOD||_===M.OP_LSHIFT||_===M.OP_RSHIFT)return!(this.errstr="SCRIPT_ERR_DISABLED_OPCODE");if(b&&0<=_&&_<=M.OP_PUSHDATA4){if(v&&!this.script.checkMinimalPush(this.pc-1))return!(this.errstr="SCRIPT_ERR_MINIMALDATA");if(y.buf){if(y.len!==y.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(y.buf)}else this.stack.push(U.false)}else if(b||M.OP_IF<=_&&_<=M.OP_ENDIF)switch(_){case M.OP_1NEGATE:case M.OP_1:case M.OP_2:case M.OP_3:case M.OP_4:case M.OP_5:case M.OP_6:case M.OP_7:case M.OP_8:case M.OP_9:case M.OP_10:case M.OP_11:case M.OP_12:case M.OP_13:case M.OP_14:case M.OP_15:case M.OP_16:n=_-(M.OP_1-1),e=new D(n).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_NOP:break;case M.OP_NOP2:case M.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break}if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");var w=D.fromScriptNumBuffer(this.stack[this.stack.length-1],v,5);if(w.lt(new D(0)))return!(this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME");if(!this.checkLockTime(w))return!(this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME");break;case M.OP_NOP1:case M.OP_NOP3:case M.OP_NOP4:case M.OP_NOP5:case M.OP_NOP6:case M.OP_NOP7:case M.OP_NOP8:case M.OP_NOP9:case M.OP_NOP10:if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break;case M.OP_IF:case M.OP_NOTIF:if(m=!1,b){if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");e=this.stack.pop(),m=U.castToBool(e),_===M.OP_NOTIF&&(m=!m)}this.vfExec.push(m);break;case M.OP_ELSE:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case M.OP_ENDIF:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec.pop();break;case M.OP_VERIFY:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],!(m=U.castToBool(e)))return!(this.errstr="SCRIPT_ERR_VERIFY");this.stack.pop();break;case M.OP_RETURN:return!(this.errstr="SCRIPT_ERR_OP_RETURN");case M.OP_TOALTSTACK:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.altstack.push(this.stack.pop());break;case M.OP_FROMALTSTACK:if(this.altstack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION");this.stack.push(this.altstack.pop());break;case M.OP_2DROP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop(),this.stack.pop();break;case M.OP_2DUP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1],this.stack.push(t),this.stack.push(r);break;case M.OP_3DUP:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-3],r=this.stack[this.stack.length-2];var k=this.stack[this.stack.length-1];this.stack.push(t),this.stack.push(r),this.stack.push(k);break;case M.OP_2OVER:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-4],r=this.stack[this.stack.length-3],this.stack.push(t),this.stack.push(r);break;case M.OP_2ROT:if(this.stack.length<6)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-6,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_2SWAP:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-4,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_IFDUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-1],(m=U.castToBool(e))&&this.stack.push(e);break;case M.OP_DEPTH:e=new D(this.stack.length).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_DROP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop();break;case M.OP_DUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-1]);break;case M.OP_NIP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,1);break;case M.OP_OVER:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-2]);break;case M.OP_PICK:case M.OP_ROLL:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],n=(s=D.fromScriptNumBuffer(e,v)).toNumber(),this.stack.pop(),n<0||n>=this.stack.length)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-n-1],_===M.OP_ROLL&&this.stack.splice(this.stack.length-n-1,1),this.stack.push(e);break;case M.OP_ROT:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-3],o=this.stack[this.stack.length-2];var x=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=o,this.stack[this.stack.length-2]=x,this.stack[this.stack.length-1]=a;break;case M.OP_SWAP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-2],o=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=o,this.stack[this.stack.length-1]=a;break;case M.OP_TUCK:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case M.OP_SIZE:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");s=new D(this.stack[this.stack.length-1].length),this.stack.push(s.toScriptNumBuffer());break;case M.OP_EQUAL:case M.OP_EQUALVERIFY:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1];var S=t.toString("hex")===r.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(S?U.true:U.false),_===M.OP_EQUALVERIFY){if(!S)return!(this.errstr="SCRIPT_ERR_EQUALVERIFY");this.stack.pop()}break;case M.OP_1ADD:case M.OP_1SUB:case M.OP_NEGATE:case M.OP_ABS:case M.OP_NOT:case M.OP_0NOTEQUAL:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(e=this.stack[this.stack.length-1],s=D.fromScriptNumBuffer(e,v),_){case M.OP_1ADD:s=s.add(D.One);break;case M.OP_1SUB:s=s.sub(D.One);break;case M.OP_NEGATE:s=s.neg();break;case M.OP_ABS:s.cmp(D.Zero)<0&&(s=s.neg());break;case M.OP_NOT:s=new D((0===s.cmp(D.Zero))+0);break;case M.OP_0NOTEQUAL:s=new D((0!==s.cmp(D.Zero))+0)}this.stack.pop(),this.stack.push(s.toScriptNumBuffer());break;case M.OP_ADD:case M.OP_SUB:case M.OP_BOOLAND:case M.OP_BOOLOR:case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:case M.OP_NUMNOTEQUAL:case M.OP_LESSTHAN:case M.OP_GREATERTHAN:case M.OP_LESSTHANOREQUAL:case M.OP_GREATERTHANOREQUAL:case M.OP_MIN:case M.OP_MAX:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(c=D.fromScriptNumBuffer(this.stack[this.stack.length-2],v),u=D.fromScriptNumBuffer(this.stack[this.stack.length-1],v),s=new D(0),_){case M.OP_ADD:s=c.add(u);break;case M.OP_SUB:s=c.sub(u);break;case M.OP_BOOLAND:s=new D((0!==c.cmp(D.Zero)&&0!==u.cmp(D.Zero))+0);break;case M.OP_BOOLOR:s=new D((0!==c.cmp(D.Zero)||0!==u.cmp(D.Zero))+0);break;case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:s=new D((0===c.cmp(u))+0);break;case M.OP_NUMNOTEQUAL:s=new D((0!==c.cmp(u))+0);break;case M.OP_LESSTHAN:s=new D((c.cmp(u)<0)+0);break;case M.OP_GREATERTHAN:s=new D((0"},v.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==c.OP_DUP||this.chunks[1].opcodenum!==c.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==c.OP_EQUALVERIFY||this.chunks[4].opcodenum!==c.OP_CHECKSIG)},v.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&48===e[0]&&t&&t.length){var r=t[0];if((4===r||6===r||7===r)&&65===t.length)return!0;if((3===r||2===r)&&33===t.length)return!0}}return!1},v.prototype.getPublicKey=function(){return p.checkState(this.isPublicKeyOut(),"Can't retreive PublicKey from a non-PK output"),this.chunks[0].buf},v.prototype.getPublicKeyHash=function(){return p.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},v.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===c.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if((4!==t&&6!==t&&7!==t||65!==e.length)&&(3!==t&&2!==t||33!==e.length)||(r=!0),r)return u.isValid(e)}return!1},v.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var e=this.chunks[0].buf;if(e&&e.length&&48===e[0])return!0}return!1},v.prototype.isScriptHashOut=function(){var e=this.toBuffer();return 23===e.length&&e[0]===c.OP_HASH160&&20===e[1]&&e[e.length-1]===c.OP_EQUAL},v.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e,t=this.chunks[this.chunks.length-1].buf;if(!t)return!1;try{e=v.fromBuffer(t)}catch(e){if(e instanceof l.Script.InvalidBuffer)return!1;throw e}return e.classify()!==v.types.UNKNOWN},v.prototype.isMultisigOut=function(){return 3=c.OP_1&&e<=c.OP_16)return e-(c.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))},v.prototype.getSignatureOperationsCount=function(r){r=!!h.isUndefined(r)||r;var i=this,n=0,a=c.OP_INVALIDOPCODE;return h.each(i.chunks,function(e){var t=e.opcodenum;t==c.OP_CHECKSIG||t==c.OP_CHECKSIGVERIFY?n++:t!=c.OP_CHECKMULTISIG&&t!=c.OP_CHECKMULTISIGVERIFY||(r&&a>=c.OP_1&&a<=c.OP_16?n+=i._decodeOP_N(a):n+=20),a=t}),n},t.exports=v}).call(this,e("buffer").Buffer)},{"../address":79,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../networks":100,"../opcode":101,"../publickey":103,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],107:[function(e,t,r){t.exports=e("./transaction"),t.exports.Input=e("./input"),t.exports.Output=e("./output"),t.exports.UnspentOutput=e("./unspentoutput"),t.exports.Signature=e("./signature"),t.exports.Sighash=e("./sighash")},{"./input":108,"./output":114,"./sighash":115,"./signature":116,"./transaction":117,"./unspentoutput":118}],108:[function(e,t,r){t.exports=e("./input"),t.exports.PublicKey=e("./publickey"),t.exports.PublicKeyHash=e("./publickeyhash"),t.exports.MultiSig=e("./multisig.js"),t.exports.MultiSigScriptHash=e("./multisigscripthash.js")},{"./input":109,"./multisig.js":110,"./multisigscripthash.js":111,"./publickey":112,"./publickeyhash":113}],109:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../../util/preconditions"),a=e("../../errors"),o=e("../../encoding/bufferwriter"),s=e("buffer"),c=e("../../util/buffer"),u=e("../../util/js"),f=e("../../script"),p=e("../sighash"),h=e("../output"),l=4294967295;function d(e){return this instanceof d?e?this._fromObject(e):void 0:new d(e)}d.MAXINT=l,d.DEFAULT_SEQNUMBER=4294967295,d.DEFAULT_LOCKTIME_SEQNUMBER=4294967294,d.DEFAULT_RBF_SEQNUMBER=4294967293,Object.defineProperty(d.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new f(this._scriptBuffer),this._script._isInput=!0),this._script)}}),d.fromObject=function(e){return n.checkArgument(i.isObject(e)),(new d)._fromObject(e)},d.prototype._fromObject=function(e){var t;if(t=i.isString(e.prevTxId)&&u.isHexa(e.prevTxId)?new s.Buffer(e.prevTxId,"hex"):e.prevTxId,this.output=e.output?e.output instanceof h?e.output:new h(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=i.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=i.isUndefined(e.sequenceNumber)?i.isUndefined(e.seqnum)?4294967295:e.seqnum:e.sequenceNumber,i.isUndefined(e.script)&&i.isUndefined(e.scriptBuffer))throw new a.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this},d.prototype.toObject=d.prototype.toJSON=function(){var e={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(e.scriptString=this.script.toString()),this.output&&(e.output=this.output.toObject()),e},d.fromBufferReader=function(e){var t=new d;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t},d.prototype.toBufferWriter=function(e){e||(e=new o),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e},d.prototype.setScript=function(e){if(this._script=null,e instanceof f)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(u.isHexa(e))this._scriptBuffer=new s.Buffer(e,"hex");else if(i.isString(e))this._script=new f(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!c.isBuffer(e))throw new TypeError("Invalid argument type: script");this._scriptBuffer=new s.Buffer(e)}return this},d.prototype.getSignatures=function(){throw new a.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},d.prototype.isFullySigned=function(){throw new a.AbstractMethodInvoked("Input#isFullySigned")},d.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},d.prototype.addSignature=function(){throw new a.AbstractMethodInvoked("Input#addSignature")},d.prototype.clearSignatures=function(){throw new a.AbstractMethodInvoked("Input#clearSignatures")},d.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},d.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},d.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},t.exports=d},{"../../encoding/bufferwriter":93,"../../errors":95,"../../script":104,"../../util/buffer":121,"../../util/js":122,"../../util/preconditions":123,"../output":114,"../sighash":115,buffer:191,lodash:149}],110:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=(e("../transaction"),e("./input")),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),u.checkState(o.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.output.script),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},l.normalizeSignatures=function(n,a,o,e,t){return t.map(function(r){var i=null;return e=e.filter(function(e){if(i)return!0;var t=new h({signature:f.fromTxFormat(e),publicKey:r,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:o,sigtype:f.SIGHASH_ALL});return t.signature.nhashtype=t.sigtype,!p.verify(n,t.signature,t.publicKey,t.inputIndex,a.output.script)||(i=t,!1)}),i||null})},l.OPCODES_SIZE=1,l.SIGNATURE_SIZE=73,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"../transaction":117,"./input":109,inherits:148,lodash:149}],111:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=e("./input"),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),this.redeemScript=o.buildMultisigOut(this.publicKeys,r),u.checkState(o.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.redeemScript),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript)},l.OPCODES_SIZE=7,l.SIGNATURE_SIZE=74,l.PUBKEY_SIZE=34,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE+this.publicKeys.length*l.PUBKEY_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148,lodash:149}],112:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),n=(e("../../util/buffer"),e("./input")),o=e("../output"),s=e("../sighash"),c=e("../../script"),u=e("../../crypto/signature"),f=e("../signature");function p(){n.apply(this,arguments)}i(p,n),p.prototype.getSignatures=function(e,t,r,i){a.checkState(this.output instanceof o),i=i||u.SIGHASH_ALL;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new f({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:s.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},p.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(c.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this},p.prototype.clearSignatures=function(){return this.setScript(c.empty()),this},p.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},p.SCRIPT_MAX_SIZE=73,p.prototype._estimateSize=function(){return p.SCRIPT_MAX_SIZE},t.exports=p},{"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],113:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),o=e("../../util/buffer"),s=e("../../crypto/hash"),n=e("./input"),c=e("../output"),u=e("../sighash"),f=e("../../script"),p=e("../../crypto/signature"),h=e("../signature");function l(){n.apply(this,arguments)}i(l,n),l.prototype.getSignatures=function(e,t,r,i,n){return a.checkState(this.output instanceof c),n=n||s.sha256ripemd160(t.publicKey.toBuffer()),i=i||p.SIGHASH_ALL,o.equals(n,this.output.script.getPublicKeyHash())?[new h({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:u.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},l.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(f.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this},l.prototype.clearSignatures=function(){return this.setScript(f.empty()),this},l.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()},l.SCRIPT_MAX_SIZE=107,l.prototype._estimateSize=function(){return l.SCRIPT_MAX_SIZE},t.exports=l},{"../../crypto/hash":86,"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],114:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../crypto/bn"),a=e("buffer"),o=e("../util/buffer"),s=e("../util/js"),c=e("../encoding/bufferwriter"),u=e("../script"),f=e("../util/preconditions"),p=e("../errors");function h(e){if(!(this instanceof h))return new h(e);if(!i.isObject(e))throw new TypeError("Unrecognized argument for Output");var t;this.satoshis=e.satoshis,o.isBuffer(e.script)?this._scriptBuffer=e.script:(t=i.isString(e.script)&&s.isHexa(e.script)?new a.Buffer(e.script,"hex"):e.script,this.setScript(t))}Object.defineProperty(h.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script||this.setScriptFromBuffer(this._scriptBuffer),this._script}}),Object.defineProperty(h.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof n?(this._satoshisBN=e,this._satoshis=e.toNumber()):i.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=n.fromNumber(this._satoshis)):(f.checkArgument(s.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=n.fromNumber(e),this._satoshis=e),f.checkState(s.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),h.prototype.invalidSatoshis=function(){return 9007199254740991"},h.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return t.script=0!==r?e.read(r):new a.Buffer([]),new h(t)},h.prototype.toBufferWriter=function(e){e||(e=new c),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e},t.exports=h},{"../crypto/bn":84,"../encoding/bufferwriter":93,"../errors":95,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],115:[function(y,e,t){(function(f){"use strict";var p=y("buffer"),h=y("../crypto/signature"),l=y("../script"),d=y("./output"),m=y("../encoding/bufferreader"),g=y("../encoding/bufferwriter"),v=y("../crypto/bn"),b=y("../crypto/hash"),o=y("../crypto/ecdsa"),s=y("../util/preconditions"),c=y("lodash"),u=function(e,t,r,i){var n,a=y("./transaction"),o=y("./input"),s=a.shallowCopy(e);for((i=new l(i)).removeCodeseparators(),n=0;n=s.outputs.length)return new f("0000000000000000000000000000000000000000000000000000000000000001","hex");for(s.outputs.length=r+1,n=0;n"},S.prototype.toBuffer=function(){var e=new u;return this.toBufferWriter(e).toBuffer()},S.prototype.toBufferWriter=function(t){return t.writeUInt32LE(this.version),t.writeVarintNum(this.inputs.length),s.each(this.inputs,function(e){e.toBufferWriter(t)}),t.writeVarintNum(this.outputs.length),s.each(this.outputs,function(e){e.toBufferWriter(t)}),t.writeUInt32LE(this.nLockTime),t},S.prototype.fromBuffer=function(e){var t=new c(e);return this.fromBufferReader(t)},S.prototype.fromBufferReader=function(e){var t,r,i;for(a.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readUInt32LE(),r=e.readVarintNum(),t=0;t=this.inputs.length)throw new n.Transaction.InvalidIndex(e,this.inputs.length);var i=this.inputs[e];this.inputs=s.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()},S.prototype.sign=function(e,t){a.checkState(this.hasAllUtxoInfo());var r=this;return s.isArray(e)?s.each(e,function(e){r.sign(e,t)}):s.each(this.getSignatures(e,t),function(e){r.applySignature(e)}),this},S.prototype.getSignatures=function(r,i){r=new k(r),i=i||p.SIGHASH_ALL;var n=this,a=[],o=f.sha256ripemd160(r.publicKey.toBuffer());return s.each(this.inputs,function(e,t){s.each(e.getSignatures(n,r,t,i,o),function(e){a.push(e)})}),a},S.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this},S.prototype.isFullySigned=function(){return s.each(this.inputs,function(e){if(e.isFullySigned===m.prototype.isFullySigned)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),s.all(s.map(this.inputs,function(e){return e.isFullySigned()}))},S.prototype.isValidSignature=function(e){if(this.inputs[e.inputIndex].isValidSignature===m.prototype.isValidSignature)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e)},S.prototype.verifySignature=function(e,t,r,i){return h.verify(this,e,t,r,i)},S.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var e=new x(0),t=0;t=m.MAXINT-1&&(t.sequenceNumber=m.DEFAULT_RBF_SEQNUMBER)}return this},I.exports=S}).call(this,A("buffer").Buffer)},{"../address":79,"../crypto/bn":84,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../privatekey":102,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"./input":108,"./output":114,"./sighash":115,"./unspentoutput":118,buffer:191,"buffer-compare":126,lodash:149}],118:[function(e,t,r){"use strict";var o=e("lodash"),s=e("../util/preconditions"),c=e("../util/js"),u=e("../script"),f=e("../address"),p=e("../unit");function h(e){if(!(this instanceof h))return new h(e);s.checkArgument(o.isObject(e),"Must provide an object from where to extract data");var t=e.address?new f(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!c.isHexaString(r)||64"},h.prototype.toString=function(){return this.txId+":"+this.outputIndex},h.fromObject=function(e){return new h(e)},h.prototype.toObject=h.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:p.fromSatoshis(this.satoshis).toBTC()}},t.exports=h},{"../address":79,"../script":104,"../unit":119,"../util/js":122,"../util/preconditions":123,lodash:149}],119:[function(e,t,r){"use strict";var i=e("lodash"),n=e("./errors"),a=e("./util/preconditions"),o={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function s(e,t){if(!(this instanceof s))return new s(e,t);if(i.isNumber(t)){if(t<=0)throw new n.Unit.InvalidRate(t);e/=t,t=s.BTC}this._value=this._from(e,t);var r=this;Object.keys(o).forEach(function(e){Object.defineProperty(r,e,{get:function(){return r.to(e)},enumerable:!0})})}Object.keys(o).forEach(function(e){s[e]=e}),s.fromObject=function(e){return a.checkArgument(i.isObject(e),"Argument is expected to be an object"),new s(e.amount,e.code)},s.fromBTC=function(e){return new s(e,s.BTC)},s.fromMillis=s.fromMilis=function(e){return new s(e,s.mBTC)},s.fromMicros=s.fromBits=function(e){return new s(e,s.bits)},s.fromSatoshis=function(e){return new s(e,s.satoshis)},s.fromFiat=function(e,t){return new s(e,t)},s.prototype._from=function(e,t){if(!o[t])throw new n.Unit.UnknownCode(t);return parseInt((e*o[t][0]).toFixed())},s.prototype.to=function(e){if(i.isNumber(e)){if(e<=0)throw new n.Unit.InvalidRate(e);return parseFloat((this.BTC*e).toFixed(2))}if(!o[e])throw new n.Unit.UnknownCode(e);var t=this._value/o[e][0];return parseFloat(t.toFixed(o[e][1]))},s.prototype.toBTC=function(){return this.to(s.BTC)},s.prototype.toMillis=s.prototype.toMilis=function(){return this.to(s.mBTC)},s.prototype.toMicros=s.prototype.toBits=function(){return this.to(s.bits)},s.prototype.toSatoshis=function(){return this.to(s.satoshis)},s.prototype.atRate=function(e){return this.to(e)},s.prototype.toString=function(){return this.satoshis+" satoshis"},s.prototype.toObject=s.prototype.toJSON=function(){return{amount:this.BTC,code:s.BTC}},s.prototype.inspect=function(){return""},t.exports=s},{"./errors":95,"./util/preconditions":123,lodash:149}],120:[function(e,t,r){"use strict";var i=e("lodash"),n=e("url"),a=e("./address"),o=e("./unit"),s=function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.extras={},this.knownParams=r||[],this.address=this.network=this.amount=this.message=null,"string"==typeof t){var i=e.parse(t);i.amount&&(i.amount=this._parseAmount(i.amount)),this._fromObject(i)}else{if("object"!==(void 0===t?"undefined":_typeof(t)))throw new TypeError("Unrecognized data format.");this._fromObject(t)}};s.fromString=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return new s(e)},s.fromObject=function(e){return new s(e)},s.isValid=function(e,t){try{new s(e,t)}catch(e){return!1}return!0},s.parse=function(e){var t=n.parse(e,!0);if("bitcoin:"!==t.protocol)throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(e);return t.query.address=r&&r[1]||void 0,t.query},s.Members=["address","amount","message","label","r"],s.prototype._fromObject=function(e){if(!a.isValid(e.address))throw new TypeError("Invalid bitcoin address");for(var t in this.address=new a(e.address),this.network=this.address.network,this.amount=e.amount,e)if("address"!==t&&"amount"!==t){if(/^req-/.exec(t)&&-1===this.knownParams.indexOf(t))throw Error("Unknown required argument "+t);(-1"},t.exports=s},{"./address":79,"./unit":119,lodash:149,url:500}],121:[function(o,s,e){(function(r){"use strict";var i=o("buffer"),t=o("assert"),n=o("./js"),a=o("./preconditions");function e(e,t){if(e.length!==t.length)return!1;for(var r=e.length,i=0;i>24&255),t.push(e>>16&255),t.push(e>>8&255),t.push(255&e),new r(t)},integerFromBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]<<24|e[1]<<16|e[2]<<8|e[3]},integerFromSingleByteBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]},bufferToHex:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e.toString("hex")},reverse:function(e){for(var t=new i.Buffer(e.length),r=0;r>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}}else if("le"===r)for(i=0,a=0;i>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-i&4194303,26<=(i+=24)&&(i-=26,n++)}if(r+6!==t){a=o(e,t,r+6);this.words[n]|=a<>>26-i&4194303}this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];v.prototype.toString=function(e,t){if(16===(e=e||10)||"hex"===e){for(var r="",i=0,n=(t=0|t||1,0),a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return this.sign&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var c=l[e],u=d[e],f=(r="",this.clone());for(f.sign=!1;0!==f.cmpn(0);){var p=f.modn(u).toString(e);r=0!==(f=f.idivn(u)).cmpn(0)?h[c-p.length]+p+r:p+r}return 0===this.cmpn(0)&&(r="0"+r),this.sign&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.prototype.toJSON=function(){return this.toString(16)},v.prototype.toArray=function(){this.strip();var e=new Array(this.byteLength());e[0]=0;for(var t=this.clone(),r=0;0!==t.cmpn(0);r++){var i=t.andln(255);t.ishrn(8),e[e.length-r-1]=i}return e},v.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return 4096<=t&&(r+=13,t>>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.iand=function(e){var t;this.sign=this.sign&&e.sign,t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},v.prototype.ixor=function(e){var t,r;this.sign=this.sign||e.sign,r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);for(var r=e/26|0,i=e%26;this.length<=r;)this.words[this.length++]=0;return this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,a=0;a>>26}for(;0!==n&&a>>26}if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this);this.sign=!1;t=e.sub(this);return this.sign=!0,t},v.prototype.isub=function(e){if(e.sign){e.sign=!1;var t=this.iadd(e);return e.sign=!0,t._normSign()}if(this.sign)return this.sign=!1,this.iadd(e),this.sign=!0,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.sign=!1,this.length=1,this.words[0]=0,this;i=0>26,this.words[o]=67108863&t}for(;0!==a&&o>26,this.words[o]=67108863&t}if(0===a&&o>>26,a=67108863&r,o=Math.min(i,e.length-1),s=Math.max(0,i-this.length+1);s<=o;s++){var c=i-s,u=(0|this.words[c])*(0|e.words[s]),f=67108863&u;a=67108863&(f=f+a|0),n=(n=n+(u/67108864|0)|0)+(f>>>26)|0}t.words[i]=a,r=n}return 0!==r?t.words[i]=r:t.length--,t.strip()},v.prototype._bigMulTo=function(e,t){t.sign=e.sign!==this.sign,t.length=this.length+e.length;for(var r=0,i=0,n=0;n>>26)|0)>>>26,a&=67108863}t.words[n]=o,r=a,a=i}return 0!==r?t.words[n]=r:t.length--,t.strip()},v.prototype.mulTo=function(e,t){return this.length+e.length<63?this._smallMulTo(e,t):this._bigMulTo(e,t)},v.prototype.mul=function(e){var t=new v(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},v.prototype.imul=function(e){if(0===this.cmpn(0)||0===e.cmpn(0))return this.words[0]=0,this.length=1,this;var t=this.length,r=e.length;this.sign=e.sign!==this.sign,this.length=this.length+e.length,this.words[this.length-1]=0;for(var i=this.length-2;0<=i;i--){for(var n=0,a=0,o=Math.min(i,r-1),s=Math.max(0,i-t+1);s<=o;s++){var c=i-s,u=this.words[c]*e.words[s],f=67108863&u;n+=u/67108864|0,a=67108863&(f+=a),n+=f>>>26}this.words[i]=a,this.words[i+1]+=n,n=0}for(n=0,c=1;c>>26}return this.strip()},v.prototype.imuln=function(e){g("number"==typeof e);for(var t=0,r=0;r>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.mul(this)},v.prototype.ishln=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){for(var n=0,a=0;a>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;a>>n<a){this.length-=a;for(c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(c/67108864|0),this.words[a+r]=67108863&s}for(;a>26,this.words[a+r]=67108863&s}if(0===o)return this.strip();g(-1===o);for(a=o=0;a>26,this.words[a]=67108863&s}return this.sign=!0,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.shln(r),i.ishln(r),a=n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var n;i=this.divmod(e.neg(),t);return"mod"!==t&&(n=i.div.neg()),{div:n,mod:i.mod}},v.prototype.div=function(e){return this.divmod(e,"div").div},v.prototype.mod=function(e){return this.divmod(e,"mod").mod},v.prototype.divRound=function(e){var t=this.divmod(e);if(0===t.mod.cmpn(0))return t.div;var r=t.div.sign?t.mod.isub(e):t.mod,i=e.shrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:t.div.sign?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+this.words[i])%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=this.words[r]+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.ishrn(1),r.ishrn(1),++s;for(var c=r.clone(),u=t.clone();0!==t.cmpn(0);){for(;t.isEven();)t.ishrn(1),i.isEven()&&n.isEven()?(i.ishrn(1),n.ishrn(1)):(i.iadd(c).ishrn(1),n.isub(u).ishrn(1));for(;r.isEven();)r.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(u).ishrn(1));0<=t.cmp(r)?(t.isub(r),i.isub(a),n.isub(o)):(r.isub(t),a.isub(i),o.isub(n))}return{a:a,b:o,gcd:r.ishln(s)}},v.prototype._invmp=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=r.clone();0>>26,o&=67108863,this.words[n]=o}return 0!==a&&(this.words[n]=a,this.length++),this},v.prototype.cmpn=function(e){var t,r=e<0;if(r&&(e=-e),this.sign&&!r)return-1;if(!this.sign&&r)return 1;if(e&=67108863,this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}e.words[i-10]=n>>>22,e.length-=9},a.prototype.imulK=function(e){var t;e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(i[e])return i[e];var t;if("k256"===e)t=new a;else if("p224"===e)t=new s;else if("p192"===e)t=new c;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new u}return i[e]=t},f.prototype._verify1=function(e){g(!e.sign,"red works only with positives"),g(e.red,"red works only with red numbers")},f.prototype._verify2=function(e,t){g(!e.sign&&!t.sign,"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},f.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.mod(this.m)._forceRed(this)},f.prototype.neg=function(e){var t=e.clone();return t.sign=!t.sign,t.iadd(this.m)._forceRed(this)},f.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},f.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},f.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)},f.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.shln(t))},f.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},f.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},f.prototype.isqr=function(e){return this.imul(e,e)},f.prototype.sqr=function(e){return this.mul(e,e)},f.prototype.sqrt=function(e){if(0===e.cmpn(0))return e.clone();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).ishrn(2);return f=this.pow(e,r)}for(var i=this.m.subn(1),n=0;0!==i.cmpn(0)&&0===i.andln(1);)n++,i.ishrn(1);g(0!==i.cmpn(0));var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).ishrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).ishrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>8,i[r]&=255;for(;a;)i.push(255&a),a>>=8}for(t=0;"1"===e[t]&&tt[i]?1:0);++i);return 0==r&&(t.length>e.length?r=-1:e.length>t.length&&(r=1)),r}},{}],127:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.hmacDRBG=e("./elliptic/hmac-drbg"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec")},{"../package.json":147,"./elliptic/curve":130,"./elliptic/curves":133,"./elliptic/ec":134,"./elliptic/hmac-drbg":137,"./elliptic/utils":139,brorand:140}],128:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic"),S=n.utils.getNAF,j=n.utils.getJSF,u=n.utils.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function o(e,t){this.curve=e,this.type=t,this.precomputed=null}(t.exports=a).prototype.point=function(){throw new Error("Not implemented")},a.prototype.validate=function(){throw new Error("Not implemented")},a.prototype._fixedNafMul=function(e,t){var r=e._getDoubles(),i=S(t,1),n=(1<>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i){for(var n=this._wnafT1,a=this._wnafT2,o=this._wnafT3,s=0,c=0;c>1]:x<0&&(k=a[m][-x-1>>1].neg()),b="affine"===k.type?b.mixedAdd(k):b.add(k))}}for(c=0;c":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],130:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":128,"./edwards":129,"./mont":131,"./short":132}],131:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base;function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(s,o),(t.exports=s).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)},a(c,o.BasePoint),s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.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)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.ishrn(1))n.push(t.andln(1));for(var a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../curve":130,"bn.js":124,inherits:148}],132:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.shrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.sign&&(i=i.neg(),n=n.neg()),a.sign&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(t=new w(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b).redSqrt(),i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},c.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)},c.prototype._endoWnafMulAdd=function(e,t){for(var r=this._endoWnafT1,i=this._endoWnafT2,n=0;n":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],133:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":127,"./precomputed/secp256k1":138,"hash.js":141}],134:[function(e,t,r){"use strict";var d=e("bn.js"),m=e("../../elliptic"),i=m.utils.assert,n=e("./key"),g=e("./signature");function a(e){if(!(this instanceof a))return new a(e);"string"==typeof e&&(i(m.curves.hasOwnProperty(e),"Unknown curve "+e),e=m.curves[e]),e instanceof m.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(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}(t.exports=a).prototype.keyPair=function(e){return new n(this,e)},a.prototype.keyFromPrivate=function(e,t){return n.fromPrivate(this,e,t)},a.prototype.keyFromPublic=function(e,t){return n.fromPublic(this,e,t)},a.prototype.genKeyPair=function(e){e||(e={});for(var t=new m.hmacDRBG({hash:this.hash,pers:e.pers,entropy:e.entropy||m.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new d(2));;){var n=new d(t.generate(r));if(!(0"}},{"../../elliptic":127,"bn.js":124}],136:[function(e,t,r){"use strict";var n=e("bn.js"),a=e("../../elliptic").utils,i=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16))}(t.exports=o).prototype._importDER=function(e,t){if((e=a.toArray(e,t)).length<6||48!==e[0]||2!==e[2])return!1;if(1+e[1]>e.length)return!1;var r=e[3];if(128<=r)return!1;if(4+r+2>=e.length)return!1;if(2!==e[4+r])return!1;var i=e[5+r];return!(128<=i)&&(!(4+r+2+i>e.length)&&(this.r=new n(e.slice(4,4+r)),this.s=new n(e.slice(4+r+2,4+r+2+i)),!0))},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r));var i=[48,t.length+r.length+4,2,t.length];return i=i.concat(t,[2,r.length],r),a.encode(i,e)}},{"../../elliptic":127,"bn.js":124}],137:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("../elliptic").utils,n=o.assert;function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc),r=o.toArray(e.nonce,e.nonceEnc),i=o.toArray(e.pers,e.persEnc);n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this.reseed=1},a.prototype.generate=function(e,t,r,i){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i),this._update(r));for(var n=[];n.length>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e},i.getNAF=function(e,t){for(var r=[],i=1<>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=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=n.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{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;for(a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>10),n[a-7],(r=n[a-15],b(r,7)^b(r,18)^r>>>3),n[a-16]);var o,s,c=this.h[0],u=this.h[1],f=this.h[2],p=this.h[3],h=this.h[4],l=this.h[5],d=this.h[6],m=this.h[7];F(this.k.length===n.length);for(a=0;a>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function s(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}function u(e,t){if(!e)throw new Error(t||"Assertion failed")}i.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},i.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,r){return e+t+r>>>0},i.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},i.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},i.assert=u,i.inherits=n,r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:148}],147:[function(e,t,r){t.exports={_args:[["elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","/home/giacof/Download/javascript-opentimestamps/node_modules/bitcore-lib"]],_from:"elliptic@=3.0.3",_id:"elliptic@3.0.3",_inCache:!0,_location:"/bitcore-lib/elliptic",_phantomChildren:{inherits:"2.0.1"},_requested:{name:"elliptic",raw:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",rawSpec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",scope:null,spec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",type:"remote"},_requiredBy:["/bitcore-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_shasum:"865c9b420bfbe55006b9f969f97a0d2c44966595",_shrinkwrap:null,_spec:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_where:"/home/giacof/Download/javascript-opentimestamps/node_modules/bitcore-lib",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^2.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},description:"EC cryptography",devDependencies:{browserify:"^3.44.2",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",optionalDependencies:{},readme:"# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic)\n\nFast elliptic-curve cryptography in a plain javascript implementation.\n\nNOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve\nfor your cryptography operations.\n\n## Incentive\n\nECC is much slower than regular RSA cryptography, the JS implementations are\neven more slower.\n\n## Benchmarks\n\n```bash\n$ node benchmarks/index.js\nBenchmarking: sign\nelliptic#sign x 262 ops/sec ±0.51% (177 runs sampled)\neccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled)\n------------------------\nFastest is elliptic#sign\n========================\nBenchmarking: verify\nelliptic#verify x 113 ops/sec ±0.50% (166 runs sampled)\neccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled)\n------------------------\nFastest is elliptic#verify\n========================\nBenchmarking: gen\nelliptic#gen x 294 ops/sec ±0.43% (176 runs sampled)\neccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled)\n------------------------\nFastest is elliptic#gen\n========================\nBenchmarking: ecdh\nelliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled)\n------------------------\nFastest is elliptic#ecdh\n========================\n```\n\n## API\n\n### ECDSA\n\n```javascript\nvar EC = require('elliptic').ec;\n\n// Create and initialize EC context\n// (better do it once and reuse it)\nvar ec = new EC('secp256k1');\n\n// Generate keys\nvar key = ec.genKeyPair();\n\n// Sign message (must be an array, or it'll be treated as a hex sequence)\nvar msg = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];\nvar signature = key.sign(msg);\n\n// Export DER encoded signature in Array\nvar derSign = signature.toDER();\n\n// Verify signature\nconsole.log(key.verify(msg, derSign));\n```\n\n### ECDH\n\n```javascript\n// Generate keys\nvar key1 = ec.genKeyPair();\nvar key2 = ec.genKeyPair();\n\nvar shared1 = key1.derive(key2.getPublic());\nvar shared2 = key2.derive(key1.getPublic());\n\nconsole.log('Both shared secrets are BN instances');\nconsole.log(shared1.toString(16));\nconsole.log(shared2.toString(16));\n```\n\nNOTE: `.derive()` returns a [BN][1] instance.\n\n## Supported curves\n\nElliptic.js support following curve types:\n\n* Short Weierstrass\n* Montgomery\n* Edwards\n* Twisted Edwards\n\nFollowing curve 'presets' are embedded into the library:\n\n* `secp256k1`\n* `p192`\n* `p224`\n* `p256`\n* `curve25519`\n* `ed25519`\n\nNOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead.\n\n### Implementation details\n\nECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of\nthe curve operations are performed on non-affine coordinates (either projective\nor extended), various windowing techniques are used for different cases.\n\nAll operations are performed in reduction context using [bn.js][1], hashing is\nprovided by [hash.js][2]\n\n### Related projects\n\n* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both\n browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for\n node)\n\n#### LICENSE\n\nThis software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2014.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://tools.ietf.org/html/rfc6979\n[1]: https://github.com/indutny/bn.js\n[2]: https://github.com/indutny/hash.js\n[3]: https://github.com/bitchan/eccrypto\n[4]: https://github.com/wanderer/secp256k1-node\n",readmeFilename:"README.md",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{test:"make lint && mocha --reporter=spec test/*-test.js"},version:"3.0.3"}},{}],148:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{dup:68}],149:[function(e,y,_){(function(b){(function(){var dn,e,t,mn="3.10.1",gn=1,vn=2,bn=4,yn=8,_n=16,wn=32,kn=64,xn=128,Sn=256,jn=30,En="...",An=150,In=16,Pn=200,On=1,Tn=2,Bn="Expected a function",Cn="__lodash_placeholder__",Fn="[object Arguments]",Rn="[object Array]",zn="[object Boolean]",Mn="[object Date]",Dn="[object Error]",Nn="[object Function]",r="[object Map]",qn="[object Number]",Ln="[object Object]",Un="[object RegExp]",i="[object Set]",Hn="[object String]",n="[object WeakMap]",Kn="[object ArrayBuffer]",Vn="[object Float32Array]",Gn="[object Float64Array]",$n="[object Int8Array]",Wn="[object Int16Array]",Zn="[object Int32Array]",Yn="[object Uint8Array]",Xn="[object Uint8ClampedArray]",Jn="[object Uint16Array]",Qn="[object Uint32Array]",ea=/\b__p \+= '';/g,ta=/\b(__p \+=) '' \+/g,ra=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ia=/&(?:amp|lt|gt|quot|#39|#96);/g,na=/[&<>"'`]/g,aa=RegExp(ia.source),oa=RegExp(na.source),sa=/<%-([\s\S]+?)%>/g,ca=/<%([\s\S]+?)%>/g,ua=/<%=([\s\S]+?)%>/g,fa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,pa=/^\w*$/,ha=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,la=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,da=RegExp(la.source),ma=/[\u0300-\u036f\ufe20-\ufe23]/g,ga=/\\(\\)?/g,va=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ba=/\w*$/,ya=/^0[xX]/,_a=/^\[object .+?Constructor\]$/,wa=/^\d+$/,ka=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xa=/($^)/,Sa=/['\n\r\u2028\u2029\\]/g,ja=(e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",t="[a-z\\xdf-\\xf6\\xf8-\\xff]+",RegExp(e+"+(?="+e+t+")|"+e+"?"+t+"|"+e+"+|[0-9]+","g")),Ea=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Aa=-1,Ia={};Ia[Vn]=Ia[Gn]=Ia[$n]=Ia[Wn]=Ia[Zn]=Ia[Yn]=Ia[Xn]=Ia[Jn]=Ia[Qn]=!0,Ia[Fn]=Ia[Rn]=Ia[Kn]=Ia[zn]=Ia[Mn]=Ia[Dn]=Ia[Nn]=Ia[r]=Ia[qn]=Ia[Ln]=Ia[Un]=Ia[i]=Ia[Hn]=Ia[n]=!1;var Pa={};Pa[Fn]=Pa[Rn]=Pa[Kn]=Pa[zn]=Pa[Mn]=Pa[Vn]=Pa[Gn]=Pa[$n]=Pa[Wn]=Pa[Zn]=Pa[qn]=Pa[Ln]=Pa[Un]=Pa[Hn]=Pa[Yn]=Pa[Xn]=Pa[Jn]=Pa[Qn]=!0,Pa[Dn]=Pa[Nn]=Pa[r]=Pa[i]=Pa[n]=!1;var a={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},o={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},s={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},c={function:!0,object:!0},u={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},f={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},p=c[void 0===_?"undefined":_typeof(_)]&&_&&!_.nodeType&&_,h=c[void 0===y?"undefined":_typeof(y)]&&y&&!y.nodeType&&y,l=p&&h&&"object"==(void 0===b?"undefined":_typeof(b))&&b&&b.Object&&b,d=c["undefined"==typeof self?"undefined":_typeof(self)]&&self&&self.Object&&self,m=c["undefined"==typeof window?"undefined":_typeof(window)]&&window&&window.Object&&window,g=h&&h.exports===p&&p,Oa=l||m!==(this&&this.window)&&m||d||this;function Ta(e,t){if(e!==t){var r=null===e,i=e===dn,n=e==e,a=null===t,o=t===dn,s=t==t;if(t>>1,$=9007199254740991,W=O&&new O,Z={};function Y(e){if(Ka(e)&&!ui(e)&&!(e instanceof Q)){if(e instanceof J)return e;if(_.call(e,"__chain__")&&_.call(e,"__wrapped__"))return Qt(e)}return new J(e)}function X(){}function J(e,t,r){this.__wrapped__=e,this.__actions__=r||[],this.__chain__=!!t}Y.support={};function Q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function ee(){this.__data__={}}function te(e){var t=e?e.length:0;for(this.data={hash:B(null),set:new j};t--;)this.push(e[t])}function re(e,t){var r=e.data;return("string"==typeof t||li(t)?r.set.has(t):r.hash[t])?0:-1}function ie(e,t){var r=-1,i=e.length;for(t||(t=P(i));++r=Pn?st(t):null,c=t.length;s&&(a=re,o=!1,t=s);e:for(;++n>>0,t>>>=0;for(var a=P(n);++i>>1,o=e[a];(r?o<=t:o=Pn)return n.plant(t).value();for(var r=0,i=a?o[r].apply(this,e):t;++r=An)return e}else Gt=0;return Ue(e,t)});function Zt(e){for(var t=Ri(e),r=t.length,i=r&&e.length,n=!!i&&Ut(i)&&(ui(e)||ci(e)),a=-1,o=[];++a>>0,r>>>=0;r=D(t,r)&&e=(e=Ra(e)).length)return e;var o=i-n.length;if(o<1)return n;var s=e.slice(0,o);if(null==a)return s+n;if(vi(a)){if(e.slice(o).search(a)){var c,u,f=e.slice(0,o);for(a.global||(a=b(a.source,(ba.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(f);)u=c.index;s=s.slice(0,null==u?o:u)}}else if(e.indexOf(a,o)!=o){var p=s.lastIndexOf(a);-1=0.13.7 <0.14.0",_id:"bitcore-lib@0.13.19",_inCache:!0,_installable:!0,_location:"/bitcore-lib",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/bitcore-lib-0.13.19.tgz_1470850061596_0.2146058666985482"},_npmUser:{email:"braydon@bitpay.com",name:"braydonf"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{name:"bitcore-lib",raw:"bitcore-lib@^0.13.7",rawSpec:"^0.13.7",scope:null,spec:">=0.13.7 <0.14.0",type:"range"},_requiredBy:["/","/bitcore-message"],_resolved:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz",_shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",_shrinkwrap:{dependencies:{"bn.js":{from:"bn.js@=2.0.4",resolved:"https://registry.npmjs.org/bn.js/-/bn.js-2.0.4.tgz",version:"2.0.4"},bs58:{from:"bs58@=2.0.0",resolved:"https://registry.npmjs.org/bs58/-/bs58-2.0.0.tgz",version:"2.0.0"},"buffer-compare":{from:"buffer-compare@=1.0.0",resolved:"https://registry.npmjs.org/buffer-compare/-/buffer-compare-1.0.0.tgz",version:"1.0.0"},elliptic:{dependencies:{brorand:{from:"brorand@^1.0.1",resolved:"https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz",version:"1.0.5"},"hash.js":{from:"hash.js@=1.0.3",resolved:"https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz",version:"1.0.3"}},from:"elliptic@=3.0.3",resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",version:"3.0.3"},inherits:{from:"inherits@=2.0.1",resolved:"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",version:"2.0.1"},lodash:{from:"lodash@=3.10.1",resolved:"https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",version:"3.10.1"}},name:"bitcore",version:"0.13.18"},_spec:"bitcore-lib@^0.13.7",_where:"/home/giacof/Download/javascript-opentimestamps",author:{email:"dev@bitpay.com",name:"BitPay"},browser:{request:"browser-request"},bugs:{url:"https://github.com/bitpay/bitcore-lib/issues"},contributors:[{name:"Manuel Araoz",email:"manuelaraoz@gmail.com"},{name:"Daniel Cousens",email:"bitcoin@dcousens.com"},{name:"Gordon Hall",email:"gordon@bitpay.com"},{name:"Jeff Garzik",email:"jgarzik@bitpay.com"},{name:"Kyle Drake",email:"kyle@kyledrake.net"},{name:"Esteban Ordano",email:"eordano@gmail.com"},{name:"Matias Alejo Garcia",email:"ematiu@gmail.com"},{name:"Ryan X. Charles",email:"ryanxcharles@gmail.com"},{name:"Stefan Thomas",email:"moon@justmoon.net"},{name:"Stephen Pair",email:"stephen@bitpay.com"},{name:"Wei Lu",email:"luwei.here@gmail.com"}],dependencies:{"bn.js":"=2.0.4",bs58:"=2.0.0","buffer-compare":"=1.0.0",elliptic:"=3.0.3",inherits:"=2.0.1",lodash:"=3.10.1"},description:"A pure and powerful JavaScript Bitcoin library.",devDependencies:{"bitcore-build":"github:bitpay/bitcore-build",brfs:"^1.2.0",chai:"^1.10.0",gulp:"^3.8.10",sinon:"^1.13.0"},directories:{},dist:{shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",tarball:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz"},gitHead:"9517864f14d09700f3fd02ff61173003c0280774",homepage:"https://github.com/bitpay/bitcore-lib#readme",keywords:["address","bip21","bip32","bip37","bip69","bip70","bitcoin","blockchain","cryptocurrency","ecies","multisig","p2p","payment","transaction"],license:"MIT",main:"index.js",maintainers:[{name:"braydonf",email:"braydon@bitpay.com"},{name:"gabegattis",email:"gabegattis@gmail.com"},{name:"gasteve",email:"stephen@pairhome.net"},{name:"patrickbitpay",email:"patrick@bitpay.com"}],name:"bitcore-lib",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/bitpay/bitcore-lib.git"},scripts:{build:"gulp",coverage:"gulp coverage",lint:"gulp lint",test:"gulp test"},version:"0.13.19"}},{}],151:[function(e,t,r){var i=e("bitcore-lib");i.Message=e("./lib/message"),t.exports=i.Message},{"./lib/message":152,"bitcore-lib":78}],152:[function(r,d,e){(function(o){"use strict";var e=r("bitcore-lib"),s=e.deps._,i=e.PrivateKey,n=e.PublicKey,c=e.Address,a=e.encoding.BufferWriter,u=e.crypto.ECDSA,f=e.crypto.Signature,p=e.crypto.Hash.sha256sha256,t=e.util.js,h=e.util.preconditions,l=function e(t){return this instanceof e?(h.checkArgument(s.isString(t),"First argument should be a string"),this.message=t,this):new e(t)};l.MAGIC_BYTES=new o("Bitcoin Signed Message:\n"),l.prototype.magicHash=function(){var e=a.varintBufNum(l.MAGIC_BYTES.length),t=new o(this.message),r=a.varintBufNum(t.length),i=o.concat([e,l.MAGIC_BYTES,r,t]);return p(i)},l.prototype._sign=function(e){h.checkArgument(e instanceof i,"First argument should be an instance of PrivateKey");var t=this.magicHash(),r=new u;return r.hashbuf=t,r.privkey=e,r.pubkey=e.toPublicKey(),r.signRandomK(),r.calci(),r.sig},l.prototype.sign=function(e){return this._sign(e).toCompact().toString("base64")},l.prototype._verify=function(e,t){h.checkArgument(e instanceof n,"First argument should be an instance of PublicKey"),h.checkArgument(t instanceof f,"Second argument should be an instance of Signature");var r=this.magicHash(),i=u.verify(r,t,e);return i||(this.error="The signature was invalid"),i},l.prototype.verify=function(e,t){h.checkArgument(e),h.checkArgument(t&&s.isString(t)),s.isString(e)&&(e=c.fromString(e));var r=f.fromCompact(new o(t,"base64")),i=new u;i.hashbuf=this.magicHash(),i.sig=r;var n=i.toPublicKey(),a=c.fromPublicKey(n,e.network);return e.toString()!==a.toString()?!(this.error="The signature did not match the message digest"):this._verify(n,r)},l.fromString=function(e){return new l(e)},l.fromJSON=function(e){return t.isValidJSON(e)&&(e=JSON.parse(e)),new l(e.message)},l.prototype.toObject=function(){return{message:this.message}},l.prototype.toJSON=function(){return JSON.stringify(this.toObject())},l.prototype.toString=function(){return this.message},l.prototype.inspect=function(){return""},d.exports=l}).call(this,r("buffer").Buffer)},{"bitcore-lib":78,buffer:191}],153:[function(e,r,i){(function(Q,U,u){!function(e){if("object"==(void 0===i?"undefined":_typeof(i))&&void 0!==r)r.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:void 0!==U?t=U:"undefined"!=typeof self&&(t=self),t.Promise=e()}}(function(){var e,t,r;return function a(o,s,c){function u(r,e){if(!s[r]){if(!o[r]){var t="function"==typeof _dereq_&&_dereq_;if(!e&&t)return t(r,!0);if(f)return f(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[r]={exports:{}};o[r][0].call(n.exports,function(e){var t=o[r][1][e];return u(t||e)},n,n.exports,a,o,s,c)}return s[r].exports}for(var f="function"==typeof _dereq_&&_dereq_,e=0;e, no stack trace)"}function V(){return"function"==typeof Y}var G=function(){return!1},$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function W(e){var t=e.match($);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function Z(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);Y(this,Z),32=a)return r[t]=e,this._queue.push(t),!1;null!==n&&(n[t]=e);var o=this._promise,s=this._callback,c=o._boundValue();o._pushContext();var u=g(s).call(c,e,t,i),f=o._popContext();if(m.checkForgottenReturns(u,f,null!==n?"Promise.filter":"Promise.map",o),u===v)return this._reject(u.e),!0;var p=d(u,this._promise);if(p instanceof l){var h=(p=p._target())._bitField;if(0==(50397184&h))return 1<=a&&this._inFlight++,(r[t]=p)._proxy(this,-1*(t+1)),!1;if(0==(33554432&h))return 0!=(16777216&h)?this._reject(p._reason()):this._cancel(),!0;u=p._value()}r[t]=u}return i<=++this._totalResolved&&(null!==n?this._filter(r,n):this._resolve(r),!0)},f.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;0>>16)){if(e===this){var r=c();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,0<(65535&t)&&(0!=(134217728&t)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},E.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,d.isNode);0<(65535&t)?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},E.prototype._fulfillPromises=function(e,t){for(var r=1;r=this._length&&(this._resolve(this._values),!0)},t.prototype._promiseCancelled=function(){return this._cancel(),!0},t.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},t.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof s)e.cancel();else for(var t=0;t=this._length){var r;if(this._isMap)r=function(e){for(var t=new s,r=e.length/2|0,i=0;i>1},i.prototype.props=function(){return r(this)},i.props=function(e){return r(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function i(e){this._capacity=e,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},n.prototype._promiseFulfilled=function(e,t){var r=new i;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},n.prototype._promiseRejected=function(e,t){var r=new i;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},e.settle=function(e){return r.deprecated(".settle()",".reflect()"),new n(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(f,e,t){"use strict";e.exports=function(e,t,n){var r=f("./util"),i=f("./errors").RangeError,a=f("./errors").AggregateError,o=r.isArray,s={};function c(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function u(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new c(e),i=r.promise();return r.setHowMany(t),r.init(),i}r.inherits(c,t),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=o(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(e){this._howMany=e},c.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(s),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);else if("le"===r)for(n=i=0;i>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-a&4194303,26<=(a+=24)&&(a-=26,i++);r+6!==t&&(n=o(e,t,r+6),this.words[i]|=n<>>26-a&4194303),this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=67108863&o,c=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,p=67108863&c,h=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=h;l++){var d=u-l|0;f+=(o=(n=0|e.words[d])*(a=0|t.words[l])+p)/67108864|0,p=67108863&o}r.words[u]=0|p,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}v.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,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}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)&&2<=e&&e<=36){var c=l[e],u=d[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var p=f.modn(u).toString(e);r=(f=f.idivn(u)).isZero()?p+r:h[c-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.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]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},v.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)},v.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},v.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},v.prototype.inotn=function(e){g("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},v.prototype.notn=function(e){return this.clone().inotn(e)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);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,e):(r=e,this);for(var n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},v.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;i=0>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],d=8191&l,m=l>>>13,g=0|o[2],v=8191&g,b=g>>>13,y=0|o[3],_=8191&y,w=y>>>13,k=0|o[4],x=8191&k,S=k>>>13,j=0|o[5],E=8191&j,A=j>>>13,I=0|o[6],P=8191&I,O=I>>>13,T=0|o[7],B=8191&T,C=T>>>13,F=0|o[8],R=8191&F,z=F>>>13,M=0|o[9],D=8191&M,N=M>>>13,q=0|s[0],L=8191&q,U=q>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],$=8191&G,W=G>>>13,Z=0|s[3],Y=8191&Z,X=Z>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],ae=8191&ne,oe=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],pe=8191&fe,he=fe>>>13,le=0|s[9],de=8191&le,me=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(p,L))|0)+((8191&(n=(n=Math.imul(p,U))+Math.imul(h,L)|0))<<13)|0;u=((a=Math.imul(h,U))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,L),n=(n=Math.imul(d,U))+Math.imul(m,L)|0,a=Math.imul(m,U);var ve=(u+(i=i+Math.imul(p,K)|0)|0)+((8191&(n=(n=n+Math.imul(p,V)|0)+Math.imul(h,K)|0))<<13)|0;u=((a=a+Math.imul(h,V)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(b,L)|0,a=Math.imul(b,U),i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,V)|0;var be=(u+(i=i+Math.imul(p,$)|0)|0)+((8191&(n=(n=n+Math.imul(p,W)|0)+Math.imul(h,$)|0))<<13)|0;u=((a=a+Math.imul(h,W)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(_,L),n=(n=Math.imul(_,U))+Math.imul(w,L)|0,a=Math.imul(w,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,i=i+Math.imul(d,$)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,W)|0;var ye=(u+(i=i+Math.imul(p,Y)|0)|0)+((8191&(n=(n=n+Math.imul(p,X)|0)+Math.imul(h,Y)|0))<<13)|0;u=((a=a+Math.imul(h,X)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(x,L),n=(n=Math.imul(x,U))+Math.imul(S,L)|0,a=Math.imul(S,U),i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,W)|0,i=i+Math.imul(d,Y)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,X)|0;var _e=(u+(i=i+Math.imul(p,Q)|0)|0)+((8191&(n=(n=n+Math.imul(p,ee)|0)+Math.imul(h,Q)|0))<<13)|0;u=((a=a+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(A,L)|0,a=Math.imul(A,U),i=i+Math.imul(x,K)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,V)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,W)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(b,Y)|0,a=a+Math.imul(b,X)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0;var we=(u+(i=i+Math.imul(p,re)|0)|0)+((8191&(n=(n=n+Math.imul(p,ie)|0)+Math.imul(h,re)|0))<<13)|0;u=((a=a+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(O,L)|0,a=Math.imul(O,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,V)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,W)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,X)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0;var ke=(u+(i=i+Math.imul(p,ae)|0)|0)+((8191&(n=(n=n+Math.imul(p,oe)|0)+Math.imul(h,ae)|0))<<13)|0;u=((a=a+Math.imul(h,oe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(C,L)|0,a=Math.imul(C,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(O,K)|0,a=a+Math.imul(O,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,W)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(S,Y)|0,a=a+Math.imul(S,X)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ie)|0,i=i+Math.imul(d,ae)|0,n=(n=n+Math.imul(d,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var xe=(u+(i=i+Math.imul(p,ce)|0)|0)+((8191&(n=(n=n+Math.imul(p,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((a=a+Math.imul(h,ue)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(R,L),n=(n=Math.imul(R,U))+Math.imul(z,L)|0,a=Math.imul(z,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,W)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ie)|0,i=i+Math.imul(v,ae)|0,n=(n=n+Math.imul(v,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,i=i+Math.imul(d,ce)|0,n=(n=n+Math.imul(d,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0;var Se=(u+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,he)|0)+Math.imul(h,pe)|0))<<13)|0;u=((a=a+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(D,L),n=(n=Math.imul(D,U))+Math.imul(N,L)|0,a=Math.imul(N,U),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(z,K)|0,a=a+Math.imul(z,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,W)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,Y)|0,a=a+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ie)|0,i=i+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,i=i+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,ue)|0,i=i+Math.imul(d,pe)|0,n=(n=n+Math.imul(d,he)|0)+Math.imul(m,pe)|0,a=a+Math.imul(m,he)|0;var je=(u+(i=i+Math.imul(p,de)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(h,de)|0))<<13)|0;u=((a=a+Math.imul(h,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,V))+Math.imul(N,K)|0,a=Math.imul(N,V),i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,W)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,W)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(C,Y)|0,a=a+Math.imul(C,X)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ie)|0,i=i+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,ue)|0,i=i+Math.imul(v,pe)|0,n=(n=n+Math.imul(v,he)|0)+Math.imul(b,pe)|0,a=a+Math.imul(b,he)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;u=((a=a+Math.imul(m,me)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(D,$),n=(n=Math.imul(D,W))+Math.imul(N,$)|0,a=Math.imul(N,W),i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,X)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ie)|0,i=i+Math.imul(E,ae)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,i=i+Math.imul(x,ce)|0,n=(n=n+Math.imul(x,ue)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,ue)|0,i=i+Math.imul(_,pe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,pe)|0,a=a+Math.imul(w,he)|0;var Ae=(u+(i=i+Math.imul(v,de)|0)|0)+((8191&(n=(n=n+Math.imul(v,me)|0)+Math.imul(b,de)|0))<<13)|0;u=((a=a+Math.imul(b,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,X))+Math.imul(N,Y)|0,a=Math.imul(N,X),i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ie)|0,i=i+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,i=i+Math.imul(x,pe)|0,n=(n=n+Math.imul(x,he)|0)+Math.imul(S,pe)|0,a=a+Math.imul(S,he)|0;var Ie=(u+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,me)|0)+Math.imul(w,de)|0))<<13)|0;u=((a=a+Math.imul(w,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,ee))+Math.imul(N,Q)|0,a=Math.imul(N,ee),i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ie)|0,i=i+Math.imul(B,ae)|0,n=(n=n+Math.imul(B,oe)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,ue)|0,i=i+Math.imul(E,pe)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(A,pe)|0,a=a+Math.imul(A,he)|0;var Pe=(u+(i=i+Math.imul(x,de)|0)|0)+((8191&(n=(n=n+Math.imul(x,me)|0)+Math.imul(S,de)|0))<<13)|0;u=((a=a+Math.imul(S,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(D,re),n=(n=Math.imul(D,ie))+Math.imul(N,re)|0,a=Math.imul(N,ie),i=i+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,i=i+Math.imul(B,ce)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,ue)|0,i=i+Math.imul(P,pe)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(O,pe)|0,a=a+Math.imul(O,he)|0;var Oe=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(A,de)|0))<<13)|0;u=((a=a+Math.imul(A,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(D,ae),n=(n=Math.imul(D,oe))+Math.imul(N,ae)|0,a=Math.imul(N,oe),i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(z,ce)|0,a=a+Math.imul(z,ue)|0,i=i+Math.imul(B,pe)|0,n=(n=n+Math.imul(B,he)|0)+Math.imul(C,pe)|0,a=a+Math.imul(C,he)|0;var Te=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(O,de)|0))<<13)|0;u=((a=a+Math.imul(O,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(D,ce),n=(n=Math.imul(D,ue))+Math.imul(N,ce)|0,a=Math.imul(N,ue),i=i+Math.imul(R,pe)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(z,pe)|0,a=a+Math.imul(z,he)|0;var Be=(u+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,me)|0)+Math.imul(C,de)|0))<<13)|0;u=((a=a+Math.imul(C,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(D,pe),n=(n=Math.imul(D,he))+Math.imul(N,pe)|0,a=Math.imul(N,he);var Ce=(u+(i=i+Math.imul(R,de)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(z,de)|0))<<13)|0;u=((a=a+Math.imul(z,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Fe=(u+(i=Math.imul(D,de))|0)+((8191&(n=(n=Math.imul(D,me))+Math.imul(N,de)|0))<<13)|0;return u=((a=Math.imul(N,me))+(n>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,c[0]=ge,c[1]=ve,c[2]=be,c[3]=ye,c[4]=_e,c[5]=we,c[6]=ke,c[7]=xe,c[8]=Se,c[9]=je,c[10]=Ee,c[11]=Ae,c[12]=Ie,c[13]=Pe,c[14]=Oe,c[15]=Te,c[16]=Be,c[17]=Ce,c[18]=Fe,0!==u&&(c[19]=u,r.length++),r};function s(e,t,r){return(new c).mulp(e,t,r)}function c(e,t){this.x=e,this.y=t}Math.imul||(a=n),v.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?a(this,e,t):r<63?n(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,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},c.prototype.makeRBT=function(e){for(var t=new Array(e),r=v.prototype._countBits(e)-1,i=0;i>=1;return i},c.prototype.permute=function(e,t,r,i,n,a){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*a+1]=8191&n,n>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.muln=function(e){return this.clone().imuln(e)},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.imul(this.clone())},v.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 v(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<a)for(this.length-=a,c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},v.prototype.ishrn=function(e,t,r){return g(0===this.negative),this.iushrn(e,t,r)},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.ushln=function(e){return this.clone().iushln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.ushrn=function(e){return this.clone().iushrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===o)return this.strip();for(g(-1===o),i=o=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,a},v.prototype.div=function(e){return this.divmod(e,"div",!1).div},v.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},v.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},v.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),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(0===e.negative),g(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var c=r.clone(),u=t.clone();!t.isZero();){for(var f=0,p=1;0==(t.words[0]&p)&&f<26;++f,p<<=1);if(0>>26,o&=67108863,this.words[a]=o}return 0!==n&&(this.words[a]=n,this.length++),this},v.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},v.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(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(u[e])return u[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new b;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return u[e]=t},w.prototype._verify1=function(e){g(0===e.negative,"red works only with positives"),g(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){g(0==(e.negative|t.negative),"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},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 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&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();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);g(!i.isZero());var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==a?(a<<=1,a|=f,(4===++o||0===i&&0===u)&&(n=this.mul(n,r[a]),a=o=0)):o=0}s=26}return n},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},v.mont=function(e){return new k(e)},r(k,w),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.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),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new v(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:157}],155:[function(e,t,r){var A=e("concat-map"),I=e("balanced-match");t.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function t(e,r){var i=[];var n=I("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var s=a||o;var c=0<=n.body.indexOf(",");if(!s&&!c)return n.post.match(/,.*\}/)?(e=n.pre+"{"+n.body+P+n.post,t(e)):[e];var u;if(s)u=n.body.split(/\.\./);else if(1===(u=T(n.body)).length&&1===(u=t(u[0],!1).map(B)).length){var f=n.post.length?t(n.post,!1):[""];return f.map(function(e){return n.pre+u[0]+e})}var p=n.pre;var f=n.post.length?t(n.post,!1):[""];var h;if(s){var l=O(u[0]),d=O(u[1]),m=Math.max(u[0].length,u[1].length),g=3==u.length?Math.abs(O(u[2])):1,v=F,b=d>>24]^f[d>>>16&255]^p[m>>>8&255]^h[255&g]^t[v++],o=u[d>>>24]^f[m>>>16&255]^p[g>>>8&255]^h[255&l]^t[v++],s=u[m>>>24]^f[g>>>16&255]^p[l>>>8&255]^h[255&d]^t[v++],c=u[g>>>24]^f[l>>>16&255]^p[d>>>8&255]^h[255&m]^t[v++],l=a,d=o,m=s,g=c;return a=(i[l>>>24]<<24|i[d>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[v++],o=(i[d>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&l])^t[v++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[l>>>8&255]<<8|i[255&d])^t[v++],c=(i[g>>>24]<<24|i[l>>>16&255]<<16|i[d>>>8&255]<<8|i[255&m])^t[v++],[a>>>=0,o>>>=0,s>>>=0,c>>>=0]}var p=[0,1,2,4,8,16,32,64,128,27,54],h=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=[[],[],[],[]],a=[[],[],[],[]],o=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;var f=e[i[r[o]=u]=o],p=e[f],h=e[p],l=257*e[u]^16843008*u;n[0][o]=l<<24|l>>>8,n[1][o]=l<<16|l>>>16,n[2][o]=l<<8|l>>>24,n[3][o]=l,l=16843009*h^65537*p^257*f^16843008*o,a[0][u]=l<<24|l>>>8,a[1][u]=l<<16|l>>>16,a[2][u]=l<<8|l>>>24,a[3][u]=l,0===o?o=s=1:(o=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();function s(e){this._key=a(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],a=0;a>>24,o=h.SBOX[o>>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o],o^=p[a/t|0]<<24):6>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o]),n[a]=n[a-t]^o}for(var s=[],c=0;c>>24]]^h.INV_SUB_MIX[1][h.SBOX[f>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[f>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return o(e=a(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=a(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":447}],159:[function(e,t,r){var o=e("./aes"),u=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),f=e("./ghash"),n=e("buffer-xor"),p=e("./incr32");function a(e,t,r,i){s.call(this);var n=u.alloc(4,0);this._cipher=new o.AES(t);var a=this._cipher.encryptBlock(n);this._ghash=new f(a),r=function(e,t,r){if(12===t.length)return e._finID=u.concat([t,u.from([0,0,0,1])]),u.concat([t,u.from([0,0,0,2])]);var i=new f(r),n=t.length,a=n%16;i.update(t),a&&(a=16-a,i.update(u.alloc(a,0))),i.update(u.alloc(8,0));var o=8*n,s=u.alloc(8);s.writeUIntBE(o,0,8),i.update(s),e._finID=i.state;var c=u.from(e._finID);return p(c),c}(this,r,a),this._prev=u.from(r),this._cache=u.allocUnsafe(0),this._secCache=u.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(a,s),a.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=u.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},a.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(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;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":447}],164:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],165:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":190}],166:[function(e,t,r){var a=e("safe-buffer").Buffer,o=e("buffer-xor");function s(e,t,r){var i=t.length,n=o(t,e._cache);return e._cache=e._cache.slice(i),e._prev=a.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=a.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=a.allocUnsafe(0)),!(e._cache.length<=t.length)){n=a.concat([n,s(e,t,r)]);break}i=e._cache.length,n=a.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":190,"safe-buffer":447}],167:[function(e,t,r){var o=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,a=-1,o=0;++a<8;)i=t&1<<7-a?128:0,o+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>a%8,e._prev=c(e._prev,r?i:n);return o}function c(e,t){var r=e.length,i=-1,n=o.allocUnsafe(e.length);for(e=o.concat([e,o.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=o.allocUnsafe(i),a=-1;++a=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var a=m(r);if("ec"===a.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=g[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new d(i),a=r.data.subjectPrivateKey.data;return n.verify(t,e,a)}(e,t,a)}if("dsa"===a.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,a=r.data.g,o=r.data.pub_key,s=m.signature.decode(e,"der"),c=s.s,u=s.r;v(c,n),v(u,n);var f=l.mont(i),p=c.invm(n);return 0===a.toRed(f).redPow(new l(t).mul(p).mod(n)).fromRed().mul(o.toRed(f).redPow(u.mul(p).mod(n)).fromRed()).mod(i).mod(n).cmp(u)}(e,t,a)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var o=a.modulus.byteLength(),s=[1],c=0;t.length+s.length+2l.UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function h(e,t){for(var r=0;rm.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsm.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelm.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelm.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=m.Z_FILTERED&&e.strategy!=m.Z_HUFFMAN_ONLY&&e.strategy!=m.Z_RLE&&e.strategy!=m.Z_FIXED&&e.strategy!=m.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!g.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new o.Zlib(t);var i=this;this._hadError=!1,this._binding.onerror=function(e,t){i._binding=null,i._hadError=!0;var r=new Error(e);r.errno=t,r.code=m.codes[t],i.emit("error",r)};var r=m.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(r=e.level);var n=m.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(n=e.strategy),this._binding.init(e.windowBits||m.Z_DEFAULT_WINDOWBITS,r,e.memLevel||m.Z_DEFAULT_MEMLEVEL,n,e.dictionary),this._buffer=new g(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=n,this.once("end",this.close)}o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION,Object.keys(o).forEach(function(e){e.match(/^Z/)&&(m[e]=o[e])}),m.codes={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},Object.keys(m.codes).forEach(function(e){m.codes[m.codes[e]]=e}),m.Deflate=s,m.Inflate=c,m.Gzip=u,m.Gunzip=f,m.DeflateRaw=p,m.InflateRaw=h,m.Unzip=l,m.createDeflate=function(e){return new s(e)},m.createInflate=function(e){return new c(e)},m.createDeflateRaw=function(e){return new p(e)},m.createInflateRaw=function(e){return new h(e)},m.createGzip=function(e){return new u(e)},m.createGunzip=function(e){return new f(e)},m.createUnzip=function(e){return new l(e)},m.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new s(t),e,r)},m.deflateSync=function(e,t){return r(new s(t),e)},m.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new u(t),e,r)},m.gzipSync=function(e,t){return r(new u(t),e)},m.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new p(t),e,r)},m.deflateRawSync=function(e,t){return r(new p(t),e)},m.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new l(t),e,r)},m.unzipSync=function(e,t){return r(new l(t),e)},m.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new c(t),e,r)},m.inflateSync=function(e,t){return r(new c(t),e)},m.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new f(t),e,r)},m.gunzipSync=function(e,t){return r(new f(t),e)},m.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new h(t),e,r)},m.inflateRawSync=function(e,t){return r(new h(t),e)},e.inherits(t,a),t.prototype.params=function(e,t,r){if(em.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=m.Z_FILTERED&&t!=m.Z_HUFFMAN_ONLY&&t!=m.Z_RLE&&t!=m.Z_FIXED&&t!=m.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var i=this;this.flush(o.Z_SYNC_FLUSH,function(){i._binding.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())})}else n.nextTick(r)},t.prototype.reset=function(){return this._binding.reset()},t.prototype._flush=function(e){this._transform(new g(0),"",e)},t.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=o.Z_FULL_FLUSH),r.ended)t&&n.nextTick(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var i=this;this.once("drain",function(){i.flush(t)})}else this._flushFlag=e,this.write(new g(0),"",t)},t.prototype.close=function(e){if(e&&n.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;n.nextTick(function(){t.emit("close")})}},t.prototype._transform=function(e,t,r){var i,n=this._writableState,a=(n.ending||n.ended)&&(!e||n.length===e.length);if(null===!e&&!g.isBuffer(e))return r(new Error("invalid input"));a?i=o.Z_FINISH:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH));this._processChunk(e,i,r)},t.prototype._processChunk=function(a,o,s){var c=a&&a.length,u=this._chunkSize-this._offset,f=0,p=this,h="function"==typeof s;if(!h){var t,l=[],d=0;this.on("error",function(e){t=e});do{var e=this._binding.writeSync(o,a,f,c,this._buffer,this._offset,u)}while(!this._hadError&&m(e[0],e[1]));if(this._hadError)throw t;var r=g.concat(l,d);return this.close(),r}var i=this._binding.write(o,a,f,c,this._buffer,this._offset,u);function m(e,t){if(!p._hadError){var r=u-t;if(v(0<=r,"have should not go down"),0=p._chunkSize)&&(u=p._chunkSize,p._offset=0,p._buffer=new g(p._chunkSize)),0===t){if(f+=c-e,c=e,!h)return!0;var n=p._binding.write(o,a,f,c,p._buffer,p._offset,p._chunkSize);return n.callback=m,void(n.buffer=a)}if(!h)return!1;s()}}i.buffer=a,i.callback=m},e.inherits(s,t),e.inherits(c,t),e.inherits(u,t),e.inherits(f,t),e.inherits(p,t),e.inherits(h,t),e.inherits(l,t)}).call(this,d("_process"),d("buffer").Buffer)},{"./binding":185,_process:382,_stream_transform:427,assert:67,buffer:191,util:505}],187:[function(e,t,r){arguments[4][157][0].apply(r,arguments)},{dup:157}],188:[function(e,B,C){(function(T){!function(e){var t="object"==(void 0===C?"undefined":_typeof(C))&&C&&!C.nodeType&&C,r="object"==(void 0===B?"undefined":_typeof(B))&&B&&!B.nodeType&&B,i="object"==(void 0===T?"undefined":_typeof(T))&&T;i.global!==i&&i.window!==i&&i.self!==i||(e=i);var n,a,v=2147483647,b=36,y=1,_=26,o=38,s=700,w=72,k=128,x="-",c=/^xn--/,u=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=b-y,S=Math.floor,j=String.fromCharCode;function E(e){throw new RangeError(p[e])}function l(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function d(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((v-d)/o))&&E("overflow"),d+=c*o,!(c<(u=s<=g?y:g+_<=s?_:s-g));s+=b)o>S(v/(f=b-u))&&E("overflow"),o*=f;g=O(d-a,t=h.length+1,0==a),S(d/t)>v-m&&E("overflow"),m+=S(d/t),d%=t,h.splice(d++,0,m)}return I(h)}function g(e){var t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g=[];for(h=(e=A(e)).length,t=k,a=w,o=r=0;oS((v-r)/(l=i+1))&&E("overflow"),r+=(s-t)*l,t=s,o=0;ov&&E("overflow"),p==t){for(c=r,u=b;!(c<(f=u<=a?y:a+_<=u?_:u-a));u+=b)m=c-f,d=b-f,g.push(j(P(f+m%d,0))),c=S(m/d);g.push(j(P(c,0))),a=O(r,l,i==n),r=0,++i}++r,++t}return g.join("")}if(n={version:"1.4.1",ucs2:{decode:A,encode:I},decode:m,encode:g,toASCII:function(e){return d(e,function(e){return u.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return d(e,function(e){return c.test(e)?m(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",function(){return n});else if(t&&r)if(B.exports==t)r.exports=n;else for(a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],189:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var a=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=c;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function c(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}a.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},a.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:191}],190:[function(e,t,r){(function(a){t.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new a(r),n=0;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function l(e,t){if(p.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return R(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=p.from(t,i)),p.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,n);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,n){var a,o=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;s/=o=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var f=-1;for(a=r;a>>10&1023|55296),f=56320|1023&f),i.push(f),n+=p}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;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 S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===p.compare(this,e)},p.prototype.inspect=function(){var e="",t=D.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,i,n){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(i,n),u=e.slice(t,r),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a,o,s,c,u,f,p,h,l,d=!1;;)switch(i){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return h=t,l=r,M(R(e,(p=this).length-h),p,h,l);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return c=this,u=t,f=r,M(z(e),c,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=t,s=r,M(function(e,t){for(var r,i,n,a=[],o=0;o>8,n=r%256,a.push(n),a.push(i);return a}(e,(a=this).length-o),a,o,s);default:if(d)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function k(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function I(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function P(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function O(e,t,r,i,n,a){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(e,t,r,i,n){return n||O(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function B(e,t,r,i,n){return n||O(e,0,r,8),a.write(e,t,r,i,52,8),r+8}p.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):I(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;0<=--a&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function z(e){return i.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function M(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":75,ieee754:318,isarray:323}],192:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],193:[function(e,t,r){function n(e){this.dict=e||{}}n.prototype.set=function(e,t,r){if("object"!==(void 0===e?"undefined":_typeof(e))){void 0===r&&(r=!0);var i=this.has(e);return!r&&i?this.dict[i]=this.dict[i]+","+t:this.dict[i||e]=t,i}for(var n in e)this.set(n,e[n],t)},n.prototype.has=function(e){for(var t=Object.keys(this.dict),r=(e=e.toLowerCase(),0);rr)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>8^255&n^99,u[r]=n;var a=e[f[n]=r],o=e[a],s=e[o],c=257*e[n]^16843008*n;p[r]=c<<24|c>>>8,h[r]=c<<16|c>>>16,l[r]=c<<8|c>>>24,d[r]=c;c=16843009*s^65537*o^257*a^16843008*r;m[n]=c<<24|c>>>8,g[n]=c<<16|c>>>16,v[n]=c<<8|c>>>24,b[n]=c,r?(r=a^e[e[e[s^a]]],i^=e[e[i]]):r=i=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],i=r.AES=t.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),n=this._keySchedule=[],a=0;a>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o]):(o=u[(o=o<<8|o>>>24)>>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o],o^=y[a/r|0]<<24),n[a]=n[a-r]^o}for(var s=this._invKeySchedule=[],c=0;c>>24]]^g[u[o>>>16&255]]^v[u[o>>>8&255]]^b[u[255&o]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,p,h,l,d,u)},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,m,g,v,b,f);r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,a,o,s){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],p=e[t+2]^r[2],h=e[t+3]^r[3],l=4,d=1;d>>24]^n[f>>>16&255]^a[p>>>8&255]^o[255&h]^r[l++],g=i[f>>>24]^n[p>>>16&255]^a[h>>>8&255]^o[255&u]^r[l++],v=i[p>>>24]^n[h>>>16&255]^a[u>>>8&255]^o[255&f]^r[l++],b=i[h>>>24]^n[u>>>16&255]^a[f>>>8&255]^o[255&p]^r[l++];u=m,f=g,p=v,h=b}m=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&h])^r[l++],g=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[h>>>8&255]<<8|s[255&u])^r[l++],v=(s[p>>>24]<<24|s[h>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^r[l++],b=(s[h>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^r[l++];e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=b},keySize:8});e.AES=t._createHelper(i)}(),n.AES},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],206:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,c,n,a,o,s,u,f,p,h,l,d,m,g,v,b;e.lib.Cipher||(r=(t=e).lib,i=r.Base,c=r.WordArray,n=r.BufferedBlockAlgorithm,(a=t.enc).Utf8,o=a.Base64,s=t.algo.EvpKDF,u=r.Cipher=n.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function n(e){return"string"==typeof e?b:g}return function(i){return{encrypt:function(e,t,r){return n(t).encrypt(i,e,t,r)},decrypt:function(e,t,r){return n(t).decrypt(i,e,t,r)}}}}()}),r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),f=t.mode={},p=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var e=p.extend();function a(e,t,r){var i=this._iv;if(i){var n=i;this._iv=void 0}else n=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:l}),reset:function(){u.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else{i=r.createDecryptor;this._minBufferSize=1}this._mode=i.call(r,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),d=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var i=c.create([1398893684,1701076831]).concat(r).concat(t);else i=t;return i.toString(o)},parse:function(e){var t=o.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var i=c.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return d.create({ciphertext:t,salt:i})}},g=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),a=n.finalize(t),o=n.cfg;return d.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.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}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=c.random(8));var n=s.create({keySize:t+r}).compute(e,i),a=c.create(n.words.slice(t),4*r);return n.sigBytes=4*t,d.create({key:n,iv:a,salt:i})}},b=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),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 a=g.encrypt.call(this,e,t,n.key,i);return a.mixIn(n),a},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,g.decrypt.call(this,e,t,n.key,i)}}))},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],207:[function(e,t,r){var i,n;i=this,n=function(){var f,r,e,t,i,p,n,a,o,s,c,u,h=h||(f=Math,r=Object.create||function(){function r(){}return function(e){var t;return r.prototype=e,t=new r,r.prototype=null,t}}(),t=(e={}).lib={},i=t.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$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)}},p=t.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).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 a=0;a>>2]>>>24-a%4*8&255;t[i+a>>>2]|=o<<24-(i+a)%4*8}else for(a=0;a>>2]=r[a>>>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=f.ceil(t/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,r=[],i=function(t){t=t;var r=987654321,i=4294967295;return function(){var e=((r=36969*(65535&r)+(r>>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return e/=4294967296,(e+=.5)*(.5>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).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 p.init(r,t/2)}},o=n.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(a))}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 p.init(r,t)}},s=n.Utf8={stringify:function(e){try{return decodeURIComponent(escape(o.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return o.parse(unescape(encodeURIComponent(e)))}},c=t.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=s.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,n=this.blockSize,a=i/(4*n),o=(a=e?f.ceil(a):f.max((0|a)-this._minBufferSize,0))*n,s=f.min(4*o,i);if(o){for(var c=0;c>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.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,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var n=0;n>>6-a%4*2;i[n>>>2]|=(o|s)<<24-n%4*8,n++}return c.create(i,n)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],209:[function(e,t,r){var i,n;i=this,n=function(r){return function(){var e=r,n=e.lib.WordArray,t=e.enc;t.Utf16=t.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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}};function o(e){return e<<8&4278255360|e>>>8&16711935}t.Utf16LE={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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return n.create(r,2*t)}}}(),r.enc.Utf16},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],210:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,f,n,a,o;return r=(t=e).lib,i=r.Base,f=r.WordArray,n=t.algo,a=n.MD5,o=n.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=r.hasher.create(),n=f.create(),a=n.words,o=r.keySize,s=r.iterations;a.lengthi&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),a=this._iKey=t.clone(),o=n.words,s=a.words,c=0;c>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)}).prototype=e}}(),t.lib.WordArray},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],215:[function(e,t,r){var i,n;i=this,n=function(o){return function(f){var e=o,t=e.lib,r=t.WordArray,i=t.Hasher,n=e.algo,E=[];!function(){for(var e=0;e<64;e++)E[e]=4294967296*f.abs(f.sin(e+1))|0}();var a=n.MD5=i.extend({_doReset:function(){this._hash=new r.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 a=this._hash.words,o=e[t+0],s=e[t+1],c=e[t+2],u=e[t+3],f=e[t+4],p=e[t+5],h=e[t+6],l=e[t+7],d=e[t+8],m=e[t+9],g=e[t+10],v=e[t+11],b=e[t+12],y=e[t+13],_=e[t+14],w=e[t+15],k=a[0],x=a[1],S=a[2],j=a[3];x=O(x=O(x=O(x=O(x=P(x=P(x=P(x=P(x=I(x=I(x=I(x=I(x=A(x=A(x=A(x=A(x,S=A(S,j=A(j,k=A(k,x,S,j,o,7,E[0]),x,S,s,12,E[1]),k,x,c,17,E[2]),j,k,u,22,E[3]),S=A(S,j=A(j,k=A(k,x,S,j,f,7,E[4]),x,S,p,12,E[5]),k,x,h,17,E[6]),j,k,l,22,E[7]),S=A(S,j=A(j,k=A(k,x,S,j,d,7,E[8]),x,S,m,12,E[9]),k,x,g,17,E[10]),j,k,v,22,E[11]),S=A(S,j=A(j,k=A(k,x,S,j,b,7,E[12]),x,S,y,12,E[13]),k,x,_,17,E[14]),j,k,w,22,E[15]),S=I(S,j=I(j,k=I(k,x,S,j,s,5,E[16]),x,S,h,9,E[17]),k,x,v,14,E[18]),j,k,o,20,E[19]),S=I(S,j=I(j,k=I(k,x,S,j,p,5,E[20]),x,S,g,9,E[21]),k,x,w,14,E[22]),j,k,f,20,E[23]),S=I(S,j=I(j,k=I(k,x,S,j,m,5,E[24]),x,S,_,9,E[25]),k,x,u,14,E[26]),j,k,d,20,E[27]),S=I(S,j=I(j,k=I(k,x,S,j,y,5,E[28]),x,S,c,9,E[29]),k,x,l,14,E[30]),j,k,b,20,E[31]),S=P(S,j=P(j,k=P(k,x,S,j,p,4,E[32]),x,S,d,11,E[33]),k,x,v,16,E[34]),j,k,_,23,E[35]),S=P(S,j=P(j,k=P(k,x,S,j,s,4,E[36]),x,S,f,11,E[37]),k,x,l,16,E[38]),j,k,g,23,E[39]),S=P(S,j=P(j,k=P(k,x,S,j,y,4,E[40]),x,S,o,11,E[41]),k,x,u,16,E[42]),j,k,h,23,E[43]),S=P(S,j=P(j,k=P(k,x,S,j,m,4,E[44]),x,S,b,11,E[45]),k,x,w,16,E[46]),j,k,c,23,E[47]),S=O(S,j=O(j,k=O(k,x,S,j,o,6,E[48]),x,S,l,10,E[49]),k,x,_,15,E[50]),j,k,p,21,E[51]),S=O(S,j=O(j,k=O(k,x,S,j,b,6,E[52]),x,S,u,10,E[53]),k,x,g,15,E[54]),j,k,s,21,E[55]),S=O(S,j=O(j,k=O(k,x,S,j,d,6,E[56]),x,S,w,10,E[57]),k,x,h,15,E[58]),j,k,y,21,E[59]),S=O(S,j=O(j,k=O(k,x,S,j,f,6,E[60]),x,S,v,10,E[61]),k,x,c,15,E[62]),j,k,m,21,E[63]),a[0]=a[0]+k|0,a[1]=a[1]+x|0,a[2]=a[2]+S|0,a[3]=a[3]+j|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var n=f.floor(r/4294967296),a=r;t[15+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,s=o.words,c=0;c<4;c++){var u=s[c];s[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function A(e,t,r,i,n,a,o){var s=e+(t&r|~t&i)+n+o;return(s<>>32-a)+t}function I(e,t,r,i,n,a,o){var s=e+(t&i|r&~i)+n+o;return(s<>>32-a)+t}function P(e,t,r,i,n,a,o){var s=e+(t^r^i)+n+o;return(s<>>32-a)+t}function O(e,t,r,i,n,a,o){var s=e+(r^(t|~i))+n+o;return(s<>>32-a)+t}e.MD5=i._createHelper(a),e.HmacMD5=i._createHmacHelper(a)}(Math),o.MD5},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],216:[function(e,t,r){var i,n;i=this,n=function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function a(e,t,r,i){var n=this._iv;if(n){var a=n.slice(0);this._iv=void 0}else a=this._prevBlock;i.encryptBlock(a,0);for(var o=0;o>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 t=e.Encryptor=e.extend({processBlock:function(e,t){var r,i=this._cipher,n=i.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),0===((r=o)[0]=u(r[0]))&&(r[1]=u(r[1]));var s=o.slice(0);i.encryptBlock(s,0);for(var c=0;c>>2]|=n<<24-a%4*8,e.sigBytes+=n},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],222:[function(e,t,r){var i,n;i=this,n=function(n){return n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],223:[function(e,t,r){var i,n;i=this,n=function(r){return r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],224:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],225:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],226:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,v,n,a,b,o;return r=(t=e).lib,i=r.Base,v=r.WordArray,n=t.algo,a=n.SHA1,b=n.HMAC,o=n.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=b.create(r.hasher,e),n=v.create(),a=v.create([1]),o=n.words,s=a.words,c=r.keySize,u=r.iterations;o.length>>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]],n=this._b=0;n<4;n++)h.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;i[0]^=c,i[1]^=f,i[2]^=u,i[3]^=p,i[4]^=c,i[5]^=f,i[6]^=u,i[7]^=p;for(n=0;n<4;n++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.RabbitLegacy=t._createHelper(i)}(),a.RabbitLegacy},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],228:[function(e,t,r){var i,n;i=this,n=function(a){return function(){var e=a,t=e.lib.StreamCipher,r=e.algo,n=[],c=[],u=[],i=r.Rabbit=t.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(r=this._b=0;r<4;r++)h.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;n[0]^=c,n[1]^=f,n[2]^=u,n[3]^=p,n[4]^=c,n[5]^=f,n[6]^=u,n[7]^=p;for(r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.Rabbit=t._createHelper(i)}(),a.Rabbit},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],229:[function(e,t,r){var i,n;i=this,n=function(o){return function(){var e=o,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.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 a=0;n<256;n++){var o=n%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+i[n]+s)%256;var c=i[n];i[n]=i[a],i[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=n.call(this)},keySize:8,ivSize:0});function n(){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 a=e[t];e[t]=e[r],e[r]=a,i|=e[(e[t]+e[r])%256]<<24-8*n}return this._i=t,this._j=r,i}e.RC4=t._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;0>>24)|4278255360&(n<<24|n>>>8)}var a,o,s,c,u,f,p,h,l,d,m,g=this._hash.words,v=A.words,b=I.words,y=x.words,_=S.words,w=j.words,k=E.words;f=a=g[0],p=o=g[1],h=s=g[2],l=c=g[3],d=u=g[4];for(r=0;r<80;r+=1)m=a+e[t+y[r]]|0,m+=r<16?P(o,s,c)+v[0]:r<32?O(o,s,c)+v[1]:r<48?T(o,s,c)+v[2]:r<64?B(o,s,c)+v[3]:C(o,s,c)+v[4],m=(m=F(m|=0,w[r]))+u|0,a=u,u=c,c=F(s,10),s=o,o=m,m=f+e[t+_[r]]|0,m+=r<16?C(p,h,l)+b[0]:r<32?B(p,h,l)+b[1]:r<48?T(p,h,l)+b[2]:r<64?O(p,h,l)+b[3]:P(p,h,l)+b[4],m=(m=F(m|=0,k[r]))+d|0,f=d,d=l,l=F(h,10),h=p,p=m;m=g[1]+s+l|0,g[1]=g[2]+c+d|0,g[2]=g[3]+u+f|0,g[3]=g[4]+a+p|0,g[4]=g[0]+o+h|0,g[0]=m},_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,a=n.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function P(e,t,r){return e^t^r}function O(e,t,r){return e&t|~e&r}function T(e,t,r){return(e|~t)^r}function B(e,t,r){return e&r|t&~r}function C(e,t,r){return e^(t|~r)}function F(e,t){return e<>>32-t}t.RIPEMD160=n._createHelper(o),t.HmacRIPEMD160=n._createHmacHelper(o)}(Math),s.RIPEMD160},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],231:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,p,o;return r=(t=e).lib,i=r.WordArray,n=r.Hasher,a=t.algo,p=[],o=a.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],a=r[2],o=r[3],s=r[4],c=0;c<80;c++){if(c<16)p[c]=0|e[t+c];else{var u=p[c-3]^p[c-8]^p[c-14]^p[c-16];p[c]=u<<1|u>>>31}var f=(i<<5|i>>>27)+s+p[c];f+=c<20?1518500249+(n&a|~n&o):c<40?1859775393+(n^a^o):c<60?(n&a|n&o|a&o)-1894007588:(n^a^o)-899497514,s=o,o=a,a=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|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(o),t.HmacSHA1=n._createHmacHelper(o),e.SHA1},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],232:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a;return r=(t=e).lib.WordArray,i=t.algo,n=i.SHA256,a=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(a),t.HmacSHA224=n._createHmacHelper(a),e.SHA224},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],n):n(i.CryptoJS)},{"./core":207,"./sha256":233}],233:[function(e,t,r){var i,n;i=this,n=function(c){return function(n){var e=c,t=e.lib,r=t.WordArray,i=t.Hasher,a=e.algo,o=[],y=[];!function(){function e(e){for(var t=n.sqrt(e),r=2;r<=t;r++)if(!(e%r))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(o[i]=t(n.pow(r,.5))),y[i]=t(n.pow(r,1/3)),i++),r++}();var _=[],s=a.SHA256=i.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=0;p<64;p++){if(p<16)_[p]=0|e[t+p];else{var h=_[p-15],l=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,d=_[p-2],m=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;_[p]=l+_[p-7]+m+_[p-16]}var g=i&n^i&a^n&a,v=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&u)+y[p]+_[p];f=u,u=c,c=s,s=o+b|0,o=a,a=n,n=i,i=b+(v+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+u|0,r[7]=r[7]+f|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)]=n.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA256=i._createHelper(s),e.HmacSHA256=i._createHmacHelper(s)}(Math),c.SHA256},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],234:[function(e,t,r){var i,n;i=this,n=function(a){return function(h){var e=a,t=e.lib,l=t.WordArray,i=t.Hasher,f=e.x64.Word,r=e.algo,P=[],O=[],T=[];!function(){for(var e=1,t=0,r=0;r<24;r++){P[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++)O[e+5*t]=t+(2*e+3*t)%5*5;for(var n=1,a=0;a<24;a++){for(var o=0,s=0,c=0;c<7;c++){if(1&n){var u=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(S=r[n]).high^=o,S.low^=a}for(var s=0;s<24;s++){for(var c=0;c<5;c++){for(var u=0,f=0,p=0;p<5;p++){u^=(S=r[c+5*p]).high,f^=S.low}var h=B[c];h.high=u,h.low=f}for(c=0;c<5;c++){var l=B[(c+4)%5],d=B[(c+1)%5],m=d.high,g=d.low;for(u=l.high^(m<<1|g>>>31),f=l.low^(g<<1|m>>>31),p=0;p<5;p++){(S=r[c+5*p]).high^=u,S.low^=f}}for(var v=1;v<25;v++){var b=(S=r[v]).high,y=S.low,_=P[v];if(_<32)u=b<<_|y>>>32-_,f=y<<_|b>>>32-_;else u=y<<_-32|b>>>64-_,f=b<<_-32|y>>>64-_;var w=B[O[v]];w.high=u,w.low=f}var k=B[0],x=r[0];k.high=x.high,k.low=x.low;for(c=0;c<5;c++)for(p=0;p<5;p++){var S=r[v=c+5*p],j=B[v],E=B[(c+1)%5+5*p],A=B[(c+2)%5+5*p];S.high=j.high^~E.high&A.high,S.low=j.low^~E.low&A.low}S=r[0];var I=T[s];S.high^=I.high,S.low^=I.low}},_doFinalize:function(){var e=this._data,t=e.words,r=(this._nDataBytes,8*e.sigBytes),i=32*this.blockSize;t[r>>>5]|=1<<24-r%32,t[(h.ceil((r+1)/i)*i>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();for(var n=this._state,a=this.cfg.outputLength/8,o=a/8,s=[],c=0;c>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),s.push(p),s.push(f)}return new l.init(s,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});e.SHA3=i._createHelper(n),e.HmacSHA3=i._createHmacHelper(n)}(Math),a.SHA3},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],235:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,o,s;return r=(t=e).x64,i=r.Word,n=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.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=o._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s),e.SHA384},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core"),e("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],n):n(i.CryptoJS)},{"./core":207,"./sha512":236,"./x64-core":238}],236:[function(e,t,r){var i,n;i=this,n=function(c){return function(){var e=c,t=e.lib.Hasher,r=e.x64,i=r.Word,n=r.WordArray,a=e.algo;function o(){return i.create.apply(i,arguments)}var xe=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],Se=[];!function(){for(var e=0;e<80;e++)Se[e]=o()}();var s=a.SHA512=t.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=i.high,h=i.low,l=n.high,d=n.low,m=a.high,g=a.low,v=o.high,b=o.low,y=s.high,_=s.low,w=c.high,k=c.low,x=u.high,S=u.low,j=f.high,E=f.low,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=w,D=k,N=x,q=S,L=j,U=E,H=0;H<80;H++){var K=Se[H];if(H<16)var V=K.high=0|e[t+2*H],G=K.low=0|e[t+2*H+1];else{var $=Se[H-15],W=$.high,Z=$.low,Y=(W>>>1|Z<<31)^(W>>>8|Z<<24)^W>>>7,X=(Z>>>1|W<<31)^(Z>>>8|W<<24)^(Z>>>7|W<<25),J=Se[H-2],Q=J.high,ee=J.low,te=(Q>>>19|ee<<13)^(Q<<3|ee>>>29)^Q>>>6,re=(ee>>>19|Q<<13)^(ee<<3|Q>>>29)^(ee>>>6|Q<<26),ie=Se[H-7],ne=ie.high,ae=ie.low,oe=Se[H-16],se=oe.high,ce=oe.low;V=(V=(V=Y+ne+((G=X+ae)>>>0>>0?1:0))+te+((G=G+re)>>>0>>0?1:0))+se+((G=G+ce)>>>0>>0?1:0);K.high=V,K.low=G}var ue,fe=R&M^~R&N,pe=z&D^~z&q,he=A&P^A&T^P&T,le=I&O^I&B^O&B,de=(A>>>28|I<<4)^(A<<30|I>>>2)^(A<<25|I>>>7),me=(I>>>28|A<<4)^(I<<30|A>>>2)^(I<<25|A>>>7),ge=(R>>>14|z<<18)^(R>>>18|z<<14)^(R<<23|z>>>9),ve=(z>>>14|R<<18)^(z>>>18|R<<14)^(z<<23|R>>>9),be=xe[H],ye=be.high,_e=be.low,we=L+ge+((ue=U+ve)>>>0>>0?1:0),ke=me+le;L=N,U=q,N=M,q=D,M=R,D=z,R=C+(we=(we=(we=we+fe+((ue=ue+pe)>>>0>>0?1:0))+ye+((ue=ue+_e)>>>0<_e>>>0?1:0))+V+((ue=ue+G)>>>0>>0?1:0))+((z=F+ue|0)>>>0>>0?1:0)|0,C=T,F=B,T=P,B=O,P=A,O=I,A=we+(de+he+(ke>>>0>>0?1:0))+((I=ue+ke|0)>>>0>>0?1:0)|0}h=i.low=h+I,i.high=p+A+(h>>>0>>0?1:0),d=n.low=d+O,n.high=l+P+(d>>>0>>0?1:0),g=a.low=g+B,a.high=m+T+(g>>>0>>0?1:0),b=o.low=b+F,o.high=v+C+(b>>>0>>0?1:0),_=s.low=_+z,s.high=y+R+(_>>>0>>0?1:0),k=c.low=k+D,c.high=w+M+(k>>>0>>0?1:0),S=u.low=S+q,u.high=x+N+(S>>>0>>0?1:0),E=f.low=E+U,f.high=j+L+(E>>>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=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(s),e.HmacSHA512=t._createHmacHelper(s)}(),c.SHA512},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],237:[function(e,t,r){var i,n;i=this,n=function(s){return function(){var e=s,t=e.lib,r=t.WordArray,i=t.BlockCipher,n=e.algo,u=[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],f=[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],p=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],a=n.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var i=u[r]-1;t[r]=e[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var o=n[a]=[],s=p[a];for(r=0;r<24;r++)o[r/6|0]|=t[(f[r]-1+s)%28]<<31-r%6,o[4+(r/6|0)]|=t[28+(f[r+24]-1+s)%28]<<31-r%6;o[0]=o[0]<<1|o[0]>>>31;for(r=1;r<7;r++)o[r]=o[r]>>>4*(r-1)+3;o[7]=o[7]<<5|o[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[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],d.call(this,4,252645135),d.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),d.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=h[c][((o^n[c])&l[c])>>>0];this._lBlock=o,this._rBlock=a^s}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,d.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(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<>>1];r=h.r28shl(r,a),i=h.r28shl(i,a),h.pc2(r,i,e.keys,n)}},c.prototype._update=function(e,t,r,i){var n=this._desState,a=h.readUInt32BE(e,t),o=h.readUInt32BE(e,t+4);h.ip(a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,o,n.tmp,0):this._decrypt(n,a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],h.writeUInt32BE(r,a,i),h.writeUInt32BE(r,o,i+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,a=p}h.rip(o,a,i,n)},c.prototype._decrypt=function(e,t,r,i,n){for(var a=r,o=t,s=e.keys.length-2;0<=s;s-=2){var c=e.keys[s],u=e.keys[s+1];h.expand(a,e.tmp,0),c^=e.tmp[0],u^=e.tmp[1];var f=h.substitute(c,u),p=a;a=(o^h.permute(f))>>>0,o=p}h.rip(a,o,i,n)}},{"../des":240,inherits:320,"minimalistic-assert":353}],244:[function(e,t,r){"use strict";var a=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),o=n.Cipher,s=n.DES;function c(e,t){a.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new c(this.type,this.options.key);this._edeState=t}i(u,o),(t.exports=u).create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":240,inherits:320,"minimalistic-assert":353}],245:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.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},r.ip=function(e,t,r,i){for(var n=0,a=0,o=6;0<=o;o-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+o&1}for(o=6;0<=o;o-=2){for(s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1;for(s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1}r[i+0]=n>>>0,r[i+1]=a>>>0},r.rip=function(e,t,r,i){for(var n=0,a=0,o=0;o<4;o++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+o&1,n<<=1,n|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;0<=s;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.pc1=function(e,t,r,i){for(var n=0,a=0,o=7;5<=o;o--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.r28shl=function(e,t){return e<>>28-t};var c=[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];r.pc2=function(e,t,r,i){for(var n=0,a=0,o=c.length>>>1,s=0;s>>c[s]&1;for(s=o;s>>c[s]&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var a=23;15<=a;a-=4)i<<=6,i|=e>>>a&63;for(a=11;3<=a;a-=4)n|=e>>>a&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[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];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[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];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(c),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;r.mod(p).cmp(h);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(i=r.shrn(1))&&g(r)&&v(i)&&v(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":154,"miller-rabin":349,randombytes:414}],249:[function(e,t,r){t.exports={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"}}},{}],250:[function(e,t,r){var u=e("crypto"),f=e("jsbn").BigInteger,p=(e("./lib/ec.js").ECPointFp,e("safer-buffer").Buffer);function h(e,t){return e.length>=t?e:h("0"+e,t)}r.ECCurves=e("./lib/sec.js"),r.ECKey=function(e,t,r){var i,n=e(),a=n.getN(),o=Math.floor(a.bitLength()/8);if(t)if(r){e=n.getCurve();this.P=e.decodePointHex(t.toString("hex"))}else{if(t.length!=o)return!1;i=new f(t.toString("hex"),16)}else{var s=a.subtract(f.ONE),c=new f(u.randomBytes(a.bitLength()));i=c.mod(s).add(f.ONE),this.P=n.getG().multiply(i)}this.P&&(this.PublicKey=p.from(n.getCurve().encodeCompressedPointHex(this.P),"hex")),i&&(this.PrivateKey=p.from(h(i.toString(16),2*o),"hex"),this.deriveSharedSecret=function(e){if(!e||!e.P)return!1;var t=e.P.multiply(i);return p.from(h(t.getX().toBigInteger().toString(16),2*o),"hex")})}},{"./lib/ec.js":251,"./lib/sec.js":252,crypto:204,jsbn:325,"safer-buffer":448}],251:[function(e,t,r){var l=e("jsbn").BigInteger,i=l.prototype.Barrett;function f(e,t){this.x=t,this.q=e}function d(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=null==i?l.ONE:i,this.zinv=null}function n(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new d(this,null,null),this.reducer=new i(this.q)}f.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},f.prototype.toBigInteger=function(){return this.x},f.prototype.negate=function(){return new f(this.q,this.x.negate().mod(this.q))},f.prototype.add=function(e){return new f(this.q,this.x.add(e.toBigInteger()).mod(this.q))},f.prototype.subtract=function(e){return new f(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},f.prototype.multiply=function(e){return new f(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},f.prototype.square=function(){return new f(this.q,this.x.square().mod(this.q))},f.prototype.divide=function(e){return new f(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},d.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO))},d.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(l.ZERO)&&!this.y.toBigInteger().equals(l.ZERO)},d.prototype.negate=function(){return new d(this.curve,this.x,this.y.negate(),this.z)},d.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(l.ZERO.equals(r))return l.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new l("3"),n=this.x.toBigInteger(),a=this.y.toBigInteger(),o=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),s=o.multiply(r),c=n.multiply(o),u=t.square().multiply(this.z),f=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(s).multiply(r).mod(this.curve.q),p=c.multiply(i).multiply(t).subtract(a.multiply(s)).subtract(u.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),h=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(p),h)},d.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new l("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),n=i.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),o=t.square().multiply(e);l.ZERO.equals(a)||(o=o.add(this.z.square().multiply(a)));var s=(o=o.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(i).mod(this.curve.q),c=o.multiply(e).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(o.square().multiply(o)).mod(this.curve.q),u=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(c),u)},d.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new l("3")),n=this.negate(),a=this;for(t=i.bitLength()-2;0r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var n=this.curve.getInfinity(),a=this.add(t);0<=i;)n=n.twice(),e.testBit(i)?n=r.testBit(i)?n.add(a):n.add(this):r.testBit(i)&&(n=n.add(t)),--i;return n},n.prototype.getQ=function(){return this.q},n.prototype.getA=function(){return this.a},n.prototype.getB=function(){return this.b},n.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},n.prototype.getInfinity=function(){return this.infinity},n.prototype.fromBigInteger=function(e){return new f(this.q,e)},n.prototype.reduce=function(e){this.reducer.reduce(e)},n.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;t.lengtht+1;){var r=e.shiftRight(t),i=e.subtract(r.shiftLeft(t));this.getR().equals(l.ONE)||(r=r.multiply(this.getR())),e=r.add(i)}for(;0<=e.compareTo(q);)e=e.subtract(q)}else e=e.mod(q);return e},f.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var e=new f(this.q,this.x.modPow(this.q.shiftRight(2).add(l.ONE),this.q));return e.square().equals(this)?e:null}var t=this.q.subtract(l.ONE),r=t.shiftRight(1);if(!this.x.modPow(r,this.q).equals(l.ONE))return null;var i,n,a=t.shiftRight(2).shiftLeft(1).add(l.ONE),o=this.x,s=modDouble(modDouble(o));do{for(var c;0<=(c=new l(this.q.bitLength(),new SecureRandom)).compareTo(this.q)||!c.multiply(c).subtract(s).modPow(r,this.q).equals(t););var u=this.lucasSequence(c,o,a);if(i=u[0],n=u[1],this.modMult(n,n).equals(s))return n.testBit(0)&&(n=n.add(q)),n=n.shiftRight(1),new f(q,n)}while(i.equals(l.ONE)||i.equals(t));return null},f.prototype.lucasSequence=function(e,t,r){for(var i=r.bitLength(),n=r.getLowestSetBit(),a=l.ONE,o=l.TWO,s=e,c=l.ONE,u=l.ONE,f=i-1;n+1<=f;--f)c=this.modMult(c,u),r.testBit(f)?(u=this.modMult(c,t),a=this.modMult(a,s),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1)))):(u=c,a=this.modReduce(a.multiply(o).subtract(c)),s=this.modReduce(s.multiply(o).subtract(e.multiply(c))),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))));c=this.modMult(c,u),u=this.modMult(c,t),a=this.modReduce(a.multiply(o).subtract(c)),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),c=this.modMult(c,u);for(f=1;f<=n;++f)a=this.modMult(a,o),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))),c=this.modMult(c,c);return[a,o]};r={ECCurveFp:n,ECPointFp:d,ECFieldElementFp:f};t.exports=r},{jsbn:325}],252:[function(e,t,r){var o=e("jsbn").BigInteger,s=e("./ec.js").ECCurveFp;function c(e,t,r,i){this.curve=e,this.g=t,this.n=r,this.h=i}function u(e){return new o(e,16)}function i(){var e=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),r=u("E87579C11079F43DD824993C2CEE5ED3"),i=u("FFFFFFFE0000000075A30D1B9038A115"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83"),i,n)}function n(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=o.ZERO,r=u("7"),i=u("0100000000000000000001B8FA16DFAB9ACA16B6B3"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE"),i,n)}function a(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),r=u("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),i=u("0100000000000000000001F4C8F927AED3CA752257"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32"),i,n)}function f(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=o.ZERO,r=u("3"),i=u("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"),i,n)}function p(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),r=u("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),i=u("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811"),i,n)}function h(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),r=u("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),i=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"),i,n)}function l(){var e=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),r=u("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),i=u("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),i,n)}c.prototype.getCurve=function(){return this.curve},c.prototype.getG=function(){return this.g},c.prototype.getN=function(){return this.n},c.prototype.getH=function(){return this.h},t.exports={secp128r1:i,secp160k1:n,secp160r1:a,secp192k1:f,secp192r1:p,secp224r1:h,secp256r1:l}},{"./ec.js":251,jsbn:325}],253:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":268,"./elliptic/curve":256,"./elliptic/curves":259,"./elliptic/ec":260,"./elliptic/eddsa":263,"./elliptic/utils":267,brorand:156}],254:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,j=n.getNAF,E=n.getJSF,p=n.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i,n){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,c=0,u=0;u>1]:S<0&&(x=o[g][-S-1>>1].neg()),y="affine"===x.type?y.mixedAdd(x):y.add(x))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},o.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.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),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],256:[function(e,t,r){arguments[4][130][0].apply(r,arguments)},{"./base":254,"./edwards":255,"./mont":257,"./short":258,dup:130}],257:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base,s=e("../../elliptic").utils;function c(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(c,o),(t.exports=c).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)},a(u,o.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},c.prototype.point=function(e,t){return new u(this,e,t)},c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.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)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},u.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 a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],258:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new w(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)},c.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)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],259:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":253,"./precomputed/secp256k1":266,"hash.js":299}],260:[function(e,t,r){"use strict";var g=e("bn.js"),v=e("hmac-drbg"),a=e("../../elliptic"),l=a.utils.assert,i=e("./key"),b=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(l(a.curves.hasOwnProperty(e),"Unknown curve "+e),e=a.curves[e]),e instanceof a.curves.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}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new v({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new g(2));;){var n=new g(t.generate(r));if(!(0>1;if(0<=o.cmp(this.curve.p.umod(this.curve.n))&&u)throw new Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var f=t.r.invm(n),p=n.sub(a).mul(f).umod(n),h=s.mul(f).umod(n);return this.g.mulAdd(p,o,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new b(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":253,"./key":261,"./signature":262,"bn.js":154,"hmac-drbg":311}],261:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=a).fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},{"../../elliptic":253,"bn.js":154}],262:[function(e,t,r){"use strict";var s=e("bn.js"),c=e("../../elliptic").utils,i=c.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=c.toArray(e,t);var r=new u;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=f(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=f(e,r);if(e.length!==a+r.place)return!1;var o=e.slice(r.place,a+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===o[0]&&128&o[1]&&(o=o.slice(1)),this.r=new s(n),this.s=new s(o),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];p(i,t.length),(i=i.concat(t)).push(2),p(i,r.length);var n=i.concat(r),a=[48];return p(a,n.length),a=a.concat(n),c.encode(a,e)}},{"../../elliptic":253,"bn.js":154}],263:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),a=n.utils,o=a.assert,c=a.parseBytes,s=e("./key"),u=e("./signature");function f(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=f).prototype.sign=function(e,t){e=c(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),a=this.encodePoint(n),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:a})},f.prototype.verify=function(e,t,r){e=c(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(a)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=6.0.0 <7.0.0",_id:"elliptic@6.4.1",_inCache:!0,_installable:!0,_location:"/elliptic",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/elliptic_6.4.1_1533787091502_0.6309761823717674"},_npmUser:{email:"fedor@indutny.com",name:"indutny"},_npmVersion:"6.3.0",_phantomChildren:{},_requested:{name:"elliptic",raw:"elliptic@^6.0.0",rawSpec:"^6.0.0",scope:null,spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/home/giacof/Download/javascript-opentimestamps/node_modules/browserify-sign",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{fileCount:17,integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJba7vUCRA9TVsSAnZWagAA+gcP/jWaj5GmDZ0YFi/X4g5O\nx+pxu9i3HbP9YqywT7rz3XFXSaytu0LQDeDEbddl523X69tsbKfzHRTcnW8n\n2r0VjPhttRm+0RpEhBwjSIK34VkQA1xIWh2ugOToKXVCFVLM5VFDPGzbiN6x\n/hpL7gj1hoCRVmuhjnqFQ+vPKACKfv1Eq4CsRmu2focmP37kQpWQlweD/z4V\nJF4NxA33Fvp13Fl+9g4sPHyhUVsW9ojVaG3Ijn70pCaGQM18UPlbODkWQ1QX\nAgteOFjkIOtcalJk3B3qsM8GZeHEcAFvt2T73miJkHdCGNmRQS45Ede+gnj0\nlLlZJsCCKUHtTqrlprHo6AgMnBZufmytyozYAHC1/JYniazSBi2yPHtQeniR\nl69BfiRBdD2rNrMPwmCNRkMqrgel5WMGpaD0xdaFAHF1Ru2ZQFKsA7KvPGgp\nA20+LN11cCib67Pg5XDyrZ92T3yXec+6gQ3iq9d9UBZKFGl0P8ebVqq1LrUJ\na6nekwMpRISWnKcqV72XVmQdBmUWHq9VfVLsWJzVIJqtpHmUO7q74ACP3i4W\n0/F1REeI0YEhh3NjeStdDecfjlu7PY0pLQpbk2I3ms+6DO+cAfeDEev5jFBK\nwQabRNhITeT1FVtxZAcApj33fnCdqwaWr1NS00K5ZRqhDTTzPr/O4KRN4CR1\npstU\r\n=UVBB\r\n-----END PGP SIGNATURE-----\r\n",shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",unpackedSize:118371},files:["lib"],gitHead:"523da1cf71ddcfd607fbdee1858bc2af47f0e700",homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.1"}},{}],269:[function(e,t,r){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function c(e){return"function"==typeof e}function u(e){return"object"===(void 0===e?"undefined":_typeof(e))&&null!==e}function f(e){return void 0===e}((t.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},i.prototype.emit=function(e){var t,r,i,n,a,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(f(r=this._events[e]))return!1;if(c(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=Array.prototype.slice.call(arguments,1),r.apply(this,n)}else if(u(r))for(n=Array.prototype.slice.call(arguments,1),i=(o=r.slice()).length,a=0;ar&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!c(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,a;if(!c(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||c(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(r)){for(a=n;0=this._blockSize;){for(var n=this._blockOffset;n=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=n.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,a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":310}],310:[function(e,t,r){"use strict";var u=e("minimalistic-assert"),i=e("inherits");function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function o(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}r.inherits=i,r.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:320,"minimalistic-assert":353}],311:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),i=o.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length1e3*t.clockSkew)throw new E("clock skew of "+g/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach(function(e){if(u.params.headers.indexOf(e.toLowerCase())<0)throw new P(e+" was not a signed header")}),t.algorithms&&-1===t.algorithms.indexOf(u.params.algorithm))throw new I(u.params.algorithm+" is not a supported algorithm");return u.algorithm=u.params.algorithm.toUpperCase(),u.keyId=u.params.keyId,u}}},{"./utils":315,"assert-plus":66,util:505}],314:[function(n,a,e){(function(l){var d=n("assert-plus"),m=n("crypto"),e=(n("http"),n("util")),g=n("sshpk"),v=n("jsprim"),t=n("./utils"),b=n("util").format,y=t.HASH_ALGOS,_=t.PK_ALGOS,w=t.InvalidAlgorithmError,r=t.HttpSignatureError,k=t.validateAlgorithm,x='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';function S(e){r.call(this,e,S)}function j(e){r.call(this,e,j)}function i(e){d.object(e,"options");var t=[];if(void 0!==e.algorithm&&(d.string(e.algorithm,"options.algorithm"),t=k(e.algorithm)),this.rs_alg=t,void 0!==e.sign)d.func(e.sign,"options.sign"),this.rs_signFunc=e.sign;else if("hmac"===t[0]&&void 0!==e.key){if(d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,"string"!=typeof e.key&&!l.isBuffer(e.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=m.createHmac(t[1].toUpperCase(),e.key),this.rs_signer.sign=function(){var e=this.digest("base64");return{hashAlgorithm:t[1],toString:function(){return e}}}}else{if(void 0===e.key)throw new TypeError("options.sign (func) or options.key is required");var r=e.key;if(("string"==typeof r||l.isBuffer(r))&&(r=g.parsePrivateKey(r)),d.ok(g.PrivateKey.isPrivateKey(r,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=r,d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,!_[r.type])throw new w(r.type.toUpperCase()+" type keys are not supported");if(void 0!==t[0]&&r.type!==t[0])throw new w("options.key must be a "+t[0].toUpperCase()+" key, was given a "+r.type.toUpperCase()+" key instead");this.rs_signer=r.createSign(t[1])}this.rs_headers=[],this.rs_lines=[]}e.inherits(S,r),e.inherits(j,r),i.prototype.writeHeader=function(e,t){if(d.string(e,"header"),e=e.toLowerCase(),d.string(t,"value"),this.rs_headers.push(e),this.rs_signFunc)this.rs_lines.push(e+": "+t);else{var r=e+": "+t;0>1,f=-7,p=r?n-1:0,h=r?-1:1,l=e[t+p];for(p+=h,a=l&(1<<-f)-1,l>>=-f,f+=s;0>=-f,f+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:a-1,d=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),2<=(t+=1<=o+p?h/c:h*Math.pow(2,1-p))*c&&(o++,c/=2),f<=o+p?(s=0,o=f):1<=o+p?(s=(t*c-1)*Math.pow(2,n),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,n),o=0));8<=n;e[r+l]=255&s,l+=d,s/=256,n-=8);for(o=o<>15;0<=--a;){var c=32767&this[e],u=this[e++]>>15,f=s*c+u*o;n=((c=o*c+((32767&f)<<15)+r[i]+(1073741823&n))>>>30)+(f>>>15)+s*u+(n>>>30),r[i++]=1073741823&c}return n},30):t&&"Netscape"!=navigator.appName?(y.prototype.am=function(e,t,r,i,n,a){for(;0<=--a;){var o=t*this[e++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},26):(y.prototype.am=function(e,t,r,i,n,a){for(var o=16383&t,s=t>>14;0<=--a;){var c=16383&this[e],u=this[e++]>>14,f=s*c+u*o;n=((c=o*c+((16383&f)<<14)+r[i]+n)>>28)+(f>>14)+s*u,r[i++]=268435455&c}return n},28),y.prototype.DB=e,y.prototype.DM=(1<>>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 v(e){this.m=e}function b(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 l(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function d(){}function m(e){return e}function k(e){this.r2=_(),this.q3=_(),y.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},b.prototype.convert=function(e){var t=_();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&0>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),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},b.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.copyTo=function(e){for(var t=this.t-1;0<=t;--t)e[t]=this[t];e.t=this.t,e.s=this.s},y.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0this.DB?(this[this.t-1]|=(o&(1<>this.DB-a):this[this.t-1]|=o<=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,0>n|s,s=(this[r]&a)<=this.t)t.t=0;else{var i=e%this.DB,n=this.DB-i,a=(1<>i;for(var o=r+1;o>i;0>=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:0=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}0>this.F2:0),h=this.FV/p,l=(1<>s)&&(n=!0,a=c(r));0<=o;)s>(s+=this.DB-t)):(r=this[o]>>(s-=t)&i,s<=0&&(s+=this.DB,--o)),02*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=_();return e.copyTo(t),this.reduce(t),t},k.prototype.revert=function(e){return e},k.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);0<=e.compareTo(this.m);)e.subTo(this.m,e)},k.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},k.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x,S,j,E=[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],A=(1<<26)/E[E.length-1];function I(){var e;e=(new Date).getTime(),S[j++]^=255&e,S[j++]^=e>>8&255,S[j++]^=e>>16&255,S[j++]^=e>>24&255,R<=j&&(j-=R)}if(y.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},y.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||36=r&&(this.dMultiply(i),this.dAddOffset(o,0),o=a=0))}0e&&this.subTo(y.ONE.shiftLeft(e-1),this);else{var i=new Array,n=7&e;i.length=1+(e>>3),t.nextBytes(i),0>=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,0=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},y.prototype.multiplyLowerTo=function(e,t,r){var i,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;0>1)>E.length&&(e=E.length);for(var n=_(),a=0;a>24},y.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},y.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},y.prototype.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(0>i)!=(this.s&this.DM)>>i&&(t[n++]=r|this.s<>(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,(0=this.t?0!=this.s:0!=(this[t]&1<>n-c&u:(p=(e[l]&(1<>this.DB+n-c)),s=r;0==(1&p);)p>>=1,--s;if((n-=s)<0&&(n+=this.DB,--l),d)o[p].copyTo(a),d=!1;else{for(;1>>8,S[j++]=255&P;j=0,I()}function B(){if(null==x){for(I(),(x=new F).init(S),j=0;jt.maxItems&&n("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&m.concat(function(e,t,r,i){if("object"==(void 0===t?"undefined":_typeof(t)))for(var n in("object"!=(void 0===e?"undefined":_typeof(e))||e instanceof Array)&&m.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(n)){var a=e[n];if(void 0===a&&h.existingOnly)continue;var o=t[n];void 0===a&&o.default&&(a=e[n]=o.default),h.coerce&&n in e&&(a=e[n]=h.coerce(a,o)),g(a,o,r,n)}for(n in e){if(e.hasOwnProperty(n)&&("_"!=n.charAt(0)||"_"!=n.charAt(1))&&t&&!t[n]&&!1===i){if(h.filter){delete e[n];continue}m.push({property:r,message:(void 0===a?"undefined":_typeof(a))+"The property "+n+" is not defined in the schema and the schema does not allow additional properties"})}var s=t&&t[n]&&t[n].requires;!s||s in e||m.push({property:r,message:"the presence of the property "+n+" requires that "+s+" also be present"}),a=e[n],!i||t&&"object"==(void 0===t?"undefined":_typeof(t))&&n in t||(h.coerce&&(a=e[n]=h.coerce(a,i)),g(a,i,r,n)),!l&&a&&a.$schema&&(m=m.concat(g(a,a.$schema,r,n)))}return m}(e,t.properties,o,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&n("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&n("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.lengthe&&n("must have a minimum value of "+t.minimum),void 0!==_typeof(t.maximum)&&(void 0===e?"undefined":_typeof(e))==_typeof(t.maximum)&&t.maximum= 2"),d.ok(n.base<=36,"options.base <= 36"),d.bool(n.allowSign,"options.allowSign"),d.bool(n.allowPrefix,"options.allowPrefix"),d.bool(n.allowTrailing,"options.allowTrailing"),d.bool(n.allowImprecise,"options.allowImprecise"),d.bool(n.trimWhitespace,"options.trimWhitespace"),d.bool(n.leadingZeroIsOctal,"options.leadingZeroIsOctal"),n.leadingZeroIsOctal&&d.ok(!i,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var a,o=-1,s=n.base,c=1,u=0,f=0,p=e.length;if(n.trimWhitespace)for(;ft[0]||e[0]==t[0]&&e[1]>=t[1],"negative differences not allowed");var r=[e[0]-t[0],0];return e[1]>=t[1]?r[1]=e[1]-t[1]:(r[0]--,r[1]=1e9-(t[1]-e[1])),r}function R(e,t){return C(e),C(t),e[1]+=t[1],1e9<=e[1]&&(e[0]++,e[1]-=1e9),e[0]+=t[0],e}function z(e,t,r){var i,n;if(i={},r)for(n in r)i[n]=r[n];if(e)for(n in e)i[n]=e[n];if(t)for(n in t)i[n]=t[n];return i}},{"assert-plus":66,extsprintf:272,"json-schema":327,util:505,verror:509}],330:[function(e,t,r){"use strict";t.exports=e("./lib/api")(e("./lib/keccak"))},{"./lib/api":331,"./lib/keccak":335}],331:[function(e,t,r){"use strict";var n=e("./keccak"),a=e("./shake");t.exports=function(e){var r=n(e),i=a(e);return function(e,t){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new r(1152,448,null,224,t);case"keccak256":return new r(1088,512,null,256,t);case"keccak384":return new r(832,768,null,384,t);case"keccak512":return new r(576,1024,null,512,t);case"sha3-224":return new r(1152,448,6,224,t);case"sha3-256":return new r(1088,512,6,256,t);case"sha3-384":return new r(832,768,6,384,t);case"sha3-512":return new r(576,1024,6,512,t);case"shake128":return new i(1344,256,31,t);case"shake256":return new i(1088,512,31,t);default:throw new Error("Invald algorithm: "+e)}}}},{"./keccak":332,"./shake":333}],332:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,o=e("stream").Transform,n=e("inherits");t.exports=function(a){function t(e,t,r,i,n){o.call(this,n),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._hashBitLength=i,this._options=n,this._state=new a,this._state.initialize(e,t),this._finalized=!1}return n(t,o),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],333:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("stream").Transform,o=e("inherits");t.exports=function(n){function t(e,t,r,i){a.call(this,i),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._options=i,this._state=new n,this._state.initialize(e,t),this._finalized=!1}return o(t,a),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],334:[function(e,t,r){"use strict";var ot=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];r.p1600=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],n=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],h=f^(n<<1|a>>>31),l=p^(a<<1|n>>>31),d=e[0]^h,m=e[1]^l,g=e[10]^h,v=e[11]^l,b=e[20]^h,y=e[21]^l,_=e[30]^h,w=e[31]^l,k=e[40]^h,x=e[41]^l;h=r^(o<<1|s>>>31),l=i^(s<<1|o>>>31);var S=e[2]^h,j=e[3]^l,E=e[12]^h,A=e[13]^l,I=e[22]^h,P=e[23]^l,O=e[32]^h,T=e[33]^l,B=e[42]^h,C=e[43]^l;h=n^(c<<1|u>>>31),l=a^(u<<1|c>>>31);var F=e[4]^h,R=e[5]^l,z=e[14]^h,M=e[15]^l,D=e[24]^h,N=e[25]^l,q=e[34]^h,L=e[35]^l,U=e[44]^h,H=e[45]^l;h=o^(f<<1|p>>>31),l=s^(p<<1|f>>>31);var K=e[6]^h,V=e[7]^l,G=e[16]^h,$=e[17]^l,W=e[26]^h,Z=e[27]^l,Y=e[36]^h,X=e[37]^l,J=e[46]^h,Q=e[47]^l;h=c^(r<<1|i>>>31),l=u^(i<<1|r>>>31);var ee=e[8]^h,te=e[9]^l,re=e[18]^h,ie=e[19]^l,ne=e[28]^h,ae=e[29]^l,oe=e[38]^h,se=e[39]^l,ce=e[48]^h,ue=e[49]^l,fe=d,pe=m,he=v<<4|g>>>28,le=g<<4|v>>>28,de=b<<3|y>>>29,me=y<<3|b>>>29,ge=w<<9|_>>>23,ve=_<<9|w>>>23,be=k<<18|x>>>14,ye=x<<18|k>>>14,_e=S<<1|j>>>31,we=j<<1|S>>>31,ke=A<<12|E>>>20,xe=E<<12|A>>>20,Se=I<<10|P>>>22,je=P<<10|I>>>22,Ee=T<<13|O>>>19,Ae=O<<13|T>>>19,Ie=B<<2|C>>>30,Pe=C<<2|B>>>30,Oe=R<<30|F>>>2,Te=F<<30|R>>>2,Be=z<<6|M>>>26,Ce=M<<6|z>>>26,Fe=N<<11|D>>>21,Re=D<<11|N>>>21,ze=q<<15|L>>>17,Me=L<<15|q>>>17,De=H<<29|U>>>3,Ne=U<<29|H>>>3,qe=K<<28|V>>>4,Le=V<<28|K>>>4,Ue=$<<23|G>>>9,He=G<<23|$>>>9,Ke=W<<25|Z>>>7,Ve=Z<<25|W>>>7,Ge=Y<<21|X>>>11,$e=X<<21|Y>>>11,We=Q<<24|J>>>8,Ze=J<<24|Q>>>8,Ye=ee<<27|te>>>5,Xe=te<<27|ee>>>5,Je=re<<20|ie>>>12,Qe=ie<<20|re>>>12,et=ae<<7|ne>>>25,tt=ne<<7|ae>>>25,rt=oe<<8|se>>>24,it=se<<8|oe>>>24,nt=ce<<14|ue>>>18,at=ue<<14|ce>>>18;e[0]=fe^~ke&Fe,e[1]=pe^~xe&Re,e[10]=qe^~Je&de,e[11]=Le^~Qe&me,e[20]=_e^~Be&Ke,e[21]=we^~Ce&Ve,e[30]=Ye^~he&Se,e[31]=Xe^~le&je,e[40]=Oe^~Ue&et,e[41]=Te^~He&tt,e[2]=ke^~Fe&Ge,e[3]=xe^~Re&$e,e[12]=Je^~de&Ee,e[13]=Qe^~me&Ae,e[22]=Be^~Ke&rt,e[23]=Ce^~Ve&it,e[32]=he^~Se&ze,e[33]=le^~je&Me,e[42]=Ue^~et&ge,e[43]=He^~tt&ve,e[4]=Fe^~Ge&nt,e[5]=Re^~$e&at,e[14]=de^~Ee&De,e[15]=me^~Ae&Ne,e[24]=Ke^~rt&be,e[25]=Ve^~it&ye,e[34]=Se^~ze&We,e[35]=je^~Me&Ze,e[44]=et^~ge&Ie,e[45]=tt^~ve&Pe,e[6]=Ge^~nt&fe,e[7]=$e^~at&pe,e[16]=Ee^~De&qe,e[17]=Ae^~Ne&Le,e[26]=rt^~be&_e,e[27]=it^~ye&we,e[36]=ze^~We&Ye,e[37]=Me^~Ze&Xe,e[46]=ge^~Ie&Oe,e[47]=ve^~Pe&Te,e[8]=nt^~fe&ke,e[9]=at^~pe&xe,e[18]=De^~qe&Je,e[19]=Ne^~Le&Qe,e[28]=be^~_e&Be,e[29]=ye^~we&Ce,e[38]=We^~Ye&he,e[39]=Ze^~Xe&le,e[48]=Ie^~Oe&Ue,e[49]=Pe^~Te&He,e[0]^=ot[2*t],e[1]^=ot[2*t+1]}}},{}],335:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=e("./keccak-state-unroll");function a(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}a.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},a.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},a.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},t.exports=a},{"./keccak-state-unroll":334,"safe-buffer":447}],336:[function(e,t,r){var i=e("./_root").Symbol;t.exports=i},{"./_root":341}],337:[function(e,t,r){var i=e("./_Symbol"),n=e("./_getRawTag"),a=e("./_objectToString"),o=i?i.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},{"./_Symbol":336,"./_getRawTag":339,"./_objectToString":340}],338:[function(e,r,t){(function(e){var t="object"==(void 0===e?"undefined":_typeof(e))&&e&&e.Object===Object&&e;r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],339:[function(e,t,r){var i=e("./_Symbol"),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,s=i?i.toStringTag:void 0;t.exports=function(e){var t=a.call(e,s),r=e[s];try{var i=!(e[s]=void 0)}catch(e){}var n=o.call(e);return i&&(t?e[s]=r:delete e[s]),n}},{"./_Symbol":336}],340:[function(e,t,r){var i=Object.prototype.toString;t.exports=function(e){return i.call(e)}},{}],341:[function(e,t,r){var i=e("./_freeGlobal"),n="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,a=i||n||Function("return this")();t.exports=a},{"./_freeGlobal":338}],342:[function(e,t,r){var i=Array.isArray;t.exports=i},{}],343:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isObject");t.exports=function(e){if(!n(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},{"./_baseGetTag":337,"./isObject":344}],344:[function(e,t,r){t.exports=function(e){var t=void 0===e?"undefined":_typeof(e);return null!=e&&("object"==t||"function"==t)}},{}],345:[function(e,t,r){t.exports=function(e){return null!=e&&"object"==(void 0===e?"undefined":_typeof(e))}},{}],346:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isArray"),a=e("./isObjectLike");t.exports=function(e){return"string"==typeof e||!n(e)&&a(e)&&"[object String]"==i(e)}},{"./_baseGetTag":337,"./isArray":342,"./isObjectLike":345}],347:[function(e,t,r){t.exports=function(e){return void 0===e}},{}],348:[function(e,t,r){"use strict";var i=e("inherits"),n=e("hash-base"),a=e("safe-buffer").Buffer,o=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,r,i,n,a,o){return c(e+(t&r|~t&i)+n+a|0,o)+t|0}function f(e,t,r,i,n,a,o){return c(e+(t&i|r&~i)+n+a|0,o)+t|0}function p(e,t,r,i,n,a,o){return c(e+(t^r^i)+n+a|0,o)+t|0}function h(e,t,r,i,n,a,o){return c(e+(r^(t|~i))+n+a|0,o)+t|0}i(s,n),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,a=this._d;i=h(i=h(i=h(i=h(i=p(i=p(i=p(i=p(i=f(i=f(i=f(i=f(i=u(i=u(i=u(i=u(i,n=u(n,a=u(a,r=u(r,i,n,a,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),a,r,e[3],3250441966,22),n=u(n,a=u(a,r=u(r,i,n,a,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),a,r,e[7],4249261313,22),n=u(n,a=u(a,r=u(r,i,n,a,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),a,r,e[11],2304563134,22),n=u(n,a=u(a,r=u(r,i,n,a,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),a,r,e[15],1236535329,22),n=f(n,a=f(a,r=f(r,i,n,a,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),a,r,e[0],3921069994,20),n=f(n,a=f(a,r=f(r,i,n,a,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),a,r,e[4],3889429448,20),n=f(n,a=f(a,r=f(r,i,n,a,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),a,r,e[8],1163531501,20),n=f(n,a=f(a,r=f(r,i,n,a,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),a,r,e[12],2368359562,20),n=p(n,a=p(a,r=p(r,i,n,a,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),a,r,e[14],4259657740,23),n=p(n,a=p(a,r=p(r,i,n,a,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),a,r,e[10],3200236656,23),n=p(n,a=p(a,r=p(r,i,n,a,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),a,r,e[6],76029189,23),n=p(n,a=p(a,r=p(r,i,n,a,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),a,r,e[2],3299628645,23),n=h(n,a=h(a,r=h(r,i,n,a,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),a,r,e[5],4237533241,21),n=h(n,a=h(a,r=h(r,i,n,a,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),a,r,e[1],2240044497,21),n=h(n,a=h(a,r=h(r,i,n,a,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),a,r,e[13],1309151649,21),n=h(n,a=h(a,r=h(r,i,n,a,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),a,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+a|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e}},{}],355:[function(e,t,r){(t.exports=o).Minimatch=n;var u={sep:"/"};try{u=e("path")}catch(e){}var z=o.GLOBSTAR=n.GLOBSTAR={},i=e("brace-expansion"),M={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},D="[^/]*?",N="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{});var f=/\/+/;function a(t,r){t=t||{},r=r||{};var i={};return Object.keys(r).forEach(function(e){i[e]=r[e]}),Object.keys(t).forEach(function(e){i[e]=t[e]}),i}function o(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new n(t,r).match(e))}function n(e,t){if(!(this instanceof n))return new n(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==u.sep&&(e=e.split(u.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function s(e,t){if(t||(t=this instanceof n?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:i(e)}o.filter=function(i,n){return n=n||{},function(e,t,r){return o(e,i,n)}},o.defaults=function(i){if(!i||!Object.keys(i).length)return o;var n=o,e=function(e,t,r){return n.minimatch(e,t,a(i,r))};return e.Minimatch=function(e,t){return new n.Minimatch(e,a(i,t))},e},n.defaults=function(e){return e&&Object.keys(e).length?o.defaults(e).Minimatch:n},n.prototype.debug=function(){},n.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(f)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r},n.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=this.options,i=0;if(r.nonegate)return;for(var n=0,a=e.length;n>> no match, partial?",e,p,t,h),p!==o))}if("string"==typeof u?(c=i.nocase?f.toLowerCase()===u.toLowerCase():f===u,this.debug("string match",u,f,c)):(c=f.match(u),this.debug("pattern match",u,f,c)),!c)return!1}if(n===o&&a===s)return!0;if(n===o)return r;if(a===s)return n===o-1&&""===e[n];throw new Error("wtf?")}},{"brace-expansion":155,path:374}],356:[function(e,t,r){var c=e("crypto");function o(e,t,r){return c.createHmac(r,e).update(t).digest("base64")}function s(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function n(e,t){return t>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var n=s,a=i+r;e^=-1;for(var o=i;o>>8^n[255&(e^t[o])];return-1^e}},{}],362:[function(e,t,r){"use strict";var c,h=e("../utils/common"),u=e("./trees"),l=e("./adler32"),d=e("./crc32"),i=e("./messages"),f=0,p=4,m=0,g=-2,v=-1,b=4,n=2,y=8,_=9,a=286,o=30,s=19,w=2*a+1,k=15,x=3,S=258,j=S+x+1,E=42,A=113,I=1,P=2,O=3,T=4;function B(e,t){return e.msg=i[t],t}function C(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(h.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function z(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,R(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function D(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function N(e,t){var r,i,n=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-j?e.strstart-(e.w_size-j):0,u=e.window,f=e.w_mask,p=e.prev,h=e.strstart+S,l=u[a+o-1],d=u[a+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===d&&u[r+o-1]===l&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ac&&0!=--n);return o<=e.lookahead?o:e.lookahead}function q(e){var t,r,i,n,a,o,s,c,u,f,p=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-j)){for(h.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;i=e.head[--t],e.head[t]=p<=i?i-p:0,--r;);for(t=r=p;i=e.prev[--t],e.prev[t]=p<=i?i-p:0,--r;);n+=p}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,c=e.strstart+e.lookahead,u=n,f=void 0,f=o.avail_in,u=x)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(i=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(n=e.strstart+e.lookahead-x,i=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=n&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(q(e),0===e.lookahead&&t===f)return I;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,z(e,!1),0===e.strm.avail_out))return I;if(e.strstart-e.block_start>=e.w_size-j&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):(e.strstart>e.block_start&&(z(e,!1),e.strm.avail_out),I)}),new H(4,4,8,4,L),new H(4,5,16,8,L),new H(4,6,32,32,L),new H(4,4,16,16,U),new H(8,16,32,32,U),new H(8,16,128,128,U),new H(8,32,128,256,U),new H(32,128,258,1024,U),new H(32,258,258,4096,U)],r.deflateInit=function(e,t){return $(e,t,y,15,8,0)},r.deflateInit2=$,r.deflateReset=G,r.deflateResetKeep=V,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,m):g},r.deflate=function(e,t){var r,i,n,a;if(!e||!e.state||5>8&255),M(i,i.gzhead.time>>16&255),M(i,i.gzhead.time>>24&255),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(M(i,255&i.gzhead.extra.length),M(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=d(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(M(i,0),M(i,0),M(i,0),M(i,0),M(i,0),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,3),i.status=A);else{var o=y+(i.w_bits-8<<4)<<8;o|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(o|=32),o+=31-o%31,i.status=A,D(i,o),0!==i.strstart&&(D(i,e.adler>>>16),D(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending!==i.pending_buf_size));)M(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&R(e),i.pending+2<=i.pending_buf_size&&(M(i,255&e.adler),M(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(R(e),0===e.avail_out)return i.last_flush=-1,m}else if(0===e.avail_in&&C(t)<=C(r)&&t!==p)return B(e,-5);if(666===i.status&&0!==e.avail_in)return B(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==f&&666!==i.status){var s=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(q(e),0===e.lookahead)){if(t===f)return I;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):3===i.strategy?function(e,t){for(var r,i,n,a,o=e.window;;){if(e.lookahead<=S){if(q(e),e.lookahead<=S&&t===f)return I;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):c[i.level].func(i,t);if(s!==O&&s!==T||(i.status=666),s===I||s===O)return 0===e.avail_out&&(i.last_flush=-1),m;if(s===P&&(1===t?u._tr_align(i):5!==t&&(u._tr_stored_block(i,0,0,!1),3===t&&(F(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),R(e),0===e.avail_out))return i.last_flush=-1,m}return t!==p?m:i.wrap<=0?1:(2===i.wrap?(M(i,255&e.adler),M(i,e.adler>>8&255),M(i,e.adler>>16&255),M(i,e.adler>>24&255),M(i,255&e.total_in),M(i,e.total_in>>8&255),M(i,e.total_in>>16&255),M(i,e.total_in>>24&255)):(D(i,e.adler>>>16),D(i,65535&e.adler)),R(e),0=r.w_size&&(0===a&&(F(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new h.Buf8(r.w_size),h.arraySet(u,t,f-r.w_size,r.w_size,0),t=u,f=r.w_size),o=e.avail_in,s=e.next_in,c=e.input,e.avail_in=f,e.next_in=0,e.input=t,q(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=_=y>>>24,d-=_,0===(_=y>>>16&255))E[a++]=65535&y;else{if(!(16&_)){if(0==(64&_)){y=m[(65535&y)+(l&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&y,(_&=15)&&(d<_&&(l+=j[i++]<>>=_,d-=_),d<15&&(l+=j[i++]<>>=_=y>>>24,d-=_,!(16&(_=y>>>16&255))){if(0==(64&_)){y=g[(65535&y)+(l&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&y,d<(_&=15)&&(l+=j[i++]<>>=_,d-=_,(_=a-o)>3,l&=(1<<(d-=w<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new P.Buf16(320),this.work=new P.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=D,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new P.Buf32(i),t.distcode=t.distdyn=new P.Buf32(n),t.sane=1,t.back=-1,z):M}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):M}function c(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=a.wsize?(P.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(n=a.wsize-a.wnext)&&(n=i),P.arraySet(a.window,t,r-i,n,a.wnext),(i-=n)?(P.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=T(r.check,A,2,0),f=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(f-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=3;case 3:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>8&255,A[2]=u>>>16&255,A[3]=u>>>24&255,r.check=T(r.check,A,4,0)),f=u=0,r.mode=4;case 4:for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>8),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>>8&255,r.check=T(r.check,A,2,0)),f=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(s<(l=r.length)&&(l=s),l&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),P.arraySet(r.head.extra,i,a,l,k)),512&r.flags&&(r.check=T(r.check,i,l,a)),s-=l,a+=l,r.length-=l),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;for(l=0;k=i[a+l++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&l>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>=7&f,f-=7&f,r.mode=27;break}for(;f<3;){if(0===s)break e;s--,u+=i[a++]<>>=1)){case 0:r.mode=14;break;case 1:if(q(r),r.mode=20,6!==t)break;u>>>=2,f-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,f-=2;break;case 14:for(u>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,u+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,f=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(l=r.length){if(s>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,286>>=3,f-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=C(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=g,f-=g,r.lens[r.have++]=b;else{if(16===b){for(j=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],l=3+(3&u),u>>>=2,f-=2}else if(17===b){for(j=g+3;f>>=g)),u>>>=3,f-=3}else{for(j=g+7;f>>=g)),u>>>=7,f-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;l--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=C(F,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=C(R,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=s&&258<=c){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,r.hold=u,r.bits=f,B(e,h),o=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,u=r.hold,f=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;v=(E=r.lencode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,r.length=b,0===v){r.mode=26;break}if(32&v){r.back=-1,r.mode=12;break}if(64&v){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&v,r.mode=22;case 22:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=(E=r.distcode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&v,r.mode=24;case 24:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===c)break e;if(l=h-c,r.offset>l){if((l=r.offset-l)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d=l>r.wnext?(l-=r.wnext,r.wsize-l):r.wnext-l,l>r.length&&(l=r.length),m=r.window}else m=n,d=o-r.offset,l=r.length;for(cl?(m=B[C+o[y]],I[P+o[y]]):(m=96,0),c=1<>S)+(u-=c)]=d<<24|m<<16|g|0,0!==u;);for(c=1<>=1;if(0!==c?(A&=c-1,A+=c):A=0,y++,0==--O[b]){if(b===w)break;b=t[r+o[y]]}if(k>>7)]}function M(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function D(e,t,r){e.bi_valid>n-r?(e.bi_buf|=t<>n-e.bi_valid,e.bi_valid+=r-n):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function L(e,t,r){var i,n,a=new Array(v+1),o=0;for(i=1;i<=v;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=q(a[s]++,s))}}function U(e){var t;for(t=0;t>1;1<=r;r--)V(e,a,r);for(n=c;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],V(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,a[2*n]=a[2*r]+a[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,a[2*r+1]=a[2*i+1]=n,e.heap[1]=n++,V(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,n,a,o,s,c=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,p=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(a=0;a<=v;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return s;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return u;for(t=32;t>>3,(a=e.static_len+3+7>>>3)<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==t?X(e,t,r,i):4===e.strategy||a===n?(D(e,2+(i?1:0),3),G(e,E,A)):(D(e,4+(i?1:0),3),function(e,t,r,i){var n;for(D(e,t-257,5),D(e,r-1,5),D(e,i-4,4),n=0;n>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(P[r]+p+1)]++,e.dyn_dtree[2*z(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;D(e,2,3),N(e,b,E),16===(t=e).bi_valid?(M(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":358}],368:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],369:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],370:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var a=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=a;var o=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=o;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var f=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=f,r.DSAparam=i.define("DSAparam",function(){this.int()});var p=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=p;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":371,"asn1.js":46}],371:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),a=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(a)}),u=i.define("RDNSequence",function(){this.seqof(c)}),f=i.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),p=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(f),this.key("validity").use(p),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),d=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=d},{"asn1.js":46}],372:[function(e,t,r){(function(h){var l=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,d=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m,m=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,g=e("evp_bytestokey"),v=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(l);if(n){var a="aes"+n[1],o=new h(n[2],"hex"),s=new h(n[3].replace(/[\r\n]/g,""),"base64"),c=g(t,o.slice(0,8),parseInt(n[1],10)).key,u=[],f=v.createDecipheriv(a,c,o);u.push(f.update(s)),u.push(f.final()),r=h.concat(u)}else{var p=i.match(m);r=new h(p[2].replace(/[\r\n]/g,""),"base64")}return{tag:i.match(d)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":160,buffer:191,evp_bytestokey:270}],373:[function(t,r,e){(function(b){var y=t("./asn1"),_=t("./aesid.json"),w=t("./fixProc"),k=t("browserify-aes"),x=t("pbkdf2");function e(e){var t;"object"!==(void 0===e?"undefined":_typeof(e))||b.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new b(e));var r,i,n,a,o,s,c,u,f,p,h,l,d,m=w(e,t),g=m.tag,v=m.data;switch(g){case"CERTIFICATE":i=y.certificate.decode(v,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=y.PublicKey.decode(v,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=y.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"ENCRYPTED PRIVATE KEY":v=y.EncryptedPrivateKey.decode(v,"der"),a=t,o=(n=v).algorithm.decrypt.kde.kdeparams.salt,s=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=_[n.algorithm.decrypt.cipher.algo.join(".")],u=n.algorithm.decrypt.cipher.iv,f=n.subjectPrivateKey,p=parseInt(c.split("-")[1],10)/8,h=x.pbkdf2Sync(a,o,s,p),l=k.createDecipheriv(c,h,u),(d=[]).push(l.update(f)),d.push(l.final()),v=b.concat(d);case"PRIVATE KEY":switch(r=(i=y.PrivateKey.decode(v,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:y.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=y.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"RSA PUBLIC KEY":return y.RSAPublicKey.decode(v,"der");case"RSA PRIVATE KEY":return y.RSAPrivateKey.decode(v,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:y.DSAPrivateKey.decode(v,"der")};case"EC PRIVATE KEY":return{curve:(v=y.ECPrivateKey.decode(v,"der")).parameters.value,privateKey:v.privateKey};default:throw new Error("unknown key type "+g)}}(r.exports=e).signature=y.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":369,"./asn1":370,"./fixProc":372,"browserify-aes":160,buffer:191,pbkdf2:375}],374:[function(e,t,u){(function(n){function a(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function o(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;ia?t=n(t):t.length "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+o+";","var res;","switch (argLength) {",r.concat(["extra"]).map(function(e,t){return"case "+t+":res = fn.call("+["self"].concat(r.slice(0,t)).concat("cb").join(",")+");break;"}).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],n)(a,e)}(e)};var o="function (err, res) {if (err) { rj(err); } else { rs(res); }}";a.nodeify=function(r){return function(){var e=Array.prototype.slice.call(arguments),t="function"==typeof e[e.length-1]?e.pop():null,i=this;try{return r.apply(this,arguments).nodeify(t,i)}catch(r){if(null==t)return new a(function(e,t){t(r)});n(function(){t.call(i,r)})}}},a.prototype.nodeify=function(t,r){if("function"!=typeof t)return this;this.then(function(e){n(function(){t.call(r,null,e)})},function(e){n(function(){t.call(r,e)})})}},{"./core.js":384,asap:44}],390:[function(e,t,r){"use strict";var i=e("./core.js");(t.exports=i).enableSynchronous=function(){i.prototype.isPending=function(){return 0==this.getState()},i.prototype.isFulfilled=function(){return 1==this.getState()},i.prototype.isRejected=function(){return 2==this.getState()},i.prototype.getValue=function(){if(3===this._65)return this._55.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._55},i.prototype.getReason=function(){if(3===this._65)return this._55.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._55},i.prototype.getState=function(){return 3===this._65?this._55.getState():-1===this._65||-2===this._65?0:this._65}},i.disableSynchronous=function(){i.prototype.isPending=void 0,i.prototype.isFulfilled=void 0,i.prototype.isRejected=void 0,i.prototype.getValue=void 0,i.prototype.getReason=void 0,i.prototype.getState=void 0}},{"./core.js":384}],391:[function(e,t,r){"use strict";var n=function(e){for(var t=e.toString(16);4!==t.length;)t="0"+t;return"\\u"+t};t.exports=function(e,t,r,i){return!r.key||61!==t&&58!==t&&t!==r.separator?31o||0<=new u(t).cmp(a.modulus))throw new Error("decryption error");n=r?d(new u(t),a):h(t,a);var s=m.alloc(o-n.length);if(n=m.concat([s,n],o),4===i)return function(e,t){var r=e.modulus.byteLength(),i=l("sha1").update(m.alloc(0)).digest(),n=i.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,n+1),o=t.slice(n+1),s=p(a,f(o,n)),c=p(o,f(s,r-n-1));if(function(e,t){e=m.from(e),t=m.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){a++;break}var o=t.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&a++;o.length<8&&a++;if(a)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}},{"./mgf":401,"./withPublic":404,"./xor":405,"bn.js":154,"browserify-rsa":178,"create-hash":200,"parse-asn1":373,"safe-buffer":447}],403:[function(e,t,r){var o=e("parse-asn1"),h=e("randombytes"),l=e("create-hash"),d=e("./mgf"),m=e("./xor"),g=e("bn.js"),s=e("./withPublic"),c=e("browserify-rsa"),v=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,a=o(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=l("sha1").update(v.alloc(0)).digest(),a=n.length,o=2*a;if(r-o-2>6]+a[128|63&n]:n<55296||57344<=n?r+=a[224|n>>12]+a[128|n>>6&63]+a[128|63&n]:(i+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),r+=a[240|n>>18]+a[128|n>>12&63]+a[128|n>>6&63]+a[128|63&n])}return r},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function i(r,n,a){if(!n)return r;if("object"!==(void 0===n?"undefined":_typeof(n))){if(Array.isArray(r))r.push(n);else{if("object"!==(void 0===r?"undefined":_typeof(r)))return[r,n];(a.plainObjects||a.allowPrototypes||!o.call(Object.prototype,n))&&(r[n]=!0)}return r}if("object"!==(void 0===r?"undefined":_typeof(r)))return[r].concat(n);var e=r;return Array.isArray(r)&&!Array.isArray(n)&&(e=s(r,a)),Array.isArray(r)&&Array.isArray(n)?(n.forEach(function(e,t){o.call(r,t)?r[t]&&"object"===_typeof(r[t])?r[t]=i(r[t],e,a):r.push(e):r[t]=e}),r):Object.keys(n).reduce(function(e,t){var r=n[t];return o.call(e,t)?e[t]=i(e[t],r,a):e[t]=r,e},e)}}},{}],411:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var a=/\+/g;e=e.split(t);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var s,c,u=e.length;0t.highWaterMark&&(t.highWaterMark=(m<=(r=e)?r=m:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(_("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?v.nextTick(x,e):x(e))}function x(e){_("emit readable"),e.emit("readable"),I(e)}function S(e,t){t.readingMore||(t.readingMore=!0,v.nextTick(j,e,t))}function j(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;ea.length?a.length:e;if(o===a.length?n+=a:n+=a.slice(0,e),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=a.slice(o);break}++i}return t.length-=i,n}(e,t):function(e,t){var r=u.allocUnsafe(e),i=t.head,n=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i).data=a.slice(o);break}++n}return t.length-=n,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return _("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):k(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,n=t.needReadable;return _("need readable",n),(0===t.length||t.length-e>>0),a=this.head,o=0;a;)t=a.data,r=n,i=o,t.copy(r,i),o+=a.data.length,a=a.next;return n},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":447,util:157}],423:[function(e,t,r){"use strict";var a=e("process-nextick-args");function o(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a.nextTick(o,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(o,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":381}],424:[function(e,t,r){t.exports=e("events").EventEmitter},{events:269}],425:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":426}],426:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":417,"./lib/_stream_passthrough.js":418,"./lib/_stream_readable.js":419,"./lib/_stream_transform.js":420,"./lib/_stream_writable.js":421}],427:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":426}],428:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":421}],429:[function(e,t,r){"use strict";var s=e("../"),c=e("lodash/isArray"),u=e("lodash/isFunction"),f=e("lodash/isObjectLike");t.exports=function(e){var t="Please verify options";if(!f(e))throw new TypeError(t);if(!u(e.request))throw new TypeError(t+".request");if(!c(e.expose)||0===e.expose.length)throw new TypeError(t+".expose");for(var r=s({PromiseImpl:e.PromiseImpl,constructorMixin:e.constructorMixin}),i=e.request.Request.prototype.init,n=!(e.request.Request.prototype.init=function(e){return!f(e)||this._callback||this._rp_promise||r.init.call(this,e),i.apply(this,arguments)}),a=0;a=t.maxRedirects)return r.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+r.uri.href)),!1;t.redirectsFollowed+=1,o.test(i)||(i=a.resolve(r.uri.href,i));var n=r.uri;return r.uri=a.parse(i),r.uri.protocol!==n.protocol&&delete r.agent,t.redirects.push({statusCode:e.statusCode,redirectUri:i}),t.followAllRedirects&&"HEAD"!==r.method&&401!==e.statusCode&&307!==e.statusCode&&(r.method=t.followOriginalHttpMethod?r.method:"GET"),delete r.src,delete r.req,delete r._started,401!==e.statusCode&&307!==e.statusCode&&(delete r.body,delete r._form,r.headers&&(r.removeHeader("host"),r.removeHeader("content-type"),r.removeHeader("content-length"),r.uri.hostname!==r.originalHost.split(":")[0]&&r.removeHeader("authorization"))),t.removeRefererHeader||r.setHeader("referer",n.href),r.emit("redirect"),r.init(),!0},r.Redirect=i},{url:500}],444:[function(e,t,r){"use strict";var w=e("url"),k=e("tunnel-agent"),i=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],x=["proxy-authorization"];function n(e){this.request=e,this.proxyHeaderWhiteList=i,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}n.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},n.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=w.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,i,n,a,o,s,c=this.proxyHeaderExclusiveList.concat(x),u=this.proxyHeaderWhiteList.concat(c),f=(r=t.headers,i=u.reduce(function(e,t){return e[t.toLowerCase()]=!0,e},{}),Object.keys(r).filter(function(e){return i[e.toLowerCase()]}).reduce(function(e,t){return e[t]=r[t],e},{}));f.host=(n=t.uri,a=n.port,o=n.protocol,s=n.hostname+":",s+=a||("https:"===o?"443":"80")),c.forEach(t.removeHeader,t);var p,h,l,d,m,g,v,b,y=(l=(p=t).uri,d=p.proxy,h=d,m=["https:"===l.protocol?"https":"http","https:"===h.protocol?"Https":"Http"].join("Over"),k[m]),_=(v=f,{proxy:{host:(b=(g=t).proxy).hostname,port:+b.port,proxyAuth:b.auth,headers:v},headers:g.headers,ca:g.ca,cert:g.cert,key:g.key,passphrase:g.passphrase,pfx:g.pfx,ciphers:g.ciphers,rejectUnauthorized:g.rejectUnauthorized,secureOptions:g.secureOptions,secureProtocol:g.secureProtocol});return t.agent=y(_),!0},n.defaultProxyHeaderWhiteList=i,n.defaultProxyHeaderExclusiveList=x,r.Tunnel=n},{"tunnel-agent":497,url:500}],445:[function(U,H,e){(function(e){"use strict";var w=U("http"),k=U("https"),x=U("url"),t=U("util"),n=U("stream"),f=U("zlib"),c=U("aws-sign2"),u=U("aws4"),i=U("http-signature"),S=U("mime-types"),j=U("caseless"),E=U("forever-agent"),r=U("form-data"),a=U("extend"),A=U("isstream"),I=U("is-typedarray").strict,o=U("./lib/helpers"),s=U("./lib/cookies"),P=U("./lib/getProxyFromURI"),p=U("./lib/querystring").Querystring,h=U("./lib/har").Har,l=U("./lib/auth").Auth,d=U("./lib/oauth").OAuth,m=U("./lib/hawk"),g=U("./lib/multipart").Multipart,v=U("./lib/redirect").Redirect,b=U("./lib/tunnel").Tunnel,y=U("performance-now"),O=U("safe-buffer").Buffer,_=o.safeStringify,T=o.isReadStream,B=o.toBase64,C=o.defer,F=o.copy,R=o.version,z=s.jar(),M={};function D(){return{uri:this.uri,method:this.method,headers:this.headers}}function N(){return{statusCode:this.statusCode,body:this.body,headers:this.headers,request:D.call(this.request)}}function q(e){var t=this;e.har&&(t._har=new h(t),e=t._har.options(e)),n.Stream.call(t);var r=Object.keys(q.prototype),i=function(e,t){var r={};for(var i in t)-1===e.indexOf(i)&&(r[i]=t[i]);return r}(r,e);a(t,i),e=function(e,t){var r={};for(var i in t){var n=!(-1===e.indexOf(i)),a="function"==typeof t[i];n&&a||(r[i]=t[i])}return r}(r,e),t.readable=!0,t.writable=!0,e.method&&(t.explicitMethod=!0),t._qs=new p(t),t._auth=new l(t),t._oauth=new d(t),t._multipart=new g(t),t._redirect=new v(t),t._tunnel=new b(t),t.init(e)}function L(){q.debug&&console.error("REQUEST %s",t.format.apply(t,arguments))}t.inherits(q,n.Stream),q.debug=e.env.NODE_DEBUG&&/\brequest\b/.test(e.env.NODE_DEBUG),q.prototype.debug=L,q.prototype.init=function(e){var i=this;for(var t in e||(e={}),i.headers=i.headers?F(i.headers):{},i.headers)void 0===i.headers[t]&&delete i.headers[t];if(j.httpify(i,i.headers),i.method||(i.method=e.method||"GET"),i.localAddress||(i.localAddress=e.localAddress),i._qs.init(e),L(e),i.pool||!1===i.pool||(i.pool=M),i.dests=i.dests||[],i.__isRequestRequest=!0,!i._callback&&i.callback&&(i._callback=i.callback,i.callback=function(){i._callbackCalled||(i._callbackCalled=!0,i._callback.apply(i,arguments))},i.on("error",i.callback.bind()),i.on("complete",i.callback.bind(i,null))),!i.uri&&i.url&&(i.uri=i.url,delete i.url),i.baseUrl){if("string"!=typeof i.baseUrl)return i.emit("error",new Error("options.baseUrl must be a string"));if("string"!=typeof i.uri)return i.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(0===i.uri.indexOf("//")||-1!==i.uri.indexOf("://"))return i.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var r=i.baseUrl.lastIndexOf("/")===i.baseUrl.length-1,n=0===i.uri.indexOf("/");r&&n?i.uri=i.baseUrl+i.uri.slice(1):r||n?i.uri=i.baseUrl+i.uri:""===i.uri?i.uri=i.baseUrl:i.uri=i.baseUrl+"/"+i.uri,delete i.baseUrl}if(!i.uri)return i.emit("error",new Error("options.uri is a required argument"));if("string"==typeof i.uri&&(i.uri=x.parse(i.uri)),i.uri.href||(i.uri.href=x.format(i.uri)),"unix:"===i.uri.protocol)return i.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if("unix"===i.uri.host&&i.enableUnixSocket(),!1===i.strictSSL&&(i.rejectUnauthorized=!1),i.uri.pathname||(i.uri.pathname="/"),!(i.uri.host||i.uri.hostname&&i.uri.port||i.uri.isUnix)){var a='Invalid URI "'+x.format(i.uri)+'"';return 0===Object.keys(e).length&&(a+=". This can be caused by a crappy redirection."),i.abort(),i.emit("error",new Error(a))}if(i.hasOwnProperty("proxy")||(i.proxy=P(i.uri)),i.tunnel=i._tunnel.isEnabled(),i.proxy&&i._tunnel.setup(e),i._redirect.onRequest(e),i.setHost=!1,!i.hasHeader("host")){var o=i.originalHostHeaderName||"host";i.setHeader(o,i.uri.host),i.uri.port&&("80"===i.uri.port&&"http:"===i.uri.protocol||"443"===i.uri.port&&"https:"===i.uri.protocol)&&i.setHeader(o,i.uri.hostname),i.setHost=!0}if(i.jar(i._jar||e.jar),i.uri.port||("http:"===i.uri.protocol?i.uri.port=80:"https:"===i.uri.protocol&&(i.uri.port=443)),i.proxy&&!i.tunnel?(i.port=i.proxy.port,i.host=i.proxy.hostname):(i.port=i.uri.port,i.host=i.uri.hostname),e.form&&i.form(e.form),e.formData){var s=e.formData,c=i.form(),u=function(e,t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?c.append(e,t.value,t.options):c.append(e,t)};for(var f in s)if(s.hasOwnProperty(f)){var p=s[f];if(p instanceof Array)for(var h=0;h>>32-t}function S(e,t,r,i,n,a,o,s){return x(e+(t^r^i)+a+o|0,s)+n|0}function j(e,t,r,i,n,a,o,s){return x(e+(t&r|~t&i)+a+o|0,s)+n|0}function E(e,t,r,i,n,a,o,s){return x(e+((t|~r)^i)+a+o|0,s)+n|0}function A(e,t,r,i,n,a,o,s){return x(e+(t&i|r&~i)+a+o|0,s)+n|0}function I(e,t,r,i,n,a,o,s){return x(e+(t^(r|~i))+a+o|0,s)+n|0}n(o,a),o.prototype._update=function(){for(var e=g,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,a=0|this._d,o=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,f=0|this._d,p=0|this._e,h=0;h<80;h+=1){var l,d;d=h<16?(l=S(r,i,n,a,o,e[v[h]],w[0],y[h]),I(s,c,u,f,p,e[b[h]],k[0],_[h])):h<32?(l=j(r,i,n,a,o,e[v[h]],w[1],y[h]),A(s,c,u,f,p,e[b[h]],k[1],_[h])):h<48?(l=E(r,i,n,a,o,e[v[h]],w[2],y[h]),E(s,c,u,f,p,e[b[h]],k[2],_[h])):h<64?(l=A(r,i,n,a,o,e[v[h]],w[3],y[h]),j(s,c,u,f,p,e[b[h]],k[3],_[h])):(l=I(r,i,n,a,o,e[v[h]],w[4],y[h]),S(s,c,u,f,p,e[b[h]],k[4],_[h])),r=o,o=a,a=x(n,10),n=i,i=l,s=p,p=f,f=x(u,10),u=c,c=d}var m=this._b+n+f|0;this._b=this._c+a+p|0,this._c=this._d+o+s|0,this._d=this._e+r+c|0,this._e=this._a+i+u|0,this._a=m},o.prototype._digest=function(){this._block[this._blockOffset++]=128,56=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 a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":447}],450:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":451,"./sha1":452,"./sha224":453,"./sha256":454,"./sha384":455,"./sha512":456}],451:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,v=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s=this._w,c=0|this._a,u=0|this._b,f=0|this._c,p=0|this._d,h=0|this._e,l=0;l<16;++l)s[l]=e.readInt32BE(4*l);for(;l<80;++l)s[l]=s[l-3]^s[l-8]^s[l-14]^s[l-16];for(var d=0;d<80;++d){var m=~~(d/20),g=0|((o=c)<<5|o>>>27)+(i=u,n=f,a=p,0===(r=m)?i&n|~i&a:2===r?i&n|i&a|n&a:i^n^a)+h+s[d]+v[m];h=p,p=f,f=(t=u)<<30|t>>>2,u=c,c=g}this._a=c+this._a|0,this._b=u+this._b|0,this._c=f+this._c|0,this._d=p+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],452:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0;d<16;++d)c[d]=e.readInt32BE(4*d);for(;d<80;++d)c[d]=(t=c[d-3]^c[d-8]^c[d-14]^c[d-16])<<1|t>>>31;for(var m=0;m<80;++m){var g=~~(m/20),v=0|((s=u)<<5|s>>>27)+(n=f,a=p,o=h,0===(i=g)?n&a|~n&o:2===i?n&a|n&o|a&o:n^a^o)+l+c[m]+b[g];l=h,h=p,p=(r=f)<<30|r>>>2,f=u,u=v}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],453:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}i(c,n),c.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},c.prototype._hash=function(){var e=o.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},t.exports=c},{"./hash":449,"./sha256":454,inherits:320,"safe-buffer":447}],454:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,w=[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],o=new Array(64);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0|this._f,m=0|this._g,g=0|this._h,v=0;v<16;++v)c[v]=e.readInt32BE(4*v);for(;v<64;++v)c[v]=0|(((r=c[v-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+c[v-7]+(((t=c[v-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+c[v-16];for(var b=0;b<64;++b){var y=g+(((s=l)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((o=m)^l&(d^o))+w[b]+c[b]|0,_=0|(((a=u)>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+((i=u)&(n=f)|p&(i|n));g=m,m=d,d=l,l=h+y|0,h=p,p=f,f=u,u=y+_|0}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],455:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(160);function c(){this.init(),this._w=s,a.call(this,128,112)}i(c,n),c.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},c.prototype._hash=function(){var i=o.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=c},{"./hash":449,"./sha512":456,inherits:320,"safe-buffer":447}],456:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,ee=[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],o=new Array(160);function s(){this.init(),this._w=o,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ae(e,t){return e>>>0>>0?1:0}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c,u=this._w,f=0|this._ah,p=0|this._bh,h=0|this._ch,l=0|this._dh,d=0|this._eh,m=0|this._fh,g=0|this._gh,v=0|this._hh,b=0|this._al,y=0|this._bl,_=0|this._cl,w=0|this._dl,k=0|this._el,x=0|this._fl,S=0|this._gl,j=0|this._hl,E=0;E<32;E+=2)u[E]=e.readInt32BE(4*E),u[E+1]=e.readInt32BE(4*E+4);for(;E<160;E+=2){var A=u[E-30],I=u[E-30+1],P=((s=A)>>>1|(c=I)<<31)^(s>>>8|c<<24)^s>>>7,O=((a=I)>>>1|(o=A)<<31)^(a>>>8|o<<24)^(a>>>7|o<<25);A=u[E-4],I=u[E-4+1];var T=((i=A)>>>19|(n=I)<<13)^(n>>>29|i<<3)^i>>>6,B=((t=I)>>>19|(r=A)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),C=u[E-14],F=u[E-14+1],R=u[E-32],z=u[E-32+1],M=O+F|0,D=P+C+ae(M,O)|0;D=(D=D+T+ae(M=M+B|0,B)|0)+R+ae(M=M+z|0,z)|0,u[E]=D,u[E+1]=M}for(var N=0;N<160;N+=2){D=u[N],M=u[N+1];var q=re(f,p,h),L=re(b,y,_),U=ie(f,b),H=ie(b,f),K=ne(d,k),V=ne(k,d),G=ee[N],$=ee[N+1],W=te(d,m,g),Z=te(k,x,S),Y=j+V|0,X=v+K+ae(Y,j)|0;X=(X=(X=X+W+ae(Y=Y+Z|0,Z)|0)+G+ae(Y=Y+$|0,$)|0)+D+ae(Y=Y+M|0,M)|0;var J=H+L|0,Q=U+q+ae(J,H)|0;v=g,j=S,g=m,S=x,m=d,x=k,d=l+X+ae(k=w+Y|0,w)|0,l=h,w=_,h=p,_=y,p=f,y=b,f=X+Q+ae(b=Y+J|0,Y)|0}this._al=this._al+b|0,this._bl=this._bl+y|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+k|0,this._fl=this._fl+x|0,this._gl=this._gl+S|0,this._hl=this._hl+j|0,this._ah=this._ah+f+ae(this._al,b)|0,this._bh=this._bh+p+ae(this._bl,y)|0,this._ch=this._ch+h+ae(this._cl,_)|0,this._dh=this._dh+l+ae(this._dl,w)|0,this._eh=this._eh+d+ae(this._el,k)|0,this._fh=this._fh+m+ae(this._fl,x)|0,this._gh=this._gh+g+ae(this._gl,S)|0,this._hh=this._hh+v+ae(this._hl,j)|0},s.prototype._hash=function(){var i=a.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],457:[function(e,t,r){var i=e("safer-buffer").Buffer,n={dsa:{parts:["p","q","g","y"],sizePart:"p"},rsa:{parts:["e","n"],sizePart:"n"},ecdsa:{parts:["curve","Q"],sizePart:"Q"},ed25519:{parts:["A"],sizePart:"A"}};n.curve25519=n.ed25519;var a={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};a.curve25519=a.ed25519;var o={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:i.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g,""),"hex"),s:i.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g,""),"hex"),n:i.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g,""),"hex"),G:i.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g,""),"hex"),s:i.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g,""),"hex"),n:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g,""),"hex"),G:i.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:i.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g,""),"hex"),a:i.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g,""),"hex"),s:i.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g,""),"hex"),n:i.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g,""),"hex"),G:i.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g,""),"hex")}};t.exports={info:n,privInfo:a,hashAlgs:{md5:!0,sha1:!0,sha256:!0,sha384:!0,sha512:!0},curves:o}},{"safer-buffer":448}],458:[function(e,t,r){t.exports=_;var d=e("assert-plus"),m=e("safer-buffer").Buffer,i=e("./algs"),n=e("crypto"),a=e("./fingerprint"),o=(e("./signature"),e("./errors")),g=(e("util"),e("./utils")),v=e("./key"),b=e("./private-key"),y=e("./identity"),s={};s.openssh=e("./formats/openssh-cert"),s.x509=e("./formats/x509"),s.pem=e("./formats/x509-pem");var c=o.CertificateParseError,u=o.InvalidAlgorithmError;function _(e){d.object(e,"options"),d.arrayOfObject(e.subjects,"options.subjects"),g.assertCompatible(e.subjects[0],y,[1,0],"options.subjects"),g.assertCompatible(e.subjectKey,v,[1,0],"options.subjectKey"),g.assertCompatible(e.issuer,y,[1,0],"options.issuer"),void 0!==e.issuerKey&&g.assertCompatible(e.issuerKey,v,[1,0],"options.issuerKey"),d.object(e.signatures,"options.signatures"),d.buffer(e.serial,"options.serial"),d.date(e.validFrom,"options.validFrom"),d.date(e.validUntil,"optons.validUntil"),d.optionalArrayOfString(e.purposes,"options.purposes"),this._hashCache={},this.subjects=e.subjects,this.issuer=e.issuer,this.subjectKey=e.subjectKey,this.issuerKey=e.issuerKey,this.signatures=e.signatures,this.serial=e.serial,this.validFrom=e.validFrom,this.validUntil=e.validUntil,this.purposes=e.purposes}_.formats=s,_.prototype.toBuffer=function(e,t){return void 0===e&&(e="x509"),d.string(e,"format"),d.object(s[e],"formats[format]"),d.optionalObject(t,"options"),s[e].write(this,t)},_.prototype.toString=function(e,t){return void 0===e&&(e="pem"),this.toBuffer(e,t).toString()},_.prototype.fingerprint=function(e){void 0===e&&(e="sha256"),d.string(e,"algorithm");var t={type:"certificate",hash:this.hash(e),algorithm:e};return new a(t)},_.prototype.hash=function(e){if(d.string(e,"algorithm"),e=e.toLowerCase(),void 0===i.hashAlgs[e])throw new u(e);if(this._hashCache[e])return this._hashCache[e];var t=n.createHash(e).update(this.toBuffer("x509")).digest();return this._hashCache[e]=t},_.prototype.isExpired=function(e){return void 0===e&&(e=new Date),!(e.getTime()>=this.validFrom.getTime()&&e.getTime()e.length||"BEGIN"!==e.slice(t,t+5).toString("ascii"))}(e))return a.read(e,t);if(function(e){var t=0;for(;to.length&&(p=o.length),u+=c.write(o.slice(f,p),u),c[u++]=10,f=p}return u+=c.write("-----END "+i+"-----\n",u),c.slice(0,u)}};var b=e("assert-plus"),y=e("asn1"),_=e("crypto"),w=e("safer-buffer").Buffer,k=(e("../algs"),e("../utils")),h=e("../key"),l=e("../private-key"),x=e("./pkcs1"),S=e("./pkcs8"),j=e("./ssh-private"),E=e("./rfc4253"),A=e("../errors")},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../utils":480,"./pkcs1":467,"./pkcs8":468,"./rfc4253":469,"./ssh-private":470,asn1:65,"assert-plus":66,crypto:204,"safer-buffer":448}],467:[function(e,t,r){t.exports={read:function(e,t){return i.read(e,t,"pkcs1")},readPkcs1:function(e,t,r){switch(e){case"RSA":if("public"===t)return u=y(c=r,"modulus"),f=y(c,"exponent"),new p({type:"rsa",parts:[{name:"e",data:f},{name:"n",data:u}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t[0],0);var r=y(e,"modulus"),i=y(e,"public exponent"),n=y(e,"private exponent"),a=y(e,"prime1"),o=y(e,"prime2"),s=y(e,"exponent1"),c=y(e,"exponent2"),u=y(e,"iqmp");return new v({type:"rsa",parts:[{name:"n",data:r},{name:"e",data:i},{name:"d",data:n},{name:"iqmp",data:u},{name:"p",data:a},{name:"q",data:o},{name:"dmodp",data:s},{name:"dmodq",data:c}]})}(r);throw new Error("Unknown key type: "+t);case"DSA":if("public"===t)return n=y(i=r,"y"),a=y(i,"p"),o=y(i,"q"),s=y(i,"g"),new p({type:"dsa",parts:[{name:"y",data:n},{name:"p",data:a},{name:"q",data:o},{name:"g",data:s}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),0);var r=y(e,"p"),i=y(e,"q"),n=y(e,"g"),a=y(e,"y"),o=y(e,"x");return new v({type:"dsa",parts:[{name:"p",data:r},{name:"q",data:i},{name:"g",data:n},{name:"y",data:a},{name:"x",data:o}]})}(r);throw new Error("Unknown key type: "+t);case"EC":case"ECDSA":if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),1);var r=e.readString(l.Ber.OctetString,!0);e.readSequence(160);var i=b(e);h.string(i,"a known elliptic curve"),e.readSequence(161);var n=e.readString(l.Ber.BitString,!0);n=g.ecNormalize(n);var a={type:"ecdsa",parts:[{name:"curve",data:d.from(i)},{name:"Q",data:n},{name:"d",data:r}]};return new v(a)}(r);if("public"===t)return function(e){e.readSequence();var t=e.readOID();h.strictEqual(t,"1.2.840.10045.2.1","must be ecPublicKey");for(var r,i=e.readOID(),n=Object.keys(m.curves),a=0;aS.length&&(I=S.length),E+=x.write(S.slice(A,I),E),x[E++]=10,A=I}return E+=x.write("-----END "+k+"-----\n",E),x.slice(0,E)}};var O,T=P("assert-plus"),B=(P("asn1"),P("safer-buffer").Buffer),C=(P("../algs"),P("../utils")),F=P("crypto"),R=(P("../key"),P("../private-key")),r=P("./pem"),A=P("./rfc4253"),z=P("../ssh-buffer"),I=P("../errors");var M="openssh-key-v1"},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../ssh-buffer":479,"../utils":480,"./pem":466,"./rfc4253":469,asn1:65,"assert-plus":66,"bcrypt-pbkdf":76,crypto:204,"safer-buffer":448}],471:[function(e,t,r){t.exports={read:function(e,t){"string"!=typeof e&&(h.buffer(e,"buf"),e=e.toString("ascii"));var r=e.trim().replace(/[\\\r]/g,""),i=r.match(m);i||(i=r.match(g));h.ok(i,"key must match regex");var n,a=d.algToKeyType(i[1]),o=l.from(i[2],"base64"),s={};if(i[4])try{n=d.read(o)}catch(e){i=r.match(g),h.ok(i,"key must match regex"),o=l.from(i[2],"base64"),n=d.readInternal(s,"public",o)}else n=d.readInternal(s,"public",o);if(h.strictEqual(a,n.type),i[4]&&0n.length&&(u=n.length),s+=o.write(n.slice(c,u),s),o[s++]=10,c=u}return s+=o.write("-----END "+i+"-----\n",s),o.slice(0,s)}};var o=e("assert-plus"),p=(e("asn1"),e("safer-buffer").Buffer);e("../algs"),e("../utils"),e("../key"),e("../private-key"),e("./pem"),e("../identity"),e("../signature"),e("../certificate")},{"../algs":457,"../certificate":458,"../identity":474,"../key":476,"../private-key":477,"../signature":478,"../utils":480,"./pem":466,"./x509":473,asn1:65,"assert-plus":66,"safer-buffer":448}],473:[function(e,t,r){t.exports={read:function(e,t){"string"==typeof e&&(e=_.from(e,"binary"));b.buffer(e,"buf");var r=new y.BerReader(e);if(r.readSequence(),1=this._buffer.length},a.prototype.remainder=function(){return this._buffer.slice(this._offset)},a.prototype.skip=function(e){this._offset+=e},a.prototype.expand=function(){this._size*=2;var e=n.alloc(this._size);this._buffer.copy(e,0),this._buffer=e},a.prototype.readPart=function(){return{data:this.readBuffer()}},a.prototype.readBuffer=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4,i.ok(this._offset+e<=this._buffer.length,"length out of bounds at +0x"+this._offset.toString(16)+" (data truncated?)");var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t},a.prototype.readString=function(){return this.readBuffer().toString()},a.prototype.readCString=function(){for(var e=this._offset;ethis._size;)this.expand();this._buffer.writeUInt32BE(e.length,this._offset),this._offset+=4,e.copy(this._buffer,this._offset),this._offset+=e.length},a.prototype.writeString=function(e){this.writeBuffer(n.from(e,"utf8"))},a.prototype.writeCString=function(e){for(;this._offset+1+e.length>this._size;)this.expand();this._buffer.write(e,this._offset),this._offset+=e.length,this._buffer[this._offset++]=0},a.prototype.writeInt=function(e){for(;this._offset+4>this._size;)this.expand();this._buffer.writeUInt32BE(e,this._offset),this._offset+=4},a.prototype.writeInt64=function(e){if(i.buffer(e,"value"),8this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=8},a.prototype.writeChar=function(e){for(;this._offset+1>this._size;)this.expand();this._buffer[this._offset++]=e},a.prototype.writePart=function(e){this.writeBuffer(e.data)},a.prototype.write=function(e){for(;this._offset+e.length>this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=e.length}},{"assert-plus":66,"safer-buffer":448}],480:[function(e,t,r){t.exports={bufferSplit:function(e,t){p.buffer(e),p.string(t);for(var r=[],i=0,n=0,a=0;a=t.length){var o=a+1;r.push(e.slice(i,o-n)),i=o,n=0}i<=e.length&&r.push(e.slice(i,e.length));return r},addRSAMissing:function(e){p.object(e),u(e,s,[1,1]);var t,r=new g(e.part.d.data);if(!e.part.dmodp){var i=new g(e.part.p.data),n=r.mod(i.subtract(1));t=_(n),e.part.dmodp={name:"dmodp",data:t},e.parts.push(e.part.dmodp)}if(!e.part.dmodq){var a=new g(e.part.q.data),o=r.mod(a.subtract(1));t=_(o),e.part.dmodq={name:"dmodq",data:t},e.parts.push(e.part.dmodq)}},calculateDSAPublic:function(e,t,r){return p.buffer(e),p.buffer(t),p.buffer(r),e=new g(e),t=new g(t),r=new g(r),_(e.modPow(r,t))},calculateED25519Public:function(e){p.buffer(e);var t=i.sign.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},calculateX25519Public:function(e){p.buffer(e);var t=i.box.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},mpNormalize:y,mpDenormalize:function(e){p.buffer(e);for(;1c)return!1;if(i.constructor.name!==t.name)return!1;var a=i._sshpkApiVersion;void 0===a&&(a=t._oldVersionDetect(e));return!(a[0]!=r[0]||a[1]t;)p.equal(e[0],0),e=e.slice(1);for(;e.length=r[1],i+" must be compatible with "+t.name+" klass version "+r[0]+"."+r[1])}}var v={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}},b=8;function y(e){for(p.buffer(e);1t._pos){var i=r.substr(t._pos);if("x-user-defined"===t._charset){for(var n=new p(i.length),a=0;at._pos&&(t.push(new p(new Uint8Array(o.result.slice(t._pos)))),t._pos=o.result.byteLength)},o.onload=function(){t.push(null)},o.readAsArrayBuffer(r)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":484,_process:382,buffer:191,inherits:320,"readable-stream":426}],487:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=p,t=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1=2.4.3 <2.5.0",_hasShrinkwrap:!1,_id:"tough-cookie@2.4.3",_inCache:!0,_installable:!0,_location:"/tough-cookie",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/tough-cookie_2.4.3_1529960207843_0.4882910670728131"},_npmUser:{email:"jstash@gmail.com",name:"jstash"},_npmVersion:"6.1.0",_phantomChildren:{},_requested:{name:"tough-cookie",raw:"tough-cookie@~2.4.3",rawSpec:"~2.4.3",scope:null,spec:">=2.4.3 <2.5.0",type:"range"},_requiredBy:["/request","/request-promise"],_resolved:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",_shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",_shrinkwrap:null,_spec:"tough-cookie@~2.4.3",_where:"/home/giacof/Download/javascript-opentimestamps/node_modules/request",author:{email:"jstash@gmail.com",name:"Jeremy Stashewsky"},bugs:{url:"https://github.com/salesforce/tough-cookie/issues"},contributors:[{name:"Alexander Savin"},{name:"Ian Livingstone"},{name:"Ivan Nikulin"},{name:"Lalit Kapoor"},{name:"Sam Thompson"},{name:"Sebastian Mayr"}],dependencies:{psl:"^1.1.24",punycode:"^1.4.1"},description:"RFC6265 Cookies and Cookie Jar for node.js",devDependencies:{async:"^1.4.2",nyc:"^11.6.0","string.prototype.repeat":"^0.2.0",vows:"^0.8.1"},directories:{},dist:{fileCount:9,integrity:"sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMVcQCRA9TVsSAnZWagAAzX0P/2COkbzb3dOX/FTOYIVL\n7oHge7BvGODNkEHTjBtNsR0jO/AA/gVcUOq6CSmFH+UC14LrmCyNDemQvD15\njnYuJXUIiZsSZO7BGGbOFYrQF+DKLiwgf0LokrIM8KasZ5nxc5xS1jYHG5o+\nwCqutfhlRTqlPbZsexB+eRlIuYNvpsbRAdSDYXrhLJNMZgx49g/SZ7IwunGN\nJ/5Fe041MZqqdi7MAavM3T7vX9IvVRJJ3f4xAEVxY1vh4s0dN+h4fG2eMQzL\nOiaulRUIahs4xmJUYHZgZESc9eTIrI8K+YT7i3r35TGc0Du7ueB2KYxBqy7q\n6AUFbdX9Ep308kTVsTf/h4wE0RvdxKLfZ0ww7T1ivADX9xMi2oIvVtyhCQHo\nSIpyBhaav/fTufF0/Fu4Lcr7PMJxyvF0UcNRqrPmEQTw4UZkFKfT8HN2P5cH\nBvJsFwpeEjt84tt5pJ/bmD0j0EUCLUXLGH6fbA84fHpZGifO239zSf262Qdv\nSXeygU7YxnK8wOCnvlauZx/gp+/WTMfMdODxiX0QnqwS5BctiPCgGG1cKJcC\nqvTECaAEmxMVf/gEW73oxVXJgUO7f6jJaWoawV7ka+wR91W9Bp0pKGOOAxAG\nU72rmnwQKid9U7ly5833sb3D+lbzKJXGNIqohegP4daKZfNNTaLWZXmKE+Iy\n7Vml\r\n=8KpS\r\n-----END PGP SIGNATURE-----\r\n",shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",tarball:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",unpackedSize:83959},engines:{node:">=0.8"},files:["lib"],gitHead:"671ad413b38d7464352886772f57a7ec417d4760",homepage:"https://github.com/salesforce/tough-cookie",keywords:["HTTP","RFC2965","RFC6265","cookie","cookiejar","cookies","jar","set-cookie"],license:"BSD-3-Clause",main:"./lib/cookie",maintainers:[{name:"awaterma",email:"awaterma@awaterma.net"},{name:"jstash",email:"jstash@gmail.com"},{name:"maratto",email:"marat+npm@salesforce.com"},{name:"ruoho",email:"clint@ruoho.org"}],name:"tough-cookie",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/salesforce/tough-cookie.git"},scripts:{cover:"nyc --reporter=lcov --reporter=html vows test/*_test.js",test:"vows test/*_test.js"},version:"2.4.3"}},{}],497:[function(s,e,c){(function(u){"use strict";s("net");var f,a=s("tls"),r=s("http"),i=s("https"),e=s("events"),p=s("assert"),t=s("util"),h=s("safe-buffer").Buffer;function o(e){var o=this;o.options=e||{},o.proxyOptions=o.options.proxy||{},o.maxSockets=o.options.maxSockets||r.Agent.defaultMaxSockets,o.requests=[],o.sockets=[],o.on("free",function(e,t,r){for(var i=0,n=o.requests.length;i=this.maxSockets?this.requests.push({host:t.host,port:t.port,request:e}):this.createConnection({host:t.host,port:t.port,request:e})},o.prototype.createConnection=function(e){var n=this;n.createSocket(e,function(t){function r(){n.emit("free",t,e.host,e.port)}function i(e){n.removeSocket(t),t.removeListener("free",r),t.removeListener("close",i),t.removeListener("agentRemove",i)}t.on("free",r),t.on("close",i),t.on("agentRemove",i),e.request.onSocket(t)})},o.prototype.createSocket=function(n,a){var o=this,s={};o.sockets.push(s);var e=l({},o.proxyOptions,{method:"CONNECT",path:n.host+":"+n.port,agent:!1});e.proxyAuth&&(e.headers=e.headers||{},e.headers["Proxy-Authorization"]="Basic "+h.from(e.proxyAuth).toString("base64")),f("making CONNECT request");var c=o.request(e);function i(e,t,r){if(c.removeAllListeners(),t.removeAllListeners(),200===e.statusCode)p.equal(r.length,0),f("tunneling connection has established"),o.sockets[o.sockets.indexOf(s)]=t,a(t);else{f("tunneling socket could not be established, statusCode=%d",e.statusCode);var i=new Error("tunneling socket could not be established, statusCode="+e.statusCode);i.code="ECONNRESET",n.request.emit("error",i),o.removeSocket(s)}}c.useChunkedEncodingByDefault=!1,c.once("response",function(e){e.upgrade=!0}),c.once("upgrade",function(e,t,r){u.nextTick(function(){i(e,t,r)})}),c.once("connect",i),c.once("error",function(e){c.removeAllListeners(),f("tunneling socket could not be established, cause=%s\n",e.message,e.stack);var t=new Error("tunneling socket could not be established, cause="+e.message);t.code="ECONNRESET",n.request.emit("error",t),o.removeSocket(s)}),c.end()},o.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},f=u.env.NODE_DEBUG&&/\btunnel\b/.test(u.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},c.debug=f}).call(this,s("_process"))},{_process:382,assert:67,events:269,http:483,https:317,net:187,"safe-buffer":447,tls:187,util:505}],498:[function(e,t,r){!function(a){"use strict";var m=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function d(e,t,r,i,n){var a,o=0;for(a=0;a>>8)-1}function v(e,t,r,i){return d(e,t,r,i,16)}function b(e,t,r,i){return d(e,t,r,i,32)}function y(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=a,k=o,x=s,S=c,j=u,E=f,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=0;M<20;M+=2)w^=(n=(C^=(n=(P^=(n=(j^=(n=w+C|0)<<7|n>>>25)+w|0)<<9|n>>>23)+j|0)<<13|n>>>19)+P|0)<<18|n>>>14,E^=(n=(k^=(n=(F^=(n=(O^=(n=E+k|0)<<7|n>>>25)+E|0)<<9|n>>>23)+O|0)<<13|n>>>19)+F|0)<<18|n>>>14,T^=(n=(A^=(n=(x^=(n=(R^=(n=T+A|0)<<7|n>>>25)+T|0)<<9|n>>>23)+R|0)<<13|n>>>19)+x|0)<<18|n>>>14,z^=(n=(B^=(n=(I^=(n=(S^=(n=z+B|0)<<7|n>>>25)+z|0)<<9|n>>>23)+S|0)<<13|n>>>19)+I|0)<<18|n>>>14,w^=(n=(S^=(n=(x^=(n=(k^=(n=w+S|0)<<7|n>>>25)+w|0)<<9|n>>>23)+k|0)<<13|n>>>19)+x|0)<<18|n>>>14,E^=(n=(j^=(n=(I^=(n=(A^=(n=E+j|0)<<7|n>>>25)+E|0)<<9|n>>>23)+A|0)<<13|n>>>19)+I|0)<<18|n>>>14,T^=(n=(O^=(n=(P^=(n=(B^=(n=T+O|0)<<7|n>>>25)+T|0)<<9|n>>>23)+B|0)<<13|n>>>19)+P|0)<<18|n>>>14,z^=(n=(R^=(n=(F^=(n=(C^=(n=z+R|0)<<7|n>>>25)+z|0)<<9|n>>>23)+C|0)<<13|n>>>19)+F|0)<<18|n>>>14;w=w+a|0,k=k+o|0,x=x+s|0,S=S+c|0,j=j+u|0,E=E+f|0,A=A+p|0,I=I+h|0,P=P+l|0,O=O+d|0,T=T+m|0,B=B+g|0,C=C+v|0,F=F+b|0,R=R+y|0,z=z+_|0,e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=x>>>0&255,e[9]=x>>>8&255,e[10]=x>>>16&255,e[11]=x>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=j>>>0&255,e[17]=j>>>8&255,e[18]=j>>>16&255,e[19]=j>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=B>>>0&255,e[45]=B>>>8&255,e[46]=B>>>16&255,e[47]=B>>>24&255,e[48]=C>>>0&255,e[49]=C>>>8&255,e[50]=C>>>16&255,e[51]=C>>>24&255,e[52]=F>>>0&255,e[53]=F>>>8&255,e[54]=F>>>16&255,e[55]=F>>>24&255,e[56]=R>>>0&255,e[57]=R>>>8&255,e[58]=R>>>16&255,e[59]=R>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,i)}function _(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=0;w<20;w+=2)a^=(n=(v^=(n=(l^=(n=(u^=(n=a+v|0)<<7|n>>>25)+a|0)<<9|n>>>23)+u|0)<<13|n>>>19)+l|0)<<18|n>>>14,f^=(n=(o^=(n=(b^=(n=(d^=(n=f+o|0)<<7|n>>>25)+f|0)<<9|n>>>23)+d|0)<<13|n>>>19)+b|0)<<18|n>>>14,m^=(n=(p^=(n=(s^=(n=(y^=(n=m+p|0)<<7|n>>>25)+m|0)<<9|n>>>23)+y|0)<<13|n>>>19)+s|0)<<18|n>>>14,_^=(n=(g^=(n=(h^=(n=(c^=(n=_+g|0)<<7|n>>>25)+_|0)<<9|n>>>23)+c|0)<<13|n>>>19)+h|0)<<18|n>>>14,a^=(n=(c^=(n=(s^=(n=(o^=(n=a+c|0)<<7|n>>>25)+a|0)<<9|n>>>23)+o|0)<<13|n>>>19)+s|0)<<18|n>>>14,f^=(n=(u^=(n=(h^=(n=(p^=(n=f+u|0)<<7|n>>>25)+f|0)<<9|n>>>23)+p|0)<<13|n>>>19)+h|0)<<18|n>>>14,m^=(n=(d^=(n=(l^=(n=(g^=(n=m+d|0)<<7|n>>>25)+m|0)<<9|n>>>23)+g|0)<<13|n>>>19)+l|0)<<18|n>>>14,_^=(n=(y^=(n=(b^=(n=(v^=(n=_+y|0)<<7|n>>>25)+_|0)<<9|n>>>23)+v|0)<<13|n>>>19)+b|0)<<18|n>>>14;e[0]=a>>>0&255,e[1]=a>>>8&255,e[2]=a>>>16&255,e[3]=a>>>24&255,e[4]=f>>>0&255,e[5]=f>>>8&255,e[6]=f>>>16&255,e[7]=f>>>24&255,e[8]=m>>>0&255,e[9]=m>>>8&255,e[10]=m>>>16&255,e[11]=m>>>24&255,e[12]=_>>>0&255,e[13]=_>>>8&255,e[14]=_>>>16&255,e[15]=_>>>24&255,e[16]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255}(e,t,r,i)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function k(e,t,r,i,n,a,o){var s,c,u=new Uint8Array(16),f=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=a[c];for(;64<=n;){for(y(f,u,o,w),c=0;c<64;c++)e[t+c]=r[i+c]^f[c];for(s=1,c=8;c<16;c++)s=s+(255&u[c])|0,u[c]=255&s,s>>>=8;n-=64,t+=64,i+=64}if(0>>=8;r-=64,t+=64}if(0>>13|r<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|i<<6),n=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|n<<9),a=255&e[8]|(255&e[9])<<8,this.r[4]=255&(n>>>4|a<<12),this.r[5]=a>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(a>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,r,i,n,a){var o=new E(a);return o.update(r,i,n),o.finish(e,t),0}function I(e,t,r,i,n,a){var o=new Uint8Array(16);return A(o,0,r,i,n,a),v(e,t,o,0)}function P(e,t,r,i,n){var a;if(r<32)return-1;for(j(e,0,t,0,r,i,n),A(e,16,e,32,r-32,e),a=0;a<16;a++)e[a]=0;return 0}function O(e,t,r,i,n){var a,o=new Uint8Array(32);if(r<32)return-1;if(S(o,0,32,i,n),0!==I(t,16,t,32,r-32,o))return-1;for(j(e,0,t,0,r,i,n),a=0;a<32;a++)e[a]=0;return 0}function T(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function C(e,t,r){for(var i,n=~(r-1),a=0;a<16;a++)i=n&(e[a]^t[a]),e[a]^=i,t[a]^=i}function F(e,t){var r,i,n,a=m(),o=m();for(r=0;r<16;r++)o[r]=t[r];for(B(o),B(o),B(o),i=0;i<2;i++){for(a[0]=o[0]-65517,r=1;r<15;r++)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),n=a[15]>>16&1,a[14]&=65535,C(o,a,1-n)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function R(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return F(r,e),F(i,t),b(r,0,i,0)}function z(e){var t=new Uint8Array(32);return F(t,e),1&t[0]}function M(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function D(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function N(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function q(e,t,r){var i,n,a=0,o=0,s=0,c=0,u=0,f=0,p=0,h=0,l=0,d=0,m=0,g=0,v=0,b=0,y=0,_=0,w=0,k=0,x=0,S=0,j=0,E=0,A=0,I=0,P=0,O=0,T=0,B=0,C=0,F=0,R=0,z=r[0],M=r[1],D=r[2],N=r[3],q=r[4],L=r[5],U=r[6],H=r[7],K=r[8],V=r[9],G=r[10],$=r[11],W=r[12],Z=r[13],Y=r[14],X=r[15];a+=(i=t[0])*z,o+=i*M,s+=i*D,c+=i*N,u+=i*q,f+=i*L,p+=i*U,h+=i*H,l+=i*K,d+=i*V,m+=i*G,g+=i*$,v+=i*W,b+=i*Z,y+=i*Y,_+=i*X,o+=(i=t[1])*z,s+=i*M,c+=i*D,u+=i*N,f+=i*q,p+=i*L,h+=i*U,l+=i*H,d+=i*K,m+=i*V,g+=i*G,v+=i*$,b+=i*W,y+=i*Z,_+=i*Y,w+=i*X,s+=(i=t[2])*z,c+=i*M,u+=i*D,f+=i*N,p+=i*q,h+=i*L,l+=i*U,d+=i*H,m+=i*K,g+=i*V,v+=i*G,b+=i*$,y+=i*W,_+=i*Z,w+=i*Y,k+=i*X,c+=(i=t[3])*z,u+=i*M,f+=i*D,p+=i*N,h+=i*q,l+=i*L,d+=i*U,m+=i*H,g+=i*K,v+=i*V,b+=i*G,y+=i*$,_+=i*W,w+=i*Z,k+=i*Y,x+=i*X,u+=(i=t[4])*z,f+=i*M,p+=i*D,h+=i*N,l+=i*q,d+=i*L,m+=i*U,g+=i*H,v+=i*K,b+=i*V,y+=i*G,_+=i*$,w+=i*W,k+=i*Z,x+=i*Y,S+=i*X,f+=(i=t[5])*z,p+=i*M,h+=i*D,l+=i*N,d+=i*q,m+=i*L,g+=i*U,v+=i*H,b+=i*K,y+=i*V,_+=i*G,w+=i*$,k+=i*W,x+=i*Z,S+=i*Y,j+=i*X,p+=(i=t[6])*z,h+=i*M,l+=i*D,d+=i*N,m+=i*q,g+=i*L,v+=i*U,b+=i*H,y+=i*K,_+=i*V,w+=i*G,k+=i*$,x+=i*W,S+=i*Z,j+=i*Y,E+=i*X,h+=(i=t[7])*z,l+=i*M,d+=i*D,m+=i*N,g+=i*q,v+=i*L,b+=i*U,y+=i*H,_+=i*K,w+=i*V,k+=i*G,x+=i*$,S+=i*W,j+=i*Z,E+=i*Y,A+=i*X,l+=(i=t[8])*z,d+=i*M,m+=i*D,g+=i*N,v+=i*q,b+=i*L,y+=i*U,_+=i*H,w+=i*K,k+=i*V,x+=i*G,S+=i*$,j+=i*W,E+=i*Z,A+=i*Y,I+=i*X,d+=(i=t[9])*z,m+=i*M,g+=i*D,v+=i*N,b+=i*q,y+=i*L,_+=i*U,w+=i*H,k+=i*K,x+=i*V,S+=i*G,j+=i*$,E+=i*W,A+=i*Z,I+=i*Y,P+=i*X,m+=(i=t[10])*z,g+=i*M,v+=i*D,b+=i*N,y+=i*q,_+=i*L,w+=i*U,k+=i*H,x+=i*K,S+=i*V,j+=i*G,E+=i*$,A+=i*W,I+=i*Z,P+=i*Y,O+=i*X,g+=(i=t[11])*z,v+=i*M,b+=i*D,y+=i*N,_+=i*q,w+=i*L,k+=i*U,x+=i*H,S+=i*K,j+=i*V,E+=i*G,A+=i*$,I+=i*W,P+=i*Z,O+=i*Y,T+=i*X,v+=(i=t[12])*z,b+=i*M,y+=i*D,_+=i*N,w+=i*q,k+=i*L,x+=i*U,S+=i*H,j+=i*K,E+=i*V,A+=i*G,I+=i*$,P+=i*W,O+=i*Z,T+=i*Y,B+=i*X,b+=(i=t[13])*z,y+=i*M,_+=i*D,w+=i*N,k+=i*q,x+=i*L,S+=i*U,j+=i*H,E+=i*K,A+=i*V,I+=i*G,P+=i*$,O+=i*W,T+=i*Z,B+=i*Y,C+=i*X,y+=(i=t[14])*z,_+=i*M,w+=i*D,k+=i*N,x+=i*q,S+=i*L,j+=i*U,E+=i*H,A+=i*K,I+=i*V,P+=i*G,O+=i*$,T+=i*W,B+=i*Z,C+=i*Y,F+=i*X,_+=(i=t[15])*z,o+=38*(k+=i*D),s+=38*(x+=i*N),c+=38*(S+=i*q),u+=38*(j+=i*L),f+=38*(E+=i*U),p+=38*(A+=i*H),h+=38*(I+=i*K),l+=38*(P+=i*V),d+=38*(O+=i*G),m+=38*(T+=i*$),g+=38*(B+=i*W),v+=38*(C+=i*Z),b+=38*(F+=i*Y),y+=38*(R+=i*X),a=(i=(a+=38*(w+=i*M))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a=(i=(a+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a+=n-1+37*(n-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=h,e[8]=l,e[9]=d,e[10]=m,e[11]=g,e[12]=v,e[13]=b,e[14]=y,e[15]=_}function L(e,t){q(e,t,t)}function U(e,t){var r,i=m();for(r=0;r<16;r++)i[r]=t[r];for(r=253;0<=r;r--)L(i,i),2!==r&&4!==r&&q(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function H(e,t,r){var i,n,a=new Uint8Array(32),o=new Float64Array(80),s=m(),c=m(),u=m(),f=m(),p=m(),h=m();for(n=0;n<31;n++)a[n]=t[n];for(a[31]=127&t[31]|64,a[0]&=248,M(o,r),n=0;n<16;n++)c[n]=o[n],f[n]=s[n]=u[n]=0;for(s[0]=f[0]=1,n=254;0<=n;--n)C(s,c,i=a[n>>>3]>>>(7&n)&1),C(u,f,i),D(p,s,u),N(s,s,u),D(u,c,f),N(c,c,f),L(f,p),L(h,s),q(s,u,s),q(u,c,p),D(p,s,u),N(s,s,u),L(c,s),N(u,f,h),q(s,u,g),D(s,s,f),q(u,u,s),q(s,f,h),q(f,c,o),L(c,p),C(s,c,i),C(u,f,i);for(n=0;n<16;n++)o[n+16]=s[n],o[n+32]=u[n],o[n+48]=c[n],o[n+64]=f[n];var l=o.subarray(32),d=o.subarray(16);return U(l,l),q(d,d,l),F(e,d),0}function K(e,t){return H(e,t,r)}function V(e,t){return o(t,32),K(e,t)}function G(e,t,r){var i=new Uint8Array(32);return H(i,r,t),_(e,n,i,w)}E.prototype.blocks=function(e,t,r){for(var i,n,a,o,s,c,u,f,p,h,l,d,m,g,v,b,y,_,w,k=this.fin?0:2048,x=this.h[0],S=this.h[1],j=this.h[2],E=this.h[3],A=this.h[4],I=this.h[5],P=this.h[6],O=this.h[7],T=this.h[8],B=this.h[9],C=this.r[0],F=this.r[1],R=this.r[2],z=this.r[3],M=this.r[4],D=this.r[5],N=this.r[6],q=this.r[7],L=this.r[8],U=this.r[9];16<=r;)h=p=0,h+=(x+=8191&(i=255&e[t+0]|(255&e[t+1])<<8))*C,h+=(S+=8191&(i>>>13|(n=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*U),h+=(j+=8191&(n>>>10|(a=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*L),h+=(E+=8191&(a>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*q),p=(h+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*N))>>>13,h&=8191,h+=(I+=s>>>1&8191)*(5*D),h+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*M),h+=(O+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),h+=(T+=8191&(u>>>8|(f=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*R),l=p+=(h+=(B+=f>>>5|k)*(5*F))>>>13,l+=x*F,l+=S*C,l+=j*(5*U),l+=E*(5*L),p=(l+=A*(5*q))>>>13,l&=8191,l+=I*(5*N),l+=P*(5*D),l+=O*(5*M),l+=T*(5*z),p+=(l+=B*(5*R))>>>13,l&=8191,d=p,d+=x*R,d+=S*F,d+=j*C,d+=E*(5*U),p=(d+=A*(5*L))>>>13,d&=8191,d+=I*(5*q),d+=P*(5*N),d+=O*(5*D),d+=T*(5*M),m=p+=(d+=B*(5*z))>>>13,m+=x*z,m+=S*R,m+=j*F,m+=E*C,p=(m+=A*(5*U))>>>13,m&=8191,m+=I*(5*L),m+=P*(5*q),m+=O*(5*N),m+=T*(5*D),g=p+=(m+=B*(5*M))>>>13,g+=x*M,g+=S*z,g+=j*R,g+=E*F,p=(g+=A*C)>>>13,g&=8191,g+=I*(5*U),g+=P*(5*L),g+=O*(5*q),g+=T*(5*N),v=p+=(g+=B*(5*D))>>>13,v+=x*D,v+=S*M,v+=j*z,v+=E*R,p=(v+=A*F)>>>13,v&=8191,v+=I*C,v+=P*(5*U),v+=O*(5*L),v+=T*(5*q),b=p+=(v+=B*(5*N))>>>13,b+=x*N,b+=S*D,b+=j*M,b+=E*z,p=(b+=A*R)>>>13,b&=8191,b+=I*F,b+=P*C,b+=O*(5*U),b+=T*(5*L),y=p+=(b+=B*(5*q))>>>13,y+=x*q,y+=S*N,y+=j*D,y+=E*M,p=(y+=A*z)>>>13,y&=8191,y+=I*R,y+=P*F,y+=O*C,y+=T*(5*U),_=p+=(y+=B*(5*L))>>>13,_+=x*L,_+=S*q,_+=j*N,_+=E*D,p=(_+=A*M)>>>13,_&=8191,_+=I*z,_+=P*R,_+=O*F,_+=T*C,w=p+=(_+=B*(5*U))>>>13,w+=x*U,w+=S*L,w+=j*q,w+=E*N,p=(w+=A*D)>>>13,w&=8191,w+=I*M,w+=P*z,w+=O*R,w+=T*F,x=h=8191&(p=(p=((p+=(w+=B*C)>>>13)<<2)+p|0)+(h&=8191)|0),S=l+=p>>>=13,j=d&=8191,E=m&=8191,A=g&=8191,I=v&=8191,P=b&=8191,O=y&=8191,T=_&=8191,B=w&=8191,t+=16,r-=16;this.h[0]=x,this.h[1]=S,this.h[2]=j,this.h[3]=E,this.h[4]=A,this.h[5]=I,this.h[6]=P,this.h[7]=O,this.h[8]=T,this.h[9]=B},E.prototype.finish=function(e,t){var r,i,n,a,o=new Uint16Array(10);if(this.leftover){for(a=this.leftover,this.buffer[a++]=1;a<16;a++)this.buffer[a]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=r,r=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this.h[a]+r,r=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,i=(1^r)-1,a=0;a<10;a++)o[a]&=i;for(i=~i,a=0;a<10;a++)this.h[a]=this.h[a]&i|o[a];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,a=1;a<8;a++)n=(this.h[a]+this.pad[a]|0)+(n>>>16)|0,this.h[a]=65535&n;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var i,n;if(this.leftover){for(r<(n=16-this.leftover)&&(n=r),i=0;i>>16,I=65535&(S=N),P=S>>>16,E+=65535&(j=((g=K)>>>14|(c=z)<<18)^(K>>>18|z<<14)^(z>>>9|K<<23)),A+=j>>>16,I+=65535&(S=(z>>>14|K<<18)^(z>>>18|K<<14)^(K>>>9|z<<23)),P+=S>>>16,E+=65535&(j=K&(v=V)^~K&(b=G)),A+=j>>>16,I+=65535&(S=z&(u=M)^~z&(f=D)),P+=S>>>16,S=Z[2*k],E+=65535&(j=Z[2*k+1]),A+=j>>>16,I+=65535&S,P+=S>>>16,S=O[k%16],A+=(j=T[k%16])>>>16,I+=65535&S,P+=S>>>16,I+=(A+=(E+=65535&j)>>>16)>>>16,E=65535&(j=w=65535&E|A<<16),A=j>>>16,I=65535&(S=_=65535&I|(P+=I>>>16)<<16),P=S>>>16,E+=65535&(j=(q>>>28|B<<4)^(B>>>2|q<<30)^(B>>>7|q<<25)),A+=j>>>16,I+=65535&(S=(B>>>28|q<<4)^(q>>>2|B<<30)^(q>>>7|B<<25)),P+=S>>>16,A+=(j=q&L^q&U^L&U)>>>16,I+=65535&(S=B&C^B&F^C&F),P+=S>>>16,p=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,y=65535&E|A<<16,E=65535&(j=m),A=j>>>16,I=65535&(S=s),P=S>>>16,A+=(j=w)>>>16,I+=65535&(S=_),P+=S>>>16,C=n,F=a,R=o,z=s=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,M=c,D=u,N=f,B=p,L=h,U=l,H=d,K=m=65535&E|A<<16,V=g,G=v,$=b,q=y,k%16==15)for(x=0;x<16;x++)S=O[x],E=65535&(j=T[x]),A=j>>>16,I=65535&S,P=S>>>16,S=O[(x+9)%16],E+=65535&(j=T[(x+9)%16]),A+=j>>>16,I+=65535&S,P+=S>>>16,_=O[(x+1)%16],E+=65535&(j=((w=T[(x+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),A+=j>>>16,I+=65535&(S=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),P+=S>>>16,_=O[(x+14)%16],A+=(j=((w=T[(x+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,I+=65535&(S=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,O[x]=65535&I|P<<16,T[x]=65535&E|A<<16;E=65535&(j=q),A=j>>>16,I=65535&(S=B),P=S>>>16,S=e[0],A+=(j=t[0])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[0]=B=65535&I|P<<16,t[0]=q=65535&E|A<<16,E=65535&(j=L),A=j>>>16,I=65535&(S=C),P=S>>>16,S=e[1],A+=(j=t[1])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[1]=C=65535&I|P<<16,t[1]=L=65535&E|A<<16,E=65535&(j=U),A=j>>>16,I=65535&(S=F),P=S>>>16,S=e[2],A+=(j=t[2])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[2]=F=65535&I|P<<16,t[2]=U=65535&E|A<<16,E=65535&(j=H),A=j>>>16,I=65535&(S=R),P=S>>>16,S=e[3],A+=(j=t[3])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[3]=R=65535&I|P<<16,t[3]=H=65535&E|A<<16,E=65535&(j=K),A=j>>>16,I=65535&(S=z),P=S>>>16,S=e[4],A+=(j=t[4])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[4]=z=65535&I|P<<16,t[4]=K=65535&E|A<<16,E=65535&(j=V),A=j>>>16,I=65535&(S=M),P=S>>>16,S=e[5],A+=(j=t[5])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[5]=M=65535&I|P<<16,t[5]=V=65535&E|A<<16,E=65535&(j=G),A=j>>>16,I=65535&(S=D),P=S>>>16,S=e[6],A+=(j=t[6])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[6]=D=65535&I|P<<16,t[6]=G=65535&E|A<<16,E=65535&(j=$),A=j>>>16,I=65535&(S=N),P=S>>>16,S=e[7],A+=(j=t[7])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[7]=N=65535&I|P<<16,t[7]=$=65535&E|A<<16,W+=128,i-=128}return i}function X(e,t,r){var i,n=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,Y(n,a,t,r),r%=128,i=0;i>(7&n)&1),J(t,e),J(e,e),Q(e,t,i)}function re(e,t){var r=[m(),m(),m(),m()];T(r[0],i),T(r[1],s),T(r[2],f),q(r[3],i,s),te(e,r,t)}function ie(e,t,r){var i,n=new Uint8Array(64),a=[m(),m(),m(),m()];for(r||o(t,32),X(n,t,32),n[0]&=248,n[31]&=127,n[31]|=64,re(a,n),ee(e,a),i=0;i<32;i++)t[i+32]=e[i];return 0}var ne=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var r,i,n,a;for(i=63;32<=i;--i){for(r=0,n=i-32,a=i-12;n>8,t[n]-=256*r;t[n]+=r,t[i]=0}for(n=r=0;n<32;n++)t[n]+=r-(t[31]>>4)*ne[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*ne[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function oe(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function se(e,t,r,i){var n,a,o=new Uint8Array(64),s=new Uint8Array(64),c=new Uint8Array(64),u=new Float64Array(64),f=[m(),m(),m(),m()];X(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var p=r+64;for(n=0;n>7&&N(e[0],u,e[0]),q(e[3],e[0],e[1]),0)}function ue(e,t,r,i){var n,a=new Uint8Array(32),o=new Uint8Array(64),s=[m(),m(),m(),m()],c=[m(),m(),m(),m()];if(-1,r<64)return-1;if(ce(c,i))return-1;for(n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,M=String.fromCharCode;function D(e){throw new RangeError(o[e])}function s(e,t){var r=e.split("@"),i="";return 1>1,e+=z(e/t);455z((C-n)/p))&&D("overflow"),n+=l*p;var d=h<=o?1:o+26<=h?26:h-o;if(lz(C/m)&&D("overflow"),p*=m}var g=r.length+1;o=L(n-f,g,0==f),z(n/g)>C-a&&D("overflow"),a+=z(n/g),n%=g,r.splice(n++,0,a)}return String.fromCodePoint.apply(String,r)},u=function(e){var t=[],r=(e=N(e)).length,i=128,n=0,a=72,o=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(o=(u=f.next()).done);o=!0){var p=u.value;p<128&&t.push(M(p))}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}var h=t.length,l=h;for(h&&t.push("-");lz((C-n)/w)&&D("overflow"),n+=(d-i)*w,i=d;var k=!0,x=!1,S=void 0;try{for(var j,E=e[Symbol.iterator]();!(k=(j=E.next()).done);k=!0){var A=j.value;if(AC&&D("overflow"),A==i){for(var I=n,P=36;;P+=36){var O=P<=a?1:a+26<=P?26:P-a;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function l(e){for(var t="",r=0,i=e.length;rA-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(V,"g"),Y=new RegExp($,"g"),X=new RegExp(F("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',W),"g"),J=new RegExp(F("[^]",V,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),Q=J;function ee(e){var t=l(e);return t.match(Z)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,a={},o=r.query.split("&"),s=0,c=o.length;s",'"',"`"," ","\r","\n","\t"]),M=["'"].concat(n),D=["%","/","?",";","#"].concat(M),N=["/","?","#"],q=/^[+a-z0-9A-Z_-]{0,63}$/,L=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,U={javascript:!0,"javascript:":!0},H={javascript:!0,"javascript:":!0},K={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},V=e("querystring");function a(e,t,r){if(e&&F.isObject(e)&&e instanceof A)return e;var i=new A;return i.parse(e,t,r),i}A.prototype.parse=function(e,t,r){if(!F.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===e?"undefined":_typeof(e)));var i=e.indexOf("?"),n=-1!==i&&i>t&63|128)}function p(e){if(0==(4294967168&e))return s(e);var t="";return 0==(4294965248&e)?t=s(e>>6&31|192):0==(4294901760&e)?(u(e),t=s(e>>12&15|224),t+=f(e,6)):0==(4292870144&e)&&(t=s(e>>18&7|240),t+=f(e,12),t+=f(e,6)),t+=s(63&e|128)}function h(){if(a<=o)throw Error("Invalid byte index");var e=255&n[o];if(o++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,t;if(a>>10&1023|55296),t=56320|1023&t),n+=s(t);return n}(r)}};if("function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define(function(){return d});else if(t&&!t.nodeType)if(r)r.exports=d;else{var m={}.hasOwnProperty;for(var g in d)m.call(d,g)&&(t[g]=d[g])}else e.utf8=d}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],503:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],504:[function(e,t,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],505:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{"./support/isBuffer":504,_process:382,dup:70,inherits:320}],506:[function(e,t,r){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},{}],507:[function(e,t,r){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var n=new Uint8Array(16);t.exports=function(){return i(n),n}}else{var a=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}},{}],508:[function(e,t,r){var o=e("./lib/rng"),s=e("./lib/bytesToUuid");t.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var a=0;a<16;++a)t[i+a]=n[a];return t||s(n)}},{"./lib/bytesToUuid":506,"./lib/rng":507}],509:[function(e,t,r){var s=e("assert-plus"),i=e("util"),n=e("extsprintf"),c=e("core-util-is").isError,a=n.sprintf;function u(e){var t,r,i,n;if(s.object(e,"args"),s.bool(e.strict,"args.strict"),s.array(e.argv,"args.argv"),0===(t=e.argv).length)r={},i=[];else if(c(t[0]))r={cause:t[0]},i=t.slice(1);else if("object"===_typeof(t[0])){for(n in r={},t[0])r[n]=t[0][n];i=t.slice(1)}else s.string(t[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},i=t;return s.object(r),r.strict||e.strict||(i=i.map(function(e){return null===e?"null":void 0===e?"undefined":e})),{options:r,shortmessage:0===i.length?"":a.apply(null,i)}}function f(){var e,t,r,i,n,a,o;if(e=Array.prototype.slice.call(arguments,0),!(this instanceof f))return t=Object.create(f.prototype),f.apply(t,arguments),t;if((r=u({argv:e,strict:!1})).options.name&&(s.string(r.options.name,'error\'s "name" must be a string'),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,a=r.shortmessage,(i=r.options.cause)&&(s.ok(c(i),"cause is not an Error"),this.jse_cause=i,r.options.skipCauseMessage||(a+=": "+i.message)),this.jse_info={},r.options.info)for(o in r.options.info)this.jse_info[o]=r.options.info[o];return this.message=a,Error.call(this,a),Error.captureStackTrace&&(n=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,n)),this}function o(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof o?(i=(r=u({argv:e,strict:!0})).options,f.call(this,i,"%s",r.shortmessage),this):(t=Object.create(o.prototype),o.apply(t,arguments),t)}function p(e){s.array(e,"list of errors"),s.ok(0this._inputTypes.length&&!n.isObject(e[e.length-1]))return a.inputDefaultBlockNumberFormatter(e.pop())},s.prototype.toPayload=function(e){var t={};return e.length>this._inputTypes.length&&n.isObject(e[e.length-1])&&(t=e[e.length-1]),t.to=this._address,t.data="0x"+this.signature()+i.encodeParams(this._inputTypes,e),t},s.prototype.signature=function(){return o(this._name).slice(0,8)},s.prototype.unpackOutput=function(e){if(e){e=2<=e.length?e.slice(2):e;var t=i.decodeParams(this._outputTypes,e);return 1===t.length?t[0]:t}},s.prototype.call=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),i=this.extractCallback(e),t=this.extractDefaultBlock(e),r=this.toPayload(e);if(!i){var n=this._eth.call(r,t);return this.unpackOutput(n)}var a=this;this._eth.call(r,t,function(t,e){if(t)return i(t,null);var r=null;try{r=a.unpackOutput(e)}catch(e){t=e}i(t,r)})},s.prototype.sendTransaction=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),t=this.extractCallback(e),r=this.toPayload(e);if(0=this.buffer.length)){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,t}}},{key:"read",value:function(e){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,Array.from(t)}},{key:"readBool",value:function(){var e=this.read(1)[0];if(255===e)return!0;if(0===e)return!1;throw new n("read_bool() expected 0xff or 0x00; got +"+e)}},{key:"readVaruint",value:function(){for(var e=0,t=0,r=void 0;e|=(127&(r=this.read(1)[0]))< "+e);if(r>=7}}},{key:"writeByte",value:function(e){if(this.length>=this.buffer.length){var t=2*this.length,r=new Uint8Array(t);r.set(this.buffer,0),this.buffer=r}isNaN(e)?this.buffer[this.length]=e.codePointAt():this.buffer[this.length]=e,this.length++}},{key:"writeBytes",value:function(e){var t=this;e.forEach(function(e){t.writeByte(e)})}},{key:"writeVarbytes",value:function(e){this.writeVaruint(e.length),this.writeBytes(e)}},{key:"toString",value:function(){return this.buffer.toHex(0)}}]),e}();m.exports={StreamDeserialization:h,StreamSerialization:l,DeserializationError:n,BadMagicError:a,UnsupportedMajorVersion:o,TruncationError:s,TrailingGarbageError:c,RecursionLimitError:u,SerializerTypeError:f,SerializerValueError:p,ValueError:e,TypeError:t}}).call(this,d("buffer").Buffer)},{"./extend-error.js":570,"./utils.js":577,buffer:191}],568:[function(e,t,r){"use strict";var s=e("./ops.js"),c=e("./timestamp.js"),i=e("./utils.js"),u=e("./context.js"),f=[0,79,112,101,110,84,105,109,101,115,116,97,109,112,115,0,0,80,114,111,111,102,0,191,137,226,232,132,232,146,148],n=function(){function o(e,t){if(_classCallCheck2(this,o),!(e instanceof s.Op&&t instanceof c))throw new u.ValueError("Invalid Timestamp or fileHashOp");if(t.msg.length!==e._DIGEST_LENGTH())throw new u.ValueError("Timestamp message length and fileHashOp digest length differ");this.fileHashOp=e,this.timestamp=t}return _createClass(o,[{key:"fileDigest",value:function(){return this.timestamp.msg}},{key:"serialize",value:function(e){e.writeBytes(f),e.writeVaruint(1),this.fileHashOp.serialize(e),e.writeBytes(this.timestamp.msg),this.timestamp.serialize(e)}},{key:"serializeToBytes",value:function(){var e=new u.StreamSerialization;return this.serialize(e),e.getOutput()}},{key:"toString",value:function(){var e="DetachedTimestampFile\n";return e+="fileHashOp: "+this.fileHashOp.toString()+"\n",e+="timestamp: "+this.timestamp.toString()+"\n"}},{key:"toJson",value:function(){var e={};e.hash=i.bytesToHex(this.fileDigest()),e.op=this.fileHashOp._HASHLIB_NAME(),e.timestamp=this.timestamp.toJson()}},{key:"equals",value:function(e){return e instanceof o&&(!!e.fileHashOp.equals(this.fileHashOp)&&!!e.timestamp.equals(this.timestamp))}}],[{key:"deserialize",value:function(e){var t=void 0;if(e instanceof u.StreamDeserialization)t=e;else if(e instanceof Array)t=new u.StreamDeserialization(e);else if(e instanceof Uint8Array)t=new u.StreamDeserialization(Array.from(e));else{if(!(e instanceof ArrayBuffer))throw new Error("StreamDeserialization deserialize: Invalid param");t=new u.StreamDeserialization(Array.from(e))}t.assertMagic(f);var r=t.readVaruint();if(1!==r)throw new u.UnsupportedMajorVersion("Version "+r+" detached timestamp files are not supported");var i=s.CryptOp.deserialize(t),n=t.readBytes(i._DIGEST_LENGTH()),a=c.deserialize(t,n);return t.assertEof(),new o(i,a)}},{key:"fromBytes",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOp param");var r=void 0;if(t instanceof u.StreamDeserialization)r=e.hashFd(t);else if(t instanceof Array){var i=new u.StreamDeserialization(t);r=e.hashFd(i)}else if(t instanceof Uint8Array){var n=new u.StreamDeserialization(Array.from(t));r=e.hashFd(n)}else{if(!(t instanceof ArrayBuffer))throw new Error("DetachedTimestampFile: Invalid buffer param");var a=new u.StreamDeserialization(Array.from(t));r=e.hashFd(a)}return new o(e,new c(r))}},{key:"fromHash",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOpss param");if(t instanceof Array)return new o(e,new c(t));if(t instanceof ArrayBuffer||t instanceof Uint8Array)return new o(e,new c(Array.from(t)));throw new Error("DetachedTimestampFile: Invalid fdHash param")}}]),o}();t.exports=n},{"./context.js":567,"./ops.js":575,"./timestamp.js":576,"./utils.js":577}],569:[function(e,t,r){"use strict";var a=e("promise"),o=e("./utils.js"),s=e("./insight.js"),c=e("./blockstream.js"),u={bitcoin:[{url:"https://blockstream.info/api",type:"blockstream"},{url:"https://insight.bitpay.com/api",type:"insight"},{url:"https://blockexplorer.com/api",type:"insight"},{url:"https://bitcore.schmoock.net/insight-api",type:"insight"}],bitcoinTestnet:[{url:"https://blockstream.info/testnet/api",type:"blockstream"},{url:"https://test-insight.bitpay.com/api",type:"insight"}],litecoin:[{url:"https://ltc-bitcore1.trezor.io/api",type:"insight"},{url:"https://insight.litecore.io/api",type:"insight"}]},i=function(){function n(e){var r=this;_classCallCheck2(this,n),this.explorers=[];var t=e&&Object.prototype.hasOwnProperty.call(e,"chain")?e.chain:"bitcoin",i=e&&Object.prototype.hasOwnProperty.call(e,"timeout")?e.timeout:10;(e&&Object.prototype.hasOwnProperty.call(e,"explorers")&&1(new i)._MAX_URI_LENGTH())return console.error("URI exceeds maximum length"),!1;for(var t=0;ta.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=a.privateCalendars.length;else if(a.privateCalendars=[],a.calendars&&0!==a.calendars.length||(a.calendars=c.DEFAULT_AGGREGATORS),a.m&&0!==a.m){if(a.m<0||a.m>a.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=1,2<=a.calendars.length&&(a.m=2);o.createTimestamp(i,a.calendars,a.m,a.privateCalendars).then(function(e){if(void 0===e)return r(new Error("Error on timestamp creation"));t()}).catch(function(e){r(e)})})},createTimestamp:function(i,e,t,r){var n=[];return e&&e.forEach(function(e){var t=new c.RemoteCalendar(e);n.push(t.submit(i.msg)),console.log("Submitting to remote calendar "+e)}),r&&r.forEach(function(e,t){var r=new c.RemoteCalendar(t);r.setKey(e),n.push(r.submit(i.msg)),console.log("Submitting to remote calendar "+t)}),new Promise(function(t,r){Promise.all(n.map(u.softFail)).then(function(e){return e.filter(function(e){return!(e instanceof Error)&&void 0!==e}).forEach(function(e){i.merge(e)}),t(i)}).catch(function(e){r(e)})})},makeMerkleTree:function(e){var i=[];return e.forEach(function(e){if(e instanceof s)try{var t=u.randBytes(16),r=e.timestamp.add(new n.OpAppend(u.arrayToBytes(t))).add(new n.OpSHA256);i.push(r)}catch(e){return}else console.error("Invalid input")}),f.makeMerkleTree(i)},verify:function(e,t,i){if(!u.arrEq(e.fileDigest(),t.fileDigest()))return console.error("Expected digest "+u.bytesToHex(e.fileDigest())),console.error("File does not match original!"),new Promise(function(e,t){t(new Error("File does not match original!"))});var n=this;return new Promise(function(t,r){n.upgradeTimestamp(e.timestamp,i).then(function(){n.verifyTimestamp(e.timestamp,i).then(function(e){return t(e)}).catch(function(e){return r(e)})})})},verifyTimestamp:function(e,r){var i=[],n=this;function c(e,t){return e.attestedTimet.attestedTime?1:0}return e.allAttestations().forEach(function(e,t){i.push(n.verifyAttestation(e,t,r))}),new Promise(function(o,s){Promise.all(i.map(u.softFail)).then(function(e){var t=e.filter(function(e){return e.constructor===h.VerificationError?e:void 0});if(0this._MAX_MSG_LENGTH())){var t=this.call(e);return t.length>this._MAX_RESULT_LENGTH()&&console.error("Error : Result too long;"),t}console.error("Error : Message too long;")}}],[{key:"deserialize",value:function(e){return this.tag=e.readBytes(1)[0],t.deserializeFromTag(e,this.tag)}},{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return n.get(t).deserializeFromTag(e,t);console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),t=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t.arg=void 0===e?[]:e,t}return _inherits(r,c),_createClass(r,[{key:"serialize",value:function(e){_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"serialize",this).call(this,e),e.writeVarbytes(this.arg)}},{key:"toString",value:function(){return this._TAG_NAME()+" "+i.bytesToHex(this.arg)}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t)){var r=e.readVarbytes((new c)._MAX_RESULT_LENGTH(),1);return new(n.get(t))(r)}}}]),r}(),e=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 240}},{key:"_TAG_NAME",value:function(){return"append"}},{key:"call",value:function(e){return e.concat(this.arg)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),r=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 241}},{key:"_TAG_NAME",value:function(){return"prepend"}},{key:"call",value:function(e){return this.arg.concat(e)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),u=function(e){function t(){return _classCallCheck2(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,c),_createClass(t,[{key:"toString",value:function(){return this._TAG_NAME()}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return new(n.get(t));console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),f=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 242}},{key:"_TAG_NAME",value:function(){return"reverse"}},{key:"call",value:function(e){return 0===e.length&&console.error("Can't reverse an empty message"),e.reverse()}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),p=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 243}},{key:"_TAG_NAME",value:function(){return"hexlify"}},{key:"_MAX_MSG_LENGTH",value:function(){return u._MAX_RESULT_LENGTH()}},{key:"call",value:function(e){0===e.length&&console.error("Can't hexlify an empty message")}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),h=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_HASHLIB_NAME",value:function(){return 0}},{key:"call",value:function(e,t){for(var r=("keccak256"===e._HASHLIB_NAME()?s(e._HASHLIB_NAME()).update(a.from(t)):o.createHash(e._HASHLIB_NAME()).update(a.from(t))).digest(),i=[r.length],n=0;n(new m.Op)._MAX_MSG_LENGTH())throw new TypeError("Message exceeds Op length limit; "+e.length+" > "+(new m.Op)._MAX_MSG_LENGTH());this.msg=e,this.attestations=[],this.ops=new Map}return _createClass(h,[{key:"getDigest",value:function(){return this.msg}},{key:"serialize",value:function(r){var i=this;if(!this.attestations&&!this.ops)throw new a.ValueError("An empty timestamp can't be serialized");var e=this.attestations;if(e.sort(function(e,t){return e.compareTo(t)}),1 "+t.toString()+u(o,n,i)+"\n",f+=e.strTree(a+1,o)});else if(0>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},r.charsToHex=function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&i).toString(16))}return t.join("")},r.charToByte=function(e){return e.charCodeAt(0)},r.charsToBytes=function(e){for(var t=[],r=0;r Date: Fri, 18 Jan 2019 14:43:11 +0100 Subject: [PATCH 12/16] added mainnet calendars --- index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index d07a121..f6b31a0 100644 --- a/index.js +++ b/index.js @@ -2,16 +2,16 @@ const OpenTimestamps = window.OpenTimestamps // an empty list would be equivalent to the default calendars const calendarsList = [ - 'http://test-calendar.aniasafe.it:80' - //'https://alice.btc.calendar.opentimestamps.org', + 'http://test-calendar.aniasafe.it:80', + 'https://alice.btc.calendar.opentimestamps.org', //'https://bob.btc.calendar.opentimestamps.org', //'https://finney.calendar.eternitywall.com' ] // an empty list is not acceptable here const wcalendars = [ - 'http://test-calendar.aniasafe.it:80' - //'https://alice.btc.calendar.opentimestamps.org' + 'http://test-calendar.aniasafe.it:80', + 'https://alice.btc.calendar.opentimestamps.org' //'https://bob.btc.calendar.opentimestamps.org', //'https://finney.calendar.eternitywall.com' ] @@ -22,13 +22,15 @@ const blockexplorers = { explorers: [ {url: 'https://blockstream.info/api', type: 'blockstream'}, {url: 'https://blockexplorer.com/api', type: 'insight'} - ] + ], + timeout: 5 }, bitcoinTestnet: { explorers: [ {url: 'https://blockstream.info/testnet/api', type: 'blockstream'}, {url: 'https://testnet.blockexplorer.com/api', type: 'insight'} - ] + ], + timeout: 5 } } From f10dd1b83bddac49652cf81463b7756756ad2113 Mon Sep 17 00:00:00 2001 From: federicoon Date: Fri, 18 Jan 2019 14:43:11 +0100 Subject: [PATCH 13/16] added yet more mainnet calendars --- index.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index d07a121..6a947ae 100644 --- a/index.js +++ b/index.js @@ -2,18 +2,18 @@ const OpenTimestamps = window.OpenTimestamps // an empty list would be equivalent to the default calendars const calendarsList = [ - 'http://test-calendar.aniasafe.it:80' - //'https://alice.btc.calendar.opentimestamps.org', - //'https://bob.btc.calendar.opentimestamps.org', - //'https://finney.calendar.eternitywall.com' + 'http://test-calendar.aniasafe.it:80', + 'https://alice.btc.calendar.opentimestamps.org', + 'https://bob.btc.calendar.opentimestamps.org', + 'https://finney.calendar.eternitywall.com' ] // an empty list is not acceptable here const wcalendars = [ - 'http://test-calendar.aniasafe.it:80' - //'https://alice.btc.calendar.opentimestamps.org' - //'https://bob.btc.calendar.opentimestamps.org', - //'https://finney.calendar.eternitywall.com' + 'http://test-calendar.aniasafe.it:80', + 'https://alice.btc.calendar.opentimestamps.org', + 'https://bob.btc.calendar.opentimestamps.org', + 'https://finney.calendar.eternitywall.com' ] const whitelistedCalendars = new OpenTimestamps.Calendar.UrlWhitelist(wcalendars) @@ -22,13 +22,15 @@ const blockexplorers = { explorers: [ {url: 'https://blockstream.info/api', type: 'blockstream'}, {url: 'https://blockexplorer.com/api', type: 'insight'} - ] + ], + timeout: 5 }, bitcoinTestnet: { explorers: [ {url: 'https://blockstream.info/testnet/api', type: 'blockstream'}, {url: 'https://testnet.blockexplorer.com/api', type: 'insight'} - ] + ], + timeout: 5 } } From 0346dfbc8211e94d6125d96d79fe0149eaf65e5a Mon Sep 17 00:00:00 2001 From: "Ferdinando M. Ametrano" Date: Mon, 21 Jan 2019 02:24:50 +0100 Subject: [PATCH 14/16] relative path library --- index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.html b/index.html index 3c1689f..1698b80 100644 --- a/index.html +++ b/index.html @@ -268,8 +268,7 @@

VERIFY OTS PROOF

- - + From 4b2644af02fb8ec25fdc1f2e9be8ac7cf9297c8b Mon Sep 17 00:00:00 2001 From: "Ferdinando M. Ametrano" Date: Mon, 21 Jan 2019 12:15:57 +0100 Subject: [PATCH 15/16] fixed calendars and library --- index.html | 3 +-- index.js | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 3c1689f..1698b80 100644 --- a/index.html +++ b/index.html @@ -268,8 +268,7 @@

VERIFY OTS PROOF

- - + diff --git a/index.js b/index.js index 8d6a8ad..5a36b9a 100644 --- a/index.js +++ b/index.js @@ -4,9 +4,8 @@ const OpenTimestamps = window.OpenTimestamps // an empty list would be equivalent to the default calendars const calendarsList = [ - //'http://test-calendar.aniasafe.it:80', // testnet - //'http://calendar.aniasafe.it:80', // mainet - 'http://calendar.irsa.it:80', // testnet + 'http://test-calendar.aniasafe.it:80', // testnet + 'http://calendar.aniasafe.it:80', // mainet 'https://alice.btc.calendar.opentimestamps.org', 'https://bob.btc.calendar.opentimestamps.org', 'https://finney.calendar.eternitywall.com' @@ -14,9 +13,8 @@ const calendarsList = [ // an empty list is not acceptable here const wcalendars = [ - //'http://test-calendar.aniasafe.it:80', // testnet - //'http://calendar.aniasafe.it:80', // mainet - 'http://calendar.irsa.it:80', // testnet + 'http://test-calendar.aniasafe.it:80', // testnet + 'http://calendar.aniasafe.it:80', // mainet 'https://alice.btc.calendar.opentimestamps.org', 'https://bob.btc.calendar.opentimestamps.org', 'https://finney.calendar.eternitywall.com' From f52ba027bd052cb887bb47188e85587704080596 Mon Sep 17 00:00:00 2001 From: federicoon Date: Tue, 5 Feb 2019 16:09:36 +0000 Subject: [PATCH 16/16] updated ots lib; connects to calendars via https --- index.js | 4 +- opentimestamps.js | 21865 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 21865 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 6a947ae..c830e51 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ const OpenTimestamps = window.OpenTimestamps // an empty list would be equivalent to the default calendars const calendarsList = [ - 'http://test-calendar.aniasafe.it:80', + 'https://test-calendar.aniasafe.it', 'https://alice.btc.calendar.opentimestamps.org', 'https://bob.btc.calendar.opentimestamps.org', 'https://finney.calendar.eternitywall.com' @@ -10,7 +10,7 @@ const calendarsList = [ // an empty list is not acceptable here const wcalendars = [ - 'http://test-calendar.aniasafe.it:80', + 'https://test-calendar.aniasafe.it', 'https://alice.btc.calendar.opentimestamps.org', 'https://bob.btc.calendar.opentimestamps.org', 'https://finney.calendar.eternitywall.com' diff --git a/opentimestamps.js b/opentimestamps.js index 856d127..eaee9dc 100644 --- a/opentimestamps.js +++ b/opentimestamps.js @@ -1,2 +1,21863 @@ -// javascript-opentimestamps v.0.4.4-dev -var _get=function e(t,r,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,r);if(void 0===n){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,i)}if("value"in n)return n.value;var o=n.get;return void 0!==o?o.call(i):void 0},_createClass=function(){function i(e,t){for(var r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,f=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,p=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,l=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",i.copy(m[e])}function g(e){var t=e.match(o);if(!t)return!1;var r,i=+t[1],n=+t[2],a=+t[3];return 1<=n&&n<=12&&1<=a&&a<=(2!=n||((r=i)%4!=0||r%100==0&&r%400!=0)?s[n]:29)}function v(e,t){var r=e.match(c);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return(i<=23&&n<=59&&a<=59||23==i&&59==n&&60==a)&&(!t||o)}(t.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:n,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d},m.full={date:g,time:v,"date-time":function(e){var t=e.split(b);return 2==t.length&&g(t[0])&&v(t[1],!0)},uri:function(e){return y.test(e)&&a.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:f,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&n.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:p,"json-pointer":h,"json-pointer-uri-fragment":l,"relative-json-pointer":d};var b=/t|\s/i;var y=/\/|:/;var _=/[^\\]\\Z/;function w(e){if(_.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":12}],7:[function(e,t,r){"use strict";var I=e("./resolve"),P=e("./util"),O=e("./error_classes"),T=e("fast-json-stable-stringify"),B=e("../dotjs/validate"),C=P.ucs2length,F=e("fast-deep-equal"),R=O.Validation;function z(e,t,r){var i=n.call(this,e,t,r);return 0<=i?{index:i,compiling:!0}:{index:i=this._compilations.length,compiling:!(this._compilations[i]={schema:e,root:t,baseId:r})}}function M(e,t,r){var i=n.call(this,e,t,r);0<=i&&this._compilations.splice(i,1)}function n(e,t,r){for(var i=0;i",b=l?">":"<",y=void 0;if(g){var _=e.util.getData(m.$data,o,e.dataPathArr),w="exclusive"+a,k="exclType"+a,x="exclIsNumber"+a,S="' + "+(A="op"+a)+" + '";n+=" var schemaExcl"+a+" = "+_+"; ",n+=" var "+w+"; var "+k+" = typeof "+(_="schemaExcl"+a)+"; if ("+k+" != 'boolean' && "+k+" != 'undefined' && "+k+" != 'number') { ";var j;y=d;(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+d+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var E=n;n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+k+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+_+" "+v+"= "+i+") ? "+p+" "+b+"= "+_+" : "+p+" "+b+" "+i+" ) : ( ("+w+" = "+_+" === true) ? "+p+" "+b+"= "+i+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { var op"+a+" = "+w+" ? '"+v+"' : '"+v+"='; ",void 0===s&&(y=d,u=e.errSchemaPath+"/"+d,i=_,h=g)}else{S=v;if((x="number"==typeof m)&&h){var A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ( "+i+" === undefined || "+m+" "+v+"= "+i+" ? "+p+" "+b+"= "+m+" : "+p+" "+b+" "+i+" ) || "+p+" !== "+p+") { "}else{x&&void 0===s?(w=!0,y=d,u=e.errSchemaPath+"/"+d,i=m,b+="="):(x&&(i=Math[l?"min":"max"](m,s)),m===(!x||i)?(w=!0,y=d,u=e.errSchemaPath+"/"+d,b+="="):(w=!1,S+="="));A="'"+S+"'";n+=" if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+" "+b+" "+i+" || "+p+" !== "+p+") { "}}y=y||t,(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+A+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+S+" ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";E=n;return n=j.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+p+".length "+("maxItems"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s;var l="maxLength"==t?">":"<";n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+p+".length ":n+=" ucs2length("+p+") ",n+=" "+l+" "+i+") { ";var d=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="if ( ",h&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+p+").length "+("maxProperties"==t?">":"<")+" "+i+") { ";var l=t,d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(l||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=h?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var m=n;return n=d.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.schema[t],a=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var f="valid"+c.level,p=c.baseId,h=!0,l=n;if(l)for(var d,m=-1,g=l.length-1;m "+E+") { ";var I=f+"["+E+"]";l.schema=j,l.schemaPath=s+"["+E+"]",l.errSchemaPath=c+"/"+E,l.errorPath=e.util.getPathExpr(e.errorPath,E,e.opts.jsonPointers,!0),l.dataPathArr[v]=E;var P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",i+=" } ",u&&(i+=" if ("+m+") { ",d+="}")}if("object"==(void 0===_?"undefined":_typeof(_))&&e.util.schemaHasRules(_,e.RULES.all)){l.schema=_,l.schemaPath=e.schemaPath+".additionalItems",l.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+f+".length > "+o.length+") { for (var "+g+" = "+o.length+"; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" } } ",u&&(i+=" if ("+m+") { ",d+="}")}}else if(e.util.schemaHasRules(o,e.RULES.all)){l.schema=o,l.schemaPath=s,l.errSchemaPath=c,i+=" for (var "+g+" = 0; "+g+" < "+f+".length; "+g+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);I=f+"["+g+"]";l.dataPathArr[v]=g;P=e.validate(l);l.baseId=y,e.util.varOccurences(P,b)<2?i+=" "+e.util.varReplace(P,b,I)+" ":i+=" var "+b+" = "+I+"; "+P+" ",u&&(i+=" if (!"+m+") break; "),i+=" }"}return u&&(i+=" "+d+" if ("+h+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],30:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,p="data"+(o||""),h=e.opts.$data&&s&&s.$data;i=h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+a):s,n+="var division"+a+";if (",h&&(n+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),n+=" (division"+a+" = "+p+" / "+i+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var l=l||[];l.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=h?"' + "+i:i+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var d=n;return n=l.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+d+"]); ":n+=" validate.errors = ["+d+"]; return false; ":n+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",f&&(n+=" else { "),n}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="errs__"+n,h=e.util.copy(e);h.level++;var l="valid"+h.level;if(e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=c,i+=" var "+p+" = errors; ";var d,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(d=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,d&&(h.opts.allErrors=d),e.compositeRule=h.compositeRule=m,i+=" if ("+l+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var v=i;i=g.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",!1!==e.createErrors?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ");return i}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,f="data"+(a||""),p="valid"+n,h="errs__"+n,l=e.util.copy(e),d="";l.level++;var m="valid"+l.level,g=l.baseId,v="prevValid"+n,b="passingSchemas"+n;i+="var "+h+" = errors , "+v+" = false , "+p+" = false , "+b+" = null; ";var y=e.compositeRule;e.compositeRule=l.compositeRule=!0;var _=o;if(_)for(var w,k=-1,x=_.length-1;k=e.opts.loopRequired,k=e.opts.ownProperties;if(u)if(i+=" var missing"+n+"; ",w){h||(i+=" var "+l+" = validate.schema"+s+"; ");var x="' + "+(P="schema"+n+"["+(E="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(_,P,e.opts.jsonPointers)),i+=" var "+p+" = true; ",h&&(i+=" if (schema"+n+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+n+")) "+p+" = false; else {"),i+=" for (var "+E+" = 0; "+E+" < "+l+".length; "+E+"++) { "+p+" = "+f+"["+l+"["+E+"]] !== undefined ",k&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", "+l+"["+E+"]) "),i+="; if (!"+p+") break; } ",h&&(i+=" } "),i+=" if (!"+p+") { ",(I=I||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+x+"' } ",!1!==e.opts.messages&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+x+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var S=i;i=I.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var j=d;if(j)for(var E=-1,A=j.length-1;E 1) { ";var d=e.schema.items&&e.schema.items.type,m=Array.isArray(d);if(!d||"object"==d||"array"==d||m&&(0<=d.indexOf("object")||0<=d.indexOf("array")))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ";var g="checkDataType"+(m?"s":"");n+=" if ("+e.util[g](d,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",l&&(n+=" } "),n+=" if (!"+h+") { ";var v=v||[];v.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+c:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),n+=" } "):n+=" {} ";var b=n;n=v.pop(),!e.compositeRule&&f?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",f&&(n+=" else { ")}else f&&(n+=" if (true) { ");return n}},{}],39:[function(e,t,r){"use strict";t.exports=function(i,e,t){var r="",n=!0===i.schema.$async,a=i.util.schemaHasRulesExcept(i.schema,i.RULES.all,"$ref"),o=i.self._getId(i.schema);if(i.isTop&&(r+=" var validate = ",n&&(i.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(i.opts.sourceCode||i.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof i.schema||!a&&!i.schema.$ref){e="false schema";var s=i.level,c=i.dataLevel,u=i.schema[e],f=i.schemaPath+i.util.getProperty(e),p=i.errSchemaPath+"/"+e,h=!i.opts.allErrors,l="data"+(c||""),d="valid"+s;if(!1===i.schema){i.isTop?h=!0:r+=" var "+d+" = false; ",(W=W||[]).push(r),r="",!1!==i.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(p)+" , params: {} ",!1!==i.opts.messages&&(r+=" , message: 'boolean schema is false' "),i.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+i.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var m=r;r=W.pop(),!i.compositeRule&&h?i.async?r+=" throw new ValidationError(["+m+"]); ":r+=" validate.errors = ["+m+"]; return false; ":r+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else i.isTop?r+=n?" return data; ":" validate.errors = null; return true; ":r+=" var "+d+" = true; ";return i.isTop&&(r+=" }; return validate; "),r}if(i.isTop){var g=i.isTop;s=i.level=0,c=i.dataLevel=0,l="data";i.rootId=i.resolve.fullPath(i.self._getId(i.root.schema)),i.baseId=i.baseId||i.rootId,delete i.isTop,i.dataPathArr=[void 0],r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{s=i.level,l="data"+((c=i.dataLevel)||"");if(o&&(i.baseId=i.resolve.url(i.baseId,o)),n&&!i.async)throw new Error("async schema in sync schema");r+=" var errs_"+s+" = errors;"}d="valid"+s,h=!i.opts.allErrors;var v="",b="",y=i.schema.type,_=Array.isArray(y);if(_&&1==y.length&&(y=y[0],_=!1),i.schema.$ref&&a){if("fail"==i.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+i.errSchemaPath+'" (see option extendRefs)');!0!==i.opts.extendRefs&&(a=!1,i.logger.warn('$ref: keywords ignored in schema at path "'+i.errSchemaPath+'"'))}if(i.schema.$comment&&i.opts.$comment&&(r+=" "+i.RULES.all.$comment.code(i,"$comment")),y){if(i.opts.coerceTypes)var w=i.util.coerceToTypes(i.opts.coerceTypes,y);var k=i.RULES.types[y];if(w||_||!0===k||k&&!Z(k)){f=i.schemaPath+".type",p=i.errSchemaPath+"/type",f=i.schemaPath+".type",p=i.errSchemaPath+"/type";var x=_?"checkDataTypes":"checkDataType";if(r+=" if ("+i.util[x](y,l,!0)+") { ",w){var S="dataType"+s,j="coerced"+s;r+=" var "+S+" = typeof "+l+"; ","array"==i.opts.coerceTypes&&(r+=" if ("+S+" == 'object' && Array.isArray("+l+")) "+S+" = 'array'; "),r+=" var "+j+" = undefined; ";var E="",A=w;if(A)for(var I,P=-1,O=A.length-1;P>6],n=0==(32&r);if(31==(31&r)){var a=r;for(r=0;128==(128&a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function p(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)o++;(n=new u(2+o))[0]=a,n[1]=128|o;s=1+o;for(var c=i.length;0>=8)n[s]=255&c;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new u(2*e.length),i=0;i>=7)n++}var o=new u(n),s=o.length-1;for(i=e.length-1;0<=i;i--){a=e[i];for(o[s--]=127&a;0<(a>>=7);)o[s--]=128|127&a}return this._createEncoderBuffer(o)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[c(i.getFullYear()),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(i.getFullYear()%100),c(i.getUTCMonth()+1),c(i.getUTCDate()),c(i.getUTCHours()),c(i.getUTCMinutes()),c(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.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&&!u.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new u(r)}if(u.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new u(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var a=e;256<=a;a>>=8)i++;for(a=(n=new Array(i)).length-1;0<=a;a--)n[a]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new u(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var a=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),a.length!==n.defaultBuffer.length)return!1;for(i=0;i=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0===(t&=127))throw c("Indefinite length not supported");if(4this._size-i)return null;if(this._offset=i,0===this.length)return t?a.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?n:n.toString("utf8")},i.prototype.readOID=function(e){e||(e=s.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],i=0,n=0;n>0),r.join(".")},i.prototype._readTag=function(e){o.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw c("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(4this._size-r)return null;this._offset=r;for(var i=this._buf[this._offset],n=0,a=0;a>0},t.exports=i},{"./errors":60,"./types":63,assert:67,"safer-buffer":448}],63:[function(e,t,r){t.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},{}],64:[function(e,t,r){var n=e("assert"),a=e("safer-buffer").Buffer,o=e("./types"),i=e("./errors").newInvalidAsn1Error,s={size:1024,growthFactor:8};function c(e){var r,i;r=s,i=e||{},n.ok(r),n.equal(void 0===r?"undefined":_typeof(r),"object"),n.ok(i),n.equal(void 0===i?"undefined":_typeof(i),"object"),Object.getOwnPropertyNames(r).forEach(function(e){if(!i[e]){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,t)}}),e=i,this._buf=a.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw i(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},c.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=o.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&1 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;0>>24,e<<=8},c.prototype.writeNull=function(){this.writeByte(o.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=o.Enumeration),this.writeInt(e,t)},c.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=o.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},c.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+(void 0===e?"undefined":_typeof(e))+")");"number"!=typeof t&&(t=o.OctetString);var r=a.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},c.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!a.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},c.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach(function(e){t.writeString(e)})},c.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=o.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),i=[];i.push(40*parseInt(r[0],10)+parseInt(r[1],10)),r.slice(2).forEach(function(e){var t,r;t=i,(r=parseInt(e,10))<128?t.push(r):(r<16384?t.push(r>>>7|128):(r<2097152?t.push(r>>>14|128):(r<268435456?t.push(r>>>21|128):(t.push(255&(r>>>28|128)),t.push(255&(r>>>21|128))),t.push(255&(r>>>14|128))),t.push(255&(r>>>7|128))),t.push(127&r))});var n=this;this._ensure(2+i.length),this.writeByte(t),this.writeLength(i.length),i.forEach(function(e){n.writeByte(e)})},c.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw i("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},c.prototype.startSequence=function(e){"number"!=typeof e&&(e=o.Sequence|o.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw i("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},c.prototype._shift=function(e,t,r){n.ok(void 0!==e),n.ok(void 0!==t),n.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},c.prototype._ensure=function(e){if(n.ok(e),this._size-this._offset>16&255,a[o++]=t>>8&255,a[o++]=255&t;var u,f;2===n&&(t=p[e.charCodeAt(c)]<<2|p[e.charCodeAt(c+1)]>>4,a[o++]=255&t);1===n&&(t=p[e.charCodeAt(c)]<<10|p[e.charCodeAt(c+1)]<<4|p[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],a=0,o=r-i;a>2]+s[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],p=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,a=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return a.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},{}],76:[function(e,t,r){"use strict";var y=e("tweetnacl").lowlevel.crypto_hash,s=0,c=function(){this.S=[new Uint32Array([3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946]),new Uint32Array([1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055]),new Uint32Array([3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504]),new Uint32Array([976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462])],this.P=new Uint32Array([608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731])};function n(e,t,r){return(e[0][t[r+3]]+e[1][t[r+2]]^e[2][t[r+1]])+e[3][t[r]]}function u(e,t){var r,i=0;for(r=0;r<4;r++,s++)t<=s&&(s=0),i=i<<8|e[s];return i}c.prototype.encipher=function(e,t){void 0===t&&(t=new Uint8Array(e.buffer),0!==e.byteOffset&&(t=t.subarray(e.byteOffset))),e[0]^=this.P[0];for(var r=1;r<16;r+=2)e[1]^=n(this.S,t,0)^this.P[r],e[0]^=n(this.S,t,4)^this.P[r+1];var i=e[0];e[0]=e[1]^this.P[17],e[1]=i},c.prototype.decipher=function(e){var t=new Uint8Array(e.buffer);0!==e.byteOffset&&(t=t.subarray(e.byteOffset)),e[0]^=this.P[17];for(var r=16;0>>24,r[4*i+2]=a[i]>>>16,r[4*i+1]=a[i]>>>8,r[4*i+0]=a[i]}t.exports={BLOCKS:f,HASHSIZE:32,hash:_,pbkdf:function(e,t,r,i,n,a,o){var s,c,u,f,p,h,l=new Uint8Array(64),d=new Uint8Array(64),m=new Uint8Array(32),g=new Uint8Array(32),v=new Uint8Array(i+4),b=a;if(o<1)return-1;if(0===t||0===i||0===a||a>m.byteLength*m.byteLength||1<<20>>24,v[i+1]=h>>>16,v[i+2]=h>>>8,v[i+3]=h,y(d,v,i+4),_(l,d,g),s=m.byteLength;s--;)m[s]=g[s];for(s=1;sa[o]^r?1:-1;return c==u?0:u=t&&e<=r}function J(e){return"[object Array]"==Object.prototype.toString.call(e)}function Q(e,t,r){for(var i,n,a=[0],o=0,s=e.length;or-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}function ee(e,t){return(1(r=e.length)){for(i="0",t-=r;--t;i+="0");e+=i}else tt;)u[n]=0,n||(++a,u.unshift(1));for(o=u.length;!u[--o];);for(p=0,e="";p<=o;e+=U.charAt(u[p++]));e=te(e,a)}return e}function P(e,t,r,i){var n,a,o,s,c;if(r=null!=r&&k(r,0,8,i,q)?0|r:b,!e.c)return e.toString();if(n=e.c[0],o=e.e,null==t)c=Z(e.c),c=19==i||24==i&&o<=h?ee(c,o):te(c,o);else if(a=(e=C(new I(e),t,r)).e,s=(c=Z(e.c)).length,19==i||24==i&&(t<=a||a<=h)){for(;sy?e.c=e.e=null:e.c=r=p.length){if(!i)break e;for(;p.length<=u;p.push(0));c=f=0,o=(a%=K)-K+(n=1)}else{for(c=s=p[u],n=1;10<=s;s/=10,n++);f=(o=(a%=K)-K+n)<0?0:c/h[n-o-1]%10|0}if(i=i||t<0||null!=p[u+1]||(o<0?c:c%h[n-o-1]),i=r<4?(f||i)&&(0==r||r==(e.s<0?3:2)):5y?e.c=e.e=null:e.er)return null!=(e=n[r++])};return o(t="DECIMAL_PLACES")&&k(e,0,$,2,t)&&(d=0|e),i[t]=d,o(t="ROUNDING_MODE")&&k(e,0,8,2,t)&&(b=0|e),i[t]=b,o(t="EXPONENTIAL_AT")&&(J(e)?k(e[0],-$,0,2,t)&&k(e[1],0,$,2,t)&&(h=0|e[0],l=0|e[1]):k(e,-$,$,2,t)&&(h=-(l=0|(e<0?-e:e)))),i[t]=[h,l],o(t="RANGE")&&(J(e)?k(e[0],-$,-1,2,t)&&k(e[1],1,$,2,t)&&(m=0|e[0],y=0|e[1]):k(e,-$,$,2,t)&&(0|e?m=-(y=0|(e<0?-e:e)):w&&B(2,t+" cannot be zero",e))),i[t]=[m,y],o(t="ERRORS")&&(e===!!e||1===e||0===e?(_=0,k=(w=!!e)?O:X):w&&B(2,t+N,e)),i[t]=w,o(t="CRYPTO")&&(e===!!e||1===e||0===e?(x=!(!e||!F||"object"!=(void 0===F?"undefined":_typeof(F))),e&&!x&&w&&B(2,"crypto unavailable",F)):w&&B(2,t+N,e)),i[t]=x,o(t="MODULO_MODE")&&k(e,0,9,2,t)&&(S=0|e),i[t]=S,o(t="POW_PRECISION")&&k(e,0,$,2,t)&&(j=0|e),i[t]=j,o(t="FORMAT")&&("object"==(void 0===e?"undefined":_typeof(e))?E=e:w&&B(2,t+" not an object",e)),i[t]=E,i},I.max=function(){return n(arguments,i.lt)},I.min=function(){return n(arguments,i.gt)},I.random=(r=9007199254740992,u=Math.random()*r&2097151?function(){return D(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,n,a,o=0,s=[],c=new I(v);if(e=null!=e&&k(e,0,$,14)?0|e:d,n=M(e/K),x)if(F&&F.getRandomValues){for(t=F.getRandomValues(new Uint32Array(n*=2));o>>11))?(r=F.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(s.push(a%1e14),o+=2);o=n/2}else if(F&&F.randomBytes){for(t=F.randomBytes(n*=7);ot[n]?1:-1;break}return a}function A(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r](x[s]||0)&&o--,k<0)l.push(1),c=!0;else{for(b=x.length,_=S.length,k+=2,1<(u=D(n/(S[s=0]+1)))&&(S=j(S,u,n),x=j(x,u,n),_=S.length,b=x.length),v=_,m=(d=x.slice(0,_)).length;m<_;d[m++]=0);(w=S.slice()).unshift(0),y=S[0],S[1]>=n/2&&y++;do{if(u=0,(a=E(S,d,_,m))<0){if(g=d[0],_!=m&&(g=g*n+(d[1]||0)),1<(u=D(g/y)))for(n<=u&&(u=n-1),p=(f=j(S,u,n)).length,m=d.length;1==E(f,d,p,m);)u--,A(f,_this.c.length-2},i.isNaN=function(){return!this.s},i.isNegative=i.isNeg=function(){return this.s<0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.lessThan=i.lt=function(e,t){return _=8,Y(this,new I(e,t))<0},i.lessThanOrEqualTo=i.lte=function(e,t){return _=9,-1===(t=Y(this,new I(e,t)))||0===t},i.minus=i.sub=function(e,t){var r,i,n,a,o=this,s=o.s;if(_=10,t=(e=new I(e,t)).s,!s||!t)return new I(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/K,u=e.e/K,f=o.c,p=e.c;if(!c||!u){if(!f||!p)return f?(e.s=-t,e):new I(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new I(f[0]?o:3==b?-0:0)}if(c=W(c),u=W(u),f=f.slice(),s=c-u){for((n=(a=s<0)?(s=-s,f):(u=c,p)).reverse(),t=s;t--;n.push(0));n.reverse()}else for(i=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;tt&&(t=this.e+1),t},i.round=function(e,t){var r=new I(this);return(null==e||k(e,0,$,15))&&C(r,~~e+this.e+1,null!=t&&k(t,0,8,15,q)?0|t:b),r},i.shift=function(e){var t=this;return k(e,-a,a,16,"argument")?t.times("1e"+re(e)):new I(t.c&&t.c[0]&&(e<-a||at&&(r.c.length=t)}if(!(i=D(i/2)))break;n=n.times(n),t&&n.c&&n.c.length>t&&(n.c.length=t)}return e<0&&(r=v.div(r)),t?C(r,j,b):r},i.toPrecision=function(e,t){return P(this,null!=e&&k(e,1,$,24,"precision")?0|e:null,t,24)},i.toString=function(e){var t,r=this.s,i=this.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=Z(this.c),t=null!=e&&k(e,2,64,25,"base")?A(te(t,i),0|e,10,r):i<=h||l<=i?ee(t,i):te(t,i),r<0&&this.c[0]&&(t="-"+t)),t},i.truncated=i.trunc=function(){return C(new I(this),this.e+1,1)},i.valueOf=i.toJSON=function(){return this.toString()},null!=t&&I.config(t),I}(),"function"==typeof define&&define.amd)define(function(){return t});else if(void 0!==i&&i.exports){if(i.exports=t,!F)try{F=r("crypto")}catch(e){}}else e.BigNumber=t}(this)},{crypto:204}],78:[function(i,n,e){(function(e,t){"use strict";var r=n.exports;r.version="v"+i("./package.json").version,r.versionGuard=function(e){if(void 0!==e){throw new Error("More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.")}},r.versionGuard(e._bitcore),e._bitcore=r.version,r.crypto={},r.crypto.BN=i("./lib/crypto/bn"),r.crypto.ECDSA=i("./lib/crypto/ecdsa"),r.crypto.Hash=i("./lib/crypto/hash"),r.crypto.Random=i("./lib/crypto/random"),r.crypto.Point=i("./lib/crypto/point"),r.crypto.Signature=i("./lib/crypto/signature"),r.encoding={},r.encoding.Base58=i("./lib/encoding/base58"),r.encoding.Base58Check=i("./lib/encoding/base58check"),r.encoding.BufferReader=i("./lib/encoding/bufferreader"),r.encoding.BufferWriter=i("./lib/encoding/bufferwriter"),r.encoding.Varint=i("./lib/encoding/varint"),r.util={},r.util.buffer=i("./lib/util/buffer"),r.util.js=i("./lib/util/js"),r.util.preconditions=i("./lib/util/preconditions"),r.errors=i("./lib/errors"),r.Address=i("./lib/address"),r.Block=i("./lib/block"),r.MerkleBlock=i("./lib/block/merkleblock"),r.BlockHeader=i("./lib/block/blockheader"),r.HDPrivateKey=i("./lib/hdprivatekey.js"),r.HDPublicKey=i("./lib/hdpublickey.js"),r.Networks=i("./lib/networks"),r.Opcode=i("./lib/opcode"),r.PrivateKey=i("./lib/privatekey"),r.PublicKey=i("./lib/publickey"),r.Script=i("./lib/script"),r.Transaction=i("./lib/transaction"),r.URI=i("./lib/uri"),r.Unit=i("./lib/unit"),r.deps={},r.deps.bnjs=i("bn.js"),r.deps.bs58=i("bs58"),r.deps.Buffer=t,r.deps.elliptic=i("elliptic"),r.deps._=i("lodash"),r._HDKeyCache=i("./lib/hdkeycache"),r.Transaction.sighash=i("./lib/transaction/sighash")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i("buffer").Buffer)},{"./lib/address":79,"./lib/block":82,"./lib/block/blockheader":81,"./lib/block/merkleblock":83,"./lib/crypto/bn":84,"./lib/crypto/ecdsa":85,"./lib/crypto/hash":86,"./lib/crypto/point":87,"./lib/crypto/random":88,"./lib/crypto/signature":89,"./lib/encoding/base58":90,"./lib/encoding/base58check":91,"./lib/encoding/bufferreader":92,"./lib/encoding/bufferwriter":93,"./lib/encoding/varint":94,"./lib/errors":95,"./lib/hdkeycache":97,"./lib/hdprivatekey.js":98,"./lib/hdpublickey.js":99,"./lib/networks":100,"./lib/opcode":101,"./lib/privatekey":102,"./lib/publickey":103,"./lib/script":104,"./lib/transaction":107,"./lib/transaction/sighash":115,"./lib/unit":119,"./lib/uri":120,"./lib/util/buffer":121,"./lib/util/js":122,"./lib/util/preconditions":123,"./package.json":150,"bn.js":124,bs58:125,buffer:191,elliptic:127,lodash:149}],79:[function(e,t,r){(function(a){"use strict";var n=e("lodash"),o=e("./util/preconditions"),i=e("./errors"),s=e("./encoding/base58check"),c=e("./networks"),r=e("./crypto/hash"),u=e("./util/js"),f=e("./publickey");function p(e,t,r){if(!(this instanceof p))return new p(e,t,r);if(n.isArray(e)&&n.isNumber(t))return p.createMultisig(e,t,r);if(e instanceof p)return e;if(o.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!c.get(t))throw new TypeError('Second argument must be "livenet" or "testnet".');if(r&&r!==p.PayToPublicKeyHash&&r!==p.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||c.get(t)||c.defaultNetwork,i.type=i.type||r||p.PayToPublicKeyHash,u.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}p.prototype._classifyArguments=function(e,t,r){if((e instanceof a||e instanceof Uint8Array)&&20===e.length)return p._transformHash(e);if((e instanceof a||e instanceof Uint8Array)&&21===e.length)return p._transformBuffer(e,t,r);if(e instanceof f)return p._transformPublicKey(e);if(e instanceof h)return p._transformScript(e,t);if("string"==typeof e)return p._transformString(e,t,r);if(n.isObject(e))return p._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")},p.PayToPublicKeyHash="pubkeyhash",p.PayToScriptHash="scripthash",p._transformHash=function(e){var t={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==e.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t},p._transformObject=function(e){return o.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),o.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?new a(e.hash,"hex"):e.hashBuffer,network:c.get(e.network)||c.defaultNetwork,type:e.type}},p._classifyFromVersion=function(e){var t={},r=c.get(e[0],"pubkeyhash"),i=c.get(e[0],"scripthash");return r?(t.network=r,t.type=p.PayToPublicKeyHash):i&&(t.network=i,t.type=p.PayToScriptHash),t},p._transformBuffer=function(e,t,r){var i={};if(!(e instanceof a||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==e.length)throw new TypeError("Address buffers must be exactly 21 bytes.");t=c.get(t);var n=p._classifyFromVersion(e);if(!n.network||t&&t!==n.network)throw new TypeError("Address has mismatched network type.");if(!n.type||r&&r!==n.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=e.slice(1),i.network=n.network,i.type=n.type,i},p._transformPublicKey=function(e){var t={};if(!(e instanceof f))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=r.sha256ripemd160(e.toBuffer()),t.type=p.PayToPublicKeyHash,t},p._transformScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new i.Script.CantDeriveAddress(e);return r},p.createMultisig=function(e,t,r){return r=r||e[0].network||c.defaultNetwork,p.payingTo(h.buildMultisigOut(e,t),r)},p._transformString=function(e,t,r){if("string"!=typeof e)throw new TypeError("data parameter supplied is not a string.");e=e.trim();var i=s.decode(e);return p._transformBuffer(i,t,r)},p.fromPublicKey=function(e,t){var r=p._transformPublicKey(e);return t=t||c.defaultNetwork,new p(r.hashBuffer,t,r.type)},p.fromPublicKeyHash=function(e,t){return new p(p._transformHash(e).hashBuffer,t,p.PayToPublicKeyHash)},p.fromScriptHash=function(e,t){return o.checkArgument(e,"hash parameter is required"),new p(p._transformHash(e).hashBuffer,t,p.PayToScriptHash)},p.payingTo=function(e,t){return o.checkArgument(e,"script is required"),o.checkArgument(e instanceof h,"script must be instance of Script"),p.fromScriptHash(r.sha256ripemd160(e.toBuffer()),t)},p.fromScript=function(e,t){o.checkArgument(e instanceof h,"script must be a Script instance");var r=p._transformScript(e,t);return new p(r.hashBuffer,t,r.type)},p.fromBuffer=function(e,t,r){var i=p._transformBuffer(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromString=function(e,t,r){var i=p._transformString(e,t,r);return new p(i.hashBuffer,i.network,i.type)},p.fromObject=function(e){return o.checkState(u.isHexa(e.hash),'Unexpected hash property, "'+e.hash+'", expected to be hex.'),new p(new a(e.hash,"hex"),e.network,e.type)},p.getValidationError=function(e,t,r){var i;try{new p(e,t,r)}catch(e){i=e}return i},p.isValid=function(e,t,r){return!p.getValidationError(e,t,r)},p.prototype.isPayToPublicKeyHash=function(){return this.type===p.PayToPublicKeyHash},p.prototype.isPayToScriptHash=function(){return this.type===p.PayToScriptHash},p.prototype.toBuffer=function(){var e=new a([this.network[this.type]]);return a.concat([e,this.hashBuffer])},p.prototype.toObject=p.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},p.prototype.toString=function(){return s.encode(this.toBuffer())},p.prototype.inspect=function(){return""},t.exports=p;var h=e("./script")}).call(this,e("buffer").Buffer)},{"./crypto/hash":86,"./encoding/base58check":91,"./errors":95,"./networks":100,"./publickey":103,"./script":104,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],80:[function(t,l,e){(function(o){"use strict";var r=t("lodash"),n=t("./blockheader"),i=t("../crypto/bn"),a=t("../util/buffer"),s=t("../encoding/bufferreader"),c=t("../encoding/bufferwriter"),u=t("../crypto/hash"),f=t("../transaction"),p=t("../util/preconditions");function h(e){return this instanceof h?(r.extend(this,h._from(e)),this):new h(e)}h.MAX_BLOCK_SIZE=1e6,h._from=function(e){var t={};if(a.isBuffer(e))t=h._fromBufferReader(s(e));else{if(!r.isObject(e))throw new TypeError("Unrecognized argument for Block");t=h._fromObject(e)}return t},h._fromObject=function(e){var t=[];return e.transactions.forEach(function(e){e instanceof f?t.push(e):t.push(f().fromObject(e))}),{header:n.fromObject(e.header),transactions:t}},h.fromObject=function(e){return new h(h._fromObject(e))},h._fromBufferReader=function(e){var t={};p.checkState(!e.finished(),"No block data received"),t.header=n.fromBufferReader(e);var r=e.readVarintNum();t.transactions=[];for(var i=0;i"},h.Values={START_OF_BLOCK:8,NULL_HASH:new o("0000000000000000000000000000000000000000000000000000000000000000","hex")},l.exports=h}).call(this,t("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../transaction":107,"../util/buffer":121,"../util/preconditions":123,"./blockheader":81,buffer:191,lodash:149}],81:[function(f,p,e){(function(i){"use strict";var n=f("lodash"),a=f("../crypto/bn"),o=f("../util/buffer"),s=f("../encoding/bufferreader"),t=f("../encoding/bufferwriter"),r=f("../crypto/hash"),c=(f("../util/js"),f("../util/preconditions")),u=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&c.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};u._from=function(e){var t={};if(o.isBuffer(e))t=u._fromBufferReader(s(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for BlockHeader");t=u._fromObject(e)}return t},u._fromObject=function(e){c.checkArgument(e,"data is required");var t=e.prevHash,r=e.merkleRoot;return n.isString(e.prevHash)&&(t=o.reverse(new i(e.prevHash,"hex"))),n.isString(e.merkleRoot)&&(r=o.reverse(new i(e.merkleRoot,"hex"))),{hash:e.hash,version:e.version,prevHash:t,merkleRoot:r,time:e.time,timestamp:e.time,bits:e.bits,nonce:e.nonce}},u.fromObject=function(e){var t=u._fromObject(e);return new u(t)},u.fromRawBlock=function(e){o.isBuffer(e)||(e=new i(e,"binary"));var t=s(e);t.pos=u.Constants.START_OF_HEADER;var r=u._fromBufferReader(t);return new u(r)},u.fromBuffer=function(e){var t=u._fromBufferReader(s(e));return new u(t)},u.fromString=function(e){var t=new i(e,"hex");return u.fromBuffer(t)},u._fromBufferReader=function(e){var t={};return t.version=e.readUInt32LE(),t.prevHash=e.read(32),t.merkleRoot=e.read(32),t.time=e.readUInt32LE(),t.bits=e.readUInt32LE(),t.nonce=e.readUInt32LE(),t},u.fromBufferReader=function(e){var t=u._fromBufferReader(e);return new u(t)},u.prototype.toObject=u.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:o.reverse(this.prevHash).toString("hex"),merkleRoot:o.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},u.prototype.toBuffer=function(){return this.toBufferWriter().concat()},u.prototype.toString=function(){return this.toBuffer().toString("hex")},u.prototype.toBufferWriter=function(e){return e||(e=new t),e.writeUInt32LE(this.version),e.write(this.prevHash),e.write(this.merkleRoot),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e},u.prototype.getTargetDifficulty=function(e){e=e||this.bits;for(var t=new a(16777215&e),r=8*((e>>>24)-3);0e+u.Constants.MAX_TIME_OFFSET)},u.prototype.validProofOfWork=function(){var e=new a(this.id,"hex"),t=this.getTargetDifficulty();return!(0"},u.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new a("10000000000000000000000000000000000000000000000000000000000000000","hex")},p.exports=u}).call(this,f("buffer").Buffer)},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],82:[function(e,t,r){t.exports=e("./block"),t.exports.BlockHeader=e("./blockheader"),t.exports.MerkleBlock=e("./merkleblock")},{"./block":80,"./blockheader":81,"./merkleblock":83}],83:[function(e,t,r){(function(s){"use strict";var n=e("lodash"),a=e("./blockheader"),o=e("../util/buffer"),r=e("../encoding/bufferreader"),i=e("../encoding/bufferwriter"),c=e("../crypto/hash"),u=(e("../util/js"),e("../transaction")),f=e("../util/preconditions");function p(e){if(!(this instanceof p))return new p(e);var t={};if(o.isBuffer(e))t=p._fromBufferReader(r(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for MerkleBlock");t={header:e.header instanceof a?e.header:a.fromObject(e.header),numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}return n.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}p.fromBuffer=function(e){return p.fromBufferReader(r(e))},p.fromBufferReader=function(e){return new p(p._fromBufferReader(e))},p.prototype.toBuffer=function(){return this.toBufferWriter().concat()},p.prototype.toBufferWriter=function(e){e||(e=new i),e.write(this.header.toBuffer()),e.writeUInt32LE(this.numTransactions),e.writeVarintNum(this.hashes.length);for(var t=0;tthis.numTransactions)return!1;if(8*this.flags.length8*this.flags.length)return null;var i=this.flags[r.flagBitsUsed>>3]>>>(7&r.flagBitsUsed++)&1;if(0!==e&&i){var n=this._traverseMerkleTree(e-1,2*t,r),a=n;return 2*t+1=this.hashes.length)return null;var o=this.hashes[r.hashesUsed++];return 0===e&&i&&r.txs.push(o),new s(o,"hex")},p.prototype._calcTreeWidth=function(e){return this.numTransactions+(1<>e},p.prototype._calcTreeHeight=function(){for(var e=0;1e.size?t=n.trim(t,i):i>1,o=d.getN(),s=d.getG(),c=a?r.add(o):r,u=d.fromX(n,c);if(!u.mul(o).isInfinity())throw new Error("nR is not a valid curve point");var f=t.neg().mod(o),p=r.invm(o),h=u.mul(i).add(s.mul(f)).mul(p);return m.fromPoint(h,this.sig.compressed)},h.prototype.sigError=function(){if(!f.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s;if(!(e.gt(l.Zero)&&e.lt(d.getN())&&t.gt(l.Zero)&&t.lt(d.getN())))return"r and s not in range";var r=l.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),i=d.getN(),n=t.invm(i),a=n.mul(r).mod(i),o=n.mul(e).mod(i),s=d.getG().mulAdd(a,this.pubkey.point,o);return s.isInfinity()?"p is infinity":0!==s.getX().mod(i).cmp(e)&&"Invalid signature"},h.toLowS=function(e){return e.gt(l.fromBuffer(new c("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=d.getN().sub(e)),e},h.prototype._findSignature=function(e,t){for(var r,i,n,a=d.getN(),o=d.getG(),s=0;(!this.k||0i)r=e(r);else if(r>>=8)}return r},e.exports=r}).call(this,i("_process"),i("buffer").Buffer)},{_process:382,buffer:191,crypto:204}],89:[function(e,r,t){(function(u){"use strict";var g=e("./bn"),v=e("lodash"),b=e("../util/preconditions"),y=e("../util/buffer"),t=e("../util/js"),o=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof g)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};o.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=void 0!==e.i?e.i:this.i,this.compressed=void 0!==e.compressed?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this},o.fromCompact=function(e){b.checkArgument(y.isBuffer(e),"Argument is expected to be a Buffer");var t=new o,r=!0,i=e.slice(0,1)[0]-27-4;i<0&&(r=!1,i+=4);var n=e.slice(1,33),a=e.slice(33,65);return b.checkArgument(0===i||1===i||2===i||3===i,new Error("i must be 0, 1, 2, or 3")),b.checkArgument(32===n.length,new Error("r must be 32 bytes")),b.checkArgument(32===a.length,new Error("s must be 32 bytes")),t.compressed=r,t.i=i,t.r=g.fromBuffer(n),t.s=g.fromBuffer(a),t},o.fromDER=o.fromBuffer=function(e,t){var r=o.parseDER(e,t),i=new o;return i.r=r.r,i.s=r.s,i},o.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=new o.fromDER(r,!1);return i.nhashtype=t,i},o.fromString=function(e){var t=new u(e,"hex");return o.fromDER(t)},o.parseDER=function(e,t){b.checkArgument(y.isBuffer(e),new Error("DER formatted signature should be a buffer")),v.isUndefined(t)&&(t=!0);var r=e[0];b.checkArgument(48===r,new Error("Header byte should be 0x30"));var i=e[1],n=e.slice(2).length;b.checkArgument(!t||i===n,new Error("Length byte should length of what follows")),i=i=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(2!==e[2])return!1;if(0===t)return!1;if(128&i[0])return!1;if(1=this.buf.length},e.prototype.read=function(e){r.checkArgument(!n.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t},e.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e},e.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e},e.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e},e.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e},e.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=o.fromBuffer(e);return this.pos=this.pos+8,t},e.prototype.readUInt64LEBN=function(){var e,t=this.buf.readUInt32LE(this.pos),r=4294967296*this.buf.readUInt32LE(this.pos+4)+t;if(r<=9007199254740991)e=new o(r);else{var i=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);e=new o(i,10,"le")}return this.pos=this.pos+8,e},e.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN().toNumber();if(t<=Math.pow(2,53))return t;throw new Error("number too large to retain precision - use readVarintBN");default:return e}},e.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return r.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t},e.prototype.readVarintBuf=function(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},e.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new o(this.readUInt16LE());case 254:return new o(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new o(e)}},e.prototype.reverse=function(){for(var e=new i(this.buf.length),t=0;t"},k.prototype.toObject=k.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:_.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},k.fromBuffer=function(e){return new k(e.toString())},k.prototype.toBuffer=function(){return _.copy(this._buffers.xprivkey)},k.DefaultDepth=0,k.DefaultFingerprint=0,k.DefaultChildIndex=0,k.MaxIndex=2*(k.Hardened=2147483648),k.RootElementAlias=["m","M","m'","M'"],k.VersionSize=4,k.DepthSize=1,k.ParentFingerPrintSize=4,k.ChildIndexSize=4,k.ChainCodeSize=32,k.PrivateKeySize=32,k.CheckSumSize=4,k.DataLength=78,k.SerializedByteSize=82,n((k.ChecksumEnd=(k.ChecksumStart=k.PrivateKeyEnd=(k.PrivateKeyStart=(k.ChainCodeEnd=(k.ChainCodeStart=k.ChildIndexEnd=(k.ChildIndexStart=k.ParentFingerPrintEnd=(k.ParentFingerPrintStart=k.DepthEnd=(k.DepthStart=k.VersionEnd=(k.VersionStart=0)+k.VersionSize)+k.DepthSize)+k.ParentFingerPrintSize)+k.ChildIndexSize)+k.ChainCodeSize)+1)+k.PrivateKeySize)+k.CheckSumSize)===k.SerializedByteSize),e.exports=k}).call(this,o("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./crypto/random":88,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdpublickey":99,"./networks":100,"./privatekey":102,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],99:[function(i,s,e){(function(u){"use strict";var n=i("lodash"),t=i("./util/preconditions"),f=i("./crypto/bn"),a=i("./encoding/base58"),p=i("./encoding/base58check"),h=i("./crypto/hash"),r=i("./hdprivatekey"),l=i("./hdkeycache"),d=i("./networks"),m=i("./crypto/point"),g=i("./publickey"),e=i("./errors"),v=e,b=e.HDPublicKey,o=i("assert"),y=i("./util/js"),_=i("./util/buffer");function w(e){if(e instanceof w)return e;if(!(this instanceof w))return new w(e);if(e){if(n.isString(e)||_.isBuffer(e)){var t=w.getSerializedError(e);if(t){if(_.isBuffer(e)&&!w.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof b.ArgumentIsPrivateExtended)return new r(e).hdPublicKey;throw t}return this._buildFromSerialized(e)}if(n.isObject(e))return e instanceof r?this._buildFromPrivate(e):this._buildFromObject(e);throw new b.UnrecognizedArgument(e)}throw new b.MustSupplyArgument}w.isValidPath=function(e){if(n.isString(e)){var t=r._getDerivationIndexes(e);return null!==t&&n.all(t,w.isValidPath)}return!!n.isNumber(e)&&(0<=e&&e"},w.prototype.toObject=w.prototype.toJSON=function(){return{network:d.get(_.integerFromBuffer(this._buffers.version)).name,depth:_.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:_.integerFromBuffer(this.fingerPrint),parentFingerPrint:_.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:_.integerFromBuffer(this._buffers.childIndex),chainCode:_.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:_.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},w.fromBuffer=function(e){return new w(e)},w.prototype.toBuffer=function(){return _.copy(this._buffers.xpubkey)},w.Hardened=2147483648,w.RootElementAlias=["m","M"],w.VersionSize=4,w.DepthSize=1,w.ParentFingerPrintSize=4,w.ChildIndexSize=4,w.ChainCodeSize=32,w.PublicKeySize=33,w.CheckSumSize=4,w.DataSize=78,w.SerializedByteSize=82,w.ChecksumEnd=(w.ChecksumStart=w.PublicKeyEnd=(w.PublicKeyStart=w.ChainCodeEnd=(w.ChainCodeStart=w.ChildIndexEnd=(w.ChildIndexStart=w.ParentFingerPrintEnd=(w.ParentFingerPrintStart=w.DepthEnd=(w.DepthStart=w.VersionEnd=(w.VersionStart=0)+w.VersionSize)+w.DepthSize)+w.ParentFingerPrintSize)+w.ChildIndexSize)+w.ChainCodeSize)+w.PublicKeySize)+w.CheckSumSize,o(w.PublicKeyEnd===w.DataSize),o(w.ChecksumEnd===w.SerializedByteSize),s.exports=w}).call(this,i("buffer").Buffer)},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdprivatekey":98,"./networks":100,"./publickey":103,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,assert:67,buffer:191,lodash:149}],100:[function(e,t,r){"use strict";var n=e("lodash"),i=e("./util/buffer"),a=e("./util/js"),o=[],s={};function c(){}function u(t,e){if(~o.indexOf(t))return t;if(!e)return s[t];n.isArray(e)||(e=[e]);var r=function(e){return o[i][e]===t};for(var i in o)if(n.any(e,r))return o[i]}function f(e){var t=new c;return a.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey}),e.networkMagic&&a.defineImmutable(t,{networkMagic:i.integerAsBuffer(e.networkMagic)}),e.port&&a.defineImmutable(t,{port:e.port}),e.dnsSeeds&&a.defineImmutable(t,{dnsSeeds:e.dnsSeeds}),n.each(t,function(e){n.isUndefined(e)||n.isObject(e)||(s[e]=t)}),o.push(t),t}c.prototype.toString=function(){return this.name},f({name:"livenet",alias:"mainnet",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var p=u("livenet");f({name:"testnet",alias:"regtest",pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956});var h=u("testnet"),l={PORT:18333,NETWORK_MAGIC:i.integerAsBuffer(185665799),DNS_SEEDS:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]};for(var d in l)n.isObject(l[d])||(s[l[d]]=h);var m={PORT:18444,NETWORK_MAGIC:i.integerAsBuffer(4206867930),DNS_SEEDS:[]};for(var d in m)n.isObject(m[d])||(s[m[d]]=h);Object.defineProperty(h,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.PORT:l.PORT}}),Object.defineProperty(h,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.NETWORK_MAGIC:l.NETWORK_MAGIC}}),Object.defineProperty(h,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?m.DNS_SEEDS:l.DNS_SEEDS}}),t.exports={add:f,remove:function(e){for(var t=0;t=a.map.OP_1&&e<=a.map.OP_16},a.prototype.inspect=function(){return""},c.exports=a}).call(this,s("buffer").Buffer)},{"./util/buffer":121,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],102:[function(h,l,e){(function(i){"use strict";var n=h("lodash"),r=h("./address"),a=h("./encoding/base58check"),o=h("./crypto/bn"),s=h("./util/js"),c=h("./networks"),u=h("./crypto/point"),e=h("./publickey"),f=h("./crypto/random"),t=h("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(e instanceof p)return e;var r=this._classifyArguments(e,t);if(!r.bn||0===r.bn.cmp(new o(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(u.getN()))throw new TypeError("Number must be less than N");if(void 0===r.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return s.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}p.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?c.get(t):c.defaultNetwork};if(n.isUndefined(e)||n.isNull(e))r.bn=p._getRandomBN();else if(e instanceof o)r.bn=e;else if(e instanceof i||e instanceof Uint8Array)r=p._transformBuffer(e,t);else if(e.bn&&e.network)r=p._transformObject(e);else if(!t&&c.get(e))r.bn=p._getRandomBN(),r.network=c.get(e);else{if("string"!=typeof e)throw new TypeError("First argument is an unrecognized data type.");s.isHexa(e)?r.bn=new o(new i(e,"hex")):r=p._transformWIF(e,t)}return r},p._getRandomBN=function(){var e,t;do{var r=f.getRandomBuffer(32);e=(t=o.fromBuffer(r)).lt(u.getN())}while(!e);return t},p._transformBuffer=function(e,t){var r={};if(32===e.length)return p._transformBNBuffer(e,t);if(r.network=c.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==c.get(t))throw new TypeError("Private key network mismatch");if(34===e.length&&1===e[33])r.compressed=!0;else{if(33!==e.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");r.compressed=!1}return r.bn=o.fromBuffer(e.slice(1,33)),r},p._transformBNBuffer=function(e,t){var r={};return r.network=c.get(t)||c.defaultNetwork,r.bn=o.fromBuffer(e),r.compressed=!1,r},p._transformWIF=function(e,t){return p._transformBuffer(a.decode(e),t)},p.fromBuffer=function(e,t){return new p(e,t)},p._transformObject=function(e){return{bn:new o(e.bn,"hex"),network:c.get(e.network),compressed:e.compressed}},p.fromString=p.fromWIF=function(e){return t.checkArgument(n.isString(e),"First argument is expected to be a string."),new p(e)},p.fromObject=function(e){return t.checkArgument(n.isObject(e),"First argument is expected to be an object."),new p(e)},p.fromRandom=function(e){return new p(p._getRandomBN(),e)},p.getValidationError=function(e,t){var r;try{new p(e,t)}catch(e){r=e}return r},p.isValid=function(e,t){return!!e&&!p.getValidationError(e,t)},p.prototype.toString=function(){return this.toBuffer().toString("hex")},p.prototype.toWIF=function(){var e,t=this.network;return e=this.compressed?i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32}),new i([1])]):i.concat([new i([t.privatekey]),this.bn.toBuffer({size:32})]),a.encode(e)},p.prototype.toBigNumber=function(){return this.bn},p.prototype.toBuffer=function(){return this.bn.toBuffer()},p.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=e.fromPrivateKey(this)),this._pubkey},p.prototype.toAddress=function(e){var t=this.toPublicKey();return r.fromPublicKey(t,e||this.network)},p.prototype.toObject=p.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},p.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return""},l.exports=p}).call(this,h("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/point":87,"./crypto/random":88,"./encoding/base58check":91,"./networks":100,"./publickey":103,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],103:[function(t,r,e){(function(o){"use strict";var s=t("./crypto/bn"),c=t("./crypto/point"),e=t("./crypto/hash"),i=t("./util/js"),n=t("./networks"),u=t("lodash"),f=t("./util/preconditions");function p(e,t){if(!(this instanceof p))return new p(e,t);if(f.checkArgument(e,"First argument is required, please include public key data."),e instanceof p)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),i.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||n.defaultNetwork}),this}p.prototype._classifyArgs=function(e,t){var r={compressed:u.isUndefined(t.compressed)||t.compressed};if(e instanceof c)r.point=e;else if(e.x&&e.y)r=p._transformObject(e);else if("string"==typeof e)r=p._transformDER(new o(e,"hex"));else if(p._isBuffer(e))r=p._transformDER(e);else{if(!p._isPrivateKey(e))throw new TypeError("First argument is an unrecognized data format.");r=p._transformPrivateKey(e)}return r.network||(r.network=u.isUndefined(t.network)?void 0:n.get(t.network)),r},p._isPrivateKey=function(e){return e instanceof t("./privatekey")},p._isBuffer=function(e){return e instanceof o||e instanceof Uint8Array},p._transformPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=c.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t},p._transformDER=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r,i,n,a,o={};if(t=!!u.isUndefined(t)||t,4!==e[0]&&(t||6!==e[0]&&7!==e[0]))if(3===e[0])n=e.slice(1),r=new s(n),(o=p._transformX(!0,r)).compressed=!0;else{if(2!==e[0])throw new TypeError("Invalid DER format public key");n=e.slice(1),r=new s(n),(o=p._transformX(!1,r)).compressed=!0}else{if(n=e.slice(1,33),a=e.slice(33,65),32!==n.length||32!==a.length||65!==e.length)throw new TypeError("Length of x and y must be 32 bytes");r=new s(n),i=new s(a),o.point=new c(r,i),o.compressed=!1}return o},p._transformX=function(e,t){f.checkArgument("boolean"==typeof e,"Must specify whether y is odd or not (true or false)");var r={};return r.point=c.fromX(e,t),r},p._transformObject=function(e){var t=new s(e.x,"hex"),r=new s(e.y,"hex");return new p(new c(t,r),{compressed:e.compressed})},p.fromPrivateKey=function(e){f.checkArgument(p._isPrivateKey(e),"Must be an instance of PrivateKey");var t=p._transformPrivateKey(e);return new p(t.point,{compressed:t.compressed,network:t.network})},p.fromDER=p.fromBuffer=function(e,t){f.checkArgument(p._isBuffer(e),"Must be a hex buffer of DER encoded public key");var r=p._transformDER(e,t);return new p(r.point,{compressed:r.compressed})},p.fromPoint=function(e,t){return f.checkArgument(e instanceof c,"First argument must be an instance of Point."),new p(e,{compressed:t})},p.fromString=function(e,t){var r=new o(e,t||"hex"),i=p._transformDER(r);return new p(i.point,{compressed:i.compressed})},p.fromX=function(e,t){var r=p._transformX(e,t);return new p(r.point,{compressed:r.compressed})},p.getValidationError=function(e){var t;try{new p(e)}catch(e){t=e}return t},p.isValid=function(e){return!p.getValidationError(e)},p.prototype.toObject=p.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},p.prototype.toBuffer=p.prototype.toDER=function(){var e,t=this.point.getX(),r=this.point.getY(),i=t.toBuffer({size:32}),n=r.toBuffer({size:32});if(this.compressed){var a=n[n.length-1]%2;return e=new o(a?[3]:[2]),o.concat([e,i])}return e=new o([4]),o.concat([e,i,n])},p.prototype._getID=function(){return e.sha256ripemd160(this.toBuffer())},p.prototype.toAddress=function(e){return t("./address").fromPublicKey(this,e||this.network)},p.prototype.toString=function(){return this.toDER().toString("hex")},p.prototype.inspect=function(){return""},r.exports=p}).call(this,t("buffer").Buffer)},{"./address":79,"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./networks":100,"./privatekey":102,"./util/js":122,"./util/preconditions":123,buffer:191,lodash:149}],104:[function(e,t,r){t.exports=e("./script"),t.exports.Interpreter=e("./interpreter")},{"./interpreter":105,"./script":106}],105:[function(p,t,e){(function(e){"use strict";var R=p("lodash"),z=p("./script"),M=p("../opcode"),D=p("../crypto/bn"),N=p("../crypto/hash"),q=p("../crypto/signature"),L=p("../publickey"),U=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};U.prototype.verify=function(e,t,r,i,n){var a,o=p("../transaction");if(R.isUndefined(r)&&(r=new o),R.isUndefined(i)&&(i=0),R.isUndefined(n)&&(n=0),this.set({script:e,tx:r,nin:i,flags:n}),0!=(n&U.SCRIPT_VERIFY_SIGPUSHONLY)&&!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(!this.evaluate())return!1;n&U.SCRIPT_VERIFY_P2SH&&(a=this.stack.slice());var s=this.stack;if(this.initialize(),this.set({script:t,stack:s,tx:r,nin:i,flags:n}),!this.evaluate())return!1;if(0===this.stack.length)return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT");var c=this.stack[this.stack.length-1];if(!U.castToBool(c))return!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK");if(n&U.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return!(this.errstr="SCRIPT_ERR_SIG_PUSHONLY");if(0===a.length)throw new Error("internal error - stack copy empty");var u=a[a.length-1],f=z.fromBuffer(u);return a.pop(),this.initialize(),this.set({script:f,stack:a,tx:r,nin:i,flags:n}),!!this.evaluate()&&(0===a.length?!(this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK"):!!U.castToBool(a[a.length-1])||!(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK"))}return!0},(t.exports=U).prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},U.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=void 0!==e.nin?e.nin:this.nin,this.stack=e.stack||this.stack,this.altstack=e.altack||this.altstack,this.pc=void 0!==e.pc?e.pc:this.pc,this.pbegincodehash=void 0!==e.pbegincodehash?e.pbegincodehash:this.pbegincodehash,this.nOpCount=void 0!==e.nOpCount?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=void 0!==e.flags?e.flags:this.flags},U.true=new e([1]),U.false=new e([]),U.MAX_SCRIPT_ELEMENT_SIZE=520,U.LOCKTIME_THRESHOLD_BN=new D(U.LOCKTIME_THRESHOLD=5e8),U.SCRIPT_VERIFY_NONE=0,U.SCRIPT_VERIFY_P2SH=1,U.SCRIPT_VERIFY_STRICTENC=2,U.SCRIPT_VERIFY_DERSIG=4,U.SCRIPT_VERIFY_LOW_S=8,U.SCRIPT_VERIFY_NULLDUMMY=16,U.SCRIPT_VERIFY_SIGPUSHONLY=32,U.SCRIPT_VERIFY_MINIMALDATA=64,U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,U.castToBool=function(e){for(var t=0;t=U.LOCKTIME_THRESHOLD&&e.gte(U.LOCKTIME_THRESHOLD_BN))&&(!e.gt(new D(this.tx.nLockTime))&&!!this.tx.inputs[this.nin].isFinal())},U.prototype.step=function(){var e,t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g,v=0!=(this.flags&U.SCRIPT_VERIFY_MINIMALDATA),b=-1===this.vfExec.indexOf(!1),y=this.script.chunks[this.pc];this.pc++;var _=y.opcodenum;if(R.isUndefined(_))return!(this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE");if(y.buf&&y.buf.length>U.MAX_SCRIPT_ELEMENT_SIZE)return!(this.errstr="SCRIPT_ERR_PUSH_SIZE");if(_>M.OP_16&&201<++this.nOpCount)return!(this.errstr="SCRIPT_ERR_OP_COUNT");if(_===M.OP_CAT||_===M.OP_SUBSTR||_===M.OP_LEFT||_===M.OP_RIGHT||_===M.OP_INVERT||_===M.OP_AND||_===M.OP_OR||_===M.OP_XOR||_===M.OP_2MUL||_===M.OP_2DIV||_===M.OP_MUL||_===M.OP_DIV||_===M.OP_MOD||_===M.OP_LSHIFT||_===M.OP_RSHIFT)return!(this.errstr="SCRIPT_ERR_DISABLED_OPCODE");if(b&&0<=_&&_<=M.OP_PUSHDATA4){if(v&&!this.script.checkMinimalPush(this.pc-1))return!(this.errstr="SCRIPT_ERR_MINIMALDATA");if(y.buf){if(y.len!==y.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(y.buf)}else this.stack.push(U.false)}else if(b||M.OP_IF<=_&&_<=M.OP_ENDIF)switch(_){case M.OP_1NEGATE:case M.OP_1:case M.OP_2:case M.OP_3:case M.OP_4:case M.OP_5:case M.OP_6:case M.OP_7:case M.OP_8:case M.OP_9:case M.OP_10:case M.OP_11:case M.OP_12:case M.OP_13:case M.OP_14:case M.OP_15:case M.OP_16:n=_-(M.OP_1-1),e=new D(n).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_NOP:break;case M.OP_NOP2:case M.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&U.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break}if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");var w=D.fromScriptNumBuffer(this.stack[this.stack.length-1],v,5);if(w.lt(new D(0)))return!(this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME");if(!this.checkLockTime(w))return!(this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME");break;case M.OP_NOP1:case M.OP_NOP3:case M.OP_NOP4:case M.OP_NOP5:case M.OP_NOP6:case M.OP_NOP7:case M.OP_NOP8:case M.OP_NOP9:case M.OP_NOP10:if(this.flags&U.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return!(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS");break;case M.OP_IF:case M.OP_NOTIF:if(m=!1,b){if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");e=this.stack.pop(),m=U.castToBool(e),_===M.OP_NOTIF&&(m=!m)}this.vfExec.push(m);break;case M.OP_ELSE:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case M.OP_ENDIF:if(0===this.vfExec.length)return!(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL");this.vfExec.pop();break;case M.OP_VERIFY:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],!(m=U.castToBool(e)))return!(this.errstr="SCRIPT_ERR_VERIFY");this.stack.pop();break;case M.OP_RETURN:return!(this.errstr="SCRIPT_ERR_OP_RETURN");case M.OP_TOALTSTACK:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.altstack.push(this.stack.pop());break;case M.OP_FROMALTSTACK:if(this.altstack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION");this.stack.push(this.altstack.pop());break;case M.OP_2DROP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop(),this.stack.pop();break;case M.OP_2DUP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1],this.stack.push(t),this.stack.push(r);break;case M.OP_3DUP:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-3],r=this.stack[this.stack.length-2];var k=this.stack[this.stack.length-1];this.stack.push(t),this.stack.push(r),this.stack.push(k);break;case M.OP_2OVER:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-4],r=this.stack[this.stack.length-3],this.stack.push(t),this.stack.push(r);break;case M.OP_2ROT:if(this.stack.length<6)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-6,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_2SWAP:if(this.stack.length<4)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");i=this.stack.splice(this.stack.length-4,2),this.stack.push(i[0]),this.stack.push(i[1]);break;case M.OP_IFDUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-1],(m=U.castToBool(e))&&this.stack.push(e);break;case M.OP_DEPTH:e=new D(this.stack.length).toScriptNumBuffer(),this.stack.push(e);break;case M.OP_DROP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.pop();break;case M.OP_DUP:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-1]);break;case M.OP_NIP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,1);break;case M.OP_OVER:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.push(this.stack[this.stack.length-2]);break;case M.OP_PICK:case M.OP_ROLL:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");if(e=this.stack[this.stack.length-1],n=(s=D.fromScriptNumBuffer(e,v)).toNumber(),this.stack.pop(),n<0||n>=this.stack.length)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");e=this.stack[this.stack.length-n-1],_===M.OP_ROLL&&this.stack.splice(this.stack.length-n-1,1),this.stack.push(e);break;case M.OP_ROT:if(this.stack.length<3)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-3],o=this.stack[this.stack.length-2];var x=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=o,this.stack[this.stack.length-2]=x,this.stack[this.stack.length-1]=a;break;case M.OP_SWAP:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");a=this.stack[this.stack.length-2],o=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=o,this.stack[this.stack.length-1]=a;break;case M.OP_TUCK:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case M.OP_SIZE:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");s=new D(this.stack[this.stack.length-1].length),this.stack.push(s.toScriptNumBuffer());break;case M.OP_EQUAL:case M.OP_EQUALVERIFY:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");t=this.stack[this.stack.length-2],r=this.stack[this.stack.length-1];var S=t.toString("hex")===r.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(S?U.true:U.false),_===M.OP_EQUALVERIFY){if(!S)return!(this.errstr="SCRIPT_ERR_EQUALVERIFY");this.stack.pop()}break;case M.OP_1ADD:case M.OP_1SUB:case M.OP_NEGATE:case M.OP_ABS:case M.OP_NOT:case M.OP_0NOTEQUAL:if(this.stack.length<1)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(e=this.stack[this.stack.length-1],s=D.fromScriptNumBuffer(e,v),_){case M.OP_1ADD:s=s.add(D.One);break;case M.OP_1SUB:s=s.sub(D.One);break;case M.OP_NEGATE:s=s.neg();break;case M.OP_ABS:s.cmp(D.Zero)<0&&(s=s.neg());break;case M.OP_NOT:s=new D((0===s.cmp(D.Zero))+0);break;case M.OP_0NOTEQUAL:s=new D((0!==s.cmp(D.Zero))+0)}this.stack.pop(),this.stack.push(s.toScriptNumBuffer());break;case M.OP_ADD:case M.OP_SUB:case M.OP_BOOLAND:case M.OP_BOOLOR:case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:case M.OP_NUMNOTEQUAL:case M.OP_LESSTHAN:case M.OP_GREATERTHAN:case M.OP_LESSTHANOREQUAL:case M.OP_GREATERTHANOREQUAL:case M.OP_MIN:case M.OP_MAX:if(this.stack.length<2)return!(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION");switch(c=D.fromScriptNumBuffer(this.stack[this.stack.length-2],v),u=D.fromScriptNumBuffer(this.stack[this.stack.length-1],v),s=new D(0),_){case M.OP_ADD:s=c.add(u);break;case M.OP_SUB:s=c.sub(u);break;case M.OP_BOOLAND:s=new D((0!==c.cmp(D.Zero)&&0!==u.cmp(D.Zero))+0);break;case M.OP_BOOLOR:s=new D((0!==c.cmp(D.Zero)||0!==u.cmp(D.Zero))+0);break;case M.OP_NUMEQUAL:case M.OP_NUMEQUALVERIFY:s=new D((0===c.cmp(u))+0);break;case M.OP_NUMNOTEQUAL:s=new D((0!==c.cmp(u))+0);break;case M.OP_LESSTHAN:s=new D((c.cmp(u)<0)+0);break;case M.OP_GREATERTHAN:s=new D((0"},v.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==c.OP_DUP||this.chunks[1].opcodenum!==c.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==c.OP_EQUALVERIFY||this.chunks[4].opcodenum!==c.OP_CHECKSIG)},v.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&48===e[0]&&t&&t.length){var r=t[0];if((4===r||6===r||7===r)&&65===t.length)return!0;if((3===r||2===r)&&33===t.length)return!0}}return!1},v.prototype.getPublicKey=function(){return p.checkState(this.isPublicKeyOut(),"Can't retreive PublicKey from a non-PK output"),this.chunks[0].buf},v.prototype.getPublicKeyHash=function(){return p.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},v.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===c.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if((4!==t&&6!==t&&7!==t||65!==e.length)&&(3!==t&&2!==t||33!==e.length)||(r=!0),r)return u.isValid(e)}return!1},v.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var e=this.chunks[0].buf;if(e&&e.length&&48===e[0])return!0}return!1},v.prototype.isScriptHashOut=function(){var e=this.toBuffer();return 23===e.length&&e[0]===c.OP_HASH160&&20===e[1]&&e[e.length-1]===c.OP_EQUAL},v.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e,t=this.chunks[this.chunks.length-1].buf;if(!t)return!1;try{e=v.fromBuffer(t)}catch(e){if(e instanceof l.Script.InvalidBuffer)return!1;throw e}return e.classify()!==v.types.UNKNOWN},v.prototype.isMultisigOut=function(){return 3=c.OP_1&&e<=c.OP_16)return e-(c.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))},v.prototype.getSignatureOperationsCount=function(r){r=!!h.isUndefined(r)||r;var i=this,n=0,a=c.OP_INVALIDOPCODE;return h.each(i.chunks,function(e){var t=e.opcodenum;t==c.OP_CHECKSIG||t==c.OP_CHECKSIGVERIFY?n++:t!=c.OP_CHECKMULTISIG&&t!=c.OP_CHECKMULTISIGVERIFY||(r&&a>=c.OP_1&&a<=c.OP_16?n+=i._decodeOP_N(a):n+=20),a=t}),n},t.exports=v}).call(this,e("buffer").Buffer)},{"../address":79,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../networks":100,"../opcode":101,"../publickey":103,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],107:[function(e,t,r){t.exports=e("./transaction"),t.exports.Input=e("./input"),t.exports.Output=e("./output"),t.exports.UnspentOutput=e("./unspentoutput"),t.exports.Signature=e("./signature"),t.exports.Sighash=e("./sighash")},{"./input":108,"./output":114,"./sighash":115,"./signature":116,"./transaction":117,"./unspentoutput":118}],108:[function(e,t,r){t.exports=e("./input"),t.exports.PublicKey=e("./publickey"),t.exports.PublicKeyHash=e("./publickeyhash"),t.exports.MultiSig=e("./multisig.js"),t.exports.MultiSigScriptHash=e("./multisigscripthash.js")},{"./input":109,"./multisig.js":110,"./multisigscripthash.js":111,"./publickey":112,"./publickeyhash":113}],109:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../../util/preconditions"),a=e("../../errors"),o=e("../../encoding/bufferwriter"),s=e("buffer"),c=e("../../util/buffer"),u=e("../../util/js"),f=e("../../script"),p=e("../sighash"),h=e("../output"),l=4294967295;function d(e){return this instanceof d?e?this._fromObject(e):void 0:new d(e)}d.MAXINT=l,d.DEFAULT_SEQNUMBER=4294967295,d.DEFAULT_LOCKTIME_SEQNUMBER=4294967294,d.DEFAULT_RBF_SEQNUMBER=4294967293,Object.defineProperty(d.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new f(this._scriptBuffer),this._script._isInput=!0),this._script)}}),d.fromObject=function(e){return n.checkArgument(i.isObject(e)),(new d)._fromObject(e)},d.prototype._fromObject=function(e){var t;if(t=i.isString(e.prevTxId)&&u.isHexa(e.prevTxId)?new s.Buffer(e.prevTxId,"hex"):e.prevTxId,this.output=e.output?e.output instanceof h?e.output:new h(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=i.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=i.isUndefined(e.sequenceNumber)?i.isUndefined(e.seqnum)?4294967295:e.seqnum:e.sequenceNumber,i.isUndefined(e.script)&&i.isUndefined(e.scriptBuffer))throw new a.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this},d.prototype.toObject=d.prototype.toJSON=function(){var e={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(e.scriptString=this.script.toString()),this.output&&(e.output=this.output.toObject()),e},d.fromBufferReader=function(e){var t=new d;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t},d.prototype.toBufferWriter=function(e){e||(e=new o),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e},d.prototype.setScript=function(e){if(this._script=null,e instanceof f)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(u.isHexa(e))this._scriptBuffer=new s.Buffer(e,"hex");else if(i.isString(e))this._script=new f(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!c.isBuffer(e))throw new TypeError("Invalid argument type: script");this._scriptBuffer=new s.Buffer(e)}return this},d.prototype.getSignatures=function(){throw new a.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},d.prototype.isFullySigned=function(){throw new a.AbstractMethodInvoked("Input#isFullySigned")},d.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},d.prototype.addSignature=function(){throw new a.AbstractMethodInvoked("Input#addSignature")},d.prototype.clearSignatures=function(){throw new a.AbstractMethodInvoked("Input#clearSignatures")},d.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},d.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},d.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},t.exports=d},{"../../encoding/bufferwriter":93,"../../errors":95,"../../script":104,"../../util/buffer":121,"../../util/js":122,"../../util/preconditions":123,"../output":114,"../sighash":115,buffer:191,lodash:149}],110:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=(e("../transaction"),e("./input")),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),u.checkState(o.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.output.script),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script)},l.normalizeSignatures=function(n,a,o,e,t){return t.map(function(r){var i=null;return e=e.filter(function(e){if(i)return!0;var t=new h({signature:f.fromTxFormat(e),publicKey:r,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:o,sigtype:f.SIGHASH_ALL});return t.signature.nhashtype=t.sigtype,!p.verify(n,t.signature,t.publicKey,t.inputIndex,a.output.script)||(i=t,!1)}),i||null})},l.OPCODES_SIZE=1,l.SIGNATURE_SIZE=73,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"../transaction":117,"./input":109,inherits:148,lodash:149}],111:[function(e,t,r){"use strict";var s=e("lodash"),i=e("inherits"),a=e("./input"),c=e("../output"),u=e("../../util/preconditions"),o=e("../../script"),f=e("../../crypto/signature"),p=e("../sighash"),n=(e("../../publickey"),e("../../util/buffer")),h=e("../signature");function l(e,t,r,i){a.apply(this,arguments);var n=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=s.sortBy(t,function(e){return e.toString("hex")}),this.redeemScript=o.buildMultisigOut(this.publicKeys,r),u.checkState(o.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},s.each(this.publicKeys,function(e,t){n.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}i(l,a),l.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=s.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},l.prototype._deserializeSignatures=function(e){return s.map(e,function(e){if(e)return new h(e)})},l.prototype._serializeSignatures=function(){return s.map(this.signatures,function(e){if(e)return e.toObject()})},l.prototype.getSignatures=function(t,r,i,n){u.checkState(this.output instanceof c),n=n||f.SIGHASH_ALL;var a=this,o=[];return s.each(this.publicKeys,function(e){e.toString()===r.publicKey.toString()&&o.push(new h({publicKey:r.publicKey,prevTxId:a.prevTxId,outputIndex:a.outputIndex,inputIndex:i,signature:p.sign(t,r,n,i,a.redeemScript),sigtype:n}))}),o},l.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!s.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},l.prototype._updateScript=function(){return this.setScript(o.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this},l.prototype._createSignatures=function(){return s.map(s.filter(this.signatures,function(e){return!s.isUndefined(e)}),function(e){return n.concat([e.signature.toDER(),n.integerAsSingleByteBuffer(e.sigtype)])})},l.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},l.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},l.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},l.prototype.countSignatures=function(){return s.reduce(this.signatures,function(e,t){return e+!!t},0)},l.prototype.publicKeysWithoutSignature=function(){var t=this;return s.filter(this.publicKeys,function(e){return!t.signatures[t.publicKeyIndex[e.toString()]]})},l.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,p.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript)},l.OPCODES_SIZE=7,l.SIGNATURE_SIZE=74,l.PUBKEY_SIZE=34,l.prototype._estimateSize=function(){return l.OPCODES_SIZE+this.threshold*l.SIGNATURE_SIZE+this.publicKeys.length*l.PUBKEY_SIZE},t.exports=l},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148,lodash:149}],112:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),n=(e("../../util/buffer"),e("./input")),o=e("../output"),s=e("../sighash"),c=e("../../script"),u=e("../../crypto/signature"),f=e("../signature");function p(){n.apply(this,arguments)}i(p,n),p.prototype.getSignatures=function(e,t,r,i){a.checkState(this.output instanceof o),i=i||u.SIGHASH_ALL;var n=t.toPublicKey();return n.toString()===this.output.script.getPublicKey().toString("hex")?[new f({publicKey:n,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:s.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},p.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(c.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this},p.prototype.clearSignatures=function(){return this.setScript(c.empty()),this},p.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},p.SCRIPT_MAX_SIZE=73,p.prototype._estimateSize=function(){return p.SCRIPT_MAX_SIZE},t.exports=p},{"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],113:[function(e,t,r){"use strict";var i=e("inherits"),a=e("../../util/preconditions"),o=e("../../util/buffer"),s=e("../../crypto/hash"),n=e("./input"),c=e("../output"),u=e("../sighash"),f=e("../../script"),p=e("../../crypto/signature"),h=e("../signature");function l(){n.apply(this,arguments)}i(l,n),l.prototype.getSignatures=function(e,t,r,i,n){return a.checkState(this.output instanceof c),n=n||s.sha256ripemd160(t.publicKey.toBuffer()),i=i||p.SIGHASH_ALL,o.equals(n,this.output.script.getPublicKeyHash())?[new h({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:u.sign(e,t,i,r,this.output.script),sigtype:i})]:[]},l.prototype.addSignature=function(e,t){return a.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(f.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this},l.prototype.clearSignatures=function(){return this.setScript(f.empty()),this},l.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()},l.SCRIPT_MAX_SIZE=107,l.prototype._estimateSize=function(){return l.SCRIPT_MAX_SIZE},t.exports=l},{"../../crypto/hash":86,"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,inherits:148}],114:[function(e,t,r){"use strict";var i=e("lodash"),n=e("../crypto/bn"),a=e("buffer"),o=e("../util/buffer"),s=e("../util/js"),c=e("../encoding/bufferwriter"),u=e("../script"),f=e("../util/preconditions"),p=e("../errors");function h(e){if(!(this instanceof h))return new h(e);if(!i.isObject(e))throw new TypeError("Unrecognized argument for Output");var t;this.satoshis=e.satoshis,o.isBuffer(e.script)?this._scriptBuffer=e.script:(t=i.isString(e.script)&&s.isHexa(e.script)?new a.Buffer(e.script,"hex"):e.script,this.setScript(t))}Object.defineProperty(h.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script||this.setScriptFromBuffer(this._scriptBuffer),this._script}}),Object.defineProperty(h.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof n?(this._satoshisBN=e,this._satoshis=e.toNumber()):i.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=n.fromNumber(this._satoshis)):(f.checkArgument(s.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=n.fromNumber(e),this._satoshis=e),f.checkState(s.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),h.prototype.invalidSatoshis=function(){return 9007199254740991"},h.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return t.script=0!==r?e.read(r):new a.Buffer([]),new h(t)},h.prototype.toBufferWriter=function(e){e||(e=new c),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e},t.exports=h},{"../crypto/bn":84,"../encoding/bufferwriter":93,"../errors":95,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,buffer:191,lodash:149}],115:[function(y,e,t){(function(f){"use strict";var p=y("buffer"),h=y("../crypto/signature"),l=y("../script"),d=y("./output"),m=y("../encoding/bufferreader"),g=y("../encoding/bufferwriter"),v=y("../crypto/bn"),b=y("../crypto/hash"),o=y("../crypto/ecdsa"),s=y("../util/preconditions"),c=y("lodash"),u=function(e,t,r,i){var n,a=y("./transaction"),o=y("./input"),s=a.shallowCopy(e);for((i=new l(i)).removeCodeseparators(),n=0;n=s.outputs.length)return new f("0000000000000000000000000000000000000000000000000000000000000001","hex");for(s.outputs.length=r+1,n=0;n"},S.prototype.toBuffer=function(){var e=new u;return this.toBufferWriter(e).toBuffer()},S.prototype.toBufferWriter=function(t){return t.writeUInt32LE(this.version),t.writeVarintNum(this.inputs.length),s.each(this.inputs,function(e){e.toBufferWriter(t)}),t.writeVarintNum(this.outputs.length),s.each(this.outputs,function(e){e.toBufferWriter(t)}),t.writeUInt32LE(this.nLockTime),t},S.prototype.fromBuffer=function(e){var t=new c(e);return this.fromBufferReader(t)},S.prototype.fromBufferReader=function(e){var t,r,i;for(a.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readUInt32LE(),r=e.readVarintNum(),t=0;t=this.inputs.length)throw new n.Transaction.InvalidIndex(e,this.inputs.length);var i=this.inputs[e];this.inputs=s.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()},S.prototype.sign=function(e,t){a.checkState(this.hasAllUtxoInfo());var r=this;return s.isArray(e)?s.each(e,function(e){r.sign(e,t)}):s.each(this.getSignatures(e,t),function(e){r.applySignature(e)}),this},S.prototype.getSignatures=function(r,i){r=new k(r),i=i||p.SIGHASH_ALL;var n=this,a=[],o=f.sha256ripemd160(r.publicKey.toBuffer());return s.each(this.inputs,function(e,t){s.each(e.getSignatures(n,r,t,i,o),function(e){a.push(e)})}),a},S.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this},S.prototype.isFullySigned=function(){return s.each(this.inputs,function(e){if(e.isFullySigned===m.prototype.isFullySigned)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),s.all(s.map(this.inputs,function(e){return e.isFullySigned()}))},S.prototype.isValidSignature=function(e){if(this.inputs[e.inputIndex].isValidSignature===m.prototype.isValidSignature)throw new n.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e)},S.prototype.verifySignature=function(e,t,r,i){return h.verify(this,e,t,r,i)},S.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var e=new x(0),t=0;t=m.MAXINT-1&&(t.sequenceNumber=m.DEFAULT_RBF_SEQNUMBER)}return this},I.exports=S}).call(this,A("buffer").Buffer)},{"../address":79,"../crypto/bn":84,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../privatekey":102,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"./input":108,"./output":114,"./sighash":115,"./unspentoutput":118,buffer:191,"buffer-compare":126,lodash:149}],118:[function(e,t,r){"use strict";var o=e("lodash"),s=e("../util/preconditions"),c=e("../util/js"),u=e("../script"),f=e("../address"),p=e("../unit");function h(e){if(!(this instanceof h))return new h(e);s.checkArgument(o.isObject(e),"Must provide an object from where to extract data");var t=e.address?new f(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!c.isHexaString(r)||64"},h.prototype.toString=function(){return this.txId+":"+this.outputIndex},h.fromObject=function(e){return new h(e)},h.prototype.toObject=h.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:p.fromSatoshis(this.satoshis).toBTC()}},t.exports=h},{"../address":79,"../script":104,"../unit":119,"../util/js":122,"../util/preconditions":123,lodash:149}],119:[function(e,t,r){"use strict";var i=e("lodash"),n=e("./errors"),a=e("./util/preconditions"),o={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function s(e,t){if(!(this instanceof s))return new s(e,t);if(i.isNumber(t)){if(t<=0)throw new n.Unit.InvalidRate(t);e/=t,t=s.BTC}this._value=this._from(e,t);var r=this;Object.keys(o).forEach(function(e){Object.defineProperty(r,e,{get:function(){return r.to(e)},enumerable:!0})})}Object.keys(o).forEach(function(e){s[e]=e}),s.fromObject=function(e){return a.checkArgument(i.isObject(e),"Argument is expected to be an object"),new s(e.amount,e.code)},s.fromBTC=function(e){return new s(e,s.BTC)},s.fromMillis=s.fromMilis=function(e){return new s(e,s.mBTC)},s.fromMicros=s.fromBits=function(e){return new s(e,s.bits)},s.fromSatoshis=function(e){return new s(e,s.satoshis)},s.fromFiat=function(e,t){return new s(e,t)},s.prototype._from=function(e,t){if(!o[t])throw new n.Unit.UnknownCode(t);return parseInt((e*o[t][0]).toFixed())},s.prototype.to=function(e){if(i.isNumber(e)){if(e<=0)throw new n.Unit.InvalidRate(e);return parseFloat((this.BTC*e).toFixed(2))}if(!o[e])throw new n.Unit.UnknownCode(e);var t=this._value/o[e][0];return parseFloat(t.toFixed(o[e][1]))},s.prototype.toBTC=function(){return this.to(s.BTC)},s.prototype.toMillis=s.prototype.toMilis=function(){return this.to(s.mBTC)},s.prototype.toMicros=s.prototype.toBits=function(){return this.to(s.bits)},s.prototype.toSatoshis=function(){return this.to(s.satoshis)},s.prototype.atRate=function(e){return this.to(e)},s.prototype.toString=function(){return this.satoshis+" satoshis"},s.prototype.toObject=s.prototype.toJSON=function(){return{amount:this.BTC,code:s.BTC}},s.prototype.inspect=function(){return""},t.exports=s},{"./errors":95,"./util/preconditions":123,lodash:149}],120:[function(e,t,r){"use strict";var i=e("lodash"),n=e("url"),a=e("./address"),o=e("./unit"),s=function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.extras={},this.knownParams=r||[],this.address=this.network=this.amount=this.message=null,"string"==typeof t){var i=e.parse(t);i.amount&&(i.amount=this._parseAmount(i.amount)),this._fromObject(i)}else{if("object"!==(void 0===t?"undefined":_typeof(t)))throw new TypeError("Unrecognized data format.");this._fromObject(t)}};s.fromString=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return new s(e)},s.fromObject=function(e){return new s(e)},s.isValid=function(e,t){try{new s(e,t)}catch(e){return!1}return!0},s.parse=function(e){var t=n.parse(e,!0);if("bitcoin:"!==t.protocol)throw new TypeError("Invalid bitcoin URI");var r=/[^:]*:\/?\/?([^?]*)/.exec(e);return t.query.address=r&&r[1]||void 0,t.query},s.Members=["address","amount","message","label","r"],s.prototype._fromObject=function(e){if(!a.isValid(e.address))throw new TypeError("Invalid bitcoin address");for(var t in this.address=new a(e.address),this.network=this.address.network,this.amount=e.amount,e)if("address"!==t&&"amount"!==t){if(/^req-/.exec(t)&&-1===this.knownParams.indexOf(t))throw Error("Unknown required argument "+t);(-1"},t.exports=s},{"./address":79,"./unit":119,lodash:149,url:500}],121:[function(o,s,e){(function(r){"use strict";var i=o("buffer"),t=o("assert"),n=o("./js"),a=o("./preconditions");function e(e,t){if(e.length!==t.length)return!1;for(var r=e.length,i=0;i>24&255),t.push(e>>16&255),t.push(e>>8&255),t.push(255&e),new r(t)},integerFromBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]<<24|e[1]<<16|e[2]<<8|e[3]},integerFromSingleByteBuffer:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e[0]},bufferToHex:function(e){return a.checkArgumentType(e,"Buffer","buffer"),e.toString("hex")},reverse:function(e){for(var t=new i.Buffer(e.length),r=0;r>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}}else if("le"===r)for(i=0,a=0;i>>26-n&67108863,26<=(n+=24)&&(n-=26,a++)}return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-i&4194303,26<=(i+=24)&&(i-=26,n++)}if(r+6!==t){a=o(e,t,r+6);this.words[n]|=a<>>26-i&4194303}this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];v.prototype.toString=function(e,t){if(16===(e=e||10)||"hex"===e){for(var r="",i=0,n=(t=0|t||1,0),a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return this.sign&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var c=l[e],u=d[e],f=(r="",this.clone());for(f.sign=!1;0!==f.cmpn(0);){var p=f.modn(u).toString(e);r=0!==(f=f.idivn(u)).cmpn(0)?h[c-p.length]+p+r:p+r}return 0===this.cmpn(0)&&(r="0"+r),this.sign&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.prototype.toJSON=function(){return this.toString(16)},v.prototype.toArray=function(){this.strip();var e=new Array(this.byteLength());e[0]=0;for(var t=this.clone(),r=0;0!==t.cmpn(0);r++){var i=t.andln(255);t.ishrn(8),e[e.length-r-1]=i}return e},v.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return 4096<=t&&(r+=13,t>>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.iand=function(e){var t;this.sign=this.sign&&e.sign,t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},v.prototype.ixor=function(e){var t,r;this.sign=this.sign||e.sign,r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);for(var r=e/26|0,i=e%26;this.length<=r;)this.words[this.length++]=0;return this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,a=0;a>>26}for(;0!==n&&a>>26}if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this);this.sign=!1;t=e.sub(this);return this.sign=!0,t},v.prototype.isub=function(e){if(e.sign){e.sign=!1;var t=this.iadd(e);return e.sign=!0,t._normSign()}if(this.sign)return this.sign=!1,this.iadd(e),this.sign=!0,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.sign=!1,this.length=1,this.words[0]=0,this;i=0>26,this.words[o]=67108863&t}for(;0!==a&&o>26,this.words[o]=67108863&t}if(0===a&&o>>26,a=67108863&r,o=Math.min(i,e.length-1),s=Math.max(0,i-this.length+1);s<=o;s++){var c=i-s,u=(0|this.words[c])*(0|e.words[s]),f=67108863&u;a=67108863&(f=f+a|0),n=(n=n+(u/67108864|0)|0)+(f>>>26)|0}t.words[i]=a,r=n}return 0!==r?t.words[i]=r:t.length--,t.strip()},v.prototype._bigMulTo=function(e,t){t.sign=e.sign!==this.sign,t.length=this.length+e.length;for(var r=0,i=0,n=0;n>>26)|0)>>>26,a&=67108863}t.words[n]=o,r=a,a=i}return 0!==r?t.words[n]=r:t.length--,t.strip()},v.prototype.mulTo=function(e,t){return this.length+e.length<63?this._smallMulTo(e,t):this._bigMulTo(e,t)},v.prototype.mul=function(e){var t=new v(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},v.prototype.imul=function(e){if(0===this.cmpn(0)||0===e.cmpn(0))return this.words[0]=0,this.length=1,this;var t=this.length,r=e.length;this.sign=e.sign!==this.sign,this.length=this.length+e.length,this.words[this.length-1]=0;for(var i=this.length-2;0<=i;i--){for(var n=0,a=0,o=Math.min(i,r-1),s=Math.max(0,i-t+1);s<=o;s++){var c=i-s,u=this.words[c]*e.words[s],f=67108863&u;n+=u/67108864|0,a=67108863&(f+=a),n+=f>>>26}this.words[i]=a,this.words[i+1]+=n,n=0}for(n=0,c=1;c>>26}return this.strip()},v.prototype.imuln=function(e){g("number"==typeof e);for(var t=0,r=0;r>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.mul(this)},v.prototype.ishln=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){for(var n=0,a=0;a>>26-t}n&&(this.words[a]=n,this.length++)}if(0!==r){for(a=this.length-1;0<=a;a--)this.words[a+r]=this.words[a];for(a=0;a>>n<a){this.length-=a;for(c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(c/67108864|0),this.words[a+r]=67108863&s}for(;a>26,this.words[a+r]=67108863&s}if(0===o)return this.strip();g(-1===o);for(a=o=0;a>26,this.words[a]=67108863&s}return this.sign=!0,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.shln(r),i.ishln(r),a=n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var n;i=this.divmod(e.neg(),t);return"mod"!==t&&(n=i.div.neg()),{div:n,mod:i.mod}},v.prototype.div=function(e){return this.divmod(e,"div").div},v.prototype.mod=function(e){return this.divmod(e,"mod").mod},v.prototype.divRound=function(e){var t=this.divmod(e);if(0===t.mod.cmpn(0))return t.div;var r=t.div.sign?t.mod.isub(e):t.mod,i=e.shrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:t.div.sign?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+this.words[i])%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=this.words[r]+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.ishrn(1),r.ishrn(1),++s;for(var c=r.clone(),u=t.clone();0!==t.cmpn(0);){for(;t.isEven();)t.ishrn(1),i.isEven()&&n.isEven()?(i.ishrn(1),n.ishrn(1)):(i.iadd(c).ishrn(1),n.isub(u).ishrn(1));for(;r.isEven();)r.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(c).ishrn(1),o.isub(u).ishrn(1));0<=t.cmp(r)?(t.isub(r),i.isub(a),n.isub(o)):(r.isub(t),a.isub(i),o.isub(n))}return{a:a,b:o,gcd:r.ishln(s)}},v.prototype._invmp=function(e){g(!e.sign),g(0!==e.cmpn(0));var t=this,r=e.clone();t=t.sign?t.mod(e):t.clone();for(var i=new v(1),n=new v(0),a=r.clone();0>>26,o&=67108863,this.words[n]=o}return 0!==a&&(this.words[n]=a,this.length++),this},v.prototype.cmpn=function(e){var t,r=e<0;if(r&&(e=-e),this.sign&&!r)return-1;if(!this.sign&&r)return 1;if(e&=67108863,this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}e.words[i-10]=n>>>22,e.length-=9},a.prototype.imulK=function(e){var t;e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(i[e])return i[e];var t;if("k256"===e)t=new a;else if("p224"===e)t=new s;else if("p192"===e)t=new c;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new u}return i[e]=t},f.prototype._verify1=function(e){g(!e.sign,"red works only with positives"),g(e.red,"red works only with red numbers")},f.prototype._verify2=function(e,t){g(!e.sign&&!t.sign,"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},f.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.mod(this.m)._forceRed(this)},f.prototype.neg=function(e){var t=e.clone();return t.sign=!t.sign,t.iadd(this.m)._forceRed(this)},f.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},f.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},f.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)},f.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},f.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.shln(t))},f.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},f.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},f.prototype.isqr=function(e){return this.imul(e,e)},f.prototype.sqr=function(e){return this.mul(e,e)},f.prototype.sqrt=function(e){if(0===e.cmpn(0))return e.clone();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).ishrn(2);return f=this.pow(e,r)}for(var i=this.m.subn(1),n=0;0!==i.cmpn(0)&&0===i.andln(1);)n++,i.ishrn(1);g(0!==i.cmpn(0));var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).ishrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).ishrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>8,i[r]&=255;for(;a;)i.push(255&a),a>>=8}for(t=0;"1"===e[t]&&tt[i]?1:0);++i);return 0==r&&(t.length>e.length?r=-1:e.length>t.length&&(r=1)),r}},{}],127:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.hmacDRBG=e("./elliptic/hmac-drbg"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec")},{"../package.json":147,"./elliptic/curve":130,"./elliptic/curves":133,"./elliptic/ec":134,"./elliptic/hmac-drbg":137,"./elliptic/utils":139,brorand:140}],128:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic"),S=n.utils.getNAF,j=n.utils.getJSF,u=n.utils.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4)}function o(e,t){this.curve=e,this.type=t,this.precomputed=null}(t.exports=a).prototype.point=function(){throw new Error("Not implemented")},a.prototype.validate=function(){throw new Error("Not implemented")},a.prototype._fixedNafMul=function(e,t){var r=e._getDoubles(),i=S(t,1),n=(1<>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i){for(var n=this._wnafT1,a=this._wnafT2,o=this._wnafT3,s=0,c=0;c>1]:x<0&&(k=a[m][-x-1>>1].neg()),b="affine"===k.type?b.mixedAdd(k):b.add(k))}}for(c=0;c":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],130:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":128,"./edwards":129,"./mont":131,"./short":132}],131:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base;function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(s,o),(t.exports=s).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)},a(c,o.BasePoint),s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.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)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.ishrn(1))n.push(t.andln(1));for(var a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../curve":130,"bn.js":124,inherits:148}],132:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.shrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.sign&&(i=i.neg(),n=n.neg()),a.sign&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(t=new w(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b).redSqrt(),i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},c.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)},c.prototype._endoWnafMulAdd=function(e,t){for(var r=this._endoWnafT1,i=this._endoWnafT2,n=0;n":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this.precomputed&&this.precomputed.doubles?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":127,"../curve":130,"bn.js":124,inherits:148}],133:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"0",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":127,"./precomputed/secp256k1":138,"hash.js":141}],134:[function(e,t,r){"use strict";var d=e("bn.js"),m=e("../../elliptic"),i=m.utils.assert,n=e("./key"),g=e("./signature");function a(e){if(!(this instanceof a))return new a(e);"string"==typeof e&&(i(m.curves.hasOwnProperty(e),"Unknown curve "+e),e=m.curves[e]),e instanceof m.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.shrn(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}(t.exports=a).prototype.keyPair=function(e){return new n(this,e)},a.prototype.keyFromPrivate=function(e,t){return n.fromPrivate(this,e,t)},a.prototype.keyFromPublic=function(e,t){return n.fromPublic(this,e,t)},a.prototype.genKeyPair=function(e){e||(e={});for(var t=new m.hmacDRBG({hash:this.hash,pers:e.pers,entropy:e.entropy||m.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new d(2));;){var n=new d(t.generate(r));if(!(0"}},{"../../elliptic":127,"bn.js":124}],136:[function(e,t,r){"use strict";var n=e("bn.js"),a=e("../../elliptic").utils,i=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16))}(t.exports=o).prototype._importDER=function(e,t){if((e=a.toArray(e,t)).length<6||48!==e[0]||2!==e[2])return!1;if(1+e[1]>e.length)return!1;var r=e[3];if(128<=r)return!1;if(4+r+2>=e.length)return!1;if(2!==e[4+r])return!1;var i=e[5+r];return!(128<=i)&&(!(4+r+2+i>e.length)&&(this.r=new n(e.slice(4,4+r)),this.s=new n(e.slice(4+r+2,4+r+2+i)),!0))},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r));var i=[48,t.length+r.length+4,2,t.length];return i=i.concat(t,[2,r.length],r),a.encode(i,e)}},{"../../elliptic":127,"bn.js":124}],137:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("../elliptic").utils,n=o.assert;function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc),r=o.toArray(e.nonce,e.nonceEnc),i=o.toArray(e.pers,e.persEnc);n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this.reseed=1},a.prototype.generate=function(e,t,r,i){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i),this._update(r));for(var n=[];n.length>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e},i.getNAF=function(e,t){for(var r=[],i=1<>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=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=n.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{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;for(a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>10),n[a-7],(r=n[a-15],b(r,7)^b(r,18)^r>>>3),n[a-16]);var o,s,c=this.h[0],u=this.h[1],f=this.h[2],p=this.h[3],h=this.h[4],l=this.h[5],d=this.h[6],m=this.h[7];F(this.k.length===n.length);for(a=0;a>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function s(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}function u(e,t){if(!e)throw new Error(t||"Assertion failed")}i.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},i.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,r){return e+t+r>>>0},i.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},i.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},i.assert=u,i.inherits=n,r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:148}],147:[function(e,t,r){t.exports={_args:[["elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","/home/giacof/Download/javascript-opentimestamps/node_modules/bitcore-lib"]],_from:"elliptic@=3.0.3",_id:"elliptic@3.0.3",_inCache:!0,_location:"/bitcore-lib/elliptic",_phantomChildren:{inherits:"2.0.1"},_requested:{name:"elliptic",raw:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",rawSpec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",scope:null,spec:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",type:"remote"},_requiredBy:["/bitcore-lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_shasum:"865c9b420bfbe55006b9f969f97a0d2c44966595",_shrinkwrap:null,_spec:"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",_where:"/home/giacof/Download/javascript-opentimestamps/node_modules/bitcore-lib",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^2.0.0",brorand:"^1.0.1","hash.js":"^1.0.0",inherits:"^2.0.1"},description:"EC cryptography",devDependencies:{browserify:"^3.44.2",jscs:"^1.11.3",jshint:"^2.6.0",mocha:"^2.1.0","uglify-js":"^2.4.13"},homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",optionalDependencies:{},readme:"# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic)\n\nFast elliptic-curve cryptography in a plain javascript implementation.\n\nNOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve\nfor your cryptography operations.\n\n## Incentive\n\nECC is much slower than regular RSA cryptography, the JS implementations are\neven more slower.\n\n## Benchmarks\n\n```bash\n$ node benchmarks/index.js\nBenchmarking: sign\nelliptic#sign x 262 ops/sec ±0.51% (177 runs sampled)\neccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled)\n------------------------\nFastest is elliptic#sign\n========================\nBenchmarking: verify\nelliptic#verify x 113 ops/sec ±0.50% (166 runs sampled)\neccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled)\n------------------------\nFastest is elliptic#verify\n========================\nBenchmarking: gen\nelliptic#gen x 294 ops/sec ±0.43% (176 runs sampled)\neccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled)\n------------------------\nFastest is elliptic#gen\n========================\nBenchmarking: ecdh\nelliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled)\n------------------------\nFastest is elliptic#ecdh\n========================\n```\n\n## API\n\n### ECDSA\n\n```javascript\nvar EC = require('elliptic').ec;\n\n// Create and initialize EC context\n// (better do it once and reuse it)\nvar ec = new EC('secp256k1');\n\n// Generate keys\nvar key = ec.genKeyPair();\n\n// Sign message (must be an array, or it'll be treated as a hex sequence)\nvar msg = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];\nvar signature = key.sign(msg);\n\n// Export DER encoded signature in Array\nvar derSign = signature.toDER();\n\n// Verify signature\nconsole.log(key.verify(msg, derSign));\n```\n\n### ECDH\n\n```javascript\n// Generate keys\nvar key1 = ec.genKeyPair();\nvar key2 = ec.genKeyPair();\n\nvar shared1 = key1.derive(key2.getPublic());\nvar shared2 = key2.derive(key1.getPublic());\n\nconsole.log('Both shared secrets are BN instances');\nconsole.log(shared1.toString(16));\nconsole.log(shared2.toString(16));\n```\n\nNOTE: `.derive()` returns a [BN][1] instance.\n\n## Supported curves\n\nElliptic.js support following curve types:\n\n* Short Weierstrass\n* Montgomery\n* Edwards\n* Twisted Edwards\n\nFollowing curve 'presets' are embedded into the library:\n\n* `secp256k1`\n* `p192`\n* `p224`\n* `p256`\n* `curve25519`\n* `ed25519`\n\nNOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead.\n\n### Implementation details\n\nECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of\nthe curve operations are performed on non-affine coordinates (either projective\nor extended), various windowing techniques are used for different cases.\n\nAll operations are performed in reduction context using [bn.js][1], hashing is\nprovided by [hash.js][2]\n\n### Related projects\n\n* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both\n browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for\n node)\n\n#### LICENSE\n\nThis software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2014.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://tools.ietf.org/html/rfc6979\n[1]: https://github.com/indutny/bn.js\n[2]: https://github.com/indutny/hash.js\n[3]: https://github.com/bitchan/eccrypto\n[4]: https://github.com/wanderer/secp256k1-node\n",readmeFilename:"README.md",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{test:"make lint && mocha --reporter=spec test/*-test.js"},version:"3.0.3"}},{}],148:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{dup:68}],149:[function(e,y,_){(function(b){(function(){var dn,e,t,mn="3.10.1",gn=1,vn=2,bn=4,yn=8,_n=16,wn=32,kn=64,xn=128,Sn=256,jn=30,En="...",An=150,In=16,Pn=200,On=1,Tn=2,Bn="Expected a function",Cn="__lodash_placeholder__",Fn="[object Arguments]",Rn="[object Array]",zn="[object Boolean]",Mn="[object Date]",Dn="[object Error]",Nn="[object Function]",r="[object Map]",qn="[object Number]",Ln="[object Object]",Un="[object RegExp]",i="[object Set]",Hn="[object String]",n="[object WeakMap]",Kn="[object ArrayBuffer]",Vn="[object Float32Array]",Gn="[object Float64Array]",$n="[object Int8Array]",Wn="[object Int16Array]",Zn="[object Int32Array]",Yn="[object Uint8Array]",Xn="[object Uint8ClampedArray]",Jn="[object Uint16Array]",Qn="[object Uint32Array]",ea=/\b__p \+= '';/g,ta=/\b(__p \+=) '' \+/g,ra=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ia=/&(?:amp|lt|gt|quot|#39|#96);/g,na=/[&<>"'`]/g,aa=RegExp(ia.source),oa=RegExp(na.source),sa=/<%-([\s\S]+?)%>/g,ca=/<%([\s\S]+?)%>/g,ua=/<%=([\s\S]+?)%>/g,fa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,pa=/^\w*$/,ha=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,la=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,da=RegExp(la.source),ma=/[\u0300-\u036f\ufe20-\ufe23]/g,ga=/\\(\\)?/g,va=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ba=/\w*$/,ya=/^0[xX]/,_a=/^\[object .+?Constructor\]$/,wa=/^\d+$/,ka=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xa=/($^)/,Sa=/['\n\r\u2028\u2029\\]/g,ja=(e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",t="[a-z\\xdf-\\xf6\\xf8-\\xff]+",RegExp(e+"+(?="+e+t+")|"+e+"?"+t+"|"+e+"+|[0-9]+","g")),Ea=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Aa=-1,Ia={};Ia[Vn]=Ia[Gn]=Ia[$n]=Ia[Wn]=Ia[Zn]=Ia[Yn]=Ia[Xn]=Ia[Jn]=Ia[Qn]=!0,Ia[Fn]=Ia[Rn]=Ia[Kn]=Ia[zn]=Ia[Mn]=Ia[Dn]=Ia[Nn]=Ia[r]=Ia[qn]=Ia[Ln]=Ia[Un]=Ia[i]=Ia[Hn]=Ia[n]=!1;var Pa={};Pa[Fn]=Pa[Rn]=Pa[Kn]=Pa[zn]=Pa[Mn]=Pa[Vn]=Pa[Gn]=Pa[$n]=Pa[Wn]=Pa[Zn]=Pa[qn]=Pa[Ln]=Pa[Un]=Pa[Hn]=Pa[Yn]=Pa[Xn]=Pa[Jn]=Pa[Qn]=!0,Pa[Dn]=Pa[Nn]=Pa[r]=Pa[i]=Pa[n]=!1;var a={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},o={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},s={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},c={function:!0,object:!0},u={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},f={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},p=c[void 0===_?"undefined":_typeof(_)]&&_&&!_.nodeType&&_,h=c[void 0===y?"undefined":_typeof(y)]&&y&&!y.nodeType&&y,l=p&&h&&"object"==(void 0===b?"undefined":_typeof(b))&&b&&b.Object&&b,d=c["undefined"==typeof self?"undefined":_typeof(self)]&&self&&self.Object&&self,m=c["undefined"==typeof window?"undefined":_typeof(window)]&&window&&window.Object&&window,g=h&&h.exports===p&&p,Oa=l||m!==(this&&this.window)&&m||d||this;function Ta(e,t){if(e!==t){var r=null===e,i=e===dn,n=e==e,a=null===t,o=t===dn,s=t==t;if(t>>1,$=9007199254740991,W=O&&new O,Z={};function Y(e){if(Ka(e)&&!ui(e)&&!(e instanceof Q)){if(e instanceof J)return e;if(_.call(e,"__chain__")&&_.call(e,"__wrapped__"))return Qt(e)}return new J(e)}function X(){}function J(e,t,r){this.__wrapped__=e,this.__actions__=r||[],this.__chain__=!!t}Y.support={};function Q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function ee(){this.__data__={}}function te(e){var t=e?e.length:0;for(this.data={hash:B(null),set:new j};t--;)this.push(e[t])}function re(e,t){var r=e.data;return("string"==typeof t||li(t)?r.set.has(t):r.hash[t])?0:-1}function ie(e,t){var r=-1,i=e.length;for(t||(t=P(i));++r=Pn?st(t):null,c=t.length;s&&(a=re,o=!1,t=s);e:for(;++n>>0,t>>>=0;for(var a=P(n);++i>>1,o=e[a];(r?o<=t:o=Pn)return n.plant(t).value();for(var r=0,i=a?o[r].apply(this,e):t;++r=An)return e}else Gt=0;return Ue(e,t)});function Zt(e){for(var t=Ri(e),r=t.length,i=r&&e.length,n=!!i&&Ut(i)&&(ui(e)||ci(e)),a=-1,o=[];++a>>0,r>>>=0;r=D(t,r)&&e=(e=Ra(e)).length)return e;var o=i-n.length;if(o<1)return n;var s=e.slice(0,o);if(null==a)return s+n;if(vi(a)){if(e.slice(o).search(a)){var c,u,f=e.slice(0,o);for(a.global||(a=b(a.source,(ba.exec(a)||"")+"g")),a.lastIndex=0;c=a.exec(f);)u=c.index;s=s.slice(0,null==u?o:u)}}else if(e.indexOf(a,o)!=o){var p=s.lastIndexOf(a);-1=0.13.7 <0.14.0",_id:"bitcore-lib@0.13.19",_inCache:!0,_installable:!0,_location:"/bitcore-lib",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/bitcore-lib-0.13.19.tgz_1470850061596_0.2146058666985482"},_npmUser:{email:"braydon@bitpay.com",name:"braydonf"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{name:"bitcore-lib",raw:"bitcore-lib@^0.13.7",rawSpec:"^0.13.7",scope:null,spec:">=0.13.7 <0.14.0",type:"range"},_requiredBy:["/","/bitcore-message"],_resolved:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz",_shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",_shrinkwrap:{dependencies:{"bn.js":{from:"bn.js@=2.0.4",resolved:"https://registry.npmjs.org/bn.js/-/bn.js-2.0.4.tgz",version:"2.0.4"},bs58:{from:"bs58@=2.0.0",resolved:"https://registry.npmjs.org/bs58/-/bs58-2.0.0.tgz",version:"2.0.0"},"buffer-compare":{from:"buffer-compare@=1.0.0",resolved:"https://registry.npmjs.org/buffer-compare/-/buffer-compare-1.0.0.tgz",version:"1.0.0"},elliptic:{dependencies:{brorand:{from:"brorand@^1.0.1",resolved:"https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz",version:"1.0.5"},"hash.js":{from:"hash.js@=1.0.3",resolved:"https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz",version:"1.0.3"}},from:"elliptic@=3.0.3",resolved:"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz",version:"3.0.3"},inherits:{from:"inherits@=2.0.1",resolved:"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",version:"2.0.1"},lodash:{from:"lodash@=3.10.1",resolved:"https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",version:"3.10.1"}},name:"bitcore",version:"0.13.18"},_spec:"bitcore-lib@^0.13.7",_where:"/home/giacof/Download/javascript-opentimestamps",author:{email:"dev@bitpay.com",name:"BitPay"},browser:{request:"browser-request"},bugs:{url:"https://github.com/bitpay/bitcore-lib/issues"},contributors:[{name:"Manuel Araoz",email:"manuelaraoz@gmail.com"},{name:"Daniel Cousens",email:"bitcoin@dcousens.com"},{name:"Gordon Hall",email:"gordon@bitpay.com"},{name:"Jeff Garzik",email:"jgarzik@bitpay.com"},{name:"Kyle Drake",email:"kyle@kyledrake.net"},{name:"Esteban Ordano",email:"eordano@gmail.com"},{name:"Matias Alejo Garcia",email:"ematiu@gmail.com"},{name:"Ryan X. Charles",email:"ryanxcharles@gmail.com"},{name:"Stefan Thomas",email:"moon@justmoon.net"},{name:"Stephen Pair",email:"stephen@bitpay.com"},{name:"Wei Lu",email:"luwei.here@gmail.com"}],dependencies:{"bn.js":"=2.0.4",bs58:"=2.0.0","buffer-compare":"=1.0.0",elliptic:"=3.0.3",inherits:"=2.0.1",lodash:"=3.10.1"},description:"A pure and powerful JavaScript Bitcoin library.",devDependencies:{"bitcore-build":"github:bitpay/bitcore-build",brfs:"^1.2.0",chai:"^1.10.0",gulp:"^3.8.10",sinon:"^1.13.0"},directories:{},dist:{shasum:"48af1e9bda10067c1ab16263472b5add2000f3dc",tarball:"https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-0.13.19.tgz"},gitHead:"9517864f14d09700f3fd02ff61173003c0280774",homepage:"https://github.com/bitpay/bitcore-lib#readme",keywords:["address","bip21","bip32","bip37","bip69","bip70","bitcoin","blockchain","cryptocurrency","ecies","multisig","p2p","payment","transaction"],license:"MIT",main:"index.js",maintainers:[{name:"braydonf",email:"braydon@bitpay.com"},{name:"gabegattis",email:"gabegattis@gmail.com"},{name:"gasteve",email:"stephen@pairhome.net"},{name:"patrickbitpay",email:"patrick@bitpay.com"}],name:"bitcore-lib",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/bitpay/bitcore-lib.git"},scripts:{build:"gulp",coverage:"gulp coverage",lint:"gulp lint",test:"gulp test"},version:"0.13.19"}},{}],151:[function(e,t,r){var i=e("bitcore-lib");i.Message=e("./lib/message"),t.exports=i.Message},{"./lib/message":152,"bitcore-lib":78}],152:[function(r,d,e){(function(o){"use strict";var e=r("bitcore-lib"),s=e.deps._,i=e.PrivateKey,n=e.PublicKey,c=e.Address,a=e.encoding.BufferWriter,u=e.crypto.ECDSA,f=e.crypto.Signature,p=e.crypto.Hash.sha256sha256,t=e.util.js,h=e.util.preconditions,l=function e(t){return this instanceof e?(h.checkArgument(s.isString(t),"First argument should be a string"),this.message=t,this):new e(t)};l.MAGIC_BYTES=new o("Bitcoin Signed Message:\n"),l.prototype.magicHash=function(){var e=a.varintBufNum(l.MAGIC_BYTES.length),t=new o(this.message),r=a.varintBufNum(t.length),i=o.concat([e,l.MAGIC_BYTES,r,t]);return p(i)},l.prototype._sign=function(e){h.checkArgument(e instanceof i,"First argument should be an instance of PrivateKey");var t=this.magicHash(),r=new u;return r.hashbuf=t,r.privkey=e,r.pubkey=e.toPublicKey(),r.signRandomK(),r.calci(),r.sig},l.prototype.sign=function(e){return this._sign(e).toCompact().toString("base64")},l.prototype._verify=function(e,t){h.checkArgument(e instanceof n,"First argument should be an instance of PublicKey"),h.checkArgument(t instanceof f,"Second argument should be an instance of Signature");var r=this.magicHash(),i=u.verify(r,t,e);return i||(this.error="The signature was invalid"),i},l.prototype.verify=function(e,t){h.checkArgument(e),h.checkArgument(t&&s.isString(t)),s.isString(e)&&(e=c.fromString(e));var r=f.fromCompact(new o(t,"base64")),i=new u;i.hashbuf=this.magicHash(),i.sig=r;var n=i.toPublicKey(),a=c.fromPublicKey(n,e.network);return e.toString()!==a.toString()?!(this.error="The signature did not match the message digest"):this._verify(n,r)},l.fromString=function(e){return new l(e)},l.fromJSON=function(e){return t.isValidJSON(e)&&(e=JSON.parse(e)),new l(e.message)},l.prototype.toObject=function(){return{message:this.message}},l.prototype.toJSON=function(){return JSON.stringify(this.toObject())},l.prototype.toString=function(){return this.message},l.prototype.inspect=function(){return""},d.exports=l}).call(this,r("buffer").Buffer)},{"bitcore-lib":78,buffer:191}],153:[function(e,r,i){(function(Q,U,u){!function(e){if("object"==(void 0===i?"undefined":_typeof(i))&&void 0!==r)r.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:void 0!==U?t=U:"undefined"!=typeof self&&(t=self),t.Promise=e()}}(function(){var e,t,r;return function a(o,s,c){function u(r,e){if(!s[r]){if(!o[r]){var t="function"==typeof _dereq_&&_dereq_;if(!e&&t)return t(r,!0);if(f)return f(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[r]={exports:{}};o[r][0].call(n.exports,function(e){var t=o[r][1][e];return u(t||e)},n,n.exports,a,o,s,c)}return s[r].exports}for(var f="function"==typeof _dereq_&&_dereq_,e=0;e, no stack trace)"}function V(){return"function"==typeof Y}var G=function(){return!1},$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function W(e){var t=e.match($);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function Z(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);Y(this,Z),32=a)return r[t]=e,this._queue.push(t),!1;null!==n&&(n[t]=e);var o=this._promise,s=this._callback,c=o._boundValue();o._pushContext();var u=g(s).call(c,e,t,i),f=o._popContext();if(m.checkForgottenReturns(u,f,null!==n?"Promise.filter":"Promise.map",o),u===v)return this._reject(u.e),!0;var p=d(u,this._promise);if(p instanceof l){var h=(p=p._target())._bitField;if(0==(50397184&h))return 1<=a&&this._inFlight++,(r[t]=p)._proxy(this,-1*(t+1)),!1;if(0==(33554432&h))return 0!=(16777216&h)?this._reject(p._reason()):this._cancel(),!0;u=p._value()}r[t]=u}return i<=++this._totalResolved&&(null!==n?this._filter(r,n):this._resolve(r),!0)},f.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;0>>16)){if(e===this){var r=c();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,0<(65535&t)&&(0!=(134217728&t)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},E.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,d.isNode);0<(65535&t)?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},E.prototype._fulfillPromises=function(e,t){for(var r=1;r=this._length&&(this._resolve(this._values),!0)},t.prototype._promiseCancelled=function(){return this._cancel(),!0},t.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},t.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof s)e.cancel();else for(var t=0;t=this._length){var r;if(this._isMap)r=function(e){for(var t=new s,r=e.length/2|0,i=0;i>1},i.prototype.props=function(){return r(this)},i.props=function(e){return r(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function i(e){this._capacity=e,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},n.prototype._promiseFulfilled=function(e,t){var r=new i;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},n.prototype._promiseRejected=function(e,t){var r=new i;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},e.settle=function(e){return r.deprecated(".settle()",".reflect()"),new n(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(f,e,t){"use strict";e.exports=function(e,t,n){var r=f("./util"),i=f("./errors").RangeError,a=f("./errors").AggregateError,o=r.isArray,s={};function c(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function u(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new c(e),i=r.promise();return r.setHowMany(t),r.init(),i}r.inherits(c,t),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=o(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(e){this._howMany=e},c.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(s),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);else if("le"===r)for(n=i=0;i>>26-o&67108863,26<=(o+=24)&&(o-=26,n++);return this.strip()},v.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-a&4194303,26<=(a+=24)&&(a-=26,i++);r+6!==t&&(n=o(e,t,r+6),this.words[i]|=n<>>26-a&4194303),this.strip()},v.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,u=r;u"};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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=67108863&o,c=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,p=67108863&c,h=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=h;l++){var d=u-l|0;f+=(o=(n=0|e.words[d])*(a=0|t.words[l])+p)/67108864|0,p=67108863&o}r.words[u]=0|p,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}v.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,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,a--)}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)&&2<=e&&e<=36){var c=l[e],u=d[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var p=f.modn(u).toString(e);r=(f=f.idivn(u)).isZero()?p+r:h[c-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}g(!1,"Base should be between 2 and 36")},v.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]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},v.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},v.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},v.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},v.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},v.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)},v.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},v.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},v.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},v.prototype.inotn=function(e){g("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},v.prototype.notn=function(e){return this.clone().inotn(e)},v.prototype.setn=function(e,t){g("number"==typeof e&&0<=e);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,e):(r=e,this);for(var n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},v.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;i=0>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],d=8191&l,m=l>>>13,g=0|o[2],v=8191&g,b=g>>>13,y=0|o[3],_=8191&y,w=y>>>13,k=0|o[4],x=8191&k,S=k>>>13,j=0|o[5],E=8191&j,A=j>>>13,I=0|o[6],P=8191&I,O=I>>>13,T=0|o[7],B=8191&T,C=T>>>13,F=0|o[8],R=8191&F,z=F>>>13,M=0|o[9],D=8191&M,N=M>>>13,q=0|s[0],L=8191&q,U=q>>>13,H=0|s[1],K=8191&H,V=H>>>13,G=0|s[2],$=8191&G,W=G>>>13,Z=0|s[3],Y=8191&Z,X=Z>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],ae=8191&ne,oe=ne>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],pe=8191&fe,he=fe>>>13,le=0|s[9],de=8191&le,me=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(p,L))|0)+((8191&(n=(n=Math.imul(p,U))+Math.imul(h,L)|0))<<13)|0;u=((a=Math.imul(h,U))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(d,L),n=(n=Math.imul(d,U))+Math.imul(m,L)|0,a=Math.imul(m,U);var ve=(u+(i=i+Math.imul(p,K)|0)|0)+((8191&(n=(n=n+Math.imul(p,V)|0)+Math.imul(h,K)|0))<<13)|0;u=((a=a+Math.imul(h,V)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(b,L)|0,a=Math.imul(b,U),i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,V)|0;var be=(u+(i=i+Math.imul(p,$)|0)|0)+((8191&(n=(n=n+Math.imul(p,W)|0)+Math.imul(h,$)|0))<<13)|0;u=((a=a+Math.imul(h,W)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(_,L),n=(n=Math.imul(_,U))+Math.imul(w,L)|0,a=Math.imul(w,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,i=i+Math.imul(d,$)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,W)|0;var ye=(u+(i=i+Math.imul(p,Y)|0)|0)+((8191&(n=(n=n+Math.imul(p,X)|0)+Math.imul(h,Y)|0))<<13)|0;u=((a=a+Math.imul(h,X)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(x,L),n=(n=Math.imul(x,U))+Math.imul(S,L)|0,a=Math.imul(S,U),i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,K)|0,a=a+Math.imul(w,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,W)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,W)|0,i=i+Math.imul(d,Y)|0,n=(n=n+Math.imul(d,X)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,X)|0;var _e=(u+(i=i+Math.imul(p,Q)|0)|0)+((8191&(n=(n=n+Math.imul(p,ee)|0)+Math.imul(h,Q)|0))<<13)|0;u=((a=a+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(A,L)|0,a=Math.imul(A,U),i=i+Math.imul(x,K)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,V)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,W)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(b,Y)|0,a=a+Math.imul(b,X)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0;var we=(u+(i=i+Math.imul(p,re)|0)|0)+((8191&(n=(n=n+Math.imul(p,ie)|0)+Math.imul(h,re)|0))<<13)|0;u=((a=a+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(O,L)|0,a=Math.imul(O,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,V)|0,i=i+Math.imul(x,$)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,W)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,X)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0;var ke=(u+(i=i+Math.imul(p,ae)|0)|0)+((8191&(n=(n=n+Math.imul(p,oe)|0)+Math.imul(h,ae)|0))<<13)|0;u=((a=a+Math.imul(h,oe)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(C,L)|0,a=Math.imul(C,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(O,K)|0,a=a+Math.imul(O,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,W)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(S,Y)|0,a=a+Math.imul(S,X)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,ee)|0,i=i+Math.imul(v,re)|0,n=(n=n+Math.imul(v,ie)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ie)|0,i=i+Math.imul(d,ae)|0,n=(n=n+Math.imul(d,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var xe=(u+(i=i+Math.imul(p,ce)|0)|0)+((8191&(n=(n=n+Math.imul(p,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((a=a+Math.imul(h,ue)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(R,L),n=(n=Math.imul(R,U))+Math.imul(z,L)|0,a=Math.imul(z,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,W)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(A,Y)|0,a=a+Math.imul(A,X)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ie)|0,i=i+Math.imul(v,ae)|0,n=(n=n+Math.imul(v,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,i=i+Math.imul(d,ce)|0,n=(n=n+Math.imul(d,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0;var Se=(u+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,he)|0)+Math.imul(h,pe)|0))<<13)|0;u=((a=a+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(D,L),n=(n=Math.imul(D,U))+Math.imul(N,L)|0,a=Math.imul(N,U),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(z,K)|0,a=a+Math.imul(z,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,W)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,Y)|0,a=a+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ie)|0,i=i+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,i=i+Math.imul(v,ce)|0,n=(n=n+Math.imul(v,ue)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,ue)|0,i=i+Math.imul(d,pe)|0,n=(n=n+Math.imul(d,he)|0)+Math.imul(m,pe)|0,a=a+Math.imul(m,he)|0;var je=(u+(i=i+Math.imul(p,de)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(h,de)|0))<<13)|0;u=((a=a+Math.imul(h,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,V))+Math.imul(N,K)|0,a=Math.imul(N,V),i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,W)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,W)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(C,Y)|0,a=a+Math.imul(C,X)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ie)|0,i=i+Math.imul(x,ae)|0,n=(n=n+Math.imul(x,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,ue)|0,i=i+Math.imul(v,pe)|0,n=(n=n+Math.imul(v,he)|0)+Math.imul(b,pe)|0,a=a+Math.imul(b,he)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(m,de)|0))<<13)|0;u=((a=a+Math.imul(m,me)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(D,$),n=(n=Math.imul(D,W))+Math.imul(N,$)|0,a=Math.imul(N,W),i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,X)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ie)|0,i=i+Math.imul(E,ae)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,i=i+Math.imul(x,ce)|0,n=(n=n+Math.imul(x,ue)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,ue)|0,i=i+Math.imul(_,pe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,pe)|0,a=a+Math.imul(w,he)|0;var Ae=(u+(i=i+Math.imul(v,de)|0)|0)+((8191&(n=(n=n+Math.imul(v,me)|0)+Math.imul(b,de)|0))<<13)|0;u=((a=a+Math.imul(b,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,X))+Math.imul(N,Y)|0,a=Math.imul(N,X),i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ie)|0,i=i+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,i=i+Math.imul(x,pe)|0,n=(n=n+Math.imul(x,he)|0)+Math.imul(S,pe)|0,a=a+Math.imul(S,he)|0;var Ie=(u+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,me)|0)+Math.imul(w,de)|0))<<13)|0;u=((a=a+Math.imul(w,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,ee))+Math.imul(N,Q)|0,a=Math.imul(N,ee),i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ie)|0,i=i+Math.imul(B,ae)|0,n=(n=n+Math.imul(B,oe)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,ue)|0,i=i+Math.imul(E,pe)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(A,pe)|0,a=a+Math.imul(A,he)|0;var Pe=(u+(i=i+Math.imul(x,de)|0)|0)+((8191&(n=(n=n+Math.imul(x,me)|0)+Math.imul(S,de)|0))<<13)|0;u=((a=a+Math.imul(S,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(D,re),n=(n=Math.imul(D,ie))+Math.imul(N,re)|0,a=Math.imul(N,ie),i=i+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,i=i+Math.imul(B,ce)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,ue)|0,i=i+Math.imul(P,pe)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(O,pe)|0,a=a+Math.imul(O,he)|0;var Oe=(u+(i=i+Math.imul(E,de)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(A,de)|0))<<13)|0;u=((a=a+Math.imul(A,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(D,ae),n=(n=Math.imul(D,oe))+Math.imul(N,ae)|0,a=Math.imul(N,oe),i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(z,ce)|0,a=a+Math.imul(z,ue)|0,i=i+Math.imul(B,pe)|0,n=(n=n+Math.imul(B,he)|0)+Math.imul(C,pe)|0,a=a+Math.imul(C,he)|0;var Te=(u+(i=i+Math.imul(P,de)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(O,de)|0))<<13)|0;u=((a=a+Math.imul(O,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(D,ce),n=(n=Math.imul(D,ue))+Math.imul(N,ce)|0,a=Math.imul(N,ue),i=i+Math.imul(R,pe)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(z,pe)|0,a=a+Math.imul(z,he)|0;var Be=(u+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,me)|0)+Math.imul(C,de)|0))<<13)|0;u=((a=a+Math.imul(C,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(D,pe),n=(n=Math.imul(D,he))+Math.imul(N,pe)|0,a=Math.imul(N,he);var Ce=(u+(i=i+Math.imul(R,de)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(z,de)|0))<<13)|0;u=((a=a+Math.imul(z,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Fe=(u+(i=Math.imul(D,de))|0)+((8191&(n=(n=Math.imul(D,me))+Math.imul(N,de)|0))<<13)|0;return u=((a=Math.imul(N,me))+(n>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,c[0]=ge,c[1]=ve,c[2]=be,c[3]=ye,c[4]=_e,c[5]=we,c[6]=ke,c[7]=xe,c[8]=Se,c[9]=je,c[10]=Ee,c[11]=Ae,c[12]=Ie,c[13]=Pe,c[14]=Oe,c[15]=Te,c[16]=Be,c[17]=Ce,c[18]=Fe,0!==u&&(c[19]=u,r.length++),r};function s(e,t,r){return(new c).mulp(e,t,r)}function c(e,t){this.x=e,this.y=t}Math.imul||(a=n),v.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?a(this,e,t):r<63?n(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,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},c.prototype.makeRBT=function(e){for(var t=new Array(e),r=v.prototype._countBits(e)-1,i=0;i>=1;return i},c.prototype.permute=function(e,t,r,i,n,a){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*a+1]=8191&n,n>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},v.prototype.muln=function(e){return this.clone().imuln(e)},v.prototype.sqr=function(){return this.mul(this)},v.prototype.isqr=function(){return this.imul(this.clone())},v.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 v(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<a)for(this.length-=a,c=0;c>>n,u=f&o}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},v.prototype.ishrn=function(e,t,r){return g(0===this.negative),this.iushrn(e,t,r)},v.prototype.shln=function(e){return this.clone().ishln(e)},v.prototype.ushln=function(e){return this.clone().iushln(e)},v.prototype.shrn=function(e){return this.clone().ishrn(e)},v.prototype.ushrn=function(e){return this.clone().iushrn(e)},v.prototype.testn=function(e){g("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===o)return this.strip();for(g(-1===o),i=o=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},v.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var o,s=i.length-n.length;if("mod"!==t){(o=new v(null)).length=s+1,o.words=new Array(o.length);for(var c=0;cthis.length||this.cmp(e)<0?{div:new v(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new v(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new v(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,a},v.prototype.div=function(e){return this.divmod(e,"div",!1).div},v.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},v.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},v.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),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},v.prototype.modn=function(e){g(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},v.prototype.idivn=function(e){g(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},v.prototype.divn=function(e){return this.clone().idivn(e)},v.prototype.egcd=function(e){g(0===e.negative),g(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new v(1),n=new v(0),a=new v(0),o=new v(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var c=r.clone(),u=t.clone();!t.isZero();){for(var f=0,p=1;0==(t.words[0]&p)&&f<26;++f,p<<=1);if(0>>26,o&=67108863,this.words[a]=o}return 0!==n&&(this.words[a]=n,this.length++),this},v.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},v.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(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=a}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},v._prime=function(e){if(u[e])return u[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new b;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return u[e]=t},w.prototype._verify1=function(e){g(0===e.negative,"red works only with positives"),g(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){g(0==(e.negative|t.negative),"red works only with positives"),g(e.red&&e.red===t.red,"red works only with red numbers")},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 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&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();var t=this.m.andln(3);if(g(t%2==1),3===t){var r=this.m.add(new v(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);g(!i.isZero());var a=new v(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new v(2*c*c).toRed(this);0!==this.pow(c,s).cmp(o);)c.redIAdd(o);for(var u=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=n;0!==p.cmp(a);){for(var l=p,d=0;0!==l.cmp(a);d++)l=l.redSqr();g(d>u&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==a?(a<<=1,a|=f,(4===++o||0===i&&0===u)&&(n=this.mul(n,r[a]),a=o=0)):o=0}s=26}return n},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},v.mont=function(e){return new k(e)},r(k,w),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.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),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new v(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return 0<=n.cmp(this.m)?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:157}],155:[function(e,t,r){var A=e("concat-map"),I=e("balanced-match");t.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function t(e,r){var i=[];var n=I("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var s=a||o;var c=0<=n.body.indexOf(",");if(!s&&!c)return n.post.match(/,.*\}/)?(e=n.pre+"{"+n.body+P+n.post,t(e)):[e];var u;if(s)u=n.body.split(/\.\./);else if(1===(u=T(n.body)).length&&1===(u=t(u[0],!1).map(B)).length){var f=n.post.length?t(n.post,!1):[""];return f.map(function(e){return n.pre+u[0]+e})}var p=n.pre;var f=n.post.length?t(n.post,!1):[""];var h;if(s){var l=O(u[0]),d=O(u[1]),m=Math.max(u[0].length,u[1].length),g=3==u.length?Math.abs(O(u[2])):1,v=F,b=d>>24]^f[d>>>16&255]^p[m>>>8&255]^h[255&g]^t[v++],o=u[d>>>24]^f[m>>>16&255]^p[g>>>8&255]^h[255&l]^t[v++],s=u[m>>>24]^f[g>>>16&255]^p[l>>>8&255]^h[255&d]^t[v++],c=u[g>>>24]^f[l>>>16&255]^p[d>>>8&255]^h[255&m]^t[v++],l=a,d=o,m=s,g=c;return a=(i[l>>>24]<<24|i[d>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[v++],o=(i[d>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&l])^t[v++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[l>>>8&255]<<8|i[255&d])^t[v++],c=(i[g>>>24]<<24|i[l>>>16&255]<<16|i[d>>>8&255]<<8|i[255&m])^t[v++],[a>>>=0,o>>>=0,s>>>=0,c>>>=0]}var p=[0,1,2,4,8,16,32,64,128,27,54],h=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=[[],[],[],[]],a=[[],[],[],[]],o=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;var f=e[i[r[o]=u]=o],p=e[f],h=e[p],l=257*e[u]^16843008*u;n[0][o]=l<<24|l>>>8,n[1][o]=l<<16|l>>>16,n[2][o]=l<<8|l>>>24,n[3][o]=l,l=16843009*h^65537*p^257*f^16843008*o,a[0][u]=l<<24|l>>>8,a[1][u]=l<<16|l>>>16,a[2][u]=l<<8|l>>>24,a[3][u]=l,0===o?o=s=1:(o=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();function s(e){this._key=a(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],a=0;a>>24,o=h.SBOX[o>>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o],o^=p[a/t|0]<<24):6>>24]<<24|h.SBOX[o>>>16&255]<<16|h.SBOX[o>>>8&255]<<8|h.SBOX[255&o]),n[a]=n[a-t]^o}for(var s=[],c=0;c>>24]]^h.INV_SUB_MIX[1][h.SBOX[f>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[f>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return o(e=a(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=a(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":447}],159:[function(e,t,r){var o=e("./aes"),u=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),f=e("./ghash"),n=e("buffer-xor"),p=e("./incr32");function a(e,t,r,i){s.call(this);var n=u.alloc(4,0);this._cipher=new o.AES(t);var a=this._cipher.encryptBlock(n);this._ghash=new f(a),r=function(e,t,r){if(12===t.length)return e._finID=u.concat([t,u.from([0,0,0,1])]),u.concat([t,u.from([0,0,0,2])]);var i=new f(r),n=t.length,a=n%16;i.update(t),a&&(a=16-a,i.update(u.alloc(a,0))),i.update(u.alloc(8,0));var o=8*n,s=u.alloc(8);s.writeUIntBE(o,0,8),i.update(s),e._finID=i.state;var c=u.from(e._finID);return p(c),c}(this,r,a),this._prev=u.from(r),this._cache=u.allocUnsafe(0),this._secCache=u.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(a,s),a.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=u.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},a.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(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;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=o(n)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":447}],164:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],165:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":190}],166:[function(e,t,r){var a=e("safe-buffer").Buffer,o=e("buffer-xor");function s(e,t,r){var i=t.length,n=o(t,e._cache);return e._cache=e._cache.slice(i),e._prev=a.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=a.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=a.allocUnsafe(0)),!(e._cache.length<=t.length)){n=a.concat([n,s(e,t,r)]);break}i=e._cache.length,n=a.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":190,"safe-buffer":447}],167:[function(e,t,r){var o=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,a=-1,o=0;++a<8;)i=t&1<<7-a?128:0,o+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>a%8,e._prev=c(e._prev,r?i:n);return o}function c(e,t){var r=e.length,i=-1,n=o.allocUnsafe(e.length);for(e=o.concat([e,o.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=o.allocUnsafe(i),a=-1;++a=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var a=m(r);if("ec"===a.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=g[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new d(i),a=r.data.subjectPrivateKey.data;return n.verify(t,e,a)}(e,t,a)}if("dsa"===a.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,a=r.data.g,o=r.data.pub_key,s=m.signature.decode(e,"der"),c=s.s,u=s.r;v(c,n),v(u,n);var f=l.mont(i),p=c.invm(n);return 0===a.toRed(f).redPow(new l(t).mul(p).mod(n)).fromRed().mul(o.toRed(f).redPow(u.mul(p).mod(n)).fromRed()).mod(i).mod(n).cmp(u)}(e,t,a)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var o=a.modulus.byteLength(),s=[1],c=0;t.length+s.length+2l.UNZIP)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function h(e,t){for(var r=0;rm.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsm.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelm.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelm.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=m.Z_FILTERED&&e.strategy!=m.Z_HUFFMAN_ONLY&&e.strategy!=m.Z_RLE&&e.strategy!=m.Z_FIXED&&e.strategy!=m.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!g.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new o.Zlib(t);var i=this;this._hadError=!1,this._binding.onerror=function(e,t){i._binding=null,i._hadError=!0;var r=new Error(e);r.errno=t,r.code=m.codes[t],i.emit("error",r)};var r=m.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(r=e.level);var n=m.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(n=e.strategy),this._binding.init(e.windowBits||m.Z_DEFAULT_WINDOWBITS,r,e.memLevel||m.Z_DEFAULT_MEMLEVEL,n,e.dictionary),this._buffer=new g(this._chunkSize),this._offset=0,this._closed=!1,this._level=r,this._strategy=n,this.once("end",this.close)}o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION,Object.keys(o).forEach(function(e){e.match(/^Z/)&&(m[e]=o[e])}),m.codes={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},Object.keys(m.codes).forEach(function(e){m.codes[m.codes[e]]=e}),m.Deflate=s,m.Inflate=c,m.Gzip=u,m.Gunzip=f,m.DeflateRaw=p,m.InflateRaw=h,m.Unzip=l,m.createDeflate=function(e){return new s(e)},m.createInflate=function(e){return new c(e)},m.createDeflateRaw=function(e){return new p(e)},m.createInflateRaw=function(e){return new h(e)},m.createGzip=function(e){return new u(e)},m.createGunzip=function(e){return new f(e)},m.createUnzip=function(e){return new l(e)},m.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new s(t),e,r)},m.deflateSync=function(e,t){return r(new s(t),e)},m.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new u(t),e,r)},m.gzipSync=function(e,t){return r(new u(t),e)},m.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new p(t),e,r)},m.deflateRawSync=function(e,t){return r(new p(t),e)},m.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new l(t),e,r)},m.unzipSync=function(e,t){return r(new l(t),e)},m.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new c(t),e,r)},m.inflateSync=function(e,t){return r(new c(t),e)},m.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new f(t),e,r)},m.gunzipSync=function(e,t){return r(new f(t),e)},m.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),i(new h(t),e,r)},m.inflateRawSync=function(e,t){return r(new h(t),e)},e.inherits(t,a),t.prototype.params=function(e,t,r){if(em.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=m.Z_FILTERED&&t!=m.Z_HUFFMAN_ONLY&&t!=m.Z_RLE&&t!=m.Z_FIXED&&t!=m.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var i=this;this.flush(o.Z_SYNC_FLUSH,function(){i._binding.params(e,t),i._hadError||(i._level=e,i._strategy=t,r&&r())})}else n.nextTick(r)},t.prototype.reset=function(){return this._binding.reset()},t.prototype._flush=function(e){this._transform(new g(0),"",e)},t.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=o.Z_FULL_FLUSH),r.ended)t&&n.nextTick(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var i=this;this.once("drain",function(){i.flush(t)})}else this._flushFlag=e,this.write(new g(0),"",t)},t.prototype.close=function(e){if(e&&n.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;n.nextTick(function(){t.emit("close")})}},t.prototype._transform=function(e,t,r){var i,n=this._writableState,a=(n.ending||n.ended)&&(!e||n.length===e.length);if(null===!e&&!g.isBuffer(e))return r(new Error("invalid input"));a?i=o.Z_FINISH:(i=this._flushFlag,e.length>=n.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH));this._processChunk(e,i,r)},t.prototype._processChunk=function(a,o,s){var c=a&&a.length,u=this._chunkSize-this._offset,f=0,p=this,h="function"==typeof s;if(!h){var t,l=[],d=0;this.on("error",function(e){t=e});do{var e=this._binding.writeSync(o,a,f,c,this._buffer,this._offset,u)}while(!this._hadError&&m(e[0],e[1]));if(this._hadError)throw t;var r=g.concat(l,d);return this.close(),r}var i=this._binding.write(o,a,f,c,this._buffer,this._offset,u);function m(e,t){if(!p._hadError){var r=u-t;if(v(0<=r,"have should not go down"),0=p._chunkSize)&&(u=p._chunkSize,p._offset=0,p._buffer=new g(p._chunkSize)),0===t){if(f+=c-e,c=e,!h)return!0;var n=p._binding.write(o,a,f,c,p._buffer,p._offset,p._chunkSize);return n.callback=m,void(n.buffer=a)}if(!h)return!1;s()}}i.buffer=a,i.callback=m},e.inherits(s,t),e.inherits(c,t),e.inherits(u,t),e.inherits(f,t),e.inherits(p,t),e.inherits(h,t),e.inherits(l,t)}).call(this,d("_process"),d("buffer").Buffer)},{"./binding":185,_process:382,_stream_transform:427,assert:67,buffer:191,util:505}],187:[function(e,t,r){arguments[4][157][0].apply(r,arguments)},{dup:157}],188:[function(e,B,C){(function(T){!function(e){var t="object"==(void 0===C?"undefined":_typeof(C))&&C&&!C.nodeType&&C,r="object"==(void 0===B?"undefined":_typeof(B))&&B&&!B.nodeType&&B,i="object"==(void 0===T?"undefined":_typeof(T))&&T;i.global!==i&&i.window!==i&&i.self!==i||(e=i);var n,a,v=2147483647,b=36,y=1,_=26,o=38,s=700,w=72,k=128,x="-",c=/^xn--/,u=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=b-y,S=Math.floor,j=String.fromCharCode;function E(e){throw new RangeError(p[e])}function l(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function d(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((v-d)/o))&&E("overflow"),d+=c*o,!(c<(u=s<=g?y:g+_<=s?_:s-g));s+=b)o>S(v/(f=b-u))&&E("overflow"),o*=f;g=O(d-a,t=h.length+1,0==a),S(d/t)>v-m&&E("overflow"),m+=S(d/t),d%=t,h.splice(d++,0,m)}return I(h)}function g(e){var t,r,i,n,a,o,s,c,u,f,p,h,l,d,m,g=[];for(h=(e=A(e)).length,t=k,a=w,o=r=0;oS((v-r)/(l=i+1))&&E("overflow"),r+=(s-t)*l,t=s,o=0;ov&&E("overflow"),p==t){for(c=r,u=b;!(c<(f=u<=a?y:a+_<=u?_:u-a));u+=b)m=c-f,d=b-f,g.push(j(P(f+m%d,0))),c=S(m/d);g.push(j(P(c,0))),a=O(r,l,i==n),r=0,++i}++r,++t}return g.join("")}if(n={version:"1.4.1",ucs2:{decode:A,encode:I},decode:m,encode:g,toASCII:function(e){return d(e,function(e){return u.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return d(e,function(e){return c.test(e)?m(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define("punycode",function(){return n});else if(t&&r)if(B.exports==t)r.exports=n;else for(a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],189:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var a=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=c;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function c(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}a.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},a.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:191}],190:[function(e,t,r){(function(a){t.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new a(r),n=0;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function l(e,t){if(p.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return R(e).length;t=(""+t).toLowerCase(),i=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=p.from(t,i)),p.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,n);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,n){var a,o=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;s/=o=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var f=-1;for(a=r;a>>10&1023|55296),f=56320|1023&f),i.push(f),n+=p}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;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 S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===p.compare(this,e)},p.prototype.inspect=function(){var e="",t=D.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,i,n){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(i,n),u=e.slice(t,r),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a,o,s,c,u,f,p,h,l,d=!1;;)switch(i){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return h=t,l=r,M(R(e,(p=this).length-h),p,h,l);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return c=this,u=t,f=r,M(z(e),c,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=t,s=r,M(function(e,t){for(var r,i,n,a=[],o=0;o>8,n=r%256,a.push(n),a.push(i);return a}(e,(a=this).length-o),a,o,s);default:if(d)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),d=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function k(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function I(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function P(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function O(e,t,r,i,n,a){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function T(e,t,r,i,n){return n||O(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function B(e,t,r,i,n){return n||O(e,0,r,8),a.write(e,t,r,i,52,8),r+8}p.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):I(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);A(this,e,t,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;0<=--a&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function z(e){return i.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function M(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":75,ieee754:318,isarray:323}],192:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],193:[function(e,t,r){function n(e){this.dict=e||{}}n.prototype.set=function(e,t,r){if("object"!==(void 0===e?"undefined":_typeof(e))){void 0===r&&(r=!0);var i=this.has(e);return!r&&i?this.dict[i]=this.dict[i]+","+t:this.dict[i||e]=t,i}for(var n in e)this.set(n,e[n],t)},n.prototype.has=function(e){for(var t=Object.keys(this.dict),r=(e=e.toLowerCase(),0);rr)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>8^255&n^99,u[r]=n;var a=e[f[n]=r],o=e[a],s=e[o],c=257*e[n]^16843008*n;p[r]=c<<24|c>>>8,h[r]=c<<16|c>>>16,l[r]=c<<8|c>>>24,d[r]=c;c=16843009*s^65537*o^257*a^16843008*r;m[n]=c<<24|c>>>8,g[n]=c<<16|c>>>16,v[n]=c<<8|c>>>24,b[n]=c,r?(r=a^e[e[e[s^a]]],i^=e[e[i]]):r=i=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],i=r.AES=t.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),n=this._keySchedule=[],a=0;a>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o]):(o=u[(o=o<<8|o>>>24)>>>24]<<24|u[o>>>16&255]<<16|u[o>>>8&255]<<8|u[255&o],o^=y[a/r|0]<<24),n[a]=n[a-r]^o}for(var s=this._invKeySchedule=[],c=0;c>>24]]^g[u[o>>>16&255]]^v[u[o>>>8&255]]^b[u[255&o]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,p,h,l,d,u)},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,m,g,v,b,f);r=e[t+1];e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,a,o,s){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],p=e[t+2]^r[2],h=e[t+3]^r[3],l=4,d=1;d>>24]^n[f>>>16&255]^a[p>>>8&255]^o[255&h]^r[l++],g=i[f>>>24]^n[p>>>16&255]^a[h>>>8&255]^o[255&u]^r[l++],v=i[p>>>24]^n[h>>>16&255]^a[u>>>8&255]^o[255&f]^r[l++],b=i[h>>>24]^n[u>>>16&255]^a[f>>>8&255]^o[255&p]^r[l++];u=m,f=g,p=v,h=b}m=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[p>>>8&255]<<8|s[255&h])^r[l++],g=(s[f>>>24]<<24|s[p>>>16&255]<<16|s[h>>>8&255]<<8|s[255&u])^r[l++],v=(s[p>>>24]<<24|s[h>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^r[l++],b=(s[h>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&p])^r[l++];e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=b},keySize:8});e.AES=t._createHelper(i)}(),n.AES},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],206:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,c,n,a,o,s,u,f,p,h,l,d,m,g,v,b;e.lib.Cipher||(r=(t=e).lib,i=r.Base,c=r.WordArray,n=r.BufferedBlockAlgorithm,(a=t.enc).Utf8,o=a.Base64,s=t.algo.EvpKDF,u=r.Cipher=n.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function n(e){return"string"==typeof e?b:g}return function(i){return{encrypt:function(e,t,r){return n(t).encrypt(i,e,t,r)},decrypt:function(e,t,r){return n(t).decrypt(i,e,t,r)}}}}()}),r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),f=t.mode={},p=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var e=p.extend();function a(e,t,r){var i=this._iv;if(i){var n=i;this._iv=void 0}else n=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:l}),reset:function(){u.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else{i=r.createDecryptor;this._minBufferSize=1}this._mode=i.call(r,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),d=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var i=c.create([1398893684,1701076831]).concat(r).concat(t);else i=t;return i.toString(o)},parse:function(e){var t=o.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var i=c.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return d.create({ciphertext:t,salt:i})}},g=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),a=n.finalize(t),o=n.cfg;return d.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.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}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=c.random(8));var n=s.create({keySize:t+r}).compute(e,i),a=c.create(n.words.slice(t),4*r);return n.sigBytes=4*t,d.create({key:n,iv:a,salt:i})}},b=r.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),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 a=g.encrypt.call(this,e,t,n.key,i);return a.mixIn(n),a},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,g.decrypt.call(this,e,t,n.key,i)}}))},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],207:[function(e,t,r){var i,n;i=this,n=function(){var f,r,e,t,i,p,n,a,o,s,c,u,h=h||(f=Math,r=Object.create||function(){function r(){}return function(e){var t;return r.prototype=e,t=new r,r.prototype=null,t}}(),t=(e={}).lib={},i=t.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$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)}},p=t.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).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 a=0;a>>2]>>>24-a%4*8&255;t[i+a>>>2]|=o<<24-(i+a)%4*8}else for(a=0;a>>2]=r[a>>>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=f.ceil(t/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,r=[],i=function(t){t=t;var r=987654321,i=4294967295;return function(){var e=((r=36969*(65535&r)+(r>>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return e/=4294967296,(e+=.5)*(.5>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).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 p.init(r,t/2)}},o=n.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(a))}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 p.init(r,t)}},s=n.Utf8={stringify:function(e){try{return decodeURIComponent(escape(o.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return o.parse(unescape(encodeURIComponent(e)))}},c=t.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=s.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,n=this.blockSize,a=i/(4*n),o=(a=e?f.ceil(a):f.max((0|a)-this._minBufferSize,0))*n,s=f.min(4*o,i);if(o){for(var c=0;c>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.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,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var n=0;n>>6-a%4*2;i[n>>>2]|=(o|s)<<24-n%4*8,n++}return c.create(i,n)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],209:[function(e,t,r){var i,n;i=this,n=function(r){return function(){var e=r,n=e.lib.WordArray,t=e.enc;t.Utf16=t.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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}};function o(e){return e<<8&4278255360|e>>>8&16711935}t.Utf16LE={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(a))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return n.create(r,2*t)}}}(),r.enc.Utf16},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],210:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,f,n,a,o;return r=(t=e).lib,i=r.Base,f=r.WordArray,n=t.algo,a=n.MD5,o=n.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=r.hasher.create(),n=f.create(),a=n.words,o=r.keySize,s=r.iterations;a.lengthi&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),a=this._iKey=t.clone(),o=n.words,s=a.words,c=0;c>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)}).prototype=e}}(),t.lib.WordArray},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],215:[function(e,t,r){var i,n;i=this,n=function(o){return function(f){var e=o,t=e.lib,r=t.WordArray,i=t.Hasher,n=e.algo,E=[];!function(){for(var e=0;e<64;e++)E[e]=4294967296*f.abs(f.sin(e+1))|0}();var a=n.MD5=i.extend({_doReset:function(){this._hash=new r.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 a=this._hash.words,o=e[t+0],s=e[t+1],c=e[t+2],u=e[t+3],f=e[t+4],p=e[t+5],h=e[t+6],l=e[t+7],d=e[t+8],m=e[t+9],g=e[t+10],v=e[t+11],b=e[t+12],y=e[t+13],_=e[t+14],w=e[t+15],k=a[0],x=a[1],S=a[2],j=a[3];x=O(x=O(x=O(x=O(x=P(x=P(x=P(x=P(x=I(x=I(x=I(x=I(x=A(x=A(x=A(x=A(x,S=A(S,j=A(j,k=A(k,x,S,j,o,7,E[0]),x,S,s,12,E[1]),k,x,c,17,E[2]),j,k,u,22,E[3]),S=A(S,j=A(j,k=A(k,x,S,j,f,7,E[4]),x,S,p,12,E[5]),k,x,h,17,E[6]),j,k,l,22,E[7]),S=A(S,j=A(j,k=A(k,x,S,j,d,7,E[8]),x,S,m,12,E[9]),k,x,g,17,E[10]),j,k,v,22,E[11]),S=A(S,j=A(j,k=A(k,x,S,j,b,7,E[12]),x,S,y,12,E[13]),k,x,_,17,E[14]),j,k,w,22,E[15]),S=I(S,j=I(j,k=I(k,x,S,j,s,5,E[16]),x,S,h,9,E[17]),k,x,v,14,E[18]),j,k,o,20,E[19]),S=I(S,j=I(j,k=I(k,x,S,j,p,5,E[20]),x,S,g,9,E[21]),k,x,w,14,E[22]),j,k,f,20,E[23]),S=I(S,j=I(j,k=I(k,x,S,j,m,5,E[24]),x,S,_,9,E[25]),k,x,u,14,E[26]),j,k,d,20,E[27]),S=I(S,j=I(j,k=I(k,x,S,j,y,5,E[28]),x,S,c,9,E[29]),k,x,l,14,E[30]),j,k,b,20,E[31]),S=P(S,j=P(j,k=P(k,x,S,j,p,4,E[32]),x,S,d,11,E[33]),k,x,v,16,E[34]),j,k,_,23,E[35]),S=P(S,j=P(j,k=P(k,x,S,j,s,4,E[36]),x,S,f,11,E[37]),k,x,l,16,E[38]),j,k,g,23,E[39]),S=P(S,j=P(j,k=P(k,x,S,j,y,4,E[40]),x,S,o,11,E[41]),k,x,u,16,E[42]),j,k,h,23,E[43]),S=P(S,j=P(j,k=P(k,x,S,j,m,4,E[44]),x,S,b,11,E[45]),k,x,w,16,E[46]),j,k,c,23,E[47]),S=O(S,j=O(j,k=O(k,x,S,j,o,6,E[48]),x,S,l,10,E[49]),k,x,_,15,E[50]),j,k,p,21,E[51]),S=O(S,j=O(j,k=O(k,x,S,j,b,6,E[52]),x,S,u,10,E[53]),k,x,g,15,E[54]),j,k,s,21,E[55]),S=O(S,j=O(j,k=O(k,x,S,j,d,6,E[56]),x,S,w,10,E[57]),k,x,h,15,E[58]),j,k,y,21,E[59]),S=O(S,j=O(j,k=O(k,x,S,j,f,6,E[60]),x,S,v,10,E[61]),k,x,c,15,E[62]),j,k,m,21,E[63]),a[0]=a[0]+k|0,a[1]=a[1]+x|0,a[2]=a[2]+S|0,a[3]=a[3]+j|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var n=f.floor(r/4294967296),a=r;t[15+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,s=o.words,c=0;c<4;c++){var u=s[c];s[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return o},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function A(e,t,r,i,n,a,o){var s=e+(t&r|~t&i)+n+o;return(s<>>32-a)+t}function I(e,t,r,i,n,a,o){var s=e+(t&i|r&~i)+n+o;return(s<>>32-a)+t}function P(e,t,r,i,n,a,o){var s=e+(t^r^i)+n+o;return(s<>>32-a)+t}function O(e,t,r,i,n,a,o){var s=e+(r^(t|~i))+n+o;return(s<>>32-a)+t}e.MD5=i._createHelper(a),e.HmacMD5=i._createHmacHelper(a)}(Math),o.MD5},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],216:[function(e,t,r){var i,n;i=this,n=function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function a(e,t,r,i){var n=this._iv;if(n){var a=n.slice(0);this._iv=void 0}else a=this._prevBlock;i.encryptBlock(a,0);for(var o=0;o>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 t=e.Encryptor=e.extend({processBlock:function(e,t){var r,i=this._cipher,n=i.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),0===((r=o)[0]=u(r[0]))&&(r[1]=u(r[1]));var s=o.slice(0);i.encryptBlock(s,0);for(var c=0;c>>2]|=n<<24-a%4*8,e.sigBytes+=n},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],222:[function(e,t,r){var i,n;i=this,n=function(n){return n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],223:[function(e,t,r){var i,n;i=this,n=function(r){return r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],224:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],225:[function(e,t,r){var i,n;i=this,n=function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},e.pad.ZeroPadding},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207}],226:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,v,n,a,b,o;return r=(t=e).lib,i=r.Base,v=r.WordArray,n=t.algo,a=n.SHA1,b=n.HMAC,o=n.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=b.create(r.hasher,e),n=v.create(),a=v.create([1]),o=n.words,s=a.words,c=r.keySize,u=r.iterations;o.length>>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]],n=this._b=0;n<4;n++)h.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;i[0]^=c,i[1]^=f,i[2]^=u,i[3]^=p,i[4]^=c,i[5]^=f,i[6]^=u,i[7]^=p;for(n=0;n<4;n++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.RabbitLegacy=t._createHelper(i)}(),a.RabbitLegacy},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],228:[function(e,t,r){var i,n;i=this,n=function(a){return function(){var e=a,t=e.lib.StreamCipher,r=e.algo,n=[],c=[],u=[],i=r.Rabbit=t.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(r=this._b=0;r<4;r++)h.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&u,p=u<<16|65535&c;n[0]^=c,n[1]^=f,n[2]^=u,n[3]^=p,n[4]^=c,n[5]^=f,n[6]^=u,n[7]^=p;for(r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.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 h(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,s=((4294901760&i)*i|0)+((65535&i)*i|0);u[r]=o^s}e[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,e[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,e[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,e[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,e[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,e[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,e[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,e[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}e.Rabbit=t._createHelper(i)}(),a.Rabbit},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./enc-base64"),e("./md5"),e("./evpkdf"),e("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],n):n(i.CryptoJS)},{"./cipher-core":206,"./core":207,"./enc-base64":208,"./evpkdf":210,"./md5":215}],229:[function(e,t,r){var i,n;i=this,n=function(o){return function(){var e=o,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.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 a=0;n<256;n++){var o=n%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+i[n]+s)%256;var c=i[n];i[n]=i[a],i[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=n.call(this)},keySize:8,ivSize:0});function n(){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 a=e[t];e[t]=e[r],e[r]=a,i|=e[(e[t]+e[r])%256]<<24-8*n}return this._i=t,this._j=r,i}e.RC4=t._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;0>>24)|4278255360&(n<<24|n>>>8)}var a,o,s,c,u,f,p,h,l,d,m,g=this._hash.words,v=A.words,b=I.words,y=x.words,_=S.words,w=j.words,k=E.words;f=a=g[0],p=o=g[1],h=s=g[2],l=c=g[3],d=u=g[4];for(r=0;r<80;r+=1)m=a+e[t+y[r]]|0,m+=r<16?P(o,s,c)+v[0]:r<32?O(o,s,c)+v[1]:r<48?T(o,s,c)+v[2]:r<64?B(o,s,c)+v[3]:C(o,s,c)+v[4],m=(m=F(m|=0,w[r]))+u|0,a=u,u=c,c=F(s,10),s=o,o=m,m=f+e[t+_[r]]|0,m+=r<16?C(p,h,l)+b[0]:r<32?B(p,h,l)+b[1]:r<48?T(p,h,l)+b[2]:r<64?O(p,h,l)+b[3]:P(p,h,l)+b[4],m=(m=F(m|=0,k[r]))+d|0,f=d,d=l,l=F(h,10),h=p,p=m;m=g[1]+s+l|0,g[1]=g[2]+c+d|0,g[2]=g[3]+u+f|0,g[3]=g[4]+a+p|0,g[4]=g[0]+o+h|0,g[0]=m},_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,a=n.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function P(e,t,r){return e^t^r}function O(e,t,r){return e&t|~e&r}function T(e,t,r){return(e|~t)^r}function B(e,t,r){return e&r|t&~r}function C(e,t,r){return e^(t|~r)}function F(e,t){return e<>>32-t}t.RIPEMD160=n._createHelper(o),t.HmacRIPEMD160=n._createHmacHelper(o)}(Math),s.RIPEMD160},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],231:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,p,o;return r=(t=e).lib,i=r.WordArray,n=r.Hasher,a=t.algo,p=[],o=a.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],a=r[2],o=r[3],s=r[4],c=0;c<80;c++){if(c<16)p[c]=0|e[t+c];else{var u=p[c-3]^p[c-8]^p[c-14]^p[c-16];p[c]=u<<1|u>>>31}var f=(i<<5|i>>>27)+s+p[c];f+=c<20?1518500249+(n&a|~n&o):c<40?1859775393+(n^a^o):c<60?(n&a|n&o|a&o)-1894007588:(n^a^o)-899497514,s=o,o=a,a=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|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(o),t.HmacSHA1=n._createHmacHelper(o),e.SHA1},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],232:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a;return r=(t=e).lib.WordArray,i=t.algo,n=i.SHA256,a=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(a),t.HmacSHA224=n._createHmacHelper(a),e.SHA224},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],n):n(i.CryptoJS)},{"./core":207,"./sha256":233}],233:[function(e,t,r){var i,n;i=this,n=function(c){return function(n){var e=c,t=e.lib,r=t.WordArray,i=t.Hasher,a=e.algo,o=[],y=[];!function(){function e(e){for(var t=n.sqrt(e),r=2;r<=t;r++)if(!(e%r))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(o[i]=t(n.pow(r,.5))),y[i]=t(n.pow(r,1/3)),i++),r++}();var _=[],s=a.SHA256=i.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=0;p<64;p++){if(p<16)_[p]=0|e[t+p];else{var h=_[p-15],l=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,d=_[p-2],m=(d<<15|d>>>17)^(d<<13|d>>>19)^d>>>10;_[p]=l+_[p-7]+m+_[p-16]}var g=i&n^i&a^n&a,v=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&u)+y[p]+_[p];f=u,u=c,c=s,s=o+b|0,o=a,a=n,n=i,i=b+(v+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+u|0,r[7]=r[7]+f|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)]=n.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA256=i._createHelper(s),e.HmacSHA256=i._createHmacHelper(s)}(Math),c.SHA256},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(i.CryptoJS)},{"./core":207}],234:[function(e,t,r){var i,n;i=this,n=function(a){return function(h){var e=a,t=e.lib,l=t.WordArray,i=t.Hasher,f=e.x64.Word,r=e.algo,P=[],O=[],T=[];!function(){for(var e=1,t=0,r=0;r<24;r++){P[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++)O[e+5*t]=t+(2*e+3*t)%5*5;for(var n=1,a=0;a<24;a++){for(var o=0,s=0,c=0;c<7;c++){if(1&n){var u=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(S=r[n]).high^=o,S.low^=a}for(var s=0;s<24;s++){for(var c=0;c<5;c++){for(var u=0,f=0,p=0;p<5;p++){u^=(S=r[c+5*p]).high,f^=S.low}var h=B[c];h.high=u,h.low=f}for(c=0;c<5;c++){var l=B[(c+4)%5],d=B[(c+1)%5],m=d.high,g=d.low;for(u=l.high^(m<<1|g>>>31),f=l.low^(g<<1|m>>>31),p=0;p<5;p++){(S=r[c+5*p]).high^=u,S.low^=f}}for(var v=1;v<25;v++){var b=(S=r[v]).high,y=S.low,_=P[v];if(_<32)u=b<<_|y>>>32-_,f=y<<_|b>>>32-_;else u=y<<_-32|b>>>64-_,f=b<<_-32|y>>>64-_;var w=B[O[v]];w.high=u,w.low=f}var k=B[0],x=r[0];k.high=x.high,k.low=x.low;for(c=0;c<5;c++)for(p=0;p<5;p++){var S=r[v=c+5*p],j=B[v],E=B[(c+1)%5+5*p],A=B[(c+2)%5+5*p];S.high=j.high^~E.high&A.high,S.low=j.low^~E.low&A.low}S=r[0];var I=T[s];S.high^=I.high,S.low^=I.low}},_doFinalize:function(){var e=this._data,t=e.words,r=(this._nDataBytes,8*e.sigBytes),i=32*this.blockSize;t[r>>>5]|=1<<24-r%32,t[(h.ceil((r+1)/i)*i>>>5)-1]|=128,e.sigBytes=4*t.length,this._process();for(var n=this._state,a=this.cfg.outputLength/8,o=a/8,s=[],c=0;c>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),s.push(p),s.push(f)}return new l.init(s,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});e.SHA3=i._createHelper(n),e.HmacSHA3=i._createHmacHelper(n)}(Math),a.SHA3},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],235:[function(e,t,r){var i,n;i=this,n=function(e){var t,r,i,n,a,o,s;return r=(t=e).x64,i=r.Word,n=r.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.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=o._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s),e.SHA384},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core"),e("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],n):n(i.CryptoJS)},{"./core":207,"./sha512":236,"./x64-core":238}],236:[function(e,t,r){var i,n;i=this,n=function(c){return function(){var e=c,t=e.lib.Hasher,r=e.x64,i=r.Word,n=r.WordArray,a=e.algo;function o(){return i.create.apply(i,arguments)}var xe=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],Se=[];!function(){for(var e=0;e<80;e++)Se[e]=o()}();var s=a.SHA512=t.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],u=r[6],f=r[7],p=i.high,h=i.low,l=n.high,d=n.low,m=a.high,g=a.low,v=o.high,b=o.low,y=s.high,_=s.low,w=c.high,k=c.low,x=u.high,S=u.low,j=f.high,E=f.low,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=w,D=k,N=x,q=S,L=j,U=E,H=0;H<80;H++){var K=Se[H];if(H<16)var V=K.high=0|e[t+2*H],G=K.low=0|e[t+2*H+1];else{var $=Se[H-15],W=$.high,Z=$.low,Y=(W>>>1|Z<<31)^(W>>>8|Z<<24)^W>>>7,X=(Z>>>1|W<<31)^(Z>>>8|W<<24)^(Z>>>7|W<<25),J=Se[H-2],Q=J.high,ee=J.low,te=(Q>>>19|ee<<13)^(Q<<3|ee>>>29)^Q>>>6,re=(ee>>>19|Q<<13)^(ee<<3|Q>>>29)^(ee>>>6|Q<<26),ie=Se[H-7],ne=ie.high,ae=ie.low,oe=Se[H-16],se=oe.high,ce=oe.low;V=(V=(V=Y+ne+((G=X+ae)>>>0>>0?1:0))+te+((G=G+re)>>>0>>0?1:0))+se+((G=G+ce)>>>0>>0?1:0);K.high=V,K.low=G}var ue,fe=R&M^~R&N,pe=z&D^~z&q,he=A&P^A&T^P&T,le=I&O^I&B^O&B,de=(A>>>28|I<<4)^(A<<30|I>>>2)^(A<<25|I>>>7),me=(I>>>28|A<<4)^(I<<30|A>>>2)^(I<<25|A>>>7),ge=(R>>>14|z<<18)^(R>>>18|z<<14)^(R<<23|z>>>9),ve=(z>>>14|R<<18)^(z>>>18|R<<14)^(z<<23|R>>>9),be=xe[H],ye=be.high,_e=be.low,we=L+ge+((ue=U+ve)>>>0>>0?1:0),ke=me+le;L=N,U=q,N=M,q=D,M=R,D=z,R=C+(we=(we=(we=we+fe+((ue=ue+pe)>>>0>>0?1:0))+ye+((ue=ue+_e)>>>0<_e>>>0?1:0))+V+((ue=ue+G)>>>0>>0?1:0))+((z=F+ue|0)>>>0>>0?1:0)|0,C=T,F=B,T=P,B=O,P=A,O=I,A=we+(de+he+(ke>>>0>>0?1:0))+((I=ue+ke|0)>>>0>>0?1:0)|0}h=i.low=h+I,i.high=p+A+(h>>>0>>0?1:0),d=n.low=d+O,n.high=l+P+(d>>>0>>0?1:0),g=a.low=g+B,a.high=m+T+(g>>>0>>0?1:0),b=o.low=b+F,o.high=v+C+(b>>>0>>0?1:0),_=s.low=_+z,s.high=y+R+(_>>>0>>0?1:0),k=c.low=k+D,c.high=w+M+(k>>>0>>0?1:0),S=u.low=S+q,u.high=x+N+(S>>>0>>0?1:0),E=f.low=E+U,f.high=j+L+(E>>>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=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(s),e.HmacSHA512=t._createHmacHelper(s)}(),c.SHA512},"object"===(void 0===r?"undefined":_typeof(r))?t.exports=r=n(e("./core"),e("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],n):n(i.CryptoJS)},{"./core":207,"./x64-core":238}],237:[function(e,t,r){var i,n;i=this,n=function(s){return function(){var e=s,t=e.lib,r=t.WordArray,i=t.BlockCipher,n=e.algo,u=[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],f=[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],p=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],a=n.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var i=u[r]-1;t[r]=e[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var o=n[a]=[],s=p[a];for(r=0;r<24;r++)o[r/6|0]|=t[(f[r]-1+s)%28]<<31-r%6,o[4+(r/6|0)]|=t[28+(f[r+24]-1+s)%28]<<31-r%6;o[0]=o[0]<<1|o[0]>>>31;for(r=1;r<7;r++)o[r]=o[r]>>>4*(r-1)+3;o[7]=o[7]<<5|o[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[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],d.call(this,4,252645135),d.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),d.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=h[c][((o^n[c])&l[c])>>>0];this._lBlock=o,this._rBlock=a^s}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,d.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(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<>>1];r=h.r28shl(r,a),i=h.r28shl(i,a),h.pc2(r,i,e.keys,n)}},c.prototype._update=function(e,t,r,i){var n=this._desState,a=h.readUInt32BE(e,t),o=h.readUInt32BE(e,t+4);h.ip(a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,o,n.tmp,0):this._decrypt(n,a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],h.writeUInt32BE(r,a,i),h.writeUInt32BE(r,o,i+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,a=p}h.rip(o,a,i,n)},c.prototype._decrypt=function(e,t,r,i,n){for(var a=r,o=t,s=e.keys.length-2;0<=s;s-=2){var c=e.keys[s],u=e.keys[s+1];h.expand(a,e.tmp,0),c^=e.tmp[0],u^=e.tmp[1];var f=h.substitute(c,u),p=a;a=(o^h.permute(f))>>>0,o=p}h.rip(a,o,i,n)}},{"../des":240,inherits:320,"minimalistic-assert":353}],244:[function(e,t,r){"use strict";var a=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),o=n.Cipher,s=n.DES;function c(e,t){a.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new c(this.type,this.options.key);this._edeState=t}i(u,o),(t.exports=u).create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"../des":240,inherits:320,"minimalistic-assert":353}],245:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.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},r.ip=function(e,t,r,i){for(var n=0,a=0,o=6;0<=o;o-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+o&1}for(o=6;0<=o;o-=2){for(s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1;for(s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1}r[i+0]=n>>>0,r[i+1]=a>>>0},r.rip=function(e,t,r,i){for(var n=0,a=0,o=0;o<4;o++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+o&1,n<<=1,n|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;0<=s;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.pc1=function(e,t,r,i){for(var n=0,a=0,o=7;5<=o;o--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.r28shl=function(e,t){return e<>>28-t};var c=[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];r.pc2=function(e,t,r,i){for(var n=0,a=0,o=c.length>>>1,s=0;s>>c[s]&1;for(s=o;s>>c[s]&1;r[i+0]=n>>>0,r[i+1]=a>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var a=23;15<=a;a-=4)i<<=6,i|=e>>>a&63;for(a=11;3<=a;a-=4)n|=e>>>a&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[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];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[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];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(c),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;r.mod(p).cmp(h);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(i=r.shrn(1))&&g(r)&&v(i)&&v(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":154,"miller-rabin":349,randombytes:414}],249:[function(e,t,r){t.exports={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"}}},{}],250:[function(e,t,r){var u=e("crypto"),f=e("jsbn").BigInteger,p=(e("./lib/ec.js").ECPointFp,e("safer-buffer").Buffer);function h(e,t){return e.length>=t?e:h("0"+e,t)}r.ECCurves=e("./lib/sec.js"),r.ECKey=function(e,t,r){var i,n=e(),a=n.getN(),o=Math.floor(a.bitLength()/8);if(t)if(r){e=n.getCurve();this.P=e.decodePointHex(t.toString("hex"))}else{if(t.length!=o)return!1;i=new f(t.toString("hex"),16)}else{var s=a.subtract(f.ONE),c=new f(u.randomBytes(a.bitLength()));i=c.mod(s).add(f.ONE),this.P=n.getG().multiply(i)}this.P&&(this.PublicKey=p.from(n.getCurve().encodeCompressedPointHex(this.P),"hex")),i&&(this.PrivateKey=p.from(h(i.toString(16),2*o),"hex"),this.deriveSharedSecret=function(e){if(!e||!e.P)return!1;var t=e.P.multiply(i);return p.from(h(t.getX().toBigInteger().toString(16),2*o),"hex")})}},{"./lib/ec.js":251,"./lib/sec.js":252,crypto:204,jsbn:325,"safer-buffer":448}],251:[function(e,t,r){var l=e("jsbn").BigInteger,i=l.prototype.Barrett;function f(e,t){this.x=t,this.q=e}function d(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=null==i?l.ONE:i,this.zinv=null}function n(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new d(this,null,null),this.reducer=new i(this.q)}f.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},f.prototype.toBigInteger=function(){return this.x},f.prototype.negate=function(){return new f(this.q,this.x.negate().mod(this.q))},f.prototype.add=function(e){return new f(this.q,this.x.add(e.toBigInteger()).mod(this.q))},f.prototype.subtract=function(e){return new f(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},f.prototype.multiply=function(e){return new f(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},f.prototype.square=function(){return new f(this.q,this.x.square().mod(this.q))},f.prototype.divide=function(e){return new f(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},d.prototype.getX=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.getY=function(){null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},d.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(l.ZERO))},d.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(l.ZERO)&&!this.y.toBigInteger().equals(l.ZERO)},d.prototype.negate=function(){return new d(this.curve,this.x,this.y.negate(),this.z)},d.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(l.ZERO.equals(r))return l.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new l("3"),n=this.x.toBigInteger(),a=this.y.toBigInteger(),o=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),s=o.multiply(r),c=n.multiply(o),u=t.square().multiply(this.z),f=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(s).multiply(r).mod(this.curve.q),p=c.multiply(i).multiply(t).subtract(a.multiply(s)).subtract(u.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),h=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(p),h)},d.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new l("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),n=i.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),o=t.square().multiply(e);l.ZERO.equals(a)||(o=o.add(this.z.square().multiply(a)));var s=(o=o.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(i).mod(this.curve.q),c=o.multiply(e).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(o.square().multiply(o)).mod(this.curve.q),u=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new d(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(c),u)},d.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new l("3")),n=this.negate(),a=this;for(t=i.bitLength()-2;0r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var n=this.curve.getInfinity(),a=this.add(t);0<=i;)n=n.twice(),e.testBit(i)?n=r.testBit(i)?n.add(a):n.add(this):r.testBit(i)&&(n=n.add(t)),--i;return n},n.prototype.getQ=function(){return this.q},n.prototype.getA=function(){return this.a},n.prototype.getB=function(){return this.b},n.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},n.prototype.getInfinity=function(){return this.infinity},n.prototype.fromBigInteger=function(e){return new f(this.q,e)},n.prototype.reduce=function(e){this.reducer.reduce(e)},n.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),i=this.getQ().toString(16).length;for(i%2!=0&&i++;t.lengtht+1;){var r=e.shiftRight(t),i=e.subtract(r.shiftLeft(t));this.getR().equals(l.ONE)||(r=r.multiply(this.getR())),e=r.add(i)}for(;0<=e.compareTo(q);)e=e.subtract(q)}else e=e.mod(q);return e},f.prototype.sqrt=function(){if(!this.q.testBit(0))throw"unsupported";if(this.q.testBit(1)){var e=new f(this.q,this.x.modPow(this.q.shiftRight(2).add(l.ONE),this.q));return e.square().equals(this)?e:null}var t=this.q.subtract(l.ONE),r=t.shiftRight(1);if(!this.x.modPow(r,this.q).equals(l.ONE))return null;var i,n,a=t.shiftRight(2).shiftLeft(1).add(l.ONE),o=this.x,s=modDouble(modDouble(o));do{for(var c;0<=(c=new l(this.q.bitLength(),new SecureRandom)).compareTo(this.q)||!c.multiply(c).subtract(s).modPow(r,this.q).equals(t););var u=this.lucasSequence(c,o,a);if(i=u[0],n=u[1],this.modMult(n,n).equals(s))return n.testBit(0)&&(n=n.add(q)),n=n.shiftRight(1),new f(q,n)}while(i.equals(l.ONE)||i.equals(t));return null},f.prototype.lucasSequence=function(e,t,r){for(var i=r.bitLength(),n=r.getLowestSetBit(),a=l.ONE,o=l.TWO,s=e,c=l.ONE,u=l.ONE,f=i-1;n+1<=f;--f)c=this.modMult(c,u),r.testBit(f)?(u=this.modMult(c,t),a=this.modMult(a,s),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),s=this.modReduce(s.multiply(s).subtract(u.shiftLeft(1)))):(u=c,a=this.modReduce(a.multiply(o).subtract(c)),s=this.modReduce(s.multiply(o).subtract(e.multiply(c))),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))));c=this.modMult(c,u),u=this.modMult(c,t),a=this.modReduce(a.multiply(o).subtract(c)),o=this.modReduce(s.multiply(o).subtract(e.multiply(c))),c=this.modMult(c,u);for(f=1;f<=n;++f)a=this.modMult(a,o),o=this.modReduce(o.multiply(o).subtract(c.shiftLeft(1))),c=this.modMult(c,c);return[a,o]};r={ECCurveFp:n,ECPointFp:d,ECFieldElementFp:f};t.exports=r},{jsbn:325}],252:[function(e,t,r){var o=e("jsbn").BigInteger,s=e("./ec.js").ECCurveFp;function c(e,t,r,i){this.curve=e,this.g=t,this.n=r,this.h=i}function u(e){return new o(e,16)}function i(){var e=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),r=u("E87579C11079F43DD824993C2CEE5ED3"),i=u("FFFFFFFE0000000075A30D1B9038A115"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83"),i,n)}function n(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=o.ZERO,r=u("7"),i=u("0100000000000000000001B8FA16DFAB9ACA16B6B3"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE"),i,n)}function a(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),r=u("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),i=u("0100000000000000000001F4C8F927AED3CA752257"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32"),i,n)}function f(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=o.ZERO,r=u("3"),i=u("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"),i,n)}function p(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),r=u("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),i=u("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811"),i,n)}function h(){var e=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),r=u("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),i=u("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"),i,n)}function l(){var e=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=u("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),r=u("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),i=u("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),n=o.ONE,a=new s(e,t,r);return new c(a,a.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),i,n)}c.prototype.getCurve=function(){return this.curve},c.prototype.getG=function(){return this.g},c.prototype.getN=function(){return this.n},c.prototype.getH=function(){return this.h},t.exports={secp128r1:i,secp160k1:n,secp160r1:a,secp192k1:f,secp192r1:p,secp224r1:h,secp256r1:l}},{"./ec.js":251,jsbn:325}],253:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":268,"./elliptic/curve":256,"./elliptic/curves":259,"./elliptic/ec":260,"./elliptic/eddsa":263,"./elliptic/utils":267,brorand:156}],254:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,j=n.getNAF,E=n.getJSF,p=n.assert;function a(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):o.mixedAdd(n[-c-1>>1].neg()):0>1]):o.add(n[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},a.prototype._wnafMulAdd=function(e,t,r,i,n){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,c=0,u=0;u>1]:S<0&&(x=o[g][-S-1>>1].neg()),y="affine"===x.type?y.mixedAdd(x):y.add(x))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},o.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.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),a=i.redAdd(t),o=a.redSub(r),s=i.redSub(t),c=n.redMul(o),u=a.redMul(s),f=n.redMul(s),p=o.redMul(a);return this.curve.point(c,u,p,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=(u=this.curve._mulA(n)).redAdd(a);if(this.zOne)e=i.redSub(n).redSub(a).redMul(o.redSub(this.curve.two)),t=o.redMul(u.redSub(a)),r=o.redSqr().redSub(o).redSub(o);else{var s=this.z.redSqr(),c=o.redSub(s).redISub(s);e=i.redSub(n).redISub(a).redMul(c),t=o.redMul(u.redSub(a)),r=o.redMul(c)}}else{var u=n.redAdd(a);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(n.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.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)),a=r.redSub(t),o=n.redSub(i),s=n.redAdd(i),c=r.redAdd(t),u=a.redMul(o),f=s.redMul(c),p=a.redMul(c),h=o.redMul(s);return this.curve.point(u,f,h,p)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),p=i.redMul(c).redMul(f);return r=this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(a))),c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(a)),this.curve._mulC(c).redMul(u)),this.curve.point(p,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.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),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],256:[function(e,t,r){arguments[4][130][0].apply(r,arguments)},{"./base":254,"./edwards":255,"./mont":257,"./short":258,dup:130}],257:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),a=e("inherits"),o=i.base,s=e("../../elliptic").utils;function c(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(c,o),(t.exports=c).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)},a(u,o.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},c.prototype.point=function(e,t){return new u(this,e,t)},c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.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)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=n.redMul(i),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},u.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 a=n.length-1;0<=a;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],258:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),a=e("inherits"),o=i.base,s=n.utils.assert;function c(e){o.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),this.inf=null===t&&null===r?(this.x=null,!(this.y=null)):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),!1)}function f(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),this.z=null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,new w(0)):(this.x=new w(t,16),this.y=new w(r,16),new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,o),(t.exports=c).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,n,a,o,s,c,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),l=new w(1),d=new w(0),m=new w(0),g=new w(1),v=0;0!==p.cmpn(0);){var b=h.div(p);c=h.sub(b.mul(p)),u=m.sub(b.mul(l));var y=g.sub(b.mul(d));if(!i&&c.cmp(f)<0)t=s.neg(),r=l,i=c.neg(),n=u;else if(i&&2==++v)break;h=p,p=s=c,m=l,l=u,g=d,d=y}a=c.neg(),o=u;var _=i.sqr().add(n.sqr());return 0<=a.sqr().add(o.sqr()).cmp(_)&&(a=t,o=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),c=n.mul(r.b),u=a.mul(i.b);return{k1:e.sub(o).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new w(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)},c.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)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.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)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(f,o.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),c=a.redSub(o);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),p=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(p).redISub(p),l=c.redMul(p.redISub(h)).redISub(a.redMul(f)),d=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,d)},f.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=r.redMul(c),p=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(p)).redISub(n.redMul(u)),l=this.z.redMul(o);return this.curve.jpoint(p,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":253,"../curve":256,"bn.js":154,inherits:320}],259:[function(e,t,r){"use strict";var i,n=r,a=e("hash.js"),o=e("../elliptic"),s=o.utils.assert;function c(e){"short"===e.type?this.curve=new o.curve.short(e):"edwards"===e.type?this.curve=new o.curve.edwards(e):this.curve=new o.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new c(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":253,"./precomputed/secp256k1":266,"hash.js":299}],260:[function(e,t,r){"use strict";var g=e("bn.js"),v=e("hmac-drbg"),a=e("../../elliptic"),l=a.utils.assert,i=e("./key"),b=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(l(a.curves.hasOwnProperty(e),"Unknown curve "+e),e=a.curves[e]),e instanceof a.curves.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}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new v({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new g(2));;){var n=new g(t.generate(r));if(!(0>1;if(0<=o.cmp(this.curve.p.umod(this.curve.n))&&u)throw new Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var f=t.r.invm(n),p=n.sub(a).mul(f).umod(n),h=s.mul(f).umod(n);return this.g.mulAdd(p,o,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new b(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":253,"./key":261,"./signature":262,"bn.js":154,"hmac-drbg":311}],261:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=a).fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},{"../../elliptic":253,"bn.js":154}],262:[function(e,t,r){"use strict";var s=e("bn.js"),c=e("../../elliptic").utils,i=c.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,o=t.place;a>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=c.toArray(e,t);var r=new u;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=f(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=f(e,r);if(e.length!==a+r.place)return!1;var o=e.slice(r.place,a+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===o[0]&&128&o[1]&&(o=o.slice(1)),this.r=new s(n),this.s=new s(o),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=o(t),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];p(i,t.length),(i=i.concat(t)).push(2),p(i,r.length);var n=i.concat(r),a=[48];return p(a,n.length),a=a.concat(n),c.encode(a,e)}},{"../../elliptic":253,"bn.js":154}],263:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),a=n.utils,o=a.assert,c=a.parseBytes,s=e("./key"),u=e("./signature");function f(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=f).prototype.sign=function(e,t){e=c(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),a=this.encodePoint(n),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:a})},f.prototype.verify=function(e,t,r){e=c(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(a)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,c=1;c=6.0.0 <7.0.0",_id:"elliptic@6.4.1",_inCache:!0,_installable:!0,_location:"/elliptic",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/elliptic_6.4.1_1533787091502_0.6309761823717674"},_npmUser:{email:"fedor@indutny.com",name:"indutny"},_npmVersion:"6.3.0",_phantomChildren:{},_requested:{name:"elliptic",raw:"elliptic@^6.0.0",rawSpec:"^6.0.0",scope:null,spec:">=6.0.0 <7.0.0",type:"range"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",_shrinkwrap:null,_spec:"elliptic@^6.0.0",_where:"/home/giacof/Download/javascript-opentimestamps/node_modules/browserify-sign",author:{email:"fedor@indutny.com",name:"Fedor Indutny"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},directories:{},dist:{fileCount:17,integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJba7vUCRA9TVsSAnZWagAA+gcP/jWaj5GmDZ0YFi/X4g5O\nx+pxu9i3HbP9YqywT7rz3XFXSaytu0LQDeDEbddl523X69tsbKfzHRTcnW8n\n2r0VjPhttRm+0RpEhBwjSIK34VkQA1xIWh2ugOToKXVCFVLM5VFDPGzbiN6x\n/hpL7gj1hoCRVmuhjnqFQ+vPKACKfv1Eq4CsRmu2focmP37kQpWQlweD/z4V\nJF4NxA33Fvp13Fl+9g4sPHyhUVsW9ojVaG3Ijn70pCaGQM18UPlbODkWQ1QX\nAgteOFjkIOtcalJk3B3qsM8GZeHEcAFvt2T73miJkHdCGNmRQS45Ede+gnj0\nlLlZJsCCKUHtTqrlprHo6AgMnBZufmytyozYAHC1/JYniazSBi2yPHtQeniR\nl69BfiRBdD2rNrMPwmCNRkMqrgel5WMGpaD0xdaFAHF1Ru2ZQFKsA7KvPGgp\nA20+LN11cCib67Pg5XDyrZ92T3yXec+6gQ3iq9d9UBZKFGl0P8ebVqq1LrUJ\na6nekwMpRISWnKcqV72XVmQdBmUWHq9VfVLsWJzVIJqtpHmUO7q74ACP3i4W\n0/F1REeI0YEhh3NjeStdDecfjlu7PY0pLQpbk2I3ms+6DO+cAfeDEev5jFBK\nwQabRNhITeT1FVtxZAcApj33fnCdqwaWr1NS00K5ZRqhDTTzPr/O4KRN4CR1\npstU\r\n=UVBB\r\n-----END PGP SIGNATURE-----\r\n",shasum:"c2d0b7776911b86722c632c3c06c60f2f819939a",tarball:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",unpackedSize:118371},files:["lib"],gitHead:"523da1cf71ddcfd607fbdee1858bc2af47f0e700",homepage:"https://github.com/indutny/elliptic",keywords:["Cryptography","EC","Elliptic","curve"],license:"MIT",main:"lib/elliptic.js",maintainers:[{name:"indutny",email:"fedor@indutny.com"}],name:"elliptic",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.1"}},{}],269:[function(e,t,r){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function c(e){return"function"==typeof e}function u(e){return"object"===(void 0===e?"undefined":_typeof(e))&&null!==e}function f(e){return void 0===e}((t.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},i.prototype.emit=function(e){var t,r,i,n,a,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(f(r=this._events[e]))return!1;if(c(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=Array.prototype.slice.call(arguments,1),r.apply(this,n)}else if(u(r))for(n=Array.prototype.slice.call(arguments,1),i=(o=r.slice()).length,a=0;ar&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!c(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,a;if(!c(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||c(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(r)){for(a=n;0=this._blockSize;){for(var n=this._blockOffset;n=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=n.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,a=8;athis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":310}],310:[function(e,t,r){"use strict";var u=e("minimalistic-assert"),i=e("inherits");function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function o(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}r.inherits=i,r.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),i=0;i>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>0}return a},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0,o=(a>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,a,o,s){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,a,o,s){return t+i+a+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,a,o,s,c,u){var f=0,p=t;return f+=(p=p+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,a,o,s,c,u){return t+i+a+s+u>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:320,"minimalistic-assert":353}],311:[function(e,t,r){"use strict";var i=e("hash.js"),o=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),i=o.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=a).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=o.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length1e3*t.clockSkew)throw new E("clock skew of "+g/1e3+"s was greater than "+t.clockSkew+"s")}if(t.headers.forEach(function(e){if(u.params.headers.indexOf(e.toLowerCase())<0)throw new P(e+" was not a signed header")}),t.algorithms&&-1===t.algorithms.indexOf(u.params.algorithm))throw new I(u.params.algorithm+" is not a supported algorithm");return u.algorithm=u.params.algorithm.toUpperCase(),u.keyId=u.params.keyId,u}}},{"./utils":315,"assert-plus":66,util:505}],314:[function(n,a,e){(function(l){var d=n("assert-plus"),m=n("crypto"),e=(n("http"),n("util")),g=n("sshpk"),v=n("jsprim"),t=n("./utils"),b=n("util").format,y=t.HASH_ALGOS,_=t.PK_ALGOS,w=t.InvalidAlgorithmError,r=t.HttpSignatureError,k=t.validateAlgorithm,x='Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';function S(e){r.call(this,e,S)}function j(e){r.call(this,e,j)}function i(e){d.object(e,"options");var t=[];if(void 0!==e.algorithm&&(d.string(e.algorithm,"options.algorithm"),t=k(e.algorithm)),this.rs_alg=t,void 0!==e.sign)d.func(e.sign,"options.sign"),this.rs_signFunc=e.sign;else if("hmac"===t[0]&&void 0!==e.key){if(d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,"string"!=typeof e.key&&!l.isBuffer(e.key))throw new TypeError("options.key for HMAC must be a string or Buffer");this.rs_signer=m.createHmac(t[1].toUpperCase(),e.key),this.rs_signer.sign=function(){var e=this.digest("base64");return{hashAlgorithm:t[1],toString:function(){return e}}}}else{if(void 0===e.key)throw new TypeError("options.sign (func) or options.key is required");var r=e.key;if(("string"==typeof r||l.isBuffer(r))&&(r=g.parsePrivateKey(r)),d.ok(g.PrivateKey.isPrivateKey(r,[1,2]),"options.key must be a sshpk.PrivateKey"),this.rs_key=r,d.string(e.keyId,"options.keyId"),this.rs_keyId=e.keyId,!_[r.type])throw new w(r.type.toUpperCase()+" type keys are not supported");if(void 0!==t[0]&&r.type!==t[0])throw new w("options.key must be a "+t[0].toUpperCase()+" key, was given a "+r.type.toUpperCase()+" key instead");this.rs_signer=r.createSign(t[1])}this.rs_headers=[],this.rs_lines=[]}e.inherits(S,r),e.inherits(j,r),i.prototype.writeHeader=function(e,t){if(d.string(e,"header"),e=e.toLowerCase(),d.string(t,"value"),this.rs_headers.push(e),this.rs_signFunc)this.rs_lines.push(e+": "+t);else{var r=e+": "+t;0>1,f=-7,p=r?n-1:0,h=r?-1:1,l=e[t+p];for(p+=h,a=l&(1<<-f)-1,l>>=-f,f+=s;0>=-f,f+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:a-1,d=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),2<=(t+=1<=o+p?h/c:h*Math.pow(2,1-p))*c&&(o++,c/=2),f<=o+p?(s=0,o=f):1<=o+p?(s=(t*c-1)*Math.pow(2,n),o+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,n),o=0));8<=n;e[r+l]=255&s,l+=d,s/=256,n-=8);for(o=o<>15;0<=--a;){var c=32767&this[e],u=this[e++]>>15,f=s*c+u*o;n=((c=o*c+((32767&f)<<15)+r[i]+(1073741823&n))>>>30)+(f>>>15)+s*u+(n>>>30),r[i++]=1073741823&c}return n},30):t&&"Netscape"!=navigator.appName?(y.prototype.am=function(e,t,r,i,n,a){for(;0<=--a;){var o=t*this[e++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},26):(y.prototype.am=function(e,t,r,i,n,a){for(var o=16383&t,s=t>>14;0<=--a;){var c=16383&this[e],u=this[e++]>>14,f=s*c+u*o;n=((c=o*c+((16383&f)<<14)+r[i]+n)>>28)+(f>>14)+s*u,r[i++]=268435455&c}return n},28),y.prototype.DB=e,y.prototype.DM=(1<>>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 v(e){this.m=e}function b(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 l(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function d(){}function m(e){return e}function k(e){this.r2=_(),this.q3=_(),y.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},b.prototype.convert=function(e){var t=_();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&0>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),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},b.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.copyTo=function(e){for(var t=this.t-1;0<=t;--t)e[t]=this[t];e.t=this.t,e.s=this.s},y.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0this.DB?(this[this.t-1]|=(o&(1<>this.DB-a):this[this.t-1]|=o<=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,0>n|s,s=(this[r]&a)<=this.t)t.t=0;else{var i=e%this.DB,n=this.DB-i,a=(1<>i;for(var o=r+1;o>i;0>=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:0=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}0>this.F2:0),h=this.FV/p,l=(1<>s)&&(n=!0,a=c(r));0<=o;)s>(s+=this.DB-t)):(r=this[o]>>(s-=t)&i,s<=0&&(s+=this.DB,--o)),02*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=_();return e.copyTo(t),this.reduce(t),t},k.prototype.revert=function(e){return e},k.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);0<=e.compareTo(this.m);)e.subTo(this.m,e)},k.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},k.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x,S,j,E=[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],A=(1<<26)/E[E.length-1];function I(){var e;e=(new Date).getTime(),S[j++]^=255&e,S[j++]^=e>>8&255,S[j++]^=e>>16&255,S[j++]^=e>>24&255,R<=j&&(j-=R)}if(y.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},y.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||36=r&&(this.dMultiply(i),this.dAddOffset(o,0),o=a=0))}0e&&this.subTo(y.ONE.shiftLeft(e-1),this);else{var i=new Array,n=7&e;i.length=1+(e>>3),t.nextBytes(i),0>=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,0=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},y.prototype.multiplyLowerTo=function(e,t,r){var i,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;0>1)>E.length&&(e=E.length);for(var n=_(),a=0;a>24},y.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},y.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},y.prototype.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(0>i)!=(this.s&this.DM)>>i&&(t[n++]=r|this.s<>(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,(0=this.t?0!=this.s:0!=(this[t]&1<>n-c&u:(p=(e[l]&(1<>this.DB+n-c)),s=r;0==(1&p);)p>>=1,--s;if((n-=s)<0&&(n+=this.DB,--l),d)o[p].copyTo(a),d=!1;else{for(;1>>8,S[j++]=255&P;j=0,I()}function B(){if(null==x){for(I(),(x=new F).init(S),j=0;jt.maxItems&&n("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&m.concat(function(e,t,r,i){if("object"==(void 0===t?"undefined":_typeof(t)))for(var n in("object"!=(void 0===e?"undefined":_typeof(e))||e instanceof Array)&&m.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(n)){var a=e[n];if(void 0===a&&h.existingOnly)continue;var o=t[n];void 0===a&&o.default&&(a=e[n]=o.default),h.coerce&&n in e&&(a=e[n]=h.coerce(a,o)),g(a,o,r,n)}for(n in e){if(e.hasOwnProperty(n)&&("_"!=n.charAt(0)||"_"!=n.charAt(1))&&t&&!t[n]&&!1===i){if(h.filter){delete e[n];continue}m.push({property:r,message:(void 0===a?"undefined":_typeof(a))+"The property "+n+" is not defined in the schema and the schema does not allow additional properties"})}var s=t&&t[n]&&t[n].requires;!s||s in e||m.push({property:r,message:"the presence of the property "+n+" requires that "+s+" also be present"}),a=e[n],!i||t&&"object"==(void 0===t?"undefined":_typeof(t))&&n in t||(h.coerce&&(a=e[n]=h.coerce(a,i)),g(a,i,r,n)),!l&&a&&a.$schema&&(m=m.concat(g(a,a.$schema,r,n)))}return m}(e,t.properties,o,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&n("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&n("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.lengthe&&n("must have a minimum value of "+t.minimum),void 0!==_typeof(t.maximum)&&(void 0===e?"undefined":_typeof(e))==_typeof(t.maximum)&&t.maximum= 2"),d.ok(n.base<=36,"options.base <= 36"),d.bool(n.allowSign,"options.allowSign"),d.bool(n.allowPrefix,"options.allowPrefix"),d.bool(n.allowTrailing,"options.allowTrailing"),d.bool(n.allowImprecise,"options.allowImprecise"),d.bool(n.trimWhitespace,"options.trimWhitespace"),d.bool(n.leadingZeroIsOctal,"options.leadingZeroIsOctal"),n.leadingZeroIsOctal&&d.ok(!i,'"base" and "leadingZeroIsOctal" are mutually exclusive'));var a,o=-1,s=n.base,c=1,u=0,f=0,p=e.length;if(n.trimWhitespace)for(;ft[0]||e[0]==t[0]&&e[1]>=t[1],"negative differences not allowed");var r=[e[0]-t[0],0];return e[1]>=t[1]?r[1]=e[1]-t[1]:(r[0]--,r[1]=1e9-(t[1]-e[1])),r}function R(e,t){return C(e),C(t),e[1]+=t[1],1e9<=e[1]&&(e[0]++,e[1]-=1e9),e[0]+=t[0],e}function z(e,t,r){var i,n;if(i={},r)for(n in r)i[n]=r[n];if(e)for(n in e)i[n]=e[n];if(t)for(n in t)i[n]=t[n];return i}},{"assert-plus":66,extsprintf:272,"json-schema":327,util:505,verror:509}],330:[function(e,t,r){"use strict";t.exports=e("./lib/api")(e("./lib/keccak"))},{"./lib/api":331,"./lib/keccak":335}],331:[function(e,t,r){"use strict";var n=e("./keccak"),a=e("./shake");t.exports=function(e){var r=n(e),i=a(e);return function(e,t){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new r(1152,448,null,224,t);case"keccak256":return new r(1088,512,null,256,t);case"keccak384":return new r(832,768,null,384,t);case"keccak512":return new r(576,1024,null,512,t);case"sha3-224":return new r(1152,448,6,224,t);case"sha3-256":return new r(1088,512,6,256,t);case"sha3-384":return new r(832,768,6,384,t);case"sha3-512":return new r(576,1024,6,512,t);case"shake128":return new i(1344,256,31,t);case"shake256":return new i(1088,512,31,t);default:throw new Error("Invald algorithm: "+e)}}}},{"./keccak":332,"./shake":333}],332:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,o=e("stream").Transform,n=e("inherits");t.exports=function(a){function t(e,t,r,i,n){o.call(this,n),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._hashBitLength=i,this._options=n,this._state=new a,this._state.initialize(e,t),this._finalized=!1}return n(t,o),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],333:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,a=e("stream").Transform,o=e("inherits");t.exports=function(n){function t(e,t,r,i){a.call(this,i),this._rate=e,this._capacity=t,this._delimitedSuffix=r,this._options=i,this._state=new n,this._state.initialize(e,t),this._finalized=!1}return o(t,a),t.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return i.isBuffer(e)||(e=i.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},{inherits:320,"safe-buffer":447,stream:482}],334:[function(e,t,r){"use strict";var ot=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];r.p1600=function(e){for(var t=0;t<24;++t){var r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],n=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],h=f^(n<<1|a>>>31),l=p^(a<<1|n>>>31),d=e[0]^h,m=e[1]^l,g=e[10]^h,v=e[11]^l,b=e[20]^h,y=e[21]^l,_=e[30]^h,w=e[31]^l,k=e[40]^h,x=e[41]^l;h=r^(o<<1|s>>>31),l=i^(s<<1|o>>>31);var S=e[2]^h,j=e[3]^l,E=e[12]^h,A=e[13]^l,I=e[22]^h,P=e[23]^l,O=e[32]^h,T=e[33]^l,B=e[42]^h,C=e[43]^l;h=n^(c<<1|u>>>31),l=a^(u<<1|c>>>31);var F=e[4]^h,R=e[5]^l,z=e[14]^h,M=e[15]^l,D=e[24]^h,N=e[25]^l,q=e[34]^h,L=e[35]^l,U=e[44]^h,H=e[45]^l;h=o^(f<<1|p>>>31),l=s^(p<<1|f>>>31);var K=e[6]^h,V=e[7]^l,G=e[16]^h,$=e[17]^l,W=e[26]^h,Z=e[27]^l,Y=e[36]^h,X=e[37]^l,J=e[46]^h,Q=e[47]^l;h=c^(r<<1|i>>>31),l=u^(i<<1|r>>>31);var ee=e[8]^h,te=e[9]^l,re=e[18]^h,ie=e[19]^l,ne=e[28]^h,ae=e[29]^l,oe=e[38]^h,se=e[39]^l,ce=e[48]^h,ue=e[49]^l,fe=d,pe=m,he=v<<4|g>>>28,le=g<<4|v>>>28,de=b<<3|y>>>29,me=y<<3|b>>>29,ge=w<<9|_>>>23,ve=_<<9|w>>>23,be=k<<18|x>>>14,ye=x<<18|k>>>14,_e=S<<1|j>>>31,we=j<<1|S>>>31,ke=A<<12|E>>>20,xe=E<<12|A>>>20,Se=I<<10|P>>>22,je=P<<10|I>>>22,Ee=T<<13|O>>>19,Ae=O<<13|T>>>19,Ie=B<<2|C>>>30,Pe=C<<2|B>>>30,Oe=R<<30|F>>>2,Te=F<<30|R>>>2,Be=z<<6|M>>>26,Ce=M<<6|z>>>26,Fe=N<<11|D>>>21,Re=D<<11|N>>>21,ze=q<<15|L>>>17,Me=L<<15|q>>>17,De=H<<29|U>>>3,Ne=U<<29|H>>>3,qe=K<<28|V>>>4,Le=V<<28|K>>>4,Ue=$<<23|G>>>9,He=G<<23|$>>>9,Ke=W<<25|Z>>>7,Ve=Z<<25|W>>>7,Ge=Y<<21|X>>>11,$e=X<<21|Y>>>11,We=Q<<24|J>>>8,Ze=J<<24|Q>>>8,Ye=ee<<27|te>>>5,Xe=te<<27|ee>>>5,Je=re<<20|ie>>>12,Qe=ie<<20|re>>>12,et=ae<<7|ne>>>25,tt=ne<<7|ae>>>25,rt=oe<<8|se>>>24,it=se<<8|oe>>>24,nt=ce<<14|ue>>>18,at=ue<<14|ce>>>18;e[0]=fe^~ke&Fe,e[1]=pe^~xe&Re,e[10]=qe^~Je&de,e[11]=Le^~Qe&me,e[20]=_e^~Be&Ke,e[21]=we^~Ce&Ve,e[30]=Ye^~he&Se,e[31]=Xe^~le&je,e[40]=Oe^~Ue&et,e[41]=Te^~He&tt,e[2]=ke^~Fe&Ge,e[3]=xe^~Re&$e,e[12]=Je^~de&Ee,e[13]=Qe^~me&Ae,e[22]=Be^~Ke&rt,e[23]=Ce^~Ve&it,e[32]=he^~Se&ze,e[33]=le^~je&Me,e[42]=Ue^~et&ge,e[43]=He^~tt&ve,e[4]=Fe^~Ge&nt,e[5]=Re^~$e&at,e[14]=de^~Ee&De,e[15]=me^~Ae&Ne,e[24]=Ke^~rt&be,e[25]=Ve^~it&ye,e[34]=Se^~ze&We,e[35]=je^~Me&Ze,e[44]=et^~ge&Ie,e[45]=tt^~ve&Pe,e[6]=Ge^~nt&fe,e[7]=$e^~at&pe,e[16]=Ee^~De&qe,e[17]=Ae^~Ne&Le,e[26]=rt^~be&_e,e[27]=it^~ye&we,e[36]=ze^~We&Ye,e[37]=Me^~Ze&Xe,e[46]=ge^~Ie&Oe,e[47]=ve^~Pe&Te,e[8]=nt^~fe&ke,e[9]=at^~pe&xe,e[18]=De^~qe&Je,e[19]=Ne^~Le&Qe,e[28]=be^~_e&Be,e[29]=ye^~we&Ce,e[38]=We^~Ye&he,e[39]=Ze^~Xe&le,e[48]=Ie^~Oe&Ue,e[49]=Pe^~Te&He,e[0]^=ot[2*t],e[1]^=ot[2*t+1]}}},{}],335:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=e("./keccak-state-unroll");function a(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}a.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},a.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},a.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},t.exports=a},{"./keccak-state-unroll":334,"safe-buffer":447}],336:[function(e,t,r){var i=e("./_root").Symbol;t.exports=i},{"./_root":341}],337:[function(e,t,r){var i=e("./_Symbol"),n=e("./_getRawTag"),a=e("./_objectToString"),o=i?i.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):a(e)}},{"./_Symbol":336,"./_getRawTag":339,"./_objectToString":340}],338:[function(e,r,t){(function(e){var t="object"==(void 0===e?"undefined":_typeof(e))&&e&&e.Object===Object&&e;r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],339:[function(e,t,r){var i=e("./_Symbol"),n=Object.prototype,a=n.hasOwnProperty,o=n.toString,s=i?i.toStringTag:void 0;t.exports=function(e){var t=a.call(e,s),r=e[s];try{var i=!(e[s]=void 0)}catch(e){}var n=o.call(e);return i&&(t?e[s]=r:delete e[s]),n}},{"./_Symbol":336}],340:[function(e,t,r){var i=Object.prototype.toString;t.exports=function(e){return i.call(e)}},{}],341:[function(e,t,r){var i=e("./_freeGlobal"),n="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,a=i||n||Function("return this")();t.exports=a},{"./_freeGlobal":338}],342:[function(e,t,r){var i=Array.isArray;t.exports=i},{}],343:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isObject");t.exports=function(e){if(!n(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},{"./_baseGetTag":337,"./isObject":344}],344:[function(e,t,r){t.exports=function(e){var t=void 0===e?"undefined":_typeof(e);return null!=e&&("object"==t||"function"==t)}},{}],345:[function(e,t,r){t.exports=function(e){return null!=e&&"object"==(void 0===e?"undefined":_typeof(e))}},{}],346:[function(e,t,r){var i=e("./_baseGetTag"),n=e("./isArray"),a=e("./isObjectLike");t.exports=function(e){return"string"==typeof e||!n(e)&&a(e)&&"[object String]"==i(e)}},{"./_baseGetTag":337,"./isArray":342,"./isObjectLike":345}],347:[function(e,t,r){t.exports=function(e){return void 0===e}},{}],348:[function(e,t,r){"use strict";var i=e("inherits"),n=e("hash-base"),a=e("safe-buffer").Buffer,o=new Array(16);function s(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,r,i,n,a,o){return c(e+(t&r|~t&i)+n+a|0,o)+t|0}function f(e,t,r,i,n,a,o){return c(e+(t&i|r&~i)+n+a|0,o)+t|0}function p(e,t,r,i,n,a,o){return c(e+(t^r^i)+n+a|0,o)+t|0}function h(e,t,r,i,n,a,o){return c(e+(r^(t|~i))+n+a|0,o)+t|0}i(s,n),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,a=this._d;i=h(i=h(i=h(i=h(i=p(i=p(i=p(i=p(i=f(i=f(i=f(i=f(i=u(i=u(i=u(i=u(i,n=u(n,a=u(a,r=u(r,i,n,a,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),a,r,e[3],3250441966,22),n=u(n,a=u(a,r=u(r,i,n,a,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),a,r,e[7],4249261313,22),n=u(n,a=u(a,r=u(r,i,n,a,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),a,r,e[11],2304563134,22),n=u(n,a=u(a,r=u(r,i,n,a,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),a,r,e[15],1236535329,22),n=f(n,a=f(a,r=f(r,i,n,a,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),a,r,e[0],3921069994,20),n=f(n,a=f(a,r=f(r,i,n,a,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),a,r,e[4],3889429448,20),n=f(n,a=f(a,r=f(r,i,n,a,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),a,r,e[8],1163531501,20),n=f(n,a=f(a,r=f(r,i,n,a,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),a,r,e[12],2368359562,20),n=p(n,a=p(a,r=p(r,i,n,a,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),a,r,e[14],4259657740,23),n=p(n,a=p(a,r=p(r,i,n,a,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),a,r,e[10],3200236656,23),n=p(n,a=p(a,r=p(r,i,n,a,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),a,r,e[6],76029189,23),n=p(n,a=p(a,r=p(r,i,n,a,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),a,r,e[2],3299628645,23),n=h(n,a=h(a,r=h(r,i,n,a,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),a,r,e[5],4237533241,21),n=h(n,a=h(a,r=h(r,i,n,a,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),a,r,e[1],2240044497,21),n=h(n,a=h(a,r=h(r,i,n,a,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),a,r,e[13],1309151649,21),n=h(n,a=h(a,r=h(r,i,n,a,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),a,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+a|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,56>8,o=255&n;a?r.push(a,o):r.push(o)}return r},i.zero2=n,i.toHex=a,i.encode=function(e,t){return"hex"===t?a(e):e}},{}],355:[function(e,t,r){(t.exports=o).Minimatch=n;var u={sep:"/"};try{u=e("path")}catch(e){}var z=o.GLOBSTAR=n.GLOBSTAR={},i=e("brace-expansion"),M={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},D="[^/]*?",N="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{});var f=/\/+/;function a(t,r){t=t||{},r=r||{};var i={};return Object.keys(r).forEach(function(e){i[e]=r[e]}),Object.keys(t).forEach(function(e){i[e]=t[e]}),i}function o(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new n(t,r).match(e))}function n(e,t){if(!(this instanceof n))return new n(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==u.sep&&(e=e.split(u.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function s(e,t){if(t||(t=this instanceof n?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:i(e)}o.filter=function(i,n){return n=n||{},function(e,t,r){return o(e,i,n)}},o.defaults=function(i){if(!i||!Object.keys(i).length)return o;var n=o,e=function(e,t,r){return n.minimatch(e,t,a(i,r))};return e.Minimatch=function(e,t){return new n.Minimatch(e,a(i,t))},e},n.defaults=function(e){return e&&Object.keys(e).length?o.defaults(e).Minimatch:n},n.prototype.debug=function(){},n.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(f)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r},n.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=this.options,i=0;if(r.nonegate)return;for(var n=0,a=e.length;n>> no match, partial?",e,p,t,h),p!==o))}if("string"==typeof u?(c=i.nocase?f.toLowerCase()===u.toLowerCase():f===u,this.debug("string match",u,f,c)):(c=f.match(u),this.debug("pattern match",u,f,c)),!c)return!1}if(n===o&&a===s)return!0;if(n===o)return r;if(a===s)return n===o-1&&""===e[n];throw new Error("wtf?")}},{"brace-expansion":155,path:374}],356:[function(e,t,r){var c=e("crypto");function o(e,t,r){return c.createHmac(r,e).update(t).digest("base64")}function s(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function n(e,t){return t>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var n=s,a=i+r;e^=-1;for(var o=i;o>>8^n[255&(e^t[o])];return-1^e}},{}],362:[function(e,t,r){"use strict";var c,h=e("../utils/common"),u=e("./trees"),l=e("./adler32"),d=e("./crc32"),i=e("./messages"),f=0,p=4,m=0,g=-2,v=-1,b=4,n=2,y=8,_=9,a=286,o=30,s=19,w=2*a+1,k=15,x=3,S=258,j=S+x+1,E=42,A=113,I=1,P=2,O=3,T=4;function B(e,t){return e.msg=i[t],t}function C(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(h.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function z(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,R(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function D(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function N(e,t){var r,i,n=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-j?e.strstart-(e.w_size-j):0,u=e.window,f=e.w_mask,p=e.prev,h=e.strstart+S,l=u[a+o-1],d=u[a+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===d&&u[r+o-1]===l&&u[r]===u[a]&&u[++r]===u[a+1]){a+=2,r++;do{}while(u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&u[++a]===u[++r]&&ac&&0!=--n);return o<=e.lookahead?o:e.lookahead}function q(e){var t,r,i,n,a,o,s,c,u,f,p=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-j)){for(h.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;i=e.head[--t],e.head[t]=p<=i?i-p:0,--r;);for(t=r=p;i=e.prev[--t],e.prev[t]=p<=i?i-p:0,--r;);n+=p}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,c=e.strstart+e.lookahead,u=n,f=void 0,f=o.avail_in,u=x)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(i=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(n=e.strstart+e.lookahead-x,i=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=n&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(q(e),0===e.lookahead&&t===f)return I;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,z(e,!1),0===e.strm.avail_out))return I;if(e.strstart-e.block_start>=e.w_size-j&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):(e.strstart>e.block_start&&(z(e,!1),e.strm.avail_out),I)}),new H(4,4,8,4,L),new H(4,5,16,8,L),new H(4,6,32,32,L),new H(4,4,16,16,U),new H(8,16,32,32,U),new H(8,16,128,128,U),new H(8,32,128,256,U),new H(32,128,258,1024,U),new H(32,258,258,4096,U)],r.deflateInit=function(e,t){return $(e,t,y,15,8,0)},r.deflateInit2=$,r.deflateReset=G,r.deflateResetKeep=V,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,m):g},r.deflate=function(e,t){var r,i,n,a;if(!e||!e.state||5>8&255),M(i,i.gzhead.time>>16&255),M(i,i.gzhead.time>>24&255),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(M(i,255&i.gzhead.extra.length),M(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=d(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(M(i,0),M(i,0),M(i,0),M(i,0),M(i,0),M(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),M(i,3),i.status=A);else{var o=y+(i.w_bits-8<<4)<<8;o|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(o|=32),o+=31-o%31,i.status=A,D(i,o),0!==i.strstart&&(D(i,e.adler>>>16),D(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending!==i.pending_buf_size));)M(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),R(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}M(i,a=i.gzindexn&&(e.adler=d(e.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&R(e),i.pending+2<=i.pending_buf_size&&(M(i,255&e.adler),M(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(R(e),0===e.avail_out)return i.last_flush=-1,m}else if(0===e.avail_in&&C(t)<=C(r)&&t!==p)return B(e,-5);if(666===i.status&&0!==e.avail_in)return B(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==f&&666!==i.status){var s=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(q(e),0===e.lookahead)){if(t===f)return I;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):3===i.strategy?function(e,t){for(var r,i,n,a,o=e.window;;){if(e.lookahead<=S){if(q(e),e.lookahead<=S&&t===f)return I;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(z(e,!1),0===e.strm.avail_out))return I}return e.insert=0,t===p?(z(e,!0),0===e.strm.avail_out?O:T):e.last_lit&&(z(e,!1),0===e.strm.avail_out)?I:P}(i,t):c[i.level].func(i,t);if(s!==O&&s!==T||(i.status=666),s===I||s===O)return 0===e.avail_out&&(i.last_flush=-1),m;if(s===P&&(1===t?u._tr_align(i):5!==t&&(u._tr_stored_block(i,0,0,!1),3===t&&(F(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),R(e),0===e.avail_out))return i.last_flush=-1,m}return t!==p?m:i.wrap<=0?1:(2===i.wrap?(M(i,255&e.adler),M(i,e.adler>>8&255),M(i,e.adler>>16&255),M(i,e.adler>>24&255),M(i,255&e.total_in),M(i,e.total_in>>8&255),M(i,e.total_in>>16&255),M(i,e.total_in>>24&255)):(D(i,e.adler>>>16),D(i,65535&e.adler)),R(e),0=r.w_size&&(0===a&&(F(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new h.Buf8(r.w_size),h.arraySet(u,t,f-r.w_size,r.w_size,0),t=u,f=r.w_size),o=e.avail_in,s=e.next_in,c=e.input,e.avail_in=f,e.next_in=0,e.input=t,q(r);r.lookahead>=x;){for(i=r.strstart,n=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=_=y>>>24,d-=_,0===(_=y>>>16&255))E[a++]=65535&y;else{if(!(16&_)){if(0==(64&_)){y=m[(65535&y)+(l&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&y,(_&=15)&&(d<_&&(l+=j[i++]<>>=_,d-=_),d<15&&(l+=j[i++]<>>=_=y>>>24,d-=_,!(16&(_=y>>>16&255))){if(0==(64&_)){y=g[(65535&y)+(l&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&y,d<(_&=15)&&(l+=j[i++]<>>=_,d-=_,(_=a-o)>3,l&=(1<<(d-=w<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new P.Buf16(320),this.work=new P.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=D,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new P.Buf32(i),t.distcode=t.distdyn=new P.Buf32(n),t.sane=1,t.back=-1,z):M}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):M}function c(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=a.wsize?(P.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(n=a.wsize-a.wnext)&&(n=i),P.arraySet(a.window,t,r-i,n,a.wnext),(i-=n)?(P.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=T(r.check,A,2,0),f=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(f-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=3;case 3:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>8&255,A[2]=u>>>16&255,A[3]=u>>>24&255,r.check=T(r.check,A,4,0)),f=u=0,r.mode=4;case 4:for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>8),512&r.flags&&(A[0]=255&u,A[1]=u>>>8&255,r.check=T(r.check,A,2,0)),f=u=0,r.mode=5;case 5:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,u+=i[a++]<>>8&255,r.check=T(r.check,A,2,0)),f=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(s<(l=r.length)&&(l=s),l&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),P.arraySet(r.head.extra,i,a,l,k)),512&r.flags&&(r.check=T(r.check,i,l,a)),s-=l,a+=l,r.length-=l),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;for(l=0;k=i[a+l++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&l>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;f<32;){if(0===s)break e;s--,u+=i[a++]<>>=7&f,f-=7&f,r.mode=27;break}for(;f<3;){if(0===s)break e;s--,u+=i[a++]<>>=1)){case 0:r.mode=14;break;case 1:if(q(r),r.mode=20,6!==t)break;u>>>=2,f-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}u>>>=2,f-=2;break;case 14:for(u>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,u+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,f=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(l=r.length){if(s>>=5,f-=5,r.ndist=1+(31&u),u>>>=5,f-=5,r.ncode=4+(15&u),u>>>=4,f-=4,286>>=3,f-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=C(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=g,f-=g,r.lens[r.have++]=b;else{if(16===b){for(j=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],l=3+(3&u),u>>>=2,f-=2}else if(17===b){for(j=g+3;f>>=g)),u>>>=3,f-=3}else{for(j=g+7;f>>=g)),u>>>=7,f-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;l--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=C(F,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=C(R,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=s&&258<=c){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,r.hold=u,r.bits=f,B(e,h),o=e.next_out,n=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,u=r.hold,f=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;v=(E=r.lencode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,r.length=b,0===v){r.mode=26;break}if(32&v){r.back=-1,r.mode=12;break}if(64&v){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&v,r.mode=22;case 22:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=(E=r.distcode[u&(1<>>16&255,b=65535&E,!((g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>y)])>>>16&255,b=65535&E,!(y+(g=E>>>24)<=f);){if(0===s)break e;s--,u+=i[a++]<>>=y,f-=y,r.back+=y}if(u>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&v,r.mode=24;case 24:if(r.extra){for(j=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===c)break e;if(l=h-c,r.offset>l){if((l=r.offset-l)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d=l>r.wnext?(l-=r.wnext,r.wsize-l):r.wnext-l,l>r.length&&(l=r.length),m=r.window}else m=n,d=o-r.offset,l=r.length;for(cl?(m=B[C+o[y]],I[P+o[y]]):(m=96,0),c=1<>S)+(u-=c)]=d<<24|m<<16|g|0,0!==u;);for(c=1<>=1;if(0!==c?(A&=c-1,A+=c):A=0,y++,0==--O[b]){if(b===w)break;b=t[r+o[y]]}if(k>>7)]}function M(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function D(e,t,r){e.bi_valid>n-r?(e.bi_buf|=t<>n-e.bi_valid,e.bi_valid+=r-n):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function L(e,t,r){var i,n,a=new Array(v+1),o=0;for(i=1;i<=v;i++)a[i]=o=o+r[i-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=q(a[s]++,s))}}function U(e){var t;for(t=0;t>1;1<=r;r--)V(e,a,r);for(n=c;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],V(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,a[2*n]=a[2*r]+a[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,a[2*r+1]=a[2*i+1]=n,e.heap[1]=n++,V(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,n,a,o,s,c=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,p=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(a=0;a<=v;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return s;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return u;for(t=32;t>>3,(a=e.static_len+3+7>>>3)<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==t?X(e,t,r,i):4===e.strategy||a===n?(D(e,2+(i?1:0),3),G(e,E,A)):(D(e,4+(i?1:0),3),function(e,t,r,i){var n;for(D(e,t-257,5),D(e,r-1,5),D(e,i-4,4),n=0;n>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(P[r]+p+1)]++,e.dyn_dtree[2*z(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;D(e,2,3),N(e,b,E),16===(t=e).bi_valid?(M(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":358}],368:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],369:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],370:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var a=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=a;var o=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=o;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=u;var f=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=f,r.DSAparam=i.define("DSAparam",function(){this.int()});var p=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=p;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":371,"asn1.js":46}],371:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),a=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),c=i.define("RelativeDistinguishedName",function(){this.setof(a)}),u=i.define("RDNSequence",function(){this.seqof(c)}),f=i.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),p=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(f),this.key("validity").use(p),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),d=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=d},{"asn1.js":46}],372:[function(e,t,r){(function(h){var l=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,d=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m,m=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,g=e("evp_bytestokey"),v=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(l);if(n){var a="aes"+n[1],o=new h(n[2],"hex"),s=new h(n[3].replace(/[\r\n]/g,""),"base64"),c=g(t,o.slice(0,8),parseInt(n[1],10)).key,u=[],f=v.createDecipheriv(a,c,o);u.push(f.update(s)),u.push(f.final()),r=h.concat(u)}else{var p=i.match(m);r=new h(p[2].replace(/[\r\n]/g,""),"base64")}return{tag:i.match(d)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":160,buffer:191,evp_bytestokey:270}],373:[function(t,r,e){(function(b){var y=t("./asn1"),_=t("./aesid.json"),w=t("./fixProc"),k=t("browserify-aes"),x=t("pbkdf2");function e(e){var t;"object"!==(void 0===e?"undefined":_typeof(e))||b.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new b(e));var r,i,n,a,o,s,c,u,f,p,h,l,d,m=w(e,t),g=m.tag,v=m.data;switch(g){case"CERTIFICATE":i=y.certificate.decode(v,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=y.PublicKey.decode(v,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=y.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"ENCRYPTED PRIVATE KEY":v=y.EncryptedPrivateKey.decode(v,"der"),a=t,o=(n=v).algorithm.decrypt.kde.kdeparams.salt,s=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=_[n.algorithm.decrypt.cipher.algo.join(".")],u=n.algorithm.decrypt.cipher.iv,f=n.subjectPrivateKey,p=parseInt(c.split("-")[1],10)/8,h=x.pbkdf2Sync(a,o,s,p),l=k.createDecipheriv(c,h,u),(d=[]).push(l.update(f)),d.push(l.final()),v=b.concat(d);case"PRIVATE KEY":switch(r=(i=y.PrivateKey.decode(v,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return y.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:y.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=y.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+g);case"RSA PUBLIC KEY":return y.RSAPublicKey.decode(v,"der");case"RSA PRIVATE KEY":return y.RSAPrivateKey.decode(v,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:y.DSAPrivateKey.decode(v,"der")};case"EC PRIVATE KEY":return{curve:(v=y.ECPrivateKey.decode(v,"der")).parameters.value,privateKey:v.privateKey};default:throw new Error("unknown key type "+g)}}(r.exports=e).signature=y.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":369,"./asn1":370,"./fixProc":372,"browserify-aes":160,buffer:191,pbkdf2:375}],374:[function(e,t,u){(function(n){function a(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function o(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;ia?t=n(t):t.length "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+o+";","var res;","switch (argLength) {",r.concat(["extra"]).map(function(e,t){return"case "+t+":res = fn.call("+["self"].concat(r.slice(0,t)).concat("cb").join(",")+");break;"}).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],n)(a,e)}(e)};var o="function (err, res) {if (err) { rj(err); } else { rs(res); }}";a.nodeify=function(r){return function(){var e=Array.prototype.slice.call(arguments),t="function"==typeof e[e.length-1]?e.pop():null,i=this;try{return r.apply(this,arguments).nodeify(t,i)}catch(r){if(null==t)return new a(function(e,t){t(r)});n(function(){t.call(i,r)})}}},a.prototype.nodeify=function(t,r){if("function"!=typeof t)return this;this.then(function(e){n(function(){t.call(r,null,e)})},function(e){n(function(){t.call(r,e)})})}},{"./core.js":384,asap:44}],390:[function(e,t,r){"use strict";var i=e("./core.js");(t.exports=i).enableSynchronous=function(){i.prototype.isPending=function(){return 0==this.getState()},i.prototype.isFulfilled=function(){return 1==this.getState()},i.prototype.isRejected=function(){return 2==this.getState()},i.prototype.getValue=function(){if(3===this._65)return this._55.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._55},i.prototype.getReason=function(){if(3===this._65)return this._55.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._55},i.prototype.getState=function(){return 3===this._65?this._55.getState():-1===this._65||-2===this._65?0:this._65}},i.disableSynchronous=function(){i.prototype.isPending=void 0,i.prototype.isFulfilled=void 0,i.prototype.isRejected=void 0,i.prototype.getValue=void 0,i.prototype.getReason=void 0,i.prototype.getState=void 0}},{"./core.js":384}],391:[function(e,t,r){"use strict";var n=function(e){for(var t=e.toString(16);4!==t.length;)t="0"+t;return"\\u"+t};t.exports=function(e,t,r,i){return!r.key||61!==t&&58!==t&&t!==r.separator?31o||0<=new u(t).cmp(a.modulus))throw new Error("decryption error");n=r?d(new u(t),a):h(t,a);var s=m.alloc(o-n.length);if(n=m.concat([s,n],o),4===i)return function(e,t){var r=e.modulus.byteLength(),i=l("sha1").update(m.alloc(0)).digest(),n=i.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,n+1),o=t.slice(n+1),s=p(a,f(o,n)),c=p(o,f(s,r-n-1));if(function(e,t){e=m.from(e),t=m.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){a++;break}var o=t.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&a++;o.length<8&&a++;if(a)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}},{"./mgf":401,"./withPublic":404,"./xor":405,"bn.js":154,"browserify-rsa":178,"create-hash":200,"parse-asn1":373,"safe-buffer":447}],403:[function(e,t,r){var o=e("parse-asn1"),h=e("randombytes"),l=e("create-hash"),d=e("./mgf"),m=e("./xor"),g=e("bn.js"),s=e("./withPublic"),c=e("browserify-rsa"),v=e("safe-buffer").Buffer;t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,a=o(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=l("sha1").update(v.alloc(0)).digest(),a=n.length,o=2*a;if(r-o-2>6]+a[128|63&n]:n<55296||57344<=n?r+=a[224|n>>12]+a[128|n>>6&63]+a[128|63&n]:(i+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),r+=a[240|n>>18]+a[128|n>>12&63]+a[128|n>>6&63]+a[128|63&n])}return r},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function i(r,n,a){if(!n)return r;if("object"!==(void 0===n?"undefined":_typeof(n))){if(Array.isArray(r))r.push(n);else{if("object"!==(void 0===r?"undefined":_typeof(r)))return[r,n];(a.plainObjects||a.allowPrototypes||!o.call(Object.prototype,n))&&(r[n]=!0)}return r}if("object"!==(void 0===r?"undefined":_typeof(r)))return[r].concat(n);var e=r;return Array.isArray(r)&&!Array.isArray(n)&&(e=s(r,a)),Array.isArray(r)&&Array.isArray(n)?(n.forEach(function(e,t){o.call(r,t)?r[t]&&"object"===_typeof(r[t])?r[t]=i(r[t],e,a):r.push(e):r[t]=e}),r):Object.keys(n).reduce(function(e,t){var r=n[t];return o.call(e,t)?e[t]=i(e[t],r,a):e[t]=r,e},e)}}},{}],411:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var a=/\+/g;e=e.split(t);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var s,c,u=e.length;0t.highWaterMark&&(t.highWaterMark=(m<=(r=e)?r=m:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var r}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(_("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?v.nextTick(x,e):x(e))}function x(e){_("emit readable"),e.emit("readable"),I(e)}function S(e,t){t.readingMore||(t.readingMore=!0,v.nextTick(j,e,t))}function j(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;ea.length?a.length:e;if(o===a.length?n+=a:n+=a.slice(0,e),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=a.slice(o);break}++i}return t.length-=i,n}(e,t):function(e,t){var r=u.allocUnsafe(e),i=t.head,n=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i).data=a.slice(o);break}++n}return t.length-=n,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return _("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):k(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&O(this),null;var i,n=t.needReadable;return _("need readable",n),(0===t.length||t.length-e>>0),a=this.head,o=0;a;)t=a.data,r=n,i=o,t.copy(r,i),o+=a.data.length,a=a.next;return n},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":447,util:157}],423:[function(e,t,r){"use strict";var a=e("process-nextick-args");function o(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a.nextTick(o,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(o,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":381}],424:[function(e,t,r){t.exports=e("events").EventEmitter},{events:269}],425:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":426}],426:[function(e,t,r){(((r=t.exports=e("./lib/_stream_readable.js")).Stream=r).Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":417,"./lib/_stream_passthrough.js":418,"./lib/_stream_readable.js":419,"./lib/_stream_transform.js":420,"./lib/_stream_writable.js":421}],427:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":426}],428:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":421}],429:[function(e,t,r){"use strict";var s=e("../"),c=e("lodash/isArray"),u=e("lodash/isFunction"),f=e("lodash/isObjectLike");t.exports=function(e){var t="Please verify options";if(!f(e))throw new TypeError(t);if(!u(e.request))throw new TypeError(t+".request");if(!c(e.expose)||0===e.expose.length)throw new TypeError(t+".expose");for(var r=s({PromiseImpl:e.PromiseImpl,constructorMixin:e.constructorMixin}),i=e.request.Request.prototype.init,n=!(e.request.Request.prototype.init=function(e){return!f(e)||this._callback||this._rp_promise||r.init.call(this,e),i.apply(this,arguments)}),a=0;a=t.maxRedirects)return r.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+r.uri.href)),!1;t.redirectsFollowed+=1,o.test(i)||(i=a.resolve(r.uri.href,i));var n=r.uri;return r.uri=a.parse(i),r.uri.protocol!==n.protocol&&delete r.agent,t.redirects.push({statusCode:e.statusCode,redirectUri:i}),t.followAllRedirects&&"HEAD"!==r.method&&401!==e.statusCode&&307!==e.statusCode&&(r.method=t.followOriginalHttpMethod?r.method:"GET"),delete r.src,delete r.req,delete r._started,401!==e.statusCode&&307!==e.statusCode&&(delete r.body,delete r._form,r.headers&&(r.removeHeader("host"),r.removeHeader("content-type"),r.removeHeader("content-length"),r.uri.hostname!==r.originalHost.split(":")[0]&&r.removeHeader("authorization"))),t.removeRefererHeader||r.setHeader("referer",n.href),r.emit("redirect"),r.init(),!0},r.Redirect=i},{url:500}],444:[function(e,t,r){"use strict";var w=e("url"),k=e("tunnel-agent"),i=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],x=["proxy-authorization"];function n(e){this.request=e,this.proxyHeaderWhiteList=i,this.proxyHeaderExclusiveList=[],void 0!==e.tunnel&&(this.tunnelOverride=e.tunnel)}n.prototype.isEnabled=function(){var e=this.request;return void 0!==this.tunnelOverride?this.tunnelOverride:"https:"===e.uri.protocol},n.prototype.setup=function(e){var t=this.request;if(e=e||{},"string"==typeof t.proxy&&(t.proxy=w.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(this.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(this.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var r,i,n,a,o,s,c=this.proxyHeaderExclusiveList.concat(x),u=this.proxyHeaderWhiteList.concat(c),f=(r=t.headers,i=u.reduce(function(e,t){return e[t.toLowerCase()]=!0,e},{}),Object.keys(r).filter(function(e){return i[e.toLowerCase()]}).reduce(function(e,t){return e[t]=r[t],e},{}));f.host=(n=t.uri,a=n.port,o=n.protocol,s=n.hostname+":",s+=a||("https:"===o?"443":"80")),c.forEach(t.removeHeader,t);var p,h,l,d,m,g,v,b,y=(l=(p=t).uri,d=p.proxy,h=d,m=["https:"===l.protocol?"https":"http","https:"===h.protocol?"Https":"Http"].join("Over"),k[m]),_=(v=f,{proxy:{host:(b=(g=t).proxy).hostname,port:+b.port,proxyAuth:b.auth,headers:v},headers:g.headers,ca:g.ca,cert:g.cert,key:g.key,passphrase:g.passphrase,pfx:g.pfx,ciphers:g.ciphers,rejectUnauthorized:g.rejectUnauthorized,secureOptions:g.secureOptions,secureProtocol:g.secureProtocol});return t.agent=y(_),!0},n.defaultProxyHeaderWhiteList=i,n.defaultProxyHeaderExclusiveList=x,r.Tunnel=n},{"tunnel-agent":497,url:500}],445:[function(U,H,e){(function(e){"use strict";var w=U("http"),k=U("https"),x=U("url"),t=U("util"),n=U("stream"),f=U("zlib"),c=U("aws-sign2"),u=U("aws4"),i=U("http-signature"),S=U("mime-types"),j=U("caseless"),E=U("forever-agent"),r=U("form-data"),a=U("extend"),A=U("isstream"),I=U("is-typedarray").strict,o=U("./lib/helpers"),s=U("./lib/cookies"),P=U("./lib/getProxyFromURI"),p=U("./lib/querystring").Querystring,h=U("./lib/har").Har,l=U("./lib/auth").Auth,d=U("./lib/oauth").OAuth,m=U("./lib/hawk"),g=U("./lib/multipart").Multipart,v=U("./lib/redirect").Redirect,b=U("./lib/tunnel").Tunnel,y=U("performance-now"),O=U("safe-buffer").Buffer,_=o.safeStringify,T=o.isReadStream,B=o.toBase64,C=o.defer,F=o.copy,R=o.version,z=s.jar(),M={};function D(){return{uri:this.uri,method:this.method,headers:this.headers}}function N(){return{statusCode:this.statusCode,body:this.body,headers:this.headers,request:D.call(this.request)}}function q(e){var t=this;e.har&&(t._har=new h(t),e=t._har.options(e)),n.Stream.call(t);var r=Object.keys(q.prototype),i=function(e,t){var r={};for(var i in t)-1===e.indexOf(i)&&(r[i]=t[i]);return r}(r,e);a(t,i),e=function(e,t){var r={};for(var i in t){var n=!(-1===e.indexOf(i)),a="function"==typeof t[i];n&&a||(r[i]=t[i])}return r}(r,e),t.readable=!0,t.writable=!0,e.method&&(t.explicitMethod=!0),t._qs=new p(t),t._auth=new l(t),t._oauth=new d(t),t._multipart=new g(t),t._redirect=new v(t),t._tunnel=new b(t),t.init(e)}function L(){q.debug&&console.error("REQUEST %s",t.format.apply(t,arguments))}t.inherits(q,n.Stream),q.debug=e.env.NODE_DEBUG&&/\brequest\b/.test(e.env.NODE_DEBUG),q.prototype.debug=L,q.prototype.init=function(e){var i=this;for(var t in e||(e={}),i.headers=i.headers?F(i.headers):{},i.headers)void 0===i.headers[t]&&delete i.headers[t];if(j.httpify(i,i.headers),i.method||(i.method=e.method||"GET"),i.localAddress||(i.localAddress=e.localAddress),i._qs.init(e),L(e),i.pool||!1===i.pool||(i.pool=M),i.dests=i.dests||[],i.__isRequestRequest=!0,!i._callback&&i.callback&&(i._callback=i.callback,i.callback=function(){i._callbackCalled||(i._callbackCalled=!0,i._callback.apply(i,arguments))},i.on("error",i.callback.bind()),i.on("complete",i.callback.bind(i,null))),!i.uri&&i.url&&(i.uri=i.url,delete i.url),i.baseUrl){if("string"!=typeof i.baseUrl)return i.emit("error",new Error("options.baseUrl must be a string"));if("string"!=typeof i.uri)return i.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(0===i.uri.indexOf("//")||-1!==i.uri.indexOf("://"))return i.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var r=i.baseUrl.lastIndexOf("/")===i.baseUrl.length-1,n=0===i.uri.indexOf("/");r&&n?i.uri=i.baseUrl+i.uri.slice(1):r||n?i.uri=i.baseUrl+i.uri:""===i.uri?i.uri=i.baseUrl:i.uri=i.baseUrl+"/"+i.uri,delete i.baseUrl}if(!i.uri)return i.emit("error",new Error("options.uri is a required argument"));if("string"==typeof i.uri&&(i.uri=x.parse(i.uri)),i.uri.href||(i.uri.href=x.format(i.uri)),"unix:"===i.uri.protocol)return i.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if("unix"===i.uri.host&&i.enableUnixSocket(),!1===i.strictSSL&&(i.rejectUnauthorized=!1),i.uri.pathname||(i.uri.pathname="/"),!(i.uri.host||i.uri.hostname&&i.uri.port||i.uri.isUnix)){var a='Invalid URI "'+x.format(i.uri)+'"';return 0===Object.keys(e).length&&(a+=". This can be caused by a crappy redirection."),i.abort(),i.emit("error",new Error(a))}if(i.hasOwnProperty("proxy")||(i.proxy=P(i.uri)),i.tunnel=i._tunnel.isEnabled(),i.proxy&&i._tunnel.setup(e),i._redirect.onRequest(e),i.setHost=!1,!i.hasHeader("host")){var o=i.originalHostHeaderName||"host";i.setHeader(o,i.uri.host),i.uri.port&&("80"===i.uri.port&&"http:"===i.uri.protocol||"443"===i.uri.port&&"https:"===i.uri.protocol)&&i.setHeader(o,i.uri.hostname),i.setHost=!0}if(i.jar(i._jar||e.jar),i.uri.port||("http:"===i.uri.protocol?i.uri.port=80:"https:"===i.uri.protocol&&(i.uri.port=443)),i.proxy&&!i.tunnel?(i.port=i.proxy.port,i.host=i.proxy.hostname):(i.port=i.uri.port,i.host=i.uri.hostname),e.form&&i.form(e.form),e.formData){var s=e.formData,c=i.form(),u=function(e,t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?c.append(e,t.value,t.options):c.append(e,t)};for(var f in s)if(s.hasOwnProperty(f)){var p=s[f];if(p instanceof Array)for(var h=0;h>>32-t}function S(e,t,r,i,n,a,o,s){return x(e+(t^r^i)+a+o|0,s)+n|0}function j(e,t,r,i,n,a,o,s){return x(e+(t&r|~t&i)+a+o|0,s)+n|0}function E(e,t,r,i,n,a,o,s){return x(e+((t|~r)^i)+a+o|0,s)+n|0}function A(e,t,r,i,n,a,o,s){return x(e+(t&i|r&~i)+a+o|0,s)+n|0}function I(e,t,r,i,n,a,o,s){return x(e+(t^(r|~i))+a+o|0,s)+n|0}n(o,a),o.prototype._update=function(){for(var e=g,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,a=0|this._d,o=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,f=0|this._d,p=0|this._e,h=0;h<80;h+=1){var l,d;d=h<16?(l=S(r,i,n,a,o,e[v[h]],w[0],y[h]),I(s,c,u,f,p,e[b[h]],k[0],_[h])):h<32?(l=j(r,i,n,a,o,e[v[h]],w[1],y[h]),A(s,c,u,f,p,e[b[h]],k[1],_[h])):h<48?(l=E(r,i,n,a,o,e[v[h]],w[2],y[h]),E(s,c,u,f,p,e[b[h]],k[2],_[h])):h<64?(l=A(r,i,n,a,o,e[v[h]],w[3],y[h]),j(s,c,u,f,p,e[b[h]],k[3],_[h])):(l=I(r,i,n,a,o,e[v[h]],w[4],y[h]),S(s,c,u,f,p,e[b[h]],k[4],_[h])),r=o,o=a,a=x(n,10),n=i,i=l,s=p,p=f,f=x(u,10),u=c,c=d}var m=this._b+n+f|0;this._b=this._c+a+p|0,this._c=this._d+o+s|0,this._d=this._e+r+c|0,this._e=this._a+i+u|0,this._a=m},o.prototype._digest=function(){this._block[this._blockOffset++]=128,56=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 a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":447}],450:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":451,"./sha1":452,"./sha224":453,"./sha256":454,"./sha384":455,"./sha512":456}],451:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,v=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s=this._w,c=0|this._a,u=0|this._b,f=0|this._c,p=0|this._d,h=0|this._e,l=0;l<16;++l)s[l]=e.readInt32BE(4*l);for(;l<80;++l)s[l]=s[l-3]^s[l-8]^s[l-14]^s[l-16];for(var d=0;d<80;++d){var m=~~(d/20),g=0|((o=c)<<5|o>>>27)+(i=u,n=f,a=p,0===(r=m)?i&n|~i&a:2===r?i&n|i&a|n&a:i^n^a)+h+s[d]+v[m];h=p,p=f,f=(t=u)<<30|t>>>2,u=c,c=g}this._a=c+this._a|0,this._b=u+this._b|0,this._c=f+this._c|0,this._d=p+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],452:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0;d<16;++d)c[d]=e.readInt32BE(4*d);for(;d<80;++d)c[d]=(t=c[d-3]^c[d-8]^c[d-14]^c[d-16])<<1|t>>>31;for(var m=0;m<80;++m){var g=~~(m/20),v=0|((s=u)<<5|s>>>27)+(n=f,a=p,o=h,0===(i=g)?n&a|~n&o:2===i?n&a|n&o|a&o:n^a^o)+l+c[m]+b[g];l=h,h=p,p=(r=f)<<30|r>>>2,f=u,u=v}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],453:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}i(c,n),c.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},c.prototype._hash=function(){var e=o.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},t.exports=c},{"./hash":449,"./sha256":454,inherits:320,"safe-buffer":447}],454:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,w=[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],o=new Array(64);function s(){this.init(),this._w=o,n.call(this,64,56)}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c=this._w,u=0|this._a,f=0|this._b,p=0|this._c,h=0|this._d,l=0|this._e,d=0|this._f,m=0|this._g,g=0|this._h,v=0;v<16;++v)c[v]=e.readInt32BE(4*v);for(;v<64;++v)c[v]=0|(((r=c[v-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+c[v-7]+(((t=c[v-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+c[v-16];for(var b=0;b<64;++b){var y=g+(((s=l)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((o=m)^l&(d^o))+w[b]+c[b]|0,_=0|(((a=u)>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+((i=u)&(n=f)|p&(i|n));g=m,m=d,d=l,l=h+y|0,h=p,p=f,f=u,u=y+_|0}this._a=u+this._a|0,this._b=f+this._b|0,this._c=p+this._c|0,this._d=h+this._d|0,this._e=l+this._e|0,this._f=d+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},s.prototype._hash=function(){var e=a.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},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],455:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(160);function c(){this.init(),this._w=s,a.call(this,128,112)}i(c,n),c.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},c.prototype._hash=function(){var i=o.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=c},{"./hash":449,"./sha512":456,inherits:320,"safe-buffer":447}],456:[function(e,t,r){var i=e("inherits"),n=e("./hash"),a=e("safe-buffer").Buffer,ee=[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],o=new Array(160);function s(){this.init(),this._w=o,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ae(e,t){return e>>>0>>0?1:0}i(s,n),s.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},s.prototype._update=function(e){for(var t,r,i,n,a,o,s,c,u=this._w,f=0|this._ah,p=0|this._bh,h=0|this._ch,l=0|this._dh,d=0|this._eh,m=0|this._fh,g=0|this._gh,v=0|this._hh,b=0|this._al,y=0|this._bl,_=0|this._cl,w=0|this._dl,k=0|this._el,x=0|this._fl,S=0|this._gl,j=0|this._hl,E=0;E<32;E+=2)u[E]=e.readInt32BE(4*E),u[E+1]=e.readInt32BE(4*E+4);for(;E<160;E+=2){var A=u[E-30],I=u[E-30+1],P=((s=A)>>>1|(c=I)<<31)^(s>>>8|c<<24)^s>>>7,O=((a=I)>>>1|(o=A)<<31)^(a>>>8|o<<24)^(a>>>7|o<<25);A=u[E-4],I=u[E-4+1];var T=((i=A)>>>19|(n=I)<<13)^(n>>>29|i<<3)^i>>>6,B=((t=I)>>>19|(r=A)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),C=u[E-14],F=u[E-14+1],R=u[E-32],z=u[E-32+1],M=O+F|0,D=P+C+ae(M,O)|0;D=(D=D+T+ae(M=M+B|0,B)|0)+R+ae(M=M+z|0,z)|0,u[E]=D,u[E+1]=M}for(var N=0;N<160;N+=2){D=u[N],M=u[N+1];var q=re(f,p,h),L=re(b,y,_),U=ie(f,b),H=ie(b,f),K=ne(d,k),V=ne(k,d),G=ee[N],$=ee[N+1],W=te(d,m,g),Z=te(k,x,S),Y=j+V|0,X=v+K+ae(Y,j)|0;X=(X=(X=X+W+ae(Y=Y+Z|0,Z)|0)+G+ae(Y=Y+$|0,$)|0)+D+ae(Y=Y+M|0,M)|0;var J=H+L|0,Q=U+q+ae(J,H)|0;v=g,j=S,g=m,S=x,m=d,x=k,d=l+X+ae(k=w+Y|0,w)|0,l=h,w=_,h=p,_=y,p=f,y=b,f=X+Q+ae(b=Y+J|0,Y)|0}this._al=this._al+b|0,this._bl=this._bl+y|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+k|0,this._fl=this._fl+x|0,this._gl=this._gl+S|0,this._hl=this._hl+j|0,this._ah=this._ah+f+ae(this._al,b)|0,this._bh=this._bh+p+ae(this._bl,y)|0,this._ch=this._ch+h+ae(this._cl,_)|0,this._dh=this._dh+l+ae(this._dl,w)|0,this._eh=this._eh+d+ae(this._el,k)|0,this._fh=this._fh+m+ae(this._fl,x)|0,this._gh=this._gh+g+ae(this._gl,S)|0,this._hh=this._hh+v+ae(this._hl,j)|0},s.prototype._hash=function(){var i=a.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":449,inherits:320,"safe-buffer":447}],457:[function(e,t,r){var i=e("safer-buffer").Buffer,n={dsa:{parts:["p","q","g","y"],sizePart:"p"},rsa:{parts:["e","n"],sizePart:"n"},ecdsa:{parts:["curve","Q"],sizePart:"Q"},ed25519:{parts:["A"],sizePart:"A"}};n.curve25519=n.ed25519;var a={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};a.curve25519=a.ed25519;var o={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:i.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g,""),"hex"),s:i.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g,""),"hex"),n:i.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g,""),"hex"),G:i.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g,""),"hex"),a:i.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g,""),"hex"),s:i.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g,""),"hex"),n:i.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g,""),"hex"),G:i.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:i.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g,""),"hex"),a:i.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:i.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g,""),"hex"),s:i.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g,""),"hex"),n:i.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g,""),"hex"),G:i.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g,""),"hex")}};t.exports={info:n,privInfo:a,hashAlgs:{md5:!0,sha1:!0,sha256:!0,sha384:!0,sha512:!0},curves:o}},{"safer-buffer":448}],458:[function(e,t,r){t.exports=_;var d=e("assert-plus"),m=e("safer-buffer").Buffer,i=e("./algs"),n=e("crypto"),a=e("./fingerprint"),o=(e("./signature"),e("./errors")),g=(e("util"),e("./utils")),v=e("./key"),b=e("./private-key"),y=e("./identity"),s={};s.openssh=e("./formats/openssh-cert"),s.x509=e("./formats/x509"),s.pem=e("./formats/x509-pem");var c=o.CertificateParseError,u=o.InvalidAlgorithmError;function _(e){d.object(e,"options"),d.arrayOfObject(e.subjects,"options.subjects"),g.assertCompatible(e.subjects[0],y,[1,0],"options.subjects"),g.assertCompatible(e.subjectKey,v,[1,0],"options.subjectKey"),g.assertCompatible(e.issuer,y,[1,0],"options.issuer"),void 0!==e.issuerKey&&g.assertCompatible(e.issuerKey,v,[1,0],"options.issuerKey"),d.object(e.signatures,"options.signatures"),d.buffer(e.serial,"options.serial"),d.date(e.validFrom,"options.validFrom"),d.date(e.validUntil,"optons.validUntil"),d.optionalArrayOfString(e.purposes,"options.purposes"),this._hashCache={},this.subjects=e.subjects,this.issuer=e.issuer,this.subjectKey=e.subjectKey,this.issuerKey=e.issuerKey,this.signatures=e.signatures,this.serial=e.serial,this.validFrom=e.validFrom,this.validUntil=e.validUntil,this.purposes=e.purposes}_.formats=s,_.prototype.toBuffer=function(e,t){return void 0===e&&(e="x509"),d.string(e,"format"),d.object(s[e],"formats[format]"),d.optionalObject(t,"options"),s[e].write(this,t)},_.prototype.toString=function(e,t){return void 0===e&&(e="pem"),this.toBuffer(e,t).toString()},_.prototype.fingerprint=function(e){void 0===e&&(e="sha256"),d.string(e,"algorithm");var t={type:"certificate",hash:this.hash(e),algorithm:e};return new a(t)},_.prototype.hash=function(e){if(d.string(e,"algorithm"),e=e.toLowerCase(),void 0===i.hashAlgs[e])throw new u(e);if(this._hashCache[e])return this._hashCache[e];var t=n.createHash(e).update(this.toBuffer("x509")).digest();return this._hashCache[e]=t},_.prototype.isExpired=function(e){return void 0===e&&(e=new Date),!(e.getTime()>=this.validFrom.getTime()&&e.getTime()e.length||"BEGIN"!==e.slice(t,t+5).toString("ascii"))}(e))return a.read(e,t);if(function(e){var t=0;for(;to.length&&(p=o.length),u+=c.write(o.slice(f,p),u),c[u++]=10,f=p}return u+=c.write("-----END "+i+"-----\n",u),c.slice(0,u)}};var b=e("assert-plus"),y=e("asn1"),_=e("crypto"),w=e("safer-buffer").Buffer,k=(e("../algs"),e("../utils")),h=e("../key"),l=e("../private-key"),x=e("./pkcs1"),S=e("./pkcs8"),j=e("./ssh-private"),E=e("./rfc4253"),A=e("../errors")},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../utils":480,"./pkcs1":467,"./pkcs8":468,"./rfc4253":469,"./ssh-private":470,asn1:65,"assert-plus":66,crypto:204,"safer-buffer":448}],467:[function(e,t,r){t.exports={read:function(e,t){return i.read(e,t,"pkcs1")},readPkcs1:function(e,t,r){switch(e){case"RSA":if("public"===t)return u=y(c=r,"modulus"),f=y(c,"exponent"),new p({type:"rsa",parts:[{name:"e",data:f},{name:"n",data:u}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t[0],0);var r=y(e,"modulus"),i=y(e,"public exponent"),n=y(e,"private exponent"),a=y(e,"prime1"),o=y(e,"prime2"),s=y(e,"exponent1"),c=y(e,"exponent2"),u=y(e,"iqmp");return new v({type:"rsa",parts:[{name:"n",data:r},{name:"e",data:i},{name:"d",data:n},{name:"iqmp",data:u},{name:"p",data:a},{name:"q",data:o},{name:"dmodp",data:s},{name:"dmodq",data:c}]})}(r);throw new Error("Unknown key type: "+t);case"DSA":if("public"===t)return n=y(i=r,"y"),a=y(i,"p"),o=y(i,"q"),s=y(i,"g"),new p({type:"dsa",parts:[{name:"y",data:n},{name:"p",data:a},{name:"q",data:o},{name:"g",data:s}]});if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),0);var r=y(e,"p"),i=y(e,"q"),n=y(e,"g"),a=y(e,"y"),o=y(e,"x");return new v({type:"dsa",parts:[{name:"p",data:r},{name:"q",data:i},{name:"g",data:n},{name:"y",data:a},{name:"x",data:o}]})}(r);throw new Error("Unknown key type: "+t);case"EC":case"ECDSA":if("private"===t)return function(e){var t=y(e,"version");h.strictEqual(t.readUInt8(0),1);var r=e.readString(l.Ber.OctetString,!0);e.readSequence(160);var i=b(e);h.string(i,"a known elliptic curve"),e.readSequence(161);var n=e.readString(l.Ber.BitString,!0);n=g.ecNormalize(n);var a={type:"ecdsa",parts:[{name:"curve",data:d.from(i)},{name:"Q",data:n},{name:"d",data:r}]};return new v(a)}(r);if("public"===t)return function(e){e.readSequence();var t=e.readOID();h.strictEqual(t,"1.2.840.10045.2.1","must be ecPublicKey");for(var r,i=e.readOID(),n=Object.keys(m.curves),a=0;aS.length&&(I=S.length),E+=x.write(S.slice(A,I),E),x[E++]=10,A=I}return E+=x.write("-----END "+k+"-----\n",E),x.slice(0,E)}};var O,T=P("assert-plus"),B=(P("asn1"),P("safer-buffer").Buffer),C=(P("../algs"),P("../utils")),F=P("crypto"),R=(P("../key"),P("../private-key")),r=P("./pem"),A=P("./rfc4253"),z=P("../ssh-buffer"),I=P("../errors");var M="openssh-key-v1"},{"../algs":457,"../errors":461,"../key":476,"../private-key":477,"../ssh-buffer":479,"../utils":480,"./pem":466,"./rfc4253":469,asn1:65,"assert-plus":66,"bcrypt-pbkdf":76,crypto:204,"safer-buffer":448}],471:[function(e,t,r){t.exports={read:function(e,t){"string"!=typeof e&&(h.buffer(e,"buf"),e=e.toString("ascii"));var r=e.trim().replace(/[\\\r]/g,""),i=r.match(m);i||(i=r.match(g));h.ok(i,"key must match regex");var n,a=d.algToKeyType(i[1]),o=l.from(i[2],"base64"),s={};if(i[4])try{n=d.read(o)}catch(e){i=r.match(g),h.ok(i,"key must match regex"),o=l.from(i[2],"base64"),n=d.readInternal(s,"public",o)}else n=d.readInternal(s,"public",o);if(h.strictEqual(a,n.type),i[4]&&0n.length&&(u=n.length),s+=o.write(n.slice(c,u),s),o[s++]=10,c=u}return s+=o.write("-----END "+i+"-----\n",s),o.slice(0,s)}};var o=e("assert-plus"),p=(e("asn1"),e("safer-buffer").Buffer);e("../algs"),e("../utils"),e("../key"),e("../private-key"),e("./pem"),e("../identity"),e("../signature"),e("../certificate")},{"../algs":457,"../certificate":458,"../identity":474,"../key":476,"../private-key":477,"../signature":478,"../utils":480,"./pem":466,"./x509":473,asn1:65,"assert-plus":66,"safer-buffer":448}],473:[function(e,t,r){t.exports={read:function(e,t){"string"==typeof e&&(e=_.from(e,"binary"));b.buffer(e,"buf");var r=new y.BerReader(e);if(r.readSequence(),1=this._buffer.length},a.prototype.remainder=function(){return this._buffer.slice(this._offset)},a.prototype.skip=function(e){this._offset+=e},a.prototype.expand=function(){this._size*=2;var e=n.alloc(this._size);this._buffer.copy(e,0),this._buffer=e},a.prototype.readPart=function(){return{data:this.readBuffer()}},a.prototype.readBuffer=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4,i.ok(this._offset+e<=this._buffer.length,"length out of bounds at +0x"+this._offset.toString(16)+" (data truncated?)");var t=this._buffer.slice(this._offset,this._offset+e);return this._offset+=e,t},a.prototype.readString=function(){return this.readBuffer().toString()},a.prototype.readCString=function(){for(var e=this._offset;ethis._size;)this.expand();this._buffer.writeUInt32BE(e.length,this._offset),this._offset+=4,e.copy(this._buffer,this._offset),this._offset+=e.length},a.prototype.writeString=function(e){this.writeBuffer(n.from(e,"utf8"))},a.prototype.writeCString=function(e){for(;this._offset+1+e.length>this._size;)this.expand();this._buffer.write(e,this._offset),this._offset+=e.length,this._buffer[this._offset++]=0},a.prototype.writeInt=function(e){for(;this._offset+4>this._size;)this.expand();this._buffer.writeUInt32BE(e,this._offset),this._offset+=4},a.prototype.writeInt64=function(e){if(i.buffer(e,"value"),8this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=8},a.prototype.writeChar=function(e){for(;this._offset+1>this._size;)this.expand();this._buffer[this._offset++]=e},a.prototype.writePart=function(e){this.writeBuffer(e.data)},a.prototype.write=function(e){for(;this._offset+e.length>this._size;)this.expand();e.copy(this._buffer,this._offset),this._offset+=e.length}},{"assert-plus":66,"safer-buffer":448}],480:[function(e,t,r){t.exports={bufferSplit:function(e,t){p.buffer(e),p.string(t);for(var r=[],i=0,n=0,a=0;a=t.length){var o=a+1;r.push(e.slice(i,o-n)),i=o,n=0}i<=e.length&&r.push(e.slice(i,e.length));return r},addRSAMissing:function(e){p.object(e),u(e,s,[1,1]);var t,r=new g(e.part.d.data);if(!e.part.dmodp){var i=new g(e.part.p.data),n=r.mod(i.subtract(1));t=_(n),e.part.dmodp={name:"dmodp",data:t},e.parts.push(e.part.dmodp)}if(!e.part.dmodq){var a=new g(e.part.q.data),o=r.mod(a.subtract(1));t=_(o),e.part.dmodq={name:"dmodq",data:t},e.parts.push(e.part.dmodq)}},calculateDSAPublic:function(e,t,r){return p.buffer(e),p.buffer(t),p.buffer(r),e=new g(e),t=new g(t),r=new g(r),_(e.modPow(r,t))},calculateED25519Public:function(e){p.buffer(e);var t=i.sign.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},calculateX25519Public:function(e){p.buffer(e);var t=i.box.keyPair.fromSeed(new Uint8Array(e));return h.from(t.publicKey)},mpNormalize:y,mpDenormalize:function(e){p.buffer(e);for(;1c)return!1;if(i.constructor.name!==t.name)return!1;var a=i._sshpkApiVersion;void 0===a&&(a=t._oldVersionDetect(e));return!(a[0]!=r[0]||a[1]t;)p.equal(e[0],0),e=e.slice(1);for(;e.length=r[1],i+" must be compatible with "+t.name+" klass version "+r[0]+"."+r[1])}}var v={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}},b=8;function y(e){for(p.buffer(e);1t._pos){var i=r.substr(t._pos);if("x-user-defined"===t._charset){for(var n=new p(i.length),a=0;at._pos&&(t.push(new p(new Uint8Array(o.result.slice(t._pos)))),t._pos=o.result.byteLength)},o.onload=function(){t.push(null)},o.readAsArrayBuffer(r)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r("buffer").Buffer)},{"./capability":484,_process:382,buffer:191,inherits:320,"readable-stream":426}],487:[function(e,t,r){"use strict";var i=e("safe-buffer").Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=p,t=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1=2.4.3 <2.5.0",_hasShrinkwrap:!1,_id:"tough-cookie@2.4.3",_inCache:!0,_installable:!0,_location:"/tough-cookie",_nodeVersion:"10.5.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/tough-cookie_2.4.3_1529960207843_0.4882910670728131"},_npmUser:{email:"jstash@gmail.com",name:"jstash"},_npmVersion:"6.1.0",_phantomChildren:{},_requested:{name:"tough-cookie",raw:"tough-cookie@~2.4.3",rawSpec:"~2.4.3",scope:null,spec:">=2.4.3 <2.5.0",type:"range"},_requiredBy:["/request","/request-promise"],_resolved:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",_shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",_shrinkwrap:null,_spec:"tough-cookie@~2.4.3",_where:"/home/giacof/Download/javascript-opentimestamps/node_modules/request",author:{email:"jstash@gmail.com",name:"Jeremy Stashewsky"},bugs:{url:"https://github.com/salesforce/tough-cookie/issues"},contributors:[{name:"Alexander Savin"},{name:"Ian Livingstone"},{name:"Ivan Nikulin"},{name:"Lalit Kapoor"},{name:"Sam Thompson"},{name:"Sebastian Mayr"}],dependencies:{psl:"^1.1.24",punycode:"^1.4.1"},description:"RFC6265 Cookies and Cookie Jar for node.js",devDependencies:{async:"^1.4.2",nyc:"^11.6.0","string.prototype.repeat":"^0.2.0",vows:"^0.8.1"},directories:{},dist:{fileCount:9,integrity:"sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==","npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMVcQCRA9TVsSAnZWagAAzX0P/2COkbzb3dOX/FTOYIVL\n7oHge7BvGODNkEHTjBtNsR0jO/AA/gVcUOq6CSmFH+UC14LrmCyNDemQvD15\njnYuJXUIiZsSZO7BGGbOFYrQF+DKLiwgf0LokrIM8KasZ5nxc5xS1jYHG5o+\nwCqutfhlRTqlPbZsexB+eRlIuYNvpsbRAdSDYXrhLJNMZgx49g/SZ7IwunGN\nJ/5Fe041MZqqdi7MAavM3T7vX9IvVRJJ3f4xAEVxY1vh4s0dN+h4fG2eMQzL\nOiaulRUIahs4xmJUYHZgZESc9eTIrI8K+YT7i3r35TGc0Du7ueB2KYxBqy7q\n6AUFbdX9Ep308kTVsTf/h4wE0RvdxKLfZ0ww7T1ivADX9xMi2oIvVtyhCQHo\nSIpyBhaav/fTufF0/Fu4Lcr7PMJxyvF0UcNRqrPmEQTw4UZkFKfT8HN2P5cH\nBvJsFwpeEjt84tt5pJ/bmD0j0EUCLUXLGH6fbA84fHpZGifO239zSf262Qdv\nSXeygU7YxnK8wOCnvlauZx/gp+/WTMfMdODxiX0QnqwS5BctiPCgGG1cKJcC\nqvTECaAEmxMVf/gEW73oxVXJgUO7f6jJaWoawV7ka+wR91W9Bp0pKGOOAxAG\nU72rmnwQKid9U7ly5833sb3D+lbzKJXGNIqohegP4daKZfNNTaLWZXmKE+Iy\n7Vml\r\n=8KpS\r\n-----END PGP SIGNATURE-----\r\n",shasum:"53f36da3f47783b0925afa06ff9f3b165280f781",tarball:"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",unpackedSize:83959},engines:{node:">=0.8"},files:["lib"],gitHead:"671ad413b38d7464352886772f57a7ec417d4760",homepage:"https://github.com/salesforce/tough-cookie",keywords:["HTTP","RFC2965","RFC6265","cookie","cookiejar","cookies","jar","set-cookie"],license:"BSD-3-Clause",main:"./lib/cookie",maintainers:[{name:"awaterma",email:"awaterma@awaterma.net"},{name:"jstash",email:"jstash@gmail.com"},{name:"maratto",email:"marat+npm@salesforce.com"},{name:"ruoho",email:"clint@ruoho.org"}],name:"tough-cookie",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/salesforce/tough-cookie.git"},scripts:{cover:"nyc --reporter=lcov --reporter=html vows test/*_test.js",test:"vows test/*_test.js"},version:"2.4.3"}},{}],497:[function(s,e,c){(function(u){"use strict";s("net");var f,a=s("tls"),r=s("http"),i=s("https"),e=s("events"),p=s("assert"),t=s("util"),h=s("safe-buffer").Buffer;function o(e){var o=this;o.options=e||{},o.proxyOptions=o.options.proxy||{},o.maxSockets=o.options.maxSockets||r.Agent.defaultMaxSockets,o.requests=[],o.sockets=[],o.on("free",function(e,t,r){for(var i=0,n=o.requests.length;i=this.maxSockets?this.requests.push({host:t.host,port:t.port,request:e}):this.createConnection({host:t.host,port:t.port,request:e})},o.prototype.createConnection=function(e){var n=this;n.createSocket(e,function(t){function r(){n.emit("free",t,e.host,e.port)}function i(e){n.removeSocket(t),t.removeListener("free",r),t.removeListener("close",i),t.removeListener("agentRemove",i)}t.on("free",r),t.on("close",i),t.on("agentRemove",i),e.request.onSocket(t)})},o.prototype.createSocket=function(n,a){var o=this,s={};o.sockets.push(s);var e=l({},o.proxyOptions,{method:"CONNECT",path:n.host+":"+n.port,agent:!1});e.proxyAuth&&(e.headers=e.headers||{},e.headers["Proxy-Authorization"]="Basic "+h.from(e.proxyAuth).toString("base64")),f("making CONNECT request");var c=o.request(e);function i(e,t,r){if(c.removeAllListeners(),t.removeAllListeners(),200===e.statusCode)p.equal(r.length,0),f("tunneling connection has established"),o.sockets[o.sockets.indexOf(s)]=t,a(t);else{f("tunneling socket could not be established, statusCode=%d",e.statusCode);var i=new Error("tunneling socket could not be established, statusCode="+e.statusCode);i.code="ECONNRESET",n.request.emit("error",i),o.removeSocket(s)}}c.useChunkedEncodingByDefault=!1,c.once("response",function(e){e.upgrade=!0}),c.once("upgrade",function(e,t,r){u.nextTick(function(){i(e,t,r)})}),c.once("connect",i),c.once("error",function(e){c.removeAllListeners(),f("tunneling socket could not be established, cause=%s\n",e.message,e.stack);var t=new Error("tunneling socket could not be established, cause="+e.message);t.code="ECONNRESET",n.request.emit("error",t),o.removeSocket(s)}),c.end()},o.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(-1!==t){this.sockets.splice(t,1);var r=this.requests.shift();r&&this.createConnection(r)}},f=u.env.NODE_DEBUG&&/\btunnel\b/.test(u.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments);"string"==typeof e[0]?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:function(){},c.debug=f}).call(this,s("_process"))},{_process:382,assert:67,events:269,http:483,https:317,net:187,"safe-buffer":447,tls:187,util:505}],498:[function(e,t,r){!function(a){"use strict";var m=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=i>>24&255,e[t+5]=i>>16&255,e[t+6]=i>>8&255,e[t+7]=255&i}function d(e,t,r,i,n){var a,o=0;for(a=0;a>>8)-1}function v(e,t,r,i){return d(e,t,r,i,16)}function b(e,t,r,i){return d(e,t,r,i,32)}function y(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=a,k=o,x=s,S=c,j=u,E=f,A=p,I=h,P=l,O=d,T=m,B=g,C=v,F=b,R=y,z=_,M=0;M<20;M+=2)w^=(n=(C^=(n=(P^=(n=(j^=(n=w+C|0)<<7|n>>>25)+w|0)<<9|n>>>23)+j|0)<<13|n>>>19)+P|0)<<18|n>>>14,E^=(n=(k^=(n=(F^=(n=(O^=(n=E+k|0)<<7|n>>>25)+E|0)<<9|n>>>23)+O|0)<<13|n>>>19)+F|0)<<18|n>>>14,T^=(n=(A^=(n=(x^=(n=(R^=(n=T+A|0)<<7|n>>>25)+T|0)<<9|n>>>23)+R|0)<<13|n>>>19)+x|0)<<18|n>>>14,z^=(n=(B^=(n=(I^=(n=(S^=(n=z+B|0)<<7|n>>>25)+z|0)<<9|n>>>23)+S|0)<<13|n>>>19)+I|0)<<18|n>>>14,w^=(n=(S^=(n=(x^=(n=(k^=(n=w+S|0)<<7|n>>>25)+w|0)<<9|n>>>23)+k|0)<<13|n>>>19)+x|0)<<18|n>>>14,E^=(n=(j^=(n=(I^=(n=(A^=(n=E+j|0)<<7|n>>>25)+E|0)<<9|n>>>23)+A|0)<<13|n>>>19)+I|0)<<18|n>>>14,T^=(n=(O^=(n=(P^=(n=(B^=(n=T+O|0)<<7|n>>>25)+T|0)<<9|n>>>23)+B|0)<<13|n>>>19)+P|0)<<18|n>>>14,z^=(n=(R^=(n=(F^=(n=(C^=(n=z+R|0)<<7|n>>>25)+z|0)<<9|n>>>23)+C|0)<<13|n>>>19)+F|0)<<18|n>>>14;w=w+a|0,k=k+o|0,x=x+s|0,S=S+c|0,j=j+u|0,E=E+f|0,A=A+p|0,I=I+h|0,P=P+l|0,O=O+d|0,T=T+m|0,B=B+g|0,C=C+v|0,F=F+b|0,R=R+y|0,z=z+_|0,e[0]=w>>>0&255,e[1]=w>>>8&255,e[2]=w>>>16&255,e[3]=w>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=x>>>0&255,e[9]=x>>>8&255,e[10]=x>>>16&255,e[11]=x>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=j>>>0&255,e[17]=j>>>8&255,e[18]=j>>>16&255,e[19]=j>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=P>>>0&255,e[33]=P>>>8&255,e[34]=P>>>16&255,e[35]=P>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=B>>>0&255,e[45]=B>>>8&255,e[46]=B>>>16&255,e[47]=B>>>24&255,e[48]=C>>>0&255,e[49]=C>>>8&255,e[50]=C>>>16&255,e[51]=C>>>24&255,e[52]=F>>>0&255,e[53]=F>>>8&255,e[54]=F>>>16&255,e[55]=F>>>24&255,e[56]=R>>>0&255,e[57]=R>>>8&255,e[58]=R>>>16&255,e[59]=R>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,i)}function _(e,t,r,i){!function(e,t,r,i){for(var n,a=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,p=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,d=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,y=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,_=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=0;w<20;w+=2)a^=(n=(v^=(n=(l^=(n=(u^=(n=a+v|0)<<7|n>>>25)+a|0)<<9|n>>>23)+u|0)<<13|n>>>19)+l|0)<<18|n>>>14,f^=(n=(o^=(n=(b^=(n=(d^=(n=f+o|0)<<7|n>>>25)+f|0)<<9|n>>>23)+d|0)<<13|n>>>19)+b|0)<<18|n>>>14,m^=(n=(p^=(n=(s^=(n=(y^=(n=m+p|0)<<7|n>>>25)+m|0)<<9|n>>>23)+y|0)<<13|n>>>19)+s|0)<<18|n>>>14,_^=(n=(g^=(n=(h^=(n=(c^=(n=_+g|0)<<7|n>>>25)+_|0)<<9|n>>>23)+c|0)<<13|n>>>19)+h|0)<<18|n>>>14,a^=(n=(c^=(n=(s^=(n=(o^=(n=a+c|0)<<7|n>>>25)+a|0)<<9|n>>>23)+o|0)<<13|n>>>19)+s|0)<<18|n>>>14,f^=(n=(u^=(n=(h^=(n=(p^=(n=f+u|0)<<7|n>>>25)+f|0)<<9|n>>>23)+p|0)<<13|n>>>19)+h|0)<<18|n>>>14,m^=(n=(d^=(n=(l^=(n=(g^=(n=m+d|0)<<7|n>>>25)+m|0)<<9|n>>>23)+g|0)<<13|n>>>19)+l|0)<<18|n>>>14,_^=(n=(y^=(n=(b^=(n=(v^=(n=_+y|0)<<7|n>>>25)+_|0)<<9|n>>>23)+v|0)<<13|n>>>19)+b|0)<<18|n>>>14;e[0]=a>>>0&255,e[1]=a>>>8&255,e[2]=a>>>16&255,e[3]=a>>>24&255,e[4]=f>>>0&255,e[5]=f>>>8&255,e[6]=f>>>16&255,e[7]=f>>>24&255,e[8]=m>>>0&255,e[9]=m>>>8&255,e[10]=m>>>16&255,e[11]=m>>>24&255,e[12]=_>>>0&255,e[13]=_>>>8&255,e[14]=_>>>16&255,e[15]=_>>>24&255,e[16]=p>>>0&255,e[17]=p>>>8&255,e[18]=p>>>16&255,e[19]=p>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=d>>>0&255,e[29]=d>>>8&255,e[30]=d>>>16&255,e[31]=d>>>24&255}(e,t,r,i)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function k(e,t,r,i,n,a,o){var s,c,u=new Uint8Array(16),f=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=a[c];for(;64<=n;){for(y(f,u,o,w),c=0;c<64;c++)e[t+c]=r[i+c]^f[c];for(s=1,c=8;c<16;c++)s=s+(255&u[c])|0,u[c]=255&s,s>>>=8;n-=64,t+=64,i+=64}if(0>>=8;r-=64,t+=64}if(0>>13|r<<3),i=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|i<<6),n=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(i>>>7|n<<9),a=255&e[8]|(255&e[9])<<8,this.r[4]=255&(n>>>4|a<<12),this.r[5]=a>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(a>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,r,i,n,a){var o=new E(a);return o.update(r,i,n),o.finish(e,t),0}function I(e,t,r,i,n,a){var o=new Uint8Array(16);return A(o,0,r,i,n,a),v(e,t,o,0)}function P(e,t,r,i,n){var a;if(r<32)return-1;for(j(e,0,t,0,r,i,n),A(e,16,e,32,r-32,e),a=0;a<16;a++)e[a]=0;return 0}function O(e,t,r,i,n){var a,o=new Uint8Array(32);if(r<32)return-1;if(S(o,0,32,i,n),0!==I(t,16,t,32,r-32,o))return-1;for(j(e,0,t,0,r,i,n),a=0;a<32;a++)e[a]=0;return 0}function T(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,i=1;for(t=0;t<16;t++)r=e[t]+i+65535,i=Math.floor(r/65536),e[t]=r-65536*i;e[0]+=i-1+37*(i-1)}function C(e,t,r){for(var i,n=~(r-1),a=0;a<16;a++)i=n&(e[a]^t[a]),e[a]^=i,t[a]^=i}function F(e,t){var r,i,n,a=m(),o=m();for(r=0;r<16;r++)o[r]=t[r];for(B(o),B(o),B(o),i=0;i<2;i++){for(a[0]=o[0]-65517,r=1;r<15;r++)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),n=a[15]>>16&1,a[14]&=65535,C(o,a,1-n)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function R(e,t){var r=new Uint8Array(32),i=new Uint8Array(32);return F(r,e),F(i,t),b(r,0,i,0)}function z(e){var t=new Uint8Array(32);return F(t,e),1&t[0]}function M(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function D(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]+r[i]}function N(e,t,r){for(var i=0;i<16;i++)e[i]=t[i]-r[i]}function q(e,t,r){var i,n,a=0,o=0,s=0,c=0,u=0,f=0,p=0,h=0,l=0,d=0,m=0,g=0,v=0,b=0,y=0,_=0,w=0,k=0,x=0,S=0,j=0,E=0,A=0,I=0,P=0,O=0,T=0,B=0,C=0,F=0,R=0,z=r[0],M=r[1],D=r[2],N=r[3],q=r[4],L=r[5],U=r[6],H=r[7],K=r[8],V=r[9],G=r[10],$=r[11],W=r[12],Z=r[13],Y=r[14],X=r[15];a+=(i=t[0])*z,o+=i*M,s+=i*D,c+=i*N,u+=i*q,f+=i*L,p+=i*U,h+=i*H,l+=i*K,d+=i*V,m+=i*G,g+=i*$,v+=i*W,b+=i*Z,y+=i*Y,_+=i*X,o+=(i=t[1])*z,s+=i*M,c+=i*D,u+=i*N,f+=i*q,p+=i*L,h+=i*U,l+=i*H,d+=i*K,m+=i*V,g+=i*G,v+=i*$,b+=i*W,y+=i*Z,_+=i*Y,w+=i*X,s+=(i=t[2])*z,c+=i*M,u+=i*D,f+=i*N,p+=i*q,h+=i*L,l+=i*U,d+=i*H,m+=i*K,g+=i*V,v+=i*G,b+=i*$,y+=i*W,_+=i*Z,w+=i*Y,k+=i*X,c+=(i=t[3])*z,u+=i*M,f+=i*D,p+=i*N,h+=i*q,l+=i*L,d+=i*U,m+=i*H,g+=i*K,v+=i*V,b+=i*G,y+=i*$,_+=i*W,w+=i*Z,k+=i*Y,x+=i*X,u+=(i=t[4])*z,f+=i*M,p+=i*D,h+=i*N,l+=i*q,d+=i*L,m+=i*U,g+=i*H,v+=i*K,b+=i*V,y+=i*G,_+=i*$,w+=i*W,k+=i*Z,x+=i*Y,S+=i*X,f+=(i=t[5])*z,p+=i*M,h+=i*D,l+=i*N,d+=i*q,m+=i*L,g+=i*U,v+=i*H,b+=i*K,y+=i*V,_+=i*G,w+=i*$,k+=i*W,x+=i*Z,S+=i*Y,j+=i*X,p+=(i=t[6])*z,h+=i*M,l+=i*D,d+=i*N,m+=i*q,g+=i*L,v+=i*U,b+=i*H,y+=i*K,_+=i*V,w+=i*G,k+=i*$,x+=i*W,S+=i*Z,j+=i*Y,E+=i*X,h+=(i=t[7])*z,l+=i*M,d+=i*D,m+=i*N,g+=i*q,v+=i*L,b+=i*U,y+=i*H,_+=i*K,w+=i*V,k+=i*G,x+=i*$,S+=i*W,j+=i*Z,E+=i*Y,A+=i*X,l+=(i=t[8])*z,d+=i*M,m+=i*D,g+=i*N,v+=i*q,b+=i*L,y+=i*U,_+=i*H,w+=i*K,k+=i*V,x+=i*G,S+=i*$,j+=i*W,E+=i*Z,A+=i*Y,I+=i*X,d+=(i=t[9])*z,m+=i*M,g+=i*D,v+=i*N,b+=i*q,y+=i*L,_+=i*U,w+=i*H,k+=i*K,x+=i*V,S+=i*G,j+=i*$,E+=i*W,A+=i*Z,I+=i*Y,P+=i*X,m+=(i=t[10])*z,g+=i*M,v+=i*D,b+=i*N,y+=i*q,_+=i*L,w+=i*U,k+=i*H,x+=i*K,S+=i*V,j+=i*G,E+=i*$,A+=i*W,I+=i*Z,P+=i*Y,O+=i*X,g+=(i=t[11])*z,v+=i*M,b+=i*D,y+=i*N,_+=i*q,w+=i*L,k+=i*U,x+=i*H,S+=i*K,j+=i*V,E+=i*G,A+=i*$,I+=i*W,P+=i*Z,O+=i*Y,T+=i*X,v+=(i=t[12])*z,b+=i*M,y+=i*D,_+=i*N,w+=i*q,k+=i*L,x+=i*U,S+=i*H,j+=i*K,E+=i*V,A+=i*G,I+=i*$,P+=i*W,O+=i*Z,T+=i*Y,B+=i*X,b+=(i=t[13])*z,y+=i*M,_+=i*D,w+=i*N,k+=i*q,x+=i*L,S+=i*U,j+=i*H,E+=i*K,A+=i*V,I+=i*G,P+=i*$,O+=i*W,T+=i*Z,B+=i*Y,C+=i*X,y+=(i=t[14])*z,_+=i*M,w+=i*D,k+=i*N,x+=i*q,S+=i*L,j+=i*U,E+=i*H,A+=i*K,I+=i*V,P+=i*G,O+=i*$,T+=i*W,B+=i*Z,C+=i*Y,F+=i*X,_+=(i=t[15])*z,o+=38*(k+=i*D),s+=38*(x+=i*N),c+=38*(S+=i*q),u+=38*(j+=i*L),f+=38*(E+=i*U),p+=38*(A+=i*H),h+=38*(I+=i*K),l+=38*(P+=i*V),d+=38*(O+=i*G),m+=38*(T+=i*$),g+=38*(B+=i*W),v+=38*(C+=i*Z),b+=38*(F+=i*Y),y+=38*(R+=i*X),a=(i=(a+=38*(w+=i*M))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a=(i=(a+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),o=(i=o+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),_=(i=_+n+65535)-65536*(n=Math.floor(i/65536)),a+=n-1+37*(n-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=h,e[8]=l,e[9]=d,e[10]=m,e[11]=g,e[12]=v,e[13]=b,e[14]=y,e[15]=_}function L(e,t){q(e,t,t)}function U(e,t){var r,i=m();for(r=0;r<16;r++)i[r]=t[r];for(r=253;0<=r;r--)L(i,i),2!==r&&4!==r&&q(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function H(e,t,r){var i,n,a=new Uint8Array(32),o=new Float64Array(80),s=m(),c=m(),u=m(),f=m(),p=m(),h=m();for(n=0;n<31;n++)a[n]=t[n];for(a[31]=127&t[31]|64,a[0]&=248,M(o,r),n=0;n<16;n++)c[n]=o[n],f[n]=s[n]=u[n]=0;for(s[0]=f[0]=1,n=254;0<=n;--n)C(s,c,i=a[n>>>3]>>>(7&n)&1),C(u,f,i),D(p,s,u),N(s,s,u),D(u,c,f),N(c,c,f),L(f,p),L(h,s),q(s,u,s),q(u,c,p),D(p,s,u),N(s,s,u),L(c,s),N(u,f,h),q(s,u,g),D(s,s,f),q(u,u,s),q(s,f,h),q(f,c,o),L(c,p),C(s,c,i),C(u,f,i);for(n=0;n<16;n++)o[n+16]=s[n],o[n+32]=u[n],o[n+48]=c[n],o[n+64]=f[n];var l=o.subarray(32),d=o.subarray(16);return U(l,l),q(d,d,l),F(e,d),0}function K(e,t){return H(e,t,r)}function V(e,t){return o(t,32),K(e,t)}function G(e,t,r){var i=new Uint8Array(32);return H(i,r,t),_(e,n,i,w)}E.prototype.blocks=function(e,t,r){for(var i,n,a,o,s,c,u,f,p,h,l,d,m,g,v,b,y,_,w,k=this.fin?0:2048,x=this.h[0],S=this.h[1],j=this.h[2],E=this.h[3],A=this.h[4],I=this.h[5],P=this.h[6],O=this.h[7],T=this.h[8],B=this.h[9],C=this.r[0],F=this.r[1],R=this.r[2],z=this.r[3],M=this.r[4],D=this.r[5],N=this.r[6],q=this.r[7],L=this.r[8],U=this.r[9];16<=r;)h=p=0,h+=(x+=8191&(i=255&e[t+0]|(255&e[t+1])<<8))*C,h+=(S+=8191&(i>>>13|(n=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*U),h+=(j+=8191&(n>>>10|(a=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*L),h+=(E+=8191&(a>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*q),p=(h+=(A+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*N))>>>13,h&=8191,h+=(I+=s>>>1&8191)*(5*D),h+=(P+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*M),h+=(O+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),h+=(T+=8191&(u>>>8|(f=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*R),l=p+=(h+=(B+=f>>>5|k)*(5*F))>>>13,l+=x*F,l+=S*C,l+=j*(5*U),l+=E*(5*L),p=(l+=A*(5*q))>>>13,l&=8191,l+=I*(5*N),l+=P*(5*D),l+=O*(5*M),l+=T*(5*z),p+=(l+=B*(5*R))>>>13,l&=8191,d=p,d+=x*R,d+=S*F,d+=j*C,d+=E*(5*U),p=(d+=A*(5*L))>>>13,d&=8191,d+=I*(5*q),d+=P*(5*N),d+=O*(5*D),d+=T*(5*M),m=p+=(d+=B*(5*z))>>>13,m+=x*z,m+=S*R,m+=j*F,m+=E*C,p=(m+=A*(5*U))>>>13,m&=8191,m+=I*(5*L),m+=P*(5*q),m+=O*(5*N),m+=T*(5*D),g=p+=(m+=B*(5*M))>>>13,g+=x*M,g+=S*z,g+=j*R,g+=E*F,p=(g+=A*C)>>>13,g&=8191,g+=I*(5*U),g+=P*(5*L),g+=O*(5*q),g+=T*(5*N),v=p+=(g+=B*(5*D))>>>13,v+=x*D,v+=S*M,v+=j*z,v+=E*R,p=(v+=A*F)>>>13,v&=8191,v+=I*C,v+=P*(5*U),v+=O*(5*L),v+=T*(5*q),b=p+=(v+=B*(5*N))>>>13,b+=x*N,b+=S*D,b+=j*M,b+=E*z,p=(b+=A*R)>>>13,b&=8191,b+=I*F,b+=P*C,b+=O*(5*U),b+=T*(5*L),y=p+=(b+=B*(5*q))>>>13,y+=x*q,y+=S*N,y+=j*D,y+=E*M,p=(y+=A*z)>>>13,y&=8191,y+=I*R,y+=P*F,y+=O*C,y+=T*(5*U),_=p+=(y+=B*(5*L))>>>13,_+=x*L,_+=S*q,_+=j*N,_+=E*D,p=(_+=A*M)>>>13,_&=8191,_+=I*z,_+=P*R,_+=O*F,_+=T*C,w=p+=(_+=B*(5*U))>>>13,w+=x*U,w+=S*L,w+=j*q,w+=E*N,p=(w+=A*D)>>>13,w&=8191,w+=I*M,w+=P*z,w+=O*R,w+=T*F,x=h=8191&(p=(p=((p+=(w+=B*C)>>>13)<<2)+p|0)+(h&=8191)|0),S=l+=p>>>=13,j=d&=8191,E=m&=8191,A=g&=8191,I=v&=8191,P=b&=8191,O=y&=8191,T=_&=8191,B=w&=8191,t+=16,r-=16;this.h[0]=x,this.h[1]=S,this.h[2]=j,this.h[3]=E,this.h[4]=A,this.h[5]=I,this.h[6]=P,this.h[7]=O,this.h[8]=T,this.h[9]=B},E.prototype.finish=function(e,t){var r,i,n,a,o=new Uint16Array(10);if(this.leftover){for(a=this.leftover,this.buffer[a++]=1;a<16;a++)this.buffer[a]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=r,r=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this.h[a]+r,r=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,i=(1^r)-1,a=0;a<10;a++)o[a]&=i;for(i=~i,a=0;a<10;a++)this.h[a]=this.h[a]&i|o[a];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,a=1;a<8;a++)n=(this.h[a]+this.pad[a]|0)+(n>>>16)|0,this.h[a]=65535&n;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var i,n;if(this.leftover){for(r<(n=16-this.leftover)&&(n=r),i=0;i>>16,I=65535&(S=N),P=S>>>16,E+=65535&(j=((g=K)>>>14|(c=z)<<18)^(K>>>18|z<<14)^(z>>>9|K<<23)),A+=j>>>16,I+=65535&(S=(z>>>14|K<<18)^(z>>>18|K<<14)^(K>>>9|z<<23)),P+=S>>>16,E+=65535&(j=K&(v=V)^~K&(b=G)),A+=j>>>16,I+=65535&(S=z&(u=M)^~z&(f=D)),P+=S>>>16,S=Z[2*k],E+=65535&(j=Z[2*k+1]),A+=j>>>16,I+=65535&S,P+=S>>>16,S=O[k%16],A+=(j=T[k%16])>>>16,I+=65535&S,P+=S>>>16,I+=(A+=(E+=65535&j)>>>16)>>>16,E=65535&(j=w=65535&E|A<<16),A=j>>>16,I=65535&(S=_=65535&I|(P+=I>>>16)<<16),P=S>>>16,E+=65535&(j=(q>>>28|B<<4)^(B>>>2|q<<30)^(B>>>7|q<<25)),A+=j>>>16,I+=65535&(S=(B>>>28|q<<4)^(q>>>2|B<<30)^(q>>>7|B<<25)),P+=S>>>16,A+=(j=q&L^q&U^L&U)>>>16,I+=65535&(S=B&C^B&F^C&F),P+=S>>>16,p=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,y=65535&E|A<<16,E=65535&(j=m),A=j>>>16,I=65535&(S=s),P=S>>>16,A+=(j=w)>>>16,I+=65535&(S=_),P+=S>>>16,C=n,F=a,R=o,z=s=65535&(I+=(A+=(E+=65535&j)>>>16)>>>16)|(P+=I>>>16)<<16,M=c,D=u,N=f,B=p,L=h,U=l,H=d,K=m=65535&E|A<<16,V=g,G=v,$=b,q=y,k%16==15)for(x=0;x<16;x++)S=O[x],E=65535&(j=T[x]),A=j>>>16,I=65535&S,P=S>>>16,S=O[(x+9)%16],E+=65535&(j=T[(x+9)%16]),A+=j>>>16,I+=65535&S,P+=S>>>16,_=O[(x+1)%16],E+=65535&(j=((w=T[(x+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),A+=j>>>16,I+=65535&(S=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),P+=S>>>16,_=O[(x+14)%16],A+=(j=((w=T[(x+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,I+=65535&(S=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,O[x]=65535&I|P<<16,T[x]=65535&E|A<<16;E=65535&(j=q),A=j>>>16,I=65535&(S=B),P=S>>>16,S=e[0],A+=(j=t[0])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[0]=B=65535&I|P<<16,t[0]=q=65535&E|A<<16,E=65535&(j=L),A=j>>>16,I=65535&(S=C),P=S>>>16,S=e[1],A+=(j=t[1])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[1]=C=65535&I|P<<16,t[1]=L=65535&E|A<<16,E=65535&(j=U),A=j>>>16,I=65535&(S=F),P=S>>>16,S=e[2],A+=(j=t[2])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[2]=F=65535&I|P<<16,t[2]=U=65535&E|A<<16,E=65535&(j=H),A=j>>>16,I=65535&(S=R),P=S>>>16,S=e[3],A+=(j=t[3])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[3]=R=65535&I|P<<16,t[3]=H=65535&E|A<<16,E=65535&(j=K),A=j>>>16,I=65535&(S=z),P=S>>>16,S=e[4],A+=(j=t[4])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[4]=z=65535&I|P<<16,t[4]=K=65535&E|A<<16,E=65535&(j=V),A=j>>>16,I=65535&(S=M),P=S>>>16,S=e[5],A+=(j=t[5])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[5]=M=65535&I|P<<16,t[5]=V=65535&E|A<<16,E=65535&(j=G),A=j>>>16,I=65535&(S=D),P=S>>>16,S=e[6],A+=(j=t[6])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[6]=D=65535&I|P<<16,t[6]=G=65535&E|A<<16,E=65535&(j=$),A=j>>>16,I=65535&(S=N),P=S>>>16,S=e[7],A+=(j=t[7])>>>16,I+=65535&S,P+=S>>>16,P+=(I+=(A+=(E+=65535&j)>>>16)>>>16)>>>16,e[7]=N=65535&I|P<<16,t[7]=$=65535&E|A<<16,W+=128,i-=128}return i}function X(e,t,r){var i,n=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,Y(n,a,t,r),r%=128,i=0;i>(7&n)&1),J(t,e),J(e,e),Q(e,t,i)}function re(e,t){var r=[m(),m(),m(),m()];T(r[0],i),T(r[1],s),T(r[2],f),q(r[3],i,s),te(e,r,t)}function ie(e,t,r){var i,n=new Uint8Array(64),a=[m(),m(),m(),m()];for(r||o(t,32),X(n,t,32),n[0]&=248,n[31]&=127,n[31]|=64,re(a,n),ee(e,a),i=0;i<32;i++)t[i+32]=e[i];return 0}var ne=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var r,i,n,a;for(i=63;32<=i;--i){for(r=0,n=i-32,a=i-12;n>8,t[n]-=256*r;t[n]+=r,t[i]=0}for(n=r=0;n<32;n++)t[n]+=r-(t[31]>>4)*ne[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*ne[n];for(i=0;i<32;i++)t[i+1]+=t[i]>>8,e[i]=255&t[i]}function oe(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function se(e,t,r,i){var n,a,o=new Uint8Array(64),s=new Uint8Array(64),c=new Uint8Array(64),u=new Float64Array(64),f=[m(),m(),m(),m()];X(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var p=r+64;for(n=0;n>7&&N(e[0],u,e[0]),q(e[3],e[0],e[1]),0)}function ue(e,t,r,i){var n,a=new Uint8Array(32),o=new Uint8Array(64),s=[m(),m(),m(),m()],c=[m(),m(),m(),m()];if(-1,r<64)return-1;if(ce(c,i))return-1;for(n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,M=String.fromCharCode;function D(e){throw new RangeError(o[e])}function s(e,t){var r=e.split("@"),i="";return 1>1,e+=z(e/t);455z((C-n)/p))&&D("overflow"),n+=l*p;var d=h<=o?1:o+26<=h?26:h-o;if(lz(C/m)&&D("overflow"),p*=m}var g=r.length+1;o=L(n-f,g,0==f),z(n/g)>C-a&&D("overflow"),a+=z(n/g),n%=g,r.splice(n++,0,a)}return String.fromCodePoint.apply(String,r)},u=function(e){var t=[],r=(e=N(e)).length,i=128,n=0,a=72,o=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(o=(u=f.next()).done);o=!0){var p=u.value;p<128&&t.push(M(p))}}catch(e){s=!0,c=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw c}}var h=t.length,l=h;for(h&&t.push("-");lz((C-n)/w)&&D("overflow"),n+=(d-i)*w,i=d;var k=!0,x=!1,S=void 0;try{for(var j,E=e[Symbol.iterator]();!(k=(j=E.next()).done);k=!0){var A=j.value;if(AC&&D("overflow"),A==i){for(var I=n,P=36;;P+=36){var O=P<=a?1:a+26<=P?26:P-a;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function l(e){for(var t="",r=0,i=e.length;rA-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(V,"g"),Y=new RegExp($,"g"),X=new RegExp(F("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',W),"g"),J=new RegExp(F("[^]",V,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),Q=J;function ee(e){var t=l(e);return t.match(Z)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,i=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,a={},o=r.query.split("&"),s=0,c=o.length;s",'"',"`"," ","\r","\n","\t"]),M=["'"].concat(n),D=["%","/","?",";","#"].concat(M),N=["/","?","#"],q=/^[+a-z0-9A-Z_-]{0,63}$/,L=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,U={javascript:!0,"javascript:":!0},H={javascript:!0,"javascript:":!0},K={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},V=e("querystring");function a(e,t,r){if(e&&F.isObject(e)&&e instanceof A)return e;var i=new A;return i.parse(e,t,r),i}A.prototype.parse=function(e,t,r){if(!F.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===e?"undefined":_typeof(e)));var i=e.indexOf("?"),n=-1!==i&&i>t&63|128)}function p(e){if(0==(4294967168&e))return s(e);var t="";return 0==(4294965248&e)?t=s(e>>6&31|192):0==(4294901760&e)?(u(e),t=s(e>>12&15|224),t+=f(e,6)):0==(4292870144&e)&&(t=s(e>>18&7|240),t+=f(e,12),t+=f(e,6)),t+=s(63&e|128)}function h(){if(a<=o)throw Error("Invalid byte index");var e=255&n[o];if(o++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,t;if(a>>10&1023|55296),t=56320|1023&t),n+=s(t);return n}(r)}};if("function"==typeof define&&"object"==_typeof(define.amd)&&define.amd)define(function(){return d});else if(t&&!t.nodeType)if(r)r.exports=d;else{var m={}.hasOwnProperty;for(var g in d)m.call(d,g)&&(t[g]=d[g])}else e.utf8=d}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],503:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],504:[function(e,t,r){arguments[4][69][0].apply(r,arguments)},{dup:69}],505:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{"./support/isBuffer":504,_process:382,dup:70,inherits:320}],506:[function(e,t,r){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},{}],507:[function(e,t,r){var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(i){var n=new Uint8Array(16);t.exports=function(){return i(n),n}}else{var a=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}},{}],508:[function(e,t,r){var o=e("./lib/rng"),s=e("./lib/bytesToUuid");t.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var a=0;a<16;++a)t[i+a]=n[a];return t||s(n)}},{"./lib/bytesToUuid":506,"./lib/rng":507}],509:[function(e,t,r){var s=e("assert-plus"),i=e("util"),n=e("extsprintf"),c=e("core-util-is").isError,a=n.sprintf;function u(e){var t,r,i,n;if(s.object(e,"args"),s.bool(e.strict,"args.strict"),s.array(e.argv,"args.argv"),0===(t=e.argv).length)r={},i=[];else if(c(t[0]))r={cause:t[0]},i=t.slice(1);else if("object"===_typeof(t[0])){for(n in r={},t[0])r[n]=t[0][n];i=t.slice(1)}else s.string(t[0],"first argument to VError, SError, or WError constructor must be a string, object, or Error"),r={},i=t;return s.object(r),r.strict||e.strict||(i=i.map(function(e){return null===e?"null":void 0===e?"undefined":e})),{options:r,shortmessage:0===i.length?"":a.apply(null,i)}}function f(){var e,t,r,i,n,a,o;if(e=Array.prototype.slice.call(arguments,0),!(this instanceof f))return t=Object.create(f.prototype),f.apply(t,arguments),t;if((r=u({argv:e,strict:!1})).options.name&&(s.string(r.options.name,'error\'s "name" must be a string'),this.name=r.options.name),this.jse_shortmsg=r.shortmessage,a=r.shortmessage,(i=r.options.cause)&&(s.ok(c(i),"cause is not an Error"),this.jse_cause=i,r.options.skipCauseMessage||(a+=": "+i.message)),this.jse_info={},r.options.info)for(o in r.options.info)this.jse_info[o]=r.options.info[o];return this.message=a,Error.call(this,a),Error.captureStackTrace&&(n=r.options.constructorOpt||this.constructor,Error.captureStackTrace(this,n)),this}function o(){var e,t,r,i;return e=Array.prototype.slice.call(arguments,0),this instanceof o?(i=(r=u({argv:e,strict:!0})).options,f.call(this,i,"%s",r.shortmessage),this):(t=Object.create(o.prototype),o.apply(t,arguments),t)}function p(e){s.array(e,"list of errors"),s.ok(0this._inputTypes.length&&!n.isObject(e[e.length-1]))return a.inputDefaultBlockNumberFormatter(e.pop())},s.prototype.toPayload=function(e){var t={};return e.length>this._inputTypes.length&&n.isObject(e[e.length-1])&&(t=e[e.length-1]),t.to=this._address,t.data="0x"+this.signature()+i.encodeParams(this._inputTypes,e),t},s.prototype.signature=function(){return o(this._name).slice(0,8)},s.prototype.unpackOutput=function(e){if(e){e=2<=e.length?e.slice(2):e;var t=i.decodeParams(this._outputTypes,e);return 1===t.length?t[0]:t}},s.prototype.call=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),i=this.extractCallback(e),t=this.extractDefaultBlock(e),r=this.toPayload(e);if(!i){var n=this._eth.call(r,t);return this.unpackOutput(n)}var a=this;this._eth.call(r,t,function(t,e){if(t)return i(t,null);var r=null;try{r=a.unpackOutput(e)}catch(e){t=e}i(t,r)})},s.prototype.sendTransaction=function(){var e=Array.prototype.slice.call(arguments).filter(function(e){return void 0!==e}),t=this.extractCallback(e),r=this.toPayload(e);if(0=this.buffer.length)){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,t}}},{key:"read",value:function(e){e>this.buffer.length&&(e=this.buffer.length);var t=this.buffer.slice(this.counter,this.counter+e);return this.counter+=e,Array.from(t)}},{key:"readBool",value:function(){var e=this.read(1)[0];if(255===e)return!0;if(0===e)return!1;throw new n("read_bool() expected 0xff or 0x00; got +"+e)}},{key:"readVaruint",value:function(){for(var e=0,t=0,r=void 0;e|=(127&(r=this.read(1)[0]))< "+e);if(r>=7}}},{key:"writeByte",value:function(e){if(this.length>=this.buffer.length){var t=2*this.length,r=new Uint8Array(t);r.set(this.buffer,0),this.buffer=r}isNaN(e)?this.buffer[this.length]=e.codePointAt():this.buffer[this.length]=e,this.length++}},{key:"writeBytes",value:function(e){var t=this;e.forEach(function(e){t.writeByte(e)})}},{key:"writeVarbytes",value:function(e){this.writeVaruint(e.length),this.writeBytes(e)}},{key:"toString",value:function(){return this.buffer.toHex(0)}}]),e}();m.exports={StreamDeserialization:h,StreamSerialization:l,DeserializationError:n,BadMagicError:a,UnsupportedMajorVersion:o,TruncationError:s,TrailingGarbageError:c,RecursionLimitError:u,SerializerTypeError:f,SerializerValueError:p,ValueError:e,TypeError:t}}).call(this,d("buffer").Buffer)},{"./extend-error.js":570,"./utils.js":577,buffer:191}],568:[function(e,t,r){"use strict";var s=e("./ops.js"),c=e("./timestamp.js"),i=e("./utils.js"),u=e("./context.js"),f=[0,79,112,101,110,84,105,109,101,115,116,97,109,112,115,0,0,80,114,111,111,102,0,191,137,226,232,132,232,146,148],n=function(){function o(e,t){if(_classCallCheck2(this,o),!(e instanceof s.Op&&t instanceof c))throw new u.ValueError("Invalid Timestamp or fileHashOp");if(t.msg.length!==e._DIGEST_LENGTH())throw new u.ValueError("Timestamp message length and fileHashOp digest length differ");this.fileHashOp=e,this.timestamp=t}return _createClass(o,[{key:"fileDigest",value:function(){return this.timestamp.msg}},{key:"serialize",value:function(e){e.writeBytes(f),e.writeVaruint(1),this.fileHashOp.serialize(e),e.writeBytes(this.timestamp.msg),this.timestamp.serialize(e)}},{key:"serializeToBytes",value:function(){var e=new u.StreamSerialization;return this.serialize(e),e.getOutput()}},{key:"toString",value:function(){var e="DetachedTimestampFile\n";return e+="fileHashOp: "+this.fileHashOp.toString()+"\n",e+="timestamp: "+this.timestamp.toString()+"\n"}},{key:"toJson",value:function(){var e={};e.hash=i.bytesToHex(this.fileDigest()),e.op=this.fileHashOp._HASHLIB_NAME(),e.timestamp=this.timestamp.toJson()}},{key:"equals",value:function(e){return e instanceof o&&(!!e.fileHashOp.equals(this.fileHashOp)&&!!e.timestamp.equals(this.timestamp))}}],[{key:"deserialize",value:function(e){var t=void 0;if(e instanceof u.StreamDeserialization)t=e;else if(e instanceof Array)t=new u.StreamDeserialization(e);else if(e instanceof Uint8Array)t=new u.StreamDeserialization(Array.from(e));else{if(!(e instanceof ArrayBuffer))throw new Error("StreamDeserialization deserialize: Invalid param");t=new u.StreamDeserialization(Array.from(e))}t.assertMagic(f);var r=t.readVaruint();if(1!==r)throw new u.UnsupportedMajorVersion("Version "+r+" detached timestamp files are not supported");var i=s.CryptOp.deserialize(t),n=t.readBytes(i._DIGEST_LENGTH()),a=c.deserialize(t,n);return t.assertEof(),new o(i,a)}},{key:"fromBytes",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOp param");var r=void 0;if(t instanceof u.StreamDeserialization)r=e.hashFd(t);else if(t instanceof Array){var i=new u.StreamDeserialization(t);r=e.hashFd(i)}else if(t instanceof Uint8Array){var n=new u.StreamDeserialization(Array.from(t));r=e.hashFd(n)}else{if(!(t instanceof ArrayBuffer))throw new Error("DetachedTimestampFile: Invalid buffer param");var a=new u.StreamDeserialization(Array.from(t));r=e.hashFd(a)}return new o(e,new c(r))}},{key:"fromHash",value:function(e,t){if(!(e instanceof s.Op))throw new Error("DetachedTimestampFile: Invalid fileHashOpss param");if(t instanceof Array)return new o(e,new c(t));if(t instanceof ArrayBuffer||t instanceof Uint8Array)return new o(e,new c(Array.from(t)));throw new Error("DetachedTimestampFile: Invalid fdHash param")}}]),o}();t.exports=n},{"./context.js":567,"./ops.js":575,"./timestamp.js":576,"./utils.js":577}],569:[function(e,t,r){"use strict";var a=e("promise"),o=e("./utils.js"),s=e("./insight.js"),c=e("./blockstream.js"),u={bitcoin:[{url:"https://blockstream.info/api",type:"blockstream"},{url:"https://insight.bitpay.com/api",type:"insight"},{url:"https://blockexplorer.com/api",type:"insight"},{url:"https://bitcore.schmoock.net/insight-api",type:"insight"}],bitcoinTestnet:[{url:"https://blockstream.info/testnet/api",type:"blockstream"},{url:"https://test-insight.bitpay.com/api",type:"insight"}],litecoin:[{url:"https://ltc-bitcore1.trezor.io/api",type:"insight"},{url:"https://insight.litecore.io/api",type:"insight"}]},i=function(){function n(e){var r=this;_classCallCheck2(this,n),this.explorers=[];var t=e&&Object.prototype.hasOwnProperty.call(e,"chain")?e.chain:"bitcoin",i=e&&Object.prototype.hasOwnProperty.call(e,"timeout")?e.timeout:10;(e&&Object.prototype.hasOwnProperty.call(e,"explorers")&&1(new i)._MAX_URI_LENGTH())return console.error("URI exceeds maximum length"),!1;for(var t=0;ta.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=a.privateCalendars.length;else if(a.privateCalendars=[],a.calendars&&0!==a.calendars.length||(a.calendars=c.DEFAULT_AGGREGATORS),a.m&&0!==a.m){if(a.m<0||a.m>a.calendars.length)return console.log("m cannot be greater than available calendar neither less or equal 0"),r(new Error("m cannot be greater than available calendar neither less or equal 0"))}else a.m=1,2<=a.calendars.length&&(a.m=2);o.createTimestamp(i,a.calendars,a.m,a.privateCalendars).then(function(e){if(void 0===e)return r(new Error("Error on timestamp creation"));t()}).catch(function(e){r(e)})})},createTimestamp:function(i,e,t,r){var n=[];return e&&e.forEach(function(e){var t=new c.RemoteCalendar(e);n.push(t.submit(i.msg)),console.log("Submitting to remote calendar "+e)}),r&&r.forEach(function(e,t){var r=new c.RemoteCalendar(t);r.setKey(e),n.push(r.submit(i.msg)),console.log("Submitting to remote calendar "+t)}),new Promise(function(t,r){Promise.all(n.map(u.softFail)).then(function(e){return e.filter(function(e){return!(e instanceof Error)&&void 0!==e}).forEach(function(e){i.merge(e)}),t(i)}).catch(function(e){r(e)})})},makeMerkleTree:function(e){var i=[];return e.forEach(function(e){if(e instanceof s)try{var t=u.randBytes(16),r=e.timestamp.add(new n.OpAppend(u.arrayToBytes(t))).add(new n.OpSHA256);i.push(r)}catch(e){return}else console.error("Invalid input")}),f.makeMerkleTree(i)},verify:function(e,t,i){if(!u.arrEq(e.fileDigest(),t.fileDigest()))return console.error("Expected digest "+u.bytesToHex(e.fileDigest())),console.error("File does not match original!"),new Promise(function(e,t){t(new Error("File does not match original!"))});var n=this;return new Promise(function(t,r){n.upgradeTimestamp(e.timestamp,i).then(function(){n.verifyTimestamp(e.timestamp,i).then(function(e){return t(e)}).catch(function(e){return r(e)})})})},verifyTimestamp:function(e,r){var i=[],n=this;function c(e,t){return e.attestedTimet.attestedTime?1:0}return e.allAttestations().forEach(function(e,t){i.push(n.verifyAttestation(e,t,r))}),new Promise(function(o,s){Promise.all(i.map(u.softFail)).then(function(e){var t=e.filter(function(e){return e.constructor===h.VerificationError?e:void 0});if(0this._MAX_MSG_LENGTH())){var t=this.call(e);return t.length>this._MAX_RESULT_LENGTH()&&console.error("Error : Result too long;"),t}console.error("Error : Message too long;")}}],[{key:"deserialize",value:function(e){return this.tag=e.readBytes(1)[0],t.deserializeFromTag(e,this.tag)}},{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return n.get(t).deserializeFromTag(e,t);console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),t=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return t.arg=void 0===e?[]:e,t}return _inherits(r,c),_createClass(r,[{key:"serialize",value:function(e){_get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"serialize",this).call(this,e),e.writeVarbytes(this.arg)}},{key:"toString",value:function(){return this._TAG_NAME()+" "+i.bytesToHex(this.arg)}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t)){var r=e.readVarbytes((new c)._MAX_RESULT_LENGTH(),1);return new(n.get(t))(r)}}}]),r}(),e=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 240}},{key:"_TAG_NAME",value:function(){return"append"}},{key:"call",value:function(e){return e.concat(this.arg)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),r=function(e){function r(e){_classCallCheck2(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.arg=void 0===e?[]:e,t}return _inherits(r,t),_createClass(r,[{key:"_TAG",value:function(){return 241}},{key:"_TAG_NAME",value:function(){return"prepend"}},{key:"call",value:function(e){return this.arg.concat(e)}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),u=function(e){function t(){return _classCallCheck2(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,c),_createClass(t,[{key:"toString",value:function(){return this._TAG_NAME()}}],[{key:"deserializeFromTag",value:function(e,t){if(void 0!==n.get(t))return new(n.get(t));console.error("Unknown operation tag: ",i.bytesToHex([t]))}}]),t}(),f=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 242}},{key:"_TAG_NAME",value:function(){return"reverse"}},{key:"call",value:function(e){return 0===e.length&&console.error("Can't reverse an empty message"),e.reverse()}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),p=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_TAG",value:function(){return 243}},{key:"_TAG_NAME",value:function(){return"hexlify"}},{key:"_MAX_MSG_LENGTH",value:function(){return u._MAX_RESULT_LENGTH()}},{key:"call",value:function(e){0===e.length&&console.error("Can't hexlify an empty message")}},{key:"equals",value:function(e){return e instanceof r&&i.arrEq(this.arg,e.arg)}}],[{key:"deserializeFromTag",value:function(e,t){return _get(r.__proto__||Object.getPrototypeOf(r),"deserializeFromTag",this).call(this,e,t)}}]),r}(),h=function(e){function r(){return _classCallCheck2(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,u),_createClass(r,[{key:"_HASHLIB_NAME",value:function(){return 0}},{key:"call",value:function(e,t){for(var r=("keccak256"===e._HASHLIB_NAME()?s(e._HASHLIB_NAME()).update(a.from(t)):o.createHash(e._HASHLIB_NAME()).update(a.from(t))).digest(),i=[r.length],n=0;n(new m.Op)._MAX_MSG_LENGTH())throw new TypeError("Message exceeds Op length limit; "+e.length+" > "+(new m.Op)._MAX_MSG_LENGTH());this.msg=e,this.attestations=[],this.ops=new Map}return _createClass(h,[{key:"getDigest",value:function(){return this.msg}},{key:"serialize",value:function(r){var i=this;if(!this.attestations&&!this.ops)throw new a.ValueError("An empty timestamp can't be serialized");var e=this.attestations;if(e.sort(function(e,t){return e.compareTo(t)}),1 "+t.toString()+u(o,n,i)+"\n",f+=e.strTree(a+1,o)});else if(0>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},r.charsToHex=function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&i).toString(16))}return t.join("")},r.charToByte=function(e){return e.charCodeAt(0)},r.charsToBytes=function(e){for(var t=[],r=0;r} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {Object} options optional options with properties `separator` and `dataVar`. + * @return {String} human readable string with all errors descriptions + */function errorsText(errors,options){errors=errors||this.errors;if(!errors)return'No errors';options=options||{};var separator=options.separator===undefined?', ':options.separator;var dataVar=options.dataVar===undefined?'data':options.dataVar;var text='';for(var i=0;i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;// For the source: https://gist.github.com/dperini/729294 +// For test cases: https://mathiasbynens.be/demo/url-regex +// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983. +// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu; +var URL=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i;var UUID=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;var JSON_POINTER=/^(?:\/(?:[^~/]|~0|~1)*)*$/;var JSON_POINTER_URI_FRAGMENT=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;var RELATIVE_JSON_POINTER=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;module.exports=formats;function formats(mode){mode=mode=='full'?'full':'fast';return util.copy(formats[mode]);}formats.fast={// date: http://tools.ietf.org/html/rfc3339#section-5.6 +date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,// date-time: http://tools.ietf.org/html/rfc3339#section-5.6 +time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,'date-time':/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,// uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js +uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,'uri-reference':/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,'uri-template':URITEMPLATE,url:URL,// email (sources from jsen validator): +// http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 +// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') +email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:HOSTNAME,// optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html +ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,// optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses +ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:regex,// uuid: http://tools.ietf.org/html/rfc4122 +uuid:UUID,// JSON-pointer: https://tools.ietf.org/html/rfc6901 +// uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A +'json-pointer':JSON_POINTER,'json-pointer-uri-fragment':JSON_POINTER_URI_FRAGMENT,// relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 +'relative-json-pointer':RELATIVE_JSON_POINTER};formats.full={date:date,time:time,'date-time':date_time,uri:uri,'uri-reference':URIREF,'uri-template':URITEMPLATE,url:URL,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:hostname,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:regex,uuid:UUID,'json-pointer':JSON_POINTER,'json-pointer-uri-fragment':JSON_POINTER_URI_FRAGMENT,'relative-json-pointer':RELATIVE_JSON_POINTER};function isLeapYear(year){// https://tools.ietf.org/html/rfc3339#appendix-C +return year%4===0&&(year%100!==0||year%400===0);}function date(str){// full-date from http://tools.ietf.org/html/rfc3339#section-5.6 +var matches=str.match(DATE);if(!matches)return false;var year=+matches[1];var month=+matches[2];var day=+matches[3];return month>=1&&month<=12&&day>=1&&day<=(month==2&&isLeapYear(year)?29:DAYS[month]);}function time(str,full){var matches=str.match(TIME);if(!matches)return false;var hour=matches[1];var minute=matches[2];var second=matches[3];var timeZone=matches[5];return(hour<=23&&minute<=59&&second<=59||hour==23&&minute==59&&second==60)&&(!full||timeZone);}var DATE_TIME_SEPARATOR=/t|\s/i;function date_time(str){// http://tools.ietf.org/html/rfc3339#section-5.6 +var dateTime=str.split(DATE_TIME_SEPARATOR);return dateTime.length==2&&date(dateTime[0])&&time(dateTime[1],true);}function hostname(str){// https://tools.ietf.org/html/rfc1034#section-3.5 +// https://tools.ietf.org/html/rfc1123#section-2 +return str.length<=255&&HOSTNAME.test(str);}var NOT_URI_FRAGMENT=/\/|:/;function uri(str){// http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." +return NOT_URI_FRAGMENT.test(str)&&URI.test(str);}var Z_ANCHOR=/[^\\]\\Z/;function regex(str){if(Z_ANCHOR.test(str))return false;try{new RegExp(str);return true;}catch(e){return false;}}},{"./util":12}],7:[function(require,module,exports){'use strict';var resolve=require('./resolve'),util=require('./util'),errorClasses=require('./error_classes'),stableStringify=require('fast-json-stable-stringify');var validateGenerator=require('../dotjs/validate');/** + * Functions below are used inside compiled validations function + */var ucs2length=util.ucs2length;var equal=require('fast-deep-equal');// this error is thrown by async schemas to return validation errors via exception +var ValidationError=errorClasses.Validation;module.exports=compile;/** + * Compiles schema to validation function + * @this Ajv + * @param {Object} schema schema object + * @param {Object} root object with information about the root schema for this schema + * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution + * @param {String} baseId base ID for IDs in the schema + * @return {Function} validation function + */function compile(schema,root,localRefs,baseId){/* jshint validthis: true, evil: true *//* eslint no-shadow: 0 */var self=this,opts=this._opts,refVal=[undefined],refs={},patterns=[],patternsHash={},defaults=[],defaultsHash={},customRules=[];root=root||{schema:schema,refVal:refVal,refs:refs};var c=checkCompiling.call(this,schema,root,baseId);var compilation=this._compilations[c.index];if(c.compiling)return compilation.callValidate=callValidate;var formats=this._formats;var RULES=this.RULES;try{var v=localCompile(schema,root,localRefs,baseId);compilation.validate=v;var cv=compilation.callValidate;if(cv){cv.schema=v.schema;cv.errors=null;cv.refs=v.refs;cv.refVal=v.refVal;cv.root=v.root;cv.$async=v.$async;if(opts.sourceCode)cv.source=v.source;}return v;}finally{endCompiling.call(this,schema,root,baseId);}/* @this {*} - custom context, see passContext option */function callValidate(){/* jshint validthis: true */var validate=compilation.validate;var result=validate.apply(this,arguments);callValidate.errors=validate.errors;return result;}function localCompile(_schema,_root,localRefs,baseId){var isRoot=!_root||_root&&_root.schema==_schema;if(_root.schema!=root.schema)return compile.call(self,_schema,_root,localRefs,baseId);var $async=_schema.$async===true;var sourceCode=validateGenerator({isTop:true,schema:_schema,isRoot:isRoot,baseId:baseId,root:_root,schemaPath:'',errSchemaPath:'#',errorPath:'""',MissingRefError:errorClasses.MissingRef,RULES:RULES,validate:validateGenerator,util:util,resolve:resolve,resolveRef:resolveRef,usePattern:usePattern,useDefault:useDefault,useCustomRule:useCustomRule,opts:opts,formats:formats,logger:self.logger,self:self});sourceCode=vars(refVal,refValCode)+vars(patterns,patternCode)+vars(defaults,defaultCode)+vars(customRules,customRuleCode)+sourceCode;if(opts.processCode)sourceCode=opts.processCode(sourceCode);// console.log('\n\n\n *** \n', JSON.stringify(sourceCode)); +var validate;try{var makeValidate=new Function('self','RULES','formats','root','refVal','defaults','customRules','equal','ucs2length','ValidationError',sourceCode);validate=makeValidate(self,RULES,formats,root,refVal,defaults,customRules,equal,ucs2length,ValidationError);refVal[0]=validate;}catch(e){self.logger.error('Error compiling schema, function code:',sourceCode);throw e;}validate.schema=_schema;validate.errors=null;validate.refs=refs;validate.refVal=refVal;validate.root=isRoot?validate:_root;if($async)validate.$async=true;if(opts.sourceCode===true){validate.source={code:sourceCode,patterns:patterns,defaults:defaults};}return validate;}function resolveRef(baseId,ref,isRoot){ref=resolve.url(baseId,ref);var refIndex=refs[ref];var _refVal,refCode;if(refIndex!==undefined){_refVal=refVal[refIndex];refCode='refVal['+refIndex+']';return resolvedRef(_refVal,refCode);}if(!isRoot&&root.refs){var rootRefId=root.refs[ref];if(rootRefId!==undefined){_refVal=root.refVal[rootRefId];refCode=addLocalRef(ref,_refVal);return resolvedRef(_refVal,refCode);}}refCode=addLocalRef(ref);var v=resolve.call(self,localCompile,root,ref);if(v===undefined){var localSchema=localRefs&&localRefs[ref];if(localSchema){v=resolve.inlineRef(localSchema,opts.inlineRefs)?localSchema:compile.call(self,localSchema,root,localRefs,baseId);}}if(v===undefined){removeLocalRef(ref);}else{replaceLocalRef(ref,v);return resolvedRef(v,refCode);}}function addLocalRef(ref,v){var refId=refVal.length;refVal[refId]=v;refs[ref]=refId;return'refVal'+refId;}function removeLocalRef(ref){delete refs[ref];}function replaceLocalRef(ref,v){var refId=refs[ref];refVal[refId]=v;}function resolvedRef(refVal,code){return(typeof refVal==="undefined"?"undefined":_typeof(refVal))=='object'||typeof refVal=='boolean'?{code:code,schema:refVal,inline:true}:{code:code,$async:refVal&&!!refVal.$async};}function usePattern(regexStr){var index=patternsHash[regexStr];if(index===undefined){index=patternsHash[regexStr]=patterns.length;patterns[index]=regexStr;}return'pattern'+index;}function useDefault(value){switch(typeof value==="undefined"?"undefined":_typeof(value)){case'boolean':case'number':return''+value;case'string':return util.toQuotedString(value);case'object':if(value===null)return'null';var valueStr=stableStringify(value);var index=defaultsHash[valueStr];if(index===undefined){index=defaultsHash[valueStr]=defaults.length;defaults[index]=value;}return'default'+index;}}function useCustomRule(rule,schema,parentSchema,it){var validateSchema=rule.definition.validateSchema;if(validateSchema&&self._opts.validateSchema!==false){var valid=validateSchema(schema);if(!valid){var message='keyword schema is invalid: '+self.errorsText(validateSchema.errors);if(self._opts.validateSchema=='log')self.logger.error(message);else throw new Error(message);}}var compile=rule.definition.compile,inline=rule.definition.inline,macro=rule.definition.macro;var validate;if(compile){validate=compile.call(self,schema,parentSchema,it);}else if(macro){validate=macro.call(self,schema,parentSchema,it);if(opts.validateSchema!==false)self.validateSchema(validate,true);}else if(inline){validate=inline.call(self,it,rule.keyword,schema,parentSchema);}else{validate=rule.definition.validate;if(!validate)return;}if(validate===undefined)throw new Error('custom keyword "'+rule.keyword+'"failed to compile');var index=customRules.length;customRules[index]=validate;return{code:'customRule'+index,validate:validate};}}/** + * Checks if the schema is currently compiled + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) + */function checkCompiling(schema,root,baseId){/* jshint validthis: true */var index=compIndex.call(this,schema,root,baseId);if(index>=0)return{index:index,compiling:true};index=this._compilations.length;this._compilations[index]={schema:schema,root:root,baseId:baseId};return{index:index,compiling:false};}/** + * Removes the schema from the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + */function endCompiling(schema,root,baseId){/* jshint validthis: true */var i=compIndex.call(this,schema,root,baseId);if(i>=0)this._compilations.splice(i,1);}/** + * Index of schema compilation in the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Integer} compilation index + */function compIndex(schema,root,baseId){/* jshint validthis: true */for(var i=0;i=0xD800&&value<=0xDBFF&&pos=lvl)throw new Error('Cannot access property/index '+up+' levels up, current level is '+lvl);return paths[lvl-up];}if(up>lvl)throw new Error('Cannot access data '+up+' levels up, current level is '+lvl);data='data'+(lvl-up||'');if(!jsonPointer)return data;}var expr=data;var segments=jsonPointer.split('/');for(var i=0;i',$notOp=$isMax?'>':'<',$errorKeyword=undefined;if($isDataExcl){var $schemaValueExcl=it.util.getData($schemaExcl.$data,$dataLvl,it.dataPathArr),$exclusive='exclusive'+$lvl,$exclType='exclType'+$lvl,$exclIsNumber='exclIsNumber'+$lvl,$opExpr='op'+$lvl,$opStr='\' + '+$opExpr+' + \'';out+=' var schemaExcl'+$lvl+' = '+$schemaValueExcl+'; ';$schemaValueExcl='schemaExcl'+$lvl;out+=' var '+$exclusive+'; var '+$exclType+' = typeof '+$schemaValueExcl+'; if ('+$exclType+' != \'boolean\' && '+$exclType+' != \'undefined\' && '+$exclType+' != \'number\') { ';var $errorKeyword=$exclusiveKeyword;var $$outStack=$$outStack||[];$$outStack.push(out);out='';/* istanbul ignore else */if(it.createErrors!==false){out+=' { keyword: \''+($errorKeyword||'_exclusiveLimit')+'\' , dataPath: (dataPath || \'\') + '+it.errorPath+' , schemaPath: '+it.util.toQuotedString($errSchemaPath)+' , params: {} ';if(it.opts.messages!==false){out+=' , message: \''+$exclusiveKeyword+' should be boolean\' ';}if(it.opts.verbose){out+=' , schema: validate.schema'+$schemaPath+' , parentSchema: validate.schema'+it.schemaPath+' , data: '+$data+' ';}out+=' } ';}else{out+=' {} ';}var __err=out;out=$$outStack.pop();if(!it.compositeRule&&$breakOnError){/* istanbul ignore if */if(it.async){out+=' throw new ValidationError(['+__err+']); ';}else{out+=' validate.errors = ['+__err+']; return false; ';}}else{out+=' var err = '+__err+'; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';}out+=' } else if ( ';if($isData){out+=' ('+$schemaValue+' !== undefined && typeof '+$schemaValue+' != \'number\') || ';}out+=' '+$exclType+' == \'number\' ? ( ('+$exclusive+' = '+$schemaValue+' === undefined || '+$schemaValueExcl+' '+$op+'= '+$schemaValue+') ? '+$data+' '+$notOp+'= '+$schemaValueExcl+' : '+$data+' '+$notOp+' '+$schemaValue+' ) : ( ('+$exclusive+' = '+$schemaValueExcl+' === true) ? '+$data+' '+$notOp+'= '+$schemaValue+' : '+$data+' '+$notOp+' '+$schemaValue+' ) || '+$data+' !== '+$data+') { var op'+$lvl+' = '+$exclusive+' ? \''+$op+'\' : \''+$op+'=\'; ';if($schema===undefined){$errorKeyword=$exclusiveKeyword;$errSchemaPath=it.errSchemaPath+'/'+$exclusiveKeyword;$schemaValue=$schemaValueExcl;$isData=$isDataExcl;}}else{var $exclIsNumber=typeof $schemaExcl=='number',$opStr=$op;if($exclIsNumber&&$isData){var $opExpr='\''+$opStr+'\'';out+=' if ( ';if($isData){out+=' ('+$schemaValue+' !== undefined && typeof '+$schemaValue+' != \'number\') || ';}out+=' ( '+$schemaValue+' === undefined || '+$schemaExcl+' '+$op+'= '+$schemaValue+' ? '+$data+' '+$notOp+'= '+$schemaExcl+' : '+$data+' '+$notOp+' '+$schemaValue+' ) || '+$data+' !== '+$data+') { ';}else{if($exclIsNumber&&$schema===undefined){$exclusive=true;$errorKeyword=$exclusiveKeyword;$errSchemaPath=it.errSchemaPath+'/'+$exclusiveKeyword;$schemaValue=$schemaExcl;$notOp+='=';}else{if($exclIsNumber)$schemaValue=Math[$isMax?'min':'max']($schemaExcl,$schema);if($schemaExcl===($exclIsNumber?$schemaValue:true)){$exclusive=true;$errorKeyword=$exclusiveKeyword;$errSchemaPath=it.errSchemaPath+'/'+$exclusiveKeyword;$notOp+='=';}else{$exclusive=false;$opStr+='=';}}var $opExpr='\''+$opStr+'\'';out+=' if ( ';if($isData){out+=' ('+$schemaValue+' !== undefined && typeof '+$schemaValue+' != \'number\') || ';}out+=' '+$data+' '+$notOp+' '+$schemaValue+' || '+$data+' !== '+$data+') { ';}}$errorKeyword=$errorKeyword||$keyword;var $$outStack=$$outStack||[];$$outStack.push(out);out='';/* istanbul ignore else */if(it.createErrors!==false){out+=' { keyword: \''+($errorKeyword||'_limit')+'\' , dataPath: (dataPath || \'\') + '+it.errorPath+' , schemaPath: '+it.util.toQuotedString($errSchemaPath)+' , params: { comparison: '+$opExpr+', limit: '+$schemaValue+', exclusive: '+$exclusive+' } ';if(it.opts.messages!==false){out+=' , message: \'should be '+$opStr+' ';if($isData){out+='\' + '+$schemaValue;}else{out+=''+$schemaValue+'\'';}}if(it.opts.verbose){out+=' , schema: ';if($isData){out+='validate.schema'+$schemaPath;}else{out+=''+$schema;}out+=' , parentSchema: validate.schema'+it.schemaPath+' , data: '+$data+' ';}out+=' } ';}else{out+=' {} ';}var __err=out;out=$$outStack.pop();if(!it.compositeRule&&$breakOnError){/* istanbul ignore if */if(it.async){out+=' throw new ValidationError(['+__err+']); ';}else{out+=' validate.errors = ['+__err+']; return false; ';}}else{out+=' var err = '+__err+'; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';}out+=' } ';if($breakOnError){out+=' else { ';}return out;};},{}],15:[function(require,module,exports){'use strict';module.exports=function generate__limitItems(it,$keyword,$ruleType){var out=' ';var $lvl=it.level;var $dataLvl=it.dataLevel;var $schema=it.schema[$keyword];var $schemaPath=it.schemaPath+it.util.getProperty($keyword);var $errSchemaPath=it.errSchemaPath+'/'+$keyword;var $breakOnError=!it.opts.allErrors;var $errorKeyword;var $data='data'+($dataLvl||'');var $isData=it.opts.$data&&$schema&&$schema.$data,$schemaValue;if($isData){out+=' var schema'+$lvl+' = '+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+'; ';$schemaValue='schema'+$lvl;}else{$schemaValue=$schema;}var $op=$keyword=='maxItems'?'>':'<';out+='if ( ';if($isData){out+=' ('+$schemaValue+' !== undefined && typeof '+$schemaValue+' != \'number\') || ';}out+=' '+$data+'.length '+$op+' '+$schemaValue+') { ';var $errorKeyword=$keyword;var $$outStack=$$outStack||[];$$outStack.push(out);out='';/* istanbul ignore else */if(it.createErrors!==false){out+=' { keyword: \''+($errorKeyword||'_limitItems')+'\' , dataPath: (dataPath || \'\') + '+it.errorPath+' , schemaPath: '+it.util.toQuotedString($errSchemaPath)+' , params: { limit: '+$schemaValue+' } ';if(it.opts.messages!==false){out+=' , message: \'should NOT have ';if($keyword=='maxItems'){out+='more';}else{out+='fewer';}out+=' than ';if($isData){out+='\' + '+$schemaValue+' + \'';}else{out+=''+$schema;}out+=' items\' ';}if(it.opts.verbose){out+=' , schema: ';if($isData){out+='validate.schema'+$schemaPath;}else{out+=''+$schema;}out+=' , parentSchema: validate.schema'+it.schemaPath+' , data: '+$data+' ';}out+=' } ';}else{out+=' {} ';}var __err=out;out=$$outStack.pop();if(!it.compositeRule&&$breakOnError){/* istanbul ignore if */if(it.async){out+=' throw new ValidationError(['+__err+']); ';}else{out+=' validate.errors = ['+__err+']; return false; ';}}else{out+=' var err = '+__err+'; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';}out+='} ';if($breakOnError){out+=' else { ';}return out;};},{}],16:[function(require,module,exports){'use strict';module.exports=function generate__limitLength(it,$keyword,$ruleType){var out=' ';var $lvl=it.level;var $dataLvl=it.dataLevel;var $schema=it.schema[$keyword];var $schemaPath=it.schemaPath+it.util.getProperty($keyword);var $errSchemaPath=it.errSchemaPath+'/'+$keyword;var $breakOnError=!it.opts.allErrors;var $errorKeyword;var $data='data'+($dataLvl||'');var $isData=it.opts.$data&&$schema&&$schema.$data,$schemaValue;if($isData){out+=' var schema'+$lvl+' = '+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+'; ';$schemaValue='schema'+$lvl;}else{$schemaValue=$schema;}var $op=$keyword=='maxLength'?'>':'<';out+='if ( ';if($isData){out+=' ('+$schemaValue+' !== undefined && typeof '+$schemaValue+' != \'number\') || ';}if(it.opts.unicode===false){out+=' '+$data+'.length ';}else{out+=' ucs2length('+$data+') ';}out+=' '+$op+' '+$schemaValue+') { ';var $errorKeyword=$keyword;var $$outStack=$$outStack||[];$$outStack.push(out);out='';/* istanbul ignore else */if(it.createErrors!==false){out+=' { keyword: \''+($errorKeyword||'_limitLength')+'\' , dataPath: (dataPath || \'\') + '+it.errorPath+' , schemaPath: '+it.util.toQuotedString($errSchemaPath)+' , params: { limit: '+$schemaValue+' } ';if(it.opts.messages!==false){out+=' , message: \'should NOT be ';if($keyword=='maxLength'){out+='longer';}else{out+='shorter';}out+=' than ';if($isData){out+='\' + '+$schemaValue+' + \'';}else{out+=''+$schema;}out+=' characters\' ';}if(it.opts.verbose){out+=' , schema: ';if($isData){out+='validate.schema'+$schemaPath;}else{out+=''+$schema;}out+=' , parentSchema: validate.schema'+it.schemaPath+' , data: '+$data+' ';}out+=' } ';}else{out+=' {} ';}var __err=out;out=$$outStack.pop();if(!it.compositeRule&&$breakOnError){/* istanbul ignore if */if(it.async){out+=' throw new ValidationError(['+__err+']); ';}else{out+=' validate.errors = ['+__err+']; return false; ';}}else{out+=' var err = '+__err+'; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';}out+='} ';if($breakOnError){out+=' else { ';}return out;};},{}],17:[function(require,module,exports){'use strict';module.exports=function generate__limitProperties(it,$keyword,$ruleType){var out=' ';var $lvl=it.level;var $dataLvl=it.dataLevel;var $schema=it.schema[$keyword];var $schemaPath=it.schemaPath+it.util.getProperty($keyword);var $errSchemaPath=it.errSchemaPath+'/'+$keyword;var $breakOnError=!it.opts.allErrors;var $errorKeyword;var $data='data'+($dataLvl||'');var $isData=it.opts.$data&&$schema&&$schema.$data,$schemaValue;if($isData){out+=' var schema'+$lvl+' = '+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+'; ';$schemaValue='schema'+$lvl;}else{$schemaValue=$schema;}var $op=$keyword=='maxProperties'?'>':'<';out+='if ( ';if($isData){out+=' ('+$schemaValue+' !== undefined && typeof '+$schemaValue+' != \'number\') || ';}out+=' Object.keys('+$data+').length '+$op+' '+$schemaValue+') { ';var $errorKeyword=$keyword;var $$outStack=$$outStack||[];$$outStack.push(out);out='';/* istanbul ignore else */if(it.createErrors!==false){out+=' { keyword: \''+($errorKeyword||'_limitProperties')+'\' , dataPath: (dataPath || \'\') + '+it.errorPath+' , schemaPath: '+it.util.toQuotedString($errSchemaPath)+' , params: { limit: '+$schemaValue+' } ';if(it.opts.messages!==false){out+=' , message: \'should NOT have ';if($keyword=='maxProperties'){out+='more';}else{out+='fewer';}out+=' than ';if($isData){out+='\' + '+$schemaValue+' + \'';}else{out+=''+$schema;}out+=' properties\' ';}if(it.opts.verbose){out+=' , schema: ';if($isData){out+='validate.schema'+$schemaPath;}else{out+=''+$schema;}out+=' , parentSchema: validate.schema'+it.schemaPath+' , data: '+$data+' ';}out+=' } ';}else{out+=' {} ';}var __err=out;out=$$outStack.pop();if(!it.compositeRule&&$breakOnError){/* istanbul ignore if */if(it.async){out+=' throw new ValidationError(['+__err+']); ';}else{out+=' validate.errors = ['+__err+']; return false; ';}}else{out+=' var err = '+__err+'; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';}out+='} ';if($breakOnError){out+=' else { ';}return out;};},{}],18:[function(require,module,exports){'use strict';module.exports=function generate_allOf(it,$keyword,$ruleType){var out=' ';var $schema=it.schema[$keyword];var $schemaPath=it.schemaPath+it.util.getProperty($keyword);var $errSchemaPath=it.errSchemaPath+'/'+$keyword;var $breakOnError=!it.opts.allErrors;var $it=it.util.copy(it);var $closingBraces='';$it.level++;var $nextValid='valid'+$it.level;var $currentBaseId=$it.baseId,$allSchemasEmpty=true;var arr1=$schema;if(arr1){var $sch,$i=-1,l1=arr1.length-1;while($i=0){if($breakOnError){out+=' if (true) { ';}return out;}else{throw new Error('unknown format "'+$schema+'" is used in schema at path "'+it.errSchemaPath+'"');}}var $isObject=(typeof $format==="undefined"?"undefined":_typeof($format))=='object'&&!($format instanceof RegExp)&&$format.validate;var $formatType=$isObject&&$format.type||'string';if($isObject){var $async=$format.async===true;$format=$format.validate;}if($formatType!=$ruleType){if($breakOnError){out+=' if (true) { ';}return out;}if($async){if(!it.async)throw new Error('async format in sync schema');var $formatRef='formats'+it.util.getProperty($schema)+'.validate';out+=' if (!(await '+$formatRef+'('+$data+'))) { ';}else{out+=' if (! ';var $formatRef='formats'+it.util.getProperty($schema);if($isObject)$formatRef+='.validate';if(typeof $format=='function'){out+=' '+$formatRef+'('+$data+') ';}else{out+=' '+$formatRef+'.test('+$data+') ';}out+=') { ';}}var $$outStack=$$outStack||[];$$outStack.push(out);out='';/* istanbul ignore else */if(it.createErrors!==false){out+=' { keyword: \''+'format'+'\' , dataPath: (dataPath || \'\') + '+it.errorPath+' , schemaPath: '+it.util.toQuotedString($errSchemaPath)+' , params: { format: ';if($isData){out+=''+$schemaValue;}else{out+=''+it.util.toQuotedString($schema);}out+=' } ';if(it.opts.messages!==false){out+=' , message: \'should match format "';if($isData){out+='\' + '+$schemaValue+' + \'';}else{out+=''+it.util.escapeQuotes($schema);}out+='"\' ';}if(it.opts.verbose){out+=' , schema: ';if($isData){out+='validate.schema'+$schemaPath;}else{out+=''+it.util.toQuotedString($schema);}out+=' , parentSchema: validate.schema'+it.schemaPath+' , data: '+$data+' ';}out+=' } ';}else{out+=' {} ';}var __err=out;out=$$outStack.pop();if(!it.compositeRule&&$breakOnError){/* istanbul ignore if */if(it.async){out+=' throw new ValidationError(['+__err+']); ';}else{out+=' validate.errors = ['+__err+']; return false; ';}}else{out+=' var err = '+__err+'; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';}out+=' } ';if($breakOnError){out+=' else { ';}return out;};},{}],27:[function(require,module,exports){'use strict';module.exports=function generate_if(it,$keyword,$ruleType){var out=' ';var $lvl=it.level;var $dataLvl=it.dataLevel;var $schema=it.schema[$keyword];var $schemaPath=it.schemaPath+it.util.getProperty($keyword);var $errSchemaPath=it.errSchemaPath+'/'+$keyword;var $breakOnError=!it.opts.allErrors;var $data='data'+($dataLvl||'');var $valid='valid'+$lvl;var $errs='errs__'+$lvl;var $it=it.util.copy(it);$it.level++;var $nextValid='valid'+$it.level;var $thenSch=it.schema['then'],$elseSch=it.schema['else'],$thenPresent=$thenSch!==undefined&&it.util.schemaHasRules($thenSch,it.RULES.all),$elsePresent=$elseSch!==undefined&&it.util.schemaHasRules($elseSch,it.RULES.all),$currentBaseId=$it.baseId;if($thenPresent||$elsePresent){var $ifClause;$it.createErrors=false;$it.schema=$schema;$it.schemaPath=$schemaPath;$it.errSchemaPath=$errSchemaPath;out+=' var '+$errs+' = errors; var '+$valid+' = true; ';var $wasComposite=it.compositeRule;it.compositeRule=$it.compositeRule=true;out+=' '+it.validate($it)+' ';$it.baseId=$currentBaseId;$it.createErrors=true;out+=' errors = '+$errs+'; if (vErrors !== null) { if ('+$errs+') vErrors.length = '+$errs+'; else vErrors = null; } ';it.compositeRule=$it.compositeRule=$wasComposite;if($thenPresent){out+=' if ('+$nextValid+') { ';$it.schema=it.schema['then'];$it.schemaPath=it.schemaPath+'.then';$it.errSchemaPath=it.errSchemaPath+'/then';out+=' '+it.validate($it)+' ';$it.baseId=$currentBaseId;out+=' '+$valid+' = '+$nextValid+'; ';if($thenPresent&&$elsePresent){$ifClause='ifClause'+$lvl;out+=' var '+$ifClause+' = \'then\'; ';}else{$ifClause='\'then\'';}out+=' } ';if($elsePresent){out+=' else { ';}}else{out+=' if (!'+$nextValid+') { ';}if($elsePresent){$it.schema=it.schema['else'];$it.schemaPath=it.schemaPath+'.else';$it.errSchemaPath=it.errSchemaPath+'/else';out+=' '+it.validate($it)+' ';$it.baseId=$currentBaseId;out+=' '+$valid+' = '+$nextValid+'; ';if($thenPresent&&$elsePresent){$ifClause='ifClause'+$lvl;out+=' var '+$ifClause+' = \'else\'; ';}else{$ifClause='\'else\'';}out+=' } ';}out+=' if (!'+$valid+') { var err = ';/* istanbul ignore else */if(it.createErrors!==false){out+=' { keyword: \''+'if'+'\' , dataPath: (dataPath || \'\') + '+it.errorPath+' , schemaPath: '+it.util.toQuotedString($errSchemaPath)+' , params: { failingKeyword: '+$ifClause+' } ';if(it.opts.messages!==false){out+=' , message: \'should match "\' + '+$ifClause+' + \'" schema\' ';}if(it.opts.verbose){out+=' , schema: validate.schema'+$schemaPath+' , parentSchema: validate.schema'+it.schemaPath+' , data: '+$data+' ';}out+=' } ';}else{out+=' {} ';}out+='; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';if(!it.compositeRule&&$breakOnError){/* istanbul ignore if */if(it.async){out+=' throw new ValidationError(vErrors); ';}else{out+=' validate.errors = vErrors; return false; ';}}out+=' } ';if($breakOnError){out+=' else { ';}out=it.util.cleanUpCode(out);}else{if($breakOnError){out+=' if (true) { ';}}return out;};},{}],28:[function(require,module,exports){'use strict';//all requires must be explicit because browserify won't work with dynamic requires +module.exports={'$ref':require('./ref'),allOf:require('./allOf'),anyOf:require('./anyOf'),'$comment':require('./comment'),const:require('./const'),contains:require('./contains'),dependencies:require('./dependencies'),'enum':require('./enum'),format:require('./format'),'if':require('./if'),items:require('./items'),maximum:require('./_limit'),minimum:require('./_limit'),maxItems:require('./_limitItems'),minItems:require('./_limitItems'),maxLength:require('./_limitLength'),minLength:require('./_limitLength'),maxProperties:require('./_limitProperties'),minProperties:require('./_limitProperties'),multipleOf:require('./multipleOf'),not:require('./not'),oneOf:require('./oneOf'),pattern:require('./pattern'),properties:require('./properties'),propertyNames:require('./propertyNames'),required:require('./required'),uniqueItems:require('./uniqueItems'),validate:require('./validate')};},{"./_limit":14,"./_limitItems":15,"./_limitLength":16,"./_limitProperties":17,"./allOf":18,"./anyOf":19,"./comment":20,"./const":21,"./contains":22,"./dependencies":24,"./enum":25,"./format":26,"./if":27,"./items":29,"./multipleOf":30,"./not":31,"./oneOf":32,"./pattern":33,"./properties":34,"./propertyNames":35,"./ref":36,"./required":37,"./uniqueItems":38,"./validate":39}],29:[function(require,module,exports){'use strict';module.exports=function generate_items(it,$keyword,$ruleType){var out=' ';var $lvl=it.level;var $dataLvl=it.dataLevel;var $schema=it.schema[$keyword];var $schemaPath=it.schemaPath+it.util.getProperty($keyword);var $errSchemaPath=it.errSchemaPath+'/'+$keyword;var $breakOnError=!it.opts.allErrors;var $data='data'+($dataLvl||'');var $valid='valid'+$lvl;var $errs='errs__'+$lvl;var $it=it.util.copy(it);var $closingBraces='';$it.level++;var $nextValid='valid'+$it.level;var $idx='i'+$lvl,$dataNxt=$it.dataLevel=it.dataLevel+1,$nextData='data'+$dataNxt,$currentBaseId=it.baseId;out+='var '+$errs+' = errors;var '+$valid+';';if(Array.isArray($schema)){var $additionalItems=it.schema.additionalItems;if($additionalItems===false){out+=' '+$valid+' = '+$data+'.length <= '+$schema.length+'; ';var $currErrSchemaPath=$errSchemaPath;$errSchemaPath=it.errSchemaPath+'/additionalItems';out+=' if (!'+$valid+') { ';var $$outStack=$$outStack||[];$$outStack.push(out);out='';/* istanbul ignore else */if(it.createErrors!==false){out+=' { keyword: \''+'additionalItems'+'\' , dataPath: (dataPath || \'\') + '+it.errorPath+' , schemaPath: '+it.util.toQuotedString($errSchemaPath)+' , params: { limit: '+$schema.length+' } ';if(it.opts.messages!==false){out+=' , message: \'should NOT have more than '+$schema.length+' items\' ';}if(it.opts.verbose){out+=' , schema: false , parentSchema: validate.schema'+it.schemaPath+' , data: '+$data+' ';}out+=' } ';}else{out+=' {} ';}var __err=out;out=$$outStack.pop();if(!it.compositeRule&&$breakOnError){/* istanbul ignore if */if(it.async){out+=' throw new ValidationError(['+__err+']); ';}else{out+=' validate.errors = ['+__err+']; return false; ';}}else{out+=' var err = '+__err+'; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';}out+=' } ';$errSchemaPath=$currErrSchemaPath;if($breakOnError){$closingBraces+='}';out+=' else { ';}}var arr1=$schema;if(arr1){var $sch,$i=-1,l1=arr1.length-1;while($i '+$i+') { ';var $passData=$data+'['+$i+']';$it.schema=$sch;$it.schemaPath=$schemaPath+'['+$i+']';$it.errSchemaPath=$errSchemaPath+'/'+$i;$it.errorPath=it.util.getPathExpr(it.errorPath,$i,it.opts.jsonPointers,true);$it.dataPathArr[$dataNxt]=$i;var $code=it.validate($it);$it.baseId=$currentBaseId;if(it.util.varOccurences($code,$nextData)<2){out+=' '+it.util.varReplace($code,$nextData,$passData)+' ';}else{out+=' var '+$nextData+' = '+$passData+'; '+$code+' ';}out+=' } ';if($breakOnError){out+=' if ('+$nextValid+') { ';$closingBraces+='}';}}}}if((typeof $additionalItems==="undefined"?"undefined":_typeof($additionalItems))=='object'&&it.util.schemaHasRules($additionalItems,it.RULES.all)){$it.schema=$additionalItems;$it.schemaPath=it.schemaPath+'.additionalItems';$it.errSchemaPath=it.errSchemaPath+'/additionalItems';out+=' '+$nextValid+' = true; if ('+$data+'.length > '+$schema.length+') { for (var '+$idx+' = '+$schema.length+'; '+$idx+' < '+$data+'.length; '+$idx+'++) { ';$it.errorPath=it.util.getPathExpr(it.errorPath,$idx,it.opts.jsonPointers,true);var $passData=$data+'['+$idx+']';$it.dataPathArr[$dataNxt]=$idx;var $code=it.validate($it);$it.baseId=$currentBaseId;if(it.util.varOccurences($code,$nextData)<2){out+=' '+it.util.varReplace($code,$nextData,$passData)+' ';}else{out+=' var '+$nextData+' = '+$passData+'; '+$code+' ';}if($breakOnError){out+=' if (!'+$nextValid+') break; ';}out+=' } } ';if($breakOnError){out+=' if ('+$nextValid+') { ';$closingBraces+='}';}}}else if(it.util.schemaHasRules($schema,it.RULES.all)){$it.schema=$schema;$it.schemaPath=$schemaPath;$it.errSchemaPath=$errSchemaPath;out+=' for (var '+$idx+' = '+0+'; '+$idx+' < '+$data+'.length; '+$idx+'++) { ';$it.errorPath=it.util.getPathExpr(it.errorPath,$idx,it.opts.jsonPointers,true);var $passData=$data+'['+$idx+']';$it.dataPathArr[$dataNxt]=$idx;var $code=it.validate($it);$it.baseId=$currentBaseId;if(it.util.varOccurences($code,$nextData)<2){out+=' '+it.util.varReplace($code,$nextData,$passData)+' ';}else{out+=' var '+$nextData+' = '+$passData+'; '+$code+' ';}if($breakOnError){out+=' if (!'+$nextValid+') break; ';}out+=' }';}if($breakOnError){out+=' '+$closingBraces+' if ('+$errs+' == errors) {';}out=it.util.cleanUpCode(out);return out;};},{}],30:[function(require,module,exports){'use strict';module.exports=function generate_multipleOf(it,$keyword,$ruleType){var out=' ';var $lvl=it.level;var $dataLvl=it.dataLevel;var $schema=it.schema[$keyword];var $schemaPath=it.schemaPath+it.util.getProperty($keyword);var $errSchemaPath=it.errSchemaPath+'/'+$keyword;var $breakOnError=!it.opts.allErrors;var $data='data'+($dataLvl||'');var $isData=it.opts.$data&&$schema&&$schema.$data,$schemaValue;if($isData){out+=' var schema'+$lvl+' = '+it.util.getData($schema.$data,$dataLvl,it.dataPathArr)+'; ';$schemaValue='schema'+$lvl;}else{$schemaValue=$schema;}out+='var division'+$lvl+';if (';if($isData){out+=' '+$schemaValue+' !== undefined && ( typeof '+$schemaValue+' != \'number\' || ';}out+=' (division'+$lvl+' = '+$data+' / '+$schemaValue+', ';if(it.opts.multipleOfPrecision){out+=' Math.abs(Math.round(division'+$lvl+') - division'+$lvl+') > 1e-'+it.opts.multipleOfPrecision+' ';}else{out+=' division'+$lvl+' !== parseInt(division'+$lvl+') ';}out+=' ) ';if($isData){out+=' ) ';}out+=' ) { ';var $$outStack=$$outStack||[];$$outStack.push(out);out='';/* istanbul ignore else */if(it.createErrors!==false){out+=' { keyword: \''+'multipleOf'+'\' , dataPath: (dataPath || \'\') + '+it.errorPath+' , schemaPath: '+it.util.toQuotedString($errSchemaPath)+' , params: { multipleOf: '+$schemaValue+' } ';if(it.opts.messages!==false){out+=' , message: \'should be multiple of ';if($isData){out+='\' + '+$schemaValue;}else{out+=''+$schemaValue+'\'';}}if(it.opts.verbose){out+=' , schema: ';if($isData){out+='validate.schema'+$schemaPath;}else{out+=''+$schema;}out+=' , parentSchema: validate.schema'+it.schemaPath+' , data: '+$data+' ';}out+=' } ';}else{out+=' {} ';}var __err=out;out=$$outStack.pop();if(!it.compositeRule&&$breakOnError){/* istanbul ignore if */if(it.async){out+=' throw new ValidationError(['+__err+']); ';}else{out+=' validate.errors = ['+__err+']; return false; ';}}else{out+=' var err = '+__err+'; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';}out+='} ';if($breakOnError){out+=' else { ';}return out;};},{}],31:[function(require,module,exports){'use strict';module.exports=function generate_not(it,$keyword,$ruleType){var out=' ';var $lvl=it.level;var $dataLvl=it.dataLevel;var $schema=it.schema[$keyword];var $schemaPath=it.schemaPath+it.util.getProperty($keyword);var $errSchemaPath=it.errSchemaPath+'/'+$keyword;var $breakOnError=!it.opts.allErrors;var $data='data'+($dataLvl||'');var $errs='errs__'+$lvl;var $it=it.util.copy(it);$it.level++;var $nextValid='valid'+$it.level;if(it.util.schemaHasRules($schema,it.RULES.all)){$it.schema=$schema;$it.schemaPath=$schemaPath;$it.errSchemaPath=$errSchemaPath;out+=' var '+$errs+' = errors; ';var $wasComposite=it.compositeRule;it.compositeRule=$it.compositeRule=true;$it.createErrors=false;var $allErrorsOption;if($it.opts.allErrors){$allErrorsOption=$it.opts.allErrors;$it.opts.allErrors=false;}out+=' '+it.validate($it)+' ';$it.createErrors=true;if($allErrorsOption)$it.opts.allErrors=$allErrorsOption;it.compositeRule=$it.compositeRule=$wasComposite;out+=' if ('+$nextValid+') { ';var $$outStack=$$outStack||[];$$outStack.push(out);out='';/* istanbul ignore else */if(it.createErrors!==false){out+=' { keyword: \''+'not'+'\' , dataPath: (dataPath || \'\') + '+it.errorPath+' , schemaPath: '+it.util.toQuotedString($errSchemaPath)+' , params: {} ';if(it.opts.messages!==false){out+=' , message: \'should NOT be valid\' ';}if(it.opts.verbose){out+=' , schema: validate.schema'+$schemaPath+' , parentSchema: validate.schema'+it.schemaPath+' , data: '+$data+' ';}out+=' } ';}else{out+=' {} ';}var __err=out;out=$$outStack.pop();if(!it.compositeRule&&$breakOnError){/* istanbul ignore if */if(it.async){out+=' throw new ValidationError(['+__err+']); ';}else{out+=' validate.errors = ['+__err+']; return false; ';}}else{out+=' var err = '+__err+'; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';}out+=' } else { errors = '+$errs+'; if (vErrors !== null) { if ('+$errs+') vErrors.length = '+$errs+'; else vErrors = null; } ';if(it.opts.allErrors){out+=' } ';}}else{out+=' var err = ';/* istanbul ignore else */if(it.createErrors!==false){out+=' { keyword: \''+'not'+'\' , dataPath: (dataPath || \'\') + '+it.errorPath+' , schemaPath: '+it.util.toQuotedString($errSchemaPath)+' , params: {} ';if(it.opts.messages!==false){out+=' , message: \'should NOT be valid\' ';}if(it.opts.verbose){out+=' , schema: validate.schema'+$schemaPath+' , parentSchema: validate.schema'+it.schemaPath+' , data: '+$data+' ';}out+=' } ';}else{out+=' {} ';}out+='; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';if($breakOnError){out+=' if (false) { ';}}return out;};},{}],32:[function(require,module,exports){'use strict';module.exports=function generate_oneOf(it,$keyword,$ruleType){var out=' ';var $lvl=it.level;var $dataLvl=it.dataLevel;var $schema=it.schema[$keyword];var $schemaPath=it.schemaPath+it.util.getProperty($keyword);var $errSchemaPath=it.errSchemaPath+'/'+$keyword;var $breakOnError=!it.opts.allErrors;var $data='data'+($dataLvl||'');var $valid='valid'+$lvl;var $errs='errs__'+$lvl;var $it=it.util.copy(it);var $closingBraces='';$it.level++;var $nextValid='valid'+$it.level;var $currentBaseId=$it.baseId,$prevValid='prevValid'+$lvl,$passingSchemas='passingSchemas'+$lvl;out+='var '+$errs+' = errors , '+$prevValid+' = false , '+$valid+' = false , '+$passingSchemas+' = null; ';var $wasComposite=it.compositeRule;it.compositeRule=$it.compositeRule=true;var arr1=$schema;if(arr1){var $sch,$i=-1,l1=arr1.length-1;while($i8){out+=' || validate.schema'+$schemaPath+'.hasOwnProperty('+$key+') ';}else{var arr1=$schemaKeys;if(arr1){var $propertyKey,i1=-1,l1=arr1.length-1;while(i1=it.opts.loopRequired,$ownProperties=it.opts.ownProperties;if($breakOnError){out+=' var missing'+$lvl+'; ';if($loopRequired){if(!$isData){out+=' var '+$vSchema+' = validate.schema'+$schemaPath+'; ';}var $i='i'+$lvl,$propertyPath='schema'+$lvl+'['+$i+']',$missingProperty='\' + '+$propertyPath+' + \'';if(it.opts._errorDataPathProperty){it.errorPath=it.util.getPathExpr($currentErrorPath,$propertyPath,it.opts.jsonPointers);}out+=' var '+$valid+' = true; ';if($isData){out+=' if (schema'+$lvl+' === undefined) '+$valid+' = true; else if (!Array.isArray(schema'+$lvl+')) '+$valid+' = false; else {';}out+=' for (var '+$i+' = 0; '+$i+' < '+$vSchema+'.length; '+$i+'++) { '+$valid+' = '+$data+'['+$vSchema+'['+$i+']] !== undefined ';if($ownProperties){out+=' && Object.prototype.hasOwnProperty.call('+$data+', '+$vSchema+'['+$i+']) ';}out+='; if (!'+$valid+') break; } ';if($isData){out+=' } ';}out+=' if (!'+$valid+') { ';var $$outStack=$$outStack||[];$$outStack.push(out);out='';/* istanbul ignore else */if(it.createErrors!==false){out+=' { keyword: \''+'required'+'\' , dataPath: (dataPath || \'\') + '+it.errorPath+' , schemaPath: '+it.util.toQuotedString($errSchemaPath)+' , params: { missingProperty: \''+$missingProperty+'\' } ';if(it.opts.messages!==false){out+=' , message: \'';if(it.opts._errorDataPathProperty){out+='is a required property';}else{out+='should have required property \\\''+$missingProperty+'\\\'';}out+='\' ';}if(it.opts.verbose){out+=' , schema: validate.schema'+$schemaPath+' , parentSchema: validate.schema'+it.schemaPath+' , data: '+$data+' ';}out+=' } ';}else{out+=' {} ';}var __err=out;out=$$outStack.pop();if(!it.compositeRule&&$breakOnError){/* istanbul ignore if */if(it.async){out+=' throw new ValidationError(['+__err+']); ';}else{out+=' validate.errors = ['+__err+']; return false; ';}}else{out+=' var err = '+__err+'; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';}out+=' } else { ';}else{out+=' if ( ';var arr2=$required;if(arr2){var $propertyKey,$i=-1,l2=arr2.length-1;while($i 1) { ';var $itemType=it.schema.items&&it.schema.items.type,$typeIsArray=Array.isArray($itemType);if(!$itemType||$itemType=='object'||$itemType=='array'||$typeIsArray&&($itemType.indexOf('object')>=0||$itemType.indexOf('array')>=0)){out+=' outer: for (;i--;) { for (j = i; j--;) { if (equal('+$data+'[i], '+$data+'[j])) { '+$valid+' = false; break outer; } } } ';}else{out+=' var itemIndices = {}, item; for (;i--;) { var item = '+$data+'[i]; ';var $method='checkDataType'+($typeIsArray?'s':'');out+=' if ('+it.util[$method]($itemType,'item',true)+') continue; ';if($typeIsArray){out+=' if (typeof item == \'string\') item = \'"\' + item; ';}out+=' if (typeof itemIndices[item] == \'number\') { '+$valid+' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ';}out+=' } ';if($isData){out+=' } ';}out+=' if (!'+$valid+') { ';var $$outStack=$$outStack||[];$$outStack.push(out);out='';/* istanbul ignore else */if(it.createErrors!==false){out+=' { keyword: \''+'uniqueItems'+'\' , dataPath: (dataPath || \'\') + '+it.errorPath+' , schemaPath: '+it.util.toQuotedString($errSchemaPath)+' , params: { i: i, j: j } ';if(it.opts.messages!==false){out+=' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' ';}if(it.opts.verbose){out+=' , schema: ';if($isData){out+='validate.schema'+$schemaPath;}else{out+=''+$schema;}out+=' , parentSchema: validate.schema'+it.schemaPath+' , data: '+$data+' ';}out+=' } ';}else{out+=' {} ';}var __err=out;out=$$outStack.pop();if(!it.compositeRule&&$breakOnError){/* istanbul ignore if */if(it.async){out+=' throw new ValidationError(['+__err+']); ';}else{out+=' validate.errors = ['+__err+']; return false; ';}}else{out+=' var err = '+__err+'; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';}out+=' } ';if($breakOnError){out+=' else { ';}}else{if($breakOnError){out+=' if (true) { ';}}return out;};},{}],39:[function(require,module,exports){'use strict';module.exports=function generate_validate(it,$keyword,$ruleType){var out='';var $async=it.schema.$async===true,$refKeywords=it.util.schemaHasRulesExcept(it.schema,it.RULES.all,'$ref'),$id=it.self._getId(it.schema);if(it.isTop){out+=' var validate = ';if($async){it.async=true;out+='async ';}out+='function(data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; ';if($id&&(it.opts.sourceCode||it.opts.processCode)){out+=' '+('/\*# sourceURL='+$id+' */')+' ';}}if(typeof it.schema=='boolean'||!($refKeywords||it.schema.$ref)){var $keyword='false schema';var $lvl=it.level;var $dataLvl=it.dataLevel;var $schema=it.schema[$keyword];var $schemaPath=it.schemaPath+it.util.getProperty($keyword);var $errSchemaPath=it.errSchemaPath+'/'+$keyword;var $breakOnError=!it.opts.allErrors;var $errorKeyword;var $data='data'+($dataLvl||'');var $valid='valid'+$lvl;if(it.schema===false){if(it.isTop){$breakOnError=true;}else{out+=' var '+$valid+' = false; ';}var $$outStack=$$outStack||[];$$outStack.push(out);out='';/* istanbul ignore else */if(it.createErrors!==false){out+=' { keyword: \''+($errorKeyword||'false schema')+'\' , dataPath: (dataPath || \'\') + '+it.errorPath+' , schemaPath: '+it.util.toQuotedString($errSchemaPath)+' , params: {} ';if(it.opts.messages!==false){out+=' , message: \'boolean schema is false\' ';}if(it.opts.verbose){out+=' , schema: false , parentSchema: validate.schema'+it.schemaPath+' , data: '+$data+' ';}out+=' } ';}else{out+=' {} ';}var __err=out;out=$$outStack.pop();if(!it.compositeRule&&$breakOnError){/* istanbul ignore if */if(it.async){out+=' throw new ValidationError(['+__err+']); ';}else{out+=' validate.errors = ['+__err+']; return false; ';}}else{out+=' var err = '+__err+'; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';}}else{if(it.isTop){if($async){out+=' return data; ';}else{out+=' validate.errors = null; return true; ';}}else{out+=' var '+$valid+' = true; ';}}if(it.isTop){out+=' }; return validate; ';}return out;}if(it.isTop){var $top=it.isTop,$lvl=it.level=0,$dataLvl=it.dataLevel=0,$data='data';it.rootId=it.resolve.fullPath(it.self._getId(it.root.schema));it.baseId=it.baseId||it.rootId;delete it.isTop;it.dataPathArr=[undefined];out+=' var vErrors = null; ';out+=' var errors = 0; ';out+=' if (rootData === undefined) rootData = data; ';}else{var $lvl=it.level,$dataLvl=it.dataLevel,$data='data'+($dataLvl||'');if($id)it.baseId=it.resolve.url(it.baseId,$id);if($async&&!it.async)throw new Error('async schema in sync schema');out+=' var errs_'+$lvl+' = errors;';}var $valid='valid'+$lvl,$breakOnError=!it.opts.allErrors,$closingBraces1='',$closingBraces2='';var $errorKeyword;var $typeSchema=it.schema.type,$typeIsArray=Array.isArray($typeSchema);if($typeIsArray&&$typeSchema.length==1){$typeSchema=$typeSchema[0];$typeIsArray=false;}if(it.schema.$ref&&$refKeywords){if(it.opts.extendRefs=='fail'){throw new Error('$ref: validation keywords used in schema at path "'+it.errSchemaPath+'" (see option extendRefs)');}else if(it.opts.extendRefs!==true){$refKeywords=false;it.logger.warn('$ref: keywords ignored in schema at path "'+it.errSchemaPath+'"');}}if(it.schema.$comment&&it.opts.$comment){out+=' '+it.RULES.all.$comment.code(it,'$comment');}if($typeSchema){if(it.opts.coerceTypes){var $coerceToTypes=it.util.coerceToTypes(it.opts.coerceTypes,$typeSchema);}var $rulesGroup=it.RULES.types[$typeSchema];if($coerceToTypes||$typeIsArray||$rulesGroup===true||$rulesGroup&&!$shouldUseGroup($rulesGroup)){var $schemaPath=it.schemaPath+'.type',$errSchemaPath=it.errSchemaPath+'/type';var $schemaPath=it.schemaPath+'.type',$errSchemaPath=it.errSchemaPath+'/type',$method=$typeIsArray?'checkDataTypes':'checkDataType';out+=' if ('+it.util[$method]($typeSchema,$data,true)+') { ';if($coerceToTypes){var $dataType='dataType'+$lvl,$coerced='coerced'+$lvl;out+=' var '+$dataType+' = typeof '+$data+'; ';if(it.opts.coerceTypes=='array'){out+=' if ('+$dataType+' == \'object\' && Array.isArray('+$data+')) '+$dataType+' = \'array\'; ';}out+=' var '+$coerced+' = undefined; ';var $bracesCoercion='';var arr1=$coerceToTypes;if(arr1){var $type,$i=-1,l1=arr1.length-1;while($icapacity){// Manually shift all values starting at the index back to the +// beginning of the queue. +for(var scan=0,newLength=queue.length-index;scan>6];var primitive=(tag&0x20)===0;// Multi-octet tag - load +if((tag&0x1f)===0x1f){var oct=tag;tag=0;while((oct&0x80)===0x80){oct=buf.readUInt8(fail);if(buf.isError(oct))return oct;tag<<=7;tag|=oct&0x7f;}}else{tag&=0x1f;}var tagStr=der.tag[tag];return{cls:cls,primitive:primitive,tag:tag,tagStr:tagStr};}function derDecodeLen(buf,primitive,fail){var len=buf.readUInt8(fail);if(buf.isError(len))return len;// Indefinite form +if(!primitive&&len===0x80)return null;// Definite form +if((len&0x80)===0){// Short form +return len;}// Long form +var num=len&0x7f;if(num>4)return buf.error('length octect is too long');len=0;for(var i=0;i=0x100;i>>=8){lenOctets++;}var header=new Buffer(1+1+lenOctets);header[0]=encodedTag;header[1]=0x80|lenOctets;for(var i=1+lenOctets,j=content.length;j>0;i--,j>>=8){header[i]=j&0xff;}return this._createEncoderBuffer([header,content]);};DERNode.prototype._encodeStr=function encodeStr(str,tag){if(tag==='bitstr'){return this._createEncoderBuffer([str.unused|0,str.data]);}else if(tag==='bmpstr'){var buf=new Buffer(str.length*2);for(var i=0;i=40)return this.reporter.error('Second objid identifier OOB');id.splice(0,2,id[0]*40+id[1]);}// Count number of octets +var size=0;for(var i=0;i=0x80;ident>>=7){size++;}}var objid=new Buffer(size);var offset=objid.length-1;for(var i=id.length-1;i>=0;i--){var ident=id[i];objid[offset--]=ident&0x7f;while((ident>>=7)>0){objid[offset--]=0x80|ident&0x7f;}}return this._createEncoderBuffer(objid);};function two(num){if(num<10)return'0'+num;else return num;}DERNode.prototype._encodeTime=function encodeTime(time,tag){var str;var date=new Date(time);if(tag==='gentime'){str=[two(date.getFullYear()),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),'Z'].join('');}else if(tag==='utctime'){str=[two(date.getFullYear()%100),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),'Z'].join('');}else{this.reporter.error('Encoding '+tag+' time is not supported yet');}return this._encodeStr(str,'octstr');};DERNode.prototype._encodeNull=function encodeNull(){return this._createEncoderBuffer('');};DERNode.prototype._encodeInt=function encodeInt(num,values){if(typeof num==='string'){if(!values)return this.reporter.error('String int or enum given, but no values map');if(!values.hasOwnProperty(num)){return this.reporter.error('Values map doesn\'t contain: '+JSON.stringify(num));}num=values[num];}// Bignum, assume big endian +if(typeof num!=='number'&&!Buffer.isBuffer(num)){var numArray=num.toArray();if(!num.sign&&numArray[0]&0x80){numArray.unshift(0);}num=new Buffer(numArray);}if(Buffer.isBuffer(num)){var size=num.length;if(num.length===0)size++;var out=new Buffer(size);num.copy(out);if(num.length===0)out[0]=0;return this._createEncoderBuffer(out);}if(num<0x80)return this._createEncoderBuffer(num);if(num<0x100)return this._createEncoderBuffer([0,num]);var size=1;for(var i=num;i>=0x100;i>>=8){size++;}var out=new Array(size);for(var i=out.length-1;i>=0;i--){out[i]=num&0xff;num>>=8;}if(out[0]&0x80){out.unshift(0);}return this._createEncoderBuffer(new Buffer(out));};DERNode.prototype._encodeBool=function encodeBool(value){return this._createEncoderBuffer(value?0xff:0);};DERNode.prototype._use=function use(entity,obj){if(typeof entity==='function')entity=entity(obj);return entity._getEncoder('der').tree;};DERNode.prototype._skipDefault=function skipDefault(dataBuffer,reporter,parent){var state=this._baseState;var i;if(state['default']===null)return false;var data=dataBuffer.join();if(state.defaultBuffer===undefined)state.defaultBuffer=this._encodeValue(state['default'],reporter,parent).join();if(data.length!==state.defaultBuffer.length)return false;for(i=0;i=0x1f)return reporter.error('Multi-octet tag encoding unsupported');if(!primitive)res|=0x20;res|=der.tagClassByName[cls||'universal']<<6;return res;}},{"../../asn1":46,"buffer":191,"inherits":320}],58:[function(require,module,exports){var encoders=exports;encoders.der=require('./der');encoders.pem=require('./pem');},{"./der":57,"./pem":59}],59:[function(require,module,exports){var inherits=require('inherits');var DEREncoder=require('./der');function PEMEncoder(entity){DEREncoder.call(this,entity);this.enc='pem';};inherits(PEMEncoder,DEREncoder);module.exports=PEMEncoder;PEMEncoder.prototype.encode=function encode(data,options){var buf=DEREncoder.prototype.encode.call(this,data);var p=buf.toString('base64');var out=['-----BEGIN '+options.label+'-----'];for(var i=0;i All rights reserved. +module.exports={newInvalidAsn1Error:function newInvalidAsn1Error(msg){var e=new Error();e.name='InvalidAsn1Error';e.message=msg||'';return e;}};},{}],61:[function(require,module,exports){// Copyright 2011 Mark Cavage All rights reserved. +var errors=require('./errors');var types=require('./types');var Reader=require('./reader');var Writer=require('./writer');// --- Exports +module.exports={Reader:Reader,Writer:Writer};for(var t in types){if(types.hasOwnProperty(t))module.exports[t]=types[t];}for(var e in errors){if(errors.hasOwnProperty(e))module.exports[e]=errors[e];}},{"./errors":60,"./reader":62,"./types":63,"./writer":64}],62:[function(require,module,exports){// Copyright 2011 Mark Cavage All rights reserved. +var assert=require('assert');var Buffer=require('safer-buffer').Buffer;var ASN1=require('./types');var errors=require('./errors');// --- Globals +var newInvalidAsn1Error=errors.newInvalidAsn1Error;// --- API +function Reader(data){if(!data||!Buffer.isBuffer(data))throw new TypeError('data must be a node Buffer');this._buf=data;this._size=data.length;// These hold the "current" state +this._len=0;this._offset=0;}Object.defineProperty(Reader.prototype,'length',{enumerable:true,get:function get(){return this._len;}});Object.defineProperty(Reader.prototype,'offset',{enumerable:true,get:function get(){return this._offset;}});Object.defineProperty(Reader.prototype,'remain',{get:function get(){return this._size-this._offset;}});Object.defineProperty(Reader.prototype,'buffer',{get:function get(){return this._buf.slice(this._offset);}});/** + * Reads a single byte and advances offset; you can pass in `true` to make this + * a "peek" operation (i.e., get the byte, but don't advance the offset). + * + * @param {Boolean} peek true means don't move offset. + * @return {Number} the next byte, null if not enough data. + */Reader.prototype.readByte=function(peek){if(this._size-this._offset<1)return null;var b=this._buf[this._offset]&0xff;if(!peek)this._offset+=1;return b;};Reader.prototype.peek=function(){return this.readByte(true);};/** + * Reads a (potentially) variable length off the BER buffer. This call is + * not really meant to be called directly, as callers have to manipulate + * the internal buffer afterwards. + * + * As a result of this call, you can call `Reader.length`, until the + * next thing called that does a readLength. + * + * @return {Number} the amount of offset to advance the buffer. + * @throws {InvalidAsn1Error} on bad ASN.1 + */Reader.prototype.readLength=function(offset){if(offset===undefined)offset=this._offset;if(offset>=this._size)return null;var lenB=this._buf[offset++]&0xff;if(lenB===null)return null;if((lenB&0x80)===0x80){lenB&=0x7f;if(lenB===0)throw newInvalidAsn1Error('Indefinite length not supported');if(lenB>4)throw newInvalidAsn1Error('encoding too long');if(this._size-offsetthis._size-o)return null;this._offset=o;if(this.length===0)return retbuf?Buffer.alloc(0):'';var str=this._buf.slice(this._offset,this._offset+this.length);this._offset+=this.length;return retbuf?str:str.toString('utf8');};Reader.prototype.readOID=function(tag){if(!tag)tag=ASN1.OID;var b=this.readString(tag,true);if(b===null)return null;var values=[];var value=0;for(var i=0;i>0);return values.join('.');};Reader.prototype._readTag=function(tag){assert.ok(tag!==undefined);var b=this.peek();if(b===null)return null;if(b!==tag)throw newInvalidAsn1Error('Expected 0x'+tag.toString(16)+': got 0x'+b.toString(16));var o=this.readLength(this._offset+1);// stored in `length` +if(o===null)return null;if(this.length>4)throw newInvalidAsn1Error('Integer too long: '+this.length);if(this.length>this._size-o)return null;this._offset=o;var fb=this._buf[this._offset];var value=0;for(var i=0;i>0;};// --- Exported API +module.exports=Reader;},{"./errors":60,"./types":63,"assert":67,"safer-buffer":448}],63:[function(require,module,exports){// Copyright 2011 Mark Cavage All rights reserved. +module.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,// float +Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128};},{}],64:[function(require,module,exports){// Copyright 2011 Mark Cavage All rights reserved. +var assert=require('assert');var Buffer=require('safer-buffer').Buffer;var ASN1=require('./types');var errors=require('./errors');// --- Globals +var newInvalidAsn1Error=errors.newInvalidAsn1Error;var DEFAULT_OPTS={size:1024,growthFactor:8};// --- Helpers +function merge(from,to){assert.ok(from);assert.equal(typeof from==="undefined"?"undefined":_typeof(from),'object');assert.ok(to);assert.equal(typeof to==="undefined"?"undefined":_typeof(to),'object');var keys=Object.getOwnPropertyNames(from);keys.forEach(function(key){if(to[key])return;var value=Object.getOwnPropertyDescriptor(from,key);Object.defineProperty(to,key,value);});return to;}// --- API +function Writer(options){options=merge(DEFAULT_OPTS,options||{});this._buf=Buffer.alloc(options.size||1024);this._size=this._buf.length;this._offset=0;this._options=options;// A list of offsets in the buffer where we need to insert +// sequence tag/len pairs. +this._seq=[];}Object.defineProperty(Writer.prototype,'buffer',{get:function get(){if(this._seq.length)throw newInvalidAsn1Error(this._seq.length+' unended sequence(s)');return this._buf.slice(0,this._offset);}});Writer.prototype.writeByte=function(b){if(typeof b!=='number')throw new TypeError('argument must be a Number');this._ensure(1);this._buf[this._offset++]=b;};Writer.prototype.writeInt=function(i,tag){if(typeof i!=='number')throw new TypeError('argument must be a Number');if(typeof tag!=='number')tag=ASN1.Integer;var sz=4;while(((i&0xff800000)===0||(i&0xff800000)===0xff800000>>0)&&sz>1){sz--;i<<=8;}if(sz>4)throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff');this._ensure(2+sz);this._buf[this._offset++]=tag;this._buf[this._offset++]=sz;while(sz-->0){this._buf[this._offset++]=(i&0xff000000)>>>24;i<<=8;}};Writer.prototype.writeNull=function(){this.writeByte(ASN1.Null);this.writeByte(0x00);};Writer.prototype.writeEnumeration=function(i,tag){if(typeof i!=='number')throw new TypeError('argument must be a Number');if(typeof tag!=='number')tag=ASN1.Enumeration;return this.writeInt(i,tag);};Writer.prototype.writeBoolean=function(b,tag){if(typeof b!=='boolean')throw new TypeError('argument must be a Boolean');if(typeof tag!=='number')tag=ASN1.Boolean;this._ensure(3);this._buf[this._offset++]=tag;this._buf[this._offset++]=0x01;this._buf[this._offset++]=b?0xff:0x00;};Writer.prototype.writeString=function(s,tag){if(typeof s!=='string')throw new TypeError('argument must be a string (was: '+(typeof s==="undefined"?"undefined":_typeof(s))+')');if(typeof tag!=='number')tag=ASN1.OctetString;var len=Buffer.byteLength(s);this.writeByte(tag);this.writeLength(len);if(len){this._ensure(len);this._buf.write(s,this._offset);this._offset+=len;}};Writer.prototype.writeBuffer=function(buf,tag){if(typeof tag!=='number')throw new TypeError('tag must be a number');if(!Buffer.isBuffer(buf))throw new TypeError('argument must be a buffer');this.writeByte(tag);this.writeLength(buf.length);this._ensure(buf.length);buf.copy(this._buf,this._offset,0,buf.length);this._offset+=buf.length;};Writer.prototype.writeStringArray=function(strings){if(!strings instanceof Array)throw new TypeError('argument must be an Array[String]');var self=this;strings.forEach(function(s){self.writeString(s);});};// This is really to solve DER cases, but whatever for now +Writer.prototype.writeOID=function(s,tag){if(typeof s!=='string')throw new TypeError('argument must be a string');if(typeof tag!=='number')tag=ASN1.OID;if(!/^([0-9]+\.){3,}[0-9]+$/.test(s))throw new Error('argument is not a valid OID string');function encodeOctet(bytes,octet){if(octet<128){bytes.push(octet);}else if(octet<16384){bytes.push(octet>>>7|0x80);bytes.push(octet&0x7F);}else if(octet<2097152){bytes.push(octet>>>14|0x80);bytes.push((octet>>>7|0x80)&0xFF);bytes.push(octet&0x7F);}else if(octet<268435456){bytes.push(octet>>>21|0x80);bytes.push((octet>>>14|0x80)&0xFF);bytes.push((octet>>>7|0x80)&0xFF);bytes.push(octet&0x7F);}else{bytes.push((octet>>>28|0x80)&0xFF);bytes.push((octet>>>21|0x80)&0xFF);bytes.push((octet>>>14|0x80)&0xFF);bytes.push((octet>>>7|0x80)&0xFF);bytes.push(octet&0x7F);}}var tmp=s.split('.');var bytes=[];bytes.push(parseInt(tmp[0],10)*40+parseInt(tmp[1],10));tmp.slice(2).forEach(function(b){encodeOctet(bytes,parseInt(b,10));});var self=this;this._ensure(2+bytes.length);this.writeByte(tag);this.writeLength(bytes.length);bytes.forEach(function(b){self.writeByte(b);});};Writer.prototype.writeLength=function(len){if(typeof len!=='number')throw new TypeError('argument must be a Number');this._ensure(4);if(len<=0x7f){this._buf[this._offset++]=len;}else if(len<=0xff){this._buf[this._offset++]=0x81;this._buf[this._offset++]=len;}else if(len<=0xffff){this._buf[this._offset++]=0x82;this._buf[this._offset++]=len>>8;this._buf[this._offset++]=len;}else if(len<=0xffffff){this._buf[this._offset++]=0x83;this._buf[this._offset++]=len>>16;this._buf[this._offset++]=len>>8;this._buf[this._offset++]=len;}else{throw newInvalidAsn1Error('Length too long (> 4 bytes)');}};Writer.prototype.startSequence=function(tag){if(typeof tag!=='number')tag=ASN1.Sequence|ASN1.Constructor;this.writeByte(tag);this._seq.push(this._offset);this._ensure(3);this._offset+=3;};Writer.prototype.endSequence=function(){var seq=this._seq.pop();var start=seq+3;var len=this._offset-start;if(len<=0x7f){this._shift(start,len,-2);this._buf[seq]=len;}else if(len<=0xff){this._shift(start,len,-1);this._buf[seq]=0x81;this._buf[seq+1]=len;}else if(len<=0xffff){this._buf[seq]=0x82;this._buf[seq+1]=len>>8;this._buf[seq+2]=len;}else if(len<=0xffffff){this._shift(start,len,1);this._buf[seq]=0x83;this._buf[seq+1]=len>>16;this._buf[seq+2]=len>>8;this._buf[seq+3]=len;}else{throw newInvalidAsn1Error('Sequence too long');}};Writer.prototype._shift=function(start,len,shift){assert.ok(start!==undefined);assert.ok(len!==undefined);assert.ok(shift);this._buf.copy(this._buf,start+shift,start,start+len);this._offset+=shift;};Writer.prototype._ensure=function(len){assert.ok(len);if(this._size-this._offset All rights reserved. +// If you have no idea what ASN.1 or BER is, see this: +// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc +var Ber=require('./ber/index');// --- Exported API +module.exports={Ber:Ber,BerReader:Ber.Reader,BerWriter:Ber.Writer};},{"./ber/index":61}],66:[function(require,module,exports){(function(Buffer,process){// Copyright (c) 2012, Mark Cavage. All rights reserved. +// Copyright 2015 Joyent, Inc. +var assert=require('assert');var Stream=require('stream').Stream;var util=require('util');///--- Globals +/* JSSTYLED */var UUID_REGEXP=/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;///--- Internal +function _capitalize(str){return str.charAt(0).toUpperCase()+str.slice(1);}function _toss(name,expected,oper,arg,actual){throw new assert.AssertionError({message:util.format('%s (%s) is required',name,expected),actual:actual===undefined?typeof arg==="undefined"?"undefined":_typeof(arg):actual(arg),expected:expected,operator:oper||'===',stackStartFunction:_toss.caller});}function _getClass(arg){return Object.prototype.toString.call(arg).slice(8,-1);}function noop(){}// Why even bother with asserts? +///--- Exports +var types={bool:{check:function check(arg){return typeof arg==='boolean';}},func:{check:function check(arg){return typeof arg==='function';}},string:{check:function check(arg){return typeof arg==='string';}},object:{check:function check(arg){return(typeof arg==="undefined"?"undefined":_typeof(arg))==='object'&&arg!==null;}},number:{check:function check(arg){return typeof arg==='number'&&!isNaN(arg);}},finite:{check:function check(arg){return typeof arg==='number'&&!isNaN(arg)&&isFinite(arg);}},buffer:{check:function check(arg){return Buffer.isBuffer(arg);},operator:'Buffer.isBuffer'},array:{check:function check(arg){return Array.isArray(arg);},operator:'Array.isArray'},stream:{check:function check(arg){return arg instanceof Stream;},operator:'instanceof',actual:_getClass},date:{check:function check(arg){return arg instanceof Date;},operator:'instanceof',actual:_getClass},regexp:{check:function check(arg){return arg instanceof RegExp;},operator:'instanceof',actual:_getClass},uuid:{check:function check(arg){return typeof arg==='string'&&UUID_REGEXP.test(arg);},operator:'isUUID'}};function _setExports(ndebug){var keys=Object.keys(types);var out;/* re-export standard assert */if(process.env.NODE_NDEBUG){out=noop;}else{out=function out(arg,msg){if(!arg){_toss(msg,'true',arg);}};}/* standard checks */keys.forEach(function(k){if(ndebug){out[k]=noop;return;}var type=types[k];out[k]=function(arg,msg){if(!type.check(arg)){_toss(msg,k,type.operator,arg,type.actual);}};});/* optional checks */keys.forEach(function(k){var name='optional'+_capitalize(k);if(ndebug){out[name]=noop;return;}var type=types[k];out[name]=function(arg,msg){if(arg===undefined||arg===null){return;}if(!type.check(arg)){_toss(msg,k,type.operator,arg,type.actual);}};});/* arrayOf checks */keys.forEach(function(k){var name='arrayOf'+_capitalize(k);if(ndebug){out[name]=noop;return;}var type=types[k];var expected='['+k+']';out[name]=function(arg,msg){if(!Array.isArray(arg)){_toss(msg,expected,type.operator,arg,type.actual);}var i;for(i=0;i +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the 'Software'), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// when used in node, this will actually load the util module we depend on +// versus loading the builtin util module as happens otherwise +// this is a bug in node module loading as far as I am concerned +var util=require('util/');var pSlice=Array.prototype.slice;var hasOwn=Object.prototype.hasOwnProperty;// 1. The assert module provides functions that throw +// AssertionError's when particular conditions are not met. The +// assert module must conform to the following interface. +var assert=module.exports=ok;// 2. The AssertionError is defined in assert. +// new assert.AssertionError({ message: message, +// actual: actual, +// expected: expected }) +assert.AssertionError=function AssertionError(options){this.name='AssertionError';this.actual=options.actual;this.expected=options.expected;this.operator=options.operator;if(options.message){this.message=options.message;this.generatedMessage=false;}else{this.message=getMessage(this);this.generatedMessage=true;}var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace){Error.captureStackTrace(this,stackStartFunction);}else{// non v8 browsers so we can have a stacktrace +var err=new Error();if(err.stack){var out=err.stack;// try to strip useless frames +var fn_name=stackStartFunction.name;var idx=out.indexOf('\n'+fn_name);if(idx>=0){// once we have located the function frame +// we need to strip out everything before it (and its line) +var next_line=out.indexOf('\n',idx+1);out=out.substring(next_line+1);}this.stack=out;}}};// assert.AssertionError instanceof Error +util.inherits(assert.AssertionError,Error);function replacer(key,value){if(util.isUndefined(value)){return''+value;}if(util.isNumber(value)&&!isFinite(value)){return value.toString();}if(util.isFunction(value)||util.isRegExp(value)){return value.toString();}return value;}function truncate(s,n){if(util.isString(s)){return s.length=0;i--){if(ka[i]!=kb[i])return false;}//equivalent values for every corresponding key, and +//~~~possibly expensive deep test +for(i=ka.length-1;i>=0;i--){key=ka[i];if(!_deepEqual(a[key],b[key]))return false;}return true;}// 8. The non-equivalence assertion tests for any deep inequality. +// assert.notDeepEqual(actual, expected, message_opt); +assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected)){fail(actual,expected,message,'notDeepEqual',assert.notDeepEqual);}};// 9. The strict equality assertion tests strict equality, as determined by ===. +// assert.strictEqual(actual, expected, message_opt); +assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,'===',assert.strictEqual);}};// 10. The strict non-equality assertion tests for strict inequality, as +// determined by !==. assert.notStrictEqual(actual, expected, message_opt); +assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,'!==',assert.notStrictEqual);}};function expectedException(actual,expected){if(!actual||!expected){return false;}if(Object.prototype.toString.call(expected)=='[object RegExp]'){return expected.test(actual);}else if(actual instanceof expected){return true;}else if(expected.call({},actual)===true){return true;}return false;}function _throws(shouldThrow,block,expected,message){var actual;if(util.isString(expected)){message=expected;expected=null;}try{block();}catch(e){actual=e;}message=(expected&&expected.name?' ('+expected.name+').':'.')+(message?' '+message:'.');if(shouldThrow&&!actual){fail(actual,expected,'Missing expected exception'+message);}if(!shouldThrow&&expectedException(actual,expected)){fail(actual,expected,'Got unwanted exception'+message);}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual;}}// 11. Expected to throw an error: +// assert.throws(block, Error_opt, message_opt); +assert.throws=function(block,/*optional*/error,/*optional*/message){_throws.apply(this,[true].concat(pSlice.call(arguments)));};// EXTENSION! This is annoying to write outside this module. +assert.doesNotThrow=function(block,/*optional*/message){_throws.apply(this,[false].concat(pSlice.call(arguments)));};assert.ifError=function(err){if(err){throw err;}};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key);}return keys;};},{"util/":70}],68:[function(require,module,exports){if(typeof Object.create==='function'){// implementation from standard node.js 'util' module +module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}});};}else{// old school shim for old browsers +module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function TempCtor(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor();ctor.prototype.constructor=ctor;};}},{}],69:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&(typeof arg==="undefined"?"undefined":_typeof(arg))==='object'&&typeof arg.copy==='function'&&typeof arg.fill==='function'&&typeof arg.readUInt8==='function';};},{}],70:[function(require,module,exports){(function(process,global){// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i=len)return x;switch(x){case'%s':return String(args[i++]);case'%d':return Number(args[i++]);case'%j':try{return JSON.stringify(args[i++]);}catch(_){return'[Circular]';}default:return x;}});for(var x=args[i];i=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){// legacy... +ctx.showHidden=opts;}else if(opts){// got an "options" object +exports._extend(ctx,opts);}// set default options +if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth);}exports.inspect=inspect;// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +inspect.colors={'bold':[1,22],'italic':[3,23],'underline':[4,24],'inverse':[7,27],'white':[37,39],'grey':[90,39],'black':[30,39],'blue':[34,39],'cyan':[36,39],'green':[32,39],'magenta':[35,39],'red':[31,39],'yellow':[33,39]};// Don't use 'blue' not visible on cmd.exe +inspect.styles={'special':'cyan','number':'yellow','boolean':'yellow','undefined':'grey','null':'bold','string':'green','date':'magenta',// "name": intentionally not styling +'regexp':'red'};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"\x1B["+inspect.colors[style][0]+'m'+str+"\x1B["+inspect.colors[style][1]+'m';}else{return str;}}function stylizeNoColor(str,styleType){return str;}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true;});return hash;}function formatValue(ctx,value,recurseTimes){// Provide a hook for user-specified inspect functions. +// Check that value is an object with an inspect function on it +if(ctx.customInspect&&value&&isFunction(value.inspect)&&// Filter out the util module, it's inspect function is special +value.inspect!==exports.inspect&&// Also filter out any prototype objects using the circular check. +!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes);}return ret;}// Primitive types cannot have properties +var primitive=formatPrimitive(ctx,value);if(primitive){return primitive;}// Look up the keys of the object. +var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value);}// IE doesn't make error fields non-enumerable +// http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx +if(isError(value)&&(keys.indexOf('message')>=0||keys.indexOf('description')>=0)){return formatError(value);}// Some type of object without properties can be shortcutted. +if(keys.length===0){if(isFunction(value)){var name=value.name?': '+value.name:'';return ctx.stylize('[Function'+name+']','special');}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),'regexp');}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),'date');}if(isError(value)){return formatError(value);}}var base='',array=false,braces=['{','}'];// Make Array say that they are Array +if(isArray(value)){array=true;braces=['[',']'];}// Make functions say that they are functions +if(isFunction(value)){var n=value.name?': '+value.name:'';base=' [Function'+n+']';}// Make RegExps say that they are RegExps +if(isRegExp(value)){base=' '+RegExp.prototype.toString.call(value);}// Make dates with properties first say the date +if(isDate(value)){base=' '+Date.prototype.toUTCString.call(value);}// Make error with message first say the error +if(isError(value)){base=' '+formatError(value);}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1];}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),'regexp');}else{return ctx.stylize('[Object]','special');}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys);}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array);});}ctx.seen.pop();return reduceToSingleString(output,base,braces);}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize('undefined','undefined');if(isString(value)){var simple='\''+JSON.stringify(value).replace(/^"|"$/g,'').replace(/'/g,"\\'").replace(/\\"/g,'"')+'\'';return ctx.stylize(simple,'string');}if(isNumber(value))return ctx.stylize(''+value,'number');if(isBoolean(value))return ctx.stylize(''+value,'boolean');// For some reason typeof null is "object", so special case here. +if(isNull(value))return ctx.stylize('null','null');}function formatError(value){return'['+Error.prototype.toString.call(value)+']';}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i-1){if(array){str=str.split('\n').map(function(line){return' '+line;}).join('\n').substr(2);}else{str='\n'+str.split('\n').map(function(line){return' '+line;}).join('\n');}}}else{str=ctx.stylize('[Circular]','special');}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str;}name=JSON.stringify(''+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,'name');}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,'string');}}return name+': '+str;}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf('\n')>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,'').length+1;},0);if(length>60){return braces[0]+(base===''?'':base+'\n ')+' '+output.join(',\n ')+' '+braces[1];}return braces[0]+base+' '+output.join(', ')+' '+braces[1];}// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar){return Array.isArray(ar);}exports.isArray=isArray;function isBoolean(arg){return typeof arg==='boolean';}exports.isBoolean=isBoolean;function isNull(arg){return arg===null;}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null;}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==='number';}exports.isNumber=isNumber;function isString(arg){return typeof arg==='string';}exports.isString=isString;function isSymbol(arg){return(typeof arg==="undefined"?"undefined":_typeof(arg))==='symbol';}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0;}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==='[object RegExp]';}exports.isRegExp=isRegExp;function isObject(arg){return(typeof arg==="undefined"?"undefined":_typeof(arg))==='object'&&arg!==null;}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==='[object Date]';}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==='[object Error]'||e instanceof Error);}exports.isError=isError;function isFunction(arg){return typeof arg==='function';}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==='boolean'||typeof arg==='number'||typeof arg==='string'||(typeof arg==="undefined"?"undefined":_typeof(arg))==='symbol'||// ES6 symbol +typeof arg==='undefined';}exports.isPrimitive=isPrimitive;exports.isBuffer=require('./support/isBuffer');function objectToString(o){return Object.prototype.toString.call(o);}function pad(n){return n<10?'0'+n.toString(10):n.toString(10);}var months=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];// 26 Feb 16:19:34 +function timestamp(){var d=new Date();var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(':');return[d.getDate(),months[d.getMonth()],time].join(' ');}// log is just a thin wrapper to console.log that prepends a timestamp +exports.log=function(){console.log('%s - %s',timestamp(),exports.format.apply(exports,arguments));};/** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */exports.inherits=require('inherits');exports._extend=function(origin,add){// Don't do anything if add isn't an object +if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]];}return origin;};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);}}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"./support/isBuffer":69,"_process":382,"inherits":68}],71:[function(require,module,exports){/*! + * Copyright 2010 LearnBoost + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *//** + * Module dependencies. + */var crypto=require('crypto'),parse=require('url').parse;/** + * Valid keys. + */var keys=['acl','location','logging','notification','partNumber','policy','requestPayment','torrent','uploadId','uploads','versionId','versioning','versions','website'];/** + * Return an "Authorization" header value with the given `options` + * in the form of "AWS :" + * + * @param {Object} options + * @return {String} + * @api private + */function authorization(options){return'AWS '+options.key+':'+sign(options);}module.exports=authorization;module.exports.authorization=authorization;/** + * Simple HMAC-SHA1 Wrapper + * + * @param {Object} options + * @return {String} + * @api private + */function hmacSha1(options){return crypto.createHmac('sha1',options.secret).update(options.message).digest('base64');}module.exports.hmacSha1=hmacSha1;/** + * Create a base64 sha1 HMAC for `options`. + * + * @param {Object} options + * @return {String} + * @api private + */function sign(options){options.message=stringToSign(options);return hmacSha1(options);}module.exports.sign=sign;/** + * Create a base64 sha1 HMAC for `options`. + * + * Specifically to be used with S3 presigned URLs + * + * @param {Object} options + * @return {String} + * @api private + */function signQuery(options){options.message=queryStringToSign(options);return hmacSha1(options);}module.exports.signQuery=signQuery;/** + * Return a string for sign() with the given `options`. + * + * Spec: + * + * \n + * \n + * \n + * \n + * [headers\n] + * + * + * @param {Object} options + * @return {String} + * @api private + */function stringToSign(options){var headers=options.amazonHeaders||'';if(headers)headers+='\n';var r=[options.verb,options.md5,options.contentType,options.date?options.date.toUTCString():'',headers+options.resource];return r.join('\n');}module.exports.stringToSign=stringToSign;/** + * Return a string for sign() with the given `options`, but is meant exclusively + * for S3 presigned URLs + * + * Spec: + * + * \n + * + * + * @param {Object} options + * @return {String} + * @api private + */function queryStringToSign(options){return'GET\n\n\n'+options.date+'\n'+options.resource;}module.exports.queryStringToSign=queryStringToSign;/** + * Perform the following: + * + * - ignore non-amazon headers + * - lowercase fields + * - sort lexicographically + * - trim whitespace between ":" + * - join with newline + * + * @param {Object} headers + * @return {String} + * @api private + */function canonicalizeHeaders(headers){var buf=[],fields=Object.keys(headers);for(var i=0,len=fields.length;i=0&&this.region==='us-east-1')return true;return['cloudfront','ls','route53','iam','importexport','sts'].indexOf(this.service)>=0;};RequestSigner.prototype.createHost=function(){var region=this.isSingleRegion()?'':(this.service==='s3'&&this.region!=='us-east-1'?'-':'.')+this.region,service=this.service==='ses'?'email':this.service;return service+region+'.amazonaws.com';};RequestSigner.prototype.prepareRequest=function(){this.parsePath();var request=this.request,headers=request.headers,query;if(request.signQuery){this.parsedPath.query=query=this.parsedPath.query||{};if(this.credentials.sessionToken)query['X-Amz-Security-Token']=this.credentials.sessionToken;if(this.service==='s3'&&!query['X-Amz-Expires'])query['X-Amz-Expires']=86400;if(query['X-Amz-Date'])this.datetime=query['X-Amz-Date'];else query['X-Amz-Date']=this.getDateTime();query['X-Amz-Algorithm']='AWS4-HMAC-SHA256';query['X-Amz-Credential']=this.credentials.accessKeyId+'/'+this.credentialString();query['X-Amz-SignedHeaders']=this.signedHeaders();}else{if(!request.doNotModifyHeaders&&!this.isCodeCommitGit){if(request.body&&!headers['Content-Type']&&!headers['content-type'])headers['Content-Type']='application/x-www-form-urlencoded; charset=utf-8';if(request.body&&!headers['Content-Length']&&!headers['content-length'])headers['Content-Length']=Buffer.byteLength(request.body);if(this.credentials.sessionToken&&!headers['X-Amz-Security-Token']&&!headers['x-amz-security-token'])headers['X-Amz-Security-Token']=this.credentials.sessionToken;if(this.service==='s3'&&!headers['X-Amz-Content-Sha256']&&!headers['x-amz-content-sha256'])headers['X-Amz-Content-Sha256']=hash(this.request.body||'','hex');if(headers['X-Amz-Date']||headers['x-amz-date'])this.datetime=headers['X-Amz-Date']||headers['x-amz-date'];else headers['X-Amz-Date']=this.getDateTime();}delete headers.Authorization;delete headers.authorization;}};RequestSigner.prototype.sign=function(){if(!this.parsedPath)this.prepareRequest();if(this.request.signQuery){this.parsedPath.query['X-Amz-Signature']=this.signature();}else{this.request.headers.Authorization=this.authHeader();}this.request.path=this.formatPath();return this.request;};RequestSigner.prototype.getDateTime=function(){if(!this.datetime){var headers=this.request.headers,date=new Date(headers.Date||headers.date||new Date());this.datetime=date.toISOString().replace(/[:\-]|\.\d{3}/g,'');// Remove the trailing 'Z' on the timestamp string for CodeCommit git access +if(this.isCodeCommitGit)this.datetime=this.datetime.slice(0,-1);}return this.datetime;};RequestSigner.prototype.getDate=function(){return this.getDateTime().substr(0,8);};RequestSigner.prototype.authHeader=function(){return['AWS4-HMAC-SHA256 Credential='+this.credentials.accessKeyId+'/'+this.credentialString(),'SignedHeaders='+this.signedHeaders(),'Signature='+this.signature()].join(', ');};RequestSigner.prototype.signature=function(){var date=this.getDate(),cacheKey=[this.credentials.secretAccessKey,date,this.region,this.service].join(),kDate,kRegion,kService,kCredentials=credentialsCache.get(cacheKey);if(!kCredentials){kDate=hmac('AWS4'+this.credentials.secretAccessKey,date);kRegion=hmac(kDate,this.region);kService=hmac(kRegion,this.service);kCredentials=hmac(kService,'aws4_request');credentialsCache.set(cacheKey,kCredentials);}return hmac(kCredentials,this.stringToSign(),'hex');};RequestSigner.prototype.stringToSign=function(){return['AWS4-HMAC-SHA256',this.getDateTime(),this.credentialString(),hash(this.canonicalString(),'hex')].join('\n');};RequestSigner.prototype.canonicalString=function(){if(!this.parsedPath)this.prepareRequest();var pathStr=this.parsedPath.path,query=this.parsedPath.query,headers=this.request.headers,queryStr='',normalizePath=this.service!=='s3',decodePath=this.service==='s3'||this.request.doNotEncodePath,decodeSlashesInPath=this.service==='s3',firstValOnly=this.service==='s3',bodyHash;if(this.service==='s3'&&this.request.signQuery){bodyHash='UNSIGNED-PAYLOAD';}else if(this.isCodeCommitGit){bodyHash='';}else{bodyHash=headers['X-Amz-Content-Sha256']||headers['x-amz-content-sha256']||hash(this.request.body||'','hex');}if(query){queryStr=encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj,key){if(!key)return obj;obj[key]=!Array.isArray(query[key])?query[key]:firstValOnly?query[key][0]:query[key].slice().sort();return obj;},{})));}if(pathStr!=='/'){if(normalizePath)pathStr=pathStr.replace(/\/{2,}/g,'/');pathStr=pathStr.split('/').reduce(function(path,piece){if(normalizePath&&piece==='..'){path.pop();}else if(!normalizePath||piece!=='.'){if(decodePath)piece=decodeURIComponent(piece);path.push(encodeRfc3986(encodeURIComponent(piece)));}return path;},[]).join('/');if(pathStr[0]!=='/')pathStr='/'+pathStr;if(decodeSlashesInPath)pathStr=pathStr.replace(/%2F/g,'/');}return[this.request.method||'GET',pathStr,queryStr,this.canonicalHeaders()+'\n',this.signedHeaders(),bodyHash].join('\n');};RequestSigner.prototype.canonicalHeaders=function(){var headers=this.request.headers;function trimAll(header){return header.toString().trim().replace(/\s+/g,' ');}return Object.keys(headers).sort(function(a,b){return a.toLowerCase()=0){query=querystring.parse(path.slice(queryIx+1));path=path.slice(0,queryIx);}// S3 doesn't always encode characters > 127 correctly and +// all services don't encode characters > 255 correctly +// So if there are non-reserved chars (and it's not already all % encoded), just encode them all +if(/[^0-9A-Za-z!'()*\-._~%/]/.test(path)){path=path.split('/').map(function(piece){return encodeURIComponent(decodeURIComponent(piece));}).join('/');}this.parsedPath={path:path,query:query};};RequestSigner.prototype.formatPath=function(){var path=this.parsedPath.path,query=this.parsedPath.query;if(!query)return path;// Services don't support empty query string keys +if(query['']!=null)delete query[''];return path+'?'+encodeRfc3986(querystring.stringify(query));};aws4.RequestSigner=RequestSigner;aws4.sign=function(request,credentials){return new RequestSigner(request,credentials).sign();};}).call(this,require('_process'),require("buffer").Buffer);},{"./lru":73,"_process":382,"buffer":191,"crypto":204,"querystring":413,"url":500}],73:[function(require,module,exports){module.exports=function(size){return new LruCache(size);};function LruCache(size){this.capacity=size|0;this.map=Object.create(null);this.list=new DoublyLinkedList();}LruCache.prototype.get=function(key){var node=this.map[key];if(node==null)return undefined;this.used(node);return node.val;};LruCache.prototype.set=function(key,val){var node=this.map[key];if(node!=null){node.val=val;}else{if(!this.capacity)this.prune();if(!this.capacity)return false;node=new DoublyLinkedNode(key,val);this.map[key]=node;this.capacity--;}this.used(node);return true;};LruCache.prototype.used=function(node){this.list.moveToFront(node);};LruCache.prototype.prune=function(){var node=this.list.pop();if(node!=null){delete this.map[node.key];this.capacity++;}};function DoublyLinkedList(){this.firstNode=null;this.lastNode=null;}DoublyLinkedList.prototype.moveToFront=function(node){if(this.firstNode==node)return;this.remove(node);if(this.firstNode==null){this.firstNode=node;this.lastNode=node;node.prev=null;node.next=null;}else{node.prev=null;node.next=this.firstNode;node.next.prev=node;this.firstNode=node;}};DoublyLinkedList.prototype.pop=function(){var lastNode=this.lastNode;if(lastNode!=null){this.remove(lastNode);}return lastNode;};DoublyLinkedList.prototype.remove=function(node){if(this.firstNode==node){this.firstNode=node.next;}else if(node.prev!=null){node.prev.next=node.next;}if(this.lastNode==node){this.lastNode=node.prev;}else if(node.next!=null){node.next.prev=node.prev;}};function DoublyLinkedNode(key,val){this.key=key;this.val=val;this.prev=null;this.next=null;}},{}],74:[function(require,module,exports){'use strict';module.exports=balanced;function balanced(a,b,str){if(a instanceof RegExp)a=maybeMatch(a,str);if(b instanceof RegExp)b=maybeMatch(b,str);var r=range(a,b,str);return r&&{start:r[0],end:r[1],pre:str.slice(0,r[0]),body:str.slice(r[0]+a.length,r[1]),post:str.slice(r[1]+b.length)};}function maybeMatch(reg,str){var m=str.match(reg);return m?m[0]:null;}balanced.range=range;function range(a,b,str){var begs,beg,left,right,result;var ai=str.indexOf(a);var bi=str.indexOf(b,ai+1);var i=ai;if(ai>=0&&bi>0){begs=[];left=str.length;while(i>=0&&!result){if(i==ai){begs.push(i);ai=str.indexOf(a,i+1);}else if(begs.length==1){result=[begs.pop(),bi];}else{beg=begs.pop();if(beg=0?ai:bi;}if(begs.length){result=[left,right];}}return result;}},{}],75:[function(require,module,exports){'use strict';exports.byteLength=byteLength;exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=='undefined'?Uint8Array:Array;var code='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';for(var i=0,len=code.length;i0){throw new Error('Invalid string. Length must be a multiple of 4');}// Trim off extra bytes after placeholder bytes are found +// See: https://github.com/beatgammit/base64-js/issues/42 +var validLen=b64.indexOf('=');if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen];}// base64 is 4/3 + up to two characters of the original data +function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen;}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen;}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;// if there are placeholders, only get up to the last complete 4 chars +var len=placeHoldersLen>0?validLen-4:validLen;for(var i=0;i>16&0xFF;arr[curByte++]=tmp>>8&0xFF;arr[curByte++]=tmp&0xFF;}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&0xFF;}if(placeHoldersLen===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[curByte++]=tmp>>8&0xFF;arr[curByte++]=tmp&0xFF;}return arr;}function tripletToBase64(num){return lookup[num>>18&0x3F]+lookup[num>>12&0x3F]+lookup[num>>6&0x3F]+lookup[num&0x3F];}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;ilen2?len2:i+maxChunkLength));}// pad the end with zeros, but make sure to not forget the extra bytes +if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&0x3F]+'==');}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&0x3F]+lookup[tmp<<2&0x3F]+'=');}return parts.join('');}},{}],76:[function(require,module,exports){'use strict';var crypto_hash_sha512=require('tweetnacl').lowlevel.crypto_hash;/* + * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a + * result, it retains the original copyright and license. The two files are + * under slightly different (but compatible) licenses, and are here combined in + * one file. + * + * Credit for the actual porting work goes to: + * Devi Mandiri + *//* + * The Blowfish portions are under the following license: + * + * Blowfish block cipher for OpenBSD + * Copyright 1997 Niels Provos + * All rights reserved. + * + * Implementation advice by David Mazieres . + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *//* + * The bcrypt_pbkdf portions are under the following license: + * + * Copyright (c) 2013 Ted Unangst + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + *//* + * Performance improvements (Javascript-specific): + * + * Copyright 2016, Joyent Inc + * Author: Alex Wilson + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */// Ported from OpenBSD bcrypt_pbkdf.c v1.9 +var BLF_J=0;var Blowfish=function Blowfish(){this.S=[new Uint32Array([0xd1310ba6,0x98dfb5ac,0x2ffd72db,0xd01adfb7,0xb8e1afed,0x6a267e96,0xba7c9045,0xf12c7f99,0x24a19947,0xb3916cf7,0x0801f2e2,0x858efc16,0x636920d8,0x71574e69,0xa458fea3,0xf4933d7e,0x0d95748f,0x728eb658,0x718bcd58,0x82154aee,0x7b54a41d,0xc25a59b5,0x9c30d539,0x2af26013,0xc5d1b023,0x286085f0,0xca417918,0xb8db38ef,0x8e79dcb0,0x603a180e,0x6c9e0e8b,0xb01e8a3e,0xd71577c1,0xbd314b27,0x78af2fda,0x55605c60,0xe65525f3,0xaa55ab94,0x57489862,0x63e81440,0x55ca396a,0x2aab10b6,0xb4cc5c34,0x1141e8ce,0xa15486af,0x7c72e993,0xb3ee1411,0x636fbc2a,0x2ba9c55d,0x741831f6,0xce5c3e16,0x9b87931e,0xafd6ba33,0x6c24cf5c,0x7a325381,0x28958677,0x3b8f4898,0x6b4bb9af,0xc4bfe81b,0x66282193,0x61d809cc,0xfb21a991,0x487cac60,0x5dec8032,0xef845d5d,0xe98575b1,0xdc262302,0xeb651b88,0x23893e81,0xd396acc5,0x0f6d6ff3,0x83f44239,0x2e0b4482,0xa4842004,0x69c8f04a,0x9e1f9b5e,0x21c66842,0xf6e96c9a,0x670c9c61,0xabd388f0,0x6a51a0d2,0xd8542f68,0x960fa728,0xab5133a3,0x6eef0b6c,0x137a3be4,0xba3bf050,0x7efb2a98,0xa1f1651d,0x39af0176,0x66ca593e,0x82430e88,0x8cee8619,0x456f9fb4,0x7d84a5c3,0x3b8b5ebe,0xe06f75d8,0x85c12073,0x401a449f,0x56c16aa6,0x4ed3aa62,0x363f7706,0x1bfedf72,0x429b023d,0x37d0d724,0xd00a1248,0xdb0fead3,0x49f1c09b,0x075372c9,0x80991b7b,0x25d479d8,0xf6e8def7,0xe3fe501a,0xb6794c3b,0x976ce0bd,0x04c006ba,0xc1a94fb6,0x409f60c4,0x5e5c9ec2,0x196a2463,0x68fb6faf,0x3e6c53b5,0x1339b2eb,0x3b52ec6f,0x6dfc511f,0x9b30952c,0xcc814544,0xaf5ebd09,0xbee3d004,0xde334afd,0x660f2807,0x192e4bb3,0xc0cba857,0x45c8740f,0xd20b5f39,0xb9d3fbdb,0x5579c0bd,0x1a60320a,0xd6a100c6,0x402c7279,0x679f25fe,0xfb1fa3cc,0x8ea5e9f8,0xdb3222f8,0x3c7516df,0xfd616b15,0x2f501ec8,0xad0552ab,0x323db5fa,0xfd238760,0x53317b48,0x3e00df82,0x9e5c57bb,0xca6f8ca0,0x1a87562e,0xdf1769db,0xd542a8f6,0x287effc3,0xac6732c6,0x8c4f5573,0x695b27b0,0xbbca58c8,0xe1ffa35d,0xb8f011a0,0x10fa3d98,0xfd2183b8,0x4afcb56c,0x2dd1d35b,0x9a53e479,0xb6f84565,0xd28e49bc,0x4bfb9790,0xe1ddf2da,0xa4cb7e33,0x62fb1341,0xcee4c6e8,0xef20cada,0x36774c01,0xd07e9efe,0x2bf11fb4,0x95dbda4d,0xae909198,0xeaad8e71,0x6b93d5a0,0xd08ed1d0,0xafc725e0,0x8e3c5b2f,0x8e7594b7,0x8ff6e2fb,0xf2122b64,0x8888b812,0x900df01c,0x4fad5ea0,0x688fc31c,0xd1cff191,0xb3a8c1ad,0x2f2f2218,0xbe0e1777,0xea752dfe,0x8b021fa1,0xe5a0cc0f,0xb56f74e8,0x18acf3d6,0xce89e299,0xb4a84fe0,0xfd13e0b7,0x7cc43b81,0xd2ada8d9,0x165fa266,0x80957705,0x93cc7314,0x211a1477,0xe6ad2065,0x77b5fa86,0xc75442f5,0xfb9d35cf,0xebcdaf0c,0x7b3e89a0,0xd6411bd3,0xae1e7e49,0x00250e2d,0x2071b35e,0x226800bb,0x57b8e0af,0x2464369b,0xf009b91e,0x5563911d,0x59dfa6aa,0x78c14389,0xd95a537f,0x207d5ba2,0x02e5b9c5,0x83260376,0x6295cfa9,0x11c81968,0x4e734a41,0xb3472dca,0x7b14a94a,0x1b510052,0x9a532915,0xd60f573f,0xbc9bc6e4,0x2b60a476,0x81e67400,0x08ba6fb5,0x571be91f,0xf296ec6b,0x2a0dd915,0xb6636521,0xe7b9f9b6,0xff34052e,0xc5855664,0x53b02d5d,0xa99f8fa1,0x08ba4799,0x6e85076a]),new Uint32Array([0x4b7a70e9,0xb5b32944,0xdb75092e,0xc4192623,0xad6ea6b0,0x49a7df7d,0x9cee60b8,0x8fedb266,0xecaa8c71,0x699a17ff,0x5664526c,0xc2b19ee1,0x193602a5,0x75094c29,0xa0591340,0xe4183a3e,0x3f54989a,0x5b429d65,0x6b8fe4d6,0x99f73fd6,0xa1d29c07,0xefe830f5,0x4d2d38e6,0xf0255dc1,0x4cdd2086,0x8470eb26,0x6382e9c6,0x021ecc5e,0x09686b3f,0x3ebaefc9,0x3c971814,0x6b6a70a1,0x687f3584,0x52a0e286,0xb79c5305,0xaa500737,0x3e07841c,0x7fdeae5c,0x8e7d44ec,0x5716f2b8,0xb03ada37,0xf0500c0d,0xf01c1f04,0x0200b3ff,0xae0cf51a,0x3cb574b2,0x25837a58,0xdc0921bd,0xd19113f9,0x7ca92ff6,0x94324773,0x22f54701,0x3ae5e581,0x37c2dadc,0xc8b57634,0x9af3dda7,0xa9446146,0x0fd0030e,0xecc8c73e,0xa4751e41,0xe238cd99,0x3bea0e2f,0x3280bba1,0x183eb331,0x4e548b38,0x4f6db908,0x6f420d03,0xf60a04bf,0x2cb81290,0x24977c79,0x5679b072,0xbcaf89af,0xde9a771f,0xd9930810,0xb38bae12,0xdccf3f2e,0x5512721f,0x2e6b7124,0x501adde6,0x9f84cd87,0x7a584718,0x7408da17,0xbc9f9abc,0xe94b7d8c,0xec7aec3a,0xdb851dfa,0x63094366,0xc464c3d2,0xef1c1847,0x3215d908,0xdd433b37,0x24c2ba16,0x12a14d43,0x2a65c451,0x50940002,0x133ae4dd,0x71dff89e,0x10314e55,0x81ac77d6,0x5f11199b,0x043556f1,0xd7a3c76b,0x3c11183b,0x5924a509,0xf28fe6ed,0x97f1fbfa,0x9ebabf2c,0x1e153c6e,0x86e34570,0xeae96fb1,0x860e5e0a,0x5a3e2ab3,0x771fe71c,0x4e3d06fa,0x2965dcb9,0x99e71d0f,0x803e89d6,0x5266c825,0x2e4cc978,0x9c10b36a,0xc6150eba,0x94e2ea78,0xa5fc3c53,0x1e0a2df4,0xf2f74ea7,0x361d2b3d,0x1939260f,0x19c27960,0x5223a708,0xf71312b6,0xebadfe6e,0xeac31f66,0xe3bc4595,0xa67bc883,0xb17f37d1,0x018cff28,0xc332ddef,0xbe6c5aa5,0x65582185,0x68ab9802,0xeecea50f,0xdb2f953b,0x2aef7dad,0x5b6e2f84,0x1521b628,0x29076170,0xecdd4775,0x619f1510,0x13cca830,0xeb61bd96,0x0334fe1e,0xaa0363cf,0xb5735c90,0x4c70a239,0xd59e9e0b,0xcbaade14,0xeecc86bc,0x60622ca7,0x9cab5cab,0xb2f3846e,0x648b1eaf,0x19bdf0ca,0xa02369b9,0x655abb50,0x40685a32,0x3c2ab4b3,0x319ee9d5,0xc021b8f7,0x9b540b19,0x875fa099,0x95f7997e,0x623d7da8,0xf837889a,0x97e32d77,0x11ed935f,0x16681281,0x0e358829,0xc7e61fd6,0x96dedfa1,0x7858ba99,0x57f584a5,0x1b227263,0x9b83c3ff,0x1ac24696,0xcdb30aeb,0x532e3054,0x8fd948e4,0x6dbc3128,0x58ebf2ef,0x34c6ffea,0xfe28ed61,0xee7c3c73,0x5d4a14d9,0xe864b7e3,0x42105d14,0x203e13e0,0x45eee2b6,0xa3aaabea,0xdb6c4f15,0xfacb4fd0,0xc742f442,0xef6abbb5,0x654f3b1d,0x41cd2105,0xd81e799e,0x86854dc7,0xe44b476a,0x3d816250,0xcf62a1f2,0x5b8d2646,0xfc8883a0,0xc1c7b6a3,0x7f1524c3,0x69cb7492,0x47848a0b,0x5692b285,0x095bbf00,0xad19489d,0x1462b174,0x23820e00,0x58428d2a,0x0c55f5ea,0x1dadf43e,0x233f7061,0x3372f092,0x8d937e41,0xd65fecf1,0x6c223bdb,0x7cde3759,0xcbee7460,0x4085f2a7,0xce77326e,0xa6078084,0x19f8509e,0xe8efd855,0x61d99735,0xa969a7aa,0xc50c06c2,0x5a04abfc,0x800bcadc,0x9e447a2e,0xc3453484,0xfdd56705,0x0e1e9ec9,0xdb73dbd3,0x105588cd,0x675fda79,0xe3674340,0xc5c43465,0x713e38d8,0x3d28f89e,0xf16dff20,0x153e21e7,0x8fb03d4a,0xe6e39f2b,0xdb83adf7]),new Uint32Array([0xe93d5a68,0x948140f7,0xf64c261c,0x94692934,0x411520f7,0x7602d4f7,0xbcf46b2e,0xd4a20068,0xd4082471,0x3320f46a,0x43b7d4b7,0x500061af,0x1e39f62e,0x97244546,0x14214f74,0xbf8b8840,0x4d95fc1d,0x96b591af,0x70f4ddd3,0x66a02f45,0xbfbc09ec,0x03bd9785,0x7fac6dd0,0x31cb8504,0x96eb27b3,0x55fd3941,0xda2547e6,0xabca0a9a,0x28507825,0x530429f4,0x0a2c86da,0xe9b66dfb,0x68dc1462,0xd7486900,0x680ec0a4,0x27a18dee,0x4f3ffea2,0xe887ad8c,0xb58ce006,0x7af4d6b6,0xaace1e7c,0xd3375fec,0xce78a399,0x406b2a42,0x20fe9e35,0xd9f385b9,0xee39d7ab,0x3b124e8b,0x1dc9faf7,0x4b6d1856,0x26a36631,0xeae397b2,0x3a6efa74,0xdd5b4332,0x6841e7f7,0xca7820fb,0xfb0af54e,0xd8feb397,0x454056ac,0xba489527,0x55533a3a,0x20838d87,0xfe6ba9b7,0xd096954b,0x55a867bc,0xa1159a58,0xcca92963,0x99e1db33,0xa62a4a56,0x3f3125f9,0x5ef47e1c,0x9029317c,0xfdf8e802,0x04272f70,0x80bb155c,0x05282ce3,0x95c11548,0xe4c66d22,0x48c1133f,0xc70f86dc,0x07f9c9ee,0x41041f0f,0x404779a4,0x5d886e17,0x325f51eb,0xd59bc0d1,0xf2bcc18f,0x41113564,0x257b7834,0x602a9c60,0xdff8e8a3,0x1f636c1b,0x0e12b4c2,0x02e1329e,0xaf664fd1,0xcad18115,0x6b2395e0,0x333e92e1,0x3b240b62,0xeebeb922,0x85b2a20e,0xe6ba0d99,0xde720c8c,0x2da2f728,0xd0127845,0x95b794fd,0x647d0862,0xe7ccf5f0,0x5449a36f,0x877d48fa,0xc39dfd27,0xf33e8d1e,0x0a476341,0x992eff74,0x3a6f6eab,0xf4f8fd37,0xa812dc60,0xa1ebddf8,0x991be14c,0xdb6e6b0d,0xc67b5510,0x6d672c37,0x2765d43b,0xdcd0e804,0xf1290dc7,0xcc00ffa3,0xb5390f92,0x690fed0b,0x667b9ffb,0xcedb7d9c,0xa091cf0b,0xd9155ea3,0xbb132f88,0x515bad24,0x7b9479bf,0x763bd6eb,0x37392eb3,0xcc115979,0x8026e297,0xf42e312d,0x6842ada7,0xc66a2b3b,0x12754ccc,0x782ef11c,0x6a124237,0xb79251e7,0x06a1bbe6,0x4bfb6350,0x1a6b1018,0x11caedfa,0x3d25bdd8,0xe2e1c3c9,0x44421659,0x0a121386,0xd90cec6e,0xd5abea2a,0x64af674e,0xda86a85f,0xbebfe988,0x64e4c3fe,0x9dbc8057,0xf0f7c086,0x60787bf8,0x6003604d,0xd1fd8346,0xf6381fb0,0x7745ae04,0xd736fccc,0x83426b33,0xf01eab71,0xb0804187,0x3c005e5f,0x77a057be,0xbde8ae24,0x55464299,0xbf582e61,0x4e58f48f,0xf2ddfda2,0xf474ef38,0x8789bdc2,0x5366f9c3,0xc8b38e74,0xb475f255,0x46fcd9b9,0x7aeb2661,0x8b1ddf84,0x846a0e79,0x915f95e2,0x466e598e,0x20b45770,0x8cd55591,0xc902de4c,0xb90bace1,0xbb8205d0,0x11a86248,0x7574a99e,0xb77f19b6,0xe0a9dc09,0x662d09a1,0xc4324633,0xe85a1f02,0x09f0be8c,0x4a99a025,0x1d6efe10,0x1ab93d1d,0x0ba5a4df,0xa186f20f,0x2868f169,0xdcb7da83,0x573906fe,0xa1e2ce9b,0x4fcd7f52,0x50115e01,0xa70683fa,0xa002b5c4,0x0de6d027,0x9af88c27,0x773f8641,0xc3604c06,0x61a806b5,0xf0177a28,0xc0f586e0,0x006058aa,0x30dc7d62,0x11e69ed7,0x2338ea63,0x53c2dd94,0xc2c21634,0xbbcbee56,0x90bcb6de,0xebfc7da1,0xce591d76,0x6f05e409,0x4b7c0188,0x39720a3d,0x7c927c24,0x86e3725f,0x724d9db9,0x1ac15bb4,0xd39eb8fc,0xed545578,0x08fca5b5,0xd83d7cd3,0x4dad0fc4,0x1e50ef5e,0xb161e6f8,0xa28514d9,0x6c51133c,0x6fd5c7e7,0x56e14ec4,0x362abfce,0xddc6c837,0xd79a3234,0x92638212,0x670efa8e,0x406000e0]),new Uint32Array([0x3a39ce37,0xd3faf5cf,0xabc27737,0x5ac52d1b,0x5cb0679e,0x4fa33742,0xd3822740,0x99bc9bbe,0xd5118e9d,0xbf0f7315,0xd62d1c7e,0xc700c47b,0xb78c1b6b,0x21a19045,0xb26eb1be,0x6a366eb4,0x5748ab2f,0xbc946e79,0xc6a376d2,0x6549c2c8,0x530ff8ee,0x468dde7d,0xd5730a1d,0x4cd04dc6,0x2939bbdb,0xa9ba4650,0xac9526e8,0xbe5ee304,0xa1fad5f0,0x6a2d519a,0x63ef8ce2,0x9a86ee22,0xc089c2b8,0x43242ef6,0xa51e03aa,0x9cf2d0a4,0x83c061ba,0x9be96a4d,0x8fe51550,0xba645bd6,0x2826a2f9,0xa73a3ae1,0x4ba99586,0xef5562e9,0xc72fefd3,0xf752f7da,0x3f046f69,0x77fa0a59,0x80e4a915,0x87b08601,0x9b09e6ad,0x3b3ee593,0xe990fd5a,0x9e34d797,0x2cf0b7d9,0x022b8b51,0x96d5ac3a,0x017da67d,0xd1cf3ed6,0x7c7d2d28,0x1f9f25cf,0xadf2b89b,0x5ad6b472,0x5a88f54c,0xe029ac71,0xe019a5e6,0x47b0acfd,0xed93fa9b,0xe8d3c48d,0x283b57cc,0xf8d56629,0x79132e28,0x785f0191,0xed756055,0xf7960e44,0xe3d35e8c,0x15056dd4,0x88f46dba,0x03a16125,0x0564f0bd,0xc3eb9e15,0x3c9057a2,0x97271aec,0xa93a072a,0x1b3f6d9b,0x1e6321f5,0xf59c66fb,0x26dcf319,0x7533d928,0xb155fdf5,0x03563482,0x8aba3cbb,0x28517711,0xc20ad9f8,0xabcc5167,0xccad925f,0x4de81751,0x3830dc8e,0x379d5862,0x9320f991,0xea7a90c2,0xfb3e7bce,0x5121ce64,0x774fbe32,0xa8b6e37e,0xc3293d46,0x48de5369,0x6413e680,0xa2ae0810,0xdd6db224,0x69852dfd,0x09072166,0xb39a460a,0x6445c0dd,0x586cdecf,0x1c20c8ae,0x5bbef7dd,0x1b588d40,0xccd2017f,0x6bb4e3bb,0xdda26a7e,0x3a59ff45,0x3e350a44,0xbcb4cdd5,0x72eacea8,0xfa6484bb,0x8d6612ae,0xbf3c6f47,0xd29be463,0x542f5d9e,0xaec2771b,0xf64e6370,0x740e0d8d,0xe75b1357,0xf8721671,0xaf537d5d,0x4040cb08,0x4eb4e2cc,0x34d2466a,0x0115af84,0xe1b00428,0x95983a1d,0x06b89fb4,0xce6ea048,0x6f3f3b82,0x3520ab82,0x011a1d4b,0x277227f8,0x611560b1,0xe7933fdc,0xbb3a792b,0x344525bd,0xa08839e1,0x51ce794b,0x2f32c9b7,0xa01fbac9,0xe01cc87e,0xbcc7d1f6,0xcf0111c3,0xa1e8aac7,0x1a908749,0xd44fbd9a,0xd0dadecb,0xd50ada38,0x0339c32a,0xc6913667,0x8df9317c,0xe0b12b4f,0xf79e59b7,0x43f5bb3a,0xf2d519ff,0x27d9459c,0xbf97222c,0x15e6fc2a,0x0f91fc71,0x9b941525,0xfae59361,0xceb69ceb,0xc2a86459,0x12baa8d1,0xb6c1075e,0xe3056a0c,0x10d25065,0xcb03a442,0xe0ec6e0e,0x1698db3b,0x4c98a0be,0x3278e964,0x9f1f9532,0xe0d392df,0xd3a0342b,0x8971f21e,0x1b0a7441,0x4ba3348c,0xc5be7120,0xc37632d8,0xdf359f8d,0x9b992f2e,0xe60b6f47,0x0fe3f11d,0xe54cda54,0x1edad891,0xce6279cf,0xcd3e7e6f,0x1618b166,0xfd2c1d05,0x848fd2c5,0xf6fb2299,0xf523f357,0xa6327623,0x93a83531,0x56cccd02,0xacf08162,0x5a75ebb5,0x6e163697,0x88d273cc,0xde966292,0x81b949d0,0x4c50901b,0x71c65614,0xe6c6c7bd,0x327a140a,0x45e1d006,0xc3f27b9a,0xc9aa53fd,0x62a80f00,0xbb25bfe2,0x35bdd2f6,0x71126905,0xb2040222,0xb6cbcf7c,0xcd769c2b,0x53113ec0,0x1640e3d3,0x38abbd60,0x2547adf0,0xba38209c,0xf746ce76,0x77afa1c5,0x20756060,0x85cbfe4e,0x8ae88dd8,0x7aaaf9b0,0x4cf9aa7e,0x1948c25c,0x02fb8a8c,0x01c36ae4,0xd6ebe1f9,0x90d4f869,0xa65cdea0,0x3f09252d,0xc208e69f,0xb74e6132,0xce77e25b,0x578fdfe3,0x3ac372e6])];this.P=new Uint32Array([0x243f6a88,0x85a308d3,0x13198a2e,0x03707344,0xa4093822,0x299f31d0,0x082efa98,0xec4e6c89,0x452821e6,0x38d01377,0xbe5466cf,0x34e90c6c,0xc0ac29b7,0xc97c50dd,0x3f84d5b5,0xb5470917,0x9216d5d9,0x8979fb1b]);};function F(S,x8,i){return(S[0][x8[i+3]]+S[1][x8[i+2]]^S[2][x8[i+1]])+S[3][x8[i]];};Blowfish.prototype.encipher=function(x,x8){if(x8===undefined){x8=new Uint8Array(x.buffer);if(x.byteOffset!==0)x8=x8.subarray(x.byteOffset);}x[0]^=this.P[0];for(var i=1;i<16;i+=2){x[1]^=F(this.S,x8,0)^this.P[i];x[0]^=F(this.S,x8,4)^this.P[i+1];}var t=x[0];x[0]=x[1]^this.P[17];x[1]=t;};Blowfish.prototype.decipher=function(x){var x8=new Uint8Array(x.buffer);if(x.byteOffset!==0)x8=x8.subarray(x.byteOffset);x[0]^=this.P[17];for(var i=16;i>0;i-=2){x[1]^=F(this.S,x8,0)^this.P[i];x[0]^=F(this.S,x8,4)^this.P[i-1];}var t=x[0];x[0]=x[1]^this.P[0];x[1]=t;};function stream2word(data,databytes){var i,temp=0;for(i=0;i<4;i++,BLF_J++){if(BLF_J>=databytes)BLF_J=0;temp=temp<<8|data[BLF_J];}return temp;};Blowfish.prototype.expand0state=function(key,keybytes){var d=new Uint32Array(2),i,k;var d8=new Uint8Array(d.buffer);for(i=0,BLF_J=0;i<18;i++){this.P[i]^=stream2word(key,keybytes);}BLF_J=0;for(i=0;i<18;i+=2){this.encipher(d,d8);this.P[i]=d[0];this.P[i+1]=d[1];}for(i=0;i<4;i++){for(k=0;k<256;k+=2){this.encipher(d,d8);this.S[i][k]=d[0];this.S[i][k+1]=d[1];}}};Blowfish.prototype.expandstate=function(data,databytes,key,keybytes){var d=new Uint32Array(2),i,k;for(i=0,BLF_J=0;i<18;i++){this.P[i]^=stream2word(key,keybytes);}for(i=0,BLF_J=0;i<18;i+=2){d[0]^=stream2word(data,databytes);d[1]^=stream2word(data,databytes);this.encipher(d);this.P[i]=d[0];this.P[i+1]=d[1];}for(i=0;i<4;i++){for(k=0;k<256;k+=2){d[0]^=stream2word(data,databytes);d[1]^=stream2word(data,databytes);this.encipher(d);this.S[i][k]=d[0];this.S[i][k+1]=d[1];}}BLF_J=0;};Blowfish.prototype.enc=function(data,blocks){for(var i=0;i>>24;out[4*i+2]=cdata[i]>>>16;out[4*i+1]=cdata[i]>>>8;out[4*i+0]=cdata[i];}};function bcrypt_pbkdf(pass,passlen,salt,saltlen,key,keylen,rounds){var sha2pass=new Uint8Array(64),sha2salt=new Uint8Array(64),out=new Uint8Array(BCRYPT_HASHSIZE),tmpout=new Uint8Array(BCRYPT_HASHSIZE),countsalt=new Uint8Array(saltlen+4),i,j,amt,stride,dest,count,origkeylen=keylen;if(rounds<1)return-1;if(passlen===0||saltlen===0||keylen===0||keylen>out.byteLength*out.byteLength||saltlen>1<<20)return-1;stride=Math.floor((keylen+out.byteLength-1)/out.byteLength);amt=Math.floor((keylen+stride-1)/stride);for(i=0;i0;count++){countsalt[saltlen+0]=count>>>24;countsalt[saltlen+1]=count>>>16;countsalt[saltlen+2]=count>>>8;countsalt[saltlen+3]=count;crypto_hash_sha512(sha2salt,countsalt,saltlen+4);bcrypt_hash(sha2pass,sha2salt,tmpout);for(i=out.byteLength;i--;){out[i]=tmpout[i];}for(i=1;i=origkeylen)break;key[dest]=out[i];}keylen-=i;}return 0;};module.exports={BLOCKS:BCRYPT_BLOCKS,HASHSIZE:BCRYPT_HASHSIZE,hash:bcrypt_hash,pbkdf:bcrypt_pbkdf};},{"tweetnacl":498}],77:[function(require,module,exports){/*! bignumber.js v2.0.7 https://github.com/MikeMcl/bignumber.js/LICENCE */;(function(global){'use strict';/* + bignumber.js v2.0.7 + A JavaScript library for arbitrary-precision arithmetic. + https://github.com/MikeMcl/bignumber.js + Copyright (c) 2015 Michael Mclaughlin + MIT Expat Licence + */var BigNumber,crypto,parseNumeric,isNumeric=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,notBool=' not a boolean or binary digit',roundingMode='rounding mode',tooManyDigits='number type has more than 15 significant digits',ALPHABET='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_',BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=0x1fffffffffffff,// 2^53 - 1 +// MAX_INT32 = 0x7fffffff, // 2^31 - 1 +POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,/* + * The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and + * the arguments to toExponential, toFixed, toFormat, and toPrecision, beyond which an + * exception is thrown (if ERRORS is true). + */MAX=1E9;// 0 to MAX_INT32 +/* + * Create and return a BigNumber constructor. + */function another(configObj){var div,// id tracks the caller function, so its name can be included in error messages. +id=0,P=BigNumber.prototype,ONE=new BigNumber(1),/********************************* EDITABLE DEFAULTS **********************************//* + * The default values below must be integers within the inclusive ranges stated. + * The values can also be changed at run-time using BigNumber.config. + */// The maximum number of decimal places for operations involving division. +DECIMAL_PLACES=20,// 0 to MAX +/* + * The rounding mode used when rounding to the above decimal places, and when using + * toExponential, toFixed, toFormat and toPrecision, and round (default value). + * UP 0 Away from zero. + * DOWN 1 Towards zero. + * CEIL 2 Towards +Infinity. + * FLOOR 3 Towards -Infinity. + * HALF_UP 4 Towards nearest neighbour. If equidistant, up. + * HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. + * HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. + * HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. + * HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. + */ROUNDING_MODE=4,// 0 to 8 +// EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS] +// The exponent value at and beneath which toString returns exponential notation. +// Number type: -7 +TO_EXP_NEG=-7,// 0 to -MAX +// The exponent value at and above which toString returns exponential notation. +// Number type: 21 +TO_EXP_POS=21,// 0 to MAX +// RANGE : [MIN_EXP, MAX_EXP] +// The minimum exponent value, beneath which underflow to zero occurs. +// Number type: -324 (5e-324) +MIN_EXP=-1e7,// -1 to -MAX +// The maximum exponent value, above which overflow to Infinity occurs. +// Number type: 308 (1.7976931348623157e+308) +// For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow. +MAX_EXP=1e7,// 1 to MAX +// Whether BigNumber Errors are ever thrown. +ERRORS=true,// true or false +// Change to intValidatorNoErrors if ERRORS is false. +isValidInt=intValidatorWithErrors,// intValidatorWithErrors/intValidatorNoErrors +// Whether to use cryptographically-secure random number generation, if available. +CRYPTO=false,// true or false +/* + * The modulo mode used when calculating the modulus: a mod n. + * The quotient (q = a / n) is calculated according to the corresponding rounding mode. + * The remainder (r) is calculated as: r = a - n * q. + * + * UP 0 The remainder is positive if the dividend is negative, else is negative. + * DOWN 1 The remainder has the same sign as the dividend. + * This modulo mode is commonly known as 'truncated division' and is + * equivalent to (a % n) in JavaScript. + * FLOOR 3 The remainder has the same sign as the divisor (Python %). + * HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function. + * EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). + * The remainder is always positive. + * + * The truncated division, floored division, Euclidian division and IEEE 754 remainder + * modes are commonly used for the modulus operation. + * Although the other rounding modes can also be used, they may not give useful results. + */MODULO_MODE=1,// 0 to 9 +// The maximum number of significant digits of the result of the toPower operation. +// If POW_PRECISION is 0, there will be unlimited significant digits. +POW_PRECISION=100,// 0 to MAX +// The format specification used by the BigNumber.prototype.toFormat method. +FORMAT={decimalSeparator:'.',groupSeparator:',',groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:'\xA0',// non-breaking space +fractionGroupSize:0};/******************************************************************************************/// CONSTRUCTOR +/* + * The BigNumber constructor and exported function. + * Create and return a new instance of a BigNumber object. + * + * n {number|string|BigNumber} A numeric value. + * [b] {number} The base of n. Integer, 2 to 64 inclusive. + */function BigNumber(n,b){var c,e,i,num,len,str,x=this;// Enable constructor usage without new. +if(!(x instanceof BigNumber)){// 'BigNumber() constructor call without new: {n}' +if(ERRORS)raise(26,'constructor call without new',n);return new BigNumber(n,b);}// 'new BigNumber() base not an integer: {b}' +// 'new BigNumber() base out of range: {b}' +if(b==null||!isValidInt(b,2,64,id,'base')){// Duplicate. +if(n instanceof BigNumber){x.s=n.s;x.e=n.e;x.c=(n=n.c)?n.slice():n;id=0;return;}if((num=typeof n=='number')&&n*0==0){x.s=1/n<0?(n=-n,-1):1;// Fast path for integers. +if(n===~~n){for(e=0,i=n;i>=10;i/=10,e++){}x.e=e;x.c=[n];id=0;return;}str=n+'';}else{if(!isNumeric.test(str=n+''))return parseNumeric(x,str,num);x.s=str.charCodeAt(0)===45?(str=str.slice(1),-1):1;}}else{b=b|0;str=n+'';// Ensure return value is rounded to DECIMAL_PLACES as with other bases. +// Allow exponential notation to be used with base 10 argument. +if(b==10){x=new BigNumber(n instanceof BigNumber?n:str);return round(x,DECIMAL_PLACES+x.e+1,ROUNDING_MODE);}// Avoid potential interpretation of Infinity and NaN as base 44+ values. +// Any number in exponential form will fail due to the [Ee][+-]. +if((num=typeof n=='number')&&n*0!=0||!new RegExp('^-?'+(c='['+ALPHABET.slice(0,b)+']+')+'(?:\\.'+c+')?$',b<37?'i':'').test(str)){return parseNumeric(x,str,num,b);}if(num){x.s=1/n<0?(str=str.slice(1),-1):1;if(ERRORS&&str.replace(/^0\.0*|\./,'').length>15){// 'new BigNumber() number type has more than 15 significant digits: {n}' +raise(id,tooManyDigits,n);}// Prevent later check for length on converted number. +num=false;}else{x.s=str.charCodeAt(0)===45?(str=str.slice(1),-1):1;}str=convertBase(str,10,b,x.s);}// Decimal point? +if((e=str.indexOf('.'))>-1)str=str.replace('.','');// Exponential form? +if((i=str.search(/e/i))>0){// Determine exponent. +if(e<0)e=i;e+=+str.slice(i+1);str=str.substring(0,i);}else if(e<0){// Integer. +e=str.length;}// Determine leading zeros. +for(i=0;str.charCodeAt(i)===48;i++){}// Determine trailing zeros. +for(len=str.length;str.charCodeAt(--len)===48;){}str=str.slice(i,len+1);if(str){len=str.length;// Disallow numbers with over 15 significant digits if number type. +// 'new BigNumber() number type has more than 15 significant digits: {n}' +if(num&&ERRORS&&len>15)raise(id,tooManyDigits,x.s*n);e=e-i-1;// Overflow? +if(e>MAX_EXP){// Infinity. +x.c=x.e=null;// Underflow? +}else if(ei)return(v=a[i++])!=null;};// DECIMAL_PLACES {number} Integer, 0 to MAX inclusive. +// 'config() DECIMAL_PLACES not an integer: {v}' +// 'config() DECIMAL_PLACES out of range: {v}' +if(has(p='DECIMAL_PLACES')&&isValidInt(v,0,MAX,2,p)){DECIMAL_PLACES=v|0;}r[p]=DECIMAL_PLACES;// ROUNDING_MODE {number} Integer, 0 to 8 inclusive. +// 'config() ROUNDING_MODE not an integer: {v}' +// 'config() ROUNDING_MODE out of range: {v}' +if(has(p='ROUNDING_MODE')&&isValidInt(v,0,8,2,p)){ROUNDING_MODE=v|0;}r[p]=ROUNDING_MODE;// EXPONENTIAL_AT {number|number[]} +// Integer, -MAX to MAX inclusive or [integer -MAX to 0 inclusive, 0 to MAX inclusive]. +// 'config() EXPONENTIAL_AT not an integer: {v}' +// 'config() EXPONENTIAL_AT out of range: {v}' +if(has(p='EXPONENTIAL_AT')){if(isArray(v)){if(isValidInt(v[0],-MAX,0,2,p)&&isValidInt(v[1],0,MAX,2,p)){TO_EXP_NEG=v[0]|0;TO_EXP_POS=v[1]|0;}}else if(isValidInt(v,-MAX,MAX,2,p)){TO_EXP_NEG=-(TO_EXP_POS=(v<0?-v:v)|0);}}r[p]=[TO_EXP_NEG,TO_EXP_POS];// RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or +// [integer -MAX to -1 inclusive, integer 1 to MAX inclusive]. +// 'config() RANGE not an integer: {v}' +// 'config() RANGE cannot be zero: {v}' +// 'config() RANGE out of range: {v}' +if(has(p='RANGE')){if(isArray(v)){if(isValidInt(v[0],-MAX,-1,2,p)&&isValidInt(v[1],1,MAX,2,p)){MIN_EXP=v[0]|0;MAX_EXP=v[1]|0;}}else if(isValidInt(v,-MAX,MAX,2,p)){if(v|0)MIN_EXP=-(MAX_EXP=(v<0?-v:v)|0);else if(ERRORS)raise(2,p+' cannot be zero',v);}}r[p]=[MIN_EXP,MAX_EXP];// ERRORS {boolean|number} true, false, 1 or 0. +// 'config() ERRORS not a boolean or binary digit: {v}' +if(has(p='ERRORS')){if(v===!!v||v===1||v===0){id=0;isValidInt=(ERRORS=!!v)?intValidatorWithErrors:intValidatorNoErrors;}else if(ERRORS){raise(2,p+notBool,v);}}r[p]=ERRORS;// CRYPTO {boolean|number} true, false, 1 or 0. +// 'config() CRYPTO not a boolean or binary digit: {v}' +// 'config() crypto unavailable: {crypto}' +if(has(p='CRYPTO')){if(v===!!v||v===1||v===0){CRYPTO=!!(v&&crypto&&(typeof crypto==="undefined"?"undefined":_typeof(crypto))=='object');if(v&&!CRYPTO&&ERRORS)raise(2,'crypto unavailable',crypto);}else if(ERRORS){raise(2,p+notBool,v);}}r[p]=CRYPTO;// MODULO_MODE {number} Integer, 0 to 9 inclusive. +// 'config() MODULO_MODE not an integer: {v}' +// 'config() MODULO_MODE out of range: {v}' +if(has(p='MODULO_MODE')&&isValidInt(v,0,9,2,p)){MODULO_MODE=v|0;}r[p]=MODULO_MODE;// POW_PRECISION {number} Integer, 0 to MAX inclusive. +// 'config() POW_PRECISION not an integer: {v}' +// 'config() POW_PRECISION out of range: {v}' +if(has(p='POW_PRECISION')&&isValidInt(v,0,MAX,2,p)){POW_PRECISION=v|0;}r[p]=POW_PRECISION;// FORMAT {object} +// 'config() FORMAT not an object: {v}' +if(has(p='FORMAT')){if((typeof v==="undefined"?"undefined":_typeof(v))=='object'){FORMAT=v;}else if(ERRORS){raise(2,p+' not an object',v);}}r[p]=FORMAT;return r;};/* + * Return a new BigNumber whose value is the maximum of the arguments. + * + * arguments {number|string|BigNumber} + */BigNumber.max=function(){return maxOrMin(arguments,P.lt);};/* + * Return a new BigNumber whose value is the minimum of the arguments. + * + * arguments {number|string|BigNumber} + */BigNumber.min=function(){return maxOrMin(arguments,P.gt);};/* + * Return a new BigNumber with a random value equal to or greater than 0 and less than 1, + * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing + * zeros are produced). + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * + * 'random() decimal places not an integer: {dp}' + * 'random() decimal places out of range: {dp}' + * 'random() crypto unavailable: {crypto}' + */BigNumber.random=function(){var pow2_53=0x20000000000000;// Return a 53 bit integer n, where 0 <= n < 9007199254740992. +// Check if Math.random() produces more than 32 bits of randomness. +// If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits. +// 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1. +var random53bitInt=Math.random()*pow2_53&0x1fffff?function(){return mathfloor(Math.random()*pow2_53);}:function(){return(Math.random()*0x40000000|0)*0x800000+(Math.random()*0x800000|0);};return function(dp){var a,b,e,k,v,i=0,c=[],rand=new BigNumber(ONE);dp=dp==null||!isValidInt(dp,0,MAX,14)?DECIMAL_PLACES:dp|0;k=mathceil(dp/LOG_BASE);if(CRYPTO){// Browsers supporting crypto.getRandomValues. +if(crypto&&crypto.getRandomValues){a=crypto.getRandomValues(new Uint32Array(k*=2));for(;i>> 11).toString(2) +// 11111 11111111 11111111 +// 0x20000 is 2^21. +v=a[i]*0x20000+(a[i+1]>>>11);// Rejection sampling: +// 0 <= v < 9007199254740992 +// Probability that v >= 9e15, is +// 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251 +if(v>=9e15){b=crypto.getRandomValues(new Uint32Array(2));a[i]=b[0];a[i+1]=b[1];}else{// 0 <= v <= 8999999999999999 +// 0 <= (v % 1e14) <= 99999999999999 +c.push(v%1e14);i+=2;}}i=k/2;// Node.js supporting crypto.randomBytes. +}else if(crypto&&crypto.randomBytes){// buffer +a=crypto.randomBytes(k*=7);for(;i=9e15){crypto.randomBytes(7).copy(a,i);}else{// 0 <= (v % 1e14) <= 99999999999999 +c.push(v%1e14);i+=7;}}i=k/7;}else if(ERRORS){raise(14,'crypto unavailable',crypto);}}// Use Math.random: CRYPTO is false or crypto is unavailable and ERRORS is false. +if(!i){for(;i=10;v/=10,i++){}// adjust the exponent accordingly. +if(i=0){k=POW_PRECISION;// Unlimited precision. +POW_PRECISION=0;str=str.replace('.','');y=new BigNumber(baseIn);x=y.pow(str.length-i);POW_PRECISION=k;// Convert str as if an integer, then restore the fraction part by dividing the +// result by its base raised to a power. +y.c=toBaseOut(toFixedPoint(coeffToString(x.c),x.e),10,baseOut);y.e=y.c.length;}// Convert the number as integer. +xc=toBaseOut(str,baseIn,baseOut);e=k=xc.length;// Remove trailing zeros. +for(;xc[--k]==0;xc.pop()){}if(!xc[0])return'0';if(i<0){--e;}else{x.c=xc;x.e=e;// sign is needed for correct rounding. +x.s=sign;x=div(x,y,dp,rm,baseOut);xc=x.c;r=x.r;e=x.e;}d=e+dp+1;// The rounding digit, i.e. the digit to the right of the digit that may be rounded up. +i=xc[d];k=baseOut/2;r=r||d<0||xc[d+1]!=null;r=rm<4?(i!=null||r)&&(rm==0||rm==(x.s<0?3:2)):i>k||i==k&&(rm==4||r||rm==6&&xc[d-1]&1||rm==(x.s<0?8:7));if(d<1||!xc[0]){// 1^-dp or 0. +str=r?toFixedPoint('1',-dp):'0';}else{xc.length=d;if(r){// Rounding up may mean the previous digit has to be rounded up and so on. +for(--baseOut;++xc[--d]>baseOut;){xc[d]=0;if(!d){++e;xc.unshift(1);}}}// Determine trailing zeros. +for(k=xc.length;!xc[--k];){}// E.g. [4, 11, 15] becomes 4bf. +for(i=0,str='';i<=k;str+=ALPHABET.charAt(xc[i++])){}str=toFixedPoint(str,e);}// The caller will add the sign. +return str;}// Perform division in the specified base. Called by div and convertBase. +div=function(){// Assume non-zero x and k. +function multiply(x,k,base){var m,temp,xlo,xhi,carry=0,i=x.length,klo=k%SQRT_BASE,khi=k/SQRT_BASE|0;for(x=x.slice();i--;){xlo=x[i]%SQRT_BASE;xhi=x[i]/SQRT_BASE|0;m=khi*xlo+xhi*klo;temp=klo*xlo+m%SQRT_BASE*SQRT_BASE+carry;carry=(temp/base|0)+(m/SQRT_BASE|0)+khi*xhi;x[i]=temp%base;}if(carry)x.unshift(carry);return x;}function compare(a,b,aL,bL){var i,cmp;if(aL!=bL){cmp=aL>bL?1:-1;}else{for(i=cmp=0;ib[i]?1:-1;break;}}}return cmp;}function subtract(a,b,aL,base){var i=0;// Subtract b from a. +for(;aL--;){a[aL]-=i;i=a[aL]1;a.shift()){}}// x: dividend, y: divisor. +return function(x,y,dp,rm,base){var cmp,e,i,more,n,prod,prodL,q,qc,rem,remL,rem0,xi,xL,yc0,yL,yz,s=x.s==y.s?1:-1,xc=x.c,yc=y.c;// Either NaN, Infinity or 0? +if(!xc||!xc[0]||!yc||!yc[0]){return new BigNumber(// Return NaN if either NaN, or both Infinity or 0. +!x.s||!y.s||(xc?yc&&xc[0]==yc[0]:!yc)?NaN:// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. +xc&&xc[0]==0||!yc?s*0:s/0);}q=new BigNumber(s);qc=q.c=[];e=x.e-y.e;s=dp+e+1;if(!base){base=BASE;e=bitFloor(x.e/LOG_BASE)-bitFloor(y.e/LOG_BASE);s=s/LOG_BASE|0;}// Result exponent may be one less then the current value of e. +// The coefficients of the BigNumbers from convertBase may have trailing zeros. +for(i=0;yc[i]==(xc[i]||0);i++){}if(yc[i]>(xc[i]||0))e--;if(s<0){qc.push(1);more=true;}else{xL=xc.length;yL=yc.length;i=0;s+=2;// Normalise xc and yc so highest order digit of yc is >= base / 2. +n=mathfloor(base/(yc[0]+1));// Not necessary, but to handle odd bases where yc[0] == ( base / 2 ) - 1. +// if ( n > 1 || n++ == 1 && yc[0] < base / 2 ) { +if(n>1){yc=multiply(yc,n,base);xc=multiply(xc,n,base);yL=yc.length;xL=xc.length;}xi=yL;rem=xc.slice(0,yL);remL=rem.length;// Add zeros to make remainder as long as divisor. +for(;remL=base/2)yc0++;// Not necessary, but to prevent trial digit n > base, when using base 3. +// else if ( base == 3 && yc0 == 1 ) yc0 = 1 + 1e-15; +do{n=0;// Compare divisor and remainder. +cmp=compare(yc,rem,yL,remL);// If divisor < remainder. +if(cmp<0){// Calculate trial digit, n. +rem0=rem[0];if(yL!=remL)rem0=rem0*base+(rem[1]||0);// n is how many times the divisor goes into the current remainder. +n=mathfloor(rem0/yc0);// Algorithm: +// 1. product = divisor * trial digit (n) +// 2. if product > remainder: product -= divisor, n-- +// 3. remainder -= product +// 4. if product was < remainder at 2: +// 5. compare new remainder and divisor +// 6. If remainder > divisor: remainder -= divisor, n++ +if(n>1){// n may be > base only when base is 3. +if(n>=base)n=base-1;// product = divisor * trial digit. +prod=multiply(yc,n,base);prodL=prod.length;remL=rem.length;// Compare product and remainder. +// If product > remainder. +// Trial digit n too high. +// n is 1 too high about 5% of the time, and is not known to have +// ever been more than 1 too high. +while(compare(prod,rem,prodL,remL)==1){n--;// Subtract divisor from product. +subtract(prod,yL=10;s/=10,i++){}round(q,dp+(q.e=i+e*LOG_BASE-1)+1,rm,more);// Caller is convertBase. +}else{q.e=e;q.r=+more;}return q;};}();/* + * Return a string representing the value of BigNumber n in fixed-point or exponential + * notation rounded to the specified decimal places or significant digits. + * + * n is a BigNumber. + * i is the index of the last digit required (i.e. the digit that may be rounded up). + * rm is the rounding mode. + * caller is caller id: toExponential 19, toFixed 20, toFormat 21, toPrecision 24. + */function format(n,i,rm,caller){var c0,e,ne,len,str;rm=rm!=null&&isValidInt(rm,0,8,caller,roundingMode)?rm|0:ROUNDING_MODE;if(!n.c)return n.toString();c0=n.c[0];ne=n.e;if(i==null){str=coeffToString(n.c);str=caller==19||caller==24&&ne<=TO_EXP_NEG?toExponential(str,ne):toFixedPoint(str,ne);}else{n=round(new BigNumber(n),i,rm);// n.e may have changed if the value was rounded up. +e=n.e;str=coeffToString(n.c);len=str.length;// toPrecision returns exponential notation if the number of significant digits +// specified is less than the number of digits necessary to represent the integer +// part of the value in fixed-point notation. +// Exponential notation. +if(caller==19||caller==24&&(i<=e||e<=TO_EXP_NEG)){// Append zeros? +for(;lenlen){if(--i>0)for(str+='.';i--;str+='0'){}}else{i+=e-len;if(i>0){if(e+1==len)str+='.';for(;i--;str+='0'){}}}}}return n.s<0&&c0?'-'+str:str;}// Handle BigNumber.max and BigNumber.min. +function maxOrMin(args,method){var m,n,i=0;if(isArray(args[0]))args=args[0];m=new BigNumber(args[0]);for(;++imax||n!=truncate(n)){raise(caller,(name||'decimal places')+(nmax?' out of range':' not an integer'),n);}return true;}/* + * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP. + * Called by minus, plus and times. + */function normalise(n,c,e){var i=1,j=c.length;// Remove trailing zeros. +for(;!c[--j];c.pop()){}// Calculate the base 10 exponent. First get the number of digits of c[0]. +for(j=c[0];j>=10;j/=10,i++){}// Overflow? +if((e=i+e*LOG_BASE-1)>MAX_EXP){// Infinity. +n.c=n.e=null;// Underflow? +}else if(e=10;k/=10,d++){}i=sd-d;// If the rounding digit is in the first element of xc... +if(i<0){i+=LOG_BASE;j=sd;n=xc[ni=0];// Get the rounding digit at index j of n. +rd=n/pows10[d-j-1]%10|0;}else{ni=mathceil((i+1)/LOG_BASE);if(ni>=xc.length){if(r){// Needed by sqrt. +for(;xc.length<=ni;xc.push(0)){}n=rd=0;d=1;i%=LOG_BASE;j=i-LOG_BASE+1;}else{break out;}}else{n=k=xc[ni];// Get the number of digits of n. +for(d=1;k>=10;k/=10,d++){}// Get the index of rd within n. +i%=LOG_BASE;// Get the index of rd within n, adjusted for leading zeros. +// The number of leading zeros of n is given by LOG_BASE - d. +j=i-LOG_BASE+d;// Get the rounding digit at index j of n. +rd=j<0?0:n/pows10[d-j-1]%10|0;}}r=r||sd<0||// Are there any non-zero digits after the rounding digit? +// The expression n % pows10[ d - j - 1 ] returns all digits of n to the right +// of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. +xc[ni+1]!=null||(j<0?n:n%pows10[d-j-1]);r=rm<4?(rd||r)&&(rm==0||rm==(x.s<0?3:2)):rd>5||rd==5&&(rm==4||r||rm==6&&// Check whether the digit to the left of the rounding digit is odd. +(i>0?j>0?n/pows10[d-j]:0:xc[ni-1])%10&1||rm==(x.s<0?8:7));if(sd<1||!xc[0]){xc.length=0;if(r){// Convert sd to decimal places. +sd-=x.e+1;// 1, 0.1, 0.01, 0.001, 0.0001 etc. +xc[0]=pows10[sd%LOG_BASE];x.e=-sd||0;}else{// Zero. +xc[0]=x.e=0;}return x;}// Remove excess digits. +if(i==0){xc.length=ni;k=1;ni--;}else{xc.length=ni+1;k=pows10[LOG_BASE-i];// E.g. 56700 becomes 56000 if 7 is the rounding digit. +// j > 0 means i > number of leading zeros of n. +xc[ni]=j>0?mathfloor(n/pows10[d-j]%pows10[j])*k:0;}// Round up? +if(r){for(;;){// If the digit to be rounded up is in the first element of xc... +if(ni==0){// i will be the length of xc[0] before k is added. +for(i=1,j=xc[0];j>=10;j/=10,i++){}j=xc[0]+=k;for(k=1;j>=10;j/=10,k++){}// if i != k the length has increased. +if(i!=k){x.e++;if(xc[0]==BASE)xc[0]=1;}break;}else{xc[ni]+=k;if(xc[ni]!=BASE)break;xc[ni--]=0;k=1;}}}// Remove trailing zeros. +for(i=xc.length;xc[--i]===0;xc.pop()){}}// Overflow? Infinity. +if(x.e>MAX_EXP){x.c=x.e=null;// Underflow? Zero. +}else if(x.e0;};/* + * Return true if the value of this BigNumber is greater than or equal to the value of + * BigNumber(y, b), otherwise returns false. + */P.greaterThanOrEqualTo=P.gte=function(y,b){id=7;return(b=compare(this,new BigNumber(y,b)))===1||b===0;};/* + * Return true if the value of this BigNumber is a finite number, otherwise returns false. + */P.isFinite=function(){return!!this.c;};/* + * Return true if the value of this BigNumber is an integer, otherwise return false. + */P.isInteger=P.isInt=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2;};/* + * Return true if the value of this BigNumber is NaN, otherwise returns false. + */P.isNaN=function(){return!this.s;};/* + * Return true if the value of this BigNumber is negative, otherwise returns false. + */P.isNegative=P.isNeg=function(){return this.s<0;};/* + * Return true if the value of this BigNumber is 0 or -0, otherwise returns false. + */P.isZero=function(){return!!this.c&&this.c[0]==0;};/* + * Return true if the value of this BigNumber is less than the value of BigNumber(y, b), + * otherwise returns false. + */P.lessThan=P.lt=function(y,b){id=8;return compare(this,new BigNumber(y,b))<0;};/* + * Return true if the value of this BigNumber is less than or equal to the value of + * BigNumber(y, b), otherwise returns false. + */P.lessThanOrEqualTo=P.lte=function(y,b){id=9;return(b=compare(this,new BigNumber(y,b)))===-1||b===0;};/* + * n - 0 = n + * n - N = N + * n - I = -I + * 0 - n = -n + * 0 - 0 = 0 + * 0 - N = N + * 0 - I = -I + * N - n = N + * N - 0 = N + * N - N = N + * N - I = N + * I - n = I + * I - 0 = I + * I - N = N + * I - I = N + * + * Return a new BigNumber whose value is the value of this BigNumber minus the value of + * BigNumber(y, b). + */P.minus=P.sub=function(y,b){var i,j,t,xLTy,x=this,a=x.s;id=10;y=new BigNumber(y,b);b=y.s;// Either NaN? +if(!a||!b)return new BigNumber(NaN);// Signs differ? +if(a!=b){y.s=-b;return x.plus(y);}var xe=x.e/LOG_BASE,ye=y.e/LOG_BASE,xc=x.c,yc=y.c;if(!xe||!ye){// Either Infinity? +if(!xc||!yc)return xc?(y.s=-b,y):new BigNumber(yc?x:NaN);// Either zero? +if(!xc[0]||!yc[0]){// Return y if y is non-zero, x if x is non-zero, or zero if both are zero. +return yc[0]?(y.s=-b,y):new BigNumber(xc[0]?x:// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity +ROUNDING_MODE==3?-0:0);}}xe=bitFloor(xe);ye=bitFloor(ye);xc=xc.slice();// Determine which is the bigger number. +if(a=xe-ye){if(xLTy=a<0){a=-a;t=xc;}else{ye=xe;t=yc;}t.reverse();// Prepend zeros to equalise exponents. +for(b=a;b--;t.push(0)){}t.reverse();}else{// Exponents equal. Check digit by digit. +j=(xLTy=(a=xc.length)<(b=yc.length))?a:b;for(a=b=0;b0)for(;b--;xc[i++]=0){}b=BASE-1;// Subtract yc from xc. +for(;j>a;){if(xc[--j]0){ye=xe;t=yc;}else{a=-a;t=xc;}t.reverse();for(;a--;t.push(0)){}t.reverse();}a=xc.length;b=yc.length;// Point xc to the longer array, and b to the shorter length. +if(a-b<0)t=yc,yc=xc,xc=t,b=a;// Only start adding at yc.length - 1 as the further digits of xc can be ignored. +for(a=0;b;){a=(xc[--b]=xc[b]+yc[b]+a)/BASE|0;xc[b]%=BASE;}if(a){xc.unshift(a);++ye;}// No need to check for zero, as +x + +y != 0 && -x + -y != 0 +// ye = MAX_EXP + 1 possible +return normalise(y,xc,ye);};/* + * Return the number of significant digits of the value of this BigNumber. + * + * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0. + */P.precision=P.sd=function(z){var n,v,x=this,c=x.c;// 'precision() argument not a boolean or binary digit: {z}' +if(z!=null&&z!==!!z&&z!==1&&z!==0){if(ERRORS)raise(13,'argument'+notBool,z);if(z!=!!z)z=null;}if(!c)return null;v=c.length-1;n=v*LOG_BASE+1;if(v=c[v]){// Subtract the number of trailing zeros of the last element. +for(;v%10==0;v/=10,n--){}// Add the number of digits of the first element. +for(v=c[0];v>=10;v/=10,n++){}}if(z&&x.e+1>n)n=x.e+1;return n;};/* + * Return a new BigNumber whose value is the value of this BigNumber rounded to a maximum of + * dp decimal places using rounding mode rm, or to 0 and ROUNDING_MODE respectively if + * omitted. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * 'round() decimal places out of range: {dp}' + * 'round() decimal places not an integer: {dp}' + * 'round() rounding mode not an integer: {rm}' + * 'round() rounding mode out of range: {rm}' + */P.round=function(dp,rm){var n=new BigNumber(this);if(dp==null||isValidInt(dp,0,MAX,15)){round(n,~~dp+this.e+1,rm==null||!isValidInt(rm,0,8,15,roundingMode)?ROUNDING_MODE:rm|0);}return n;};/* + * Return a new BigNumber whose value is the value of this BigNumber shifted by k places + * (powers of 10). Shift to the right if n > 0, and to the left if n < 0. + * + * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive. + * + * If k is out of range and ERRORS is false, the result will be ±0 if k < 0, or ±Infinity + * otherwise. + * + * 'shift() argument not an integer: {k}' + * 'shift() argument out of range: {k}' + */P.shift=function(k){var n=this;return isValidInt(k,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,16,'argument')// k < 1e+21, or truncate(k) will produce exponential notation. +?n.times('1e'+truncate(k)):new BigNumber(n.c&&n.c[0]&&(k<-MAX_SAFE_INTEGER||k>MAX_SAFE_INTEGER)?n.s*(k<0?0:1/0):n);};/* + * sqrt(-n) = N + * sqrt( N) = N + * sqrt(-I) = N + * sqrt( I) = I + * sqrt( 0) = 0 + * sqrt(-0) = -0 + * + * Return a new BigNumber whose value is the square root of the value of this BigNumber, + * rounded according to DECIMAL_PLACES and ROUNDING_MODE. + */P.squareRoot=P.sqrt=function(){var m,n,r,rep,t,x=this,c=x.c,s=x.s,e=x.e,dp=DECIMAL_PLACES+4,half=new BigNumber('0.5');// Negative/NaN/Infinity/zero? +if(s!==1||!c||!c[0]){return new BigNumber(!s||s<0&&(!c||c[0])?NaN:c?x:1/0);}// Initial estimate. +s=Math.sqrt(+x);// Math.sqrt underflow/overflow? +// Pass x to Math.sqrt as integer, then adjust the exponent of the result. +if(s==0||s==1/0){n=coeffToString(c);if((n.length+e)%2==0)n+='0';s=Math.sqrt(n);e=bitFloor((e+1)/2)-(e<0||e%2);if(s==1/0){n='1e'+e;}else{n=s.toExponential();n=n.slice(0,n.indexOf('e')+1)+e;}r=new BigNumber(n);}else{r=new BigNumber(s+'');}// Check for zero. +// r could be zero if MIN_EXP is changed after the this value was created. +// This would cause a division by zero (x/t) and hence Infinity below, which would cause +// coeffToString to throw. +if(r.c[0]){e=r.e;s=e+dp;if(s<3)s=0;// Newton-Raphson iteration. +for(;;){t=r;r=half.times(t.plus(div(x,t,dp,1)));if(coeffToString(t.c).slice(0,s)===(n=coeffToString(r.c)).slice(0,s)){// The exponent of r may here be one less than the final result exponent, +// e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits +// are indexed correctly. +if(r.e=0;){c=0;ylo=yc[i]%sqrtBase;yhi=yc[i]/sqrtBase|0;for(k=xcL,j=i+k;j>i;){xlo=xc[--k]%sqrtBase;xhi=xc[k]/sqrtBase|0;m=yhi*xlo+xhi*ylo;xlo=ylo*xlo+m%sqrtBase*sqrtBase+zc[j]+c;c=(xlo/base|0)+(m/sqrtBase|0)+yhi*xhi;zc[j--]=xlo%base;}zc[j]=c;}if(c){++e;}else{zc.shift();}return normalise(y,zc,e);};/* + * Return a new BigNumber whose value is the value of this BigNumber rounded to a maximum of + * sd significant digits using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * [sd] {number} Significant digits. Integer, 1 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * 'toDigits() precision out of range: {sd}' + * 'toDigits() precision not an integer: {sd}' + * 'toDigits() rounding mode not an integer: {rm}' + * 'toDigits() rounding mode out of range: {rm}' + */P.toDigits=function(sd,rm){var n=new BigNumber(this);sd=sd==null||!isValidInt(sd,1,MAX,18,'precision')?null:sd|0;rm=rm==null||!isValidInt(rm,0,8,18,roundingMode)?ROUNDING_MODE:rm|0;return sd?round(n,sd,rm):n;};/* + * Return a string representing the value of this BigNumber in exponential notation and + * rounded using ROUNDING_MODE to dp fixed decimal places. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * 'toExponential() decimal places not an integer: {dp}' + * 'toExponential() decimal places out of range: {dp}' + * 'toExponential() rounding mode not an integer: {rm}' + * 'toExponential() rounding mode out of range: {rm}' + */P.toExponential=function(dp,rm){return format(this,dp!=null&&isValidInt(dp,0,MAX,19)?~~dp+1:null,rm,19);};/* + * Return a string representing the value of this BigNumber in fixed-point notation rounding + * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted. + * + * Note: as with JavaScript's number type, (-0).toFixed(0) is '0', + * but e.g. (-0.00001).toFixed(0) is '-0'. + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * 'toFixed() decimal places not an integer: {dp}' + * 'toFixed() decimal places out of range: {dp}' + * 'toFixed() rounding mode not an integer: {rm}' + * 'toFixed() rounding mode out of range: {rm}' + */P.toFixed=function(dp,rm){return format(this,dp!=null&&isValidInt(dp,0,MAX,20)?~~dp+this.e+1:null,rm,20);};/* + * Return a string representing the value of this BigNumber in fixed-point notation rounded + * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties + * of the FORMAT object (see BigNumber.config). + * + * FORMAT = { + * decimalSeparator : '.', + * groupSeparator : ',', + * groupSize : 3, + * secondaryGroupSize : 0, + * fractionGroupSeparator : '\xA0', // non-breaking space + * fractionGroupSize : 0 + * }; + * + * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * 'toFormat() decimal places not an integer: {dp}' + * 'toFormat() decimal places out of range: {dp}' + * 'toFormat() rounding mode not an integer: {rm}' + * 'toFormat() rounding mode out of range: {rm}' + */P.toFormat=function(dp,rm){var str=format(this,dp!=null&&isValidInt(dp,0,MAX,21)?~~dp+this.e+1:null,rm,21);if(this.c){var i,arr=str.split('.'),g1=+FORMAT.groupSize,g2=+FORMAT.secondaryGroupSize,groupSeparator=FORMAT.groupSeparator,intPart=arr[0],fractionPart=arr[1],isNeg=this.s<0,intDigits=isNeg?intPart.slice(1):intPart,len=intDigits.length;if(g2)i=g1,g1=g2,g2=i,len-=i;if(g1>0&&len>0){i=len%g1||g1;intPart=intDigits.substr(0,i);for(;i0)intPart+=groupSeparator+intDigits.slice(i);if(isNeg)intPart='-'+intPart;}str=fractionPart?intPart+FORMAT.decimalSeparator+((g2=+FORMAT.fractionGroupSize)?fractionPart.replace(new RegExp('\\d{'+g2+'}\\B','g'),'$&'+FORMAT.fractionGroupSeparator):fractionPart):intPart;}return str;};/* + * Return a string array representing the value of this BigNumber as a simple fraction with + * an integer numerator and an integer denominator. The denominator will be a positive + * non-zero value less than or equal to the specified maximum denominator. If a maximum + * denominator is not specified, the denominator will be the lowest value necessary to + * represent the number exactly. + * + * [md] {number|string|BigNumber} Integer >= 1 and < Infinity. The maximum denominator. + * + * 'toFraction() max denominator not an integer: {md}' + * 'toFraction() max denominator out of range: {md}' + */P.toFraction=function(md){var arr,d0,d2,e,exp,n,n0,q,s,k=ERRORS,x=this,xc=x.c,d=new BigNumber(ONE),n1=d0=new BigNumber(ONE),d1=n0=new BigNumber(ONE);if(md!=null){ERRORS=false;n=new BigNumber(md);ERRORS=k;if(!(k=n.isInt())||n.lt(ONE)){if(ERRORS){raise(22,'max denominator '+(k?'out of range':'not an integer'),md);}// ERRORS is false: +// If md is a finite non-integer >= 1, round it to an integer and use it. +md=!k&&n.c&&round(n,n.e+1,1).gte(ONE)?n:null;}}if(!xc)return x.toString();s=coeffToString(xc);// Determine initial denominator. +// d is a power of 10 and the minimum max denominator that specifies the value exactly. +e=d.e=s.length-x.e-1;d.c[0]=POWS_TEN[(exp=e%LOG_BASE)<0?LOG_BASE+exp:exp];md=!md||n.cmp(d)>0?e>0?d:n1:n;exp=MAX_EXP;MAX_EXP=1/0;n=new BigNumber(s);// n0 = d1 = 0 +n0.c[0]=0;for(;;){q=div(n,d,0,1);d2=d0.plus(q.times(d1));if(d2.cmp(md)==1)break;d0=d1;d1=d2;n1=n0.plus(q.times(d2=n1));n0=d2;d=n.minus(q.times(d2=d));n=d2;}d2=div(md.minus(d0),d1,0,1);n0=n0.plus(d2.times(n1));d0=d0.plus(d2.times(d1));n0.s=n1.s=x.s;e*=2;// Determine which fraction is closer to x, n0/d0 or n1/d1 +arr=div(n1,d1,e,ROUNDING_MODE).minus(x).abs().cmp(div(n0,d0,e,ROUNDING_MODE).minus(x).abs())<1?[n1.toString(),d1.toString()]:[n0.toString(),d0.toString()];MAX_EXP=exp;return arr;};/* + * Return the value of this BigNumber converted to a number primitive. + */P.toNumber=function(){var x=this;// Ensure zero has correct sign. +return+x||(x.s?x.s*0:NaN);};/* + * Return a BigNumber whose value is the value of this BigNumber raised to the power n. + * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE. + * If POW_PRECISION is not 0, round to POW_PRECISION using ROUNDING_MODE. + * + * n {number} Integer, -9007199254740992 to 9007199254740992 inclusive. + * (Performs 54 loop iterations for n of 9007199254740992.) + * + * 'pow() exponent not an integer: {n}' + * 'pow() exponent out of range: {n}' + */P.toPower=P.pow=function(n){var k,y,i=mathfloor(n<0?-n:+n),x=this;// Pass ±Infinity to Math.pow if exponent is out of range. +if(!isValidInt(n,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER,23,'exponent')&&(!isFinite(n)||i>MAX_SAFE_INTEGER&&(n/=0)||parseFloat(n)!=n&&!(n=NaN))){return new BigNumber(Math.pow(+x,n));}// Truncating each coefficient array to a length of k after each multiplication equates +// to truncating significant digits to POW_PRECISION + [28, 41], i.e. there will be a +// minimum of 28 guard digits retained. (Using + 1.5 would give [9, 21] guard digits.) +k=POW_PRECISION?mathceil(POW_PRECISION/LOG_BASE+2):0;y=new BigNumber(ONE);for(;;){if(i%2){y=y.times(x);if(!y.c)break;if(k&&y.c.length>k)y.c.length=k;}i=mathfloor(i/2);if(!i)break;x=x.times(x);if(k&&x.c&&x.c.length>k)x.c.length=k;}if(n<0)y=ONE.div(y);return k?round(y,POW_PRECISION,ROUNDING_MODE):y;};/* + * Return a string representing the value of this BigNumber rounded to sd significant digits + * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits + * necessary to represent the integer part of the value in fixed-point notation, then use + * exponential notation. + * + * [sd] {number} Significant digits. Integer, 1 to MAX inclusive. + * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. + * + * 'toPrecision() precision not an integer: {sd}' + * 'toPrecision() precision out of range: {sd}' + * 'toPrecision() rounding mode not an integer: {rm}' + * 'toPrecision() rounding mode out of range: {rm}' + */P.toPrecision=function(sd,rm){return format(this,sd!=null&&isValidInt(sd,1,MAX,24,'precision')?sd|0:null,rm,24);};/* + * Return a string representing the value of this BigNumber in base b, or base 10 if b is + * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and + * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent + * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than + * TO_EXP_NEG, return exponential notation. + * + * [b] {number} Integer, 2 to 64 inclusive. + * + * 'toString() base not an integer: {b}' + * 'toString() base out of range: {b}' + */P.toString=function(b){var str,n=this,s=n.s,e=n.e;// Infinity or NaN? +if(e===null){if(s){str='Infinity';if(s<0)str='-'+str;}else{str='NaN';}}else{str=coeffToString(n.c);if(b==null||!isValidInt(b,2,64,25,'base')){str=e<=TO_EXP_NEG||e>=TO_EXP_POS?toExponential(str,e):toFixedPoint(str,e);}else{str=convertBase(toFixedPoint(str,e),b|0,10,s);}if(s<0&&n.c[0])str='-'+str;}return str;};/* + * Return a new BigNumber whose value is the value of this BigNumber truncated to a whole + * number. + */P.truncated=P.trunc=function(){return round(new BigNumber(this),this.e+1,1);};/* + * Return as toString, but do not accept a base argument. + */P.valueOf=P.toJSON=function(){return this.toString();};// Aliases for BigDecimal methods. +//P.add = P.plus; // P.add included above +//P.subtract = P.minus; // P.sub included above +//P.multiply = P.times; // P.mul included above +//P.divide = P.div; +//P.remainder = P.mod; +//P.compareTo = P.cmp; +//P.negate = P.neg; +if(configObj!=null)BigNumber.config(configObj);return BigNumber;}// PRIVATE HELPER FUNCTIONS +function bitFloor(n){var i=n|0;return n>0||n===i?i:i-1;}// Return a coefficient array as a string of base 10 digits. +function coeffToString(a){var s,z,i=1,j=a.length,r=a[0]+'';for(;il^a?1:-1;j=(k=xc.length)<(l=yc.length)?k:l;// Compare digit by digit. +for(i=0;iyc[i]^a?1:-1;}// Compare lengths. +return k==l?0:k>l^a?1:-1;}/* + * Return true if n is a valid number in range, otherwise false. + * Use for argument validation when ERRORS is false. + * Note: parseInt('1e+1') == 1 but parseFloat('1e+1') == 10. + */function intValidatorNoErrors(n,min,max){return(n=truncate(n))>=min&&n<=max;}function isArray(obj){return Object.prototype.toString.call(obj)=='[object Array]';}/* + * Convert string of baseIn to an array of numbers of baseOut. + * Eg. convertBase('255', 10, 16) returns [15, 15]. + * Eg. convertBase('ff', 16, 10) returns [2, 5, 5]. + */function toBaseOut(str,baseIn,baseOut){var j,arr=[0],arrL,i=0,len=str.length;for(;ibaseOut-1){if(arr[j+1]==null)arr[j+1]=0;arr[j+1]+=arr[j]/baseOut|0;arr[j]%=baseOut;}}}return arr.reverse();}function toExponential(str,e){return(str.length>1?str.charAt(0)+'.'+str.slice(1):str)+(e<0?'e':'e+')+e;}function toFixedPoint(str,e){var len,z;// Negative exponent? +if(e<0){// Prepend zeros. +for(z='0.';++e;z+='0'){}str=z+str;// Positive exponent +}else{len=str.length;// Append zeros. +if(++e>len){for(z='0',e-=len;--e;z+='0'){}str+=z;}else if(e';};module.exports=Address;var Script=require('./script');}).call(this,require("buffer").Buffer);},{"./crypto/hash":86,"./encoding/base58check":91,"./errors":95,"./networks":100,"./publickey":103,"./script":104,"./util/js":122,"./util/preconditions":123,"buffer":191,"lodash":149}],80:[function(require,module,exports){(function(Buffer){'use strict';var _=require('lodash');var BlockHeader=require('./blockheader');var BN=require('../crypto/bn');var BufferUtil=require('../util/buffer');var BufferReader=require('../encoding/bufferreader');var BufferWriter=require('../encoding/bufferwriter');var Hash=require('../crypto/hash');var Transaction=require('../transaction');var $=require('../util/preconditions');/** + * Instantiate a Block from a Buffer, JSON object, or Object with + * the properties of the Block + * + * @param {*} - A Buffer, JSON string, or Object + * @returns {Block} + * @constructor + */function Block(arg){if(!(this instanceof Block)){return new Block(arg);}_.extend(this,Block._from(arg));return this;}// https://github.com/bitcoin/bitcoin/blob/b5fa132329f0377d787a4a21c1686609c2bfaece/src/primitives/block.h#L14 +Block.MAX_BLOCK_SIZE=1000000;/** + * @param {*} - A Buffer, JSON string or Object + * @returns {Object} - An object representing block data + * @throws {TypeError} - If the argument was not recognized + * @private + */Block._from=function _from(arg){var info={};if(BufferUtil.isBuffer(arg)){info=Block._fromBufferReader(BufferReader(arg));}else if(_.isObject(arg)){info=Block._fromObject(arg);}else{throw new TypeError('Unrecognized argument for Block');}return info;};/** + * @param {Object} - A plain JavaScript object + * @returns {Object} - An object representing block data + * @private + */Block._fromObject=function _fromObject(data){var transactions=[];data.transactions.forEach(function(tx){if(tx instanceof Transaction){transactions.push(tx);}else{transactions.push(Transaction().fromObject(tx));}});var info={header:BlockHeader.fromObject(data.header),transactions:transactions};return info;};/** + * @param {Object} - A plain JavaScript object + * @returns {Block} - An instance of block + */Block.fromObject=function fromObject(obj){var info=Block._fromObject(obj);return new Block(info);};/** + * @param {BufferReader} - Block data + * @returns {Object} - An object representing the block data + * @private + */Block._fromBufferReader=function _fromBufferReader(br){var info={};$.checkState(!br.finished(),'No block data received');info.header=BlockHeader.fromBufferReader(br);var transactions=br.readVarintNum();info.transactions=[];for(var i=0;i1;size=Math.floor((size+1)/2)){for(var i=0;i';};Block.Values={START_OF_BLOCK:8,// Start of block in raw block data +NULL_HASH:new Buffer('0000000000000000000000000000000000000000000000000000000000000000','hex')};module.exports=Block;}).call(this,require("buffer").Buffer);},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../transaction":107,"../util/buffer":121,"../util/preconditions":123,"./blockheader":81,"buffer":191,"lodash":149}],81:[function(require,module,exports){(function(Buffer){'use strict';var _=require('lodash');var BN=require('../crypto/bn');var BufferUtil=require('../util/buffer');var BufferReader=require('../encoding/bufferreader');var BufferWriter=require('../encoding/bufferwriter');var Hash=require('../crypto/hash');var JSUtil=require('../util/js');var $=require('../util/preconditions');var GENESIS_BITS=0x1d00ffff;/** + * Instantiate a BlockHeader from a Buffer, JSON object, or Object with + * the properties of the BlockHeader + * + * @param {*} - A Buffer, JSON string, or Object + * @returns {BlockHeader} - An instance of block header + * @constructor + */var BlockHeader=function BlockHeader(arg){if(!(this instanceof BlockHeader)){return new BlockHeader(arg);}var info=BlockHeader._from(arg);this.version=info.version;this.prevHash=info.prevHash;this.merkleRoot=info.merkleRoot;this.time=info.time;this.timestamp=info.time;this.bits=info.bits;this.nonce=info.nonce;if(info.hash){$.checkState(this.hash===info.hash,'Argument object hash property does not match block hash.');}return this;};/** + * @param {*} - A Buffer, JSON string or Object + * @returns {Object} - An object representing block header data + * @throws {TypeError} - If the argument was not recognized + * @private + */BlockHeader._from=function _from(arg){var info={};if(BufferUtil.isBuffer(arg)){info=BlockHeader._fromBufferReader(BufferReader(arg));}else if(_.isObject(arg)){info=BlockHeader._fromObject(arg);}else{throw new TypeError('Unrecognized argument for BlockHeader');}return info;};/** + * @param {Object} - A JSON string + * @returns {Object} - An object representing block header data + * @private + */BlockHeader._fromObject=function _fromObject(data){$.checkArgument(data,'data is required');var prevHash=data.prevHash;var merkleRoot=data.merkleRoot;if(_.isString(data.prevHash)){prevHash=BufferUtil.reverse(new Buffer(data.prevHash,'hex'));}if(_.isString(data.merkleRoot)){merkleRoot=BufferUtil.reverse(new Buffer(data.merkleRoot,'hex'));}var info={hash:data.hash,version:data.version,prevHash:prevHash,merkleRoot:merkleRoot,time:data.time,timestamp:data.time,bits:data.bits,nonce:data.nonce};return info;};/** + * @param {Object} - A plain JavaScript object + * @returns {BlockHeader} - An instance of block header + */BlockHeader.fromObject=function fromObject(obj){var info=BlockHeader._fromObject(obj);return new BlockHeader(info);};/** + * @param {Binary} - Raw block binary data or buffer + * @returns {BlockHeader} - An instance of block header + */BlockHeader.fromRawBlock=function fromRawBlock(data){if(!BufferUtil.isBuffer(data)){data=new Buffer(data,'binary');}var br=BufferReader(data);br.pos=BlockHeader.Constants.START_OF_HEADER;var info=BlockHeader._fromBufferReader(br);return new BlockHeader(info);};/** + * @param {Buffer} - A buffer of the block header + * @returns {BlockHeader} - An instance of block header + */BlockHeader.fromBuffer=function fromBuffer(buf){var info=BlockHeader._fromBufferReader(BufferReader(buf));return new BlockHeader(info);};/** + * @param {string} - A hex encoded buffer of the block header + * @returns {BlockHeader} - An instance of block header + */BlockHeader.fromString=function fromString(str){var buf=new Buffer(str,'hex');return BlockHeader.fromBuffer(buf);};/** + * @param {BufferReader} - A BufferReader of the block header + * @returns {Object} - An object representing block header data + * @private + */BlockHeader._fromBufferReader=function _fromBufferReader(br){var info={};info.version=br.readUInt32LE();info.prevHash=br.read(32);info.merkleRoot=br.read(32);info.time=br.readUInt32LE();info.bits=br.readUInt32LE();info.nonce=br.readUInt32LE();return info;};/** + * @param {BufferReader} - A BufferReader of the block header + * @returns {BlockHeader} - An instance of block header + */BlockHeader.fromBufferReader=function fromBufferReader(br){var info=BlockHeader._fromBufferReader(br);return new BlockHeader(info);};/** + * @returns {Object} - A plain object of the BlockHeader + */BlockHeader.prototype.toObject=BlockHeader.prototype.toJSON=function toObject(){return{hash:this.hash,version:this.version,prevHash:BufferUtil.reverse(this.prevHash).toString('hex'),merkleRoot:BufferUtil.reverse(this.merkleRoot).toString('hex'),time:this.time,bits:this.bits,nonce:this.nonce};};/** + * @returns {Buffer} - A Buffer of the BlockHeader + */BlockHeader.prototype.toBuffer=function toBuffer(){return this.toBufferWriter().concat();};/** + * @returns {string} - A hex encoded string of the BlockHeader + */BlockHeader.prototype.toString=function toString(){return this.toBuffer().toString('hex');};/** + * @param {BufferWriter} - An existing instance BufferWriter + * @returns {BufferWriter} - An instance of BufferWriter representation of the BlockHeader + */BlockHeader.prototype.toBufferWriter=function toBufferWriter(bw){if(!bw){bw=new BufferWriter();}bw.writeUInt32LE(this.version);bw.write(this.prevHash);bw.write(this.merkleRoot);bw.writeUInt32LE(this.time);bw.writeUInt32LE(this.bits);bw.writeUInt32LE(this.nonce);return bw;};/** + * Returns the target difficulty for this block + * @param {Number} bits + * @returns {BN} An instance of BN with the decoded difficulty bits + */BlockHeader.prototype.getTargetDifficulty=function getTargetDifficulty(bits){bits=bits||this.bits;var target=new BN(bits&0xffffff);var mov=8*((bits>>>24)-3);while(mov-->0){target=target.mul(new BN(2));}return target;};/** + * @link https://en.bitcoin.it/wiki/Difficulty + * @return {Number} + */BlockHeader.prototype.getDifficulty=function getDifficulty(){var difficulty1TargetBN=this.getTargetDifficulty(GENESIS_BITS).mul(new BN(Math.pow(10,8)));var currentTargetBN=this.getTargetDifficulty();var difficultyString=difficulty1TargetBN.div(currentTargetBN).toString(10);var decimalPos=difficultyString.length-8;difficultyString=difficultyString.slice(0,decimalPos)+'.'+difficultyString.slice(decimalPos);return parseFloat(difficultyString);};/** + * @returns {Buffer} - The little endian hash buffer of the header + */BlockHeader.prototype._getHash=function hash(){var buf=this.toBuffer();return Hash.sha256sha256(buf);};var idProperty={configurable:false,enumerable:true,/** + * @returns {string} - The big endian hash buffer of the header + */get:function get(){if(!this._id){this._id=BufferReader(this._getHash()).readReverse().toString('hex');}return this._id;},set:_.noop};Object.defineProperty(BlockHeader.prototype,'id',idProperty);Object.defineProperty(BlockHeader.prototype,'hash',idProperty);/** + * @returns {Boolean} - If timestamp is not too far in the future + */BlockHeader.prototype.validTimestamp=function validTimestamp(){var currentTime=Math.round(new Date().getTime()/1000);if(this.time>currentTime+BlockHeader.Constants.MAX_TIME_OFFSET){return false;}return true;};/** + * @returns {Boolean} - If the proof-of-work hash satisfies the target difficulty + */BlockHeader.prototype.validProofOfWork=function validProofOfWork(){var pow=new BN(this.id,'hex');var target=this.getTargetDifficulty();if(pow.cmp(target)>0){return false;}return true;};/** + * @returns {string} - A string formatted for the console + */BlockHeader.prototype.inspect=function inspect(){return'';};BlockHeader.Constants={START_OF_HEADER:8,// Start buffer position in raw block data +MAX_TIME_OFFSET:2*60*60,// The max a timestamp can be in the future +LARGEST_HASH:new BN('10000000000000000000000000000000000000000000000000000000000000000','hex')};module.exports=BlockHeader;}).call(this,require("buffer").Buffer);},{"../crypto/bn":84,"../crypto/hash":86,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"buffer":191,"lodash":149}],82:[function(require,module,exports){module.exports=require('./block');module.exports.BlockHeader=require('./blockheader');module.exports.MerkleBlock=require('./merkleblock');},{"./block":80,"./blockheader":81,"./merkleblock":83}],83:[function(require,module,exports){(function(Buffer){'use strict';var _=require('lodash');var BlockHeader=require('./blockheader');var BufferUtil=require('../util/buffer');var BufferReader=require('../encoding/bufferreader');var BufferWriter=require('../encoding/bufferwriter');var Hash=require('../crypto/hash');var JSUtil=require('../util/js');var Transaction=require('../transaction');var $=require('../util/preconditions');/** + * Instantiate a MerkleBlock from a Buffer, JSON object, or Object with + * the properties of the Block + * + * @param {*} - A Buffer, JSON string, or Object representing a MerkleBlock + * @returns {MerkleBlock} + * @constructor + */function MerkleBlock(arg){/* jshint maxstatements: 18 */if(!(this instanceof MerkleBlock)){return new MerkleBlock(arg);}var info={};if(BufferUtil.isBuffer(arg)){info=MerkleBlock._fromBufferReader(BufferReader(arg));}else if(_.isObject(arg)){var header;if(arg.header instanceof BlockHeader){header=arg.header;}else{header=BlockHeader.fromObject(arg.header);}info={/** + * @name MerkleBlock#header + * @type {BlockHeader} + */header:header,/** + * @name MerkleBlock#numTransactions + * @type {Number} + */numTransactions:arg.numTransactions,/** + * @name MerkleBlock#hashes + * @type {String[]} + */hashes:arg.hashes,/** + * @name MerkleBlock#flags + * @type {Number[]} + */flags:arg.flags};}else{throw new TypeError('Unrecognized argument for MerkleBlock');}_.extend(this,info);this._flagBitsUsed=0;this._hashesUsed=0;return this;}/** + * @param {Buffer} - MerkleBlock data in a Buffer object + * @returns {MerkleBlock} - A MerkleBlock object + */MerkleBlock.fromBuffer=function fromBuffer(buf){return MerkleBlock.fromBufferReader(BufferReader(buf));};/** + * @param {BufferReader} - MerkleBlock data in a BufferReader object + * @returns {MerkleBlock} - A MerkleBlock object + */MerkleBlock.fromBufferReader=function fromBufferReader(br){return new MerkleBlock(MerkleBlock._fromBufferReader(br));};/** + * @returns {Buffer} - A buffer of the block + */MerkleBlock.prototype.toBuffer=function toBuffer(){return this.toBufferWriter().concat();};/** + * @param {BufferWriter} - An existing instance of BufferWriter + * @returns {BufferWriter} - An instance of BufferWriter representation of the MerkleBlock + */MerkleBlock.prototype.toBufferWriter=function toBufferWriter(bw){if(!bw){bw=new BufferWriter();}bw.write(this.header.toBuffer());bw.writeUInt32LE(this.numTransactions);bw.writeVarintNum(this.hashes.length);for(var i=0;ithis.numTransactions){return false;}// Can't have more flag bits than num hashes +if(this.flags.length*8this.flags.length*8){return null;}var isParentOfMatch=this.flags[opts.flagBitsUsed>>3]>>>(opts.flagBitsUsed++&7)&1;if(depth===0||!isParentOfMatch){if(opts.hashesUsed>=this.hashes.length){return null;}var hash=this.hashes[opts.hashesUsed++];if(depth===0&&isParentOfMatch){opts.txs.push(hash);}return new Buffer(hash,'hex');}else{var left=this._traverseMerkleTree(depth-1,pos*2,opts);var right=left;if(pos*2+1>height;};/** Calculates the height of the merkle tree in this MerkleBlock + * @param {Number} - Height at which we want the tree width + * @returns {Number} - Height of the merkle tree in this MerkleBlock + * @private + */MerkleBlock.prototype._calcTreeHeight=function calcTreeHeight(){var height=0;while(this._calcTreeWidth(height)>1){height++;}return height;};/** + * @param {Transaction|String} - Transaction or Transaction ID Hash + * @returns {Boolean} - return true/false if this MerkleBlock has the TX or not + * @private + */MerkleBlock.prototype.hasTransaction=function hasTransaction(tx){$.checkArgument(!_.isUndefined(tx),'tx cannot be undefined');$.checkArgument(tx instanceof Transaction||typeof tx==='string','Invalid tx given, tx must be a "string" or "Transaction"');var hash=tx;if(tx instanceof Transaction){// We need to reverse the id hash for the lookup +hash=BufferUtil.reverse(new Buffer(tx.id,'hex')).toString('hex');}var txs=[];var height=this._calcTreeHeight();this._traverseMerkleTree(height,0,{txs:txs});return txs.indexOf(hash)!==-1;};/** + * @param {Buffer} - MerkleBlock data + * @returns {Object} - An Object representing merkleblock data + * @private + */MerkleBlock._fromBufferReader=function _fromBufferReader(br){$.checkState(!br.finished(),'No merkleblock data received');var info={};info.header=BlockHeader.fromBufferReader(br);info.numTransactions=br.readUInt32LE();var numHashes=br.readVarintNum();info.hashes=[];for(var i=0;iopts.size){buf=BN.trim(buf,natlen);}else if(natlen0){// Check that the number is encoded with the minimum possible +// number of bytes. +// +// If the most-significant-byte - excluding the sign bit - is zero +// then we're not minimal. Note how this test also rejects the +// negative-zero encoding, 0x80. +if((buf[buf.length-1]&0x7f)===0){// One exception: if there's more than one byte and the most +// significant bit of the second-most-significant-byte is set +// it would conflict with the sign bit. An example of this case +// is +-255, which encode to 0xff00 and 0xff80 respectively. +// (big-endian). +if(buf.length<=1||(buf[buf.length-2]&0x80)===0){throw new Error('non-minimally encoded script number');}}}return BN.fromSM(buf,{endian:'little'});};/** + * The corollary to the above, with the notable exception that we do not throw + * an error if the output is larger than four bytes. (Which can happen if + * performing a numerical operation that results in an overflow to more than 4 + * bytes). + */BN.prototype.toScriptNumBuffer=function(){return this.toSM({endian:'little'});};BN.prototype.gt=function(b){return this.cmp(b)>0;};BN.prototype.gte=function(b){return this.cmp(b)>=0;};BN.prototype.lt=function(b){return this.cmp(b)<0;};BN.trim=function(buf,natlen){return buf.slice(natlen-buf.length,buf.length);};BN.pad=function(buf,natlen,size){var rbuf=new Buffer(size);for(var i=0;i>1;var n=Point.getN();var G=Point.getG();// 1.1 Let x = r + jn +var x=isSecondKey?r.add(n):r;var R=Point.fromX(isYOdd,x);// 1.4 Check that nR is at infinity +var nR=R.mul(n);if(!nR.isInfinity()){throw new Error('nR is not a valid curve point');}// Compute -e from e +var eNeg=e.neg().mod(n);// 1.6.1 Compute Q = r^-1 (sR - eG) +// Q = r^-1 (sR + -eG) +var rInv=r.invm(n);//var Q = R.multiplyTwo(s, G, eNeg).mul(rInv); +var Q=R.mul(s).add(G.mul(eNeg)).mul(rInv);var pubkey=PublicKey.fromPoint(Q,this.sig.compressed);return pubkey;};ECDSA.prototype.sigError=function(){/* jshint maxstatements: 25 */if(!BufferUtil.isBuffer(this.hashbuf)||this.hashbuf.length!==32){return'hashbuf must be a 32 byte buffer';}var r=this.sig.r;var s=this.sig.s;if(!(r.gt(BN.Zero)&&r.lt(Point.getN()))||!(s.gt(BN.Zero)&&s.lt(Point.getN()))){return'r and s not in range';}var e=BN.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:undefined);var n=Point.getN();var sinv=s.invm(n);var u1=sinv.mul(e).mod(n);var u2=sinv.mul(r).mod(n);var p=Point.getG().mulAdd(u1,this.pubkey.point,u2);if(p.isInfinity()){return'p is infinity';}if(p.getX().mod(n).cmp(r)!==0){return'Invalid signature';}else{return false;}};ECDSA.toLowS=function(s){//enforce low s +//see BIP 62, "low S values in signatures" +if(s.gt(BN.fromBuffer(new Buffer('7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0','hex')))){s=Point.getN().sub(s);}return s;};ECDSA.prototype._findSignature=function(d,e){var N=Point.getN();var G=Point.getG();// try different values of k until r, s are valid +var badrs=0;var k,Q,r,s;do{if(!this.k||badrs>0){this.deterministicK(badrs);}badrs++;k=this.k;Q=G.mul(k);r=Q.x.mod(N);s=k.invm(N).mul(e.add(d.mul(r))).mod(N);}while(r.cmp(BN.Zero)<=0||s.cmp(BN.Zero)<=0);s=ECDSA.toLowS(s);return{s:s,r:r};};ECDSA.prototype.sign=function(){var hashbuf=this.hashbuf;var privkey=this.privkey;var d=privkey.bn;$.checkState(hashbuf&&privkey&&d,new Error('invalid parameters'));$.checkState(BufferUtil.isBuffer(hashbuf)&&hashbuf.length===32,new Error('hashbuf must be a 32 byte buffer'));var e=BN.fromBuffer(hashbuf,this.endian?{endian:this.endian}:undefined);var obj=this._findSignature(d,e);obj.compressed=this.pubkey.compressed;this.sig=new Signature(obj);return this;};ECDSA.prototype.signRandomK=function(){this.randomK();return this.sign();};ECDSA.prototype.toString=function(){var obj={};if(this.hashbuf){obj.hashbuf=this.hashbuf.toString('hex');}if(this.privkey){obj.privkey=this.privkey.toString();}if(this.pubkey){obj.pubkey=this.pubkey.toString();}if(this.sig){obj.sig=this.sig.toString();}if(this.k){obj.k=this.k.toString();}return JSON.stringify(obj);};ECDSA.prototype.verify=function(){if(!this.sigError()){this.verified=true;}else{this.verified=false;}return this;};ECDSA.sign=function(hashbuf,privkey,endian){return ECDSA().set({hashbuf:hashbuf,endian:endian,privkey:privkey}).sign().sig;};ECDSA.verify=function(hashbuf,sig,pubkey,endian){return ECDSA().set({hashbuf:hashbuf,endian:endian,sig:sig,pubkey:pubkey}).verify().verified;};module.exports=ECDSA;}).call(this,require("buffer").Buffer);},{"../publickey":103,"../util/buffer":121,"../util/preconditions":123,"./bn":84,"./hash":86,"./point":87,"./random":88,"./signature":89,"buffer":191,"lodash":149}],86:[function(require,module,exports){(function(Buffer){'use strict';var crypto=require('crypto');var BufferUtil=require('../util/buffer');var $=require('../util/preconditions');var Hash=module.exports;Hash.sha1=function(buf){$.checkArgument(BufferUtil.isBuffer(buf));return crypto.createHash('sha1').update(buf).digest();};Hash.sha1.blocksize=512;Hash.sha256=function(buf){$.checkArgument(BufferUtil.isBuffer(buf));return crypto.createHash('sha256').update(buf).digest();};Hash.sha256.blocksize=512;Hash.sha256sha256=function(buf){$.checkArgument(BufferUtil.isBuffer(buf));return Hash.sha256(Hash.sha256(buf));};Hash.ripemd160=function(buf){$.checkArgument(BufferUtil.isBuffer(buf));return crypto.createHash('ripemd160').update(buf).digest();};Hash.sha256ripemd160=function(buf){$.checkArgument(BufferUtil.isBuffer(buf));return Hash.ripemd160(Hash.sha256(buf));};Hash.sha512=function(buf){$.checkArgument(BufferUtil.isBuffer(buf));return crypto.createHash('sha512').update(buf).digest();};Hash.sha512.blocksize=1024;Hash.hmac=function(hashf,data,key){//http://en.wikipedia.org/wiki/Hash-based_message_authentication_code +//http://tools.ietf.org/html/rfc4868#section-2 +$.checkArgument(BufferUtil.isBuffer(data));$.checkArgument(BufferUtil.isBuffer(key));$.checkArgument(hashf.blocksize);var blocksize=hashf.blocksize/8;if(key.length>blocksize){key=hashf(key);}else if(key>>8)&0xff;}}return b;};module.exports=Random;}).call(this,require('_process'),require("buffer").Buffer);},{"_process":382,"buffer":191,"crypto":204}],89:[function(require,module,exports){(function(Buffer){'use strict';var BN=require('./bn');var _=require('lodash');var $=require('../util/preconditions');var BufferUtil=require('../util/buffer');var JSUtil=require('../util/js');var Signature=function Signature(r,s){if(!(this instanceof Signature)){return new Signature(r,s);}if(r instanceof BN){this.set({r:r,s:s});}else if(r){var obj=r;this.set(obj);}};/* jshint maxcomplexity: 7 */Signature.prototype.set=function(obj){this.r=obj.r||this.r||undefined;this.s=obj.s||this.s||undefined;this.i=typeof obj.i!=='undefined'?obj.i:this.i;//public key recovery parameter in range [0, 3] +this.compressed=typeof obj.compressed!=='undefined'?obj.compressed:this.compressed;//whether the recovered pubkey is compressed +this.nhashtype=obj.nhashtype||this.nhashtype||undefined;return this;};Signature.fromCompact=function(buf){$.checkArgument(BufferUtil.isBuffer(buf),'Argument is expected to be a Buffer');var sig=new Signature();var compressed=true;var i=buf.slice(0,1)[0]-27-4;if(i<0){compressed=false;i=i+4;}var b2=buf.slice(1,33);var b3=buf.slice(33,65);$.checkArgument(i===0||i===1||i===2||i===3,new Error('i must be 0, 1, 2, or 3'));$.checkArgument(b2.length===32,new Error('r must be 32 bytes'));$.checkArgument(b3.length===32,new Error('s must be 32 bytes'));sig.compressed=compressed;sig.i=i;sig.r=BN.fromBuffer(b2);sig.s=BN.fromBuffer(b3);return sig;};Signature.fromDER=Signature.fromBuffer=function(buf,strict){var obj=Signature.parseDER(buf,strict);var sig=new Signature();sig.r=obj.r;sig.s=obj.s;return sig;};// The format used in a tx +Signature.fromTxFormat=function(buf){var nhashtype=buf.readUInt8(buf.length-1);var derbuf=buf.slice(0,buf.length-1);var sig=new Signature.fromDER(derbuf,false);sig.nhashtype=nhashtype;return sig;};Signature.fromString=function(str){var buf=new Buffer(str,'hex');return Signature.fromDER(buf);};/** + * In order to mimic the non-strict DER encoding of OpenSSL, set strict = false. + */Signature.parseDER=function(buf,strict){$.checkArgument(BufferUtil.isBuffer(buf),new Error('DER formatted signature should be a buffer'));if(_.isUndefined(strict)){strict=true;}var header=buf[0];$.checkArgument(header===0x30,new Error('Header byte should be 0x30'));var length=buf[1];var buflength=buf.slice(2).length;$.checkArgument(!strict||length===buflength,new Error('Length byte should length of what follows'));length=length73){// Non-canonical signature: too long +return false;}if(buf[0]!==0x30){// Non-canonical signature: wrong type +return false;}if(buf[1]!==buf.length-3){// Non-canonical signature: wrong length marker +return false;}var nLenR=buf[3];if(5+nLenR>=buf.length){// Non-canonical signature: S length misplaced +return false;}var nLenS=buf[5+nLenR];if(nLenR+nLenS+7!==buf.length){// Non-canonical signature: R+S length mismatch +return false;}var R=buf.slice(4);if(buf[4-2]!==0x02){// Non-canonical signature: R value type mismatch +return false;}if(nLenR===0){// Non-canonical signature: R length is zero +return false;}if(R[0]&0x80){// Non-canonical signature: R value negative +return false;}if(nLenR>1&&R[0]===0x00&&!(R[1]&0x80)){// Non-canonical signature: R value excessively padded +return false;}var S=buf.slice(6+nLenR);if(buf[6+nLenR-2]!==0x02){// Non-canonical signature: S value type mismatch +return false;}if(nLenS===0){// Non-canonical signature: S length is zero +return false;}if(S[0]&0x80){// Non-canonical signature: S value negative +return false;}if(nLenS>1&&S[0]===0x00&&!(S[1]&0x80)){// Non-canonical signature: S value excessively padded +return false;}return true;};/** + * Compares to bitcoind's IsLowDERSignature + * See also ECDSA signature algorithm which enforces this. + * See also BIP 62, "low S values in signatures" + */Signature.prototype.hasLowS=function(){if(this.s.lt(new BN(1))||this.s.gt(new BN('7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0','hex'))){return false;}return true;};/** + * @returns true if the nhashtype is exactly equal to one of the standard options or combinations thereof. + * Translated from bitcoind's IsDefinedHashtypeSignature + */Signature.prototype.hasDefinedHashtype=function(){if(!JSUtil.isNaturalNumber(this.nhashtype)){return false;}// accept with or without Signature.SIGHASH_ANYONECANPAY by ignoring the bit +var temp=this.nhashtype&~Signature.SIGHASH_ANYONECANPAY;if(tempSignature.SIGHASH_SINGLE){return false;}return true;};Signature.prototype.toTxFormat=function(){var derbuf=this.toDER();var buf=new Buffer(1);buf.writeUInt8(this.nhashtype,0);return Buffer.concat([derbuf,buf]);};Signature.SIGHASH_ALL=0x01;Signature.SIGHASH_NONE=0x02;Signature.SIGHASH_SINGLE=0x03;Signature.SIGHASH_ANYONECANPAY=0x80;module.exports=Signature;}).call(this,require("buffer").Buffer);},{"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"./bn":84,"buffer":191,"lodash":149}],90:[function(require,module,exports){(function(Buffer){'use strict';var _=require('lodash');var bs58=require('bs58');var buffer=require('buffer');var ALPHABET='123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'.split('');var Base58=function Base58(obj){/* jshint maxcomplexity: 8 */if(!(this instanceof Base58)){return new Base58(obj);}if(Buffer.isBuffer(obj)){var buf=obj;this.fromBuffer(buf);}else if(typeof obj==='string'){var str=obj;this.fromString(str);}else if(obj){this.set(obj);}};Base58.validCharacters=function validCharacters(chars){if(buffer.Buffer.isBuffer(chars)){chars=chars.toString();}return _.all(_.map(chars,function(char){return _.contains(ALPHABET,char);}));};Base58.prototype.set=function(obj){this.buf=obj.buf||this.buf||undefined;return this;};Base58.encode=function(buf){if(!buffer.Buffer.isBuffer(buf)){throw new Error('Input should be a buffer');}return bs58.encode(buf);};Base58.decode=function(str){if(typeof str!=='string'){throw new Error('Input should be a string');}return new Buffer(bs58.decode(str));};Base58.prototype.fromBuffer=function(buf){this.buf=buf;return this;};Base58.prototype.fromString=function(str){var buf=Base58.decode(str);this.buf=buf;return this;};Base58.prototype.toBuffer=function(){return this.buf;};Base58.prototype.toString=function(){return Base58.encode(this.buf);};module.exports=Base58;}).call(this,require("buffer").Buffer);},{"bs58":125,"buffer":191,"lodash":149}],91:[function(require,module,exports){(function(Buffer){'use strict';var _=require('lodash');var Base58=require('./base58');var buffer=require('buffer');var sha256sha256=require('../crypto/hash').sha256sha256;var Base58Check=function Base58Check(obj){if(!(this instanceof Base58Check))return new Base58Check(obj);if(Buffer.isBuffer(obj)){var buf=obj;this.fromBuffer(buf);}else if(typeof obj==='string'){var str=obj;this.fromString(str);}else if(obj){this.set(obj);}};Base58Check.prototype.set=function(obj){this.buf=obj.buf||this.buf||undefined;return this;};Base58Check.validChecksum=function validChecksum(data,checksum){if(_.isString(data)){data=new buffer.Buffer(Base58.decode(data));}if(_.isString(checksum)){checksum=new buffer.Buffer(Base58.decode(checksum));}if(!checksum){checksum=data.slice(-4);data=data.slice(0,-4);}return Base58Check.checksum(data).toString('hex')===checksum.toString('hex');};Base58Check.decode=function(s){if(typeof s!=='string')throw new Error('Input must be a string');var buf=new Buffer(Base58.decode(s));if(buf.length<4)throw new Error("Input string too short");var data=buf.slice(0,-4);var csum=buf.slice(-4);var hash=sha256sha256(data);var hash4=hash.slice(0,4);if(csum.toString('hex')!==hash4.toString('hex'))throw new Error("Checksum mismatch");return data;};Base58Check.checksum=function(buffer){return sha256sha256(buffer).slice(0,4);};Base58Check.encode=function(buf){if(!Buffer.isBuffer(buf))throw new Error('Input must be a buffer');var checkedBuf=new Buffer(buf.length+4);var hash=Base58Check.checksum(buf);buf.copy(checkedBuf);hash.copy(checkedBuf,buf.length);return Base58.encode(checkedBuf);};Base58Check.prototype.fromBuffer=function(buf){this.buf=buf;return this;};Base58Check.prototype.fromString=function(str){var buf=Base58Check.decode(str);this.buf=buf;return this;};Base58Check.prototype.toBuffer=function(){return this.buf;};Base58Check.prototype.toString=function(){return Base58Check.encode(this.buf);};module.exports=Base58Check;}).call(this,require("buffer").Buffer);},{"../crypto/hash":86,"./base58":90,"buffer":191,"lodash":149}],92:[function(require,module,exports){(function(Buffer){'use strict';var _=require('lodash');var $=require('../util/preconditions');var BufferUtil=require('../util/buffer');var BN=require('../crypto/bn');var BufferReader=function BufferReader(buf){if(!(this instanceof BufferReader)){return new BufferReader(buf);}if(_.isUndefined(buf)){return;}if(Buffer.isBuffer(buf)){this.set({buf:buf});}else if(_.isString(buf)){this.set({buf:new Buffer(buf,'hex')});}else if(_.isObject(buf)){var obj=buf;this.set(obj);}else{throw new TypeError('Unrecognized argument for BufferReader');}};BufferReader.prototype.set=function(obj){this.buf=obj.buf||this.buf||undefined;this.pos=obj.pos||this.pos||0;return this;};BufferReader.prototype.eof=function(){return this.pos>=this.buf.length;};BufferReader.prototype.finished=BufferReader.prototype.eof;BufferReader.prototype.read=function(len){$.checkArgument(!_.isUndefined(len),'Must specify a length');var buf=this.buf.slice(this.pos,this.pos+len);this.pos=this.pos+len;return buf;};BufferReader.prototype.readAll=function(){var buf=this.buf.slice(this.pos,this.buf.length);this.pos=this.buf.length;return buf;};BufferReader.prototype.readUInt8=function(){var val=this.buf.readUInt8(this.pos);this.pos=this.pos+1;return val;};BufferReader.prototype.readUInt16BE=function(){var val=this.buf.readUInt16BE(this.pos);this.pos=this.pos+2;return val;};BufferReader.prototype.readUInt16LE=function(){var val=this.buf.readUInt16LE(this.pos);this.pos=this.pos+2;return val;};BufferReader.prototype.readUInt32BE=function(){var val=this.buf.readUInt32BE(this.pos);this.pos=this.pos+4;return val;};BufferReader.prototype.readUInt32LE=function(){var val=this.buf.readUInt32LE(this.pos);this.pos=this.pos+4;return val;};BufferReader.prototype.readUInt64BEBN=function(){var buf=this.buf.slice(this.pos,this.pos+8);var bn=BN.fromBuffer(buf);this.pos=this.pos+8;return bn;};BufferReader.prototype.readUInt64LEBN=function(){var second=this.buf.readUInt32LE(this.pos);var first=this.buf.readUInt32LE(this.pos+4);var combined=first*0x100000000+second;// Instantiating an instance of BN with a number is faster than with an +// array or string. However, the maximum safe number for a double precision +// floating point is 2 ^ 52 - 1 (0x1fffffffffffff), thus we can safely use +// non-floating point numbers less than this amount (52 bits). And in the case +// that the number is larger, we can instatiate an instance of BN by passing +// an array from the buffer (slower) and specifying the endianness. +var bn;if(combined<=0x1fffffffffffff){bn=new BN(combined);}else{var data=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);bn=new BN(data,10,'le');}this.pos=this.pos+8;return bn;};BufferReader.prototype.readVarintNum=function(){var first=this.readUInt8();switch(first){case 0xFD:return this.readUInt16LE();case 0xFE:return this.readUInt32LE();case 0xFF:var bn=this.readUInt64LEBN();var n=bn.toNumber();if(n<=Math.pow(2,53)){return n;}else{throw new Error('number too large to retain precision - use readVarintBN');}break;default:return first;}};/** + * reads a length prepended buffer + */BufferReader.prototype.readVarLengthBuffer=function(){var len=this.readVarintNum();var buf=this.read(len);$.checkState(buf.length===len,'Invalid length while reading varlength buffer. '+'Expected to read: '+len+' and read '+buf.length);return buf;};BufferReader.prototype.readVarintBuf=function(){var first=this.buf.readUInt8(this.pos);switch(first){case 0xFD:return this.read(1+2);case 0xFE:return this.read(1+4);case 0xFF:return this.read(1+8);default:return this.read(1);}};BufferReader.prototype.readVarintBN=function(){var first=this.readUInt8();switch(first){case 0xFD:return new BN(this.readUInt16LE());case 0xFE:return new BN(this.readUInt32LE());case 0xFF:return this.readUInt64LEBN();default:return new BN(first);}};BufferReader.prototype.reverse=function(){var buf=new Buffer(this.buf.length);for(var i=0;i=0&&arg=HDPrivateKey.Hardened?true:hardened;if(indexMAXIMUM_ENTROPY_BITS*BITS_TO_BYTES){throw new hdErrors.InvalidEntropyArgument.TooMuchEntropy(hexa);}var hash=Hash.sha512hmac(hexa,new buffer.Buffer('Bitcoin seed'));return new HDPrivateKey({network:Network.get(network)||Network.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:hash.slice(0,32),chainCode:hash.slice(32,64)});};HDPrivateKey.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var HDPublicKey=require('./hdpublickey');this._hdPublicKey=new HDPublicKey(this);}};/** + * Receives a object with buffers in all the properties and populates the + * internal structure + * + * @param {Object} arg + * @param {buffer.Buffer} arg.version + * @param {buffer.Buffer} arg.depth + * @param {buffer.Buffer} arg.parentFingerPrint + * @param {buffer.Buffer} arg.childIndex + * @param {buffer.Buffer} arg.chainCode + * @param {buffer.Buffer} arg.privateKey + * @param {buffer.Buffer} arg.checksum + * @param {string=} arg.xprivkey - if set, don't recalculate the base58 + * representation + * @return {HDPrivateKey} this + */HDPrivateKey.prototype._buildFromBuffers=function(arg){/* jshint maxcomplexity: 8 *//* jshint maxstatements: 20 */HDPrivateKey._validateBufferArguments(arg);JSUtil.defineImmutable(this,{_buffers:arg});var sequence=[arg.version,arg.depth,arg.parentFingerPrint,arg.childIndex,arg.chainCode,BufferUtil.emptyBuffer(1),arg.privateKey];var concat=buffer.Buffer.concat(sequence);if(!arg.checksum||!arg.checksum.length){arg.checksum=Base58Check.checksum(concat);}else{if(arg.checksum.toString()!==Base58Check.checksum(concat).toString()){throw new errors.InvalidB58Checksum(concat);}}var network=Network.get(BufferUtil.integerFromBuffer(arg.version));var xprivkey;xprivkey=Base58Check.encode(buffer.Buffer.concat(sequence));arg.xprivkey=new Buffer(xprivkey);var privateKey=new PrivateKey(BN.fromBuffer(arg.privateKey),network);var publicKey=privateKey.toPublicKey();var size=HDPrivateKey.ParentFingerPrintSize;var fingerPrint=Hash.sha256ripemd160(publicKey.toBuffer()).slice(0,size);JSUtil.defineImmutable(this,{xprivkey:xprivkey,network:network,depth:BufferUtil.integerFromSingleByteBuffer(arg.depth),privateKey:privateKey,publicKey:publicKey,fingerPrint:fingerPrint});this._hdPublicKey=null;Object.defineProperty(this,'hdPublicKey',{configurable:false,enumerable:true,get:function get(){this._calcHDPublicKey();return this._hdPublicKey;}});Object.defineProperty(this,'xpubkey',{configurable:false,enumerable:true,get:function get(){this._calcHDPublicKey();return this._hdPublicKey.xpubkey;}});return this;};HDPrivateKey._validateBufferArguments=function(arg){var checkBuffer=function checkBuffer(name,size){var buff=arg[name];assert(BufferUtil.isBuffer(buff),name+' argument is not a buffer');assert(buff.length===size,name+' has not the expected size: found '+buff.length+', expected '+size);};checkBuffer('version',HDPrivateKey.VersionSize);checkBuffer('depth',HDPrivateKey.DepthSize);checkBuffer('parentFingerPrint',HDPrivateKey.ParentFingerPrintSize);checkBuffer('childIndex',HDPrivateKey.ChildIndexSize);checkBuffer('chainCode',HDPrivateKey.ChainCodeSize);checkBuffer('privateKey',HDPrivateKey.PrivateKeySize);if(arg.checksum&&arg.checksum.length){checkBuffer('checksum',HDPrivateKey.CheckSumSize);}};/** + * Returns the string representation of this private key (a string starting + * with "xprv..." + * + * @return string + */HDPrivateKey.prototype.toString=function(){return this.xprivkey;};/** + * Returns the console representation of this extended private key. + * @return string + */HDPrivateKey.prototype.inspect=function(){return'';};/** + * Returns a plain object with a representation of this private key. + * + * Fields include:
    + *
  • network: either 'livenet' or 'testnet' + *
  • depth: a number ranging from 0 to 255 + *
  • fingerPrint: a number ranging from 0 to 2^32-1, taken from the hash of the + *
  • associated public key + *
  • parentFingerPrint: a number ranging from 0 to 2^32-1, taken from the hash + *
  • of this parent's associated public key or zero. + *
  • childIndex: the index from which this child was derived (or zero) + *
  • chainCode: an hexa string representing a number used in the derivation + *
  • privateKey: the private key associated, in hexa representation + *
  • xprivkey: the representation of this extended private key in checksum + *
  • base58 format + *
  • checksum: the base58 checksum of xprivkey + *
+ * @return {Object} + */HDPrivateKey.prototype.toObject=HDPrivateKey.prototype.toJSON=function toObject(){return{network:Network.get(BufferUtil.integerFromBuffer(this._buffers.version),'xprivkey').name,depth:BufferUtil.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:BufferUtil.integerFromBuffer(this.fingerPrint),parentFingerPrint:BufferUtil.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:BufferUtil.integerFromBuffer(this._buffers.childIndex),chainCode:BufferUtil.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString('hex'),checksum:BufferUtil.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey};};/** + * Build a HDPrivateKey from a buffer + * + * @param {Buffer} arg + * @return {HDPrivateKey} + */HDPrivateKey.fromBuffer=function(arg){return new HDPrivateKey(arg.toString());};/** + * Returns a buffer representation of the HDPrivateKey + * + * @return {string} + */HDPrivateKey.prototype.toBuffer=function(){return BufferUtil.copy(this._buffers.xprivkey);};HDPrivateKey.DefaultDepth=0;HDPrivateKey.DefaultFingerprint=0;HDPrivateKey.DefaultChildIndex=0;HDPrivateKey.Hardened=0x80000000;HDPrivateKey.MaxIndex=2*HDPrivateKey.Hardened;HDPrivateKey.RootElementAlias=['m','M','m\'','M\''];HDPrivateKey.VersionSize=4;HDPrivateKey.DepthSize=1;HDPrivateKey.ParentFingerPrintSize=4;HDPrivateKey.ChildIndexSize=4;HDPrivateKey.ChainCodeSize=32;HDPrivateKey.PrivateKeySize=32;HDPrivateKey.CheckSumSize=4;HDPrivateKey.DataLength=78;HDPrivateKey.SerializedByteSize=82;HDPrivateKey.VersionStart=0;HDPrivateKey.VersionEnd=HDPrivateKey.VersionStart+HDPrivateKey.VersionSize;HDPrivateKey.DepthStart=HDPrivateKey.VersionEnd;HDPrivateKey.DepthEnd=HDPrivateKey.DepthStart+HDPrivateKey.DepthSize;HDPrivateKey.ParentFingerPrintStart=HDPrivateKey.DepthEnd;HDPrivateKey.ParentFingerPrintEnd=HDPrivateKey.ParentFingerPrintStart+HDPrivateKey.ParentFingerPrintSize;HDPrivateKey.ChildIndexStart=HDPrivateKey.ParentFingerPrintEnd;HDPrivateKey.ChildIndexEnd=HDPrivateKey.ChildIndexStart+HDPrivateKey.ChildIndexSize;HDPrivateKey.ChainCodeStart=HDPrivateKey.ChildIndexEnd;HDPrivateKey.ChainCodeEnd=HDPrivateKey.ChainCodeStart+HDPrivateKey.ChainCodeSize;HDPrivateKey.PrivateKeyStart=HDPrivateKey.ChainCodeEnd+1;HDPrivateKey.PrivateKeyEnd=HDPrivateKey.PrivateKeyStart+HDPrivateKey.PrivateKeySize;HDPrivateKey.ChecksumStart=HDPrivateKey.PrivateKeyEnd;HDPrivateKey.ChecksumEnd=HDPrivateKey.ChecksumStart+HDPrivateKey.CheckSumSize;assert(HDPrivateKey.ChecksumEnd===HDPrivateKey.SerializedByteSize);module.exports=HDPrivateKey;}).call(this,require("buffer").Buffer);},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./crypto/random":88,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdpublickey":99,"./networks":100,"./privatekey":102,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,"assert":67,"buffer":191,"lodash":149}],99:[function(require,module,exports){(function(Buffer){'use strict';var _=require('lodash');var $=require('./util/preconditions');var BN=require('./crypto/bn');var Base58=require('./encoding/base58');var Base58Check=require('./encoding/base58check');var Hash=require('./crypto/hash');var HDPrivateKey=require('./hdprivatekey');var HDKeyCache=require('./hdkeycache');var Network=require('./networks');var Point=require('./crypto/point');var PublicKey=require('./publickey');var bitcoreErrors=require('./errors');var errors=bitcoreErrors;var hdErrors=bitcoreErrors.HDPublicKey;var assert=require('assert');var JSUtil=require('./util/js');var BufferUtil=require('./util/buffer');/** + * The representation of an hierarchically derived public key. + * + * See https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki + * + * @constructor + * @param {Object|string|Buffer} arg + */function HDPublicKey(arg){/* jshint maxcomplexity: 12 *//* jshint maxstatements: 20 */if(arg instanceof HDPublicKey){return arg;}if(!(this instanceof HDPublicKey)){return new HDPublicKey(arg);}if(arg){if(_.isString(arg)||BufferUtil.isBuffer(arg)){var error=HDPublicKey.getSerializedError(arg);if(!error){return this._buildFromSerialized(arg);}else if(BufferUtil.isBuffer(arg)&&!HDPublicKey.getSerializedError(arg.toString())){return this._buildFromSerialized(arg.toString());}else{if(error instanceof hdErrors.ArgumentIsPrivateExtended){return new HDPrivateKey(arg).hdPublicKey;}throw error;}}else{if(_.isObject(arg)){if(arg instanceof HDPrivateKey){return this._buildFromPrivate(arg);}else{return this._buildFromObject(arg);}}else{throw new hdErrors.UnrecognizedArgument(arg);}}}else{throw new hdErrors.MustSupplyArgument();}}/** + * Verifies that a given path is valid. + * + * @param {string|number} arg + * @return {boolean} + */HDPublicKey.isValidPath=function(arg){if(_.isString(arg)){var indexes=HDPrivateKey._getDerivationIndexes(arg);return indexes!==null&&_.all(indexes,HDPublicKey.isValidPath);}if(_.isNumber(arg)){return arg>=0&&arg=HDPublicKey.Hardened||hardened){throw new hdErrors.InvalidIndexCantDeriveHardened();}if(index<0){throw new hdErrors.InvalidPath(index);}var cached=HDKeyCache.get(this.xpubkey,index,false);if(cached){return cached;}var indexBuffer=BufferUtil.integerAsBuffer(index);var data=BufferUtil.concat([this.publicKey.toBuffer(),indexBuffer]);var hash=Hash.sha512hmac(data,this._buffers.chainCode);var leftPart=BN.fromBuffer(hash.slice(0,32),{size:32});var chainCode=hash.slice(32,64);var publicKey=PublicKey.fromPoint(Point.getG().mul(leftPart).add(this.publicKey.point));var derived=new HDPublicKey({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:index,chainCode:chainCode,publicKey:publicKey});HDKeyCache.set(this.xpubkey,index,false,derived);return derived;};HDPublicKey.prototype._deriveFromString=function(path){/* jshint maxcomplexity: 8 */if(_.contains(path,"'")){throw new hdErrors.InvalidIndexCantDeriveHardened();}else if(!HDPublicKey.isValidPath(path)){throw new hdErrors.InvalidPath(path);}var indexes=HDPrivateKey._getDerivationIndexes(path);var derived=indexes.reduce(function(prev,index){return prev._deriveWithNumber(index);},this);return derived;};/** + * Verifies that a given serialized public key in base58 with checksum format + * is valid. + * + * @param {string|Buffer} data - the serialized public key + * @param {string|Network=} network - optional, if present, checks that the + * network provided matches the network serialized. + * @return {boolean} + */HDPublicKey.isValidSerialized=function(data,network){return _.isNull(HDPublicKey.getSerializedError(data,network));};/** + * Checks what's the error that causes the validation of a serialized public key + * in base58 with checksum to fail. + * + * @param {string|Buffer} data - the serialized public key + * @param {string|Network=} network - optional, if present, checks that the + * network provided matches the network serialized. + * @return {errors|null} + */HDPublicKey.getSerializedError=function(data,network){/* jshint maxcomplexity: 10 *//* jshint maxstatements: 20 */if(!(_.isString(data)||BufferUtil.isBuffer(data))){return new hdErrors.UnrecognizedArgument('expected buffer or string');}if(!Base58.validCharacters(data)){return new errors.InvalidB58Char('(unknown)',data);}try{data=Base58Check.decode(data);}catch(e){return new errors.InvalidB58Checksum(data);}if(data.length!==HDPublicKey.DataSize){return new hdErrors.InvalidLength(data);}if(!_.isUndefined(network)){var error=HDPublicKey._validateNetwork(data,network);if(error){return error;}}var version=BufferUtil.integerFromBuffer(data.slice(0,4));if(version===Network.livenet.xprivkey||version===Network.testnet.xprivkey){return new hdErrors.ArgumentIsPrivateExtended();}return null;};HDPublicKey._validateNetwork=function(data,networkArg){var network=Network.get(networkArg);if(!network){return new errors.InvalidNetworkArgument(networkArg);}var version=data.slice(HDPublicKey.VersionStart,HDPublicKey.VersionEnd);if(BufferUtil.integerFromBuffer(version)!==network.xpubkey){return new errors.InvalidNetwork(version);}return null;};HDPublicKey.prototype._buildFromPrivate=function(arg){var args=_.clone(arg._buffers);var point=Point.getG().mul(BN.fromBuffer(args.privateKey));args.publicKey=Point.pointToCompressed(point);args.version=BufferUtil.integerAsBuffer(Network.get(BufferUtil.integerFromBuffer(args.version)).xpubkey);args.privateKey=undefined;args.checksum=undefined;args.xprivkey=undefined;return this._buildFromBuffers(args);};HDPublicKey.prototype._buildFromObject=function(arg){/* jshint maxcomplexity: 10 */// TODO: Type validation +var buffers={version:arg.network?BufferUtil.integerAsBuffer(Network.get(arg.network).xpubkey):arg.version,depth:_.isNumber(arg.depth)?BufferUtil.integerAsSingleByteBuffer(arg.depth):arg.depth,parentFingerPrint:_.isNumber(arg.parentFingerPrint)?BufferUtil.integerAsBuffer(arg.parentFingerPrint):arg.parentFingerPrint,childIndex:_.isNumber(arg.childIndex)?BufferUtil.integerAsBuffer(arg.childIndex):arg.childIndex,chainCode:_.isString(arg.chainCode)?BufferUtil.hexToBuffer(arg.chainCode):arg.chainCode,publicKey:_.isString(arg.publicKey)?BufferUtil.hexToBuffer(arg.publicKey):BufferUtil.isBuffer(arg.publicKey)?arg.publicKey:arg.publicKey.toBuffer(),checksum:_.isNumber(arg.checksum)?BufferUtil.integerAsBuffer(arg.checksum):arg.checksum};return this._buildFromBuffers(buffers);};HDPublicKey.prototype._buildFromSerialized=function(arg){var decoded=Base58Check.decode(arg);var buffers={version:decoded.slice(HDPublicKey.VersionStart,HDPublicKey.VersionEnd),depth:decoded.slice(HDPublicKey.DepthStart,HDPublicKey.DepthEnd),parentFingerPrint:decoded.slice(HDPublicKey.ParentFingerPrintStart,HDPublicKey.ParentFingerPrintEnd),childIndex:decoded.slice(HDPublicKey.ChildIndexStart,HDPublicKey.ChildIndexEnd),chainCode:decoded.slice(HDPublicKey.ChainCodeStart,HDPublicKey.ChainCodeEnd),publicKey:decoded.slice(HDPublicKey.PublicKeyStart,HDPublicKey.PublicKeyEnd),checksum:decoded.slice(HDPublicKey.ChecksumStart,HDPublicKey.ChecksumEnd),xpubkey:arg};return this._buildFromBuffers(buffers);};/** + * Receives a object with buffers in all the properties and populates the + * internal structure + * + * @param {Object} arg + * @param {buffer.Buffer} arg.version + * @param {buffer.Buffer} arg.depth + * @param {buffer.Buffer} arg.parentFingerPrint + * @param {buffer.Buffer} arg.childIndex + * @param {buffer.Buffer} arg.chainCode + * @param {buffer.Buffer} arg.publicKey + * @param {buffer.Buffer} arg.checksum + * @param {string=} arg.xpubkey - if set, don't recalculate the base58 + * representation + * @return {HDPublicKey} this + */HDPublicKey.prototype._buildFromBuffers=function(arg){/* jshint maxcomplexity: 8 *//* jshint maxstatements: 20 */HDPublicKey._validateBufferArguments(arg);JSUtil.defineImmutable(this,{_buffers:arg});var sequence=[arg.version,arg.depth,arg.parentFingerPrint,arg.childIndex,arg.chainCode,arg.publicKey];var concat=BufferUtil.concat(sequence);var checksum=Base58Check.checksum(concat);if(!arg.checksum||!arg.checksum.length){arg.checksum=checksum;}else{if(arg.checksum.toString('hex')!==checksum.toString('hex')){throw new errors.InvalidB58Checksum(concat,checksum);}}var network=Network.get(BufferUtil.integerFromBuffer(arg.version));var xpubkey;xpubkey=Base58Check.encode(BufferUtil.concat(sequence));arg.xpubkey=new Buffer(xpubkey);var publicKey=new PublicKey(arg.publicKey,{network:network});var size=HDPublicKey.ParentFingerPrintSize;var fingerPrint=Hash.sha256ripemd160(publicKey.toBuffer()).slice(0,size);JSUtil.defineImmutable(this,{xpubkey:xpubkey,network:network,depth:BufferUtil.integerFromSingleByteBuffer(arg.depth),publicKey:publicKey,fingerPrint:fingerPrint});return this;};HDPublicKey._validateBufferArguments=function(arg){var checkBuffer=function checkBuffer(name,size){var buff=arg[name];assert(BufferUtil.isBuffer(buff),name+' argument is not a buffer, it\'s '+(typeof buff==="undefined"?"undefined":_typeof(buff)));assert(buff.length===size,name+' has not the expected size: found '+buff.length+', expected '+size);};checkBuffer('version',HDPublicKey.VersionSize);checkBuffer('depth',HDPublicKey.DepthSize);checkBuffer('parentFingerPrint',HDPublicKey.ParentFingerPrintSize);checkBuffer('childIndex',HDPublicKey.ChildIndexSize);checkBuffer('chainCode',HDPublicKey.ChainCodeSize);checkBuffer('publicKey',HDPublicKey.PublicKeySize);if(arg.checksum&&arg.checksum.length){checkBuffer('checksum',HDPublicKey.CheckSumSize);}};HDPublicKey.fromString=function(arg){$.checkArgument(_.isString(arg),'No valid string was provided');return new HDPublicKey(arg);};HDPublicKey.fromObject=function(arg){$.checkArgument(_.isObject(arg),'No valid argument was provided');return new HDPublicKey(arg);};/** + * Returns the base58 checked representation of the public key + * @return {string} a string starting with "xpub..." in livenet + */HDPublicKey.prototype.toString=function(){return this.xpubkey;};/** + * Returns the console representation of this extended public key. + * @return string + */HDPublicKey.prototype.inspect=function(){return'';};/** + * Returns a plain JavaScript object with information to reconstruct a key. + * + * Fields are:
    + *
  • network: 'livenet' or 'testnet' + *
  • depth: a number from 0 to 255, the depth to the master extended key + *
  • fingerPrint: a number of 32 bits taken from the hash of the public key + *
  • fingerPrint: a number of 32 bits taken from the hash of this key's + *
  • parent's public key + *
  • childIndex: index with which this key was derived + *
  • chainCode: string in hexa encoding used for derivation + *
  • publicKey: string, hexa encoded, in compressed key format + *
  • checksum: BufferUtil.integerFromBuffer(this._buffers.checksum), + *
  • xpubkey: the string with the base58 representation of this extended key + *
  • checksum: the base58 checksum of xpubkey + *
+ */HDPublicKey.prototype.toObject=HDPublicKey.prototype.toJSON=function toObject(){return{network:Network.get(BufferUtil.integerFromBuffer(this._buffers.version)).name,depth:BufferUtil.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:BufferUtil.integerFromBuffer(this.fingerPrint),parentFingerPrint:BufferUtil.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:BufferUtil.integerFromBuffer(this._buffers.childIndex),chainCode:BufferUtil.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:BufferUtil.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey};};/** + * Create a HDPublicKey from a buffer argument + * + * @param {Buffer} arg + * @return {HDPublicKey} + */HDPublicKey.fromBuffer=function(arg){return new HDPublicKey(arg);};/** + * Return a buffer representation of the xpubkey + * + * @return {Buffer} + */HDPublicKey.prototype.toBuffer=function(){return BufferUtil.copy(this._buffers.xpubkey);};HDPublicKey.Hardened=0x80000000;HDPublicKey.RootElementAlias=['m','M'];HDPublicKey.VersionSize=4;HDPublicKey.DepthSize=1;HDPublicKey.ParentFingerPrintSize=4;HDPublicKey.ChildIndexSize=4;HDPublicKey.ChainCodeSize=32;HDPublicKey.PublicKeySize=33;HDPublicKey.CheckSumSize=4;HDPublicKey.DataSize=78;HDPublicKey.SerializedByteSize=82;HDPublicKey.VersionStart=0;HDPublicKey.VersionEnd=HDPublicKey.VersionStart+HDPublicKey.VersionSize;HDPublicKey.DepthStart=HDPublicKey.VersionEnd;HDPublicKey.DepthEnd=HDPublicKey.DepthStart+HDPublicKey.DepthSize;HDPublicKey.ParentFingerPrintStart=HDPublicKey.DepthEnd;HDPublicKey.ParentFingerPrintEnd=HDPublicKey.ParentFingerPrintStart+HDPublicKey.ParentFingerPrintSize;HDPublicKey.ChildIndexStart=HDPublicKey.ParentFingerPrintEnd;HDPublicKey.ChildIndexEnd=HDPublicKey.ChildIndexStart+HDPublicKey.ChildIndexSize;HDPublicKey.ChainCodeStart=HDPublicKey.ChildIndexEnd;HDPublicKey.ChainCodeEnd=HDPublicKey.ChainCodeStart+HDPublicKey.ChainCodeSize;HDPublicKey.PublicKeyStart=HDPublicKey.ChainCodeEnd;HDPublicKey.PublicKeyEnd=HDPublicKey.PublicKeyStart+HDPublicKey.PublicKeySize;HDPublicKey.ChecksumStart=HDPublicKey.PublicKeyEnd;HDPublicKey.ChecksumEnd=HDPublicKey.ChecksumStart+HDPublicKey.CheckSumSize;assert(HDPublicKey.PublicKeyEnd===HDPublicKey.DataSize);assert(HDPublicKey.ChecksumEnd===HDPublicKey.SerializedByteSize);module.exports=HDPublicKey;}).call(this,require("buffer").Buffer);},{"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./encoding/base58":90,"./encoding/base58check":91,"./errors":95,"./hdkeycache":97,"./hdprivatekey":98,"./networks":100,"./publickey":103,"./util/buffer":121,"./util/js":122,"./util/preconditions":123,"assert":67,"buffer":191,"lodash":149}],100:[function(require,module,exports){'use strict';var _=require('lodash');var BufferUtil=require('./util/buffer');var JSUtil=require('./util/js');var networks=[];var networkMaps={};/** + * A network is merely a map containing values that correspond to version + * numbers for each bitcoin network. Currently only supporting "livenet" + * (a.k.a. "mainnet") and "testnet". + * @constructor + */function Network(){}Network.prototype.toString=function toString(){return this.name;};/** + * @function + * @member Networks#get + * Retrieves the network associated with a magic number or string. + * @param {string|number|Network} arg + * @param {string|Array} keys - if set, only check if the magic number associated with this name matches + * @return Network + */function get(arg,keys){if(~networks.indexOf(arg)){return arg;}if(keys){if(!_.isArray(keys)){keys=[keys];}var containsArg=function containsArg(key){return networks[index][key]===arg;};for(var index in networks){if(_.any(keys,containsArg)){return networks[index];}}return undefined;}return networkMaps[arg];}/** + * @function + * @member Networks#add + * Will add a custom Network + * @param {Object} data + * @param {string} data.name - The name of the network + * @param {string} data.alias - The aliased name of the network + * @param {Number} data.pubkeyhash - The publickey hash prefix + * @param {Number} data.privatekey - The privatekey prefix + * @param {Number} data.scripthash - The scripthash prefix + * @param {Number} data.xpubkey - The extended public key magic + * @param {Number} data.xprivkey - The extended private key magic + * @param {Number} data.networkMagic - The network magic number + * @param {Number} data.port - The network port + * @param {Array} data.dnsSeeds - An array of dns seeds + * @return Network + */function addNetwork(data){var network=new Network();JSUtil.defineImmutable(network,{name:data.name,alias:data.alias,pubkeyhash:data.pubkeyhash,privatekey:data.privatekey,scripthash:data.scripthash,xpubkey:data.xpubkey,xprivkey:data.xprivkey});if(data.networkMagic){JSUtil.defineImmutable(network,{networkMagic:BufferUtil.integerAsBuffer(data.networkMagic)});}if(data.port){JSUtil.defineImmutable(network,{port:data.port});}if(data.dnsSeeds){JSUtil.defineImmutable(network,{dnsSeeds:data.dnsSeeds});}_.each(network,function(value){if(!_.isUndefined(value)&&!_.isObject(value)){networkMaps[value]=network;}});networks.push(network);return network;}/** + * @function + * @member Networks#remove + * Will remove a custom network + * @param {Network} network + */function removeNetwork(network){for(var i=0;i=0&&n<=16,'Invalid Argument: n must be between 0 and 16');if(n===0){return Opcode('OP_0');}return new Opcode(Opcode.map.OP_1+n-1);};Opcode.map={// push value +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,// control +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,// stack ops +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,// splice ops +OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,// bit logic +OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,// numeric +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,// crypto +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_CHECKLOCKTIMEVERIFY:177,// expansion +OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,// template matching params +OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};Opcode.reverseMap=[];for(var k in Opcode.map){Opcode.reverseMap[Opcode.map[k]]=k;}// Easier access to opcodes +_.extend(Opcode,Opcode.map);/** + * @returns true if opcode is one of OP_0, OP_1, ..., OP_16 + */Opcode.isSmallIntOp=function(opcode){if(opcode instanceof Opcode){opcode=opcode.toNumber();}return opcode===Opcode.map.OP_0||opcode>=Opcode.map.OP_1&&opcode<=Opcode.map.OP_16;};/** + * Will return a string formatted for the console + * + * @returns {string} Script opcode + */Opcode.prototype.inspect=function(){return'';};module.exports=Opcode;}).call(this,require("buffer").Buffer);},{"./util/buffer":121,"./util/js":122,"./util/preconditions":123,"buffer":191,"lodash":149}],102:[function(require,module,exports){(function(Buffer){'use strict';var _=require('lodash');var Address=require('./address');var Base58Check=require('./encoding/base58check');var BN=require('./crypto/bn');var JSUtil=require('./util/js');var Networks=require('./networks');var Point=require('./crypto/point');var PublicKey=require('./publickey');var Random=require('./crypto/random');var $=require('./util/preconditions');/** + * Instantiate a PrivateKey from a BN, Buffer and WIF. + * + * @example + * ```javascript + * // generate a new random key + * var key = PrivateKey(); + * + * // get the associated address + * var address = key.toAddress(); + * + * // encode into wallet export format + * var exported = key.toWIF(); + * + * // instantiate from the exported (and saved) private key + * var imported = PrivateKey.fromWIF(exported); + * ``` + * + * @param {string} data - The encoded data in various formats + * @param {Network|string=} network - a {@link Network} object, or a string with the network name + * @returns {PrivateKey} A new valid instance of an PrivateKey + * @constructor + */function PrivateKey(data,network){/* jshint maxstatements: 20 *//* jshint maxcomplexity: 8 */if(!(this instanceof PrivateKey)){return new PrivateKey(data,network);}if(data instanceof PrivateKey){return data;}var info=this._classifyArguments(data,network);// validation +if(!info.bn||info.bn.cmp(new BN(0))===0){throw new TypeError('Number can not be equal to zero, undefined, null or false');}if(!info.bn.lt(Point.getN())){throw new TypeError('Number must be less than N');}if(typeof info.network==='undefined'){throw new TypeError('Must specify the network ("livenet" or "testnet")');}JSUtil.defineImmutable(this,{bn:info.bn,compressed:info.compressed,network:info.network});Object.defineProperty(this,'publicKey',{configurable:false,enumerable:true,get:this.toPublicKey.bind(this)});return this;};/** + * Internal helper to instantiate PrivateKey internal `info` object from + * different kinds of arguments passed to the constructor. + * + * @param {*} data + * @param {Network|string=} network - a {@link Network} object, or a string with the network name + * @return {Object} + */PrivateKey.prototype._classifyArguments=function(data,network){/* jshint maxcomplexity: 10 */var info={compressed:true,network:network?Networks.get(network):Networks.defaultNetwork};// detect type of data +if(_.isUndefined(data)||_.isNull(data)){info.bn=PrivateKey._getRandomBN();}else if(data instanceof BN){info.bn=data;}else if(data instanceof Buffer||data instanceof Uint8Array){info=PrivateKey._transformBuffer(data,network);}else if(data.bn&&data.network){info=PrivateKey._transformObject(data);}else if(!network&&Networks.get(data)){info.bn=PrivateKey._getRandomBN();info.network=Networks.get(data);}else if(typeof data==='string'){if(JSUtil.isHexa(data)){info.bn=new BN(new Buffer(data,'hex'));}else{info=PrivateKey._transformWIF(data,network);}}else{throw new TypeError('First argument is an unrecognized data type.');}return info;};/** + * Internal function to get a random Big Number (BN) + * + * @returns {BN} A new randomly generated BN + * @private + */PrivateKey._getRandomBN=function(){var condition;var bn;do{var privbuf=Random.getRandomBuffer(32);bn=BN.fromBuffer(privbuf);condition=bn.lt(Point.getN());}while(!condition);return bn;};/** + * Internal function to transform a WIF Buffer into a private key + * + * @param {Buffer} buf - An WIF string + * @param {Network|string=} network - a {@link Network} object, or a string with the network name + * @returns {Object} An object with keys: bn, network and compressed + * @private + */PrivateKey._transformBuffer=function(buf,network){var info={};if(buf.length===32){return PrivateKey._transformBNBuffer(buf,network);}info.network=Networks.get(buf[0],'privatekey');if(!info.network){throw new Error('Invalid network');}if(network&&info.network!==Networks.get(network)){throw new TypeError('Private key network mismatch');}if(buf.length===1+32+1&&buf[1+32+1-1]===1){info.compressed=true;}else if(buf.length===1+32){info.compressed=false;}else{throw new Error('Length of buffer must be 33 (uncompressed) or 34 (compressed)');}info.bn=BN.fromBuffer(buf.slice(1,32+1));return info;};/** + * Internal function to transform a BN buffer into a private key + * + * @param {Buffer} buf + * @param {Network|string=} network - a {@link Network} object, or a string with the network name + * @returns {object} an Object with keys: bn, network, and compressed + * @private + */PrivateKey._transformBNBuffer=function(buf,network){var info={};info.network=Networks.get(network)||Networks.defaultNetwork;info.bn=BN.fromBuffer(buf);info.compressed=false;return info;};/** + * Internal function to transform a WIF string into a private key + * + * @param {string} buf - An WIF string + * @returns {Object} An object with keys: bn, network and compressed + * @private + */PrivateKey._transformWIF=function(str,network){return PrivateKey._transformBuffer(Base58Check.decode(str),network);};/** + * Instantiate a PrivateKey from a Buffer with the DER or WIF representation + * + * @param {Buffer} arg + * @param {Network} network + * @return {PrivateKey} + */PrivateKey.fromBuffer=function(arg,network){return new PrivateKey(arg,network);};/** + * Internal function to transform a JSON string on plain object into a private key + * return this. + * + * @param {string} json - A JSON string or plain object + * @returns {Object} An object with keys: bn, network and compressed + * @private + */PrivateKey._transformObject=function(json){var bn=new BN(json.bn,'hex');var network=Networks.get(json.network);return{bn:bn,network:network,compressed:json.compressed};};/** + * Instantiate a PrivateKey from a WIF string + * + * @param {string} str - The WIF encoded private key string + * @returns {PrivateKey} A new valid instance of PrivateKey + */PrivateKey.fromString=PrivateKey.fromWIF=function(str){$.checkArgument(_.isString(str),'First argument is expected to be a string.');return new PrivateKey(str);};/** + * Instantiate a PrivateKey from a plain JavaScript object + * + * @param {Object} obj - The output from privateKey.toObject() + */PrivateKey.fromObject=function(obj){$.checkArgument(_.isObject(obj),'First argument is expected to be an object.');return new PrivateKey(obj);};/** + * Instantiate a PrivateKey from random bytes + * + * @param {string=} network - Either "livenet" or "testnet" + * @returns {PrivateKey} A new valid instance of PrivateKey + */PrivateKey.fromRandom=function(network){var bn=PrivateKey._getRandomBN();return new PrivateKey(bn,network);};/** + * Check if there would be any errors when initializing a PrivateKey + * + * @param {string} data - The encoded data in various formats + * @param {string=} network - Either "livenet" or "testnet" + * @returns {null|Error} An error if exists + */PrivateKey.getValidationError=function(data,network){var error;try{/* jshint nonew: false */new PrivateKey(data,network);}catch(e){error=e;}return error;};/** + * Check if the parameters are valid + * + * @param {string} data - The encoded data in various formats + * @param {string=} network - Either "livenet" or "testnet" + * @returns {Boolean} If the private key is would be valid + */PrivateKey.isValid=function(data,network){if(!data){return false;}return!PrivateKey.getValidationError(data,network);};/** + * Will output the PrivateKey encoded as hex string + * + * @returns {string} + */PrivateKey.prototype.toString=function(){return this.toBuffer().toString('hex');};/** + * Will output the PrivateKey to a WIF string + * + * @returns {string} A WIP representation of the private key + */PrivateKey.prototype.toWIF=function(){var network=this.network;var compressed=this.compressed;var buf;if(compressed){buf=Buffer.concat([new Buffer([network.privatekey]),this.bn.toBuffer({size:32}),new Buffer([0x01])]);}else{buf=Buffer.concat([new Buffer([network.privatekey]),this.bn.toBuffer({size:32})]);}return Base58Check.encode(buf);};/** + * Will return the private key as a BN instance + * + * @returns {BN} A BN instance of the private key + */PrivateKey.prototype.toBigNumber=function(){return this.bn;};/** + * Will return the private key as a BN buffer + * + * @returns {Buffer} A buffer of the private key + */PrivateKey.prototype.toBuffer=function(){return this.bn.toBuffer();};/** + * Will return the corresponding public key + * + * @returns {PublicKey} A public key generated from the private key + */PrivateKey.prototype.toPublicKey=function(){if(!this._pubkey){this._pubkey=PublicKey.fromPrivateKey(this);}return this._pubkey;};/** + * Will return an address for the private key + * @param {Network=} network - optional parameter specifying + * the desired network for the address + * + * @returns {Address} An address generated from the private key + */PrivateKey.prototype.toAddress=function(network){var pubkey=this.toPublicKey();return Address.fromPublicKey(pubkey,network||this.network);};/** + * @returns {Object} A plain object representation + */PrivateKey.prototype.toObject=PrivateKey.prototype.toJSON=function toObject(){return{bn:this.bn.toString('hex'),compressed:this.compressed,network:this.network.toString()};};/** + * Will return a string formatted for the console + * + * @returns {string} Private key + */PrivateKey.prototype.inspect=function(){var uncompressed=!this.compressed?', uncompressed':'';return'';};module.exports=PrivateKey;}).call(this,require("buffer").Buffer);},{"./address":79,"./crypto/bn":84,"./crypto/point":87,"./crypto/random":88,"./encoding/base58check":91,"./networks":100,"./publickey":103,"./util/js":122,"./util/preconditions":123,"buffer":191,"lodash":149}],103:[function(require,module,exports){(function(Buffer){'use strict';var BN=require('./crypto/bn');var Point=require('./crypto/point');var Hash=require('./crypto/hash');var JSUtil=require('./util/js');var Network=require('./networks');var _=require('lodash');var $=require('./util/preconditions');/** + * Instantiate a PublicKey from a {@link PrivateKey}, {@link Point}, `string`, or `Buffer`. + * + * There are two internal properties, `network` and `compressed`, that deal with importing + * a PublicKey from a PrivateKey in WIF format. More details described on {@link PrivateKey} + * + * @example + * ```javascript + * // instantiate from a private key + * var key = PublicKey(privateKey, true); + * + * // export to as a DER hex encoded string + * var exported = key.toString(); + * + * // import the public key + * var imported = PublicKey.fromString(exported); + * ``` + * + * @param {string} data - The encoded data in various formats + * @param {Object} extra - additional options + * @param {Network=} extra.network - Which network should the address for this public key be for + * @param {String=} extra.compressed - If the public key is compressed + * @returns {PublicKey} A new valid instance of an PublicKey + * @constructor + */function PublicKey(data,extra){if(!(this instanceof PublicKey)){return new PublicKey(data,extra);}$.checkArgument(data,'First argument is required, please include public key data.');if(data instanceof PublicKey){// Return copy, but as it's an immutable object, return same argument +return data;}extra=extra||{};var info=this._classifyArgs(data,extra);// validation +info.point.validate();JSUtil.defineImmutable(this,{point:info.point,compressed:info.compressed,network:info.network||Network.defaultNetwork});return this;};/** + * Internal function to differentiate between arguments passed to the constructor + * @param {*} data + * @param {Object} extra + */PublicKey.prototype._classifyArgs=function(data,extra){/* jshint maxcomplexity: 10 */var info={compressed:_.isUndefined(extra.compressed)||extra.compressed};// detect type of data +if(data instanceof Point){info.point=data;}else if(data.x&&data.y){info=PublicKey._transformObject(data);}else if(typeof data==='string'){info=PublicKey._transformDER(new Buffer(data,'hex'));}else if(PublicKey._isBuffer(data)){info=PublicKey._transformDER(data);}else if(PublicKey._isPrivateKey(data)){info=PublicKey._transformPrivateKey(data);}else{throw new TypeError('First argument is an unrecognized data format.');}if(!info.network){info.network=_.isUndefined(extra.network)?undefined:Network.get(extra.network);}return info;};/** + * Internal function to detect if an object is a {@link PrivateKey} + * + * @param {*} param - object to test + * @returns {boolean} + * @private + */PublicKey._isPrivateKey=function(param){var PrivateKey=require('./privatekey');return param instanceof PrivateKey;};/** + * Internal function to detect if an object is a Buffer + * + * @param {*} param - object to test + * @returns {boolean} + * @private + */PublicKey._isBuffer=function(param){return param instanceof Buffer||param instanceof Uint8Array;};/** + * Internal function to transform a private key into a public key point + * + * @param {PrivateKey} privkey - An instance of PrivateKey + * @returns {Object} An object with keys: point and compressed + * @private + */PublicKey._transformPrivateKey=function(privkey){$.checkArgument(PublicKey._isPrivateKey(privkey),'Must be an instance of PrivateKey');var info={};info.point=Point.getG().mul(privkey.bn);info.compressed=privkey.compressed;info.network=privkey.network;return info;};/** + * Internal function to transform DER into a public key point + * + * @param {Buffer} buf - An hex encoded buffer + * @param {bool=} strict - if set to false, will loosen some conditions + * @returns {Object} An object with keys: point and compressed + * @private + */PublicKey._transformDER=function(buf,strict){/* jshint maxstatements: 30 *//* jshint maxcomplexity: 12 */$.checkArgument(PublicKey._isBuffer(buf),'Must be a hex buffer of DER encoded public key');var info={};strict=_.isUndefined(strict)?true:strict;var x;var y;var xbuf;var ybuf;if(buf[0]===0x04||!strict&&(buf[0]===0x06||buf[0]===0x07)){xbuf=buf.slice(1,33);ybuf=buf.slice(33,65);if(xbuf.length!==32||ybuf.length!==32||buf.length!==65){throw new TypeError('Length of x and y must be 32 bytes');}x=new BN(xbuf);y=new BN(ybuf);info.point=new Point(x,y);info.compressed=false;}else if(buf[0]===0x03){xbuf=buf.slice(1);x=new BN(xbuf);info=PublicKey._transformX(true,x);info.compressed=true;}else if(buf[0]===0x02){xbuf=buf.slice(1);x=new BN(xbuf);info=PublicKey._transformX(false,x);info.compressed=true;}else{throw new TypeError('Invalid DER format public key');}return info;};/** + * Internal function to transform X into a public key point + * + * @param {Boolean} odd - If the point is above or below the x axis + * @param {Point} x - The x point + * @returns {Object} An object with keys: point and compressed + * @private + */PublicKey._transformX=function(odd,x){$.checkArgument(typeof odd==='boolean','Must specify whether y is odd or not (true or false)');var info={};info.point=Point.fromX(odd,x);return info;};/** + * Internal function to transform a JSON into a public key point + * + * @param {String|Object} json - a JSON string or plain object + * @returns {Object} An object with keys: point and compressed + * @private + */PublicKey._transformObject=function(json){var x=new BN(json.x,'hex');var y=new BN(json.y,'hex');var point=new Point(x,y);return new PublicKey(point,{compressed:json.compressed});};/** + * Instantiate a PublicKey from a PrivateKey + * + * @param {PrivateKey} privkey - An instance of PrivateKey + * @returns {PublicKey} A new valid instance of PublicKey + */PublicKey.fromPrivateKey=function(privkey){$.checkArgument(PublicKey._isPrivateKey(privkey),'Must be an instance of PrivateKey');var info=PublicKey._transformPrivateKey(privkey);return new PublicKey(info.point,{compressed:info.compressed,network:info.network});};/** + * Instantiate a PublicKey from a Buffer + * @param {Buffer} buf - A DER hex buffer + * @param {bool=} strict - if set to false, will loosen some conditions + * @returns {PublicKey} A new valid instance of PublicKey + */PublicKey.fromDER=PublicKey.fromBuffer=function(buf,strict){$.checkArgument(PublicKey._isBuffer(buf),'Must be a hex buffer of DER encoded public key');var info=PublicKey._transformDER(buf,strict);return new PublicKey(info.point,{compressed:info.compressed});};/** + * Instantiate a PublicKey from a Point + * + * @param {Point} point - A Point instance + * @param {boolean=} compressed - whether to store this public key as compressed format + * @returns {PublicKey} A new valid instance of PublicKey + */PublicKey.fromPoint=function(point,compressed){$.checkArgument(point instanceof Point,'First argument must be an instance of Point.');return new PublicKey(point,{compressed:compressed});};/** + * Instantiate a PublicKey from a DER hex encoded string + * + * @param {string} str - A DER hex string + * @param {String=} encoding - The type of string encoding + * @returns {PublicKey} A new valid instance of PublicKey + */PublicKey.fromString=function(str,encoding){var buf=new Buffer(str,encoding||'hex');var info=PublicKey._transformDER(buf);return new PublicKey(info.point,{compressed:info.compressed});};/** + * Instantiate a PublicKey from an X Point + * + * @param {Boolean} odd - If the point is above or below the x axis + * @param {Point} x - The x point + * @returns {PublicKey} A new valid instance of PublicKey + */PublicKey.fromX=function(odd,x){var info=PublicKey._transformX(odd,x);return new PublicKey(info.point,{compressed:info.compressed});};/** + * Check if there would be any errors when initializing a PublicKey + * + * @param {string} data - The encoded data in various formats + * @returns {null|Error} An error if exists + */PublicKey.getValidationError=function(data){var error;try{/* jshint nonew: false */new PublicKey(data);}catch(e){error=e;}return error;};/** + * Check if the parameters are valid + * + * @param {string} data - The encoded data in various formats + * @returns {Boolean} If the public key would be valid + */PublicKey.isValid=function(data){return!PublicKey.getValidationError(data);};/** + * @returns {Object} A plain object of the PublicKey + */PublicKey.prototype.toObject=PublicKey.prototype.toJSON=function toObject(){return{x:this.point.getX().toString('hex',2),y:this.point.getY().toString('hex',2),compressed:this.compressed};};/** + * Will output the PublicKey to a DER Buffer + * + * @returns {Buffer} A DER hex encoded buffer + */PublicKey.prototype.toBuffer=PublicKey.prototype.toDER=function(){var x=this.point.getX();var y=this.point.getY();var xbuf=x.toBuffer({size:32});var ybuf=y.toBuffer({size:32});var prefix;if(!this.compressed){prefix=new Buffer([0x04]);return Buffer.concat([prefix,xbuf,ybuf]);}else{var odd=ybuf[ybuf.length-1]%2;if(odd){prefix=new Buffer([0x03]);}else{prefix=new Buffer([0x02]);}return Buffer.concat([prefix,xbuf]);}};/** + * Will return a sha256 + ripemd160 hash of the serialized public key + * @see https://github.com/bitcoin/bitcoin/blob/master/src/pubkey.h#L141 + * @returns {Buffer} + */PublicKey.prototype._getID=function _getID(){return Hash.sha256ripemd160(this.toBuffer());};/** + * Will return an address for the public key + * + * @param {String|Network=} network - Which network should the address be for + * @returns {Address} An address generated from the public key + */PublicKey.prototype.toAddress=function(network){var Address=require('./address');return Address.fromPublicKey(this,network||this.network);};/** + * Will output the PublicKey to a DER encoded hex string + * + * @returns {string} A DER hex encoded string + */PublicKey.prototype.toString=function(){return this.toDER().toString('hex');};/** + * Will return a string formatted for the console + * + * @returns {string} Public key + */PublicKey.prototype.inspect=function(){return'';};module.exports=PublicKey;}).call(this,require("buffer").Buffer);},{"./address":79,"./crypto/bn":84,"./crypto/hash":86,"./crypto/point":87,"./networks":100,"./privatekey":102,"./util/js":122,"./util/preconditions":123,"buffer":191,"lodash":149}],104:[function(require,module,exports){module.exports=require('./script');module.exports.Interpreter=require('./interpreter');},{"./interpreter":105,"./script":106}],105:[function(require,module,exports){(function(Buffer){'use strict';var _=require('lodash');var Script=require('./script');var Opcode=require('../opcode');var BN=require('../crypto/bn');var Hash=require('../crypto/hash');var Signature=require('../crypto/signature');var PublicKey=require('../publickey');/** + * Bitcoin transactions contain scripts. Each input has a script called the + * scriptSig, and each output has a script called the scriptPubkey. To validate + * an input, the input's script is concatenated with the referenced output script, + * and the result is executed. If at the end of execution the stack contains a + * "true" value, then the transaction is valid. + * + * The primary way to use this class is via the verify function. + * e.g., Interpreter().verify( ... ); + */var Interpreter=function Interpreter(obj){if(!(this instanceof Interpreter)){return new Interpreter(obj);}if(obj){this.initialize();this.set(obj);}else{this.initialize();}};/** + * Verifies a Script by executing it and returns true if it is valid. + * This function needs to be provided with the scriptSig and the scriptPubkey + * separately. + * @param {Script} scriptSig - the script's first part (corresponding to the tx input) + * @param {Script} scriptPubkey - the script's last part (corresponding to the tx output) + * @param {Transaction=} tx - the Transaction containing the scriptSig in one input (used + * to check signature validity for some opcodes like OP_CHECKSIG) + * @param {number} nin - index of the transaction input containing the scriptSig verified. + * @param {number} flags - evaluation flags. See Interpreter.SCRIPT_* constants + * + * Translated from bitcoind's VerifyScript + */Interpreter.prototype.verify=function(scriptSig,scriptPubkey,tx,nin,flags){var Transaction=require('../transaction');if(_.isUndefined(tx)){tx=new Transaction();}if(_.isUndefined(nin)){nin=0;}if(_.isUndefined(flags)){flags=0;}this.set({script:scriptSig,tx:tx,nin:nin,flags:flags});var stackCopy;if((flags&Interpreter.SCRIPT_VERIFY_SIGPUSHONLY)!==0&&!scriptSig.isPushOnly()){this.errstr='SCRIPT_ERR_SIG_PUSHONLY';return false;}// evaluate scriptSig +if(!this.evaluate()){return false;}if(flags&Interpreter.SCRIPT_VERIFY_P2SH){stackCopy=this.stack.slice();}var stack=this.stack;this.initialize();this.set({script:scriptPubkey,stack:stack,tx:tx,nin:nin,flags:flags});// evaluate scriptPubkey +if(!this.evaluate()){return false;}if(this.stack.length===0){this.errstr='SCRIPT_ERR_EVAL_FALSE_NO_RESULT';return false;}var buf=this.stack[this.stack.length-1];if(!Interpreter.castToBool(buf)){this.errstr='SCRIPT_ERR_EVAL_FALSE_IN_STACK';return false;}// Additional validation for spend-to-script-hash transactions: +if(flags&Interpreter.SCRIPT_VERIFY_P2SH&&scriptPubkey.isScriptHashOut()){// scriptSig must be literals-only or validation fails +if(!scriptSig.isPushOnly()){this.errstr='SCRIPT_ERR_SIG_PUSHONLY';return false;}// stackCopy cannot be empty here, because if it was the +// P2SH HASH <> EQUAL scriptPubKey would be evaluated with +// an empty stack and the EvalScript above would return false. +if(stackCopy.length===0){throw new Error('internal error - stack copy empty');}var redeemScriptSerialized=stackCopy[stackCopy.length-1];var redeemScript=Script.fromBuffer(redeemScriptSerialized);stackCopy.pop();this.initialize();this.set({script:redeemScript,stack:stackCopy,tx:tx,nin:nin,flags:flags});// evaluate redeemScript +if(!this.evaluate()){return false;}if(stackCopy.length===0){this.errstr='SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK';return false;}if(!Interpreter.castToBool(stackCopy[stackCopy.length-1])){this.errstr='SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK';return false;}else{return true;}}return true;};module.exports=Interpreter;Interpreter.prototype.initialize=function(obj){this.stack=[];this.altstack=[];this.pc=0;this.pbegincodehash=0;this.nOpCount=0;this.vfExec=[];this.errstr='';this.flags=0;};Interpreter.prototype.set=function(obj){this.script=obj.script||this.script;this.tx=obj.tx||this.tx;this.nin=typeof obj.nin!=='undefined'?obj.nin:this.nin;this.stack=obj.stack||this.stack;this.altstack=obj.altack||this.altstack;this.pc=typeof obj.pc!=='undefined'?obj.pc:this.pc;this.pbegincodehash=typeof obj.pbegincodehash!=='undefined'?obj.pbegincodehash:this.pbegincodehash;this.nOpCount=typeof obj.nOpCount!=='undefined'?obj.nOpCount:this.nOpCount;this.vfExec=obj.vfExec||this.vfExec;this.errstr=obj.errstr||this.errstr;this.flags=typeof obj.flags!=='undefined'?obj.flags:this.flags;};Interpreter.true=new Buffer([1]);Interpreter.false=new Buffer([]);Interpreter.MAX_SCRIPT_ELEMENT_SIZE=520;Interpreter.LOCKTIME_THRESHOLD=500000000;Interpreter.LOCKTIME_THRESHOLD_BN=new BN(Interpreter.LOCKTIME_THRESHOLD);// flags taken from bitcoind +// bitcoind commit: b5d1b1092998bc95313856d535c632ea5a8f9104 +Interpreter.SCRIPT_VERIFY_NONE=0;// Evaluate P2SH subscripts (softfork safe, BIP16). +Interpreter.SCRIPT_VERIFY_P2SH=1<<0;// Passing a non-strict-DER signature or one with undefined hashtype to a checksig operation causes script failure. +// Passing a pubkey that is not (0x04 + 64 bytes) or (0x02 or 0x03 + 32 bytes) to checksig causes that pubkey to be +// skipped (not softfork safe: this flag can widen the validity of OP_CHECKSIG OP_NOT). +Interpreter.SCRIPT_VERIFY_STRICTENC=1<<1;// Passing a non-strict-DER signature to a checksig operation causes script failure (softfork safe, BIP62 rule 1) +Interpreter.SCRIPT_VERIFY_DERSIG=1<<2;// Passing a non-strict-DER signature or one with S > order/2 to a checksig operation causes script failure +// (softfork safe, BIP62 rule 5). +Interpreter.SCRIPT_VERIFY_LOW_S=1<<3;// verify dummy stack item consumed by CHECKMULTISIG is of zero-length (softfork safe, BIP62 rule 7). +Interpreter.SCRIPT_VERIFY_NULLDUMMY=1<<4;// Using a non-push operator in the scriptSig causes script failure (softfork safe, BIP62 rule 2). +Interpreter.SCRIPT_VERIFY_SIGPUSHONLY=1<<5;// Require minimal encodings for all push operations (OP_0... OP_16, OP_1NEGATE where possible, direct +// pushes up to 75 bytes, OP_PUSHDATA up to 255 bytes, OP_PUSHDATA2 for anything larger). Evaluating +// any other push causes the script to fail (BIP62 rule 3). +// In addition, whenever a stack element is interpreted as a number, it must be of minimal length (BIP62 rule 4). +// (softfork safe) +Interpreter.SCRIPT_VERIFY_MINIMALDATA=1<<6;// Discourage use of NOPs reserved for upgrades (NOP1-10) +// +// Provided so that nodes can avoid accepting or mining transactions +// containing executed NOP's whose meaning may change after a soft-fork, +// thus rendering the script invalid; with this flag set executing +// discouraged NOPs fails the script. This verification flag will never be +// a mandatory flag applied to scripts in a block. NOPs that are not +// executed, e.g. within an unexecuted IF ENDIF block, are *not* rejected. +Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=1<<7;// CLTV See BIP65 for details. +Interpreter.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=1<<9;Interpreter.castToBool=function(buf){for(var i=0;i10000){this.errstr='SCRIPT_ERR_SCRIPT_SIZE';return false;}try{while(this.pc1000){this.errstr='SCRIPT_ERR_STACK_SIZE';return false;}}catch(e){this.errstr='SCRIPT_ERR_UNKNOWN_ERROR: '+e;return false;}if(this.vfExec.length>0){this.errstr='SCRIPT_ERR_UNBALANCED_CONDITIONAL';return false;}return true;};/** + * Checks a locktime parameter with the transaction's locktime. + * There are two times of nLockTime: lock-by-blockheight and lock-by-blocktime, + * distinguished by whether nLockTime < LOCKTIME_THRESHOLD = 500000000 + * + * See the corresponding code on bitcoin core: + * https://github.com/bitcoin/bitcoin/blob/ffd75adce01a78b3461b3ff05bcc2b530a9ce994/src/script/interpreter.cpp#L1129 + * + * @param {BN} nLockTime the locktime read from the script + * @return {boolean} true if the transaction's locktime is less than or equal to + * the transaction's locktime + */Interpreter.prototype.checkLockTime=function(nLockTime){// We want to compare apples to apples, so fail the script +// unless the type of nLockTime being tested is the same as +// the nLockTime in the transaction. +if(!(this.tx.nLockTime=Interpreter.LOCKTIME_THRESHOLD&&nLockTime.gte(Interpreter.LOCKTIME_THRESHOLD_BN))){return false;}// Now that we know we're comparing apples-to-apples, the +// comparison is a simple numeric one. +if(nLockTime.gt(new BN(this.tx.nLockTime))){return false;}// Finally the nLockTime feature can be disabled and thus +// CHECKLOCKTIMEVERIFY bypassed if every txin has been +// finalized by setting nSequence to maxint. The +// transaction would be allowed into the blockchain, making +// the opcode ineffective. +// +// Testing if this vin is not final is sufficient to +// prevent this condition. Alternatively we could test all +// inputs, but testing just this input minimizes the data +// required to prove correct CHECKLOCKTIMEVERIFY execution. +if(!this.tx.inputs[this.nin].isFinal()){return false;}return true;};/** + * Based on the inner loop of bitcoind's EvalScript function + * bitcoind commit: b5d1b1092998bc95313856d535c632ea5a8f9104 + */Interpreter.prototype.step=function(){var fRequireMinimal=(this.flags&Interpreter.SCRIPT_VERIFY_MINIMALDATA)!==0;//bool fExec = !count(vfExec.begin(), vfExec.end(), false); +var fExec=this.vfExec.indexOf(false)===-1;var buf,buf1,buf2,spliced,n,x1,x2,bn,bn1,bn2,bufSig,bufPubkey,subscript;var sig,pubkey;var fValue,fSuccess;// Read instruction +var chunk=this.script.chunks[this.pc];this.pc++;var opcodenum=chunk.opcodenum;if(_.isUndefined(opcodenum)){this.errstr='SCRIPT_ERR_UNDEFINED_OPCODE';return false;}if(chunk.buf&&chunk.buf.length>Interpreter.MAX_SCRIPT_ELEMENT_SIZE){this.errstr='SCRIPT_ERR_PUSH_SIZE';return false;}// Note how Opcode.OP_RESERVED does not count towards the opcode limit. +if(opcodenum>Opcode.OP_16&&++this.nOpCount>201){this.errstr='SCRIPT_ERR_OP_COUNT';return false;}if(opcodenum===Opcode.OP_CAT||opcodenum===Opcode.OP_SUBSTR||opcodenum===Opcode.OP_LEFT||opcodenum===Opcode.OP_RIGHT||opcodenum===Opcode.OP_INVERT||opcodenum===Opcode.OP_AND||opcodenum===Opcode.OP_OR||opcodenum===Opcode.OP_XOR||opcodenum===Opcode.OP_2MUL||opcodenum===Opcode.OP_2DIV||opcodenum===Opcode.OP_MUL||opcodenum===Opcode.OP_DIV||opcodenum===Opcode.OP_MOD||opcodenum===Opcode.OP_LSHIFT||opcodenum===Opcode.OP_RSHIFT){this.errstr='SCRIPT_ERR_DISABLED_OPCODE';return false;}if(fExec&&0<=opcodenum&&opcodenum<=Opcode.OP_PUSHDATA4){if(fRequireMinimal&&!this.script.checkMinimalPush(this.pc-1)){this.errstr='SCRIPT_ERR_MINIMALDATA';return false;}if(!chunk.buf){this.stack.push(Interpreter.false);}else if(chunk.len!==chunk.buf.length){throw new Error('Length of push value not equal to length of data');}else{this.stack.push(chunk.buf);}}else if(fExec||Opcode.OP_IF<=opcodenum&&opcodenum<=Opcode.OP_ENDIF){switch(opcodenum){// Push value +case Opcode.OP_1NEGATE:case Opcode.OP_1:case Opcode.OP_2:case Opcode.OP_3:case Opcode.OP_4:case Opcode.OP_5:case Opcode.OP_6:case Opcode.OP_7:case Opcode.OP_8:case Opcode.OP_9:case Opcode.OP_10:case Opcode.OP_11:case Opcode.OP_12:case Opcode.OP_13:case Opcode.OP_14:case Opcode.OP_15:case Opcode.OP_16:{// ( -- value) +// ScriptNum bn((int)opcode - (int)(Opcode.OP_1 - 1)); +n=opcodenum-(Opcode.OP_1-1);buf=new BN(n).toScriptNumBuffer();this.stack.push(buf);// The result of these opcodes should always be the minimal way to push the data +// they push, so no need for a CheckMinimalPush here. +}break;// +// Control +// +case Opcode.OP_NOP:break;case Opcode.OP_NOP2:case Opcode.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&Interpreter.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){// not enabled; treat as a NOP2 +if(this.flags&Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS){this.errstr='SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS';return false;}break;}if(this.stack.length<1){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}// Note that elsewhere numeric opcodes are limited to +// operands in the range -2**31+1 to 2**31-1, however it is +// legal for opcodes to produce results exceeding that +// range. This limitation is implemented by CScriptNum's +// default 4-byte limit. +// +// If we kept to that limit we'd have a year 2038 problem, +// even though the nLockTime field in transactions +// themselves is uint32 which only becomes meaningless +// after the year 2106. +// +// Thus as a special case we tell CScriptNum to accept up +// to 5-byte bignums, which are good until 2**39-1, well +// beyond the 2**32-1 limit of the nLockTime field itself. +var nLockTime=BN.fromScriptNumBuffer(this.stack[this.stack.length-1],fRequireMinimal,5);// In the rare event that the argument may be < 0 due to +// some arithmetic being done first, you can always use +// 0 MAX CHECKLOCKTIMEVERIFY. +if(nLockTime.lt(new BN(0))){this.errstr='SCRIPT_ERR_NEGATIVE_LOCKTIME';return false;}// Actually compare the specified lock time with the transaction. +if(!this.checkLockTime(nLockTime)){this.errstr='SCRIPT_ERR_UNSATISFIED_LOCKTIME';return false;}break;case Opcode.OP_NOP1:case Opcode.OP_NOP3:case Opcode.OP_NOP4:case Opcode.OP_NOP5:case Opcode.OP_NOP6:case Opcode.OP_NOP7:case Opcode.OP_NOP8:case Opcode.OP_NOP9:case Opcode.OP_NOP10:{if(this.flags&Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS){this.errstr='SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS';return false;}}break;case Opcode.OP_IF:case Opcode.OP_NOTIF:{// if [statements] [else [statements]] endif +// bool fValue = false; +fValue=false;if(fExec){if(this.stack.length<1){this.errstr='SCRIPT_ERR_UNBALANCED_CONDITIONAL';return false;}buf=this.stack.pop();fValue=Interpreter.castToBool(buf);if(opcodenum===Opcode.OP_NOTIF){fValue=!fValue;}}this.vfExec.push(fValue);}break;case Opcode.OP_ELSE:{if(this.vfExec.length===0){this.errstr='SCRIPT_ERR_UNBALANCED_CONDITIONAL';return false;}this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];}break;case Opcode.OP_ENDIF:{if(this.vfExec.length===0){this.errstr='SCRIPT_ERR_UNBALANCED_CONDITIONAL';return false;}this.vfExec.pop();}break;case Opcode.OP_VERIFY:{// (true -- ) or +// (false -- false) and return +if(this.stack.length<1){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}buf=this.stack[this.stack.length-1];fValue=Interpreter.castToBool(buf);if(fValue){this.stack.pop();}else{this.errstr='SCRIPT_ERR_VERIFY';return false;}}break;case Opcode.OP_RETURN:{this.errstr='SCRIPT_ERR_OP_RETURN';return false;}break;// +// Stack ops +// +case Opcode.OP_TOALTSTACK:{if(this.stack.length<1){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}this.altstack.push(this.stack.pop());}break;case Opcode.OP_FROMALTSTACK:{if(this.altstack.length<1){this.errstr='SCRIPT_ERR_INVALID_ALTSTACK_OPERATION';return false;}this.stack.push(this.altstack.pop());}break;case Opcode.OP_2DROP:{// (x1 x2 -- ) +if(this.stack.length<2){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}this.stack.pop();this.stack.pop();}break;case Opcode.OP_2DUP:{// (x1 x2 -- x1 x2 x1 x2) +if(this.stack.length<2){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}buf1=this.stack[this.stack.length-2];buf2=this.stack[this.stack.length-1];this.stack.push(buf1);this.stack.push(buf2);}break;case Opcode.OP_3DUP:{// (x1 x2 x3 -- x1 x2 x3 x1 x2 x3) +if(this.stack.length<3){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}buf1=this.stack[this.stack.length-3];buf2=this.stack[this.stack.length-2];var buf3=this.stack[this.stack.length-1];this.stack.push(buf1);this.stack.push(buf2);this.stack.push(buf3);}break;case Opcode.OP_2OVER:{// (x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2) +if(this.stack.length<4){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}buf1=this.stack[this.stack.length-4];buf2=this.stack[this.stack.length-3];this.stack.push(buf1);this.stack.push(buf2);}break;case Opcode.OP_2ROT:{// (x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2) +if(this.stack.length<6){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}spliced=this.stack.splice(this.stack.length-6,2);this.stack.push(spliced[0]);this.stack.push(spliced[1]);}break;case Opcode.OP_2SWAP:{// (x1 x2 x3 x4 -- x3 x4 x1 x2) +if(this.stack.length<4){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}spliced=this.stack.splice(this.stack.length-4,2);this.stack.push(spliced[0]);this.stack.push(spliced[1]);}break;case Opcode.OP_IFDUP:{// (x - 0 | x x) +if(this.stack.length<1){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}buf=this.stack[this.stack.length-1];fValue=Interpreter.castToBool(buf);if(fValue){this.stack.push(buf);}}break;case Opcode.OP_DEPTH:{// -- stacksize +buf=new BN(this.stack.length).toScriptNumBuffer();this.stack.push(buf);}break;case Opcode.OP_DROP:{// (x -- ) +if(this.stack.length<1){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}this.stack.pop();}break;case Opcode.OP_DUP:{// (x -- x x) +if(this.stack.length<1){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}this.stack.push(this.stack[this.stack.length-1]);}break;case Opcode.OP_NIP:{// (x1 x2 -- x2) +if(this.stack.length<2){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}this.stack.splice(this.stack.length-2,1);}break;case Opcode.OP_OVER:{// (x1 x2 -- x1 x2 x1) +if(this.stack.length<2){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}this.stack.push(this.stack[this.stack.length-2]);}break;case Opcode.OP_PICK:case Opcode.OP_ROLL:{// (xn ... x2 x1 x0 n - xn ... x2 x1 x0 xn) +// (xn ... x2 x1 x0 n - ... x2 x1 x0 xn) +if(this.stack.length<2){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}buf=this.stack[this.stack.length-1];bn=BN.fromScriptNumBuffer(buf,fRequireMinimal);n=bn.toNumber();this.stack.pop();if(n<0||n>=this.stack.length){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}buf=this.stack[this.stack.length-n-1];if(opcodenum===Opcode.OP_ROLL){this.stack.splice(this.stack.length-n-1,1);}this.stack.push(buf);}break;case Opcode.OP_ROT:{// (x1 x2 x3 -- x2 x3 x1) +// x2 x1 x3 after first swap +// x2 x3 x1 after second swap +if(this.stack.length<3){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}x1=this.stack[this.stack.length-3];x2=this.stack[this.stack.length-2];var x3=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=x2;this.stack[this.stack.length-2]=x3;this.stack[this.stack.length-1]=x1;}break;case Opcode.OP_SWAP:{// (x1 x2 -- x2 x1) +if(this.stack.length<2){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}x1=this.stack[this.stack.length-2];x2=this.stack[this.stack.length-1];this.stack[this.stack.length-2]=x2;this.stack[this.stack.length-1]=x1;}break;case Opcode.OP_TUCK:{// (x1 x2 -- x2 x1 x2) +if(this.stack.length<2){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);}break;case Opcode.OP_SIZE:{// (in -- in size) +if(this.stack.length<1){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}bn=new BN(this.stack[this.stack.length-1].length);this.stack.push(bn.toScriptNumBuffer());}break;// +// Bitwise logic +// +case Opcode.OP_EQUAL:case Opcode.OP_EQUALVERIFY://case Opcode.OP_NOTEQUAL: // use Opcode.OP_NUMNOTEQUAL +{// (x1 x2 - bool) +if(this.stack.length<2){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}buf1=this.stack[this.stack.length-2];buf2=this.stack[this.stack.length-1];var fEqual=buf1.toString('hex')===buf2.toString('hex');this.stack.pop();this.stack.pop();this.stack.push(fEqual?Interpreter.true:Interpreter.false);if(opcodenum===Opcode.OP_EQUALVERIFY){if(fEqual){this.stack.pop();}else{this.errstr='SCRIPT_ERR_EQUALVERIFY';return false;}}}break;// +// Numeric +// +case Opcode.OP_1ADD:case Opcode.OP_1SUB:case Opcode.OP_NEGATE:case Opcode.OP_ABS:case Opcode.OP_NOT:case Opcode.OP_0NOTEQUAL:{// (in -- out) +if(this.stack.length<1){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}buf=this.stack[this.stack.length-1];bn=BN.fromScriptNumBuffer(buf,fRequireMinimal);switch(opcodenum){case Opcode.OP_1ADD:bn=bn.add(BN.One);break;case Opcode.OP_1SUB:bn=bn.sub(BN.One);break;case Opcode.OP_NEGATE:bn=bn.neg();break;case Opcode.OP_ABS:if(bn.cmp(BN.Zero)<0){bn=bn.neg();}break;case Opcode.OP_NOT:bn=new BN((bn.cmp(BN.Zero)===0)+0);break;case Opcode.OP_0NOTEQUAL:bn=new BN((bn.cmp(BN.Zero)!==0)+0);break;//default: assert(!'invalid opcode'); break; // TODO: does this ever occur? +}this.stack.pop();this.stack.push(bn.toScriptNumBuffer());}break;case Opcode.OP_ADD:case Opcode.OP_SUB:case Opcode.OP_BOOLAND:case Opcode.OP_BOOLOR:case Opcode.OP_NUMEQUAL:case Opcode.OP_NUMEQUALVERIFY:case Opcode.OP_NUMNOTEQUAL:case Opcode.OP_LESSTHAN:case Opcode.OP_GREATERTHAN:case Opcode.OP_LESSTHANOREQUAL:case Opcode.OP_GREATERTHANOREQUAL:case Opcode.OP_MIN:case Opcode.OP_MAX:{// (x1 x2 -- out) +if(this.stack.length<2){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}bn1=BN.fromScriptNumBuffer(this.stack[this.stack.length-2],fRequireMinimal);bn2=BN.fromScriptNumBuffer(this.stack[this.stack.length-1],fRequireMinimal);bn=new BN(0);switch(opcodenum){case Opcode.OP_ADD:bn=bn1.add(bn2);break;case Opcode.OP_SUB:bn=bn1.sub(bn2);break;// case Opcode.OP_BOOLAND: bn = (bn1 != bnZero && bn2 != bnZero); break; +case Opcode.OP_BOOLAND:bn=new BN((bn1.cmp(BN.Zero)!==0&&bn2.cmp(BN.Zero)!==0)+0);break;// case Opcode.OP_BOOLOR: bn = (bn1 != bnZero || bn2 != bnZero); break; +case Opcode.OP_BOOLOR:bn=new BN((bn1.cmp(BN.Zero)!==0||bn2.cmp(BN.Zero)!==0)+0);break;// case Opcode.OP_NUMEQUAL: bn = (bn1 == bn2); break; +case Opcode.OP_NUMEQUAL:bn=new BN((bn1.cmp(bn2)===0)+0);break;// case Opcode.OP_NUMEQUALVERIFY: bn = (bn1 == bn2); break; +case Opcode.OP_NUMEQUALVERIFY:bn=new BN((bn1.cmp(bn2)===0)+0);break;// case Opcode.OP_NUMNOTEQUAL: bn = (bn1 != bn2); break; +case Opcode.OP_NUMNOTEQUAL:bn=new BN((bn1.cmp(bn2)!==0)+0);break;// case Opcode.OP_LESSTHAN: bn = (bn1 < bn2); break; +case Opcode.OP_LESSTHAN:bn=new BN((bn1.cmp(bn2)<0)+0);break;// case Opcode.OP_GREATERTHAN: bn = (bn1 > bn2); break; +case Opcode.OP_GREATERTHAN:bn=new BN((bn1.cmp(bn2)>0)+0);break;// case Opcode.OP_LESSTHANOREQUAL: bn = (bn1 <= bn2); break; +case Opcode.OP_LESSTHANOREQUAL:bn=new BN((bn1.cmp(bn2)<=0)+0);break;// case Opcode.OP_GREATERTHANOREQUAL: bn = (bn1 >= bn2); break; +case Opcode.OP_GREATERTHANOREQUAL:bn=new BN((bn1.cmp(bn2)>=0)+0);break;case Opcode.OP_MIN:bn=bn1.cmp(bn2)<0?bn1:bn2;break;case Opcode.OP_MAX:bn=bn1.cmp(bn2)>0?bn1:bn2;break;// default: assert(!'invalid opcode'); break; //TODO: does this ever occur? +}this.stack.pop();this.stack.pop();this.stack.push(bn.toScriptNumBuffer());if(opcodenum===Opcode.OP_NUMEQUALVERIFY){// if (CastToBool(stacktop(-1))) +if(Interpreter.castToBool(this.stack[this.stack.length-1])){this.stack.pop();}else{this.errstr='SCRIPT_ERR_NUMEQUALVERIFY';return false;}}}break;case Opcode.OP_WITHIN:{// (x min max -- out) +if(this.stack.length<3){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}bn1=BN.fromScriptNumBuffer(this.stack[this.stack.length-3],fRequireMinimal);bn2=BN.fromScriptNumBuffer(this.stack[this.stack.length-2],fRequireMinimal);var bn3=BN.fromScriptNumBuffer(this.stack[this.stack.length-1],fRequireMinimal);//bool fValue = (bn2 <= bn1 && bn1 < bn3); +fValue=bn2.cmp(bn1)<=0&&bn1.cmp(bn3)<0;this.stack.pop();this.stack.pop();this.stack.pop();this.stack.push(fValue?Interpreter.true:Interpreter.false);}break;// +// Crypto +// +case Opcode.OP_RIPEMD160:case Opcode.OP_SHA1:case Opcode.OP_SHA256:case Opcode.OP_HASH160:case Opcode.OP_HASH256:{// (in -- hash) +if(this.stack.length<1){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}buf=this.stack[this.stack.length-1];//valtype vchHash((opcode == Opcode.OP_RIPEMD160 || +// opcode == Opcode.OP_SHA1 || opcode == Opcode.OP_HASH160) ? 20 : 32); +var bufHash;if(opcodenum===Opcode.OP_RIPEMD160){bufHash=Hash.ripemd160(buf);}else if(opcodenum===Opcode.OP_SHA1){bufHash=Hash.sha1(buf);}else if(opcodenum===Opcode.OP_SHA256){bufHash=Hash.sha256(buf);}else if(opcodenum===Opcode.OP_HASH160){bufHash=Hash.sha256ripemd160(buf);}else if(opcodenum===Opcode.OP_HASH256){bufHash=Hash.sha256sha256(buf);}this.stack.pop();this.stack.push(bufHash);}break;case Opcode.OP_CODESEPARATOR:{// Hash starts after the code separator +this.pbegincodehash=this.pc;}break;case Opcode.OP_CHECKSIG:case Opcode.OP_CHECKSIGVERIFY:{// (sig pubkey -- bool) +if(this.stack.length<2){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}bufSig=this.stack[this.stack.length-2];bufPubkey=this.stack[this.stack.length-1];// Subset of script starting at the most recent codeseparator +// CScript scriptCode(pbegincodehash, pend); +subscript=new Script().set({chunks:this.script.chunks.slice(this.pbegincodehash)});// Drop the signature, since there's no way for a signature to sign itself +var tmpScript=new Script().add(bufSig);subscript.findAndDelete(tmpScript);if(!this.checkSignatureEncoding(bufSig)||!this.checkPubkeyEncoding(bufPubkey)){return false;}try{sig=Signature.fromTxFormat(bufSig);pubkey=PublicKey.fromBuffer(bufPubkey,false);fSuccess=this.tx.verifySignature(sig,pubkey,this.nin,subscript);}catch(e){//invalid sig or pubkey +fSuccess=false;}this.stack.pop();this.stack.pop();// stack.push_back(fSuccess ? vchTrue : vchFalse); +this.stack.push(fSuccess?Interpreter.true:Interpreter.false);if(opcodenum===Opcode.OP_CHECKSIGVERIFY){if(fSuccess){this.stack.pop();}else{this.errstr='SCRIPT_ERR_CHECKSIGVERIFY';return false;}}}break;case Opcode.OP_CHECKMULTISIG:case Opcode.OP_CHECKMULTISIGVERIFY:{// ([sig ...] num_of_signatures [pubkey ...] num_of_pubkeys -- bool) +var i=1;if(this.stack.length20){this.errstr='SCRIPT_ERR_PUBKEY_COUNT';return false;}this.nOpCount+=nKeysCount;if(this.nOpCount>201){this.errstr='SCRIPT_ERR_OP_COUNT';return false;}// int ikey = ++i; +var ikey=++i;i+=nKeysCount;if(this.stack.lengthnKeysCount){this.errstr='SCRIPT_ERR_SIG_COUNT';return false;}// int isig = ++i; +var isig=++i;i+=nSigsCount;if(this.stack.length0){// valtype& vchSig = stacktop(-isig); +bufSig=this.stack[this.stack.length-isig];// valtype& vchPubKey = stacktop(-ikey); +bufPubkey=this.stack[this.stack.length-ikey];if(!this.checkSignatureEncoding(bufSig)||!this.checkPubkeyEncoding(bufPubkey)){return false;}var fOk;try{sig=Signature.fromTxFormat(bufSig);pubkey=PublicKey.fromBuffer(bufPubkey,false);fOk=this.tx.verifySignature(sig,pubkey,this.nin,subscript);}catch(e){//invalid sig or pubkey +fOk=false;}if(fOk){isig++;nSigsCount--;}ikey++;nKeysCount--;// If there are more signatures left than keys left, +// then too many signatures have failed +if(nSigsCount>nKeysCount){fSuccess=false;}}// Clean up stack of actual arguments +while(i-->1){this.stack.pop();}// A bug causes CHECKMULTISIG to consume one extra argument +// whose contents were not checked in any way. +// +// Unfortunately this is a potential source of mutability, +// so optionally verify it is exactly equal to zero prior +// to removing it from the stack. +if(this.stack.length<1){this.errstr='SCRIPT_ERR_INVALID_STACK_OPERATION';return false;}if(this.flags&Interpreter.SCRIPT_VERIFY_NULLDUMMY&&this.stack[this.stack.length-1].length){this.errstr='SCRIPT_ERR_SIG_NULLDUMMY';return false;}this.stack.pop();this.stack.push(fSuccess?Interpreter.true:Interpreter.false);if(opcodenum===Opcode.OP_CHECKMULTISIGVERIFY){if(fSuccess){this.stack.pop();}else{this.errstr='SCRIPT_ERR_CHECKMULTISIGVERIFY';return false;}}}break;default:this.errstr='SCRIPT_ERR_BAD_OPCODE';return false;}}return true;};}).call(this,require("buffer").Buffer);},{"../crypto/bn":84,"../crypto/hash":86,"../crypto/signature":89,"../opcode":101,"../publickey":103,"../transaction":107,"./script":106,"buffer":191,"lodash":149}],106:[function(require,module,exports){(function(Buffer){'use strict';var Address=require('../address');var BufferReader=require('../encoding/bufferreader');var BufferWriter=require('../encoding/bufferwriter');var Hash=require('../crypto/hash');var Opcode=require('../opcode');var PublicKey=require('../publickey');var Signature=require('../crypto/signature');var Networks=require('../networks');var $=require('../util/preconditions');var _=require('lodash');var errors=require('../errors');var buffer=require('buffer');var BufferUtil=require('../util/buffer');var JSUtil=require('../util/js');/** + * A bitcoin transaction script. Each transaction's inputs and outputs + * has a script that is evaluated to validate it's spending. + * + * See https://en.bitcoin.it/wiki/Script + * + * @constructor + * @param {Object|string|Buffer=} from optional data to populate script + */var Script=function Script(from){if(!(this instanceof Script)){return new Script(from);}this.chunks=[];if(BufferUtil.isBuffer(from)){return Script.fromBuffer(from);}else if(from instanceof Address){return Script.fromAddress(from);}else if(from instanceof Script){return Script.fromBuffer(from.toBuffer());}else if(typeof from==='string'){return Script.fromString(from);}else if(typeof from!=='undefined'){this.set(from);}};Script.prototype.set=function(obj){this.chunks=obj.chunks||this.chunks;return this;};Script.fromBuffer=function(buffer){var script=new Script();script.chunks=[];var br=new BufferReader(buffer);while(!br.finished()){try{var opcodenum=br.readUInt8();var len,buf;if(opcodenum>0&&opcodenum0&&opcodenum0){if(asm){str=str+' '+chunk.buf.toString('hex');}else{str=str+' '+chunk.len+' '+'0x'+chunk.buf.toString('hex');}}}return str;};Script.prototype.toASM=function(){var str='';for(var i=0;i';};// script classification methods +/** + * @returns {boolean} if this is a pay to pubkey hash output script + */Script.prototype.isPublicKeyHashOut=function(){return!!(this.chunks.length===5&&this.chunks[0].opcodenum===Opcode.OP_DUP&&this.chunks[1].opcodenum===Opcode.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===Opcode.OP_EQUALVERIFY&&this.chunks[4].opcodenum===Opcode.OP_CHECKSIG);};/** + * @returns {boolean} if this is a pay to public key hash input script + */Script.prototype.isPublicKeyHashIn=function(){if(this.chunks.length===2){var signatureBuf=this.chunks[0].buf;var pubkeyBuf=this.chunks[1].buf;if(signatureBuf&&signatureBuf.length&&signatureBuf[0]===0x30&&pubkeyBuf&&pubkeyBuf.length){var version=pubkeyBuf[0];if((version===0x04||version===0x06||version===0x07)&&pubkeyBuf.length===65){return true;}else if((version===0x03||version===0x02)&&pubkeyBuf.length===33){return true;}}}return false;};Script.prototype.getPublicKey=function(){$.checkState(this.isPublicKeyOut(),'Can\'t retreive PublicKey from a non-PK output');return this.chunks[0].buf;};Script.prototype.getPublicKeyHash=function(){$.checkState(this.isPublicKeyHashOut(),'Can\'t retrieve PublicKeyHash from a non-PKH output');return this.chunks[2].buf;};/** + * @returns {boolean} if this is a public key output script + */Script.prototype.isPublicKeyOut=function(){if(this.chunks.length===2&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===Opcode.OP_CHECKSIG){var pubkeyBuf=this.chunks[0].buf;var version=pubkeyBuf[0];var isVersion=false;if((version===0x04||version===0x06||version===0x07)&&pubkeyBuf.length===65){isVersion=true;}else if((version===0x03||version===0x02)&&pubkeyBuf.length===33){isVersion=true;}if(isVersion){return PublicKey.isValid(pubkeyBuf);}}return false;};/** + * @returns {boolean} if this is a pay to public key input script + */Script.prototype.isPublicKeyIn=function(){if(this.chunks.length===1){var signatureBuf=this.chunks[0].buf;if(signatureBuf&&signatureBuf.length&&signatureBuf[0]===0x30){return true;}}return false;};/** + * @returns {boolean} if this is a p2sh output script + */Script.prototype.isScriptHashOut=function(){var buf=this.toBuffer();return buf.length===23&&buf[0]===Opcode.OP_HASH160&&buf[1]===0x14&&buf[buf.length-1]===Opcode.OP_EQUAL;};/** + * @returns {boolean} if this is a p2sh input script + * Note that these are frequently indistinguishable from pubkeyhashin + */Script.prototype.isScriptHashIn=function(){if(this.chunks.length<=1){return false;}var redeemChunk=this.chunks[this.chunks.length-1];var redeemBuf=redeemChunk.buf;if(!redeemBuf){return false;}var redeemScript;try{redeemScript=Script.fromBuffer(redeemBuf);}catch(e){if(e instanceof errors.Script.InvalidBuffer){return false;}throw e;}var type=redeemScript.classify();return type!==Script.types.UNKNOWN;};/** + * @returns {boolean} if this is a mutlsig output script + */Script.prototype.isMultisigOut=function(){return this.chunks.length>3&&Opcode.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every(function(obj){return obj.buf&&BufferUtil.isBuffer(obj.buf);})&&Opcode.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===Opcode.OP_CHECKMULTISIG;};/** + * @returns {boolean} if this is a multisig input script + */Script.prototype.isMultisigIn=function(){return this.chunks.length>=2&&this.chunks[0].opcodenum===0&&this.chunks.slice(1,this.chunks.length).every(function(obj){return obj.buf&&BufferUtil.isBuffer(obj.buf)&&Signature.isTxDER(obj.buf);});};/** + * @returns {boolean} true if this is a valid standard OP_RETURN output + */Script.prototype.isDataOut=function(){return this.chunks.length>=1&&this.chunks[0].opcodenum===Opcode.OP_RETURN&&(this.chunks.length===1||this.chunks.length===2&&this.chunks[1].buf&&this.chunks[1].buf.length<=Script.OP_RETURN_STANDARD_SIZE&&this.chunks[1].length===this.chunks.len);};/** + * Retrieve the associated data for this script. + * In the case of a pay to public key hash or P2SH, return the hash. + * In the case of a standard OP_RETURN, return the data + * @returns {Buffer} + */Script.prototype.getData=function(){if(this.isDataOut()||this.isScriptHashOut()){if(_.isUndefined(this.chunks[1])){return new Buffer(0);}else{return new Buffer(this.chunks[1].buf);}}if(this.isPublicKeyHashOut()){return new Buffer(this.chunks[2].buf);}throw new Error('Unrecognized script type to get data from');};/** + * @returns {boolean} if the script is only composed of data pushing + * opcodes or small int opcodes (OP_0, OP_1, ..., OP_16) + */Script.prototype.isPushOnly=function(){return _.every(this.chunks,function(chunk){return chunk.opcodenum<=Opcode.OP_16;});};Script.types={};Script.types.UNKNOWN='Unknown';Script.types.PUBKEY_OUT='Pay to public key';Script.types.PUBKEY_IN='Spend from public key';Script.types.PUBKEYHASH_OUT='Pay to public key hash';Script.types.PUBKEYHASH_IN='Spend from public key hash';Script.types.SCRIPTHASH_OUT='Pay to script hash';Script.types.SCRIPTHASH_IN='Spend from script hash';Script.types.MULTISIG_OUT='Pay to multisig';Script.types.MULTISIG_IN='Spend from multisig';Script.types.DATA_OUT='Data push';Script.OP_RETURN_STANDARD_SIZE=80;/** + * @returns {object} The Script type if it is a known form, + * or Script.UNKNOWN if it isn't + */Script.prototype.classify=function(){if(this._isInput){return this.classifyInput();}else if(this._isOutput){return this.classifyOutput();}else{var outputType=this.classifyOutput();return outputType!=Script.types.UNKNOWN?outputType:this.classifyInput();}};Script.outputIdentifiers={};Script.outputIdentifiers.PUBKEY_OUT=Script.prototype.isPublicKeyOut;Script.outputIdentifiers.PUBKEYHASH_OUT=Script.prototype.isPublicKeyHashOut;Script.outputIdentifiers.MULTISIG_OUT=Script.prototype.isMultisigOut;Script.outputIdentifiers.SCRIPTHASH_OUT=Script.prototype.isScriptHashOut;Script.outputIdentifiers.DATA_OUT=Script.prototype.isDataOut;/** + * @returns {object} The Script type if it is a known form, + * or Script.UNKNOWN if it isn't + */Script.prototype.classifyOutput=function(){for(var type in Script.outputIdentifiers){if(Script.outputIdentifiers[type].bind(this)()){return Script.types[type];}}return Script.types.UNKNOWN;};Script.inputIdentifiers={};Script.inputIdentifiers.PUBKEY_IN=Script.prototype.isPublicKeyIn;Script.inputIdentifiers.PUBKEYHASH_IN=Script.prototype.isPublicKeyHashIn;Script.inputIdentifiers.MULTISIG_IN=Script.prototype.isMultisigIn;Script.inputIdentifiers.SCRIPTHASH_IN=Script.prototype.isScriptHashIn;/** + * @returns {object} The Script type if it is a known form, + * or Script.UNKNOWN if it isn't + */Script.prototype.classifyInput=function(){for(var type in Script.inputIdentifiers){if(Script.inputIdentifiers[type].bind(this)()){return Script.types[type];}}return Script.types.UNKNOWN;};/** + * @returns {boolean} if script is one of the known types + */Script.prototype.isStandard=function(){// TODO: Add BIP62 compliance +return this.classify()!==Script.types.UNKNOWN;};// Script construction methods +/** + * Adds a script element at the start of the script. + * @param {*} obj a string, number, Opcode, Buffer, or object to add + * @returns {Script} this script instance + */Script.prototype.prepend=function(obj){this._addByType(obj,true);return this;};/** + * Compares a script with another script + */Script.prototype.equals=function(script){$.checkState(script instanceof Script,'Must provide another script');if(this.chunks.length!==script.chunks.length){return false;}var i;for(i=0;i=0&&len=1&&buf[0]<=16){// Could have used OP_1 .. OP_16. +return opcodenum===Opcode.OP_1+(buf[0]-1);}else if(buf.length===1&&buf[0]===0x81){// Could have used OP_1NEGATE +return opcodenum===Opcode.OP_1NEGATE;}else if(buf.length<=75){// Could have used a direct push (opcode indicating number of bytes pushed + those bytes). +return opcodenum===buf.length;}else if(buf.length<=255){// Could have used OP_PUSHDATA. +return opcodenum===Opcode.OP_PUSHDATA1;}else if(buf.length<=65535){// Could have used OP_PUSHDATA2. +return opcodenum===Opcode.OP_PUSHDATA2;}return true;};/** + * Comes from bitcoind's script DecodeOP_N function + * @param {number} opcode + * @returns {number} numeric value in range of 0 to 16 + */Script.prototype._decodeOP_N=function(opcode){if(opcode===Opcode.OP_0){return 0;}else if(opcode>=Opcode.OP_1&&opcode<=Opcode.OP_16){return opcode-(Opcode.OP_1-1);}else{throw new Error('Invalid opcode: '+JSON.stringify(opcode));}};/** + * Comes from bitcoind's script GetSigOpCount(boolean) function + * @param {boolean} use current (true) or pre-version-0.6 (false) logic + * @returns {number} number of signature operations required by this script + */Script.prototype.getSignatureOperationsCount=function(accurate){accurate=_.isUndefined(accurate)?true:accurate;var self=this;var n=0;var lastOpcode=Opcode.OP_INVALIDOPCODE;_.each(self.chunks,function getChunk(chunk){var opcode=chunk.opcodenum;if(opcode==Opcode.OP_CHECKSIG||opcode==Opcode.OP_CHECKSIGVERIFY){n++;}else if(opcode==Opcode.OP_CHECKMULTISIG||opcode==Opcode.OP_CHECKMULTISIGVERIFY){if(accurate&&lastOpcode>=Opcode.OP_1&&lastOpcode<=Opcode.OP_16){n+=self._decodeOP_N(lastOpcode);}else{n+=20;}}lastOpcode=opcode;});return n;};module.exports=Script;}).call(this,require("buffer").Buffer);},{"../address":79,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../networks":100,"../opcode":101,"../publickey":103,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"buffer":191,"lodash":149}],107:[function(require,module,exports){module.exports=require('./transaction');module.exports.Input=require('./input');module.exports.Output=require('./output');module.exports.UnspentOutput=require('./unspentoutput');module.exports.Signature=require('./signature');module.exports.Sighash=require('./sighash');},{"./input":108,"./output":114,"./sighash":115,"./signature":116,"./transaction":117,"./unspentoutput":118}],108:[function(require,module,exports){module.exports=require('./input');module.exports.PublicKey=require('./publickey');module.exports.PublicKeyHash=require('./publickeyhash');module.exports.MultiSig=require('./multisig.js');module.exports.MultiSigScriptHash=require('./multisigscripthash.js');},{"./input":109,"./multisig.js":110,"./multisigscripthash.js":111,"./publickey":112,"./publickeyhash":113}],109:[function(require,module,exports){'use strict';var _=require('lodash');var $=require('../../util/preconditions');var errors=require('../../errors');var BufferWriter=require('../../encoding/bufferwriter');var buffer=require('buffer');var BufferUtil=require('../../util/buffer');var JSUtil=require('../../util/js');var Script=require('../../script');var Sighash=require('../sighash');var Output=require('../output');var MAXINT=0xffffffff;// Math.pow(2, 32) - 1; +var DEFAULT_RBF_SEQNUMBER=MAXINT-2;var DEFAULT_SEQNUMBER=MAXINT;var DEFAULT_LOCKTIME_SEQNUMBER=MAXINT-1;function Input(params){if(!(this instanceof Input)){return new Input(params);}if(params){return this._fromObject(params);}}Input.MAXINT=MAXINT;Input.DEFAULT_SEQNUMBER=DEFAULT_SEQNUMBER;Input.DEFAULT_LOCKTIME_SEQNUMBER=DEFAULT_LOCKTIME_SEQNUMBER;Input.DEFAULT_RBF_SEQNUMBER=DEFAULT_RBF_SEQNUMBER;Object.defineProperty(Input.prototype,'script',{configurable:false,enumerable:true,get:function get(){if(this.isNull()){return null;}if(!this._script){this._script=new Script(this._scriptBuffer);this._script._isInput=true;}return this._script;}});Input.fromObject=function(obj){$.checkArgument(_.isObject(obj));var input=new Input();return input._fromObject(obj);};Input.prototype._fromObject=function(params){var prevTxId;if(_.isString(params.prevTxId)&&JSUtil.isHexa(params.prevTxId)){prevTxId=new buffer.Buffer(params.prevTxId,'hex');}else{prevTxId=params.prevTxId;}this.output=params.output?params.output instanceof Output?params.output:new Output(params.output):undefined;this.prevTxId=prevTxId||params.txidbuf;this.outputIndex=_.isUndefined(params.outputIndex)?params.txoutnum:params.outputIndex;this.sequenceNumber=_.isUndefined(params.sequenceNumber)?_.isUndefined(params.seqnum)?DEFAULT_SEQNUMBER:params.seqnum:params.sequenceNumber;if(_.isUndefined(params.script)&&_.isUndefined(params.scriptBuffer)){throw new errors.Transaction.Input.MissingScript();}this.setScript(params.scriptBuffer||params.script);return this;};Input.prototype.toObject=Input.prototype.toJSON=function toObject(){var obj={prevTxId:this.prevTxId.toString('hex'),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString('hex')};// add human readable form if input contains valid script +if(this.script){obj.scriptString=this.script.toString();}if(this.output){obj.output=this.output.toObject();}return obj;};Input.fromBufferReader=function(br){var input=new Input();input.prevTxId=br.readReverse(32);input.outputIndex=br.readUInt32LE();input._scriptBuffer=br.readVarLengthBuffer();input.sequenceNumber=br.readUInt32LE();// TODO: return different classes according to which input it is +// e.g: CoinbaseInput, PublicKeyHashInput, MultiSigScriptHashInput, etc. +return input;};Input.prototype.toBufferWriter=function(writer){if(!writer){writer=new BufferWriter();}writer.writeReverse(this.prevTxId);writer.writeUInt32LE(this.outputIndex);var script=this._scriptBuffer;writer.writeVarintNum(script.length);writer.write(script);writer.writeUInt32LE(this.sequenceNumber);return writer;};Input.prototype.setScript=function(script){this._script=null;if(script instanceof Script){this._script=script;this._script._isInput=true;this._scriptBuffer=script.toBuffer();}else if(JSUtil.isHexa(script)){// hex string script +this._scriptBuffer=new buffer.Buffer(script,'hex');}else if(_.isString(script)){// human readable string script +this._script=new Script(script);this._script._isInput=true;this._scriptBuffer=this._script.toBuffer();}else if(BufferUtil.isBuffer(script)){// buffer script +this._scriptBuffer=new buffer.Buffer(script);}else{throw new TypeError('Invalid argument type: script');}return this;};/** + * Retrieve signatures for the provided PrivateKey. + * + * @param {Transaction} transaction - the transaction to be signed + * @param {PrivateKey} privateKey - the private key to use when signing + * @param {number} inputIndex - the index of this input in the provided transaction + * @param {number} sigType - defaults to Signature.SIGHASH_ALL + * @param {Buffer} addressHash - if provided, don't calculate the hash of the + * public key associated with the private key provided + * @abstract + */Input.prototype.getSignatures=function(){throw new errors.AbstractMethodInvoked('Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported)'+' for input: '+JSON.stringify(this));};Input.prototype.isFullySigned=function(){throw new errors.AbstractMethodInvoked('Input#isFullySigned');};Input.prototype.isFinal=function(){return this.sequenceNumber!==4294967295;};Input.prototype.addSignature=function(){throw new errors.AbstractMethodInvoked('Input#addSignature');};Input.prototype.clearSignatures=function(){throw new errors.AbstractMethodInvoked('Input#clearSignatures');};Input.prototype.isValidSignature=function(transaction,signature){// FIXME: Refactor signature so this is not necessary +signature.signature.nhashtype=signature.sigtype;return Sighash.verify(transaction,signature.signature,signature.publicKey,signature.inputIndex,this.output.script);};/** + * @returns true if this is a coinbase input (represents no input) + */Input.prototype.isNull=function(){return this.prevTxId.toString('hex')==='0000000000000000000000000000000000000000000000000000000000000000'&&this.outputIndex===0xffffffff;};Input.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length;};module.exports=Input;},{"../../encoding/bufferwriter":93,"../../errors":95,"../../script":104,"../../util/buffer":121,"../../util/js":122,"../../util/preconditions":123,"../output":114,"../sighash":115,"buffer":191,"lodash":149}],110:[function(require,module,exports){'use strict';var _=require('lodash');var inherits=require('inherits');var Transaction=require('../transaction');var Input=require('./input');var Output=require('../output');var $=require('../../util/preconditions');var Script=require('../../script');var Signature=require('../../crypto/signature');var Sighash=require('../sighash');var PublicKey=require('../../publickey');var BufferUtil=require('../../util/buffer');var TransactionSignature=require('../signature');/** + * @constructor + */function MultiSigInput(input,pubkeys,threshold,signatures){Input.apply(this,arguments);var self=this;pubkeys=pubkeys||input.publicKeys;threshold=threshold||input.threshold;signatures=signatures||input.signatures;this.publicKeys=_.sortBy(pubkeys,function(publicKey){return publicKey.toString('hex');});$.checkState(Script.buildMultisigOut(this.publicKeys,threshold).equals(this.output.script),'Provided public keys don\'t match to the provided output script');this.publicKeyIndex={};_.each(this.publicKeys,function(publicKey,index){self.publicKeyIndex[publicKey.toString()]=index;});this.threshold=threshold;// Empty array of signatures +this.signatures=signatures?this._deserializeSignatures(signatures):new Array(this.publicKeys.length);}inherits(MultiSigInput,Input);MultiSigInput.prototype.toObject=function(){var obj=Input.prototype.toObject.apply(this,arguments);obj.threshold=this.threshold;obj.publicKeys=_.map(this.publicKeys,function(publicKey){return publicKey.toString();});obj.signatures=this._serializeSignatures();return obj;};MultiSigInput.prototype._deserializeSignatures=function(signatures){return _.map(signatures,function(signature){if(!signature){return undefined;}return new TransactionSignature(signature);});};MultiSigInput.prototype._serializeSignatures=function(){return _.map(this.signatures,function(signature){if(!signature){return undefined;}return signature.toObject();});};MultiSigInput.prototype.getSignatures=function(transaction,privateKey,index,sigtype){$.checkState(this.output instanceof Output);sigtype=sigtype||Signature.SIGHASH_ALL;var self=this;var results=[];_.each(this.publicKeys,function(publicKey){if(publicKey.toString()===privateKey.publicKey.toString()){results.push(new TransactionSignature({publicKey:privateKey.publicKey,prevTxId:self.prevTxId,outputIndex:self.outputIndex,inputIndex:index,signature:Sighash.sign(transaction,privateKey,sigtype,index,self.output.script),sigtype:sigtype}));}});return results;};MultiSigInput.prototype.addSignature=function(transaction,signature){$.checkState(!this.isFullySigned(),'All needed signatures have already been added');$.checkArgument(!_.isUndefined(this.publicKeyIndex[signature.publicKey.toString()]),'Signature has no matching public key');$.checkState(this.isValidSignature(transaction,signature));this.signatures[this.publicKeyIndex[signature.publicKey.toString()]]=signature;this._updateScript();return this;};MultiSigInput.prototype._updateScript=function(){this.setScript(Script.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures()));return this;};MultiSigInput.prototype._createSignatures=function(){return _.map(_.filter(this.signatures,function(signature){return!_.isUndefined(signature);}),function(signature){return BufferUtil.concat([signature.signature.toDER(),BufferUtil.integerAsSingleByteBuffer(signature.sigtype)]);});};MultiSigInput.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length);this._updateScript();};MultiSigInput.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold;};MultiSigInput.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures();};MultiSigInput.prototype.countSignatures=function(){return _.reduce(this.signatures,function(sum,signature){return sum+!!signature;},0);};MultiSigInput.prototype.publicKeysWithoutSignature=function(){var self=this;return _.filter(this.publicKeys,function(publicKey){return!self.signatures[self.publicKeyIndex[publicKey.toString()]];});};MultiSigInput.prototype.isValidSignature=function(transaction,signature){// FIXME: Refactor signature so this is not necessary +signature.signature.nhashtype=signature.sigtype;return Sighash.verify(transaction,signature.signature,signature.publicKey,signature.inputIndex,this.output.script);};/** + * + * @param {Buffer[]} signatures + * @param {PublicKey[]} publicKeys + * @param {Transaction} transaction + * @param {Integer} inputIndex + * @param {Input} input + * @returns {TransactionSignature[]} + */MultiSigInput.normalizeSignatures=function(transaction,input,inputIndex,signatures,publicKeys){return publicKeys.map(function(pubKey){var signatureMatch=null;signatures=signatures.filter(function(signatureBuffer){if(signatureMatch){return true;}var signature=new TransactionSignature({signature:Signature.fromTxFormat(signatureBuffer),publicKey:pubKey,prevTxId:input.prevTxId,outputIndex:input.outputIndex,inputIndex:inputIndex,sigtype:Signature.SIGHASH_ALL});signature.signature.nhashtype=signature.sigtype;var isMatch=Sighash.verify(transaction,signature.signature,signature.publicKey,signature.inputIndex,input.output.script);if(isMatch){signatureMatch=signature;return false;}return true;});return signatureMatch?signatureMatch:null;});};MultiSigInput.OPCODES_SIZE=1;// 0 +MultiSigInput.SIGNATURE_SIZE=73;// size (1) + DER (<=72) +MultiSigInput.prototype._estimateSize=function(){return MultiSigInput.OPCODES_SIZE+this.threshold*MultiSigInput.SIGNATURE_SIZE;};module.exports=MultiSigInput;},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"../transaction":117,"./input":109,"inherits":148,"lodash":149}],111:[function(require,module,exports){'use strict';var _=require('lodash');var inherits=require('inherits');var Input=require('./input');var Output=require('../output');var $=require('../../util/preconditions');var Script=require('../../script');var Signature=require('../../crypto/signature');var Sighash=require('../sighash');var PublicKey=require('../../publickey');var BufferUtil=require('../../util/buffer');var TransactionSignature=require('../signature');/** + * @constructor + */function MultiSigScriptHashInput(input,pubkeys,threshold,signatures){Input.apply(this,arguments);var self=this;pubkeys=pubkeys||input.publicKeys;threshold=threshold||input.threshold;signatures=signatures||input.signatures;this.publicKeys=_.sortBy(pubkeys,function(publicKey){return publicKey.toString('hex');});this.redeemScript=Script.buildMultisigOut(this.publicKeys,threshold);$.checkState(Script.buildScriptHashOut(this.redeemScript).equals(this.output.script),'Provided public keys don\'t hash to the provided output');this.publicKeyIndex={};_.each(this.publicKeys,function(publicKey,index){self.publicKeyIndex[publicKey.toString()]=index;});this.threshold=threshold;// Empty array of signatures +this.signatures=signatures?this._deserializeSignatures(signatures):new Array(this.publicKeys.length);}inherits(MultiSigScriptHashInput,Input);MultiSigScriptHashInput.prototype.toObject=function(){var obj=Input.prototype.toObject.apply(this,arguments);obj.threshold=this.threshold;obj.publicKeys=_.map(this.publicKeys,function(publicKey){return publicKey.toString();});obj.signatures=this._serializeSignatures();return obj;};MultiSigScriptHashInput.prototype._deserializeSignatures=function(signatures){return _.map(signatures,function(signature){if(!signature){return undefined;}return new TransactionSignature(signature);});};MultiSigScriptHashInput.prototype._serializeSignatures=function(){return _.map(this.signatures,function(signature){if(!signature){return undefined;}return signature.toObject();});};MultiSigScriptHashInput.prototype.getSignatures=function(transaction,privateKey,index,sigtype){$.checkState(this.output instanceof Output);sigtype=sigtype||Signature.SIGHASH_ALL;var self=this;var results=[];_.each(this.publicKeys,function(publicKey){if(publicKey.toString()===privateKey.publicKey.toString()){results.push(new TransactionSignature({publicKey:privateKey.publicKey,prevTxId:self.prevTxId,outputIndex:self.outputIndex,inputIndex:index,signature:Sighash.sign(transaction,privateKey,sigtype,index,self.redeemScript),sigtype:sigtype}));}});return results;};MultiSigScriptHashInput.prototype.addSignature=function(transaction,signature){$.checkState(!this.isFullySigned(),'All needed signatures have already been added');$.checkArgument(!_.isUndefined(this.publicKeyIndex[signature.publicKey.toString()]),'Signature has no matching public key');$.checkState(this.isValidSignature(transaction,signature));this.signatures[this.publicKeyIndex[signature.publicKey.toString()]]=signature;this._updateScript();return this;};MultiSigScriptHashInput.prototype._updateScript=function(){this.setScript(Script.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript}));return this;};MultiSigScriptHashInput.prototype._createSignatures=function(){return _.map(_.filter(this.signatures,function(signature){return!_.isUndefined(signature);}),function(signature){return BufferUtil.concat([signature.signature.toDER(),BufferUtil.integerAsSingleByteBuffer(signature.sigtype)]);});};MultiSigScriptHashInput.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length);this._updateScript();};MultiSigScriptHashInput.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold;};MultiSigScriptHashInput.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures();};MultiSigScriptHashInput.prototype.countSignatures=function(){return _.reduce(this.signatures,function(sum,signature){return sum+!!signature;},0);};MultiSigScriptHashInput.prototype.publicKeysWithoutSignature=function(){var self=this;return _.filter(this.publicKeys,function(publicKey){return!self.signatures[self.publicKeyIndex[publicKey.toString()]];});};MultiSigScriptHashInput.prototype.isValidSignature=function(transaction,signature){// FIXME: Refactor signature so this is not necessary +signature.signature.nhashtype=signature.sigtype;return Sighash.verify(transaction,signature.signature,signature.publicKey,signature.inputIndex,this.redeemScript);};MultiSigScriptHashInput.OPCODES_SIZE=7;// serialized size (<=3) + 0 .. N .. M OP_CHECKMULTISIG +MultiSigScriptHashInput.SIGNATURE_SIZE=74;// size (1) + DER (<=72) + sighash (1) +MultiSigScriptHashInput.PUBKEY_SIZE=34;// size (1) + DER (<=33) +MultiSigScriptHashInput.prototype._estimateSize=function(){return MultiSigScriptHashInput.OPCODES_SIZE+this.threshold*MultiSigScriptHashInput.SIGNATURE_SIZE+this.publicKeys.length*MultiSigScriptHashInput.PUBKEY_SIZE;};module.exports=MultiSigScriptHashInput;},{"../../crypto/signature":89,"../../publickey":103,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,"inherits":148,"lodash":149}],112:[function(require,module,exports){'use strict';var inherits=require('inherits');var $=require('../../util/preconditions');var BufferUtil=require('../../util/buffer');var Input=require('./input');var Output=require('../output');var Sighash=require('../sighash');var Script=require('../../script');var Signature=require('../../crypto/signature');var TransactionSignature=require('../signature');/** + * Represents a special kind of input of PayToPublicKey kind. + * @constructor + */function PublicKeyInput(){Input.apply(this,arguments);}inherits(PublicKeyInput,Input);/** + * @param {Transaction} transaction - the transaction to be signed + * @param {PrivateKey} privateKey - the private key with which to sign the transaction + * @param {number} index - the index of the input in the transaction input vector + * @param {number=} sigtype - the type of signature, defaults to Signature.SIGHASH_ALL + * @return {Array} of objects that can be + */PublicKeyInput.prototype.getSignatures=function(transaction,privateKey,index,sigtype){$.checkState(this.output instanceof Output);sigtype=sigtype||Signature.SIGHASH_ALL;var publicKey=privateKey.toPublicKey();if(publicKey.toString()===this.output.script.getPublicKey().toString('hex')){return[new TransactionSignature({publicKey:publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:index,signature:Sighash.sign(transaction,privateKey,sigtype,index,this.output.script),sigtype:sigtype})];}return[];};/** + * Add the provided signature + * + * @param {Object} signature + * @param {PublicKey} signature.publicKey + * @param {Signature} signature.signature + * @param {number=} signature.sigtype + * @return {PublicKeyInput} this, for chaining + */PublicKeyInput.prototype.addSignature=function(transaction,signature){$.checkState(this.isValidSignature(transaction,signature),'Signature is invalid');this.setScript(Script.buildPublicKeyIn(signature.signature.toDER(),signature.sigtype));return this;};/** + * Clear the input's signature + * @return {PublicKeyHashInput} this, for chaining + */PublicKeyInput.prototype.clearSignatures=function(){this.setScript(Script.empty());return this;};/** + * Query whether the input is signed + * @return {boolean} + */PublicKeyInput.prototype.isFullySigned=function(){return this.script.isPublicKeyIn();};PublicKeyInput.SCRIPT_MAX_SIZE=73;// sigsize (1 + 72) +PublicKeyInput.prototype._estimateSize=function(){return PublicKeyInput.SCRIPT_MAX_SIZE;};module.exports=PublicKeyInput;},{"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,"inherits":148}],113:[function(require,module,exports){'use strict';var inherits=require('inherits');var $=require('../../util/preconditions');var BufferUtil=require('../../util/buffer');var Hash=require('../../crypto/hash');var Input=require('./input');var Output=require('../output');var Sighash=require('../sighash');var Script=require('../../script');var Signature=require('../../crypto/signature');var TransactionSignature=require('../signature');/** + * Represents a special kind of input of PayToPublicKeyHash kind. + * @constructor + */function PublicKeyHashInput(){Input.apply(this,arguments);}inherits(PublicKeyHashInput,Input);/* jshint maxparams: 5 *//** + * @param {Transaction} transaction - the transaction to be signed + * @param {PrivateKey} privateKey - the private key with which to sign the transaction + * @param {number} index - the index of the input in the transaction input vector + * @param {number=} sigtype - the type of signature, defaults to Signature.SIGHASH_ALL + * @param {Buffer=} hashData - the precalculated hash of the public key associated with the privateKey provided + * @return {Array} of objects that can be + */PublicKeyHashInput.prototype.getSignatures=function(transaction,privateKey,index,sigtype,hashData){$.checkState(this.output instanceof Output);hashData=hashData||Hash.sha256ripemd160(privateKey.publicKey.toBuffer());sigtype=sigtype||Signature.SIGHASH_ALL;if(BufferUtil.equals(hashData,this.output.script.getPublicKeyHash())){return[new TransactionSignature({publicKey:privateKey.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:index,signature:Sighash.sign(transaction,privateKey,sigtype,index,this.output.script),sigtype:sigtype})];}return[];};/* jshint maxparams: 3 *//** + * Add the provided signature + * + * @param {Object} signature + * @param {PublicKey} signature.publicKey + * @param {Signature} signature.signature + * @param {number=} signature.sigtype + * @return {PublicKeyHashInput} this, for chaining + */PublicKeyHashInput.prototype.addSignature=function(transaction,signature){$.checkState(this.isValidSignature(transaction,signature),'Signature is invalid');this.setScript(Script.buildPublicKeyHashIn(signature.publicKey,signature.signature.toDER(),signature.sigtype));return this;};/** + * Clear the input's signature + * @return {PublicKeyHashInput} this, for chaining + */PublicKeyHashInput.prototype.clearSignatures=function(){this.setScript(Script.empty());return this;};/** + * Query whether the input is signed + * @return {boolean} + */PublicKeyHashInput.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn();};PublicKeyHashInput.SCRIPT_MAX_SIZE=73+34;// sigsize (1 + 72) + pubkey (1 + 33) +PublicKeyHashInput.prototype._estimateSize=function(){return PublicKeyHashInput.SCRIPT_MAX_SIZE;};module.exports=PublicKeyHashInput;},{"../../crypto/hash":86,"../../crypto/signature":89,"../../script":104,"../../util/buffer":121,"../../util/preconditions":123,"../output":114,"../sighash":115,"../signature":116,"./input":109,"inherits":148}],114:[function(require,module,exports){'use strict';var _=require('lodash');var BN=require('../crypto/bn');var buffer=require('buffer');var bufferUtil=require('../util/buffer');var JSUtil=require('../util/js');var BufferWriter=require('../encoding/bufferwriter');var Script=require('../script');var $=require('../util/preconditions');var errors=require('../errors');var MAX_SAFE_INTEGER=0x1fffffffffffff;function Output(args){if(!(this instanceof Output)){return new Output(args);}if(_.isObject(args)){this.satoshis=args.satoshis;if(bufferUtil.isBuffer(args.script)){this._scriptBuffer=args.script;}else{var script;if(_.isString(args.script)&&JSUtil.isHexa(args.script)){script=new buffer.Buffer(args.script,'hex');}else{script=args.script;}this.setScript(script);}}else{throw new TypeError('Unrecognized argument for Output');}}Object.defineProperty(Output.prototype,'script',{configurable:false,enumerable:true,get:function get(){if(this._script){return this._script;}else{this.setScriptFromBuffer(this._scriptBuffer);return this._script;}}});Object.defineProperty(Output.prototype,'satoshis',{configurable:false,enumerable:true,get:function get(){return this._satoshis;},set:function set(num){if(num instanceof BN){this._satoshisBN=num;this._satoshis=num.toNumber();}else if(_.isString(num)){this._satoshis=parseInt(num);this._satoshisBN=BN.fromNumber(this._satoshis);}else{$.checkArgument(JSUtil.isNaturalNumber(num),'Output satoshis is not a natural number');this._satoshisBN=BN.fromNumber(num);this._satoshis=num;}$.checkState(JSUtil.isNaturalNumber(this._satoshis),'Output satoshis is not a natural number');}});Output.prototype.invalidSatoshis=function(){if(this._satoshis>MAX_SAFE_INTEGER){return'transaction txout satoshis greater than max safe integer';}if(this._satoshis!==this._satoshisBN.toNumber()){return'transaction txout satoshis has corrupted value';}if(this._satoshis<0){return'transaction txout negative';}return false;};Output.prototype.toObject=Output.prototype.toJSON=function toObject(){var obj={satoshis:this.satoshis};obj.script=this._scriptBuffer.toString('hex');return obj;};Output.fromObject=function(data){return new Output(data);};Output.prototype.setScriptFromBuffer=function(buffer){this._scriptBuffer=buffer;try{this._script=Script.fromBuffer(this._scriptBuffer);this._script._isOutput=true;}catch(e){if(e instanceof errors.Script.InvalidBuffer){this._script=null;}else{throw e;}}};Output.prototype.setScript=function(script){if(script instanceof Script){this._scriptBuffer=script.toBuffer();this._script=script;this._script._isOutput=true;}else if(_.isString(script)){this._script=Script.fromString(script);this._scriptBuffer=this._script.toBuffer();this._script._isOutput=true;}else if(bufferUtil.isBuffer(script)){this.setScriptFromBuffer(script);}else{throw new TypeError('Invalid argument type: script');}return this;};Output.prototype.inspect=function(){var scriptStr;if(this.script){scriptStr=this.script.inspect();}else{scriptStr=this._scriptBuffer.toString('hex');}return'';};Output.fromBufferReader=function(br){var obj={};obj.satoshis=br.readUInt64LEBN();var size=br.readVarintNum();if(size!==0){obj.script=br.read(size);}else{obj.script=new buffer.Buffer([]);}return new Output(obj);};Output.prototype.toBufferWriter=function(writer){if(!writer){writer=new BufferWriter();}writer.writeUInt64LEBN(this._satoshisBN);var script=this._scriptBuffer;writer.writeVarintNum(script.length);writer.write(script);return writer;};module.exports=Output;},{"../crypto/bn":84,"../encoding/bufferwriter":93,"../errors":95,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"buffer":191,"lodash":149}],115:[function(require,module,exports){(function(Buffer){'use strict';var buffer=require('buffer');var Signature=require('../crypto/signature');var Script=require('../script');var Output=require('./output');var BufferReader=require('../encoding/bufferreader');var BufferWriter=require('../encoding/bufferwriter');var BN=require('../crypto/bn');var Hash=require('../crypto/hash');var ECDSA=require('../crypto/ecdsa');var $=require('../util/preconditions');var _=require('lodash');var SIGHASH_SINGLE_BUG='0000000000000000000000000000000000000000000000000000000000000001';var BITS_64_ON='ffffffffffffffff';/** + * Returns a buffer of length 32 bytes with the hash that needs to be signed + * for OP_CHECKSIG. + * + * @name Signing.sighash + * @param {Transaction} transaction the transaction to sign + * @param {number} sighashType the type of the hash + * @param {number} inputNumber the input index for the signature + * @param {Script} subscript the script that will be signed + */var sighash=function sighash(transaction,sighashType,inputNumber,subscript){var Transaction=require('./transaction');var Input=require('./input');var i;// Copy transaction +var txcopy=Transaction.shallowCopy(transaction);// Copy script +subscript=new Script(subscript);subscript.removeCodeseparators();for(i=0;i=txcopy.outputs.length){return new Buffer(SIGHASH_SINGLE_BUG,'hex');}txcopy.outputs.length=inputNumber+1;for(i=0;imaximumFee){if(this._missingChange()){return new errors.Transaction.ChangeAddressMissing('Fee is too large and no change address was provided');}return new errors.Transaction.FeeError.TooLarge('expected less than '+maximumFee+' but got '+unspent);}}if(!opts.disableSmallFees){var minimumFee=Math.ceil(this._estimateFee()/Transaction.FEE_SECURITY_MARGIN);if(unspent';};Transaction.prototype.toBuffer=function(){var writer=new BufferWriter();return this.toBufferWriter(writer).toBuffer();};Transaction.prototype.toBufferWriter=function(writer){writer.writeUInt32LE(this.version);writer.writeVarintNum(this.inputs.length);_.each(this.inputs,function(input){input.toBufferWriter(writer);});writer.writeVarintNum(this.outputs.length);_.each(this.outputs,function(output){output.toBufferWriter(writer);});writer.writeUInt32LE(this.nLockTime);return writer;};Transaction.prototype.fromBuffer=function(buffer){var reader=new BufferReader(buffer);return this.fromBufferReader(reader);};Transaction.prototype.fromBufferReader=function(reader){$.checkArgument(!reader.finished(),'No transaction data received');var i,sizeTxIns,sizeTxOuts;this.version=reader.readUInt32LE();sizeTxIns=reader.readVarintNum();for(i=0;i=Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT){throw new errors.Transaction.BlockHeightTooHigh();}if(height<0){throw new errors.Transaction.NLockTimeOutOfRange();}for(var i=0;i|Transaction~fromObject)} utxo + * @param {Array=} pubkeys + * @param {number=} threshold + */Transaction.prototype.from=function(utxo,pubkeys,threshold){if(_.isArray(utxo)){var self=this;_.each(utxo,function(utxo){self.from(utxo,pubkeys,threshold);});return this;}var exists=_.any(this.inputs,function(input){// TODO: Maybe prevTxId should be a string? Or defined as read only property? +return input.prevTxId.toString('hex')===utxo.txId&&input.outputIndex===utxo.outputIndex;});if(exists){return this;}if(pubkeys&&threshold){this._fromMultisigUtxo(utxo,pubkeys,threshold);}else{this._fromNonP2SH(utxo);}return this;};Transaction.prototype._fromNonP2SH=function(utxo){var clazz;utxo=new UnspentOutput(utxo);if(utxo.script.isPublicKeyHashOut()){clazz=PublicKeyHashInput;}else if(utxo.script.isPublicKeyOut()){clazz=PublicKeyInput;}else{clazz=Input;}this.addInput(new clazz({output:new Output({script:utxo.script,satoshis:utxo.satoshis}),prevTxId:utxo.txId,outputIndex:utxo.outputIndex,script:Script.empty()}));};Transaction.prototype._fromMultisigUtxo=function(utxo,pubkeys,threshold){$.checkArgument(threshold<=pubkeys.length,'Number of required signatures must be greater than the number of public keys');var clazz;utxo=new UnspentOutput(utxo);if(utxo.script.isMultisigOut()){clazz=MultiSigInput;}else if(utxo.script.isScriptHashOut()){clazz=MultiSigScriptHashInput;}else{throw new Error("@TODO");}this.addInput(new clazz({output:new Output({script:utxo.script,satoshis:utxo.satoshis}),prevTxId:utxo.txId,outputIndex:utxo.outputIndex,script:Script.empty()},pubkeys,threshold));};/** + * Add an input to this transaction. The input must be an instance of the `Input` class. + * It should have information about the Output that it's spending, but if it's not already + * set, two additional parameters, `outputScript` and `satoshis` can be provided. + * + * @param {Input} input + * @param {String|Script} outputScript + * @param {number} satoshis + * @return Transaction this, for chaining + */Transaction.prototype.addInput=function(input,outputScript,satoshis){$.checkArgumentType(input,Input,'input');if(!input.output&&(_.isUndefined(outputScript)||_.isUndefined(satoshis))){throw new errors.Transaction.NeedMoreInfo('Need information about the UTXO script and satoshis');}if(!input.output&&outputScript&&!_.isUndefined(satoshis)){outputScript=outputScript instanceof Script?outputScript:new Script(outputScript);$.checkArgumentType(satoshis,'number','satoshis');input.output=new Output({script:outputScript,satoshis:satoshis});}return this.uncheckedAddInput(input);};/** + * Add an input to this transaction, without checking that the input has information about + * the output that it's spending. + * + * @param {Input} input + * @return Transaction this, for chaining + */Transaction.prototype.uncheckedAddInput=function(input){$.checkArgumentType(input,Input,'input');this.inputs.push(input);this._inputAmount=undefined;this._updateChangeOutput();return this;};/** + * Returns true if the transaction has enough info on all inputs to be correctly validated + * + * @return {boolean} + */Transaction.prototype.hasAllUtxoInfo=function(){return _.all(this.inputs.map(function(input){return!!input.output;}));};/** + * Manually set the fee for this transaction. Beware that this resets all the signatures + * for inputs (in further versions, SIGHASH_SINGLE or SIGHASH_NONE signatures will not + * be reset). + * + * @param {number} amount satoshis to be sent + * @return {Transaction} this, for chaining + */Transaction.prototype.fee=function(amount){$.checkArgument(_.isNumber(amount),'amount must be a number');this._fee=amount;this._updateChangeOutput();return this;};/** + * Manually set the fee per KB for this transaction. Beware that this resets all the signatures + * for inputs (in further versions, SIGHASH_SINGLE or SIGHASH_NONE signatures will not + * be reset). + * + * @param {number} amount satoshis per KB to be sent + * @return {Transaction} this, for chaining + */Transaction.prototype.feePerKb=function(amount){$.checkArgument(_.isNumber(amount),'amount must be a number');this._feePerKb=amount;this._updateChangeOutput();return this;};/* Output management *//** + * Set the change address for this transaction + * + * Beware that this resets all the signatures for inputs (in further versions, + * SIGHASH_SINGLE or SIGHASH_NONE signatures will not be reset). + * + * @param {Address} address An address for change to be sent to. + * @return {Transaction} this, for chaining + */Transaction.prototype.change=function(address){$.checkArgument(address,'address is required');this._changeScript=Script.fromAddress(address);this._updateChangeOutput();return this;};/** + * @return {Output} change output, if it exists + */Transaction.prototype.getChangeOutput=function(){if(!_.isUndefined(this._changeIndex)){return this.outputs[this._changeIndex];}return null;};/** + * @typedef {Object} Transaction~toObject + * @property {(string|Address)} address + * @property {number} satoshis + *//** + * Add an output to the transaction. + * + * Beware that this resets all the signatures for inputs (in further versions, + * SIGHASH_SINGLE or SIGHASH_NONE signatures will not be reset). + * + * @param {(string|Address|Array.)} address + * @param {number} amount in satoshis + * @return {Transaction} this, for chaining + */Transaction.prototype.to=function(address,amount){if(_.isArray(address)){var self=this;_.each(address,function(to){self.to(to.address,to.satoshis);});return this;}$.checkArgument(JSUtil.isNaturalNumber(amount),'Amount is expected to be a positive integer');this.addOutput(new Output({script:Script(new Address(address)),satoshis:amount}));return this;};/** + * Add an OP_RETURN output to the transaction. + * + * Beware that this resets all the signatures for inputs (in further versions, + * SIGHASH_SINGLE or SIGHASH_NONE signatures will not be reset). + * + * @param {Buffer|string} value the data to be stored in the OP_RETURN output. + * In case of a string, the UTF-8 representation will be stored + * @return {Transaction} this, for chaining + */Transaction.prototype.addData=function(value){this.addOutput(new Output({script:Script.buildDataOut(value),satoshis:0}));return this;};/** + * Add an output to the transaction. + * + * @param {Output} output the output to add. + * @return {Transaction} this, for chaining + */Transaction.prototype.addOutput=function(output){$.checkArgumentType(output,Output,'output');this._addOutput(output);this._updateChangeOutput();return this;};/** + * Remove all outputs from the transaction. + * + * @return {Transaction} this, for chaining + */Transaction.prototype.clearOutputs=function(){this.outputs=[];this._clearSignatures();this._outputAmount=undefined;this._changeIndex=undefined;this._updateChangeOutput();return this;};Transaction.prototype._addOutput=function(output){this.outputs.push(output);this._outputAmount=undefined;};/** + * Calculates or gets the total output amount in satoshis + * + * @return {Number} the transaction total output amount + */Transaction.prototype._getOutputAmount=function(){if(_.isUndefined(this._outputAmount)){var self=this;this._outputAmount=0;_.each(this.outputs,function(output){self._outputAmount+=output.satoshis;});}return this._outputAmount;};/** + * Calculates or gets the total input amount in satoshis + * + * @return {Number} the transaction total input amount + */Transaction.prototype._getInputAmount=function(){if(_.isUndefined(this._inputAmount)){var self=this;this._inputAmount=0;_.each(this.inputs,function(input){if(_.isUndefined(input.output)){throw new errors.Transaction.Input.MissingPreviousOutput();}self._inputAmount+=input.output.satoshis;});}return this._inputAmount;};Transaction.prototype._updateChangeOutput=function(){if(!this._changeScript){return;}this._clearSignatures();if(!_.isUndefined(this._changeIndex)){this._removeOutput(this._changeIndex);}var available=this._getUnspentValue();var fee=this.getFee();var changeAmount=available-fee;if(changeAmount>0){this._changeIndex=this.outputs.length;this._addOutput(new Output({script:this._changeScript,satoshis:changeAmount}));}else{this._changeIndex=undefined;}};/** + * Calculates the fee of the transaction. + * + * If there's a fixed fee set, return that. + * + * If there is no change output set, the fee is the + * total value of the outputs minus inputs. Note that + * a serialized transaction only specifies the value + * of its outputs. (The value of inputs are recorded + * in the previous transaction outputs being spent.) + * This method therefore raises a "MissingPreviousOutput" + * error when called on a serialized transaction. + * + * If there's no fee set and no change address, + * estimate the fee based on size. + * + * @return {Number} fee of this transaction in satoshis + */Transaction.prototype.getFee=function(){if(this.isCoinbase()){return 0;}if(!_.isUndefined(this._fee)){return this._fee;}// if no change output is set, fees should equal all the unspent amount +if(!this._changeScript){return this._getUnspentValue();}return this._estimateFee();};/** + * Estimates fee from serialized transaction size in bytes. + */Transaction.prototype._estimateFee=function(){var estimatedSize=this._estimateSize();var available=this._getUnspentValue();return Transaction._estimateFee(estimatedSize,available,this._feePerKb);};Transaction.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount();};Transaction.prototype._clearSignatures=function(){_.each(this.inputs,function(input){input.clearSignatures();});};Transaction._estimateFee=function(size,amountAvailable,feePerKb){var fee=Math.ceil(size/1000)*(feePerKb||Transaction.FEE_PER_KB);if(amountAvailable>fee){size+=Transaction.CHANGE_OUTPUT_MAX_SIZE;}return Math.ceil(size/1000)*(feePerKb||Transaction.FEE_PER_KB);};Transaction.prototype._estimateSize=function(){var result=Transaction.MAXIMUM_EXTRA_SIZE;_.each(this.inputs,function(input){result+=input._estimateSize();});_.each(this.outputs,function(output){result+=output.script.toBuffer().length+9;});return result;};Transaction.prototype._removeOutput=function(index){var output=this.outputs[index];this.outputs=_.without(this.outputs,output);this._outputAmount=undefined;};Transaction.prototype.removeOutput=function(index){this._removeOutput(index);this._updateChangeOutput();};/** + * Sort a transaction's inputs and outputs according to BIP69 + * + * @see {https://github.com/bitcoin/bips/blob/master/bip-0069.mediawiki} + * @return {Transaction} this + */Transaction.prototype.sort=function(){this.sortInputs(function(inputs){var copy=Array.prototype.concat.apply([],inputs);copy.sort(function(first,second){return compare(first.prevTxId,second.prevTxId)||first.outputIndex-second.outputIndex;});return copy;});this.sortOutputs(function(outputs){var copy=Array.prototype.concat.apply([],outputs);copy.sort(function(first,second){return first.satoshis-second.satoshis||compare(first.script.toBuffer(),second.script.toBuffer());});return copy;});return this;};/** + * Randomize this transaction's outputs ordering. The shuffling algorithm is a + * version of the Fisher-Yates shuffle, provided by lodash's _.shuffle(). + * + * @return {Transaction} this + */Transaction.prototype.shuffleOutputs=function(){return this.sortOutputs(_.shuffle);};/** + * Sort this transaction's outputs, according to a given sorting function that + * takes an array as argument and returns a new array, with the same elements + * but with a different order. The argument function MUST NOT modify the order + * of the original array + * + * @param {Function} sortingFunction + * @return {Transaction} this + */Transaction.prototype.sortOutputs=function(sortingFunction){var outs=sortingFunction(this.outputs);return this._newOutputOrder(outs);};/** + * Sort this transaction's inputs, according to a given sorting function that + * takes an array as argument and returns a new array, with the same elements + * but with a different order. + * + * @param {Function} sortingFunction + * @return {Transaction} this + */Transaction.prototype.sortInputs=function(sortingFunction){this.inputs=sortingFunction(this.inputs);this._clearSignatures();return this;};Transaction.prototype._newOutputOrder=function(newOutputs){var isInvalidSorting=this.outputs.length!==newOutputs.length||_.difference(this.outputs,newOutputs).length!==0;if(isInvalidSorting){throw new errors.Transaction.InvalidSorting();}if(!_.isUndefined(this._changeIndex)){var changeOutput=this.outputs[this._changeIndex];this._changeIndex=_.findIndex(newOutputs,changeOutput);}this.outputs=newOutputs;return this;};Transaction.prototype.removeInput=function(txId,outputIndex){var index;if(!outputIndex&&_.isNumber(txId)){index=txId;}else{index=_.findIndex(this.inputs,function(input){return input.prevTxId.toString('hex')===txId&&input.outputIndex===outputIndex;});}if(index<0||index>=this.inputs.length){throw new errors.Transaction.InvalidIndex(index,this.inputs.length);}var input=this.inputs[index];this.inputs=_.without(this.inputs,input);this._inputAmount=undefined;this._updateChangeOutput();};/* Signature handling *//** + * Sign the transaction using one or more private keys. + * + * It tries to sign each input, verifying that the signature will be valid + * (matches a public key). + * + * @param {Array|String|PrivateKey} privateKey + * @param {number} sigtype + * @return {Transaction} this, for chaining + */Transaction.prototype.sign=function(privateKey,sigtype){$.checkState(this.hasAllUtxoInfo());var self=this;if(_.isArray(privateKey)){_.each(privateKey,function(privateKey){self.sign(privateKey,sigtype);});return this;}_.each(this.getSignatures(privateKey,sigtype),function(signature){self.applySignature(signature);});return this;};Transaction.prototype.getSignatures=function(privKey,sigtype){privKey=new PrivateKey(privKey);sigtype=sigtype||Signature.SIGHASH_ALL;var transaction=this;var results=[];var hashData=Hash.sha256ripemd160(privKey.publicKey.toBuffer());_.each(this.inputs,function forEachInput(input,index){_.each(input.getSignatures(transaction,privKey,index,sigtype,hashData),function(signature){results.push(signature);});});return results;};/** + * Add a signature to the transaction + * + * @param {Object} signature + * @param {number} signature.inputIndex + * @param {number} signature.sigtype + * @param {PublicKey} signature.publicKey + * @param {Signature} signature.signature + * @return {Transaction} this, for chaining + */Transaction.prototype.applySignature=function(signature){this.inputs[signature.inputIndex].addSignature(this,signature);return this;};Transaction.prototype.isFullySigned=function(){_.each(this.inputs,function(input){if(input.isFullySigned===Input.prototype.isFullySigned){throw new errors.Transaction.UnableToVerifySignature('Unrecognized script kind, or not enough information to execute script.'+'This usually happens when creating a transaction from a serialized transaction');}});return _.all(_.map(this.inputs,function(input){return input.isFullySigned();}));};Transaction.prototype.isValidSignature=function(signature){var self=this;if(this.inputs[signature.inputIndex].isValidSignature===Input.prototype.isValidSignature){throw new errors.Transaction.UnableToVerifySignature('Unrecognized script kind, or not enough information to execute script.'+'This usually happens when creating a transaction from a serialized transaction');}return this.inputs[signature.inputIndex].isValidSignature(self,signature);};/** + * @returns {bool} whether the signature is valid for this transaction input + */Transaction.prototype.verifySignature=function(sig,pubkey,nin,subscript){return Sighash.verify(this,sig,pubkey,nin,subscript);};/** + * Check that a transaction passes basic sanity tests. If not, return a string + * describing the error. This function contains the same logic as + * CheckTransaction in bitcoin core. + */Transaction.prototype.verify=function(){// Basic checks that don't depend on any context +if(this.inputs.length===0){return'transaction txins empty';}if(this.outputs.length===0){return'transaction txouts empty';}// Check for negative or overflow output values +var valueoutbn=new BN(0);for(var i=0;iMAX_BLOCK_SIZE){return'transaction over the maximum block size';}// Check for duplicate inputs +var txinmap={};for(i=0;i100){return'coinbase transaction script size invalid';}}else{for(i=0;i=Input.MAXINT-1){input.sequenceNumber=Input.DEFAULT_RBF_SEQNUMBER;}}return this;};module.exports=Transaction;}).call(this,require("buffer").Buffer);},{"../address":79,"../crypto/bn":84,"../crypto/hash":86,"../crypto/signature":89,"../encoding/bufferreader":92,"../encoding/bufferwriter":93,"../errors":95,"../privatekey":102,"../script":104,"../util/buffer":121,"../util/js":122,"../util/preconditions":123,"./input":108,"./output":114,"./sighash":115,"./unspentoutput":118,"buffer":191,"buffer-compare":126,"lodash":149}],118:[function(require,module,exports){'use strict';var _=require('lodash');var $=require('../util/preconditions');var JSUtil=require('../util/js');var Script=require('../script');var Address=require('../address');var Unit=require('../unit');/** + * Represents an unspent output information: its script, associated amount and address, + * transaction id and output index. + * + * @constructor + * @param {object} data + * @param {string} data.txid the previous transaction id + * @param {string=} data.txId alias for `txid` + * @param {number} data.vout the index in the transaction + * @param {number=} data.outputIndex alias for `vout` + * @param {string|Script} data.scriptPubKey the script that must be resolved to release the funds + * @param {string|Script=} data.script alias for `scriptPubKey` + * @param {number} data.amount amount of bitcoins associated + * @param {number=} data.satoshis alias for `amount`, but expressed in satoshis (1 BTC = 1e8 satoshis) + * @param {string|Address=} data.address the associated address to the script, if provided + */function UnspentOutput(data){/* jshint maxcomplexity: 20 *//* jshint maxstatements: 20 */if(!(this instanceof UnspentOutput)){return new UnspentOutput(data);}$.checkArgument(_.isObject(data),'Must provide an object from where to extract data');var address=data.address?new Address(data.address):undefined;var txId=data.txid?data.txid:data.txId;if(!txId||!JSUtil.isHexaString(txId)||txId.length>64){// TODO: Use the errors library +throw new Error('Invalid TXID in object',data);}var outputIndex=_.isUndefined(data.vout)?data.outputIndex:data.vout;if(!_.isNumber(outputIndex)){throw new Error('Invalid outputIndex, received '+outputIndex);}$.checkArgument(!_.isUndefined(data.scriptPubKey)||!_.isUndefined(data.script),'Must provide the scriptPubKey for that output!');var script=new Script(data.scriptPubKey||data.script);$.checkArgument(!_.isUndefined(data.amount)||!_.isUndefined(data.satoshis),'Must provide an amount for the output');var amount=!_.isUndefined(data.amount)?new Unit.fromBTC(data.amount).toSatoshis():data.satoshis;$.checkArgument(_.isNumber(amount),'Amount must be a number');JSUtil.defineImmutable(this,{address:address,txId:txId,outputIndex:outputIndex,script:script,satoshis:amount});}/** + * Provide an informative output when displaying this object in the console + * @returns string + */UnspentOutput.prototype.inspect=function(){return'';};/** + * String representation: just "txid:index" + * @returns string + */UnspentOutput.prototype.toString=function(){return this.txId+':'+this.outputIndex;};/** + * Deserialize an UnspentOutput from an object + * @param {object|string} data + * @return UnspentOutput + */UnspentOutput.fromObject=function(data){return new UnspentOutput(data);};/** + * Returns a plain object (no prototype or methods) with the associated info for this output + * @return {object} + */UnspentOutput.prototype.toObject=UnspentOutput.prototype.toJSON=function toObject(){return{address:this.address?this.address.toString():undefined,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString('hex'),amount:Unit.fromSatoshis(this.satoshis).toBTC()};};module.exports=UnspentOutput;},{"../address":79,"../script":104,"../unit":119,"../util/js":122,"../util/preconditions":123,"lodash":149}],119:[function(require,module,exports){'use strict';var _=require('lodash');var errors=require('./errors');var $=require('./util/preconditions');var UNITS={'BTC':[1e8,8],'mBTC':[1e5,5],'uBTC':[1e2,2],'bits':[1e2,2],'satoshis':[1,0]};/** + * Utility for handling and converting bitcoins units. The supported units are + * BTC, mBTC, bits (also named uBTC) and satoshis. A unit instance can be created with an + * amount and a unit code, or alternatively using static methods like {fromBTC}. + * It also allows to be created from a fiat amount and the exchange rate, or + * alternatively using the {fromFiat} static method. + * You can consult for different representation of a unit instance using it's + * {to} method, the fixed unit methods like {toSatoshis} or alternatively using + * the unit accessors. It also can be converted to a fiat amount by providing the + * corresponding BTC/fiat exchange rate. + * + * @example + * ```javascript + * var sats = Unit.fromBTC(1.3).toSatoshis(); + * var mili = Unit.fromBits(1.3).to(Unit.mBTC); + * var bits = Unit.fromFiat(1.3, 350).bits; + * var btc = new Unit(1.3, Unit.bits).BTC; + * ``` + * + * @param {Number} amount - The amount to be represented + * @param {String|Number} code - The unit of the amount or the exchange rate + * @returns {Unit} A new instance of an Unit + * @constructor + */function Unit(amount,code){if(!(this instanceof Unit)){return new Unit(amount,code);}// convert fiat to BTC +if(_.isNumber(code)){if(code<=0){throw new errors.Unit.InvalidRate(code);}amount=amount/code;code=Unit.BTC;}this._value=this._from(amount,code);var self=this;var defineAccesor=function defineAccesor(key){Object.defineProperty(self,key,{get:function get(){return self.to(key);},enumerable:true});};Object.keys(UNITS).forEach(defineAccesor);}Object.keys(UNITS).forEach(function(key){Unit[key]=key;});/** + * Returns a Unit instance created from JSON string or object + * + * @param {String|Object} json - JSON with keys: amount and code + * @returns {Unit} A Unit instance + */Unit.fromObject=function fromObject(data){$.checkArgument(_.isObject(data),'Argument is expected to be an object');return new Unit(data.amount,data.code);};/** + * Returns a Unit instance created from an amount in BTC + * + * @param {Number} amount - The amount in BTC + * @returns {Unit} A Unit instance + */Unit.fromBTC=function(amount){return new Unit(amount,Unit.BTC);};/** + * Returns a Unit instance created from an amount in mBTC + * + * @param {Number} amount - The amount in mBTC + * @returns {Unit} A Unit instance + */Unit.fromMillis=Unit.fromMilis=function(amount){return new Unit(amount,Unit.mBTC);};/** + * Returns a Unit instance created from an amount in bits + * + * @param {Number} amount - The amount in bits + * @returns {Unit} A Unit instance + */Unit.fromMicros=Unit.fromBits=function(amount){return new Unit(amount,Unit.bits);};/** + * Returns a Unit instance created from an amount in satoshis + * + * @param {Number} amount - The amount in satoshis + * @returns {Unit} A Unit instance + */Unit.fromSatoshis=function(amount){return new Unit(amount,Unit.satoshis);};/** + * Returns a Unit instance created from a fiat amount and exchange rate. + * + * @param {Number} amount - The amount in fiat + * @param {Number} rate - The exchange rate BTC/fiat + * @returns {Unit} A Unit instance + */Unit.fromFiat=function(amount,rate){return new Unit(amount,rate);};Unit.prototype._from=function(amount,code){if(!UNITS[code]){throw new errors.Unit.UnknownCode(code);}return parseInt((amount*UNITS[code][0]).toFixed());};/** + * Returns the value represented in the specified unit + * + * @param {String|Number} code - The unit code or exchange rate + * @returns {Number} The converted value + */Unit.prototype.to=function(code){if(_.isNumber(code)){if(code<=0){throw new errors.Unit.InvalidRate(code);}return parseFloat((this.BTC*code).toFixed(2));}if(!UNITS[code]){throw new errors.Unit.UnknownCode(code);}var value=this._value/UNITS[code][0];return parseFloat(value.toFixed(UNITS[code][1]));};/** + * Returns the value represented in BTC + * + * @returns {Number} The value converted to BTC + */Unit.prototype.toBTC=function(){return this.to(Unit.BTC);};/** + * Returns the value represented in mBTC + * + * @returns {Number} The value converted to mBTC + */Unit.prototype.toMillis=Unit.prototype.toMilis=function(){return this.to(Unit.mBTC);};/** + * Returns the value represented in bits + * + * @returns {Number} The value converted to bits + */Unit.prototype.toMicros=Unit.prototype.toBits=function(){return this.to(Unit.bits);};/** + * Returns the value represented in satoshis + * + * @returns {Number} The value converted to satoshis + */Unit.prototype.toSatoshis=function(){return this.to(Unit.satoshis);};/** + * Returns the value represented in fiat + * + * @param {string} rate - The exchange rate between BTC/currency + * @returns {Number} The value converted to satoshis + */Unit.prototype.atRate=function(rate){return this.to(rate);};/** + * Returns a the string representation of the value in satoshis + * + * @returns {string} the value in satoshis + */Unit.prototype.toString=function(){return this.satoshis+' satoshis';};/** + * Returns a plain object representation of the Unit + * + * @returns {Object} An object with the keys: amount and code + */Unit.prototype.toObject=Unit.prototype.toJSON=function toObject(){return{amount:this.BTC,code:Unit.BTC};};/** + * Returns a string formatted for the console + * + * @returns {string} the value in satoshis + */Unit.prototype.inspect=function(){return'';};module.exports=Unit;},{"./errors":95,"./util/preconditions":123,"lodash":149}],120:[function(require,module,exports){'use strict';var _=require('lodash');var URL=require('url');var Address=require('./address');var Unit=require('./unit');/** + * Bitcore URI + * + * Instantiate an URI from a bitcoin URI String or an Object. An URI instance + * can be created with a bitcoin uri string or an object. All instances of + * URI are valid, the static method isValid allows checking before instantiation. + * + * All standard parameters can be found as members of the class, the address + * is represented using an {Address} instance and the amount is represented in + * satoshis. Any other non-standard parameters can be found under the extra member. + * + * @example + * ```javascript + * + * var uri = new URI('bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu?amount=1.2'); + * console.log(uri.address, uri.amount); + * ``` + * + * @param {string|Object} data - A bitcoin URI string or an Object + * @param {Array.=} knownParams - Required non-standard params + * @throws {TypeError} Invalid bitcoin address + * @throws {TypeError} Invalid amount + * @throws {Error} Unknown required argument + * @returns {URI} A new valid and frozen instance of URI + * @constructor + */var URI=function URI(data,knownParams){if(!(this instanceof URI)){return new URI(data,knownParams);}this.extras={};this.knownParams=knownParams||[];this.address=this.network=this.amount=this.message=null;if(typeof data==='string'){var params=URI.parse(data);if(params.amount){params.amount=this._parseAmount(params.amount);}this._fromObject(params);}else if((typeof data==="undefined"?"undefined":_typeof(data))==='object'){this._fromObject(data);}else{throw new TypeError('Unrecognized data format.');}};/** + * Instantiate a URI from a String + * + * @param {string} str - JSON string or object of the URI + * @returns {URI} A new instance of a URI + */URI.fromString=function fromString(str){if(typeof str!=='string'){throw new TypeError('Expected a string');}return new URI(str);};/** + * Instantiate a URI from an Object + * + * @param {Object} data - object of the URI + * @returns {URI} A new instance of a URI + */URI.fromObject=function fromObject(json){return new URI(json);};/** + * Check if an bitcoin URI string is valid + * + * @example + * ```javascript + * + * var valid = URI.isValid('bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu'); + * // true + * ``` + * + * @param {string|Object} data - A bitcoin URI string or an Object + * @param {Array.=} knownParams - Required non-standard params + * @returns {boolean} Result of uri validation + */URI.isValid=function(arg,knownParams){try{new URI(arg,knownParams);}catch(err){return false;}return true;};/** + * Convert a bitcoin URI string into a simple object. + * + * @param {string} uri - A bitcoin URI string + * @throws {TypeError} Invalid bitcoin URI + * @returns {Object} An object with the parsed params + */URI.parse=function(uri){var info=URL.parse(uri,true);if(info.protocol!=='bitcoin:'){throw new TypeError('Invalid bitcoin URI');}// workaround to host insensitiveness +var group=/[^:]*:\/?\/?([^?]*)/.exec(uri);info.query.address=group&&group[1]||undefined;return info.query;};URI.Members=['address','amount','message','label','r'];/** + * Internal function to load the URI instance with an object. + * + * @param {Object} obj - Object with the information + * @throws {TypeError} Invalid bitcoin address + * @throws {TypeError} Invalid amount + * @throws {Error} Unknown required argument + */URI.prototype._fromObject=function(obj){/* jshint maxcomplexity: 10 */if(!Address.isValid(obj.address)){throw new TypeError('Invalid bitcoin address');}this.address=new Address(obj.address);this.network=this.address.network;this.amount=obj.amount;for(var key in obj){if(key==='address'||key==='amount'){continue;}if(/^req-/.exec(key)&&this.knownParams.indexOf(key)===-1){throw Error('Unknown required argument '+key);}var destination=URI.Members.indexOf(key)>-1?this:this.extras;destination[key]=obj[key];}};/** + * Internal function to transform a BTC string amount into satoshis + * + * @param {string} amount - Amount BTC string + * @throws {TypeError} Invalid amount + * @returns {Object} Amount represented in satoshis + */URI.prototype._parseAmount=function(amount){amount=Number(amount);if(isNaN(amount)){throw new TypeError('Invalid amount');}return Unit.fromBTC(amount).toSatoshis();};URI.prototype.toObject=URI.prototype.toJSON=function toObject(){var json={};for(var i=0;i';};module.exports=URI;},{"./address":79,"./unit":119,"lodash":149,"url":500}],121:[function(require,module,exports){(function(Buffer){'use strict';var buffer=require('buffer');var assert=require('assert');var js=require('./js');var $=require('./preconditions');function equals(a,b){if(a.length!==b.length){return false;}var length=a.length;for(var i=0;ibuffer.Buffer.concat + */concat:buffer.Buffer.concat,equals:equals,equal:equals,/** + * Transforms a number from 0 to 255 into a Buffer of size 1 with that value + * + * @param {number} integer + * @return {Buffer} + */integerAsSingleByteBuffer:function integerAsSingleByteBuffer(integer){$.checkArgumentType(integer,'number','integer');return new buffer.Buffer([integer&0xff]);},/** + * Transform a 4-byte integer into a Buffer of length 4. + * + * @param {number} integer + * @return {Buffer} + */integerAsBuffer:function integerAsBuffer(integer){$.checkArgumentType(integer,'number','integer');var bytes=[];bytes.push(integer>>24&0xff);bytes.push(integer>>16&0xff);bytes.push(integer>>8&0xff);bytes.push(integer&0xff);return new Buffer(bytes);},/** + * Transform the first 4 values of a Buffer into a number, in little endian encoding + * + * @param {Buffer} buffer + * @return {number} + */integerFromBuffer:function integerFromBuffer(buffer){$.checkArgumentType(buffer,'Buffer','buffer');return buffer[0]<<24|buffer[1]<<16|buffer[2]<<8|buffer[3];},/** + * Transforms the first byte of an array into a number ranging from -128 to 127 + * @param {Buffer} buffer + * @return {number} + */integerFromSingleByteBuffer:function integerFromBuffer(buffer){$.checkArgumentType(buffer,'Buffer','buffer');return buffer[0];},/** + * Transforms a buffer into a string with a number in hexa representation + * + * Shorthand for buffer.toString('hex') + * + * @param {Buffer} buffer + * @return {string} + */bufferToHex:function bufferToHex(buffer){$.checkArgumentType(buffer,'Buffer','buffer');return buffer.toString('hex');},/** + * Reverse a buffer + * @param {Buffer} param + * @return {Buffer} + */reverse:function reverse(param){var ret=new buffer.Buffer(param.length);for(var i=0;iBuffer(string, 'hex') + * + * @param {string} string + * @return {Buffer} + */hexToBuffer:function hexToBuffer(string){assert(js.isHexa(string));return new buffer.Buffer(string,'hex');}};module.exports.NULL_HASH=module.exports.fill(new Buffer(32),0);module.exports.EMPTY_BUFFER=new Buffer(0);}).call(this,require("buffer").Buffer);},{"./js":122,"./preconditions":123,"assert":67,"buffer":191}],122:[function(require,module,exports){'use strict';var _=require('lodash');/** + * Determines whether a string contains only hexadecimal values + * + * @name JSUtil.isHexa + * @param {string} value + * @return {boolean} true if the string is the hexa representation of a number + */var isHexa=function isHexa(value){if(!_.isString(value)){return false;}return /^[0-9a-fA-F]+$/.test(value);};/** + * @namespace JSUtil + */module.exports={/** + * Test if an argument is a valid JSON object. If it is, returns a truthy + * value (the json object decoded), so no double JSON.parse call is necessary + * + * @param {string} arg + * @return {Object|boolean} false if the argument is not a JSON string. + */isValidJSON:function isValidJSON(arg){var parsed;if(!_.isString(arg)){return false;}try{parsed=JSON.parse(arg);}catch(e){return false;}if((typeof parsed==="undefined"?"undefined":_typeof(parsed))==='object'){return true;}return false;},isHexa:isHexa,isHexaString:isHexa,/** + * Clone an array + */cloneArray:function cloneArray(array){return[].concat(array);},/** + * Define immutable properties on a target object + * + * @param {Object} target - An object to be extended + * @param {Object} values - An object of properties + * @return {Object} The target object + */defineImmutable:function defineImmutable(target,values){Object.keys(values).forEach(function(key){Object.defineProperty(target,key,{configurable:false,enumerable:true,value:values[key]});});return target;},/** + * Checks that a value is a natural number, a positive integer or zero. + * + * @param {*} value + * @return {Boolean} + */isNaturalNumber:function isNaturalNumber(value){return typeof value==='number'&&isFinite(value)&&Math.floor(value)===value&&value>=0;}};},{"lodash":149}],123:[function(require,module,exports){'use strict';var errors=require('../errors');var _=require('lodash');module.exports={checkState:function checkState(condition,message){if(!condition){throw new errors.InvalidState(message);}},checkArgument:function checkArgument(condition,argumentName,message,docsPath){if(!condition){throw new errors.InvalidArgument(argumentName,message,docsPath);}},checkArgumentType:function checkArgumentType(argument,type,argumentName){argumentName=argumentName||'(unknown name)';if(_.isString(type)){if(type==='Buffer'){var BufferUtil=require('./buffer');if(!BufferUtil.isBuffer(argument)){throw new errors.InvalidArgumentType(argument,type,argumentName);}}else if((typeof argument==="undefined"?"undefined":_typeof(argument))!==type){throw new errors.InvalidArgumentType(argument,type,argumentName);}}else{if(!(argument instanceof type)){throw new errors.InvalidArgumentType(argument,type.name,argumentName);}}}};},{"../errors":95,"./buffer":121,"lodash":149}],124:[function(require,module,exports){(function(module,exports){'use strict';// Utils +function assert(val,msg){if(!val)throw new Error(msg||'Assertion failed');}// Could use `inherits` module, but don't want to move from single file +// architecture yet. +function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function TempCtor(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor();ctor.prototype.constructor=ctor;}// BN +function BN(number,base,endian){// May be `new BN(bn)` ? +if(number!==null&&(typeof number==="undefined"?"undefined":_typeof(number))==='object'&&Array.isArray(number.words)){return number;}this.sign=false;this.words=null;this.length=0;// Reduction context +this.red=null;if(base==='le'||base==='be'){endian=base;base=10;}if(number!==null)this._init(number||0,base||10,endian||'be');}if((typeof module==="undefined"?"undefined":_typeof(module))==='object')module.exports=BN;else exports.BN=BN;BN.BN=BN;BN.wordSize=26;BN.prototype._init=function init(number,base,endian){if(typeof number==='number'){if(number<0){this.sign=true;number=-number;}if(number<0x4000000){this.words=[number&0x3ffffff];this.length=1;}else if(number<0x10000000000000){this.words=[number&0x3ffffff,number/0x4000000&0x3ffffff];this.length=2;}else{assert(number<0x20000000000000);// 2 ^ 53 (unsafe) +this.words=[number&0x3ffffff,number/0x4000000&0x3ffffff,1];this.length=3;}return;}else if((typeof number==="undefined"?"undefined":_typeof(number))==='object'){return this._initArray(number,base,endian);}if(base==='hex')base=16;assert(base===(base|0)&&base>=2&&base<=36);number=number.toString().replace(/\s+/g,'');var start=0;if(number[0]==='-')start++;if(base===16)this._parseHex(number,start);else this._parseBase(number,base,start);if(number[0]==='-')this.sign=true;this.strip();};BN.prototype._initArray=function _initArray(number,base,endian){// Perhaps a Uint8Array +assert(typeof number.length==='number');if(number.length<=0){this.words=[0];this.length=1;return this;}this.length=Math.ceil(number.length/3);this.words=new Array(this.length);for(var i=0;i=0;i-=3){var w=number[i]|number[i-1]<<8|number[i-2]<<16;this.words[j]|=w<>>26-off&0x3ffffff;off+=24;if(off>=26){off-=26;j++;}}}else if(endian==='le'){for(var i=0,j=0;i>>26-off&0x3ffffff;off+=24;if(off>=26){off-=26;j++;}}}return this.strip();};function parseHex(str,start,end){var r=0;var len=Math.min(str.length,end);for(var i=start;i=49&&c<=54)r|=c-49+0xa;// 'A' - 'F' +else if(c>=17&&c<=22)r|=c-17+0xa;// '0' - '9' +else r|=c&0xf;}return r;}BN.prototype._parseHex=function _parseHex(number,start){// Create possibly bigger array to ensure that it fits the number +this.length=Math.ceil((number.length-start)/6);this.words=new Array(this.length);for(var i=0;i=start;i-=6){var w=parseHex(number,i,i+6);this.words[j]|=w<>>26-off&0x3fffff;off+=24;if(off>=26){off-=26;j++;}}if(i+6!==start){var w=parseHex(number,start,i+6);this.words[j]|=w<>>26-off&0x3fffff;}this.strip();};function parseBase(str,start,end,mul){var r=0;var len=Math.min(str.length,end);for(var i=start;i=49)r+=c-49+0xa;// 'A' +else if(c>=17)r+=c-17+0xa;// '0' - '9' +else r+=c;}return r;}BN.prototype._parseBase=function _parseBase(number,base,start){// Initialize as zero +this.words=[0];this.length=1;// Find length of limb in base +for(var limbLen=0,limbPow=1;limbPow<=0x3ffffff;limbPow*=base){limbLen++;}limbLen--;limbPow=limbPow/base|0;var total=number.length-start;var mod=total%limbLen;var end=Math.min(total,total-mod)+start;var word=0;for(var i=start;i1&&this.words[this.length-1]===0){this.length--;}return this._normSign();};BN.prototype._normSign=function _normSign(){// -0 = 0 +if(this.length===1&&this.words[0]===0)this.sign=false;return this;};BN.prototype.inspect=function inspect(){return(this.red?'';};/* + +var zeros = []; +var groupSizes = []; +var groupBases = []; + +var s = ''; +var i = -1; +while (++i < BN.wordSize) { + zeros[i] = s; + s += '0'; +} +groupSizes[0] = 0; +groupSizes[1] = 0; +groupBases[0] = 0; +groupBases[1] = 0; +var base = 2 - 1; +while (++base < 36 + 1) { + var groupSize = 0; + var groupBase = 1; + while (groupBase < (1 << BN.wordSize) / base) { + groupBase *= base; + groupSize += 1; + } + groupSizes[base] = groupSize; + groupBases[base] = groupBase; +} + +*/var zeros=['','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'];var groupSizes=[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];var groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,10000000,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function toString(base,padding){base=base||10;if(base===16||base==='hex'){var out='';var off=0;var padding=padding|0||1;var carry=0;for(var i=0;i>>24-off&0xffffff;if(carry!==0||i!==this.length-1)out=zeros[6-word.length]+word+out;else out=word+out;off+=2;if(off>=26){off-=26;i--;}}if(carry!==0)out=carry.toString(16)+out;while(out.length%padding!==0){out='0'+out;}if(this.sign)out='-'+out;return out;}else if(base===(base|0)&&base>=2&&base<=36){// var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); +var groupSize=groupSizes[base];// var groupBase = Math.pow(base, groupSize); +var groupBase=groupBases[base];var out='';var c=this.clone();c.sign=false;while(c.cmpn(0)!==0){var r=c.modn(groupBase).toString(base);c=c.idivn(groupBase);if(c.cmpn(0)!==0)out=zeros[groupSize-r.length]+r+out;else out=r+out;}if(this.cmpn(0)===0)out='0'+out;if(this.sign)out='-'+out;return out;}else{assert(false,'Base should be between 2 and 36');}};BN.prototype.toJSON=function toJSON(){return this.toString(16);};BN.prototype.toArray=function toArray(){this.strip();var res=new Array(this.byteLength());res[0]=0;var q=this.clone();for(var i=0;q.cmpn(0)!==0;i++){var b=q.andln(0xff);q.ishrn(8);// Assume big-endian +res[res.length-i-1]=b;}return res;};if(Math.clz32){BN.prototype._countBits=function _countBits(w){return 32-Math.clz32(w);};}else{BN.prototype._countBits=function _countBits(w){var t=w;var r=0;if(t>=0x1000){r+=13;t>>>=13;}if(t>=0x40){r+=7;t>>>=7;}if(t>=0x8){r+=4;t>>>=4;}if(t>=0x02){r+=2;t>>>=2;}return r+t;};}BN.prototype._zeroBits=function _zeroBits(w){// Short-cut +if(w===0)return 26;var t=w;var r=0;if((t&0x1fff)===0){r+=13;t>>>=13;}if((t&0x7f)===0){r+=7;t>>>=7;}if((t&0xf)===0){r+=4;t>>>=4;}if((t&0x3)===0){r+=2;t>>>=2;}if((t&0x1)===0)r++;return r;};// Return number of used bits in a BN +BN.prototype.bitLength=function bitLength(){var hi=0;var w=this.words[this.length-1];var hi=this._countBits(w);return(this.length-1)*26+hi;};// Number of trailing zero bits +BN.prototype.zeroBits=function zeroBits(){if(this.cmpn(0)===0)return 0;var r=0;for(var i=0;inum.length)return this.clone().ior(num);else return num.clone().ior(this);};// And `num` with `this` in-place +BN.prototype.iand=function iand(num){this.sign=this.sign&&num.sign;// b = min-length(num, this) +var b;if(this.length>num.length)b=num;else b=this;for(var i=0;inum.length)return this.clone().iand(num);else return num.clone().iand(this);};// Xor `num` with `this` in-place +BN.prototype.ixor=function ixor(num){this.sign=this.sign||num.sign;// a.length > b.length +var a;var b;if(this.length>num.length){a=this;b=num;}else{a=num;b=this;}for(var i=0;inum.length)return this.clone().ixor(num);else return num.clone().ixor(this);};// Set `bit` of `this` +BN.prototype.setn=function setn(bit,val){assert(typeof bit==='number'&&bit>=0);var off=bit/26|0;var wbit=bit%26;while(this.length<=off){this.words[this.length++]=0;}if(val)this.words[off]=this.words[off]|1< b.length +var a;var b;if(this.length>num.length){a=this;b=num;}else{a=num;b=this;}var carry=0;for(var i=0;i>>26;}for(;carry!==0&&i>>26;}this.length=a.length;if(carry!==0){this.words[this.length]=carry;this.length++;// Copy the rest of the words +}else if(a!==this){for(;inum.length)return this.clone().iadd(num);else return num.clone().iadd(this);};// Subtract `num` from `this` in-place +BN.prototype.isub=function isub(num){// this - (-num) = this + num +if(num.sign){num.sign=false;var r=this.iadd(num);num.sign=true;return r._normSign();// -this - num = -(this + num) +}else if(this.sign){this.sign=false;this.iadd(num);this.sign=true;return this._normSign();}// At this point both numbers are positive +var cmp=this.cmp(num);// Optimization - zeroify +if(cmp===0){this.sign=false;this.length=1;this.words[0]=0;return this;}// a > b +var a;var b;if(cmp>0){a=this;b=num;}else{a=num;b=this;}var carry=0;for(var i=0;i>26;this.words[i]=r&0x3ffffff;}for(;carry!==0&&i>26;this.words[i]=r&0x3ffffff;}// Copy rest of the words +if(carry===0&&i= 0x3ffffff +var ncarry=carry>>>26;var rword=carry&0x3ffffff;var maxJ=Math.min(k,num.length-1);for(var j=Math.max(0,k-this.length+1);j<=maxJ;j++){var i=k-j;var a=this.words[i]|0;var b=num.words[j]|0;var r=a*b;var lo=r&0x3ffffff;ncarry=ncarry+(r/0x4000000|0)|0;lo=lo+rword|0;rword=lo&0x3ffffff;ncarry=ncarry+(lo>>>26)|0;}out.words[k]=rword;carry=ncarry;}if(carry!==0){out.words[k]=carry;}else{out.length--;}return out.strip();};BN.prototype._bigMulTo=function _bigMulTo(num,out){out.sign=num.sign!==this.sign;out.length=this.length+num.length;var carry=0;var hncarry=0;for(var k=0;k= 0x3ffffff +var ncarry=hncarry;hncarry=0;var rword=carry&0x3ffffff;var maxJ=Math.min(k,num.length-1);for(var j=Math.max(0,k-this.length+1);j<=maxJ;j++){var i=k-j;var a=this.words[i]|0;var b=num.words[j]|0;var r=a*b;var lo=r&0x3ffffff;ncarry=ncarry+(r/0x4000000|0)|0;lo=lo+rword|0;rword=lo&0x3ffffff;ncarry=ncarry+(lo>>>26)|0;hncarry+=ncarry>>>26;ncarry&=0x3ffffff;}out.words[k]=rword;carry=ncarry;ncarry=hncarry;}if(carry!==0){out.words[k]=carry;}else{out.length--;}return out.strip();};BN.prototype.mulTo=function mulTo(num,out){var res;if(this.length+num.length<63)res=this._smallMulTo(num,out);else res=this._bigMulTo(num,out);return res;};// Multiply `this` by `num` +BN.prototype.mul=function mul(num){var out=new BN(null);out.words=new Array(this.length+num.length);return this.mulTo(num,out);};// In-place Multiplication +BN.prototype.imul=function imul(num){if(this.cmpn(0)===0||num.cmpn(0)===0){this.words[0]=0;this.length=1;return this;}var tlen=this.length;var nlen=num.length;this.sign=num.sign!==this.sign;this.length=this.length+num.length;this.words[this.length-1]=0;for(var k=this.length-2;k>=0;k--){// Sum all words with the same `i + j = k` and accumulate `carry`, +// note that carry could be >= 0x3ffffff +var carry=0;var rword=0;var maxJ=Math.min(k,nlen-1);for(var j=Math.max(0,k-tlen+1);j<=maxJ;j++){var i=k-j;var a=this.words[i];var b=num.words[j];var r=a*b;var lo=r&0x3ffffff;carry+=r/0x4000000|0;lo+=rword;rword=lo&0x3ffffff;carry+=lo>>>26;}this.words[k]=rword;this.words[k+1]+=carry;carry=0;}// Propagate overflows +var carry=0;for(var i=1;i>>26;}return this.strip();};BN.prototype.imuln=function imuln(num){assert(typeof num==='number');// Carry +var carry=0;for(var i=0;i>=26;carry+=w/0x4000000|0;// NOTE: lo is 27bit maximum +carry+=lo>>>26;this.words[i]=lo&0x3ffffff;}if(carry!==0){this.words[i]=carry;this.length++;}return this;};// `this` * `this` +BN.prototype.sqr=function sqr(){return this.mul(this);};// `this` * `this` in-place +BN.prototype.isqr=function isqr(){return this.mul(this);};// Shift-left in-place +BN.prototype.ishln=function ishln(bits){assert(typeof bits==='number'&&bits>=0);var r=bits%26;var s=(bits-r)/26;var carryMask=0x3ffffff>>>26-r<<26-r;if(r!==0){var carry=0;for(var i=0;i>>26-r;}if(carry){this.words[i]=carry;this.length++;}}if(s!==0){for(var i=this.length-1;i>=0;i--){this.words[i+s]=this.words[i];}for(var i=0;i=0);var h;if(hint)h=(hint-hint%26)/26;else h=0;var r=bits%26;var s=Math.min((bits-r)/26,this.length);var mask=0x3ffffff^0x3ffffff>>>r<s){this.length-=s;for(var i=0;i=0&&(carry!==0||i>=h);i--){var word=this.words[i];this.words[i]=carry<<26-r|word>>>r;carry=word&mask;}// Push carried bits as a mask +if(maskedWords&&carry!==0)maskedWords.words[maskedWords.length++]=carry;if(this.length===0){this.words[0]=0;this.length=1;}this.strip();return this;};// Shift-left +BN.prototype.shln=function shln(bits){return this.clone().ishln(bits);};// Shift-right +BN.prototype.shrn=function shrn(bits){return this.clone().ishrn(bits);};// Test if n bit is set +BN.prototype.testn=function testn(bit){assert(typeof bit==='number'&&bit>=0);var r=bit%26;var s=(bit-r)/26;var q=1<=0);var r=bits%26;var s=(bits-r)/26;assert(!this.sign,'imaskn works only with positive numbers');if(r!==0)s++;this.length=Math.min(s,this.length);if(r!==0){var mask=0x3ffffff^0x3ffffff>>>r<=0x4000000;i++){this.words[i]-=0x4000000;if(i===this.length-1)this.words[i+1]=1;else this.words[i+1]++;}this.length=Math.max(this.length,i+1);return this;};// Subtract plain number `num` from `this` +BN.prototype.isubn=function isubn(num){assert(typeof num==='number');if(num<0)return this.iaddn(-num);if(this.sign){this.sign=false;this.iaddn(num);this.sign=true;return this;}this.words[0]-=num;// Carry +for(var i=0;i>26)-(right/0x4000000|0);this.words[i+shift]=w&0x3ffffff;}for(;i>26;this.words[i+shift]=w&0x3ffffff;}if(carry===0)return this.strip();// Subtraction overflow +assert(carry===-1);carry=0;for(var i=0;i>26;this.words[i]=w&0x3ffffff;}this.sign=true;return this.strip();};BN.prototype._wordDiv=function _wordDiv(num,mode){var shift=this.length-num.length;var a=this.clone();var b=num;// Normalize +var bhi=b.words[b.length-1];var bhiBits=this._countBits(bhi);shift=26-bhiBits;if(shift!==0){b=b.shln(shift);a.ishln(shift);bhi=b.words[b.length-1];}// Initialize quotient +var m=a.length-b.length;var q;if(mode!=='mod'){q=new BN(null);q.length=m+1;q.words=new Array(q.length);for(var i=0;i=0;j--){var qj=a.words[b.length+j]*0x4000000+a.words[b.length+j-1];// NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max +// (0x7ffffff) +qj=Math.min(qj/bhi|0,0x3ffffff);a._ishlnsubmul(b,qj,j);while(a.sign){qj--;a.sign=false;a._ishlnsubmul(b,1,j);if(a.cmpn(0)!==0)a.sign=!a.sign;}if(q)q.words[j]=qj;}if(q)q.strip();a.strip();// Denormalize +if(mode!=='div'&&shift!==0)a.ishrn(shift);return{div:q?q:null,mod:a};};BN.prototype.divmod=function divmod(num,mode){assert(num.cmpn(0)!==0);if(this.sign&&!num.sign){var res=this.neg().divmod(num,mode);var div;var mod;if(mode!=='mod')div=res.div.neg();if(mode!=='div')mod=res.mod.cmpn(0)===0?res.mod:num.sub(res.mod);return{div:div,mod:mod};}else if(!this.sign&&num.sign){var res=this.divmod(num.neg(),mode);var div;if(mode!=='mod')div=res.div.neg();return{div:div,mod:res.mod};}else if(this.sign&&num.sign){return this.neg().divmod(num.neg(),mode);}// Both numbers are positive at this point +// Strip both numbers to approximate shift value +if(num.length>this.length||this.cmp(num)<0)return{div:new BN(0),mod:this};// Very short reduction +if(num.length===1){if(mode==='div')return{div:this.divn(num.words[0]),mod:null};else if(mode==='mod')return{div:null,mod:new BN(this.modn(num.words[0]))};return{div:this.divn(num.words[0]),mod:new BN(this.modn(num.words[0]))};}return this._wordDiv(num,mode);};// Find `this` / `num` +BN.prototype.div=function div(num){return this.divmod(num,'div').div;};// Find `this` % `num` +BN.prototype.mod=function mod(num){return this.divmod(num,'mod').mod;};// Find Round(`this` / `num`) +BN.prototype.divRound=function divRound(num){var dm=this.divmod(num);// Fast case - exact division +if(dm.mod.cmpn(0)===0)return dm.div;var mod=dm.div.sign?dm.mod.isub(num):dm.mod;var half=num.shrn(1);var r2=num.andln(1);var cmp=mod.cmp(half);// Round down +if(cmp<0||r2===1&&cmp===0)return dm.div;// Round up +return dm.div.sign?dm.div.isubn(1):dm.div.iaddn(1);};BN.prototype.modn=function modn(num){assert(num<=0x3ffffff);var p=(1<<26)%num;var acc=0;for(var i=this.length-1;i>=0;i--){acc=(p*acc+this.words[i])%num;}return acc;};// In-place division by number +BN.prototype.idivn=function idivn(num){assert(num<=0x3ffffff);var carry=0;for(var i=this.length-1;i>=0;i--){var w=this.words[i]+carry*0x4000000;this.words[i]=w/num|0;carry=w%num;}return this.strip();};BN.prototype.divn=function divn(num){return this.clone().idivn(num);};BN.prototype.egcd=function egcd(p){assert(!p.sign);assert(p.cmpn(0)!==0);var x=this;var y=p.clone();if(x.sign)x=x.mod(p);else x=x.clone();// A * x + B * y = x +var A=new BN(1);var B=new BN(0);// C * x + D * y = y +var C=new BN(0);var D=new BN(1);var g=0;while(x.isEven()&&y.isEven()){x.ishrn(1);y.ishrn(1);++g;}var yp=y.clone();var xp=x.clone();while(x.cmpn(0)!==0){while(x.isEven()){x.ishrn(1);if(A.isEven()&&B.isEven()){A.ishrn(1);B.ishrn(1);}else{A.iadd(yp).ishrn(1);B.isub(xp).ishrn(1);}}while(y.isEven()){y.ishrn(1);if(C.isEven()&&D.isEven()){C.ishrn(1);D.ishrn(1);}else{C.iadd(yp).ishrn(1);D.isub(xp).ishrn(1);}}if(x.cmp(y)>=0){x.isub(y);A.isub(C);B.isub(D);}else{y.isub(x);C.isub(A);D.isub(B);}}return{a:C,b:D,gcd:y.ishln(g)};};// This is reduced incarnation of the binary EEA +// above, designated to invert members of the +// _prime_ fields F(p) at a maximal speed +BN.prototype._invmp=function _invmp(p){assert(!p.sign);assert(p.cmpn(0)!==0);var a=this;var b=p.clone();if(a.sign)a=a.mod(p);else a=a.clone();var x1=new BN(1);var x2=new BN(0);var delta=b.clone();while(a.cmpn(1)>0&&b.cmpn(1)>0){while(a.isEven()){a.ishrn(1);if(x1.isEven())x1.ishrn(1);else x1.iadd(delta).ishrn(1);}while(b.isEven()){b.ishrn(1);if(x2.isEven())x2.ishrn(1);else x2.iadd(delta).ishrn(1);}if(a.cmp(b)>=0){a.isub(b);x1.isub(x2);}else{b.isub(a);x2.isub(x1);}}if(a.cmpn(1)===0)return x1;else return x2;};BN.prototype.gcd=function gcd(num){if(this.cmpn(0)===0)return num.clone();if(num.cmpn(0)===0)return this.clone();var a=this.clone();var b=num.clone();a.sign=false;b.sign=false;// Remove common factor of two +for(var shift=0;a.isEven()&&b.isEven();shift++){a.ishrn(1);b.ishrn(1);}do{while(a.isEven()){a.ishrn(1);}while(b.isEven()){b.ishrn(1);}var r=a.cmp(b);if(r<0){// Swap `a` and `b` to make `a` always bigger than `b` +var t=a;a=b;b=t;}else if(r===0||b.cmpn(1)===0){break;}a.isub(b);}while(true);return b.ishln(shift);};// Invert number in the field F(num) +BN.prototype.invm=function invm(num){return this.egcd(num).a.mod(num);};BN.prototype.isEven=function isEven(){return(this.words[0]&1)===0;};BN.prototype.isOdd=function isOdd(){return(this.words[0]&1)===1;};// And first word and num +BN.prototype.andln=function andln(num){return this.words[0]#};// Increment at the bit position in-line +BN.prototype.bincn=function bincn(bit){assert(typeof bit==='number');var r=bit%26;var s=(bit-r)/26;var q=1<>>26;w&=0x3ffffff;this.words[i]=w;}if(carry!==0){this.words[i]=carry;this.length++;}return this;};BN.prototype.cmpn=function cmpn(num){var sign=num<0;if(sign)num=-num;if(this.sign&&!sign)return-1;else if(!this.sign&&sign)return 1;num&=0x3ffffff;this.strip();var res;if(this.length>1){res=1;}else{var w=this.words[0];res=w===num?0:w `num` +// 0 - if `this` == `num` +// -1 - if `this` < `num` +BN.prototype.cmp=function cmp(num){if(this.sign&&!num.sign)return-1;else if(!this.sign&&num.sign)return 1;var res=this.ucmp(num);if(this.sign)return-res;else return res;};// Unsigned comparison +BN.prototype.ucmp=function ucmp(num){// At this point both numbers have the same sign +if(this.length>num.length)return 1;else if(this.length=0;i--){var a=this.words[i];var b=num.words[i];if(a===b)continue;if(ab)res=1;break;}return res;};// +// A reduce context, could be using montgomery or something better, depending +// on the `m` itself. +// +BN.red=function red(num){return new Red(num);};BN.prototype.toRed=function toRed(ctx){assert(!this.red,'Already a number in reduction context');assert(!this.sign,'red works only with positives');return ctx.convertTo(this)._forceRed(ctx);};BN.prototype.fromRed=function fromRed(){assert(this.red,'fromRed works only with numbers in reduction context');return this.red.convertFrom(this);};BN.prototype._forceRed=function _forceRed(ctx){this.red=ctx;return this;};BN.prototype.forceRed=function forceRed(ctx){assert(!this.red,'Already a number in reduction context');return this._forceRed(ctx);};BN.prototype.redAdd=function redAdd(num){assert(this.red,'redAdd works only with red numbers');return this.red.add(this,num);};BN.prototype.redIAdd=function redIAdd(num){assert(this.red,'redIAdd works only with red numbers');return this.red.iadd(this,num);};BN.prototype.redSub=function redSub(num){assert(this.red,'redSub works only with red numbers');return this.red.sub(this,num);};BN.prototype.redISub=function redISub(num){assert(this.red,'redISub works only with red numbers');return this.red.isub(this,num);};BN.prototype.redShl=function redShl(num){assert(this.red,'redShl works only with red numbers');return this.red.shl(this,num);};BN.prototype.redMul=function redMul(num){assert(this.red,'redMul works only with red numbers');this.red._verify2(this,num);return this.red.mul(this,num);};BN.prototype.redIMul=function redIMul(num){assert(this.red,'redMul works only with red numbers');this.red._verify2(this,num);return this.red.imul(this,num);};BN.prototype.redSqr=function redSqr(){assert(this.red,'redSqr works only with red numbers');this.red._verify1(this);return this.red.sqr(this);};BN.prototype.redISqr=function redISqr(){assert(this.red,'redISqr works only with red numbers');this.red._verify1(this);return this.red.isqr(this);};// Square root over p +BN.prototype.redSqrt=function redSqrt(){assert(this.red,'redSqrt works only with red numbers');this.red._verify1(this);return this.red.sqrt(this);};BN.prototype.redInvm=function redInvm(){assert(this.red,'redInvm works only with red numbers');this.red._verify1(this);return this.red.invm(this);};// Return negative clone of `this` % `red modulo` +BN.prototype.redNeg=function redNeg(){assert(this.red,'redNeg works only with red numbers');this.red._verify1(this);return this.red.neg(this);};BN.prototype.redPow=function redPow(num){assert(this.red&&!num.red,'redPow(normalNum)');this.red._verify1(this);return this.red.pow(this,num);};// Prime numbers with efficient reduction +var primes={k256:null,p224:null,p192:null,p25519:null};// Pseudo-Mersenne prime +function MPrime(name,p){// P = 2 ^ N - K +this.name=name;this.p=new BN(p,16);this.n=this.p.bitLength();this.k=new BN(1).ishln(this.n).isub(this.p);this.tmp=this._tmp();}MPrime.prototype._tmp=function _tmp(){var tmp=new BN(null);tmp.words=new Array(Math.ceil(this.n/13));return tmp;};MPrime.prototype.ireduce=function ireduce(num){// Assumes that `num` is less than `P^2` +// num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P) +var r=num;var rlen;do{this.split(r,this.tmp);r=this.imulK(r);r=r.iadd(this.tmp);rlen=r.bitLength();}while(rlen>this.n);var cmp=rlen0){r.isub(this.p);}else{r.strip();}return r;};MPrime.prototype.split=function split(input,out){input.ishrn(this.n,0,out);};MPrime.prototype.imulK=function imulK(num){return num.imul(this.k);};function K256(){MPrime.call(this,'k256','ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');}inherits(K256,MPrime);K256.prototype.split=function split(input,output){// 256 = 9 * 26 + 22 +var mask=0x3fffff;var outLen=Math.min(input.length,9);for(var i=0;i>>22;prev=next;}input.words[i-10]=prev>>>22;input.length-=9;};K256.prototype.imulK=function imulK(num){// K = 0x1000003d1 = [ 0x40, 0x3d1 ] +num.words[num.length]=0;num.words[num.length+1]=0;num.length+=2;// bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 +var hi;var lo=0;for(var i=0;i>>=26;num.words[i]=lo;carry=hi;}if(carry!==0)num.words[num.length++]=carry;return num;};// Exported mostly for testing purposes, use plain name instead +BN._prime=function prime(name){// Cached version of prime +if(primes[name])return primes[name];var prime;if(name==='k256')prime=new K256();else if(name==='p224')prime=new P224();else if(name==='p192')prime=new P192();else if(name==='p25519')prime=new P25519();else throw new Error('Unknown prime '+name);primes[name]=prime;return prime;};// +// Base reduction engine +// +function Red(m){if(typeof m==='string'){var prime=BN._prime(m);this.m=prime.p;this.prime=prime;}else{this.m=m;this.prime=null;}}Red.prototype._verify1=function _verify1(a){assert(!a.sign,'red works only with positives');assert(a.red,'red works only with red numbers');};Red.prototype._verify2=function _verify2(a,b){assert(!a.sign&&!b.sign,'red works only with positives');assert(a.red&&a.red===b.red,'red works only with red numbers');};Red.prototype.imod=function imod(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);return a.mod(this.m)._forceRed(this);};Red.prototype.neg=function neg(a){var r=a.clone();r.sign=!r.sign;return r.iadd(this.m)._forceRed(this);};Red.prototype.add=function add(a,b){this._verify2(a,b);var res=a.add(b);if(res.cmp(this.m)>=0)res.isub(this.m);return res._forceRed(this);};Red.prototype.iadd=function iadd(a,b){this._verify2(a,b);var res=a.iadd(b);if(res.cmp(this.m)>=0)res.isub(this.m);return res;};Red.prototype.sub=function sub(a,b){this._verify2(a,b);var res=a.sub(b);if(res.cmpn(0)<0)res.iadd(this.m);return res._forceRed(this);};Red.prototype.isub=function isub(a,b){this._verify2(a,b);var res=a.isub(b);if(res.cmpn(0)<0)res.iadd(this.m);return res;};Red.prototype.shl=function shl(a,num){this._verify1(a);return this.imod(a.shln(num));};Red.prototype.imul=function imul(a,b){this._verify2(a,b);return this.imod(a.imul(b));};Red.prototype.mul=function mul(a,b){this._verify2(a,b);return this.imod(a.mul(b));};Red.prototype.isqr=function isqr(a){return this.imul(a,a);};Red.prototype.sqr=function sqr(a){return this.mul(a,a);};Red.prototype.sqrt=function sqrt(a){if(a.cmpn(0)===0)return a.clone();var mod3=this.m.andln(3);assert(mod3%2===1);// Fast case +if(mod3===3){var pow=this.m.add(new BN(1)).ishrn(2);var r=this.pow(a,pow);return r;}// Tonelli-Shanks algorithm (Totally unoptimized and slow) +// +// Find Q and S, that Q * 2 ^ S = (P - 1) +var q=this.m.subn(1);var s=0;while(q.cmpn(0)!==0&&q.andln(1)===0){s++;q.ishrn(1);}assert(q.cmpn(0)!==0);var one=new BN(1).toRed(this);var nOne=one.redNeg();// Find quadratic non-residue +// NOTE: Max is such because of generalized Riemann hypothesis. +var lpow=this.m.subn(1).ishrn(1);var z=this.m.bitLength();z=new BN(2*z*z).toRed(this);while(this.pow(z,lpow).cmp(nOne)!==0){z.redIAdd(nOne);}var c=this.pow(z,q);var r=this.pow(a,q.addn(1).ishrn(1));var t=this.pow(a,q);var m=s;while(t.cmp(one)!==0){var tmp=t;for(var i=0;tmp.cmp(one)!==0;i++){tmp=tmp.redSqr();}assert(i=0)res=u.isub(this.m);else if(u.cmpn(0)<0)res=u.iadd(this.m);return res._forceRed(this);};Mont.prototype.mul=function mul(a,b){if(a.cmpn(0)===0||b.cmpn(0)===0)return new BN(0)._forceRed(this);var t=a.mul(b);var c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var u=t.isub(c).ishrn(this.shift);var res=u;if(u.cmp(this.m)>=0)res=u.isub(this.m);else if(u.cmpn(0)<0)res=u.iadd(this.m);return res._forceRed(this);};Mont.prototype.invm=function invm(a){// (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R +var res=this.imod(a._invmp(this.m).mul(this.r2));return res._forceRed(this);};})(typeof module==='undefined'||module,this);},{}],125:[function(require,module,exports){// Base58 encoding/decoding +// Originally written by Mike Hearn for BitcoinJ +// Copyright (c) 2011 Google Inc +// Ported to JavaScript by Stefan Thomas +// Merged Buffer refactorings from base58-native by Stephen Pair +// Copyright (c) 2013 BitPay Inc +var ALPHABET='123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';var ALPHABET_MAP={};for(var i=0;i>8;bytes[j]&=0xff;}while(carry){bytes.push(carry&0xff);carry>>=8;}}// deal with leading zeros +for(i=0;string[i]==='1'&&ito[i]?1:0;if(c!=0)break;}if(c==0){if(to.length>cmp.length)c=-1;else if(cmp.length>to.length)c=1;}return c;};},{}],127:[function(require,module,exports){'use strict';var elliptic=exports;elliptic.version=require('../package.json').version;elliptic.utils=require('./elliptic/utils');elliptic.rand=require('brorand');elliptic.hmacDRBG=require('./elliptic/hmac-drbg');elliptic.curve=require('./elliptic/curve');elliptic.curves=require('./elliptic/curves');// Protocols +elliptic.ec=require('./elliptic/ec');},{"../package.json":147,"./elliptic/curve":130,"./elliptic/curves":133,"./elliptic/ec":134,"./elliptic/hmac-drbg":137,"./elliptic/utils":139,"brorand":140}],128:[function(require,module,exports){'use strict';var bn=require('bn.js');var elliptic=require('../../elliptic');var getNAF=elliptic.utils.getNAF;var getJSF=elliptic.utils.getJSF;var assert=elliptic.utils.assert;function BaseCurve(type,conf){this.type=type;this.p=new bn(conf.p,16);// Use Montgomery, when there is no fast reduction for the prime +this.red=conf.prime?bn.red(conf.prime):bn.mont(this.p);// Useful for many curves +this.zero=new bn(0).toRed(this.red);this.one=new bn(1).toRed(this.red);this.two=new bn(2).toRed(this.red);// Curve configuration, optional +this.n=conf.n&&new bn(conf.n,16);this.g=conf.g&&this.pointFromJSON(conf.g,conf.gRed);// Temporary arrays +this._wnafT1=new Array(4);this._wnafT2=new Array(4);this._wnafT3=new Array(4);this._wnafT4=new Array(4);}module.exports=BaseCurve;BaseCurve.prototype.point=function point(){throw new Error('Not implemented');};BaseCurve.prototype.validate=function validate(){throw new Error('Not implemented');};BaseCurve.prototype._fixedNafMul=function _fixedNafMul(p,k){var doubles=p._getDoubles();var naf=getNAF(k,1);var I=(1<=j;k--){nafW=(nafW<<1)+naf[k];}repr.push(nafW);}var a=this.jpoint(null,null,null);var b=this.jpoint(null,null,null);for(var i=I;i>0;i--){for(var j=0;j=0;i--){// Count zeroes +for(var k=0;i>=0&&naf[i]===0;i--){k++;}if(i>=0)k++;acc=acc.dblp(k);if(i<0)break;var z=naf[i];assert(z!==0);if(p.type==='affine'){// J +- P +if(z>0)acc=acc.mixedAdd(wnd[z-1>>1]);else acc=acc.mixedAdd(wnd[-z-1>>1].neg());}else{// J +- J +if(z>0)acc=acc.add(wnd[z-1>>1]);else acc=acc.add(wnd[-z-1>>1].neg());}}return p.type==='affine'?acc.toP():acc;};BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(defW,points,coeffs,len){var wndWidth=this._wnafT1;var wnd=this._wnafT2;var naf=this._wnafT3;// Fill all arrays +var max=0;for(var i=0;i=1;i-=2){var a=i-1;var b=i;if(wndWidth[a]!==1||wndWidth[b]!==1){naf[a]=getNAF(coeffs[a],wndWidth[a]);naf[b]=getNAF(coeffs[b],wndWidth[b]);max=Math.max(naf[a].length,max);max=Math.max(naf[b].length,max);continue;}var comb=[points[a],/* 1 */null,/* 3 */null,/* 5 */points[b]/* 7 */];// Try to avoid Projective points, if possible +if(points[a].y.cmp(points[b].y)===0){comb[1]=points[a].add(points[b]);comb[2]=points[a].toJ().mixedAdd(points[b].neg());}else if(points[a].y.cmp(points[b].y.redNeg())===0){comb[1]=points[a].toJ().mixedAdd(points[b]);comb[2]=points[a].add(points[b].neg());}else{comb[1]=points[a].toJ().mixedAdd(points[b]);comb[2]=points[a].toJ().mixedAdd(points[b].neg());}var index=[-3,/* -1 -1 */-1,/* -1 0 */-5,/* -1 1 */-7,/* 0 -1 */0,/* 0 0 */7,/* 0 1 */5,/* 1 -1 */1,/* 1 0 */3/* 1 1 */];var jsf=getJSF(coeffs[a],coeffs[b]);max=Math.max(jsf[0].length,max);naf[a]=new Array(max);naf[b]=new Array(max);for(var j=0;j=0;i--){var k=0;while(i>=0){var zero=true;for(var j=0;j=0)k++;acc=acc.dblp(k);if(i<0)break;for(var j=0;j0)p=wnd[j][z-1>>1];else if(z<0)p=wnd[j][-z-1>>1].neg();if(p.type==='affine')acc=acc.mixedAdd(p);else acc=acc.add(p);}}// Zeroify references +for(var i=0;i';return'';};Point.prototype.isInfinity=function isInfinity(){// XXX This code assumes that zero is always zero in red +return this.x.cmpn(0)===0&&this.y.cmp(this.z)===0;};Point.prototype._extDbl=function _extDbl(){// hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html +// #doubling-dbl-2008-hwcd +// 4M + 4S +// A = X1^2 +var a=this.x.redSqr();// B = Y1^2 +var b=this.y.redSqr();// C = 2 * Z1^2 +var c=this.z.redSqr();c=c.redIAdd(c);// D = a * A +var d=this.curve._mulA(a);// E = (X1 + Y1)^2 - A - B +var e=this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);// G = D + B +var g=d.redAdd(b);// F = G - C +var f=g.redSub(c);// H = D - B +var h=d.redSub(b);// X3 = E * F +var nx=e.redMul(f);// Y3 = G * H +var ny=g.redMul(h);// T3 = E * H +var nt=e.redMul(h);// Z3 = F * G +var nz=f.redMul(g);return this.curve.point(nx,ny,nz,nt);};Point.prototype._projDbl=function _projDbl(){// hyperelliptic.org/EFD/g1p/auto-twisted-projective.html +// #doubling-dbl-2008-bbjlp +// #doubling-dbl-2007-bl +// and others +// Generally 3M + 4S or 2M + 4S +// B = (X1 + Y1)^2 +var b=this.x.redAdd(this.y).redSqr();// C = X1^2 +var c=this.x.redSqr();// D = Y1^2 +var d=this.y.redSqr();var nx;var ny;var nz;if(this.curve.twisted){// E = a * C +var e=this.curve._mulA(c);// F = E + D +var f=e.redAdd(d);if(this.zOne){// X3 = (B - C - D) * (F - 2) +nx=b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));// Y3 = F * (E - D) +ny=f.redMul(e.redSub(d));// Z3 = F^2 - 2 * F +nz=f.redSqr().redSub(f).redSub(f);}else{// H = Z1^2 +var h=this.z.redSqr();// J = F - 2 * H +var j=f.redSub(h).redISub(h);// X3 = (B-C-D)*J +nx=b.redSub(c).redISub(d).redMul(j);// Y3 = F * (E - D) +ny=f.redMul(e.redSub(d));// Z3 = F * J +nz=f.redMul(j);}}else{// E = C + D +var e=c.redAdd(d);// H = (c * Z1)^2 +var h=this.curve._mulC(this.c.redMul(this.z)).redSqr();// J = E - 2 * H +var j=e.redSub(h).redSub(h);// X3 = c * (B - E) * J +nx=this.curve._mulC(b.redISub(e)).redMul(j);// Y3 = c * E * (C - D) +ny=this.curve._mulC(e).redMul(c.redISub(d));// Z3 = E * J +nz=e.redMul(j);}return this.curve.point(nx,ny,nz);};Point.prototype.dbl=function dbl(){if(this.isInfinity())return this;// Double in extended coordinates +if(this.curve.extended)return this._extDbl();else return this._projDbl();};Point.prototype._extAdd=function _extAdd(p){// hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html +// #addition-add-2008-hwcd-3 +// 8M +// A = (Y1 - X1) * (Y2 - X2) +var a=this.y.redSub(this.x).redMul(p.y.redSub(p.x));// B = (Y1 + X1) * (Y2 + X2) +var b=this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));// C = T1 * k * T2 +var c=this.t.redMul(this.curve.dd).redMul(p.t);// D = Z1 * 2 * Z2 +var d=this.z.redMul(p.z.redAdd(p.z));// E = B - A +var e=b.redSub(a);// F = D - C +var f=d.redSub(c);// G = D + C +var g=d.redAdd(c);// H = B + A +var h=b.redAdd(a);// X3 = E * F +var nx=e.redMul(f);// Y3 = G * H +var ny=g.redMul(h);// T3 = E * H +var nt=e.redMul(h);// Z3 = F * G +var nz=f.redMul(g);return this.curve.point(nx,ny,nz,nt);};Point.prototype._projAdd=function _projAdd(p){// hyperelliptic.org/EFD/g1p/auto-twisted-projective.html +// #addition-add-2008-bbjlp +// #addition-add-2007-bl +// 10M + 1S +// A = Z1 * Z2 +var a=this.z.redMul(p.z);// B = A^2 +var b=a.redSqr();// C = X1 * X2 +var c=this.x.redMul(p.x);// D = Y1 * Y2 +var d=this.y.redMul(p.y);// E = d * C * D +var e=this.curve.d.redMul(c).redMul(d);// F = B - E +var f=b.redSub(e);// G = B + E +var g=b.redAdd(e);// X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D) +var tmp=this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);var nx=a.redMul(f).redMul(tmp);var ny;var nz;if(this.curve.twisted){// Y3 = A * G * (D - a * C) +ny=a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));// Z3 = F * G +nz=f.redMul(g);}else{// Y3 = A * G * (D - C) +ny=a.redMul(g).redMul(d.redSub(c));// Z3 = c * F * G +nz=this.curve._mulC(f).redMul(g);}return this.curve.point(nx,ny,nz);};Point.prototype.add=function add(p){if(this.isInfinity())return p;if(p.isInfinity())return this;if(this.curve.extended)return this._extAdd(p);else return this._projAdd(p);};Point.prototype.mul=function mul(k){if(this.precomputed&&this.precomputed.doubles)return this.curve._fixedNafMul(this,k);else return this.curve._wnafMul(this,k);};Point.prototype.mulAdd=function mulAdd(k1,p,k2){return this.curve._wnafMulAdd(1,[this,p],[k1,k2],2);};Point.prototype.normalize=function normalize(){if(this.zOne)return this;// Normalize coordinates +var zi=this.z.redInvm();this.x=this.x.redMul(zi);this.y=this.y.redMul(zi);if(this.t)this.t=this.t.redMul(zi);this.z=this.curve.one;this.zOne=true;return this;};Point.prototype.neg=function neg(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg());};Point.prototype.getX=function getX(){this.normalize();return this.x.fromRed();};Point.prototype.getY=function getY(){this.normalize();return this.y.fromRed();};// Compatibility with BaseCurve +Point.prototype.toP=Point.prototype.normalize;Point.prototype.mixedAdd=Point.prototype.add;},{"../../elliptic":127,"../curve":130,"bn.js":124,"inherits":148}],130:[function(require,module,exports){'use strict';var curve=exports;curve.base=require('./base');curve.short=require('./short');curve.mont=require('./mont');curve.edwards=require('./edwards');},{"./base":128,"./edwards":129,"./mont":131,"./short":132}],131:[function(require,module,exports){'use strict';var curve=require('../curve');var bn=require('bn.js');var inherits=require('inherits');var Base=curve.base;function MontCurve(conf){Base.call(this,'mont',conf);this.a=new bn(conf.a,16).toRed(this.red);this.b=new bn(conf.b,16).toRed(this.red);this.i4=new bn(4).toRed(this.red).redInvm();this.two=new bn(2).toRed(this.red);this.a24=this.i4.redMul(this.a.redAdd(this.two));}inherits(MontCurve,Base);module.exports=MontCurve;MontCurve.prototype.validate=function validate(point){var x=point.normalize().x;var x2=x.redSqr();var rhs=x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);var y=rhs.redSqrt();return y.redSqr().cmp(rhs)===0;};function Point(curve,x,z){Base.BasePoint.call(this,curve,'projective');if(x===null&&z===null){this.x=this.curve.one;this.z=this.curve.zero;}else{this.x=new bn(x,16);this.z=new bn(z,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);}}inherits(Point,Base.BasePoint);MontCurve.prototype.point=function point(x,z){return new Point(this,x,z);};MontCurve.prototype.pointFromJSON=function pointFromJSON(obj){return Point.fromJSON(this,obj);};Point.prototype.precompute=function precompute(){// No-op +};Point.fromJSON=function fromJSON(curve,obj){return new Point(curve,obj[0],obj[1]||curve.one);};Point.prototype.inspect=function inspect(){if(this.isInfinity())return'';return'';};Point.prototype.isInfinity=function isInfinity(){// XXX This code assumes that zero is always zero in red +return this.z.cmpn(0)===0;};Point.prototype.dbl=function dbl(){// http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3 +// 2M + 2S + 4A +// A = X1 + Z1 +var a=this.x.redAdd(this.z);// AA = A^2 +var aa=a.redSqr();// B = X1 - Z1 +var b=this.x.redSub(this.z);// BB = B^2 +var bb=b.redSqr();// C = AA - BB +var c=aa.redSub(bb);// X3 = AA * BB +var nx=aa.redMul(bb);// Z3 = C * (BB + A24 * C) +var nz=c.redMul(bb.redAdd(this.curve.a24.redMul(c)));return this.curve.point(nx,nz);};Point.prototype.add=function add(){throw new Error('Not supported on Montgomery curve');};Point.prototype.diffAdd=function diffAdd(p,diff){// http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3 +// 4M + 2S + 6A +// A = X2 + Z2 +var a=this.x.redAdd(this.z);// B = X2 - Z2 +var b=this.x.redSub(this.z);// C = X3 + Z3 +var c=p.x.redAdd(p.z);// D = X3 - Z3 +var d=p.x.redSub(p.z);// DA = D * A +var da=d.redMul(a);// CB = C * B +var cb=c.redMul(b);// X5 = Z1 * (DA + CB)^2 +var nx=diff.z.redMul(da.redAdd(cb).redSqr());// Z5 = X1 * (DA - CB)^2 +var nz=diff.x.redMul(da.redISub(cb).redSqr());return this.curve.point(nx,nz);};Point.prototype.mul=function mul(k){var t=k.clone();var a=this;// (N / 2) * Q + Q +var b=this.curve.point(null,null);// (N / 2) * Q +var c=this;// Q +for(var bits=[];t.cmpn(0)!==0;t.ishrn(1)){bits.push(t.andln(1));}for(var i=bits.length-1;i>=0;i--){if(bits[i]===0){// N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q +a=a.diffAdd(b,c);// N * Q = 2 * ((N / 2) * Q + Q)) +b=b.dbl();}else{// N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q) +b=a.diffAdd(b,c);// N * Q + Q = 2 * ((N / 2) * Q + Q) +a=a.dbl();}}return b;};Point.prototype.mulAdd=function mulAdd(){throw new Error('Not supported on Montgomery curve');};Point.prototype.normalize=function normalize(){this.x=this.x.redMul(this.z.redInvm());this.z=this.curve.one;return this;};Point.prototype.getX=function getX(){// Normalize coordinates +this.normalize();return this.x.fromRed();};},{"../curve":130,"bn.js":124,"inherits":148}],132:[function(require,module,exports){'use strict';var curve=require('../curve');var elliptic=require('../../elliptic');var bn=require('bn.js');var inherits=require('inherits');var Base=curve.base;var assert=elliptic.utils.assert;function ShortCurve(conf){Base.call(this,'short',conf);this.a=new bn(conf.a,16).toRed(this.red);this.b=new bn(conf.b,16).toRed(this.red);this.tinv=this.two.redInvm();this.zeroA=this.a.fromRed().cmpn(0)===0;this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0;// If the curve is endomorphic, precalculate beta and lambda +this.endo=this._getEndomorphism(conf);this._endoWnafT1=new Array(4);this._endoWnafT2=new Array(4);}inherits(ShortCurve,Base);module.exports=ShortCurve;ShortCurve.prototype._getEndomorphism=function _getEndomorphism(conf){// No efficient endomorphism +if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;// Compute beta and lambda, that lambda * P = (beta * Px; Py) +var beta;var lambda;if(conf.beta){beta=new bn(conf.beta,16).toRed(this.red);}else{var betas=this._getEndoRoots(this.p);// Choose the smallest beta +beta=betas[0].cmp(betas[1])<0?betas[0]:betas[1];beta=beta.toRed(this.red);}if(conf.lambda){lambda=new bn(conf.lambda,16);}else{// Choose the lambda that is matching selected beta +var lambdas=this._getEndoRoots(this.n);if(this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta))===0){lambda=lambdas[0];}else{lambda=lambdas[1];assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta))===0);}}// Get basis vectors, used for balanced length-two representation +var basis;if(conf.basis){basis=conf.basis.map(function(vec){return{a:new bn(vec.a,16),b:new bn(vec.b,16)};});}else{basis=this._getEndoBasis(lambda);}return{beta:beta,lambda:lambda,basis:basis};};ShortCurve.prototype._getEndoRoots=function _getEndoRoots(num){// Find roots of for x^2 + x + 1 in F +// Root = (-1 +- Sqrt(-3)) / 2 +// +var red=num===this.p?this.red:bn.mont(num);var tinv=new bn(2).toRed(red).redInvm();var ntinv=tinv.redNeg();var s=new bn(3).toRed(red).redNeg().redSqrt().redMul(tinv);var l1=ntinv.redAdd(s).fromRed();var l2=ntinv.redSub(s).fromRed();return[l1,l2];};ShortCurve.prototype._getEndoBasis=function _getEndoBasis(lambda){// aprxSqrt >= sqrt(this.n) +var aprxSqrt=this.n.shrn(Math.floor(this.n.bitLength()/2));// 3.74 +// Run EGCD, until r(L + 1) < aprxSqrt +var u=lambda;var v=this.n.clone();var x1=new bn(1);var y1=new bn(0);var x2=new bn(0);var y2=new bn(1);// NOTE: all vectors are roots of: a + b * lambda = 0 (mod n) +var a0;var b0;// First vector +var a1;var b1;// Second vector +var a2;var b2;var prevR;var i=0;var r;var x;while(u.cmpn(0)!==0){var q=v.div(u);r=v.sub(q.mul(u));x=x2.sub(q.mul(x1));var y=y2.sub(q.mul(y1));if(!a1&&r.cmp(aprxSqrt)<0){a0=prevR.neg();b0=x1;a1=r.neg();b1=x;}else if(a1&&++i===2){break;}prevR=r;v=u;u=r;x2=x1;x1=x;y2=y1;y1=y;}a2=r.neg();b2=x;var len1=a1.sqr().add(b1.sqr());var len2=a2.sqr().add(b2.sqr());if(len2.cmp(len1)>=0){a2=a0;b2=b0;}// Normalize signs +if(a1.sign){a1=a1.neg();b1=b1.neg();}if(a2.sign){a2=a2.neg();b2=b2.neg();}return[{a:a1,b:b1},{a:a2,b:b2}];};ShortCurve.prototype._endoSplit=function _endoSplit(k){var basis=this.endo.basis;var v1=basis[0];var v2=basis[1];var c1=v2.b.mul(k).divRound(this.n);var c2=v1.b.neg().mul(k).divRound(this.n);var p1=c1.mul(v1.a);var p2=c2.mul(v2.a);var q1=c1.mul(v1.b);var q2=c2.mul(v2.b);// Calculate answer +var k1=k.sub(p1).sub(p2);var k2=q1.add(q2).neg();return{k1:k1,k2:k2};};ShortCurve.prototype.pointFromX=function pointFromX(odd,x){x=new bn(x,16);if(!x.red)x=x.toRed(this.red);var y2=x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);var y=y2.redSqrt();// XXX Is there any way to tell if the number is odd without converting it +// to non-red form? +var isOdd=y.fromRed().isOdd();if(odd&&!isOdd||!odd&&isOdd)y=y.redNeg();return this.point(x,y);};ShortCurve.prototype.validate=function validate(point){if(point.inf)return true;var x=point.x;var y=point.y;var ax=this.a.redMul(x);var rhs=x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);return y.redSqr().redISub(rhs).cmpn(0)===0;};ShortCurve.prototype._endoWnafMulAdd=function _endoWnafMulAdd(points,coeffs){var npoints=this._endoWnafT1;var ncoeffs=this._endoWnafT2;for(var i=0;i';return'';};Point.prototype.isInfinity=function isInfinity(){return this.inf;};Point.prototype.add=function add(p){// O + P = P +if(this.inf)return p;// P + O = P +if(p.inf)return this;// P + P = 2P +if(this.eq(p))return this.dbl();// P + (-P) = O +if(this.neg().eq(p))return this.curve.point(null,null);// P + Q = O +if(this.x.cmp(p.x)===0)return this.curve.point(null,null);var c=this.y.redSub(p.y);if(c.cmpn(0)!==0)c=c.redMul(this.x.redSub(p.x).redInvm());var nx=c.redSqr().redISub(this.x).redISub(p.x);var ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny);};Point.prototype.dbl=function dbl(){if(this.inf)return this;// 2P = O +var ys1=this.y.redAdd(this.y);if(ys1.cmpn(0)===0)return this.curve.point(null,null);var a=this.curve.a;var x2=this.x.redSqr();var dyinv=ys1.redInvm();var c=x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);var nx=c.redSqr().redISub(this.x.redAdd(this.x));var ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny);};Point.prototype.getX=function getX(){return this.x.fromRed();};Point.prototype.getY=function getY(){return this.y.fromRed();};Point.prototype.mul=function mul(k){k=new bn(k,16);if(this.precomputed&&this.precomputed.doubles)return this.curve._fixedNafMul(this,k);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[k]);else return this.curve._wnafMul(this,k);};Point.prototype.mulAdd=function mulAdd(k1,p2,k2){var points=[this,p2];var coeffs=[k1,k2];if(this.curve.endo)return this.curve._endoWnafMulAdd(points,coeffs);else return this.curve._wnafMulAdd(1,points,coeffs,2);};Point.prototype.eq=function eq(p){return this===p||this.inf===p.inf&&(this.inf||this.x.cmp(p.x)===0&&this.y.cmp(p.y)===0);};Point.prototype.neg=function neg(_precompute){if(this.inf)return this;var res=this.curve.point(this.x,this.y.redNeg());if(_precompute&&this.precomputed){var pre=this.precomputed;var negate=function negate(p){return p.neg();};res.precomputed={naf:pre.naf&&{wnd:pre.naf.wnd,points:pre.naf.points.map(negate)},doubles:pre.doubles&&{step:pre.doubles.step,points:pre.doubles.points.map(negate)}};}return res;};Point.prototype.toJ=function toJ(){if(this.inf)return this.curve.jpoint(null,null,null);var res=this.curve.jpoint(this.x,this.y,this.curve.one);return res;};function JPoint(curve,x,y,z){Base.BasePoint.call(this,curve,'jacobian');if(x===null&&y===null&&z===null){this.x=this.curve.one;this.y=this.curve.one;this.z=new bn(0);}else{this.x=new bn(x,16);this.y=new bn(y,16);this.z=new bn(z,16);}if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one;}inherits(JPoint,Base.BasePoint);ShortCurve.prototype.jpoint=function jpoint(x,y,z){return new JPoint(this,x,y,z);};JPoint.prototype.toP=function toP(){if(this.isInfinity())return this.curve.point(null,null);var zinv=this.z.redInvm();var zinv2=zinv.redSqr();var ax=this.x.redMul(zinv2);var ay=this.y.redMul(zinv2).redMul(zinv);return this.curve.point(ax,ay);};JPoint.prototype.neg=function neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z);};JPoint.prototype.add=function add(p){// O + P = P +if(this.isInfinity())return p;// P + O = P +if(p.isInfinity())return this;// 12M + 4S + 7A +var pz2=p.z.redSqr();var z2=this.z.redSqr();var u1=this.x.redMul(pz2);var u2=p.x.redMul(z2);var s1=this.y.redMul(pz2.redMul(p.z));var s2=p.y.redMul(z2.redMul(this.z));var h=u1.redSub(u2);var r=s1.redSub(s2);if(h.cmpn(0)===0){if(r.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();}var h2=h.redSqr();var h3=h2.redMul(h);var v=u1.redMul(h2);var nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v);var ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));var nz=this.z.redMul(p.z).redMul(h);return this.curve.jpoint(nx,ny,nz);};JPoint.prototype.mixedAdd=function mixedAdd(p){// O + P = P +if(this.isInfinity())return p.toJ();// P + O = P +if(p.isInfinity())return this;// 8M + 3S + 7A +var z2=this.z.redSqr();var u1=this.x;var u2=p.x.redMul(z2);var s1=this.y;var s2=p.y.redMul(z2).redMul(this.z);var h=u1.redSub(u2);var r=s1.redSub(s2);if(h.cmpn(0)===0){if(r.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();}var h2=h.redSqr();var h3=h2.redMul(h);var v=u1.redMul(h2);var nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v);var ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));var nz=this.z.redMul(h);return this.curve.jpoint(nx,ny,nz);};JPoint.prototype.dblp=function dblp(pow){if(pow===0)return this;if(this.isInfinity())return this;if(!pow)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var r=this;for(var i=0;i 6M + 6S + 9A +var a=this.curve.a;var tinv=this.curve.tinv;var jx=this.x;var jy=this.y;var jz=this.z;var jz4=jz.redSqr().redSqr();// Reuse results +var jyd=jy.redAdd(jy);for(var i=0;i';return'';};JPoint.prototype.isInfinity=function isInfinity(){// XXX This code assumes that zero is always zero in red +return this.z.cmpn(0)===0;};},{"../../elliptic":127,"../curve":130,"bn.js":124,"inherits":148}],133:[function(require,module,exports){'use strict';var curves=exports;var hash=require('hash.js');var elliptic=require('../elliptic');var assert=elliptic.utils.assert;function PresetCurve(options){if(options.type==='short')this.curve=new elliptic.curve.short(options);else if(options.type==='edwards')this.curve=new elliptic.curve.edwards(options);else this.curve=new elliptic.curve.mont(options);this.g=this.curve.g;this.n=this.curve.n;this.hash=options.hash;assert(this.g.validate(),'Invalid curve');assert(this.g.mul(this.n).isInfinity(),'Invalid curve, G*N != O');}curves.PresetCurve=PresetCurve;function defineCurve(name,options){Object.defineProperty(curves,name,{configurable:true,enumerable:true,get:function get(){var curve=new PresetCurve(options);Object.defineProperty(curves,name,{configurable:true,enumerable:true,value:curve});return curve;}});}defineCurve('p192',{type:'short',prime:'p192',p:'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',a:'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',b:'64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',n:'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',hash:hash.sha256,gRed:false,g:['188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012','07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811']});defineCurve('p224',{type:'short',prime:'p224',p:'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',a:'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',b:'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',n:'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',hash:hash.sha256,gRed:false,g:['b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21','bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34']});defineCurve('p256',{type:'short',prime:null,p:'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',a:'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',b:'5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',n:'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',hash:hash.sha256,gRed:false,g:['6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296','4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5']});defineCurve('curve25519',{type:'mont',prime:'p25519',p:'7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',a:'76d06',b:'0',n:'1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',hash:hash.sha256,gRed:false,g:['9']});defineCurve('ed25519',{type:'edwards',prime:'p25519',p:'7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',a:'-1',c:'1',// -121665 * (121666^(-1)) (mod P) +d:'52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',n:'1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',hash:hash.sha256,gRed:false,g:['216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',// 4/5 +'6666666666666666666666666666666666666666666666666666666666666658']});var pre;try{pre=require('./precomputed/secp256k1');}catch(e){pre=undefined;}defineCurve('secp256k1',{type:'short',prime:'k256',p:'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',a:'0',b:'7',n:'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',h:'1',hash:hash.sha256,// Precomputed endomorphism +beta:'7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',lambda:'5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',basis:[{a:'3086d221a7d46bcde86c90e49284eb15',b:'-e4437ed6010e88286f547fa90abfe4c3'},{a:'114ca50f7a8e2f3f657c1108d9d44cfd8',b:'3086d221a7d46bcde86c90e49284eb15'}],gRed:false,g:['79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798','483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',pre]});},{"../elliptic":127,"./precomputed/secp256k1":138,"hash.js":141}],134:[function(require,module,exports){'use strict';var bn=require('bn.js');var elliptic=require('../../elliptic');var utils=elliptic.utils;var assert=utils.assert;var KeyPair=require('./key');var Signature=require('./signature');function EC(options){if(!(this instanceof EC))return new EC(options);// Shortcut `elliptic.ec(curve-name)` +if(typeof options==='string'){assert(elliptic.curves.hasOwnProperty(options),'Unknown curve '+options);options=elliptic.curves[options];}// Shortcut for `elliptic.ec(elliptic.curves.curveName)` +if(options instanceof elliptic.curves.PresetCurve)options={curve:options};this.curve=options.curve.curve;this.n=this.curve.n;this.nh=this.n.shrn(1);this.g=this.curve.g;// Point on curve +this.g=options.curve.g;this.g.precompute(options.curve.n.bitLength()+1);// Hash for function for DRBG +this.hash=options.hash||options.curve.hash;}module.exports=EC;EC.prototype.keyPair=function keyPair(options){return new KeyPair(this,options);};EC.prototype.keyFromPrivate=function keyFromPrivate(priv,enc){return KeyPair.fromPrivate(this,priv,enc);};EC.prototype.keyFromPublic=function keyFromPublic(pub,enc){return KeyPair.fromPublic(this,pub,enc);};EC.prototype.genKeyPair=function genKeyPair(options){if(!options)options={};// Instantiate Hmac_DRBG +var drbg=new elliptic.hmacDRBG({hash:this.hash,pers:options.pers,entropy:options.entropy||elliptic.rand(this.hash.hmacStrength),nonce:this.n.toArray()});var bytes=this.n.byteLength();var ns2=this.n.sub(new bn(2));do{var priv=new bn(drbg.generate(bytes));if(priv.cmp(ns2)>0)continue;priv.iaddn(1);return this.keyFromPrivate(priv);}while(true);};EC.prototype._truncateToN=function truncateToN(msg,truncOnly){var delta=msg.byteLength()*8-this.n.bitLength();if(delta>0)msg=msg.shrn(delta);if(!truncOnly&&msg.cmp(this.n)>=0)return msg.sub(this.n);else return msg;};EC.prototype.sign=function sign(msg,key,enc,options){if((typeof enc==="undefined"?"undefined":_typeof(enc))==='object'){options=enc;enc=null;}if(!options)options={};key=this.keyFromPrivate(key,enc);msg=this._truncateToN(new bn(msg,16));// Zero-extend key to provide enough entropy +var bytes=this.n.byteLength();var bkey=key.getPrivate().toArray();for(var i=bkey.length;i<21;i++){bkey.unshift(0);}// Zero-extend nonce to have the same byte size as N +var nonce=msg.toArray();for(var i=nonce.length;i=0)continue;var kp=this.g.mul(k);if(kp.isInfinity())continue;var r=kp.getX().mod(this.n);if(r.cmpn(0)===0)continue;var s=k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg)).mod(this.n);if(s.cmpn(0)===0)continue;// Use complement of `s`, if it is > `n / 2` +if(options.canonical&&s.cmp(this.nh)>0)s=this.n.sub(s);return new Signature({r:r,s:s});}while(true);};EC.prototype.verify=function verify(msg,signature,key,enc){msg=this._truncateToN(new bn(msg,16));key=this.keyFromPublic(key,enc);signature=new Signature(signature,'hex');// Perform primitive values validation +var r=signature.r;var s=signature.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return false;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return false;// Validate signature +var sinv=s.invm(this.n);var u1=sinv.mul(msg).mod(this.n);var u2=sinv.mul(r).mod(this.n);var p=this.g.mulAdd(u1,key.getPublic(),u2);if(p.isInfinity())return false;return p.getX().mod(this.n).cmp(r)===0;};},{"../../elliptic":127,"./key":135,"./signature":136,"bn.js":124}],135:[function(require,module,exports){'use strict';var bn=require('bn.js');var elliptic=require('../../elliptic');var utils=elliptic.utils;function KeyPair(ec,options){this.ec=ec;this.priv=null;this.pub=null;// KeyPair(ec, { priv: ..., pub: ... }) +if(options.priv)this._importPrivate(options.priv,options.privEnc);if(options.pub)this._importPublic(options.pub,options.pubEnc);}module.exports=KeyPair;KeyPair.fromPublic=function fromPublic(ec,pub,enc){if(pub instanceof KeyPair)return pub;return new KeyPair(ec,{pub:pub,pubEnc:enc});};KeyPair.fromPrivate=function fromPrivate(ec,priv,enc){if(priv instanceof KeyPair)return priv;return new KeyPair(ec,{priv:priv,privEnc:enc});};KeyPair.prototype.validate=function validate(){var pub=this.getPublic();if(pub.isInfinity())return{result:false,reason:'Invalid public key'};if(!pub.validate())return{result:false,reason:'Public key is not a point'};if(!pub.mul(this.ec.curve.n).isInfinity())return{result:false,reason:'Public key * N != O'};return{result:true,reason:null};};KeyPair.prototype.getPublic=function getPublic(compact,enc){if(!this.pub)this.pub=this.ec.g.mul(this.priv);// compact is optional argument +if(typeof compact==='string'){enc=compact;compact=null;}if(!enc)return this.pub;var len=this.ec.curve.p.byteLength();var x=this.pub.getX().toArray();for(var i=x.length;i';};},{"../../elliptic":127,"bn.js":124}],136:[function(require,module,exports){'use strict';var bn=require('bn.js');var elliptic=require('../../elliptic');var utils=elliptic.utils;var assert=utils.assert;function Signature(options,enc){if(options instanceof Signature)return options;if(this._importDER(options,enc))return;assert(options.r&&options.s,'Signature without r or s');this.r=new bn(options.r,16);this.s=new bn(options.s,16);}module.exports=Signature;Signature.prototype._importDER=function _importDER(data,enc){data=utils.toArray(data,enc);if(data.length<6||data[0]!==0x30||data[2]!==0x02)return false;var total=data[1];if(1+total>data.length)return false;var rlen=data[3];// Short length notation +if(rlen>=0x80)return false;if(4+rlen+2>=data.length)return false;if(data[4+rlen]!==0x02)return false;var slen=data[5+rlen];// Short length notation +if(slen>=0x80)return false;if(4+rlen+2+slen>data.length)return false;this.r=new bn(data.slice(4,4+rlen));this.s=new bn(data.slice(4+rlen+2,4+rlen+2+slen));return true;};Signature.prototype.toDER=function toDER(enc){var r=this.r.toArray();var s=this.s.toArray();// Pad values +if(r[0]&0x80)r=[0].concat(r);// Pad values +if(s[0]&0x80)s=[0].concat(s);var total=r.length+s.length+4;var res=[0x30,total,0x02,r.length];res=res.concat(r,[0x02,s.length],s);return utils.encode(res,enc);};},{"../../elliptic":127,"bn.js":124}],137:[function(require,module,exports){'use strict';var hash=require('hash.js');var elliptic=require('../elliptic');var utils=elliptic.utils;var assert=utils.assert;function HmacDRBG(options){if(!(this instanceof HmacDRBG))return new HmacDRBG(options);this.hash=options.hash;this.predResist=!!options.predResist;this.outLen=this.hash.outSize;this.minEntropy=options.minEntropy||this.hash.hmacStrength;this.reseed=null;this.reseedInterval=null;this.K=null;this.V=null;var entropy=utils.toArray(options.entropy,options.entropyEnc);var nonce=utils.toArray(options.nonce,options.nonceEnc);var pers=utils.toArray(options.pers,options.persEnc);assert(entropy.length>=this.minEntropy/8,'Not enough entropy. Minimum is: '+this.minEntropy+' bits');this._init(entropy,nonce,pers);}module.exports=HmacDRBG;HmacDRBG.prototype._init=function init(entropy,nonce,pers){var seed=entropy.concat(nonce).concat(pers);this.K=new Array(this.outLen/8);this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,'Not enough entropy. Minimum is: '+this.minEntropy+' bits');this._update(entropy.concat(add||[]));this.reseed=1;};HmacDRBG.prototype.generate=function generate(len,enc,add,addEnc){if(this.reseed>this.reseedInterval)throw new Error('Reseed is required');// Optional encoding +if(typeof enc!=='string'){addEnc=add;add=enc;enc=null;}// Optional additional data +if(add){add=utils.toArray(add,addEnc);this._update(add);}var temp=[];while(temp.length>8;var lo=c&0xff;if(hi)res.push(hi,lo);else res.push(lo);}}else if(enc==='hex'){msg=msg.replace(/[^a-z0-9]+/ig,'');if(msg.length%2!==0)msg='0'+msg;for(var i=0;i=0){var z;if(k.isOdd()){var mod=k.andln(ws-1);if(mod>(ws>>1)-1)z=(ws>>1)-mod;else z=mod;k.isubn(z);}else{z=0;}naf.push(z);// Optimization, shift by word if possible +var shift=k.cmpn(0)!==0&&k.andln(ws-1)===0?w+1:1;for(var i=1;i0||k2.cmpn(-d2)>0){// First phase +var m14=k1.andln(3)+d1&3;var m24=k2.andln(3)+d2&3;if(m14===3)m14=-1;if(m24===3)m24=-1;var u1;if((m14&1)===0){u1=0;}else{var m8=k1.andln(7)+d1&7;if((m8===3||m8===5)&&m24===2)u1=-m14;else u1=m14;}jsf[0].push(u1);var u2;if((m24&1)===0){u2=0;}else{var m8=k2.andln(7)+d2&7;if((m8===3||m8===5)&&m14===2)u2=-m24;else u2=m24;}jsf[1].push(u2);// Second phase +if(2*d1===u1+1)d1=1-d1;if(2*d2===u2+1)d2=1-d2;k1.ishrn(1);k2.ishrn(1);}return jsf;}utils.getJSF=getJSF;},{}],140:[function(require,module,exports){var r;module.exports=function rand(len){if(!r)r=new Rand(null);return r.generate(len);};function Rand(rand){this.rand=rand;}module.exports.Rand=Rand;Rand.prototype.generate=function generate(len){return this._rand(len);};if((typeof window==="undefined"?"undefined":_typeof(window))==='object'){if(window.crypto&&window.crypto.getRandomValues){// Modern browsers +Rand.prototype._rand=function _rand(n){var arr=new Uint8Array(n);window.crypto.getRandomValues(arr);return arr;};}else if(window.msCrypto&&window.msCrypto.getRandomValues){// IE +Rand.prototype._rand=function _rand(n){var arr=new Uint8Array(n);window.msCrypto.getRandomValues(arr);return arr;};}else{// Old junk +Rand.prototype._rand=function(){throw new Error('Not implemented yet');};}}else{// Node.js or Web worker +try{var crypto=require('cry'+'pto');Rand.prototype._rand=function _rand(n){return crypto.randomBytes(n);};}catch(e){// Emulate crypto API using randy +Rand.prototype._rand=function _rand(n){var res=new Uint8Array(n);for(var i=0;i=this._delta8){msg=this.pending;// Process pending data in blocks +var r=msg.length%this._delta8;this.pending=msg.slice(msg.length-r,msg.length);if(this.pending.length===0)this.pending=null;msg=utils.join32(msg,0,msg.length-r,this.endian);for(var i=0;i>>24&0xff;res[i++]=len>>>16&0xff;res[i++]=len>>>8&0xff;res[i++]=len&0xff;}else{res[i++]=len&0xff;res[i++]=len>>>8&0xff;res[i++]=len>>>16&0xff;res[i++]=len>>>24&0xff;res[i++]=0;res[i++]=0;res[i++]=0;res[i++]=0;for(var t=8;tthis.blockSize)key=new this.Hash().update(key).digest();assert(key.length<=this.blockSize);// Add padding to key +for(var i=key.length;i>>3;}function g1_256(x){return rotr32(x,17)^rotr32(x,19)^x>>>10;}function ft_1(s,x,y,z){if(s===0)return ch32(x,y,z);if(s===1||s===3)return p32(x,y,z);if(s===2)return maj32(x,y,z);}function ch64_hi(xh,xl,yh,yl,zh,zl){var r=xh&yh^~xh&zh;if(r<0)r+=0x100000000;return r;}function ch64_lo(xh,xl,yh,yl,zh,zl){var r=xl&yl^~xl&zl;if(r<0)r+=0x100000000;return r;}function maj64_hi(xh,xl,yh,yl,zh,zl){var r=xh&yh^xh&zh^yh&zh;if(r<0)r+=0x100000000;return r;}function maj64_lo(xh,xl,yh,yl,zh,zl){var r=xl&yl^xl&zl^yl&zl;if(r<0)r+=0x100000000;return r;}function s0_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,28);var c1_hi=rotr64_hi(xl,xh,2);// 34 +var c2_hi=rotr64_hi(xl,xh,7);// 39 +var r=c0_hi^c1_hi^c2_hi;if(r<0)r+=0x100000000;return r;}function s0_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,28);var c1_lo=rotr64_lo(xl,xh,2);// 34 +var c2_lo=rotr64_lo(xl,xh,7);// 39 +var r=c0_lo^c1_lo^c2_lo;if(r<0)r+=0x100000000;return r;}function s1_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,14);var c1_hi=rotr64_hi(xh,xl,18);var c2_hi=rotr64_hi(xl,xh,9);// 41 +var r=c0_hi^c1_hi^c2_hi;if(r<0)r+=0x100000000;return r;}function s1_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,14);var c1_lo=rotr64_lo(xh,xl,18);var c2_lo=rotr64_lo(xl,xh,9);// 41 +var r=c0_lo^c1_lo^c2_lo;if(r<0)r+=0x100000000;return r;}function g0_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,1);var c1_hi=rotr64_hi(xh,xl,8);var c2_hi=shr64_hi(xh,xl,7);var r=c0_hi^c1_hi^c2_hi;if(r<0)r+=0x100000000;return r;}function g0_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,1);var c1_lo=rotr64_lo(xh,xl,8);var c2_lo=shr64_lo(xh,xl,7);var r=c0_lo^c1_lo^c2_lo;if(r<0)r+=0x100000000;return r;}function g1_512_hi(xh,xl){var c0_hi=rotr64_hi(xh,xl,19);var c1_hi=rotr64_hi(xl,xh,29);// 61 +var c2_hi=shr64_hi(xh,xl,6);var r=c0_hi^c1_hi^c2_hi;if(r<0)r+=0x100000000;return r;}function g1_512_lo(xh,xl){var c0_lo=rotr64_lo(xh,xl,19);var c1_lo=rotr64_lo(xl,xh,29);// 61 +var c2_lo=shr64_lo(xh,xl,6);var r=c0_lo^c1_lo^c2_lo;if(r<0)r+=0x100000000;return r;}},{"../hash":141}],146:[function(require,module,exports){var utils=exports;var inherits=require('inherits');function toArray(msg,enc){if(Array.isArray(msg))return msg.slice();if(!msg)return[];var res=[];if(typeof msg==='string'){if(!enc){for(var i=0;i>8;var lo=c&0xff;if(hi)res.push(hi,lo);else res.push(lo);}}else if(enc==='hex'){msg=msg.replace(/[^a-z0-9]+/ig,'');if(msg.length%2!==0)msg='0'+msg;for(var i=0;i>>24|w>>>8&0xff00|w<<8&0xff0000|(w&0xff)<<24;return res>>>0;}utils.htonl=htonl;function toHex32(msg,endian){var res='';for(var i=0;i>>0;}return res;}utils.join32=join32;function split32(msg,endian){var res=new Array(msg.length*4);for(var i=0,k=0;i>>24;res[k+1]=m>>>16&0xff;res[k+2]=m>>>8&0xff;res[k+3]=m&0xff;}else{res[k+3]=m>>>24;res[k+2]=m>>>16&0xff;res[k+1]=m>>>8&0xff;res[k]=m&0xff;}}return res;}utils.split32=split32;function rotr32(w,b){return w>>>b|w<<32-b;}utils.rotr32=rotr32;function rotl32(w,b){return w<>>32-b;}utils.rotl32=rotl32;function sum32(a,b){return a+b>>>0;}utils.sum32=sum32;function sum32_3(a,b,c){return a+b+c>>>0;}utils.sum32_3=sum32_3;function sum32_4(a,b,c,d){return a+b+c+d>>>0;}utils.sum32_4=sum32_4;function sum32_5(a,b,c,d,e){return a+b+c+d+e>>>0;}utils.sum32_5=sum32_5;function assert(cond,msg){if(!cond)throw new Error(msg||'Assertion failed');}utils.assert=assert;utils.inherits=inherits;function sum64(buf,pos,ah,al){var bh=buf[pos];var bl=buf[pos+1];var lo=al+bl>>>0;var hi=(lo>>0;buf[pos+1]=lo;}exports.sum64=sum64;function sum64_hi(ah,al,bh,bl){var lo=al+bl>>>0;var hi=(lo>>0;};exports.sum64_hi=sum64_hi;function sum64_lo(ah,al,bh,bl){var lo=al+bl;return lo>>>0;};exports.sum64_lo=sum64_lo;function sum64_4_hi(ah,al,bh,bl,ch,cl,dh,dl){var carry=0;var lo=al;lo=lo+bl>>>0;carry+=lo>>0;carry+=lo>>0;carry+=lo>>0;};exports.sum64_4_hi=sum64_4_hi;function sum64_4_lo(ah,al,bh,bl,ch,cl,dh,dl){var lo=al+bl+cl+dl;return lo>>>0;};exports.sum64_4_lo=sum64_4_lo;function sum64_5_hi(ah,al,bh,bl,ch,cl,dh,dl,eh,el){var carry=0;var lo=al;lo=lo+bl>>>0;carry+=lo>>0;carry+=lo>>0;carry+=lo>>0;carry+=lo>>0;};exports.sum64_5_hi=sum64_5_hi;function sum64_5_lo(ah,al,bh,bl,ch,cl,dh,dl,eh,el){var lo=al+bl+cl+dl+el;return lo>>>0;};exports.sum64_5_lo=sum64_5_lo;function rotr64_hi(ah,al,num){var r=al<<32-num|ah>>>num;return r>>>0;};exports.rotr64_hi=rotr64_hi;function rotr64_lo(ah,al,num){var r=ah<<32-num|al>>>num;return r>>>0;};exports.rotr64_lo=rotr64_lo;function shr64_hi(ah,al,num){return ah>>>num;};exports.shr64_hi=shr64_hi;function shr64_lo(ah,al,num){var r=ah<<32-num|al>>>num;return r>>>0;};exports.shr64_lo=shr64_lo;},{"inherits":148}],147:[function(require,module,exports){module.exports={"_args":[["elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib"]],"_from":"elliptic@=3.0.3","_id":"elliptic@3.0.3","_inCache":true,"_location":"/bitcore-lib/elliptic","_phantomChildren":{"inherits":"2.0.1"},"_requested":{"name":"elliptic","raw":"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","rawSpec":"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","scope":null,"spec":"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","type":"remote"},"_requiredBy":["/bitcore-lib"],"_resolved":"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","_shasum":"865c9b420bfbe55006b9f969f97a0d2c44966595","_shrinkwrap":null,"_spec":"elliptic@https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","_where":"/home/administrator/javascript-opentimestamps/node_modules/bitcore-lib","author":{"email":"fedor@indutny.com","name":"Fedor Indutny"},"bugs":{"url":"https://github.com/indutny/elliptic/issues"},"dependencies":{"bn.js":"^2.0.0","brorand":"^1.0.1","hash.js":"^1.0.0","inherits":"^2.0.1"},"description":"EC cryptography","devDependencies":{"browserify":"^3.44.2","jscs":"^1.11.3","jshint":"^2.6.0","mocha":"^2.1.0","uglify-js":"^2.4.13"},"homepage":"https://github.com/indutny/elliptic","keywords":["Cryptography","EC","Elliptic","curve"],"license":"MIT","main":"lib/elliptic.js","name":"elliptic","optionalDependencies":{},"readme":"# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic)\n\nFast elliptic-curve cryptography in a plain javascript implementation.\n\nNOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve\nfor your cryptography operations.\n\n## Incentive\n\nECC is much slower than regular RSA cryptography, the JS implementations are\neven more slower.\n\n## Benchmarks\n\n```bash\n$ node benchmarks/index.js\nBenchmarking: sign\nelliptic#sign x 262 ops/sec ±0.51% (177 runs sampled)\neccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled)\n------------------------\nFastest is elliptic#sign\n========================\nBenchmarking: verify\nelliptic#verify x 113 ops/sec ±0.50% (166 runs sampled)\neccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled)\n------------------------\nFastest is elliptic#verify\n========================\nBenchmarking: gen\nelliptic#gen x 294 ops/sec ±0.43% (176 runs sampled)\neccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled)\n------------------------\nFastest is elliptic#gen\n========================\nBenchmarking: ecdh\nelliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled)\n------------------------\nFastest is elliptic#ecdh\n========================\n```\n\n## API\n\n### ECDSA\n\n```javascript\nvar EC = require('elliptic').ec;\n\n// Create and initialize EC context\n// (better do it once and reuse it)\nvar ec = new EC('secp256k1');\n\n// Generate keys\nvar key = ec.genKeyPair();\n\n// Sign message (must be an array, or it'll be treated as a hex sequence)\nvar msg = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];\nvar signature = key.sign(msg);\n\n// Export DER encoded signature in Array\nvar derSign = signature.toDER();\n\n// Verify signature\nconsole.log(key.verify(msg, derSign));\n```\n\n### ECDH\n\n```javascript\n// Generate keys\nvar key1 = ec.genKeyPair();\nvar key2 = ec.genKeyPair();\n\nvar shared1 = key1.derive(key2.getPublic());\nvar shared2 = key2.derive(key1.getPublic());\n\nconsole.log('Both shared secrets are BN instances');\nconsole.log(shared1.toString(16));\nconsole.log(shared2.toString(16));\n```\n\nNOTE: `.derive()` returns a [BN][1] instance.\n\n## Supported curves\n\nElliptic.js support following curve types:\n\n* Short Weierstrass\n* Montgomery\n* Edwards\n* Twisted Edwards\n\nFollowing curve 'presets' are embedded into the library:\n\n* `secp256k1`\n* `p192`\n* `p224`\n* `p256`\n* `curve25519`\n* `ed25519`\n\nNOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead.\n\n### Implementation details\n\nECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of\nthe curve operations are performed on non-affine coordinates (either projective\nor extended), various windowing techniques are used for different cases.\n\nAll operations are performed in reduction context using [bn.js][1], hashing is\nprovided by [hash.js][2]\n\n### Related projects\n\n* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both\n browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for\n node)\n\n#### LICENSE\n\nThis software is licensed under the MIT License.\n\nCopyright Fedor Indutny, 2014.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[0]: http://tools.ietf.org/html/rfc6979\n[1]: https://github.com/indutny/bn.js\n[2]: https://github.com/indutny/hash.js\n[3]: https://github.com/bitchan/eccrypto\n[4]: https://github.com/wanderer/secp256k1-node\n","readmeFilename":"README.md","repository":{"type":"git","url":"git+ssh://git@github.com/indutny/elliptic.git"},"scripts":{"test":"make lint && mocha --reporter=spec test/*-test.js"},"version":"3.0.3"};},{}],148:[function(require,module,exports){arguments[4][68][0].apply(exports,arguments);},{"dup":68}],149:[function(require,module,exports){(function(global){/** + * @license + * lodash 3.10.1 (Custom Build) + * Build: `lodash modern -d -o ./index.js` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */;(function(){/** Used as a safe reference for `undefined` in pre-ES5 environments. */var undefined;/** Used as the semantic version number. */var VERSION='3.10.1';/** Used to compose bitmasks for wrapper metadata. */var BIND_FLAG=1,BIND_KEY_FLAG=2,CURRY_BOUND_FLAG=4,CURRY_FLAG=8,CURRY_RIGHT_FLAG=16,PARTIAL_FLAG=32,PARTIAL_RIGHT_FLAG=64,ARY_FLAG=128,REARG_FLAG=256;/** Used as default options for `_.trunc`. */var DEFAULT_TRUNC_LENGTH=30,DEFAULT_TRUNC_OMISSION='...';/** Used to detect when a function becomes hot. */var HOT_COUNT=150,HOT_SPAN=16;/** Used as the size to enable large array optimizations. */var LARGE_ARRAY_SIZE=200;/** Used to indicate the type of lazy iteratees. */var LAZY_FILTER_FLAG=1,LAZY_MAP_FLAG=2;/** Used as the `TypeError` message for "Functions" methods. */var FUNC_ERROR_TEXT='Expected a function';/** Used as the internal argument placeholder. */var PLACEHOLDER='__lodash_placeholder__';/** `Object#toString` result references. */var argsTag='[object Arguments]',arrayTag='[object Array]',boolTag='[object Boolean]',dateTag='[object Date]',errorTag='[object Error]',funcTag='[object Function]',mapTag='[object Map]',numberTag='[object Number]',objectTag='[object Object]',regexpTag='[object RegExp]',setTag='[object Set]',stringTag='[object String]',weakMapTag='[object WeakMap]';var arrayBufferTag='[object ArrayBuffer]',float32Tag='[object Float32Array]',float64Tag='[object Float64Array]',int8Tag='[object Int8Array]',int16Tag='[object Int16Array]',int32Tag='[object Int32Array]',uint8Tag='[object Uint8Array]',uint8ClampedTag='[object Uint8ClampedArray]',uint16Tag='[object Uint16Array]',uint32Tag='[object Uint32Array]';/** Used to match empty string literals in compiled template source. */var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;/** Used to match HTML entities and HTML characters. */var reEscapedHtml=/&(?:amp|lt|gt|quot|#39|#96);/g,reUnescapedHtml=/[&<>"'`]/g,reHasEscapedHtml=RegExp(reEscapedHtml.source),reHasUnescapedHtml=RegExp(reUnescapedHtml.source);/** Used to match template delimiters. */var reEscape=/<%-([\s\S]+?)%>/g,reEvaluate=/<%([\s\S]+?)%>/g,reInterpolate=/<%=([\s\S]+?)%>/g;/** Used to match property names within property paths. */var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;/** + * Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns) + * and those outlined by [`EscapeRegExpPattern`](http://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern). + */var reRegExpChars=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,reHasRegExpChars=RegExp(reRegExpChars.source);/** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */var reComboMark=/[\u0300-\u036f\ufe20-\ufe23]/g;/** Used to match backslashes in property paths. */var reEscapeChar=/\\(\\)?/g;/** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;/** Used to match `RegExp` flags from their coerced string values. */var reFlags=/\w*$/;/** Used to detect hexadecimal string values. */var reHasHexPrefix=/^0[xX]/;/** Used to detect host constructors (Safari > 5). */var reIsHostCtor=/^\[object .+?Constructor\]$/;/** Used to detect unsigned integer values. */var reIsUint=/^\d+$/;/** Used to match latin-1 supplementary letters (excluding mathematical operators). */var reLatin1=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;/** Used to ensure capturing order of template delimiters. */var reNoMatch=/($^)/;/** Used to match unescaped characters in compiled string literals. */var reUnescapedString=/['\n\r\u2028\u2029\\]/g;/** Used to match words to create compound words. */var reWords=function(){var upper='[A-Z\\xc0-\\xd6\\xd8-\\xde]',lower='[a-z\\xdf-\\xf6\\xf8-\\xff]+';return RegExp(upper+'+(?='+upper+lower+')|'+upper+'?'+lower+'|'+upper+'+|[0-9]+','g');}();/** Used to assign default `context` object properties. */var contextProps=['Array','ArrayBuffer','Date','Error','Float32Array','Float64Array','Function','Int8Array','Int16Array','Int32Array','Math','Number','Object','RegExp','Set','String','_','clearTimeout','isFinite','parseFloat','parseInt','setTimeout','TypeError','Uint8Array','Uint8ClampedArray','Uint16Array','Uint32Array','WeakMap'];/** Used to make template sourceURLs easier to identify. */var templateCounter=-1;/** Used to identify `toStringTag` values of typed arrays. */var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=false;/** Used to identify `toStringTag` values supported by `_.clone`. */var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[stringTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=true;cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[mapTag]=cloneableTags[setTag]=cloneableTags[weakMapTag]=false;/** Used to map latin-1 supplementary letters to basic latin letters. */var deburredLetters={'\xc0':'A','\xc1':'A','\xc2':'A','\xc3':'A','\xc4':'A','\xc5':'A','\xe0':'a','\xe1':'a','\xe2':'a','\xe3':'a','\xe4':'a','\xe5':'a','\xc7':'C','\xe7':'c','\xd0':'D','\xf0':'d','\xc8':'E','\xc9':'E','\xca':'E','\xcb':'E','\xe8':'e','\xe9':'e','\xea':'e','\xeb':'e','\xcC':'I','\xcd':'I','\xce':'I','\xcf':'I','\xeC':'i','\xed':'i','\xee':'i','\xef':'i','\xd1':'N','\xf1':'n','\xd2':'O','\xd3':'O','\xd4':'O','\xd5':'O','\xd6':'O','\xd8':'O','\xf2':'o','\xf3':'o','\xf4':'o','\xf5':'o','\xf6':'o','\xf8':'o','\xd9':'U','\xda':'U','\xdb':'U','\xdc':'U','\xf9':'u','\xfa':'u','\xfb':'u','\xfc':'u','\xdd':'Y','\xfd':'y','\xff':'y','\xc6':'Ae','\xe6':'ae','\xde':'Th','\xfe':'th','\xdf':'ss'};/** Used to map characters to HTML entities. */var htmlEscapes={'&':'&','<':'<','>':'>','"':'"',"'":''','`':'`'};/** Used to map HTML entities to characters. */var htmlUnescapes={'&':'&','<':'<','>':'>','"':'"',''':"'",'`':'`'};/** Used to determine if values are of the language type `Object`. */var objectTypes={'function':true,'object':true};/** Used to escape characters for inclusion in compiled regexes. */var regexpEscapes={'0':'x30','1':'x31','2':'x32','3':'x33','4':'x34','5':'x35','6':'x36','7':'x37','8':'x38','9':'x39','A':'x41','B':'x42','C':'x43','D':'x44','E':'x45','F':'x46','a':'x61','b':'x62','c':'x63','d':'x64','e':'x65','f':'x66','n':'x6e','r':'x72','t':'x74','u':'x75','v':'x76','x':'x78'};/** Used to escape characters for inclusion in compiled string literals. */var stringEscapes={'\\':'\\',"'":"'",'\n':'n','\r':'r',"\u2028":'u2028',"\u2029":'u2029'};/** Detect free variable `exports`. */var freeExports=objectTypes[typeof exports==="undefined"?"undefined":_typeof(exports)]&&exports&&!exports.nodeType&&exports;/** Detect free variable `module`. */var freeModule=objectTypes[typeof module==="undefined"?"undefined":_typeof(module)]&&module&&!module.nodeType&&module;/** Detect free variable `global` from Node.js. */var freeGlobal=freeExports&&freeModule&&(typeof global==="undefined"?"undefined":_typeof(global))=='object'&&global&&global.Object&&global;/** Detect free variable `self`. */var freeSelf=objectTypes[typeof self==="undefined"?"undefined":_typeof(self)]&&self&&self.Object&&self;/** Detect free variable `window`. */var freeWindow=objectTypes[typeof window==="undefined"?"undefined":_typeof(window)]&&window&&window.Object&&window;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;/** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */var root=freeGlobal||freeWindow!==(this&&this.window)&&freeWindow||freeSelf||this;/*--------------------------------------------------------------------------*//** + * The base implementation of `compareAscending` which compares values and + * sorts them in ascending order without guaranteeing a stable sort. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */function baseCompareAscending(value,other){if(value!==other){var valIsNull=value===null,valIsUndef=value===undefined,valIsReflexive=value===value;var othIsNull=other===null,othIsUndef=other===undefined,othIsReflexive=other===other;if(value>other&&!othIsNull||!valIsReflexive||valIsNull&&!othIsUndef&&othIsReflexive||valIsUndef&&othIsReflexive){return 1;}if(value-1){}return index;}/** + * Used by `_.trim` and `_.trimRight` to get the index of the last character + * of `string` that is not found in `chars`. + * + * @private + * @param {string} string The string to inspect. + * @param {string} chars The characters to find. + * @returns {number} Returns the index of the last character not found in `chars`. + */function charsRightIndex(string,chars){var index=string.length;while(index--&&chars.indexOf(string.charAt(index))>-1){}return index;}/** + * Used by `_.sortBy` to compare transformed elements of a collection and stable + * sort them in ascending order. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @returns {number} Returns the sort order indicator for `object`. + */function compareAscending(object,other){return baseCompareAscending(object.criteria,other.criteria)||object.index-other.index;}/** + * Used by `_.sortByOrder` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all valuess are sorted in ascending order. Otherwise, + * a value is sorted in ascending order if its corresponding order is "asc", and + * descending if "desc". + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */function compareMultiple(object,other,orders){var index=-1,objCriteria=object.criteria,othCriteria=other.criteria,length=objCriteria.length,ordersLength=orders.length;while(++index=ordersLength){return result;}var order=orders[index];return result*(order==='asc'||order===true?1:-1);}}// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications +// that causes it, under certain circumstances, to provide the same value for +// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 +// for more details. +// +// This also ensures a stable sort in V8 and other engines. +// See https://code.google.com/p/v8/issues/detail?id=90 for more details. +return object.index-other.index;}/** + * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */function deburrLetter(letter){return deburredLetters[letter];}/** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */function escapeHtmlChar(chr){return htmlEscapes[chr];}/** + * Used by `_.escapeRegExp` to escape characters for inclusion in compiled regexes. + * + * @private + * @param {string} chr The matched character to escape. + * @param {string} leadingChar The capture group for a leading character. + * @param {string} whitespaceChar The capture group for a whitespace character. + * @returns {string} Returns the escaped character. + */function escapeRegExpChar(chr,leadingChar,whitespaceChar){if(leadingChar){chr=regexpEscapes[chr];}else if(whitespaceChar){chr=stringEscapes[chr];}return'\\'+chr;}/** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */function escapeStringChar(chr){return'\\'+stringEscapes[chr];}/** + * Gets the index at which the first occurrence of `NaN` is found in `array`. + * + * @private + * @param {Array} array The array to search. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched `NaN`, else `-1`. + */function indexOfNaN(array,fromIndex,fromRight){var length=array.length,index=fromIndex+(fromRight?0:-1);while(fromRight?index--:++index=9&&charCode<=13||charCode==32||charCode==160||charCode==5760||charCode==6158||charCode>=8192&&(charCode<=8202||charCode==8232||charCode==8233||charCode==8239||charCode==8287||charCode==12288||charCode==65279);}/** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */function replaceHolders(array,placeholder){var index=-1,length=array.length,resIndex=-1,result=[];while(++index true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // using `context` to mock `Date#getTime` use in `_.now` + * var mock = _.runInContext({ + * 'Date': function() { + * return { 'getTime': getTimeMock }; + * } + * }); + * + * // or creating a suped-up `defer` in Node.js + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */function runInContext(context){// Avoid issues with some ES3 environments that attempt to use values, named +// after built-in constructors like `Object`, for the creation of literals. +// ES5 clears this up by stating that literals must use built-in constructors. +// See https://es5.github.io/#x11.1.5 for more details. +context=context?_.defaults(root.Object(),context,_.pick(root,contextProps)):root;/** Native constructor references. */var Array=context.Array,Date=context.Date,Error=context.Error,Function=context.Function,Math=context.Math,Number=context.Number,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError;/** Used for native method references. */var arrayProto=Array.prototype,objectProto=Object.prototype,stringProto=String.prototype;/** Used to resolve the decompiled source of functions. */var fnToString=Function.prototype.toString;/** Used to check objects for own properties. */var hasOwnProperty=objectProto.hasOwnProperty;/** Used to generate unique IDs. */var idCounter=0;/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */var objToString=objectProto.toString;/** Used to restore the original `_` reference in `_.noConflict`. */var oldDash=root._;/** Used to detect if a method is native. */var reIsNative=RegExp('^'+fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,'\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,'$1.*?')+'$');/** Native method references. */var ArrayBuffer=context.ArrayBuffer,clearTimeout=context.clearTimeout,parseFloat=context.parseFloat,pow=Math.pow,propertyIsEnumerable=objectProto.propertyIsEnumerable,Set=getNative(context,'Set'),setTimeout=context.setTimeout,splice=arrayProto.splice,Uint8Array=context.Uint8Array,WeakMap=getNative(context,'WeakMap');/* Native method references for those with the same name as other `lodash` methods. */var nativeCeil=Math.ceil,nativeCreate=getNative(Object,'create'),nativeFloor=Math.floor,nativeIsArray=getNative(Array,'isArray'),nativeIsFinite=context.isFinite,nativeKeys=getNative(Object,'keys'),nativeMax=Math.max,nativeMin=Math.min,nativeNow=getNative(Date,'now'),nativeParseInt=context.parseInt,nativeRandom=Math.random;/** Used as references for `-Infinity` and `Infinity`. */var NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,POSITIVE_INFINITY=Number.POSITIVE_INFINITY;/** Used as references for the maximum length and index of an array. */var MAX_ARRAY_LENGTH=4294967295,MAX_ARRAY_INDEX=MAX_ARRAY_LENGTH-1,HALF_MAX_ARRAY_LENGTH=MAX_ARRAY_LENGTH>>>1;/** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */var MAX_SAFE_INTEGER=9007199254740991;/** Used to store function metadata. */var metaMap=WeakMap&&new WeakMap();/** Used to lookup unminified function names. */var realNames={};/*------------------------------------------------------------------------*//** + * Creates a `lodash` object which wraps `value` to enable implicit chaining. + * Methods that operate on and return arrays, collections, and functions can + * be chained together. Methods that retrieve a single value or may return a + * primitive value will automatically end the chain returning the unwrapped + * value. Explicit chaining may be enabled using `_.chain`. The execution of + * chained methods is lazy, that is, execution is deferred until `_#value` + * is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. Shortcut + * fusion is an optimization strategy which merge iteratee calls; this can help + * to avoid the creation of intermediate data structures and greatly reduce the + * number of iteratee executions. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, + * `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, + * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, + * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, + * and `where` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, + * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`, + * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`, + * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`, + * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, + * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, + * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, + * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, + * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`, + * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`, + * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`, + * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`, + * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`, + * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`, + * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`, + * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`, + * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`, + * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, + * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, + * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`, + * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, + * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`, + * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, + * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`, + * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`, + * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`, + * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`, + * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, + * `unescape`, `uniqueId`, `value`, and `words` + * + * The wrapper method `sample` will return a wrapped value when `n` is provided, + * otherwise an unwrapped value is returned. + * + * @name _ + * @constructor + * @category Chain + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var wrapped = _([1, 2, 3]); + * + * // returns an unwrapped value + * wrapped.reduce(function(total, n) { + * return total + n; + * }); + * // => 6 + * + * // returns a wrapped value + * var squares = wrapped.map(function(n) { + * return n * n; + * }); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */function lodash(value){if(isObjectLike(value)&&!isArray(value)&&!(value instanceof LazyWrapper)){if(value instanceof LodashWrapper){return value;}if(hasOwnProperty.call(value,'__chain__')&&hasOwnProperty.call(value,'__wrapped__')){return wrapperClone(value);}}return new LodashWrapper(value);}/** + * The function whose prototype all chaining wrappers inherit from. + * + * @private + */function baseLodash(){}// No operation performed. +/** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable chaining for all wrapper methods. + * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value. + */function LodashWrapper(value,chainAll,actions){this.__wrapped__=value;this.__actions__=actions||[];this.__chain__=!!chainAll;}/** + * An object environment feature flags. + * + * @static + * @memberOf _ + * @type Object + */var support=lodash.support={};/** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB). Change the following template settings to use + * alternative delimiters. + * + * @static + * @memberOf _ + * @type Object + */lodash.templateSettings={/** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type RegExp + */'escape':reEscape,/** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type RegExp + */'evaluate':reEvaluate,/** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type RegExp + */'interpolate':reInterpolate,/** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type string + */'variable':'',/** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type Object + */'imports':{/** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type Function + */'_':lodash}};/*------------------------------------------------------------------------*//** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @param {*} value The value to wrap. + */function LazyWrapper(value){this.__wrapped__=value;this.__actions__=[];this.__dir__=1;this.__filtered__=false;this.__iteratees__=[];this.__takeCount__=POSITIVE_INFINITY;this.__views__=[];}/** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */function lazyClone(){var result=new LazyWrapper(this.__wrapped__);result.__actions__=arrayCopy(this.__actions__);result.__dir__=this.__dir__;result.__filtered__=this.__filtered__;result.__iteratees__=arrayCopy(this.__iteratees__);result.__takeCount__=this.__takeCount__;result.__views__=arrayCopy(this.__views__);return result;}/** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */function lazyReverse(){if(this.__filtered__){var result=new LazyWrapper(this);result.__dir__=-1;result.__filtered__=true;}else{result=this.clone();result.__dir__*=-1;}return result;}/** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */function lazyValue(){var array=this.__wrapped__.value(),dir=this.__dir__,isArr=isArray(array),isRight=dir<0,arrLength=isArr?array.length:0,view=getView(0,arrLength,this.__views__),start=view.start,end=view.end,length=end-start,index=isRight?end:start-1,iteratees=this.__iteratees__,iterLength=iteratees.length,resIndex=0,takeCount=nativeMin(length,this.__takeCount__);if(!isArr||arrLength=LARGE_ARRAY_SIZE?createCache(values):null,valuesLength=values.length;if(cache){indexOf=cacheIndexOf;isCommon=false;values=cache;}outer:while(++indexlength?0:length+start;}end=end===undefined||end>length?length:+end||0;if(end<0){end+=length;}length=start>end?0:end>>>0;start>>>=0;while(startlength?0:length+start;}end=end===undefined||end>length?length:+end||0;if(end<0){end+=length;}length=start>end?0:end-start>>>0;start>>>=0;var result=Array(length);while(++index=LARGE_ARRAY_SIZE,seen=isLarge?createCache():null,result=[];if(seen){indexOf=cacheIndexOf;isCommon=false;}else{isLarge=false;seen=iteratee?[]:result;}outer:while(++index>>1,computed=array[mid];if((retHighest?computed<=value:computed2?sources[length-2]:undefined,guard=length>2?sources[2]:undefined,thisArg=length>1?sources[length-1]:undefined;if(typeof customizer=='function'){customizer=bindCallback(customizer,thisArg,5);length-=2;}else{customizer=typeof thisArg=='function'?thisArg:undefined;length-=customizer?1:0;}if(guard&&isIterateeCall(sources[0],sources[1],guard)){customizer=length<3?undefined:customizer;length=1;}while(++index-1?collection[index]:undefined;}return baseFind(collection,predicate,eachFunc);};}/** + * Creates a `_.findIndex` or `_.findLastIndex` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new find function. + */function createFindIndex(fromRight){return function(array,predicate,thisArg){if(!(array&&array.length)){return-1;}predicate=getCallback(predicate,thisArg,3);return baseFindIndex(array,predicate,fromRight);};}/** + * Creates a `_.findKey` or `_.findLastKey` function. + * + * @private + * @param {Function} objectFunc The function to iterate over an object. + * @returns {Function} Returns the new find function. + */function createFindKey(objectFunc){return function(object,predicate,thisArg){predicate=getCallback(predicate,thisArg,3);return baseFind(object,predicate,objectFunc,true);};}/** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */function createFlow(fromRight){return function(){var wrapper,length=arguments.length,index=fromRight?length:-1,leftIndex=0,funcs=Array(length);while(fromRight?index--:++index=LARGE_ARRAY_SIZE){return wrapper.plant(value).value();}var index=0,result=length?funcs[index].apply(this,args):value;while(++index=length||!nativeIsFinite(length)){return'';}var padLength=length-strLength;chars=chars==null?' ':chars+'';return repeat(chars,nativeCeil(padLength/chars.length)).slice(0,padLength);}/** + * Creates a function that wraps `func` and invokes it with the optional `this` + * binding of `thisArg` and the `partials` prepended to those provided to + * the wrapper. + * + * @private + * @param {Function} func The function to partially apply arguments to. + * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to the new function. + * @returns {Function} Returns the new bound function. + */function createPartialWrapper(func,bitmask,thisArg,partials){var isBind=bitmask&BIND_FLAG,Ctor=createCtorWrapper(func);function wrapper(){// Avoid `arguments` object use disqualifying optimizations by +// converting it to an array before providing it `func`. +var argsIndex=-1,argsLength=arguments.length,leftIndex=-1,leftLength=partials.length,args=Array(leftLength+argsLength);while(++leftIndexarrLength)){return false;}// Ignore non-index properties. +while(++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER;}/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */function isStrictComparable(value){return value===value&&!isObject(value);}/** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers required to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg` + * augment function arguments, making the order in which they are executed important, + * preventing the merging of metadata. However, we make an exception for a safe + * common case where curried functions have `_.ary` and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */function mergeData(data,source){var bitmask=data[1],srcBitmask=source[1],newBitmask=bitmask|srcBitmask,isCommon=newBitmask0){if(++count>=HOT_COUNT){return key;}}else{count=0;}return baseSetData(key,value);};}();/** + * A fallback implementation of `Object.keys` which creates an array of the + * own enumerable property names of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */function shimKeys(object){var props=keysIn(object),propsLength=props.length,length=propsLength&&object.length;var allowIndexes=!!length&&isLength(length)&&(isArray(object)||isArguments(object));var index=-1,result=[];while(++index [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */function chunk(array,size,guard){if(guard?isIterateeCall(array,size,guard):size==null){size=1;}else{size=nativeMax(nativeFloor(size)||1,1);}var index=0,length=array?array.length:0,resIndex=-1,result=Array(nativeCeil(length/size));while(index [1, 2, 3] + */function compact(array){var index=-1,length=array?array.length:0,resIndex=-1,result=[];while(++index [1, 3] + */var difference=restParam(function(array,values){return isObjectLike(array)&&isArrayLike(array)?baseDifference(array,baseFlatten(values,false,true)):[];});/** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */function drop(array,n,guard){var length=array?array.length:0;if(!length){return[];}if(guard?isIterateeCall(array,n,guard):n==null){n=1;}return baseSlice(array,n<0?0:n);}/** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */function dropRight(array,n,guard){var length=array?array.length:0;if(!length){return[];}if(guard?isIterateeCall(array,n,guard):n==null){n=1;}n=length-(+n||0);return baseSlice(array,0,n<0?0:n);}/** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * bound to `thisArg` and invoked with three arguments: (value, index, array). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that match the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRightWhile([1, 2, 3], function(n) { + * return n > 1; + * }); + * // => [1] + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * // using the `_.matches` callback shorthand + * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); + * // => ['barney', 'fred'] + * + * // using the `_.matchesProperty` callback shorthand + * _.pluck(_.dropRightWhile(users, 'active', false), 'user'); + * // => ['barney'] + * + * // using the `_.property` callback shorthand + * _.pluck(_.dropRightWhile(users, 'active'), 'user'); + * // => ['barney', 'fred', 'pebbles'] + */function dropRightWhile(array,predicate,thisArg){return array&&array.length?baseWhile(array,getCallback(predicate,thisArg,3),true,true):[];}/** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * bound to `thisArg` and invoked with three arguments: (value, index, array). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropWhile([1, 2, 3], function(n) { + * return n < 3; + * }); + * // => [3] + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * // using the `_.matches` callback shorthand + * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user'); + * // => ['fred', 'pebbles'] + * + * // using the `_.matchesProperty` callback shorthand + * _.pluck(_.dropWhile(users, 'active', false), 'user'); + * // => ['pebbles'] + * + * // using the `_.property` callback shorthand + * _.pluck(_.dropWhile(users, 'active'), 'user'); + * // => ['barney', 'fred', 'pebbles'] + */function dropWhile(array,predicate,thisArg){return array&&array.length?baseWhile(array,getCallback(predicate,thisArg,3),true):[];}/** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8], '*', 1, 2); + * // => [4, '*', 8] + */function fill(array,value,start,end){var length=array?array.length:0;if(!length){return[];}if(start&&typeof start!='number'&&isIterateeCall(array,value,start)){start=0;end=length;}return baseFill(array,value,start,end);}/** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to search. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(chr) { + * return chr.user == 'barney'; + * }); + * // => 0 + * + * // using the `_.matches` callback shorthand + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // using the `_.matchesProperty` callback shorthand + * _.findIndex(users, 'active', false); + * // => 0 + * + * // using the `_.property` callback shorthand + * _.findIndex(users, 'active'); + * // => 2 + */var findIndex=createFindIndex();/** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to search. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(chr) { + * return chr.user == 'pebbles'; + * }); + * // => 2 + * + * // using the `_.matches` callback shorthand + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // using the `_.matchesProperty` callback shorthand + * _.findLastIndex(users, 'active', false); + * // => 2 + * + * // using the `_.property` callback shorthand + * _.findLastIndex(users, 'active'); + * // => 0 + */var findLastIndex=createFindIndex(true);/** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @alias head + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.first([1, 2, 3]); + * // => 1 + * + * _.first([]); + * // => undefined + */function first(array){return array?array[0]:undefined;}/** + * Flattens a nested array. If `isDeep` is `true` the array is recursively + * flattened, otherwise it is only flattened a single level. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to flatten. + * @param {boolean} [isDeep] Specify a deep flatten. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, 3, [4]]]); + * // => [1, 2, 3, [4]] + * + * // using `isDeep` + * _.flatten([1, [2, 3, [4]]], true); + * // => [1, 2, 3, 4] + */function flatten(array,isDeep,guard){var length=array?array.length:0;if(guard&&isIterateeCall(array,isDeep,guard)){isDeep=false;}return length?baseFlatten(array,isDeep):[];}/** + * Recursively flattens a nested array. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to recursively flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, 3, [4]]]); + * // => [1, 2, 3, 4] + */function flattenDeep(array){var length=array?array.length:0;return length?baseFlatten(array,true):[];}/** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it is used as the offset + * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` + * performs a faster binary search. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {boolean|number} [fromIndex=0] The index to search from or `true` + * to perform a binary search on a sorted array. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // using `fromIndex` + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + * + * // performing a binary search + * _.indexOf([1, 1, 2, 2], 2, true); + * // => 2 + */function indexOf(array,value,fromIndex){var length=array?array.length:0;if(!length){return-1;}if(typeof fromIndex=='number'){fromIndex=fromIndex<0?nativeMax(length+fromIndex,0):fromIndex;}else if(fromIndex){var index=binaryIndex(array,value);if(index [1, 2] + */function initial(array){return dropRight(array,1);}/** + * Creates an array of unique values that are included in all of the provided + * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of shared values. + * @example + * _.intersection([1, 2], [4, 2], [2, 1]); + * // => [2] + */var intersection=restParam(function(arrays){var othLength=arrays.length,othIndex=othLength,caches=Array(length),indexOf=getIndexOf(),isCommon=indexOf==baseIndexOf,result=[];while(othIndex--){var value=arrays[othIndex]=isArrayLike(value=arrays[othIndex])?value:[];caches[othIndex]=isCommon&&value.length>=120?createCache(othIndex&&value):null;}var array=arrays[0],index=-1,length=array?array.length:0,seen=caches[0];outer:while(++index 3 + */function last(array){var length=array?array.length:0;return length?array[length-1]:undefined;}/** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {boolean|number} [fromIndex=array.length-1] The index to search from + * or `true` to perform a binary search on a sorted array. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // using `fromIndex` + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + * + * // performing a binary search + * _.lastIndexOf([1, 1, 2, 2], 2, true); + * // => 3 + */function lastIndexOf(array,value,fromIndex){var length=array?array.length:0;if(!length){return-1;}var index=length;if(typeof fromIndex=='number'){index=(fromIndex<0?nativeMax(length+fromIndex,0):nativeMin(fromIndex||0,length-1))+1;}else if(fromIndex){index=binaryIndex(array,value,true)-1;var other=array[index];if(value===value?value===other:other!==other){return index;}return-1;}if(value!==value){return indexOfNaN(array,index,true);}while(index--){if(array[index]===value){return index;}}return-1;}/** + * Removes all provided values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3, 1, 2, 3]; + * + * _.pull(array, 2, 3); + * console.log(array); + * // => [1, 1] + */function pull(){var args=arguments,array=args[0];if(!(array&&array.length)){return array;}var index=0,indexOf=getIndexOf(),length=args.length;while(++index-1){splice.call(array,fromIndex,1);}}return array;}/** + * Removes elements from `array` corresponding to the given indexes and returns + * an array of the removed elements. Indexes may be specified as an array of + * indexes or as individual arguments. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove, + * specified as individual indexes or arrays of indexes. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [5, 10, 15, 20]; + * var evens = _.pullAt(array, 1, 3); + * + * console.log(array); + * // => [5, 15] + * + * console.log(evens); + * // => [10, 20] + */var pullAt=restParam(function(array,indexes){indexes=baseFlatten(indexes);var result=baseAt(array,indexes);basePullAt(array,indexes.sort(baseCompareAscending));return result;});/** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is bound to + * `thisArg` and invoked with three arguments: (value, index, array). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * **Note:** Unlike `_.filter`, this method mutates `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to modify. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */function remove(array,predicate,thisArg){var result=[];if(!(array&&array.length)){return result;}var index=-1,indexes=[],length=array.length;predicate=getCallback(predicate,thisArg,3);while(++index [2, 3] + */function rest(array){return drop(array,1);}/** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of `Array#slice` to support node + * lists in IE < 9 and to ensure dense arrays are returned. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */function slice(array,start,end){var length=array?array.length:0;if(!length){return[];}if(end&&typeof end!='number'&&isIterateeCall(array,start,end)){start=0;end=length;}return baseSlice(array,start,end);}/** + * Uses a binary search to determine the lowest index at which `value` should + * be inserted into `array` in order to maintain its sort order. If an iteratee + * function is provided it is invoked for `value` and each element of `array` + * to compute their sort ranking. The iteratee is bound to `thisArg` and + * invoked with one argument; (value). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + * + * _.sortedIndex([4, 4, 5, 5], 5); + * // => 2 + * + * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } }; + * + * // using an iteratee function + * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) { + * return this.data[word]; + * }, dict); + * // => 1 + * + * // using the `_.property` callback shorthand + * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); + * // => 1 + */var sortedIndex=createSortedIndex();/** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 4, 5, 5], 5); + * // => 4 + */var sortedLastIndex=createSortedIndex(true);/** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */function take(array,n,guard){var length=array?array.length:0;if(!length){return[];}if(guard?isIterateeCall(array,n,guard):n==null){n=1;}return baseSlice(array,0,n<0?0:n);}/** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */function takeRight(array,n,guard){var length=array?array.length:0;if(!length){return[];}if(guard?isIterateeCall(array,n,guard):n==null){n=1;}n=length-(+n||0);return baseSlice(array,n<0?0:n);}/** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is bound to `thisArg` + * and invoked with three arguments: (value, index, array). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRightWhile([1, 2, 3], function(n) { + * return n > 1; + * }); + * // => [2, 3] + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * // using the `_.matches` callback shorthand + * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); + * // => ['pebbles'] + * + * // using the `_.matchesProperty` callback shorthand + * _.pluck(_.takeRightWhile(users, 'active', false), 'user'); + * // => ['fred', 'pebbles'] + * + * // using the `_.property` callback shorthand + * _.pluck(_.takeRightWhile(users, 'active'), 'user'); + * // => [] + */function takeRightWhile(array,predicate,thisArg){return array&&array.length?baseWhile(array,getCallback(predicate,thisArg,3),false,true):[];}/** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is bound to + * `thisArg` and invoked with three arguments: (value, index, array). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeWhile([1, 2, 3], function(n) { + * return n < 3; + * }); + * // => [1, 2] + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false}, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * // using the `_.matches` callback shorthand + * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user'); + * // => ['barney'] + * + * // using the `_.matchesProperty` callback shorthand + * _.pluck(_.takeWhile(users, 'active', false), 'user'); + * // => ['barney', 'fred'] + * + * // using the `_.property` callback shorthand + * _.pluck(_.takeWhile(users, 'active'), 'user'); + * // => [] + */function takeWhile(array,predicate,thisArg){return array&&array.length?baseWhile(array,getCallback(predicate,thisArg,3)):[];}/** + * Creates an array of unique values, in order, from all of the provided arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([1, 2], [4, 2], [2, 1]); + * // => [1, 2, 4] + */var union=restParam(function(arrays){return baseUniq(baseFlatten(arrays,false,true));});/** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurence of each element + * is kept. Providing `true` for `isSorted` performs a faster search algorithm + * for sorted arrays. If an iteratee function is provided it is invoked for + * each element in the array to generate the criterion by which uniqueness + * is computed. The `iteratee` is bound to `thisArg` and invoked with three + * arguments: (value, index, array). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @alias unique + * @category Array + * @param {Array} array The array to inspect. + * @param {boolean} [isSorted] Specify the array is sorted. + * @param {Function|Object|string} [iteratee] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Array} Returns the new duplicate-value-free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + * + * // using `isSorted` + * _.uniq([1, 1, 2], true); + * // => [1, 2] + * + * // using an iteratee function + * _.uniq([1, 2.5, 1.5, 2], function(n) { + * return this.floor(n); + * }, Math); + * // => [1, 2.5] + * + * // using the `_.property` callback shorthand + * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */function uniq(array,isSorted,iteratee,thisArg){var length=array?array.length:0;if(!length){return[];}if(isSorted!=null&&typeof isSorted!='boolean'){thisArg=iteratee;iteratee=isIterateeCall(array,isSorted,thisArg)?undefined:isSorted;isSorted=false;}var callback=getCallback();if(!(iteratee==null&&callback===baseCallback)){iteratee=callback(iteratee,thisArg,3);}return isSorted&&getIndexOf()==baseIndexOf?sortedUniq(array,iteratee):baseUniq(array,iteratee);}/** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); + * // => [['fred', 30, true], ['barney', 40, false]] + * + * _.unzip(zipped); + * // => [['fred', 'barney'], [30, 40], [true, false]] + */function unzip(array){if(!(array&&array.length)){return[];}var index=-1,length=0;array=arrayFilter(array,function(group){if(isArrayLike(group)){length=nativeMax(group.length,length);return true;}});var result=Array(length);while(++index [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */function unzipWith(array,iteratee,thisArg){var length=array?array.length:0;if(!length){return[];}var result=unzip(array);if(iteratee==null){return result;}iteratee=bindCallback(iteratee,thisArg,4);return arrayMap(result,function(group){return arrayReduce(group,iteratee,undefined,true);});}/** + * Creates an array excluding all provided values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to filter. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.without([1, 2, 1, 3], 1, 2); + * // => [3] + */var without=restParam(function(array,values){return isArrayLike(array)?baseDifference(array,values):[];});/** + * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the provided arrays. + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of values. + * @example + * + * _.xor([1, 2], [4, 2]); + * // => [1, 4] + */function xor(){var index=-1,length=arguments.length;while(++index [['fred', 30, true], ['barney', 40, false]] + */var zip=restParam(unzip);/** + * The inverse of `_.pairs`; this method returns an object composed from arrays + * of property names and values. Provide either a single two dimensional array, + * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names + * and one of corresponding values. + * + * @static + * @memberOf _ + * @alias object + * @category Array + * @param {Array} props The property names. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject([['fred', 30], ['barney', 40]]); + * // => { 'fred': 30, 'barney': 40 } + * + * _.zipObject(['fred', 'barney'], [30, 40]); + * // => { 'fred': 30, 'barney': 40 } + */function zipObject(props,values){var index=-1,length=props?props.length:0,result={};if(length&&!values&&!isArray(props[0])){values=[];}while(++index [111, 222] + */var zipWith=restParam(function(arrays){var length=arrays.length,iteratee=length>2?arrays[length-2]:undefined,thisArg=length>1?arrays[length-1]:undefined;if(length>2&&typeof iteratee=='function'){length-=2;}else{iteratee=length>1&&typeof thisArg=='function'?(--length,thisArg):undefined;thisArg=undefined;}arrays.length=length;return unzipWith(arrays,iteratee,thisArg);});/*------------------------------------------------------------------------*//** + * Creates a `lodash` object that wraps `value` with explicit method + * chaining enabled. + * + * @static + * @memberOf _ + * @category Chain + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _.chain(users) + * .sortBy('age') + * .map(function(chr) { + * return chr.user + ' is ' + chr.age; + * }) + * .first() + * .value(); + * // => 'pebbles is 1' + */function chain(value){var result=lodash(value);result.__chain__=true;return result;}/** + * This method invokes `interceptor` and returns `value`. The interceptor is + * bound to `thisArg` and invoked with one argument; (value). The purpose of + * this method is to "tap into" a method chain in order to perform operations + * on intermediate results within the chain. + * + * @static + * @memberOf _ + * @category Chain + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @param {*} [thisArg] The `this` binding of `interceptor`. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */function tap(value,interceptor,thisArg){interceptor.call(thisArg,value);return value;}/** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * + * @static + * @memberOf _ + * @category Chain + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @param {*} [thisArg] The `this` binding of `interceptor`. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */function thru(value,interceptor,thisArg){return interceptor.call(thisArg,value);}/** + * Enables explicit method chaining on the wrapper object. + * + * @name chain + * @memberOf _ + * @category Chain + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // without explicit chaining + * _(users).first(); + * // => { 'user': 'barney', 'age': 36 } + * + * // with explicit chaining + * _(users).chain() + * .first() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */function wrapperChain(){return chain(this);}/** + * Executes the chained sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @category Chain + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */function wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__);}/** + * Creates a new array joining a wrapped array with any additional arrays + * and/or values. + * + * @name concat + * @memberOf _ + * @category Chain + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var wrapped = _(array).concat(2, [3], [[4]]); + * + * console.log(wrapped.value()); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */var wrapperConcat=restParam(function(values){values=baseFlatten(values);return this.thru(function(array){return arrayConcat(isArray(array)?array:[toObject(array)],values);});});/** + * Creates a clone of the chained sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @category Chain + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).map(function(value) { + * return Math.pow(value, 2); + * }); + * + * var other = [3, 4]; + * var otherWrapped = wrapped.plant(other); + * + * otherWrapped.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */function wrapperPlant(value){var result,parent=this;while(parent instanceof baseLodash){var clone=wrapperClone(parent);if(result){previous.__wrapped__=clone;}else{result=clone;}var previous=clone;parent=parent.__wrapped__;}previous.__wrapped__=value;return result;}/** + * Reverses the wrapped array so the first element becomes the last, the + * second element becomes the second to last, and so on. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @category Chain + * @returns {Object} Returns the new reversed `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */function wrapperReverse(){var value=this.__wrapped__;var interceptor=function interceptor(value){return wrapped&&wrapped.__dir__<0?value:value.reverse();};if(value instanceof LazyWrapper){var wrapped=value;if(this.__actions__.length){wrapped=new LazyWrapper(this);}wrapped=wrapped.reverse();wrapped.__actions__.push({'func':thru,'args':[interceptor],'thisArg':undefined});return new LodashWrapper(wrapped,this.__chain__);}return this.thru(interceptor);}/** + * Produces the result of coercing the unwrapped value to a string. + * + * @name toString + * @memberOf _ + * @category Chain + * @returns {string} Returns the coerced string value. + * @example + * + * _([1, 2, 3]).toString(); + * // => '1,2,3' + */function wrapperToString(){return this.value()+'';}/** + * Executes the chained sequence to extract the unwrapped value. + * + * @name value + * @memberOf _ + * @alias run, toJSON, valueOf + * @category Chain + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__);}/*------------------------------------------------------------------------*//** + * Creates an array of elements corresponding to the given keys, or indexes, + * of `collection`. Keys may be specified as individual arguments or as arrays + * of keys. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {...(number|number[]|string|string[])} [props] The property names + * or indexes of elements to pick, specified individually or in arrays. + * @returns {Array} Returns the new array of picked elements. + * @example + * + * _.at(['a', 'b', 'c'], [0, 2]); + * // => ['a', 'c'] + * + * _.at(['barney', 'fred', 'pebbles'], 0, 2); + * // => ['barney', 'pebbles'] + */var at=restParam(function(collection,props){return baseAt(collection,baseFlatten(props));});/** + * Creates an object composed of keys generated from the results of running + * each element of `collection` through `iteratee`. The corresponding value + * of each key is the number of times the key was returned by `iteratee`. + * The `iteratee` is bound to `thisArg` and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([4.3, 6.1, 6.4], function(n) { + * return Math.floor(n); + * }); + * // => { '4': 1, '6': 2 } + * + * _.countBy([4.3, 6.1, 6.4], function(n) { + * return this.floor(n); + * }, Math); + * // => { '4': 1, '6': 2 } + * + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?++result[key]:result[key]=1;});/** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * The predicate is bound to `thisArg` and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @alias all + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // using the `_.matches` callback shorthand + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // using the `_.matchesProperty` callback shorthand + * _.every(users, 'active', false); + * // => true + * + * // using the `_.property` callback shorthand + * _.every(users, 'active'); + * // => false + */function every(collection,predicate,thisArg){var func=isArray(collection)?arrayEvery:baseEvery;if(thisArg&&isIterateeCall(collection,predicate,thisArg)){predicate=undefined;}if(typeof predicate!='function'||thisArg!==undefined){predicate=getCallback(predicate,thisArg,3);}return func(collection,predicate);}/** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is bound to `thisArg` and + * invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @alias select + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the new filtered array. + * @example + * + * _.filter([4, 5, 6], function(n) { + * return n % 2 == 0; + * }); + * // => [4, 6] + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // using the `_.matches` callback shorthand + * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user'); + * // => ['barney'] + * + * // using the `_.matchesProperty` callback shorthand + * _.pluck(_.filter(users, 'active', false), 'user'); + * // => ['fred'] + * + * // using the `_.property` callback shorthand + * _.pluck(_.filter(users, 'active'), 'user'); + * // => ['barney'] + */function filter(collection,predicate,thisArg){var func=isArray(collection)?arrayFilter:baseFilter;predicate=getCallback(predicate,thisArg,3);return func(collection,predicate);}/** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is bound to `thisArg` and + * invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @alias detect + * @category Collection + * @param {Array|Object|string} collection The collection to search. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.result(_.find(users, function(chr) { + * return chr.age < 40; + * }), 'user'); + * // => 'barney' + * + * // using the `_.matches` callback shorthand + * _.result(_.find(users, { 'age': 1, 'active': true }), 'user'); + * // => 'pebbles' + * + * // using the `_.matchesProperty` callback shorthand + * _.result(_.find(users, 'active', false), 'user'); + * // => 'fred' + * + * // using the `_.property` callback shorthand + * _.result(_.find(users, 'active'), 'user'); + * // => 'barney' + */var find=createFind(baseEach);/** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to search. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */var findLast=createFind(baseEachRight,true);/** + * Performs a deep comparison between each element in `collection` and the + * source object, returning the first element that has equivalent property + * values. + * + * **Note:** This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Objects are compared by + * their own, not inherited, enumerable properties. For comparing a single + * own or inherited property value see `_.matchesProperty`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to search. + * @param {Object} source The object of property values to match. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user'); + * // => 'barney' + * + * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user'); + * // => 'fred' + */function findWhere(collection,source){return find(collection,baseMatches(source));}/** + * Iterates over elements of `collection` invoking `iteratee` for each element. + * The `iteratee` is bound to `thisArg` and invoked with three arguments: + * (value, index|key, collection). Iteratee functions may exit iteration early + * by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" property + * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` + * may be used for object iteration. + * + * @static + * @memberOf _ + * @alias each + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Array|Object|string} Returns `collection`. + * @example + * + * _([1, 2]).forEach(function(n) { + * console.log(n); + * }).value(); + * // => logs each value from left to right and returns the array + * + * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { + * console.log(n, key); + * }); + * // => logs each value-key pair and returns the object (iteration order is not guaranteed) + */var forEach=createForEach(arrayEach,baseEach);/** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @alias eachRight + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Array|Object|string} Returns `collection`. + * @example + * + * _([1, 2]).forEachRight(function(n) { + * console.log(n); + * }).value(); + * // => logs each value from right to left and returns the array + */var forEachRight=createForEach(arrayEachRight,baseEachRight);/** + * Creates an object composed of keys generated from the results of running + * each element of `collection` through `iteratee`. The corresponding value + * of each key is an array of the elements responsible for generating the key. + * The `iteratee` is bound to `thisArg` and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([4.2, 6.1, 6.4], function(n) { + * return Math.floor(n); + * }); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * _.groupBy([4.2, 6.1, 6.4], function(n) { + * return this.floor(n); + * }, Math); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * // using the `_.property` callback shorthand + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */var groupBy=createAggregator(function(result,value,key){if(hasOwnProperty.call(result,key)){result[key].push(value);}else{result[key]=[value];}});/** + * Checks if `value` is in `collection` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it is used as the offset + * from the end of `collection`. + * + * @static + * @memberOf _ + * @alias contains, include + * @category Collection + * @param {Array|Object|string} collection The collection to search. + * @param {*} target The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. + * @returns {boolean} Returns `true` if a matching element is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); + * // => true + * + * _.includes('pebbles', 'eb'); + * // => true + */function includes(collection,target,fromIndex,guard){var length=collection?getLength(collection):0;if(!isLength(length)){collection=values(collection);length=collection.length;}if(typeof fromIndex!='number'||guard&&isIterateeCall(target,fromIndex,guard)){fromIndex=0;}else{fromIndex=fromIndex<0?nativeMax(length+fromIndex,0):fromIndex||0;}return typeof collection=='string'||!isArray(collection)&&isString(collection)?fromIndex<=length&&collection.indexOf(target,fromIndex)>-1:!!length&&getIndexOf(collection,target,fromIndex)>-1;}/** + * Creates an object composed of keys generated from the results of running + * each element of `collection` through `iteratee`. The corresponding value + * of each key is the last element responsible for generating the key. The + * iteratee function is bound to `thisArg` and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var keyData = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.indexBy(keyData, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + * + * _.indexBy(keyData, function(object) { + * return String.fromCharCode(object.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.indexBy(keyData, function(object) { + * return this.fromCharCode(object.code); + * }, String); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + */var indexBy=createAggregator(function(result,value,key){result[key]=value;});/** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `methodName` is a function it is + * invoked for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invoke([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */var invoke=restParam(function(collection,path,args){var index=-1,isFunc=typeof path=='function',isProp=isKey(path),result=isArrayLike(collection)?Array(collection.length):[];baseEach(collection,function(value){var func=isFunc?path:isProp&&value!=null?value[path]:undefined;result[++index]=func?func.apply(value,args):invokePath(value,path,args);});return result;});/** + * Creates an array of values by running each element in `collection` through + * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three + * arguments: (value, index|key, collection). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`, + * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`, + * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`, + * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`, + * `sum`, `uniq`, and `words` + * + * @static + * @memberOf _ + * @alias collect + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Array} Returns the new mapped array. + * @example + * + * function timesThree(n) { + * return n * 3; + * } + * + * _.map([1, 2], timesThree); + * // => [3, 6] + * + * _.map({ 'a': 1, 'b': 2 }, timesThree); + * // => [3, 6] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // using the `_.property` callback shorthand + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */function map(collection,iteratee,thisArg){var func=isArray(collection)?arrayMap:baseMap;iteratee=getCallback(iteratee,thisArg,3);return func(collection,iteratee);}/** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, while the second of which + * contains elements `predicate` returns falsey for. The predicate is bound + * to `thisArg` and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * _.partition([1, 2, 3], function(n) { + * return n % 2; + * }); + * // => [[1, 3], [2]] + * + * _.partition([1.2, 2.3, 3.4], function(n) { + * return this.floor(n) % 2; + * }, Math); + * // => [[1.2, 3.4], [2.3]] + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * var mapper = function(array) { + * return _.pluck(array, 'user'); + * }; + * + * // using the `_.matches` callback shorthand + * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper); + * // => [['pebbles'], ['barney', 'fred']] + * + * // using the `_.matchesProperty` callback shorthand + * _.map(_.partition(users, 'active', false), mapper); + * // => [['barney', 'pebbles'], ['fred']] + * + * // using the `_.property` callback shorthand + * _.map(_.partition(users, 'active'), mapper); + * // => [['fred'], ['barney', 'pebbles']] + */var partition=createAggregator(function(result,value,key){result[key?0:1].push(value);},function(){return[[],[]];});/** + * Gets the property value of `path` from all elements in `collection`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Array|string} path The path of the property to pluck. + * @returns {Array} Returns the property values. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * _.pluck(users, 'user'); + * // => ['barney', 'fred'] + * + * var userIndex = _.indexBy(users, 'user'); + * _.pluck(userIndex, 'age'); + * // => [36, 40] (iteration order is not guaranteed) + */function pluck(collection,path){return map(collection,property(path));}/** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` through `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not provided the first element of `collection` is used as the initial + * value. The `iteratee` is bound to `thisArg` and invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `sortByAll`, + * and `sortByOrder` + * + * @static + * @memberOf _ + * @alias foldl, inject + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {*} Returns the accumulated value. + * @example + * + * _.reduce([1, 2], function(total, n) { + * return total + n; + * }); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { + * result[key] = n * 3; + * return result; + * }, {}); + * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed) + */var reduce=createReduce(arrayReduce,baseEach);/** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @alias foldr + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {*} Returns the accumulated value. + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */var reduceRight=createReduce(arrayReduceRight,baseEachRight);/** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Array} Returns the new filtered array. + * @example + * + * _.reject([1, 2, 3, 4], function(n) { + * return n % 2 == 0; + * }); + * // => [1, 3] + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * // using the `_.matches` callback shorthand + * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user'); + * // => ['barney'] + * + * // using the `_.matchesProperty` callback shorthand + * _.pluck(_.reject(users, 'active', false), 'user'); + * // => ['fred'] + * + * // using the `_.property` callback shorthand + * _.pluck(_.reject(users, 'active'), 'user'); + * // => ['barney'] + */function reject(collection,predicate,thisArg){var func=isArray(collection)?arrayFilter:baseFilter;predicate=getCallback(predicate,thisArg,3);return func(collection,function(value,index,collection){return!predicate(value,index,collection);});}/** + * Gets a random element or `n` random elements from a collection. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to sample. + * @param {number} [n] The number of elements to sample. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {*} Returns the random sample(s). + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + * + * _.sample([1, 2, 3, 4], 2); + * // => [3, 1] + */function sample(collection,n,guard){if(guard?isIterateeCall(collection,n,guard):n==null){collection=toIterable(collection);var length=collection.length;return length>0?collection[baseRandom(0,length-1)]:undefined;}var index=-1,result=toArray(collection),length=result.length,lastIndex=length-1;n=nativeMin(n<0?0:+n||0,length);while(++index [4, 1, 3, 2] + */function shuffle(collection){return sample(collection,POSITIVE_INFINITY);}/** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable properties for objects. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the size of `collection`. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */function size(collection){var length=collection?getLength(collection):0;return isLength(length)?length:keys(collection).length;}/** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * The function returns as soon as it finds a passing value and does not iterate + * over the entire collection. The predicate is bound to `thisArg` and invoked + * with three arguments: (value, index|key, collection). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @alias any + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // using the `_.matches` callback shorthand + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // using the `_.matchesProperty` callback shorthand + * _.some(users, 'active', false); + * // => true + * + * // using the `_.property` callback shorthand + * _.some(users, 'active'); + * // => true + */function some(collection,predicate,thisArg){var func=isArray(collection)?arraySome:baseSome;if(thisArg&&isIterateeCall(collection,predicate,thisArg)){predicate=undefined;}if(typeof predicate!='function'||thisArg!==undefined){predicate=getCallback(predicate,thisArg,3);}return func(collection,predicate);}/** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection through `iteratee`. This method performs + * a stable sort, that is, it preserves the original sort order of equal elements. + * The `iteratee` is bound to `thisArg` and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Array} Returns the new sorted array. + * @example + * + * _.sortBy([1, 2, 3], function(n) { + * return Math.sin(n); + * }); + * // => [3, 1, 2] + * + * _.sortBy([1, 2, 3], function(n) { + * return this.sin(n); + * }, Math); + * // => [3, 1, 2] + * + * var users = [ + * { 'user': 'fred' }, + * { 'user': 'pebbles' }, + * { 'user': 'barney' } + * ]; + * + * // using the `_.property` callback shorthand + * _.pluck(_.sortBy(users, 'user'), 'user'); + * // => ['barney', 'fred', 'pebbles'] + */function sortBy(collection,iteratee,thisArg){if(collection==null){return[];}if(thisArg&&isIterateeCall(collection,iteratee,thisArg)){iteratee=undefined;}var index=-1;iteratee=getCallback(iteratee,thisArg,3);var result=baseMap(collection,function(value,key,collection){return{'criteria':iteratee(value,key,collection),'index':++index,'value':value};});return baseSortBy(result,compareAscending);}/** + * This method is like `_.sortBy` except that it can sort by multiple iteratees + * or property names. + * + * If a property name is provided for an iteratee the created `_.property` + * style callback returns the property value of the given element. + * + * If an object is provided for an iteratee the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees + * The iteratees to sort by, specified as individual values or arrays of values. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 42 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.map(_.sortByAll(users, ['user', 'age']), _.values); + * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] + * + * _.map(_.sortByAll(users, 'user', function(chr) { + * return Math.floor(chr.age / 10); + * }), _.values); + * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + */var sortByAll=restParam(function(collection,iteratees){if(collection==null){return[];}var guard=iteratees[2];if(guard&&isIterateeCall(iteratees[0],iteratees[1],guard)){iteratees.length=1;}return baseSortByOrder(collection,baseFlatten(iteratees),[]);});/** + * This method is like `_.sortByAll` except that it allows specifying the + * sort orders of the iteratees to sort by. If `orders` is unspecified, all + * values are sorted in ascending order. Otherwise, a value is sorted in + * ascending order if its corresponding order is "asc", and descending if "desc". + * + * If a property name is provided for an iteratee the created `_.property` + * style callback returns the property value of the given element. + * + * If an object is provided for an iteratee the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {boolean[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 42 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // sort by `user` in ascending order and by `age` in descending order + * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values); + * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + */function sortByOrder(collection,iteratees,orders,guard){if(collection==null){return[];}if(guard&&isIterateeCall(iteratees,orders,guard)){orders=undefined;}if(!isArray(iteratees)){iteratees=iteratees==null?[]:[iteratees];}if(!isArray(orders)){orders=orders==null?[]:[orders];}return baseSortByOrder(collection,iteratees,orders);}/** + * Performs a deep comparison between each element in `collection` and the + * source object, returning an array of all elements that have equivalent + * property values. + * + * **Note:** This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Objects are compared by + * their own, not inherited, enumerable properties. For comparing a single + * own or inherited property value see `_.matchesProperty`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object|string} collection The collection to search. + * @param {Object} source The object of property values to match. + * @returns {Array} Returns the new filtered array. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] }, + * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] } + * ]; + * + * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user'); + * // => ['barney'] + * + * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); + * // => ['fred'] + */function where(collection,source){return filter(collection,baseMatches(source));}/*------------------------------------------------------------------------*//** + * Gets the number of milliseconds that have elapsed since the Unix epoch + * (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @category Date + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => logs the number of milliseconds it took for the deferred function to be invoked + */var now=nativeNow||function(){return new Date().getTime();};/*------------------------------------------------------------------------*//** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it is called `n` or more times. + * + * @static + * @memberOf _ + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => logs 'done saving!' after the two async saves have completed + */function after(n,func){if(typeof func!='function'){if(typeof n=='function'){var temp=n;n=func;func=temp;}else{throw new TypeError(FUNC_ERROR_TEXT);}}n=nativeIsFinite(n=+n)?n:0;return function(){if(--n<1){return func.apply(this,arguments);}};}/** + * Creates a function that accepts up to `n` arguments ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Function} Returns the new function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */function ary(func,n,guard){if(guard&&isIterateeCall(func,n,guard)){n=undefined;}n=func&&n==null?func.length:nativeMax(+n||0,0);return createWrapper(func,ARY_FLAG,undefined,undefined,undefined,undefined,n);}/** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it is called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery('#add').on('click', _.before(5, addContactToList)); + * // => allows adding up to 4 contacts to the list + */function before(n,func){var result;if(typeof func!='function'){if(typeof n=='function'){var temp=n;n=func;func=temp;}else{throw new TypeError(FUNC_ERROR_TEXT);}}return function(){if(--n>0){result=func.apply(this,arguments);}if(n<=1){func=undefined;}return result;};}/** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and prepends any additional `_.bind` arguments to those provided to the + * bound function. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind` this method does not set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var greet = function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * }; + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // using placeholders + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */var bind=restParam(function(func,thisArg,partials){var bitmask=BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,bind.placeholder);bitmask|=PARTIAL_FLAG;}return createWrapper(func,bitmask,thisArg,partials,holders);});/** + * Binds methods of an object to the object itself, overwriting the existing + * method. Method names may be specified as individual arguments or as arrays + * of method names. If no method names are provided all enumerable function + * properties, own and inherited, of `object` are bound. + * + * **Note:** This method does not set the "length" property of bound functions. + * + * @static + * @memberOf _ + * @category Function + * @param {Object} object The object to bind and assign the bound methods to. + * @param {...(string|string[])} [methodNames] The object method names to bind, + * specified as individual method names or arrays of method names. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'onClick': function() { + * console.log('clicked ' + this.label); + * } + * }; + * + * _.bindAll(view); + * jQuery('#docs').on('click', view.onClick); + * // => logs 'clicked docs' when the element is clicked + */var bindAll=restParam(function(object,methodNames){methodNames=methodNames.length?baseFlatten(methodNames):functions(object);var index=-1,length=methodNames.length;while(++index 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // using placeholders + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */var bindKey=restParam(function(object,key,partials){var bitmask=BIND_FLAG|BIND_KEY_FLAG;if(partials.length){var holders=replaceHolders(partials,bindKey.placeholder);bitmask|=PARTIAL_FLAG;}return createWrapper(key,bitmask,object,partials,holders);});/** + * Creates a function that accepts one or more arguments of `func` that when + * called either invokes `func` returning its result, if all `func` arguments + * have been provided, or returns a function that accepts one or more of the + * remaining `func` arguments, and so on. The arity of `func` may be specified + * if `func.length` is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method does not set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // using placeholders + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */var curry=createCurry(CURRY_FLAG);/** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method does not set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // using placeholders + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */var curryRight=createCurry(CURRY_RIGHT_FLAG);/** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed invocations. Provide an options object to indicate that `func` + * should be invoked on the leading and/or trailing edge of the `wait` timeout. + * Subsequent calls to the debounced function return the result of the last + * `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked + * on the trailing edge of the timeout only if the the debounced function is + * invoked more than once during the `wait` timeout. + * + * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=false] Specify invoking on the leading + * edge of the timeout. + * @param {number} [options.maxWait] The maximum time `func` is allowed to be + * delayed before it is invoked. + * @param {boolean} [options.trailing=true] Specify invoking on the trailing + * edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // avoid costly calculations while the window size is in flux + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // invoke `sendMail` when the click event is fired, debouncing subsequent calls + * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // ensure `batchLog` is invoked once after 1 second of debounced calls + * var source = new EventSource('/stream'); + * jQuery(source).on('message', _.debounce(batchLog, 250, { + * 'maxWait': 1000 + * })); + * + * // cancel a debounced call + * var todoChanges = _.debounce(batchLog, 1000); + * Object.observe(models.todo, todoChanges); + * + * Object.observe(models, function(changes) { + * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) { + * todoChanges.cancel(); + * } + * }, ['delete']); + * + * // ...at some point `models.todo` is changed + * models.todo.completed = true; + * + * // ...before 1 second has passed `models.todo` is deleted + * // which cancels the debounced `todoChanges` call + * delete models.todo; + */function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}wait=wait<0?0:+wait||0;if(options===true){var leading=true;trailing=false;}else if(isObject(options)){leading=!!options.leading;maxWait='maxWait'in options&&nativeMax(+options.maxWait||0,wait);trailing='trailing'in options?!!options.trailing:trailing;}function cancel(){if(timeoutId){clearTimeout(timeoutId);}if(maxTimeoutId){clearTimeout(maxTimeoutId);}lastCalled=0;maxTimeoutId=timeoutId=trailingCall=undefined;}function complete(isCalled,id){if(id){clearTimeout(id);}maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=undefined;}}}function delayed(){var remaining=wait-(now()-stamp);if(remaining<=0||remaining>wait){complete(trailingCall,maxTimeoutId);}else{timeoutId=setTimeout(delayed,remaining);}}function maxDelayed(){complete(trailing,timeoutId);}function debounced(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId;}else{if(!maxTimeoutId&&!leading){lastCalled=stamp;}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0||remaining>maxWait;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId);}lastCalled=stamp;result=func.apply(thisArg,args);}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining);}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId);}else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait);}if(leadingCall){isCalled=true;result=func.apply(thisArg,args);}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=undefined;}return result;}debounced.cancel=cancel;return debounced;}/** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke the function with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // logs 'deferred' after one or more milliseconds + */var defer=restParam(function(func,args){return baseDelay(func,1,args);});/** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke the function with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => logs 'later' after one second + */var delay=restParam(function(func,wait,args){return baseDelay(func,wait,args);});/** + * Creates a function that returns the result of invoking the provided + * functions with the `this` binding of the created function, where each + * successive invocation is supplied the return value of the previous. + * + * @static + * @memberOf _ + * @category Function + * @param {...Function} [funcs] Functions to invoke. + * @returns {Function} Returns the new function. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flow(_.add, square); + * addSquare(1, 2); + * // => 9 + */var flow=createFlow();/** + * This method is like `_.flow` except that it creates a function that + * invokes the provided functions from right to left. + * + * @static + * @memberOf _ + * @alias backflow, compose + * @category Function + * @param {...Function} [funcs] Functions to invoke. + * @returns {Function} Returns the new function. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flowRight(square, _.add); + * addSquare(1, 2); + * // => 9 + */var flowRight=createFlow(true);/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is coerced to a string and used as the + * cache key. The `func` is invoked with the `this` binding of the memoized + * function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) + * method interface of `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoizing function. + * @example + * + * var upperCase = _.memoize(function(string) { + * return string.toUpperCase(); + * }); + * + * upperCase('fred'); + * // => 'FRED' + * + * // modifying the result cache + * upperCase.cache.set('fred', 'BARNEY'); + * upperCase('fred'); + * // => 'BARNEY' + * + * // replacing `_.memoize.Cache` + * var object = { 'user': 'fred' }; + * var other = { 'user': 'barney' }; + * var identity = _.memoize(_.identity); + * + * identity(object); + * // => { 'user': 'fred' } + * identity(other); + * // => { 'user': 'fred' } + * + * _.memoize.Cache = WeakMap; + * var identity = _.memoize(_.identity); + * + * identity(object); + * // => { 'user': 'fred' } + * identity(other); + * // => { 'user': 'barney' } + */function memoize(func,resolver){if(typeof func!='function'||resolver&&typeof resolver!='function'){throw new TypeError(FUNC_ERROR_TEXT);}var memoized=function memoized(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key)){return cache.get(key);}var result=func.apply(this,args);memoized.cache=cache.set(key,result);return result;};memoized.cache=new memoize.Cache();return memoized;}/** + * Creates a function that runs each argument through a corresponding + * transform function. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms] The functions to transform + * arguments, specified as individual functions or arrays of functions. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var modded = _.modArgs(function(x, y) { + * return [x, y]; + * }, square, doubled); + * + * modded(1, 2); + * // => [1, 4] + * + * modded(5, 10); + * // => [25, 20] + */var modArgs=restParam(function(func,transforms){transforms=baseFlatten(transforms);if(typeof func!='function'||!arrayEvery(transforms,baseIsFunction)){throw new TypeError(FUNC_ERROR_TEXT);}var length=transforms.length;return restParam(function(args){var index=nativeMin(args.length,length);while(index--){args[index]=transforms[index](args[index]);}return func.apply(this,args);});});/** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */function negate(predicate){if(typeof predicate!='function'){throw new TypeError(FUNC_ERROR_TEXT);}return function(){return!predicate.apply(this,arguments);};}/** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first call. The `func` is invoked + * with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // `initialize` invokes `createApplication` once + */function once(func){return before(2,func);}/** + * Creates a function that invokes `func` with `partial` arguments prepended + * to those provided to the new function. This method is like `_.bind` except + * it does **not** alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method does not set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { + * return greeting + ' ' + name; + * }; + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // using placeholders + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */var partial=createPartial(PARTIAL_FLAG);/** + * This method is like `_.partial` except that partially applied arguments + * are appended to those provided to the new function. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method does not set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { + * return greeting + ' ' + name; + * }; + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // using placeholders + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */var partialRight=createPartial(PARTIAL_RIGHT_FLAG);/** + * Creates a function that invokes `func` with arguments arranged according + * to the specified indexes where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes, + * specified as individual indexes or arrays of indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, 2, 0, 1); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + * + * var map = _.rearg(_.map, [1, 0]); + * map(function(n) { + * return n * 3; + * }, [1, 2, 3]); + * // => [3, 6, 9] + */var rearg=restParam(function(func,indexes){return createWrapper(func,REARG_FLAG,undefined,undefined,undefined,baseFlatten(indexes));});/** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as an array. + * + * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.restParam(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */function restParam(func,start){if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}start=nativeMax(start===undefined?func.length-1:+start||0,0);return function(){var args=arguments,index=-1,length=nativeMax(args.length-start,0),rest=Array(length);while(++index 'fred says hello' + * + * // with a Promise + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */function spread(func){if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}return function(array){return func.apply(this,array);};}/** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed invocations. Provide an options object to indicate + * that `func` should be invoked on the leading and/or trailing edge of the + * `wait` timeout. Subsequent calls to the throttled function return the + * result of the last `func` call. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked + * on the trailing edge of the timeout only if the the throttled function is + * invoked more than once during the `wait` timeout. + * + * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=true] Specify invoking on the leading + * edge of the timeout. + * @param {boolean} [options.trailing=true] Specify invoking on the trailing + * edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // avoid excessively updating the position while scrolling + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes + * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { + * 'trailing': false + * })); + * + * // cancel a trailing throttled call + * jQuery(window).on('popstate', throttled.cancel); + */function throttle(func,wait,options){var leading=true,trailing=true;if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}if(options===false){leading=false;}else if(isObject(options)){leading='leading'in options?!!options.leading:leading;trailing='trailing'in options?!!options.trailing:trailing;}return debounce(func,wait,{'leading':leading,'maxWait':+wait,'trailing':trailing});}/** + * Creates a function that provides `value` to the wrapper function as its + * first argument. Any additional arguments provided to the function are + * appended to those provided to the wrapper function. The wrapper is invoked + * with the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Function + * @param {*} value The value to wrap. + * @param {Function} wrapper The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

fred, barney, & pebbles

' + */function wrap(value,wrapper){wrapper=wrapper==null?identity:wrapper;return createWrapper(wrapper,PARTIAL_FLAG,undefined,[value],[]);}/*------------------------------------------------------------------------*//** + * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned, + * otherwise they are assigned by reference. If `customizer` is provided it is + * invoked to produce the cloned values. If `customizer` returns `undefined` + * cloning is handled by the method instead. The `customizer` is bound to + * `thisArg` and invoked with two argument; (value [, index|key, object]). + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). + * The enumerable properties of `arguments` objects and objects created by + * constructors other than `Object` are cloned to plain `Object` objects. An + * empty object is returned for uncloneable values such as functions, DOM nodes, + * Maps, Sets, and WeakMaps. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {Function} [customizer] The function to customize cloning values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {*} Returns the cloned value. + * @example + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * var shallow = _.clone(users); + * shallow[0] === users[0]; + * // => true + * + * var deep = _.clone(users, true); + * deep[0] === users[0]; + * // => false + * + * // using a customizer callback + * var el = _.clone(document.body, function(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * }); + * + * el === document.body + * // => false + * el.nodeName + * // => BODY + * el.childNodes.length; + * // => 0 + */function clone(value,isDeep,customizer,thisArg){if(isDeep&&typeof isDeep!='boolean'&&isIterateeCall(value,isDeep,customizer)){isDeep=false;}else if(typeof isDeep=='function'){thisArg=customizer;customizer=isDeep;isDeep=false;}return typeof customizer=='function'?baseClone(value,isDeep,bindCallback(customizer,thisArg,1)):baseClone(value,isDeep);}/** + * Creates a deep clone of `value`. If `customizer` is provided it is invoked + * to produce the cloned values. If `customizer` returns `undefined` cloning + * is handled by the method instead. The `customizer` is bound to `thisArg` + * and invoked with two argument; (value [, index|key, object]). + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). + * The enumerable properties of `arguments` objects and objects created by + * constructors other than `Object` are cloned to plain `Object` objects. An + * empty object is returned for uncloneable values such as functions, DOM nodes, + * Maps, Sets, and WeakMaps. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to deep clone. + * @param {Function} [customizer] The function to customize cloning values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {*} Returns the deep cloned value. + * @example + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * var deep = _.cloneDeep(users); + * deep[0] === users[0]; + * // => false + * + * // using a customizer callback + * var el = _.cloneDeep(document.body, function(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * }); + * + * el === document.body + * // => false + * el.nodeName + * // => BODY + * el.childNodes.length; + * // => 20 + */function cloneDeep(value,customizer,thisArg){return typeof customizer=='function'?baseClone(value,true,bindCallback(customizer,thisArg,1)):baseClone(value,true);}/** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`. + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */function gt(value,other){return value>other;}/** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`. + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */function gte(value,other){return value>=other;}/** + * Checks if `value` is classified as an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */function isArguments(value){return isObjectLike(value)&&isArrayLike(value)&&hasOwnProperty.call(value,'callee')&&!propertyIsEnumerable.call(value,'callee');}/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(function() { return arguments; }()); + * // => false + */var isArray=nativeIsArray||function(value){return isObjectLike(value)&&isLength(value.length)&&objToString.call(value)==arrayTag;};/** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */function isBoolean(value){return value===true||value===false||isObjectLike(value)&&objToString.call(value)==boolTag;}/** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */function isDate(value){return isObjectLike(value)&&objToString.call(value)==dateTag;}/** + * Checks if `value` is a DOM element. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */function isElement(value){return!!value&&value.nodeType===1&&isObjectLike(value)&&!isPlainObject(value);}/** + * Checks if `value` is empty. A value is considered empty unless it is an + * `arguments` object, array, string, or jQuery-like collection with a length + * greater than `0` or an object with own enumerable properties. + * + * @static + * @memberOf _ + * @category Lang + * @param {Array|Object|string} value The value to inspect. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */function isEmpty(value){if(value==null){return true;}if(isArrayLike(value)&&(isArray(value)||isString(value)||isArguments(value)||isObjectLike(value)&&isFunction(value.splice))){return!value.length;}return!keys(value).length;}/** + * Performs a deep comparison between two values to determine if they are + * equivalent. If `customizer` is provided it is invoked to compare values. + * If `customizer` returns `undefined` comparisons are handled by the method + * instead. The `customizer` is bound to `thisArg` and invoked with three + * arguments: (value, other [, index|key]). + * + * **Note:** This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Objects are compared by + * their own, not inherited, enumerable properties. Functions and DOM nodes + * are **not** supported. Provide a customizer function to extend support + * for comparing other values. + * + * @static + * @memberOf _ + * @alias eq + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize value comparisons. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * object == other; + * // => false + * + * _.isEqual(object, other); + * // => true + * + * // using a customizer callback + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqual(array, other, function(value, other) { + * if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) { + * return true; + * } + * }); + * // => true + */function isEqual(value,other,customizer,thisArg){customizer=typeof customizer=='function'?bindCallback(customizer,thisArg,3):undefined;var result=customizer?customizer(value,other):undefined;return result===undefined?baseIsEqual(value,other,customizer):!!result;}/** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */function isError(value){return isObjectLike(value)&&typeof value.message=='string'&&objToString.call(value)==errorTag;}/** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(10); + * // => true + * + * _.isFinite('10'); + * // => false + * + * _.isFinite(true); + * // => false + * + * _.isFinite(Object(10)); + * // => false + * + * _.isFinite(Infinity); + * // => false + */function isFinite(value){return typeof value=='number'&&nativeIsFinite(value);}/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */function isFunction(value){// The use of `Object#toString` avoids issues with the `typeof` operator +// in older versions of Chrome and Safari which return 'function' for regexes +// and Safari 8 equivalents which return 'object' for typed array constructors. +return isObject(value)&&objToString.call(value)==funcTag;}/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */function isObject(value){// Avoid a V8 JIT bug in Chrome 19-20. +// See https://code.google.com/p/v8/issues/detail?id=2291 for more details. +var type=typeof value==="undefined"?"undefined":_typeof(value);return!!value&&(type=='object'||type=='function');}/** + * Performs a deep comparison between `object` and `source` to determine if + * `object` contains equivalent property values. If `customizer` is provided + * it is invoked to compare values. If `customizer` returns `undefined` + * comparisons are handled by the method instead. The `customizer` is bound + * to `thisArg` and invoked with three arguments: (value, other, index|key). + * + * **Note:** This method supports comparing properties of arrays, booleans, + * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions + * and DOM nodes are **not** supported. Provide a customizer function to extend + * support for comparing other values. + * + * @static + * @memberOf _ + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize value comparisons. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'user': 'fred', 'age': 40 }; + * + * _.isMatch(object, { 'age': 40 }); + * // => true + * + * _.isMatch(object, { 'age': 36 }); + * // => false + * + * // using a customizer callback + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatch(object, source, function(value, other) { + * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; + * }); + * // => true + */function isMatch(object,source,customizer,thisArg){customizer=typeof customizer=='function'?bindCallback(customizer,thisArg,3):undefined;return baseIsMatch(object,getMatchData(source),customizer);}/** + * Checks if `value` is `NaN`. + * + * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4) + * which returns `true` for `undefined` and other non-numeric values. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */function isNaN(value){// An `NaN` primitive is the only value that is not equal to itself. +// Perform the `toStringTag` check first to avoid errors with some host objects in IE. +return isNumber(value)&&value!=+value;}/** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */function isNative(value){if(value==null){return false;}if(isFunction(value)){return reIsNative.test(fnToString.call(value));}return isObjectLike(value)&&reIsHostCtor.test(value);}/** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */function isNull(value){return value===null;}/** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified + * as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isNumber(8.4); + * // => true + * + * _.isNumber(NaN); + * // => true + * + * _.isNumber('8.4'); + * // => false + */function isNumber(value){return typeof value=='number'||isObjectLike(value)&&objToString.call(value)==numberTag;}/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * **Note:** This method assumes objects created by the `Object` constructor + * have no inherited enumerable properties. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */function isPlainObject(value){var Ctor;// Exit early for non `Object` objects. +if(!(isObjectLike(value)&&objToString.call(value)==objectTag&&!isArguments(value))||!hasOwnProperty.call(value,'constructor')&&(Ctor=value.constructor,typeof Ctor=='function'&&!(Ctor instanceof Ctor))){return false;}// IE < 9 iterates inherited properties before own properties. If the first +// iterated property is an object's own property then there are no inherited +// enumerable properties. +var result;// In most environments an object's own properties are iterated before +// its inherited properties. If the last iterated property is an object's +// own property then there are no inherited enumerable properties. +baseForIn(value,function(subValue,key){result=key;});return result===undefined||hasOwnProperty.call(value,result);}/** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */function isRegExp(value){return isObject(value)&&objToString.call(value)==regexpTag;}/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */function isString(value){return typeof value=='string'||isObjectLike(value)&&objToString.call(value)==stringTag;}/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */function isTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[objToString.call(value)];}/** + * Checks if `value` is `undefined`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */function isUndefined(value){return value===undefined;}/** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`. + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */function lt(value,other){return value true + * + * _.lte(3, 3); + * // => true + * + * _.lte(3, 1); + * // => false + */function lte(value,other){return value<=other;}/** + * Converts `value` to an array. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * (function() { + * return _.toArray(arguments).slice(1); + * }(1, 2, 3)); + * // => [2, 3] + */function toArray(value){var length=value?getLength(value):0;if(!isLength(length)){return values(value);}if(!length){return[];}return arrayCopy(value);}/** + * Converts `value` to a plain object flattening inherited enumerable + * properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */function toPlainObject(value){return baseCopy(value,keysIn(value));}/*------------------------------------------------------------------------*//** + * Recursively merges own enumerable properties of the source object(s), that + * don't resolve to `undefined` into the destination object. Subsequent sources + * overwrite property assignments of previous sources. If `customizer` is + * provided it is invoked to produce the merged values of the destination and + * source properties. If `customizer` returns `undefined` merging is handled + * by the method instead. The `customizer` is bound to `thisArg` and invoked + * with five arguments: (objectValue, sourceValue, key, object, source). + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {Object} Returns `object`. + * @example + * + * var users = { + * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] + * }; + * + * var ages = { + * 'data': [{ 'age': 36 }, { 'age': 40 }] + * }; + * + * _.merge(users, ages); + * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } + * + * // using a customizer callback + * var object = { + * 'fruits': ['apple'], + * 'vegetables': ['beet'] + * }; + * + * var other = { + * 'fruits': ['banana'], + * 'vegetables': ['carrot'] + * }; + * + * _.merge(object, other, function(a, b) { + * if (_.isArray(a)) { + * return a.concat(b); + * } + * }); + * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } + */var merge=createAssigner(baseMerge);/** + * Assigns own enumerable properties of source object(s) to the destination + * object. Subsequent sources overwrite property assignments of previous sources. + * If `customizer` is provided it is invoked to produce the assigned values. + * The `customizer` is bound to `thisArg` and invoked with five arguments: + * (objectValue, sourceValue, key, object, source). + * + * **Note:** This method mutates `object` and is based on + * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign). + * + * @static + * @memberOf _ + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {Object} Returns `object`. + * @example + * + * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); + * // => { 'user': 'fred', 'age': 40 } + * + * // using a customizer callback + * var defaults = _.partialRight(_.assign, function(value, other) { + * return _.isUndefined(value) ? other : value; + * }); + * + * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); + * // => { 'user': 'barney', 'age': 36 } + */var assign=createAssigner(function(object,source,customizer){return customizer?assignWith(object,source,customizer):baseAssign(object,source);});/** + * Creates an object that inherits from the given `prototype` object. If a + * `properties` object is provided its own enumerable properties are assigned + * to the created object. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */function create(prototype,properties,guard){var result=baseCreate(prototype);if(guard&&isIterateeCall(prototype,properties,guard)){properties=undefined;}return properties?baseAssign(result,properties):result;}/** + * Assigns own enumerable properties of source object(s) to the destination + * object for all destination properties that resolve to `undefined`. Once a + * property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); + * // => { 'user': 'barney', 'age': 36 } + */var defaults=createDefaults(assign,assignDefaults);/** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } }); + * // => { 'user': { 'name': 'barney', 'age': 36 } } + * + */var defaultsDeep=createDefaults(merge,mergeDefaults);/** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to search. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {string|undefined} Returns the key of the matched element, else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(chr) { + * return chr.age < 40; + * }); + * // => 'barney' (iteration order is not guaranteed) + * + * // using the `_.matches` callback shorthand + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // using the `_.matchesProperty` callback shorthand + * _.findKey(users, 'active', false); + * // => 'fred' + * + * // using the `_.property` callback shorthand + * _.findKey(users, 'active'); + * // => 'barney' + */var findKey=createFindKey(baseForOwn);/** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to search. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {string|undefined} Returns the key of the matched element, else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(chr) { + * return chr.age < 40; + * }); + * // => returns `pebbles` assuming `_.findKey` returns `barney` + * + * // using the `_.matches` callback shorthand + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // using the `_.matchesProperty` callback shorthand + * _.findLastKey(users, 'active', false); + * // => 'fred' + * + * // using the `_.property` callback shorthand + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */var findLastKey=createFindKey(baseForOwnRight);/** + * Iterates over own and inherited enumerable properties of an object invoking + * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed) + */var forIn=createForIn(baseFor);/** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c' + */var forInRight=createForIn(baseForRight);/** + * Iterates over own enumerable properties of an object invoking `iteratee` + * for each property. The `iteratee` is bound to `thisArg` and invoked with + * three arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => logs 'a' and 'b' (iteration order is not guaranteed) + */var forOwn=createForOwn(baseForOwn);/** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b' + */var forOwnRight=createForOwn(baseForOwnRight);/** + * Creates an array of function property names from all enumerable properties, + * own and inherited, of `object`. + * + * @static + * @memberOf _ + * @alias methods + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the new array of property names. + * @example + * + * _.functions(_); + * // => ['after', 'ary', 'assign', ...] + */function functions(object){return baseFunctions(object,keysIn(object));}/** + * Gets the property value at `path` of `object`. If the resolved value is + * `undefined` the `defaultValue` is used in its place. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */function get(object,path,defaultValue){var result=object==null?undefined:baseGet(object,toPath(path),path+'');return result===undefined?defaultValue:result;}/** + * Checks if `path` is a direct property. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` is a direct property, else `false`. + * @example + * + * var object = { 'a': { 'b': { 'c': 3 } } }; + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b.c'); + * // => true + * + * _.has(object, ['a', 'b', 'c']); + * // => true + */function has(object,path){if(object==null){return false;}var result=hasOwnProperty.call(object,path);if(!result&&!isKey(path)){path=toPath(path);object=path.length==1?object:baseGet(object,baseSlice(path,0,-1));if(object==null){return false;}path=last(path);result=hasOwnProperty.call(object,path);}return result||isLength(object.length)&&isIndex(path,object.length)&&(isArray(object)||isArguments(object));}/** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite property + * assignments of previous values unless `multiValue` is `true`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to invert. + * @param {boolean} [multiValue] Allow multiple values per key. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + * + * // with `multiValue` + * _.invert(object, true); + * // => { '1': ['a', 'c'], '2': ['b'] } + */function invert(object,multiValue,guard){if(guard&&isIterateeCall(object,multiValue,guard)){multiValue=undefined;}var index=-1,props=keys(object),length=props.length,result={};while(++index ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */var keys=!nativeKeys?shimKeys:function(object){var Ctor=object==null?undefined:object.constructor;if(typeof Ctor=='function'&&Ctor.prototype===object||typeof object!='function'&&isArrayLike(object)){return shimKeys(object);}return isObject(object)?nativeKeys(object):[];};/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */function keysIn(object){if(object==null){return[];}if(!isObject(object)){object=Object(object);}var length=object.length;length=length&&isLength(length)&&(isArray(object)||isArguments(object))&&length||0;var Ctor=object.constructor,index=-1,isProto=typeof Ctor=='function'&&Ctor.prototype===object,result=Array(length),skipIndexes=length>0;while(++index { 'a1': 1, 'b2': 2 } + */var mapKeys=createObjectMapper(true);/** + * Creates an object with the same keys as `object` and values generated by + * running each own enumerable property of `object` through `iteratee`. The + * iteratee function is bound to `thisArg` and invoked with three arguments: + * (value, key, object). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Object} Returns the new mapped object. + * @example + * + * _.mapValues({ 'a': 1, 'b': 2 }, function(n) { + * return n * 3; + * }); + * // => { 'a': 3, 'b': 6 } + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * // using the `_.property` callback shorthand + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */var mapValues=createObjectMapper();/** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable properties of `object` that are not omitted. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {Function|...(string|string[])} [predicate] The function invoked per + * iteration or property names to omit, specified as individual property + * names or arrays of property names. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'user': 'fred', 'age': 40 }; + * + * _.omit(object, 'age'); + * // => { 'user': 'fred' } + * + * _.omit(object, _.isNumber); + * // => { 'user': 'fred' } + */var omit=restParam(function(object,props){if(object==null){return{};}if(typeof props[0]!='function'){var props=arrayMap(baseFlatten(props),String);return pickByArray(object,baseDifference(keysIn(object),props));}var predicate=bindCallback(props[0],props[1],3);return pickByCallback(object,function(value,key,object){return!predicate(value,key,object);});});/** + * Creates a two dimensional array of the key-value pairs for `object`, + * e.g. `[[key1, value1], [key2, value2]]`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the new array of key-value pairs. + * @example + * + * _.pairs({ 'barney': 36, 'fred': 40 }); + * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed) + */function pairs(object){object=toObject(object);var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index { 'user': 'fred' } + * + * _.pick(object, _.isString); + * // => { 'user': 'fred' } + */var pick=restParam(function(object,props){if(object==null){return{};}return typeof props[0]=='function'?pickByCallback(object,bindCallback(props[0],props[1],3)):pickByArray(object,baseFlatten(props));});/** + * This method is like `_.get` except that if the resolved value is a function + * it is invoked with the `this` binding of its parent object and its result + * is returned. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a.b.c', 'default'); + * // => 'default' + * + * _.result(object, 'a.b.c', _.constant('default')); + * // => 'default' + */function result(object,path,defaultValue){var result=object==null?undefined:object[path];if(result===undefined){if(object!=null&&!isKey(path,object)){path=toPath(path);object=path.length==1?object:baseGet(object,baseSlice(path,0,-1));result=object==null?undefined:object[last(path)];}result=result===undefined?defaultValue:result;}return isFunction(result)?result.call(object):result;}/** + * Sets the property value of `path` on `object`. If a portion of `path` + * does not exist it is created. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to augment. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, 'x[0].y.z', 5); + * console.log(object.x[0].y.z); + * // => 5 + */function set(object,path,value){if(object==null){return object;}var pathKey=path+'';path=object[pathKey]!=null||isKey(path,object)?[pathKey]:toPath(path);var index=-1,length=path.length,lastIndex=length-1,nested=object;while(nested!=null&&++index [4, 9] + * + * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) { + * result[key] = n * 3; + * }); + * // => { 'a': 3, 'b': 6 } + */function transform(object,iteratee,accumulator,thisArg){var isArr=isArray(object)||isTypedArray(object);iteratee=getCallback(iteratee,thisArg,4);if(accumulator==null){if(isArr||isObject(object)){var Ctor=object.constructor;if(isArr){accumulator=isArray(object)?new Ctor():[];}else{accumulator=baseCreate(isFunction(Ctor)?Ctor.prototype:undefined);}}else{accumulator={};}}(isArr?arrayEach:baseForOwn)(object,function(value,index,object){return iteratee(accumulator,value,index,object);});return accumulator;}/** + * Creates an array of the own enumerable property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */function values(object){return baseValues(object,keys(object));}/** + * Creates an array of the own and inherited enumerable property values + * of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) + */function valuesIn(object){return baseValues(object,keysIn(object));}/*------------------------------------------------------------------------*//** + * Checks if `n` is between `start` and up to but not including, `end`. If + * `end` is not specified it is set to `start` with `start` then set to `0`. + * + * @static + * @memberOf _ + * @category Number + * @param {number} n The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `n` is in the range, else `false`. + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + */function inRange(value,start,end){start=+start||0;if(end===undefined){end=start;start=0;}else{end=+end||0;}return value>=nativeMin(start,end)&&value an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */function random(min,max,floating){if(floating&&isIterateeCall(min,max,floating)){max=floating=undefined;}var noMin=min==null,noMax=max==null;if(floating==null){if(noMax&&typeof min=='boolean'){floating=min;min=1;}else if(typeof max=='boolean'){floating=max;noMax=true;}}if(noMin&&noMax){max=1;noMax=false;}min=+min||0;if(noMax){max=min;min=0;}else{max=+max||0;}if(floating||min%1||max%1){var rand=nativeRandom();return nativeMin(min+rand*(max-min+parseFloat('1e-'+((rand+'').length-1))),max);}return baseRandom(min,max);}/*------------------------------------------------------------------------*//** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar'); + * // => 'fooBar' + * + * _.camelCase('__foo_bar__'); + * // => 'fooBar' + */var camelCase=createCompounder(function(result,word,index){word=word.toLowerCase();return result+(index?word.charAt(0).toUpperCase()+word.slice(1):word);});/** + * Capitalizes the first character of `string`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('fred'); + * // => 'Fred' + */function capitalize(string){string=baseToString(string);return string&&string.charAt(0).toUpperCase()+string.slice(1);}/** + * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */function deburr(string){string=baseToString(string);return string&&string.replace(reLatin1,deburrLetter).replace(reComboMark,'');}/** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to search. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search from. + * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */function endsWith(string,target,position){string=baseToString(string);target=target+'';var length=string.length;position=position===undefined?length:nativeMin(position<0?0:+position||0,length);position-=target.length;return position>=0&&string.indexOf(target,position)==position;}/** + * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string` to + * their corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional characters + * use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. + * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * Backticks are escaped because in Internet Explorer < 9, they can break out + * of attribute values or HTML comments. See [#59](https://html5sec.org/#59), + * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and + * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) + * for more details. + * + * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping) + * to reduce XSS vectors. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */function escape(string){// Reset `lastIndex` because in IE < 9 `String#replace` does not. +string=baseToString(string);return string&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string;}/** + * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?", + * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https:\/\/lodash\.com\/\)' + */function escapeRegExp(string){string=baseToString(string);return string&&reHasRegExpChars.test(string)?string.replace(reRegExpChars,escapeRegExpChar):string||'(?:)';}/** + * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__foo_bar__'); + * // => 'foo-bar' + */var kebabCase=createCompounder(function(result,word,index){return result+(index?'-':'')+word.toLowerCase();});/** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */function pad(string,length,chars){string=baseToString(string);length=+length;var strLength=string.length;if(strLength>=length||!nativeIsFinite(length)){return string;}var mid=(length-strLength)/2,leftLength=nativeFloor(mid),rightLength=nativeCeil(mid);chars=createPadding('',rightLength,chars);return chars.slice(0,leftLength)+string+chars;}/** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padLeft('abc', 6); + * // => ' abc' + * + * _.padLeft('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padLeft('abc', 3); + * // => 'abc' + */var padLeft=createPadDir();/** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padRight('abc', 6); + * // => 'abc ' + * + * _.padRight('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padRight('abc', 3); + * // => 'abc' + */var padRight=createPadDir(true);/** + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, + * in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E) + * of `parseInt`. + * + * @static + * @memberOf _ + * @category String + * @param {string} string The string to convert. + * @param {number} [radix] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {number} Returns the converted integer. + * @example + * + * _.parseInt('08'); + * // => 8 + * + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] + */function parseInt(string,radix,guard){// Firefox < 21 and Opera < 15 follow ES3 for `parseInt`. +// Chrome fails to trim leading whitespace characters. +// See https://code.google.com/p/v8/issues/detail?id=3109 for more details. +if(guard?isIterateeCall(string,radix,guard):radix==null){radix=0;}else if(radix){radix=+radix;}string=trim(string);return nativeParseInt(string,radix||(reHasHexPrefix.test(string)?16:10));}/** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=0] The number of times to repeat the string. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */function repeat(string,n){var result='';string=baseToString(string);n=+n;if(n<1||!string||!nativeIsFinite(n)){return result;}// Leverage the exponentiation by squaring algorithm for a faster repeat. +// See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. +do{if(n%2){result+=string;}n=nativeFloor(n/2);string+=string;}while(n);return result;}/** + * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. + * @example + * + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' + * + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--foo-bar'); + * // => 'foo_bar' + */var snakeCase=createCompounder(function(result,word,index){return result+(index?'_':'')+word.toLowerCase();});/** + * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__foo_bar__'); + * // => 'Foo Bar' + */var startCase=createCompounder(function(result,word,index){return result+(index?' ':'')+(word.charAt(0).toUpperCase()+word.slice(1));});/** + * Checks if `string` starts with the given target string. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to search. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`. + * @example + * + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true + */function startsWith(string,target,position){string=baseToString(string);position=position==null?0:nativeMin(position<0?0:+position||0,string.length);return string.lastIndexOf(target,position)==position;}/** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is provided it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options] The options object. + * @param {RegExp} [options.escape] The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate] The "evaluate" delimiter. + * @param {Object} [options.imports] An object to import into the template as free variables. + * @param {RegExp} [options.interpolate] The "interpolate" delimiter. + * @param {string} [options.sourceURL] The sourceURL of the template's compiled source. + * @param {string} [options.variable] The data object variable name. + * @param- {Object} [otherOptions] Enables the legacy `options` param signature. + * @returns {Function} Returns the compiled template function. + * @example + * + * // using the "interpolate" delimiter to create a compiled template + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // using the HTML "escape" delimiter to escape data property values + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': '