o2-client
Version:
Light Client for O2 Blockchain
1 lines • 144 kB
JavaScript
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).O2=t()}}(function(){return function o(a,s,u){function f(e,t){if(!s[e]){if(!a[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(h)return h(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var i=s[e]={exports:{}};a[e][0].call(i.exports,function(t){return f(a[e][1][t]||t)},i,i.exports,o,a,s,u)}return s[e].exports}for(var h="function"==typeof require&&require,t=0;t<u.length;t++)f(u[t]);return f}({1:[function(t,e,r){e.exports=t("./lib/axios")},{"./lib/axios":3}],2:[function(b,t,e){(function(c){"use strict";var p=b("./../utils"),y=b("./../core/settle"),d=b("./../helpers/buildURL"),v=b("./../helpers/parseHeaders"),g=b("./../helpers/isURLSameOrigin"),w=b("../core/createError"),m="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||b("./../helpers/btoa");t.exports=function(l){return new Promise(function(r,n){var i=l.data,o=l.headers;p.isFormData(i)&&delete o["Content-Type"];var a=new XMLHttpRequest,t="onreadystatechange",s=!1;if("test"===c.env.NODE_ENV||"undefined"==typeof window||!window.XDomainRequest||"withCredentials"in a||g(l.url)||(a=new window.XDomainRequest,t="onload",s=!0,a.onprogress=function(){},a.ontimeout=function(){}),l.auth){var e=l.auth.username||"",u=l.auth.password||"";o.Authorization="Basic "+m(e+":"+u)}if(a.open(l.method.toUpperCase(),d(l.url,l.params,l.paramsSerializer),!0),a.timeout=l.timeout,a[t]=function(){if(a&&(4===a.readyState||s)&&(0!==a.status||a.responseURL&&0===a.responseURL.indexOf("file:"))){var t="getAllResponseHeaders"in a?v(a.getAllResponseHeaders()):null,e={data:l.responseType&&"text"!==l.responseType?a.response:a.responseText,status:1223===a.status?204:a.status,statusText:1223===a.status?"No Content":a.statusText,headers:t,config:l,request:a};y(r,n,e),a=null}},a.onerror=function(){n(w("Network Error",l,null,a)),a=null},a.ontimeout=function(){n(w("timeout of "+l.timeout+"ms exceeded",l,"ECONNABORTED",a)),a=null},p.isStandardBrowserEnv()){var f=b("./../helpers/cookies"),h=(l.withCredentials||g(l.url))&&l.xsrfCookieName?f.read(l.xsrfCookieName):void 0;h&&(o[l.xsrfHeaderName]=h)}if("setRequestHeader"in a&&p.forEach(o,function(t,e){void 0===i&&"content-type"===e.toLowerCase()?delete o[e]:a.setRequestHeader(e,t)}),l.withCredentials&&(a.withCredentials=!0),l.responseType)try{a.responseType=l.responseType}catch(t){if("json"!==l.responseType)throw t}"function"==typeof l.onDownloadProgress&&a.addEventListener("progress",l.onDownloadProgress),"function"==typeof l.onUploadProgress&&a.upload&&a.upload.addEventListener("progress",l.onUploadProgress),l.cancelToken&&l.cancelToken.promise.then(function(t){a&&(a.abort(),n(t),a=null)}),void 0===i&&(i=null),a.send(i)})}}).call(this,b("_process"))},{"../core/createError":9,"./../core/settle":12,"./../helpers/btoa":16,"./../helpers/buildURL":17,"./../helpers/cookies":19,"./../helpers/isURLSameOrigin":21,"./../helpers/parseHeaders":23,"./../utils":25,_process:34}],3:[function(t,e,r){"use strict";var n=t("./utils"),i=t("./helpers/bind"),o=t("./core/Axios"),a=t("./defaults");function s(t){var e=new o(t),r=i(o.prototype.request,e);return n.extend(r,o.prototype,e),n.extend(r,e),r}var u=s(a);u.Axios=o,u.create=function(t){return s(n.merge(a,t))},u.Cancel=t("./cancel/Cancel"),u.CancelToken=t("./cancel/CancelToken"),u.isCancel=t("./cancel/isCancel"),u.all=function(t){return Promise.all(t)},u.spread=t("./helpers/spread"),e.exports=u,e.exports.default=u},{"./cancel/Cancel":4,"./cancel/CancelToken":5,"./cancel/isCancel":6,"./core/Axios":7,"./defaults":14,"./helpers/bind":15,"./helpers/spread":24,"./utils":25}],4:[function(t,e,r){"use strict";function n(t){this.message=t}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},{}],5:[function(t,e,r){"use strict";var n=t("./Cancel");function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var r=this;t(function(t){r.reason||(r.reason=new n(t),e(r.reason))})}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i(function(t){e=t}),cancel:e}},e.exports=i},{"./Cancel":4}],6:[function(t,e,r){"use strict";e.exports=function(t){return!(!t||!t.__CANCEL__)}},{}],7:[function(t,e,r){"use strict";var n=t("./../defaults"),i=t("./../utils"),o=t("./InterceptorManager"),a=t("./dispatchRequest");function s(t){this.defaults=t,this.interceptors={request:new o,response:new o}}s.prototype.request=function(t){"string"==typeof t&&(t=i.merge({url:arguments[0]},arguments[1])),(t=i.merge(n,{method:"get"},this.defaults,t)).method=t.method.toLowerCase();var e=[a,void 0],r=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)r=r.then(e.shift(),e.shift());return r},i.forEach(["delete","get","head","options"],function(r){s.prototype[r]=function(t,e){return this.request(i.merge(e||{},{method:r,url:t}))}}),i.forEach(["post","put","patch"],function(n){s.prototype[n]=function(t,e,r){return this.request(i.merge(r||{},{method:n,url:t,data:e}))}}),e.exports=s},{"./../defaults":14,"./../utils":25,"./InterceptorManager":8,"./dispatchRequest":10}],8:[function(t,e,r){"use strict";var n=t("./../utils");function i(){this.handlers=[]}i.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=i},{"./../utils":25}],9:[function(t,e,r){"use strict";var a=t("./enhanceError");e.exports=function(t,e,r,n,i){var o=new Error(t);return a(o,e,r,n,i)}},{"./enhanceError":11}],10:[function(t,e,r){"use strict";var n=t("./../utils"),i=t("./transformData"),o=t("../cancel/isCancel"),a=t("../defaults"),s=t("./../helpers/isAbsoluteURL"),u=t("./../helpers/combineURLs");function f(t){t.cancelToken&&t.cancelToken.throwIfRequested()}e.exports=function(e){return f(e),e.baseURL&&!s(e.url)&&(e.url=u(e.baseURL,e.url)),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),n.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||a.adapter)(e).then(function(t){return f(e),t.data=i(t.data,t.headers,e.transformResponse),t},function(t){return o(t)||(f(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},{"../cancel/isCancel":6,"../defaults":14,"./../helpers/combineURLs":18,"./../helpers/isAbsoluteURL":20,"./../utils":25,"./transformData":13}],11:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){return t.config=e,r&&(t.code=r),t.request=n,t.response=i,t}},{}],12:[function(t,e,r){"use strict";var i=t("./createError");e.exports=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(i("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)}},{"./createError":9}],13:[function(t,e,r){"use strict";var n=t("./../utils");e.exports=function(e,r,t){return n.forEach(t,function(t){e=t(e,r)}),e}},{"./../utils":25}],14:[function(s,u,t){(function(t){"use strict";var r=s("./utils"),n=s("./helpers/normalizeHeaderName"),e={"Content-Type":"application/x-www-form-urlencoded"};function i(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var o,a={adapter:("undefined"!=typeof XMLHttpRequest?o=s("./adapters/xhr"):void 0!==t&&(o=s("./adapters/http")),o),transformRequest:[function(t,e){return n(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(i(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(i(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return 200<=t&&t<300}};a.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(t){a.headers[t]={}}),r.forEach(["post","put","patch"],function(t){a.headers[t]=r.merge(e)}),u.exports=a}).call(this,s("_process"))},{"./adapters/http":2,"./adapters/xhr":2,"./helpers/normalizeHeaderName":22,"./utils":25,_process:34}],15:[function(t,e,r){"use strict";e.exports=function(r,n){return function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];return r.apply(n,t)}}},{}],16:[function(t,e,r){"use strict";function s(){this.message="String contains an invalid character"}(s.prototype=new Error).code=5,s.prototype.name="InvalidCharacterError",e.exports=function(t){for(var e,r,n=String(t),i="",o=0,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.charAt(0|o)||(a="=",o%1);i+=a.charAt(63&e>>8-o%1*8)){if(255<(r=n.charCodeAt(o+=.75)))throw new s;e=e<<8|r}return i}},{}],17:[function(t,e,r){"use strict";var o=t("./../utils");function a(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(t,e,r){if(!e)return t;var n;if(r)n=r(e);else if(o.isURLSearchParams(e))n=e.toString();else{var i=[];o.forEach(e,function(t,e){null!=t&&(o.isArray(t)?e+="[]":t=[t],o.forEach(t,function(t){o.isDate(t)?t=t.toISOString():o.isObject(t)&&(t=JSON.stringify(t)),i.push(a(e)+"="+a(t))}))}),n=i.join("&")}return n&&(t+=(-1===t.indexOf("?")?"?":"&")+n),t}},{"./../utils":25}],18:[function(t,e,r){"use strict";e.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},{}],19:[function(t,e,r){"use strict";var s=t("./../utils");e.exports=s.isStandardBrowserEnv()?{write:function(t,e,r,n,i,o){var a=[];a.push(t+"="+encodeURIComponent(e)),s.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),s.isString(n)&&a.push("path="+n),s.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},{"./../utils":25}],20:[function(t,e,r){"use strict";e.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},{}],21:[function(t,e,r){"use strict";var a=t("./../utils");e.exports=a.isStandardBrowserEnv()?function(){var r,n=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function o(t){var e=t;return n&&(i.setAttribute("href",e),e=i.href),i.setAttribute("href",e),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}return r=o(window.location.href),function(t){var e=a.isString(t)?o(t):t;return e.protocol===r.protocol&&e.host===r.host}}():function(){return!0}},{"./../utils":25}],22:[function(t,e,r){"use strict";var i=t("../utils");e.exports=function(r,n){i.forEach(r,function(t,e){e!==n&&e.toUpperCase()===n.toUpperCase()&&(r[n]=t,delete r[e])})}},{"../utils":25}],23:[function(t,e,r){"use strict";var o=t("./../utils"),a=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(t){var e,r,n,i={};return t&&o.forEach(t.split("\n"),function(t){if(n=t.indexOf(":"),e=o.trim(t.substr(0,n)).toLowerCase(),r=o.trim(t.substr(n+1)),e){if(i[e]&&0<=a.indexOf(e))return;i[e]="set-cookie"===e?(i[e]?i[e]:[]).concat([r]):i[e]?i[e]+", "+r:r}}),i}},{"./../utils":25}],24:[function(t,e,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},{}],25:[function(t,e,r){"use strict";var i=t("./helpers/bind"),n=t("is-buffer"),o=Object.prototype.toString;function a(t){return"[object Array]"===o.call(t)}function s(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===o.call(t)}function f(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),a(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}e.exports={isArray:a,isArrayBuffer:function(t){return"[object ArrayBuffer]"===o.call(t)},isBuffer:n,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===o.call(t)},isFile:function(t){return"[object File]"===o.call(t)},isBlob:function(t){return"[object Blob]"===o.call(t)},isFunction:u,isStream:function(t){return s(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:f,merge:function r(){var n={};function t(t,e){"object"==typeof n[e]&&"object"==typeof t?n[e]=r(n[e],t):n[e]=t}for(var e=0,i=arguments.length;e<i;e++)f(arguments[e],t);return n},extend:function(r,t,n){return f(t,function(t,e){r[e]=n&&"function"==typeof t?i(t,n):t}),r},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},{"./helpers/bind":15,"is-buffer":33}],26:[function(t,e,r){"use strict";r.byteLength=function(t){var e=p(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){for(var e,r=p(t),n=r[0],i=r[1],o=new c((f=n,h=i,3*(f+h)/4-h)),a=0,s=0<i?n-4:n,u=0;u<s;u+=4)e=l[t.charCodeAt(u)]<<18|l[t.charCodeAt(u+1)]<<12|l[t.charCodeAt(u+2)]<<6|l[t.charCodeAt(u+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=255&e;var f,h;2===i&&(e=l[t.charCodeAt(u)]<<2|l[t.charCodeAt(u+1)]>>4,o[a++]=255&e);1===i&&(e=l[t.charCodeAt(u)]<<10|l[t.charCodeAt(u+1)]<<4|l[t.charCodeAt(u+2)]>>2,o[a++]=e>>8&255,o[a++]=255&e);return o},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,i=[],o=0,a=r-n;o<a;o+=16383)i.push(u(t,o,a<o+16383?a:o+16383));1===n?(e=t[r-1],i.push(s[e>>2]+s[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],i.push(s[e>>10]+s[e>>4&63]+s[e<<2&63]+"="));return i.join("")};for(var s=[],l=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i<o;++i)s[i]=n[i],l[n.charCodeAt(i)]=i;function p(t){var e=t.length;if(0<e%4)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,r){for(var n,i,o=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(s[(i=n)>>18&63]+s[i>>12&63]+s[i>>6&63]+s[63&i]);return o.join("")}l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},{}],27:[function(t,e,r){var J=function(u){"use strict";var g=1e7,l=7,e=9007199254740992,r=w(e),c=Math.log(e);function p(t,e){return void 0===t?p[0]:void 0!==e?10==+e?W(t):F(t,e):W(t)}function y(t,e){this.value=t,this.sign=e,this.isSmall=!1}function d(t){this.value=t,this.sign=t<0,this.isSmall=!0}function v(t){return-e<t&&t<e}function w(t){return t<1e7?[t]:t<1e14?[t%1e7,Math.floor(t/1e7)]:[t%1e7,Math.floor(t/1e7)%1e7,Math.floor(t/1e14)]}function m(t){b(t);var e=t.length;if(e<4&&O(t,r)<0)switch(e){case 0:return 0;case 1:return t[0];case 2:return t[0]+t[1]*g;default:return t[0]+(t[1]+t[2]*g)*g}return t}function b(t){for(var e=t.length;0===t[--e];);t.length=e+1}function _(t){for(var e=new Array(t),r=-1;++r<t;)e[r]=0;return e}function E(t){return 0<t?Math.floor(t):Math.ceil(t)}function n(t,e){var r,n,i=t.length,o=e.length,a=new Array(i),s=0,u=g;for(n=0;n<o;n++)s=u<=(r=t[n]+e[n]+s)?1:0,a[n]=r-s*u;for(;n<i;)s=(r=t[n]+s)===u?1:0,a[n++]=r-s*u;return 0<s&&a.push(s),a}function A(t,e){return t.length>=e.length?n(t,e):n(e,t)}function i(t,e){var r,n,i=t.length,o=new Array(i),a=g;for(n=0;n<i;n++)r=t[n]-a+e,e=Math.floor(r/a),o[n]=r-e*a,e+=1;for(;0<e;)o[n++]=e%a,e=Math.floor(e/a);return o}function T(t,e){var r,n,i=t.length,o=e.length,a=new Array(i),s=0,u=g;for(r=0;r<o;r++)(n=t[r]-s-e[r])<0?(n+=u,s=1):s=0,a[r]=n;for(r=o;r<i;r++){if(!((n=t[r]-s)<0)){a[r++]=n;break}n+=u,a[r]=n}for(;r<i;r++)a[r]=t[r];return b(a),a}function f(t,e,r){var n,i,o=t.length,a=new Array(o),s=-e,u=g;for(n=0;n<o;n++)i=t[n]+s,s=Math.floor(i/u),i%=u,a[n]=i<0?i+u:i;return"number"==typeof(a=m(a))?(r&&(a=-a),new d(a)):new y(a,r)}function x(t,e){var r,n,i,o,a=t.length,s=e.length,u=_(a+s),f=g;for(i=0;i<a;++i){o=t[i];for(var h=0;h<s;++h)r=o*e[h]+u[i+h],n=Math.floor(r/f),u[i+h]=r-n*f,u[i+h+1]+=n}return b(u),u}function U(t,e){var r,n,i=t.length,o=new Array(i),a=g,s=0;for(n=0;n<i;n++)r=t[n]*e+s,s=Math.floor(r/a),o[n]=r-s*a;for(;0<s;)o[n++]=s%a,s=Math.floor(s/a);return o}function B(t,e){for(var r=[];0<e--;)r.push(0);return r.concat(t)}function o(t,e,r){return new y(t<g?U(e,t):x(e,w(t)),r)}function a(t){var e,r,n,i,o=t.length,a=_(o+o),s=g;for(n=0;n<o;n++){r=0-(i=t[n])*i;for(var u=n;u<o;u++)e=i*t[u]*2+a[n+u]+r,r=Math.floor(e/s),a[n+u]=e-r*s;a[n+o]=r}return b(a),a}function S(t,e){var r,n,i,o,a=t.length,s=_(a),u=g;for(i=0,r=a-1;0<=r;--r)i=(o=i*u+t[r])-(n=E(o/e))*e,s[r]=0|n;return[s,0|i]}function k(t,e){var r,n,i=W(e),o=t.value,a=i.value;if(0===a)throw new Error("Cannot divide by zero");if(t.isSmall)return i.isSmall?[new d(E(o/a)),new d(o%a)]:[p[0],t];if(i.isSmall){if(1===a)return[t,p[0]];if(-1==a)return[t.negate(),p[0]];var s=Math.abs(a);if(s<g){n=m((r=S(o,s))[0]);var u=r[1];return t.sign&&(u=-u),"number"==typeof n?(t.sign!==i.sign&&(n=-n),[new d(n),new d(u)]):[new y(n,t.sign!==i.sign),new d(u)]}a=w(s)}var f=O(o,a);if(-1===f)return[p[0],t];if(0===f)return[p[t.sign===i.sign?1:-1],p[0]];n=(r=o.length+a.length<=200?function(t,e){var r,n,i,o,a,s,u,f=t.length,h=e.length,l=g,c=_(e.length),p=e[h-1],y=Math.ceil(l/(2*p)),d=U(t,y),v=U(e,y);for(d.length<=f&&d.push(0),v.push(0),p=v[h-1],n=f-h;0<=n;n--){for(r=l-1,d[n+h]!==p&&(r=Math.floor((d[n+h]*l+d[n+h-1])/p)),o=i=0,s=v.length,a=0;a<s;a++)i+=r*v[a],u=Math.floor(i/l),o+=d[n+a]-(i-u*l),i=u,o<0?(d[n+a]=o+l,o=-1):(d[n+a]=o,o=0);for(;0!==o;){for(r-=1,a=i=0;a<s;a++)(i+=d[n+a]-l+v[a])<0?(d[n+a]=i+l,i=0):(d[n+a]=i,i=1);o+=i}c[n]=r}return d=S(d,y)[0],[m(c),m(d)]}(o,a):function(t,e){for(var r,n,i,o,a,s=t.length,u=e.length,f=[],h=[],l=g;s;)if(h.unshift(t[--s]),b(h),O(h,e)<0)f.push(0);else{i=h[(n=h.length)-1]*l+h[n-2],o=e[u-1]*l+e[u-2],u<n&&(i=(i+1)*l),r=Math.ceil(i/o);do{if(O(a=U(e,r),h)<=0)break;r--}while(r);f.push(r),h=T(h,a)}return f.reverse(),[m(f),m(h)]}(o,a))[0];var h=t.sign!==i.sign,l=r[1],c=t.sign;return"number"==typeof n?(h&&(n=-n),n=new d(n)):n=new y(n,h),"number"==typeof l?(c&&(l=-l),l=new d(l)):l=new y(l,c),[n,l]}function O(t,e){if(t.length!==e.length)return t.length>e.length?1:-1;for(var r=t.length-1;0<=r;r--)if(t[r]!==e[r])return t[r]>e[r]?1:-1;return 0}function h(t){var e=t.abs();return!e.isUnit()&&(!!(e.equals(2)||e.equals(3)||e.equals(5))||!(e.isEven()||e.isDivisibleBy(3)||e.isDivisibleBy(5))&&(!!e.lesser(49)||void 0))}function M(t,e){for(var r,n,i,o=t.prev(),a=o,s=0;a.isEven();)a=a.divide(2),s++;t:for(n=0;n<e.length;n++)if(!t.lesser(e[n])&&!(i=J(e[n]).modPow(a,t)).equals(p[1])&&!i.equals(o)){for(r=s-1;0!=r;r--){if((i=i.square().mod(t)).isUnit())return!1;if(i.equals(o))continue t}return!1}return!0}y.prototype=Object.create(p.prototype),d.prototype=Object.create(p.prototype),y.prototype.plus=y.prototype.add=function(t){var e=W(t);if(this.sign!==e.sign)return this.subtract(e.negate());var r=this.value,n=e.value;return e.isSmall?new y(i(r,Math.abs(n)),this.sign):new y(A(r,n),this.sign)},d.prototype.plus=d.prototype.add=function(t){var e=W(t),r=this.value;if(r<0!==e.sign)return this.subtract(e.negate());var n=e.value;if(e.isSmall){if(v(r+n))return new d(r+n);n=w(Math.abs(n))}return new y(i(n,Math.abs(r)),r<0)},y.prototype.minus=y.prototype.subtract=function(t){var e=W(t);if(this.sign!==e.sign)return this.add(e.negate());var r,n,i,o,a=this.value,s=e.value;return e.isSmall?f(a,Math.abs(s),this.sign):(r=a,n=s,i=this.sign,0<=O(r,n)?o=T(r,n):(o=T(n,r),i=!i),"number"==typeof(o=m(o))?(i&&(o=-o),new d(o)):new y(o,i))},d.prototype.minus=d.prototype.subtract=function(t){var e=W(t),r=this.value;if(r<0!==e.sign)return this.add(e.negate());var n=e.value;return e.isSmall?new d(r-n):f(n,Math.abs(r),0<=r)},y.prototype.negate=function(){return new y(this.value,!this.sign)},d.prototype.negate=function(){var t=this.sign,e=new d(-this.value);return e.sign=!t,e},y.prototype.abs=function(){return new y(this.value,!1)},d.prototype.abs=function(){return new d(Math.abs(this.value))},y.prototype.times=y.prototype.multiply=function(t){var e,r,n,i=W(t),o=this.value,a=i.value,s=this.sign!==i.sign;if(i.isSmall){if(0===a)return p[0];if(1===a)return this;if(-1===a)return this.negate();if((e=Math.abs(a))<g)return new y(U(o,e),s);a=w(e)}return r=o.length,n=a.length,new y(0<-.012*r-.012*n+15e-6*r*n?function t(e,r){var n=Math.max(e.length,r.length);if(n<=30)return x(e,r);n=Math.ceil(n/2);var i=e.slice(n),o=e.slice(0,n),a=r.slice(n),s=r.slice(0,n),u=t(o,s),f=t(i,a),h=A(A(u,B(T(T(t(A(o,i),A(s,a)),u),f),n)),B(f,2*n));return b(h),h}(o,a):x(o,a),s)},d.prototype._multiplyBySmall=function(t){return v(t.value*this.value)?new d(t.value*this.value):o(Math.abs(t.value),w(Math.abs(this.value)),this.sign!==t.sign)},y.prototype._multiplyBySmall=function(t){return 0===t.value?p[0]:1===t.value?this:-1===t.value?this.negate():o(Math.abs(t.value),this.value,this.sign!==t.sign)},d.prototype.times=d.prototype.multiply=function(t){return W(t)._multiplyBySmall(this)},y.prototype.square=function(){return new y(a(this.value),!1)},d.prototype.square=function(){var t=this.value*this.value;return v(t)?new d(t):new y(a(w(Math.abs(this.value))),!1)},d.prototype.divmod=y.prototype.divmod=function(t){var e=k(this,t);return{quotient:e[0],remainder:e[1]}},d.prototype.over=d.prototype.divide=y.prototype.over=y.prototype.divide=function(t){return k(this,t)[0]},d.prototype.remainder=d.prototype.mod=y.prototype.remainder=y.prototype.mod=function(t){return k(this,t)[1]},y.prototype.pow=function(t){var e,r,n,i=W(t),o=this.value,a=i.value;if(0===a)return p[1];if(0===o)return p[0];if(1===o)return p[1];if(-1===o)return i.isEven()?p[1]:p[-1];if(i.sign)return p[0];if(!i.isSmall)throw new Error("The exponent "+i.toString()+" is too large.");if(this.isSmall&&v(e=Math.pow(o,a)))return new d(E(e));for(r=this,n=p[1];!0&a&&(n=n.times(r),--a),0!==a;)a/=2,r=r.square();return n},d.prototype.pow=y.prototype.pow,d.prototype.modPow=y.prototype.modPow=function(t,e){if(t=W(t),(e=W(e)).isZero())throw new Error("Cannot take modPow with modulus 0");for(var r=p[1],n=this.mod(e);t.isPositive();){if(n.isZero())return p[0];t.isOdd()&&(r=r.multiply(n).mod(e)),t=t.divide(2),n=n.square().mod(e)}return r},y.prototype.compareAbs=function(t){var e=W(t),r=this.value,n=e.value;return e.isSmall?1:O(r,n)},d.prototype.compareAbs=function(t){var e=W(t),r=Math.abs(this.value),n=e.value;return e.isSmall?r===(n=Math.abs(n))?0:n<r?1:-1:-1},y.prototype.compareTo=y.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=W(t),r=this.value,n=e.value;return this.sign!==e.sign?e.sign?1:-1:e.isSmall?this.sign?-1:1:O(r,n)*(this.sign?-1:1)},d.prototype.compareTo=d.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=W(t),r=this.value,n=e.value;return e.isSmall?r==n?0:n<r?1:-1:r<0!==e.sign?r<0?-1:1:r<0?1:-1},d.prototype.eq=d.prototype.equals=y.prototype.eq=y.prototype.equals=function(t){return 0===this.compare(t)},d.prototype.neq=d.prototype.notEquals=y.prototype.neq=y.prototype.notEquals=function(t){return 0!==this.compare(t)},d.prototype.gt=d.prototype.greater=y.prototype.gt=y.prototype.greater=function(t){return 0<this.compare(t)},d.prototype.lt=d.prototype.lesser=y.prototype.lt=y.prototype.lesser=function(t){return this.compare(t)<0},d.prototype.geq=d.prototype.greaterOrEquals=y.prototype.geq=y.prototype.greaterOrEquals=function(t){return 0<=this.compare(t)},d.prototype.leq=d.prototype.lesserOrEquals=y.prototype.leq=y.prototype.lesserOrEquals=function(t){return this.compare(t)<=0},y.prototype.isEven=function(){return 0==(1&this.value[0])},d.prototype.isEven=function(){return 0==(1&this.value)},y.prototype.isOdd=function(){return 1==(1&this.value[0])},d.prototype.isOdd=function(){return 1==(1&this.value)},y.prototype.isPositive=function(){return!this.sign},d.prototype.isPositive=function(){return 0<this.value},y.prototype.isNegative=function(){return this.sign},d.prototype.isNegative=function(){return this.value<0},y.prototype.isUnit=function(){return!1},d.prototype.isUnit=function(){return 1===Math.abs(this.value)},y.prototype.isZero=function(){return!1},d.prototype.isZero=function(){return 0===this.value},d.prototype.isDivisibleBy=y.prototype.isDivisibleBy=function(t){var e=W(t),r=e.value;return 0!==r&&(1===r||(2===r?this.isEven():this.mod(e).equals(p[0])))},d.prototype.isPrime=y.prototype.isPrime=function(t){var e=h(this);if(e!==u)return e;var r=this.abs(),n=r.bitLength();if(n<=64)return M(r,[2,325,9375,28178,450775,9780504,1795265022]);for(var i=Math.log(2)*n,o=Math.ceil(!0===t?2*Math.pow(i,2):i),a=[],s=0;s<o;s++)a.push(J(s+2));return M(r,a)},d.prototype.isProbablePrime=y.prototype.isProbablePrime=function(t){var e=h(this);if(e!==u)return e;for(var r=this.abs(),n=t===u?5:t,i=[],o=0;o<n;o++)i.push(J.randBetween(2,r.minus(2)));return M(r,i)},d.prototype.modInv=y.prototype.modInv=function(t){for(var e,r,n,i=J.zero,o=J.one,a=W(t),s=this.abs();!s.equals(J.zero);)e=a.divide(s),r=i,n=a,i=o,a=s,o=r.subtract(e.multiply(o)),s=n.subtract(e.multiply(s));if(!a.equals(1))throw new Error(this.toString()+" and "+t.toString()+" are not co-prime");return-1===i.compare(0)&&(i=i.add(t)),this.isNegative()?i.negate():i},y.prototype.next=function(){var t=this.value;return this.sign?f(t,1,this.sign):new y(i(t,1),this.sign)},d.prototype.next=function(){var t=this.value;return t+1<e?new d(t+1):new y(r,!1)},y.prototype.prev=function(){var t=this.value;return this.sign?new y(i(t,1),!0):f(t,1,this.sign)},d.prototype.prev=function(){var t=this.value;return-e<t-1?new d(t-1):new y(r,!0)};for(var s=[1];2*s[s.length-1]<=g;)s.push(2*s[s.length-1]);var I=s.length,z=s[I-1];function P(t){return("number"==typeof t||"string"==typeof t)&&+Math.abs(t)<=g||t instanceof y&&t.value.length<=1}function j(t,e,r){e=W(e);for(var n=t.isNegative(),i=e.isNegative(),o=n?t.not():t,a=i?e.not():e,s=0,u=0,f=null,h=null,l=[];!o.isZero()||!a.isZero();)s=(f=k(o,z))[1].toJSNumber(),n&&(s=z-1-s),u=(h=k(a,z))[1].toJSNumber(),i&&(u=z-1-u),o=f[0],a=h[0],l.push(r(s,u));for(var c=0!==r(n?1:0,i?1:0)?J(-1):J(0),p=l.length-1;0<=p;p-=1)c=c.multiply(z).add(J(l[p]));return c}d.prototype.shiftLeft=y.prototype.shiftLeft=function(t){if(!P(t))throw new Error(String(t)+" is too large for shifting.");if((t=+t)<0)return this.shiftRight(-t);var e=this;if(e.isZero())return e;for(;I<=t;)e=e.multiply(z),t-=I-1;return e.multiply(s[t])},d.prototype.shiftRight=y.prototype.shiftRight=function(t){var e;if(!P(t))throw new Error(String(t)+" is too large for shifting.");if((t=+t)<0)return this.shiftLeft(-t);for(var r=this;I<=t;){if(r.isZero()||r.isNegative()&&r.isUnit())return r;r=(e=k(r,z))[1].isNegative()?e[0].prev():e[0],t-=I-1}return(e=k(r,s[t]))[1].isNegative()?e[0].prev():e[0]},d.prototype.not=y.prototype.not=function(){return this.negate().prev()},d.prototype.and=y.prototype.and=function(t){return j(this,t,function(t,e){return t&e})},d.prototype.or=y.prototype.or=function(t){return j(this,t,function(t,e){return t|e})},d.prototype.xor=y.prototype.xor=function(t){return j(this,t,function(t,e){return t^e})};var L=1<<30,C=(g&-g)*(g&-g)|L;function N(t){var e=t.value,r="number"==typeof e?e|L:e[0]+e[1]*g|C;return r&-r}function R(t,e){return t=W(t),e=W(e),t.greater(e)?t:e}function q(t,e){return t=W(t),e=W(e),t.lesser(e)?t:e}function H(t,e){if(t=W(t).abs(),e=W(e).abs(),t.equals(e))return t;if(t.isZero())return e;if(e.isZero())return t;for(var r,n,i=p[1];t.isEven()&&e.isEven();)r=Math.min(N(t),N(e)),t=t.divide(r),e=e.divide(r),i=i.multiply(r);for(;t.isEven();)t=t.divide(N(t));do{for(;e.isEven();)e=e.divide(N(e));t.greater(e)&&(n=e,e=t,t=n),e=e.subtract(t)}while(!e.isZero());return i.isUnit()?t:t.multiply(i)}d.prototype.bitLength=y.prototype.bitLength=function(){var t=this;return t.compareTo(J(0))<0&&(t=t.negate().subtract(J(1))),0===t.compareTo(J(0))?J(0):J(function t(e,r){if(r.compareTo(e)<=0){var n=t(e,r.square(r)),i=n.p,o=n.e,a=i.multiply(r);return a.compareTo(e)<=0?{p:a,e:2*o+1}:{p:i,e:2*o}}return{p:J(1),e:0}}(t,J(2)).e).add(J(1))};var F=function(t,e){for(var r=t.length,n=Math.abs(e),i=0;i<r;i++){if("-"!==(u=t[i].toLowerCase())&&/[a-z0-9]/.test(u)){if(/[0-9]/.test(u)&&n<=+u){if("1"===u&&1===n)continue;throw new Error(u+" is not a valid digit in base "+e+".")}if(u.charCodeAt(0)-87>=n)throw new Error(u+" is not a valid digit in base "+e+".")}}if(2<=e&&e<=36&&r<=c/Math.log(e)){var o=parseInt(t,e);if(isNaN(o))throw new Error(u+" is not a valid digit in base "+e+".");return new d(parseInt(t,e))}e=W(e);var a=[],s="-"===t[0];for(i=s?1:0;i<t.length;i++){var u,f=(u=t[i].toLowerCase()).charCodeAt(0);if(48<=f&&f<=57)a.push(W(u));else if(97<=f&&f<=122)a.push(W(u.charCodeAt(0)-87));else{if("<"!==u)throw new Error(u+" is not a valid character");for(var h=i;">"!==t[++i];);a.push(W(t.slice(h+1,i)))}}return K(a,e,s)};function K(t,e,r){var n,i=p[0],o=p[1];for(n=t.length-1;0<=n;n--)i=i.add(t[n].times(o)),o=o.times(e);return r?i.negate():i}function D(t){return t<=35?"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t):"<"+t+">"}function Y(t,e){if((e=J(e)).isZero()){if(t.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(e.equals(-1)){if(t.isZero())return{value:[0],isNegative:!1};if(t.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-t)).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var r=Array.apply(null,Array(+t-1)).map(Array.prototype.valueOf,[0,1]);return r.unshift([1]),{value:[].concat.apply([],r),isNegative:!1}}var n=!1;if(t.isNegative()&&e.isPositive()&&(n=!0,t=t.abs()),e.equals(1))return t.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(+t)).map(Number.prototype.valueOf,1),isNegative:n};for(var i,o=[],a=t;a.isNegative()||0<=a.compareAbs(e);){a=(i=a.divmod(e)).quotient;var s=i.remainder;s.isNegative()&&(s=e.minus(s).abs(),a=a.next()),o.push(s.toJSNumber())}return o.push(a.toJSNumber()),{value:o.reverse(),isNegative:n}}function Z(t,e){var r=Y(t,e);return(r.isNegative?"-":"")+r.value.map(D).join("")}function G(t){if(v(+t)){var e=+t;if(e===E(e))return new d(e);throw new Error("Invalid integer: "+t)}var r="-"===t[0];r&&(t=t.slice(1));var n=t.split(/e/i);if(2<n.length)throw new Error("Invalid integer: "+n.join("e"));if(2===n.length){var i=n[1];if("+"===i[0]&&(i=i.slice(1)),(i=+i)!==E(i)||!v(i))throw new Error("Invalid integer: "+i+" is not a valid exponent.");var o=n[0],a=o.indexOf(".");if(0<=a&&(i-=o.length-a-1,o=o.slice(0,a)+o.slice(a+1)),i<0)throw new Error("Cannot include negative exponent part for integers");t=o+=new Array(i+1).join("0")}if(!/^([0-9][0-9]*)$/.test(t))throw new Error("Invalid integer: "+t);for(var s=[],u=t.length,f=l,h=u-f;0<u;)s.push(+t.slice(h,u)),(h-=f)<0&&(h=0),u-=f;return b(s),new y(s,r)}function W(t){return"number"==typeof t?function(t){if(v(t)){if(t!==E(t))throw new Error(t+" is not an integer.");return new d(t)}return G(t.toString())}(t):"string"==typeof t?G(t):t}y.prototype.toArray=function(t){return Y(this,t)},d.prototype.toArray=function(t){return Y(this,t)},y.prototype.toString=function(t){if(t===u&&(t=10),10!==t)return Z(this,t);for(var e,r=this.value,n=r.length,i=String(r[--n]);0<=--n;)e=String(r[n]),i+="0000000".slice(e.length)+e;return(this.sign?"-":"")+i},d.prototype.toString=function(t){return t===u&&(t=10),10!=t?Z(this,t):String(this.value)},y.prototype.toJSON=d.prototype.toJSON=function(){return this.toString()},y.prototype.toJSNumber=y.prototype.valueOf=function(){return parseInt(this.toString(),10)},d.prototype.toJSNumber=d.prototype.valueOf=function(){return this.value};for(var t=0;t<1e3;t++)p[t]=new d(t),0<t&&(p[-t]=new d(-t));return p.one=p[1],p.zero=p[0],p.minusOne=p[-1],p.max=R,p.min=q,p.gcd=H,p.lcm=function(t,e){return t=W(t).abs(),e=W(e).abs(),t.divide(H(t,e)).multiply(e)},p.isInstance=function(t){return t instanceof y||t instanceof d},p.randBetween=function(t,e){var r=q(t=W(t),e=W(e)),n=R(t,e).subtract(r).add(1);if(n.isSmall)return r.add(Math.floor(Math.random()*n));for(var i=[],o=!0,a=n.value.length-1;0<=a;a--){var s=o?n.value[a]:g,u=E(Math.random()*s);i.unshift(u),u<s&&(o=!1)}return i=m(i),r.add("number"==typeof i?new d(i):new y(i,!1))},p.fromArray=function(t,e,r){return K(t.map(W),W(e||10),r)},p}();void 0!==e&&e.hasOwnProperty("exports")&&(e.exports=J)},{}],28:[function(t,e,r){e.exports=function(t,e,r,n,i){var o,a;if(void 0===n)n=0;else if((n|=0)<0||n>=t.length)throw new RangeError("invalid lower bound");if(void 0===i)i=t.length-1;else if((i|=0)<n||i>=t.length)throw new RangeError("invalid upper bound");for(;n<=i;)if((a=+r(t[o=n+(i-n>>1)],e,o,t))<0)n=o+1;else{if(!(0<a))return o;i=o-1}return~n}},{}],29:[function(t,e,r){},{}],30:[function(t,e,r){"use strict";var n=t("base64-js"),o=t("ieee754");r.Buffer=l,r.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},r.INSPECT_MAX_BYTES=50;var i=2147483647;function a(t){if(i<t)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=l.prototype,e}function l(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 f(t)}return s(t,e,r)}function s(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|p(t,e),n=a(r),i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return h(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(L(t,ArrayBuffer)||t&&L(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);return n.__proto__=l.prototype,n}(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 l.from(n,e,r);var i=function(t){if(l.isBuffer(t)){var e=0|c(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||C(t.length)?a(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.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 u(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 f(t){return u(t),a(t<0?0:0|c(t))}function h(t){for(var e=t.length<0?0:0|c(t.length),r=a(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function c(t){if(i<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function p(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||L(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=2<arguments.length&&!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 z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return P(t).length;default:if(i)return n?-1:z(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),C(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=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:v(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):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(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;s/=a=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var h=-1;for(o=r;o<s;o++)if(f(t,o)===f(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===u)return h*a}else-1!==h&&(o-=o-h),h=-1}else for(s<r+u&&(r=s-u),o=r;0<=o;o--){for(var l=!0,c=0;c<u;c++)if(f(t,o+c)!==f(e,c)){l=!1;break}if(l)return o}return-1}function g(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?i<(n=Number(n))&&(n=i):n=i;var o=e.length;o/2<n&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(C(s))return a;t[r+a]=s}return a}function w(t,e,r,n){return j(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function m(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function b(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,a,s,u,f=t[i],h=null,l=239<f?4:223<f?3:191<f?2:1;if(i+l<=r)switch(l){case 1:f<128&&(h=f);break;case 2:128==(192&(o=t[i+1]))&&127<(u=(31&f)<<6|63&o)&&(h=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&2047<(u=(15&f)<<12|(63&o)<<6|63&a)&&(u<55296||57343<u)&&(h=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&65535<(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)&&u<1114112&&(h=u)}null===h?(h=65533,l=1):65535<h&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=l}return function(t){var e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=_));return r}(n)}r.kMaxLength=i,(l.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),l.poolSize=8192,l.from=function(t,e,r){return s(t,e,r)},l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,l.alloc=function(t,e,r){return i=e,o=r,u(n=t),n<=0?a(n):void 0!==i?"string"==typeof o?a(n).fill(i,o):a(n).fill(i):a(n);var n,i,o},l.allocUnsafe=function(t){return f(t)},l.allocUnsafeSlow=function(t){return f(t)},l.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==l.prototype},l.compare=function(t,e){if(L(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),L(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var r;if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;var n=l.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(L(o,Uint8Array)&&(o=l.from(o)),!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},l.byteLength=p,l.prototype._isBuffer=!0,l.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;e<t;e+=2)y(this,e,e+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},l.prototype.toLocaleString=l.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?b(this,0,t):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 T(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return A(this,e,r);case"base64":return m(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},l.prototype.compare=function(t,e,r,n,i){if(L(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.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(i<=n&&r<=e)return 0;if(i<=n)return-1;if(r<=e)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),f=t.slice(e,r),h=0;h<s;++h)if(u[h]!==f[h]){o=u[h],a=f[h];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},l.prototype.indexOf=function(t,e,r){return d(this,t,e,r,!0)},l.prototype.lastIndexOf=function(t,e,r){return d(this,t,e,r,!1)},l.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||i<r)&&(r=i),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o,a,s,u,f,h,l,c,p,y=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return c=e,p=r,j(z(t,(l=this).length-c),l,c,p);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return u=this,f=e,h=r,j(P(t),u,f,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=e,s=r,j(function(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,(o=this).length-a),o,a,s);default:if(y)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),y=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function E(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function T(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||n<r)&&(r=n);for(var i="",o=e;o<r;++o)i+=I(t[o]);return i}function x(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function U(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(r<t+e)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,i,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<e||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function S(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 k(t,e,r,n,i){return e=+e,r>>>=0,i||S(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function O(t,e,r,n,i){return e=+e,r>>>=0,i||S(t,0,r,8),o.write(t,e,r,n,52,8),r+8}l.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=l.prototype,n},l.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},l.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t+--e],i=1;0<e&&(i*=256);)n+=this[t+--e]*i;return n},l.prototype.readUInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return(i*=128)<=n&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=e,i=1,o=this[t+--n];0<n&&(i*=256);)o+=this[t+--n]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||U(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){t>>>=0,e||U(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return t>>>=0,e||U(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||U(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||U(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||U(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},l.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;0<=--i&&(o*=256);)this[e+i]=t/o&255;return e+r},l.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(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},l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(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},l.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=