diff --git a/asset-manifest.json b/asset-manifest.json index 0eb7c3a..b12c253 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,15 +1,15 @@ { "files": { "main.css": "/voting/static/css/main.bca2956b.css", - "main.js": "/voting/static/js/main.78a29838.js", + "main.js": "/voting/static/js/main.5946e327.js", "static/js/787.ee04e7c1.chunk.js": "/voting/static/js/787.ee04e7c1.chunk.js", "index.html": "/voting/index.html", "main.bca2956b.css.map": "/voting/static/css/main.bca2956b.css.map", - "main.78a29838.js.map": "/voting/static/js/main.78a29838.js.map", + "main.5946e327.js.map": "/voting/static/js/main.5946e327.js.map", "787.ee04e7c1.chunk.js.map": "/voting/static/js/787.ee04e7c1.chunk.js.map" }, "entrypoints": [ "static/css/main.bca2956b.css", - "static/js/main.78a29838.js" + "static/js/main.5946e327.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index d7248e5..71d899f 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -React App
\ No newline at end of file +React App
\ No newline at end of file diff --git a/static/js/main.5946e327.js b/static/js/main.5946e327.js new file mode 100644 index 0000000..dc3e56b --- /dev/null +++ b/static/js/main.5946e327.js @@ -0,0 +1,3 @@ +/*! For license information please see main.5946e327.js.LICENSE.txt */ +!function(){var t={76318:function(t,e,r){"use strict";var n=r(72791),i=r.t(n,2),o=r(1250);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(){s=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(P){f=function(t,e,r){return t[e]=r}}function l(t,e,r,i){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),s=new A(i||[]);return n(a,"_invoke",{value:M(t,r,s)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(P){return{type:"throw",arg:P}}}t.wrap=l;var d={};function p(){}function m(){}function g(){}var v={};f(v,o,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(O([])));b&&b!==e&&r.call(b,o)&&(v=b);var w=g.prototype=p.prototype=Object.create(v);function _(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function i(n,o,s,u){var c=h(t[n],t,o);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==a(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){i("next",t,s,u)}),(function(t){i("throw",t,s,u)})):e.resolve(l).then((function(t){f.value=t,s(f)}),(function(t){return i("throw",t,s,u)}))}u(c.arg)}var o;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return o=o?o.then(n,n):n()}})}function M(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return T()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=k(a,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=h(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function k(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var i=h(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,d;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function u(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(c){return void r(c)}s.done?e(u):Promise.resolve(u).then(n,i)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){u(o,n,i,a,s,"next",t)}function s(t){u(o,n,i,a,s,"throw",t)}a(void 0)}))}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0||(i[r]=t[r]);return i}function m(t){var e,r,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;e2&&void 0!==arguments[2]?arguments[2]:void 0,n={};return Object.keys(t).forEach((function(i){n[i]=t[i].reduce((function(t,n){if(n){var i=e(n);""!==i&&t.push(i),r&&r[n]&&t.push(r[n])}return t}),[]).join(" ")})),n}function y(t){var e=function(t,e){if("object"!==a(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===a(e)?e:String(e)}function b(t,e,r){return(e=y(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{clone:!0},n=r.clone?_({},t):t;return M(t)&&M(e)&&Object.keys(e).forEach((function(i){"__proto__"!==i&&(M(e[i])&&i in t&&M(t[i])?n[i]=x(t[i],e[i],r):r.clone?n[i]=M(e[i])?k(e[i]):e[i]:n[i]=e[i])})),n}var E=["values","unit","step"],A=function(t){var e=Object.keys(t).map((function(e){return{key:e,val:t[e]}}))||[];return e.sort((function(t,e){return t.val-e.val})),e.reduce((function(t,e){return d({},t,b({},e.key,e.val))}),{})};var O={borderRadius:4},T={xs:0,sm:600,md:900,lg:1200,xl:1536},P={keys:["xs","sm","md","lg","xl"],up:function(t){return"@media (min-width:".concat(T[t],"px)")}};function I(t,e,r){var n=t.theme||{};if(Array.isArray(e)){var i=n.breakpoints||P;return e.reduce((function(t,n,o){return t[i.up(i.keys[o])]=r(e[o]),t}),{})}if("object"===typeof e){var o=n.breakpoints||P;return Object.keys(e).reduce((function(t,n){if(-1!==Object.keys(o.values||T).indexOf(n)){t[o.up(n)]=r(e[n],n)}else{var i=n;t[i]=e[i]}return t}),{})}return r(e)}function R(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(null==(t=e.keys)?void 0:t.reduce((function(t,r){return t[e.up(r)]={},t}),{}))||{}}function C(t,e){return t.reduce((function(t,e){var r=t[e];return(!r||0===Object.keys(r).length)&&delete t[e],t}),e)}function N(t){var e,r=t.values,n=t.breakpoints,i=t.base||function(t,e){if("object"!==typeof t)return{};var r={},n=Object.keys(e);return Array.isArray(t)?n.forEach((function(e,n){n2&&void 0!==arguments[2])||arguments[2];if(!e||"string"!==typeof e)return null;if(t&&t.vars&&r){var n="vars.".concat(e).split(".").reduce((function(t,e){return t&&t[e]?t[e]:null}),t);if(null!=n)return n}return e.split(".").reduce((function(t,e){return t&&null!=t[e]?t[e]:null}),t)}function D(t,e,r){var n,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r;return n="function"===typeof t?t(r):Array.isArray(t)?t[r]||i:L(t,r)||i,e&&(n=e(n,i,t)),n}var U=function(t){var e=t.prop,r=t.cssProperty,n=void 0===r?t.prop:r,i=t.themeKey,o=t.transform,a=function(t){if(null==t[e])return null;var r=t[e],a=L(t.theme,i)||{};return I(t,r,(function(t){var r=D(a,o,t);return t===r&&"string"===typeof t&&(r=D(a,o,"".concat(e).concat("default"===t?"":j(t)),t)),!1===n?r:b({},n,r)}))};return a.propTypes={},a.filterProps=[e],a};var F=function(t,e){return e?x(t,e,{clone:!1}):t};var H={m:"margin",p:"padding"},z={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},K={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},q=function(t){var e={};return function(r){return void 0===e[r]&&(e[r]=t(r)),e[r]}}((function(t){if(t.length>2){if(!K[t])return[t];t=K[t]}var e=h(t.split(""),2),r=e[0],n=e[1],i=H[r],o=z[n]||"";return Array.isArray(o)?o.map((function(t){return i+t})):[i+o]})),V=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],G=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],W=[].concat(V,G);function Y(t,e,r,n){var i,o=null!=(i=L(t,e,!1))?i:r;return"number"===typeof o?function(t){return"string"===typeof t?t:o*t}:Array.isArray(o)?function(t){return"string"===typeof t?t:o[t]}:"function"===typeof o?o:function(){}}function $(t){return Y(t,"spacing",8)}function Z(t,e){if("string"===typeof e||null==e)return e;var r=t(Math.abs(e));return e>=0?r:"number"===typeof r?-r:"-".concat(r)}function X(t,e,r,n){if(-1===e.indexOf(r))return null;var i=function(t,e){return function(r){return t.reduce((function(t,n){return t[n]=Z(e,r),t}),{})}}(q(r),n);return I(t,t[r],i)}function J(t,e){var r=$(t.theme);return Object.keys(t).map((function(n){return X(t,e,n,r)})).reduce(F,{})}function Q(t){return J(t,V)}function tt(t){return J(t,G)}function et(t){return J(t,W)}Q.propTypes={},Q.filterProps=V,tt.propTypes={},tt.filterProps=G,et.propTypes={},et.filterProps=W;var rt=function(){for(var t=arguments.length,e=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=t.breakpoints,r=void 0===e?{}:e,n=t.palette,i=void 0===n?{}:n,o=t.spacing,a=t.shape,s=void 0===a?{}:a,u=p(t,Tt),c=function(t){var e=t.values,r=void 0===e?{xs:0,sm:600,md:900,lg:1200,xl:1536}:e,n=t.unit,i=void 0===n?"px":n,o=t.step,a=void 0===o?5:o,s=p(t,E),u=A(r),c=Object.keys(u);function f(t){var e="number"===typeof r[t]?r[t]:t;return"@media (min-width:".concat(e).concat(i,")")}function l(t){var e="number"===typeof r[t]?r[t]:t;return"@media (max-width:".concat(e-a/100).concat(i,")")}function h(t,e){var n=c.indexOf(e);return"@media (min-width:".concat("number"===typeof r[t]?r[t]:t).concat(i,") and ")+"(max-width:".concat((-1!==n&&"number"===typeof r[c[n]]?r[c[n]]:e)-a/100).concat(i,")")}return d({keys:c,values:u,up:f,down:l,between:h,only:function(t){return c.indexOf(t)+10&&void 0!==arguments[0]?arguments[0]:8;if(t.mui)return t;var e=$({spacing:t}),r=function(){for(var t=arguments.length,r=new Array(t),n=0;n1?h-1:0),g=1;g0?Dt(Yt,--Gt):0,qt--,10===Wt&&(qt=1,Kt--),Wt}function Jt(){return Wt=Gt2||re(Wt)>3?"":" "}function se(t,e){for(;--e&&Jt()&&!(Wt<48||Wt>102||Wt>57&&Wt<65||Wt>70&&Wt<97););return ee(t,te()+(e<6&&32==Qt()&&32==Jt()))}function ue(t){for(;Jt();)switch(Wt){case t:return Gt;case 34:case 39:34!==t&&39!==t&&ue(Wt);break;case 40:41===t&&ue(t);break;case 92:Jt()}return Gt}function ce(t,e){for(;Jt()&&t+Wt!==57&&(t+Wt!==84||47!==Qt()););return"/*"+ee(e,Gt-1)+"*"+Ct(47===t?t:Jt())}function fe(t){for(;!re(Qt());)Jt();return ee(t,Gt)}var le="-ms-",he="-moz-",de="-webkit-",pe="comm",me="rule",ge="decl",ve="@keyframes";function ye(t,e){for(var r="",n=Ht(t),i=0;i0&&Ft(M)-l&&zt(d>32?ke(M+";",n,r,l-1):ke(jt(M," ","")+";",n,r,l-2),u);break;case 59:M+=";";default:if(zt(S=Se(M,e,r,c,f,i,s,b,w=[],_=[],l),o),123===y)if(0===f)_e(M,e,S,S,w,o,l,s,_);else switch(99===h&&110===Dt(M,3)?100:h){case 100:case 108:case 109:case 115:_e(t,S,S,n&&zt(Se(t,S,S,0,0,i,s,b,i,w=[],l),_),i,_,l,s,n?w:_);break;default:_e(M,S,S,S,[""],_,0,s,_)}}c=f=d=0,m=v=1,b=M="",l=a;break;case 58:l=1+Ft(M),d=p;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==Xt())continue;switch(M+=Ct(y),y*m){case 38:v=f>0?1:(M+="\f",-1);break;case 44:s[c++]=(Ft(M)-1)*v,v=1;break;case 64:45===Qt()&&(M+=oe(Jt())),h=Qt(),f=l=Ft(b=M+=fe(te())),y++;break;case 45:45===p&&2==Ft(M)&&(m=0)}}return o}function Se(t,e,r,n,i,o,a,s,u,c,f){for(var l=i-1,h=0===i?o:[""],d=Ht(h),p=0,m=0,g=0;p0?h[v]+" "+y:jt(y,/&\f/g,h[v])))&&(u[g++]=b);return $t(t,e,r,0===i?me:s,u,c,f)}function Me(t,e,r){return $t(t,e,r,pe,Ct(Wt),Ut(t,2,-2),0)}function ke(t,e,r,n){return $t(t,e,r,ge,Ut(t,0,n),Ut(t,n+1,-1),n)}var xe=function(t,e,r){for(var n=0,i=0;n=i,i=Qt(),38===n&&12===i&&(e[r]=1),!re(i);)Jt();return ee(t,Gt)},Ee=function(t,e){return ie(function(t,e){var r=-1,n=44;do{switch(re(n)){case 0:38===n&&12===Qt()&&(e[r]=1),t[r]+=xe(Gt-1,e,r);break;case 2:t[r]+=oe(n);break;case 4:if(44===n){t[++r]=58===Qt()?"&\f":"",e[r]=t[r].length;break}default:t[r]+=Ct(n)}}while(n=Jt());return t}(ne(t),e))},Ae=new WeakMap,Oe=function(t){if("rule"===t.type&&t.parent&&!(t.length<1)){for(var e=t.value,r=t.parent,n=t.column===r.column&&t.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==t.props.length||58===e.charCodeAt(0)||Ae.get(r))&&!n){Ae.set(t,!0);for(var i=[],o=Ee(e,i),a=r.props,s=0,u=0;s6)switch(Dt(t,e+1)){case 109:if(45!==Dt(t,e+4))break;case 102:return jt(t,/(.+:)(.+)-([^]+)/,"$1"+de+"$2-$3$1"+he+(108==Dt(t,e+3)?"$3":"$2-$3"))+t;case 115:return~Lt(t,"stretch")?Pe(jt(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(115!==Dt(t,e+1))break;case 6444:switch(Dt(t,Ft(t)-3-(~Lt(t,"!important")&&10))){case 107:return jt(t,":",":"+de)+t;case 101:return jt(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+de+(45===Dt(t,14)?"inline-":"")+"box$3$1"+de+"$2$3$1"+le+"$2box$3")+t}break;case 5936:switch(Dt(t,e+11)){case 114:return de+t+le+jt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return de+t+le+jt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return de+t+le+jt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return de+t+le+t+t}return t}var Ie=[function(t,e,r,n){if(t.length>-1&&!t.return)switch(t.type){case ge:t.return=Pe(t.value,t.length);break;case ve:return ye([Zt(t,{value:jt(t.value,"@","@"+de)})],n);case me:if(t.length)return function(t,e){return t.map(e).join("")}(t.props,(function(e){switch(function(t,e){return(t=e.exec(t))?t[0]:t}(e,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ye([Zt(t,{props:[jt(e,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return ye([Zt(t,{props:[jt(e,/:(plac\w+)/,":"+de+"input-$1")]}),Zt(t,{props:[jt(e,/:(plac\w+)/,":-moz-$1")]}),Zt(t,{props:[jt(e,/:(plac\w+)/,le+"input-$1")]})],n)}return""}))}}],Re=function(t){var e=t.key;if("css"===e){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(t){-1!==t.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(t),t.setAttribute("data-s",""))}))}var n=t.stylisPlugins||Ie;var i,o,a={},s=[];i=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+e+' "]'),(function(t){for(var e=t.getAttribute("data-emotion").split(" "),r=1;r=4;++n,i-=4)e=1540483477*(65535&(e=255&t.charCodeAt(n)|(255&t.charCodeAt(++n))<<8|(255&t.charCodeAt(++n))<<16|(255&t.charCodeAt(++n))<<24))+(59797*(e>>>16)<<16),r=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&t.charCodeAt(n+2))<<16;case 2:r^=(255&t.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(i)+u;return{name:c,styles:i,next:ze}},Ve=!!i.useInsertionEffect&&i.useInsertionEffect,Ge=Ve||function(t){return t()},We=(Ve||n.useLayoutEffect,n.createContext("undefined"!==typeof HTMLElement?Re({key:"css"}):null));We.Provider;var Ye=function(t){return(0,n.forwardRef)((function(e,r){var i=(0,n.useContext)(We);return t(e,i,r)}))};var $e=n.createContext({});var Ze=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=n.useContext($e);return r&&(t=r,0!==Object.keys(t).length)?r:e},Xe=Pt();var Je=function(){return Ze(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xe)};function Qe(t){var e=t.props,r=t.name,n=t.defaultTheme,i=t.themeId,o=Je(n);i&&(o=o[i]||o);var a=function(t){var e=t.theme,r=t.name,n=t.props;return e&&e.components&&e.components[r]&&e.components[r].defaultProps?S(e.components[r].defaultProps,n):n}({theme:o,name:r,props:e});return a}function tr(t,e){var r;return d({toolbar:(r={minHeight:56},b(r,t.up("xs"),{"@media (orientation: landscape)":{minHeight:48}}),b(r,t.up("sm"),{minHeight:64}),r)},e)}function er(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(e,t),r)}function rr(t){if(t.type)return t;if("#"===t.charAt(0))return rr(function(t){t=t.slice(1);var e=new RegExp(".{1,".concat(t.length>=6?2:1,"}"),"g"),r=t.match(e);return r&&1===r[0].length&&(r=r.map((function(t){return t+t}))),r?"rgb".concat(4===r.length?"a":"","(").concat(r.map((function(t,e){return e<3?parseInt(t,16):Math.round(parseInt(t,16)/255*1e3)/1e3})).join(", "),")"):""}(t));var e=t.indexOf("("),r=t.substring(0,e);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(r))throw new Error(B(9,t));var n,i=t.substring(e+1,t.length-1);if("color"===r){if(n=(i=i.split(" ")).shift(),4===i.length&&"/"===i[3].charAt(0)&&(i[3]=i[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(n))throw new Error(B(10,n))}else i=i.split(",");return{type:r,values:i=i.map((function(t){return parseFloat(t)})),colorSpace:n}}function nr(t){var e=t.type,r=t.colorSpace,n=t.values;return-1!==e.indexOf("rgb")?n=n.map((function(t,e){return e<3?parseInt(t,10):t})):-1!==e.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),n=-1!==e.indexOf("color")?"".concat(r," ").concat(n.join(" ")):"".concat(n.join(", ")),"".concat(e,"(").concat(n,")")}function ir(t){var e="hsl"===(t=rr(t)).type||"hsla"===t.type?rr(function(t){var e=(t=rr(t)).values,r=e[0],n=e[1]/100,i=e[2]/100,o=n*Math.min(i,1-i),a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t+r/30)%12;return i-o*Math.max(Math.min(e-3,9-e,1),-1)},s="rgb",u=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===t.type&&(s+="a",u.push(e[3])),nr({type:s,values:u})}(t)).values:t.values;return e=e.map((function(e){return"color"!==t.type&&(e/=255),e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function or(t,e){return t=rr(t),e=er(e),"rgb"!==t.type&&"hsl"!==t.type||(t.type+="a"),"color"===t.type?t.values[3]="/".concat(e):t.values[3]=e,nr(t)}function ar(t,e){if(t=rr(t),e=er(e),-1!==t.type.indexOf("hsl"))t.values[2]*=1-e;else if(-1!==t.type.indexOf("rgb")||-1!==t.type.indexOf("color"))for(var r=0;r<3;r+=1)t.values[r]*=1-e;return nr(t)}function sr(t,e){if(t=rr(t),e=er(e),-1!==t.type.indexOf("hsl"))t.values[2]+=(100-t.values[2])*e;else if(-1!==t.type.indexOf("rgb"))for(var r=0;r<3;r+=1)t.values[r]+=(255-t.values[r])*e;else if(-1!==t.type.indexOf("color"))for(var n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return nr(t)}var ur={black:"#000",white:"#fff"},cr={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},fr={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},lr={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},hr={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},dr={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},pr={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},mr={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},gr=["mode","contrastThreshold","tonalOffset"],vr={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:ur.white,default:ur.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},yr={text:{primary:ur.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:ur.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function br(t,e,r,n){var i=n.light||n,o=n.dark||1.5*n;t[e]||(t.hasOwnProperty(r)?t[e]=t[r]:"light"===e?t.light=sr(t.main,i):"dark"===e&&(t.dark=ar(t.main,o)))}function wr(t){var e=t.mode,r=void 0===e?"light":e,n=t.contrastThreshold,i=void 0===n?3:n,o=t.tonalOffset,a=void 0===o?.2:o,s=p(t,gr),u=t.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:dr[200],light:dr[50],dark:dr[400]}:{main:dr[700],light:dr[400],dark:dr[800]}}(r),c=t.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:fr[200],light:fr[50],dark:fr[400]}:{main:fr[500],light:fr[300],dark:fr[700]}}(r),f=t.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:lr[500],light:lr[300],dark:lr[700]}:{main:lr[700],light:lr[400],dark:lr[800]}}(r),l=t.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:pr[400],light:pr[300],dark:pr[700]}:{main:pr[700],light:pr[500],dark:pr[900]}}(r),h=t.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:mr[400],light:mr[300],dark:mr[700]}:{main:mr[800],light:mr[500],dark:mr[900]}}(r),m=t.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:hr[400],light:hr[300],dark:hr[700]}:{main:"#ed6c02",light:hr[500],dark:hr[900]}}(r);function g(t){var e=function(t,e){var r=ir(t),n=ir(e);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}(t,yr.text.primary)>=i?yr.text.primary:vr.text.primary;return e}var v=function(t){var e=t.color,r=t.name,n=t.mainShade,i=void 0===n?500:n,o=t.lightShade,s=void 0===o?300:o,u=t.darkShade,c=void 0===u?700:u;if(!(e=d({},e)).main&&e[i]&&(e.main=e[i]),!e.hasOwnProperty("main"))throw new Error(B(11,r?" (".concat(r,")"):"",i));if("string"!==typeof e.main)throw new Error(B(12,r?" (".concat(r,")"):"",JSON.stringify(e.main)));return br(e,"light",s,a),br(e,"dark",c,a),e.contrastText||(e.contrastText=g(e.main)),e},y={dark:yr,light:vr};return x(d({common:d({},ur),mode:r,primary:v({color:u,name:"primary"}),secondary:v({color:c,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:v({color:f,name:"error"}),warning:v({color:m,name:"warning"}),info:v({color:l,name:"info"}),success:v({color:h,name:"success"}),grey:cr,contrastThreshold:i,getContrastText:g,augmentColor:v,tonalOffset:a},y[r]),s)}var _r=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];var Sr={textTransform:"uppercase"},Mr='"Roboto", "Helvetica", "Arial", sans-serif';function kr(t,e){var r="function"===typeof e?e(t):e,n=r.fontFamily,i=void 0===n?Mr:n,o=r.fontSize,a=void 0===o?14:o,s=r.fontWeightLight,u=void 0===s?300:s,c=r.fontWeightRegular,f=void 0===c?400:c,l=r.fontWeightMedium,h=void 0===l?500:l,m=r.fontWeightBold,g=void 0===m?700:m,v=r.htmlFontSize,y=void 0===v?16:v,b=r.allVariants,w=r.pxToRem,_=p(r,_r);var S=a/14,M=w||function(t){return"".concat(t/y*S,"rem")},k=function(t,e,r,n,o){return d({fontFamily:i,fontWeight:t,fontSize:M(e),lineHeight:r},i===Mr?{letterSpacing:"".concat((a=n/e,Math.round(1e5*a)/1e5),"em")}:{},o,b);var a},E={h1:k(u,96,1.167,-1.5),h2:k(u,60,1.2,-.5),h3:k(f,48,1.167,0),h4:k(f,34,1.235,.25),h5:k(f,24,1.334,0),h6:k(h,20,1.6,.15),subtitle1:k(f,16,1.75,.15),subtitle2:k(h,14,1.57,.1),body1:k(f,16,1.5,.15),body2:k(f,14,1.43,.15),button:k(h,14,1.75,.4,Sr),caption:k(f,12,1.66,.4),overline:k(f,12,2.66,1,Sr),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return x(d({htmlFontSize:y,pxToRem:M,fontFamily:i,fontSize:a,fontWeightLight:u,fontWeightRegular:f,fontWeightMedium:h,fontWeightBold:g},E),_,{clone:!1})}function xr(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var Er=["none",xr(0,2,1,-1,0,1,1,0,0,1,3,0),xr(0,3,1,-2,0,2,2,0,0,1,5,0),xr(0,3,3,-2,0,3,4,0,0,1,8,0),xr(0,2,4,-1,0,4,5,0,0,1,10,0),xr(0,3,5,-1,0,5,8,0,0,1,14,0),xr(0,3,5,-1,0,6,10,0,0,1,18,0),xr(0,4,5,-2,0,7,10,1,0,2,16,1),xr(0,5,5,-3,0,8,10,1,0,3,14,2),xr(0,5,6,-3,0,9,12,1,0,3,16,2),xr(0,6,6,-3,0,10,14,1,0,4,18,3),xr(0,6,7,-4,0,11,15,1,0,4,20,3),xr(0,7,8,-4,0,12,17,2,0,5,22,4),xr(0,7,8,-4,0,13,19,2,0,5,24,4),xr(0,7,9,-4,0,14,21,2,0,5,26,4),xr(0,8,9,-5,0,15,22,2,0,6,28,5),xr(0,8,10,-5,0,16,24,2,0,6,30,5),xr(0,8,11,-5,0,17,26,2,0,6,32,5),xr(0,9,11,-5,0,18,28,2,0,7,34,6),xr(0,9,12,-6,0,19,29,2,0,7,36,6),xr(0,10,13,-6,0,20,31,3,0,8,38,7),xr(0,10,13,-6,0,21,33,3,0,8,40,7),xr(0,10,14,-6,0,22,35,3,0,8,42,7),xr(0,11,14,-7,0,23,36,3,0,9,44,8),xr(0,11,15,-7,0,24,38,3,0,9,46,8)],Ar=["duration","easing","delay"],Or={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Tr={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Pr(t){return"".concat(Math.round(t),"ms")}function Ir(t){if(!t)return 0;var e=t/36;return Math.round(10*(4+15*Math.pow(e,.25)+e/5))}function Rr(t){var e=d({},Or,t.easing),r=d({},Tr,t.duration);return d({getAutoHeightDuration:Ir,create:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.duration,o=void 0===i?r.standard:i,a=n.easing,s=void 0===a?e.easeInOut:a,u=n.delay,c=void 0===u?0:u;p(n,Ar);return(Array.isArray(t)?t:[t]).map((function(t){return"".concat(t," ").concat("string"===typeof o?o:Pr(o)," ").concat(s," ").concat("string"===typeof c?c:Pr(c))})).join(",")}},t,{easing:e,duration:r})}var Cr={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},Nr=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function Br(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.mixins,r=void 0===e?{}:e,n=t.palette,i=void 0===n?{}:n,o=t.transitions,a=void 0===o?{}:o,s=t.typography,u=void 0===s?{}:s,c=p(t,Nr);if(t.vars)throw new Error(B(18));var f=wr(i),l=Pt(t),h=x(l,{mixins:tr(l.breakpoints,r),palette:f,shadows:Er.slice(),typography:kr(f,u),transitions:Rr(a),zIndex:d({},Cr)});h=x(h,c);for(var m=arguments.length,g=new Array(m>1?m-1:0),v=1;v96?Kr:qr},Gr=function(t,e,r){var n;if(e){var i=e.shouldForwardProp;n=t.__emotion_forwardProp&&i?function(e){return t.__emotion_forwardProp(e)&&i(e)}:i}return"function"!==typeof n&&r&&(n=t.__emotion_forwardProp),n},Wr=function(t){var e=t.cache,r=t.serialized,n=t.isStringTag;return zr(e,r,n),Ge((function(){return function(t,e,r){zr(t,e,r);var n=t.key+"-"+e.name;if(void 0===t.inserted[e.name]){var i=e;do{t.insert(e===i?"."+n:"",i,t.sheet,!0),i=i.next}while(void 0!==i)}}(e,r,n)})),null},Yr=function t(e,r){var i,o,a=e.__emotion_real===e,s=a&&e.__emotion_base||e;void 0!==r&&(i=r.label,o=r.target);var u=Gr(e,r,a),c=u||Vr(s),f=!c("as");return function(){var l=arguments,h=a&&void 0!==e.__emotion_styles?e.__emotion_styles.slice(0):[];if(void 0!==i&&h.push("label:"+i+";"),null==l[0]||void 0===l[0].raw)h.push.apply(h,l);else{0,h.push(l[0][0]);for(var p=l.length,m=1;m0&&void 0!==arguments[0]?arguments[0]:{},e=t.themeId,r=t.defaultTheme,n=void 0===r?en:r,i=t.rootShouldForwardProp,o=void 0===i?tn:i,a=t.slotShouldForwardProp,s=void 0===a?tn:a,u=function(t){return Ot(d({},t,{theme:rn(d({},t,{defaultTheme:n,themeId:e}))}))};return u.__mui_systemSx=!0,function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))}(t,(function(t){return t.filter((function(t){return!(null!=t&&t.__mui_systemSx)}))}));var i=r.name,a=r.slot,c=r.skipVariantsResolver,f=r.skipSx,l=r.overridesResolver,m=p(r,Qr),g=void 0!==c?c:a&&"Root"!==a||!1,v=f||!1;var y=tn;"Root"===a?y=o:a?y=s:function(t){return"string"===typeof t&&t.charCodeAt(0)>96}(t)&&(y=void 0);var b=$r(t,d({shouldForwardProp:y,label:undefined},m)),w=function(r){for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;s0){var m=new Array(p).fill("");(f=[].concat(Fr(r),Fr(m))).raw=[].concat(Fr(r.raw),Fr(m))}else"function"===typeof r&&r.__emotion_real!==r&&(f=function(t){return r(d({},t,{theme:rn(d({},t,{defaultTheme:n,themeId:e}))}))});var y=b.apply(void 0,[f].concat(Fr(c)));return t.muiName&&(y.muiName=t.muiName),y};return b.withConfig&&(w.withConfig=b.withConfig),w}}var on=function(t){return tn(t)&&"classes"!==t},an=nn({themeId:Dr,defaultTheme:Lr,rootShouldForwardProp:on}),sn=function(t){return t},un=function(){var t=sn;return{configure:function(e){t=e},generate:function(e){return t(e)},reset:function(){t=sn}}}(),cn={active:"active",checked:"checked",completed:"completed",disabled:"disabled",readOnly:"readOnly",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",required:"required",selected:"selected"};function fn(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui",n=cn[e];return n?"".concat(r,"-").concat(n):"".concat(un.generate(t),"-").concat(e)}function ln(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui",n={};return e.forEach((function(e){n[e]=fn(t,e,r)})),n}function hn(t){return fn("MuiTableContainer",t)}ln("MuiTableContainer",["root"]);var dn=r(80184),pn=["className","component"],mn=an("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:function(t,e){return e.root}})({width:"100%",overflowX:"auto"}),gn=n.forwardRef((function(t,e){var r=Ur({props:t,name:"MuiTableContainer"}),n=r.className,i=r.component,o=void 0===i?"div":i,a=p(r,pn),s=d({},r,{component:o}),u=function(t){return v({root:["root"]},hn,t.classes)}(s);return(0,dn.jsx)(mn,d({ref:e,as:o,className:g(u.root,n),ownerState:s},a))})),vn=function(t){return((t<1?5.11916*Math.pow(t,2):4.5*Math.log(t+1)+2)/100).toFixed(2)};function yn(t){return fn("MuiPaper",t)}ln("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);var bn=["className","component","elevation","square","variant"],wn=an("div",{name:"MuiPaper",slot:"Root",overridesResolver:function(t,e){var r=t.ownerState;return[e.root,e[r.variant],!r.square&&e.rounded,"elevation"===r.variant&&e["elevation".concat(r.elevation)]]}})((function(t){var e,r=t.theme,n=t.ownerState;return d({backgroundColor:(r.vars||r).palette.background.paper,color:(r.vars||r).palette.text.primary,transition:r.transitions.create("box-shadow")},!n.square&&{borderRadius:r.shape.borderRadius},"outlined"===n.variant&&{border:"1px solid ".concat((r.vars||r).palette.divider)},"elevation"===n.variant&&d({boxShadow:(r.vars||r).shadows[n.elevation]},!r.vars&&"dark"===r.palette.mode&&{backgroundImage:"linear-gradient(".concat(or("#fff",vn(n.elevation)),", ").concat(or("#fff",vn(n.elevation)),")")},r.vars&&{backgroundImage:null==(e=r.vars.overlays)?void 0:e[n.elevation]}))})),_n=n.forwardRef((function(t,e){var r=Ur({props:t,name:"MuiPaper"}),n=r.className,i=r.component,o=void 0===i?"div":i,a=r.elevation,s=void 0===a?1:a,u=r.square,c=void 0!==u&&u,f=r.variant,l=void 0===f?"elevation":f,h=p(r,bn),m=d({},r,{component:o,elevation:s,square:c,variant:l}),y=function(t){var e=t.square,r=t.elevation,n=t.variant,i=t.classes;return v({root:["root",n,!e&&"rounded","elevation"===n&&"elevation".concat(r)]},yn,i)}(m);return(0,dn.jsx)(wn,d({as:o,ownerState:m,className:g(y.root,n),ref:e},h))}));var Sn=n.createContext();function Mn(t){return fn("MuiTable",t)}ln("MuiTable",["root","stickyHeader"]);var kn=["className","component","padding","size","stickyHeader"],xn=an("table",{name:"MuiTable",slot:"Root",overridesResolver:function(t,e){var r=t.ownerState;return[e.root,r.stickyHeader&&e.stickyHeader]}})((function(t){var e=t.theme,r=t.ownerState;return d({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":d({},e.typography.body2,{padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},r.stickyHeader&&{borderCollapse:"separate"})})),En="table",An=n.forwardRef((function(t,e){var r=Ur({props:t,name:"MuiTable"}),i=r.className,o=r.component,a=void 0===o?En:o,s=r.padding,u=void 0===s?"normal":s,c=r.size,f=void 0===c?"medium":c,l=r.stickyHeader,h=void 0!==l&&l,m=p(r,kn),y=d({},r,{component:a,padding:u,size:f,stickyHeader:h}),b=function(t){var e=t.classes;return v({root:["root",t.stickyHeader&&"stickyHeader"]},Mn,e)}(y),w=n.useMemo((function(){return{padding:u,size:f,stickyHeader:h}}),[u,f,h]);return(0,dn.jsx)(Sn.Provider,{value:w,children:(0,dn.jsx)(xn,d({as:a,role:a===En?null:"table",ref:e,className:g(b.root,i),ownerState:y},m))})})),On=An;var Tn=n.createContext();function Pn(t){return fn("MuiTableHead",t)}ln("MuiTableHead",["root"]);var In=["className","component"],Rn=an("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:function(t,e){return e.root}})({display:"table-header-group"}),Cn={variant:"head"},Nn="thead",Bn=n.forwardRef((function(t,e){var r=Ur({props:t,name:"MuiTableHead"}),n=r.className,i=r.component,o=void 0===i?Nn:i,a=p(r,In),s=d({},r,{component:o}),u=function(t){return v({root:["root"]},Pn,t.classes)}(s);return(0,dn.jsx)(Tn.Provider,{value:Cn,children:(0,dn.jsx)(Rn,d({as:o,className:g(u.root,n),ref:e,role:o===Nn?null:"rowgroup",ownerState:s},a))})}));function jn(t){return fn("MuiTableRow",t)}var Ln=ln("MuiTableRow",["root","selected","hover","head","footer"]),Dn=["className","component","hover","selected"],Un=an("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:function(t,e){var r=t.ownerState;return[e.root,r.head&&e.head,r.footer&&e.footer]}})((function(t){var e,r=t.theme;return b(e={color:"inherit",display:"table-row",verticalAlign:"middle",outline:0},"&.".concat(Ln.hover,":hover"),{backgroundColor:(r.vars||r).palette.action.hover}),b(e,"&.".concat(Ln.selected),{backgroundColor:r.vars?"rgba(".concat(r.vars.palette.primary.mainChannel," / ").concat(r.vars.palette.action.selectedOpacity,")"):or(r.palette.primary.main,r.palette.action.selectedOpacity),"&:hover":{backgroundColor:r.vars?"rgba(".concat(r.vars.palette.primary.mainChannel," / calc(").concat(r.vars.palette.action.selectedOpacity," + ").concat(r.vars.palette.action.hoverOpacity,"))"):or(r.palette.primary.main,r.palette.action.selectedOpacity+r.palette.action.hoverOpacity)}}),e})),Fn=n.forwardRef((function(t,e){var r=Ur({props:t,name:"MuiTableRow"}),i=r.className,o=r.component,a=void 0===o?"tr":o,s=r.hover,u=void 0!==s&&s,c=r.selected,f=void 0!==c&&c,l=p(r,Dn),h=n.useContext(Tn),m=d({},r,{component:a,hover:u,selected:f,head:h&&"head"===h.variant,footer:h&&"footer"===h.variant}),y=function(t){var e=t.classes;return v({root:["root",t.selected&&"selected",t.hover&&"hover",t.head&&"head",t.footer&&"footer"]},jn,e)}(m);return(0,dn.jsx)(Un,d({as:a,ref:e,className:g(y.root,i),role:"tr"===a?null:"row",ownerState:m},l))})),Hn=Fn,zn=j;function Kn(t){return fn("MuiTableCell",t)}var qn=ln("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),Vn=["align","className","component","padding","scope","size","sortDirection","variant"],Gn=an("td",{name:"MuiTableCell",slot:"Root",overridesResolver:function(t,e){var r=t.ownerState;return[e.root,e[r.variant],e["size".concat(zn(r.size))],"normal"!==r.padding&&e["padding".concat(zn(r.padding))],"inherit"!==r.align&&e["align".concat(zn(r.align))],r.stickyHeader&&e.stickyHeader]}})((function(t){var e=t.theme,r=t.ownerState;return d({},e.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?"1px solid ".concat(e.vars.palette.TableCell.border):"1px solid\n ".concat("light"===e.palette.mode?sr(or(e.palette.divider,1),.88):ar(or(e.palette.divider,1),.68)),textAlign:"left",padding:16},"head"===r.variant&&{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium},"body"===r.variant&&{color:(e.vars||e).palette.text.primary},"footer"===r.variant&&{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)},"small"===r.size&&b({padding:"6px 16px"},"&.".concat(qn.paddingCheckbox),{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}),"checkbox"===r.padding&&{width:48,padding:"0 0 0 4px"},"none"===r.padding&&{padding:0},"left"===r.align&&{textAlign:"left"},"center"===r.align&&{textAlign:"center"},"right"===r.align&&{textAlign:"right",flexDirection:"row-reverse"},"justify"===r.align&&{textAlign:"justify"},r.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default})})),Wn=n.forwardRef((function(t,e){var r,i=Ur({props:t,name:"MuiTableCell"}),o=i.align,a=void 0===o?"inherit":o,s=i.className,u=i.component,c=i.padding,f=i.scope,l=i.size,h=i.sortDirection,m=i.variant,y=p(i,Vn),b=n.useContext(Sn),w=n.useContext(Tn),_=w&&"head"===w.variant,S=f;"td"===(r=u||(_?"th":"td"))?S=void 0:!S&&_&&(S="col");var M=m||w&&w.variant,k=d({},i,{align:a,component:r,padding:c||(b&&b.padding?b.padding:"normal"),size:l||(b&&b.size?b.size:"medium"),sortDirection:h,stickyHeader:"head"===M&&b&&b.stickyHeader,variant:M}),x=function(t){var e=t.classes,r=t.variant,n=t.align,i=t.padding,o=t.size;return v({root:["root",r,t.stickyHeader&&"stickyHeader","inherit"!==n&&"align".concat(zn(n)),"normal"!==i&&"padding".concat(zn(i)),"size".concat(zn(o))]},Kn,e)}(k),E=null;return h&&(E="asc"===h?"ascending":"descending"),(0,dn.jsx)(Gn,d({as:r,ref:e,className:g(x.root,s),"aria-sort":E,scope:S,ownerState:k},y))})),Yn=Wn;function $n(t){return fn("MuiTableBody",t)}ln("MuiTableBody",["root"]);var Zn=["className","component"],Xn=an("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:function(t,e){return e.root}})({display:"table-row-group"}),Jn={variant:"body"},Qn="tbody",ti=n.forwardRef((function(t,e){var r=Ur({props:t,name:"MuiTableBody"}),n=r.className,i=r.component,o=void 0===i?Qn:i,a=p(r,Zn),s=d({},r,{component:o}),u=function(t){return v({root:["root"]},$n,t.classes)}(s);return(0,dn.jsx)(Tn.Provider,{value:Jn,children:(0,dn.jsx)(Xn,d({className:g(u.root,n),as:o,ref:e,role:o===Qn?null:"rowgroup",ownerState:s},a))})})),ei=["sx"],ri=function(t){var e,r,n={systemProps:{},otherProps:{}},i=null!=(e=null==t||null==(r=t.theme)?void 0:r.unstable_sxConfig)?e:Et;return Object.keys(t).forEach((function(e){i[e]?n.systemProps[e]=t[e]:n.otherProps[e]=t[e]})),n};function ni(t){var e,r=t.sx,n=p(t,ei),i=ri(n),o=i.systemProps,a=i.otherProps;return e=Array.isArray(r)?[o].concat(Fr(r)):"function"===typeof r?function(){var t=r.apply(void 0,arguments);return M(t)?d({},o,t):o}:d({},o,r),d({},a,{sx:e})}var ii=["className","component"];var oi=jr(),ai=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.themeId,r=t.defaultTheme,i=t.defaultClassName,o=void 0===i?"MuiBox-root":i,a=t.generateClassName,s=$r("div",{shouldForwardProp:function(t){return"theme"!==t&&"sx"!==t&&"as"!==t}})(Ot);return n.forwardRef((function(t,n){var i=Je(r),u=ni(t),c=u.className,f=u.component,l=void 0===f?"div":f,h=p(u,ii);return(0,dn.jsx)(s,d({as:l,ref:n,className:g(c,a?a(o):o),theme:e&&i[e]||i},h))}))}({themeId:Dr,defaultTheme:oi,defaultClassName:"MuiBox-root",generateClassName:un.generate}),si=ai;function ui(t){return fn("MuiTypography",t)}ln("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);var ci=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],fi=an("span",{name:"MuiTypography",slot:"Root",overridesResolver:function(t,e){var r=t.ownerState;return[e.root,r.variant&&e[r.variant],"inherit"!==r.align&&e["align".concat(zn(r.align))],r.noWrap&&e.noWrap,r.gutterBottom&&e.gutterBottom,r.paragraph&&e.paragraph]}})((function(t){var e=t.theme,r=t.ownerState;return d({margin:0},r.variant&&e.typography[r.variant],"inherit"!==r.align&&{textAlign:r.align},r.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},r.gutterBottom&&{marginBottom:"0.35em"},r.paragraph&&{marginBottom:16})})),li={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},hi={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},di=n.forwardRef((function(t,e){var r=Ur({props:t,name:"MuiTypography"}),n=function(t){return hi[t]||t}(r.color),i=ni(d({},r,{color:n})),o=i.align,a=void 0===o?"inherit":o,s=i.className,u=i.component,c=i.gutterBottom,f=void 0!==c&&c,l=i.noWrap,h=void 0!==l&&l,m=i.paragraph,y=void 0!==m&&m,b=i.variant,w=void 0===b?"body1":b,_=i.variantMapping,S=void 0===_?li:_,M=p(i,ci),k=d({},i,{align:a,color:n,className:s,component:u,gutterBottom:f,noWrap:h,paragraph:y,variant:w,variantMapping:S}),x=u||(y?"p":S[w]||li[w])||"span",E=function(t){var e=t.align,r=t.gutterBottom,n=t.noWrap,i=t.paragraph,o=t.variant,a=t.classes;return v({root:["root",o,"inherit"!==t.align&&"align".concat(zn(e)),r&&"gutterBottom",n&&"noWrap",i&&"paragraph"]},ui,a)}(k);return(0,dn.jsx)(fi,d({as:x,ref:e,ownerState:k,className:g(E.root,s)},M))})),pi=di;function mi(){for(var t=arguments.length,e=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=e.pulsate,i=void 0!==n&&n,a=e.center,s=void 0===a?o||e.pulsate:a,u=e.fakeElement,c=void 0!==u&&u;if("mousedown"===(null==t?void 0:t.type)&&b.current)b.current=!1;else{"touchstart"===(null==t?void 0:t.type)&&(b.current=!0);var f,l,h,d=c?null:S.current,p=d?d.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||void 0===t||0===t.clientX&&0===t.clientY||!t.clientX&&!t.touches)f=Math.round(p.width/2),l=Math.round(p.height/2);else{var m=t.touches&&t.touches.length>0?t.touches[0]:t,g=m.clientX,v=m.clientY;f=Math.round(g-p.left),l=Math.round(v-p.top)}if(s)(h=Math.sqrt((2*Math.pow(p.width,2)+Math.pow(p.height,2))/3))%2===0&&(h+=1);else{var y=2*Math.max(Math.abs((d?d.clientWidth:0)-f),f)+2,k=2*Math.max(Math.abs((d?d.clientHeight:0)-l),l)+2;h=Math.sqrt(Math.pow(y,2)+Math.pow(k,2))}null!=t&&t.touches?null===_.current&&(_.current=function(){M({pulsate:i,rippleX:f,rippleY:l,rippleSize:h,cb:r})},w.current=setTimeout((function(){_.current&&(_.current(),_.current=null)}),80)):M({pulsate:i,rippleX:f,rippleY:l,rippleSize:h,cb:r})}}),[o,M]),x=n.useCallback((function(){k({},{pulsate:!0})}),[k]),E=n.useCallback((function(t,e){if(clearTimeout(w.current),"touchend"===(null==t?void 0:t.type)&&_.current)return _.current(),_.current=null,void(w.current=setTimeout((function(){E(t,e)})));_.current=null,m((function(t){return t.length>0?t.slice(1):t})),y.current=e}),[]);return n.useImperativeHandle(e,(function(){return{pulsate:x,start:k,stop:E}}),[x,k,E]),(0,dn.jsx)(ro,d({className:g(Xi.root,s.root,u),ref:S},c,{children:(0,dn.jsx)(Ui,{component:null,exit:!0,children:l})}))})),oo=io;function ao(t){return fn("MuiButtonBase",t)}var so,uo=ln("MuiButtonBase",["root","disabled","focusVisible"]),co=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],fo=an("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:function(t,e){return e.root}})((b(so={display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"}},"&.".concat(uo.disabled),{pointerEvents:"none",cursor:"default"}),b(so,"@media print",{colorAdjust:"exact"}),so)),lo=n.forwardRef((function(t,e){var r=Ur({props:t,name:"MuiButtonBase"}),i=r.action,o=r.centerRipple,a=void 0!==o&&o,s=r.children,u=r.className,c=r.component,f=void 0===c?"button":c,l=r.disabled,m=void 0!==l&&l,y=r.disableRipple,b=void 0!==y&&y,w=r.disableTouchRipple,_=void 0!==w&&w,S=r.focusRipple,M=void 0!==S&&S,k=r.LinkComponent,x=void 0===k?"a":k,E=r.onBlur,A=r.onClick,O=r.onContextMenu,T=r.onDragLeave,P=r.onFocus,I=r.onFocusVisible,R=r.onKeyDown,C=r.onKeyUp,N=r.onMouseDown,B=r.onMouseLeave,j=r.onMouseUp,L=r.onTouchEnd,D=r.onTouchMove,U=r.onTouchStart,F=r.tabIndex,H=void 0===F?0:F,z=r.TouchRippleProps,K=r.touchRippleRef,q=r.type,V=p(r,co),G=n.useRef(null),W=n.useRef(null),Y=gi(W,K),$=Oi(),Z=$.isFocusVisibleRef,X=$.onFocus,J=$.onBlur,Q=$.ref,tt=h(n.useState(!1),2),et=tt[0],rt=tt[1];m&&et&&rt(!1),n.useImperativeHandle(i,(function(){return{focusVisible:function(){rt(!0),G.current.focus()}}}),[]);var nt=h(n.useState(!1),2),it=nt[0],ot=nt[1];n.useEffect((function(){ot(!0)}),[]);var at=it&&!b&&!m;function st(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_;return wi((function(n){return e&&e(n),!r&&W.current&&W.current[t](n),!0}))}n.useEffect((function(){et&&M&&!b&&it&&W.current.pulsate()}),[b,M,et,it]);var ut=st("start",N),ct=st("stop",O),ft=st("stop",T),lt=st("stop",j),ht=st("stop",(function(t){et&&t.preventDefault(),B&&B(t)})),dt=st("start",U),pt=st("stop",L),mt=st("stop",D),gt=st("stop",(function(t){J(t),!1===Z.current&&rt(!1),E&&E(t)}),!1),vt=wi((function(t){G.current||(G.current=t.currentTarget),X(t),!0===Z.current&&(rt(!0),I&&I(t)),P&&P(t)})),yt=function(){var t=G.current;return f&&"button"!==f&&!("A"===t.tagName&&t.href)},bt=n.useRef(!1),wt=wi((function(t){M&&!bt.current&&et&&W.current&&" "===t.key&&(bt.current=!0,W.current.stop(t,(function(){W.current.start(t)}))),t.target===t.currentTarget&&yt()&&" "===t.key&&t.preventDefault(),R&&R(t),t.target===t.currentTarget&&yt()&&"Enter"===t.key&&!m&&(t.preventDefault(),A&&A(t))})),_t=wi((function(t){M&&" "===t.key&&W.current&&et&&!t.defaultPrevented&&(bt.current=!1,W.current.stop(t,(function(){W.current.pulsate(t)}))),C&&C(t),A&&t.target===t.currentTarget&&yt()&&" "===t.key&&!t.defaultPrevented&&A(t)})),St=f;"button"===St&&(V.href||V.to)&&(St=x);var Mt={};"button"===St?(Mt.type=void 0===q?"button":q,Mt.disabled=m):(V.href||V.to||(Mt.role="button"),m&&(Mt["aria-disabled"]=m));var kt=gi(e,Q,G);var xt=d({},r,{centerRipple:a,component:f,disabled:m,disableRipple:b,disableTouchRipple:_,focusRipple:M,tabIndex:H,focusVisible:et}),Et=function(t){var e=t.disabled,r=t.focusVisible,n=t.focusVisibleClassName,i=v({root:["root",e&&"disabled",r&&"focusVisible"]},ao,t.classes);return r&&n&&(i.root+=" ".concat(n)),i}(xt);return(0,dn.jsxs)(fo,d({as:St,className:g(Et.root,u),ownerState:xt,onBlur:gt,onClick:A,onContextMenu:ct,onFocus:vt,onKeyDown:wt,onKeyUp:_t,onMouseDown:ut,onMouseLeave:ht,onMouseUp:lt,onDragLeave:ft,onTouchEnd:pt,onTouchMove:mt,onTouchStart:dt,ref:kt,tabIndex:m?-1:H,type:q},Mt,V,{children:[s,at?(0,dn.jsx)(oo,d({ref:Y,center:a},z)):null]}))})),ho=lo;function po(t){return fn("MuiButton",t)}var mo=ln("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]);var go=n.createContext({}),vo=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],yo=function(t){return d({},"small"===t.size&&{"& > *:nth-of-type(1)":{fontSize:18}},"medium"===t.size&&{"& > *:nth-of-type(1)":{fontSize:20}},"large"===t.size&&{"& > *:nth-of-type(1)":{fontSize:22}})},bo=an(ho,{shouldForwardProp:function(t){return on(t)||"classes"===t},name:"MuiButton",slot:"Root",overridesResolver:function(t,e){var r=t.ownerState;return[e.root,e[r.variant],e["".concat(r.variant).concat(zn(r.color))],e["size".concat(zn(r.size))],e["".concat(r.variant,"Size").concat(zn(r.size))],"inherit"===r.color&&e.colorInherit,r.disableElevation&&e.disableElevation,r.fullWidth&&e.fullWidth]}})((function(t){var e,r,n,i=t.theme,o=t.ownerState,a="light"===i.palette.mode?i.palette.grey[300]:i.palette.grey[800],s="light"===i.palette.mode?i.palette.grey.A100:i.palette.grey[700];return d({},i.typography.button,(b(e={minWidth:64,padding:"6px 16px",borderRadius:(i.vars||i).shape.borderRadius,transition:i.transitions.create(["background-color","box-shadow","border-color","color"],{duration:i.transitions.duration.short}),"&:hover":d({textDecoration:"none",backgroundColor:i.vars?"rgba(".concat(i.vars.palette.text.primaryChannel," / ").concat(i.vars.palette.action.hoverOpacity,")"):or(i.palette.text.primary,i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"text"===o.variant&&"inherit"!==o.color&&{backgroundColor:i.vars?"rgba(".concat(i.vars.palette[o.color].mainChannel," / ").concat(i.vars.palette.action.hoverOpacity,")"):or(i.palette[o.color].main,i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"outlined"===o.variant&&"inherit"!==o.color&&{border:"1px solid ".concat((i.vars||i).palette[o.color].main),backgroundColor:i.vars?"rgba(".concat(i.vars.palette[o.color].mainChannel," / ").concat(i.vars.palette.action.hoverOpacity,")"):or(i.palette[o.color].main,i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"contained"===o.variant&&{backgroundColor:i.vars?i.vars.palette.Button.inheritContainedHoverBg:s,boxShadow:(i.vars||i).shadows[4],"@media (hover: none)":{boxShadow:(i.vars||i).shadows[2],backgroundColor:(i.vars||i).palette.grey[300]}},"contained"===o.variant&&"inherit"!==o.color&&{backgroundColor:(i.vars||i).palette[o.color].dark,"@media (hover: none)":{backgroundColor:(i.vars||i).palette[o.color].main}}),"&:active":d({},"contained"===o.variant&&{boxShadow:(i.vars||i).shadows[8]})},"&.".concat(mo.focusVisible),d({},"contained"===o.variant&&{boxShadow:(i.vars||i).shadows[6]})),b(e,"&.".concat(mo.disabled),d({color:(i.vars||i).palette.action.disabled},"outlined"===o.variant&&{border:"1px solid ".concat((i.vars||i).palette.action.disabledBackground)},"contained"===o.variant&&{color:(i.vars||i).palette.action.disabled,boxShadow:(i.vars||i).shadows[0],backgroundColor:(i.vars||i).palette.action.disabledBackground})),e),"text"===o.variant&&{padding:"6px 8px"},"text"===o.variant&&"inherit"!==o.color&&{color:(i.vars||i).palette[o.color].main},"outlined"===o.variant&&{padding:"5px 15px",border:"1px solid currentColor"},"outlined"===o.variant&&"inherit"!==o.color&&{color:(i.vars||i).palette[o.color].main,border:i.vars?"1px solid rgba(".concat(i.vars.palette[o.color].mainChannel," / 0.5)"):"1px solid ".concat(or(i.palette[o.color].main,.5))},"contained"===o.variant&&{color:i.vars?i.vars.palette.text.primary:null==(r=(n=i.palette).getContrastText)?void 0:r.call(n,i.palette.grey[300]),backgroundColor:i.vars?i.vars.palette.Button.inheritContainedBg:a,boxShadow:(i.vars||i).shadows[2]},"contained"===o.variant&&"inherit"!==o.color&&{color:(i.vars||i).palette[o.color].contrastText,backgroundColor:(i.vars||i).palette[o.color].main},"inherit"===o.color&&{color:"inherit",borderColor:"currentColor"},"small"===o.size&&"text"===o.variant&&{padding:"4px 5px",fontSize:i.typography.pxToRem(13)},"large"===o.size&&"text"===o.variant&&{padding:"8px 11px",fontSize:i.typography.pxToRem(15)},"small"===o.size&&"outlined"===o.variant&&{padding:"3px 9px",fontSize:i.typography.pxToRem(13)},"large"===o.size&&"outlined"===o.variant&&{padding:"7px 21px",fontSize:i.typography.pxToRem(15)},"small"===o.size&&"contained"===o.variant&&{padding:"4px 10px",fontSize:i.typography.pxToRem(13)},"large"===o.size&&"contained"===o.variant&&{padding:"8px 22px",fontSize:i.typography.pxToRem(15)},o.fullWidth&&{width:"100%"})}),(function(t){var e;return t.ownerState.disableElevation&&(b(e={boxShadow:"none","&:hover":{boxShadow:"none"}},"&.".concat(mo.focusVisible),{boxShadow:"none"}),b(e,"&:active",{boxShadow:"none"}),b(e,"&.".concat(mo.disabled),{boxShadow:"none"}),e)})),wo=an("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:function(t,e){var r=t.ownerState;return[e.startIcon,e["iconSize".concat(zn(r.size))]]}})((function(t){var e=t.ownerState;return d({display:"inherit",marginRight:8,marginLeft:-4},"small"===e.size&&{marginLeft:-2},yo(e))})),_o=an("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:function(t,e){var r=t.ownerState;return[e.endIcon,e["iconSize".concat(zn(r.size))]]}})((function(t){var e=t.ownerState;return d({display:"inherit",marginRight:-4,marginLeft:8},"small"===e.size&&{marginRight:-2},yo(e))})),So=n.forwardRef((function(t,e){var r=n.useContext(go),i=Ur({props:S(r,t),name:"MuiButton"}),o=i.children,a=i.color,s=void 0===a?"primary":a,u=i.component,c=void 0===u?"button":u,f=i.className,l=i.disabled,h=void 0!==l&&l,m=i.disableElevation,y=void 0!==m&&m,b=i.disableFocusRipple,w=void 0!==b&&b,_=i.endIcon,M=i.focusVisibleClassName,k=i.fullWidth,x=void 0!==k&&k,E=i.size,A=void 0===E?"medium":E,O=i.startIcon,T=i.type,P=i.variant,I=void 0===P?"text":P,R=p(i,vo),C=d({},i,{color:s,component:c,disabled:h,disableElevation:y,disableFocusRipple:w,fullWidth:x,size:A,type:T,variant:I}),N=function(t){var e=t.color,r=t.disableElevation,n=t.fullWidth,i=t.size,o=t.variant,a=t.classes;return d({},a,v({root:["root",o,"".concat(o).concat(zn(e)),"size".concat(zn(i)),"".concat(o,"Size").concat(zn(i)),"inherit"===e&&"colorInherit",r&&"disableElevation",n&&"fullWidth"],label:["label"],startIcon:["startIcon","iconSize".concat(zn(i))],endIcon:["endIcon","iconSize".concat(zn(i))]},po,a))}(C),B=O&&(0,dn.jsx)(wo,{className:N.startIcon,ownerState:C,children:O}),j=_&&(0,dn.jsx)(_o,{className:N.endIcon,ownerState:C,children:_});return(0,dn.jsxs)(bo,d({ownerState:C,className:g(r.className,N.root,f),component:c,disabled:h,focusRipple:!w,focusVisibleClassName:g(N.focusVisible,M),ref:e,type:T},R,{classes:N,children:[B,o,j]}))})),Mo=So;function ko(t){return fn("MuiDivider",t)}ln("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);var xo=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],Eo=an("div",{name:"MuiDivider",slot:"Root",overridesResolver:function(t,e){var r=t.ownerState;return[e.root,r.absolute&&e.absolute,e[r.variant],r.light&&e.light,"vertical"===r.orientation&&e.vertical,r.flexItem&&e.flexItem,r.children&&e.withChildren,r.children&&"vertical"===r.orientation&&e.withChildrenVertical,"right"===r.textAlign&&"vertical"!==r.orientation&&e.textAlignRight,"left"===r.textAlign&&"vertical"!==r.orientation&&e.textAlignLeft]}})((function(t){var e=t.theme,r=t.ownerState;return d({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin"},r.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},r.light&&{borderColor:e.vars?"rgba(".concat(e.vars.palette.dividerChannel," / 0.08)"):or(e.palette.divider,.08)},"inset"===r.variant&&{marginLeft:72},"middle"===r.variant&&"horizontal"===r.orientation&&{marginLeft:e.spacing(2),marginRight:e.spacing(2)},"middle"===r.variant&&"vertical"===r.orientation&&{marginTop:e.spacing(1),marginBottom:e.spacing(1)},"vertical"===r.orientation&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},r.flexItem&&{alignSelf:"stretch",height:"auto"})}),(function(t){return d({},t.ownerState.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}})}),(function(t){var e=t.theme,r=t.ownerState;return d({},r.children&&"vertical"!==r.orientation&&{"&::before, &::after":{width:"100%",borderTop:"thin solid ".concat((e.vars||e).palette.divider)}})}),(function(t){var e=t.theme,r=t.ownerState;return d({},r.children&&"vertical"===r.orientation&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:"thin solid ".concat((e.vars||e).palette.divider)}})}),(function(t){var e=t.ownerState;return d({},"right"===e.textAlign&&"vertical"!==e.orientation&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},"left"===e.textAlign&&"vertical"!==e.orientation&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})})),Ao=an("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:function(t,e){var r=t.ownerState;return[e.wrapper,"vertical"===r.orientation&&e.wrapperVertical]}})((function(t){var e=t.theme,r=t.ownerState;return d({display:"inline-block",paddingLeft:"calc(".concat(e.spacing(1)," * 1.2)"),paddingRight:"calc(".concat(e.spacing(1)," * 1.2)")},"vertical"===r.orientation&&{paddingTop:"calc(".concat(e.spacing(1)," * 1.2)"),paddingBottom:"calc(".concat(e.spacing(1)," * 1.2)")})})),Oo=n.forwardRef((function(t,e){var r=Ur({props:t,name:"MuiDivider"}),n=r.absolute,i=void 0!==n&&n,o=r.children,a=r.className,s=r.component,u=void 0===s?o?"div":"hr":s,c=r.flexItem,f=void 0!==c&&c,l=r.light,h=void 0!==l&&l,m=r.orientation,y=void 0===m?"horizontal":m,b=r.role,w=void 0===b?"hr"!==u?"separator":void 0:b,_=r.textAlign,S=void 0===_?"center":_,M=r.variant,k=void 0===M?"fullWidth":M,x=p(r,xo),E=d({},r,{absolute:i,component:u,flexItem:f,light:h,orientation:y,role:w,textAlign:S,variant:k}),A=function(t){var e=t.absolute,r=t.children,n=t.classes,i=t.flexItem,o=t.light,a=t.orientation,s=t.textAlign;return v({root:["root",e&&"absolute",t.variant,o&&"light","vertical"===a&&"vertical",i&&"flexItem",r&&"withChildren",r&&"vertical"===a&&"withChildrenVertical","right"===s&&"vertical"!==a&&"textAlignRight","left"===s&&"vertical"!==a&&"textAlignLeft"],wrapper:["wrapper","vertical"===a&&"wrapperVertical"]},ko,n)}(E);return(0,dn.jsx)(Eo,d({as:u,className:g(A.root,a),role:w,ref:e,ownerState:E},x,{children:o?(0,dn.jsx)(Ao,{className:A.wrapper,ownerState:E,children:o}):null}))})),To=Oo;function Po(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(void 0===t)return{};var r={};return Object.keys(t).filter((function(r){return r.match(/^on[A-Z]/)&&"function"===typeof t[r]&&!e.includes(r)})).forEach((function(e){r[e]=t[e]})),r}function Io(t){if(void 0===t)return{};var e={};return Object.keys(t).filter((function(e){return!(e.match(/^on[A-Z]/)&&"function"===typeof t[e])})).forEach((function(r){e[r]=t[r]})),e}var Ro=["elementType","externalSlotProps","ownerState"];function Co(t){var e,r=t.elementType,n=t.externalSlotProps,i=t.ownerState,o=p(t,Ro),a=function(t,e){return"function"===typeof t?t(e):t}(n,i),s=function(t){var e=t.getSlotProps,r=t.additionalProps,n=t.externalSlotProps,i=t.externalForwardedProps,o=t.className;if(!e){var a=g(null==i?void 0:i.className,null==n?void 0:n.className,o,null==r?void 0:r.className),s=d({},null==r?void 0:r.style,null==i?void 0:i.style,null==n?void 0:n.style),u=d({},r,i,n);return a.length>0&&(u.className=a),Object.keys(s).length>0&&(u.style=s),{props:u,internalRef:void 0}}var c=Po(d({},i,n)),f=Io(n),l=Io(i),h=e(c),p=g(null==h?void 0:h.className,null==r?void 0:r.className,o,null==i?void 0:i.className,null==n?void 0:n.className),m=d({},null==h?void 0:h.style,null==r?void 0:r.style,null==i?void 0:i.style,null==n?void 0:n.style),v=d({},h,r,l,f);return p.length>0&&(v.className=p),Object.keys(m).length>0&&(v.style=m),{props:v,internalRef:h.ref}}(d({},o,{externalSlotProps:a})),u=function(t,e,r){return void 0===t||"string"===typeof t?e:d({},e,{ownerState:d({},e.ownerState,r)})}(r,d({},s.props,{ref:mi(s.internalRef,null==a?void 0:a.ref,null==(e=t.additionalProps)?void 0:e.ref)}),i);return u}function No(t){return t&&t.ownerDocument||document}function Bo(t){return t.substring(2).toLowerCase()}var jo=function(t){var e=t.children,r=t.disableReactTree,i=void 0!==r&&r,o=t.mouseEvent,a=void 0===o?"onClick":o,s=t.onClickAway,u=t.touchEvent,c=void 0===u?"onTouchEnd":u,f=n.useRef(!1),l=n.useRef(null),h=n.useRef(!1),d=n.useRef(!1);n.useEffect((function(){return setTimeout((function(){h.current=!0}),0),function(){h.current=!1}}),[]);var p=mi(e.ref,l),m=yi((function(t){var e=d.current;d.current=!1;var r=No(l.current);!h.current||!l.current||"clientX"in t&&function(t,e){return e.documentElement.clientWidth-1:!r.documentElement.contains(t.target)||l.current.contains(t.target))||!i&&e||s(t))})),g=function(t){return function(r){d.current=!0;var n=e.props[t];n&&n(r)}},v={ref:p};return!1!==c&&(v[c]=g(c)),n.useEffect((function(){if(!1!==c){var t=Bo(c),e=No(l.current),r=function(){f.current=!0};return e.addEventListener(t,m),e.addEventListener("touchmove",r),function(){e.removeEventListener(t,m),e.removeEventListener("touchmove",r)}}}),[m,c]),!1!==a&&(v[a]=g(a)),n.useEffect((function(){if(!1!==a){var t=Bo(a),e=No(l.current);return e.addEventListener(t,m),function(){e.removeEventListener(t,m)}}}),[m,a]),(0,dn.jsx)(n.Fragment,{children:n.cloneElement(e,v)})};function Lo(){var t=Je(Lr);return t[Dr]||t}var Do=r(54164),Uo=!1,Fo="unmounted",Ho="exited",zo="entering",Ko="entered",qo="exiting",Vo=function(t){function e(e,r){var n;n=t.call(this,e,r)||this;var i,o=r&&!r.isMounting?e.enter:e.appear;return n.appearStatus=null,e.in?o?(i=Ho,n.appearStatus=zo):i=Ko:i=e.unmountOnExit||e.mountOnEnter?Fo:Ho,n.state={status:i},n.nextCallback=null,n}Ri(e,t),e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===Fo?{status:Ho}:null};var r=e.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(t){var e=null;if(t!==this.props){var r=this.state.status;this.props.in?r!==zo&&r!==Ko&&(e=zo):r!==zo&&r!==Ko||(e=qo)}this.updateStatus(!1,e)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var t,e,r,n=this.props.timeout;return t=e=r=n,null!=n&&"number"!==typeof n&&(t=n.exit,e=n.enter,r=void 0!==n.appear?n.appear:e),{exit:t,enter:e,appear:r}},r.updateStatus=function(t,e){if(void 0===t&&(t=!1),null!==e)if(this.cancelNextCallback(),e===zo){if(this.props.unmountOnExit||this.props.mountOnEnter){var r=this.props.nodeRef?this.props.nodeRef.current:Do.findDOMNode(this);r&&function(t){t.scrollTop}(r)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ho&&this.setState({status:Fo})},r.performEnter=function(t){var e=this,r=this.props.enter,n=this.context?this.context.isMounting:t,i=this.props.nodeRef?[n]:[Do.findDOMNode(this),n],o=i[0],a=i[1],s=this.getTimeouts(),u=n?s.appear:s.enter;!t&&!r||Uo?this.safeSetState({status:Ko},(function(){e.props.onEntered(o)})):(this.props.onEnter(o,a),this.safeSetState({status:zo},(function(){e.props.onEntering(o,a),e.onTransitionEnd(u,(function(){e.safeSetState({status:Ko},(function(){e.props.onEntered(o,a)}))}))})))},r.performExit=function(){var t=this,e=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:Do.findDOMNode(this);e&&!Uo?(this.props.onExit(n),this.safeSetState({status:qo},(function(){t.props.onExiting(n),t.onTransitionEnd(r.exit,(function(){t.safeSetState({status:Ho},(function(){t.props.onExited(n)}))}))}))):this.safeSetState({status:Ho},(function(){t.props.onExited(n)}))},r.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(t,e){e=this.setNextCallback(e),this.setState(t,e)},r.setNextCallback=function(t){var e=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,e.nextCallback=null,t(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},r.onTransitionEnd=function(t,e){this.setNextCallback(e);var r=this.props.nodeRef?this.props.nodeRef.current:Do.findDOMNode(this),n=null==t&&!this.props.addEndListener;if(r&&!n){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],o=i[0],a=i[1];this.props.addEndListener(o,a)}null!=t&&setTimeout(this.nextCallback,t)}else setTimeout(this.nextCallback,0)},r.render=function(){var t=this.state.status;if(t===Fo)return null;var e=this.props,r=e.children,i=(e.in,e.mountOnEnter,e.unmountOnExit,e.appear,e.enter,e.exit,e.timeout,e.addEndListener,e.onEnter,e.onEntering,e.onEntered,e.onExit,e.onExiting,e.onExited,e.nodeRef,p(e,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return n.createElement(Ci.Provider,{value:null},"function"===typeof r?r(t,i):n.cloneElement(n.Children.only(r),i))},e}(n.Component);function Go(){}Vo.contextType=Ci,Vo.propTypes={},Vo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Go,onEntering:Go,onEntered:Go,onExit:Go,onExiting:Go,onExited:Go},Vo.UNMOUNTED=Fo,Vo.EXITED=Ho,Vo.ENTERING=zo,Vo.ENTERED=Ko,Vo.EXITING=qo;var Wo=Vo;function Yo(t,e){var r,n,i=t.timeout,o=t.easing,a=t.style,s=void 0===a?{}:a;return{duration:null!=(r=s.transitionDuration)?r:"number"===typeof i?i:i[e.mode]||0,easing:null!=(n=s.transitionTimingFunction)?n:"object"===typeof o?o[e.mode]:o,delay:s.transitionDelay}}var $o=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function Zo(t){return"scale(".concat(t,", ").concat(Math.pow(t,2),")")}var Xo={entering:{opacity:1,transform:Zo(1)},entered:{opacity:1,transform:"none"}},Jo="undefined"!==typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Qo=n.forwardRef((function(t,e){var r=t.addEndListener,i=t.appear,o=void 0===i||i,a=t.children,s=t.easing,u=t.in,c=t.onEnter,f=t.onEntered,l=t.onEntering,h=t.onExit,m=t.onExited,g=t.onExiting,v=t.style,y=t.timeout,b=void 0===y?"auto":y,w=t.TransitionComponent,_=void 0===w?Wo:w,S=p(t,$o),M=n.useRef(),k=n.useRef(),x=Lo(),E=n.useRef(null),A=gi(E,a.ref,e),O=function(t){return function(e){if(t){var r=E.current;void 0===e?t(r):t(r,e)}}},T=O(l),P=O((function(t,e){!function(t){t.scrollTop}(t);var r,n=Yo({style:v,timeout:b,easing:s},{mode:"enter"}),i=n.duration,o=n.delay,a=n.easing;"auto"===b?(r=x.transitions.getAutoHeightDuration(t.clientHeight),k.current=r):r=i,t.style.transition=[x.transitions.create("opacity",{duration:r,delay:o}),x.transitions.create("transform",{duration:Jo?r:.666*r,delay:o,easing:a})].join(","),c&&c(t,e)})),I=O(f),R=O(g),C=O((function(t){var e,r=Yo({style:v,timeout:b,easing:s},{mode:"exit"}),n=r.duration,i=r.delay,o=r.easing;"auto"===b?(e=x.transitions.getAutoHeightDuration(t.clientHeight),k.current=e):e=n,t.style.transition=[x.transitions.create("opacity",{duration:e,delay:i}),x.transitions.create("transform",{duration:Jo?e:.666*e,delay:Jo?i:i||.333*e,easing:o})].join(","),t.style.opacity=0,t.style.transform=Zo(.75),h&&h(t)})),N=O(m);return n.useEffect((function(){return function(){clearTimeout(M.current)}}),[]),(0,dn.jsx)(_,d({appear:o,in:u,nodeRef:E,onEnter:P,onEntered:I,onEntering:T,onExit:C,onExited:N,onExiting:R,addEndListener:function(t){"auto"===b&&(M.current=setTimeout(t,k.current||0)),r&&r(E.current,t)},timeout:"auto"===b?null:b},S,{children:function(t,e){return n.cloneElement(a,d({style:d({opacity:0,transform:Zo(.75),visibility:"exited"!==t||u?void 0:"hidden"},Xo[t],v,a.props.style),ref:A},e))}}))}));Qo.muiSupportAuto=!0;var ta=Qo;function ea(t){return fn("MuiSnackbarContent",t)}ln("MuiSnackbarContent",["root","message","action"]);var ra=["action","className","message","role"],na=an(_n,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:function(t,e){return e.root}})((function(t){var e=t.theme,r="light"===e.palette.mode?.8:.98,n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return ir(t)>.5?ar(t,e):sr(t,e)}(e.palette.background.default,r);return d({},e.typography.body2,b({color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(n),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,flexGrow:1},e.breakpoints.up("sm"),{flexGrow:"initial",minWidth:288}))})),ia=an("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:function(t,e){return e.message}})({padding:"8px 0"}),oa=an("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:function(t,e){return e.action}})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),aa=n.forwardRef((function(t,e){var r=Ur({props:t,name:"MuiSnackbarContent"}),n=r.action,i=r.className,o=r.message,a=r.role,s=void 0===a?"alert":a,u=p(r,ra),c=r,f=function(t){return v({root:["root"],action:["action"],message:["message"]},ea,t.classes)}(c);return(0,dn.jsxs)(na,d({role:s,square:!0,elevation:6,className:g(f.root,i),ownerState:c,ref:e},u,{children:[(0,dn.jsx)(ia,{className:f.message,ownerState:c,children:o}),n?(0,dn.jsx)(oa,{className:f.action,ownerState:c,children:n}):null]}))}));function sa(t){return fn("MuiSnackbar",t)}ln("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);var ua=["onEnter","onExited"],ca=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],fa=an("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:function(t,e){var r=t.ownerState;return[e.root,e["anchorOrigin".concat(zn(r.anchorOrigin.vertical)).concat(zn(r.anchorOrigin.horizontal))]]}})((function(t){var e=t.theme,r=t.ownerState;return d({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},"top"===r.anchorOrigin.vertical?{top:8}:{bottom:8},"left"===r.anchorOrigin.horizontal&&{justifyContent:"flex-start"},"right"===r.anchorOrigin.horizontal&&{justifyContent:"flex-end"},b({},e.breakpoints.up("sm"),d({},"top"===r.anchorOrigin.vertical?{top:24}:{bottom:24},"center"===r.anchorOrigin.horizontal&&{left:"50%",right:"auto",transform:"translateX(-50%)"},"left"===r.anchorOrigin.horizontal&&{left:24,right:"auto"},"right"===r.anchorOrigin.horizontal&&{right:24,left:"auto"})))})),la=n.forwardRef((function(t,e){var r=Ur({props:t,name:"MuiSnackbar"}),i=Lo(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},a=r.action,s=r.anchorOrigin,u=void 0===s?{vertical:"bottom",horizontal:"left"}:s,c=u.vertical,f=u.horizontal,l=r.autoHideDuration,m=void 0===l?null:l,g=r.children,y=r.className,b=r.ClickAwayListenerProps,w=r.ContentProps,_=r.disableWindowBlurListener,S=void 0!==_&&_,M=r.message,k=r.open,x=r.TransitionComponent,E=void 0===x?ta:x,A=r.transitionDuration,O=void 0===A?o:A,T=r.TransitionProps,P=void 0===T?{}:T,I=P.onEnter,R=P.onExited,C=p(r.TransitionProps,ua),N=p(r,ca),B=d({},r,{anchorOrigin:{vertical:c,horizontal:f},autoHideDuration:m,disableWindowBlurListener:S,TransitionComponent:E,transitionDuration:O}),j=function(t){var e=t.classes,r=t.anchorOrigin;return v({root:["root","anchorOrigin".concat(zn(r.vertical)).concat(zn(r.horizontal))]},sa,e)}(B),L=function(t){var e=t.autoHideDuration,r=void 0===e?null:e,i=t.disableWindowBlurListener,o=void 0!==i&&i,a=t.onClose,s=t.open,u=t.resumeHideDuration,c=n.useRef();n.useEffect((function(){if(s)return document.addEventListener("keydown",t),function(){document.removeEventListener("keydown",t)};function t(t){t.defaultPrevented||"Escape"!==t.key&&"Esc"!==t.key||null==a||a(t,"escapeKeyDown")}}),[s,a]);var f=yi((function(t,e){null==a||a(t,e)})),l=yi((function(t){a&&null!=t&&(clearTimeout(c.current),c.current=setTimeout((function(){f(null,"timeout")}),t))}));n.useEffect((function(){return s&&l(r),function(){clearTimeout(c.current)}}),[s,r,l]);var h=function(){clearTimeout(c.current)},p=n.useCallback((function(){null!=r&&l(null!=u?u:.5*r)}),[r,u,l]),m=function(t){return function(e){var r=t.onBlur;null==r||r(e),p()}},g=function(t){return function(e){var r=t.onFocus;null==r||r(e),h()}},v=function(t){return function(e){var r=t.onMouseEnter;null==r||r(e),h()}},y=function(t){return function(e){var r=t.onMouseLeave;null==r||r(e),p()}};return n.useEffect((function(){if(!o&&s)return window.addEventListener("focus",p),window.addEventListener("blur",h),function(){window.removeEventListener("focus",p),window.removeEventListener("blur",h)}}),[o,p,s]),{getRootProps:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=d({},Po(t),e);return d({role:"presentation"},r,{onBlur:m(r),onFocus:g(r),onMouseEnter:v(r),onMouseLeave:y(r)})},onClickAway:function(t){null==a||a(t,"clickaway")}}}(d({},B)),D=L.getRootProps,U=L.onClickAway,F=h(n.useState(!0),2),H=F[0],z=F[1],K=Co({elementType:fa,getSlotProps:D,externalForwardedProps:N,ownerState:B,additionalProps:{ref:e},className:[j.root,y]});return!k&&H?null:(0,dn.jsx)(jo,d({onClickAway:U},b,{children:(0,dn.jsx)(fa,d({},K,{children:(0,dn.jsx)(E,d({appear:!0,in:k,timeout:O,direction:"top"===c?"down":"up",onEnter:function(t,e){z(!1),I&&I(t,e)},onExited:function(t){z(!0),R&&R(t)}},C,{children:g||(0,dn.jsx)(aa,d({message:M,action:a},w))}))}))}))})),ha=la;function da(t){return fn("MuiAlert",t)}var pa=ln("MuiAlert",["root","action","icon","message","filled","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function ma(t){return fn("MuiIconButton",t)}var ga=ln("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),va=["edge","children","className","color","disabled","disableFocusRipple","size"],ya=an(ho,{name:"MuiIconButton",slot:"Root",overridesResolver:function(t,e){var r=t.ownerState;return[e.root,"default"!==r.color&&e["color".concat(zn(r.color))],r.edge&&e["edge".concat(zn(r.edge))],e["size".concat(zn(r.size))]]}})((function(t){var e=t.theme,r=t.ownerState;return d({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!r.disableRipple&&{"&:hover":{backgroundColor:e.vars?"rgba(".concat(e.vars.palette.action.activeChannel," / ").concat(e.vars.palette.action.hoverOpacity,")"):or(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===r.edge&&{marginLeft:"small"===r.size?-3:-12},"end"===r.edge&&{marginRight:"small"===r.size?-3:-12})}),(function(t){var e,r=t.theme,n=t.ownerState,i=null==(e=(r.vars||r).palette)?void 0:e[n.color];return d({},"inherit"===n.color&&{color:"inherit"},"inherit"!==n.color&&"default"!==n.color&&d({color:null==i?void 0:i.main},!n.disableRipple&&{"&:hover":d({},i&&{backgroundColor:r.vars?"rgba(".concat(i.mainChannel," / ").concat(r.vars.palette.action.hoverOpacity,")"):or(i.main,r.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===n.size&&{padding:5,fontSize:r.typography.pxToRem(18)},"large"===n.size&&{padding:12,fontSize:r.typography.pxToRem(28)},b({},"&.".concat(ga.disabled),{backgroundColor:"transparent",color:(r.vars||r).palette.action.disabled}))})),ba=n.forwardRef((function(t,e){var r=Ur({props:t,name:"MuiIconButton"}),n=r.edge,i=void 0!==n&&n,o=r.children,a=r.className,s=r.color,u=void 0===s?"default":s,c=r.disabled,f=void 0!==c&&c,l=r.disableFocusRipple,h=void 0!==l&&l,m=r.size,y=void 0===m?"medium":m,b=p(r,va),w=d({},r,{edge:i,color:u,disabled:f,disableFocusRipple:h,size:y}),_=function(t){var e=t.classes,r=t.disabled,n=t.color,i=t.edge,o=t.size;return v({root:["root",r&&"disabled","default"!==n&&"color".concat(zn(n)),i&&"edge".concat(zn(i)),"size".concat(zn(o))]},ma,e)}(w);return(0,dn.jsx)(ya,d({className:g(_.root,a),centerRipple:!0,focusRipple:!h,disabled:f,ref:e,ownerState:w},b,{children:o}))})),wa=ba;function _a(t){return fn("MuiSvgIcon",t)}ln("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var Sa=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Ma=an("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:function(t,e){var r=t.ownerState;return[e.root,"inherit"!==r.color&&e["color".concat(zn(r.color))],e["fontSize".concat(zn(r.fontSize))]]}})((function(t){var e,r,n,i,o,a,s,u,c,f,l,h,d,p,m,g,v,y=t.theme,b=t.ownerState;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,transition:null==(e=y.transitions)||null==(r=e.create)?void 0:r.call(e,"fill",{duration:null==(n=y.transitions)||null==(i=n.duration)?void 0:i.shorter}),fontSize:{inherit:"inherit",small:(null==(o=y.typography)||null==(a=o.pxToRem)?void 0:a.call(o,20))||"1.25rem",medium:(null==(s=y.typography)||null==(u=s.pxToRem)?void 0:u.call(s,24))||"1.5rem",large:(null==(c=y.typography)||null==(f=c.pxToRem)?void 0:f.call(c,35))||"2.1875rem"}[b.fontSize],color:null!=(l=null==(h=(y.vars||y).palette)||null==(d=h[b.color])?void 0:d.main)?l:{action:null==(p=(y.vars||y).palette)||null==(m=p.action)?void 0:m.active,disabled:null==(g=(y.vars||y).palette)||null==(v=g.action)?void 0:v.disabled,inherit:void 0}[b.color]}})),ka=n.forwardRef((function(t,e){var r=Ur({props:t,name:"MuiSvgIcon"}),n=r.children,i=r.className,o=r.color,a=void 0===o?"inherit":o,s=r.component,u=void 0===s?"svg":s,c=r.fontSize,f=void 0===c?"medium":c,l=r.htmlColor,h=r.inheritViewBox,m=void 0!==h&&h,y=r.titleAccess,b=r.viewBox,w=void 0===b?"0 0 24 24":b,_=p(r,Sa),S=d({},r,{color:a,component:u,fontSize:f,instanceFontSize:t.fontSize,inheritViewBox:m,viewBox:w}),M={};m||(M.viewBox=w);var k=function(t){var e=t.color,r=t.fontSize,n=t.classes;return v({root:["root","inherit"!==e&&"color".concat(zn(e)),"fontSize".concat(zn(r))]},_a,n)}(S);return(0,dn.jsxs)(Ma,d({as:u,className:g(k.root,i),focusable:"false",color:l,"aria-hidden":!y||void 0,role:y?"img":void 0,ref:e},M,_,{ownerState:S,children:[n,y?(0,dn.jsx)("title",{children:y}):null]}))}));ka.muiName="SvgIcon";var xa=ka;function Ea(t,e){function r(r,n){return(0,dn.jsx)(xa,d({"data-testid":"".concat(e,"Icon"),ref:n},r,{children:t}))}return r.muiName=xa.muiName,n.memo(n.forwardRef(r))}var Aa=Ea((0,dn.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),Oa=Ea((0,dn.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),Ta=Ea((0,dn.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),Pa=Ea((0,dn.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Ia=Ea((0,dn.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Ra=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],Ca=an(_n,{name:"MuiAlert",slot:"Root",overridesResolver:function(t,e){var r=t.ownerState;return[e.root,e[r.variant],e["".concat(r.variant).concat(zn(r.color||r.severity))]]}})((function(t){var e=t.theme,r=t.ownerState,n="light"===e.palette.mode?ar:sr,i="light"===e.palette.mode?sr:ar,o=r.color||r.severity;return d({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},o&&"standard"===r.variant&&b({color:e.vars?e.vars.palette.Alert["".concat(o,"Color")]:n(e.palette[o].light,.6),backgroundColor:e.vars?e.vars.palette.Alert["".concat(o,"StandardBg")]:i(e.palette[o].light,.9)},"& .".concat(pa.icon),e.vars?{color:e.vars.palette.Alert["".concat(o,"IconColor")]}:{color:e.palette[o].main}),o&&"outlined"===r.variant&&b({color:e.vars?e.vars.palette.Alert["".concat(o,"Color")]:n(e.palette[o].light,.6),border:"1px solid ".concat((e.vars||e).palette[o].light)},"& .".concat(pa.icon),e.vars?{color:e.vars.palette.Alert["".concat(o,"IconColor")]}:{color:e.palette[o].main}),o&&"filled"===r.variant&&d({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert["".concat(o,"FilledColor")],backgroundColor:e.vars.palette.Alert["".concat(o,"FilledBg")]}:{backgroundColor:"dark"===e.palette.mode?e.palette[o].dark:e.palette[o].main,color:e.palette.getContrastText(e.palette[o].main)}))})),Na=an("div",{name:"MuiAlert",slot:"Icon",overridesResolver:function(t,e){return e.icon}})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Ba=an("div",{name:"MuiAlert",slot:"Message",overridesResolver:function(t,e){return e.message}})({padding:"8px 0",minWidth:0,overflow:"auto"}),ja=an("div",{name:"MuiAlert",slot:"Action",overridesResolver:function(t,e){return e.action}})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),La={success:(0,dn.jsx)(Aa,{fontSize:"inherit"}),warning:(0,dn.jsx)(Oa,{fontSize:"inherit"}),error:(0,dn.jsx)(Ta,{fontSize:"inherit"}),info:(0,dn.jsx)(Pa,{fontSize:"inherit"})},Da=n.forwardRef((function(t,e){var r,n,i,o,a,s,u=Ur({props:t,name:"MuiAlert"}),c=u.action,f=u.children,l=u.className,h=u.closeText,m=void 0===h?"Close":h,y=u.color,b=u.components,w=void 0===b?{}:b,_=u.componentsProps,S=void 0===_?{}:_,M=u.icon,k=u.iconMapping,x=void 0===k?La:k,E=u.onClose,A=u.role,O=void 0===A?"alert":A,T=u.severity,P=void 0===T?"success":T,I=u.slotProps,R=void 0===I?{}:I,C=u.slots,N=void 0===C?{}:C,B=u.variant,j=void 0===B?"standard":B,L=p(u,Ra),D=d({},u,{color:y,severity:P,variant:j}),U=function(t){var e=t.variant,r=t.color,n=t.severity,i=t.classes;return v({root:["root","".concat(e).concat(zn(r||n)),"".concat(e)],icon:["icon"],message:["message"],action:["action"]},da,i)}(D),F=null!=(r=null!=(n=N.closeButton)?n:w.CloseButton)?r:wa,H=null!=(i=null!=(o=N.closeIcon)?o:w.CloseIcon)?i:Ia,z=null!=(a=R.closeButton)?a:S.closeButton,K=null!=(s=R.closeIcon)?s:S.closeIcon;return(0,dn.jsxs)(Ca,d({role:O,elevation:0,ownerState:D,className:g(U.root,l),ref:e},L,{children:[!1!==M?(0,dn.jsx)(Na,{ownerState:D,className:U.icon,children:M||x[P]||La[P]}):null,(0,dn.jsx)(Ba,{ownerState:D,className:U.message,children:f}),null!=c?(0,dn.jsx)(ja,{ownerState:D,className:U.action,children:c}):null,null==c&&E?(0,dn.jsx)(ja,{ownerState:D,className:U.action,children:(0,dn.jsx)(F,d({size:"small","aria-label":m,title:m,color:"inherit",onClick:E},z,{children:(0,dn.jsx)(H,d({fontSize:"small"},K))}))}):null]}))})),Ua=Da;function Fa(t){return fn("MuiLink",t)}var Ha,za,Ka,qa,Va,Ga=ln("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),Wa={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Ya=function(t){var e=t.theme,r=t.ownerState,n=function(t){return Wa[t]||t}(r.color),i=L(e,"palette.".concat(n),!1)||r.color,o=L(e,"palette.".concat(n,"Channel"));return"vars"in e&&o?"rgba(".concat(o," / 0.4)"):or(i,.4)},$a=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],Za=an(pi,{name:"MuiLink",slot:"Root",overridesResolver:function(t,e){var r=t.ownerState;return[e.root,e["underline".concat(zn(r.underline))],"button"===r.component&&e.button]}})((function(t){var e=t.theme,r=t.ownerState;return d({},"none"===r.underline&&{textDecoration:"none"},"hover"===r.underline&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},"always"===r.underline&&d({textDecoration:"underline"},"inherit"!==r.color&&{textDecorationColor:Ya({theme:e,ownerState:r})},{"&:hover":{textDecorationColor:"inherit"}}),"button"===r.component&&b({position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"}},"&.".concat(Ga.focusVisible),{outline:"auto"}))})),Xa=n.forwardRef((function(t,e){var r=Ur({props:t,name:"MuiLink"}),i=r.className,o=r.color,a=void 0===o?"primary":o,s=r.component,u=void 0===s?"a":s,c=r.onBlur,f=r.onFocus,l=r.TypographyClasses,m=r.underline,y=void 0===m?"always":m,b=r.variant,w=void 0===b?"inherit":b,_=r.sx,S=p(r,$a),M=Oi(),k=M.isFocusVisibleRef,x=M.onBlur,E=M.onFocus,A=M.ref,O=h(n.useState(!1),2),T=O[0],P=O[1],I=gi(e,A),R=d({},r,{color:a,component:u,focusVisible:T,underline:y,variant:w}),C=function(t){var e=t.classes,r=t.component,n=t.focusVisible,i=t.underline;return v({root:["root","underline".concat(zn(i)),"button"===r&&"button",n&&"focusVisible"]},Fa,e)}(R);return(0,dn.jsx)(Za,d({color:a,className:g(C.root,i),classes:l,component:u,onBlur:function(t){x(t),!1===k.current&&P(!1),c&&c(t)},onFocus:function(t){E(t),!0===k.current&&P(!0),f&&f(t)},ref:I,ownerState:R,variant:w,sx:[].concat(Fr(Object.keys(Wa).includes(a)?[]:[{color:a}]),Fr(Array.isArray(_)?_:[_]))},S))})),Ja=Xa,Qa=r(49933);function ts(t,e){for(var r=0;r0n&&(e+=this.buildChangeOutput()),(0,Qa.assert)(this.ctx.hashOutputs===(0,Qa.hash256)(e),"hashOutputs mismatch")}},{key:"increaseVotesReceived",value:function(t){for(var e=0;e<2;e++)this.candidates[e].name===t&&this.candidates[e].votesReceived++}}])&&ts(e.prototype,r),n&&ts(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(Qa.SmartContract),Va=ns(qa.prototype,"candidates",[Ha],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ns(qa.prototype,"vote",[za],Object.getOwnPropertyDescriptor(qa.prototype,"vote"),qa.prototype),ns(qa.prototype,"increaseVotesReceived",[Ka],Object.getOwnPropertyDescriptor(qa.prototype,"increaseVotesReceived"),qa.prototype),qa),os=nn(),as=["className","component","disableGutters","fixed","maxWidth","classes"],ss=Pt(),us=os("div",{name:"MuiContainer",slot:"Root",overridesResolver:function(t,e){var r=t.ownerState;return[e.root,e["maxWidth".concat(j(String(r.maxWidth)))],r.fixed&&e.fixed,r.disableGutters&&e.disableGutters]}}),cs=function(t){return Qe({props:t,name:"MuiContainer",defaultTheme:ss})};var fs=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.createStyledComponent,r=void 0===e?us:e,i=t.useThemeProps,o=void 0===i?cs:i,a=t.componentName,s=void 0===a?"MuiContainer":a,u=r((function(t){var e=t.theme;return d({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!t.ownerState.disableGutters&&b({paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},e.breakpoints.up("sm"),{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}))}),(function(t){var e=t.theme;return t.ownerState.fixed&&Object.keys(e.breakpoints.values).reduce((function(t,r){var n=r,i=e.breakpoints.values[n];return 0!==i&&(t[e.breakpoints.up(n)]={maxWidth:"".concat(i).concat(e.breakpoints.unit)}),t}),{})}),(function(t){var e=t.theme,r=t.ownerState;return d({},"xs"===r.maxWidth&&b({},e.breakpoints.up("xs"),{maxWidth:Math.max(e.breakpoints.values.xs,444)}),r.maxWidth&&"xs"!==r.maxWidth&&b({},e.breakpoints.up(r.maxWidth),{maxWidth:"".concat(e.breakpoints.values[r.maxWidth]).concat(e.breakpoints.unit)}))})),c=n.forwardRef((function(t,e){var r=o(t),n=r.className,i=r.component,a=void 0===i?"div":i,c=r.disableGutters,f=void 0!==c&&c,l=r.fixed,h=void 0!==l&&l,m=r.maxWidth,y=void 0===m?"lg":m,b=p(r,as),w=d({},r,{component:a,disableGutters:f,fixed:h,maxWidth:y}),_=function(t,e){var r=t.classes,n=t.fixed,i=t.disableGutters,o=t.maxWidth;return v({root:["root",o&&"maxWidth".concat(j(String(o))),n&&"fixed",i&&"disableGutters"]},(function(t){return fn(e,t)}),r)}(w,s);return(0,dn.jsx)(u,d({as:a,ownerState:w,className:g(_.root,n),ref:e},b))}));return c}({createStyledComponent:an("div",{name:"MuiContainer",slot:"Root",overridesResolver:function(t,e){var r=t.ownerState;return[e.root,e["maxWidth".concat(zn(String(r.maxWidth)))],r.fixed&&e.fixed,r.disableGutters&&e.disableGutters]}}),useThemeProps:function(t){return Ur({props:t,name:"MuiContainer"})}}),ls=fs;var hs=n.createContext();function ds(t){return fn("MuiGrid",t)}var ps=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],ms=ln("MuiGrid",["root","container","item","zeroMinWidth"].concat(Fr([0,1,2,3,4,5,6,7,8,9,10].map((function(t){return"spacing-xs-".concat(t)}))),Fr(["column-reverse","column","row-reverse","row"].map((function(t){return"direction-xs-".concat(t)}))),Fr(["nowrap","wrap-reverse","wrap"].map((function(t){return"wrap-xs-".concat(t)}))),Fr(ps.map((function(t){return"grid-xs-".concat(t)}))),Fr(ps.map((function(t){return"grid-sm-".concat(t)}))),Fr(ps.map((function(t){return"grid-md-".concat(t)}))),Fr(ps.map((function(t){return"grid-lg-".concat(t)}))),Fr(ps.map((function(t){return"grid-xl-".concat(t)}))))),gs=ms,vs=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function ys(t){var e=parseFloat(t);return"".concat(e).concat(String(t).replace(String(e),"")||"px")}function bs(t){var e=t.breakpoints,r=t.values,n="";Object.keys(r).forEach((function(t){""===n&&0!==r[t]&&(n=t)}));var i=Object.keys(e).sort((function(t,r){return e[t]-e[r]}));return i.slice(0,i.indexOf(n))}var ws=an("div",{name:"MuiGrid",slot:"Root",overridesResolver:function(t,e){var r=t.ownerState,n=r.container,i=r.direction,o=r.item,a=r.spacing,s=r.wrap,u=r.zeroMinWidth,c=r.breakpoints,f=[];n&&(f=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t||t<=0)return[];if("string"===typeof t&&!Number.isNaN(Number(t))||"number"===typeof t)return[r["spacing-xs-".concat(String(t))]];var n=[];return e.forEach((function(e){var i=t[e];Number(i)>0&&n.push(r["spacing-".concat(e,"-").concat(String(i))])})),n}(a,c,e));var l=[];return c.forEach((function(t){var n=r[t];n&&l.push(e["grid-".concat(t,"-").concat(String(n))])})),[e.root,n&&e.container,o&&e.item,u&&e.zeroMinWidth].concat(Fr(f),["row"!==i&&e["direction-xs-".concat(String(i))],"wrap"!==s&&e["wrap-xs-".concat(String(s))]],l)}})((function(t){var e=t.ownerState;return d({boxSizing:"border-box"},e.container&&{display:"flex",flexWrap:"wrap",width:"100%"},e.item&&{margin:0},e.zeroMinWidth&&{minWidth:0},"wrap"!==e.wrap&&{flexWrap:e.wrap})}),(function(t){var e=t.theme;return I({theme:e},N({values:t.ownerState.direction,breakpoints:e.breakpoints.values}),(function(t){var e={flexDirection:t};return 0===t.indexOf("column")&&(e["& > .".concat(gs.item)]={maxWidth:"none"}),e}))}),(function(t){var e=t.theme,r=t.ownerState,n=r.container,i=r.rowSpacing,o={};if(n&&0!==i){var a,s=N({values:i,breakpoints:e.breakpoints.values});"object"===typeof s&&(a=bs({breakpoints:e.breakpoints.values,values:s})),o=I({theme:e},s,(function(t,r){var n,i=e.spacing(t);return"0px"!==i?b({marginTop:"-".concat(ys(i))},"& > .".concat(gs.item),{paddingTop:ys(i)}):null!=(n=a)&&n.includes(r)?{}:b({marginTop:0},"& > .".concat(gs.item),{paddingTop:0})}))}return o}),(function(t){var e=t.theme,r=t.ownerState,n=r.container,i=r.columnSpacing,o={};if(n&&0!==i){var a,s=N({values:i,breakpoints:e.breakpoints.values});"object"===typeof s&&(a=bs({breakpoints:e.breakpoints.values,values:s})),o=I({theme:e},s,(function(t,r){var n,i=e.spacing(t);return"0px"!==i?b({width:"calc(100% + ".concat(ys(i),")"),marginLeft:"-".concat(ys(i))},"& > .".concat(gs.item),{paddingLeft:ys(i)}):null!=(n=a)&&n.includes(r)?{}:b({width:"100%",marginLeft:0},"& > .".concat(gs.item),{paddingLeft:0})}))}return o}),(function(t){var e,r=t.theme,n=t.ownerState;return r.breakpoints.keys.reduce((function(t,i){var o={};if(n[i]&&(e=n[i]),!e)return t;if(!0===e)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if("auto"===e)o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{var a=N({values:n.columns,breakpoints:r.breakpoints.values}),s="object"===typeof a?a[i]:a;if(void 0===s||null===s)return t;var u="".concat(Math.round(e/s*1e8)/1e6,"%"),c={};if(n.container&&n.item&&0!==n.columnSpacing){var f=r.spacing(n.columnSpacing);if("0px"!==f){var l="calc(".concat(u," + ").concat(ys(f),")");c={flexBasis:l,maxWidth:l}}}o=d({flexBasis:u,flexGrow:0,maxWidth:u},c)}return 0===r.breakpoints.values[i]?Object.assign(t,o):t[r.breakpoints.up(i)]=o,t}),{})}));var _s=function(t){var e=t.classes,r=t.container,n=t.direction,i=t.item,o=t.spacing,a=t.wrap,s=t.zeroMinWidth,u=t.breakpoints,c=[];r&&(c=function(t,e){if(!t||t<=0)return[];if("string"===typeof t&&!Number.isNaN(Number(t))||"number"===typeof t)return["spacing-xs-".concat(String(t))];var r=[];return e.forEach((function(e){var n=t[e];if(Number(n)>0){var i="spacing-".concat(e,"-").concat(String(n));r.push(i)}})),r}(o,u));var f=[];return u.forEach((function(e){var r=t[e];r&&f.push("grid-".concat(e,"-").concat(String(r)))})),v({root:["root",r&&"container",i&&"item",s&&"zeroMinWidth"].concat(Fr(c),["row"!==n&&"direction-xs-".concat(String(n)),"wrap"!==a&&"wrap-xs-".concat(String(a))],f)},ds,e)},Ss=n.forwardRef((function(t,e){var r=Ur({props:t,name:"MuiGrid"}),i=Lo().breakpoints,o=ni(r),a=o.className,s=o.columns,u=o.columnSpacing,c=o.component,f=void 0===c?"div":c,l=o.container,h=void 0!==l&&l,m=o.direction,v=void 0===m?"row":m,y=o.item,b=void 0!==y&&y,w=o.rowSpacing,_=o.spacing,S=void 0===_?0:_,M=o.wrap,k=void 0===M?"wrap":M,x=o.zeroMinWidth,E=void 0!==x&&x,A=p(o,vs),O=w||S,T=u||S,P=n.useContext(hs),I=h?s||12:P,R={},C=d({},A);i.keys.forEach((function(t){null!=A[t]&&(R[t]=A[t],delete C[t])}));var N=d({},o,{columns:I,container:h,direction:v,item:b,rowSpacing:O,columnSpacing:T,wrap:k,zeroMinWidth:E,spacing:S},R,{breakpoints:i.keys}),B=_s(N);return(0,dn.jsx)(hs.Provider,{value:I,children:(0,dn.jsx)(ws,d({ownerState:N,className:g(B.root,a),as:f,ref:e},C))})})),Ms=Ss,ks=function(){return(0,dn.jsx)(si,{sx:{width:"100%",height:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:(0,dn.jsx)(ls,{maxWidth:"lg",children:(0,dn.jsxs)(Ms,{container:!0,direction:"column",alignItems:"center",children:[(0,dn.jsx)(Ms,{item:!0,xs:12,children:(0,dn.jsx)(pi,{color:"black",variant:"h5",children:"sCrypt, Inc."})}),(0,dn.jsx)(Ms,{item:!0,xs:12,children:(0,dn.jsx)(Ja,{href:"https://github.com/sCrypt-Inc/voting",target:"_blank",variant:"subtitle1",children:"Github Repo"})})]})})})},xs=r(19778).Buffer,Es={txId:"107ef6132f3c06305baa0202d1d73c670368ff209338e820f60864f3cc8344e8",outputIndex:0};var As=function(){var t=h((0,n.useState)(),2),e=t[0],r=t[1],i=(0,n.useRef)(),o=h(n.useState(""),2),a=o[0],u=o[1],f=h(n.useState({txId:"",candidate:""}),2),l=f[0],d=f[1];function p(){return m.apply(this,arguments)}function m(){return(m=c(s().mark((function t(){var e;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Qa.Scrypt.contractApi.getLatestInstance(is,Es);case 3:e=t.sent,r(e),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(0),console.error("fetchContract error: ",t.t0),u(t.t0.message);case 11:case"end":return t.stop()}}),t,null,[[0,7]])})))).apply(this,arguments)}(0,n.useEffect)((function(){var t=new Qa.ScryptProvider,e=new Qa.SensiletSigner(t);i.current=e,p();var n=Qa.Scrypt.contractApi.subscribe({clazz:is,id:Es},(function(t){d({txId:t.tx.id,candidate:t.args[0]}),r(t.nexts[0])}));return function(){n.unsubscribe()}}),[]);var g,v=function(t,e){"clickaway"!==e&&d({txId:"",candidate:""})};function y(t){return b.apply(this,arguments)}function b(){return(b=c(s().mark((function t(r){var n,o,a,c,f,l;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(v(r),n=i.current,!e||!n){t.next=16;break}return t.next=5,n.requestAuth();case 5:if(o=t.sent,a=o.isAuthenticated,c=o.error,a){t.next=10;break}throw new Error(c);case 10:return t.next=12,e.connect(n);case 12:f=e.next(),l=r.target.name,f.increaseVotesReceived(l),e.methods.vote(l,{next:{instance:f,balance:e.balance}}).then((function(t){console.log("Voting call tx: ".concat(t.tx.id))})).catch((function(t){u(t.message),p(),console.error("call error: ",t)}));case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return(0,dn.jsxs)("div",{className:"App",children:[(0,dn.jsx)("header",{className:"App-header",children:(0,dn.jsx)("h2",{children:"What's your favorite phone?"})}),(0,dn.jsx)(gn,{component:_n,variant:"outlined",style:{width:1200,height:"80vh",margin:"auto"},children:(0,dn.jsxs)(On,{children:[(0,dn.jsx)(Bn,{children:(0,dn.jsxs)(Hn,{children:[(0,dn.jsx)(Yn,{align:"center",children:"iPhone"}),(0,dn.jsx)(Yn,{align:"center",children:"Android"})]})}),(0,dn.jsxs)(ti,{children:[(0,dn.jsxs)(Hn,{children:[(0,dn.jsx)(Yn,{align:"center",children:(0,dn.jsx)(si,{children:(0,dn.jsx)(si,{sx:{height:200},component:"img",alt:"iphone",src:"".concat("/voting","/","iphone",".png")})})}),(0,dn.jsx)(Yn,{align:"center",children:(0,dn.jsx)(si,{children:(0,dn.jsx)(si,{sx:{height:200},component:"img",alt:"android",src:"".concat("/voting","/","android",".png")})})})]}),(0,dn.jsxs)(Hn,{children:[(0,dn.jsx)(Yn,{align:"center",children:(0,dn.jsxs)(si,{children:[(0,dn.jsx)(pi,{variant:"h1",children:null===e||void 0===e?void 0:e.candidates[0].votesReceived.toString()}),(0,dn.jsx)(Mo,{variant:"text",onClick:y,name:null===e||void 0===e?void 0:e.candidates[0].name,children:"\ud83d\udc4d"})]})}),(0,dn.jsxs)(Yn,{align:"center",children:[(0,dn.jsx)(To,{orientation:"vertical",flexItem:!0}),(0,dn.jsxs)(si,{children:[(0,dn.jsx)(pi,{variant:"h1",children:null===e||void 0===e?void 0:e.candidates[1].votesReceived.toString()}),(0,dn.jsx)(Mo,{variant:"text",onClick:y,name:null===e||void 0===e?void 0:e.candidates[1].name,children:"\ud83d\udc4d"})]})]})]})]})]})}),(0,dn.jsx)(ks,{}),(0,dn.jsx)(ha,{open:""!==a,autoHideDuration:6e3,onClose:function(t,e){"clickaway"!==e&&u("")},children:(0,dn.jsx)(Ua,{severity:"error",children:a})}),(0,dn.jsx)(ha,{open:""!==l.candidate&&""!==l.txId,autoHideDuration:6e3,onClose:v,children:(0,dn.jsxs)(Ua,{severity:"success",children:[" ",(0,dn.jsx)(Ja,{href:"https://test.whatsonchain.com/tx/".concat(l.txId),target:"_blank",rel:"noreferrer",children:'"'.concat((g=l.candidate,xs.from(g,"hex").toString("utf8")),'" got one vote, tx: ').concat(l.txId)})]})})]})},Os=function(t){t&&t instanceof Function&&r.e(787).then(r.bind(r,787)).then((function(e){var r=e.getCLS,n=e.getFID,i=e.getFCP,o=e.getLCP,a=e.getTTFB;r(t),n(t),i(t),o(t),a(t)}))},Ts=JSON.parse('{"version":9,"compilerVersion":"1.19.0+commit.72eaeba","contract":"Voting","md5":"6c5beea576bcec5ca25ac590d9209ece","structs":[{"name":"Candidate","params":[{"name":"name","type":"bytes"},{"name":"votesReceived","type":"int"}],"genericTypes":[]}],"library":[],"alias":[],"abi":[{"type":"function","name":"vote","index":0,"params":[{"name":"name","type":"bytes"},{"name":"__scrypt_ts_txPreimage","type":"SigHashPreimage"},{"name":"__scrypt_ts_changeAmount","type":"int"},{"name":"__scrypt_ts_changeAddress","type":"Ripemd160"}]},{"type":"constructor","params":[{"name":"names","type":"bytes[2]"}]}],"stateProps":[{"name":"candidates","type":"Candidate[2]"}],"buildType":"debug","file":"file:///Users/aaron67/WebstormProjects/voting/artifacts/voting.scrypt","hex":"0176018801a901ac2097dfd76851bf465e8f715593b217714858bbe9570ff3bd5e33840a34e20ff0262102ba79df5f8ae7604a9830f03c7933028186aede0675a16f025dc4f8be8eec0382201008ce7480da41702918d1ec8e6849ba32b4d65b1e40dc669c31a1e6306b266c0000000000610000517951795a7a5a7a5a7a5a7a75757575567a567a567a6151007600a26976529f695195946b6c766b796c7500587a587a7575567a567a567a567a567a6151517600a26976529f695195946b6c766b796c7500567a567a7575547a547a547a7575615e7961007901687f776100005279517f75007f77007901fd87635379537f75517f7761007901007e81517a7561537a75527a527a5379535479937f75537f77527a75517a67007901fe87635379557f75517f7761007901007e81517a7561537a75527a527a5379555479937f75557f77527a75517a67007901ff87635379597f75517f7761007901007e81517a7561537a75527a527a5379595479937f75597f77527a75517a675379517f75007f7761007901007e81517a7561537a75527a527a5379515479937f75517f77527a75517a6868685179517a75517a75517a75517a7561517a7561007961007982775179517951947f755179549451947f77007981527951799454945194517a75517a75517a75517a7561517951797f75537a75527a527a0000537953797f77610079537a75527a527a00527a75517a7561615179517951937f7551797f775179768b537a75527a527a75010051798791517a75610079916361005379005179557951937f7555797f77815579768b577a75567a567a567a567a567a567a750079014c9f630079547a75537a537a537a527956795579937f7556797f77527a75517a670079014c9c635279567951937f7556797f7761007901007e81517a7561547a75537a537a537a55795193567a75557a557a557a557a557a557975527956795579937f7556797f77527a75517a670079014d9c635279567952937f7556797f7761007901007e81517a7561547a75537a537a537a55795293567a75557a557a557a557a557a557975527956795579937f7556797f77527a75517a670079014e9c635279567954937f7556797f7761007901007e81517a7561547a75537a537a537a55795493567a75557a557a557a557a557a557975527956795579937f7556797f77527a75517a670069686868685579547993567a75557a557a557a557a557a5579755179517a75517a75517a75517a75615a7a75597a597a597a597a597a597a597a597a597a6161005379005179557951937f7555797f77815579768b577a75567a567a567a567a567a567a750079014c9f630079547a75537a537a537a527956795579937f7556797f77527a75517a670079014c9c635279567951937f7556797f7761007901007e81517a7561547a75537a537a537a55795193567a75557a557a557a557a557a557975527956795579937f7556797f77527a75517a670079014d9c635279567952937f7556797f7761007901007e81517a7561547a75537a537a537a55795293567a75557a557a557a557a557a557975527956795579937f7556797f77527a75517a670079014e9c635279567954937f7556797f7761007901007e81517a7561547a75537a537a537a55795493567a75557a557a557a557a557a557975527956795579937f7556797f77527a75517a670069686868685579547993567a75557a557a557a557a557a5579755179517a75517a75517a75517a75618161597a75587a587a587a587a587a587a587a587a61005379005179557951937f7555797f77815579768b577a75567a567a567a567a567a567a750079014c9f630079547a75537a537a537a527956795579937f7556797f77527a75517a670079014c9c635279567951937f7556797f7761007901007e81517a7561547a75537a537a537a55795193567a75557a557a557a557a557a557975527956795579937f7556797f77527a75517a670079014d9c635279567952937f7556797f7761007901007e81517a7561547a75537a537a537a55795293567a75557a557a557a557a557a557975527956795579937f7556797f77527a75517a670079014e9c635279567954937f7556797f7761007901007e81517a7561547a75537a537a537a55795493567a75557a557a557a557a557a557975527956795579937f7556797f77527a75517a670069686868685579547993567a75557a557a557a557a557a5579755179517a75517a75517a75517a7561587a75577a577a577a577a577a577a577a6161005379005179557951937f7555797f77815579768b577a75567a567a567a567a567a567a750079014c9f630079547a75537a537a537a527956795579937f7556797f77527a75517a670079014c9c635279567951937f7556797f7761007901007e81517a7561547a75537a537a537a55795193567a75557a557a557a557a557a557975527956795579937f7556797f77527a75517a670079014d9c635279567952937f7556797f7761007901007e81517a7561547a75537a537a537a55795293567a75557a557a557a557a557a557975527956795579937f7556797f77527a75517a670079014e9c635279567954937f7556797f7761007901007e81517a7561547a75537a537a537a55795493567a75557a557a557a557a557a557975527956795579937f7556797f77527a75517a670069686868685579547993567a75557a557a557a557a557a5579755179517a75517a75517a75517a75618161577a75567a567a567a567a567a567a6801137901416151795f795f79210ac407f0e4bd44bfc207355a778b046225a7068fc59ee7eda43ad905aadbffc800206c266b30e6a1319c66dc401e5bd6b432ba49688eecd118297041da8074ce08100111795679615679aa0079610079517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e01007e81517a75615779567956795679567961537956795479577995939521414136d08c5ed2bf3ba048afe6dcaebafeffffffffffffffffffffffffffffff00517951796151795179970079009f63007952799367007968517a75517a75517a7561527a75517a517951795296a0630079527994527a75517a6853798277527982775379012080517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e01205279947f7754537993527993013051797e527e54797e58797e527e53797e52797e57797e0079517a75517a75517a75517a75517a75517a75517a75517a75517a75517a75517a75517a75517a756100795779ac517a75517a75517a75517a75517a75517a75517a75517a75517a7561517a75517a75616901147961615a795a795a795a7952007600a26976529f699452958c6b6c766b796c766b796c756b6b757575756c6c517a517a75517987635a795a795a795a7952007600a26976529f699452958c6b6c766b796c766b796c756b6b757575756c6c007a517a75768b5b7a755a7a5a7a5a7a5a7a5a7a5a7a5a7a5a7a5a7a5a7a7568615a795a795a795a7952517600a26976529f699452958c6b6c766b796c766b796c756b6b757575756c6c517a517a75517987635a795a795a795a7952517600a26976529f699452958c6b6c766b796c766b796c756b6b757575756c6c007a517a75768b597a75587a587a587a587a587a587a587a587a756851517a756175011379610079610079827751795179012c947f7551790134947f77517a75517a756161007901007e81517a7561517a7561616100610079635167010068517a75615b795b795b795b7952007600a26976529f699452958c6b6c766b796c766b796c756b6b757575756c6c517a517a756100798277005179014c9f63517951615179517951938000795179827751947f75007f77517a75517a75517a7561517a756751790200019f63014c527951615179517951938000795179827751947f75007f77517a75517a75517a75617e517a75675179030000019f63014d527952615179517951938000795179827751947f75007f77517a75517a75517a75617e517a756751790500000000019f63014e527954615179517951938000795179827751947f75007f77517a75517a75517a75617e517a7567006968686868007953797e517a75517a75517a75617e5b795b795b795b7952007600a26976529f699452958c6b6c766b796c766b796c756b6b757575756c6c007a517a75610079009c630100670079686100798277005179014c9f63517951615179517951938000795179827751947f75007f77517a75517a75517a7561517a756751790200019f63014c527951615179517951938000795179827751947f75007f77517a75517a75517a75617e517a75675179030000019f63014d527952615179517951938000795179827751947f75007f77517a75517a75517a75617e517a756751790500000000019f63014e527954615179517951938000795179827751947f75007f77517a75517a75517a75617e517a7567006968686868007953797e517a75517a75517a7561517a75617e5b795b795b795b7952517600a26976529f699452958c6b6c766b796c766b796c756b6b757575756c6c517a517a756100798277005179014c9f63517951615179517951938000795179827751947f75007f77517a75517a75517a7561517a756751790200019f63014c527951615179517951938000795179827751947f75007f77517a75517a75517a75617e517a75675179030000019f63014d527952615179517951938000795179827751947f75007f77517a75517a75517a75617e517a756751790500000000019f63014e527954615179517951938000795179827751947f75007f77517a75517a75517a75617e517a7567006968686868007953797e517a75517a75517a75617e5b795b795b795b7952517600a26976529f699452958c6b6c766b796c766b796c756b6b757575756c6c007a517a75610079009c630100670079686100798277005179014c9f63517951615179517951938000795179827751947f75007f77517a75517a75517a7561517a756751790200019f63014c527951615179517951938000795179827751947f75007f77517a75517a75517a75617e517a75675179030000019f63014d527952615179517951938000795179827751947f75007f77517a75517a75517a75617e517a756751790500000000019f63014e527954615179517951938000795179827751947f75007f77517a75517a75517a75617e517a7567006968686868007953797e517a75517a75517a7561517a75617e5779517961007982775480517951797e0051807e517a75517a75617e517a75610079527961007958805279610079827700517902fd009f63517951615179517951938000795179827751947f75007f77517a75517a75517a7561517a75675179030000019f6301fd527952615179517951938000795179827751947f75007f77517a75517a75517a75617e517a756751790500000000019f6301fe527954615179517951938000795179827751947f75007f77517a75517a75517a75617e517a75675179090000000000000000019f6301ff527958615179517951938000795179827751947f75007f77517a75517a75517a75617e517a7568686868007953797e517a75517a75517a75617e517a75517a7561517a75517a756101137900a063007901147900a063011379610113790112797e01147e51797e0113797e0111797e517a756101157961007958805279610079827700517902fd009f63517951615179517951938000795179827751947f75007f77517a75517a75517a7561517a75675179030000019f6301fd527952615179517951938000795179827751947f75007f77517a75517a75517a75617e517a756751790500000000019f6301fe527954615179517951938000795179827751947f75007f77517a75517a75517a75617e517a75675179090000000000000000019f6301ff527958615179517951938000795179827751947f75007f77517a75517a75517a75617e517a7568686868007953797e517a75517a75517a75617e517a75517a75616700687e517a750079756801147961007982775179517958947f7551790128947f77517a75517a75615179aa8777777777777777777777777777777777777777777777","sourceMapFile":""}');is.loadArtifact(Ts),Qa.Scrypt.init({apiKey:"testnet_3OJHoUTWnhTtVGck0T6ZpV2Cx3lcLw0UchOfl4aPtfA8D10Kf",network:Qa.bsv.Networks.testnet}),o.createRoot(document.getElementById("root")).render((0,dn.jsx)(n.StrictMode,{children:(0,dn.jsx)(As,{})})),Os()},6338:function(t){t.exports="0.5.7"},36218:function(t,e,r){t.exports={version:r(6338),stringifyInfo:r(96517),stringifyStream:r(18105),parseChunked:r(61419)}},61419:function(t,e,r){var n=r(56690).default,i=r(89728).default,o=r(17061).default,a=r(17156).default,s=r(18237).default,u=r(58443).isReadableStream,c=r(29926),f=new c;function l(t){return null!==t&&"object"===typeof t}function h(t,e){return"SyntaxError"===t.name&&e.jsonParseOffset&&(t.message=t.message.replace(/at position (\d+)/,(function(t,r){return"at position "+(Number(r)+e.jsonParseOffset)}))),t}t.exports=function(t){var e=new d;if(l(t)&&u(t))return new Promise((function(r,n){t.on("data",(function(t){try{e.push(t)}catch(r){n(h(r,e)),e=null}})).on("error",(function(t){e=null,n(t)})).on("end",(function(){try{r(e.finish())}catch(t){n(h(t,e))}finally{e=null}}))}));if("function"===typeof t){var r=t();if(l(r)&&(Symbol.iterator in r||Symbol.asyncIterator in r))return new Promise(function(){var t=a(o().mark((function t(n,i){var a,u,c,f,l,d;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,a=!1,u=!1,t.prev=3,f=s(r);case 5:return t.next=7,f.next();case 7:if(!(a=!(l=t.sent).done)){t.next=13;break}d=l.value,e.push(d);case 10:a=!1,t.next=5;break;case 13:t.next=19;break;case 15:t.prev=15,t.t0=t.catch(3),u=!0,c=t.t0;case 19:if(t.prev=19,t.prev=20,!a||null==f.return){t.next=24;break}return t.next=24,f.return();case 24:if(t.prev=24,!u){t.next=27;break}throw c;case 27:return t.finish(24);case 28:return t.finish(19);case 29:n(e.finish()),t.next=35;break;case 32:t.prev=32,t.t1=t.catch(0),i(h(t.t1,e));case 35:return t.prev=35,e=null,t.finish(35);case 38:case"end":return t.stop()}}),t,null,[[0,32,35,38],[3,15,19,29],[20,,24,28]])})));return function(e,r){return t.apply(this,arguments)}}())}throw new Error("Chunk emitter should be readable stream, generator, async generator or function returning an iterable object")};var d=function(){"use strict";function t(){n(this,t),this.value=void 0,this.valueStack=null,this.stack=new Array(100),this.lastFlushDepth=0,this.flushDepth=0,this.stateString=!1,this.stateStringEscape=!1,this.pendingByteSeq=null,this.pendingChunk=null,this.chunkOffset=0,this.jsonParseOffset=0}return i(t,[{key:"parseAndAppend",value:function(t,e){1===this.stack[this.lastFlushDepth-1]?(e&&(this.jsonParseOffset--,t="{"+t+"}"),Object.assign(this.valueStack.value,JSON.parse(t))):(e&&(this.jsonParseOffset--,t="["+t+"]"),function(t,e){var r=t.length;t.length+=e.length;for(var n=0;n0?this.parseAndAppend(this.prepareAddition(n),!0):(this.value=JSON.parse(n),this.valueStack={value:this.value,prev:null});else if(this.flushDepth>this.lastFlushDepth){for(var i=this.flushDepth-1;i>=this.lastFlushDepth;i--)n+=1===this.stack[i]?"}":"]";0===this.lastFlushDepth?(this.value=JSON.parse(n),this.valueStack={value:this.value,prev:null}):this.parseAndAppend(this.prepareAddition(n),!0);for(var o=this.lastFlushDepth||1;o=this.flushDepth;u--)this.jsonParseOffset--,n=(1===this.stack[u]?"{":"[")+n;this.parseAndAppend(n,!1);for(var c=this.lastFlushDepth-1;c>=this.flushDepth;c--)this.valueStack=this.valueStack.prev}this.lastFlushDepth=this.flushDepth}},{key:"push",value:function(t){if("string"!==typeof t){if(null!==this.pendingByteSeq){var e=t;(t=new Uint8Array(this.pendingByteSeq.length+e.length)).set(this.pendingByteSeq),t.set(e,this.pendingByteSeq.length),this.pendingByteSeq=null}if(t[t.length-1]>127)for(var r=0;r>6===3){(4!==++r&&n>>3===30||3!==r&&n>>4===14||2!==r&&n>>5===6)&&(this.pendingByteSeq=t.slice(t.length-r),t=t.slice(0,-r));break}}t=f.decode(t)}var i=t.length,o=0,a=0;t:for(var s=0;so&&this.flush(t,o,a),a1&&(E+=A-1),h.delete(a),r>0&&A>0&&(E+=(1+(h.size+1)*r+1)*A,E+=1+h.size*r),l.set(a,E-c);break;case g:if(l.has(a)){d.add(a),E+=l.get(a);break}var P=E;E+=2,h.add(a);for(var I=0;I1&&(E+=a.length-1),h.delete(a),r>0&&a.length>0&&(E+=(1+(h.size+1)*r)*a.length,E+=1+h.size*r),l.set(a,E-P);break;case v:case y:S.add(a);break;case b:E+=2,S.add(a)}}}(k,"",t),{minLength:isNaN(E)?1/0:E,circular:n(w),duplicate:n(d),async:n(S)}}},18105:function(t){t.exports=function(){throw new Error("Method is not supported")}},29926:function(t){t.exports=TextDecoder},58443:function(t,e,r){var n=r(861).default;function i(t){return"function"===typeof t.pipe&&"function"===typeof t._read&&"object"===typeof t._readableState&&null!==t._readableState}t.exports={escapableCharCodeSubstitution:{8:"\\b",9:"\\t",10:"\\n",12:"\\f",13:"\\r",34:'\\"',92:"\\\\"},isLeadingSurrogate:function(t){return t>=55296&&t<=56319},isTrailingSurrogate:function(t){return t>=56320&&t<=57343},type:{PRIMITIVE:1,PROMISE:4,ARRAY:3,OBJECT:2,STRING_STREAM:5,OBJECT_STREAM:6},isReadableStream:i,replaceValue:function(t,e,r,n){switch(r&&"function"===typeof r.toJSON&&(r=r.toJSON()),null!==n&&(r=n.call(t,String(e),r)),typeof r){case"function":case"symbol":r=void 0;break;case"object":if(null!==r){var i=r.constructor;i!==String&&i!==Number&&i!==Boolean||(r=r.valueOf())}}return r},getTypeNative:function(t){return null===t||"object"!==typeof t?1:Array.isArray(t)?3:2},getTypeAsync:function(t){return null===t||"object"!==typeof t?1:"function"===typeof t.then?4:i(t)?t._readableState.objectMode?6:5:Array.isArray(t)?3:2},normalizeReplacer:function(t){if("function"===typeof t)return t;if(Array.isArray(t)){var e=new Set(t.map((function(t){var e=t&&t.constructor;return e===String||e===Number?String(t):null})).filter((function(t){return"string"===typeof t})));return n(e)}return null},normalizeSpace:function(t){return"number"===typeof t?!(!Number.isFinite(t)||t<1)&&" ".repeat(Math.min(t,10)):"string"===typeof t&&t.slice(0,10)||!1}}},97829:function(t,e,r){var n=r(19778).Buffer;!function(t){"use strict";for(var e=",".charCodeAt(0),r=";".charCodeAt(0),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(64),a=new Uint8Array(128),s=0;s>>=1,c&&(i=-2147483648|-i),r[n]+=i,e}function d(t,r,n){return!(r>=n)&&t.charCodeAt(r)!==e}function p(t){t.sort(m)}function m(t,e){return t[0]-e[0]}function g(t){for(var n=new Int32Array(5),i=16384,o=i-36,a=new Uint8Array(i),s=a.subarray(0,o),u=0,f="",l=0;l0&&(u===i&&(f+=c.decode(a),u=0),a[u++]=r),0!==h.length){n[0]=0;for(var d=0;do&&(f+=c.decode(s),a.copyWithin(0,o,u),u-=o),d>0&&(a[u++]=e),u=v(a,u,n,p,0),1!==p.length&&(u=v(a,u,n,p,1),u=v(a,u,n,p,2),u=v(a,u,n,p,3),4!==p.length&&(u=v(a,u,n,p,4)))}}}return f+c.decode(a.subarray(0,u))}function v(t,e,r,n,i){var a=n[i],s=a-r[i];r[i]=a,s=s<0?-s<<1|1:s<<1;do{var u=31&s;(s>>>=5)>0&&(u|=32),t[e++]=o[u]}while(s>0);return e}t.decode=f,t.encode=g,Object.defineProperty(t,"__esModule",{value:!0})}(e)},67822:function(t,e,r){"use strict";t=r.nmd(t);var n,i=r(27424).default,o=function(t,e){return function(){var r=t.apply(void 0,arguments);return"\x1b[".concat(r+e,"m")}},a=function(t,e){return function(){var r=t.apply(void 0,arguments);return"\x1b[".concat(38+e,";5;").concat(r,"m")}},s=function(t,e){return function(){var r=t.apply(void 0,arguments);return"\x1b[".concat(38+e,";2;").concat(r[0],";").concat(r[1],";").concat(r[2],"m")}},u=function(t){return t},c=function(t,e,r){return[t,e,r]},f=function(t,e,r){Object.defineProperty(t,e,{get:function(){var n=r();return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},l=function(t,e,o,a){void 0===n&&(n=r(87287));for(var s=a?10:0,u={},c=0,f=Object.entries(n);c>6],i=0===(32&r);if(31===(31&r)){var o=r;for(r=0;128===(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function l(t,e,r){var n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0===(128&n))return n;var i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(var o=0;o=31)return n.error("Multi-octet tag encoding unsupported");e||(i|=32);return i|=a.tagClassByName[r||"universal"]<<6,i}(t,e,r,this.reporter);if(n.length<128){var s=i.alloc(2);return s[0]=o,s[1]=n.length,this._createEncoderBuffer([s,n])}for(var u=1,c=n.length;c>=256;c>>=8)u++;var f=i.alloc(2+u);f[0]=o,f[1]=128|u;for(var l=1+u,h=n.length;h>0;l--,h>>=8)f[l]=255&h;return this._createEncoderBuffer([f,n])},u.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=i.alloc(2*t.length),n=0;n=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}for(var a=0,s=0;s=128;u>>=7)a++}for(var c=i.alloc(a),f=c.length-1,l=t.length-1;l>=0;l--){var h=t[l];for(c[f--]=127&h;(h>>=7)>0;)c[f--]=128|127&h}return this._createEncoderBuffer(c)},u.prototype._encodeTime=function(t,e){var r,n=new Date(t);return"gentime"===e?r=[c(n.getUTCFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[c(n.getUTCFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(t,e){if("string"===typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!==typeof t&&!i.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=i.from(r)}if(i.isBuffer(t)){var n=t.length;0===t.length&&n++;var o=i.alloc(n);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);for(var a=1,s=t;s>=256;s>>=8)a++;for(var u=new Array(a),c=u.length-1;c>=0;c--)u[c]=255&t,t>>=8;return 128&u[0]&&u.unshift(0),this._createEncoderBuffer(i.from(u))},u.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},u.prototype._use=function(t,e){return"function"===typeof t&&(t=t(e)),t._getEncoder("der").tree},u.prototype._skipDefault=function(t,e,r){var n,i=this._baseState;if(null===i.default)return!1;var o=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,e,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","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],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=l[t],d=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,c=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],M=8191&S,k=S>>>13,x=0|a[5],E=8191&x,A=x>>>13,O=0|a[6],T=8191&O,P=O>>>13,I=0|a[7],R=8191&I,C=I>>>13,N=0|a[8],B=8191&N,j=N>>>13,L=0|a[9],D=8191&L,U=L>>>13,F=0|s[0],H=8191&F,z=F>>>13,K=0|s[1],q=8191&K,V=K>>>13,G=0|s[2],W=8191&G,Y=G>>>13,$=0|s[3],Z=8191&$,X=$>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ft=0|s[8],lt=8191&ft,ht=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(l,H))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,H)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,z))+Math.imul(m,H)|0,o=Math.imul(m,z);var vt=(c+(n=n+Math.imul(l,q)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(h,q)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,H),i=(i=Math.imul(v,z))+Math.imul(y,H)|0,o=Math.imul(y,z),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,V)|0;var yt=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(h,W)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,H),i=(i=Math.imul(w,z))+Math.imul(_,H)|0,o=Math.imul(_,z),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Y)|0;var bt=(c+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(h,Z)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,H),i=(i=Math.imul(M,z))+Math.imul(k,H)|0,o=Math.imul(k,z),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,H),i=(i=Math.imul(E,z))+Math.imul(A,H)|0,o=Math.imul(A,z),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,H),i=(i=Math.imul(T,z))+Math.imul(P,H)|0,o=Math.imul(P,z),n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var St=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(R,H),i=(i=Math.imul(R,z))+Math.imul(C,H)|0,o=Math.imul(C,z),n=n+Math.imul(T,q)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,z))+Math.imul(j,H)|0,o=Math.imul(j,z),n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,z))+Math.imul(U,H)|0,o=Math.imul(U,z),n=n+Math.imul(B,q)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var xt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(U,q)|0,o=Math.imul(U,V),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var Et=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var At=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,X))+Math.imul(U,Z)|0,o=Math.imul(U,X),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var Ot=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ht)|0;var Tt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,at))+Math.imul(U,ot)|0,o=Math.imul(U,at),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ct)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var It=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ct))+Math.imul(U,ut)|0,o=Math.imul(U,ct),n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ht)|0;var Rt=(c+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(D,lt),i=(i=Math.imul(D,ht))+Math.imul(U,lt)|0,o=Math.imul(U,ht);var Ct=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Nt=(c+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return c=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=vt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Mt,u[8]=kt,u[9]=xt,u[10]=Et,u[11]=At,u[12]=Ot,u[13]=Tt,u[14]=Pt,u[15]=It,u[16]=Rt,u[17]=Ct,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var h=0,d=1;0===(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0===(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(b,y),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},88093:function(t,e,r){"use strict";var n=r(1426);function i(t){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var o,a,s=r(53372).codes,u=s.ERR_AMBIGUOUS_ARGUMENT,c=s.ERR_INVALID_ARG_TYPE,f=s.ERR_INVALID_ARG_VALUE,l=s.ERR_INVALID_RETURN_VALUE,h=s.ERR_MISSING_ARGS,d=r(24945),p=r(49639).inspect,m=r(49639).types,g=m.isPromise,v=m.isRegExp,y=Object.assign?Object.assign:r(50887).assign,b=Object.is?Object.is:r(33454);new Map;function w(){var t=r(46912);o=t.isDeepEqual,a=t.isDeepStrictEqual}var _=!1,S=t.exports=E,M={};function k(t){if(t.message instanceof Error)throw t.message;throw new d(t)}function x(t,e,r,n){if(!r){var i=!1;if(0===e)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new d({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw o.generatedMessage=i,o}}function E(){for(var t=arguments.length,e=new Array(t),r=0;r1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;it.length)&&(r=t.length),t.substring(r-e.length,r)===e}var g="",v="",y="",b="",w={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function S(t){return d(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(t,e,r){var i="",o="",a=0,s="",u=!1,c=S(t),f=c.split("\n"),l=S(e).split("\n"),d=0,p="";if("strictEqual"===r&&"object"===h(t)&&"object"===h(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===f.length&&1===l.length&&f[0]!==l[0]){var _=f[0].length+l[0].length;if(_<=10){if(("object"!==h(t)||null===t)&&("object"!==h(e)||null===e)&&(0!==t||0!==e))return"".concat(w[r],"\n\n")+"".concat(f[0]," !== ").concat(l[0],"\n")}else if("strictEqualObject"!==r){if(_<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;f[0][d]===l[0][d];)d++;d>2&&(p="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",d),"^"),d=0)}}}for(var M=f[f.length-1],k=l[l.length-1];M===k&&(d++<2?s="\n ".concat(M).concat(s):i=M,f.pop(),l.pop(),0!==f.length&&0!==l.length);)M=f[f.length-1],k=l[l.length-1];var x=Math.max(f.length,l.length);if(0===x){var E=c.split("\n");if(E.length>30)for(E[26]="".concat(g,"...").concat(b);E.length>27;)E.pop();return"".concat(w.notIdentical,"\n\n").concat(E.join("\n"),"\n")}d>3&&(s="\n".concat(g,"...").concat(b).concat(s),u=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var A=0,O=w[r]+"\n".concat(v,"+ actual").concat(b," ").concat(y,"- expected").concat(b),T=" ".concat(g,"...").concat(b," Lines skipped");for(d=0;d1&&d>2&&(P>4?(o+="\n".concat(g,"...").concat(b),u=!0):P>3&&(o+="\n ".concat(l[d-2]),A++),o+="\n ".concat(l[d-1]),A++),a=d,i+="\n".concat(y,"-").concat(b," ").concat(l[d]),A++;else if(l.length1&&d>2&&(P>4?(o+="\n".concat(g,"...").concat(b),u=!0):P>3&&(o+="\n ".concat(f[d-2]),A++),o+="\n ".concat(f[d-1]),A++),a=d,o+="\n".concat(v,"+").concat(b," ").concat(f[d]),A++;else{var I=l[d],R=f[d],C=R!==I&&(!m(R,",")||R.slice(0,-1)!==I);C&&m(I,",")&&I.slice(0,-1)===R&&(C=!1,R+=","),C?(P>1&&d>2&&(P>4?(o+="\n".concat(g,"...").concat(b),u=!0):P>3&&(o+="\n ".concat(f[d-2]),A++),o+="\n ".concat(f[d-1]),A++),a=d,o+="\n".concat(v,"+").concat(b," ").concat(R),i+="\n".concat(y,"-").concat(b," ").concat(I),A+=2):(o+=i,i="",1!==P&&0!==d||(o+="\n ".concat(R),A++))}if(A>20&&d30)for(k[26]="".concat(g,"...").concat(b);k.length>27;)k.pop();r=1===k.length?a(this,l(e).call(this,"".concat(m," ").concat(k[0]))):a(this,l(e).call(this,"".concat(m,"\n\n").concat(k.join("\n"),"\n")))}else{var x=S(c),E="",A=w[o];"notDeepEqual"===o||"notEqual"===o?(x="".concat(w[o],"\n\n").concat(x)).length>1024&&(x="".concat(x.slice(0,1021),"...")):(E="".concat(S(f)),x.length>512&&(x="".concat(x.slice(0,509),"...")),E.length>512&&(E="".concat(E.slice(0,509),"...")),"deepEqual"===o||"equal"===o?x="".concat(A,"\n\n").concat(x,"\n\nshould equal\n\n"):E=" ".concat(o," ").concat(E)),r=a(this,l(e).call(this,"".concat(x).concat(E)))}return Error.stackTraceLimit=d,r.generatedMessage=!i,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=f,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(s(r),u),r.stack,r.name="AssertionError",a(r)}var r,u,c;return function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(e,t),r=e,u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:d.custom,value:function(t,e){return d(this,function(t){for(var e=1;e2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}f("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),f("ERR_INVALID_ARG_TYPE",(function(t,e,i){var o,a,u,c;if(void 0===s&&(s=r(88093)),s("string"===typeof t,"'name' must be a string"),"string"===typeof e&&(a="not ",e.substr(!u||u<0?0:+u,a.length)===a)?(o="must not be",e=e.replace(/^not /,"")):o="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))c="The ".concat(t," ").concat(o," ").concat(l(e,"type"));else{var f=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";c='The "'.concat(t,'" ').concat(f," ").concat(o," ").concat(l(e,"type"))}return c+=". Received type ".concat(n(i))}),TypeError),f("ERR_INVALID_ARG_VALUE",(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===u&&(u=r(49639));var i=u.inspect(e);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),f("ERR_INVALID_RETURN_VALUE",(function(t,e,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")}),TypeError),f("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),n=0;n0,"At least one arg needs to be specified");var i="The ",o=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),o){case 1:i+="".concat(e[0]," argument");break;case 2:i+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:i+=e.slice(0,o-1).join(", "),i+=", and ".concat(e[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),t.exports.codes=c},46912:function(t,e,r){"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(u){i=!0,o=u}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(t){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var o=void 0!==/a/g.flags,a=function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e},s=function(t){var e=[];return t.forEach((function(t,r){return e.push([r,t])})),e},u=Object.is?Object.is:r(33454),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:r(6188);function l(t){return t.call.bind(t)}var h=l(Object.prototype.hasOwnProperty),d=l(Object.prototype.propertyIsEnumerable),p=l(Object.prototype.toString),m=r(49639).types,g=m.isAnyArrayBuffer,v=m.isArrayBufferView,y=m.isDate,b=m.isMap,w=m.isRegExp,_=m.isSet,S=m.isNativeError,M=m.isBoxedPrimitive,k=m.isNumberObject,x=m.isStringObject,E=m.isBooleanObject,A=m.isBigIntObject,O=m.isSymbolObject,T=m.isFloat32Array,P=m.isFloat64Array;function I(t){if(0===t.length||t.length>10)return!0;for(var e=0;e57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function R(t){return Object.keys(t).filter(I).concat(c(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function C(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i=0&&c>0){if(t===e)return[u,c];for(n=[],o=r.length;f>=0&&!s;)f==u?(n.push(f),u=r.indexOf(t,f+1)):1==n.length?s=[n.pop(),c]:((i=n.pop())=0?u:c;n.length&&(s=[o,a])}return s}t.exports=e,e.range=n},12307:function(t,e,r){"use strict";var n=r(82543).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r>>0,f=new Uint8Array(a);t[r];){var l=e[t.charCodeAt(r)];if(255===l)return;for(var h=0,d=a-1;(0!==l||h>>0,f[d]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");o=h,r++}for(var p=a-o;p!==a&&0===f[p];)p++;var m=n.allocUnsafe(i+(a-p));m.fill(0,0,i);for(var g=i;p!==a;)m[g++]=f[p++];return m}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,a=e.length;o!==a&&0===e[o];)o++,r++;for(var c=(a-o)*f+1>>>0,l=new Uint8Array(c);o!==a;){for(var h=e[o],d=0,p=c-1;(0!==h||d>>0,l[p]=h%s>>>0,h=h/s>>>0;if(0!==h)throw new Error("Non-zero carry");i=d,o++}for(var m=c-i;m!==c&&0===l[m];)m++;for(var g=u.repeat(r);m0?a-4:a;for(r=0;r>16&255,c[f++]=e>>8&255,c[f++]=255&e;2===u&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[f++]=255&e);1===u&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e);return c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=16383,s=0,c=n-i;sc?c:s+a));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var i,o,a=[],s=e;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},17144:function(t,e,r){var n;!function(i){"use strict";var o,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,u=Math.floor,c="[BigNumber Error] ",f=c+"Number primitive has more than 15 significant digits: ",l=1e14,h=14,d=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,g=1e9;function v(t){var e=0|t;return t>0||t===e?e:e-1}function y(t){for(var e,r,n=1,i=t.length,o=t[0]+"";nc^r?1:-1;for(s=(u=i.length)<(c=o.length)?u:c,a=0;ao[a]^r?1:-1;return u==c?0:u>c^r?1:-1}function w(t,e,r,n){if(tr||t!==u(t))throw Error(c+(n||"Argument")+("number"==typeof t?tr?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function _(t){var e=t.c.length-1;return v(t.e/h)==e&&t.c[e]%2!=0}function S(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function M(t,e,r){var n,i;if(e<0){for(i=r+".";++e;i+=r);t=i+t}else if(++e>(n=t.length)){for(i=r,e-=n;--e;i+=r);t+=i}else eP?v.c=v.e=null:t.e=10;l/=10,c++);return void(c>P?v.c=v.e=null:(v.e=c,v.c=[t]))}g=String(t)}else{if(!a.test(g=String(t)))return i(v,g,p);v.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(c=g.indexOf("."))>-1&&(g=g.replace(".","")),(l=g.search(/e/i))>0?(c<0&&(c=l),c+=+g.slice(l+1),g=g.substring(0,l)):c<0&&(c=g.length)}else{if(w(e,2,B.length,"Base"),10==e&&j)return H(v=new L(t),x+v.e+1,E);if(g=String(t),p="number"==typeof t){if(0*t!=0)return i(v,g,p,e);if(v.s=1/t<0?(g=g.slice(1),-1):1,L.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(f+t)}else v.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=B.slice(0,e),c=l=0,m=g.length;lc){c=m;continue}}else if(!s&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){s=!0,l=-1,c=0;continue}return i(v,String(t),p,e)}p=!1,(c=(g=n(g,e,10,v.s)).indexOf("."))>-1?g=g.replace(".",""):c=g.length}for(l=0;48===g.charCodeAt(l);l++);for(m=g.length;48===g.charCodeAt(--m););if(g=g.slice(l,++m)){if(m-=l,p&&L.DEBUG&&m>15&&(t>d||t!==u(t)))throw Error(f+v.s*t);if((c=c-l-1)>P)v.c=v.e=null;else if(c=O)?S(u,a):M(u,a,"0");else if(o=(t=H(new L(t),e,r)).e,s=(u=y(t.c)).length,1==n||2==n&&(e<=o||o<=A)){for(;ss){if(--e>0)for(u+=".";e--;u+="0");}else if((e+=o-s)>0)for(o+1==s&&(u+=".");e--;u+="0");return t.s<0&&i?"-"+u:u}function U(t,e){for(var r,n=1,i=new L(t[0]);n=10;i/=10,n++);return(r=n+r*h-1)>P?t.c=t.e=null:r=10;c/=10,i++);if((o=e-i)<0)o+=h,a=e,m=(f=g[d=0])/v[i-a-1]%10|0;else if((d=s((o+1)/h))>=g.length){if(!n)break t;for(;g.length<=d;g.push(0));f=m=0,i=1,a=(o%=h)-h+1}else{for(f=c=g[d],i=1;c>=10;c/=10,i++);m=(a=(o%=h)-h+i)<0?0:f/v[i-a-1]%10|0}if(n=n||e<0||null!=g[d+1]||(a<0?f:f%v[i-a-1]),n=r<4?(m||n)&&(0==r||r==(t.s<0?3:2)):m>5||5==m&&(4==r||n||6==r&&(o>0?a>0?f/v[i-a]:0:g[d-1])%10&1||r==(t.s<0?8:7)),e<1||!g[0])return g.length=0,n?(e-=t.e+1,g[0]=v[(h-e%h)%h],t.e=-e||0):g[0]=t.e=0,t;if(0==o?(g.length=d,c=1,d--):(g.length=d+1,c=v[h-o],g[d]=a>0?u(f/v[i-a]%v[a])*c:0),n)for(;;){if(0==d){for(o=1,a=g[0];a>=10;a/=10,o++);for(a=g[0]+=c,c=1;a>=10;a/=10,c++);o!=c&&(t.e++,g[0]==l&&(g[0]=1));break}if(g[d]+=c,g[d]!=l)break;g[d--]=0,c=1}for(o=g.length;0===g[--o];g.pop());}t.e>P?t.c=t.e=null:t.e=O?S(e,r):M(e,r,"0"),t.s<0?"-"+e:e)}return L.clone=t,L.ROUND_UP=0,L.ROUND_DOWN=1,L.ROUND_CEIL=2,L.ROUND_FLOOR=3,L.ROUND_HALF_UP=4,L.ROUND_HALF_DOWN=5,L.ROUND_HALF_EVEN=6,L.ROUND_HALF_CEIL=7,L.ROUND_HALF_FLOOR=8,L.EUCLID=9,L.config=L.set=function(t){var e,r;if(null!=t){if("object"!=typeof t)throw Error(c+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(w(r=t[e],0,g,e),x=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(w(r=t[e],0,8,e),E=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(w(r[0],-g,0,e),w(r[1],0,g,e),A=r[0],O=r[1]):(w(r,-g,g,e),A=-(O=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)w(r[0],-g,-1,e),w(r[1],1,g,e),T=r[0],P=r[1];else{if(w(r,-g,g,e),!r)throw Error(c+e+" cannot be zero: "+r);T=-(P=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(c+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw I=!r,Error(c+"crypto unavailable");I=r}else I=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(w(r=t[e],0,9,e),R=r),t.hasOwnProperty(e="POW_PRECISION")&&(w(r=t[e],0,g,e),C=r),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(r=t[e]))throw Error(c+e+" not an object: "+r);N=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(c+e+" invalid: "+r);j="0123456789"==r.slice(0,10),B=r}}return{DECIMAL_PLACES:x,ROUNDING_MODE:E,EXPONENTIAL_AT:[A,O],RANGE:[T,P],CRYPTO:I,MODULO_MODE:R,POW_PRECISION:C,FORMAT:N,ALPHABET:B}},L.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!L.DEBUG)return!0;var e,r,n=t.c,i=t.e,o=t.s;t:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-g&&i<=g&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break t}if((e=(i+1)%h)<1&&(e+=h),String(n[0]).length==e){for(e=0;e=l||r!==u(r))break t;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(c+"Invalid BigNumber: "+t)},L.maximum=L.max=function(){return U(arguments,o.lt)},L.minimum=L.min=function(){return U(arguments,o.gt)},L.random=function(){var t=9007199254740992,e=Math.random()*t&2097151?function(){return u(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var r,n,i,o,a,f=0,l=[],d=new L(k);if(null==t?t=x:w(t,0,g),o=s(t/h),I)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(o*=2));f>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),r[f]=n[0],r[f+1]=n[1]):(l.push(a%1e14),f+=2);f=o/2}else{if(!crypto.randomBytes)throw I=!1,Error(c+"crypto unavailable");for(r=crypto.randomBytes(o*=7);f=9e15?crypto.randomBytes(7).copy(r,f):(l.push(a%1e14),f+=7);f=o/7}if(!I)for(;f=10;a/=10,f++);fr-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(n,i,o,a,s){var u,c,f,l,h,d,p,m,g=n.indexOf("."),v=x,b=E;for(g>=0&&(l=C,C=0,n=n.replace(".",""),d=(m=new L(i)).pow(n.length-g),C=l,m.c=e(M(y(d.c),d.e,"0"),10,o,t),m.e=m.c.length),f=l=(p=e(n,i,o,s?(u=B,t):(u=t,B))).length;0==p[--l];p.pop());if(!p[0])return u.charAt(0);if(g<0?--f:(d.c=p,d.e=f,d.s=a,p=(d=r(d,m,v,b,o)).c,h=d.r,f=d.e),g=p[c=f+v+1],l=o/2,h=h||c<0||null!=p[c+1],h=b<4?(null!=g||h)&&(0==b||b==(d.s<0?3:2)):g>l||g==l&&(4==b||h||6==b&&1&p[c-1]||b==(d.s<0?8:7)),c<1||!p[0])n=h?M(u.charAt(1),-v,u.charAt(0)):u.charAt(0);else{if(p.length=c,h)for(--o;++p[--c]>o;)p[c]=0,c||(++f,p=[1].concat(p));for(l=p.length;!p[--l];);for(g=0,n="";g<=l;n+=u.charAt(p[g++]));n=M(n,f,u.charAt(0))}return n}}(),r=function(){function t(t,e,r){var n,i,o,a,s=0,u=t.length,c=e%m,f=e/m|0;for(t=t.slice();u--;)s=((i=c*(o=t[u]%m)+(n=f*o+(a=t[u]/m|0)*c)%m*m+s)/r|0)+(n/m|0)+f*a,t[u]=i%r;return s&&(t=[s].concat(t)),t}function e(t,e,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;ie[i]?1:-1;break}return o}function r(t,e,r,n){for(var i=0;r--;)t[r]-=i,i=t[r]1;t.splice(0,1));}return function(n,i,o,a,s){var c,f,d,p,m,g,y,b,w,_,S,M,k,x,E,A,O,T=n.s==i.s?1:-1,P=n.c,I=i.c;if(!P||!P[0]||!I||!I[0])return new L(n.s&&i.s&&(P?!I||P[0]!=I[0]:I)?P&&0==P[0]||!I?0*T:T/0:NaN);for(w=(b=new L(T)).c=[],T=o+(f=n.e-i.e)+1,s||(s=l,f=v(n.e/h)-v(i.e/h),T=T/h|0),d=0;I[d]==(P[d]||0);d++);if(I[d]>(P[d]||0)&&f--,T<0)w.push(1),p=!0;else{for(x=P.length,A=I.length,d=0,T+=2,(m=u(s/(I[0]+1)))>1&&(I=t(I,m,s),P=t(P,m,s),A=I.length,x=P.length),k=A,S=(_=P.slice(0,A)).length;S=s/2&&E++;do{if(m=0,(c=e(I,_,A,S))<0){if(M=_[0],A!=S&&(M=M*s+(_[1]||0)),(m=u(M/E))>1)for(m>=s&&(m=s-1),y=(g=t(I,m,s)).length,S=_.length;1==e(g,_,y,S);)m--,r(g,A=10;T/=10,d++);H(b,o+(b.e=d+f*h-1)+1,a,p)}else b.e=f,b.r=+p;return b}}(),i=function(){var t=/^(-?)0([xbo])(?=\w[\w.]*$)/i,e=/^([^.]+)\.$/,r=/^\.([^.]+)$/,n=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(o,a,s,u){var f,l=s?a:a.replace(i,"");if(n.test(l))o.s=isNaN(l)?null:l<0?-1:1;else{if(!s&&(l=l.replace(t,(function(t,e,r){return f="x"==(r=r.toLowerCase())?16:"b"==r?2:8,u&&u!=f?t:e})),u&&(f=u,l=l.replace(e,"$1").replace(r,"0.$1")),a!=l))return new L(l,f);if(L.DEBUG)throw Error(c+"Not a"+(u?" base "+u:"")+" number: "+a);o.s=null}o.c=o.e=null}}(),o.absoluteValue=o.abs=function(){var t=new L(this);return t.s<0&&(t.s=1),t},o.comparedTo=function(t,e){return b(this,new L(t,e))},o.decimalPlaces=o.dp=function(t,e){var r,n,i,o=this;if(null!=t)return w(t,0,g),null==e?e=E:w(e,0,8),H(new L(o),t+o.e+1,e);if(!(r=o.c))return null;if(n=((i=r.length-1)-v(this.e/h))*h,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},o.dividedBy=o.div=function(t,e){return r(this,new L(t,e),x,E)},o.dividedToIntegerBy=o.idiv=function(t,e){return r(this,new L(t,e),0,1)},o.exponentiatedBy=o.pow=function(t,e){var r,n,i,o,a,f,l,d,p=this;if((t=new L(t)).c&&!t.isInteger())throw Error(c+"Exponent not an integer: "+z(t));if(null!=e&&(e=new L(e)),a=t.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!t.c||!t.c[0])return d=new L(Math.pow(+z(p),a?t.s*(2-_(t)):+z(t))),e?d.mod(e):d;if(f=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new L(NaN);(n=!f&&p.isInteger()&&e.isInteger())&&(p=p.mod(e))}else{if(t.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||a&&p.c[1]>=24e7:p.c[0]<8e13||a&&p.c[0]<=9999975e7)))return o=p.s<0&&_(t)?-0:0,p.e>-1&&(o=1/o),new L(f?1/o:o);C&&(o=s(C/h+2))}for(a?(r=new L(.5),f&&(t.s=1),l=_(t)):l=(i=Math.abs(+z(t)))%2,d=new L(k);;){if(l){if(!(d=d.times(p)).c)break;o?d.c.length>o&&(d.c.length=o):n&&(d=d.mod(e))}if(i){if(0===(i=u(i/2)))break;l=i%2}else if(H(t=t.times(r),t.e+1,1),t.e>14)l=_(t);else{if(0===(i=+z(t)))break;l=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(e))}return n?d:(f&&(d=k.div(d)),e?d.mod(e):o?H(d,C,E,undefined):d)},o.integerValue=function(t){var e=new L(this);return null==t?t=E:w(t,0,8),H(e,e.e+1,t)},o.isEqualTo=o.eq=function(t,e){return 0===b(this,new L(t,e))},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(t,e){return b(this,new L(t,e))>0},o.isGreaterThanOrEqualTo=o.gte=function(t,e){return 1===(e=b(this,new L(t,e)))||0===e},o.isInteger=function(){return!!this.c&&v(this.e/h)>this.c.length-2},o.isLessThan=o.lt=function(t,e){return b(this,new L(t,e))<0},o.isLessThanOrEqualTo=o.lte=function(t,e){return-1===(e=b(this,new L(t,e)))||0===e},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&0==this.c[0]},o.minus=function(t,e){var r,n,i,o,a=this,s=a.s;if(e=(t=new L(t,e)).s,!s||!e)return new L(NaN);if(s!=e)return t.s=-e,a.plus(t);var u=a.e/h,c=t.e/h,f=a.c,d=t.c;if(!u||!c){if(!f||!d)return f?(t.s=-e,t):new L(d?a:NaN);if(!f[0]||!d[0])return d[0]?(t.s=-e,t):new L(f[0]?a:3==E?-0:0)}if(u=v(u),c=v(c),f=f.slice(),s=u-c){for((o=s<0)?(s=-s,i=f):(c=u,i=d),i.reverse(),e=s;e--;i.push(0));i.reverse()}else for(n=(o=(s=f.length)<(e=d.length))?s:e,s=e=0;e0)for(;e--;f[r++]=0);for(e=l-1;n>s;){if(f[--n]=0;){for(r=0,p=M[i]%w,g=M[i]/w|0,o=i+(a=u);o>i;)r=((c=p*(c=S[--a]%w)+(s=g*c+(f=S[a]/w|0)*p)%w*w+y[o]+r)/b|0)+(s/w|0)+g*f,y[o--]=c%b;y[o]=r}return r?++n:y.splice(0,1),F(t,y,n)},o.negated=function(){var t=new L(this);return t.s=-t.s||null,t},o.plus=function(t,e){var r,n=this,i=n.s;if(e=(t=new L(t,e)).s,!i||!e)return new L(NaN);if(i!=e)return t.s=-e,n.minus(t);var o=n.e/h,a=t.e/h,s=n.c,u=t.c;if(!o||!a){if(!s||!u)return new L(i/0);if(!s[0]||!u[0])return u[0]?t:new L(s[0]?n:0*i)}if(o=v(o),a=v(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=u):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(e=u.length)<0&&(r=u,u=s,s=r,e=i),i=0;e;)i=(s[--e]=s[e]+u[e]+i)/l|0,s[e]=l===s[e]?0:s[e]%l;return i&&(s=[i].concat(s),++a),F(t,s,a)},o.precision=o.sd=function(t,e){var r,n,i,o=this;if(null!=t&&t!==!!t)return w(t,1,g),null==e?e=E:w(e,0,8),H(new L(o),t,e);if(!(r=o.c))return null;if(n=(i=r.length-1)*h+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return t&&o.e+1>n&&(n=o.e+1),n},o.shiftedBy=function(t){return w(t,-9007199254740991,d),this.times("1e"+t)},o.squareRoot=o.sqrt=function(){var t,e,n,i,o,a=this,s=a.c,u=a.s,c=a.e,f=x+4,l=new L("0.5");if(1!==u||!s||!s[0])return new L(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+z(a)))||u==1/0?(((e=y(s)).length+c)%2==0&&(e+="0"),u=Math.sqrt(+e),c=v((c+1)/2)-(c<0||c%2),n=new L(e=u==1/0?"5e"+c:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+c)):n=new L(u+""),n.c[0])for((u=(c=n.e)+f)<3&&(u=0);;)if(o=n,n=l.times(o.plus(r(a,o,f,1))),y(o.c).slice(0,u)===(e=y(n.c)).slice(0,u)){if(n.e0&&m>0){for(o=m%s||s,l=p.substr(0,o);o0&&(l+=f+p.slice(o)),d&&(l="-"+l)}n=h?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):l}return(r.prefix||"")+n+(r.suffix||"")},o.toFraction=function(t){var e,n,i,o,a,s,u,f,l,d,m,g,v=this,b=v.c;if(null!=t&&(!(u=new L(t)).isInteger()&&(u.c||1!==u.s)||u.lt(k)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+z(u));if(!b)return new L(v);for(e=new L(k),l=n=new L(k),i=f=new L(k),g=y(b),a=e.e=g.length-v.e-1,e.c[0]=p[(s=a%h)<0?h+s:s],t=!t||u.comparedTo(e)>0?a>0?e:l:u,s=P,P=1/0,u=new L(g),f.c[0]=0;d=r(u,e,0,1),1!=(o=n.plus(d.times(i))).comparedTo(t);)n=i,i=o,l=f.plus(d.times(o=l)),f=o,e=u.minus(d.times(o=e)),u=o;return o=r(t.minus(n),i,0,1),f=f.plus(o.times(l)),n=n.plus(o.times(i)),f.s=l.s=v.s,m=r(l,i,a*=2,E).minus(v).abs().comparedTo(r(f,n,a,E).minus(v).abs())<1?[l,i]:[f,n],P=s,m},o.toNumber=function(){return+z(this)},o.toPrecision=function(t,e){return null!=t&&w(t,1,g),D(this,t,e,2)},o.toString=function(t){var e,r=this,i=r.s,o=r.e;return null===o?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=o<=A||o>=O?S(y(r.c),o):M(y(r.c),o,"0"):10===t&&j?e=M(y((r=H(new L(r),x+o+1,E)).c),r.e,"0"):(w(t,2,B.length,"Base"),e=n(M(y(r.c),o,"0"),10,t,i,!0)),i<0&&r.c[0]&&(e="-"+e)),e},o.valueOf=o.toJSON=function(){return z(this)},o._isBigNumber=!0,null!=e&&L.set(e),L}(),o.default=o.BigNumber=o,void 0===(n=function(){return o}.call(e,r,e,t))||(t.exports=n)}()},80518:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(46601).Buffer}catch(O){}function s(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function u(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,r,i){for(var o=0,a=0,s=Math.min(t.length,r),u=e;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(O){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[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],p=[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];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],f=p[t];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modrn(f).toString(t);r=(l=l.idivn(f)).isZero()?m+r:h[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(a,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(t[r--]=a>>8&255),r>=0&&(t[r--]=a>>16&255),6===o?(r>=0&&(t[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],M=8191&S,k=S>>>13,x=0|a[5],E=8191&x,A=x>>>13,O=0|a[6],T=8191&O,P=O>>>13,I=0|a[7],R=8191&I,C=I>>>13,N=0|a[8],B=8191&N,j=N>>>13,L=0|a[9],D=8191&L,U=L>>>13,F=0|s[0],H=8191&F,z=F>>>13,K=0|s[1],q=8191&K,V=K>>>13,G=0|s[2],W=8191&G,Y=G>>>13,$=0|s[3],Z=8191&$,X=$>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ft=0|s[8],lt=8191&ft,ht=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(l,H))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,H)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,z))+Math.imul(m,H)|0,o=Math.imul(m,z);var vt=(c+(n=n+Math.imul(l,q)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(h,q)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,H),i=(i=Math.imul(v,z))+Math.imul(y,H)|0,o=Math.imul(y,z),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,V)|0;var yt=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(h,W)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,H),i=(i=Math.imul(w,z))+Math.imul(_,H)|0,o=Math.imul(_,z),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Y)|0;var bt=(c+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(h,Z)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,H),i=(i=Math.imul(M,z))+Math.imul(k,H)|0,o=Math.imul(k,z),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,H),i=(i=Math.imul(E,z))+Math.imul(A,H)|0,o=Math.imul(A,z),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,H),i=(i=Math.imul(T,z))+Math.imul(P,H)|0,o=Math.imul(P,z),n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var St=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(R,H),i=(i=Math.imul(R,z))+Math.imul(C,H)|0,o=Math.imul(C,z),n=n+Math.imul(T,q)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,z))+Math.imul(j,H)|0,o=Math.imul(j,z),n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,z))+Math.imul(U,H)|0,o=Math.imul(U,z),n=n+Math.imul(B,q)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var xt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(U,q)|0,o=Math.imul(U,V),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var Et=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var At=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,X))+Math.imul(U,Z)|0,o=Math.imul(U,X),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var Ot=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ht)|0;var Tt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,at))+Math.imul(U,ot)|0,o=Math.imul(U,at),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ct)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var It=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ct))+Math.imul(U,ut)|0,o=Math.imul(U,ct),n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ht)|0;var Rt=(c+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(D,lt),i=(i=Math.imul(D,ht))+Math.imul(U,lt)|0,o=Math.imul(U,ht);var Ct=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Nt=(c+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return c=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=vt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Mt,u[8]=kt,u[9]=xt,u[10]=Et,u[11]=At,u[12]=Ot,u[13]=Tt,u[14]=Pt,u[15]=It,u[16]=Rt,u[17]=Ct,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function v(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function y(t,e,r){return v(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(g=m),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?m(this,t,e):r<1024?v(this,t,e):y(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var h=0,d=1;0===(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0===(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new E(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},i(S,_),S.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},S.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new S;else if("p224"===t)e=new M;else if("p192"===t)e=new k;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new x}return w[t]=e,e},E.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(f(t,t.umod(this.m)._forceRed(this)),t)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},i(A,E),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},33740:function(t,e,r){var n=r(88770),i=r(14249);t.exports=function(t){if(!t)return[];"{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2));return v(function(t){return t.split("\\\\").join(o).split("\\{").join(a).split("\\}").join(s).split("\\,").join(u).split("\\.").join(c)}(t),!0).map(l)};var o="\0SLASH"+Math.random()+"\0",a="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",u="\0COMMA"+Math.random()+"\0",c="\0PERIOD"+Math.random()+"\0";function f(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function l(t){return t.split(o).join("\\").split(a).join("{").split(s).join("}").split(u).join(",").split(c).join(".")}function h(t){if(!t)return[""];var e=[],r=i("{","}",t);if(!r)return t.split(",");var n=r.pre,o=r.body,a=r.post,s=n.split(",");s[s.length-1]+="{"+o+"}";var u=h(a);return a.length&&(s[s.length-1]+=u.shift(),s.push.apply(s,u)),e.push.apply(e,s),e}function d(t){return"{"+t+"}"}function p(t){return/^-?0\d/.test(t)}function m(t,e){return t<=e}function g(t,e){return t>=e}function v(t,e){var r=[],o=i("{","}",t);if(!o||/\$$/.test(o.pre))return[t];var a,u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),l=u||c,y=o.body.indexOf(",")>=0;if(!l&&!y)return o.post.match(/,.*\}/)?v(t=o.pre+"{"+o.body+s+o.post):[t];if(l)a=o.body.split(/\.\./);else if(1===(a=h(o.body)).length&&1===(a=v(a[0],!1).map(d)).length)return(_=o.post.length?v(o.post,!1):[""]).map((function(t){return o.pre+a[0]+t}));var b,w=o.pre,_=o.post.length?v(o.post,!1):[""];if(l){var S=f(a[0]),M=f(a[1]),k=Math.max(a[0].length,a[1].length),x=3==a.length?Math.abs(f(a[2])):1,E=m;M0){var I=new Array(P+1).join("0");T=O<0?"-"+I+T.slice(1):I+T}}b.push(T)}}else b=n(a,(function(t){return v(t,!1)}));for(var R=0;R>>24]^f[p>>>16&255]^l[m>>>8&255]^h[255&g]^e[v++],a=c[p>>>24]^f[m>>>16&255]^l[g>>>8&255]^h[255&d]^e[v++],s=c[m>>>24]^f[g>>>16&255]^l[d>>>8&255]^h[255&p]^e[v++],u=c[g>>>24]^f[d>>>16&255]^l[p>>>8&255]^h[255&m]^e[v++],d=o,p=a,m=s,g=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[m>>>8&255]<<8|n[255&g])^e[v++],a=(n[p>>>24]<<24|n[m>>>16&255]<<16|n[g>>>8&255]<<8|n[255&d])^e[v++],s=(n[m>>>24]<<24|n[g>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[v++],u=(n[g>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&m])^e[v++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99,r[a]=c,n[c]=a;var f=t[a],l=t[f],h=t[l],d=257*t[c]^16843008*c;i[0][a]=d<<24|d>>>8,i[1][a]=d<<16|d>>>16,i[2][a]=d<<8|d>>>24,i[3][a]=d,d=16843009*h^65537*l^257*f^16843008*a,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===a?a=s=1:(a=f^t[t[t[h^f]]],s^=t[t[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function c(t){this._key=i(t),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[o/e|0]<<24):e>6&&o%e===4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),i[o]=i[o-e]^a}for(var c=[],f=0;f>>24]]^u.INV_SUB_MIX[1][u.SBOX[h>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[h>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&h]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(t){return a(t=i(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},c.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=a(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=c},3560:function(t,e,r){var n=r(59915),i=r(82543).Buffer,o=r(92221),a=r(12534),s=r(15283),u=r(35865),c=r(8387);function f(t,e,r,a){o.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(e);var f=this._cipher.encryptBlock(u);this._ghash=new s(f),r=function(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new s(r),o=e.length,a=o%16;n.update(e),a&&(a=16-a,n.update(i.alloc(a,0))),n.update(i.alloc(8,0));var u=8*o,f=i.alloc(8);f.writeUIntBE(u,0,8),n.update(f),t._finID=n.state;var l=i.from(t._finID);return c(l),l}(this,r,f),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}a(f,o),f.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i16)throw new Error("unable to decrypt data");var r=-1;for(;++r16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(e,!1,r.key,r.iv);return h(t,n.key,n.iv)},e.createDecipheriv=h},25270:function(t,e,r){var n=r(88172),i=r(3560),o=r(82543).Buffer,a=r(12776),s=r(92221),u=r(59915),c=r(48462);function f(t,e,r){s.call(this),this._cache=new h,this._cipher=new u.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}r(12534)(f,s),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var l=o.alloc(16,16);function h(){this.cache=o.allocUnsafe(0)}function d(t,e,r){var s=n[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"===typeof e&&(e=o.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);if("string"===typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,e,r):"auth"===s.type?new i(s.module,e,r):new f(s.module,e,r)}f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},h.prototype.add=function(t){this.cache=o.concat([this.cache,t])},h.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},h.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function a(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(t){for(var e=-1;++e0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},a.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},a.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=a},8387:function(t){t.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},10694:function(t,e,r){var n=r(35865);e.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},33492:function(t,e,r){var n=r(82543).Buffer,i=r(35865);function o(t,e,r){var o=e.length,a=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:a]),a}e.encrypt=function(t,e,r){for(var i,a=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){a=n.concat([a,o(t,e,r)]);break}i=t._cache.length,a=n.concat([a,o(t,e.slice(0,i),r)]),e=e.slice(i)}return a}},61400:function(t,e,r){var n=r(82543).Buffer;function i(t,e,r){for(var n,i,a=-1,s=0;++a<8;)n=e&1<<7-a?128:0,s+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>a%8,t._prev=o(t._prev,r?n:i);return s}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,a=n.allocUnsafe(o),s=-1;++s=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function s(t,e){var r=function(t){var e=a(t);return{blinder:e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(e),o=e.modulus.byteLength(),s=new i(t).mul(r.blinder).umod(e.modulus),u=s.toRed(i.mont(e.prime1)),c=s.toRed(i.mont(e.prime2)),f=e.coefficient,l=e.prime1,h=e.prime2,d=u.redPow(e.exponent1).fromRed(),p=c.redPow(e.exponent2).fromRed(),m=d.isub(p).imul(f).umod(l).imul(h);return p.iadd(m).imul(r.unblinder).umod(e.modulus).toArrayLike(n,"be",o)}s.getr=a,t.exports=s},77050:function(t,e,r){t.exports=r(75207)},87834:function(t,e,r){var n=r(82543).Buffer,i=r(83569),o=r(4704),a=r(12534),s=r(45908),u=r(71666),c=r(75207);function f(t){o.Writable.call(this);var e=c[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function l(t){o.Writable.call(this);var e=c[t];if(!e)throw new Error("Unknown message digest");this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function h(t){return new f(t)}function d(t){return new l(t)}Object.keys(c).forEach((function(t){c[t].id=n.from(c[t].id,"hex"),c[t.toLowerCase()]=c[t]})),a(f,o.Writable),f.prototype._write=function(t,e,r){this._hash.update(t),r()},f.prototype.update=function(t,e){return"string"===typeof t&&(t=n.from(t,e)),this._hash.update(t),this},f.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=s(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},a(l,o.Writable),l.prototype._write=function(t,e,r){this._hash.update(t),r()},l.prototype.update=function(t,e){return"string"===typeof t&&(t=n.from(t,e)),this._hash.update(t),this},l.prototype.verify=function(t,e,r){"string"===typeof e&&(e=n.from(e,r)),this.end();var i=this._hash.digest();return u(e,i,t,this._signType,this._tag)},t.exports={Sign:h,Verify:d,createSign:h,createVerify:d}},45908:function(t,e,r){var n=r(82543).Buffer,i=r(57651),o=r(81330),a=r(6289).ec,s=r(80518),u=r(37510),c=r(1308);function f(t,e,r,o){if((t=n.from(t.toArray())).length0&&r.ishrn(n),r}function h(t,e,r){var o,a;do{for(o=n.alloc(0);8*o.length=e)throw new Error("invalid sig")}t.exports=function(t,e,r,c,f){var l=a(r);if("ec"===l.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(t,e,r){var n=s[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),a=r.data.subjectPrivateKey.data;return i.verify(e,t,a)}(t,e,l)}if("dsa"===l.type){if("dsa"!==c)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,o=r.data.q,s=r.data.g,c=r.data.pub_key,f=a.signature.decode(t,"der"),l=f.s,h=f.r;u(l,o),u(h,o);var d=i.mont(n),p=l.invm(o),m=s.toRed(d).redPow(new i(e).mul(p).mod(o)).fromRed().mul(c.toRed(d).redPow(h.mul(p).mod(o)).fromRed()).mod(n).mod(o);return 0===m.cmp(h)}(t,e,l)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");e=n.concat([f,e]);for(var h=l.modulus.byteLength(),d=[1],p=0;e.length+d.length+22?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,a,s;if("string"===typeof e&&(o="not ",e.substr(!a||a<0?0:+a,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var u=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(u," ").concat(i," ").concat(n(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},23771:function(t,e,r){"use strict";var n=r(1426),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=f;var o=r(49059),a=r(62354);r(12534)(f,o);for(var s=i(a.prototype),u=0;u0)if("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)a.endEmitted?S(t,new _):A(t,a,e,!0);else if(a.ended)S(t,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?A(t,a,e,!1):R(t,a)):A(t,a,e,!1)}else n||(a.reading=!1,R(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=O?t=O:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function P(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(I,t))}function I(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,L(t)}function R(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(C,t,e))}function C(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function B(t){c("readable nexttick read 0"),t.read(0)}function j(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),L(t),e.flowing&&!e.reading&&t.read(0)}function L(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function D(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(F,e,t))}function F(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function H(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):P(this),null;if(0===(t=T(t,e))&&e.ended)return 0===e.length&&U(this),null;var n,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t0?D(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==n&&this.emit("data",n),n},x.prototype._read=function(t){S(this,new w("_read()"))},x.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,c("pipe count=%d opts=%j",n.pipesCount,e);var a=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?u:g;function s(e,i){c("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,c("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",g),r.removeListener("data",h),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function u(){c("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",s);var f=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,L(t))}}(r);t.on("drain",f);var l=!1;function h(e){c("ondata");var i=t.write(e);c("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==H(n.pipes,t))&&!l&&(c("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(e){c("onerror",e),g(),t.removeListener("error",d),0===o(t,"error")&&S(t,e)}function p(){t.removeListener("finish",m),g()}function m(){c("onfinish"),t.removeListener("close",p),g()}function g(){c("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",m),t.emit("pipe",r),n.flowing||(c("pipe resume"),r.resume()),t},x.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,c("on readable",n.length,n.reading),n.length?P(this):n.reading||i.nextTick(B,this))),r},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(N,this),r},x.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(N,this),e},x.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(j,t,e))}(this,t)),t.paused=!1,this},x.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!==i&&void 0!==i)&&((r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause())))})),t)void 0===this[i]&&"function"===typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(t,e,r){r(new m("_write()"))},x.prototype._writev=null,x.prototype.end=function(t,e,r){var n=this._writableState;return"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,I(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),x.prototype.destroy=l.destroy,x.prototype._undestroy=l.undestroy,x.prototype._destroy=function(t,e){e(t)}},55515:function(t,e,r){"use strict";var n,i=r(1426);function o(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=r(45830),s=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function m(t){var e=t[s];if(null!==e){var r=t[d].read();null!==r&&(t[l]=null,t[s]=null,t[u]=null,e(p(r,!1)))}}function g(t){i.nextTick(m,t)}var v=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((o(n={get stream(){return this[d]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[f])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(e,r){i.nextTick((function(){t[c]?r(t[c]):e(p(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[f]?r(p(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var t=this;return new Promise((function(e,r){t[d].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),n),v);t.exports=function(t){var e,r=Object.create(y,(o(e={},d,{value:t,writable:!0}),o(e,s,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,c,{value:null,writable:!0}),o(e,f,{value:t._readableState.endEmitted,writable:!0}),o(e,h,{value:function(t,e){var n=r[d].read();n?(r[l]=null,r[s]=null,r[u]=null,t(p(n,!1))):(r[s]=t,r[u]=e)},writable:!0}),e));return r[l]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];return null!==e&&(r[l]=null,r[s]=null,r[u]=null,e(t)),void(r[c]=t)}var n=r[s];null!==n&&(r[l]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[f]=!0})),t.on("readable",g.bind(null,r)),r}},81042:function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return u.alloc(0);for(var e,r,n,i=u.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,u.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0===(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=u.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0===(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:f,value:function(t,e){return c(this,i(i({},e),{},{depth:0,customInspect:!1}))}}])&&a(e.prototype,r),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}()},53789:function(t,e,r){"use strict";var n=r(1426);function i(t,e){a(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function a(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,t)):n.nextTick(a,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e?(n.nextTick(o,r),e(t)):n.nextTick(o,r)})),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.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},45830:function(t,e,r){"use strict";var n=r(27109).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"===typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i0,(function(t){f||(f=t),t&&h.forEach(u),o||(h.forEach(u),l(f))}))}));return e.reduce(c)}},94072:function(t,e,r){"use strict";var n=r(27109).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},86872:function(t,e,r){t.exports=r(47465).EventEmitter},4704:function(t,e,r){(e=t.exports=r(49059)).Stream=e,e.Readable=e,e.Writable=r(62354),e.Duplex=r(23771),e.Transform=r(37454),e.PassThrough=r(82344),e.finished=r(45830),e.pipeline=r(55202)},66315:function(t,e,r){var n=r(12307);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},33325:function(t,e,r){"use strict";var n=r(19778).Buffer,i=t.exports;i.version="v"+r(53723).i8,i.versionGuard=function(t){if(void 0!==t){console.warn("\n More than one instance of bsv found.\n Please make sure to require bsv and check that submodules do\n not also include their own bsv dependency.")}},i.versionGuard(r.g._bsv),r.g._bsv=i.version,i.crypto={},i.crypto.BN=r(81016),i.crypto.ECDSA=r(58909),i.crypto.Hash=r(15935),i.crypto.Random=r(12396),i.crypto.Point=r(4067),i.crypto.Signature=r(34108),i.encoding={},i.encoding.Base58=r(36615),i.encoding.Base58Check=r(38856),i.encoding.BufferReader=r(84958),i.encoding.BufferWriter=r(74690),i.encoding.Varint=r(10129),i.util={},i.util.js=r(53604),i.util.preconditions=r(99281),i.errors=r(67690),i.Address=r(81386),i.Block=r(45132),i.MerkleBlock=r(89713),i.BlockHeader=r(95266),i.HDPrivateKey=r(98299),i.HDPublicKey=r(81415),i.Networks=r(47192),i.Opcode=r(3464),i.PrivateKey=r(52539),i.PublicKey=r(29730),i.Script=r(66154),i.Transaction=r(75277),i.deps={},i.deps.bnjs=r(41264),i.deps.bs58=r(66315),i.deps.Buffer=n,i.deps.elliptic=r(6289),i.deps._=r(61504),i.Transaction.sighash=r(41132)},81386:function(t,e,r){"use strict";var n=r(19778).Buffer,i=r(61504),o=r(99281),a=r(67690),s=r(38856),u=r(47192),c=r(15935),f=r(53604),l=r(29730);function h(t,e,r){if(!(this instanceof h))return new h(t,e,r);if(i.isArray(t)&&i.isNumber(e))return h.createMultisig(t,e,r);if(t instanceof h)return t;if(o.checkArgument(t,"First argument is required, please include address data.","guide/address.html"),e&&!u.get(e))throw new TypeError('Second argument must be "livenet", "testnet", or "regtest".');if(r&&r!==h.PayToPublicKeyHash&&r!==h.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var n=this._classifyArguments(t,e,r);return n.network=n.network||u.get(e)||u.defaultNetwork,n.type=n.type||r||h.PayToPublicKeyHash,f.defineImmutable(this,{hashBuffer:n.hashBuffer,network:n.network,type:n.type}),this}h.prototype._classifyArguments=function(t,e,o){var a=r(66154);if((t instanceof n||t instanceof Uint8Array)&&20===t.length)return h._transformHash(t);if((t instanceof n||t instanceof Uint8Array)&&21===t.length)return h._transformBuffer(t,e,o);if(t instanceof l)return h._transformPublicKey(t);if(t instanceof a)return h._transformScript(t,e);if("string"===typeof t)return h._transformString(t,e,o);if(i.isObject(t))return h._transformObject(t);throw new TypeError("First argument is an unrecognized data format.")},h.PayToPublicKeyHash="pubkeyhash",h.PayToScriptHash="scripthash",h._transformHash=function(t){var e={};if(!(t instanceof n)&&!(t instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==t.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return e.hashBuffer=t,e},h._transformObject=function(t){return o.checkArgument(t.hash||t.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),o.checkArgument(t.type,"Must provide a `type` property"),{hashBuffer:t.hash?n.from(t.hash,"hex"):t.hashBuffer,network:u.get(t.network)||u.defaultNetwork,type:t.type}},h._classifyFromVersion=function(t){var e={},r=u.get(t[0],"pubkeyhash"),n=u.get(t[0],"scripthash");return r?(e.network=r,e.type=h.PayToPublicKeyHash):n&&(e.network=n,e.type=h.PayToScriptHash),e},h._transformBuffer=function(t,e,r){var i={};if(!(t instanceof n)&&!(t instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==t.length)throw new TypeError("Address buffers must be exactly 21 bytes.");var o=u.get(e),a=h._classifyFromVersion(t);if(e&&!o)throw new TypeError("Unknown network");if(!a.network||o&&o!==a.network)throw new TypeError("Address has mismatched network type.");if(!a.type||r&&r!==a.type)throw new TypeError("Address has mismatched type.");return i.hashBuffer=t.slice(1),i.network=a.network,i.type=a.type,i},h._transformPublicKey=function(t){var e={};if(!(t instanceof l))throw new TypeError("Address must be an instance of PublicKey.");return e.hashBuffer=c.sha256ripemd160(t.toBuffer()),e.type=h.PayToPublicKeyHash,e},h._transformScript=function(t,e){var n=r(66154);o.checkArgument(t instanceof n,"script must be a Script instance");var i=t.getAddressInfo(e);if(!i)throw new a.Script.CantDeriveAddress(t);return i},h.createMultisig=function(t,e,n){var i=r(66154);return n=n||t[0].network||u.defaultNetwork,h.payingTo(i.buildMultisigOut(t,e),n)},h._transformString=function(t,e,r){if("string"!==typeof t)throw new TypeError("data parameter supplied is not a string.");if(t.length<27)throw new Error("Invalid Address string provided");t=t.trim();var n=u.get(e);if(e&&!n)throw new TypeError("Unknown network");var i=s.decode(t);return h._transformBuffer(i,e,r)},h.fromPublicKey=function(t,e){var r=h._transformPublicKey(t);return e=e||u.defaultNetwork,new h(r.hashBuffer,e,r.type)},h.fromPrivateKey=function(t,e){var r=l.fromPrivateKey(t);return e=e||t.network||u.defaultNetwork,h.fromPublicKey(r,e)},h.fromPublicKeyHash=function(t,e){var r=h._transformHash(t);return new h(r.hashBuffer,e,h.PayToPublicKeyHash)},h.fromScriptHash=function(t,e){o.checkArgument(t,"hash parameter is required");var r=h._transformHash(t);return new h(r.hashBuffer,e,h.PayToScriptHash)},h.payingTo=function(t,e){var n=r(66154);return o.checkArgument(t,"script is required"),o.checkArgument(t instanceof n,"script must be instance of Script"),h.fromScriptHash(c.sha256ripemd160(t.toBuffer()),e)},h.fromScript=function(t,e){var n=r(66154);o.checkArgument(t instanceof n,"script must be a Script instance");var i=h._transformScript(t,e);return new h(i.hashBuffer,e,i.type)},h.fromBuffer=function(t,e,r){var n=h._transformBuffer(t,e,r);return new h(n.hashBuffer,n.network,n.type)},h.fromHex=function(t,e,r){return h.fromBuffer(n.from(t,"hex"),e,r)},h.fromString=function(t,e,r){var n=h._transformString(t,e,r);return new h(n.hashBuffer,n.network,n.type)},h.fromObject=function(t){return o.checkState(f.isHexa(t.hash),'Unexpected hash property, "'+t.hash+'", expected to be hex.'),new h(n.from(t.hash,"hex"),t.network,t.type)},h.getValidationError=function(t,e,r){var n;try{new h(t,e,r)}catch(i){n=i}return n},h.isValid=function(t,e,r){return!h.getValidationError(t,e,r)},h.prototype.isPayToPublicKeyHash=function(){return this.type===h.PayToPublicKeyHash},h.prototype.isPayToScriptHash=function(){return this.type===h.PayToScriptHash},h.prototype.toBuffer=function(){var t=n.from([this.network[this.type]]);return n.concat([t,this.hashBuffer])},h.prototype.toHex=function(){return this.toBuffer().toString("hex")},h.prototype.toObject=h.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},h.prototype.inspect=function(){return""},h.prototype.toString=function(){return s.encode(this.toBuffer())},t.exports=h;r(66154)},25304:function(t,e,r){"use strict";var n=r(19778).Buffer,i=r(61504),o=r(95266),a=r(81016),s=r(84958),u=r(74690),c=r(15935),f=r(75277),l=r(99281);function h(t){return this instanceof h?(i.extend(this,h._from(t)),this):new h(t)}h.MAX_BLOCK_SIZE=128e6,h._from=function(t){var e={};if(n.isBuffer(t))e=h._fromBufferReader(s(t));else{if(!i.isObject(t))throw new TypeError("Unrecognized argument for Block");e=h._fromObject(t)}return e},h._fromObject=function(t){var e=[];return t.transactions.forEach((function(t){t instanceof f?e.push(t):e.push(f().fromObject(t))})),{header:o.fromObject(t.header),transactions:e}},h.fromObject=function(t){var e=h._fromObject(t);return new h(e)},h._fromBufferReader=function(t){var e={};l.checkState(!t.finished(),"No block data received"),e.header=o.fromBufferReader(t);var r=t.readVarintNum();e.transactions=[];for(var n=0;n1;r=Math.floor((r+1)/2)){for(var i=0;i"},h.Values={START_OF_BLOCK:8,NULL_HASH:n.from("0000000000000000000000000000000000000000000000000000000000000000","hex")},t.exports=h},95266:function(t,e,r){"use strict";var n=r(19778).Buffer,i=r(61504),o=r(81016),a=r(84958),s=r(74690),u=r(15935),c=r(99281),f=function t(e){if(!(this instanceof t))return new t(e);var r=t._from(e);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};f._from=function(t){var e={};if(n.isBuffer(t))e=f._fromBufferReader(a(t));else{if(!i.isObject(t))throw new TypeError("Unrecognized argument for BlockHeader");e=f._fromObject(t)}return e},f._fromObject=function(t){c.checkArgument(t,"data is required");var e=t.prevHash,r=t.merkleRoot;return i.isString(t.prevHash)&&(e=n.from(t.prevHash,"hex").reverse()),i.isString(t.merkleRoot)&&(r=n.from(t.merkleRoot,"hex").reverse()),{hash:t.hash,version:t.version,prevHash:e,merkleRoot:r,time:t.time,timestamp:t.time,bits:t.bits,nonce:t.nonce}},f.fromObject=function(t){var e=f._fromObject(t);return new f(e)},f.fromRawBlock=function(t){n.isBuffer(t)||(t=n.from(t,"binary"));var e=a(t);e.pos=f.Constants.START_OF_HEADER;var r=f._fromBufferReader(e);return new f(r)},f.fromBuffer=function(t){var e=f._fromBufferReader(a(t));return new f(e)},f.fromString=function(t){var e=n.from(t,"hex");return f.fromBuffer(e)},f._fromBufferReader=function(t){var e={};return e.version=t.readInt32LE(),e.prevHash=t.read(32),e.merkleRoot=t.read(32),e.time=t.readUInt32LE(),e.bits=t.readUInt32LE(),e.nonce=t.readUInt32LE(),e},f.fromBufferReader=function(t){var e=f._fromBufferReader(t);return new f(e)},f.prototype.toObject=f.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:n.from(this.prevHash).reverse().toString("hex"),merkleRoot:n.from(this.merkleRoot).reverse().toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},f.prototype.toBuffer=function(){return this.toBufferWriter().concat()},f.prototype.toString=function(){return this.toBuffer().toString("hex")},f.prototype.toBufferWriter=function(t){return t||(t=new s),t.writeInt32LE(this.version),t.write(this.prevHash),t.write(this.merkleRoot),t.writeUInt32LE(this.time),t.writeUInt32LE(this.bits),t.writeUInt32LE(this.nonce),t},f.prototype.getTargetDifficulty=function(t){t=t||this.bits;for(var e=new o(16777215&t),r=8*((t>>>24)-3);r-- >0;)e=e.mul(new o(2));return e},f.prototype.getDifficulty=function(){var t=this.getTargetDifficulty(486604799).mul(new o(Math.pow(10,8))),e=this.getTargetDifficulty(),r=t.div(e).toString(10),n=r.length-8;return r=r.slice(0,n)+"."+r.slice(n),parseFloat(r)},f.prototype._getHash=function(){var t=this.toBuffer();return u.sha256sha256(t)};var l={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=a(this._getHash()).readReverse().toString("hex")),this._id},set:i.noop};Object.defineProperty(f.prototype,"id",l),Object.defineProperty(f.prototype,"hash",l),f.prototype.validTimestamp=function(){var t=Math.round((new Date).getTime()/1e3);return!(this.time>t+f.Constants.MAX_TIME_OFFSET)},f.prototype.validProofOfWork=function(){var t=new o(this.id,"hex"),e=this.getTargetDifficulty();return!(t.cmp(e)>0)},f.prototype.inspect=function(){return""},f.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new o("10000000000000000000000000000000000000000000000000000000000000000","hex")},t.exports=f},45132:function(t,e,r){t.exports=r(25304),t.exports.BlockHeader=r(95266),t.exports.MerkleBlock=r(89713)},89713:function(t,e,r){"use strict";var n=r(19778).Buffer,i=r(61504),o=r(95266),a=r(84958),s=r(74690),u=r(15935),c=r(75277),f=r(67690),l=r(99281);function h(t){if(!(this instanceof h))return new h(t);var e={};if(n.isBuffer(t))e=h._fromBufferReader(a(t));else{if(!i.isObject(t))throw new TypeError("Unrecognized argument for MerkleBlock");e={header:t.header instanceof o?t.header:o.fromObject(t.header),numTransactions:t.numTransactions,hashes:t.hashes,flags:t.flags}}return i.extend(this,e),this._flagBitsUsed=0,this._hashesUsed=0,this}h.fromBuffer=function(t){return h.fromBufferReader(a(t))},h.fromBufferReader=function(t){return new h(h._fromBufferReader(t))},h.prototype.toBuffer=function(){return this.toBufferWriter().concat()},h.prototype.toBufferWriter=function(t){t||(t=new s),t.write(this.header.toBuffer()),t.writeUInt32LE(this.numTransactions),t.writeVarintNum(this.hashes.length);for(var e=0;ethis.numTransactions)return!1;if(8*this.flags.lengththis.numTransactions)throw new f.MerkleBlock.InvalidMerkleTree;if(8*this.flags.length8*this.flags.length)return null;var o=this.flags[r.flagBitsUsed>>3]>>>(7&r.flagBitsUsed++)&1;if(0!==t&&o){var a=this._traverseMerkleTree(t-1,2*e,r),s=a;return 2*e+1=this.hashes.length)return null;var c=this.hashes[r.hashesUsed++];return 0===t&&o&&r.txs.push(c),n.from(c,"hex")},h.prototype._calcTreeWidth=function(t){return this.numTransactions+(1<>t},h.prototype._calcTreeHeight=function(){for(var t=0;this._calcTreeWidth(t)>1;)t++;return t},h.prototype.hasTransaction=function(t){l.checkArgument(!i.isUndefined(t),"tx cannot be undefined"),l.checkArgument(t instanceof c||"string"===typeof t,'Invalid tx given, tx must be a "string" or "Transaction"');var e=t;t instanceof c&&(e=n.from(t.id,"hex").reverse().toString("hex"));var r=[],o=this._calcTreeHeight();return this._traverseMerkleTree(o,0,{txs:r}),-1!==r.indexOf(e)},h._fromBufferReader=function(t){l.checkState(!t.finished(),"No merkleblock data received");var e={};e.header=o.fromBufferReader(t),e.numTransactions=t.readUInt32LE();var r=t.readVarintNum();e.hashes=[];for(var n=0;n=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?c[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,c=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],M=8191&S,k=S>>>13,x=0|a[5],E=8191&x,A=x>>>13,O=0|a[6],T=8191&O,P=O>>>13,I=0|a[7],R=8191&I,C=I>>>13,N=0|a[8],B=8191&N,j=N>>>13,L=0|a[9],D=8191&L,U=L>>>13,F=0|s[0],H=8191&F,z=F>>>13,K=0|s[1],q=8191&K,V=K>>>13,G=0|s[2],W=8191&G,Y=G>>>13,$=0|s[3],Z=8191&$,X=$>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ft=0|s[8],lt=8191&ft,ht=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(l,H))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,H)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,z))+Math.imul(m,H)|0,o=Math.imul(m,z);var vt=(c+(n=n+Math.imul(l,q)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(h,q)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,H),i=(i=Math.imul(v,z))+Math.imul(y,H)|0,o=Math.imul(y,z),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,V)|0;var yt=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(h,W)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,H),i=(i=Math.imul(w,z))+Math.imul(_,H)|0,o=Math.imul(_,z),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Y)|0;var bt=(c+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(h,Z)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,H),i=(i=Math.imul(M,z))+Math.imul(k,H)|0,o=Math.imul(k,z),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,H),i=(i=Math.imul(E,z))+Math.imul(A,H)|0,o=Math.imul(A,z),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,H),i=(i=Math.imul(T,z))+Math.imul(P,H)|0,o=Math.imul(P,z),n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var St=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(R,H),i=(i=Math.imul(R,z))+Math.imul(C,H)|0,o=Math.imul(C,z),n=n+Math.imul(T,q)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,z))+Math.imul(j,H)|0,o=Math.imul(j,z),n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,z))+Math.imul(U,H)|0,o=Math.imul(U,z),n=n+Math.imul(B,q)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var xt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(U,q)|0,o=Math.imul(U,V),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var Et=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var At=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,X))+Math.imul(U,Z)|0,o=Math.imul(U,X),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var Ot=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ht)|0;var Tt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,at))+Math.imul(U,ot)|0,o=Math.imul(U,at),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ct)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var It=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ct))+Math.imul(U,ut)|0,o=Math.imul(U,ct),n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ht)|0;var Rt=(c+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(D,lt),i=(i=Math.imul(D,ht))+Math.imul(U,lt)|0,o=Math.imul(U,ht);var Ct=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Nt=(c+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return c=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=vt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Mt,u[8]=kt,u[9]=xt,u[10]=Et,u[11]=At,u[12]=Ot,u[13]=Tt,u[14]=Pt,u[15]=It,u[16]=Rt,u[17]=Ct,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=h),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?d(this,t,e):n<63?h(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e),r},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var h=0,d=1;0===(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0===(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(y,v),y.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},i(M,S),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},81016:function(t,e,r){"use strict";var n=r(19778).Buffer,i=r(94519),o=r(99281),a=r(61504),s=function(t){for(var e=n.alloc(t.length),r=0;rt.size?e=i.trim(e,o):o0&&0===(127&t[t.length-1])&&(t.length<=1||0===(128&t[t.length-2])))throw new Error("non-minimally encoded script number");return i.fromSM(t,{endian:"little"})},i.prototype.toScriptNumBuffer=function(){return this.toSM({endian:"little"})},i.trim=function(t,e){return t.slice(e-t.length,t.length)},i.pad=function(t,e,r){for(var i=n.alloc(r),o=0;o1?e-1:0),o=1;o>1,c=o.getN(),f=o.getG(),h=u?r.add(c):r,d=o.fromX(a,h);if(!d.mul(c).isInfinity())throw new Error("nR is not a valid curve point");var p=e.neg().umod(c),m=r.invm(c),g=d.mul(n).add(f.mul(p)).mul(m);return s.fromPoint(g,this.sig.compressed)},h.prototype.sigError=function(){if(!n.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var t=this.sig.r,e=this.sig.s;if(!t.gt(i.Zero)||!t.lt(o.getN())||!e.gt(i.Zero)||!e.lt(o.getN()))return"r and s not in range";var r=i.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),a=o.getN(),s=e.invm(a),u=s.mul(r).umod(a),c=s.mul(t).umod(a),f=o.getG().mulAdd(u,this.pubkey.point,c);return f.isInfinity()?"p is infinity":0!==f.getX().umod(a).cmp(t)&&"Invalid signature"},h.toLowS=function(t){return t.gt(i.fromBuffer(n.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(t=o.getN().sub(t)),t},h.prototype._findSignature=function(t,e){var r,n,a,s,u=o.getN(),c=o.getG(),f=0;do{(!this.k||f>0)&&this.deterministicK(f),f++,r=this.k,n=c.mul(r),a=new i(1).mul(n.x.umod(u)),s=r.invm(u).mul(e.add(t.mul(a))).umod(u)}while(a.cmp(i.Zero)<=0||s.cmp(i.Zero)<=0);return{s:s=h.toLowS(s),r:a}},h.prototype.sign=function(){var t=this.hashbuf,e=this.privkey,r=e.bn;l.checkState(t&&e&&r,new Error("invalid parameters")),l.checkState(n.isBuffer(t)&&32===t.length,new Error("hashbuf must be a 32 byte buffer"));var o=i.fromBuffer(t,this.endian?{endian:this.endian}:void 0),s=this._findSignature(r,o);return s.compressed=this.pubkey.compressed,this.sig=new a(s),this},h.prototype.signRandomK=function(){return this.randomK(),this.sign()},h.prototype.toString=function(){var t={};return this.hashbuf&&(t.hashbuf=this.hashbuf.toString("hex")),this.privkey&&(t.privkey=this.privkey.toString()),this.pubkey&&(t.pubkey=this.pubkey.toString()),this.sig&&(t.sig=this.sig.toString()),this.k&&(t.k=this.k.toString()),JSON.stringify(t)},h.prototype.verify=function(){return this.sigError()?this.verified=!1:this.verified=!0,this},h.sign=function(t,e,r){return h().set({hashbuf:t,endian:r,privkey:e}).sign().sig},h.signWithCalcI=function(t,e,r){return h().set({hashbuf:t,endian:r,privkey:e}).sign().calci().sig},h.signRandomK=function(t,e,r){return h().set({hashbuf:t,endian:r,privkey:e}).signRandomK().sig},h.verify=function(t,e,r,n){return h().set({hashbuf:t,endian:n,sig:e,pubkey:r}).verify().verified},t.exports=h},5979:function(t,e,r){"use strict";var n=r(19778).Buffer,i=r(33125),o=r(99281),a=t.exports;a.sha1=function(t){return o.checkArgument(n.isBuffer(t)),n.from(i.sha1().update(t).digest("hex"),"hex")},a.sha1.blocksize=512,a.sha256=function(t){return o.checkArgument(n.isBuffer(t)),n.from(i.sha256().update(t).digest("hex"),"hex")},a.sha256.blocksize=512,a.sha256sha256=function(t){return o.checkArgument(n.isBuffer(t)),a.sha256(a.sha256(t))},a.ripemd160=function(t){return o.checkArgument(n.isBuffer(t)),n.from(i.ripemd160().update(t).digest("hex"),"hex")},a.sha256ripemd160=function(t){return o.checkArgument(n.isBuffer(t)),a.ripemd160(a.sha256(t))},a.sha512=function(t){return o.checkArgument(n.isBuffer(t)),n.from(i.sha512().update(t).digest("hex"),"hex")},a.sha512.blocksize=1024,a.hmac=function(t,e,r){o.checkArgument(n.isBuffer(e)),o.checkArgument(n.isBuffer(r)),o.checkArgument(t.blocksize);var i=t.blocksize/8;if(r.length>i)r=t(r);else if(ri)r=t(r);else if(r73)return!1;if(48!==t[0])return!1;if(t[1]!==t.length-3)return!1;var e=t[3];if(5+e>=t.length)return!1;var r=t[5+e];if(e+r+7!==t.length)return!1;var n=t.slice(4);if(2!==t[2])return!1;if(0===e)return!1;if(128&n[0])return!1;if(e>1&&0===n[0]&&!(128&n[1]))return!1;var i=t.slice(6+e);return 2===t[6+e-2]&&(0!==r&&(!(128&i[0])&&!(r>1&&0===i[0]&&!(128&i[1]))))},u.prototype.hasLowS=function(){return!this.s.lt(new i(1))&&!this.s.gt(new i("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex"))},u.prototype.hasDefinedHashtype=function(){if(!s.isNaturalNumber(this.nhashtype))return!1;var t=31&this.nhashtype;return!(tu.SIGHASH_SINGLE)},u.prototype.toTxFormat=function(){var t=this.toDER(),e=n.alloc(1);return e.writeUInt8(this.nhashtype,0),n.concat([t,e])},u.SIGHASH_ALL=1,u.SIGHASH_NONE=2,u.SIGHASH_SINGLE=3,u.SIGHASH_FORKID=64,u.SIGHASH_ANYONECANPAY=128,u.ALL=65,u.NONE=66,u.SINGLE=67,u.ANYONECANPAY_ALL=193,u.ANYONECANPAY_NONE=194,u.ANYONECANPAY_SINGLE=195,t.exports=u},36615:function(t,e,r){"use strict";var n=r(19778).Buffer,i=r(61504),o=r(66315),a=r(19778),s="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split(""),u=function t(e){if(!(this instanceof t))return new t(e);if(n.isBuffer(e)){var r=e;this.fromBuffer(r)}else if("string"===typeof e){var i=e;this.fromString(i)}};u.validCharacters=function(t){return a.Buffer.isBuffer(t)&&(t=t.toString()),i.every(i.map(t,(function(t){return i.includes(s,t)})))},u.prototype.set=function(t){return this.buf=t.buf||this.buf||void 0,this},u.encode=function(t){if(!a.Buffer.isBuffer(t))throw new Error("Input should be a buffer");return o.encode(t)},u.decode=function(t){if("string"!==typeof t)throw new Error("Input should be a string");return n.from(o.decode(t))},u.prototype.fromBuffer=function(t){return this.buf=t,this},u.fromBuffer=function(t){return(new u).fromBuffer(t)},u.fromHex=function(t){return u.fromBuffer(n.from(t,"hex"))},u.prototype.fromString=function(t){var e=u.decode(t);return this.buf=e,this},u.fromString=function(t){return(new u).fromString(t)},u.prototype.toBuffer=function(){return this.buf},u.prototype.toHex=function(){return this.toBuffer().toString("hex")},u.prototype.toString=function(){return u.encode(this.buf)},t.exports=u},38856:function(t,e,r){"use strict";var n=r(19778).Buffer,i=r(61504),o=r(36615),a=r(19778),s=r(15935).sha256sha256,u=function t(e){if(!(this instanceof t))return new t(e);if(n.isBuffer(e)){var r=e;this.fromBuffer(r)}else if("string"===typeof e){var i=e;this.fromString(i)}};u.prototype.set=function(t){return this.buf=t.buf||this.buf||void 0,this},u.validChecksum=function(t,e){return i.isString(t)&&(t=a.Buffer.from(o.decode(t))),i.isString(e)&&(e=a.Buffer.from(o.decode(e))),e||(e=t.slice(-4),t=t.slice(0,-4)),u.checksum(t).toString("hex")===e.toString("hex")},u.decode=function(t){if("string"!==typeof t)throw new Error("Input must be a string");var e=n.from(o.decode(t));if(e.length<4)throw new Error("Input string too short");var r=e.slice(0,-4),i=e.slice(-4),a=s(r).slice(0,4);if(i.toString("hex")!==a.toString("hex"))throw new Error("Checksum mismatch");return r},u.checksum=function(t){return s(t).slice(0,4)},u.encode=function(t){if(!n.isBuffer(t))throw new Error("Input must be a buffer");var e=n.alloc(t.length+4),r=u.checksum(t);return t.copy(e),r.copy(e,t.length),o.encode(e)},u.prototype.fromBuffer=function(t){return this.buf=t,this},u.fromBuffer=function(t){return(new u).fromBuffer(t)},u.fromHex=function(t){return u.fromBuffer(n.from(t,"hex"))},u.prototype.fromString=function(t){var e=u.decode(t);return this.buf=e,this},u.fromString=function(t){var e=u.decode(t);return new o(e)},u.prototype.toBuffer=function(){return this.buf},u.prototype.toHex=function(){return this.toBuffer().toString("hex")},u.prototype.toString=function(){return u.encode(this.buf)},t.exports=u},84958:function(t,e,r){"use strict";var n=r(19778).Buffer,i=r(61504),o=r(99281),a=r(81016),s=function t(e){if(!(this instanceof t))return new t(e);if(!i.isUndefined(e))if(n.isBuffer(e))this.set({buf:e});else if(i.isString(e)){var r=n.from(e,"hex");if(2*r.length!==e.length)throw new TypeError("Invalid hex string");this.set({buf:r})}else{if(!i.isObject(e))throw new TypeError("Unrecognized argument for BufferReader");var o=e;this.set(o)}};s.prototype.set=function(t){return this.buf=t.buf||this.buf||void 0,this.pos=t.pos||this.pos||0,this},s.prototype.eof=function(){return this.pos>=this.buf.length},s.prototype.finished=s.prototype.eof,s.prototype.read=function(t){o.checkArgument(!i.isUndefined(t),"Must specify a length");var e=this.buf.slice(this.pos,this.pos+t);return this.pos=this.pos+t,e},s.prototype.readAll=function(){var t=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,t},s.prototype.readUInt8=function(){var t=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,t},s.prototype.readUInt16BE=function(){var t=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,t},s.prototype.readUInt16LE=function(){var t=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,t},s.prototype.readUInt32BE=function(){var t=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,t},s.prototype.readUInt32LE=function(){var t=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,t},s.prototype.readInt32LE=function(){var t=this.buf.readInt32LE(this.pos);return this.pos=this.pos+4,t},s.prototype.readUInt64BEBN=function(){var t=this.buf.slice(this.pos,this.pos+8),e=a.fromBuffer(t);return this.pos=this.pos+8,e},s.prototype.readUInt64LEBN=function(){var t,e=this.buf.readUInt32LE(this.pos),r=4294967296*this.buf.readUInt32LE(this.pos+4)+e;if(r<=9007199254740991)t=new a(r);else{var n=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);t=new a(n,10,"le")}return this.pos=this.pos+8,t},s.prototype.readVarintNum=function(){var t=this.readUInt8();switch(t){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var e=this.readUInt64LEBN().toNumber();if(e<=Math.pow(2,53))return e;throw new Error("number too large to retain precision - use readVarintBN");default:return t}},s.prototype.readVarLengthBuffer=function(){var t=this.readVarintNum(),e=this.read(t);return o.checkState(e.length===t,"Invalid length while reading varlength buffer. Expected to read: "+t+" and read "+e.length),e},s.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)}},s.prototype.readVarintBN=function(){var t=this.readUInt8();switch(t){case 253:return new a(this.readUInt16LE());case 254:return new a(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new a(t)}},s.prototype.reverse=function(){for(var t=n.alloc(this.buf.length),e=0;e=0&&t=b.Hardened||e,t64)throw new v.InvalidEntropyArgument.TooMuchEntropy(t);var r=l.sha512hmac(t,o.Buffer.from("Bitcoin seed"));return new b({network:h.get(e)||h.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:r.slice(0,32),chainCode:r.slice(32,64)})},b.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var t=r(81415);this._hdPublicKey=new t(this)}},b.prototype._buildFromBuffers=function(t){b._validateBufferArguments(t),y.defineImmutable(this,{_buffers:t});var e=[t.version,t.depth,t.parentFingerPrint,t.childIndex,t.chainCode,n.alloc(1),t.privateKey],r=o.Buffer.concat(e);if(t.checksum&&t.checksum.length){if(t.checksum.toString()!==f.checksum(r).toString())throw new g.InvalidB58Checksum(r)}else t.checksum=f.checksum(r);var i,a=h.get(t.version.readUInt32BE(0));i=f.encode(o.Buffer.concat(e)),t.xprivkey=n.from(i);var s=new p(u.fromBuffer(t.privateKey),a),c=s.toPublicKey(),d=b.ParentFingerPrintSize,m=l.sha256ripemd160(c.toBuffer()).slice(0,d);return y.defineImmutable(this,{xprivkey:i,network:a,depth:t.depth[0],privateKey:s,publicKey:c,fingerPrint:m}),this._hdPublicKey=null,Object.defineProperty(this,"hdPublicKey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey}}),Object.defineProperty(this,"xpubkey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey.xpubkey}}),this},b._validateBufferArguments=function(t){var e=function(e,r){var o=t[e];i(n.isBuffer(o),e+" argument is not a buffer"),i(o.length===r,e+" has not the expected size: found "+o.length+", expected "+r)};e("version",b.VersionSize),e("depth",b.DepthSize),e("parentFingerPrint",b.ParentFingerPrintSize),e("childIndex",b.ChildIndexSize),e("chainCode",b.ChainCodeSize),e("privateKey",b.PrivateKeySize),t.checksum&&t.checksum.length&&e("checksum",b.CheckSumSize)},b.prototype.toString=function(){return this.xprivkey},b.prototype.inspect=function(){return""},b.prototype.toObject=b.prototype.toJSON=function(){return{network:h.get(this._buffers.version.readUInt32BE(0),"xprivkey").name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:this._buffers.checksum.readUInt32BE(0),xprivkey:this.xprivkey}},b.fromBuffer=function(t){return new b(t.toString())},b.fromHex=function(t){return b.fromBuffer(n.from(t,"hex"))},b.prototype.toBuffer=function(){return n.from(this.toString())},b.prototype.toHex=function(){return this.toBuffer().toString("hex")},b.DefaultDepth=0,b.DefaultFingerprint=0,b.DefaultChildIndex=0,b.Hardened=2147483648,b.MaxIndex=2*b.Hardened,b.RootElementAlias=["m","M","m'","M'"],b.VersionSize=4,b.DepthSize=1,b.ParentFingerPrintSize=4,b.ChildIndexSize=4,b.ChainCodeSize=32,b.PrivateKeySize=32,b.CheckSumSize=4,b.DataLength=78,b.SerializedByteSize=82,b.VersionStart=0,b.VersionEnd=b.VersionStart+b.VersionSize,b.DepthStart=b.VersionEnd,b.DepthEnd=b.DepthStart+b.DepthSize,b.ParentFingerPrintStart=b.DepthEnd,b.ParentFingerPrintEnd=b.ParentFingerPrintStart+b.ParentFingerPrintSize,b.ChildIndexStart=b.ParentFingerPrintEnd,b.ChildIndexEnd=b.ChildIndexStart+b.ChildIndexSize,b.ChainCodeStart=b.ChildIndexEnd,b.ChainCodeEnd=b.ChainCodeStart+b.ChainCodeSize,b.PrivateKeyStart=b.ChainCodeEnd+1,b.PrivateKeyEnd=b.PrivateKeyStart+b.PrivateKeySize,b.ChecksumStart=b.PrivateKeyEnd,b.ChecksumEnd=b.ChecksumStart+b.CheckSumSize,i(b.ChecksumEnd===b.SerializedByteSize),t.exports=b},81415:function(t,e,r){"use strict";var n=r(19778).Buffer,i=r(61504),o=r(99281),a=r(81016),s=r(36615),u=r(38856),c=r(15935),f=r(98299),l=r(47192),h=r(4067),d=r(29730),p=r(67690),m=p,g=p.HDPublicKey,v=r(88093),y=r(53604);function b(t){if(t instanceof b)return t;if(!(this instanceof b))return new b(t);if(t){if(i.isString(t)||n.isBuffer(t)){var e=b.getSerializedError(t);if(e){if(n.isBuffer(t)&&!b.getSerializedError(t.toString()))return this._buildFromSerialized(t.toString());if(e instanceof g.ArgumentIsPrivateExtended)return new f(t).hdPublicKey;throw e}return this._buildFromSerialized(t)}if(i.isObject(t))return t instanceof f?this._buildFromPrivate(t):this._buildFromObject(t);throw new g.UnrecognizedArgument(t)}throw new g.MustSupplyArgument}b.fromHDPrivateKey=function(t){return new b(t)},b.isValidPath=function(t){if(i.isString(t)){var e=f._getDerivationIndexes(t);return null!==e&&i.every(e,b.isValidPath)}return!!i.isNumber(t)&&(t>=0&&t=b.Hardened||e)throw new g.InvalidIndexCantDeriveHardened;if(t<0)throw new g.InvalidPath(t);var r,i=y.integerAsBuffer(t),o=n.concat([this.publicKey.toBuffer(),i]),s=c.sha512hmac(o,this._buffers.chainCode),u=a.fromBuffer(s.slice(0,32),{size:32}),f=s.slice(32,64);try{r=d.fromPoint(h.getG().mul(u).add(this.publicKey.point))}catch(l){return this._deriveWithNumber(t+1)}return new b({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:t,chainCode:f,publicKey:r})},b.prototype._deriveFromString=function(t){if(i.includes(t,"'"))throw new g.InvalidIndexCantDeriveHardened;if(!b.isValidPath(t))throw new g.InvalidPath(t);return f._getDerivationIndexes(t).reduce((function(t,e){return t._deriveWithNumber(e)}),this)},b.isValidSerialized=function(t,e){return i.isNull(b.getSerializedError(t,e))},b.getSerializedError=function(t,e){if(!i.isString(t)&&!n.isBuffer(t))return new g.UnrecognizedArgument("expected buffer or string");if(!s.validCharacters(t))return new m.InvalidB58Char("(unknown)",t);try{t=u.decode(t)}catch(a){return new m.InvalidB58Checksum(t)}if(t.length!==b.DataSize)return new g.InvalidLength(t);if(!i.isUndefined(e)){var r=b._validateNetwork(t,e);if(r)return r}var o=t.readUInt32BE(0);return o===l.livenet.xprivkey||o===l.testnet.xprivkey?new g.ArgumentIsPrivateExtended:null},b._validateNetwork=function(t,e){var r=l.get(e);if(!r)return new m.InvalidNetworkArgument(e);var n=t.slice(b.VersionStart,b.VersionEnd);return n.readUInt32BE(0)!==r.xpubkey?new m.InvalidNetwork(n):null},b.prototype._buildFromPrivate=function(t){var e=i.clone(t._buffers),r=h.getG().mul(a.fromBuffer(e.privateKey));return e.publicKey=h.pointToCompressed(r),e.version=y.integerAsBuffer(l.get(e.version.readUInt32BE(0)).xpubkey),e.privateKey=void 0,e.checksum=void 0,e.xprivkey=void 0,this._buildFromBuffers(e)},b.prototype._buildFromObject=function(t){var e={version:t.network?y.integerAsBuffer(l.get(t.network).xpubkey):t.version,depth:i.isNumber(t.depth)?n.from([255&t.depth]):t.depth,parentFingerPrint:i.isNumber(t.parentFingerPrint)?y.integerAsBuffer(t.parentFingerPrint):t.parentFingerPrint,childIndex:i.isNumber(t.childIndex)?y.integerAsBuffer(t.childIndex):t.childIndex,chainCode:i.isString(t.chainCode)?n.from(t.chainCode,"hex"):t.chainCode,publicKey:i.isString(t.publicKey)?n.from(t.publicKey,"hex"):n.isBuffer(t.publicKey)?t.publicKey:t.publicKey.toBuffer(),checksum:i.isNumber(t.checksum)?y.integerAsBuffer(t.checksum):t.checksum};return this._buildFromBuffers(e)},b.prototype._buildFromSerialized=function(t){var e=u.decode(t),r={version:e.slice(b.VersionStart,b.VersionEnd),depth:e.slice(b.DepthStart,b.DepthEnd),parentFingerPrint:e.slice(b.ParentFingerPrintStart,b.ParentFingerPrintEnd),childIndex:e.slice(b.ChildIndexStart,b.ChildIndexEnd),chainCode:e.slice(b.ChainCodeStart,b.ChainCodeEnd),publicKey:e.slice(b.PublicKeyStart,b.PublicKeyEnd),checksum:e.slice(b.ChecksumStart,b.ChecksumEnd),xpubkey:t};return this._buildFromBuffers(r)},b.prototype._buildFromBuffers=function(t){b._validateBufferArguments(t),y.defineImmutable(this,{_buffers:t});var e=[t.version,t.depth,t.parentFingerPrint,t.childIndex,t.chainCode,t.publicKey],r=n.concat(e),i=u.checksum(r);if(t.checksum&&t.checksum.length){if(t.checksum.toString("hex")!==i.toString("hex"))throw new m.InvalidB58Checksum(r,i)}else t.checksum=i;var o,a=l.get(t.version.readUInt32BE(0));o=u.encode(n.concat(e)),t.xpubkey=n.from(o);var s=new d(t.publicKey,{network:a}),f=b.ParentFingerPrintSize,h=c.sha256ripemd160(s.toBuffer()).slice(0,f);return y.defineImmutable(this,{xpubkey:o,network:a,depth:t.depth[0],publicKey:s,fingerPrint:h}),this},b._validateBufferArguments=function(t){var e=function(e,r){var i=t[e];v(n.isBuffer(i),e+" argument is not a buffer, it's "+typeof i),v(i.length===r,e+" has not the expected size: found "+i.length+", expected "+r)};e("version",b.VersionSize),e("depth",b.DepthSize),e("parentFingerPrint",b.ParentFingerPrintSize),e("childIndex",b.ChildIndexSize),e("chainCode",b.ChainCodeSize),e("publicKey",b.PublicKeySize),t.checksum&&t.checksum.length&&e("checksum",b.CheckSumSize)},b.fromString=function(t){return o.checkArgument(i.isString(t),"No valid string was provided"),new b(t)},b.fromObject=function(t){return o.checkArgument(i.isObject(t),"No valid argument was provided"),new b(t)},b.prototype.toString=function(){return this.xpubkey},b.prototype.inspect=function(){return""},b.prototype.toObject=b.prototype.toJSON=function(){return{network:l.get(this._buffers.version.readUInt32BE(0)).name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),publicKey:this.publicKey.toString(),checksum:this._buffers.checksum.readUInt32BE(0),xpubkey:this.xpubkey}},b.fromBuffer=function(t){return new b(t)},b.fromHex=function(t){return b.fromBuffer(n.from(t,"hex"))},b.prototype.toBuffer=function(){return n.from(this._buffers.xpubkey)},b.prototype.toHex=function(){return this.toBuffer().toString("hex")},b.Hardened=2147483648,b.RootElementAlias=["m","M"],b.VersionSize=4,b.DepthSize=1,b.ParentFingerPrintSize=4,b.ChildIndexSize=4,b.ChainCodeSize=32,b.PublicKeySize=33,b.CheckSumSize=4,b.DataSize=78,b.SerializedByteSize=82,b.VersionStart=0,b.VersionEnd=b.VersionStart+b.VersionSize,b.DepthStart=b.VersionEnd,b.DepthEnd=b.DepthStart+b.DepthSize,b.ParentFingerPrintStart=b.DepthEnd,b.ParentFingerPrintEnd=b.ParentFingerPrintStart+b.ParentFingerPrintSize,b.ChildIndexStart=b.ParentFingerPrintEnd,b.ChildIndexEnd=b.ChildIndexStart+b.ChildIndexSize,b.ChainCodeStart=b.ChildIndexEnd,b.ChainCodeEnd=b.ChainCodeStart+b.ChainCodeSize,b.PublicKeyStart=b.ChainCodeEnd,b.PublicKeyEnd=b.PublicKeyStart+b.PublicKeySize,b.ChecksumStart=b.PublicKeyEnd,b.ChecksumEnd=b.ChecksumStart+b.CheckSumSize,v(b.PublicKeyEnd===b.DataSize),v(b.ChecksumEnd===b.SerializedByteSize),t.exports=b},47192:function(t,e,r){"use strict";var n=r(61504),i=r(53604),o=[],a={};function s(){}function u(t,e){if(~o.indexOf(t))return t;if(!e)return a[t];n.isArray(e)||(e=[e]);for(var r=0;r=0&&t<=16,"Invalid Argument: n must be between 0 and 16"),0===t?s("OP_0"):new s(s.map.OP_1+t-1)},s.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SPLIT:127,OP_NUM2BIN:128,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_CHECKLOCKTIMEVERIFY:177,OP_CHECKSEQUENCEVERIFY:178,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,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255},s.reverseMap=[],s.map)s.reverseMap[s.map[u]]=u;i.extend(s,s.map),s.isSmallIntOp=function(t){return t instanceof s&&(t=t.toNumber()),t===s.map.OP_0||t>=s.map.OP_1&&t<=s.map.OP_16},s.prototype.inspect=function(){return""},t.exports=s},52539:function(t,e,r){"use strict";var n=r(19778).Buffer,i=r(61504),o=r(81386),a=r(38856),s=r(81016),u=r(53604),c=r(47192),f=r(4067),l=r(29730),h=r(12396),d=r(99281);function p(t,e){if(!(this instanceof p))return new p(t,e);if(t instanceof p)return t;var r=this._classifyArguments(t,e);if(!r.bn||0===r.bn.cmp(new s(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(f.getN()))throw new TypeError("Number must be less than N");if("undefined"===typeof r.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return u.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(t,e){var r={compressed:!0,network:e?c.get(e):c.defaultNetwork};if(i.isUndefined(t)||i.isNull(t))r.bn=p._getRandomBN();else if(t instanceof s)r.bn=t;else if(t instanceof n||t instanceof Uint8Array)r=p._transformBuffer(t,e);else if(t.bn&&t.network)r=p._transformObject(t);else if(!e&&c.get(t))r.bn=p._getRandomBN(),r.network=c.get(t);else{if("string"!==typeof t)throw new TypeError("First argument is an unrecognized data type.");u.isHexa(t)?r.bn=new s(n.from(t,"hex")):r=p._transformWIF(t,e)}return r},p._getRandomBN=function(){var t,e;do{var r=h.getRandomBuffer(32);t=(e=s.fromBuffer(r)).lt(f.getN())}while(!t);return e},p._transformBuffer=function(t,e){var r={};if(32===t.length)return p._transformBNBuffer(t,e);if(r.network=c.get(t[0],"privatekey"),!r.network)throw new Error("Invalid network");if(e&&r.network!==c.get(e))throw new TypeError("Private key network mismatch");if(34===t.length&&1===t[33])r.compressed=!0;else{if(33!==t.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");r.compressed=!1}return r.bn=s.fromBuffer(t.slice(1,33)),r},p._transformBNBuffer=function(t,e){var r={};return r.network=c.get(e)||c.defaultNetwork,r.bn=s.fromBuffer(t),r.compressed=!1,r},p._transformWIF=function(t,e){return p._transformBuffer(a.decode(t),e)},p.fromBuffer=function(t,e){return new p(t,e)},p.fromHex=function(t,e){return p.fromBuffer(n.from(t,"hex"),e)},p._transformObject=function(t){return{bn:new s(t.bn,"hex"),network:c.get(t.network),compressed:t.compressed}},p.fromString=p.fromWIF=function(t){return d.checkArgument(i.isString(t),"First argument is expected to be a string."),new p(t)},p.fromObject=p.fromJSON=function(t){return d.checkArgument(i.isObject(t),"First argument is expected to be an object."),new p(t)},p.fromRandom=function(t){var e=p._getRandomBN();return new p(e,t)},p.getValidationError=function(t,e){var r;try{new p(t,e)}catch(n){r=n}return r},p.isValid=function(t,e){return!!t&&!p.getValidationError(t,e)},p.prototype.toString=function(){return this.toWIF()},p.prototype.toWIF=function(){var t,e=this.network;return t=this.compressed?n.concat([n.from([e.privatekey]),this.bn.toBuffer({size:32}),n.from([1])]):n.concat([n.from([e.privatekey]),this.bn.toBuffer({size:32})]),a.encode(t)},p.prototype.toBigNumber=function(){return this.bn},p.prototype.toBuffer=function(){return this.bn.toBuffer({size:32})},p.prototype.toHex=function(){return this.toBuffer().toString("hex")},p.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=l.fromPrivateKey(this)),this._pubkey},p.prototype.toAddress=function(t){var e=this.toPublicKey();return o.fromPublicKey(e,t||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 t=this.compressed?"":", uncompressed";return""},t.exports=p},29730:function(t,e,r){"use strict";var n=r(19778).Buffer,i=r(81016),o=r(4067),a=r(15935),s=r(53604),u=r(47192),c=r(61504),f=r(99281);function l(t,e){if(!(this instanceof l))return new l(t,e);if(f.checkArgument(t,"First argument is required, please include public key data."),t instanceof l)return t;e=e||{};var r=this._classifyArgs(t,e);return r.point.validate(),s.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||u.defaultNetwork}),this}l.prototype._classifyArgs=function(t,e){var r={compressed:c.isUndefined(e.compressed)||e.compressed};if(t instanceof o)r.point=t;else if(t.x&&t.y)r=l._transformObject(t);else if("string"===typeof t)r=l._transformDER(n.from(t,"hex"));else if(l._isBuffer(t))r=l._transformDER(t);else{if(!l._isPrivateKey(t))throw new TypeError("First argument is an unrecognized data format.");r=l._transformPrivateKey(t)}return r.network||(r.network=c.isUndefined(e.network)?void 0:u.get(e.network)),r},l._isPrivateKey=function(t){return t instanceof r(52539)},l._isBuffer=function(t){return t instanceof n||t instanceof Uint8Array},l._transformPrivateKey=function(t){f.checkArgument(l._isPrivateKey(t),"Must be an instance of PrivateKey");var e={};return e.point=o.getG().mul(t.bn),e.compressed=t.compressed,e.network=t.network,e},l._transformDER=function(t,e){f.checkArgument(l._isBuffer(t),"Must be a buffer of DER encoded public key");var r,n,a,s,u={};if(e=!!c.isUndefined(e)||e,4!==t[0]&&(e||6!==t[0]&&7!==t[0]))if(3===t[0])a=t.slice(1),r=new i(a),(u=l._transformX(!0,r)).compressed=!0;else{if(2!==t[0])throw new TypeError("Invalid DER format public key");a=t.slice(1),r=new i(a),(u=l._transformX(!1,r)).compressed=!0}else{if(a=t.slice(1,33),s=t.slice(33,65),32!==a.length||32!==s.length||65!==t.length)throw new TypeError("Length of x and y must be 32 bytes");r=new i(a),n=new i(s),u.point=new o(r,n),u.compressed=!1}return u},l._transformX=function(t,e){f.checkArgument("boolean"===typeof t,"Must specify whether y is odd or not (true or false)");var r={};return r.point=o.fromX(t,e),r},l._transformObject=function(t){var e=new i(t.x,"hex"),r=new i(t.y,"hex");return new l(new o(e,r),{compressed:t.compressed})},l.fromPrivateKey=function(t){f.checkArgument(l._isPrivateKey(t),"Must be an instance of PrivateKey");var e=l._transformPrivateKey(t);return new l(e.point,{compressed:e.compressed,network:e.network})},l.fromDER=l.fromBuffer=function(t,e){f.checkArgument(l._isBuffer(t),"Must be a buffer of DER encoded public key");var r=l._transformDER(t,e);return new l(r.point,{compressed:r.compressed})},l.fromPoint=function(t,e){return f.checkArgument(t instanceof o,"First argument must be an instance of Point."),new l(t,{compressed:e})},l.fromHex=l.fromString=function(t,e){var r=n.from(t,e||"hex"),i=l._transformDER(r);return new l(i.point,{compressed:i.compressed})},l.fromX=function(t,e){var r=l._transformX(t,e);return new l(r.point,{compressed:r.compressed})},l.getValidationError=function(t){var e;try{new l(t)}catch(r){e=r}return e},l.isValid=function(t){return!l.getValidationError(t)},l.prototype.toObject=l.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},l.prototype.toBuffer=l.prototype.toDER=function(){var t,e=this.point.getX(),r=this.point.getY(),i=e.toBuffer({size:32}),o=r.toBuffer({size:32});return this.compressed?(t=o[o.length-1]%2?n.from([3]):n.from([2]),n.concat([t,i])):(t=n.from([4]),n.concat([t,i,o]))},l.prototype._getID=function(){return a.sha256ripemd160(this.toBuffer())},l.prototype.toAddress=function(t){return r(81386).fromPublicKey(this,t||this.network)},l.prototype.toString=l.prototype.toHex=function(){return this.toDER().toString("hex")},l.prototype.inspect=function(){return""},t.exports=l},66154:function(t,e,r){t.exports=r(12119),t.exports.Interpreter=r(6653),t.exports.Stack=r(89815)},6653:function(t,e,r){"use strict";var n=r(19778).Buffer,i=r(61504),o=r(12119),a=r(3464),s=r(81016),u=r(15935),c=r(34108),f=r(29730),l=r(89815),h=function t(e){if(!(this instanceof t))return new t(e);e?(this.initialize(),this.set(e)):this.initialize()};h.prototype.verify=function(t,e,n,a,s,u,c){var f,l=r(75277);if(i.isUndefined(n)&&(n=new l),i.isUndefined(a)&&(a=0),i.isUndefined(s)&&(s=0),s&h.SCRIPT_ENABLE_SIGHASH_FORKID&&(s|=h.SCRIPT_VERIFY_STRICTENC,!u))throw new Error("internal error - need satoshisBN to verify FORKID transactions");if(this.set({script:t,tx:n,nin:a,flags:s,satoshisBN:u,sighashScript:c}),0!==(s&h.SCRIPT_VERIFY_SIGPUSHONLY)&&!t.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate("scriptSig"))return!1;s&h.SCRIPT_VERIFY_P2SH&&(f=this.stack.copy());var d=this.stack;if(this.initialize(),this.set({script:e,stack:d,tx:n,nin:a,flags:s,satoshisBN:u,sighashScript:c}),!this.evaluate("scriptPubkey"))return!1;if(0===this.stack.length)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var p=this.stack.stacktop(-1);if(!h.castToBool(p))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;if(s&h.SCRIPT_VERIFY_P2SH&&e.isScriptHashOut()){if(!t.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(0===f.length)throw new Error("internal error - stack copy empty");var m=f.stacktop(-1),g=o.fromBuffer(m);if(f.pop(),this.initialize(),this.set({script:g,stack:f,tx:n,nin:a,flags:s,satoshisBN:u}),!this.evaluate())return!1;if(0===f.length)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1;if(!h.castToBool(f.stacktop(-1)))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1}return 0===(s&h.SCRIPT_VERIFY_CLEANSTACK)||1===this.stack.length||(this.errstr="SCRIPT_ERR_CLEANSTACK",!1)},t.exports=h,h.prototype.initialize=function(t){this.stack=new l([]),this.altstack=new l([]),this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0,this.nonTopLevelReturnAfterGenesis=!1,this.returned=!1},h.prototype.set=function(t){this.script=t.script||this.script,this.tx=t.tx||this.tx,this.nin="undefined"!==typeof t.nin?t.nin:this.nin,this.satoshisBN=t.satoshisBN||this.satoshisBN,this.stack=t.stack||this.stack,this.altstack=t.altstack||this.altstack,this.pc="undefined"!==typeof t.pc?t.pc:this.pc,this.pbegincodehash="undefined"!==typeof t.pbegincodehash?t.pbegincodehash:this.pbegincodehash,this.nOpCount="undefined"!==typeof t.nOpCount?t.nOpCount:this.nOpCount,this.vfExec=t.vfExec||this.vfExec,this.errstr=t.errstr||this.errstr,this.flags="undefined"!==typeof t.flags?t.flags:this.flags,this.sighashScript=t.sighashScript||this.sighashScript},h.prototype.subscript=function(){return this.sighashScript?this.sighashScript.clone():o.fromChunks(this.script.chunks.slice(this.pbegincodehash))},h.getTrue=function(){return n.from([1])},h.getFalse=function(){return n.from([])},h.MAX_SCRIPT_ELEMENT_SIZE=520,h.MAXIMUM_ELEMENT_SIZE=4,h.LOCKTIME_THRESHOLD_BN=new s(h.LOCKTIME_THRESHOLD=5e8),h.SCRIPT_VERIFY_NONE=0,h.SCRIPT_VERIFY_P2SH=1,h.SCRIPT_VERIFY_STRICTENC=2,h.SCRIPT_VERIFY_DERSIG=4,h.SCRIPT_VERIFY_LOW_S=8,h.SCRIPT_VERIFY_NULLDUMMY=16,h.SCRIPT_VERIFY_SIGPUSHONLY=32,h.SCRIPT_VERIFY_MINIMALDATA=64,h.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,h.SCRIPT_VERIFY_CLEANSTACK=256,h.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,h.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024,h.SCRIPT_VERIFY_MINIMALIF=8192,h.SCRIPT_VERIFY_NULLFAIL=16384,h.SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE=32768,h.SCRIPT_ENABLE_SIGHASH_FORKID=65536,h.SCRIPT_ENABLE_REPLAY_PROTECTION=1<<17,h.SCRIPT_ENABLE_MONOLITH_OPCODES=1<<18,h.SCRIPT_ENABLE_MAGNETIC_OPCODES=1<<19,h.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31,h.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22,h.SEQUENCE_LOCKTIME_MASK=65535,h.MAX_SCRIPT_SIZE=Number.MAX_SAFE_INTEGER,h.MAX_OPCODE_COUNT=Number.MAX_SAFE_INTEGER,h.DEFAULT_FLAGS=h.SCRIPT_ENABLE_MAGNETIC_OPCODES|h.SCRIPT_ENABLE_MONOLITH_OPCODES|h.SCRIPT_VERIFY_STRICTENC|h.SCRIPT_ENABLE_SIGHASH_FORKID|h.SCRIPT_VERIFY_LOW_S|h.SCRIPT_VERIFY_NULLFAIL|h.SCRIPT_VERIFY_DERSIG|h.SCRIPT_VERIFY_MINIMALDATA|h.SCRIPT_VERIFY_NULLDUMMY|h.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS|h.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY|h.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY|h.SCRIPT_VERIFY_CLEANSTACK,h.castToBool=function(t){for(var e=0;ee)&&!(t.length>0&&0===(127&t[t.length-1])&&(t.length<=1||0===(128&t[t.length-2])))},h._minimallyEncode=function(t){if(0===t.length)return t;var e=t[t.length-1];if(127&e)return t;if(1===t.length)return n.from("");if(128&t[t.length-2])return t;for(var r=t.length-1;r>0;r--)if(0!==t[r-1])return 128&t[r-1]?t[r++]=e:t[r-1]|=e,t.slice(0,r);return n.from("")},h.prototype.evaluate=function(t){if(this.script.toBuffer().length>h.MAX_SCRIPT_SIZE)return this.errstr="SCRIPT_ERR_SCRIPT_SIZE",!1;try{for(;!this.returned&&this.pc1e3)return this.errstr="SCRIPT_ERR_STACK_SIZE",!1}catch(n){return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR: "+n,!1}return!(this.vfExec.length>0)||(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1)},h.prototype._callbackStep=function(t){if("function"===typeof this.stepListener)try{this.stepListener(t)}catch(e){console.log("Error in Step callback:".concat(e))}},h.prototype._callbackStack=function(t,e,r){if("function"===typeof this.stackListener)try{this.stackListener(t,e,r)}catch(i){var n=this.script.chunks[e];console.error("Error: ".concat(i," in _updateStack pc: ").concat(e,", opcode ").concat(a.fromNumber(n.opcodenum).toSafeString()))}},h.prototype.checkLockTime=function(t){return!!(this.tx.nLockTime=h.LOCKTIME_THRESHOLD&&t.gte(h.LOCKTIME_THRESHOLD_BN))&&(!t.gt(new s(this.tx.nLockTime))&&!this.tx.inputs[this.nin].isFinal())},h.prototype.checkSequence=function(t){var e=this.tx.inputs[this.nin].sequenceNumber;if(this.tx.version<2)return!1;if(e&h.SEQUENCE_LOCKTIME_DISABLE_FLAG)return!1;var r=h.SEQUENCE_LOCKTIME_TYPE_FLAG|h.SEQUENCE_LOCKTIME_MASK,n=new s(e&r),i=t.and(r),o=new s(h.SEQUENCE_LOCKTIME_TYPE_FLAG);return!!(n.lt(o)&&i.lt(o)||n.gte(o)&&i.gte(o))&&!i.gt(n)},h.prototype.step=function(t){var e=this;function r(t){return e.stack.stacktop(t)}function l(t){return e.stack.vartop(t)}var d,p,m,g,v,y,b,w,_,S,M,k,x,E,A,O,T,P,I,R,C=0!==(this.flags&h.SCRIPT_VERIFY_MINIMALDATA),N=this.script.chunks[this.pc];this.pc++;var B=N.opcodenum;if(i.isUndefined(B))return this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE",!1;if(N.buf&&N.buf.length>h.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;var j=-1===this.vfExec.indexOf(!1)&&(!this.nonTopLevelReturnAfterGenesis||B===a.OP_RETURN);if(B>a.OP_16&&++this.nOpCount>h.MAX_OPCODE_COUNT)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;if(function(t){switch(t){case a.OP_2MUL:case a.OP_2DIV:return!0;case a.OP_INVERT:case a.OP_MUL:case a.OP_LSHIFT:case a.OP_RSHIFT:if(0===(e.flags&h.SCRIPT_ENABLE_MAGNETIC_OPCODES))return!0;break;case a.OP_DIV:case a.OP_MOD:case a.OP_SPLIT:case a.OP_CAT:case a.OP_AND:case a.OP_OR:case a.OP_XOR:case a.OP_BIN2NUM:case a.OP_NUM2BIN:if(0===(e.flags&h.SCRIPT_ENABLE_MONOLITH_OPCODES))return!0}return!1}(B))return this.errstr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(j&&B>=0&&B<=a.OP_PUSHDATA4){if(C&&!this.script.checkMinimalPush(this.pc-1))return this.errstr="SCRIPT_ERR_MINIMALDATA",!1;if(N.buf){if(N.len!==N.buf.length)throw new Error("Length of push value not equal to length of data (".concat(N.len,",").concat(N.buf.length,")"));this.stack.push(N.buf)}else this.stack.push(h.getFalse())}else if(j||a.OP_IF<=B&&B<=a.OP_ENDIF)switch(B){case a.OP_1NEGATE:case a.OP_1:case a.OP_2:case a.OP_3:case a.OP_4:case a.OP_5:case a.OP_6:case a.OP_7:case a.OP_8:case a.OP_9:case a.OP_10:case a.OP_11:case a.OP_12:case a.OP_13:case a.OP_14:case a.OP_15:case a.OP_16:v=B-(a.OP_1-1),d=new s(v).toScriptNumBuffer(),this.stack.push(d);break;case a.OP_NOP:break;case a.OP_NOP2:case a.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&h.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&h.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var L=s.fromScriptNumBuffer(this.stack.stacktop(-1),C,5);if(L.lt(new s(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(L))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case a.OP_NOP3:case a.OP_CHECKSEQUENCEVERIFY:if(!(this.flags&h.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)){if(this.flags&h.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var D=s.fromScriptNumBuffer(r(-1),C,5);if(D.lt(new s(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(0!==(D&h.SEQUENCE_LOCKTIME_DISABLE_FLAG))break;if(!this.checkSequence(D))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case a.OP_NOP1:case a.OP_NOP4:case a.OP_NOP5:case a.OP_NOP6:case a.OP_NOP7:case a.OP_NOP8:case a.OP_NOP9:case a.OP_NOP10:if(this.flags&h.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case a.OP_IF:case a.OP_NOTIF:if(O=!1,j){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(d=r(-1),this.flags&h.SCRIPT_VERIFY_MINIMALIF){if(d.length>1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1;if(1===d.length&&1!==d[0])return this.errstr="SCRIPT_ERR_MINIMALIF",!1}O=h.castToBool(d),B===a.OP_NOTIF&&(O=!O),this.stack.pop()}this.vfExec.push(O);break;case a.OP_ELSE:if(0===this.vfExec.length)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case a.OP_ENDIF:if(0===this.vfExec.length)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec.pop();break;case a.OP_VERIFY:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(d=r(-1),!(O=h.castToBool(d)))return this.errstr="SCRIPT_ERR_VERIFY",!1;this.stack.pop();break;case a.OP_RETURN:if(0!==(this.flags&h.SCRIPT_VERIFY_P2SH))return!1;if(0===this.vfExec.length)return this.returned=!0,!0;this.nonTopLevelReturnAfterGenesis=!0;break;case a.OP_TOALTSTACK:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;P=l(-1),this.altstack.push(this.stack.pop(),P);break;case a.OP_FROMALTSTACK:if(this.altstack.length<1)return this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;var U=this.altstack.vartop(-1);this.stack.push(this.altstack.pop(),U);break;case a.OP_2DROP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case a.OP_2DUP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;p=r(-2),m=r(-1),P=l(-2),I=l(-1),this.stack.push(n.from(p),"$".concat(P)),this.stack.push(n.from(m),"$".concat(I));break;case a.OP_3DUP:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;p=r(-3),m=r(-2);var F=r(-1);P=l(-3),I=l(-2),R=l(-1),this.stack.push(n.from(p),"$".concat(P)),this.stack.push(n.from(m),"$".concat(I)),this.stack.push(n.from(F),"$".concat(R));break;case a.OP_2OVER:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;p=r(-4),m=r(-3),P=l(-4),I=l(-3),this.stack.push(n.from(p),"$".concat(P)),this.stack.push(n.from(m),"$".concat(I));break;case a.OP_2ROT:if(this.stack.length<6)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;P=l(-6),I=l(-5),g=this.stack.splice(this.stack.length-6,2),this.stack.push(g[0],P),this.stack.push(g[1],I);break;case a.OP_2SWAP:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;P=l(-4),I=l(-3),g=this.stack.splice(this.stack.length-4,2),this.stack.push(g[0],P),this.stack.push(g[1],I);break;case a.OP_IFDUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;d=r(-1),(O=h.castToBool(d))&&(P=l(-1),this.stack.push(n.from(d),"$".concat(P)));break;case a.OP_DEPTH:d=new s(this.stack.length).toScriptNumBuffer(),this.stack.push(d,"$depth");break;case a.OP_DROP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case a.OP_DUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;P=l(-1),this.stack.push(n.from(r(-1)),"$".concat(P));break;case a.OP_NIP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1);break;case a.OP_OVER:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;I=l(-2),this.stack.push(n.from(r(-2)),"$".concat(I));break;case a.OP_PICK:case a.OP_ROLL:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(d=r(-1),v=(w=s.fromScriptNumBuffer(d,C,4)).toNumber(),this.stack.pop(),v<0||v>=this.stack.length)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;d=r(-v-1),P=l(-v-1),B===a.OP_ROLL?(this.stack.splice(this.stack.length-v-1,1),this.stack.push(n.from(d),P)):this.stack.push(n.from(d),"$".concat(P));break;case a.OP_ROT:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;y=r(-3),b=r(-2);var H=r(-1);P=l(-3),I=l(-2),R=l(-1),this.stack.write(-3,b),this.stack.write(-2,H),this.stack.write(-1,y),this.stack.updateTopVars([P,R,I]);break;case a.OP_SWAP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;y=r(-2),b=r(-1),P=l(-2),I=l(-1),this.stack.write(-2,b),this.stack.write(-1,y),this.stack.updateTopVars([P,I]);break;case a.OP_TUCK:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;P=l(-2),I=l(-1),this.stack.splice(this.stack.length-2,0,n.from(r(-1))),this.stack.updateTopVars([I,P,"$".concat(I)]);break;case a.OP_SIZE:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;w=new s(r(-1).length),this.stack.push(w.toScriptNumBuffer(),"$size");break;case a.OP_AND:case a.OP_OR:case a.OP_XOR:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(p=r(-2),m=r(-1),p.length!==m.length)return this.errstr="SCRIPT_ERR_INVALID_OPERAND_SIZE",!1;switch(B){case a.OP_AND:for(var z=0;z0)+0);break;case a.OP_LESSTHANOREQUAL:w=new s((_.cmp(S)<=0)+0);break;case a.OP_GREATERTHANOREQUAL:w=new s((_.cmp(S)>=0)+0);break;case a.OP_MIN:w=_.cmp(S)<0?_:S;break;case a.OP_MAX:w=_.cmp(S)>0?_:S}if(this.stack.pop(),this.stack.pop(),this.stack.push(w.toScriptNumBuffer()),B===a.OP_NUMEQUALVERIFY){if(!h.castToBool(r(-1)))return this.errstr="SCRIPT_ERR_NUMEQUALVERIFY",!1;this.stack.pop()}break;case a.OP_WITHIN:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;_=s.fromScriptNumBuffer(r(-3),C),S=s.fromScriptNumBuffer(r(-2),C);var $=s.fromScriptNumBuffer(r(-1),C);O=S.cmp(_)<=0&&_.cmp($)<0,this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(O?h.getTrue():h.getFalse());break;case a.OP_RIPEMD160:case a.OP_SHA1:case a.OP_SHA256:case a.OP_HASH160:case a.OP_HASH256:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var Z;d=r(-1),B===a.OP_RIPEMD160?Z=u.ripemd160(d):B===a.OP_SHA1?Z=u.sha1(d):B===a.OP_SHA256?Z=u.sha256(d):B===a.OP_HASH160?Z=u.sha256ripemd160(d):B===a.OP_HASH256&&(Z=u.sha256sha256(d)),this.stack.pop(),this.stack.push(Z);break;case a.OP_CODESEPARATOR:this.pbegincodehash=this.pc;break;case a.OP_CHECKSIG:case a.OP_CHECKSIGVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(M=r(-2),k=r(-1),!this.checkSignatureEncoding(M)||!this.checkPubkeyEncoding(k))return!1;x=this.subscript();var X=(new o).add(M);x.findAndDelete(X);try{E=c.fromTxFormat(M),A=f.fromBuffer(k,!1),T=this.tx.verifySignature(E,A,this.nin,x,this.satoshisBN,this.flags)}catch(dt){T=!1}if(!T&&this.flags&h.SCRIPT_VERIFY_NULLFAIL&&M.length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;if(this.stack.pop(),this.stack.pop(),this.stack.push(T?h.getTrue():h.getFalse()),B===a.OP_CHECKSIGVERIFY){if(!T)return this.errstr="SCRIPT_ERR_CHECKSIGVERIFY",!1;this.stack.pop()}break;case a.OP_CHECKMULTISIG:case a.OP_CHECKMULTISIGVERIFY:var J=1;if(this.stack.length20)return this.errstr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=Q,this.nOpCount>h.MAX_OPCODE_COUNT)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;var tt=++J;J+=Q;var et=Q+2;if(this.stack.lengthQ)return this.errstr="SCRIPT_ERR_SIG_COUNT",!1;var nt=++J;if(J+=rt,this.stack.length0;){if(M=r(-nt),k=r(-tt),!this.checkSignatureEncoding(M)||!this.checkPubkeyEncoding(k))return!1;var ot;try{E=c.fromTxFormat(M),A=f.fromBuffer(k,!1),ot=this.tx.verifySignature(E,A,this.nin,x,this.satoshisBN,this.flags)}catch(dt){ot=!1}ot&&(nt++,rt--),tt++,rt>--Q&&(T=!1)}for(;J-- >1;){if(!T&&this.flags&h.SCRIPT_VERIFY_NULLFAIL&&!et&&r(-1).length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;et>0&&et--,this.stack.pop()}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&h.SCRIPT_VERIFY_NULLDUMMY&&r(-1).length)return this.errstr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(T?h.getTrue():h.getFalse()),B===a.OP_CHECKMULTISIGVERIFY){if(!T)return this.errstr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1;this.stack.pop()}break;case a.OP_CAT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(p=r(-2),m=r(-1),p.length+m.length>h.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack.write(-2,n.concat([p,m])),this.stack.pop();break;case a.OP_SPLIT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;p=r(-2);var at=s.fromScriptNumBuffer(r(-1),C).toNumber();if(at<0||at>p.length)return this.errstr="SCRIPT_ERR_INVALID_SPLIT_RANGE",!1;var st=n.from(p);this.stack.write(-2,st.slice(0,at)),this.stack.write(-1,st.slice(at));break;case a.OP_NUM2BIN:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var ut=s.fromScriptNumBuffer(r(-1),C).toNumber();if(ut>h.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack.pop();var ct=r(-1);if((ct=h._minimallyEncode(ct)).length>ut)return this.errstr="SCRIPT_ERR_IMPOSSIBLE_ENCODING",!1;if(ct.length===ut){this.stack.write(-1,ct);break}var ft=0;ct.length>0&&(ft=128&ct[ct.length-1],ct[ct.length-1]&=127);var lt=n.alloc(ut);ct.copy(lt,0);for(var ht=ct.length-1;ht++0&&a0&&(i=n?i+" "+t.buf.toString("hex"):i+" "+t.len+" 0x"+t.buf.toString("hex"));else if("undefined"!==typeof u.reverseMap[r])n?0===r?i+=" 0":79===r?i+=" -1":i=i+" "+u(r).toString():i=i+" "+u(r).toString();else{var o=r.toString(16);o.length%2!==0&&(o="0"+o),i=n?i+" "+o:i+" 0x"+o}return i},_.prototype.toASM=function(){for(var t="",e=this.chunks,r=0;r"},_.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==u.OP_DUP||this.chunks[1].opcodenum!==u.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==u.OP_EQUALVERIFY||this.chunks[4].opcodenum!==u.OP_CHECKSIG)},_.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var t=this.chunks[0].buf,e=this.chunks[1].buf;if(t&&t.length&&48===t[0]&&e&&e.length){var r=e[0];if((4===r||6===r||7===r)&&65===e.length)return!0;if((3===r||2===r)&&33===e.length)return!0}}return!1},_.prototype.getPublicKey=function(){return h.checkState(this.isPublicKeyOut(),"Can't retrieve PublicKey from a non-PK output"),this.chunks[0].buf},_.prototype.getPublicKeyHash=function(){return h.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},_.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===u.OP_CHECKSIG){var t=this.chunks[0].buf,e=t[0],r=!1;if((4!==e&&6!==e&&7!==e||65!==t.length)&&(3!==e&&2!==e||33!==t.length)||(r=!0),r)return c.isValid(t)}return!1},_.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var t=this.chunks[0].buf;if(t&&t.length&&48===t[0])return!0}return!1},_.prototype.isScriptHashOut=function(){var t=this.toBuffer();return 23===t.length&&t[0]===u.OP_HASH160&&20===t[1]&&t[t.length-1]===u.OP_EQUAL},_.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var t,e=this.chunks[this.chunks.length-1].buf;if(!e)return!1;try{t=_.fromBuffer(e)}catch(r){if(r instanceof p.Script.InvalidBuffer)return!1;throw r}return t.classify()!==_.types.UNKNOWN},_.prototype.isMultisigOut=function(){return this.chunks.length>3&&u.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every((function(t){return t.buf&&n.isBuffer(t.buf)}))&&u.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===u.OP_CHECKMULTISIG},_.prototype.isMultisigIn=function(){return this.chunks.length>=2&&0===this.chunks[0].opcodenum&&this.chunks.slice(1,this.chunks.length).every((function(t){return t.buf&&n.isBuffer(t.buf)&&f.isTxDER(t.buf)}))},_.prototype.isDataOut=function(){if(!(this.buffer.length>=1&&this.buffer[0]===u.OP_RETURN))return!1;var t=this.buffer.slice(1);return new _({buffer:t}).isPushOnly()},_.prototype.isSafeDataOut=function(){if(this.buffer.length<2)return!1;if(this.buffer[0]!==u.OP_FALSE)return!1;var t=this.buffer.slice(1);return new _({buffer:t}).isDataOut()},_.prototype.getData=function(){if(this.isSafeDataOut())return this.chunks.slice(2).map((function(t){return t.buf}));if(this.isDataOut()||this.isScriptHashOut())return d.isUndefined(this.chunks[1])?n.alloc(0):n.from(this.chunks[1].buf);if(this.isPublicKeyHashOut())return n.from(this.chunks[2].buf);throw new Error("Unrecognized script type to get data from")},_.prototype.isPushOnly=function(){return d.every(this.chunks,(function(t){return t.opcodenum<=u.OP_16||t.opcodenum===u.OP_PUSHDATA1||t.opcodenum===u.OP_PUSHDATA2||t.opcodenum===u.OP_PUSHDATA4}))},(_.types={}).UNKNOWN="Unknown",_.types.PUBKEY_OUT="Pay to public key",_.types.PUBKEY_IN="Spend from public key",_.types.PUBKEYHASH_OUT="Pay to public key hash",_.types.PUBKEYHASH_IN="Spend from public key hash",_.types.SCRIPTHASH_OUT="Pay to script hash",_.types.SCRIPTHASH_IN="Spend from script hash",_.types.MULTISIG_OUT="Pay to multisig",_.types.MULTISIG_IN="Spend from multisig",_.types.DATA_OUT="Data push",_.types.SAFE_DATA_OUT="Safe data push",_.OP_RETURN_STANDARD_SIZE=220,_.prototype.classify=function(){if(this._isInput)return this.classifyInput();if(this._isOutput)return this.classifyOutput();var t=this.classifyOutput();return t!==_.types.UNKNOWN?t:this.classifyInput()},(_.outputIdentifiers={}).PUBKEY_OUT=_.prototype.isPublicKeyOut,_.outputIdentifiers.PUBKEYHASH_OUT=_.prototype.isPublicKeyHashOut,_.outputIdentifiers.MULTISIG_OUT=_.prototype.isMultisigOut,_.outputIdentifiers.SCRIPTHASH_OUT=_.prototype.isScriptHashOut,_.outputIdentifiers.DATA_OUT=_.prototype.isDataOut,_.outputIdentifiers.SAFE_DATA_OUT=_.prototype.isSafeDataOut,_.prototype.classifyOutput=function(){for(var t in _.outputIdentifiers)if(_.outputIdentifiers[t].bind(this)())return _.types[t];return _.types.UNKNOWN},(_.inputIdentifiers={}).PUBKEY_IN=_.prototype.isPublicKeyIn,_.inputIdentifiers.PUBKEYHASH_IN=_.prototype.isPublicKeyHashIn,_.inputIdentifiers.MULTISIG_IN=_.prototype.isMultisigIn,_.inputIdentifiers.SCRIPTHASH_IN=_.prototype.isScriptHashIn,_.prototype.classifyInput=function(){for(var t in _.inputIdentifiers)if(_.inputIdentifiers[t].bind(this)())return _.types[t];return _.types.UNKNOWN},_.prototype.isStandard=function(){return this.classify()!==_.types.UNKNOWN},_.prototype.prepend=function(t){return this._addByType(t,!0),this},_.prototype.equals=function(t){if(h.checkState(t instanceof _,"Must provide another script"),this.buffer.length!==t.buffer.length)return!1;var e;for(e=0;e255)throw new p.Script.InvalidOpcode(r);return this._insertAtPosition(_.fromChunks([{opcodenum:r}]).toBuffer(),e),this},_.prototype._addBuffer=function(t,e){var r,n=new a,i=t.length;if(0===i)r=0,n.writeUInt8(r);else if(i>0&&i=1&&r[0]<=16?n===u.OP_1+(r[0]-1):1===r.length&&129===r[0]?n===u.OP_1NEGATE:r.length<=75?n===r.length:r.length<=255?n===u.OP_PUSHDATA1:!(r.length<=65535)||n===u.OP_PUSHDATA2)},_.prototype._decodeOP_N=function(t){if(t===u.OP_0)return 0;if(t>=u.OP_1&&t<=u.OP_16)return t-(u.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(t))},_.prototype.getSignatureOperationsCount=function(t){t=!!d.isUndefined(t)||t;var e=this,r=0,n=u.OP_INVALIDOPCODE;return d.each(e.chunks,(function(i){var o=i.opcodenum;o===u.OP_CHECKSIG||o===u.OP_CHECKSIGVERIFY?r++:o!==u.OP_CHECKMULTISIG&&o!==u.OP_CHECKMULTISIGVERIFY||(t&&n>=u.OP_1&&n<=u.OP_16?r+=e._decodeOP_N(n):r+=20),n=o})),r},t.exports=_},89815:function(t,e,r){"use strict";var n=r(861).default,i=function(t,e){this.stack=t,this.varStack=e||[]};t.exports=i,i.prototype.pushVar=function(t){this.varStack.push(t||"$tmp")},i.prototype.popVar=function(){this.varStack.pop()},i.prototype.push=function(t,e){this.pushVar(e),this.stack.push(t),this.checkConsistency()},i.prototype.pop=function(){this.popVar();var t=this.stack.pop();return this.checkConsistency(),t},i.prototype.updateTopVars=function(t){var e;if(t.length>this.varStack.length)throw new Error("updateTopVars fail, stack: ".concat(this.stack.length,", varStack: ").concat(this.varStack.length,", vars:").concat(t.length));t=t.reverse(),(e=this.varStack).splice.apply(e,[this.varStack.length-t.length,t.length].concat(n(t)))},i.prototype.stacktop=function(t){return this.stack[this.stack.length+t]},i.prototype.vartop=function(t){return this.varStack[this.varStack.length+t]},i.prototype.slice=function(t,e){return this.stack.slice(t,e)},i.prototype.splice=function(t,e){for(var r,n,i=arguments.length,o=new Array(i>2?i-2:0),a=2;a2147483647)throw new Error("Out of range. It must be >= -2147483648 and <= 2147483647.");var r=new Uint8Array(4);return r[0]=e%256,e=Math.floor(e/256),r[1]=e%256,e>>=8,r[2]=e%256,e>>=8,r[3]=e,t.write(r)}},42347:function(t){t.exports=function(t,e){if(0===e.length)t.write([0]);else if(e.length<=75)t.write([e.length]),t.write(e);else if(e.length<=255)t.write([76,e.length]),t.write(e);else if(e.length<=65535)t.write([77,e.length%256,e.length>>8]),t.write(e);else{if(!(e.length<=4294967295))throw new Error("data too large");var r=new Uint8Array(5);r[0]=78;var n=e.length;r[1]=n%256,n=Math.floor(n/256),r[2]=n%256,n=Math.floor(n/256),r[3]=n%256,n=Math.floor(n/256),r[4]=n,t.write(r),t.write(e)}return t}},2748:function(t){t.exports=function(t,e){if(e>65535)throw new Error("number too large");var r=new Uint8Array(2);return r[0]=e%256,e>>=8,r[1]=e%256,t.write(r)}},6007:function(t){t.exports=function(t,e){if(e>4294967295)throw new Error("number too large");var r=new Uint8Array(4);return r[0]=e%256,e=Math.floor(e/256),r[1]=e%256,e>>=8,r[2]=e%256,e>>=8,r[3]=e,t.write(r)}},58781:function(t){t.exports=function(t,e){if(e>255)throw new Error("number too large");var r=new Uint8Array(1);return r[0]=e,t.write(r)}},95647:function(t){t.exports=function(t,e){if(e>Number.MAX_SAFE_INTEGER)throw new Error("varint too large");if(e<=252)return t.write([e]);if(e<=65535)return t.write([253,e%256,Math.floor(e/256)]);if(e<=4294967295){var r=new Uint8Array(5);return r[0]=254,r[1]=e%256,e=Math.floor(e/256),r[2]=e%256,e=Math.floor(e/256),r[3]=e%256,e=Math.floor(e/256),r[4]=e,t.write(r)}var n=new Uint8Array(9);return n[0]=255,n[1]=e%256,e=Math.floor(e/256),n[2]=e%256,e=Math.floor(e/256),n[3]=e%256,e=Math.floor(e/256),n[4]=e%256,e=Math.floor(e/256),n[5]=e%256,e=Math.floor(e/256),n[6]=e%256,e=Math.floor(e/256),n[7]=e%256,e=Math.floor(e/256),n[8]=e,t.write(n)}},75277:function(t,e,r){t.exports=r(18173),t.exports.Input=r(81021),t.exports.Output=r(81757),t.exports.UnspentOutput=r(28871),t.exports.Signature=r(20066),t.exports.Sighash=r(41132)},81021:function(t,e,r){t.exports=r(83189),t.exports.PublicKey=r(86522),t.exports.PublicKeyHash=r(78259),t.exports.MultiSig=r(14979),t.exports.MultiSigScriptHash=r(24980)},83189:function(t,e,r){"use strict";var n=r(19778).Buffer,i=r(61504),o=r(99281),a=r(67690),s=r(74690),u=r(19778),c=r(53604),f=r(66154),l=r(41132),h=r(81757),d=r(34108),p=r(20066),m=r(15935),g=r(6653),v=r(3464),y=r(52539),b=4294967295,w=b;function _(t){return this instanceof _?t?this._fromObject(t):void 0:new _(t)}_.MAXINT=b,_.DEFAULT_SEQNUMBER=w,_.DEFAULT_LOCKTIME_SEQNUMBER=4294967294,_.DEFAULT_RBF_SEQNUMBER=4294967293,_.BASE_SIZE=40,Object.defineProperty(_.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)}}),_.fromObject=function(t){return o.checkArgument(i.isObject(t)),(new _)._fromObject(t)},_.prototype._fromObject=function(t){var e;if(e=i.isString(t.prevTxId)&&c.isHexa(t.prevTxId)?u.Buffer.from(t.prevTxId,"hex"):t.prevTxId,this.output=t.output?t.output instanceof h?t.output:new h(t.output):void 0,this.prevTxId=e||t.txidbuf,this.outputIndex=i.isUndefined(t.outputIndex)?t.txoutnum:t.outputIndex,this.sequenceNumber=i.isUndefined(t.sequenceNumber)?i.isUndefined(t.seqnum)?w:t.seqnum:t.sequenceNumber,i.isUndefined(t.script)&&i.isUndefined(t.scriptBuffer))throw new a.Transaction.Input.MissingScript;return this.setScript(t.scriptBuffer||t.script),this},_.prototype.toObject=_.prototype.toJSON=function(){var t={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(t.scriptString=this.script.toString()),this.output&&(t.output=this.output.toObject()),t},_.fromBufferReader=function(t){var e=new _;return e.prevTxId=t.readReverse(32),e.outputIndex=t.readUInt32LE(),e._scriptBuffer=t.readVarLengthBuffer(),e.sequenceNumber=t.readUInt32LE(),e},_.prototype.toBufferWriter=function(t){t||(t=new s),t.writeReverse(this.prevTxId),t.writeUInt32LE(this.outputIndex);var e=this._scriptBuffer;return t.writeVarintNum(e.length),t.write(e),t.writeUInt32LE(this.sequenceNumber),t},_.prototype.setScript=function(t){if(this._script=null,t instanceof f)this._script=t,this._script._isInput=!0,this._scriptBuffer=t.toBuffer();else if(null===t)this._script=f.empty(),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(c.isHexa(t))this._scriptBuffer=u.Buffer.from(t,"hex");else if(i.isString(t))this._script=new f(t),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!n.isBuffer(t))throw new TypeError("Invalid argument type: script");this._scriptBuffer=u.Buffer.from(t)}return this},_.prototype.getSignatures=function(t,e,r,n){o.checkState(this.output instanceof h),n=n||d.SIGHASH_ALL|d.SIGHASH_FORKID;var a=[];if(e instanceof y)a.push(new p({publicKey:e.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:l.sign(t,e,n,r,this.output.script,this.output.satoshisBN),sigtype:n}));else if(i.isArray(e)){var s=this;i.each(e,(function(e,o){var u=n;i.isArray(n)&&(u=n[o]||d.SIGHASH_ALL|d.SIGHASH_FORKID),a.push(new p({publicKey:e.publicKey,prevTxId:s.prevTxId,outputIndex:s.outputIndex,inputIndex:r,signature:l.sign(t,e,u,r,s.output.script,s.output.satoshisBN),sigtype:u}))}))}return a},_.prototype.getPreimage=function(t,e,r,n){return o.checkState(this.output instanceof h),r=r||d.SIGHASH_ALL|d.SIGHASH_FORKID,(n=n||!1)?function(t,e,r,n,o){do{var a=l.sighashPreimage(t,e,r,n,o),s=m.sha256sha256(a);if(i.isPositiveNumber(s.readUInt8())&&i.isPositiveNumber(s.readUInt8(31)))return a;t.nLockTime++}while(09007199254740991?"transaction txout satoshis greater than max safe integer":this._satoshis!==this._satoshisBN.toNumber()?"transaction txout satoshis has corrupted value":this._satoshis<0&&"transaction txout negative"},Object.defineProperty(d.prototype,"satoshisBN",{configurable:!1,enumerable:!0,get:function(){return this._satoshisBN},set:function(t){this._satoshisBN=t,this._satoshis=t.toNumber(),l.checkState(s.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),d.prototype.toObject=d.prototype.toJSON=function(){var t={satoshis:this.satoshis};return t.script=this._script.toBuffer().toString("hex"),t},d.fromObject=function(t){return new d(t)},d.prototype.setScriptFromBuffer=function(t){try{this._script=f.fromBuffer(t),this._script._isOutput=!0}catch(e){if(!(e instanceof h.Script.InvalidBuffer))throw e;this._script=null}},d.prototype.setScript=function(t){if(t instanceof f)this._script=t,this._script._isOutput=!0;else if(i.isString(t))this._script=f.fromString(t),this._script._isOutput=!0;else{if(!n.isBuffer(t))throw new TypeError("Invalid argument type: script");this.setScriptFromBuffer(t)}return this},d.prototype.inspect=function(){var t;return this.script&&(t=this.script.inspect()),""},d.fromBufferReader=function(t){var e={};e.satoshis=t.readUInt64LEBN();var r=t.readVarintNum();if(0!==r){if(t.remaining()>8)<<8|255&e);if(e&o.SIGHASH_FORKID&&b&p.SCRIPT_ENABLE_SIGHASH_FORKID)return function(t,e,r,i,a){var s=t.inputs[r];function u(t,e){var r=new c;m.isUndefined(e)?m.each(t.outputs,(function(t){t.toBufferWriter(r)})):t.outputs[e].toBufferWriter(r);var n=r.toBuffer();return l.sha256sha256(n)}d.checkArgument(a instanceof f,"For ForkId=0 signatures, satoshis or complete input must be provided");var h=n.alloc(32),p=n.alloc(32),g=n.alloc(32);e&o.SIGHASH_ANYONECANPAY||(h=function(t){var e=new c;m.each(t.inputs,(function(t){e.writeReverse(t.prevTxId),e.writeUInt32LE(t.outputIndex)}));var r=e.toBuffer();return l.sha256sha256(r)}(t)),e&o.SIGHASH_ANYONECANPAY||(31&e)===o.SIGHASH_SINGLE||(31&e)===o.SIGHASH_NONE||(p=function(t){var e=new c;m.each(t.inputs,(function(t){e.writeUInt32LE(t.sequenceNumber)}));var r=e.toBuffer();return l.sha256sha256(r)}(t)),(31&e)!==o.SIGHASH_SINGLE&&(31&e)!==o.SIGHASH_NONE?g=u(t):(31&e)===o.SIGHASH_SINGLE&&r>>0),v.toBuffer()}(t,e,u,h,y);var S,M=w.shallowCopy(t);for((h=new a(h)).removeCodeseparators(),S=0;S=M.outputs.length)return g;for(M.outputs.length=u+1,S=0;Sr)return this._missingChange()?new c.Transaction.ChangeAddressMissing("Fee is too large and no change address was provided"):new c.Transaction.FeeError.TooLarge("expected less than "+r+" but got "+e)}},O.prototype._missingChange=function(){return!this._changeScript},O.prototype._hasDustOutputs=function(t){var e,r;if(!t.disableDustOutputs)for(e in this.outputs)if((r=this.outputs[e]).satoshis"},O.prototype.toBuffer=function(){var t=new h;return this.toBufferWriter(t).toBuffer()},O.prototype.toBufferWriter=function(t){return t.writeUInt32LE(this.version),t.writeVarintNum(this.inputs.length),a.each(this.inputs,(function(e){e.toBufferWriter(t)})),t.writeVarintNum(this.outputs.length),a.each(this.outputs,(function(e){e.toBufferWriter(t)})),t.writeUInt32LE(this.nLockTime),t},O.prototype.fromBuffer=function(t){var e=new l(t);return this.fromBufferReader(e)},O.prototype.fromBufferReader=function(t){var e,r,n;for(s.checkArgument(!t.finished(),"No transaction data received"),this.version=t.readInt32LE(),r=t.readVarintNum(),e=0;e=O.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new c.Transaction.BlockHeightTooHigh;if(t<0)throw new c.Transaction.NLockTimeOutOfRange;for(var e=0;e=O.DUST_AMOUNT&&(this._changeIndex=this.outputs.length,this._addOutput(new k({script:this._changeScript,satoshis:t}))),this._clearSignatures()}},O.prototype.getFee=function(){return this.isCoinbase()?0:a.isUndefined(this._fee)?this._changeScript?this._estimateFee():this._getUnspentValue():this._fee},O.prototype._estimateFee=function(){var t=this._estimateSize();return Math.ceil(t/1e3*(this._feePerKb||O.FEE_PER_KB))},O.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount()},O.prototype._clearSignatures=function(){a.each(this.inputs,(function(t){t.clearSignatures()}))},O.prototype._estimateSize=function(){var t=8;return t+=d(this.inputs.length).toBuffer().length,t+=d(this.outputs.length).toBuffer().length,a.each(this.inputs,(function(e){t+=e._estimateSize()})),a.each(this.outputs,(function(e){t+=e.getSize()})),t},O.prototype._removeOutput=function(t){var e=this.outputs[t];this.outputs=a.without(this.outputs,e),this._outputAmount=void 0},O.prototype.removeOutput=function(t){this._removeOutput(t),this._updateChangeOutput()},O.prototype.sort=function(){return this.sortInputs((function(t){var e=Array.prototype.concat.apply([],t);return e.sort((function(t,e){return t.prevTxId.compare(e.prevTxId)||t.outputIndex-e.outputIndex})),e})),this.sortOutputs((function(t){var e=Array.prototype.concat.apply([],t);return e.sort((function(t,e){return t.satoshis-e.satoshis||t.script.toBuffer().compare(e.script.toBuffer())})),e})),this},O.prototype.shuffleOutputs=function(){return this.sortOutputs(a.shuffle)},O.prototype.sortOutputs=function(t){var e=t(this.outputs);return this._newOutputOrder(e)},O.prototype.sortInputs=function(t){return this.inputs=t(this.inputs),this._clearSignatures(),this},O.prototype._newOutputOrder=function(t){if(this.outputs.length!==t.length||0!==a.difference(this.outputs,t).length)throw new c.Transaction.InvalidSorting;if(!a.isUndefined(this._changeIndex)){var e=this.outputs[this._changeIndex];this._changeIndex=t.indexOf(e)}return this.outputs=t,this},O.prototype.removeInput=function(t,e){var r;if(r=!e&&a.isNumber(t)?t:a.findIndex(this.inputs,(function(r){return r.prevTxId.toString("hex")===t&&r.outputIndex===e})),r<0||r>=this.inputs.length)throw new c.Transaction.InvalidIndex(r,this.inputs.length);var n=this.inputs[r];this.inputs=a.without(this.inputs,n),this._inputAmount=void 0,this._updateChangeOutput()},O.prototype.sign=function(t,e){s.checkState(this.hasAllUtxoInfo(),"Not all utxo information is available to sign the transaction.");var r=this;return a.isArray(t)?(a.each(t,(function(t){r.sign(t,e)})),this):(a.each(this.getSignatures(t,e),(function(t){r.applySignature(t)})),this._privateKey=t,this._sigType=e,this)},O.prototype.getSignatures=function(t,e){t=new E(t),e=e||m.SIGHASH_ALL|m.SIGHASH_FORKID;var r=this,n=[],i=p.sha256ripemd160(t.publicKey.toBuffer());return a.each(this.inputs,(function(o,s){a.each(o.getSignatures(r,t,s,e,i),(function(t){n.push(t)}))})),n},O.prototype.applySignature=function(t){return this.inputs[t.inputIndex].addSignature(this,t),this},O.prototype.isFullySigned=function(){return a.each(this.inputs,(function(t){if(t.isFullySigned===b.prototype.isFullySigned)throw new c.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")})),a.every(a.map(this.inputs,(function(t){return t.isFullySigned()})))},O.prototype.isValidSignature=function(t){if(this.inputs[t.inputIndex].isValidSignature===b.prototype.isValidSignature)throw new c.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[t.inputIndex].isValidSignature(this,t)},O.prototype.verifySignature=function(t,e,r,n,i,o){return g.verify(this,t,e,r,n,i,o)},O.prototype.verify=function(t){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var e=new A(0),r=0;r1e6)return"transaction over the maximum block size";var i={};for(r=0;r100)return"coinbase transaction script size invalid"}else for(r=0;r=(t||this._feePerKb||O.FEE_PER_KB)/1e3},O.prototype.prevouts=function(){var t=new h;return a.each(this.inputs,(function(e){t.writeReverse(e.prevTxId),t.writeUInt32LE(e.outputIndex)})),t.toBuffer().toString("hex")},O.prototype.isSealed=function(){return this.sealed},O.prototype.getPreimage=function(t,e,r){return s.checkArgumentType(t,"number","inputIndex"),e=e||m.SIGHASH_ALL|m.SIGHASH_FORKID,r=r||!1,t=t||0,this.inputs[t].getPreimage(this,t,e,r).toString("hex")},O.prototype.getSignature=function(t,e,r){s.checkArgumentType(t,"number","inputIndex");var n=[],i=(this._inputsMap||new Map).get(t);if(e=e||(i?i.privateKey:this._privateKey)){r=r||m.SIGHASH_ALL|m.SIGHASH_FORKID;var o=this.inputs[t].getSignatures(this,e,t,r);return a.each(o,(function(t){n.push(t.signature.toTxFormat().toString("hex"))})),1===n.length?n[0]:n}return[]},O.prototype.addInputFromPrevTx=function(t,e){s.checkArgumentType(t,O,"prevTx");var r=e||0,n=t.outputs[r];return n.script.isPublicKeyHashOut()?this.addInput(new w({prevTxId:t.id,outputIndex:r,script:new x(""),output:n})):this.addInput(new b({prevTxId:t.id,outputIndex:r,script:new x(""),output:n}))},O.prototype.addDummyInput=function(t,e){return s.checkArgumentType(t,x,"script"),s.checkArgumentType(e,"number","satoshis"),this.addInput(new b({prevTxId:"a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458",outputIndex:0,script:new x(""),output:new k({script:t,satoshis:e})}))},O.prototype.dummyChange=function(){return this.change(O.DUMMY_PRIVATEKEY.toAddress())},O.prototype.verifyScript=function(t){if(s.checkArgumentType(t,"number","inputIndex"),!this.inputs[t])throw new c.Transaction.Input.MissingInput;return this.inputs[t].verify(this,t)},O.prototype.verifyInputScript=function(t){return this.verifyScript(t)},O.prototype.getInputAmount=function(t){if(s.checkArgumentType(t,"number","inputIndex"),!this.inputs[t])throw new c.Transaction.Input.MissingInput;return this.inputs[t].output.satoshis},O.prototype.getOutputAmount=function(t){if(s.checkArgumentType(t,"number","outputIndex"),!this.outputs[t])throw new c.Transaction.MissingOutput;return this.outputs[t].satoshis},t.exports=O},28871:function(t,e,r){"use strict";var n=r(61504),i=r(99281),o=r(53604),a=r(66154),s=r(81386);function u(t){if(!(this instanceof u))return new u(t);i.checkArgument(n.isObject(t),"Must provide an object from where to extract data");var e=t.address?new s(t.address):void 0,r=t.txid?t.txid:t.txId;if(!r||!o.isHexaString(r)||r.length>64)throw new Error("Invalid TXID in object",t);var c=n.isUndefined(t.vout)?t.outputIndex:t.vout;if(!n.isNumber(c))throw new Error("Invalid outputIndex, received "+c);i.checkArgument(!n.isUndefined(t.scriptPubKey)||!n.isUndefined(t.script),"Must provide the scriptPubKey for that output!");var f=new a(t.scriptPubKey||t.script);i.checkArgument(!n.isUndefined(t.amount)||!n.isUndefined(t.satoshis),"Must provide an amount for the output");var l=n.isUndefined(t.amount)?t.satoshis:Math.round(1e8*t.amount);i.checkArgument(n.isNumber(l),"Amount must be a number"),o.defineImmutable(this,{address:e,txId:r,outputIndex:c,script:f,satoshis:l})}u.prototype.inspect=function(){return""},u.prototype.toString=function(){return this.txId+":"+this.outputIndex},u.fromObject=function(t){return new u(t)},u.prototype.toObject=u.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:Number.parseFloat((this.satoshis/1e8).toFixed(8))}},t.exports=u},61504:function(t,e,r){"use strict";var n=r(861).default,i={isArray:function(t){return Array.isArray(t)},isNumber:function(t){return"number"===typeof t},isObject:function(t){return t&&"object"===typeof t},isString:function(t){return"string"===typeof t},isUndefined:function(t){return"undefined"===typeof t},isFunction:function(t){return"function"===typeof t},isNull:function(t){return null===t},isDate:function(t){return t instanceof Date},extend:function(t,e){return Object.assign(t,e)},noop:function(){},every:function(t,e){return t.every(e||function(t){return t})},map:function(t,e){return Array.from(t).map(e||function(t){return t})},includes:function(t,e){return t.includes(e)},each:function(t,e){return t.forEach(e)},clone:function(t){return Object.assign({},t)},pick:function(t,e){var r={};return e.forEach((function(e){"undefined"!==typeof t[e]&&(r[e]=t[e])})),r},values:function(t){return Object.values(t)},filter:function(t,e){return t.filter(e)},reduce:function(t,e,r){return t.reduce(e,r)},without:function(t,e){return t.filter((function(t){return t!==e}))},shuffle:function(t){for(var e=t.slice(0),r=e.length-1;r>0;r--){var n=Math.floor(Math.random()*(r+1)),i=[e[n],e[r]];e[r]=i[0],e[n]=i[1]}return e},difference:function(t,e){return t.filter((function(t){return!e.includes(t)}))},findIndex:function(t,e){return t.findIndex(e)},some:function(t,e){return t.some(e)},range:function(t){return n(Array(t).keys())},isPositiveNumber:function(t){return t<126}};t.exports=i},53604:function(t,e,r){"use strict";var n=r(19778).Buffer,i=r(61504),o=r(99281),a=function(t){return!!i.isString(t)&&/^[0-9a-fA-F]+$/.test(t)};t.exports={isValidJSON:function(t){var e;if(!i.isString(t))return!1;try{e=JSON.parse(t)}catch(r){return!1}return"object"===typeof e},isHexa:a,isHexaString:a,defineImmutable:function(t,e){return Object.keys(e).forEach((function(r){Object.defineProperty(t,r,{configurable:!1,enumerable:!0,value:e[r]})})),t},isNaturalNumber:function(t){return"number"===typeof t&&isFinite(t)&&Math.floor(t)===t&&t>=0},integerAsBuffer:function(t){o.checkArgumentType(t,"number","integer");var e=n.allocUnsafe(4);return e.writeUInt32BE(t,0),e}}},99281:function(t,e,r){"use strict";var n=r(67690),i=r(61504);t.exports={checkState:function(t,e){if(!t)throw new n.InvalidState(e)},checkArgument:function(t,e,r,i){if(!t)throw new n.InvalidArgument(e,r,i)},checkArgumentType:function(t,e,o){if(o=o||"(unknown name)",i.isString(e)){if("Buffer"===e){if(!r(19778).Buffer.isBuffer(t))throw new n.InvalidArgumentType(t,e,o)}else if(typeof t!==e)throw new n.InvalidArgumentType(t,e,o)}else if(!(t instanceof e))throw new n.InvalidArgumentType(t,e.name,o)}}},41264:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=r(52333).Buffer}catch(k){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,c=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],M=8191&S,k=S>>>13,x=0|a[5],E=8191&x,A=x>>>13,O=0|a[6],T=8191&O,P=O>>>13,I=0|a[7],R=8191&I,C=I>>>13,N=0|a[8],B=8191&N,j=N>>>13,L=0|a[9],D=8191&L,U=L>>>13,F=0|s[0],H=8191&F,z=F>>>13,K=0|s[1],q=8191&K,V=K>>>13,G=0|s[2],W=8191&G,Y=G>>>13,$=0|s[3],Z=8191&$,X=$>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ft=0|s[8],lt=8191&ft,ht=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(l,H))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,H)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,z))+Math.imul(m,H)|0,o=Math.imul(m,z);var vt=(c+(n=n+Math.imul(l,q)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(h,q)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,H),i=(i=Math.imul(v,z))+Math.imul(y,H)|0,o=Math.imul(y,z),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,V)|0;var yt=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(h,W)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,H),i=(i=Math.imul(w,z))+Math.imul(_,H)|0,o=Math.imul(_,z),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Y)|0;var bt=(c+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(h,Z)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,H),i=(i=Math.imul(M,z))+Math.imul(k,H)|0,o=Math.imul(k,z),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,H),i=(i=Math.imul(E,z))+Math.imul(A,H)|0,o=Math.imul(A,z),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,H),i=(i=Math.imul(T,z))+Math.imul(P,H)|0,o=Math.imul(P,z),n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var St=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(R,H),i=(i=Math.imul(R,z))+Math.imul(C,H)|0,o=Math.imul(C,z),n=n+Math.imul(T,q)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,z))+Math.imul(j,H)|0,o=Math.imul(j,z),n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,z))+Math.imul(U,H)|0,o=Math.imul(U,z),n=n+Math.imul(B,q)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var xt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(U,q)|0,o=Math.imul(U,V),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var Et=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var At=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,X))+Math.imul(U,Z)|0,o=Math.imul(U,X),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var Ot=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ht)|0;var Tt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,at))+Math.imul(U,ot)|0,o=Math.imul(U,at),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ct)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var It=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ct))+Math.imul(U,ut)|0,o=Math.imul(U,ct),n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ht)|0;var Rt=(c+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(D,lt),i=(i=Math.imul(D,ht))+Math.imul(U,lt)|0,o=Math.imul(U,ht);var Ct=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Nt=(c+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return c=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=vt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Mt,u[8]=kt,u[9]=xt,u[10]=Et,u[11]=At,u[12]=Ot,u[13]=Tt,u[14]=Pt,u[15]=It,u[16]=Rt,u[17]=Ct,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=h),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?d(this,t,e):n<63?h(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e),r},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var h=0,d=1;0===(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0===(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(y,v),y.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},i(M,S),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},99076:function(t){"function"===typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},35865:function(t,e,r){var n=r(19778).Buffer;t.exports=function(t,e){for(var r=Math.min(t.length,e.length),i=new n(r),o=0;ol)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,d.prototype),e}function d(t,e,r){if("number"===typeof t){if("string"===typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return g(t)}return p(t,e,r)}function p(t,e,r){if("string"===typeof t)return function(t,e){"string"===typeof e&&""!==e||(e="utf8");if(!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|w(t,e),n=h(r),i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(tt(t,Uint8Array)){var e=new Uint8Array(t);return y(e.buffer,e.byteOffset,e.byteLength)}return v(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(tt(t,ArrayBuffer)||t&&tt(t.buffer,ArrayBuffer))return y(t,e,r);if("undefined"!==typeof SharedArrayBuffer&&(tt(t,SharedArrayBuffer)||t&&tt(t.buffer,SharedArrayBuffer)))return y(t,e,r);if("number"===typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return d.from(n,e,r);var i=function(t){if(d.isBuffer(t)){var e=0|b(t.length),r=h(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!==typeof t.length||et(t.length)?h(0):v(t);if("Buffer"===t.type&&Array.isArray(t.data))return v(t.data)}(t);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof t[Symbol.toPrimitive])return d.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function m(t){if("number"!==typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function g(t){return m(t),h(t<0?0:0|b(t))}function v(t){for(var e=t.length<0?0:0|b(t.length),r=h(e),n=0;n=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return 0|t}function w(t,e){if(d.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||tt(t,ArrayBuffer))return t.byteLength;if("string"!==typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return X(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(t).length;default:if(i)return n?-1:X(t).length;e=(""+e).toLowerCase(),i=!0}}function _(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return N(this,e,r);case"base64":return P(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function S(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function M(t,e,r,n,i){if(0===t.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),et(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof e&&(e=d.from(e,n)),d.isBuffer(e))return 0===e.length?-1:k(t,e,r,n,i);if("number"===typeof e)return e&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):k(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function k(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var f=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var l=!0,h=0;hi&&(n=i):n=i;var o,a=e.length;for(n>a/2&&(n=a/2),o=0;o>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function P(t,e,r){return 0===e&&r===t.length?u.fromByteArray(t):u.fromByteArray(t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:o>223?3:o>191?2:1;if(i+s<=r){var u=void 0,c=void 0,f=void 0,l=void 0;switch(s){case 1:o<128&&(a=o);break;case 2:128===(192&(u=t[i+1]))&&(l=(31&o)<<6|63&u)>127&&(a=l);break;case 3:u=t[i+1],c=t[i+2],128===(192&u)&&128===(192&c)&&(l=(15&o)<<12|(63&u)<<6|63&c)>2047&&(l<55296||l>57343)&&(a=l);break;case 4:u=t[i+1],c=t[i+2],f=t[i+3],128===(192&u)&&128===(192&c)&&128===(192&f)&&(l=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&f)>65535&&l<1114112&&(a=l)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return function(t){var e=t.length;if(e<=R)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nn.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else{if(!d.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},d.byteLength=w,d.prototype._isBuffer=!0,d.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;er&&(t+=" ... "),""},f&&(d.prototype[f]=d.prototype.inspect),d.prototype.compare=function(t,e,r,n,i){if(tt(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return A(this,t,e,r);case"base64":return O(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function D(t,e,r,n,i,o){if(!d.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function U(t,e,r,n,i){W(e,n,i,t,r,7);var o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;var a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,r}function F(t,e,r,n,i){W(e,n,i,t,r,7);var o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;var a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a>>=8,t[r+2]=a,a>>=8,t[r+1]=a,a>>=8,t[r]=a,r+8}function H(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function z(t,e,r,n,i){return e=+e,r>>>=0,i||H(t,0,r,4),c.write(t,e,r,n,23,4),r+4}function K(t,e,r,n,i){return e=+e,r>>>=0,i||H(t,0,r,8),c.write(t,e,r,n,52,8),r+8}d.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||L(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||L(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},d.prototype.readUint8=d.prototype.readUInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),this[t]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]|this[t+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]<<8|this[t+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},d.prototype.readBigUInt64LE=nt((function(t){Y(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);var n=e+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,24),i=this[++t]+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);var n=e*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t],i=this[++t]*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,e>>>=0,r||L(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},d.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},d.prototype.readInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},d.prototype.readInt16LE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt16BE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},d.prototype.readInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},d.prototype.readBigInt64LE=nt((function(t){Y(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);var n=this[t+4]+this[t+5]*Math.pow(2,8)+this[t+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);var n=(e<<24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t];return(BigInt(n)<>>=0,e||L(t,4,this.length),c.read(this,t,!0,23,4)},d.prototype.readFloatBE=function(t,e){return t>>>=0,e||L(t,4,this.length),c.read(this,t,!1,23,4)},d.prototype.readDoubleLE=function(t,e){return t>>>=0,e||L(t,8,this.length),c.read(this,t,!0,52,8)},d.prototype.readDoubleBE=function(t,e){return t>>>=0,e||L(t,8,this.length),c.read(this,t,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||D(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||D(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},d.prototype.writeUint8=d.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,1,255,0),this[e]=255&t,e+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},d.prototype.writeBigUInt64LE=nt((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeBigUInt64BE=nt((function(t){return F(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);D(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},d.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);D(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},d.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},d.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},d.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},d.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},d.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},d.prototype.writeBigInt64LE=nt((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeBigInt64BE=nt((function(t){return F(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeFloatLE=function(t,e,r){return z(this,t,e,!0,r)},d.prototype.writeFloatBE=function(t,e,r){return z(this,t,e,!1,r)},d.prototype.writeDoubleLE=function(t,e,r){return K(this,t,e,!0,r)},d.prototype.writeDoubleBE=function(t,e,r){return K(this,t,e,!1,r)},d.prototype.copy=function(t,e,r,n){if(!d.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"===typeof t)for(o=e;o=n+4;r-=3)e="_".concat(t.slice(r-3,r)).concat(e);return"".concat(t.slice(0,r)).concat(e)}function W(t,e,r,n,i,o){if(t>r||t3?0===e||e===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(o+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(o+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(o+1)-1).concat(s):">= ".concat(e).concat(s," and <= ").concat(r).concat(s),new q.ERR_OUT_OF_RANGE("value",a,t)}!function(t,e,r){Y(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||$(e,t.length-(r+1))}(n,i,o)}function Y(t,e){if("number"!==typeof t)throw new q.ERR_INVALID_ARG_TYPE(e,"number",t)}function $(t,e,r){if(Math.floor(t)!==t)throw Y(t,r),new q.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new q.ERR_BUFFER_OUT_OF_BOUNDS;throw new q.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(e),t)}V("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),V("ERR_INVALID_ARG_TYPE",(function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(typeof e)}),TypeError),V("ERR_OUT_OF_RANGE",(function(t,e,r){var n='The value of "'.concat(t,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=G(String(r)):"bigint"===typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=G(i)),i+="n"),n+=" It must be ".concat(e,". Received ").concat(i)}),RangeError);var Z=/[^+/0-9A-Za-z-_]/g;function X(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function J(t){return u.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(Z,"")).length<2)return"";for(;t.length%4!==0;)t+="=";return t}(t))}function Q(t,e,r,n){var i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function tt(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function et(t){return t!==t}var rt=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}();function nt(t){return"undefined"===typeof BigInt?it:t}function it(){throw new Error("BigInt not supported")}},44037:function(t,e,r){"use strict";var n=r(52506),i=r(19722),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"===typeof r&&o(t,".prototype.")>-1?i(r):r}},19722:function(t,e,r){"use strict";var n=r(33350),i=r(52506),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),f=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(h){c=null}t.exports=function(t){var e=s(n,a,arguments);u&&c&&(u(e,"length").configurable&&c(e,"length",{value:1+f(0,t.length-(arguments.length-1))}));return e};var l=function(){return s(n,o,arguments)};c?c(t.exports,"apply",{value:l}):t.exports.apply=l},13505:function(t,e,r){"use strict";var n=r(42122).default,i=r(27424).default,o=r(89728).default,a=r(56690).default,s=r(67822),u=r(91197),c=u.stdout,f=u.stderr,l=r(32904),h=l.stringReplaceAll,d=l.stringEncaseCRLFWithFirstIndex,p=Array.isArray,m=["ansi","ansi","ansi256","ansi16m"],g=Object.create(null),v=o((function t(e){return a(this,t),y(e)})),y=function(t){var e={};return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");var r=c?c.level:0;t.level=void 0===e.level?r:e.level}(e,t),e.template=function(){for(var t=arguments.length,r=new Array(t),n=0;n1?e-1:0),i=1;i0?(m=h)[v].apply(m,n(y)):h[v]}}return h}t.exports=function(t,e){var r=[],n=[],i=[];if(e.replace(a,(function(e,o,a,s,u,c){if(o)i.push(l(o));else if(s){var f=i.join("");i=[],n.push(0===r.length?f:p(t,r)(f)),r.push({inverse:a,styles:d(s)})}else if(u){if(0===r.length)throw new Error("Found extraneous } in Chalk template literal");n.push(p(t,r)(i.join(""))),i=[],r.pop()}else i.push(c)})),n.push(i.join("")),r.length>0){var o="Chalk template literal is missing ".concat(r.length," closing bracket").concat(1===r.length?"":"s"," (`}`)");throw new Error(o)}return n.join("")}},32904:function(t){"use strict";t.exports={stringReplaceAll:function(t,e,r){var n=t.indexOf(e);if(-1===n)return t;var i=e.length,o=0,a="";do{a+=t.substr(o,n-o)+e+r,o=n+i,n=t.indexOf(e,o)}while(-1!==n);return a+=t.substr(o)},stringEncaseCRLFWithFirstIndex:function(t,e,r,n){var i=0,o="";do{var a="\r"===t[n-1];o+=t.substr(i,(a?n-1:n)-i)+e+(a?"\r\n":"\n")+r,i=n+1,n=t.indexOf("\n",i)}while(-1!==n);return o+=t.substr(i)}}},92221:function(t,e,r){var n=r(82543).Buffer,i=r(41064).Transform,o=r(15948).s;function a(t){i.call(this),this.hashMode="string"===typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(12534)(a,i),a.prototype.update=function(t,e,r){"string"===typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(i){n=i}finally{r(n)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(r){e=r}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=a},57049:function(t,e,r){for(var n=r(27424).default,i=r(47910),o={},a=0,s=Object.keys(i);a1&&(i-=1)),[360*i,100*o,100*c]},c.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2];return[c.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(r,n))),100*(n=1-1/255*Math.max(e,Math.max(r,n)))]},c.rgb.cmyk=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n);return[100*((1-e-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*i]},c.rgb.keyword=function(t){var e=o[t];if(e)return e;for(var r,n,a,s=1/0,u=0,c=Object.keys(i);u.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*r+.0722*n),100*(.0193*e+.1192*r+.9505*n)]},c.rgb.lab=function(t){var e=c.rgb.xyz(t),r=e[0],n=e[1],i=e[2];return n/=100,i/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},c.hsl.rgb=function(t){var e,r,n,i=t[0]/360,o=t[1]/100,a=t[2]/100;if(0===o)return[n=255*a,n,n];for(var s=2*a-(e=a<.5?a*(1+o):a+o-a*o),u=[0,0,0],c=0;c<3;c++)(r=i+1/3*-(c-1))<0&&r++,r>1&&r--,n=6*r<1?s+6*(e-s)*r:2*r<1?e:3*r<2?s+(e-s)*(2/3-r)*6:s,u[c]=255*n;return u},c.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,i*=o<=1?o:2-o,[e,100*(0===n?2*i/(o+i):2*r/(n+r)),100*((n+r)/2)]},c.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),a=255*n*(1-r),s=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,u,a];case 1:return[s,n,a];case 2:return[a,n,u];case 3:return[a,s,n];case 4:return[u,a,n];case 5:return[n,a,s]}},c.hsv.hsl=function(t){var e,r,n=t[0],i=t[1]/100,o=t[2]/100,a=Math.max(o,.01);r=(2-i)*o;var s=(2-i)*a;return e=i*a,[n,100*(e=(e/=s<=1?s:2-s)||0),100*(r/=2)]},c.hwb.rgb=function(t){var e,r=t[0]/360,n=t[1]/100,i=t[2]/100,o=n+i;o>1&&(n/=o,i/=o);var a=Math.floor(6*r),s=1-i;e=6*r-a,0!==(1&a)&&(e=1-e);var u,c,f,l=n+e*(s-n);switch(a){default:case 6:case 0:u=s,c=l,f=n;break;case 1:u=l,c=s,f=n;break;case 2:u=n,c=s,f=l;break;case 3:u=n,c=l,f=s;break;case 4:u=l,c=n,f=s;break;case 5:u=s,c=n,f=l}return[255*u,255*c,255*f]},c.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},c.xyz.rgb=function(t){var e,r,n,i=t[0]/100,o=t[1]/100,a=t[2]/100;return r=-.9689*i+1.8758*o+.0415*a,n=.0557*i+-.204*o+1.057*a,e=(e=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(e=Math.min(Math.max(0,e),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},c.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2];return r/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(e-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},c.lab.xyz=function(t){var e,r,n,i=t[0];e=t[1]/500+(r=(i+16)/116),n=r-t[2]/200;var o=Math.pow(r,3),a=Math.pow(e,3),s=Math.pow(n,3);return r=o>.008856?o:(r-16/116)/7.787,e=a>.008856?a:(e-16/116)/7.787,n=s>.008856?s:(n-16/116)/7.787,[e*=95.047,r*=100,n*=108.883]},c.lab.lch=function(t){var e,r=t[0],n=t[1],i=t[2];return(e=360*Math.atan2(i,n)/2/Math.PI)<0&&(e+=360),[r,Math.sqrt(n*n+i*i),e]},c.lch.lab=function(t){var e=t[0],r=t[1],n=t[2]/360*2*Math.PI;return[e,r*Math.cos(n),r*Math.sin(n)]},c.rgb.ansi16=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=n(t,3),i=r[0],o=r[1],a=r[2],s=null===e?c.rgb.hsv(t)[2]:e;if(0===(s=Math.round(s/50)))return 30;var u=30+(Math.round(a/255)<<2|Math.round(o/255)<<1|Math.round(i/255));return 2===s&&(u+=60),u},c.hsv.ansi16=function(t){return c.rgb.ansi16(c.hsv.rgb(t),t[2])},c.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},c.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var r=.5*(1+~~(t>50));return[(1&e)*r*255,(e>>1&1)*r*255,(e>>2&1)*r*255]},c.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var r;return t-=16,[Math.floor(t/36)/5*255,Math.floor((r=t%36)/6)/5*255,r%6/5*255]},c.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},c.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];3===e[0].length&&(r=r.split("").map((function(t){return t+t})).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},c.rgb.hcg=function(t){var e,r=t[0]/255,n=t[1]/255,i=t[2]/255,o=Math.max(Math.max(r,n),i),a=Math.min(Math.min(r,n),i),s=o-a;return e=s<=0?0:o===r?(n-i)/s%6:o===n?2+(i-r)/s:4+(r-n)/s,e/=6,[360*(e%=1),100*s,100*(s<1?a/(1-s):0)]},c.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],100*n,100*i]},c.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],100*n,100*i]},c.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(0===r)return[255*n,255*n,255*n];var i,o=[0,0,0],a=e%1*6,s=a%1,u=1-s;switch(Math.floor(a)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=u,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=u,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=u}return i=(1-r)*n,[255*(r*o[0]+i),255*(r*o[1]+i),255*(r*o[2]+i)]},c.hcg.hsv=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e),n=0;return r>0&&(n=e/r),[t[0],100*n,100*r]},c.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100*(1-e)+.5*e,n=0;return r>0&&r<.5?n=e/(2*r):r>=.5&&r<1&&(n=e/(2*(1-r))),[t[0],100*n,100*r]},c.hcg.hwb=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e);return[t[0],100*(r-e),100*(1-r)]},c.hwb.hcg=function(t){var e=t[1]/100,r=1-t[2]/100,n=r-e,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],100*n,100*i]},c.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},c.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},c.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},c.gray.hsl=function(t){return[0,0,t[0]]},c.gray.hsv=c.gray.hsl,c.gray.hwb=function(t){return[0,100,t[0]]},c.gray.cmyk=function(t){return[0,0,0,t[0]]},c.gray.lab=function(t){return[t[0],0,0]},c.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r},c.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},87287:function(t,e,r){var n=r(57049),i=r(49672),o={};Object.keys(n).forEach((function(t){o[t]={},Object.defineProperty(o[t],"channels",{value:n[t].channels}),Object.defineProperty(o[t],"labels",{value:n[t].labels});var e=i(t);Object.keys(e).forEach((function(r){var n=e[r];o[t][r]=function(t){var e=function(){for(var e=arguments.length,r=new Array(e),n=0;n1&&(r=i);var o=t(r);if("object"===typeof o)for(var a=o.length,s=0;s1&&(r=i),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}(n)}))})),t.exports=o},49672:function(t,e,r){var n=r(57049);function i(t){var e=function(){for(var t={},e=Object.keys(n),r=e.length,i=0;ic)return 1;if(c>u)return-1}var f=o[o.length-1],l=a[a.length-1];if(f&&l){var h=f.split(".").map(n),d=l.split(".").map(n);for(s=0;sd[s])return 1;if(d[s]>h[s])return-1}}else if(f||l)return f?-1:1;return 0}var a=[">",">=","=","<","<="],s={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]};function u(t){if("string"!==typeof t)throw new TypeError("Invalid operator type, expected string but got "+typeof t);if(-1===a.indexOf(t))throw new TypeError("Invalid operator, expected one of "+a.join("|"))}return o.validate=function(e){return"string"===typeof e&&t.test(e)},o.compare=function(t,e,r){u(r);var n=o(t,e);return s[r].indexOf(n)>-1},o})?r.apply(e,n):r)||(t.exports=i)},79773:function(t){function e(t){if(t)return function(t){for(var r in e.prototype)t[r]=e.prototype[r];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","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],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=l[t],d=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,c=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],M=8191&S,k=S>>>13,x=0|a[5],E=8191&x,A=x>>>13,O=0|a[6],T=8191&O,P=O>>>13,I=0|a[7],R=8191&I,C=I>>>13,N=0|a[8],B=8191&N,j=N>>>13,L=0|a[9],D=8191&L,U=L>>>13,F=0|s[0],H=8191&F,z=F>>>13,K=0|s[1],q=8191&K,V=K>>>13,G=0|s[2],W=8191&G,Y=G>>>13,$=0|s[3],Z=8191&$,X=$>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ft=0|s[8],lt=8191&ft,ht=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(l,H))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,H)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,z))+Math.imul(m,H)|0,o=Math.imul(m,z);var vt=(c+(n=n+Math.imul(l,q)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(h,q)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,H),i=(i=Math.imul(v,z))+Math.imul(y,H)|0,o=Math.imul(y,z),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,V)|0;var yt=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(h,W)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,H),i=(i=Math.imul(w,z))+Math.imul(_,H)|0,o=Math.imul(_,z),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Y)|0;var bt=(c+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(h,Z)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,H),i=(i=Math.imul(M,z))+Math.imul(k,H)|0,o=Math.imul(k,z),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,H),i=(i=Math.imul(E,z))+Math.imul(A,H)|0,o=Math.imul(A,z),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,H),i=(i=Math.imul(T,z))+Math.imul(P,H)|0,o=Math.imul(P,z),n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var St=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(R,H),i=(i=Math.imul(R,z))+Math.imul(C,H)|0,o=Math.imul(C,z),n=n+Math.imul(T,q)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,z))+Math.imul(j,H)|0,o=Math.imul(j,z),n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,z))+Math.imul(U,H)|0,o=Math.imul(U,z),n=n+Math.imul(B,q)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var xt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(U,q)|0,o=Math.imul(U,V),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var Et=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var At=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,X))+Math.imul(U,Z)|0,o=Math.imul(U,X),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var Ot=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ht)|0;var Tt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,at))+Math.imul(U,ot)|0,o=Math.imul(U,at),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ct)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var It=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ct))+Math.imul(U,ut)|0,o=Math.imul(U,ct),n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ht)|0;var Rt=(c+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(D,lt),i=(i=Math.imul(D,ht))+Math.imul(U,lt)|0,o=Math.imul(U,ht);var Ct=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Nt=(c+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return c=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=vt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Mt,u[8]=kt,u[9]=xt,u[10]=Et,u[11]=At,u[12]=Ot,u[13]=Tt,u[14]=Pt,u[15]=It,u[16]=Rt,u[17]=Ct,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var h=0,d=1;0===(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0===(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(b,y),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},83569:function(t,e,r){"use strict";var n=r(12534),i=r(68437),o=r(83375),a=r(85730),s=r(92221);function u(t){s.call(this,"digest"),this._hash=t}n(u,s),u.prototype._update=function(t){this._hash.update(t)},u.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new o:new u(a(t))}},55378:function(t,e,r){var n=r(68437);t.exports=function(t){return(new n).update(t).digest()}},57651:function(t,e,r){"use strict";var n=r(12534),i=r(43189),o=r(92221),a=r(82543).Buffer,s=r(55378),u=r(83375),c=r(85730),f=a.alloc(128);function l(t,e){o.call(this,"digest"),"string"===typeof e&&(e=a.from(e));var r="sha512"===t||"sha384"===t?128:64;(this._alg=t,this._key=e,e.length>r)?e=("rmd160"===t?new u:c(t)).update(e).digest():e.lengths?e=t(e):e.length=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=function(){var t=!1;return function(){t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||function(){},t.exports=r(18472)(e),t.exports.formatters.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},18472:function(t,e,r){var n=r(861).default;t.exports=function(t){function e(t){var r,n,o,a=null;function s(){for(var t=arguments.length,n=new Array(t),i=0;i2?arguments[2]:{},o=n(e);i&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;s0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e>>1];r=o.r28shl(r,s),i=o.r28shl(i,s),o.pc2(r,i,t.keys,a)}},u.prototype._update=function(t,e,r,n){var i=this._desState,a=o.readUInt32BE(t,e),s=o.readUInt32BE(t,e+4);o.ip(a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,a,s,i.tmp,0):this._decrypt(i,a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],o.writeUInt32BE(r,a,n),o.writeUInt32BE(r,s,n+4)},u.prototype._pad=function(t,e){if(!1===this.padding)return!1;for(var r=t.length-e,n=e;n>>0,a=h}o.rip(s,a,n,i)},u.prototype._decrypt=function(t,e,r,n,i){for(var a=r,s=e,u=t.keys.length-2;u>=0;u-=2){var c=t.keys[u],f=t.keys[u+1];o.expand(a,t.tmp,0),c^=t.tmp[0],f^=t.tmp[1];var l=o.substitute(c,f),h=a;a=(s^o.permute(l))>>>0,s=h}o.rip(a,s,n,i)}},38534:function(t,e,r){"use strict";var n=r(72325),i=r(12534),o=r(834),a=r(23688);function s(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[a.create({type:"encrypt",key:r}),a.create({type:"decrypt",key:i}),a.create({type:"encrypt",key:o})]:[a.create({type:"decrypt",key:o}),a.create({type:"encrypt",key:i}),a.create({type:"decrypt",key:r})]}function u(t){o.call(this,t);var e=new s(this.type,this.options.key);this._edeState=e}i(u,o),t.exports=u,u.create=function(t){return new u(t)},u.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=a.prototype._pad,u.prototype._unpad=a.prototype._unpad},47427:function(t,e){"use strict";e.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},e.rip=function(t,e,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=e>>>s+a&1,i<<=1,i|=t>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=e>>>s+a&1,o<<=1,o|=t>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.pc1=function(t,e,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.r28shl=function(t,e){return t<>>28-e};var r=[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];e.pc2=function(t,e,n,i){for(var o=0,a=0,s=r.length>>>1,u=0;u>>r[u]&1;for(u=s;u>>r[u]&1;n[i+0]=o>>>0,n[i+1]=a>>>0},e.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>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];e.substitute=function(t,e){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(t>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(e>>>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];e.permute=function(t){for(var e=0,r=0;r>>i[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var n=t.toString(2);n.lengtht;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),e.cmp(u)){if(!e.cmp(c))for(;r.mod(f).cmp(l);)r.iadd(d)}else for(;r.mod(o).cmp(h);)r.iadd(d);if(g(p=r.shrn(1))&&g(r)&&v(p)&&v(r)&&a.test(p)&&a.test(r))return r}}},54231:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(7748).Buffer}catch(x){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","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],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=l[t],d=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,c=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],M=8191&S,k=S>>>13,x=0|a[5],E=8191&x,A=x>>>13,O=0|a[6],T=8191&O,P=O>>>13,I=0|a[7],R=8191&I,C=I>>>13,N=0|a[8],B=8191&N,j=N>>>13,L=0|a[9],D=8191&L,U=L>>>13,F=0|s[0],H=8191&F,z=F>>>13,K=0|s[1],q=8191&K,V=K>>>13,G=0|s[2],W=8191&G,Y=G>>>13,$=0|s[3],Z=8191&$,X=$>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ft=0|s[8],lt=8191&ft,ht=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(l,H))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,H)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,z))+Math.imul(m,H)|0,o=Math.imul(m,z);var vt=(c+(n=n+Math.imul(l,q)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(h,q)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,H),i=(i=Math.imul(v,z))+Math.imul(y,H)|0,o=Math.imul(y,z),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,V)|0;var yt=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(h,W)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,H),i=(i=Math.imul(w,z))+Math.imul(_,H)|0,o=Math.imul(_,z),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Y)|0;var bt=(c+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(h,Z)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,H),i=(i=Math.imul(M,z))+Math.imul(k,H)|0,o=Math.imul(k,z),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,H),i=(i=Math.imul(E,z))+Math.imul(A,H)|0,o=Math.imul(A,z),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,H),i=(i=Math.imul(T,z))+Math.imul(P,H)|0,o=Math.imul(P,z),n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var St=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(R,H),i=(i=Math.imul(R,z))+Math.imul(C,H)|0,o=Math.imul(C,z),n=n+Math.imul(T,q)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,z))+Math.imul(j,H)|0,o=Math.imul(j,z),n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,z))+Math.imul(U,H)|0,o=Math.imul(U,z),n=n+Math.imul(B,q)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var xt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(U,q)|0,o=Math.imul(U,V),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var Et=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var At=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,X))+Math.imul(U,Z)|0,o=Math.imul(U,X),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var Ot=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ht)|0;var Tt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,at))+Math.imul(U,ot)|0,o=Math.imul(U,at),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ct)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var It=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ct))+Math.imul(U,ut)|0,o=Math.imul(U,ct),n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ht)|0;var Rt=(c+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(D,lt),i=(i=Math.imul(D,ht))+Math.imul(U,lt)|0,o=Math.imul(U,ht);var Ct=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Nt=(c+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return c=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=vt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Mt,u[8]=kt,u[9]=xt,u[10]=Et,u[11]=At,u[12]=Ot,u[13]=Tt,u[14]=Pt,u[15]=It,u[16]=Rt,u[17]=Ct,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var h=0,d=1;0===(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0===(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(b,y),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6289:function(t,e,r){"use strict";var n=e;n.version=r(18597).i8,n.utils=r(82629),n.rand=r(26084),n.curve=r(37075),n.curves=r(13297),n.ec=r(74170),n.eddsa=r(20156)},55950:function(t,e,r){"use strict";var n=r(37548),i=r(82629),o=i.getNAF,a=i.getJSF,s=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){s(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<=a;f--)u=(u<<1)+n[f];c.push(u)}for(var l=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(a=0;a=0;c--){for(var f=0;c>=0&&0===a[c];c--)f++;if(c>=0&&f++,u=u.dblp(f),c<0)break;var l=a[c];s(0!==l),u="affine"===t.type?l>0?u.mixedAdd(i[l-1>>1]):u.mixedAdd(i[-l-1>>1].neg()):l>0?u.add(i[l-1>>1]):u.add(i[-l-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){var s,u,c,f=this._wnafT1,l=this._wnafT2,h=this._wnafT3,d=0;for(s=0;s=1;s-=2){var m=s-1,g=s;if(1===f[m]&&1===f[g]){var v=[e[m],null,null,e[g]];0===e[m].y.cmp(e[g].y)?(v[1]=e[m].add(e[g]),v[2]=e[m].toJ().mixedAdd(e[g].neg())):0===e[m].y.cmp(e[g].y.redNeg())?(v[1]=e[m].toJ().mixedAdd(e[g]),v[2]=e[m].add(e[g].neg())):(v[1]=e[m].toJ().mixedAdd(e[g]),v[2]=e[m].toJ().mixedAdd(e[g].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],b=a(r[m],r[g]);for(d=Math.max(b[0].length,d),h[m]=new Array(d),h[g]=new Array(d),u=0;u=0;s--){for(var k=0;s>=0;){var x=!0;for(u=0;u=0&&k++,S=S.dblp(k),s<0)break;for(u=0;u0?c=l[u][E-1>>1]:E<0&&(c=l[u][-E-1>>1].neg()),S="affine"===c.type?S.mixedAdd(c):S.add(c))}}for(s=0;s=Math.ceil((t.bitLength()+1)/e.step)},c.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),u=i.redMul(a),c=o.redMul(s),f=i.redMul(s),l=a.redMul(o);return this.curve.point(u,c,l,f)},c.prototype._projDbl=function(){var t,e,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(s)).redAdd(u);this.zOne?(t=a.redSub(s).redSub(u).redMul(c.redSub(this.curve.two)),e=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),t=a.redSub(s).redISub(u).redMul(o),e=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(a.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(s.redISub(u)),r=n.redMul(o);return this.curve.point(t,e,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(e),c=o.redMul(a),f=s.redMul(u),l=o.redMul(u),h=a.redMul(s);return this.curve.point(c,f,h,l)},c.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),l=n.redMul(u).redMul(f);return this.curve.twisted?(e=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(e=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(l,e,r)},c.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},c.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},c.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},c.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},37075:function(t,e,r){"use strict";var n=e;n.base=r(55950),n.short=r(95536),n.mont=r(29113),n.edwards=r(72124)},29113:function(t,e,r){"use strict";var n=r(37548),i=r(12534),o=r(55950),a=r(82629);function s(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.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(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,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)))}i(s,o),t.exports=s,s.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(t,e){return this.point(a.toArray(t,e),1)},s.prototype.point=function(t,e){return new u(this,t,e)},s.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),u=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},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(t){return 0===this.getX().cmp(t.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()}},95536:function(t,e,r){"use strict";var n=r(82629),i=r(37548),o=r(12534),a=r(55950),s=n.assert;function u(t){a.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(t,e,r,n){a.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(t,e,r,n){a.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),t.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,o,a,s,u,c,f,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,d=this.n.clone(),p=new i(1),m=new i(0),g=new i(0),v=new i(1),y=0;0!==h.cmpn(0);){var b=d.div(h);c=d.sub(b.mul(h)),f=g.sub(b.mul(p));var w=v.sub(b.mul(m));if(!n&&c.cmp(l)<0)e=u.neg(),r=p,n=c.neg(),o=f;else if(n&&2===++y)break;u=c,d=h,h=c,g=p,p=f,v=m,m=w}a=c.neg(),s=f;var _=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(_)>=0&&(a=e,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},c.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,a.BasePoint),u.prototype.jpoint=function(t,e,r){return new f(this,t,e,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),f=c.redMul(s),l=n.redMul(c),h=u.redSqr().redIAdd(f).redISub(l).redISub(l),d=u.redMul(l.redISub(h)).redISub(o.redMul(f)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(h,d,p)},f.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),f=r.redMul(u),l=s.redSqr().redIAdd(c).redISub(f).redISub(f),h=s.redMul(f.redISub(l)).redISub(i.redMul(c)),d=this.z.redMul(a);return this.curve.jpoint(l,h,d)},f.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},13297:function(t,e,r){"use strict";var n,i=e,o=r(33125),a=r(37075),s=r(82629).assert;function u(t){"short"===t.type?this.curve=new a.short(t):"edwards"===t.type?this.curve=new a.edwards(t):this.curve=new a.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(31025)}catch(f){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},74170:function(t,e,r){"use strict";var n=r(37548),i=r(17411),o=r(82629),a=r(13297),s=r(26084),u=o.assert,c=r(80615),f=r(23198);function l(t){if(!(this instanceof l))return new l(t);"string"===typeof t&&(u(Object.prototype.hasOwnProperty.call(a,t),"Unknown curve "+t),t=a[t]),t instanceof a.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=l,l.prototype.keyPair=function(t){return new c(this,t)},l.prototype.keyFromPrivate=function(t,e){return c.fromPrivate(this,t,e)},l.prototype.keyFromPublic=function(t,e){return c.fromPublic(this,t,e)},l.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||s(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var a=new n(e.generate(r));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}},l.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},l.prototype.sign=function(t,e,r,o){"object"===typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var a=this.n.byteLength(),s=e.getPrivate().toArray("be",a),u=t.toArray("be",a),c=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),l=this.n.sub(new n(1)),h=0;;h++){var d=o.k?o.k(h):new n(c.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(l)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var m=p.getX(),g=m.umod(this.n);if(0!==g.cmpn(0)){var v=d.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(v=v.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return o.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),y^=1),new f({r:g,s:v,recoveryParam:y})}}}}}},l.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new f(e,"hex")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(t).umod(this.n),l=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(t,e,r,i){u((3&r)===r,"The recovery param is more than two bits"),e=new f(e,i);var o=this.n,a=new n(t),s=e.r,c=e.s,l=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l);var d=e.r.invm(o),p=o.sub(a).mul(d).umod(o),m=c.mul(d).umod(o);return this.g.mulAdd(p,s,m)},l.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new f(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},80615:function(t,e,r){"use strict";var n=r(37548),i=r(82629).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"===typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},23198:function(t,e,r){"use strict";var n=r(37548),i=r(82629),o=i.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=e.place;o>>=0;return!(i<=127)&&(e.place=a,i)}function c(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=a,a.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new s;if(48!==t[r.place++])return!1;var o=u(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var a=u(t,r);if(!1===a)return!1;var c=t.slice(r.place,a+r.place);if(r.place+=a,2!==t[r.place++])return!1;var f=u(t,r);if(!1===f)return!1;if(t.length!==f+r.place)return!1;var l=t.slice(r.place,f+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new n(c),this.s=new n(l),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=c(e),r=c(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];f(n,e.length),(n=n.concat(e)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,t)}},20156:function(t,e,r){"use strict";var n=r(33125),i=r(13297),o=r(82629),a=o.assert,s=o.parseBytes,u=r(1722),c=r(68574);function f(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof f))return new f(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=f,f.prototype.sign=function(t,e){t=s(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},f.prototype.verify=function(t,e,r){t=s(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},f.prototype.hashInt=function(){for(var t=this.hash(),e=0;e(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var a,s,u=t.andln(3)+i&3,c=e.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0===(1&u)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0===(1&c)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"===typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},37548:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(85568).Buffer}catch(x){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","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],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=l[t],d=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,c=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],M=8191&S,k=S>>>13,x=0|a[5],E=8191&x,A=x>>>13,O=0|a[6],T=8191&O,P=O>>>13,I=0|a[7],R=8191&I,C=I>>>13,N=0|a[8],B=8191&N,j=N>>>13,L=0|a[9],D=8191&L,U=L>>>13,F=0|s[0],H=8191&F,z=F>>>13,K=0|s[1],q=8191&K,V=K>>>13,G=0|s[2],W=8191&G,Y=G>>>13,$=0|s[3],Z=8191&$,X=$>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ft=0|s[8],lt=8191&ft,ht=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(l,H))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,H)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,z))+Math.imul(m,H)|0,o=Math.imul(m,z);var vt=(c+(n=n+Math.imul(l,q)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(h,q)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,H),i=(i=Math.imul(v,z))+Math.imul(y,H)|0,o=Math.imul(y,z),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,V)|0;var yt=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(h,W)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,H),i=(i=Math.imul(w,z))+Math.imul(_,H)|0,o=Math.imul(_,z),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Y)|0;var bt=(c+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(h,Z)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,H),i=(i=Math.imul(M,z))+Math.imul(k,H)|0,o=Math.imul(k,z),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,H),i=(i=Math.imul(E,z))+Math.imul(A,H)|0,o=Math.imul(A,z),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,H),i=(i=Math.imul(T,z))+Math.imul(P,H)|0,o=Math.imul(P,z),n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var St=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(R,H),i=(i=Math.imul(R,z))+Math.imul(C,H)|0,o=Math.imul(C,z),n=n+Math.imul(T,q)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,z))+Math.imul(j,H)|0,o=Math.imul(j,z),n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,z))+Math.imul(U,H)|0,o=Math.imul(U,z),n=n+Math.imul(B,q)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var xt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(U,q)|0,o=Math.imul(U,V),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var Et=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var At=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,X))+Math.imul(U,Z)|0,o=Math.imul(U,X),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var Ot=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ht)|0;var Tt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,at))+Math.imul(U,ot)|0,o=Math.imul(U,at),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ct)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var It=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ct))+Math.imul(U,ut)|0,o=Math.imul(U,ct),n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ht)|0;var Rt=(c+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(D,lt),i=(i=Math.imul(D,ht))+Math.imul(U,lt)|0,o=Math.imul(U,ht);var Ct=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Nt=(c+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return c=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=vt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Mt,u[8]=kt,u[9]=xt,u[10]=Et,u[11]=At,u[12]=Ot,u[13]=Tt,u[14]=Pt,u[15]=It,u[16]=Rt,u[17]=Ct,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var h=0,d=1;0===(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0===(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(b,y),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},50887:function(t){"use strict";function e(t,e){if(void 0===t||null===t)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),n=1;n0&&a.length>i&&!a.warned){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=a.length,c=f,console&&console.warn&&console.warn(c)}return t}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function h(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[t];if(void 0===u)return!1;if("function"===typeof u)n(u,this,e);else{var c=u.length,f=p(u,c);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return h(this,t,!0)},o.prototype.rawListeners=function(t){return h(this,t,!1)},o.listenerCount=function(t,e){return"function"===typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},48462:function(t,e,r){var n=r(82543).Buffer,i=r(68437);t.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=n.alloc(a),u=n.alloc(o||0),c=n.alloc(0);a>0||o>0;){var f=new i;f.update(c),f.update(t),e&&f.update(e),c=f.digest();var l=0;if(a>0){var h=s.length-a;l=Math.min(a,c.length),c.copy(s,h,0,l),a-=l}if(l0){var d=u.length-o,p=Math.min(o,c.length-l);c.copy(u,d,l,l+p),o-=p}}return c.fill(0),{key:s,iv:u}}},96788:function(t){var e=-1,r=1,n=0;function i(t,m,g,v,y){if(t===m)return t?[[n,t]]:[];if(null!=g){var w=function(t,e,r){var n="number"===typeof r?{index:r,length:0}:r.oldRange,i="number"===typeof r?null:r.newRange,o=t.length,a=e.length;if(0===n.length&&(null===i||0===i.length)){var s=n.index,u=t.slice(0,s),c=t.slice(s),f=i?i.index:null,l=s+a-o;if((null===f||f===l)&&!(l<0||l>a)){var h=e.slice(0,l);if((m=e.slice(l))===c){var d=Math.min(s,l);if((v=u.slice(0,d))===(w=h.slice(0,d)))return b(v,u.slice(d),h.slice(d),c)}}if(null===f||f===s){var p=s,m=(h=e.slice(0,p),e.slice(p));if(h===u){var g=Math.min(o-p,a-p);if((y=c.slice(c.length-g))===(_=m.slice(m.length-g)))return b(u,c.slice(0,c.length-g),m.slice(0,m.length-g),y)}}}if(n.length>0&&i&&0===i.length){var v=t.slice(0,n.index),y=t.slice(n.index+n.length);if(!(a<(d=v.length)+(g=y.length))){var w=e.slice(0,d),_=e.slice(a-g);if(v===w&&y===_)return b(v,t.slice(d,o-g),e.slice(d,a-g),y)}}return null}(t,m,g);if(w)return w}var _=a(t,m),S=t.substring(0,_);_=u(t=t.substring(_),m=m.substring(_));var M=t.substring(t.length-_),k=function(t,s){var c;if(!t)return[[r,s]];if(!s)return[[e,t]];var f=t.length>s.length?t:s,l=t.length>s.length?s:t,h=f.indexOf(l);if(-1!==h)return c=[[r,f.substring(0,h)],[n,l],[r,f.substring(h+l.length)]],t.length>s.length&&(c[0][0]=c[2][0]=e),c;if(1===l.length)return[[e,t],[r,s]];var d=function(t,e){var r=t.length>e.length?t:e,n=t.length>e.length?e:t;if(r.length<4||2*n.length=t.length?[n,i,o,s,l]:null}var o,s,c,f,l,h=i(r,n,Math.ceil(r.length/4)),d=i(r,n,Math.ceil(r.length/2));if(!h&&!d)return null;o=d?h&&h[4].length>d[4].length?h:d:h;t.length>e.length?(s=o[0],c=o[1],f=o[2],l=o[3]):(f=o[0],l=o[1],s=o[2],c=o[3]);var p=o[4];return[s,c,f,l,p]}(t,s);if(d){var p=d[0],m=d[1],g=d[2],v=d[3],y=d[4],b=i(p,g),w=i(m,v);return b.concat([[n,y]],w)}return function(t,n){for(var i=t.length,a=n.length,s=Math.ceil((i+a)/2),u=s,c=2*s,f=new Array(c),l=new Array(c),h=0;hi)g+=2;else if(S>a)m+=2;else if(p){if((x=u+d-w)>=0&&x=(k=i-l[x]))return o(t,n,A,S)}}for(var M=-b+v;M<=b-y;M+=2){for(var k,x=u+M,E=(k=M===-b||M!==b&&l[x-1]i)y+=2;else if(E>a)v+=2;else if(!p){if((_=u+d-M)>=0&&_=(k=i-k))return o(t,n,A,S)}}}}return[[e,t],[r,n]]}(t,s)}(t=t.substring(0,t.length-_),m=m.substring(0,m.length-_));return S&&k.unshift([n,S]),M&&k.push([n,M]),p(k,y),v&&function(t){var i=!1,o=[],a=0,m=null,g=0,v=0,y=0,b=0,w=0;for(;g0?o[a-1]:-1,v=0,y=0,b=0,w=0,m=null,i=!0)),g++;i&&p(t);(function(t){function e(t,e){if(!t||!e)return 6;var r=t.charAt(t.length-1),n=e.charAt(0),i=r.match(c),o=n.match(c),a=i&&r.match(f),s=o&&n.match(f),u=a&&r.match(l),p=s&&n.match(l),m=u&&t.match(h),g=p&&e.match(d);return m||g?5:u||p?4:i&&!a&&s?3:a||s?2:i||o?1:0}var r=1;for(;r=y&&(y=b,m=i,g=o,v=a)}t[r-1][1]!=m&&(m?t[r-1][1]=m:(t.splice(r-1,1),r--),t[r][1]=g,v?t[r+1][1]=v:(t.splice(r+1,1),r--))}r++}})(t),g=1;for(;g=k?(M>=_.length/2||M>=S.length/2)&&(t.splice(g,0,[n,S.substring(0,M)]),t[g-1][1]=_.substring(0,_.length-M),t[g+1][1]=S.substring(M),g++):(k>=_.length/2||k>=S.length/2)&&(t.splice(g,0,[n,_.substring(0,k)]),t[g-1][0]=r,t[g-1][1]=S.substring(0,S.length-k),t[g+1][0]=e,t[g+1][1]=_.substring(k),g++),g++}g++}}(k),k}function o(t,e,r,n){var o=t.substring(0,r),a=e.substring(0,n),s=t.substring(r),u=e.substring(n),c=i(o,a),f=i(s,u);return c.concat(f)}function a(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var r=0,n=Math.min(t.length,e.length),i=n,o=0;rn?t=t.substring(r-n):r=0&&y(t[d][1])){var m=t[d][1].slice(-1);if(t[d][1]=t[d][1].slice(0,-1),l=m+l,h=m+h,!t[d][1]){t.splice(d,1),s--;var g=d-1;t[g]&&t[g][0]===r&&(f++,h=t[g][1]+h,g--),t[g]&&t[g][0]===e&&(c++,l=t[g][1]+l,g--),d=g}}if(v(t[s][1])){m=t[s][1].charAt(0);t[s][1]=t[s][1].slice(1),l+=m,h+=m}}if(s0||h.length>0){l.length>0&&h.length>0&&(0!==(o=a(h,l))&&(d>=0?t[d][1]+=h.substring(0,o):(t.splice(0,0,[n,h.substring(0,o)]),s++),h=h.substring(o),l=l.substring(o)),0!==(o=u(h,l))&&(t[s][1]=h.substring(h.length-o)+t[s][1],h=h.substring(0,h.length-o),l=l.substring(0,l.length-o)));var b=f+c;0===l.length&&0===h.length?(t.splice(s-b,b),s-=b):0===l.length?(t.splice(s-b,b,[r,h]),s=s-b+1):0===h.length?(t.splice(s-b,b,[e,l]),s=s-b+1):(t.splice(s-b,b,[e,l],[r,h]),s=s-b+2)}0!==s&&t[s-1][0]===n?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,f=0,c=0,l="",h=""}""===t[t.length-1][1]&&t.pop();var w=!1;for(s=1;s=55296&&t<=56319}function g(t){return t>=56320&&t<=57343}function v(t){return g(t.charCodeAt(0))}function y(t){return m(t.charCodeAt(t.length-1))}function b(t,i,o,a){return y(t)||v(a)?null:function(t){for(var e=[],r=0;r0&&e.push(t[r]);return e}([[n,t],[e,i],[r,o],[n,a]])}function w(t,e,r,n){return i(t,e,r,n,!0)}w.INSERT=r,w.DELETE=e,w.EQUAL=n,t.exports=w},11053:function(t){t.exports=a,a.default=a,a.stable=f,a.stableStringify=f;var e="[...]",r="[Circular]",n=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(t,e,r,a){var s;"undefined"===typeof a&&(a=o()),u(t,"",0,[],void 0,0,a);try{s=0===i.length?JSON.stringify(t,e,r):JSON.stringify(t,h(e),r)}catch(f){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function s(t,e,r,o){var a=Object.getOwnPropertyDescriptor(o,r);void 0!==a.get?a.configurable?(Object.defineProperty(o,r,{value:t}),n.push([o,r,e,a])):i.push([e,r,t]):(o[r]=t,n.push([o,r,e]))}function u(t,n,i,o,a,c,f){var l;if(c+=1,"object"===typeof t&&null!==t){for(l=0;lf.depthLimit)return void s(e,t,n,a);if("undefined"!==typeof f.edgesLimit&&i+1>f.edgesLimit)return void s(e,t,n,a);if(o.push(t),Array.isArray(t))for(l=0;le?1:0}function f(t,e,r,a){"undefined"===typeof a&&(a=o());var s,u=l(t,"",0,[],void 0,0,a)||t;try{s=0===i.length?JSON.stringify(u,e,r):JSON.stringify(u,h(e),r)}catch(f){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function l(t,i,o,a,u,f,h){var d;if(f+=1,"object"===typeof t&&null!==t){for(d=0;dh.depthLimit)return void s(e,t,i,u);if("undefined"!==typeof h.edgesLimit&&o+1>h.edgesLimit)return void s(e,t,i,u);if(a.push(t),Array.isArray(t))for(d=0;d0)for(var n=0;n=3&&(a=r),"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n=t.length)return e&&(e[p]=t),r(null,t);c.lastIndex=s;var i=c.exec(t);return d=l,l+=i[0],h=d+i[1],s=c.lastIndex,g[h]||e&&e[h]===h?n.nextTick(y):e&&Object.prototype.hasOwnProperty.call(e,h)?_(e[h]):a.lstat(h,b)}function b(t,i){if(t)return r(t);if(!i.isSymbolicLink())return g[h]=!0,e&&(e[h]=h),n.nextTick(y);if(!o){var s=i.dev.toString(32)+":"+i.ino.toString(32);if(m.hasOwnProperty(s))return w(null,m[s],h)}a.stat(h,(function(t){if(t)return r(t);a.readlink(h,(function(t,e){o||(m[s]=e),w(t,e)}))}))}function w(t,n,o){if(t)return r(t);var a=i.resolve(d,n);e&&(e[o]=a),_(a)}function _(e){t=i.resolve(e,t.slice(s)),v()}v()}},30222:function(t){"use strict";var e=Array.prototype.slice,r=Object.prototype.toString;t.exports=function(t){var n=this;if("function"!==typeof n||"[object Function]"!==r.call(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var i,o=e.call(arguments,1),a=Math.max(0,n.length-o.length),s=[],u=0;u1&&"boolean"!==typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===E(/^%?[^%]*%?$/,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=x(t,0,1),r=x(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return k(t,A,(function(t,e,r,i){n[n.length]=r?k(i,O,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=T("%"+n+"%",e),s=o.name,c=o.value,f=!1,l=o.alias;l&&(n=l[0],M(r,S([0,1],l)));for(var h=1,d=!0;h=r.length){var y=u(c,p);c=(d=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:c[p]}else d=_(c,p),c=c[p];d&&!f&&(g[s]=c)}}return c}},58503:function(t,e,r){var n=r(1426);function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.setopts=function(t,e,r){r||(r={});if(r.matchBase&&-1===e.indexOf("/")){if(r.noglobstar)throw new Error("base matching requires globstar");e="**/"+e}t.silent=!!r.silent,t.pattern=e,t.strict=!1!==r.strict,t.realpath=!!r.realpath,t.realpathCache=r.realpathCache||Object.create(null),t.follow=!!r.follow,t.dot=!!r.dot,t.mark=!!r.mark,t.nodir=!!r.nodir,t.nodir&&(t.mark=!0);t.sync=!!r.sync,t.nounique=!!r.nounique,t.nonull=!!r.nonull,t.nosort=!!r.nosort,t.nocase=!!r.nocase,t.stat=!!r.stat,t.noprocess=!!r.noprocess,t.absolute=!!r.absolute,t.fs=r.fs||o,t.maxLength=r.maxLength||1/0,t.cache=r.cache||Object.create(null),t.statCache=r.statCache||Object.create(null),t.symlinks=r.symlinks||Object.create(null),function(t,e){t.ignore=e.ignore||[],Array.isArray(t.ignore)||(t.ignore=[t.ignore]);t.ignore.length&&(t.ignore=t.ignore.map(l))}(t,r),t.changedCwd=!1;var s=n.cwd();i(r,"cwd")?(t.cwd=a.resolve(r.cwd),t.changedCwd=t.cwd!==s):t.cwd=s;t.root=r.root||a.resolve(t.cwd,"/"),t.root=a.resolve(t.root),"win32"===n.platform&&(t.root=t.root.replace(/\\/g,"/"));t.cwdAbs=u(t.cwd)?t.cwd:h(t,t.cwd),"win32"===n.platform&&(t.cwdAbs=t.cwdAbs.replace(/\\/g,"/"));t.nomount=!!r.nomount,r.nonegate=!0,r.nocomment=!0,r.allowWindowsEscape=!1,t.minimatch=new c(e,r),t.options=t.minimatch.options},e.ownProp=i,e.makeAbs=h,e.finish=function(t){for(var e=t.nounique,r=e?[]:Object.create(null),n=0,i=t.matches.length;n1)return!0;for(var i=0;ithis.maxLength)return e();if(!this.stat&&p(this.cache,r)){var i=this.cache[r];if(Array.isArray(i)&&(i="DIR"),!n||"DIR"===i)return e(null,i);if(n&&"FILE"===i)return e()}var o=this.statCache[r];if(void 0!==o){if(!1===o)return e(null,o);var a=o.isDirectory()?"DIR":"FILE";return n&&"FILE"===a?e():e(null,a,o)}var s=this,u=m("stat\0"+r,(function(n,i){if(i&&i.isSymbolicLink())return s.fs.stat(r,(function(n,o){n?s._stat2(t,r,null,i,e):s._stat2(t,r,n,o,e)}));s._stat2(t,r,n,i,e)}));u&&s.fs.lstat(r,u)},_.prototype._stat2=function(t,e,r,n,i){if(r&&("ENOENT"===r.code||"ENOTDIR"===r.code))return this.statCache[e]=!1,i();var o="/"===t.slice(-1);if(this.statCache[e]=n,"/"===e.slice(-1)&&n&&!n.isDirectory())return i(null,!1,n);var a=!0;return n&&(a=n.isDirectory()?"DIR":"FILE"),this.cache[e]=this.cache[e]||a,o&&"FILE"===a?i():i(null,a,n)}},73638:function(t,e,r){var n=r(1426);t.exports=p,p.GlobSync=m;var i=r(90584),o=r(65840),a=(o.Minimatch,r(36589).Glob,r(49639),r(5246)),s=r(88093),u=r(45557),c=r(58503),f=c.setopts,l=c.ownProp,h=c.childrenIgnored,d=c.isIgnored;function p(t,e){if("function"===typeof e||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new m(t,e).found}function m(t,e){if(!t)throw new Error("must provide pattern");if("function"===typeof e||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof m))return new m(t,e);if(f(this,t,e),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;nthis.maxLength)return!1;if(!this.stat&&l(this.cache,e)){var n=this.cache[e];if(Array.isArray(n)&&(n="DIR"),!r||"DIR"===n)return n;if(r&&"FILE"===n)return!1}var i=this.statCache[e];if(!i){var o;try{o=this.fs.lstatSync(e)}catch(a){if(a&&("ENOENT"===a.code||"ENOTDIR"===a.code))return this.statCache[e]=!1,!1}if(o&&o.isSymbolicLink())try{i=this.fs.statSync(e)}catch(a){i=o}else i=o}this.statCache[e]=i;n=!0;return i&&(n=i.isDirectory()?"DIR":"FILE"),this.cache[e]=this.cache[e]||n,(!r||"FILE"!==n)&&n},m.prototype._mark=function(t){return c.mark(this,t)},m.prototype._makeAbs=function(t){return c.makeAbs(this,t)}},23347:function(t,e,r){"use strict";var n=r(52506)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(i){n=null}t.exports=n},84510:function(t,e,r){"use strict";var n=r(52506)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},92203:function(t){"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},80697:function(t,e,r){"use strict";var n="undefined"!==typeof Symbol&&Symbol,i=r(63297);t.exports=function(){return"function"===typeof n&&("function"===typeof Symbol&&("symbol"===typeof n("foo")&&("symbol"===typeof Symbol("bar")&&i())))}},63297:function(t){"use strict";t.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"===typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"===typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},4707:function(t,e,r){"use strict";var n=r(63297);t.exports=function(){return n()&&!!Symbol.toStringTag}},58316:function(t,e,r){"use strict";var n=r(33350);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},86266:function(t,e,r){"use strict";var n=r(82543).Buffer,i=r(20450).Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(12534)(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(i){n=i}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(r){e=r}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!==typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},18744:function(t){"use strict";var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"===typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,a,s;if("string"===typeof e&&(o="not ",e.substr(!a||a<0?0:+a,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var u=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(u," ").concat(i," ").concat(n(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},12889:function(t,e,r){"use strict";var n=r(1426),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=f;var o=r(47234),a=r(62814);r(12534)(f,o);for(var s=i(a.prototype),u=0;u0)if("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)a.endEmitted?S(t,new _):A(t,a,e,!0);else if(a.ended)S(t,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?A(t,a,e,!1):R(t,a)):A(t,a,e,!1)}else n||(a.reading=!1,R(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=O?t=O:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function P(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(I,t))}function I(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,L(t)}function R(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(C,t,e))}function C(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function B(t){c("readable nexttick read 0"),t.read(0)}function j(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),L(t),e.flowing&&!e.reading&&t.read(0)}function L(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function D(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(F,e,t))}function F(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function H(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):P(this),null;if(0===(t=T(t,e))&&e.ended)return 0===e.length&&U(this),null;var n,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t0?D(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==n&&this.emit("data",n),n},x.prototype._read=function(t){S(this,new w("_read()"))},x.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,c("pipe count=%d opts=%j",n.pipesCount,e);var a=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?u:g;function s(e,i){c("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,c("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",g),r.removeListener("data",h),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function u(){c("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",s);var f=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,L(t))}}(r);t.on("drain",f);var l=!1;function h(e){c("ondata");var i=t.write(e);c("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==H(n.pipes,t))&&!l&&(c("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(e){c("onerror",e),g(),t.removeListener("error",d),0===o(t,"error")&&S(t,e)}function p(){t.removeListener("finish",m),g()}function m(){c("onfinish"),t.removeListener("close",p),g()}function g(){c("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",m),t.emit("pipe",r),n.flowing||(c("pipe resume"),r.resume()),t},x.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,c("on readable",n.length,n.reading),n.length?P(this):n.reading||i.nextTick(B,this))),r},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(N,this),r},x.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(N,this),e},x.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(j,t,e))}(this,t)),t.paused=!1,this},x.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!==i&&void 0!==i)&&((r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause())))})),t)void 0===this[i]&&"function"===typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(t,e,r){r(new m("_write()"))},x.prototype._writev=null,x.prototype.end=function(t,e,r){var n=this._writableState;return"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,I(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),x.prototype.destroy=l.destroy,x.prototype._undestroy=l.undestroy,x.prototype._destroy=function(t,e){e(t)}},84812:function(t,e,r){"use strict";var n,i=r(1426);function o(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=r(62016),s=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function m(t){var e=t[s];if(null!==e){var r=t[d].read();null!==r&&(t[l]=null,t[s]=null,t[u]=null,e(p(r,!1)))}}function g(t){i.nextTick(m,t)}var v=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((o(n={get stream(){return this[d]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[f])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(e,r){i.nextTick((function(){t[c]?r(t[c]):e(p(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[f]?r(p(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var t=this;return new Promise((function(e,r){t[d].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),n),v);t.exports=function(t){var e,r=Object.create(y,(o(e={},d,{value:t,writable:!0}),o(e,s,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,c,{value:null,writable:!0}),o(e,f,{value:t._readableState.endEmitted,writable:!0}),o(e,h,{value:function(t,e){var n=r[d].read();n?(r[l]=null,r[s]=null,r[u]=null,t(p(n,!1))):(r[s]=t,r[u]=e)},writable:!0}),e));return r[l]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];return null!==e&&(r[l]=null,r[s]=null,r[u]=null,e(t)),void(r[c]=t)}var n=r[s];null!==n&&(r[l]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[f]=!0})),t.on("readable",g.bind(null,r)),r}},38619:function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return u.alloc(0);for(var e,r,n,i=u.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,u.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0===(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=u.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0===(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:f,value:function(t,e){return c(this,i(i({},e),{},{depth:0,customInspect:!1}))}}])&&a(e.prototype,r),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}()},95471:function(t,e,r){"use strict";var n=r(1426);function i(t,e){a(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function a(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,t)):n.nextTick(a,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e?(n.nextTick(o,r),e(t)):n.nextTick(o,r)})),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.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},62016:function(t,e,r){"use strict";var n=r(18744).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"===typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i0,(function(t){f||(f=t),t&&h.forEach(u),o||(h.forEach(u),l(f))}))}));return e.reduce(c)}},53538:function(t,e,r){"use strict";var n=r(18744).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},95275:function(t,e,r){t.exports=r(47465).EventEmitter},20450:function(t,e,r){(e=t.exports=r(47234)).Stream=e,e.Readable=e,e.Writable=r(62814),e.Duplex=r(12889),e.Transform=r(22795),e.PassThrough=r(64455),e.finished=r(62016),e.pipeline=r(99141)},33125:function(t,e,r){var n=e;n.utils=r(79046),n.common=r(79684),n.sha=r(39194),n.ripemd=r(56645),n.hmac=r(93609),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},79684:function(t,e,r){"use strict";var n=r(79046),i=r(72325);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;othis.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},79046:function(t,e,r){"use strict";var n=r(72325),i=r(12534);function o(t,e){return 55296===(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320===(64512&t.charCodeAt(e+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"===typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=63&a|128):o(t,i)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,a,s){var u=0,c=e;return u+=(c=c+n>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,a,s,u,c){var f=0,l=e;return f+=(l=l+n>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,n,i,o,a,s,u,c){return e+n+o+s+c>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},17411:function(t,e,r){"use strict";var n=r(33125),i=r(94034),o=r(72325);function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=a,a.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},a.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length>1,f=-7,l=r?i-1:0,h=r?-1:1,d=t[e+l];for(l+=h,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+t[e+l],l+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+t[e+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=c}return(d?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;t[r+d]=255&a,d+=p,a/=256,c-=8);t[r+d-p]|=128*m}},90940:function(t,e,r){var n=r(1426),i=r(66418),o=Object.create(null),a=r(14876);t.exports=i((function(t,e){return o[t]?(o[t].push(e),null):(o[t]=[e],function(t){return a((function e(){var r=o[t],i=r.length,a=function(t){for(var e=t.length,r=[],n=0;ni?(r.splice(0,i),n.nextTick((function(){e.apply(null,a)}))):delete o[t]}}))}(t))}))},12534:function(t){"function"===typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},65450:function(t,e,r){"use strict";var n=r(4707)(),i=r(44037)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"===typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},a=function(t){return!!o(t)||null!==t&&"object"===typeof t&&"number"===typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,t.exports=s?o:a},70460:function(t){"use strict";var e,r,n=Function.prototype.toString,i="object"===typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"===typeof i&&"function"===typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(d){d!==r&&(i=null)}else i=null;var o=/^\s*class\b/,a=function(t){try{var e=n.call(t);return o.test(e)}catch(r){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(e){return!1}},u=Object.prototype.toString,c="function"===typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),l=function(){return!1};if("object"===typeof document){var h=document.all;u.call(h)===u.call(document.all)&&(l=function(t){if((f||!t)&&("undefined"===typeof t||"object"===typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(r){}return!1})}t.exports=i?function(t){if(l(t))return!0;if(!t)return!1;if("function"!==typeof t&&"object"!==typeof t)return!1;try{i(t,null,e)}catch(n){if(n!==r)return!1}return!a(t)&&s(t)}:function(t){if(l(t))return!0;if(!t)return!1;if("function"!==typeof t&&"object"!==typeof t)return!1;if(c)return s(t);if(a(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},85718:function(t,e,r){"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(4707)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!==typeof t)return!1;if(a.test(o.call(t)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if("undefined"===typeof n){var e=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},6510:function(t){"use strict";t.exports=function(t){return t!==t}},6188:function(t,e,r){"use strict";var n=r(19722),i=r(9396),o=r(6510),a=r(64951),s=r(6034),u=n(a(),Number);i(u,{getPolyfill:a,implementation:o,shim:s}),t.exports=u},64951:function(t,e,r){"use strict";var n=r(6510);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6034:function(t,e,r){"use strict";var n=r(9396),i=r(64951);t.exports=function(){var t=i();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},66218:function(t,e,r){"use strict";var n=r(65369),i=r(30306),o=r(44037),a=o("Object.prototype.toString"),s=r(4707)(),u=r(23347),c="undefined"===typeof globalThis?r.g:globalThis,f=i(),l=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!u&&function(t){var e=!1;return n(d,(function(r,n){if(!e)try{e=r.call(t)===n}catch(i){}})),e}(t)}},46068:function(t,e,r){var n=r(9068).stringify,i=r(93630);t.exports=function(t){return{parse:i(t),stringify:n}},t.exports.parse=i(),t.exports.stringify=n},93630:function(t,e,r){var n=r(17144),i=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,o=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;t.exports=function(t){"use strict";var e={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(void 0!==t&&null!==t){if(!0===t.strict&&(e.strict=!0),!0===t.storeAsString&&(e.storeAsString=!0),e.alwaysParseAsBig=!0===t.alwaysParseAsBig&&t.alwaysParseAsBig,e.useNativeBigInt=!0===t.useNativeBigInt&&t.useNativeBigInt,"undefined"!==typeof t.constructorAction){if("error"!==t.constructorAction&&"ignore"!==t.constructorAction&&"preserve"!==t.constructorAction)throw new Error('Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed '.concat(t.constructorAction));e.constructorAction=t.constructorAction}if("undefined"!==typeof t.protoAction){if("error"!==t.protoAction&&"ignore"!==t.protoAction&&"preserve"!==t.protoAction)throw new Error('Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed '.concat(t.protoAction));e.protoAction=t.protoAction}}var r,a,s,u,c={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},f=function(t){throw{name:"SyntaxError",message:t,at:r,text:s}},l=function(t){return t&&t!==a&&f("Expected '"+t+"' instead of '"+a+"'"),a=s.charAt(r),r+=1,a},h=function(){var t,r="";for("-"===a&&(r="-",l("-"));a>="0"&&a<="9";)r+=a,l();if("."===a)for(r+=".";l()&&a>="0"&&a<="9";)r+=a;if("e"===a||"E"===a)for(r+=a,l(),"-"!==a&&"+"!==a||(r+=a,l());a>="0"&&a<="9";)r+=a,l();return t=+r,r.length>15?e.storeAsString?r:e.useNativeBigInt?BigInt(r):new n.default(r):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(t):new n.default(t):t},d=function(){var t,e,n,i="";if('"'===a)for(var o=r;l();){if('"'===a)return r-1>o&&(i+=s.substring(o,r-1)),l(),i;if("\\"===a){if(r-1>o&&(i+=s.substring(o,r-1)),l(),"u"===a){for(n=0,e=0;e<4&&(t=parseInt(l(),16),isFinite(t));e+=1)n=16*n+t;i+=String.fromCharCode(n)}else{if("string"!==typeof c[a])break;i+=c[a]}o=r}}f("Bad string")},p=function(){for(;a&&a<=" ";)l()},m=function(){var t=[];if("["===a){if(l("["),p(),"]"===a)return l("]"),t;for(;a;){if(t.push(u()),p(),"]"===a)return l("]"),t;l(","),p()}}f("Bad array")},g=function(){var t,r=Object.create(null);if("{"===a){if(l("{"),p(),"}"===a)return l("}"),r;for(;a;){if(t=d(),p(),l(":"),!0===e.strict&&Object.hasOwnProperty.call(r,t)&&f('Duplicate key "'+t+'"'),!0===i.test(t)?"error"===e.protoAction?f("Object contains forbidden prototype property"):"ignore"===e.protoAction?u():r[t]=u():!0===o.test(t)?"error"===e.constructorAction?f("Object contains forbidden constructor property"):"ignore"===e.constructorAction?u():r[t]=u():r[t]=u(),p(),"}"===a)return l("}"),r;l(","),p()}}f("Bad object")};return u=function(){switch(p(),a){case"{":return g();case"[":return m();case'"':return d();case"-":return h();default:return a>="0"&&a<="9"?h():function(){switch(a){case"t":return l("t"),l("r"),l("u"),l("e"),!0;case"f":return l("f"),l("a"),l("l"),l("s"),l("e"),!1;case"n":return l("n"),l("u"),l("l"),l("l"),null}f("Unexpected '"+a+"'")}()}},function(t,e){var n;return s=t+"",r=0,a=" ",n=u(),p(),a&&f("Syntax error"),"function"===typeof e?function t(r,n){var i,o=r[n];return o&&"object"===typeof o&&Object.keys(o).forEach((function(e){void 0!==(i=t(o,e))?o[e]=i:delete o[e]})),e.call(r,n,o)}({"":n},""):n}}},9068:function(t,e,r){var n=r(17144),i=t.exports;!function(){"use strict";var t,e,r,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function s(t){return o.lastIndex=0,o.test(t)?'"'+t.replace(o,(function(t){var e=a[t];return"string"===typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+t+'"'}function u(i,o){var a,c,f,l,h,d=t,p=o[i],m=null!=p&&(p instanceof n||n.isBigNumber(p));switch(p&&"object"===typeof p&&"function"===typeof p.toJSON&&(p=p.toJSON(i)),"function"===typeof r&&(p=r.call(o,i,p)),typeof p){case"string":return m?p:s(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":case"bigint":return String(p);case"object":if(!p)return"null";if(t+=e,h=[],"[object Array]"===Object.prototype.toString.apply(p)){for(l=p.length,a=0;a"']/g,Z=RegExp(Y.source),X=RegExp($.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,tt=/<%=([\s\S]+?)%>/g,et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rt=/^\w*$/,nt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,it=/[\\^$.*+?()[\]{}|]/g,ot=RegExp(it.source),at=/^\s+/,st=/\s/,ut=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ct=/\{\n\/\* \[wrapped with (.+)\] \*/,ft=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ht=/[()=,{}\[\]\/\s]/,dt=/\\(\\)?/g,pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mt=/\w*$/,gt=/^[-+]0x[0-9a-f]+$/i,vt=/^0b[01]+$/i,yt=/^\[object .+?Constructor\]$/,bt=/^0o[0-7]+$/i,wt=/^(?:0|[1-9]\d*)$/,_t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,St=/($^)/,Mt=/['\n\r\u2028\u2029\\]/g,kt="\\ud800-\\udfff",xt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Et="\\u2700-\\u27bf",At="a-z\\xdf-\\xf6\\xf8-\\xff",Ot="A-Z\\xc0-\\xd6\\xd8-\\xde",Tt="\\ufe0e\\ufe0f",Pt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",It="['\u2019]",Rt="["+kt+"]",Ct="["+Pt+"]",Nt="["+xt+"]",Bt="\\d+",jt="["+Et+"]",Lt="["+At+"]",Dt="[^"+kt+Pt+Bt+Et+At+Ot+"]",Ut="\\ud83c[\\udffb-\\udfff]",Ft="[^"+kt+"]",Ht="(?:\\ud83c[\\udde6-\\uddff]){2}",zt="[\\ud800-\\udbff][\\udc00-\\udfff]",Kt="["+Ot+"]",qt="\\u200d",Vt="(?:"+Lt+"|"+Dt+")",Gt="(?:"+Kt+"|"+Dt+")",Wt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Yt="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",$t="(?:"+Nt+"|"+Ut+")"+"?",Zt="["+Tt+"]?",Xt=Zt+$t+("(?:"+qt+"(?:"+[Ft,Ht,zt].join("|")+")"+Zt+$t+")*"),Jt="(?:"+[jt,Ht,zt].join("|")+")"+Xt,Qt="(?:"+[Ft+Nt+"?",Nt,Ht,zt,Rt].join("|")+")",te=RegExp(It,"g"),ee=RegExp(Nt,"g"),re=RegExp(Ut+"(?="+Ut+")|"+Qt+Xt,"g"),ne=RegExp([Kt+"?"+Lt+"+"+Wt+"(?="+[Ct,Kt,"$"].join("|")+")",Gt+"+"+Yt+"(?="+[Ct,Kt+Vt,"$"].join("|")+")",Kt+"?"+Vt+"+"+Wt,Kt+"+"+Yt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Bt,Jt].join("|"),"g"),ie=RegExp("["+qt+kt+xt+Tt+"]"),oe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ae=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],se=-1,ue={};ue[j]=ue[L]=ue[D]=ue[U]=ue[F]=ue[H]=ue[z]=ue[K]=ue[q]=!0,ue[y]=ue[b]=ue[N]=ue[w]=ue[B]=ue[_]=ue[S]=ue[M]=ue[x]=ue[E]=ue[A]=ue[T]=ue[P]=ue[I]=ue[C]=!1;var ce={};ce[y]=ce[b]=ce[N]=ce[B]=ce[w]=ce[_]=ce[j]=ce[L]=ce[D]=ce[U]=ce[F]=ce[x]=ce[E]=ce[A]=ce[T]=ce[P]=ce[I]=ce[R]=ce[H]=ce[z]=ce[K]=ce[q]=!0,ce[S]=ce[M]=ce[C]=!1;var fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},le=parseFloat,he=parseInt,de="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,pe="object"==typeof self&&self&&self.Object===Object&&self,me=de||pe||Function("return this")(),ge=e&&!e.nodeType&&e,ve=ge&&t&&!t.nodeType&&t,ye=ve&&ve.exports===ge,be=ye&&de.process,we=function(){try{var t=ve&&ve.require&&ve.require("util").types;return t||be&&be.binding&&be.binding("util")}catch(e){}}(),_e=we&&we.isArrayBuffer,Se=we&&we.isDate,Me=we&&we.isMap,ke=we&&we.isRegExp,xe=we&&we.isSet,Ee=we&&we.isTypedArray;function Ae(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Oe(t,e,r,n){for(var i=-1,o=null==t?0:t.length;++i-1}function Ne(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function nr(t,e){for(var r=t.length;r--&&Ke(e,t[r],0)>-1;);return r}var ir=Ye({"\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","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),or=Ye({"&":"&","<":"<",">":">",'"':""","'":"'"});function ar(t){return"\\"+fe[t]}function sr(t){return ie.test(t)}function ur(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function cr(t,e){return function(r){return t(e(r))}}function fr(t,e){for(var r=-1,n=t.length,i=0,o=[];++r",""":'"',"'":"'"});var vr=function t(e){var r=(e=null==e?me:vr.defaults(me.Object(),e,vr.pick(me,ae))).Array,n=e.Date,st=e.Error,kt=e.Function,xt=e.Math,Et=e.Object,At=e.RegExp,Ot=e.String,Tt=e.TypeError,Pt=r.prototype,It=kt.prototype,Rt=Et.prototype,Ct=e["__core-js_shared__"],Nt=It.toString,Bt=Rt.hasOwnProperty,jt=0,Lt=function(){var t=/[^.]+$/.exec(Ct&&Ct.keys&&Ct.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Dt=Rt.toString,Ut=Nt.call(Et),Ft=me._,Ht=At("^"+Nt.call(Bt).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=ye?e.Buffer:i,Kt=e.Symbol,qt=e.Uint8Array,Vt=zt?zt.allocUnsafe:i,Gt=cr(Et.getPrototypeOf,Et),Wt=Et.create,Yt=Rt.propertyIsEnumerable,$t=Pt.splice,Zt=Kt?Kt.isConcatSpreadable:i,Xt=Kt?Kt.iterator:i,Jt=Kt?Kt.toStringTag:i,Qt=function(){try{var t=lo(Et,"defineProperty");return t({},"",{}),t}catch(e){}}(),re=e.clearTimeout!==me.clearTimeout&&e.clearTimeout,ie=n&&n.now!==me.Date.now&&n.now,fe=e.setTimeout!==me.setTimeout&&e.setTimeout,de=xt.ceil,pe=xt.floor,ge=Et.getOwnPropertySymbols,ve=zt?zt.isBuffer:i,be=e.isFinite,we=Pt.join,Fe=cr(Et.keys,Et),Ye=xt.max,yr=xt.min,br=n.now,wr=e.parseInt,_r=xt.random,Sr=Pt.reverse,Mr=lo(e,"DataView"),kr=lo(e,"Map"),xr=lo(e,"Promise"),Er=lo(e,"Set"),Ar=lo(e,"WeakMap"),Or=lo(Et,"create"),Tr=Ar&&new Ar,Pr={},Ir=Do(Mr),Rr=Do(kr),Cr=Do(xr),Nr=Do(Er),Br=Do(Ar),jr=Kt?Kt.prototype:i,Lr=jr?jr.valueOf:i,Dr=jr?jr.toString:i;function Ur(t){if(es(t)&&!qa(t)&&!(t instanceof Kr)){if(t instanceof zr)return t;if(Bt.call(t,"__wrapped__"))return Uo(t)}return new zr(t)}var Fr=function(){function t(){}return function(e){if(!ts(e))return{};if(Wt)return Wt(e);t.prototype=e;var r=new t;return t.prototype=i,r}}();function Hr(){}function zr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function Kr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function qr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function un(t,e,r,n,o,a){var s,u=1&e,c=2&e,f=4&e;if(r&&(s=o?r(t,n,o,a):r(t)),s!==i)return s;if(!ts(t))return t;var l=qa(t);if(l){if(s=function(t){var e=t.length,r=new t.constructor(e);e&&"string"==typeof t[0]&&Bt.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!u)return Ti(t,s)}else{var h=mo(t),d=h==M||h==k;if(Ya(t))return Mi(t,u);if(h==A||h==y||d&&!o){if(s=c||d?{}:vo(t),!u)return c?function(t,e){return Pi(t,po(t),e)}(t,function(t,e){return t&&Pi(e,Rs(e),t)}(s,t)):function(t,e){return Pi(t,ho(t),e)}(t,nn(s,t))}else{if(!ce[h])return o?t:{};s=function(t,e,r){var n=t.constructor;switch(e){case N:return ki(t);case w:case _:return new n(+t);case B:return function(t,e){var r=e?ki(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case j:case L:case D:case U:case F:case H:case z:case K:case q:return xi(t,r);case x:return new n;case E:case I:return new n(t);case T:return function(t){var e=new t.constructor(t.source,mt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case P:return new n;case R:return i=t,Lr?Et(Lr.call(i)):{}}var i}(t,h,u)}}a||(a=new Yr);var p=a.get(t);if(p)return p;a.set(t,s),as(t)?t.forEach((function(n){s.add(un(n,e,r,n,t,a))})):rs(t)&&t.forEach((function(n,i){s.set(i,un(n,e,r,i,t,a))}));var m=l?i:(f?c?io:no:c?Rs:Is)(t);return Te(m||t,(function(n,i){m&&(n=t[i=n]),tn(s,i,un(n,e,r,i,t,a))})),s}function cn(t,e,r){var n=r.length;if(null==t)return!n;for(t=Et(t);n--;){var o=r[n],a=e[o],s=t[o];if(s===i&&!(o in t)||!a(s))return!1}return!0}function fn(t,e,r){if("function"!=typeof t)throw new Tt(o);return Io((function(){t.apply(i,r)}),e)}function ln(t,e,r,n){var i=-1,o=Ce,a=!0,s=t.length,u=[],c=e.length;if(!s)return u;r&&(e=Be(e,Qe(r))),n?(o=Ne,a=!1):e.length>=200&&(o=er,a=!1,e=new Wr(e));t:for(;++i-1},Vr.prototype.set=function(t,e){var r=this.__data__,n=en(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Gr.prototype.clear=function(){this.size=0,this.__data__={hash:new qr,map:new(kr||Vr),string:new qr}},Gr.prototype.delete=function(t){var e=co(this,t).delete(t);return this.size-=e?1:0,e},Gr.prototype.get=function(t){return co(this,t).get(t)},Gr.prototype.has=function(t){return co(this,t).has(t)},Gr.prototype.set=function(t,e){var r=co(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Wr.prototype.add=Wr.prototype.push=function(t){return this.__data__.set(t,a),this},Wr.prototype.has=function(t){return this.__data__.has(t)},Yr.prototype.clear=function(){this.__data__=new Vr,this.size=0},Yr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Yr.prototype.get=function(t){return this.__data__.get(t)},Yr.prototype.has=function(t){return this.__data__.has(t)},Yr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Vr){var n=r.__data__;if(!kr||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Gr(n)}return r.set(t,e),this.size=r.size,this};var hn=Ci(wn),dn=Ci(_n,!0);function pn(t,e){var r=!0;return hn(t,(function(t,n,i){return r=!!e(t,n,i)})),r}function mn(t,e,r){for(var n=-1,o=t.length;++n0&&r(s)?e>1?vn(s,e-1,r,n,i):je(i,s):n||(i[i.length]=s)}return i}var yn=Ni(),bn=Ni(!0);function wn(t,e){return t&&yn(t,e,Is)}function _n(t,e){return t&&bn(t,e,Is)}function Sn(t,e){return Re(e,(function(e){return Xa(t[e])}))}function Mn(t,e){for(var r=0,n=(e=bi(e,t)).length;null!=t&&re}function An(t,e){return null!=t&&Bt.call(t,e)}function On(t,e){return null!=t&&e in Et(t)}function Tn(t,e,n){for(var o=n?Ne:Ce,a=t[0].length,s=t.length,u=s,c=r(s),f=1/0,l=[];u--;){var h=t[u];u&&e&&(h=Be(h,Qe(e))),f=yr(h.length,f),c[u]=!n&&(e||a>=120&&h.length>=120)?new Wr(u&&h):i}h=t[0];var d=-1,p=c[0];t:for(;++d=s?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}))}function Vn(t,e,r){for(var n=-1,i=e.length,o={};++n-1;)s!==t&&$t.call(s,u,1),$t.call(t,u,1);return t}function Wn(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==o){var o=i;bo(i)?$t.call(t,i,1):li(t,i)}}return t}function Yn(t,e){return t+pe(_r()*(e-t+1))}function $n(t,e){var r="";if(!t||e<1||e>p)return r;do{e%2&&(r+=t),(e=pe(e/2))&&(t+=t)}while(e);return r}function Zn(t,e){return Ro(Ao(t,e,nu),t+"")}function Xn(t){return Zr(Fs(t))}function Jn(t,e){var r=Fs(t);return Bo(r,sn(e,0,r.length))}function Qn(t,e,r,n){if(!ts(t))return t;for(var o=-1,a=(e=bi(e,t)).length,s=a-1,u=t;null!=u&&++oo?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i>>1,a=t[o];null!==a&&!us(a)&&(r?a<=e:a=200){var c=e?null:$i(t);if(c)return lr(c);a=!1,i=er,u=new Wr}else u=e?[]:s;t:for(;++n=n?t:ni(t,e,r)}var Si=re||function(t){return me.clearTimeout(t)};function Mi(t,e){if(e)return t.slice();var r=t.length,n=Vt?Vt(r):new t.constructor(r);return t.copy(n),n}function ki(t){var e=new t.constructor(t.byteLength);return new qt(e).set(new qt(t)),e}function xi(t,e){var r=e?ki(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Ei(t,e){if(t!==e){var r=t!==i,n=null===t,o=t===t,a=us(t),s=e!==i,u=null===e,c=e===e,f=us(e);if(!u&&!f&&!a&&t>e||a&&s&&c&&!u&&!f||n&&s&&c||!r&&c||!o)return 1;if(!n&&!a&&!f&&t1?r[o-1]:i,s=o>2?r[2]:i;for(a=t.length>3&&"function"==typeof a?(o--,a):i,s&&wo(r[0],r[1],s)&&(a=o<3?i:a,o=1),e=Et(e);++n-1?o[a?e[s]:s]:i}}function Ui(t){return ro((function(e){var r=e.length,n=r,a=zr.prototype.thru;for(t&&e.reverse();n--;){var s=e[n];if("function"!=typeof s)throw new Tt(o);if(a&&!u&&"wrapper"==ao(s))var u=new zr([],!0)}for(n=u?n:r;++n1&&w.reverse(),d&&fu))return!1;var f=a.get(t),l=a.get(e);if(f&&l)return f==e&&l==t;var h=-1,d=!0,p=2&r?new Wr:i;for(a.set(t,e),a.set(e,t);++h-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(ut,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Te(v,(function(r){var n="_."+r[0];e&r[1]&&!Ce(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(ct);return e?e[1].split(ft):[]}(n),r)))}function No(t){var e=0,r=0;return function(){var n=br(),o=16-(n-r);if(r=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Bo(t,e){var r=-1,n=t.length,o=n-1;for(e=e===i?n:e;++r1?t[e-1]:i;return r="function"==typeof r?(t.pop(),r):i,oa(t,r)}));function ha(t){var e=Ur(t);return e.__chain__=!0,e}function da(t,e){return e(t)}var pa=ro((function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,o=function(e){return an(e,t)};return!(e>1||this.__actions__.length)&&n instanceof Kr&&bo(r)?((n=n.slice(r,+r+(e?1:0))).__actions__.push({func:da,args:[o],thisArg:i}),new zr(n,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(o)}));var ma=Ii((function(t,e,r){Bt.call(t,r)?++t[r]:on(t,r,1)}));var ga=Di(Ko),va=Di(qo);function ya(t,e){return(qa(t)?Te:hn)(t,uo(e,3))}function ba(t,e){return(qa(t)?Pe:dn)(t,uo(e,3))}var wa=Ii((function(t,e,r){Bt.call(t,r)?t[r].push(e):on(t,r,[e])}));var _a=Zn((function(t,e,n){var i=-1,o="function"==typeof e,a=Ga(t)?r(t.length):[];return hn(t,(function(t){a[++i]=o?Ae(e,t,n):Pn(t,e,n)})),a})),Sa=Ii((function(t,e,r){on(t,r,e)}));function Ma(t,e){return(qa(t)?Be:Un)(t,uo(e,3))}var ka=Ii((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]}));var xa=Zn((function(t,e){if(null==t)return[];var r=e.length;return r>1&&wo(t,e[0],e[1])?e=[]:r>2&&wo(e[0],e[1],e[2])&&(e=[e[0]]),qn(t,vn(e,1),[])})),Ea=ie||function(){return me.Date.now()};function Aa(t,e,r){return e=r?i:e,e=t&&null==e?t.length:e,Xi(t,l,i,i,i,i,e)}function Oa(t,e){var r;if("function"!=typeof e)throw new Tt(o);return t=ps(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=i),r}}var Ta=Zn((function(t,e,r){var n=1;if(r.length){var i=fr(r,so(Ta));n|=c}return Xi(t,n,e,r,i)})),Pa=Zn((function(t,e,r){var n=3;if(r.length){var i=fr(r,so(Pa));n|=c}return Xi(e,n,t,r,i)}));function Ia(t,e,r){var n,a,s,u,c,f,l=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new Tt(o);function m(e){var r=n,o=a;return n=a=i,l=e,u=t.apply(o,r)}function g(t){var r=t-f;return f===i||r>=e||r<0||d&&t-l>=s}function v(){var t=Ea();if(g(t))return y(t);c=Io(v,function(t){var r=e-(t-f);return d?yr(r,s-(t-l)):r}(t))}function y(t){return c=i,p&&n?m(t):(n=a=i,u)}function b(){var t=Ea(),r=g(t);if(n=arguments,a=this,f=t,r){if(c===i)return function(t){return l=t,c=Io(v,e),h?m(t):u}(f);if(d)return Si(c),c=Io(v,e),m(f)}return c===i&&(c=Io(v,e)),u}return e=gs(e)||0,ts(r)&&(h=!!r.leading,s=(d="maxWait"in r)?Ye(gs(r.maxWait)||0,e):s,p="trailing"in r?!!r.trailing:p),b.cancel=function(){c!==i&&Si(c),l=0,n=f=a=c=i},b.flush=function(){return c===i?u:y(Ea())},b}var Ra=Zn((function(t,e){return fn(t,1,e)})),Ca=Zn((function(t,e,r){return fn(t,gs(e)||0,r)}));function Na(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Tt(o);var r=function r(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=t.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(Na.Cache||Gr),r}function Ba(t){if("function"!=typeof t)throw new Tt(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Na.Cache=Gr;var ja=wi((function(t,e){var r=(e=1==e.length&&qa(e[0])?Be(e[0],Qe(uo())):Be(vn(e,1),Qe(uo()))).length;return Zn((function(n){for(var i=-1,o=yr(n.length,r);++i=e})),Ka=In(function(){return arguments}())?In:function(t){return es(t)&&Bt.call(t,"callee")&&!Yt.call(t,"callee")},qa=r.isArray,Va=_e?Qe(_e):function(t){return es(t)&&xn(t)==N};function Ga(t){return null!=t&&Qa(t.length)&&!Xa(t)}function Wa(t){return es(t)&&Ga(t)}var Ya=ve||gu,$a=Se?Qe(Se):function(t){return es(t)&&xn(t)==_};function Za(t){if(!es(t))return!1;var e=xn(t);return e==S||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!is(t)}function Xa(t){if(!ts(t))return!1;var e=xn(t);return e==M||e==k||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ja(t){return"number"==typeof t&&t==ps(t)}function Qa(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=p}function ts(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function es(t){return null!=t&&"object"==typeof t}var rs=Me?Qe(Me):function(t){return es(t)&&mo(t)==x};function ns(t){return"number"==typeof t||es(t)&&xn(t)==E}function is(t){if(!es(t)||xn(t)!=A)return!1;var e=Gt(t);if(null===e)return!0;var r=Bt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Nt.call(r)==Ut}var os=ke?Qe(ke):function(t){return es(t)&&xn(t)==T};var as=xe?Qe(xe):function(t){return es(t)&&mo(t)==P};function ss(t){return"string"==typeof t||!qa(t)&&es(t)&&xn(t)==I}function us(t){return"symbol"==typeof t||es(t)&&xn(t)==R}var cs=Ee?Qe(Ee):function(t){return es(t)&&Qa(t.length)&&!!ue[xn(t)]};var fs=Gi(Dn),ls=Gi((function(t,e){return t<=e}));function hs(t){if(!t)return[];if(Ga(t))return ss(t)?pr(t):Ti(t);if(Xt&&t[Xt])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[Xt]());var e=mo(t);return(e==x?ur:e==P?lr:Fs)(t)}function ds(t){return t?(t=gs(t))===d||t===-1/0?17976931348623157e292*(t<0?-1:1):t===t?t:0:0===t?t:0}function ps(t){var e=ds(t),r=e%1;return e===e?r?e-r:e:0}function ms(t){return t?sn(ps(t),0,g):0}function gs(t){if("number"==typeof t)return t;if(us(t))return m;if(ts(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ts(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Je(t);var r=vt.test(t);return r||bt.test(t)?he(t.slice(2),r?2:8):gt.test(t)?m:+t}function vs(t){return Pi(t,Rs(t))}function ys(t){return null==t?"":ci(t)}var bs=Ri((function(t,e){if(ko(e)||Ga(e))Pi(e,Is(e),t);else for(var r in e)Bt.call(e,r)&&tn(t,r,e[r])})),ws=Ri((function(t,e){Pi(e,Rs(e),t)})),_s=Ri((function(t,e,r,n){Pi(e,Rs(e),t,n)})),Ss=Ri((function(t,e,r,n){Pi(e,Is(e),t,n)})),Ms=ro(an);var ks=Zn((function(t,e){t=Et(t);var r=-1,n=e.length,o=n>2?e[2]:i;for(o&&wo(e[0],e[1],o)&&(n=1);++r1),e})),Pi(t,io(t),r),n&&(r=un(r,7,to));for(var i=e.length;i--;)li(r,e[i]);return r}));var js=ro((function(t,e){return null==t?{}:function(t,e){return Vn(t,e,(function(e,r){return As(t,r)}))}(t,e)}));function Ls(t,e){if(null==t)return{};var r=Be(io(t),(function(t){return[t]}));return e=uo(e),Vn(t,r,(function(t,r){return e(t,r[0])}))}var Ds=Zi(Is),Us=Zi(Rs);function Fs(t){return null==t?[]:tr(t,Is(t))}var Hs=ji((function(t,e,r){return e=e.toLowerCase(),t+(r?zs(e):e)}));function zs(t){return Zs(ys(t).toLowerCase())}function Ks(t){return(t=ys(t))&&t.replace(_t,ir).replace(ee,"")}var qs=ji((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Vs=ji((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Gs=Bi("toLowerCase");var Ws=ji((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()}));var Ys=ji((function(t,e,r){return t+(r?" ":"")+Zs(e)}));var $s=ji((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Zs=Bi("toUpperCase");function Xs(t,e,r){return t=ys(t),(e=r?i:e)===i?function(t){return oe.test(t)}(t)?function(t){return t.match(ne)||[]}(t):function(t){return t.match(lt)||[]}(t):t.match(e)||[]}var Js=Zn((function(t,e){try{return Ae(t,i,e)}catch(r){return Za(r)?r:new st(r)}})),Qs=ro((function(t,e){return Te(e,(function(e){e=Lo(e),on(t,e,Ta(t[e],t))})),t}));function tu(t){return function(){return t}}var eu=Ui(),ru=Ui(!0);function nu(t){return t}function iu(t){return Bn("function"==typeof t?t:un(t,1))}var ou=Zn((function(t,e){return function(r){return Pn(r,t,e)}})),au=Zn((function(t,e){return function(r){return Pn(t,r,e)}}));function su(t,e,r){var n=Is(e),i=Sn(e,n);null!=r||ts(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=Sn(e,Is(e)));var o=!(ts(r)&&"chain"in r)||!!r.chain,a=Xa(t);return Te(i,(function(r){var n=e[r];t[r]=n,a&&(t.prototype[r]=function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__);return(r.__actions__=Ti(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,je([this.value()],arguments))})})),t}function uu(){}var cu=Ki(Be),fu=Ki(Ie),lu=Ki(Ue);function hu(t){return _o(t)?We(Lo(t)):function(t){return function(e){return Mn(e,t)}}(t)}var du=Vi(),pu=Vi(!0);function mu(){return[]}function gu(){return!1}var vu=zi((function(t,e){return t+e}),0),yu=Yi("ceil"),bu=zi((function(t,e){return t/e}),1),wu=Yi("floor");var _u=zi((function(t,e){return t*e}),1),Su=Yi("round"),Mu=zi((function(t,e){return t-e}),0);return Ur.after=function(t,e){if("function"!=typeof e)throw new Tt(o);return t=ps(t),function(){if(--t<1)return e.apply(this,arguments)}},Ur.ary=Aa,Ur.assign=bs,Ur.assignIn=ws,Ur.assignInWith=_s,Ur.assignWith=Ss,Ur.at=Ms,Ur.before=Oa,Ur.bind=Ta,Ur.bindAll=Qs,Ur.bindKey=Pa,Ur.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return qa(t)?t:[t]},Ur.chain=ha,Ur.chunk=function(t,e,n){e=(n?wo(t,e,n):e===i)?1:Ye(ps(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var a=0,s=0,u=r(de(o/e));ao?0:o+r),(n=n===i||n>o?o:ps(n))<0&&(n+=o),n=r>n?0:ms(n);r>>0)?(t=ys(t))&&("string"==typeof e||null!=e&&!os(e))&&!(e=ci(e))&&sr(t)?_i(pr(t),0,r):t.split(e,r):[]},Ur.spread=function(t,e){if("function"!=typeof t)throw new Tt(o);return e=null==e?0:Ye(ps(e),0),Zn((function(r){var n=r[e],i=_i(r,0,e);return n&&je(i,n),Ae(t,this,i)}))},Ur.tail=function(t){var e=null==t?0:t.length;return e?ni(t,1,e):[]},Ur.take=function(t,e,r){return t&&t.length?ni(t,0,(e=r||e===i?1:ps(e))<0?0:e):[]},Ur.takeRight=function(t,e,r){var n=null==t?0:t.length;return n?ni(t,(e=n-(e=r||e===i?1:ps(e)))<0?0:e,n):[]},Ur.takeRightWhile=function(t,e){return t&&t.length?di(t,uo(e,3),!1,!0):[]},Ur.takeWhile=function(t,e){return t&&t.length?di(t,uo(e,3)):[]},Ur.tap=function(t,e){return e(t),t},Ur.throttle=function(t,e,r){var n=!0,i=!0;if("function"!=typeof t)throw new Tt(o);return ts(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Ia(t,e,{leading:n,maxWait:e,trailing:i})},Ur.thru=da,Ur.toArray=hs,Ur.toPairs=Ds,Ur.toPairsIn=Us,Ur.toPath=function(t){return qa(t)?Be(t,Lo):us(t)?[t]:Ti(jo(ys(t)))},Ur.toPlainObject=vs,Ur.transform=function(t,e,r){var n=qa(t),i=n||Ya(t)||cs(t);if(e=uo(e,4),null==r){var o=t&&t.constructor;r=i?n?new o:[]:ts(t)&&Xa(o)?Fr(Gt(t)):{}}return(i?Te:wn)(t,(function(t,n,i){return e(r,t,n,i)})),r},Ur.unary=function(t){return Aa(t,1)},Ur.union=ea,Ur.unionBy=ra,Ur.unionWith=na,Ur.uniq=function(t){return t&&t.length?fi(t):[]},Ur.uniqBy=function(t,e){return t&&t.length?fi(t,uo(e,2)):[]},Ur.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?fi(t,i,e):[]},Ur.unset=function(t,e){return null==t||li(t,e)},Ur.unzip=ia,Ur.unzipWith=oa,Ur.update=function(t,e,r){return null==t?t:hi(t,e,yi(r))},Ur.updateWith=function(t,e,r,n){return n="function"==typeof n?n:i,null==t?t:hi(t,e,yi(r),n)},Ur.values=Fs,Ur.valuesIn=function(t){return null==t?[]:tr(t,Rs(t))},Ur.without=aa,Ur.words=Xs,Ur.wrap=function(t,e){return La(yi(e),t)},Ur.xor=sa,Ur.xorBy=ua,Ur.xorWith=ca,Ur.zip=fa,Ur.zipObject=function(t,e){return gi(t||[],e||[],tn)},Ur.zipObjectDeep=function(t,e){return gi(t||[],e||[],Qn)},Ur.zipWith=la,Ur.entries=Ds,Ur.entriesIn=Us,Ur.extend=ws,Ur.extendWith=_s,su(Ur,Ur),Ur.add=vu,Ur.attempt=Js,Ur.camelCase=Hs,Ur.capitalize=zs,Ur.ceil=yu,Ur.clamp=function(t,e,r){return r===i&&(r=e,e=i),r!==i&&(r=(r=gs(r))===r?r:0),e!==i&&(e=(e=gs(e))===e?e:0),sn(gs(t),e,r)},Ur.clone=function(t){return un(t,4)},Ur.cloneDeep=function(t){return un(t,5)},Ur.cloneDeepWith=function(t,e){return un(t,5,e="function"==typeof e?e:i)},Ur.cloneWith=function(t,e){return un(t,4,e="function"==typeof e?e:i)},Ur.conformsTo=function(t,e){return null==e||cn(t,e,Is(e))},Ur.deburr=Ks,Ur.defaultTo=function(t,e){return null==t||t!==t?e:t},Ur.divide=bu,Ur.endsWith=function(t,e,r){t=ys(t),e=ci(e);var n=t.length,o=r=r===i?n:sn(ps(r),0,n);return(r-=e.length)>=0&&t.slice(r,o)==e},Ur.eq=Fa,Ur.escape=function(t){return(t=ys(t))&&X.test(t)?t.replace($,or):t},Ur.escapeRegExp=function(t){return(t=ys(t))&&ot.test(t)?t.replace(it,"\\$&"):t},Ur.every=function(t,e,r){var n=qa(t)?Ie:pn;return r&&wo(t,e,r)&&(e=i),n(t,uo(e,3))},Ur.find=ga,Ur.findIndex=Ko,Ur.findKey=function(t,e){return He(t,uo(e,3),wn)},Ur.findLast=va,Ur.findLastIndex=qo,Ur.findLastKey=function(t,e){return He(t,uo(e,3),_n)},Ur.floor=wu,Ur.forEach=ya,Ur.forEachRight=ba,Ur.forIn=function(t,e){return null==t?t:yn(t,uo(e,3),Rs)},Ur.forInRight=function(t,e){return null==t?t:bn(t,uo(e,3),Rs)},Ur.forOwn=function(t,e){return t&&wn(t,uo(e,3))},Ur.forOwnRight=function(t,e){return t&&_n(t,uo(e,3))},Ur.get=Es,Ur.gt=Ha,Ur.gte=za,Ur.has=function(t,e){return null!=t&&go(t,e,An)},Ur.hasIn=As,Ur.head=Go,Ur.identity=nu,Ur.includes=function(t,e,r,n){t=Ga(t)?t:Fs(t),r=r&&!n?ps(r):0;var i=t.length;return r<0&&(r=Ye(i+r,0)),ss(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Ke(t,e,r)>-1},Ur.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:ps(r);return i<0&&(i=Ye(n+i,0)),Ke(t,e,i)},Ur.inRange=function(t,e,r){return e=ds(e),r===i?(r=e,e=0):r=ds(r),function(t,e,r){return t>=yr(e,r)&&t=-9007199254740991&&t<=p},Ur.isSet=as,Ur.isString=ss,Ur.isSymbol=us,Ur.isTypedArray=cs,Ur.isUndefined=function(t){return t===i},Ur.isWeakMap=function(t){return es(t)&&mo(t)==C},Ur.isWeakSet=function(t){return es(t)&&"[object WeakSet]"==xn(t)},Ur.join=function(t,e){return null==t?"":we.call(t,e)},Ur.kebabCase=qs,Ur.last=Zo,Ur.lastIndexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=n;return r!==i&&(o=(o=ps(r))<0?Ye(n+o,0):yr(o,n-1)),e===e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,o):ze(t,Ve,o,!0)},Ur.lowerCase=Vs,Ur.lowerFirst=Gs,Ur.lt=fs,Ur.lte=ls,Ur.max=function(t){return t&&t.length?mn(t,nu,En):i},Ur.maxBy=function(t,e){return t&&t.length?mn(t,uo(e,2),En):i},Ur.mean=function(t){return Ge(t,nu)},Ur.meanBy=function(t,e){return Ge(t,uo(e,2))},Ur.min=function(t){return t&&t.length?mn(t,nu,Dn):i},Ur.minBy=function(t,e){return t&&t.length?mn(t,uo(e,2),Dn):i},Ur.stubArray=mu,Ur.stubFalse=gu,Ur.stubObject=function(){return{}},Ur.stubString=function(){return""},Ur.stubTrue=function(){return!0},Ur.multiply=_u,Ur.nth=function(t,e){return t&&t.length?Kn(t,ps(e)):i},Ur.noConflict=function(){return me._===this&&(me._=Ft),this},Ur.noop=uu,Ur.now=Ea,Ur.pad=function(t,e,r){t=ys(t);var n=(e=ps(e))?dr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return qi(pe(i),r)+t+qi(de(i),r)},Ur.padEnd=function(t,e,r){t=ys(t);var n=(e=ps(e))?dr(t):0;return e&&ne){var n=t;t=e,e=n}if(r||t%1||e%1){var o=_r();return yr(t+o*(e-t+le("1e-"+((o+"").length-1))),e)}return Yn(t,e)},Ur.reduce=function(t,e,r){var n=qa(t)?Le:$e,i=arguments.length<3;return n(t,uo(e,4),r,i,hn)},Ur.reduceRight=function(t,e,r){var n=qa(t)?De:$e,i=arguments.length<3;return n(t,uo(e,4),r,i,dn)},Ur.repeat=function(t,e,r){return e=(r?wo(t,e,r):e===i)?1:ps(e),$n(ys(t),e)},Ur.replace=function(){var t=arguments,e=ys(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Ur.result=function(t,e,r){var n=-1,o=(e=bi(e,t)).length;for(o||(o=1,t=i);++np)return[];var r=g,n=yr(t,g);e=uo(e),t-=g;for(var i=Xe(n,e);++r=a)return t;var u=r-dr(n);if(u<1)return n;var c=s?_i(s,0,u).join(""):t.slice(0,u);if(o===i)return c+n;if(s&&(u+=c.length-u),os(o)){if(t.slice(u).search(o)){var f,l=c;for(o.global||(o=At(o.source,ys(mt.exec(o))+"g")),o.lastIndex=0;f=o.exec(l);)var h=f.index;c=c.slice(0,h===i?u:h)}}else if(t.indexOf(ci(o),u)!=u){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+n},Ur.unescape=function(t){return(t=ys(t))&&Z.test(t)?t.replace(Y,gr):t},Ur.uniqueId=function(t){var e=++jt;return ys(t)+e},Ur.upperCase=$s,Ur.upperFirst=Zs,Ur.each=ya,Ur.eachRight=ba,Ur.first=Go,su(Ur,function(){var t={};return wn(Ur,(function(e,r){Bt.call(Ur.prototype,r)||(t[r]=e)})),t}(),{chain:!1}),Ur.VERSION="4.17.21",Te(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Ur[t].placeholder=Ur})),Te(["drop","take"],(function(t,e){Kr.prototype[t]=function(r){r=r===i?1:Ye(ps(r),0);var n=this.__filtered__&&!e?new Kr(this):this.clone();return n.__filtered__?n.__takeCount__=yr(r,n.__takeCount__):n.__views__.push({size:yr(r,g),type:t+(n.__dir__<0?"Right":"")}),n},Kr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Te(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;Kr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:uo(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),Te(["head","last"],(function(t,e){var r="take"+(e?"Right":"");Kr.prototype[t]=function(){return this[r](1).value()[0]}})),Te(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");Kr.prototype[t]=function(){return this.__filtered__?new Kr(this):this[r](1)}})),Kr.prototype.compact=function(){return this.filter(nu)},Kr.prototype.find=function(t){return this.filter(t).head()},Kr.prototype.findLast=function(t){return this.reverse().find(t)},Kr.prototype.invokeMap=Zn((function(t,e){return"function"==typeof t?new Kr(this):this.map((function(r){return Pn(r,t,e)}))})),Kr.prototype.reject=function(t){return this.filter(Ba(uo(t)))},Kr.prototype.slice=function(t,e){t=ps(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Kr(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==i&&(r=(e=ps(e))<0?r.dropRight(-e):r.take(e-t)),r)},Kr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Kr.prototype.toArray=function(){return this.take(g)},wn(Kr.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),o=Ur[n?"take"+("last"==e?"Right":""):e],a=n||/^find/.test(e);o&&(Ur.prototype[e]=function(){var e=this.__wrapped__,s=n?[1]:arguments,u=e instanceof Kr,c=s[0],f=u||qa(e),l=function(t){var e=o.apply(Ur,je([t],s));return n&&h?e[0]:e};f&&r&&"function"==typeof c&&1!=c.length&&(u=f=!1);var h=this.__chain__,d=!!this.__actions__.length,p=a&&!h,m=u&&!d;if(!a&&f){e=m?e:new Kr(this);var g=t.apply(e,s);return g.__actions__.push({func:da,args:[l],thisArg:i}),new zr(g,h)}return p&&m?t.apply(this,s):(g=this.thru(l),p?n?g.value()[0]:g.value():g)})})),Te(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Pt[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Ur.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(qa(i)?i:[],t)}return this[r]((function(r){return e.apply(qa(r)?r:[],t)}))}})),wn(Kr.prototype,(function(t,e){var r=Ur[e];if(r){var n=r.name+"";Bt.call(Pr,n)||(Pr[n]=[]),Pr[n].push({name:e,func:r})}})),Pr[Fi(i,2).name]=[{name:"wrapper",func:i}],Kr.prototype.clone=function(){var t=new Kr(this.__wrapped__);return t.__actions__=Ti(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ti(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ti(this.__views__),t},Kr.prototype.reverse=function(){if(this.__filtered__){var t=new Kr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Kr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=qa(t),n=e<0,i=r?t.length:0,o=function(t,e,r){var n=-1,i=r.length;for(;++n=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Ur.prototype.plant=function(t){for(var e,r=this;r instanceof Hr;){var n=Uo(r);n.__index__=0,n.__values__=i,e?o.__wrapped__=n:e=n;var o=n;r=r.__wrapped__}return o.__wrapped__=t,e},Ur.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Kr){var e=t;return this.__actions__.length&&(e=new Kr(this)),(e=e.reverse()).__actions__.push({func:da,args:[ta],thisArg:i}),new zr(e,this.__chain__)}return this.thru(ta)},Ur.prototype.toJSON=Ur.prototype.valueOf=Ur.prototype.value=function(){return pi(this.__wrapped__,this.__actions__)},Ur.prototype.first=Ur.prototype.head,Xt&&(Ur.prototype[Xt]=function(){return this}),Ur}();me._=vr,(n=function(){return vr}.call(e,r,e,t))===i||(t.exports=n)}.call(this)},68437:function(t,e,r){"use strict";var n=r(12534),i=r(86266),o=r(82543).Buffer,a=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(t,e){return t<>>32-e}function c(t,e,r,n,i,o,a){return u(t+(e&r|~e&n)+i+o|0,a)+e|0}function f(t,e,r,n,i,o,a){return u(t+(e&n|r&~n)+i+o|0,a)+e|0}function l(t,e,r,n,i,o,a){return u(t+(e^r^n)+i+o|0,a)+e|0}function h(t,e,r,n,i,o,a){return u(t+(r^(e|~n))+i+o|0,a)+e|0}n(s,i),s.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,t[0],3614090360,7),o=c(o,r,n,i,t[1],3905402710,12),i=c(i,o,r,n,t[2],606105819,17),n=c(n,i,o,r,t[3],3250441966,22),r=c(r,n,i,o,t[4],4118548399,7),o=c(o,r,n,i,t[5],1200080426,12),i=c(i,o,r,n,t[6],2821735955,17),n=c(n,i,o,r,t[7],4249261313,22),r=c(r,n,i,o,t[8],1770035416,7),o=c(o,r,n,i,t[9],2336552879,12),i=c(i,o,r,n,t[10],4294925233,17),n=c(n,i,o,r,t[11],2304563134,22),r=c(r,n,i,o,t[12],1804603682,7),o=c(o,r,n,i,t[13],4254626195,12),i=c(i,o,r,n,t[14],2792965006,17),r=f(r,n=c(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=f(o,r,n,i,t[6],3225465664,9),i=f(i,o,r,n,t[11],643717713,14),n=f(n,i,o,r,t[0],3921069994,20),r=f(r,n,i,o,t[5],3593408605,5),o=f(o,r,n,i,t[10],38016083,9),i=f(i,o,r,n,t[15],3634488961,14),n=f(n,i,o,r,t[4],3889429448,20),r=f(r,n,i,o,t[9],568446438,5),o=f(o,r,n,i,t[14],3275163606,9),i=f(i,o,r,n,t[3],4107603335,14),n=f(n,i,o,r,t[8],1163531501,20),r=f(r,n,i,o,t[13],2850285829,5),o=f(o,r,n,i,t[2],4243563512,9),i=f(i,o,r,n,t[7],1735328473,14),r=l(r,n=f(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=l(o,r,n,i,t[8],2272392833,11),i=l(i,o,r,n,t[11],1839030562,16),n=l(n,i,o,r,t[14],4259657740,23),r=l(r,n,i,o,t[1],2763975236,4),o=l(o,r,n,i,t[4],1272893353,11),i=l(i,o,r,n,t[7],4139469664,16),n=l(n,i,o,r,t[10],3200236656,23),r=l(r,n,i,o,t[13],681279174,4),o=l(o,r,n,i,t[0],3936430074,11),i=l(i,o,r,n,t[3],3572445317,16),n=l(n,i,o,r,t[6],76029189,23),r=l(r,n,i,o,t[9],3654602809,4),o=l(o,r,n,i,t[12],3873151461,11),i=l(i,o,r,n,t[15],530742520,16),r=h(r,n=l(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=h(o,r,n,i,t[7],1126891415,10),i=h(i,o,r,n,t[14],2878612391,15),n=h(n,i,o,r,t[5],4237533241,21),r=h(r,n,i,o,t[12],1700485571,6),o=h(o,r,n,i,t[3],2399980690,10),i=h(i,o,r,n,t[10],4293915773,15),n=h(n,i,o,r,t[1],2240044497,21),r=h(r,n,i,o,t[8],1873313359,6),o=h(o,r,n,i,t[15],4264355552,10),i=h(i,o,r,n,t[6],2734768916,15),n=h(n,i,o,r,t[13],1309151649,21),r=h(r,n,i,o,t[4],4149444226,6),o=h(o,r,n,i,t[11],3174756917,10),i=h(i,o,r,n,t[2],718787259,15),n=h(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=s},31595:function(t,e,r){var n=r(97942),i=r(26084);function o(t){this.rand=t||new i.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),a=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var s=t.subn(1),u=0;!s.testn(u);u++);for(var c=t.shrn(u),f=s.toRed(o);e>0;e--){var l=this._randrange(new n(2),s);r&&r(l);var h=l.toRed(o).redPow(c);if(0!==h.cmp(a)&&0!==h.cmp(f)){for(var d=1;d0;e--){var f=this._randrange(new n(2),a),l=t.gcd(f);if(0!==l.cmpn(1))return l;var h=f.toRed(i).redPow(u);if(0!==h.cmp(o)&&0!==h.cmp(c)){for(var d=1;d=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","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],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=l[t],d=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,c=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],M=8191&S,k=S>>>13,x=0|a[5],E=8191&x,A=x>>>13,O=0|a[6],T=8191&O,P=O>>>13,I=0|a[7],R=8191&I,C=I>>>13,N=0|a[8],B=8191&N,j=N>>>13,L=0|a[9],D=8191&L,U=L>>>13,F=0|s[0],H=8191&F,z=F>>>13,K=0|s[1],q=8191&K,V=K>>>13,G=0|s[2],W=8191&G,Y=G>>>13,$=0|s[3],Z=8191&$,X=$>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ft=0|s[8],lt=8191&ft,ht=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(l,H))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,H)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,z))+Math.imul(m,H)|0,o=Math.imul(m,z);var vt=(c+(n=n+Math.imul(l,q)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(h,q)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,H),i=(i=Math.imul(v,z))+Math.imul(y,H)|0,o=Math.imul(y,z),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,V)|0;var yt=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(h,W)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,H),i=(i=Math.imul(w,z))+Math.imul(_,H)|0,o=Math.imul(_,z),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Y)|0;var bt=(c+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(h,Z)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,H),i=(i=Math.imul(M,z))+Math.imul(k,H)|0,o=Math.imul(k,z),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,H),i=(i=Math.imul(E,z))+Math.imul(A,H)|0,o=Math.imul(A,z),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,H),i=(i=Math.imul(T,z))+Math.imul(P,H)|0,o=Math.imul(P,z),n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var St=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(R,H),i=(i=Math.imul(R,z))+Math.imul(C,H)|0,o=Math.imul(C,z),n=n+Math.imul(T,q)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,z))+Math.imul(j,H)|0,o=Math.imul(j,z),n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,z))+Math.imul(U,H)|0,o=Math.imul(U,z),n=n+Math.imul(B,q)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var xt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(U,q)|0,o=Math.imul(U,V),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var Et=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var At=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,X))+Math.imul(U,Z)|0,o=Math.imul(U,X),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var Ot=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ht)|0;var Tt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,at))+Math.imul(U,ot)|0,o=Math.imul(U,at),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ct)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var It=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ct))+Math.imul(U,ut)|0,o=Math.imul(U,ct),n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ht)|0;var Rt=(c+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(D,lt),i=(i=Math.imul(D,ht))+Math.imul(U,lt)|0,o=Math.imul(U,ht);var Ct=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Nt=(c+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return c=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=vt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Mt,u[8]=kt,u[9]=xt,u[10]=Et,u[11]=At,u[12]=Ot,u[13]=Tt,u[14]=Pt,u[15]=It,u[16]=Rt,u[17]=Ct,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var h=0,d=1;0===(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0===(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(b,y),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},72325:function(t){function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},94034:function(t,e){"use strict";var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}},65840:function(t,e,r){t.exports=h,h.Minimatch=d;var n=function(){try{return r(20067)}catch(t){}}()||{sep:"/"};h.sep=n.sep;var i=h.GLOBSTAR=d.GLOBSTAR={},o=r(33740),a={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},s="[^/]",u=s+"*?",c="().*{}+?[]^$\\!".split("").reduce((function(t,e){return t[e]=!0,t}),{});var f=/\/+/;function l(t,e){e=e||{};var r={};return Object.keys(t).forEach((function(e){r[e]=t[e]})),Object.keys(e).forEach((function(t){r[t]=e[t]})),r}function h(t,e,r){return m(e),r||(r={}),!(!r.nocomment&&"#"===e.charAt(0))&&new d(e,r).match(t)}function d(t,e){if(!(this instanceof d))return new d(t,e);m(t),e||(e={}),t=t.trim(),e.allowWindowsEscape||"/"===n.sep||(t=t.split(n.sep).join("/")),this.options=e,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.make()}function p(t,e){return e||(e=this instanceof d?this.options:{}),t="undefined"===typeof t?this.pattern:t,m(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:o(t)}h.filter=function(t,e){return e=e||{},function(r,n,i){return h(r,t,e)}},h.defaults=function(t){if(!t||"object"!==typeof t||!Object.keys(t).length)return h;var e=h,r=function(r,n,i){return e(r,n,l(t,i))};return(r.Minimatch=function(r,n){return new e.Minimatch(r,l(t,n))}).defaults=function(r){return e.defaults(l(t,r)).Minimatch},r.filter=function(r,n){return e.filter(r,l(t,n))},r.defaults=function(r){return e.defaults(l(t,r))},r.makeRe=function(r,n){return e.makeRe(r,l(t,n))},r.braceExpand=function(r,n){return e.braceExpand(r,l(t,n))},r.match=function(r,n,i){return e.match(r,n,l(t,i))},r},d.defaults=function(t){return h.defaults(t).Minimatch},d.prototype.debug=function(){},d.prototype.make=function(){var t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();e.debug&&(this.debug=function(){console.error.apply(console,arguments)});this.debug(this.pattern,r),r=this.globParts=r.map((function(t){return t.split(f)})),this.debug(this.pattern,r),r=r.map((function(t,e,r){return t.map(this.parse,this)}),this),this.debug(this.pattern,r),r=r.filter((function(t){return-1===t.indexOf(!1)})),this.debug(this.pattern,r),this.set=r},d.prototype.parseNegate=function(){var t=this.pattern,e=!1,r=this.options,n=0;if(r.nonegate)return;for(var i=0,o=t.length;i65536)throw new TypeError("pattern is too long")};d.prototype.parse=function(t,e){m(t);var r=this.options;if("**"===t){if(!r.noglobstar)return i;t="*"}if(""===t)return"";var n,o="",f=!!r.nocase,l=!1,h=[],d=[],p=!1,v=-1,y=-1,b="."===t.charAt(0)?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",w=this;function _(){if(n){switch(n){case"*":o+=u,f=!0;break;case"?":o+=s,f=!0;break;default:o+="\\"+n}w.debug("clearStateChar %j %j",n,o),n=!1}}for(var S,M=0,k=t.length;M-1;I--){var R=d[I],C=o.slice(0,R.reStart),N=o.slice(R.reStart,R.reEnd-8),B=o.slice(R.reEnd-8,R.reEnd),j=o.slice(R.reEnd);B+=j;var L=C.split("(").length-1,D=j;for(M=0;M=0&&!(i=t[o]);o--);for(o=0;o>> no match, partial?",t,h,e,d),h!==s))}if("string"===typeof f?(c=l===f,this.debug("string match",f,l,c)):(c=l.match(f),this.debug("pattern match",f,l,c)),!c)return!1}if(o===s&&a===u)return!0;if(o===s)return r;if(a===u)return o===s-1&&""===t[o];throw new Error("wtf?")}},6409:function(t){"use strict";function e(t){return"number"===typeof t||(!!/^0x[0-9a-f]+$/i.test(t)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t))}function r(t,e){return"constructor"===e&&"function"===typeof t[e]||"__proto__"===e}t.exports=function(t,n){n||(n={});var i={bools:{},strings:{},unknownFn:null};"function"===typeof n.unknown&&(i.unknownFn=n.unknown),"boolean"===typeof n.boolean&&n.boolean?i.allBools=!0:[].concat(n.boolean).filter(Boolean).forEach((function(t){i.bools[t]=!0}));var o={};function a(t){return o[t].some((function(t){return i.bools[t]}))}Object.keys(n.alias||{}).forEach((function(t){o[t]=[].concat(n.alias[t]),o[t].forEach((function(e){o[e]=[t].concat(o[t].filter((function(t){return e!==t})))}))})),[].concat(n.string).filter(Boolean).forEach((function(t){i.strings[t]=!0,o[t]&&[].concat(o[t]).forEach((function(t){i.strings[t]=!0}))}));var s=n.default||{},u={_:[]};function c(t,e,n){for(var o=t,a=0;a=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}t.exports=function(t,u){u=u||{};var c=typeof t;if("string"===c&&t.length>0)return function(t){if((t=String(t)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!s)return;var u=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*a;case"weeks":case"week":case"w":return u*o;case"days":case"day":case"d":return u*i;case"hours":case"hour":case"hrs":case"hr":case"h":return u*n;case"minutes":case"minute":case"mins":case"min":case"m":return u*r;case"seconds":case"second":case"secs":case"sec":case"s":return u*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(t);if("number"===c&&isFinite(t))return u.long?function(t){var o=Math.abs(t);if(o>=i)return s(t,o,i,"day");if(o>=n)return s(t,o,n,"hour");if(o>=r)return s(t,o,r,"minute");if(o>=e)return s(t,o,e,"second");return t+" ms"}(t):function(t){var o=Math.abs(t);if(o>=i)return Math.round(t/i)+"d";if(o>=n)return Math.round(t/n)+"h";if(o>=r)return Math.round(t/r)+"m";if(o>=e)return Math.round(t/e)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},14101:function(t){t.exports=function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){if(o)return o(a,!0);throw new Error("Cannot find module '"+a+"'")}s=r[a]={exports:{}},e[a][0].call(s.exports,(function(t){return i(e[a][1][t]||t)}),s,s.exports,t,e,r,n)}return r[a].exports}for(var o=void 0,a=0;a>16),u((65280&n)>>8),u(255&n);return 2==i?u(255&(n=c(t.charAt(r))<<2|c(t.charAt(r+1))>>4)):1==i&&(u((n=c(t.charAt(r))<<10|c(t.charAt(r+1))<<4|c(t.charAt(r+2))>>2)>>8&255),u(255&n)),o},t.fromByteArray=function(t){var e,r,n,i,o=t.length%3,a="";function s(t){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)}for(e=0,n=t.length-o;e>18&63)+s(i>>12&63)+s(i>>6&63)+s(63&i);switch(o){case 1:a=(a+=s((r=t[t.length-1])>>2))+s(r<<4&63)+"==";break;case 2:a=(a=(a+=s((r=(t[t.length-2]<<8)+t[t.length-1])>>10))+s(r>>4&63))+s(r<<2&63)+"="}return a}}(void 0===r?this.base64js={}:r)}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(t,e,r){(function(e,n,i,o,a,s,u,c,f){var l=t("base64-js"),h=t("ieee754");function i(t,e,r){if(!(this instanceof i))return new i(t,e,r);var n,o,a,s,u=typeof t;if("base64"===e&&"string"==u)for(t=(s=t).trim?s.trim():s.replace(/^\s+|\s+$/g,"");t.length%4!=0;)t+="=";if("number"==u)n=P(t);else if("string"==u)n=i.byteLength(t,e);else{if("object"!=u)throw new Error("First argument needs to be a number, array or string.");n=P(t.length)}if(i._useTypedArrays?o=i._augment(new Uint8Array(n)):((o=this).length=n,o._isBuffer=!0),i._useTypedArrays&&"number"==typeof t.byteLength)o._set(t);else if(I(s=t)||i.isBuffer(s)||s&&"object"==typeof s&&"number"==typeof s.length)for(a=0;a>8,r%=256,n.push(r),n.push(e);return n}(e),t,r,n)}function m(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i>>0)):(e+1>>0),i}function y(t,e,r,n){if(n||(F("boolean"==typeof r,"missing or invalid endian"),F(null!=e,"missing offset"),F(e+1>>8*(n?o:1-o)}function M(t,e,r,n,i){if(i||(F(null!=e,"missing value"),F("boolean"==typeof n,"missing or invalid endian"),F(null!=r,"missing offset"),F(r+3>>8*(n?o:3-o)&255}function k(t,e,r,n,i){i||(F(null!=e,"missing value"),F("boolean"==typeof n,"missing or invalid endian"),F(null!=r,"missing offset"),F(r+1this.length&&(n=this.length);var o=(n=t.length-e=this.length))return this[t]},i.prototype.readUInt16LE=function(t,e){return g(this,t,!0,e)},i.prototype.readUInt16BE=function(t,e){return g(this,t,!1,e)},i.prototype.readUInt32LE=function(t,e){return v(this,t,!0,e)},i.prototype.readUInt32BE=function(t,e){return v(this,t,!1,e)},i.prototype.readInt8=function(t,e){if(e||(F(null!=t,"missing offset"),F(t=this.length))return 128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){return y(this,t,!0,e)},i.prototype.readInt16BE=function(t,e){return y(this,t,!1,e)},i.prototype.readInt32LE=function(t,e){return b(this,t,!0,e)},i.prototype.readInt32BE=function(t,e){return b(this,t,!1,e)},i.prototype.readFloatLE=function(t,e){return w(this,t,!0,e)},i.prototype.readFloatBE=function(t,e){return w(this,t,!1,e)},i.prototype.readDoubleLE=function(t,e){return _(this,t,!0,e)},i.prototype.readDoubleBE=function(t,e){return _(this,t,!1,e)},i.prototype.writeUInt8=function(t,e,r){r||(F(null!=t,"missing value"),F(null!=e,"missing offset"),F(e=this.length||(this[e]=t)},i.prototype.writeUInt16LE=function(t,e,r){S(this,t,e,!0,r)},i.prototype.writeUInt16BE=function(t,e,r){S(this,t,e,!1,r)},i.prototype.writeUInt32LE=function(t,e,r){M(this,t,e,!0,r)},i.prototype.writeUInt32BE=function(t,e,r){M(this,t,e,!1,r)},i.prototype.writeInt8=function(t,e,r){r||(F(null!=t,"missing value"),F(null!=e,"missing offset"),F(e=this.length||(0<=t?this.writeUInt8(t,e,r):this.writeUInt8(255+t+1,e,r))},i.prototype.writeInt16LE=function(t,e,r){k(this,t,e,!0,r)},i.prototype.writeInt16BE=function(t,e,r){k(this,t,e,!1,r)},i.prototype.writeInt32LE=function(t,e,r){x(this,t,e,!0,r)},i.prototype.writeInt32BE=function(t,e,r){x(this,t,e,!1,r)},i.prototype.writeFloatLE=function(t,e,r){E(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){E(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){A(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){A(this,t,e,!1,r)},i.prototype.fill=function(t,e,r){if(e=e||0,r=r||this.length,F("number"==typeof(t="string"==typeof(t=t||0)?t.charCodeAt(0):t)&&!isNaN(t),"value is not a number"),F(e<=r,"end < start"),r!==e&&0!==this.length){F(0<=e&&e"},i.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(i._useTypedArrays)return new i(this).buffer;for(var t=new Uint8Array(this.length),e=0,r=t.length;e=e.length||i>=t.length);i++)e[i+r]=t[i];return i}function j(t){try{return decodeURIComponent(t)}catch(t){return String.fromCharCode(65533)}}function L(t,e){F("number"==typeof t,"cannot write a non-number as a number"),F(0<=t,"specified a negative value for writing an unsigned value"),F(t<=e,"value is larger than maximum value for type"),F(Math.floor(t)===t,"value has a fractional component")}function D(t,e,r){F("number"==typeof t,"cannot write a non-number as a number"),F(t<=e,"value larger than maximum allowed value"),F(r<=t,"value smaller than minimum allowed value"),F(Math.floor(t)===t,"value has a fractional component")}function U(t,e,r){F("number"==typeof t,"cannot write a non-number as a number"),F(t<=e,"value larger than maximum allowed value"),F(r<=t,"value smaller than minimum allowed value")}function F(t,e){if(!t)throw new Error(e||"Failed assertion")}i._augment=function(t){return t._isBuffer=!0,t._get=t.get,t._set=t.set,t.get=O.get,t.set=O.set,t.write=O.write,t.toString=O.toString,t.toLocaleString=O.toString,t.toJSON=O.toJSON,t.copy=O.copy,t.slice=O.slice,t.readUInt8=O.readUInt8,t.readUInt16LE=O.readUInt16LE,t.readUInt16BE=O.readUInt16BE,t.readUInt32LE=O.readUInt32LE,t.readUInt32BE=O.readUInt32BE,t.readInt8=O.readInt8,t.readInt16LE=O.readInt16LE,t.readInt16BE=O.readInt16BE,t.readInt32LE=O.readInt32LE,t.readInt32BE=O.readInt32BE,t.readFloatLE=O.readFloatLE,t.readFloatBE=O.readFloatBE,t.readDoubleLE=O.readDoubleLE,t.readDoubleBE=O.readDoubleBE,t.writeUInt8=O.writeUInt8,t.writeUInt16LE=O.writeUInt16LE,t.writeUInt16BE=O.writeUInt16BE,t.writeUInt32LE=O.writeUInt32LE,t.writeUInt32BE=O.writeUInt32BE,t.writeInt8=O.writeInt8,t.writeInt16LE=O.writeInt16LE,t.writeInt16BE=O.writeInt16BE,t.writeInt32LE=O.writeInt32LE,t.writeInt32BE=O.writeInt32BE,t.writeFloatLE=O.writeFloatLE,t.writeFloatBE=O.writeFloatBE,t.writeDoubleLE=O.writeDoubleLE,t.writeDoubleBE=O.writeDoubleBE,t.fill=O.fill,t.inspect=O.inspect,t.toArrayBuffer=O.toArrayBuffer,t}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(t,e,r){(function(r,n,i,o,a,s,u,c,f){i=t("buffer").Buffer;var l=4,h=new i(l);h.fill(0),e.exports={hash:function(t,e,r,n){for(var o=e(function(t,e){t.length%l!=0&&(r=t.length+(l-t.length%l),t=i.concat([t,h],r));for(var r,n=[],o=e?t.readInt32BE:t.readInt32LE,a=0;am?e=t(e):e.length>5]|=128<>>9<<4)]=e;for(var r=1732584193,n=-271733879,i=-1732584194,o=271733878,a=0;a>>32-i,r)}function p(t,e,r,n,i,o,a){return d(e&r|~e&n,t,e,i,o,a)}function m(t,e,r,n,i,o,a){return d(e&n|r&~n,t,e,i,o,a)}function g(t,e,r,n,i,o,a){return d(e^r^n,t,e,i,o,a)}function v(t,e,r,n,i,o,a){return d(r^(e|~n),t,e,i,o,a)}function y(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}e.exports=function(t){return l.hash(t,h,16)}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(t,e,r){(function(t,r,n,i,o,a,s,u,c){var f;e.exports=f||function(t){for(var e,r=new Array(t),n=0;n>>((3&n)<<3)&255;return r}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(t,e,r){(function(r,n,i,o,a,s,u,c,f){var l=t("./helpers");function h(t,e){t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e;for(var r,n,i,o=Array(80),a=1732584193,s=-271733879,u=-1732584194,c=271733878,f=-1009589776,l=0;l>16)+(e>>16)+(r>>16)<<16|65535&r}function p(t,e){return t<>>32-e}e.exports=function(t){return l.hash(t,h,20,!0)}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(t,e,r){(function(r,n,i,o,a,s,u,c,f){function l(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function h(t,e){var r,n=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),i=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),o=new Array(64);t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e;for(var a,s,u=0;u>>e|t<<32-e},m=function(t,e){return t>>>e};e.exports=function(t){return d.hash(t,h,32,!0)}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(t,e,r){(function(t,e,n,i,o,a,s,u,c){r.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,f=-7,l=r?i-1:0,h=r?-1:1;for(i=t[e+l],l+=h,o=i&(1<<-f)-1,i>>=-f,f+=s;0>=-f,f+=n;0>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,d=n?1:-1;for(o=e<0||0===e&&1/e<0?1:0,e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(n=Math.pow(2,-a))<1&&(a--,n*=2),2<=(e+=1<=a+f?l/n:l*Math.pow(2,1-f))*n&&(a++,n/=2),c<=a+f?(s=0,a=c):1<=a+f?(s=(e*n-1)*Math.pow(2,i),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));8<=i;t[r+h]=255&s,h+=d,s/=256,i-=8);for(a=a<-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"===typeof t){var n=t<0?-E(-t):E(t);if(n!==t){var i=String(n),o=y.call(e,i.length+1);return b.call(i,r,"$&_")+"."+b.call(b.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(e,r,"$&_")}var B=r(24654),j=B.custom,L=z(j)?j:null;function D(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function U(t){return b.call(String(t),/"/g,""")}function F(t){return"[object Array]"===V(t)&&(!I||!("object"===typeof t&&I in t))}function H(t){return"[object RegExp]"===V(t)&&(!I||!("object"===typeof t&&I in t))}function z(t){if(P)return t&&"object"===typeof t&&t instanceof Symbol;if("symbol"===typeof t)return!0;if(!t||"object"!==typeof t||!T)return!1;try{return T.call(t),!0}catch(e){}return!1}t.exports=function t(e,r,n,i){var s=r||{};if(q(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(s,"maxStringLength")&&("number"===typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!q(s,"customInspect")||s.customInspect;if("boolean"!==typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(s,"numericSeparator")&&"boolean"!==typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var m=s.numericSeparator;if("undefined"===typeof e)return"undefined";if(null===e)return"null";if("boolean"===typeof e)return e?"true":"false";if("string"===typeof e)return W(e,s);if("number"===typeof e){if(0===e)return 1/0/e>0?"0":"-0";var w=String(e);return m?N(e,w):w}if("bigint"===typeof e){var S=String(e)+"n";return m?N(e,S):S}var E="undefined"===typeof s.depth?5:s.depth;if("undefined"===typeof n&&(n=0),n>=E&&E>0&&"object"===typeof e)return F(e)?"[Array]":"[Object]";var O=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"===typeof t.indent&&t.indent>0))return null;r=k.call(Array(t.indent+1)," ")}return{base:r,prev:k.call(Array(e+1),r)}}(s,n);if("undefined"===typeof i)i=[];else if(G(i,e)>=0)return"[Circular]";function j(e,r,o){if(r&&(i=x.call(i)).push(r),o){var a={depth:s.depth};return q(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),t(e,a,n+1,i)}return t(e,s,n+1,i)}if("function"===typeof e&&!H(e)){var K=function(t){if(t.name)return t.name;var e=v.call(g.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),Y=Q(e,j);return"[Function"+(K?": "+K:" (anonymous)")+"]"+(Y.length>0?" { "+k.call(Y,", ")+" }":"")}if(z(e)){var tt=P?b.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):T.call(e);return"object"!==typeof e||P?tt:$(tt)}if(function(t){if(!t||"object"!==typeof t)return!1;if("undefined"!==typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"===typeof t.nodeName&&"function"===typeof t.getAttribute}(e)){for(var et="<"+_.call(String(e.nodeName)),rt=e.attributes||[],nt=0;nt"}if(F(e)){if(0===e.length)return"[]";var it=Q(e,j);return O&&!function(t){for(var e=0;e=0)return!1;return!0}(it)?"["+J(it,O)+"]":"[ "+k.call(it,", ")+" ]"}if(function(t){return"[object Error]"===V(t)&&(!I||!("object"===typeof t&&I in t))}(e)){var ot=Q(e,j);return"cause"in Error.prototype||!("cause"in e)||R.call(e,"cause")?0===ot.length?"["+String(e)+"]":"{ ["+String(e)+"] "+k.call(ot,", ")+" }":"{ ["+String(e)+"] "+k.call(M.call("[cause]: "+j(e.cause),ot),", ")+" }"}if("object"===typeof e&&u){if(L&&"function"===typeof e[L]&&B)return B(e,{depth:E-n});if("symbol"!==u&&"function"===typeof e.inspect)return e.inspect()}if(function(t){if(!o||!t||"object"!==typeof t)return!1;try{o.call(t);try{c.call(t)}catch(et){return!0}return t instanceof Map}catch(e){}return!1}(e)){var at=[];return a&&a.call(e,(function(t,r){at.push(j(r,e,!0)+" => "+j(t,e))})),X("Map",o.call(e),at,O)}if(function(t){if(!c||!t||"object"!==typeof t)return!1;try{c.call(t);try{o.call(t)}catch(e){return!0}return t instanceof Set}catch(r){}return!1}(e)){var st=[];return f&&f.call(e,(function(t){st.push(j(t,e))})),X("Set",c.call(e),st,O)}if(function(t){if(!l||!t||"object"!==typeof t)return!1;try{l.call(t,l);try{h.call(t,h)}catch(et){return!0}return t instanceof WeakMap}catch(e){}return!1}(e))return Z("WeakMap");if(function(t){if(!h||!t||"object"!==typeof t)return!1;try{h.call(t,h);try{l.call(t,l)}catch(et){return!0}return t instanceof WeakSet}catch(e){}return!1}(e))return Z("WeakSet");if(function(t){if(!d||!t||"object"!==typeof t)return!1;try{return d.call(t),!0}catch(e){}return!1}(e))return Z("WeakRef");if(function(t){return"[object Number]"===V(t)&&(!I||!("object"===typeof t&&I in t))}(e))return $(j(Number(e)));if(function(t){if(!t||"object"!==typeof t||!A)return!1;try{return A.call(t),!0}catch(e){}return!1}(e))return $(j(A.call(e)));if(function(t){return"[object Boolean]"===V(t)&&(!I||!("object"===typeof t&&I in t))}(e))return $(p.call(e));if(function(t){return"[object String]"===V(t)&&(!I||!("object"===typeof t&&I in t))}(e))return $(j(String(e)));if(!function(t){return"[object Date]"===V(t)&&(!I||!("object"===typeof t&&I in t))}(e)&&!H(e)){var ut=Q(e,j),ct=C?C(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",lt=!ct&&I&&Object(e)===e&&I in e?y.call(V(e),8,-1):ft?"Object":"",ht=(ct||"function"!==typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(lt||ft?"["+k.call(M.call([],lt||[],ft||[]),": ")+"] ":"");return 0===ut.length?ht+"{}":O?ht+"{"+J(ut,O)+"}":ht+"{ "+k.call(ut,", ")+" }"}return String(e)};var K=Object.prototype.hasOwnProperty||function(t){return t in this};function q(t,e){return K.call(t,e)}function V(t){return m.call(t)}function G(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return W(y.call(t,0,e.maxStringLength),e)+n}return D(b.call(b.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Y),"single",e)}function Y(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function $(t){return"Object("+t+")"}function Z(t){return t+" { ? }"}function X(t,e,r,n){return t+" ("+e+") {"+(n?J(r,n):k.call(r,", "))+"}"}function J(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+k.call(t,","+r)+"\n"+e.prev}function Q(t,e){var r=F(t),n=[];if(r){n.length=t.length;for(var i=0;i0&&!i.call(t,0))for(var m=0;m0)for(var g=0;g=0&&"[object Function]"===e.call(t.callee)),n}},14876:function(t,e,r){var n=r(66418);function i(t){var e=function e(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function o(t){var e=function e(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}t.exports=n(i),t.exports.strict=n(o),i.proto=i((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return o(this)},configurable:!0})}))},63465:function(t,e,r){"use strict";var n=r(16522);e.certificate=r(18799);var i=n.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())}));e.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=o;var a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())}));e.PublicKey=a;var s=n.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())})),u=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=u;var c=n.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())}));e.EncryptedPrivateKey=c;var f=n.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())}));e.DSAPrivateKey=f,e.DSAparam=n.define("DSAparam",(function(){this.int()}));var l=n.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())}));e.ECPrivateKey=l;var h=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},18799:function(t,e,r){"use strict";var n=r(16522),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())})),u=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),c=n.define("RDNSequence",(function(){this.seqof(u)})),f=n.define("Name",(function(){this.choice({rdnSequence:this.use(c)})})),l=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),h=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),d=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(f),this.key("validity").use(l),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())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())}));t.exports=p},722:function(t,e,r){var n=/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,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=r(48462),s=r(23525),u=r(82543).Buffer;t.exports=function(t,e){var r,c=t.toString(),f=c.match(n);if(f){var l="aes"+f[1],h=u.from(f[2],"hex"),d=u.from(f[3].replace(/[\r\n]/g,""),"base64"),p=a(e,h.slice(0,8),parseInt(f[1],10)).key,m=[],g=s.createDecipheriv(l,p,h);m.push(g.update(d)),m.push(g.final()),r=u.concat(m)}else{var v=c.match(o);r=u.from(v[2].replace(/[\r\n]/g,""),"base64")}return{tag:c.match(i)[1],data:r}}},37510:function(t,e,r){var n=r(63465),i=r(22562),o=r(722),a=r(23525),s=r(95896),u=r(82543).Buffer;function c(t){var e;"object"!==typeof t||u.isBuffer(t)||(e=t.passphrase,t=t.key),"string"===typeof t&&(t=u.from(t));var r,c,f=o(t,e),l=f.tag,h=f.data;switch(l){case"CERTIFICATE":c=n.certificate.decode(h,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(c||(c=n.PublicKey.decode(h,"der")),r=c.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(c.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return c.subjectPrivateKey=c.subjectPublicKey,{type:"ec",data:c};case"1.2.840.10040.4.1":return c.algorithm.params.pub_key=n.DSAparam.decode(c.subjectPublicKey.data,"der"),{type:"dsa",data:c.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":h=function(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=i[t.algorithm.decrypt.cipher.algo.join(".")],c=t.algorithm.decrypt.cipher.iv,f=t.subjectPrivateKey,l=parseInt(o.split("-")[1],10)/8,h=s.pbkdf2Sync(e,r,n,l,"sha1"),d=a.createDecipheriv(o,h,c),p=[];return p.push(d.update(f)),p.push(d.final()),u.concat(p)}(h=n.EncryptedPrivateKey.decode(h,"der"),e);case"PRIVATE KEY":switch(r=(c=n.PrivateKey.decode(h,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(c.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:c.algorithm.curve,privateKey:n.ECPrivateKey.decode(c.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return c.algorithm.params.priv_key=n.DSAparam.decode(c.subjectPrivateKey,"der"),{type:"dsa",params:c.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(h,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(h,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(h,"der")};case"EC PRIVATE KEY":return{curve:(h=n.ECPrivateKey.decode(h,"der")).parameters.value,privateKey:h.privateKey};default:throw new Error("unknown key type "+l)}}t.exports=c,c.signature=n.signature},45557:function(t,e,r){"use strict";var n=r(1426);function i(t){return"/"===t.charAt(0)}function o(t){var e=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(t),r=e[1]||"",n=Boolean(r&&":"!==r.charAt(1));return Boolean(e[2]||n)}t.exports="win32"===n.platform?o:i,t.exports.posix=i,t.exports.win32=o},95896:function(t,e,r){e.pbkdf2=r(66770),e.pbkdf2Sync=r(68017)},66770:function(t,e,r){var n,i,o=r(82543).Buffer,a=r(46048),s=r(74404),u=r(68017),c=r(52734),f=r.g.crypto&&r.g.crypto.subtle,l={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function d(){return i||(i=r.g.process&&r.g.process.nextTick?r.g.process.nextTick:r.g.queueMicrotask?r.g.queueMicrotask:r.g.setImmediate?r.g.setImmediate:r.g.setTimeout)}function p(t,e,r,n,i){return f.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return f.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)})).then((function(t){return o.from(t)}))}t.exports=function(t,e,i,m,g,v){"function"===typeof g&&(v=g,g=void 0);var y=l[(g=g||"sha1").toLowerCase()];if(y&&"function"===typeof r.g.Promise){if(a(i,m),t=c(t,s,"Password"),e=c(e,s,"Salt"),"function"!==typeof v)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){d()((function(){e(null,t)}))}),(function(t){d()((function(){e(t)}))}))}(function(t){if(r.g.process&&!r.g.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==h[t])return h[t];var e=p(n=n||o.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return h[t]=e,e}(y).then((function(r){return r?p(t,e,i,m,y):u(t,e,i,m,g)})),v)}else d()((function(){var r;try{r=u(t,e,i,m,g)}catch(n){return v(n)}v(null,r)}))}},74404:function(t,e,r){var n,i=r(1426);if(r.g.process&&r.g.process.browser)n="utf-8";else if(r.g.process&&r.g.process.version){n=parseInt(i.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else n="utf-8";t.exports=n},46048:function(t){var e=Math.pow(2,30)-1;t.exports=function(t,r){if("number"!==typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!==typeof r)throw new TypeError("Key length not a number");if(r<0||r>e||r!==r)throw new TypeError("Bad key length")}},68017:function(t,e,r){var n=r(55378),i=r(83375),o=r(85730),a=r(82543).Buffer,s=r(46048),u=r(74404),c=r(52734),f=a.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(t,e,r){var s=function(t){function e(e){return o(t).update(e).digest()}function r(t){return(new i).update(t).digest()}return"rmd160"===t||"ripemd160"===t?r:"md5"===t?n:e}(t),u="sha512"===t||"sha384"===t?128:64;e.length>u?e=s(e):e.length1)for(var r=1;r=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2===0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","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],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=l[t],d=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,c=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],M=8191&S,k=S>>>13,x=0|a[5],E=8191&x,A=x>>>13,O=0|a[6],T=8191&O,P=O>>>13,I=0|a[7],R=8191&I,C=I>>>13,N=0|a[8],B=8191&N,j=N>>>13,L=0|a[9],D=8191&L,U=L>>>13,F=0|s[0],H=8191&F,z=F>>>13,K=0|s[1],q=8191&K,V=K>>>13,G=0|s[2],W=8191&G,Y=G>>>13,$=0|s[3],Z=8191&$,X=$>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ft=0|s[8],lt=8191&ft,ht=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(l,H))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,H)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,z))+Math.imul(m,H)|0,o=Math.imul(m,z);var vt=(c+(n=n+Math.imul(l,q)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(h,q)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,H),i=(i=Math.imul(v,z))+Math.imul(y,H)|0,o=Math.imul(y,z),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,V)|0;var yt=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(h,W)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,H),i=(i=Math.imul(w,z))+Math.imul(_,H)|0,o=Math.imul(_,z),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Y)|0;var bt=(c+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(h,Z)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,H),i=(i=Math.imul(M,z))+Math.imul(k,H)|0,o=Math.imul(k,z),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,H),i=(i=Math.imul(E,z))+Math.imul(A,H)|0,o=Math.imul(A,z),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,H),i=(i=Math.imul(T,z))+Math.imul(P,H)|0,o=Math.imul(P,z),n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var St=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(R,H),i=(i=Math.imul(R,z))+Math.imul(C,H)|0,o=Math.imul(C,z),n=n+Math.imul(T,q)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var Mt=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,z))+Math.imul(j,H)|0,o=Math.imul(j,z),n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,z))+Math.imul(U,H)|0,o=Math.imul(U,z),n=n+Math.imul(B,q)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var xt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(U,q)|0,o=Math.imul(U,V),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var Et=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var At=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,X))+Math.imul(U,Z)|0,o=Math.imul(U,X),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var Ot=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ht)|0;var Tt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,at))+Math.imul(U,ot)|0,o=Math.imul(U,at),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ct)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var It=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ct))+Math.imul(U,ut)|0,o=Math.imul(U,ct),n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ht)|0;var Rt=(c+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(D,lt),i=(i=Math.imul(D,ht))+Math.imul(U,lt)|0,o=Math.imul(U,ht);var Ct=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Nt=(c+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return c=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=vt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Mt,u[8]=kt,u[9]=xt,u[10]=Et,u[11]=At,u[12]=Ot,u[13]=Tt,u[14]=Pt,u[15]=It,u[16]=Rt,u[17]=Ct,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var h=0,d=1;0===(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0===(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,h=1;0===(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(b,y),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return v[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},93936:function(t,e,r){var n=r(37510),i=r(77135),o=r(61214),a=r(865),s=r(81330),u=r(83569),c=r(4383),f=r(82543).Buffer;t.exports=function(t,e,r){var l;l=t.padding?t.padding:r?1:4;var h,d=n(t),p=d.modulus.byteLength();if(e.length>p||new a(e).cmp(d.modulus)>=0)throw new Error("decryption error");h=r?c(new a(e),d):s(e,d);var m=f.alloc(p-h.length);if(h=f.concat([m,h],p),4===l)return function(t,e){var r=t.modulus.byteLength(),n=u("sha1").update(f.alloc(0)).digest(),a=n.length;if(0!==e[0])throw new Error("decryption error");var s=e.slice(1,a+1),c=e.slice(a+1),l=o(s,i(c,a)),h=o(c,i(l,r-a-1));if(function(t,e){t=f.from(t),e=f.from(e);var r=0,n=t.length;t.length!==e.length&&(r++,n=Math.min(t.length,e.length));var i=-1;for(;++i=e.length){o++;break}var a=e.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(i)}(0,h,r);if(3===l)return h;throw new Error("unknown padding")}},92190:function(t,e,r){var n=r(37510),i=r(12525),o=r(83569),a=r(77135),s=r(61214),u=r(865),c=r(4383),f=r(81330),l=r(82543).Buffer;t.exports=function(t,e,r){var h;h=t.padding?t.padding:r?1:4;var d,p=n(t);if(4===h)d=function(t,e){var r=t.modulus.byteLength(),n=e.length,c=o("sha1").update(l.alloc(0)).digest(),f=c.length,h=2*f;if(n>r-h-2)throw new Error("message too long");var d=l.alloc(r-n-h-2),p=r-f-1,m=i(f),g=s(l.concat([c,d,l.alloc(1,1),e],p),a(m,p)),v=s(m,a(g,f));return new u(l.concat([l.alloc(1),v,g],r))}(p,e);else if(1===h)d=function(t,e,r){var n,o=e.length,a=t.modulus.byteLength();if(o>a-11)throw new Error("message too long");n=r?l.alloc(a-o-3,255):function(t){var e,r=l.allocUnsafe(t),n=0,o=i(2*t),a=0;for(;n=0)throw new Error("data too long for modulus")}return r?f(d,p):c(d,p)}},4383:function(t,e,r){var n=r(865),i=r(82543).Buffer;t.exports=function(t,e){return i.from(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}},61214:function(t){t.exports=function(t,e){for(var r=t.length,n=-1;++n-1?t.split(","):t},c=function(t,e,r,n){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(o),c=s?o.slice(0,s.index):o,f=[];if(c){if(!r.plainObjects&&i.call(Object.prototype,c)&&!r.allowPrototypes)return;f.push(c)}for(var l=0;r.depth>0&&null!==(s=a.exec(o))&&l=0;--o){var a,s=t[o];if("[]"===s&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,f=parseInt(c,10);r.parseArrays||""!==c?!isNaN(f)&&s!==c&&String(f)===c&&f>=0&&r.parseArrays&&f<=r.arrayLimit?(a=[])[f]=i:"__proto__"!==c&&(a[c]=i):a={0:i}}i=a}return i}(f,e,r,n)}};t.exports=function(t,e){var r=function(t){if(!t)return a;if(null!==t.decoder&&void 0!==t.decoder&&"function"!==typeof t.decoder)throw new TypeError("Decoder has to be a function.");if("undefined"!==typeof t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e="undefined"===typeof t.charset?a.charset:t.charset;return{allowDots:"undefined"===typeof t.allowDots?a.allowDots:!!t.allowDots,allowPrototypes:"boolean"===typeof t.allowPrototypes?t.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"===typeof t.allowSparse?t.allowSparse:a.allowSparse,arrayLimit:"number"===typeof t.arrayLimit?t.arrayLimit:a.arrayLimit,charset:e,charsetSentinel:"boolean"===typeof t.charsetSentinel?t.charsetSentinel:a.charsetSentinel,comma:"boolean"===typeof t.comma?t.comma:a.comma,decoder:"function"===typeof t.decoder?t.decoder:a.decoder,delimiter:"string"===typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:a.delimiter,depth:"number"===typeof t.depth||!1===t.depth?+t.depth:a.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"===typeof t.interpretNumericEntities?t.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"===typeof t.parameterLimit?t.parameterLimit:a.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"===typeof t.plainObjects?t.plainObjects:a.plainObjects,strictNullHandling:"boolean"===typeof t.strictNullHandling?t.strictNullHandling:a.strictNullHandling}}(e);if(""===t||null===t||"undefined"===typeof t)return r.plainObjects?Object.create(null):{};for(var f="string"===typeof t?function(t,e){var r,c={__proto__:null},f=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,l=e.parameterLimit===1/0?void 0:e.parameterLimit,h=f.split(e.delimiter,l),d=-1,p=e.charset;if(e.charsetSentinel)for(r=0;r-1&&(g=o(g)?[g]:g),i.call(c,m)?c[m]=n.combine(c[m],g):c[m]=g}return c}(t,r):t,l=r.plainObjects?Object.create(null):{},h=Object.keys(f),d=0;d0?k.join(",")||null:void 0}];else if(u(h))T=h;else{var I=Object.keys(k);T=m?I.sort(m):I}for(var R=a&&u(k)&&1===k.length?r+"[]":r,C=0;C0?_+w:""}},64184:function(t,e,r){"use strict";var n=r(59874),i=Object.prototype.hasOwnProperty,o=Array.isArray,a=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),s=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n1;){var e=t.pop(),r=e.obj[e.prop];if(o(r)){for(var n=[],i=0;i=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||o===n.RFC1738&&(40===f||41===f)?u+=s.charAt(c):f<128?u+=a[f]:f<2048?u+=a[192|f>>6]+a[128|63&f]:f<55296||f>=57344?u+=a[224|f>>12]+a[128|f>>6&63]+a[128|63&f]:(c+=1,f=65536+((1023&f)<<10|1023&s.charCodeAt(c)),u+=a[240|f>>18]+a[128|f>>12&63]+a[128|f>>6&63]+a[128|63&f])}return u},isBuffer:function(t){return!(!t||"object"!==typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(o(t)){for(var r=[],n=0;no)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(t);if(t>0)if(t>i)for(var u=0;uf||t<0)throw new TypeError("offset must be a uint32");if(t>u||t>e)throw new RangeError("offset out of range")}function h(t,e,r){if("number"!==typeof t||t!==t)throw new TypeError("size must be a number");if(t>f||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>u)throw new RangeError("buffer too small")}function d(t,e,r,i){if(n.browser){var o=t.buffer,s=new Uint8Array(o,e,r);return c.getRandomValues(s),i?void n.nextTick((function(){i(null,t)})):t}if(!i)return a(r).copy(t,e),t;a(r,(function(r,n){if(r)return i(r);n.copy(t,e),i(null,t)}))}c&&c.getRandomValues||!n.browser?(e.randomFill=function(t,e,n,i){if(!s.isBuffer(t)&&!(t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"===typeof e)i=e,e=0,n=t.length;else if("function"===typeof n)i=n,n=t.length-e;else if("function"!==typeof i)throw new TypeError('"cb" argument must be a function');return l(e,t.length),h(n,e,t.length),d(t,e,n,i)},e.randomFillSync=function(t,e,n){"undefined"===typeof e&&(e=0);if(!s.isBuffer(t)&&!(t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(e,t.length),void 0===n&&(n=t.length-e);return h(n,e,t.length),d(t,e,n)}):(e.randomFill=i,e.randomFillSync=i)},34463:function(t,e,r){"use strict";var n=r(72791),i=r(45296);function o(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r