@dhavalvyas/basic-slider
Version:
Basic Slider - Simple Slider with Simple API
1 lines • 323 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BasicSlider=t():e.BasicSlider=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t=window.webpackHotUpdateBasicSlider;window.webpackHotUpdateBasicSlider=function(e,r){!function(e,t){if(!_[e]||!v[e])return;for(var r in v[e]=!1,t)Object.prototype.hasOwnProperty.call(t,r)&&(p[r]=t[r]);0==--y&&0===g&&E()}(e,r),t&&t(e,r)};var r,i=!0,n="65702c1fdd9187a94e70",a=1e4,o={},s=[],f=[];function c(e){var t=A[e];if(!t)return x;var i=function(i){return t.hot.active?(A[i]?A[i].parents.indexOf(e)<0&&A[i].parents.push(e):(s=[e],r=i),t.children.indexOf(i)<0&&t.children.push(i)):(console.warn("[HMR] unexpected require("+i+") from disposed module "+e),s=[]),x(i)},n=function(e){return{configurable:!0,enumerable:!0,get:function(){return x[e]},set:function(t){x[e]=t}}};for(var a in x)Object.prototype.hasOwnProperty.call(x,a)&&"e"!==a&&Object.defineProperty(i,a,n(a));return i.e=function(e){return"ready"===d&&u("prepare"),g++,x.e(e).then(t,function(e){throw t(),e});function t(){g--,"prepare"===d&&(m[e]||M(e),0===g&&0===y&&E())}},i}var h=[],d="idle";function u(e){d=e;for(var t=0;t<h.length;t++)h[t].call(null,e)}var l,p,b,y=0,g=0,m={},v={},_={};function w(e){return+e+""===e?+e:e}function S(e){if("idle"!==d)throw new Error("check() is only allowed in idle status");return i=e,u("check"),function(e){return e=e||1e4,new Promise(function(t,r){if("undefined"==typeof XMLHttpRequest)return r(new Error("No browser support"));try{var i=new XMLHttpRequest,a=x.p+""+n+".hot-update.json";i.open("GET",a,!0),i.timeout=e,i.send(null)}catch(e){return r(e)}i.onreadystatechange=function(){if(4===i.readyState)if(0===i.status)r(new Error("Manifest request to "+a+" timed out."));else if(404===i.status)t();else if(200!==i.status&&304!==i.status)r(new Error("Manifest request to "+a+" failed."));else{try{var e=JSON.parse(i.responseText)}catch(e){return void r(e)}t(e)}}})}(a).then(function(e){if(!e)return u("idle"),null;v={},m={},_=e.c,b=e.h,u("prepare");var t=new Promise(function(e,t){l={resolve:e,reject:t}});p={};return M(0),"prepare"===d&&0===g&&0===y&&E(),t})}function M(e){_[e]?(v[e]=!0,y++,function(e){var t=document.getElementsByTagName("head")[0],r=document.createElement("script");r.type="text/javascript",r.charset="utf-8",r.src=x.p+""+e+"."+n+".hot-update.js",t.appendChild(r)}(e)):m[e]=!0}function E(){u("ready");var e=l;if(l=null,e)if(i)Promise.resolve().then(function(){return k(i)}).then(function(t){e.resolve(t)},function(t){e.reject(t)});else{var t=[];for(var r in p)Object.prototype.hasOwnProperty.call(p,r)&&t.push(w(r));e.resolve(t)}}function k(t){if("ready"!==d)throw new Error("apply() is only allowed in ready status");var r,i,a,f,c;function h(e){for(var t=[e],r={},i=t.slice().map(function(e){return{chain:[e],id:e}});i.length>0;){var n=i.pop(),a=n.id,o=n.chain;if((f=A[a])&&!f.hot._selfAccepted){if(f.hot._selfDeclined)return{type:"self-declined",chain:o,moduleId:a};if(f.hot._main)return{type:"unaccepted",chain:o,moduleId:a};for(var s=0;s<f.parents.length;s++){var c=f.parents[s],h=A[c];if(h){if(h.hot._declinedDependencies[a])return{type:"declined",chain:o.concat([c]),moduleId:a,parentId:c};t.indexOf(c)>=0||(h.hot._acceptedDependencies[a]?(r[c]||(r[c]=[]),l(r[c],[a])):(delete r[c],t.push(c),i.push({chain:o.concat([c]),id:c})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:r}}function l(e,t){for(var r=0;r<t.length;r++){var i=t[r];e.indexOf(i)<0&&e.push(i)}}t=t||{};var y={},g=[],m={},v=function(){console.warn("[HMR] unexpected require("+M.moduleId+") to disposed module")};for(var S in p)if(Object.prototype.hasOwnProperty.call(p,S)){var M;c=w(S);var E=!1,k=!1,I=!1,B="";switch((M=p[S]?h(c):{type:"disposed",moduleId:S}).chain&&(B="\nUpdate propagation: "+M.chain.join(" -> ")),M.type){case"self-declined":t.onDeclined&&t.onDeclined(M),t.ignoreDeclined||(E=new Error("Aborted because of self decline: "+M.moduleId+B));break;case"declined":t.onDeclined&&t.onDeclined(M),t.ignoreDeclined||(E=new Error("Aborted because of declined dependency: "+M.moduleId+" in "+M.parentId+B));break;case"unaccepted":t.onUnaccepted&&t.onUnaccepted(M),t.ignoreUnaccepted||(E=new Error("Aborted because "+c+" is not accepted"+B));break;case"accepted":t.onAccepted&&t.onAccepted(M),k=!0;break;case"disposed":t.onDisposed&&t.onDisposed(M),I=!0;break;default:throw new Error("Unexception type "+M.type)}if(E)return u("abort"),Promise.reject(E);if(k)for(c in m[c]=p[c],l(g,M.outdatedModules),M.outdatedDependencies)Object.prototype.hasOwnProperty.call(M.outdatedDependencies,c)&&(y[c]||(y[c]=[]),l(y[c],M.outdatedDependencies[c]));I&&(l(g,[M.moduleId]),m[c]=v)}var R,j=[];for(i=0;i<g.length;i++)c=g[i],A[c]&&A[c].hot._selfAccepted&&j.push({module:c,errorHandler:A[c].hot._selfAccepted});u("dispose"),Object.keys(_).forEach(function(e){!1===_[e]&&function(e){delete installedChunks[e]}(e)});for(var P,T,C=g.slice();C.length>0;)if(c=C.pop(),f=A[c]){var O={},D=f.hot._disposeHandlers;for(a=0;a<D.length;a++)(r=D[a])(O);for(o[c]=O,f.hot.active=!1,delete A[c],delete y[c],a=0;a<f.children.length;a++){var L=A[f.children[a]];L&&((R=L.parents.indexOf(c))>=0&&L.parents.splice(R,1))}}for(c in y)if(Object.prototype.hasOwnProperty.call(y,c)&&(f=A[c]))for(T=y[c],a=0;a<T.length;a++)P=T[a],(R=f.children.indexOf(P))>=0&&f.children.splice(R,1);for(c in u("apply"),n=b,m)Object.prototype.hasOwnProperty.call(m,c)&&(e[c]=m[c]);var U=null;for(c in y)if(Object.prototype.hasOwnProperty.call(y,c)&&(f=A[c])){T=y[c];var q=[];for(i=0;i<T.length;i++)if(P=T[i],r=f.hot._acceptedDependencies[P]){if(q.indexOf(r)>=0)continue;q.push(r)}for(i=0;i<q.length;i++){r=q[i];try{r(T)}catch(e){t.onErrored&&t.onErrored({type:"accept-errored",moduleId:c,dependencyId:T[i],error:e}),t.ignoreErrored||U||(U=e)}}}for(i=0;i<j.length;i++){var N=j[i];c=N.module,s=[c];try{x(c)}catch(e){if("function"==typeof N.errorHandler)try{N.errorHandler(e)}catch(r){t.onErrored&&t.onErrored({type:"self-accept-error-handler-errored",moduleId:c,error:r,orginalError:e,originalError:e}),t.ignoreErrored||U||(U=r),U||(U=e)}else t.onErrored&&t.onErrored({type:"self-accept-errored",moduleId:c,error:e}),t.ignoreErrored||U||(U=e)}}return U?(u("fail"),Promise.reject(U)):(u("idle"),new Promise(function(e){e(g)}))}var A={};function x(t){if(A[t])return A[t].exports;var i=A[t]={i:t,l:!1,exports:{},hot:function(e){var t={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_disposeHandlers:[],_main:r!==e,active:!0,accept:function(e,r){if(void 0===e)t._selfAccepted=!0;else if("function"==typeof e)t._selfAccepted=e;else if("object"==typeof e)for(var i=0;i<e.length;i++)t._acceptedDependencies[e[i]]=r||function(){};else t._acceptedDependencies[e]=r||function(){}},decline:function(e){if(void 0===e)t._selfDeclined=!0;else if("object"==typeof e)for(var r=0;r<e.length;r++)t._declinedDependencies[e[r]]=!0;else t._declinedDependencies[e]=!0},dispose:function(e){t._disposeHandlers.push(e)},addDisposeHandler:function(e){t._disposeHandlers.push(e)},removeDisposeHandler:function(e){var r=t._disposeHandlers.indexOf(e);r>=0&&t._disposeHandlers.splice(r,1)},check:S,apply:k,status:function(e){if(!e)return d;h.push(e)},addStatusHandler:function(e){h.push(e)},removeStatusHandler:function(e){var t=h.indexOf(e);t>=0&&h.splice(t,1)},data:o[e]};return r=void 0,t}(t),parents:(f=s,s=[],f),children:[]};return e[t].call(i.exports,i,i.exports,c(t)),i.l=!0,i.exports}return x.m=e,x.c=A,x.d=function(e,t,r){x.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},x.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return x.d(t,"a",t),t},x.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},x.p="./",x.h=function(){return n},c(71)(x.s=71)}([function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){var i=r(3),n=i.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=i:(a(i,t),t.Buffer=o),a(n,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},function(e,t,r){(function(e){!function(e,t){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o=r(121).Buffer}catch(e){}function s(e,t,r){for(var i=0,n=Math.min(e.length,r),a=t;a<n;a++){var o=e.charCodeAt(a)-48;i<<=4,i|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return i}function f(e,t,r,i){for(var n=0,a=Math.min(e.length,r),o=t;o<a;o++){var s=e.charCodeAt(o)-48;n*=i,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&n++,16===t?this._parseHex(e,n):this._parseBase(e,t,n),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var a,o,s=0;if("be"===r)for(n=e.length-1,a=0;n>=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(n=0,a=0;n<e.length;n+=3)o=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,a=0;for(r=e.length-6,i=0;r>=t;r-=6)n=s(e,r,r+6),this.words[i]|=n<<a&67108863,this.words[i+1]|=n>>>26-a&4194303,(a+=24)>=26&&(a-=26,i++);r+6!==t&&(n=s(e,t,r+6),this.words[i]|=n<<a&67108863,this.words[i+1]|=n>>>26-a&4194303),this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,c=0,h=r;h<s;h+=i)c=f(e,h,h+i,t),this.imuln(n),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var d=1;for(c=f(e,h,e.length,t),h=0;h<o;h++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function u(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=67108863&o,f=o/67108864|0;r.words[0]=s;for(var c=1;c<i;c++){for(var h=f>>>26,d=67108863&f,u=Math.min(c,t.length-1),l=Math.max(0,c-e.length+1);l<=u;l++){var p=c-l|0;h+=(o=(n=0|e.words[p])*(a=0|t.words[l])+d)/67108864|0,d=67108863&o}r.words[c]=0|d,f=0|h}return 0!==f?r.words[c]=0|f:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,a=0,o=0;o<this.length;o++){var s=this.words[o],f=(16777215&(s<<n|a)).toString(16);r=0!==(a=s>>>24-n&16777215)||o!==this.length-1?c[6-f.length]+f+r:f+r,(n+=2)>=26&&(n-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],l=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:c[u-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return i(void 0!==o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),a=r||Math.max(1,n);i(n<=a,"byte array longer than desired length"),i(a>0,"Requested array length <= 0"),this.strip();var o,s,f="le"===t,c=new e(a),h=this.clone();if(f){for(s=0;!h.isZero();s++)o=h.andln(255),h.iushrn(8),c[s]=o;for(;s<a;s++)c[s]=0}else{for(s=0;s<a-n;s++)c[s]=0;for(s=0;!h.isZero();s++)o=h.andln(255),h.iushrn(8),c[a-s-1]=o}return c},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return i(0==(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return i(0==(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},a.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,a=0;a<i.length;a++)t=(0|r.words[a])+(0|i.words[a])+n,this.words[a]=67108863&t,n=t>>>26;for(;0!==n&&a<r.length;a++)t=(0|r.words[a])+n,this.words[a]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var a=0,o=0;o<i.length;o++)a=(t=(0|r.words[o])-(0|i.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<r.length;o++)a=(t=(0|r.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var l=function(e,t,r){var i,n,a,o=e.words,s=t.words,f=r.words,c=0,h=0|o[0],d=8191&h,u=h>>>13,l=0|o[1],p=8191&l,b=l>>>13,y=0|o[2],g=8191&y,m=y>>>13,v=0|o[3],_=8191&v,w=v>>>13,S=0|o[4],M=8191&S,E=S>>>13,k=0|o[5],A=8191&k,x=k>>>13,I=0|o[6],B=8191&I,R=I>>>13,j=0|o[7],P=8191&j,T=j>>>13,C=0|o[8],O=8191&C,D=C>>>13,L=0|o[9],U=8191&L,q=L>>>13,N=0|s[0],z=8191&N,H=N>>>13,K=0|s[1],F=8191&K,W=K>>>13,X=0|s[2],Y=8191&X,V=X>>>13,G=0|s[3],J=8191&G,Z=G>>>13,$=0|s[4],Q=8191&$,ee=$>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],ae=8191&ne,oe=ne>>>13,se=0|s[7],fe=8191&se,ce=se>>>13,he=0|s[8],de=8191&he,ue=he>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(c+(i=Math.imul(d,z))|0)+((8191&(n=(n=Math.imul(d,H))+Math.imul(u,z)|0))<<13)|0;c=((a=Math.imul(u,H))+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(p,z),n=(n=Math.imul(p,H))+Math.imul(b,z)|0,a=Math.imul(b,H);var ge=(c+(i=i+Math.imul(d,F)|0)|0)+((8191&(n=(n=n+Math.imul(d,W)|0)+Math.imul(u,F)|0))<<13)|0;c=((a=a+Math.imul(u,W)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(g,z),n=(n=Math.imul(g,H))+Math.imul(m,z)|0,a=Math.imul(m,H),i=i+Math.imul(p,F)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(b,F)|0,a=a+Math.imul(b,W)|0;var me=(c+(i=i+Math.imul(d,Y)|0)|0)+((8191&(n=(n=n+Math.imul(d,V)|0)+Math.imul(u,Y)|0))<<13)|0;c=((a=a+Math.imul(u,V)|0)+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(_,z),n=(n=Math.imul(_,H))+Math.imul(w,z)|0,a=Math.imul(w,H),i=i+Math.imul(g,F)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(m,F)|0,a=a+Math.imul(m,W)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(b,Y)|0,a=a+Math.imul(b,V)|0;var ve=(c+(i=i+Math.imul(d,J)|0)|0)+((8191&(n=(n=n+Math.imul(d,Z)|0)+Math.imul(u,J)|0))<<13)|0;c=((a=a+Math.imul(u,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(M,z),n=(n=Math.imul(M,H))+Math.imul(E,z)|0,a=Math.imul(E,H),i=i+Math.imul(_,F)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(w,F)|0,a=a+Math.imul(w,W)|0,i=i+Math.imul(g,Y)|0,n=(n=n+Math.imul(g,V)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,V)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(b,J)|0,a=a+Math.imul(b,Z)|0;var _e=(c+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,ee)|0)+Math.imul(u,Q)|0))<<13)|0;c=((a=a+Math.imul(u,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(A,z),n=(n=Math.imul(A,H))+Math.imul(x,z)|0,a=Math.imul(x,H),i=i+Math.imul(M,F)|0,n=(n=n+Math.imul(M,W)|0)+Math.imul(E,F)|0,a=a+Math.imul(E,W)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,Y)|0,a=a+Math.imul(w,V)|0,i=i+Math.imul(g,J)|0,n=(n=n+Math.imul(g,Z)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,Z)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,a=a+Math.imul(b,ee)|0;var we=(c+(i=i+Math.imul(d,re)|0)|0)+((8191&(n=(n=n+Math.imul(d,ie)|0)+Math.imul(u,re)|0))<<13)|0;c=((a=a+Math.imul(u,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(B,z),n=(n=Math.imul(B,H))+Math.imul(R,z)|0,a=Math.imul(R,H),i=i+Math.imul(A,F)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(x,F)|0,a=a+Math.imul(x,W)|0,i=i+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(E,Y)|0,a=a+Math.imul(E,V)|0,i=i+Math.imul(_,J)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,J)|0,a=a+Math.imul(w,Z)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(b,re)|0,a=a+Math.imul(b,ie)|0;var Se=(c+(i=i+Math.imul(d,ae)|0)|0)+((8191&(n=(n=n+Math.imul(d,oe)|0)+Math.imul(u,ae)|0))<<13)|0;c=((a=a+Math.imul(u,oe)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(P,z),n=(n=Math.imul(P,H))+Math.imul(T,z)|0,a=Math.imul(T,H),i=i+Math.imul(B,F)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(R,F)|0,a=a+Math.imul(R,W)|0,i=i+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(x,Y)|0,a=a+Math.imul(x,V)|0,i=i+Math.imul(M,J)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Z)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,ee)|0,i=i+Math.imul(g,re)|0,n=(n=n+Math.imul(g,ie)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ie)|0,i=i+Math.imul(p,ae)|0,n=(n=n+Math.imul(p,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0;var Me=(c+(i=i+Math.imul(d,fe)|0)|0)+((8191&(n=(n=n+Math.imul(d,ce)|0)+Math.imul(u,fe)|0))<<13)|0;c=((a=a+Math.imul(u,ce)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,z),n=(n=Math.imul(O,H))+Math.imul(D,z)|0,a=Math.imul(D,H),i=i+Math.imul(P,F)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(T,F)|0,a=a+Math.imul(T,W)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(R,Y)|0,a=a+Math.imul(R,V)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,Z)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,ee)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ie)|0,i=i+Math.imul(g,ae)|0,n=(n=n+Math.imul(g,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0,i=i+Math.imul(p,fe)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(b,fe)|0,a=a+Math.imul(b,ce)|0;var Ee=(c+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,ue)|0)+Math.imul(u,de)|0))<<13)|0;c=((a=a+Math.imul(u,ue)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(U,z),n=(n=Math.imul(U,H))+Math.imul(q,z)|0,a=Math.imul(q,H),i=i+Math.imul(O,F)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(D,F)|0,a=a+Math.imul(D,W)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(T,Y)|0,a=a+Math.imul(T,V)|0,i=i+Math.imul(B,J)|0,n=(n=n+Math.imul(B,Z)|0)+Math.imul(R,J)|0,a=a+Math.imul(R,Z)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(x,Q)|0,a=a+Math.imul(x,ee)|0,i=i+Math.imul(M,re)|0,n=(n=n+Math.imul(M,ie)|0)+Math.imul(E,re)|0,a=a+Math.imul(E,ie)|0,i=i+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,i=i+Math.imul(g,fe)|0,n=(n=n+Math.imul(g,ce)|0)+Math.imul(m,fe)|0,a=a+Math.imul(m,ce)|0,i=i+Math.imul(p,de)|0,n=(n=n+Math.imul(p,ue)|0)+Math.imul(b,de)|0,a=a+Math.imul(b,ue)|0;var ke=(c+(i=i+Math.imul(d,pe)|0)|0)+((8191&(n=(n=n+Math.imul(d,be)|0)+Math.imul(u,pe)|0))<<13)|0;c=((a=a+Math.imul(u,be)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(U,F),n=(n=Math.imul(U,W))+Math.imul(q,F)|0,a=Math.imul(q,W),i=i+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(D,Y)|0,a=a+Math.imul(D,V)|0,i=i+Math.imul(P,J)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(T,J)|0,a=a+Math.imul(T,Z)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(x,re)|0,a=a+Math.imul(x,ie)|0,i=i+Math.imul(M,ae)|0,n=(n=n+Math.imul(M,oe)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,i=i+Math.imul(_,fe)|0,n=(n=n+Math.imul(_,ce)|0)+Math.imul(w,fe)|0,a=a+Math.imul(w,ce)|0,i=i+Math.imul(g,de)|0,n=(n=n+Math.imul(g,ue)|0)+Math.imul(m,de)|0,a=a+Math.imul(m,ue)|0;var Ae=(c+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;c=((a=a+Math.imul(b,be)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(U,Y),n=(n=Math.imul(U,V))+Math.imul(q,Y)|0,a=Math.imul(q,V),i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,Z)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(T,Q)|0,a=a+Math.imul(T,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(R,re)|0,a=a+Math.imul(R,ie)|0,i=i+Math.imul(A,ae)|0,n=(n=n+Math.imul(A,oe)|0)+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,i=i+Math.imul(M,fe)|0,n=(n=n+Math.imul(M,ce)|0)+Math.imul(E,fe)|0,a=a+Math.imul(E,ce)|0,i=i+Math.imul(_,de)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,de)|0,a=a+Math.imul(w,ue)|0;var xe=(c+(i=i+Math.imul(g,pe)|0)|0)+((8191&(n=(n=n+Math.imul(g,be)|0)+Math.imul(m,pe)|0))<<13)|0;c=((a=a+Math.imul(m,be)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(U,J),n=(n=Math.imul(U,Z))+Math.imul(q,J)|0,a=Math.imul(q,Z),i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(T,re)|0,a=a+Math.imul(T,ie)|0,i=i+Math.imul(B,ae)|0,n=(n=n+Math.imul(B,oe)|0)+Math.imul(R,ae)|0,a=a+Math.imul(R,oe)|0,i=i+Math.imul(A,fe)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(x,fe)|0,a=a+Math.imul(x,ce)|0,i=i+Math.imul(M,de)|0,n=(n=n+Math.imul(M,ue)|0)+Math.imul(E,de)|0,a=a+Math.imul(E,ue)|0;var Ie=(c+(i=i+Math.imul(_,pe)|0)|0)+((8191&(n=(n=n+Math.imul(_,be)|0)+Math.imul(w,pe)|0))<<13)|0;c=((a=a+Math.imul(w,be)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(U,Q),n=(n=Math.imul(U,ee))+Math.imul(q,Q)|0,a=Math.imul(q,ee),i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(D,re)|0,a=a+Math.imul(D,ie)|0,i=i+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,oe)|0)+Math.imul(T,ae)|0,a=a+Math.imul(T,oe)|0,i=i+Math.imul(B,fe)|0,n=(n=n+Math.imul(B,ce)|0)+Math.imul(R,fe)|0,a=a+Math.imul(R,ce)|0,i=i+Math.imul(A,de)|0,n=(n=n+Math.imul(A,ue)|0)+Math.imul(x,de)|0,a=a+Math.imul(x,ue)|0;var Be=(c+(i=i+Math.imul(M,pe)|0)|0)+((8191&(n=(n=n+Math.imul(M,be)|0)+Math.imul(E,pe)|0))<<13)|0;c=((a=a+Math.imul(E,be)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(U,re),n=(n=Math.imul(U,ie))+Math.imul(q,re)|0,a=Math.imul(q,ie),i=i+Math.imul(O,ae)|0,n=(n=n+Math.imul(O,oe)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,oe)|0,i=i+Math.imul(P,fe)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(T,fe)|0,a=a+Math.imul(T,ce)|0,i=i+Math.imul(B,de)|0,n=(n=n+Math.imul(B,ue)|0)+Math.imul(R,de)|0,a=a+Math.imul(R,ue)|0;var Re=(c+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,be)|0)+Math.imul(x,pe)|0))<<13)|0;c=((a=a+Math.imul(x,be)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(U,ae),n=(n=Math.imul(U,oe))+Math.imul(q,ae)|0,a=Math.imul(q,oe),i=i+Math.imul(O,fe)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(D,fe)|0,a=a+Math.imul(D,ce)|0,i=i+Math.imul(P,de)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(T,de)|0,a=a+Math.imul(T,ue)|0;var je=(c+(i=i+Math.imul(B,pe)|0)|0)+((8191&(n=(n=n+Math.imul(B,be)|0)+Math.imul(R,pe)|0))<<13)|0;c=((a=a+Math.imul(R,be)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(U,fe),n=(n=Math.imul(U,ce))+Math.imul(q,fe)|0,a=Math.imul(q,ce),i=i+Math.imul(O,de)|0,n=(n=n+Math.imul(O,ue)|0)+Math.imul(D,de)|0,a=a+Math.imul(D,ue)|0;var Pe=(c+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,be)|0)+Math.imul(T,pe)|0))<<13)|0;c=((a=a+Math.imul(T,be)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(U,de),n=(n=Math.imul(U,ue))+Math.imul(q,de)|0,a=Math.imul(q,ue);var Te=(c+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,be)|0)+Math.imul(D,pe)|0))<<13)|0;c=((a=a+Math.imul(D,be)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863;var Ce=(c+(i=Math.imul(U,pe))|0)+((8191&(n=(n=Math.imul(U,be))+Math.imul(q,pe)|0))<<13)|0;return c=((a=Math.imul(q,be))+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,f[0]=ye,f[1]=ge,f[2]=me,f[3]=ve,f[4]=_e,f[5]=we,f[6]=Se,f[7]=Me,f[8]=Ee,f[9]=ke,f[10]=Ae,f[11]=xe,f[12]=Ie,f[13]=Be,f[14]=Re,f[15]=je,f[16]=Pe,f[17]=Te,f[18]=Ce,0!==c&&(f[19]=c,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=u),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?u(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,a=0;a<r.length-1;a++){var o=n;n=0;for(var s=67108863&i,f=Math.min(a,t.length-1),c=Math.max(0,a-e.length+1);c<=f;c++){var h=a-c,d=(0|e.words[h])*(0|t.words[c]),u=67108863&d;s=67108863&(u=u+s|0),n+=(o=(o=o+(d/67108864|0)|0)+(u>>>26)|0)>>>26,o&=67108863}r.words[a]=s,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},b.prototype.permute=function(e,t,r,i,n,a){for(var o=0;o<a;o++)i[o]=t[e[o]],n[o]=r[e[o]]},b.prototype.transform=function(e,t,r,i,n,a){this.permute(a,e,t,r,i,n);for(var o=1;o<n;o<<=1)for(var s=o<<1,f=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),h=0;h<n;h+=s)for(var d=f,u=c,l=0;l<o;l++){var p=r[h+l],b=i[h+l],y=r[h+l+o],g=i[h+l+o],m=d*y-u*g;g=d*g+u*y,y=m,r[h+l]=p+y,i[h+l]=b+g,r[h+l+o]=p-y,i[h+l+o]=b-g,l!==s&&(m=f*d-c*u,u=f*u+c*d,d=m)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},b.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},b.prototype.convert13b=function(e,t,r,n){for(var a=0,o=0;o<t;o++)a+=0|e[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o<n;++o)r[o]=0;i(0===a),i(0==(-8192&a))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),a=this.stub(i),o=new Array(i),s=new Array(i),f=new Array(i),c=new Array(i),h=new Array(i),d=new Array(i),u=r.words;u.length=i,this.convert13b(e.words,e.length,o,i),this.convert13b(t.words,t.length,c,i),this.transform(o,a,s,f,i,n),this.transform(c,a,h,d,i,n);for(var l=0;l<i;l++){var p=s[l]*h[l]-f[l]*d[l];f[l]=s[l]*d[l]+f[l]*h[l],s[l]=p}return this.conjugate(s,f,i),this.transform(s,f,u,a,i,n),this.conjugate(u,a,i),this.normalize13b(u,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),p(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){i("number"==typeof e),i(e<67108864);for(var t=0,r=0;r<this.length;r++){var n=(0|this.words[r])*e,a=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new a(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},a.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,f=(0|this.words[t])-s<<r;this.words[t]=f|o,o=s>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},a.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var n;i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,f=r;if(n-=o,n=Math.max(0,n),f){for(var c=0;c<o;c++)f.words[c]=this.words[c];f.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=n);c--){var d=0|this.words[c];this.words[c]=h<<26-a|d>>>a,h=d&s}return f&&0!==h&&(f.words[f.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<<t;return!(this.length<=r)&&!!(this.words[r]&n)},a.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return i("number"==typeof e),i(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var n,a,o=e.length+r;this._expand(o);var s=0;for(n=0;n<e.length;n++){a=(0|this.words[n+r])+s;var f=(0|e.words[n])*t;s=((a-=67108863&f)>>26)-(f/67108864|0),this.words[n+r]=67108863&a}for(;n<this.length-r;n++)s=(a=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&a;if(0===s)return this.strip();for(i(-1===s),s=0,n=0;n<this.length;n++)s=(a=-(0|this.words[n])+s)>>26,this.words[n]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var s,f=i.length-n.length;if("mod"!==t){(s=new a(null)).length=f+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var h=i.clone()._ishlnsubmul(n,1,f);0===h.negative&&(i=h,s&&(s.words[f]=1));for(var d=f-1;d>=0;d--){var u=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(u=Math.min(u/o|0,67108863),i._ishlnsubmul(n,u,d);0!==i.negative;)u--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);s&&(s.words[d]=u)}return s&&s.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},a.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},a.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new a(1),o=new a(0),s=new a(0),f=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),d=t.clone();!t.isZero();){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(h),o.isub(d)),n.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(h),f.isub(d)),s.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(s),o.isub(f)):(r.isub(t),s.isub(n),f.isub(o))}return{a:s,b:f,gcd:r.iushln(c)}},a.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new a(1),s=new a(0),f=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0==(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(f),o.iushrn(1);for(var d=0,u=1;0==(r.words[0]&u)&&d<26;++d,u<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(n=0===t.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(e),n},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var a=t;t=r,r=a}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var a=n,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new S(e)},a.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(m,g),m.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var n=e.words[9];for(t.words[t.length++]=4194303&n,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(4194303&a)<<4|n>>>22,n=a}n>>>=22,e.words[i-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},m.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(v,g),n(_,g),n(w,g),w.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new v;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return y[e]=t,t},S.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var s=new a(1).toRed(this),f=s.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new a(2*h*h).toRed(this);0!==this.p