From 274e71ee9b54db48ad991d40b787780e3aa64723 Mon Sep 17 00:00:00 2001 From: learnforpractice Date: Fri, 10 Mar 2023 10:17:08 +0800 Subject: [PATCH] EOS account name should be less than 12 characters, and only contain the following symbols .12345abcdefghijklmnopqrstuvwxyz --- dist/wallet-address-validator.js | 6 ++++-- dist/wallet-address-validator.min.js | 2 +- src/eos_validator.js | 6 ++++-- test/wallet_address_validator.js | 9 +++++++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/dist/wallet-address-validator.js b/dist/wallet-address-validator.js index a1e01f14..a6f8cfd7 100644 --- a/dist/wallet-address-validator.js +++ b/dist/wallet-address-validator.js @@ -12575,8 +12575,10 @@ module.exports = { },{"./crypto/utils":52}],55:[function(require,module,exports){ function isValidEOSAddress (address, currency, networkType) { - var regex = /^[a-z0-9.]+$/g // Must be numbers, lowercase letters and decimal points only - if (address.search(regex) !== -1 && address.length === 12) { + // EOS account name should be less than 12 characters, + // and only contain the following symbols .12345abcdefghijklmnopqrstuvwxyz + var regex = /^[.1-5a-z]{1,12}$/g + if (address.search(regex) !== -1) { return true } else { return false diff --git a/dist/wallet-address-validator.min.js b/dist/wallet-address-validator.min.js index f47f0d3b..5a3342f0 100644 --- a/dist/wallet-address-validator.min.js +++ b/dist/wallet-address-validator.min.js @@ -1 +1 @@ -!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).WAValidator=t()}}(function(){return function(){return function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var h=r[a]={exports:{}};e[a][0].call(h.exports,function(t){return i(e[a][1][t]||t)},h,h.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r>>0,h=new Uint8Array(a);t[r];){var c=e[t.charCodeAt(r)];if(255===c)return;for(var l=0,d=a-1;(0!==c||l>>0,h[d]=c%256>>>0,c=c/256>>>0;if(0!==c)throw new Error("Non-zero carry");o=l,r++}for(var p=a-o;p!==a&&0===h[p];)p++;var y=n.allocUnsafe(i+(a-p));y.fill(0,0,i);for(var v=i;p!==a;)y[v++]=h[p++];return y}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,a=e.length;o!==a&&0===e[o];)o++,r++;for(var f=(a-o)*h+1>>>0,c=new Uint8Array(f);o!==a;){for(var l=e[o],d=0,p=f-1;(0!==l||d>>0,c[p]=l%s>>>0,l=l/s>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,o++}for(var y=f-i;y!==f&&0===c[y];)y++;for(var v=u.repeat(r);y0?n-4:n,c=0;c>16&255,s[u++]=e>>8&255,s[u++]=255&e;2===a&&(e=i[t.charCodeAt(c)]<<2|i[t.charCodeAt(c+1)]>>4,s[u++]=255&e);1===a&&(e=i[t.charCodeAt(c)]<<10|i[t.charCodeAt(c+1)]<<4|i[t.charCodeAt(c+2)]>>2,s[u++]=e>>8&255,s[u++]=255&e);return s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)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 h(t,e,r){for(var i,o,a=[],s=e;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],3:[function(t,e,r){(function(t){(function(){var r,n=20,i=4,o=-7,a=21,s=-1e9,u=1e9,f=!0,h=parseInt,c=g.prototype,l="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",d=0,p=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,y=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},v=g(1);function g(t,e){var o,a,h,c,v,m,_=this;if(!(_ instanceof g))return new g(t,e);if(t instanceof g){if(d=0,e===o)return _.s=t.s,_.e=t.e,void(_.c=(t=t.c)?t.slice():t);t+=""}if("string"!=typeof t&&(t=(h="number"==typeof t||"[object Number]"==Object.prototype.toString.call(t))&&0===t&&1/t<0?"-0":t+""),m=t,e===o&&p.test(t))_.s="-"==t.charAt(0)?(t=t.slice(1),-1):1;else{if(10==e)return x(t,n,i);if(t=y.call(t).replace(/^\+(?!-)/,""),_.s="-"==t.charAt(0)?(t=t.replace(/^-(?!-)/,""),-1):1,null!=e?e!=(0|e)&&f||(r=!(e>=2&&e<65))?(b(e,2),v=p.test(t)):(c="["+l.slice(0,e|=0)+"]+",t=t.replace(/\.$/,"").replace(/^\./,"0."),(v=new RegExp("^"+c+"(?:\\."+c+")?$",e<37?"i":"").test(t))?(h&&(t.replace(/^0\.0*|\./,"").length>15&&b(m,0),h=!h),t=w(t,10,e,_.s)):"Infinity"!=t&&"NaN"!=t&&(b(m,1,e),t="NaN")):v=p.test(t),!v)return _.c=_.e=null,"Infinity"!=t&&("NaN"!=t&&b(m,3),_.s=null),void(d=0)}for((o=t.indexOf("."))>-1&&(t=t.replace(".","")),(a=t.search(/e/i))>0?(o<0&&(o=a),o+=+t.slice(a+1),t=t.substring(0,a)):o<0&&(o=t.length),a=0;"0"==t.charAt(a);a++);if(e=t.length,h&&e>15&&t.slice(a).length>15&&b(m,0),d=0,(o-=a+1)>u)_.c=_.e=null;else if(a==e||oe-1&&(null==u[i+1]&&(u[i+1]=0),u[i+1]+=u[i]/e^0,u[i]%=e)}return u.reverse()}function c(t){for(var e=0,r=t.length,n="";e-1)if(i=t.length-i-1,o=h(new g(r).pow(i).toF(),10),a=h((s=t.split("."))[1]),s=h(s[0]),u=(f=m(a,o,a.length-o.length,n,e,1&s[s.length-1])).c,i=f.e){for(;++i;u.unshift(0));t=c(s)+"."+c(u)}else u[0]?s[i=s.length-1]m?1:-1;else for(d=-1,l=0;++dw[d]?1:-1;break}if(!(l<0))break;for(h=m==f?e:p;m;){if(w[--m]k&&A(_,n,o,a,null!=w[0]),_.e>u?_.c=_.e=null:_.e++e&&A(t,n,10),n=0==i[0]?n+1:r?e:t.e+n+1;i.length1?(i.splice(1,0,"."),i.join("")):i[0])+(n<0?"e":"e+")+n:t.toS()}function A(t,e,r,n,o){var a=t.c,s=t.s<0,u=r/2,f=t.e+e+1,h=a[f],c=o||f<0||null!=a[f+1];if(o=i<4?(null!=h||c)&&(0==i||2==i&&!s||3==i&&s):h>u||h==u&&(4==i||c||6==i&&(1&a[f-1]||!e&&n)||7==i&&!s||8==i&&s),f<1||!a[0])return a.length=0,a.push(0),o?(a[0]=1,t.e=-e):t.e=0,t;if(a.length=f--,o)for(--r;++a[f]>r;)a[f]=0,f--||(++t.e,a.unshift(1));for(f=a.length;!a[--f];a.pop());return t}function x(t,e,r){var n=i;return i=r,(t=new g(t)).c&&A(t,e,10),i=n,t}g.ROUND_UP=0,g.ROUND_DOWN=1,g.ROUND_CEIL=2,g.ROUND_FLOOR=3,g.ROUND_HALF_UP=4,g.ROUND_HALF_DOWN=5,g.ROUND_HALF_EVEN=6,g.ROUND_HALF_CEIL=7,g.ROUND_HALF_FLOOR=8,g.fromBuffer=function(t,e){e||(e={});var r={1:"big","-1":"little"}[e.endian]||e.endian||"big",n="auto"===e.size?Math.ceil(t.length):e.size||1;if(t.length%n!=0)throw new RangeError("Buffer length ("+t.length+") must be a multiple of size ("+n+")");for(var i=[],o=0;on)||h(t)!=t&&0!==t)},w=y&&"object"==typeof y?function(){if(y.hasOwnProperty(e))return null!=(t=y[e])}:function(){if(p.length>c)return null!=(t=p[c++])};return w(e="DECIMAL_PLACES")&&(g(t,0,1e9)?n=0|t:b(t,e,v)),l[e]=n,w(e="ROUNDING_MODE")&&(g(t,0,8)?i=0|t:b(t,e,v)),l[e]=i,w(e="EXPONENTIAL_AT")&&(g(t,-1e9,1e9)?o=-(a=~~(t<0?-t:+t)):!r&&t&&g(t[0],-1e9,0)&&g(t[1],0,1e9)?(o=~~t[0],a=~~t[1]):b(t,e,v,1)),l[e]=[o,a],w(e="RANGE")&&(g(t,-1e9,1e9)&&~~t?s=-(u=~~(t<0?-t:+t)):!r&&t&&g(t[0],-1e9,-1)&&g(t[1],1,1e9)?(s=~~t[0],u=~~t[1]):b(t,e,v,1,1)),l[e]=[s,u],w(e="ERRORS")&&(t===!!t||1===t||0===t?(r=d=0,h=(f=!!t)?parseInt:parseFloat):b(t,e,v,0,0,1)),l[e]=f,l},c.abs=c.absoluteValue=function(){var t=new g(this);return t.s<0&&(t.s=1),t},c.bitLength=function(){return this.toString(2).length},c.ceil=function(){return x(this,0,2)},c.comparedTo=c.cmp=function(t,e){var r,n=this,i=n.c,o=(d=-d,t=new g(t,e)).c,a=n.s,s=t.s,u=n.e,f=t.e;if(!a||!s)return null;if(r=i&&!i[0],e=o&&!o[0],r||e)return r?e?0:-s:a;if(a!=s)return a;if(r=a<0,e=u==f,!i||!o)return e?0:!i^r?1:-1;if(!e)return u>f^r?1:-1;for(a=-1,s=(u=i.length)<(f=o.length)?u:f;++ao[a]^r?1:-1;return u==f?0:u>f^r?1:-1},c.dividedBy=c.div=function(t,e){var r=this.c,n=this.e,i=this.s,o=(d=2,t=new g(t,e)).c,a=t.e,s=t.s,u=i==s?1:-1;return(n||r&&r[0])&&(a||o&&o[0])?m(r,o,n-a,u,10):new g(i&&s&&(r?!o||r[0]!=o[0]:o)?r&&0==r[0]||!o?0*u:u/0:NaN)},c.equals=c.eq=function(t,e){return d=3,0===this.cmp(t,e)},c.floor=function(){return x(this,0,3)},c.greaterThan=c.gt=function(t,e){return d=4,this.cmp(t,e)>0},c.greaterThanOrEqualTo=c.gte=c.gt=function(t,e){return d=5,1==(e=this.cmp(t,e))||0===e},c.isFinite=c.isF=function(){return!!this.c},c.isNaN=function(){return!this.s},c.isNegative=c.isNeg=function(){return this.s<0},c.isZero=c.isZ=function(){return!!this.c&&0==this.c[0]},c.lessThan=c.lt=function(t,e){return d=6,this.cmp(t,e)<0},c.lessThanOrEqualTo=c.lte=c.le=function(t,e){return d=7,-1==(e=this.cmp(t,e))||0===e},c.minus=c.sub=function(t,e){var r,n,o,a,u=this,f=u.s;if(e=(d=8,t=new g(t,e)).s,!f||!e)return new g(NaN);if(f!=e)return t.s=-e,u.plus(t);var h=u.c,c=u.e,l=t.c,p=t.e;if(!c||!p){if(!h||!l)return h?(t.s=-e,t):new g(l?u:NaN);if(!h[0]||!l[0])return l[0]?(t.s=-e,t):new g(h[0]?u:3==i?-0:0)}if(h=h.slice(),f=c-p){for((r=(a=f<0)?(f=-f,h):(p=c,l)).reverse(),e=f;e--;r.push(0));r.reverse()}else for(o=((a=h.length0)for(;e--;h[o++]=0);for(e=l.length;e>f;){if(h[--e]0?(s=o,f):(i=-i,a)).reverse();i--;r.push(0));r.reverse()}for(a.length-f.length<0&&(r=f,f=a,a=r),i=f.length,e=0;i;e=(a[--i]=a[i]+f[i]+e)/10^0,a[i]%=10);for(e&&(a.unshift(e),++s>u&&(a=s=null)),i=a.length;0==a[--i];a.pop());return t.c=a,t.e=s,t},c.toPower=c.pow=function(t){var e=0*t==0?0|t:t,n=new g(this),i=new g(v);if(((r=t<-1e6||t>1e6)&&(e=1*t/0)||h(t)!=t&&0!==t&&!(e=NaN))&&!b(t,"exponent","pow")||!e)return new g(Math.pow(n.toS(),e));for(e=e<0?-e:e;1&e&&(i=i.times(n)),e>>=1;)n=n.times(n);return t<0?v.div(i):i},c.powm=function(t,e){return this.pow(t).mod(e)},c.round=function(t,e){return x(this,t=null==t||((r=t<0||t>1e9)||h(t)!=t)&&!b(t,"decimal places","round")?0:0|t,e=null==e||((r=e<0||e>8)||h(e)!=e&&0!==e)&&!b(e,"mode","round")?i:0|e)},c.squareRoot=c.sqrt=function(){var t,e,r,o,a=this,s=a.c,u=a.s,f=a.e,h=n,c=i,l=new g("0.5");if(1!==u||!s||!s[0])return new g(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);for(u=Math.sqrt(a.toS()),i=1,0==u||u==1/0?((t=s.join("")).length+f&1||(t+="0"),(e=new g(Math.sqrt(t)+"")).c||(e.c=[1]),e.e=((f+1)/2|0)-(f<0||1&f)):e=new g(t=u.toString()),(u=(r=e.e)+(n+=4))<3&&(u=0),f=u;;)if(o=e,e=l.times(o.plus(a.div(o))),o.c.slice(0,u).join("")===e.c.slice(0,u).join("")){if(9!=(s=e.c)[u-=t&&e.ef-2&&(s.length=f-2),e.times(e).eq(a)))){for(;s.length-1;a--){for(e=0,f=h+a;f>a;e=r[f]+o[a]*i[f-a-1]+e,r[f--]=e%10|0,e=e/10|0);e&&(r[f]=(r[f]+e)%10)}for(e&&++t.e,!r[0]&&r.shift(),f=r.length;!r[--f];r.pop());return t.c=t.e>u?t.e=null:t.e0&&h.copy(i,4+(128&h[0]?1:0)),128&h[0]&&(i[4]=0),i[0]=n&255<<24,i[1]=n&255<<16,i[2]=65280&n,i[3]=255&n;var o=this.lt(0);if(o)for(var a=4;a0}).forEach(function(t,e){for(var r=0;r1e9)||h(t)!=t&&0!==t)&&!b(t,"decimal places","toE"))&&this.c?this.c.length-1:0|t,1)},c.toFixed=c.toF=function(t){var e,n,i,s=this;return null==t||((r=t<0||t>1e9)||h(t)!=t&&0!==t)&&!b(t,"decimal places","toF")||(i=s.e+(0|t)),e=o,t=a,o=-(a=1/0),i==n?n=s.toS():(n=_(s,i),s.s<0&&s.c&&(s.c[0]?n.indexOf("-")<0&&(n="-"+n):n=n.replace(/^-/,""))),o=e,a=t,n},c.toFraction=c.toFr=function(t){var e,o,a,s,h,c,l,p=s=new g(v),y=a=new g("0"),w=this,m=w.c,_=u,A=n,x=i,E=new g(v);if(!m)return w.toS();for(l=E.e=m.length-w.e-1,(null==t||(!(d=12,c=new g(t)).s||(r=c.cmp(p)<0||!c.c)||f&&c.e0)&&(t=l>0?E:p),u=1/0,c=new g(m.join("")),n=0,i=1;e=c.div(E),1!=(h=s.plus(e.times(y))).cmp(t);)s=y,y=h,p=a.plus(e.times(h=p)),a=h,E=c.minus(e.times(h=E)),c=h;return h=t.minus(s).div(y),a=a.plus(h.times(p)),s=s.plus(h.times(y)),a.s=p.s=w.s,n=2*l,i=x,o=p.div(y).minus(w).abs().cmp(a.div(s).minus(w).abs())<1?[p.toS(),y.toS()]:[a.toS(),s.toS()],u=_,n=A,o},c.toPrecision=c.toP=function(t){return null==t||((r=t<1||t>1e9)||h(t)!=t)&&!b(t,"precision","toP")?this.toS():_(this,0|--t,2)},c.toString=c.toS=function(t){var e,n,i,s=this,u=s.e;if(null===u)n=s.s?"Infinity":"NaN";else{if(t===e&&(u<=o||u>=a))return _(s,s.c.length-1,1);if(n=s.c.join(""),u<0){for(;++u;n="0"+n);n="0."+n}else if(i=n.length,u>0)if(++u>i)for(u-=i;u--;n+="0");else u1)n=e+"."+n.slice(1);else if("0"==e)return e;if(null!=t)if((r=!(t>=2&&t<65))||t!=(0|t)&&f)b(t,"base","toS");else if("0"==(n=w(n,0|t,10,s.s)))return n}return s.s<0?"-"+n:n},c.valueOf=function(){return this.toS()},e.exports=g}).call(this)}).call(this,t("buffer").Buffer)},{buffer:4}],4:[function(t,e,r){"use strict";var n=t("base64-js"),i=t("ieee754");r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(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 h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|d(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 c(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(z(t,ArrayBuffer)||t&&z(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||z(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(i)return n?-1:M(t).length;e=(""+e).toLowerCase(),i=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),P(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=s.from(e,n)),s.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;a=2,s/=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;os&&(r=s-u),o=r;o>=0;o--){for(var c=!0,l=0;li&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&f)<<6|63&o)>127&&(h=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&f)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(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)&&(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(h=u)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.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 C(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return B(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.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+=" ... "),""},s.prototype.compare=function(t,e,r,n,i){if(z(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,u=Math.min(o,a),f=this.slice(n,i),h=t.slice(e,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return m(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function B(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function O(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 I(t,e,r,n,o){return e=+e,r>>>=0,o||O(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function R(t,e,r,n,o){return e=+e,r>>>=0,o||O(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(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},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(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},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function N(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function z(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function P(t){return t!=t}},{"base64-js":2,ieee754:31}],5:[function(t,e,r){!function(t,r){"use strict";var n=Math.pow(2,-24),i=Math.pow(2,32),o=Math.pow(2,53);var a={encode:function(t){var e,n=new ArrayBuffer(256),a=new DataView(n),s=0;function u(t){for(var r=n.byteLength,i=s+t;r>2,f=0;f>6),i.push(128|63&a)):a<55296?(i.push(224|a>>12),i.push(128|a>>6&63),i.push(128|63&a)):(a=(1023&a)<<10,a|=1023&e.charCodeAt(++n),a+=65536,i.push(240|a>>18),i.push(128|a>>12&63),i.push(128|a>>6&63),i.push(128|63&a))}return l(3,i.length),c(i);default:var d;if(Array.isArray(e))for(l(4,d=e.length),n=0;n>5!==t)throw"Invalid indefinite length element";return r}function v(t,e){for(var r=0;r>10),t.push(56320|1023&n))}}"function"!=typeof e&&(e=function(t){return t}),"function"!=typeof o&&(o=function(){return r});var g=function t(){var i,l,g=h(),b=g>>5,w=31&g;if(7===b)switch(w){case 25:return function(){var t=new ArrayBuffer(4),e=new DataView(t),r=c(),i=32768&r,o=31744&r,a=1023&r;if(31744===o)o=261120;else if(0!==o)o+=114688;else if(0!==a)return a*n;return e.setUint32(0,i<<16|o<<13|a<<13),e.getFloat32(0)}();case 26:return u(a.getFloat32(s),4);case 27:return u(a.getFloat64(s),8)}if((l=p(w))<0&&(b<2||6=0;)_+=l,m.push(f(l));var A=new Uint8Array(_),x=0;for(i=0;i=0;)v(E,l);else v(E,l);return String.fromCharCode.apply(null,E);case 4:var k;if(l<0)for(k=[];!d();)k.push(t());else for(k=new Array(l),i=0;i>8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],19:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("ccitt",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=void 0!==e?~~e:65535,o=0;o>8^a)]^r<<8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],20:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[0,4489,8978,12955,17956,22445,25910,29887,35912,40385,44890,48851,51820,56293,59774,63735,4225,264,13203,8730,22181,18220,30135,25662,40137,36160,49115,44626,56045,52068,63999,59510,8450,12427,528,5017,26406,30383,17460,21949,44362,48323,36440,40913,60270,64231,51324,55797,12675,8202,4753,792,30631,26158,21685,17724,48587,44098,40665,36688,64495,60006,55549,51572,16900,21389,24854,28831,1056,5545,10034,14011,52812,57285,60766,64727,34920,39393,43898,47859,21125,17164,29079,24606,5281,1320,14259,9786,57037,53060,64991,60502,39145,35168,48123,43634,25350,29327,16404,20893,9506,13483,1584,6073,61262,65223,52316,56789,43370,47331,35448,39921,29575,25102,20629,16668,13731,9258,5809,1848,65487,60998,56541,52564,47595,43106,39673,35696,33800,38273,42778,46739,49708,54181,57662,61623,2112,6601,11090,15067,20068,24557,28022,31999,38025,34048,47003,42514,53933,49956,61887,57398,6337,2376,15315,10842,24293,20332,32247,27774,42250,46211,34328,38801,58158,62119,49212,53685,10562,14539,2640,7129,28518,32495,19572,24061,46475,41986,38553,34576,62383,57894,53437,49460,14787,10314,6865,2904,32743,28270,23797,19836,50700,55173,58654,62615,32808,37281,41786,45747,19012,23501,26966,30943,3168,7657,12146,16123,54925,50948,62879,58390,37033,33056,46011,41522,23237,19276,31191,26718,7393,3432,16371,11898,59150,63111,50204,54677,41258,45219,33336,37809,27462,31439,18516,23005,11618,15595,3696,8185,63375,58886,54429,50452,45483,40994,37561,33584,31687,27214,22741,18780,15843,11370,7921,3960];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("kermit",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=void 0!==e?~~e:0,o=0;o>8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],21:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("crc-16-modbus",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=void 0!==e?~~e:65535,o=0;o>8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],22:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=o(t("./create_buffer"));function o(t){return t&&t.__esModule?t:{default:t}}var a=(0,o(t("./define_crc")).default)("xmodem",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=void 0!==e?~~e:0,o=0;o>>8&255;a^=255&t[o],r=r<<8&65535,r^=a^=a>>>4,r^=a=a<<5&65535,r^=a=a<<7&65535}return r});r.default=a},{"./create_buffer":28,"./define_crc":29,buffer:4}],23:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[0,8801531,9098509,825846,9692897,1419802,1651692,10452759,10584377,2608578,2839604,11344079,3303384,11807523,12104405,4128302,12930697,4391538,5217156,13227903,5679208,13690003,14450021,5910942,6606768,14844747,15604413,6837830,16197969,7431594,8256604,16494759,840169,9084178,8783076,18463,10434312,1670131,1434117,9678590,11358416,2825259,2590173,10602790,4109873,12122826,11821884,3289031,13213536,5231515,4409965,12912278,5929345,14431610,13675660,5693559,6823513,15618722,14863188,6588335,16513208,8238147,7417269,16212302,1680338,10481449,9664223,1391140,9061683,788936,36926,8838341,12067563,4091408,3340262,11844381,2868234,11372785,10555655,2579964,14478683,5939616,5650518,13661357,5180346,13190977,12967607,4428364,8219746,16457881,16234863,7468436,15633027,6866552,6578062,14816117,1405499,9649856,10463030,1698765,8819930,55329,803287,9047340,11858690,3325945,4072975,12086004,2561507,10574104,11387118,2853909,13647026,5664841,5958079,14460228,4446803,12949160,13176670,5194661,7454091,16249200,16476294,8201341,14834538,6559633,6852199,15647388,3360676,11864927,12161705,4185682,10527045,2551230,2782280,11286707,9619101,1346150,1577872,10379115,73852,8875143,9172337,899466,16124205,7357910,8182816,16421083,6680524,14918455,15678145,6911546,5736468,13747439,14507289,5968354,12873461,4334094,5159928,13170435,4167245,12180150,11879232,3346363,11301036,2767959,2532769,10545498,10360692,1596303,1360505,9604738,913813,9157998,8856728,92259,16439492,8164415,7343561,16138546,6897189,15692510,14936872,6662099,5986813,14488838,13733104,5750795,13156124,5174247,4352529,12855018,2810998,11315341,10498427,2522496,12124823,4148844,3397530,11901793,9135439,862644,110658,8912057,1606574,10407765,9590435,1317464,15706879,6940164,6651890,14889737,8145950,16384229,16161043,7394792,5123014,13133629,12910283,4370992,14535975,5997020,5707818,13718737,2504095,10516836,11329682,2796649,11916158,3383173,4130419,12143240,8893606,129117,876971,9121104,1331783,9576124,10389322,1625009,14908182,6633453,6925851,15721184,7380471,16175372,16402682,8127489,4389423,12891860,13119266,5137369,13704398,5722165,6015427,14517560];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("crc-24",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=void 0!==e?~~e:11994318,o=0;o>16^a)]^r<<8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],24:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("crc-32",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=0===e?0:-1^~~e,o=0;o>>8}return-1^r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],25:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[0,7,14,9,28,27,18,21,56,63,54,49,36,35,42,45,112,119,126,121,108,107,98,101,72,79,70,65,84,83,90,93,224,231,238,233,252,251,242,245,216,223,214,209,196,195,202,205,144,151,158,153,140,139,130,133,168,175,166,161,180,179,186,189,199,192,201,206,219,220,213,210,255,248,241,246,227,228,237,234,183,176,185,190,171,172,165,162,143,136,129,134,147,148,157,154,39,32,41,46,59,60,53,50,31,24,17,22,3,4,13,10,87,80,89,94,75,76,69,66,111,104,97,102,115,116,125,122,137,142,135,128,149,146,155,156,177,182,191,184,173,170,163,164,249,254,247,240,229,226,235,236,193,198,207,200,221,218,211,212,105,110,103,96,117,114,123,124,81,86,95,88,77,74,67,68,25,30,23,16,5,2,11,12,33,38,47,40,61,58,51,52,78,73,64,71,82,85,92,91,118,113,120,127,106,109,100,99,62,57,48,55,34,37,44,43,6,1,8,15,26,29,20,19,174,169,160,167,178,181,188,187,150,145,152,159,138,141,132,131,222,217,208,215,194,197,204,203,230,225,232,239,250,253,244,243];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("crc-8",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=~~e,o=0;o1&&void 0!==arguments[1]?arguments[1]:-1;n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=0===e?0:~~e,o=0;o>>8}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],28:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=n.Buffer.from&&n.Buffer.alloc&&n.Buffer.allocUnsafe&&n.Buffer.allocUnsafeSlow?n.Buffer.from:function(t){return new n.Buffer(t)};r.default=i},{buffer:4}],29:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t,e){var r=function(t,r){return e(t,r)>>>0};return r.signed=e,r.unsigned=r,r.model=t,r}},{}],30:[function(t,e,r){"use strict";e.exports={crc1:t("./crc1"),crc8:t("./crc8"),crc81wire:t("./crc8_1wire"),crc16:t("./crc16"),crc16ccitt:t("./crc16_ccitt"),crc16modbus:t("./crc16_modbus"),crc16xmodem:t("./crc16_xmodem"),crc16kermit:t("./crc16_kermit"),crc24:t("./crc24"),crc32:t("./crc32"),crcjam:t("./crcjam")}},{"./crc1":6,"./crc16":7,"./crc16_ccitt":8,"./crc16_kermit":9,"./crc16_modbus":10,"./crc16_xmodem":11,"./crc24":12,"./crc32":13,"./crc8":14,"./crc8_1wire":15,"./crcjam":16}],31:[function(t,e,r){r.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,h=-7,c=r?i-1:0,l=r?-1:1,d=t[e+c];for(c+=l,o=d&(1<<-h)-1,d>>=-h,h+=s;h>0;o=256*o+t[e+c],c+=l,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[e+c],c+=l,h-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=f}return(d?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,f=8*o-i-1,h=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=h?(s=0,a=h):a+c>=1?(s=(e*u-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;t[r+d]=255&a,d+=p,a/=256,f-=8);t[r+d-p]|=128*y}},{}],32:[function(t,e,r){(function(t,r){(function(){!function(){"use strict";var n="input is invalid type",i="object"==typeof window,o=i?window:{};o.JS_SHA512_NO_WINDOW&&(i=!1);var a=!i&&"object"==typeof self;!o.JS_SHA512_NO_NODE_JS&&"object"==typeof t&&t.versions&&t.versions.node?o=r:a&&(o=self);var s=!o.JS_SHA512_NO_COMMON_JS&&"object"==typeof e&&e.exports,u=!o.JS_SHA512_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,f="0123456789abcdef".split(""),h=[-2147483648,8388608,32768,128],c=[24,16,8,0],l=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],d=["hex","array","digest","arrayBuffer"],p=[];!o.JS_SHA512_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!u||!o.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var y=function(t,e){return function(r){return new w(e,!0).update(r)[t]()}},v=function(t){var e=y("hex",t);e.create=function(){return new w(t)},e.update=function(t){return e.create().update(t)};for(var r=0;r>6,f[h++]=128|63&s):s<55296||s>=57344?(f[h++]=224|s>>12,f[h++]=128|s>>6&63,f[h++]=128|63&s):(s=65536+((1023&s)<<10|1023&t.charCodeAt(++c)),f[h++]=240|s>>18,f[h++]=128|s>>12&63,f[h++]=128|s>>6&63,f[h++]=128|63&s);t=f}t.length>128&&(t=new w(e,!0).update(t).array());var l=[],d=[];for(c=0;c<128;++c){var p=t[c]||0;l[c]=92^p,d[c]=54^p}w.call(this,e,r),this.update(d),this.oKeyPad=l,this.inner=!0,this.sharedMemory=r}w.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(n);if(null===t)throw new Error(n);if(u&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||u&&ArrayBuffer.isView(t)))throw new Error(n);e=!0}for(var i,o,a=0,s=t.length,f=this.blocks;a>2]|=t[a]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(f[o>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=128?(this.block=f[32],this.start=o-128,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[32]=this.block,t[e>>2]|=h[3&e],this.block=t[32],e>=112&&(this.hashed||this.hash(),t[0]=this.block,t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=t[16]=t[17]=t[18]=t[19]=t[20]=t[21]=t[22]=t[23]=t[24]=t[25]=t[26]=t[27]=t[28]=t[29]=t[30]=t[31]=t[32]=0),t[30]=this.hBytes<<3|this.bytes>>>29,t[31]=this.bytes<<3,this.hash()}},w.prototype.hash=function(){var t,e,r,n,i,o,a,s,u,f,h,c,d,p,y,v,g,b,w,m,_,A,x,E,k,B=this.h0h,S=this.h0l,C=this.h1h,U=this.h1l,T=this.h2h,L=this.h2l,O=this.h3h,I=this.h3l,R=this.h4h,j=this.h4l,H=this.h5h,M=this.h5l,N=this.h6h,F=this.h6l,z=this.h7h,P=this.h7l,V=this.blocks;for(t=32;t<160;t+=2)e=((m=V[t-30])>>>1|(_=V[t-29])<<31)^(m>>>8|_<<24)^m>>>7,r=(_>>>1|m<<31)^(_>>>8|m<<24)^(_>>>7|m<<25),n=((m=V[t-4])>>>19|(_=V[t-3])<<13)^(_>>>29|m<<3)^m>>>6,i=(_>>>19|m<<13)^(m>>>29|_<<3)^(_>>>6|m<<26),m=V[t-32],_=V[t-31],u=((A=V[t-14])>>>16)+(m>>>16)+(e>>>16)+(n>>>16)+((s=(65535&A)+(65535&m)+(65535&e)+(65535&n)+((a=((x=V[t-13])>>>16)+(_>>>16)+(r>>>16)+(i>>>16)+((o=(65535&x)+(65535&_)+(65535&r)+(65535&i))>>>16))>>>16))>>>16),V[t]=u<<16|65535&s,V[t+1]=a<<16|65535&o;var D=B,$=S,q=C,Y=U,X=T,J=L,W=O,Z=I,G=R,K=j,Q=H,tt=M,et=N,rt=F,nt=z,it=P;for(v=q&X,g=Y&J,t=0;t<160;t+=8)e=(D>>>28|$<<4)^($>>>2|D<<30)^($>>>7|D<<25),r=($>>>28|D<<4)^(D>>>2|$<<30)^(D>>>7|$<<25),n=(G>>>14|K<<18)^(G>>>18|K<<14)^(K>>>9|G<<23),i=(K>>>14|G<<18)^(K>>>18|G<<14)^(G>>>9|K<<23),b=(f=D&q)^D&X^v,w=(h=$&Y)^$&J^g,E=G&Q^~G&et,k=K&tt^~K&rt,m=V[t],_=V[t+1],m=(u=((A=l[t])>>>16)+(m>>>16)+(E>>>16)+(n>>>16)+(nt>>>16)+((s=(65535&A)+(65535&m)+(65535&E)+(65535&n)+(65535&nt)+((a=((x=l[t+1])>>>16)+(_>>>16)+(k>>>16)+(i>>>16)+(it>>>16)+((o=(65535&x)+(65535&_)+(65535&k)+(65535&i)+(65535&it))>>>16))>>>16))>>>16))<<16|65535&s,_=a<<16|65535&o,A=(u=(b>>>16)+(e>>>16)+((s=(65535&b)+(65535&e)+((a=(w>>>16)+(r>>>16)+((o=(65535&w)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&s,x=a<<16|65535&o,nt=(u=(W>>>16)+(m>>>16)+((s=(65535&W)+(65535&m)+((a=(Z>>>16)+(_>>>16)+((o=(65535&Z)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s,it=a<<16|65535&o,e=((W=(u=(A>>>16)+(m>>>16)+((s=(65535&A)+(65535&m)+((a=(x>>>16)+(_>>>16)+((o=(65535&x)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(Z=a<<16|65535&o)<<4)^(Z>>>2|W<<30)^(Z>>>7|W<<25),r=(Z>>>28|W<<4)^(W>>>2|Z<<30)^(W>>>7|Z<<25),n=(nt>>>14|it<<18)^(nt>>>18|it<<14)^(it>>>9|nt<<23),i=(it>>>14|nt<<18)^(it>>>18|nt<<14)^(nt>>>9|it<<23),b=(c=W&D)^W&q^f,w=(d=Z&$)^Z&Y^h,E=nt&G^~nt&Q,k=it&K^~it&tt,m=V[t+2],_=V[t+3],m=(u=((A=l[t+2])>>>16)+(m>>>16)+(E>>>16)+(n>>>16)+(et>>>16)+((s=(65535&A)+(65535&m)+(65535&E)+(65535&n)+(65535&et)+((a=((x=l[t+3])>>>16)+(_>>>16)+(k>>>16)+(i>>>16)+(rt>>>16)+((o=(65535&x)+(65535&_)+(65535&k)+(65535&i)+(65535&rt))>>>16))>>>16))>>>16))<<16|65535&s,_=a<<16|65535&o,A=(u=(b>>>16)+(e>>>16)+((s=(65535&b)+(65535&e)+((a=(w>>>16)+(r>>>16)+((o=(65535&w)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&s,x=a<<16|65535&o,et=(u=(X>>>16)+(m>>>16)+((s=(65535&X)+(65535&m)+((a=(J>>>16)+(_>>>16)+((o=(65535&J)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s,rt=a<<16|65535&o,e=((X=(u=(A>>>16)+(m>>>16)+((s=(65535&A)+(65535&m)+((a=(x>>>16)+(_>>>16)+((o=(65535&x)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(J=a<<16|65535&o)<<4)^(J>>>2|X<<30)^(J>>>7|X<<25),r=(J>>>28|X<<4)^(X>>>2|J<<30)^(X>>>7|J<<25),n=(et>>>14|rt<<18)^(et>>>18|rt<<14)^(rt>>>9|et<<23),i=(rt>>>14|et<<18)^(rt>>>18|et<<14)^(et>>>9|rt<<23),b=(p=X&W)^X&D^c,w=(y=J&Z)^J&$^d,E=et&nt^~et&G,k=rt&it^~rt&K,m=V[t+4],_=V[t+5],m=(u=((A=l[t+4])>>>16)+(m>>>16)+(E>>>16)+(n>>>16)+(Q>>>16)+((s=(65535&A)+(65535&m)+(65535&E)+(65535&n)+(65535&Q)+((a=((x=l[t+5])>>>16)+(_>>>16)+(k>>>16)+(i>>>16)+(tt>>>16)+((o=(65535&x)+(65535&_)+(65535&k)+(65535&i)+(65535&tt))>>>16))>>>16))>>>16))<<16|65535&s,_=a<<16|65535&o,A=(u=(b>>>16)+(e>>>16)+((s=(65535&b)+(65535&e)+((a=(w>>>16)+(r>>>16)+((o=(65535&w)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&s,x=a<<16|65535&o,Q=(u=(q>>>16)+(m>>>16)+((s=(65535&q)+(65535&m)+((a=(Y>>>16)+(_>>>16)+((o=(65535&Y)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s,tt=a<<16|65535&o,e=((q=(u=(A>>>16)+(m>>>16)+((s=(65535&A)+(65535&m)+((a=(x>>>16)+(_>>>16)+((o=(65535&x)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(Y=a<<16|65535&o)<<4)^(Y>>>2|q<<30)^(Y>>>7|q<<25),r=(Y>>>28|q<<4)^(q>>>2|Y<<30)^(q>>>7|Y<<25),n=(Q>>>14|tt<<18)^(Q>>>18|tt<<14)^(tt>>>9|Q<<23),i=(tt>>>14|Q<<18)^(tt>>>18|Q<<14)^(Q>>>9|tt<<23),b=(v=q&X)^q&W^p,w=(g=Y&J)^Y&Z^y,E=Q&et^~Q&nt,k=tt&rt^~tt&it,m=V[t+6],_=V[t+7],m=(u=((A=l[t+6])>>>16)+(m>>>16)+(E>>>16)+(n>>>16)+(G>>>16)+((s=(65535&A)+(65535&m)+(65535&E)+(65535&n)+(65535&G)+((a=((x=l[t+7])>>>16)+(_>>>16)+(k>>>16)+(i>>>16)+(K>>>16)+((o=(65535&x)+(65535&_)+(65535&k)+(65535&i)+(65535&K))>>>16))>>>16))>>>16))<<16|65535&s,_=a<<16|65535&o,A=(u=(b>>>16)+(e>>>16)+((s=(65535&b)+(65535&e)+((a=(w>>>16)+(r>>>16)+((o=(65535&w)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&s,x=a<<16|65535&o,G=(u=(D>>>16)+(m>>>16)+((s=(65535&D)+(65535&m)+((a=($>>>16)+(_>>>16)+((o=(65535&$)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s,K=a<<16|65535&o,D=(u=(A>>>16)+(m>>>16)+((s=(65535&A)+(65535&m)+((a=(x>>>16)+(_>>>16)+((o=(65535&x)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s,$=a<<16|65535&o;u=(B>>>16)+(D>>>16)+((s=(65535&B)+(65535&D)+((a=(S>>>16)+($>>>16)+((o=(65535&S)+(65535&$))>>>16))>>>16))>>>16),this.h0h=u<<16|65535&s,this.h0l=a<<16|65535&o,u=(C>>>16)+(q>>>16)+((s=(65535&C)+(65535&q)+((a=(U>>>16)+(Y>>>16)+((o=(65535&U)+(65535&Y))>>>16))>>>16))>>>16),this.h1h=u<<16|65535&s,this.h1l=a<<16|65535&o,u=(T>>>16)+(X>>>16)+((s=(65535&T)+(65535&X)+((a=(L>>>16)+(J>>>16)+((o=(65535&L)+(65535&J))>>>16))>>>16))>>>16),this.h2h=u<<16|65535&s,this.h2l=a<<16|65535&o,u=(O>>>16)+(W>>>16)+((s=(65535&O)+(65535&W)+((a=(I>>>16)+(Z>>>16)+((o=(65535&I)+(65535&Z))>>>16))>>>16))>>>16),this.h3h=u<<16|65535&s,this.h3l=a<<16|65535&o,u=(R>>>16)+(G>>>16)+((s=(65535&R)+(65535&G)+((a=(j>>>16)+(K>>>16)+((o=(65535&j)+(65535&K))>>>16))>>>16))>>>16),this.h4h=u<<16|65535&s,this.h4l=a<<16|65535&o,u=(H>>>16)+(Q>>>16)+((s=(65535&H)+(65535&Q)+((a=(M>>>16)+(tt>>>16)+((o=(65535&M)+(65535&tt))>>>16))>>>16))>>>16),this.h5h=u<<16|65535&s,this.h5l=a<<16|65535&o,u=(N>>>16)+(et>>>16)+((s=(65535&N)+(65535&et)+((a=(F>>>16)+(rt>>>16)+((o=(65535&F)+(65535&rt))>>>16))>>>16))>>>16),this.h6h=u<<16|65535&s,this.h6l=a<<16|65535&o,u=(z>>>16)+(nt>>>16)+((s=(65535&z)+(65535&nt)+((a=(P>>>16)+(it>>>16)+((o=(65535&P)+(65535&it))>>>16))>>>16))>>>16),this.h7h=u<<16|65535&s,this.h7l=a<<16|65535&o},w.prototype.hex=function(){this.finalize();var t=this.h0h,e=this.h0l,r=this.h1h,n=this.h1l,i=this.h2h,o=this.h2l,a=this.h3h,s=this.h3l,u=this.h4h,h=this.h4l,c=this.h5h,l=this.h5l,d=this.h6h,p=this.h6l,y=this.h7h,v=this.h7l,g=this.bits,b=f[t>>28&15]+f[t>>24&15]+f[t>>20&15]+f[t>>16&15]+f[t>>12&15]+f[t>>8&15]+f[t>>4&15]+f[15&t]+f[e>>28&15]+f[e>>24&15]+f[e>>20&15]+f[e>>16&15]+f[e>>12&15]+f[e>>8&15]+f[e>>4&15]+f[15&e]+f[r>>28&15]+f[r>>24&15]+f[r>>20&15]+f[r>>16&15]+f[r>>12&15]+f[r>>8&15]+f[r>>4&15]+f[15&r]+f[n>>28&15]+f[n>>24&15]+f[n>>20&15]+f[n>>16&15]+f[n>>12&15]+f[n>>8&15]+f[n>>4&15]+f[15&n]+f[i>>28&15]+f[i>>24&15]+f[i>>20&15]+f[i>>16&15]+f[i>>12&15]+f[i>>8&15]+f[i>>4&15]+f[15&i]+f[o>>28&15]+f[o>>24&15]+f[o>>20&15]+f[o>>16&15]+f[o>>12&15]+f[o>>8&15]+f[o>>4&15]+f[15&o]+f[a>>28&15]+f[a>>24&15]+f[a>>20&15]+f[a>>16&15]+f[a>>12&15]+f[a>>8&15]+f[a>>4&15]+f[15&a];return g>=256&&(b+=f[s>>28&15]+f[s>>24&15]+f[s>>20&15]+f[s>>16&15]+f[s>>12&15]+f[s>>8&15]+f[s>>4&15]+f[15&s]),g>=384&&(b+=f[u>>28&15]+f[u>>24&15]+f[u>>20&15]+f[u>>16&15]+f[u>>12&15]+f[u>>8&15]+f[u>>4&15]+f[15&u]+f[h>>28&15]+f[h>>24&15]+f[h>>20&15]+f[h>>16&15]+f[h>>12&15]+f[h>>8&15]+f[h>>4&15]+f[15&h]+f[c>>28&15]+f[c>>24&15]+f[c>>20&15]+f[c>>16&15]+f[c>>12&15]+f[c>>8&15]+f[c>>4&15]+f[15&c]+f[l>>28&15]+f[l>>24&15]+f[l>>20&15]+f[l>>16&15]+f[l>>12&15]+f[l>>8&15]+f[l>>4&15]+f[15&l]),512==g&&(b+=f[d>>28&15]+f[d>>24&15]+f[d>>20&15]+f[d>>16&15]+f[d>>12&15]+f[d>>8&15]+f[d>>4&15]+f[15&d]+f[p>>28&15]+f[p>>24&15]+f[p>>20&15]+f[p>>16&15]+f[p>>12&15]+f[p>>8&15]+f[p>>4&15]+f[15&p]+f[y>>28&15]+f[y>>24&15]+f[y>>20&15]+f[y>>16&15]+f[y>>12&15]+f[y>>8&15]+f[y>>4&15]+f[15&y]+f[v>>28&15]+f[v>>24&15]+f[v>>20&15]+f[v>>16&15]+f[v>>12&15]+f[v>>8&15]+f[v>>4&15]+f[15&v]),b},w.prototype.toString=w.prototype.hex,w.prototype.digest=function(){this.finalize();var t=this.h0h,e=this.h0l,r=this.h1h,n=this.h1l,i=this.h2h,o=this.h2l,a=this.h3h,s=this.h3l,u=this.h4h,f=this.h4l,h=this.h5h,c=this.h5l,l=this.h6h,d=this.h6l,p=this.h7h,y=this.h7l,v=this.bits,g=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,a>>24&255,a>>16&255,a>>8&255,255&a];return v>=256&&g.push(s>>24&255,s>>16&255,s>>8&255,255&s),v>=384&&g.push(u>>24&255,u>>16&255,u>>8&255,255&u,f>>24&255,f>>16&255,f>>8&255,255&f,h>>24&255,h>>16&255,h>>8&255,255&h,c>>24&255,c>>16&255,c>>8&255,255&c),512==v&&g.push(l>>24&255,l>>16&255,l>>8&255,255&l,d>>24&255,d>>16&255,d>>8&255,255&d,p>>24&255,p>>16&255,p>>8&255,255&p,y>>24&255,y>>16&255,y>>8&255,255&y),g},w.prototype.array=w.prototype.digest,w.prototype.arrayBuffer=function(){this.finalize();var t=this.bits,e=new ArrayBuffer(t/8),r=new DataView(e);return r.setUint32(0,this.h0h),r.setUint32(4,this.h0l),r.setUint32(8,this.h1h),r.setUint32(12,this.h1l),r.setUint32(16,this.h2h),r.setUint32(20,this.h2l),r.setUint32(24,this.h3h),t>=256&&r.setUint32(28,this.h3l),t>=384&&(r.setUint32(32,this.h4h),r.setUint32(36,this.h4l),r.setUint32(40,this.h5h),r.setUint32(44,this.h5l)),512==t&&(r.setUint32(48,this.h6h),r.setUint32(52,this.h6l),r.setUint32(56,this.h7h),r.setUint32(60,this.h7l)),e},w.prototype.clone=function(){var t=new w(this.bits,!1);return this.copyTo(t),t},w.prototype.copyTo=function(t){var e=0,r=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(e=0;eb)throw Error("numRounds must a integer >= 1");if("SHA-1"===t)p=512,y=N,v=F,d=160,g=function(t){return t.slice()};else if(0===t.lastIndexOf("SHA-",0))if(y=function(e,r){return z(e,r,t)},v=function(e,r,n,i){var o,a;if("SHA-224"===t||"SHA-256"===t)o=15+(r+65>>>9<<4),a=16;else{if("SHA-384"!==t&&"SHA-512"!==t)throw Error("Unexpected error in SHA-2 implementation");o=31+(r+129>>>10<<5),a=32}for(;e.length<=o;)e.push(0);for(e[r>>>5]|=128<<24-r%32,r+=n,e[o]=4294967295&r,e[o-1]=r/4294967296|0,n=e.length,r=0;re;e+=1)r[e]=t[e].slice();return r},S=1,"SHA3-224"===t)p=1152,d=224;else if("SHA3-256"===t)p=1088,d=256;else if("SHA3-384"===t)p=832,d=384;else if("SHA3-512"===t)p=576,d=512;else if("SHAKE128"===t)p=1344,d=-1,C=31,B=!0;else{if("SHAKE256"!==t)throw Error("Chosen SHA variant is not supported");p=1088,d=-1,C=31,B=!0}v=function(t,e,r,n,i){var o,a=C,s=[],u=(r=p)>>>5,f=0,h=e>>>5;for(o=0;o=r;o+=u)n=P(t.slice(o,o+u),n),e-=r;for(t=t.slice(o),e%=r;t.length>>3)>>2]^=a<=i));)s.push(t.a),0==64*(f+=1)%r&&(P(null,n),f=0);return s}}o=l(e,n,S),i=M(t),this.setHMACKey=function(e,r,o){var a;if(!0===A)throw Error("HMAC key already set");if(!0===k)throw Error("Cannot set HMAC key after calling update");if(!0===B)throw Error("SHAKE is not supported for HMAC");for(e=(r=l(r,n=(o||{}).encoding||"UTF8",S)(e)).binLen,r=r.value,o=(a=p>>>3)/4-1,a>>5;for(t=(e=o(t,m,_)).binLen,r=e.value,e=t>>>5,n=0;n>>5),_=t%p,k=!0},this.getHash=function(e,r){var n,o,l,p;if(!0===A)throw Error("Cannot call getHash after setting HMAC key");if(l=c(r),!0===B){if(-1===l.shakeLen)throw Error("shakeLen must be specified in options");d=l.shakeLen}switch(e){case"HEX":n=function(t){return a(t,d,S,l)};break;case"B64":n=function(t){return s(t,d,S,l)};break;case"BYTES":n=function(t){return u(t,d,S)};break;case"ARRAYBUFFER":try{o=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}n=function(t){return f(t,d,S)};break;case"UINT8ARRAY":try{o=new Uint8Array(0)}catch(t){throw Error("UINT8ARRAY not supported by this environment")}n=function(t){return h(t,d,S)};break;default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}for(p=v(m.slice(),_,w,g(i),d),o=1;o>>24-d%32),p=v(p,d,0,M(t),d);return n(p)},this.getHMAC=function(e,r){var n,o,l,b;if(!1===A)throw Error("Cannot call getHMAC without first setting HMAC key");switch(l=c(r),e){case"HEX":n=function(t){return a(t,d,S,l)};break;case"B64":n=function(t){return s(t,d,S,l)};break;case"BYTES":n=function(t){return u(t,d,S)};break;case"ARRAYBUFFER":try{n=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}n=function(t){return f(t,d,S)};break;case"UINT8ARRAY":try{n=new Uint8Array(0)}catch(t){throw Error("UINT8ARRAY not supported by this environment")}n=function(t){return h(t,d,S)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}return o=v(m.slice(),_,w,g(i),d),b=y(E,M(t)),n(b=v(o,d,p,b,d))}}function i(t,e){this.a=t,this.b=e}function o(t,e,r,n){var i,o,a,s,u;for(e=e||[0],o=(r=r||0)>>>3,u=-1===n?3:0,i=0;i>>2,e.length<=a&&e.push(0),e[a]|=t[i]<<8*(u+s%4*n);return{value:e,binLen:8*t.length+r}}function a(t,e,r,n){var i,o,a,s="";for(e/=8,a=-1===r?3:0,i=0;i>>2]>>>8*(a+i%4*r),s+="0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o);return n.outputUpper?s.toUpperCase():s}function s(t,e,r,n){var i,o,a,s,u="",f=e/8;for(s=-1===r?3:0,i=0;i>>2]:0,a=i+2>>2]:0,a=(t[i>>>2]>>>8*(s+i%4*r)&255)<<16|(o>>>8*(s+(i+1)%4*r)&255)<<8|a>>>8*(s+(i+2)%4*r)&255,o=0;4>o;o+=1)u+=8*i+6*o<=e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a>>>6*(3-o)&63):n.b64Pad;return u}function u(t,e,r){var n,i,o,a="";for(e/=8,o=-1===r?3:0,n=0;n>>2]>>>8*(o+n%4*r)&255,a+=String.fromCharCode(i);return a}function f(t,e,r){e/=8;var n,i,o,a=new ArrayBuffer(e);for(o=new Uint8Array(a),i=-1===r?3:0,n=0;n>>2]>>>8*(i+n%4*r)&255;return a}function h(t,e,r){e/=8;var n,i,o=new Uint8Array(e);for(i=-1===r?3:0,n=0;n>>2]>>>8*(i+n%4*r)&255;return o}function c(t){var e={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(t=t||{},e.outputUpper=t.outputUpper||!1,!0===t.hasOwnProperty("b64Pad")&&(e.b64Pad=t.b64Pad),!0===t.hasOwnProperty("shakeLen")){if(0!=t.shakeLen%8)throw Error("shakeLen must be a multiple of 8");e.shakeLen=t.shakeLen}if("boolean"!=typeof e.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof e.b64Pad)throw Error("Invalid b64Pad formatting option");return e}function l(t,e,r){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(t){case"HEX":t=function(t,e,n){var i,o,a,s,u,f,h=t.length;if(0!=h%2)throw Error("String of HEX type must be in byte increments");for(e=e||[0],u=(n=n||0)>>>3,f=-1===r?3:0,i=0;i>>1)+u)>>>2;e.length<=a;)e.push(0);e[a]|=o<<8*(f+s%4*r)}return{value:e,binLen:4*h+n}};break;case"TEXT":t=function(t,n,i){var o,a,s,u,f,h,c,l,d=0;if(n=n||[0],f=(i=i||0)>>>3,"UTF8"===e)for(l=-1===r?3:0,s=0;s(o=t.charCodeAt(s))?a.push(o):2048>o?(a.push(192|o>>>6),a.push(128|63&o)):55296>o||57344<=o?a.push(224|o>>>12,128|o>>>6&63,128|63&o):(s+=1,o=65536+((1023&o)<<10|1023&t.charCodeAt(s)),a.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),u=0;u>>2;n.length<=h;)n.push(0);n[h]|=a[u]<<8*(l+c%4*r),d+=1}else if("UTF16BE"===e||"UTF16LE"===e)for(l=-1===r?2:0,a="UTF16LE"===e&&1!==r||"UTF16LE"!==e&&1===r,s=0;s>>8),h=(c=d+f)>>>2;n.length<=h;)n.push(0);n[h]|=o<<8*(l+c%4*r),d+=2}return{value:n,binLen:8*d+i}};break;case"B64":t=function(t,e,n){var i,o,a,s,u,f,h,c,l=0;if(-1===t.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(o=t.indexOf("="),t=t.replace(/\=/g,""),-1!==o&&o=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r>>0,h=new Uint8Array(a);t[r];){var c=e[t.charCodeAt(r)];if(255===c)return;for(var l=0,d=a-1;(0!==c||l>>0,h[d]=c%256>>>0,c=c/256>>>0;if(0!==c)throw new Error("Non-zero carry");o=l,r++}for(var p=a-o;p!==a&&0===h[p];)p++;var y=n.allocUnsafe(i+(a-p));y.fill(0,0,i);for(var v=i;p!==a;)y[v++]=h[p++];return y}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,a=e.length;o!==a&&0===e[o];)o++,r++;for(var f=(a-o)*h+1>>>0,c=new Uint8Array(f);o!==a;){for(var l=e[o],d=0,p=f-1;(0!==l||d>>0,c[p]=l%s>>>0,l=l/s>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,o++}for(var y=f-i;y!==f&&0===c[y];)y++;for(var v=u.repeat(r);y0?n-4:n,c=0;c>16&255,s[u++]=e>>8&255,s[u++]=255&e;2===a&&(e=i[t.charCodeAt(c)]<<2|i[t.charCodeAt(c+1)]>>4,s[u++]=255&e);1===a&&(e=i[t.charCodeAt(c)]<<10|i[t.charCodeAt(c+1)]<<4|i[t.charCodeAt(c+2)]>>2,s[u++]=e>>8&255,s[u++]=255&e);return s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)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 h(t,e,r){for(var i,o,a=[],s=e;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],3:[function(t,e,r){(function(t){(function(){var r,n=20,i=4,o=-7,a=21,s=-1e9,u=1e9,f=!0,h=parseInt,c=g.prototype,l="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",d=0,p=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,y=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},v=g(1);function g(t,e){var o,a,h,c,v,m,_=this;if(!(_ instanceof g))return new g(t,e);if(t instanceof g){if(d=0,e===o)return _.s=t.s,_.e=t.e,void(_.c=(t=t.c)?t.slice():t);t+=""}if("string"!=typeof t&&(t=(h="number"==typeof t||"[object Number]"==Object.prototype.toString.call(t))&&0===t&&1/t<0?"-0":t+""),m=t,e===o&&p.test(t))_.s="-"==t.charAt(0)?(t=t.slice(1),-1):1;else{if(10==e)return x(t,n,i);if(t=y.call(t).replace(/^\+(?!-)/,""),_.s="-"==t.charAt(0)?(t=t.replace(/^-(?!-)/,""),-1):1,null!=e?e!=(0|e)&&f||(r=!(e>=2&&e<65))?(b(e,2),v=p.test(t)):(c="["+l.slice(0,e|=0)+"]+",t=t.replace(/\.$/,"").replace(/^\./,"0."),(v=new RegExp("^"+c+"(?:\\."+c+")?$",e<37?"i":"").test(t))?(h&&(t.replace(/^0\.0*|\./,"").length>15&&b(m,0),h=!h),t=w(t,10,e,_.s)):"Infinity"!=t&&"NaN"!=t&&(b(m,1,e),t="NaN")):v=p.test(t),!v)return _.c=_.e=null,"Infinity"!=t&&("NaN"!=t&&b(m,3),_.s=null),void(d=0)}for((o=t.indexOf("."))>-1&&(t=t.replace(".","")),(a=t.search(/e/i))>0?(o<0&&(o=a),o+=+t.slice(a+1),t=t.substring(0,a)):o<0&&(o=t.length),a=0;"0"==t.charAt(a);a++);if(e=t.length,h&&e>15&&t.slice(a).length>15&&b(m,0),d=0,(o-=a+1)>u)_.c=_.e=null;else if(a==e||oe-1&&(null==u[i+1]&&(u[i+1]=0),u[i+1]+=u[i]/e^0,u[i]%=e)}return u.reverse()}function c(t){for(var e=0,r=t.length,n="";e-1)if(i=t.length-i-1,o=h(new g(r).pow(i).toF(),10),a=h((s=t.split("."))[1]),s=h(s[0]),u=(f=m(a,o,a.length-o.length,n,e,1&s[s.length-1])).c,i=f.e){for(;++i;u.unshift(0));t=c(s)+"."+c(u)}else u[0]?s[i=s.length-1]m?1:-1;else for(d=-1,l=0;++dw[d]?1:-1;break}if(!(l<0))break;for(h=m==f?e:p;m;){if(w[--m]k&&A(_,n,o,a,null!=w[0]),_.e>u?_.c=_.e=null:_.e++e&&A(t,n,10),n=0==i[0]?n+1:r?e:t.e+n+1;i.length1?(i.splice(1,0,"."),i.join("")):i[0])+(n<0?"e":"e+")+n:t.toS()}function A(t,e,r,n,o){var a=t.c,s=t.s<0,u=r/2,f=t.e+e+1,h=a[f],c=o||f<0||null!=a[f+1];if(o=i<4?(null!=h||c)&&(0==i||2==i&&!s||3==i&&s):h>u||h==u&&(4==i||c||6==i&&(1&a[f-1]||!e&&n)||7==i&&!s||8==i&&s),f<1||!a[0])return a.length=0,a.push(0),o?(a[0]=1,t.e=-e):t.e=0,t;if(a.length=f--,o)for(--r;++a[f]>r;)a[f]=0,f--||(++t.e,a.unshift(1));for(f=a.length;!a[--f];a.pop());return t}function x(t,e,r){var n=i;return i=r,(t=new g(t)).c&&A(t,e,10),i=n,t}g.ROUND_UP=0,g.ROUND_DOWN=1,g.ROUND_CEIL=2,g.ROUND_FLOOR=3,g.ROUND_HALF_UP=4,g.ROUND_HALF_DOWN=5,g.ROUND_HALF_EVEN=6,g.ROUND_HALF_CEIL=7,g.ROUND_HALF_FLOOR=8,g.fromBuffer=function(t,e){e||(e={});var r={1:"big","-1":"little"}[e.endian]||e.endian||"big",n="auto"===e.size?Math.ceil(t.length):e.size||1;if(t.length%n!=0)throw new RangeError("Buffer length ("+t.length+") must be a multiple of size ("+n+")");for(var i=[],o=0;on)||h(t)!=t&&0!==t)},w=y&&"object"==typeof y?function(){if(y.hasOwnProperty(e))return null!=(t=y[e])}:function(){if(p.length>c)return null!=(t=p[c++])};return w(e="DECIMAL_PLACES")&&(g(t,0,1e9)?n=0|t:b(t,e,v)),l[e]=n,w(e="ROUNDING_MODE")&&(g(t,0,8)?i=0|t:b(t,e,v)),l[e]=i,w(e="EXPONENTIAL_AT")&&(g(t,-1e9,1e9)?o=-(a=~~(t<0?-t:+t)):!r&&t&&g(t[0],-1e9,0)&&g(t[1],0,1e9)?(o=~~t[0],a=~~t[1]):b(t,e,v,1)),l[e]=[o,a],w(e="RANGE")&&(g(t,-1e9,1e9)&&~~t?s=-(u=~~(t<0?-t:+t)):!r&&t&&g(t[0],-1e9,-1)&&g(t[1],1,1e9)?(s=~~t[0],u=~~t[1]):b(t,e,v,1,1)),l[e]=[s,u],w(e="ERRORS")&&(t===!!t||1===t||0===t?(r=d=0,h=(f=!!t)?parseInt:parseFloat):b(t,e,v,0,0,1)),l[e]=f,l},c.abs=c.absoluteValue=function(){var t=new g(this);return t.s<0&&(t.s=1),t},c.bitLength=function(){return this.toString(2).length},c.ceil=function(){return x(this,0,2)},c.comparedTo=c.cmp=function(t,e){var r,n=this,i=n.c,o=(d=-d,t=new g(t,e)).c,a=n.s,s=t.s,u=n.e,f=t.e;if(!a||!s)return null;if(r=i&&!i[0],e=o&&!o[0],r||e)return r?e?0:-s:a;if(a!=s)return a;if(r=a<0,e=u==f,!i||!o)return e?0:!i^r?1:-1;if(!e)return u>f^r?1:-1;for(a=-1,s=(u=i.length)<(f=o.length)?u:f;++ao[a]^r?1:-1;return u==f?0:u>f^r?1:-1},c.dividedBy=c.div=function(t,e){var r=this.c,n=this.e,i=this.s,o=(d=2,t=new g(t,e)).c,a=t.e,s=t.s,u=i==s?1:-1;return(n||r&&r[0])&&(a||o&&o[0])?m(r,o,n-a,u,10):new g(i&&s&&(r?!o||r[0]!=o[0]:o)?r&&0==r[0]||!o?0*u:u/0:NaN)},c.equals=c.eq=function(t,e){return d=3,0===this.cmp(t,e)},c.floor=function(){return x(this,0,3)},c.greaterThan=c.gt=function(t,e){return d=4,this.cmp(t,e)>0},c.greaterThanOrEqualTo=c.gte=c.gt=function(t,e){return d=5,1==(e=this.cmp(t,e))||0===e},c.isFinite=c.isF=function(){return!!this.c},c.isNaN=function(){return!this.s},c.isNegative=c.isNeg=function(){return this.s<0},c.isZero=c.isZ=function(){return!!this.c&&0==this.c[0]},c.lessThan=c.lt=function(t,e){return d=6,this.cmp(t,e)<0},c.lessThanOrEqualTo=c.lte=c.le=function(t,e){return d=7,-1==(e=this.cmp(t,e))||0===e},c.minus=c.sub=function(t,e){var r,n,o,a,u=this,f=u.s;if(e=(d=8,t=new g(t,e)).s,!f||!e)return new g(NaN);if(f!=e)return t.s=-e,u.plus(t);var h=u.c,c=u.e,l=t.c,p=t.e;if(!c||!p){if(!h||!l)return h?(t.s=-e,t):new g(l?u:NaN);if(!h[0]||!l[0])return l[0]?(t.s=-e,t):new g(h[0]?u:3==i?-0:0)}if(h=h.slice(),f=c-p){for((r=(a=f<0)?(f=-f,h):(p=c,l)).reverse(),e=f;e--;r.push(0));r.reverse()}else for(o=((a=h.length0)for(;e--;h[o++]=0);for(e=l.length;e>f;){if(h[--e]0?(s=o,f):(i=-i,a)).reverse();i--;r.push(0));r.reverse()}for(a.length-f.length<0&&(r=f,f=a,a=r),i=f.length,e=0;i;e=(a[--i]=a[i]+f[i]+e)/10^0,a[i]%=10);for(e&&(a.unshift(e),++s>u&&(a=s=null)),i=a.length;0==a[--i];a.pop());return t.c=a,t.e=s,t},c.toPower=c.pow=function(t){var e=0*t==0?0|t:t,n=new g(this),i=new g(v);if(((r=t<-1e6||t>1e6)&&(e=1*t/0)||h(t)!=t&&0!==t&&!(e=NaN))&&!b(t,"exponent","pow")||!e)return new g(Math.pow(n.toS(),e));for(e=e<0?-e:e;1&e&&(i=i.times(n)),e>>=1;)n=n.times(n);return t<0?v.div(i):i},c.powm=function(t,e){return this.pow(t).mod(e)},c.round=function(t,e){return x(this,t=null==t||((r=t<0||t>1e9)||h(t)!=t)&&!b(t,"decimal places","round")?0:0|t,e=null==e||((r=e<0||e>8)||h(e)!=e&&0!==e)&&!b(e,"mode","round")?i:0|e)},c.squareRoot=c.sqrt=function(){var t,e,r,o,a=this,s=a.c,u=a.s,f=a.e,h=n,c=i,l=new g("0.5");if(1!==u||!s||!s[0])return new g(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);for(u=Math.sqrt(a.toS()),i=1,0==u||u==1/0?((t=s.join("")).length+f&1||(t+="0"),(e=new g(Math.sqrt(t)+"")).c||(e.c=[1]),e.e=((f+1)/2|0)-(f<0||1&f)):e=new g(t=u.toString()),(u=(r=e.e)+(n+=4))<3&&(u=0),f=u;;)if(o=e,e=l.times(o.plus(a.div(o))),o.c.slice(0,u).join("")===e.c.slice(0,u).join("")){if(9!=(s=e.c)[u-=t&&e.ef-2&&(s.length=f-2),e.times(e).eq(a)))){for(;s.length-1;a--){for(e=0,f=h+a;f>a;e=r[f]+o[a]*i[f-a-1]+e,r[f--]=e%10|0,e=e/10|0);e&&(r[f]=(r[f]+e)%10)}for(e&&++t.e,!r[0]&&r.shift(),f=r.length;!r[--f];r.pop());return t.c=t.e>u?t.e=null:t.e0&&h.copy(i,4+(128&h[0]?1:0)),128&h[0]&&(i[4]=0),i[0]=n&255<<24,i[1]=n&255<<16,i[2]=65280&n,i[3]=255&n;var o=this.lt(0);if(o)for(var a=4;a0}).forEach(function(t,e){for(var r=0;r1e9)||h(t)!=t&&0!==t)&&!b(t,"decimal places","toE"))&&this.c?this.c.length-1:0|t,1)},c.toFixed=c.toF=function(t){var e,n,i,s=this;return null==t||((r=t<0||t>1e9)||h(t)!=t&&0!==t)&&!b(t,"decimal places","toF")||(i=s.e+(0|t)),e=o,t=a,o=-(a=1/0),i==n?n=s.toS():(n=_(s,i),s.s<0&&s.c&&(s.c[0]?n.indexOf("-")<0&&(n="-"+n):n=n.replace(/^-/,""))),o=e,a=t,n},c.toFraction=c.toFr=function(t){var e,o,a,s,h,c,l,p=s=new g(v),y=a=new g("0"),w=this,m=w.c,_=u,A=n,x=i,E=new g(v);if(!m)return w.toS();for(l=E.e=m.length-w.e-1,(null==t||(!(d=12,c=new g(t)).s||(r=c.cmp(p)<0||!c.c)||f&&c.e0)&&(t=l>0?E:p),u=1/0,c=new g(m.join("")),n=0,i=1;e=c.div(E),1!=(h=s.plus(e.times(y))).cmp(t);)s=y,y=h,p=a.plus(e.times(h=p)),a=h,E=c.minus(e.times(h=E)),c=h;return h=t.minus(s).div(y),a=a.plus(h.times(p)),s=s.plus(h.times(y)),a.s=p.s=w.s,n=2*l,i=x,o=p.div(y).minus(w).abs().cmp(a.div(s).minus(w).abs())<1?[p.toS(),y.toS()]:[a.toS(),s.toS()],u=_,n=A,o},c.toPrecision=c.toP=function(t){return null==t||((r=t<1||t>1e9)||h(t)!=t)&&!b(t,"precision","toP")?this.toS():_(this,0|--t,2)},c.toString=c.toS=function(t){var e,n,i,s=this,u=s.e;if(null===u)n=s.s?"Infinity":"NaN";else{if(t===e&&(u<=o||u>=a))return _(s,s.c.length-1,1);if(n=s.c.join(""),u<0){for(;++u;n="0"+n);n="0."+n}else if(i=n.length,u>0)if(++u>i)for(u-=i;u--;n+="0");else u1)n=e+"."+n.slice(1);else if("0"==e)return e;if(null!=t)if((r=!(t>=2&&t<65))||t!=(0|t)&&f)b(t,"base","toS");else if("0"==(n=w(n,0|t,10,s.s)))return n}return s.s<0?"-"+n:n},c.valueOf=function(){return this.toS()},e.exports=g}).call(this)}).call(this,t("buffer").Buffer)},{buffer:4}],4:[function(t,e,r){"use strict";var n=t("base64-js"),i=t("ieee754");r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(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 h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|d(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 c(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(z(t,ArrayBuffer)||t&&z(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||z(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(i)return n?-1:M(t).length;e=(""+e).toLowerCase(),i=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),P(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=s.from(e,n)),s.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;a=2,s/=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;os&&(r=s-u),o=r;o>=0;o--){for(var c=!0,l=0;li&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&f)<<6|63&o)>127&&(h=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&f)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(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)&&(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(h=u)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.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 C(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return B(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.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+=" ... "),""},s.prototype.compare=function(t,e,r,n,i){if(z(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,u=Math.min(o,a),f=this.slice(n,i),h=t.slice(e,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return m(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function B(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function O(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 I(t,e,r,n,o){return e=+e,r>>>=0,o||O(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function R(t,e,r,n,o){return e=+e,r>>>=0,o||O(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(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},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(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},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function N(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function z(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function P(t){return t!=t}},{"base64-js":2,ieee754:31}],5:[function(t,e,r){!function(t,r){"use strict";var n=Math.pow(2,-24),i=Math.pow(2,32),o=Math.pow(2,53);var a={encode:function(t){var e,n=new ArrayBuffer(256),a=new DataView(n),s=0;function u(t){for(var r=n.byteLength,i=s+t;r>2,f=0;f>6),i.push(128|63&a)):a<55296?(i.push(224|a>>12),i.push(128|a>>6&63),i.push(128|63&a)):(a=(1023&a)<<10,a|=1023&e.charCodeAt(++n),a+=65536,i.push(240|a>>18),i.push(128|a>>12&63),i.push(128|a>>6&63),i.push(128|63&a))}return l(3,i.length),c(i);default:var d;if(Array.isArray(e))for(l(4,d=e.length),n=0;n>5!==t)throw"Invalid indefinite length element";return r}function v(t,e){for(var r=0;r>10),t.push(56320|1023&n))}}"function"!=typeof e&&(e=function(t){return t}),"function"!=typeof o&&(o=function(){return r});var g=function t(){var i,l,g=h(),b=g>>5,w=31&g;if(7===b)switch(w){case 25:return function(){var t=new ArrayBuffer(4),e=new DataView(t),r=c(),i=32768&r,o=31744&r,a=1023&r;if(31744===o)o=261120;else if(0!==o)o+=114688;else if(0!==a)return a*n;return e.setUint32(0,i<<16|o<<13|a<<13),e.getFloat32(0)}();case 26:return u(a.getFloat32(s),4);case 27:return u(a.getFloat64(s),8)}if((l=p(w))<0&&(b<2||6=0;)_+=l,m.push(f(l));var A=new Uint8Array(_),x=0;for(i=0;i=0;)v(E,l);else v(E,l);return String.fromCharCode.apply(null,E);case 4:var k;if(l<0)for(k=[];!d();)k.push(t());else for(k=new Array(l),i=0;i>8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],19:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("ccitt",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=void 0!==e?~~e:65535,o=0;o>8^a)]^r<<8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],20:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[0,4489,8978,12955,17956,22445,25910,29887,35912,40385,44890,48851,51820,56293,59774,63735,4225,264,13203,8730,22181,18220,30135,25662,40137,36160,49115,44626,56045,52068,63999,59510,8450,12427,528,5017,26406,30383,17460,21949,44362,48323,36440,40913,60270,64231,51324,55797,12675,8202,4753,792,30631,26158,21685,17724,48587,44098,40665,36688,64495,60006,55549,51572,16900,21389,24854,28831,1056,5545,10034,14011,52812,57285,60766,64727,34920,39393,43898,47859,21125,17164,29079,24606,5281,1320,14259,9786,57037,53060,64991,60502,39145,35168,48123,43634,25350,29327,16404,20893,9506,13483,1584,6073,61262,65223,52316,56789,43370,47331,35448,39921,29575,25102,20629,16668,13731,9258,5809,1848,65487,60998,56541,52564,47595,43106,39673,35696,33800,38273,42778,46739,49708,54181,57662,61623,2112,6601,11090,15067,20068,24557,28022,31999,38025,34048,47003,42514,53933,49956,61887,57398,6337,2376,15315,10842,24293,20332,32247,27774,42250,46211,34328,38801,58158,62119,49212,53685,10562,14539,2640,7129,28518,32495,19572,24061,46475,41986,38553,34576,62383,57894,53437,49460,14787,10314,6865,2904,32743,28270,23797,19836,50700,55173,58654,62615,32808,37281,41786,45747,19012,23501,26966,30943,3168,7657,12146,16123,54925,50948,62879,58390,37033,33056,46011,41522,23237,19276,31191,26718,7393,3432,16371,11898,59150,63111,50204,54677,41258,45219,33336,37809,27462,31439,18516,23005,11618,15595,3696,8185,63375,58886,54429,50452,45483,40994,37561,33584,31687,27214,22741,18780,15843,11370,7921,3960];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("kermit",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=void 0!==e?~~e:0,o=0;o>8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],21:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("crc-16-modbus",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=void 0!==e?~~e:65535,o=0;o>8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],22:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=o(t("./create_buffer"));function o(t){return t&&t.__esModule?t:{default:t}}var a=(0,o(t("./define_crc")).default)("xmodem",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=void 0!==e?~~e:0,o=0;o>>8&255;a^=255&t[o],r=r<<8&65535,r^=a^=a>>>4,r^=a=a<<5&65535,r^=a=a<<7&65535}return r});r.default=a},{"./create_buffer":28,"./define_crc":29,buffer:4}],23:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[0,8801531,9098509,825846,9692897,1419802,1651692,10452759,10584377,2608578,2839604,11344079,3303384,11807523,12104405,4128302,12930697,4391538,5217156,13227903,5679208,13690003,14450021,5910942,6606768,14844747,15604413,6837830,16197969,7431594,8256604,16494759,840169,9084178,8783076,18463,10434312,1670131,1434117,9678590,11358416,2825259,2590173,10602790,4109873,12122826,11821884,3289031,13213536,5231515,4409965,12912278,5929345,14431610,13675660,5693559,6823513,15618722,14863188,6588335,16513208,8238147,7417269,16212302,1680338,10481449,9664223,1391140,9061683,788936,36926,8838341,12067563,4091408,3340262,11844381,2868234,11372785,10555655,2579964,14478683,5939616,5650518,13661357,5180346,13190977,12967607,4428364,8219746,16457881,16234863,7468436,15633027,6866552,6578062,14816117,1405499,9649856,10463030,1698765,8819930,55329,803287,9047340,11858690,3325945,4072975,12086004,2561507,10574104,11387118,2853909,13647026,5664841,5958079,14460228,4446803,12949160,13176670,5194661,7454091,16249200,16476294,8201341,14834538,6559633,6852199,15647388,3360676,11864927,12161705,4185682,10527045,2551230,2782280,11286707,9619101,1346150,1577872,10379115,73852,8875143,9172337,899466,16124205,7357910,8182816,16421083,6680524,14918455,15678145,6911546,5736468,13747439,14507289,5968354,12873461,4334094,5159928,13170435,4167245,12180150,11879232,3346363,11301036,2767959,2532769,10545498,10360692,1596303,1360505,9604738,913813,9157998,8856728,92259,16439492,8164415,7343561,16138546,6897189,15692510,14936872,6662099,5986813,14488838,13733104,5750795,13156124,5174247,4352529,12855018,2810998,11315341,10498427,2522496,12124823,4148844,3397530,11901793,9135439,862644,110658,8912057,1606574,10407765,9590435,1317464,15706879,6940164,6651890,14889737,8145950,16384229,16161043,7394792,5123014,13133629,12910283,4370992,14535975,5997020,5707818,13718737,2504095,10516836,11329682,2796649,11916158,3383173,4130419,12143240,8893606,129117,876971,9121104,1331783,9576124,10389322,1625009,14908182,6633453,6925851,15721184,7380471,16175372,16402682,8127489,4389423,12891860,13119266,5137369,13704398,5722165,6015427,14517560];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("crc-24",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=void 0!==e?~~e:11994318,o=0;o>16^a)]^r<<8)}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],24:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("crc-32",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=0===e?0:-1^~~e,o=0;o>>8}return-1^r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],25:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=a(t("./create_buffer")),o=a(t("./define_crc"));function a(t){return t&&t.__esModule?t:{default:t}}var s=[0,7,14,9,28,27,18,21,56,63,54,49,36,35,42,45,112,119,126,121,108,107,98,101,72,79,70,65,84,83,90,93,224,231,238,233,252,251,242,245,216,223,214,209,196,195,202,205,144,151,158,153,140,139,130,133,168,175,166,161,180,179,186,189,199,192,201,206,219,220,213,210,255,248,241,246,227,228,237,234,183,176,185,190,171,172,165,162,143,136,129,134,147,148,157,154,39,32,41,46,59,60,53,50,31,24,17,22,3,4,13,10,87,80,89,94,75,76,69,66,111,104,97,102,115,116,125,122,137,142,135,128,149,146,155,156,177,182,191,184,173,170,163,164,249,254,247,240,229,226,235,236,193,198,207,200,221,218,211,212,105,110,103,96,117,114,123,124,81,86,95,88,77,74,67,68,25,30,23,16,5,2,11,12,33,38,47,40,61,58,51,52,78,73,64,71,82,85,92,91,118,113,120,127,106,109,100,99,62,57,48,55,34,37,44,43,6,1,8,15,26,29,20,19,174,169,160,167,178,181,188,187,150,145,152,159,138,141,132,131,222,217,208,215,194,197,204,203,230,225,232,239,250,253,244,243];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=(0,o.default)("crc-8",function(t,e){n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=~~e,o=0;o1&&void 0!==arguments[1]?arguments[1]:-1;n.Buffer.isBuffer(t)||(t=(0,i.default)(t));for(var r=0===e?0:~~e,o=0;o>>8}return r});r.default=u},{"./create_buffer":28,"./define_crc":29,buffer:4}],28:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("buffer"),i=n.Buffer.from&&n.Buffer.alloc&&n.Buffer.allocUnsafe&&n.Buffer.allocUnsafeSlow?n.Buffer.from:function(t){return new n.Buffer(t)};r.default=i},{buffer:4}],29:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t,e){var r=function(t,r){return e(t,r)>>>0};return r.signed=e,r.unsigned=r,r.model=t,r}},{}],30:[function(t,e,r){"use strict";e.exports={crc1:t("./crc1"),crc8:t("./crc8"),crc81wire:t("./crc8_1wire"),crc16:t("./crc16"),crc16ccitt:t("./crc16_ccitt"),crc16modbus:t("./crc16_modbus"),crc16xmodem:t("./crc16_xmodem"),crc16kermit:t("./crc16_kermit"),crc24:t("./crc24"),crc32:t("./crc32"),crcjam:t("./crcjam")}},{"./crc1":6,"./crc16":7,"./crc16_ccitt":8,"./crc16_kermit":9,"./crc16_modbus":10,"./crc16_xmodem":11,"./crc24":12,"./crc32":13,"./crc8":14,"./crc8_1wire":15,"./crcjam":16}],31:[function(t,e,r){r.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,h=-7,c=r?i-1:0,l=r?-1:1,d=t[e+c];for(c+=l,o=d&(1<<-h)-1,d>>=-h,h+=s;h>0;o=256*o+t[e+c],c+=l,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[e+c],c+=l,h-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=f}return(d?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,f=8*o-i-1,h=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=h?(s=0,a=h):a+c>=1?(s=(e*u-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;t[r+d]=255&a,d+=p,a/=256,f-=8);t[r+d-p]|=128*y}},{}],32:[function(t,e,r){(function(t,r){(function(){!function(){"use strict";var n="input is invalid type",i="object"==typeof window,o=i?window:{};o.JS_SHA512_NO_WINDOW&&(i=!1);var a=!i&&"object"==typeof self;!o.JS_SHA512_NO_NODE_JS&&"object"==typeof t&&t.versions&&t.versions.node?o=r:a&&(o=self);var s=!o.JS_SHA512_NO_COMMON_JS&&"object"==typeof e&&e.exports,u=!o.JS_SHA512_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,f="0123456789abcdef".split(""),h=[-2147483648,8388608,32768,128],c=[24,16,8,0],l=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],d=["hex","array","digest","arrayBuffer"],p=[];!o.JS_SHA512_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!u||!o.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var y=function(t,e){return function(r){return new w(e,!0).update(r)[t]()}},v=function(t){var e=y("hex",t);e.create=function(){return new w(t)},e.update=function(t){return e.create().update(t)};for(var r=0;r>6,f[h++]=128|63&s):s<55296||s>=57344?(f[h++]=224|s>>12,f[h++]=128|s>>6&63,f[h++]=128|63&s):(s=65536+((1023&s)<<10|1023&t.charCodeAt(++c)),f[h++]=240|s>>18,f[h++]=128|s>>12&63,f[h++]=128|s>>6&63,f[h++]=128|63&s);t=f}t.length>128&&(t=new w(e,!0).update(t).array());var l=[],d=[];for(c=0;c<128;++c){var p=t[c]||0;l[c]=92^p,d[c]=54^p}w.call(this,e,r),this.update(d),this.oKeyPad=l,this.inner=!0,this.sharedMemory=r}w.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(n);if(null===t)throw new Error(n);if(u&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||u&&ArrayBuffer.isView(t)))throw new Error(n);e=!0}for(var i,o,a=0,s=t.length,f=this.blocks;a>2]|=t[a]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(f[o>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=128?(this.block=f[32],this.start=o-128,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[32]=this.block,t[e>>2]|=h[3&e],this.block=t[32],e>=112&&(this.hashed||this.hash(),t[0]=this.block,t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=t[16]=t[17]=t[18]=t[19]=t[20]=t[21]=t[22]=t[23]=t[24]=t[25]=t[26]=t[27]=t[28]=t[29]=t[30]=t[31]=t[32]=0),t[30]=this.hBytes<<3|this.bytes>>>29,t[31]=this.bytes<<3,this.hash()}},w.prototype.hash=function(){var t,e,r,n,i,o,a,s,u,f,h,c,d,p,y,v,g,b,w,m,_,A,x,E,k,B=this.h0h,S=this.h0l,C=this.h1h,U=this.h1l,T=this.h2h,L=this.h2l,O=this.h3h,I=this.h3l,R=this.h4h,j=this.h4l,H=this.h5h,M=this.h5l,N=this.h6h,F=this.h6l,z=this.h7h,P=this.h7l,V=this.blocks;for(t=32;t<160;t+=2)e=((m=V[t-30])>>>1|(_=V[t-29])<<31)^(m>>>8|_<<24)^m>>>7,r=(_>>>1|m<<31)^(_>>>8|m<<24)^(_>>>7|m<<25),n=((m=V[t-4])>>>19|(_=V[t-3])<<13)^(_>>>29|m<<3)^m>>>6,i=(_>>>19|m<<13)^(m>>>29|_<<3)^(_>>>6|m<<26),m=V[t-32],_=V[t-31],u=((A=V[t-14])>>>16)+(m>>>16)+(e>>>16)+(n>>>16)+((s=(65535&A)+(65535&m)+(65535&e)+(65535&n)+((a=((x=V[t-13])>>>16)+(_>>>16)+(r>>>16)+(i>>>16)+((o=(65535&x)+(65535&_)+(65535&r)+(65535&i))>>>16))>>>16))>>>16),V[t]=u<<16|65535&s,V[t+1]=a<<16|65535&o;var D=B,$=S,q=C,Y=U,X=T,J=L,W=O,Z=I,G=R,K=j,Q=H,tt=M,et=N,rt=F,nt=z,it=P;for(v=q&X,g=Y&J,t=0;t<160;t+=8)e=(D>>>28|$<<4)^($>>>2|D<<30)^($>>>7|D<<25),r=($>>>28|D<<4)^(D>>>2|$<<30)^(D>>>7|$<<25),n=(G>>>14|K<<18)^(G>>>18|K<<14)^(K>>>9|G<<23),i=(K>>>14|G<<18)^(K>>>18|G<<14)^(G>>>9|K<<23),b=(f=D&q)^D&X^v,w=(h=$&Y)^$&J^g,E=G&Q^~G&et,k=K&tt^~K&rt,m=V[t],_=V[t+1],m=(u=((A=l[t])>>>16)+(m>>>16)+(E>>>16)+(n>>>16)+(nt>>>16)+((s=(65535&A)+(65535&m)+(65535&E)+(65535&n)+(65535&nt)+((a=((x=l[t+1])>>>16)+(_>>>16)+(k>>>16)+(i>>>16)+(it>>>16)+((o=(65535&x)+(65535&_)+(65535&k)+(65535&i)+(65535&it))>>>16))>>>16))>>>16))<<16|65535&s,_=a<<16|65535&o,A=(u=(b>>>16)+(e>>>16)+((s=(65535&b)+(65535&e)+((a=(w>>>16)+(r>>>16)+((o=(65535&w)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&s,x=a<<16|65535&o,nt=(u=(W>>>16)+(m>>>16)+((s=(65535&W)+(65535&m)+((a=(Z>>>16)+(_>>>16)+((o=(65535&Z)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s,it=a<<16|65535&o,e=((W=(u=(A>>>16)+(m>>>16)+((s=(65535&A)+(65535&m)+((a=(x>>>16)+(_>>>16)+((o=(65535&x)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(Z=a<<16|65535&o)<<4)^(Z>>>2|W<<30)^(Z>>>7|W<<25),r=(Z>>>28|W<<4)^(W>>>2|Z<<30)^(W>>>7|Z<<25),n=(nt>>>14|it<<18)^(nt>>>18|it<<14)^(it>>>9|nt<<23),i=(it>>>14|nt<<18)^(it>>>18|nt<<14)^(nt>>>9|it<<23),b=(c=W&D)^W&q^f,w=(d=Z&$)^Z&Y^h,E=nt&G^~nt&Q,k=it&K^~it&tt,m=V[t+2],_=V[t+3],m=(u=((A=l[t+2])>>>16)+(m>>>16)+(E>>>16)+(n>>>16)+(et>>>16)+((s=(65535&A)+(65535&m)+(65535&E)+(65535&n)+(65535&et)+((a=((x=l[t+3])>>>16)+(_>>>16)+(k>>>16)+(i>>>16)+(rt>>>16)+((o=(65535&x)+(65535&_)+(65535&k)+(65535&i)+(65535&rt))>>>16))>>>16))>>>16))<<16|65535&s,_=a<<16|65535&o,A=(u=(b>>>16)+(e>>>16)+((s=(65535&b)+(65535&e)+((a=(w>>>16)+(r>>>16)+((o=(65535&w)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&s,x=a<<16|65535&o,et=(u=(X>>>16)+(m>>>16)+((s=(65535&X)+(65535&m)+((a=(J>>>16)+(_>>>16)+((o=(65535&J)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s,rt=a<<16|65535&o,e=((X=(u=(A>>>16)+(m>>>16)+((s=(65535&A)+(65535&m)+((a=(x>>>16)+(_>>>16)+((o=(65535&x)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(J=a<<16|65535&o)<<4)^(J>>>2|X<<30)^(J>>>7|X<<25),r=(J>>>28|X<<4)^(X>>>2|J<<30)^(X>>>7|J<<25),n=(et>>>14|rt<<18)^(et>>>18|rt<<14)^(rt>>>9|et<<23),i=(rt>>>14|et<<18)^(rt>>>18|et<<14)^(et>>>9|rt<<23),b=(p=X&W)^X&D^c,w=(y=J&Z)^J&$^d,E=et&nt^~et&G,k=rt&it^~rt&K,m=V[t+4],_=V[t+5],m=(u=((A=l[t+4])>>>16)+(m>>>16)+(E>>>16)+(n>>>16)+(Q>>>16)+((s=(65535&A)+(65535&m)+(65535&E)+(65535&n)+(65535&Q)+((a=((x=l[t+5])>>>16)+(_>>>16)+(k>>>16)+(i>>>16)+(tt>>>16)+((o=(65535&x)+(65535&_)+(65535&k)+(65535&i)+(65535&tt))>>>16))>>>16))>>>16))<<16|65535&s,_=a<<16|65535&o,A=(u=(b>>>16)+(e>>>16)+((s=(65535&b)+(65535&e)+((a=(w>>>16)+(r>>>16)+((o=(65535&w)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&s,x=a<<16|65535&o,Q=(u=(q>>>16)+(m>>>16)+((s=(65535&q)+(65535&m)+((a=(Y>>>16)+(_>>>16)+((o=(65535&Y)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s,tt=a<<16|65535&o,e=((q=(u=(A>>>16)+(m>>>16)+((s=(65535&A)+(65535&m)+((a=(x>>>16)+(_>>>16)+((o=(65535&x)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(Y=a<<16|65535&o)<<4)^(Y>>>2|q<<30)^(Y>>>7|q<<25),r=(Y>>>28|q<<4)^(q>>>2|Y<<30)^(q>>>7|Y<<25),n=(Q>>>14|tt<<18)^(Q>>>18|tt<<14)^(tt>>>9|Q<<23),i=(tt>>>14|Q<<18)^(tt>>>18|Q<<14)^(Q>>>9|tt<<23),b=(v=q&X)^q&W^p,w=(g=Y&J)^Y&Z^y,E=Q&et^~Q&nt,k=tt&rt^~tt&it,m=V[t+6],_=V[t+7],m=(u=((A=l[t+6])>>>16)+(m>>>16)+(E>>>16)+(n>>>16)+(G>>>16)+((s=(65535&A)+(65535&m)+(65535&E)+(65535&n)+(65535&G)+((a=((x=l[t+7])>>>16)+(_>>>16)+(k>>>16)+(i>>>16)+(K>>>16)+((o=(65535&x)+(65535&_)+(65535&k)+(65535&i)+(65535&K))>>>16))>>>16))>>>16))<<16|65535&s,_=a<<16|65535&o,A=(u=(b>>>16)+(e>>>16)+((s=(65535&b)+(65535&e)+((a=(w>>>16)+(r>>>16)+((o=(65535&w)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&s,x=a<<16|65535&o,G=(u=(D>>>16)+(m>>>16)+((s=(65535&D)+(65535&m)+((a=($>>>16)+(_>>>16)+((o=(65535&$)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s,K=a<<16|65535&o,D=(u=(A>>>16)+(m>>>16)+((s=(65535&A)+(65535&m)+((a=(x>>>16)+(_>>>16)+((o=(65535&x)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&s,$=a<<16|65535&o;u=(B>>>16)+(D>>>16)+((s=(65535&B)+(65535&D)+((a=(S>>>16)+($>>>16)+((o=(65535&S)+(65535&$))>>>16))>>>16))>>>16),this.h0h=u<<16|65535&s,this.h0l=a<<16|65535&o,u=(C>>>16)+(q>>>16)+((s=(65535&C)+(65535&q)+((a=(U>>>16)+(Y>>>16)+((o=(65535&U)+(65535&Y))>>>16))>>>16))>>>16),this.h1h=u<<16|65535&s,this.h1l=a<<16|65535&o,u=(T>>>16)+(X>>>16)+((s=(65535&T)+(65535&X)+((a=(L>>>16)+(J>>>16)+((o=(65535&L)+(65535&J))>>>16))>>>16))>>>16),this.h2h=u<<16|65535&s,this.h2l=a<<16|65535&o,u=(O>>>16)+(W>>>16)+((s=(65535&O)+(65535&W)+((a=(I>>>16)+(Z>>>16)+((o=(65535&I)+(65535&Z))>>>16))>>>16))>>>16),this.h3h=u<<16|65535&s,this.h3l=a<<16|65535&o,u=(R>>>16)+(G>>>16)+((s=(65535&R)+(65535&G)+((a=(j>>>16)+(K>>>16)+((o=(65535&j)+(65535&K))>>>16))>>>16))>>>16),this.h4h=u<<16|65535&s,this.h4l=a<<16|65535&o,u=(H>>>16)+(Q>>>16)+((s=(65535&H)+(65535&Q)+((a=(M>>>16)+(tt>>>16)+((o=(65535&M)+(65535&tt))>>>16))>>>16))>>>16),this.h5h=u<<16|65535&s,this.h5l=a<<16|65535&o,u=(N>>>16)+(et>>>16)+((s=(65535&N)+(65535&et)+((a=(F>>>16)+(rt>>>16)+((o=(65535&F)+(65535&rt))>>>16))>>>16))>>>16),this.h6h=u<<16|65535&s,this.h6l=a<<16|65535&o,u=(z>>>16)+(nt>>>16)+((s=(65535&z)+(65535&nt)+((a=(P>>>16)+(it>>>16)+((o=(65535&P)+(65535&it))>>>16))>>>16))>>>16),this.h7h=u<<16|65535&s,this.h7l=a<<16|65535&o},w.prototype.hex=function(){this.finalize();var t=this.h0h,e=this.h0l,r=this.h1h,n=this.h1l,i=this.h2h,o=this.h2l,a=this.h3h,s=this.h3l,u=this.h4h,h=this.h4l,c=this.h5h,l=this.h5l,d=this.h6h,p=this.h6l,y=this.h7h,v=this.h7l,g=this.bits,b=f[t>>28&15]+f[t>>24&15]+f[t>>20&15]+f[t>>16&15]+f[t>>12&15]+f[t>>8&15]+f[t>>4&15]+f[15&t]+f[e>>28&15]+f[e>>24&15]+f[e>>20&15]+f[e>>16&15]+f[e>>12&15]+f[e>>8&15]+f[e>>4&15]+f[15&e]+f[r>>28&15]+f[r>>24&15]+f[r>>20&15]+f[r>>16&15]+f[r>>12&15]+f[r>>8&15]+f[r>>4&15]+f[15&r]+f[n>>28&15]+f[n>>24&15]+f[n>>20&15]+f[n>>16&15]+f[n>>12&15]+f[n>>8&15]+f[n>>4&15]+f[15&n]+f[i>>28&15]+f[i>>24&15]+f[i>>20&15]+f[i>>16&15]+f[i>>12&15]+f[i>>8&15]+f[i>>4&15]+f[15&i]+f[o>>28&15]+f[o>>24&15]+f[o>>20&15]+f[o>>16&15]+f[o>>12&15]+f[o>>8&15]+f[o>>4&15]+f[15&o]+f[a>>28&15]+f[a>>24&15]+f[a>>20&15]+f[a>>16&15]+f[a>>12&15]+f[a>>8&15]+f[a>>4&15]+f[15&a];return g>=256&&(b+=f[s>>28&15]+f[s>>24&15]+f[s>>20&15]+f[s>>16&15]+f[s>>12&15]+f[s>>8&15]+f[s>>4&15]+f[15&s]),g>=384&&(b+=f[u>>28&15]+f[u>>24&15]+f[u>>20&15]+f[u>>16&15]+f[u>>12&15]+f[u>>8&15]+f[u>>4&15]+f[15&u]+f[h>>28&15]+f[h>>24&15]+f[h>>20&15]+f[h>>16&15]+f[h>>12&15]+f[h>>8&15]+f[h>>4&15]+f[15&h]+f[c>>28&15]+f[c>>24&15]+f[c>>20&15]+f[c>>16&15]+f[c>>12&15]+f[c>>8&15]+f[c>>4&15]+f[15&c]+f[l>>28&15]+f[l>>24&15]+f[l>>20&15]+f[l>>16&15]+f[l>>12&15]+f[l>>8&15]+f[l>>4&15]+f[15&l]),512==g&&(b+=f[d>>28&15]+f[d>>24&15]+f[d>>20&15]+f[d>>16&15]+f[d>>12&15]+f[d>>8&15]+f[d>>4&15]+f[15&d]+f[p>>28&15]+f[p>>24&15]+f[p>>20&15]+f[p>>16&15]+f[p>>12&15]+f[p>>8&15]+f[p>>4&15]+f[15&p]+f[y>>28&15]+f[y>>24&15]+f[y>>20&15]+f[y>>16&15]+f[y>>12&15]+f[y>>8&15]+f[y>>4&15]+f[15&y]+f[v>>28&15]+f[v>>24&15]+f[v>>20&15]+f[v>>16&15]+f[v>>12&15]+f[v>>8&15]+f[v>>4&15]+f[15&v]),b},w.prototype.toString=w.prototype.hex,w.prototype.digest=function(){this.finalize();var t=this.h0h,e=this.h0l,r=this.h1h,n=this.h1l,i=this.h2h,o=this.h2l,a=this.h3h,s=this.h3l,u=this.h4h,f=this.h4l,h=this.h5h,c=this.h5l,l=this.h6h,d=this.h6l,p=this.h7h,y=this.h7l,v=this.bits,g=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,a>>24&255,a>>16&255,a>>8&255,255&a];return v>=256&&g.push(s>>24&255,s>>16&255,s>>8&255,255&s),v>=384&&g.push(u>>24&255,u>>16&255,u>>8&255,255&u,f>>24&255,f>>16&255,f>>8&255,255&f,h>>24&255,h>>16&255,h>>8&255,255&h,c>>24&255,c>>16&255,c>>8&255,255&c),512==v&&g.push(l>>24&255,l>>16&255,l>>8&255,255&l,d>>24&255,d>>16&255,d>>8&255,255&d,p>>24&255,p>>16&255,p>>8&255,255&p,y>>24&255,y>>16&255,y>>8&255,255&y),g},w.prototype.array=w.prototype.digest,w.prototype.arrayBuffer=function(){this.finalize();var t=this.bits,e=new ArrayBuffer(t/8),r=new DataView(e);return r.setUint32(0,this.h0h),r.setUint32(4,this.h0l),r.setUint32(8,this.h1h),r.setUint32(12,this.h1l),r.setUint32(16,this.h2h),r.setUint32(20,this.h2l),r.setUint32(24,this.h3h),t>=256&&r.setUint32(28,this.h3l),t>=384&&(r.setUint32(32,this.h4h),r.setUint32(36,this.h4l),r.setUint32(40,this.h5h),r.setUint32(44,this.h5l)),512==t&&(r.setUint32(48,this.h6h),r.setUint32(52,this.h6l),r.setUint32(56,this.h7h),r.setUint32(60,this.h7l)),e},w.prototype.clone=function(){var t=new w(this.bits,!1);return this.copyTo(t),t},w.prototype.copyTo=function(t){var e=0,r=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(e=0;eb)throw Error("numRounds must a integer >= 1");if("SHA-1"===t)p=512,y=N,v=F,d=160,g=function(t){return t.slice()};else if(0===t.lastIndexOf("SHA-",0))if(y=function(e,r){return z(e,r,t)},v=function(e,r,n,i){var o,a;if("SHA-224"===t||"SHA-256"===t)o=15+(r+65>>>9<<4),a=16;else{if("SHA-384"!==t&&"SHA-512"!==t)throw Error("Unexpected error in SHA-2 implementation");o=31+(r+129>>>10<<5),a=32}for(;e.length<=o;)e.push(0);for(e[r>>>5]|=128<<24-r%32,r+=n,e[o]=4294967295&r,e[o-1]=r/4294967296|0,n=e.length,r=0;re;e+=1)r[e]=t[e].slice();return r},S=1,"SHA3-224"===t)p=1152,d=224;else if("SHA3-256"===t)p=1088,d=256;else if("SHA3-384"===t)p=832,d=384;else if("SHA3-512"===t)p=576,d=512;else if("SHAKE128"===t)p=1344,d=-1,C=31,B=!0;else{if("SHAKE256"!==t)throw Error("Chosen SHA variant is not supported");p=1088,d=-1,C=31,B=!0}v=function(t,e,r,n,i){var o,a=C,s=[],u=(r=p)>>>5,f=0,h=e>>>5;for(o=0;o=r;o+=u)n=P(t.slice(o,o+u),n),e-=r;for(t=t.slice(o),e%=r;t.length>>3)>>2]^=a<=i));)s.push(t.a),0==64*(f+=1)%r&&(P(null,n),f=0);return s}}o=l(e,n,S),i=M(t),this.setHMACKey=function(e,r,o){var a;if(!0===A)throw Error("HMAC key already set");if(!0===k)throw Error("Cannot set HMAC key after calling update");if(!0===B)throw Error("SHAKE is not supported for HMAC");for(e=(r=l(r,n=(o||{}).encoding||"UTF8",S)(e)).binLen,r=r.value,o=(a=p>>>3)/4-1,a>>5;for(t=(e=o(t,m,_)).binLen,r=e.value,e=t>>>5,n=0;n>>5),_=t%p,k=!0},this.getHash=function(e,r){var n,o,l,p;if(!0===A)throw Error("Cannot call getHash after setting HMAC key");if(l=c(r),!0===B){if(-1===l.shakeLen)throw Error("shakeLen must be specified in options");d=l.shakeLen}switch(e){case"HEX":n=function(t){return a(t,d,S,l)};break;case"B64":n=function(t){return s(t,d,S,l)};break;case"BYTES":n=function(t){return u(t,d,S)};break;case"ARRAYBUFFER":try{o=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}n=function(t){return f(t,d,S)};break;case"UINT8ARRAY":try{o=new Uint8Array(0)}catch(t){throw Error("UINT8ARRAY not supported by this environment")}n=function(t){return h(t,d,S)};break;default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}for(p=v(m.slice(),_,w,g(i),d),o=1;o>>24-d%32),p=v(p,d,0,M(t),d);return n(p)},this.getHMAC=function(e,r){var n,o,l,b;if(!1===A)throw Error("Cannot call getHMAC without first setting HMAC key");switch(l=c(r),e){case"HEX":n=function(t){return a(t,d,S,l)};break;case"B64":n=function(t){return s(t,d,S,l)};break;case"BYTES":n=function(t){return u(t,d,S)};break;case"ARRAYBUFFER":try{n=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}n=function(t){return f(t,d,S)};break;case"UINT8ARRAY":try{n=new Uint8Array(0)}catch(t){throw Error("UINT8ARRAY not supported by this environment")}n=function(t){return h(t,d,S)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}return o=v(m.slice(),_,w,g(i),d),b=y(E,M(t)),n(b=v(o,d,p,b,d))}}function i(t,e){this.a=t,this.b=e}function o(t,e,r,n){var i,o,a,s,u;for(e=e||[0],o=(r=r||0)>>>3,u=-1===n?3:0,i=0;i>>2,e.length<=a&&e.push(0),e[a]|=t[i]<<8*(u+s%4*n);return{value:e,binLen:8*t.length+r}}function a(t,e,r,n){var i,o,a,s="";for(e/=8,a=-1===r?3:0,i=0;i>>2]>>>8*(a+i%4*r),s+="0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o);return n.outputUpper?s.toUpperCase():s}function s(t,e,r,n){var i,o,a,s,u="",f=e/8;for(s=-1===r?3:0,i=0;i>>2]:0,a=i+2>>2]:0,a=(t[i>>>2]>>>8*(s+i%4*r)&255)<<16|(o>>>8*(s+(i+1)%4*r)&255)<<8|a>>>8*(s+(i+2)%4*r)&255,o=0;4>o;o+=1)u+=8*i+6*o<=e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a>>>6*(3-o)&63):n.b64Pad;return u}function u(t,e,r){var n,i,o,a="";for(e/=8,o=-1===r?3:0,n=0;n>>2]>>>8*(o+n%4*r)&255,a+=String.fromCharCode(i);return a}function f(t,e,r){e/=8;var n,i,o,a=new ArrayBuffer(e);for(o=new Uint8Array(a),i=-1===r?3:0,n=0;n>>2]>>>8*(i+n%4*r)&255;return a}function h(t,e,r){e/=8;var n,i,o=new Uint8Array(e);for(i=-1===r?3:0,n=0;n>>2]>>>8*(i+n%4*r)&255;return o}function c(t){var e={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(t=t||{},e.outputUpper=t.outputUpper||!1,!0===t.hasOwnProperty("b64Pad")&&(e.b64Pad=t.b64Pad),!0===t.hasOwnProperty("shakeLen")){if(0!=t.shakeLen%8)throw Error("shakeLen must be a multiple of 8");e.shakeLen=t.shakeLen}if("boolean"!=typeof e.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof e.b64Pad)throw Error("Invalid b64Pad formatting option");return e}function l(t,e,r){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(t){case"HEX":t=function(t,e,n){var i,o,a,s,u,f,h=t.length;if(0!=h%2)throw Error("String of HEX type must be in byte increments");for(e=e||[0],u=(n=n||0)>>>3,f=-1===r?3:0,i=0;i>>1)+u)>>>2;e.length<=a;)e.push(0);e[a]|=o<<8*(f+s%4*r)}return{value:e,binLen:4*h+n}};break;case"TEXT":t=function(t,n,i){var o,a,s,u,f,h,c,l,d=0;if(n=n||[0],f=(i=i||0)>>>3,"UTF8"===e)for(l=-1===r?3:0,s=0;s(o=t.charCodeAt(s))?a.push(o):2048>o?(a.push(192|o>>>6),a.push(128|63&o)):55296>o||57344<=o?a.push(224|o>>>12,128|o>>>6&63,128|63&o):(s+=1,o=65536+((1023&o)<<10|1023&t.charCodeAt(s)),a.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),u=0;u>>2;n.length<=h;)n.push(0);n[h]|=a[u]<<8*(l+c%4*r),d+=1}else if("UTF16BE"===e||"UTF16LE"===e)for(l=-1===r?2:0,a="UTF16LE"===e&&1!==r||"UTF16LE"!==e&&1===r,s=0;s>>8),h=(c=d+f)>>>2;n.length<=h;)n.push(0);n[h]|=o<<8*(l+c%4*r),d+=2}return{value:n,binLen:8*d+i}};break;case"B64":t=function(t,e,n){var i,o,a,s,u,f,h,c,l=0;if(-1===t.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(o=t.indexOf("="),t=t.replace(/\=/g,""),-1!==o&&o