/*! For license information please see Ciphers.js.LICENSE.txt */ (()=>{var __webpack_modules__={42531:function(module){var factory;factory=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=177)}([function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){var n=r(2),i=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(a(n,t),t.Buffer=s),a(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(e){var n=r(169),i=r(168),a=r(76);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return M(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(n)return M(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return F(this,t,r);case"base64":return B(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){var a,s=1,o=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,o/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var f=-1;for(a=r;ao&&(r=o-c),a=r;a>=0;a--){for(var h=!0,l=0;li&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var s=0;s>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function B(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(f=u);break;case 2:128==(192&(a=e[i+1]))&&(c=(31&u)<<6|63&a)>127&&(f=c);break;case 3:a=e[i+1],s=e[i+2],128==(192&a)&&128==(192&s)&&(c=(15&u)<<12|(63&a)<<6|63&s)>2047&&(c<55296||c>57343)&&(f=c);break;case 4:a=e[i+1],s=e[i+2],o=e[i+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(c=(15&u)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&c<1114112&&(f=c)}null===f?(f=65533,h=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=h}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);for(var r="",n=0;n0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},c.prototype.compare=function(e,t,r,n,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),o=Math.min(a,s),u=this.slice(n,i),f=e.slice(t,r),h=0;hi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return S(this,e,t,r);case"latin1":case"binary":return E(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function I(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;ii)&&(r=i);for(var a="",s=t;sr)throw new RangeError("Trying to access beyond buffer length")}function _(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function P(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function N(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function O(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,a){return a||O(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,a){return a||O(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUInt8=function(e,t){return t||D(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||D(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||D(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||D(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||D(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||D(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){t||D(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||D(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||D(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||D(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||D(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||_(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);_(this,e,t,r,i-1,-i)}var a=0,s=1,o=0;for(this[t]=255&e;++a=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||_(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(a<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function H(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(7))},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{s=r(130).Buffer}catch(e){}function o(e,t,r){for(var n=0,i=Math.min(e.length,r),a=t;a=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function c(e,t,r,n){for(var i=0,a=Math.min(e.length,r),s=t;s=49?o-49+10:o>=17?o-17+10:o}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=s<>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=o(e,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==t&&(i=o(e,t,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,s=a%n,o=Math.min(a,a-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],s=i*a,o=67108863&s,c=s/67108864|0;r.words[0]=o;for(var u=1;u>>26,h=67108863&c,l=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=l;d++){var p=u-d|0;f+=(s=(i=0|e.words[p])*(a=0|t.words[d])+h)/67108864|0,h=67108863&s}r.words[u]=0|h,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,s=0;s>>24-i&16777215)||s!==this.length-1?u[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,s--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],d=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?g+r:u[l-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var s,o,c="le"===t,u=new e(a),f=this.clone();if(c){for(o=0;!f.isZero();o++)s=f.andln(255),f.iushrn(8),u[o]=s;for(;o=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==a&&s>26,this.words[s]=67108863&t;if(0===a&&s>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],v=8191&y,m=y>>>13,b=0|s[3],w=8191&b,S=b>>>13,E=0|s[4],C=8191&E,A=E>>>13,B=0|s[5],x=8191&B,T=B>>>13,I=0|s[6],F=8191&I,k=I>>>13,R=0|s[7],D=8191&R,_=R>>>13,P=0|s[8],N=8191&P,O=P>>>13,L=0|s[9],U=8191&L,K=L>>>13,M=0|o[0],H=8191&M,j=M>>>13,V=0|o[1],G=8191&V,q=V>>>13,z=0|o[2],W=8191&z,X=z>>>13,Y=0|o[3],J=8191&Y,Q=Y>>>13,Z=0|o[4],$=8191&Z,ee=Z>>>13,te=0|o[5],re=8191&te,ne=te>>>13,ie=0|o[6],ae=8191&ie,se=ie>>>13,oe=0|o[7],ce=8191&oe,ue=oe>>>13,fe=0|o[8],he=8191&fe,le=fe>>>13,de=0|o[9],pe=8191&de,ge=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(u+(n=Math.imul(h,H))|0)+((8191&(i=(i=Math.imul(h,j))+Math.imul(l,H)|0))<<13)|0;u=((a=Math.imul(l,j))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,j))+Math.imul(g,H)|0,a=Math.imul(g,j);var ve=(u+(n=n+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(l,G)|0))<<13)|0;u=((a=a+Math.imul(l,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,H),i=(i=Math.imul(v,j))+Math.imul(m,H)|0,a=Math.imul(m,j),n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,G)|0,a=a+Math.imul(g,q)|0;var me=(u+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(l,W)|0))<<13)|0;u=((a=a+Math.imul(l,X)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(w,H),i=(i=Math.imul(w,j))+Math.imul(S,H)|0,a=Math.imul(S,j),n=n+Math.imul(v,G)|0,i=(i=i+Math.imul(v,q)|0)+Math.imul(m,G)|0,a=a+Math.imul(m,q)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(g,W)|0,a=a+Math.imul(g,X)|0;var be=(u+(n=n+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(l,J)|0))<<13)|0;u=((a=a+Math.imul(l,Q)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(C,H),i=(i=Math.imul(C,j))+Math.imul(A,H)|0,a=Math.imul(A,j),n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(S,G)|0,a=a+Math.imul(S,q)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Q)|0;var we=(u+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(l,$)|0))<<13)|0;u=((a=a+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,H),i=(i=Math.imul(x,j))+Math.imul(T,H)|0,a=Math.imul(T,j),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(A,G)|0,a=a+Math.imul(A,q)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,Q)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(g,$)|0,a=a+Math.imul(g,ee)|0;var Se=(u+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((a=a+Math.imul(l,ne)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,H),i=(i=Math.imul(F,j))+Math.imul(k,H)|0,a=Math.imul(k,j),n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(T,G)|0,a=a+Math.imul(T,q)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(A,W)|0,a=a+Math.imul(A,X)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0;var Ee=(u+(n=n+Math.imul(h,ae)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(l,ae)|0))<<13)|0;u=((a=a+Math.imul(l,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,j))+Math.imul(_,H)|0,a=Math.imul(_,j),n=n+Math.imul(F,G)|0,i=(i=i+Math.imul(F,q)|0)+Math.imul(k,G)|0,a=a+Math.imul(k,q)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(T,W)|0,a=a+Math.imul(T,X)|0,n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,Q)|0)+Math.imul(A,J)|0,a=a+Math.imul(A,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,ee)|0,n=n+Math.imul(v,re)|0,i=(i=i+Math.imul(v,ne)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ne)|0,n=n+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,se)|0;var Ce=(u+(n=n+Math.imul(h,ce)|0)|0)+((8191&(i=(i=i+Math.imul(h,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((a=a+Math.imul(l,ue)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(N,H),i=(i=Math.imul(N,j))+Math.imul(O,H)|0,a=Math.imul(O,j),n=n+Math.imul(D,G)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(_,G)|0,a=a+Math.imul(_,q)|0,n=n+Math.imul(F,W)|0,i=(i=i+Math.imul(F,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,Q)|0)+Math.imul(T,J)|0,a=a+Math.imul(T,Q)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(S,re)|0,a=a+Math.imul(S,ne)|0,n=n+Math.imul(v,ae)|0,i=(i=i+Math.imul(v,se)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,se)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(g,ce)|0,a=a+Math.imul(g,ue)|0;var Ae=(u+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;u=((a=a+Math.imul(l,le)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,j))+Math.imul(K,H)|0,a=Math.imul(K,j),n=n+Math.imul(N,G)|0,i=(i=i+Math.imul(N,q)|0)+Math.imul(O,G)|0,a=a+Math.imul(O,q)|0,n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(F,J)|0,i=(i=i+Math.imul(F,Q)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,Q)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(T,$)|0,a=a+Math.imul(T,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,se)|0,n=n+Math.imul(v,ce)|0,i=(i=i+Math.imul(v,ue)|0)+Math.imul(m,ce)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(g,he)|0,a=a+Math.imul(g,le)|0;var Be=(u+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ge)|0)+Math.imul(l,pe)|0))<<13)|0;u=((a=a+Math.imul(l,ge)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(U,G),i=(i=Math.imul(U,q))+Math.imul(K,G)|0,a=Math.imul(K,q),n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(O,W)|0,a=a+Math.imul(O,X)|0,n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,Q)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(F,$)|0,i=(i=i+Math.imul(F,ee)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(T,re)|0,a=a+Math.imul(T,ne)|0,n=n+Math.imul(C,ae)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,se)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(S,ce)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(v,he)|0,i=(i=i+Math.imul(v,le)|0)+Math.imul(m,he)|0,a=a+Math.imul(m,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;u=((a=a+Math.imul(g,ge)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,X))+Math.imul(K,W)|0,a=Math.imul(K,X),n=n+Math.imul(N,J)|0,i=(i=i+Math.imul(N,Q)|0)+Math.imul(O,J)|0,a=a+Math.imul(O,Q)|0,n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(F,re)|0,i=(i=i+Math.imul(F,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(T,ae)|0,a=a+Math.imul(T,se)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(S,he)|0,a=a+Math.imul(S,le)|0;var Te=(u+(n=n+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,ge)|0)+Math.imul(m,pe)|0))<<13)|0;u=((a=a+Math.imul(m,ge)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,Q))+Math.imul(K,J)|0,a=Math.imul(K,Q),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,ee)|0,n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(F,ae)|0,i=(i=i+Math.imul(F,se)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,se)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(T,ce)|0,a=a+Math.imul(T,ue)|0,n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(A,he)|0,a=a+Math.imul(A,le)|0;var Ie=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ge)|0)+Math.imul(S,pe)|0))<<13)|0;u=((a=a+Math.imul(S,ge)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,ee))+Math.imul(K,$)|0,a=Math.imul(K,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ne)|0,n=n+Math.imul(D,ae)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,se)|0,n=n+Math.imul(F,ce)|0,i=(i=i+Math.imul(F,ue)|0)+Math.imul(k,ce)|0,a=a+Math.imul(k,ue)|0,n=n+Math.imul(x,he)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(T,he)|0,a=a+Math.imul(T,le)|0;var Fe=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ge)|0)+Math.imul(A,pe)|0))<<13)|0;u=((a=a+Math.imul(A,ge)|0)+(i>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(K,re)|0,a=Math.imul(K,ne),n=n+Math.imul(N,ae)|0,i=(i=i+Math.imul(N,se)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,se)|0,n=n+Math.imul(D,ce)|0,i=(i=i+Math.imul(D,ue)|0)+Math.imul(_,ce)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(F,he)|0,i=(i=i+Math.imul(F,le)|0)+Math.imul(k,he)|0,a=a+Math.imul(k,le)|0;var ke=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ge)|0)+Math.imul(T,pe)|0))<<13)|0;u=((a=a+Math.imul(T,ge)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,ae),i=(i=Math.imul(U,se))+Math.imul(K,ae)|0,a=Math.imul(K,se),n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,ue)|0,n=n+Math.imul(D,he)|0,i=(i=i+Math.imul(D,le)|0)+Math.imul(_,he)|0,a=a+Math.imul(_,le)|0;var Re=(u+(n=n+Math.imul(F,pe)|0)|0)+((8191&(i=(i=i+Math.imul(F,ge)|0)+Math.imul(k,pe)|0))<<13)|0;u=((a=a+Math.imul(k,ge)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,ce),i=(i=Math.imul(U,ue))+Math.imul(K,ce)|0,a=Math.imul(K,ue),n=n+Math.imul(N,he)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(O,he)|0,a=a+Math.imul(O,le)|0;var De=(u+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ge)|0)+Math.imul(_,pe)|0))<<13)|0;u=((a=a+Math.imul(_,ge)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(U,he),i=(i=Math.imul(U,le))+Math.imul(K,he)|0,a=Math.imul(K,le);var _e=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,ge)|0)+Math.imul(O,pe)|0))<<13)|0;u=((a=a+Math.imul(O,ge)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863;var Pe=(u+(n=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,ge))+Math.imul(K,pe)|0))<<13)|0;return u=((a=Math.imul(K,ge))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,c[0]=ye,c[1]=ve,c[2]=me,c[3]=be,c[4]=we,c[5]=Se,c[6]=Ee,c[7]=Ce,c[8]=Ae,c[9]=Be,c[10]=xe,c[11]=Te,c[12]=Ie,c[13]=Fe,c[14]=ke,c[15]=Re,c[16]=De,c[17]=_e,c[18]=Pe,0!==u&&(c[19]=u,r.length++),r};function p(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(d=l),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):n<63?l(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,s&=67108863}r.words[a]=o,n=s,s=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},g.prototype.permute=function(e,t,r,n,i,a){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&a,a>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,s=Math.min((e-a)/26,this.length),o=67108863^67108863>>>a<s)for(this.length-=s,u=0;u=0&&(0!==f||u>=i);u--){var h=0|this.words[u];this.words[u]=f<<26-a|h>>>a,f=h&o}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===o)return this.strip();for(n(-1===o),o=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var o,c=n.length-i.length;if("mod"!==t){(o=new a(null)).length=c+1,o.words=new Array(o.length);for(var u=0;u=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);o&&(o.words[h]=l)}return o&&o.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:o||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(i=o.div.neg()),{div:i,mod:o.mod}):this.negative&e.negative?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,o},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),s=new a(0),o=new a(0),c=new a(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),h=t.clone();!t.isZero();){for(var l=0,d=1;!(t.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(f),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,g=1;!(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(f),c.isub(h)),o.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o),s.isub(c)):(r.isub(t),o.isub(i),c.isub(s))}return{a:o,b:c,gcd:r.iushln(u)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new a(1),o=new a(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;!(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var h=0,l=1;!(r.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(r.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o)):(r.isub(t),o.isub(s))}return(i=0===t.cmpn(1)?s:o).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return!(1&~this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new E(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function C(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(m,v),m.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,a=s}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},m.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new b;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return y[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(!(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var o=new a(1).toRed(this),c=o.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new a(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var h=this.pow(f,i),l=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=s;0!==d.cmp(o);){for(var g=d,y=0;0!==g.cmp(o);y++)g=g.redSqr();n(y=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var h=u>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4==++o||0===n&&0===f)&&(i=this.mul(i,r[s]),o=0,s=0)):o=0}c=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new C(e)},i(C,E),C.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},C.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},C.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},C.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},C.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)}).call(this,r(131)(e))},function(e,t,r){"use strict";var n=t;n.version=r(124).version,n.utils=r(123),n.rand=r(54),n.curve=r(21),n.curves=r(118),n.ec=r(110),n.eddsa=r(106)},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){"use strict";var n=r(5),i=r(0);function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function o(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>8,s=255&i;a?r.push(a,s):r.push(s)}else for(n=0;n>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],a=n+e[t+1]>>>0,s=(a>>0,e[t+1]=a},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,a,s,o){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,a,s,o){return t+n+a+o>>>0},t.sum64_5_hi=function(e,t,r,n,i,a,s,o,c,u){var f=0,h=t;return f+=(h=h+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,a,s,o,c,u){return t+n+a+o+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var n=r(1).Buffer,i=r(37).Transform,a=r(33).StringDecoder;function s(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(0)(s,i),s.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},s.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},s.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},s.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new a(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=s},function(e,t){var r,n,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var c,u=[],f=!1,h=-1;function l(){f&&c&&(f=!1,c.length?u=c.concat(u):h=-1,u.length&&d())}function d(){if(!f){var e=o(l);f=!0;for(var t=u.length;t;){for(c=u,u=[];++h1)for(var r=1;r=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t,r){"use strict";(function(t,n){var i=r(1).Buffer,a=t.crypto||t.msCrypto;a&&a.getRandomValues?e.exports=function(e,r){if(e>65536)throw new Error("requested too many random bytes");var s=new t.Uint8Array(e);e>0&&a.getRandomValues(s);var o=i.from(s.buffer);return"function"==typeof r?n.nextTick((function(){r(null,o)})):o}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,r(7),r(9))},function(e,t,r){var n=t;n.Reporter=r(99).Reporter,n.DecoderBuffer=r(49).DecoderBuffer,n.EncoderBuffer=r(49).EncoderBuffer,n.Node=r(98)},function(e,t,r){var n=t;n.bignum=r(3),n.define=r(102).define,n.base=r(13),n.constants=r(48),n.decoders=r(96),n.encoders=r(94)},function(e,t,r){"use strict";var n=r(6),i=r(5);function a(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=a,a.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a0||a>0;){var f=new i;f.update(u),f.update(e),t&&f.update(t),u=f.digest();var h=0;if(s>0){var l=o.length-s;h=Math.min(s,u.length),u.copy(o,l,0,h),s-=h}if(h0){var d=c.length-a,p=Math.min(a,u.length-h);u.copy(c,d,h,h+p),a-=p}}return u.fill(0),{key:o,iv:c}}},function(e,t,r){var n=r(1).Buffer;function i(e){n.isBuffer(e)||(e=n.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i>>24]^f[p>>>16&255]^h[g>>>8&255]^l[255&y]^t[v++],s=u[p>>>24]^f[g>>>16&255]^h[y>>>8&255]^l[255&d]^t[v++],o=u[g>>>24]^f[y>>>16&255]^h[d>>>8&255]^l[255&p]^t[v++],c=u[y>>>24]^f[d>>>16&255]^h[p>>>8&255]^l[255&g]^t[v++],d=a,p=s,g=o,y=c;return a=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[g>>>8&255]<<8|n[255&y])^t[v++],s=(n[p>>>24]<<24|n[g>>>16&255]<<16|n[y>>>8&255]<<8|n[255&d])^t[v++],o=(n[g>>>24]<<24|n[y>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^t[v++],c=(n[y>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&g])^t[v++],[a>>>=0,s>>>=0,o>>>=0,c>>>=0]}var o=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],a=[[],[],[],[]],s=0,o=0,c=0;c<256;++c){var u=o^o<<1^o<<2^o<<3^o<<4;u=u>>>8^255&u^99,r[s]=u,n[u]=s;var f=e[s],h=e[f],l=e[h],d=257*e[u]^16843008*u;i[0][s]=d<<24|d>>>8,i[1][s]=d<<16|d>>>16,i[2][s]=d<<8|d>>>24,i[3][s]=d,d=16843009*l^65537*h^257*f^16843008*s,a[0][u]=d<<24|d>>>8,a[1][u]=d<<16|d>>>16,a[2][u]=d<<8|d>>>24,a[3][u]=d,0===s?s=o=1:(s=f^e[e[e[l^f]]],o^=e[e[o]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:a}}();function u(e){this._key=i(e),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=4*(r+1),i=[],a=0;a>>24,s=c.SBOX[s>>>24]<<24|c.SBOX[s>>>16&255]<<16|c.SBOX[s>>>8&255]<<8|c.SBOX[255&s],s^=o[a/t|0]<<24):t>6&&a%t==4&&(s=c.SBOX[s>>>24]<<24|c.SBOX[s>>>16&255]<<16|c.SBOX[s>>>8&255]<<8|c.SBOX[255&s]),i[a]=i[a-t]^s}for(var u=[],f=0;f>>24]]^c.INV_SUB_MIX[1][c.SBOX[l>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[l>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&l]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(e){return s(e=i(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},u.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},u.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=s(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),a=n.allocUnsafe(16);return a.writeUInt32BE(r[0],0),a.writeUInt32BE(r[3],4),a.writeUInt32BE(r[2],8),a.writeUInt32BE(r[1],12),a},u.prototype.scrub=function(){a(this._keySchedule),a(this._invKeySchedule),a(this._key)},e.exports.AES=u},function(e,t,r){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,s,o=arguments.length;switch(o){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(a=new Array(o-1),s=0;s=0||!r.umod(e.prime1)||!r.umod(e.prime2);)r=new n(i(t));return r}e.exports=a,a.getr=s}).call(this,r(2).Buffer)},function(e,t,r){var n={ECB:r(141),CBC:r(140),CFB:r(139),CFB8:r(138),CFB1:r(137),OFB:r(136),CTR:r(61),GCM:r(61)},i=r(59);for(var a in i)i[a].module=n[i[a].mode];e.exports=i},function(e,t,r){var n=r(142),i=r(134),a=r(59);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(a)}},function(e,t,r){"use strict";t.utils=r(147),t.Cipher=r(146),t.DES=r(145),t.CBC=r(144),t.EDE=r(143)},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(156),t.sha1=r(155),t.sha224=r(154),t.sha256=r(70),t.sha384=r(153),t.sha512=r(69)},function(e,t,r){"use strict";var n=r(2).Buffer,i=r(0),a=r(75),s=new Array(16),o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],f=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],h=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function d(){a.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<>>32-t}function g(e,t,r,n,i,a,s,o){return p(e+(t^r^n)+a+s|0,o)+i|0}function y(e,t,r,n,i,a,s,o){return p(e+(t&r|~t&n)+a+s|0,o)+i|0}function v(e,t,r,n,i,a,s,o){return p(e+((t|~r)^n)+a+s|0,o)+i|0}function m(e,t,r,n,i,a,s,o){return p(e+(t&n|r&~n)+a+s|0,o)+i|0}function b(e,t,r,n,i,a,s,o){return p(e+(t^(r|~n))+a+s|0,o)+i|0}i(d,a),d.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,a=0|this._d,d=0|this._e,w=0|this._a,S=0|this._b,E=0|this._c,C=0|this._d,A=0|this._e,B=0;B<80;B+=1){var x,T;B<16?(x=g(r,n,i,a,d,e[o[B]],h[0],u[B]),T=b(w,S,E,C,A,e[c[B]],l[0],f[B])):B<32?(x=y(r,n,i,a,d,e[o[B]],h[1],u[B]),T=m(w,S,E,C,A,e[c[B]],l[1],f[B])):B<48?(x=v(r,n,i,a,d,e[o[B]],h[2],u[B]),T=v(w,S,E,C,A,e[c[B]],l[2],f[B])):B<64?(x=m(r,n,i,a,d,e[o[B]],h[3],u[B]),T=y(w,S,E,C,A,e[c[B]],l[3],f[B])):(x=b(r,n,i,a,d,e[o[B]],h[4],u[B]),T=g(w,S,E,C,A,e[c[B]],l[4],f[B])),r=d,d=a,a=p(i,10),i=n,n=x,w=A,A=C,C=p(E,10),E=S,S=T}var I=this._b+i+C|0;this._b=this._c+a+A|0,this._c=this._d+d+w|0,this._d=this._e+r+S|0,this._e=this._a+n+E|0,this._a=I},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=d},function(e,t,r){"use strict";var n=r(1).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=f,this.end=h,t=3;break;default:return this.write=l,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function l(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";(function(t,n,i){var a=r(24);function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(undefined),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=m;var o,c=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:a.nextTick;m.WritableState=v;var u=r(17);u.inherits=r(0);var f,h={deprecate:r(162)},l=r(73),d=r(1).Buffer,p=i.Uint8Array||function(){},g=r(72);function y(){}function v(e,t){o=o||r(10),e=e||{};var n=t instanceof o;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,u=e.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(u||0===u)?u:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===e.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(a.nextTick(i,n),a.nextTick(A,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),A(e,t))}(e,r,n,t,i);else{var s=E(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||S(e,r),n?c(w,e,r,s,i):w(e,r,s,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function m(e){if(o=o||r(10),!(f.call(m,this)||this instanceof o))return new m(e);this._writableState=new v(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function b(e,t,r,n,i,a,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function S(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,c=!0;r;)i[o]=r,r.isBuf||(c=!1),r=r.next,o+=1;i.allBuffers=c,b(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,h=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,f,h),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function C(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var r=E(t);return r&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(C,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(m,l),v.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(v.prototype,"buffer",{get:h.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===m&&e&&e._writableState instanceof v}})):f=function(e){return e instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(e,t,r){var n,i=this._writableState,s=!1,o=!i.objectMode&&(n=e,d.isBuffer(n)||n instanceof p);return o&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=y),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),a.nextTick(t,r)}(this,r):(o||function(e,t,r,n){var i=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),a.nextTick(n,s),i=!1),i}(this,i,e,r))&&(i.pendingcb++,s=function(e,t,r,n,i,a){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var o=t.objectMode?1:n.length;t.length+=o;var c=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,A(e,t),r&&(t.finished?a.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),m.prototype.destroy=g.destroy,m.prototype._undestroy=g.undestroy,m.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(9),r(164).setImmediate,r(7))},function(e,t,r){(t=e.exports=r(74)).Stream=t,t.Readable=t,t.Writable=r(34),t.Duplex=r(10),t.Transform=r(71),t.PassThrough=r(161)},function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,s,o,c,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var f=new Error('Uncaught, unspecified "error" event. ('+t+")");throw f.context=t,f}if(a(r=this._events[e]))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),r.apply(this,o)}else if(i(r))for(o=Array.prototype.slice.call(arguments,1),s=(u=r.slice()).length,c=0;c0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},r.prototype.removeListener=function(e,t){var r,a,s,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(s=(r=this._events[e]).length,a=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(o=s;o-- >0;)if(r[o]===t||r[o].listener&&r[o].listener===t){a=o;break}if(a<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(a,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){e.exports=i;var n=r(36).EventEmitter;function i(){n.call(this)}r(0)(i,n),i.Readable=r(35),i.Writable=r(160),i.Duplex=r(159),i.Transform=r(158),i.PassThrough=r(157),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(r.on("end",o),r.on("close",c));var s=!1;function o(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(f(),0===n.listenerCount(this,"error"))throw e}function f(){r.removeListener("data",i),e.removeListener("drain",a),r.removeListener("end",o),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("error",u),e.on("error",u),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e}},function(e,t,r){"use strict";(function(t){var n=r(0),i=r(75),a=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function o(e,t){return e<>>32-t}function c(e,t,r,n,i,a,s){return o(e+(t&r|~t&n)+i+a|0,s)+t|0}function u(e,t,r,n,i,a,s){return o(e+(t&n|r&~n)+i+a|0,s)+t|0}function f(e,t,r,n,i,a,s){return o(e+(t^r^n)+i+a|0,s)+t|0}function h(e,t,r,n,i,a,s){return o(e+(r^(t|~n))+i+a|0,s)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,s=this._d;r=c(r,n,i,s,e[0],3614090360,7),s=c(s,r,n,i,e[1],3905402710,12),i=c(i,s,r,n,e[2],606105819,17),n=c(n,i,s,r,e[3],3250441966,22),r=c(r,n,i,s,e[4],4118548399,7),s=c(s,r,n,i,e[5],1200080426,12),i=c(i,s,r,n,e[6],2821735955,17),n=c(n,i,s,r,e[7],4249261313,22),r=c(r,n,i,s,e[8],1770035416,7),s=c(s,r,n,i,e[9],2336552879,12),i=c(i,s,r,n,e[10],4294925233,17),n=c(n,i,s,r,e[11],2304563134,22),r=c(r,n,i,s,e[12],1804603682,7),s=c(s,r,n,i,e[13],4254626195,12),i=c(i,s,r,n,e[14],2792965006,17),r=u(r,n=c(n,i,s,r,e[15],1236535329,22),i,s,e[1],4129170786,5),s=u(s,r,n,i,e[6],3225465664,9),i=u(i,s,r,n,e[11],643717713,14),n=u(n,i,s,r,e[0],3921069994,20),r=u(r,n,i,s,e[5],3593408605,5),s=u(s,r,n,i,e[10],38016083,9),i=u(i,s,r,n,e[15],3634488961,14),n=u(n,i,s,r,e[4],3889429448,20),r=u(r,n,i,s,e[9],568446438,5),s=u(s,r,n,i,e[14],3275163606,9),i=u(i,s,r,n,e[3],4107603335,14),n=u(n,i,s,r,e[8],1163531501,20),r=u(r,n,i,s,e[13],2850285829,5),s=u(s,r,n,i,e[2],4243563512,9),i=u(i,s,r,n,e[7],1735328473,14),r=f(r,n=u(n,i,s,r,e[12],2368359562,20),i,s,e[5],4294588738,4),s=f(s,r,n,i,e[8],2272392833,11),i=f(i,s,r,n,e[11],1839030562,16),n=f(n,i,s,r,e[14],4259657740,23),r=f(r,n,i,s,e[1],2763975236,4),s=f(s,r,n,i,e[4],1272893353,11),i=f(i,s,r,n,e[7],4139469664,16),n=f(n,i,s,r,e[10],3200236656,23),r=f(r,n,i,s,e[13],681279174,4),s=f(s,r,n,i,e[0],3936430074,11),i=f(i,s,r,n,e[3],3572445317,16),n=f(n,i,s,r,e[6],76029189,23),r=f(r,n,i,s,e[9],3654602809,4),s=f(s,r,n,i,e[12],3873151461,11),i=f(i,s,r,n,e[15],530742520,16),r=h(r,n=f(n,i,s,r,e[2],3299628645,23),i,s,e[0],4096336452,6),s=h(s,r,n,i,e[7],1126891415,10),i=h(i,s,r,n,e[14],2878612391,15),n=h(n,i,s,r,e[5],4237533241,21),r=h(r,n,i,s,e[12],1700485571,6),s=h(s,r,n,i,e[3],2399980690,10),i=h(i,s,r,n,e[10],4293915773,15),n=h(n,i,s,r,e[1],2240044497,21),r=h(r,n,i,s,e[8],1873313359,6),s=h(s,r,n,i,e[15],4264355552,10),i=h(i,s,r,n,e[6],2734768916,15),n=h(n,i,s,r,e[13],1309151649,21),r=h(r,n,i,s,e[4],4149444226,6),s=h(s,r,n,i,e[11],3174756917,10),i=h(i,s,r,n,e[2],718787259,15),n=h(n,i,s,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+s|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=new t(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gostCodingInstance=void 0,t.GostCoding=s;var n=r(19),i=ArrayBuffer;function a(e){if(e instanceof i)return e;if(e&&e.buffer&&e.buffer instanceof i)return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(new Uint8Array(e,e.byteOffset,e.byteLength)).buffer;throw new n.DataError("CryptoOperationData required")}function s(){}var o={decode:function(e){for(var t,r,n=(e=e.replace(/[^A-Za-z0-9\+\/]/g,"")).length,i=3*n+1>>2,a=new Uint8Array(i),s=0,o=0,c=0;c64&&u<91?u-65:u>96&&u<123?u-71:u>47&&u<58?u+4:43===u?62:47===u?63:0)<<18-6*r,3===r||n-c==1){for(t=0;t<3&&o>>(16>>>t&24)&255;s=0}}return a.buffer},encode:function(e){for(var t=new Uint8Array(a(e)),r=2,n="",i=t.length,s=0,o=0;o0&&4*o/3%96==0&&(n+="\r\n"),s|=t[o]<<(16>>>r&24),2===r||i-o==1){for(var c=18;c>=0;c-=6){var u=s>>>c&63;u=u<26?u+65:u<52?u+71:u<62?u-4:62===u?43:63===u?47:65,n+=String.fromCharCode(u)}s=0}return n.substr(0,n.length-2+r)+(2===r?"":1===r?"=":"==")}};s.prototype.Base64=o;var c=function(){var e={1026:128,1027:129,8218:130,1107:131,8222:132,8230:133,8224:134,8225:135,8364:136,8240:137,1033:138,8249:139,1034:140,1036:141,1035:142,1039:143,1106:144,8216:145,8217:146,8220:147,8221:148,8226:149,8211:150,8212:151,8482:153,1113:154,8250:155,1114:156,1116:157,1115:158,1119:159,160:160,1038:161,1118:162,1032:163,164:164,1168:165,166:166,167:167,1025:168,169:169,1028:170,171:171,172:172,173:173,174:174,1031:175,176:176,177:177,1030:178,1110:179,1169:180,181:181,182:182,183:183,1105:184,8470:185,1108:186,187:187,1112:188,1029:189,1109:190,1111:191},t={};for(var r in e)t[e[r]]=r;return{decode:function(t,r){r=(r||"win1251").toLowerCase().replace("-","");for(var n=[],i=0,a=t.length;i>>6)),n.push(128+(63&s))):s<65536?(n.push(224+(s>>>12)),n.push(128+(s>>>6&63)),n.push(128+(63&s))):s<2097152?(n.push(240+(s>>>18)),n.push(128+(s>>>12&63)),n.push(128+(s>>>6&63)),n.push(128+(63&s))):s<67108864?(n.push(248+(s>>>24)),n.push(128+(s>>>18&63)),n.push(128+(s>>>12&63)),n.push(128+(s>>>6&63)),n.push(128+(63&s))):(n.push(252+(s>>>30)),n.push(128+(s>>>24&63)),n.push(128+(s>>>18&63)),n.push(128+(s>>>12&63)),n.push(128+(s>>>6&63)),n.push(128+(63&s)));else if("unicode"===r||"ucs2"===r||"utf16"===r){if(s<55296||s>=57344&&s<=65536)n.push(s>>>8),n.push(255&s);else if(s>=65536&&s<1114112){var o=55296+((1047552&(s-=65536))>>10),c=56320+(1023&s);n.push(o>>>8),n.push(255&o),n.push(c>>>8),n.push(255&c)}}else"utf32"===r||"ucs4"===r?(n.push(s>>>24&255),n.push(s>>>16&255),n.push(s>>>8&255),n.push(255&s)):"win1251"===r?(s>=128&&(s>=1040&&s<1104?s-=848:s=e[s]||0),n.push(s)):n.push(255&s)}return new Uint8Array(n).buffer},encode:function(e,r){r=(r||"win1251").toLowerCase().replace("-","");for(var n=[],i=new Uint8Array(a(e)),s=0,o=i.length;s=252&&c<254&&s+5>248&&c<252&&s+4>240&&c<248&&s+3=224&&c<240&&s+2=192&&c<224&&s+1=55296&&c<57344&&(c=(c-55296<<10)+((c=((c=i[++s])<<8)+i[++s])-56320)+65536):"utf32"===r||"ucs4"===r?c=((c=((c=(c<<8)+i[++s])<<8)+i[++s])<<8)+i[++s]:"win1251"===r&&c>=128&&(c>=192&&c<256?c+=848:c=t[c]||0),n.push(String.fromCharCode(c))}return n.join("")}}}();s.prototype.Chars=c;var u={decode:function(e,t){e=e.replace(/[^A-fa-f0-9]/g,"");var r=Math.ceil(e.length/2),n=new Uint8Array(r);if(e=(e.length%2>0?"0":"")+e,t&&("string"!=typeof t||t.toLowerCase().indexOf("little")<0))for(var i=0;i0&&o%32==0?"\r\n":"")+("00"+n[s].toString(16)).slice(-2)}else for(s=0;s0&&s%32==0?"\r\n":"")+("00"+n[s].toString(16)).slice(-2);return r.join("")}};s.prototype.Hex=u;var f={decode:function(e){0===(e=(e||"").replace(/[^\-A-fa-f0-9]/g,"")).length&&(e="0");var t=!1;for("-"===e.charAt(0)&&(t=!0,e=e.substring(1));"0"===e.charAt(0)&&e.length>1;)e=e.substring(1);e=(e.length%2>0?"0":"")+e,(!t&&!/^[0-7]/.test(e)||t&&!/^[0-7]|8[0]+$/.test(e))&&(e="00"+e);for(var r=e.length/2,n=new Uint8Array(r),i=0,a=r-1;a>=0;--a){var s=parseInt(e.substr(2*a,2),16);t&&s+i>0&&(s=256-s-i,i=1),n[a]=s}return n.buffer},encode:function(e){var t=new Uint8Array(a(e)),r=t.length;if(0===t.length)return"0x00";for(var n=[],i=t[0]>127,s=0,o=r-1;o>=0;--o){var c=t[o];i&&c+s>0&&(c=256-c-s,s=1),n[o]=("00"+c.toString(16)).slice(-2)}for(n=n.join("");"0"===n.charAt(0);)n=n.substring(1);return(i?"-":"")+"0x"+n}};s.prototype.Int16=f;var h=function(){function e(t,r,s){var o=t.object;void 0===o&&(o=t);var h=t.tagClass=t.tagClass||0;if(0===h){var l=t.tagNumber;if(void 0===l)if("string"==typeof o)l=""===o?5:/^\-?0x[0-9a-fA-F]+$/.test(o)?2:/^(\d+\.)+\d+$/.test(o)?6:/^[01]+$/.test(o)?3:/^(true|false)$/.test(o)?1:/^[0-9a-fA-F]+$/.test(o)?4:19;else if("number"==typeof o)l=2;else if("boolean"==typeof o)l=1;else if(o instanceof Array)l=16;else if(o instanceof Date)l=24;else{if(!(o instanceof i||o&&o.buffer instanceof i))throw new n.DataError("Unrecognized type for "+o);l=4}}var d,p=t.tagConstructed;if(void 0===p&&(p=t.tagConstructed=o instanceof Array),o instanceof i||o&&o.buffer instanceof i){if(d=new Uint8Array(a(o)),3===l){var g=new Uint8Array(a(d));(d=new Uint8Array(g.length+1))[0]=0,d.set(g,1)}}else if(p){if(!(o instanceof Array))throw new n.DataError("Constracted block can't be primitive");for(var y=0,v=[],m=0,b=0,w=o.length;b>>=7}while(w);for(C=x.length-1;C>=0;--C)B.push(x[C]+(0===C?0:128))}d=new Uint8Array(B);break;case 12:d=c.decode(o,"utf8");break;case 18:case 22:case 19:case 20:case 21:case 25:case 26:case 27:for(b=0,w=o.length;b255&&(l=12);d=12===l?c.decode(o,"utf8"):c.decode(o,"ascii");break;case 23:case 24:var T=o.original;if(!T){var I=new Date(o);I.setMinutes(I.getMinutes()+I.getTimezoneOffset());for(var F=24===l?I.getMilliseconds().toString():"";F.length>0&&"0"===F.charAt(F.length-1);)F=F.substring(0,F.length-1);F.length>0&&(F="."+F),T=(23===l?I.getYear().toString().slice(-2):I.getFullYear().toString())+("00"+(I.getMonth()+1)).slice(-2)+("00"+I.getDate()).slice(-2)+("00"+I.getHours()).slice(-2)+("00"+I.getMinutes()).slice(-2)+("00"+I.getSeconds()).slice(-2)+F+"Z"}d=c.decode(T,"ascii");break;case 28:d=c.decode(o,"utf32");break;case 30:d=c.decode(o,"utf16")}if(d||(d=new Uint8Array(0)),d instanceof i&&(d=new Uint8Array(d)),!p&&"CER"===r)switch(l){case 3:A=1;case 4:case 12:case 18:case 19:case 20:case 21:case 22:case 25:case 26:case 27:case 28:case 30:for(y=0,v=[],m=0,b=A=A||0,w=d.length;b>>=7}while(w);for(C=D.length-1;C>=0;--C)k.push(D[C]+(0===C?0:128))}if(p&&"CER"===r)k.push(128);else{var _=d.length;if(_>127){var P=_,N=[];do{N.push(255&P),P>>>=8}while(P);for(k.push(N.length+128),C=N.length-1;C>=0;--C)k.push(N[C])}else k.push(_)}var O=t.header=new Uint8Array(k),L=new Uint8Array(O.length+d.length);return L.set(O,0),L.set(d,O.length),L}function t(e,r){var a,s,o,u,h,l,d,p,g,y=r||0,v=y;if(e.object)a=e.tagNumber,s=e.tagClass,o=e.tagConstructed,u=e.content,h=e.header,l=e.object instanceof i?new Uint8Array(e.object):null,d=e.object instanceof Array?e.object:null,p=l&&l.length||null;else{var m=e,b=m[y++];if(s=b>>6,o=!!(32&b),31==(a=31&b)){a=0;do{if(a>9007199254740864)throw new n.DataError("Convertor not supported tag number more then (2^53 - 1) at position "+r);a=(a<<7)+(127&(b=m[y++]))}while(128&b)}if((p=127&(b=m[y++]))!==b){if(p>6)throw new n.DataError("Length over 48 bits not supported at position "+r);if(0===p)p=null;else{b=0;for(var w=0;w0?l.set(E.content.subarray(1),A):l.set(E.content,A),A+=E.content.length-g;o=!1,d=null}var B="";if(null===d){if(null===p)throw new n.DataError("Invalid tag with undefined length at offset "+v);if(0===s)switch(a){case 1:B=0!==l[0];break;case 2:case 10:if(p>6)B=f.encode(l);else{var x=l[0];for(l[0]>127&&(x-=256),w=1;w5)B=new Uint8Array(l.subarray(1)).buffer;else{var T=l[0];for(E=[],w=p-1;w>=1;--w){var I=l[w];for(A=T;A<8;++A)E.push(I>>A&1?"1":"0");T=0}B=E.reverse().join("")}break;case 4:B=new Uint8Array(l).buffer;break;case 6:E="",C=0;var F=0;for(w=0;w0)throw new n.DataError("Incompleted OID at offset "+v);B=E;break;case 16:case 17:B=[];break;case 12:B=c.encode(l,"utf8");break;case 18:case 19:case 20:case 21:case 22:case 25:case 26:case 27:B=c.encode(l,"ascii");break;case 28:B=c.encode(l,"utf32");break;case 30:B=c.encode(l,"utf16");break;case 23:case 24:var k,R=23===a;if(E=c.encode(l,"ascii"),!(k=(R?/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/:/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/).exec(E)))throw new n.DataError('Unrecognized time format "'+E+'" at offset '+v);R&&(k[1]=+k[1],k[1]+=k[1]<50?2e3:1900);var D=new Date(k[1],+k[2]-1,+k[3],+(k[4]||"0"),+(k[5]||"0"),+(k[6]||"0"),+(k[7]||"0")),_=D.getTimezoneOffset();(k[8]||23===a)&&("Z"!==k[8].toUpperCase()&&k[9]&&(_+=parseInt(k[9])),D.setMinutes(D.getMinutes()-_)),D.original=E,B=D}else B=new Uint8Array(l).buffer}else B=d;return{tagConstructed:o,tagClass:s,tagNumber:a,header:h,content:u,object:B}}return{encode:function(t,r,n){return e(t,r,n).buffer},decode:function(e){return t(e.object?e:new Uint8Array(a(e)),0)}}}();s.prototype.BER=h;var l={encode:function(e,t){return(t?"-----BEGIN "+t.toUpperCase()+"-----\r\n":"")+o.encode(e instanceof i?e:h.encode(e))+(t?"\r\n-----END "+t.toUpperCase()+"-----":"")},decode:function(e,t,r,i){var a=/([A-Za-z0-9\+\/\s\=]+)/g.exec(e);a[1].length!==e.length&&(a=!1),!a&&t&&(a=new RegExp("-----\\s?BEGIN "+t.toUpperCase()+"-----([A-Za-z0-9\\+\\/\\s\\=]+)-----\\s?END "+t.toUpperCase()+"-----","g").exec(e)),a||(a=new RegExp("-----\\s?BEGIN [A-Z0-9\\s]+-----([A-Za-z0-9\\+\\/\\s\\=]+)-----\\s?END [A-Z0-9\\s]+-----","g").exec(e));var s=a&&a[1+(i||0)];if(!s)throw new n.DataError("Not valid PEM format");var c=o.decode(s);return r&&(c=h.decode(c)),c}};s.prototype.PEM=l,t.gostCodingInstance=new s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GostDigest=function(e){switch(e=e||{},this.name=(e.name||"GOST R 34.10")+"-"+(e.version||2012)%100+((e.version||2012)>1?"-"+(e.length||256):"")+("HASH"!==(e.mode||"HASH")?"-"+e.mode:"")+(e.procreator?"/"+e.procreator:"")+("string"==typeof e.sBox?"/"+e.sBox:""),this.procreator=e.procreator,this.bitLength=e.length||256,e.version||2012){case 1:this.digest=l,this.bitLength=160;break;case 1994:this.digest=h,this.sBox=(e.sBox||("SC"===e.procreator?"D-SC":"D-A")).toUpperCase(),this.cipher=new i.GostCipher({name:"GOST 28147",block:"ECB",sBox:this.sBox,procreator:this.procreator});break;case 2012:this.digest=f;break;default:throw new a.NotSupportedError("Algorithm version "+e.version+" not supported")}switch(this.keySize=e.keySize||(e.version<=2?this.bitLength/8:32),e.mode||"HASH"){case"HASH":break;case"HMAC":this.sign=d,this.verify=p,this.generateKey=g;break;case"KDF":this.deriveKey=w,this.deriveBits=v,this.label=e.label,this.context=e.context;break;case"PBKDF2":this.deriveKey=w,this.deriveBits=m,this.generateKey=g,this.salt=e.salt,this.iterations=e.iterations||2e3,this.diversifier=e.diversifier||1;break;case"PFXKDF":this.deriveKey=w,this.deriveBits=y,this.generateKey=g,this.salt=e.salt,this.iterations=e.iterations||2e3,this.diversifier=e.diversifier||1;break;case"CPKDF":this.deriveKey=w,this.deriveBits=b,this.generateKey=g,this.salt=e.salt,this.iterations=e.iterations||2e3;break;default:throw new a.NotSupportedError("Algorithm mode "+e.mode+" not supported")}};var n=r(25),i=r(41),a=r(19);function s(e,t,r,n,i){for(var a=0;a>2,a=new Uint8Array(i),s=0,o=0,c=0;c64&&u<91?u-65:u>96&&u<123?u-71:u>47&&u<58?u+4:43===u?62:47===u?63:0)<<18-6*r,3===r||n-c==1){for(t=0;t<3&&o>>(16>>>t&24)&255;s=0}}return a.buffer}function u(e){if(e instanceof ArrayBuffer)return e;if(e&&e.buffer&&e.buffer instanceof ArrayBuffer)return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(new Uint8Array(e,e.byteOffset,e.byteLength)).buffer;throw new a.DataError("ArrayBuffer or ArrayBufferView required")}var f=function(){var e=new Int32Array(16),t=new Int32Array(16);t[0]=512;var r,n,i,a=function(e){for(var t=new Int32Array(c("B0Wm8lllgN0jTXTMNnR2BRXTYKQIKkKiAWlnkpHgfEv8xIV1jbhOcRbQRS5DdmovH3xlwIEvy+vp2soe2lsIsbebsSFwBHnmVs3L1xui3VXKpwrbwmG1XFiZ1hJrF7WaMQG1Fg9e1WGYKyMKcur+89e1cA9GneNPGi+dqYq1o2+yCroK9ZYemTHbeoZD9LbCCdtiYDc6ycGxnjWQ5A/i03t7KbEUderyix+cUl9e8QY1hD1qKPw5Cscvzius3HT1LtHjhLy+DCLxN+iToepTNL4DUpMzE7fYddYD7YIs16k/NV5orRxynX08XDN+hY5I3eRxXaDhSPnSZhXos98f71f+bHz9WBdg9WPqqX6iVnoWGicjtwD/36P1OiVHF82/vf8PgNc1njVKEIYWHxwVf2MjqWwMQT+amUdHraxr6ktufWRGekBo+jVPkDZyxXG/tsa+wmYf8gq0t5oct6b6z8aO8Jq0mn8YbKRCUfnEZi3AOTB6O8Okb9nTOh2urk+uk9QUOk1WhojzSjyiTEUXNQQFSiiDaUcGNyyCLcWrkgnJk3oZMz5H08mHv+bHxp45VAkkv/6GrFHsxaruFg7H9B7nAr/UDX+k2ahRWTXCrDYvxKXRK43RaZAGm5LLK4n0msTbTTtEtIke3jaccfi3TkFBbgwCqucDp8mTTUJbH5vbWiODUURhcmAqH8uS3DgOVJwHppqKK3uxzrLbC0QKgIQJDeC3Vdk8JEKJJRs6fTreXxbs2JpMlJsiMRZUWo837ZxFmPvHtHTDtjsV0fqYNvRSdjswbB56SzNprwJn558DYTMbiuH/H9t4iv8c50GJ8/PkskjlKjhSbwWApt6+qxst84HNpMprXdhvwEpZot6Ybkd9Hc2678q5SOrvcR2KeWaEFCGAASBhB6vru2v62JT+WmPNxgIw+4nI79CezXsg1xvxSpK8SJkbstnVF/T6UijhiKqkHeeGzJEYne+AXZufITDUEiD4dx3fvDI8pM16sUkEsIAT0roxFvFn5443")),r=new Array(12),n=0;n<12;n++)r[n]=new Int32Array(t.buffer,64*n,16);return r}(),s=new Int32Array(c("5vh+XFtxH9Alg3eACST6FshJ4H6FLqSoW0aGoY8GwWoLMumi13tBbqvaN6RngVxm9heWqBpoZnb13AtwY5GVS0hi84235kvx/1ximmi9hcXLgn2m/NdXlWbTba9pufCJNWyfdEg9g7B8vOyxI4yZoTanAqwxxHCNnrao0C+839aLGfpR5bOuN5zPtUCKEn0LvAx4tQggj1rlM+OEIojs7c7Cx9N3wV/S7HgXtlBdD165TMLAgzaHHYwgXbTLCwStdjyFWyigiS9YjRt59v8yVz/s9p5DEZM+D8DTn4A6GMnuAQom9fOtgxDv6PRBGXmmXc2hDH3pOhBKG+4dEkjpLFO/8tshhHM5tPUMz6aiPQlftLyc2EeYzeiKLYsHHFb5f3dxaVp1apzF8C5xoLoevKZj+atCFeZyLrGeIt5fu3gNuc4PJZS6FIJSDmOXZk2ELwMeagII6phcfyFEob5r8Ho3yxzRY2Lbg+COK0sxHGTPcEebq5YOMoVrqYa53ucetUeMh3r1bOm4/kKIX2HW/RvdAVaWYjjIYiFXkj74qS78l/9CEUR2+J19NQhWRSzrTJDJsOCnElYjCFAt+8sBbC16A/qnpkhF9G6LOL/GxKu9vvj91HfeujqsTOvIB5t58JyxBeiHnQwn+moQrIpYy4lg58FAHQzqGm+BHko1aSiQxPsHc9GW/0NQGi9gnQqf96UW4MY/N5Yc5KazuNqSUhMkdSw44IqbpahkczvsFU8r8SRXVUmzP9dm2xVEDcXHp9F5455Ct5La3xUaYZl/04agNF7AJxQjONVRe22pOaRlGPB3EEADtAJ5HZClrqLdiNJniZxKXQqTD2bfCihlwk7p1CBFCbCLMlU4kWaFKSpBKQe/xTOoQrJ+K2JUTcZzbFMERWKV4Ada9AbpU1GQih8vO2vBI2Fvw3sJ3FJV5cY5Z9Ezsf5oRCmIOcfw5xHiQJuH9xlk+aLpOK3D20sHGQwLTkf5w+v0VTTVdtNriENGEKBa64sC2CDDzfWCMvJRbeGEDb7Cseeg6N4GsPodCHuFS1QNNDM7QuKaZ7zKW3/YpgiKxDfdDsY7s6nZQ+2BIXFNvV5lo7FnYe3nte6haSQx98jVc6v21R/GheGjZxpeBjzUBBDJLSg6uY8ssEACj+vAbLLy95AX1k8Rb6HTPOBzWfGpnuSqeE7WjHTNwAZuKhnVxztC2ocStBYccEXDNxWC5O2TIW2s45BBSTn2/H7F8SGGIjt8wLCUBCusFvv510U3mlJ+v3N8Py6jtoFoM+e42brSeMqpoyo0wi/+u+SBY8z+370NjllAJG6lpnBRxu9LhCrR5CK60GUnnFCM2RSIwhhgjO4xnqVJH3zaF9OU4SgTTJxgCUv0MnLV47Ob9hKlpKrXkcy72kPSb/0PNN4fPJRq0lBPW1RomV7ha9+fr2/qj3eUJkjqWHDdCSu/x+Vtcdl8Z93msv9PIdVJPCdrRjroYAORdntPr4bHH2ihPng11LmgtowRXwMMn9QUHdLJFlggAZg9j33dUySsZKpwP8wXUlTCyYmUjgK0Jj5edtafRsLeUHRvA1h9gARF2z2CknLx5WBYSgKbVgvz+65Ypz/83GKhWl5ObK1M6EupblXOH7jMCPl0eq6CslPBAhRM9/tHG58EKJjz6442BosnrfLv+3rtypf+jApevneOBRP099jPMCwlAcMri/eNkt38F1xVTfhlxX9GBS9f6vMwG6Ky9CSqaLfsu9YNhpmPDzUBBHVMAAAAAAAAAADxLjFNNNDM7HEFIr4GGCO1rygNmTDABcGX/VziXWk8ZRmkHMYzzJoVlYRBcvjHnrjcVDK3k3aEqZQ2wTokkM9YgCsT8zLI71nEQq45fO1PXPoc2O/jq42C8uWslU0pP9Fq2CPokHobfU0iSfg88EO2A8ud2Hn58z3eLS8nNtgmdCpDpB+JHuLfb5iZnRtsEzrUrUbNPfQ2+rs131AmmCXAlk/cqoE+bYXrQbBTfuWlxAVAunWLFghHpBrkO+e7RK/juMQp0GcXl4GZk7vun765rpqN0eyXVCHzVyzdkX5uMWOT19rir/jOR6IgEjfcUzijI0PeyQPuNXn8VsSompHmAbKASNxXUeASlvVk5Lfbe3X3GINRWXoS222VUr3OLjMenbsjHXQwj1INcpP90yLZ4gpEYQwwRnf+7uLStOrUJcow/e4ggAZ1YerKSkcBWhPnSv4UhyZOMCzIg7J78RmlFmTPWbP2gtyoEap8HnivWx1WJvtkjcOytz6RF99bzjTQX3zwarVvXf0lfwrNEycYV03I5nbFKp4HOaflLriqmlSGVT4PPNmjVv9IrqqSe36+dWUlrY4th30ObPn/28hBOx7MoxRQyplpE74w6YPoQK1REAmVbqccsbW2ui20NU5Eab3KTiWgBRWvUoHKD3HhdEWYy40OK/JZP5sxKqhjt++zim4ppPxja2qjoEwtSp09lesO5r8x46KRw5YVVL/VGBacju+by/URXWi8nU4oRrqHXxj6z3Qg0e38uLbiPr2wBzby8eNkroTZKc5libb+cLei9tpPclUOclPXXG1JKQTyOj1XQVmnCoBp6gssEI5J0HPFa7EaEYqrehk55P/XzQlaCw44rO/J+2A2WXn1SJK95pfWfzQix4kz4QUUvGHhwdm5dcm1StImYWDPG82AmkSS7Xj9hnGzzKsqiBqXk3LOv2Z/4dCI1tRbXZhalCfIEagFjD9V3mX1tDGWtQYZ90+WsdZwbkOFnR6Ly0PTNlqrioXM+j2E+ce/mcKV/P2iH9Wh3ktjD82z73Y7i0VtgD9Z+Hz3w4WyfHO+XzGRPJjjrGYzsEghv2FnTCa4+BgP+8mVxMEwyKqghiAQdhqYYFfzQiEBFqr2PHYMBlTMNS3bRcxmfZBCvPRalkvUA4Jo6KDD7zxvPae9ktJp/3O8KQriAgHtIoe33jTN6IWBj9kB7qfdYQWb1vonMhmgNVPVbxrodMzOyeoxJFwug/VUcDRVXaB75JnOJtKsVue+9/0WGFelBU44ag59pFJ0NtFb2Go4HN6f8sr3dWIxdwwysJqu2eJ5yNBd7xCRxgZ02xEQRqJRXlBFI1Ns5HKYAvzFDLz39bY8+nOhaIfNFx8DfSlBr9nyjb0/Xj60Wk87nYTu/jYbZ3FAPbjj0+cHYnEaOij58g/SSH68fHW0nnYndOXyk8frVlwY3PWeT0eLpAxu9E+prctSxpmBLZjax2B4iwbcbkadDvxl+Op1IexOMKX3IZ6OC1Ur7D9lvKV7a93QSWm68bdemZBM2+OU6lcUsgHR5upA9ruwwIJBKErdUPIEY7+PHf/o1/k7k8usuE2Mto5HfIbowd0bOZImjj98WqESCdYvyy89mKvbNcmuZxNpViv9X/UVweFsNs7igB1+su3485sX2pTTfbAN/gGHe8PsdguK2suEld/hU65EBaJHc7e0ELMShXt4PDKr3463cNBoElE7U2c5udLj5mVYTVficbJkaNeJx4/JhJclqTW7+n0a4QKLFTej36ZBiNDNXZvDeN56Ssgsmk2Az7dCd38bg722IHLSiDodM711XnotS6tqj0H02qtruxyV2ZBc/+f9jTG2g6pkIhGbOB/ArvuEQgIsSaD5CMZjAzrjpCivCASTiCat5Bw0GopTx65xIe535qhdxH9cSiWSnoy1OOmqVc3YYwY3eqna2OspoYroe7MnmJVu39pqNeSEFGt9nRmCUJSn1Bz6VaTobL/lyu3J6kLFnKNsNRwOb8F5UYHk3m+rv4n/8MUwGE0X1J1B6xWEBFiSHA1SUCjXOWHxeOwYDKiFapoFcQGO+BHNQJGifD7178wZrxUjn2Mp0jR0UO/5HrmQ4RtKB43Sd1m5Vh3l/GATMZEvH1otqZPAFlTctluiGRo+Ld4JimuZ64pm1x4PguP+jFGtt9VaCNdFM+UPiUH/fwLm3We9SFns4Giqul321S/CSCbj/0p1pWw5Bw2IrN34ZIZUjEaRpG/Rvr0mE1x8DLMPkwOPFTNKgtmEn8G/mmmcMguoVCD65PpSgkOv+QdnntTWz+loowi4Jf1YLESxR5t2kbxe3LO7x+phkEj+ZRYQY6YfgXryM0fVOGg0CaaTY8LOmExt7TAqn9/YbIHZHXseOwYDKmaUZmCJ6/vZ/YMKWY7mc3UgewdEmhQK/ElfLKilcbZZMjQfmG+KRbvC+zgapKBQs3LCVCOjrdgfrzoXJzwLi4a7bP6DJY3IabWiKHkCv9HJgPH1qUvWazg3r4iACnmyyroSVVBDEAg7DUzfNpQOB7nusgTRp85nkLLFYSQT//EltNwm8SuXxSwST4YII1GmLyis75NjL5k35ec1B7BSKTob5ucsMK5XCpxw01hgQa4UJeDeRXSz151MxJK6IoBAxWha8AsMpdyMJxy+Eofx9pxabvOeMX+x4NyGSV0RQCDsNC1pm0B+PxjNS9yjqdRq1RUoDR0U8nmJaSQAAAAAAAAAAFk+t1+hlsYeLk54FgsRa9htSuewWIh/juZf0BOHLj4Gem3bu9MOxOKsl/yJyq7xsQnMszweGdvhifPqxGLuGGR3cM9JqoetxlbFfsplV/bWA5U92m1s+5o2ko2IRFbgfB7rjzeVn2CNMdYXnE6qqSNvrDrX5cAmYkMEn6ZTmRRWq9NmncBSuO6vAsFTp8IKKzzLA243I8AHk8nCPZDhyizDO8ZeL27X00z/VjOXWCSeselOZDJdaqY34W01lHJCCnn45mG+Yj94UhTZBALHRBNILvH98MiWWxP2m8XsFgmpDogpKBTlkr5OGYtUKhB9cszAD8vrr+cbG0nIRCIrcD4lZBZNqEDp1SDGUT4f9PlmusMgP5EM6Kvy7dHCYcR+8IFMuUWs02Hzlf64lEo5IQVcnPAsFiLWrZcYZfP3cXjpvYe6K5vwofREQAWyWWVdCe11vkgkf7wLdZYSLhfP9Cq0SwkXhel6FZZrhU4nVdqf7uCDkkkTR5EyQypGI8ZSuahGW0etPkN0+LRfJBKxXoskF/bweGRLo/shYv5/3aURS7vMJ52kbcEBc+C90CSidiIgjFmivKCKj8SQbbg2803kuQ10OmZn6nFHteBwX0bvJ4LLKhUIsDnsBl719FsefSG1sYPP0FsQ2+czwGApXHefpzZyOUwBfs9VMhGGwxyB2HIOGg1Fp+07j5l6Pd+JWDr8ecft+ysu6aQZhkPvDs5fCc32e04tN09qa+n6NN8Etq3UcDihI/mNIk0KBX6qocliSLhcG/eo4/2XYDCaLrULKm5bo1GCDetCxOH+p1cilI1YKZodg3N/z5zIZLrUUaVbT7XUtypQCL9Tgc49eZdGptjV5C0E5dIrgPx+MIeWV7aed7VzVKA5aUQdgJfQtDMwyvvz4vDP4o533eC+jMNisS4lnElPRqbOcm+529HKQeJCwe7RTbp2Ay/0eqMPsEWyaKk6zeTMr38L6IRUnQgEg1SzwUaCY5JUNcLIDv7S7k438n/f+6cWejOSDGDxTfsSO1LqA+WESgyrU/27kAed6vY4D3iKGctI7FWPDLMqtZ3Estb+9+Dc28oi9PPsthHfWBNUmpxA4z/e31aKztOgwcgSQyLpwwela4FY+m0NdyeVebHh893ZsYt0QirABLjsLZ//q8KU9Kz4qC11kU97v2mx7ytoeMT2L69Iesfhds6AnMZ+XQxnEdiPkuTBTGJ7mdkkPe3+I0qlw9+2i1GQmx8VJi2/bU9m6gVLYry1GuLPWlKqaui+oFP70M4BSO1oCMDmYxTJQ/4WzRWoJxDNBJIxoGlw9ue8imyXzEywM3zoNfyzucBl3vJYfMeA81IhTt5BMrtQlfFeQ5D0k9+HCDliXdLg8UExPBr7i2avkXIK8FGyEbxHfUJ+1O6lcy47TO72474lgmJ4NOsLzEOcA+PdeOckyCh3MorZhn35FLUZReJDsPJXSw+I9+uX4oi2+piapJQ6GcTwaMsWhYZQ7mQJrxH6733zF9XATqukelZ8VJi0xqm2u/uAT0IYjjzCK887xc0L0EM26qo5dxPwL6wb7DMTLCUG26fw00iN1+Zda/LDGh5eubIWH/gg9YQuBlDEbg+fcWvrHZ6EMAGpM3WMqzFe1D/kFP2ieSJlJ8nxcB7wCTJzpMHKcKdxvpQYS6bnaz0OQNgp/4wUyH4PvsP6x3Z0yzYWqWNKapVyjxORGcJe+Tf1Re1NWuo/nugCSZZQujh7ZDfnvQtYLiLmVZ+J4FPiYYCtUuMFKI38bcVaI+NLmTXeFOD1GtCtCcY5BXimWYZeltdhcQlIfLHi1ss6IRVgAgHpFeV3n67RrbAhP2p33LeYgLduuaGmq12fjSSGRM+b/V5FNsVmJljxxrn+m6y9/erNY0G+mXnE76ciFwhAVXZRB3Hs2I5UPsK6UctnHwQ9CtSCrHGvWHn+eHoEXNrJNrI4rzOOBJrtvYZsyUly7iZhXabrvYECkDKV/dCLLBcR+DQEYHO/CurzCZMpdY/8QhyusT59z6k0uiMHSBGIgysk785Ch0zmXA5X1h+w6doas9G61vmbNDzAdXsciTxFgitRDbhAOpKXXHaYwfHbYUo+DQEY1eaMtNYPSI6FXLTPrpYeDfPLM9k6jlWrFKAO10IXAyhiN4nBg4tt0ZyUYpKJX+997Ts668/LuOZOSjFJBkx+ZC9lw9w9Kz4qTFpj2lvT80CpIQxHtHTRV6FhWTGsWTTaHehyZm7jZRF693ZbyG7TZxawXESbpohcIB1JxbkFOHqINGxFExByxLq53f+/SUYep1GvmdUpd7wc4FuhsPeF5GAn21JUbTC6bld4jDBa1wdlD1auyYfGgmEv8pWlq4lE9fvFcX7VKOdZ8kTKjdy7zix9uIiqFUq+Mo2xuh5hm+mT7OiLCfK9nugTtxd0AapLKF0csyGFjxQxlcruSMOBhBOY0bj8t1DTsvmIiTmoapmNHOG5H4iODORzRlp4mVaDdpeHFgLPKtfuI0G/hccTtbPxoU7/kW/hK0Vn53waAjC30QV1DJj8yF7Km6Wj5/cg2p4GrWpgMaK7sfQ4lz50lH7X0mAs9GY5GMD/ml9Qp/NoZ44kNNmDtKRJ1M1orxt1VZK1h388PQIubeobq/xfW0USH2sNcektKVU1dN/99RBtTwPYCBuoe5+MGcbbfqGjrAmBu7vKEq1mFy36eXBDZgEIKccXkyZ3e/9fnAAAAAAAAAAA6yR2pMkG1xVyTdQvBzjfb7dS7mU43bZfN/+8hj31O6OO+oT8tcFX5unrXHMnJZaqGwvavyU1xDmG4SyHKk1OIJlpoovOPgh6+vsut52cS1UFakFWttksslo65qXevqKWIqOwJqgpJYBTyFs7Nq0VgbEekAEXuHWDxR86Sj/laTDgGeHtzzYhveyBHSWR/LoYRFt9TE1SSh2o2mBp3K7wBVj1zHIwneMp1MBiWWt/9XDOIq0DOdWfmFkc2ZdHAk34i5DFqgMYe1T2Y9J/w1bQ8NhYnpE1tW7VNTCWUdPWehwS+WchzSZzLtKMHD1EGjasSSqUYWQHf2ktHXPcb19RS28KcPQNaNiKYLSzDsoerEHTZQnYM4WYfQs9l0kGMPaonszJCpbEZXeiDuLFrQGofOSatV4OcKPepEKcoYJka6Dal7RG25Yvaszth9TX9t4nKrgYXTelPEafJdzv4VvLpsGcbvn+o+tTp2SjkxvYhM4v0lkLgXwQ9FaiGm2AdDkz5XOgu3nvDQ8VXAygldweI2wsT8aU1DfkEDZN9iMFMpHdMt/Hg2xCZwMmPzKZvO9uZvjNauV7b52MNa4rW+IWWTGzwuISkPh/k70gJ7+RUANpRg6QIg0bVimeJ2+uGdMoY5KMPFOiQy9wgv746Rue0LxveSw+7UD3TEDVN9LeU9t16L+uX8KyYk2pwNKlQf0KTo//4Dz9EmQmIOSVaW+n4+Hw9Ai4qY9s0aojD92m2cLH0BCd0cYoj4p50E90h9WFRpRXm6NxC6I4QX98+oNPaB1HpNsKUAflIGya8UYKZD+hKN33NL1HEoFERwZytyMt8uCGzAIQUpMYLeWNvIkrV8qh+bD4kx37a4kkR8wuWun53RGFBCCkO0vlvraKJD7WVYQlXxnI1l07Z0BOYz+gBqaNtnZsRyof94rHmrTJfiHDU0QuEICq7JpPnblXgucUBbp7yCybMiAxpUZl+LZeT7G2Ufd1R/TUi/oNhXukZoKFqWxaoWqYu5kPrvkI63nJoV43okf0pi12hX3NXSd0HvjFC4AKGCC8vmXcsgH3orRmbRuYb5Qm50zJIb9TxOZIlUEKD5PZykIgzcyqZHuk70KaQGCJChhxDE6k9psys4vM2jYt3jVM05bcI7x8Wy+pwwm7aKqFGrPSYTGnNkjgEwIdxSlB/E2yzVrat3BL5IqneWXZhO1x5jI4b9YXNLuk6C1t1TirckVcIUfqYXe0sV2hq3DPCRzorJB/znK4vf9XyF39lyJ4qKTkTGprb5QNOFGZW08f3+RiV4zK7XG8ntmIK7DAHSwKkXudXRE8UDuiwx4RqHZDxuRjySOjmcHO9xaGxX6odtyHtKlz4JbVCa8NVn2dOlgUtAwqP1ncxvQ2AviEldEh3dPh3T2YNkhK+UXnGqRmiOV1GFR+sqWR9ZNmWHRQwB2JnqgQGGWMBltPVAgMvEYDoy0DhMZRN7893DJQeOyGHirqMKj8eVc/9yFNIDDKBQy2ZfAyK4AWwwxpvpbdGyRwh9uV7pmB4WG40fwYFNnKBfiCDtK7zA3nKWPXYFBDDxTHO8yw6KCdOg+OQHZNVz9UojnRdcHhYXe9EvWjfHNPH0urN8EvH9/CbVZIsWc5XNDxbATtFTe/QqftlxYdFDBAZX1sZ9qrcrgH7Bf6h7pO6Dzfr3nLAwT7wXM/BgVxvEY+eNYcEofpiifQfPSOd7StobnCYlNskN0m4kSbWGCAFgWPwJrX+UH8+/rYzqlL5G0Oo0PyiwYI65+bEmvQSRc0e5qSh0rnaZwiGwF8QsTmnuA6TFxyDuOSVktun14+o5naa6NT9FrYPTXn/uCQTBskJSLQCYMlh+ldhCmAwA8UMOLGs8Cghh4okwh0M6QZ1ynyNB89rdQtbG/uCj+u+7Kljkruc8SQ3TGDqrcttbGhajSpKgQGXiOP33tLNaFoa2/MaiO/bvSmlWwZHLlrhRrTUlXVmNTW3jUayWBN5fKufvMcpsKjqYHhct4vlVGtelOYMCWq/1bI9hYVUh2dHihg2VBv4xz6RQc6GJxV8StkewsBgOyarn6oWXzsi0AFDBBeI1DlGYv5QQTvitM0VcwN1wenvuFtZ3+S5eMluQ3naZdaBhWRom5jerYR7xYYIItGCfTfPrepgaseuweK6H2swLeRA4y2XiMfD9ONRXSwVmBn7fcCweqOvrpfS+CDEjjN48R3ws7+vlwNzkhsNUwb0oxds2QWwxkQJuqe0adicyQDnSmz74Ll658o/ILL8q4CqKronPBdJ4ZDGqz6J3SwKM9HH54xt6k4WBvQuOOSLsi8eBmbQAvvBpD7cce/QvhiHzvrEEYDBJloPnpHtVrY3piPQmOmldGQ2AjHKm5jhFMGJ1J7wxnXy+uwRGbXKZeu5n4MCuJljHwU0vEHsFbIgHEiwywwQAuMinrhH9Xaztug3ts46YoOdK0Qk1TcxhWmC+kaF/ZVzBmN3V/+uL2xSb/lMCiviQrt1lum9bStemp5VvCIKZcifhDoZlUys1L5DlNh39rO/jnOx/MEn8kBYf9itWFnf18ul1zPJtIlh/BR7w+GVDuvYy8eQe8Qy/KPUnImNbu5SoiujbrnM0TwTUEHadNmiP2as6uU3jS7uWaAExeSjfGqm6VkoPDFETxU8THUvr2xoRd/caLz6o71tUCHhUnI9lXDfvFOaUTwXezURmPc9VE32PKs/Q1SM0T8AAAAAAAAAABfvG5ZjvVRWhbPNC7xqoUysDa9bds5XI0TdU/m3TG3Ervfp3otbJCUiefIrDpYKzA8aw4JzfpFncSuBYnH4mUhSXNad39f1GjK/WRWHSybGNoVAgMvn8nhiGckNpQmg2k3ghQeO6+JhJy11TEkcEvp19tKbxrT0jOm+YlDKpPZv501OauKDuOwU/LKrxXH4tFuGSg8dkMPFT3r4pNjhO3EXjyCwyCL+QMzuINMuUoT/WRw3rEuaGtVNZ/RN3pTxDZhyqV5AvNZdQQ6l1KC5Zp5/X9wSCaDEpzFLukTaZzNeCi5/w59rI0dVFV0TnignUPLfYjMs1IzQUS9EhtKE8+6TUnNJf26ThE+dssgjAYILz/2J7oieKB2wolX8gT7supFPf6B5G1n45TB5pU9p2IbLINoXP9JF2TzLBGX/E3spSsk1r2SLmj2sit4RJrFET9I87bt0SF8MS6erXW+tVrWF0/YtF/ULWtO1OSWEjir+pLmtO7+vrXQRqDXMgvvgghHIDuopZEqUST3W/jmnj6W8LE4JBPPCU7+4ln7yQH3dydqcksJHNt9vfj1Ae51R19ZmzwiTeyGkW2EAY+Zwer+dJi45BzbOazgWV5xIXxbtyqkOic8UMCv9QtD7D9UO26Djj4hYnNPcMCUkttFB/9Ycr/qn9/C7mcRaIrPnM36oBqBkNhqmDa5esvZO8YVx5XHMyw6KGCAyoY0RelO6H1Q9pZqX9DW3oXprYFPltXaHHCiL7aePqPVCmn2jVgrZEC4Qo7Jwu51f2BKSeOsjfEsW4b5CwwQyyPh2bLrjwLz7ik5E5TT0iVEyOChf1zQ1qq1jMal96JurYGT+wgjjwLC1caPRlsvn4H8/5zSiP26xXcFkVfzWdxHHSYuOQf/SSv7WCIz5ZrFV92yvOJC+LZzJXe3Ykjgls9vmcSm2D2nTMEUfkHreVcB9IuvdpEqkzc+8p0kmywKGenhYyK2+GIvVTaZQEd1f3qfTVbVpHsLM4IlZ0ZqoRdMuPUFfesIL7LMSMEL9EdfUzcwiNQnXew6lo9DJRgK7RAXPSMs9wFhUa5O0J+Ub8wT/UtHQcRTmHMbWz8N2ZM3ZS/8sJZ7ZEBS4CN20gqJhAyjrjpwMpsY10GcvSM13oUm+v6/EVt8MZkDlwdPhaqbDcWK1PtINrlwvsYL4/xBBKge/zbcS3CHchMf3DPthFO2CETjPjQXZNMP8RtuqzjNOWQ1Hwp3YbhaO1aU9QnPug4whXCEuHJF0Eevs70il6488rpcL29rVUp0vcR2H09w4c/fxkRx7cRe5hB4TB3ArxZ6yinWPBE/KC3tQRd2qFmvrF8hHpmj1e7UhPlJqH7zOzzjbKWW4BPk0SDwmDqdQyxrxARk3Fl1Y2nV9eXRlWyemulfBDaYuyTJ7MjaZqTvRNaVCMilsurGxAwiNcBQO4A4wZO6jGUhAxzux11GvJ6P0zEBGTdRWtHY4uVohuylD7E3EI1XecmRcJ87aQXKQgZP61CDFoDK7+xFavMkG9I4WNZzr+GBq74kL1Tnytm/jAIR8YENzBn9kLxNuw9DxgqVGERqnaB2HaG/y/E/VwEqK95PiWHhcrUnuFOoT3MkgbCx5kPfH0thGMw4Qlw5rGjSt/fXvzfYITEDhkowFMcgFKokY3Kr+lxuYA21TrrFdDlHZXQEA6PzCcIV8Lxx5iMqWLlH6YfwRXtM3xi0d73Ylwm165Bsb+BzCDwmgGDZC/7cQA5B+QN+KElIxuRL6bhyjsroCAZb+wYzDp4XSSsaWVCFYWnnKU665PT85sQ2T8p7z5XjDnRJfX/RhqM+lsJSg2EQ2FrWkE36oQIbTNMSkTq7dYclRPrdRuy5FA8VGD1lmmsehpEUwj8sq9cZEJrXE/4GLdRoNtCmBlay+8HcIhxaed2QlJbv0m28obFJNQ537aAjXk/Jy/05W2to9rkN4OrvpvTUxAQi/x8ahTLn+Wm4Xt7WqpR/biAHrvKPPzrQYjuBqTj+ZiTui3qtoae2gujdyFZge6eMxW8oHiowx5slekX6oI1bQXTgZCsws19ji/9+rgJUS8mvnAwF+AjOWTCK+YtGro/FjanMVcOIgDSWx2dtDrHzPKrh5w3XurtiAjJuorS/1QIPhyAYccudXKdUqbcSzoQWadh96DxWimGEeF62c59CC7pssHQeK/EtW2Dqwc5Hdqw19xKDaRwsa7fZ/s7bX/zNsY9MNRqDH3nAEsMWBYLwq62uYqdMt+GlgByC7wb8Z6IYRfLLI1dRFGZfXfBNnb9A/S10J4ZYoDk9P7cxg9oFpAnRkuOwF6n7KM8LQGX5JamiKUK/PXzbdeInA0Y+ArMm4QxatdBs55aOgpWmLea5c/OzY26tQt9XHTgZwwzl7lSbcinXy8USmSr9ZeLRRvjvTpBWsChktwQeE0Aw4ovALt0q2tUJZ5MrSvSK6V0Hb+b7e8bcR4Qjmqy3VfYWZkAaS+29uAfWSF6o04mvYwWkG8IgrbSxPXU7MriXKfIRmX5YS7MyICkdaDGTztocf/9atsDJn4GOFrvV4n9n46GlnTTuJdIzzZj4roU7VKLZbfcK+ssQXnl5XS6ZubukJY5De2dEM0F4AYb2zohmgvDr8JKjuzR70rzX+mLxjR1VrdnX0BHFVx4L0+Rxsb3/3qpsL4CO6v70XuV9MfbIgKT1D6R/8ET8oBrdycNR9bWV6nZkbTNS+SIAAAAAAAAAAIWQnxb1jr6mRilFc6rxLMwKVRK/Odt9Lnjb2Fcx3SbVKc++CGwta0ghi102WDoPmxUs0q36zXisg6ORiOLHlbzDudplX3+Sap7LoBssHYnDB7X4UJ8vqep+6NbJJpQNzza2fhqvO27KhgeYWXAkJav7eEnf0xqzaUx8V8yTKlHi2WQTpg6KJ/8mPqVmxxWmcWxx/DRDdtyJSk9ZUoRjevja8xTpiyC88lcnaMFKuWaHEIjbfGguyLuIcHX5U3pqYi56RljzAsKiYZEW2+WCCE2ofd4BgybnCdzAGnecaZfo7cOcPax9UMimCjOhoHiowMGoK+RSs4uXP3Rr6hNKiOmiKMy+uv2aJ6vq2U4GjHwE9IlSsXgiflBc9Iyw+wSZWWAX4BVt5Iq9RDi08qc9NTGMUormSf9YhbUV75JN/Pt2DGYcIS6SVjS0kxlcxZp5hpzaUZoh0ZA+MpSBBbW+XC0ZSs6M1F8umEONTKI4Epzbm2+pyr7+OdSBsmAJ7wuMQd7R6/aRpY4VTm2mTZ7mSB9UsG+OzxP9iknYXh0ByeH1r8gmURwJTuP2mKMwde5nrVrHgi7sTbJDjdR8KMGZ2nWJ9oM32xzoks3ON8V8Id2jUwWX3lA8VGBqQvKqVD/3k11yen5zYhup4jKHUwdFnfFWoZ4Pwt/kd8Yd07TNnCJ95Yd/A5hqNBuUnrKkFcb07WIGEZRgKJNAY4DnWuhOEbCL53K21tDxb1CSkJHVls9t6GeV7D6e4N98+SdIK1gUMshqPhTuwm20cRnNp42swPbkAYnNEAy265KtvDoCj9/3sqAXwtLTUpwgDav40FyNazSnj5ui93c347RxnY8jHwFFvkI8L1u3wfceVf79iOVdaFMDK1nz7m5ls+nE/wc6qncqwzma5evsh4Ful/hCp1sRDi2y4EhKSzMSd8s92N7dvVEMrHnrn6U1IXlVKpH1x4qwqWhG4GptQ8foC0vwszoIybNUaxYe5TnxwjXrqZC+wb7yN2YGx7IsIJIzYUVpqusBUjtvwyialGlTq5Nazt0nKDj2PhM0DosEVeyhK6BSd6GyxJeP+KKlUSLKE+VAhiJ2E1hi0/HN243f3gi3bP5dHhLInkoXig5WgWsDlphn7l95lTMD7Vmv7XSLq3jXHW2Sny35PlPu9dio+Lp5jCr2GbFpjjnPa5Xdry90kQTi7CqcgOCIZCfOXI/YgluV6sTg2Zk6xgJxRpnDpRcwdvk9GxUfUKKfQp7VBeorx1lGNGZaz9x/S5hhsftTKSNC98chwAgOhkEwhpPNFpb9e3SHJzGScTaxS9NEbIpjoXIbZpo16KZoDkrKtljyOVCaFqTl3k70Loq5N6dDXug/CNkTTmI54mx/loJ5Gjwt9nSIP27wCoMpFjyOWn5C/etlkVyq7kx5gd21GfI0eFrx6A0lXd3j7Zi9cFCJijKpnMysKMpFGdpOZlauWYgPTLMdIg2XmPo31tsmMvlo8LT/zRqgDwlkTyWFRfo61RdeJN5y9GxUfF2yRhVxPoD7/w9+IHhDzytz0qr6vRfqNq7fYrT9ERus0W+Sz0q6p9vHLWfgs0FrXa1J+tO8oxaySRSoixXRUAaK7PkU4nwd6+Me/EBP5Ix1m+2iI37c/RQbUix4TlBw8XwmaBzmlsrBWBXzvDXSpks7tIGngAz/Kf59/fYe2frD1bqksGwmY6ke9ZnRA8EZkTRAQ0H3rU3tafIFVM2dlkm2G9aryMO95+rbE2jRMYmfsCr7ZR0Y41Lh+ufx2jkjWu98psGhu/XgqO5PepE3eAXPmgseMThxYYC/jlvZ+DrL2zzlgAJ15RXTi4l+Ry0/IfD7vMYtlG63ho6jlbo8JI0hlC4J5yI2Rb/eOYP/ZP65AuQbscl3QWMNENlXw8sXIrWNTsyieuxxnK4MO5n+y1GkjBX7FGWsgm0nMyvhvQR6116/AXn3M6+UGWDFZy7JbEGjxHXCf+umUkaE82Tv0P1144c07Z5gBAdDrhj7jimTue8UTThFPrEMYlqBaXhIB0I1XBJIz0LOFKbunhysH9YGMS3Oe4LWukeS6budFBx7H4caB1YWuA3BHEouuEnBmPIfp3d8qRgByNmlBrE0jkh+wnOtQbINHph7OkR0YKtVo8+744TmKANFdvIKG4fRbYl6YXMP4n3v5F1SWIPN5rjKPb63DCNkftAdERl6Nio+oFkjhLYfQPPxiT8QddRX0UQEcdxFWNo0I3A1uNymEWWH/CBDjZtn08mrJtArC1yI7g4lF2/nejgqtdqQJpzEctnY/jFjxB5G+qjLibervHcWQvUvfR3khS8SbzmoxrowJDOboGAFB9fO6IjIj+6Cxhogr65XokSJJteAEfyl5yg2pFjwByvOu49LTL1Je75K820koTyv6Zu3aVV9EvqevQWntanowEuqW4Nr20JzFI+sO3kFkIOEgShRwSHlV9NQbFWw/XL/mWrLTz1hPtoMjmTi3APwhoNW5rlJ6QTq1yq7Cw/8F6S1E1lncGrjyOFvBNU2f/hPMAKNr1cMGEbI/L06IjJbgSD39sqRCNRvojHs6j6mM02UdFM0ByVYQDlmworSSb7W86eanyH1aMy0g6X+li3QhXUbV+ExWv7QAj3lL9GOSw5bXyDmrd8aMy3pbrGrTKPOEPV7ZcYEEI97qNYsPNerB6OhEHPY4WsNrRKRvtVs8vNmQzUywJcuVXcmss7g1AAAAAAAAAAAywKkdt6bUCnk4y/Ui556wnNLZe4shPdeblOGvM1+EK8BtPyE58vKP8/oc1xlkF/VNhO/2g/0wuYRO4csMef26C/hi6JVBSrr6XS3LrxIoeQKvFZBuJ2Xm7RqpeYiArZuROwmsMS7/4emkDtbJ6UDx39oAZD8meZHl6hKOqcajZzdEu3hYDfqfMVUJR3dDchOiMVMfZVr4xNNkWlgSGYrXbCAcsyZCbmStd5ZYsXJfFGBuAOtGbY3ybL1l9lKgjDsCwiqxV9WXaTxMn/SAXKD1q2YkZ54815jarlRlnZ1H1Mk6SFnClN3T7n9PRwV1G1IkvZhlPvaSF9aNdxzEQFbN97T9HBUd6k9wAoOs4HNDY27iNgJxl/kNhYQSZe+rLpVIbcKyVaTsoxZ9MXiJUEYdtXbXrULIfSZVdehnPVcCW+pcka0w/hRn4VS1IeivTg1VGNdGBKXw1Ajwu/chRg78p9h+W7MDJN5U0iTo53cj+1e3wtZqgpUy6wsbRqfOJRc1667oNiqfecqv6AMCcXvKNhMxk889y+/IAP2TbFYeLOnJMffwG7J+AafMj9ogIaCzClqzVHQHJQFXiuuXMDFw2Jw4sIdYwG2O4QnIDgiGcDS8JAOhGq4JFL8byd6F0XSxpU8jOlNiw/gCfj+MJV1PmVbLHmSKE0LmEo31UNH38Tqta6/iAjipZo/0sCQzFa6nKDg//hM0DhMJZXkr63hYt9nCPSzvGMCv2IPI31U68qTQp0QHBGCYAl9T9CM3dTajC+bVy5g7O9winx/GMS0Hzow26Tf6dP/QAbxmn+w8Htfa/fdTcGe9B9tBkcycW6P+fvMhmpknTMwjI3lZ3REZIlxsPlyoCks1hpHJD9ht9jv64UR1MgnZpYctr5A0UejqrNfJfe4Et52FU5AcEQynVE9drZOVwaT80eax9L5Cqibiy5EdwechSl+uZ09haxpfjfmLfx9QMN3byWk7pOeW+BFyFDdj7Wthu1bpxH/GVLpHQvZz2FrNTfgqyVuQI/7lgf2wDECWnoLAvXhFtI8nfPYSGv7UGUMYhz/J8QIdfV9QMtx+l/TSm2qZhbaopBin181SSPshOLshHw9xQfDswJaNmgEPOIFqL+ebE2sCxn6gIvi6b67lLW5nFJ3x0+jeNm8lfA5e8zjMuUM260mJMdPzhKTMnl+Fyns6y6nCavC1rn2mVTR+F2JjL+6uFUahZp2+xfditsb6FiGNi9/tfZBP4/xNs2K0xEPpbu341wKL+7VFMxNEegwEO3Nfxq5oedd5V9C1YHu3kpVwTshtvL1U1/5ThSADMG0bRiIdh684V/bZSmROy0l6JdacYHCcYF/HOLXpVQuUsXLXFMSS/n3pr7vnCgdnnIufSHy9W7OFw2bgdyn5g6bggUctJQbHnEvYjxJ1zMh5Fz6Qvn33MuOen+Lug9gjpiDGgEPtkZHTM8NjolbI6mShVhPsnqVjMK1cgUzVENC1bjphO/zpQEtGzQCHnGMV6Ziaq50GAv/GfwG49gTEjW6nU1qfG3+ydRMF4+G7WVQZSPmoC5SiAN3LVwGIpOJiwH0/gtpHsD42r2K7YJZkUxOOuyYW2e+sQ3wgn+/lqlqaSea1Pja4eeGidzT1f8ugS4aKx+lU9H7rZDW66DKGBrFQ7I0MQ45FgT33yy5eCemJBxpURifAnU1E8zqr3xeZPKln8hMTvokfSseSJ9fWttk1xirR0xIefSnofInCkAVc9qDKpvrrjSXhnloYhxyUUg40qIwIwTwr2U3/XL2hR0GAj46a0S6Z4WIw85u3XNmqJP3zHCs/9TSTim17anfOFYyFHDqamwHw0GMDlpKgyvLsi9WNbrNBLRs0Ah42QoG7lq4DEQ7DzshH0h2yPnlCVjDiRLu3pjRSznNv4sBWTl7KSBy9Bvgh8BAkxPhaN6tJumIR8qjn04UDIScZ4W71f9VHbfz2FOgykbRXVykDc1gIMeH/jRvhLdtzxXD+1fe/aD8oSHkzkuNe2CWAS09msZCrSmKLGQIddi9EPCvFLNXxup7g3SsTWMh2JpFFjLtqWcJxxmyP/dsJLvzKLwGxmLVJpEsCPI84l7EeJKzZrl4KD9vTzm9wIyPnp1oM/1PORewnnn0N1k94G+ywIwQ1oh4QbHRS9oZsm7uMhOdsLSUh2Z12T4vglk3dxmHwFiQ6ax4PUZhdfGCfgP/bIcJlF3AqDU+uH9FFvllirW5Jj+Vc5h+sCDvuFUzC21RSDEq5qkbVCvLQWMx5BPGFgR5QI+OgYDTEaDv81FhwyVQOtBmIvm9lXDViHbZog1LjUmlUzE1VzoMi+Fo02TfkcQh9BsJ5/UKL48SsJsPJMGhLdpJzCypWT3EH1w0Vj5Xpr9U0U82qFaLgq983+BD9kGa6momhclD+Lzl3L+01+kdK7J63d55nQUga0Q8rtbmq217rpHJ9hvoRT64aKx8rlFjEce2UyLjMqTSPBSRuamS0I+1mC4DEcfKcKxkKODJ1NiJW8KWD1X8xXZCPpDsje/Xb/BQft6ecmc9z0XweozC6kqgYFSUH1yxWBD7W7De/Zxe/qHjvJrGk27dS0rcgAPrdBgI+OixDdIUXsG3KIWaIii8n3NQFylEJwoGQk69zNOXKu30Mxwr9gWZd+QKZqiGJVAwKkqBLtbdio2gpwN3R8UV+HqXDpt7MCPqqWAaxXi346o6c/utpg+2mTEequWXAAAAAAAAAAAxDvGdYgS09CKTcaZE22RVDeyvWRqWB5JcpJeLuKYklhwrGQo4dTU2QaKVtYLNYCwyedzBZCYnfcGhlKqfdkJxE52AOybf0KGuUcTUQegwFtgT+kStZd/BrAvyvEXU0hMjvmqSRsUV2UnXTQiSPc84nQUDISfQZucvf97/Xk1jx6R+KgFVJH0HmbFv8S+ov+1GYdQ5jJcqr9/Qu8ijP5VC3KeWlKUdBsuwIOu2faHnJboPBWNpbao05PGkgNX3bKfEOONOlRDq95OegSQ7ZPL8je+uRgctJc8sCPOjWG/wTtelY3WzzzpWIMlHzkDnhlBD+KPdhvGCKVaLeV6sammHgAMBHx27Il31NhLT9xReAxifddowDew8lXDbnDcgyfO7Ih5Xa3PbuHL2UkDk9TbdRDviUYiryKriH/442bNXqP1Dym7n5PEXyqNhS4mkfuz+NOcy4cZinoN0LEMbmbHUzzoWr4PC1mqq5agESZDpHCYnHXZMo71fkcS3TD9YEPl8bdBF+EGixn8a/Rn+YzFPyPlXI42YnOmnCQddUwbujlX8VAKqSPoOSPpWPJAjvrRl376rylI/dmyHfSLYvOHuzE0784XgReO+u2mzYRVzPhDqrWcg/UMots6xDnHl3Cq9zETvZzfgt1I/FY6kErCNmJx0xS22zmGb61mZK5Rd6Ios78oJd29Mo71rjVt+N4TrRz2xy12JMMP7osKbSqB0nCgYFSXOF2toMxHy0MQ45F/Tute+hLcf/G7RWuX6gJs2zbARbF7+dymRhEdSCVjIopBwuVlgRghTEg66pgzBAToMBHx01ohpaR4KxtLaSWhz20l05utHUXqDiv30BZnJWkrNM7TiH5lgRslPwDSX8OarkujRy46iM1TH9WY4VvHZPuFwr3uuTWFr0nvCKuZ8krOaEDl6g3CryLMwS46YkL+WcodjCwKyW2fWB7b8bhXQMcOXzlU/5ha6WwGwBrUlqJut5ilucMhqH1Jdd9NDW24QNXBXPfoLZg77Khf8lat2Mnqel2NL9kutnWRiRYv18YMMrtvD90jFyPVCZpEx/5UEShzcSLDLiSli3zz4uGawueII6TDBNaFPs/BhGnZ8jSYF8hwWATbWtxki/sxUnjcIlDilkH2LC12jjlgD1JxaW8yc6m88vO2uJG07c//l0rh+D94i7c5eVKuxyoGF7B3n+I/oBWG5rV4ahwE1oIwvKtvWZc7MdleAtaeC9YNYPtyKLu3kez/J2Vw1Br7nD4O+ER1sTgXupgO5CVk2dBAQPIG0gJ/eXSxptgJ9DHdKOZCA19XIeVMJ1B4WSHQGtM3WOxgmUF5f+Z3C9JsCmOic0FQKlDy2f7yoS3+JHxfFcj0ds7eN8qZ4qm5x5ztPLhQz5pmgcWcNhPIb5FRiB4KY3zMntNIPL/BJ3OLTdp5c22xgGZZW63pkh0ayB4tHgzLNI1mNy63PHqSVW/DH2oXpoUNAG51Gtf2Spdm77CG4yBOMeQ4Ljhsu4AuabXulYvhXEriTt/H86yj+2AvqlJ1WSmXrikDqTGyZiOhHSigjRTWJixIdjy2r2MAyMazL9Loukcq5hny9eWC+Pe+OJjoMEal3YC/W8MtQ4a0WyTUn6uIulANf/YkoZtEvXeLOGv8bGEGrm/OQn5M53oz+DUOWRyfIxIoL91JFAsaqrlMcm5xe86wQtBNPovpJQqsypT8WWmLlURIrx0FI2nbm49eSSEDl5GSyp9NyrkPWl4TaIztyoQXhGoakigSRSUGmOLS2hSXJ3nhl3eq6rKbPgAIKl3PCULa9iMKE/7tevTOTi6DfRyyPak4q72y3TZUcMkJ5g3IqMY1Bc/fN/784m7IHTAr5OCwCbIpqDwskOgNab9rlPF+Ikx/Gi5iWflOKw0T/WccaqOY54vzgzkOekimiDN4kedjNQBnon6LI69jp9Ea7z/OYJwxDs1M+IoTkVdgvDc2OlFBGUQZvErJs6CDnOVeva8VCbQgezlpAwW+gOxk9T8W/q3t/5mSI3xdNQg6YFO9wWATYgTeshXw518axczJE4YWoIWlcP4lvEfhn9s8GV+Pv9SQaq/J20Clj1S2jZk51uR5eAom9mBB30iiQwf199BNgjzxVN7b9k6kXqhIQfjkZouAGhtq1MJlreNqmsFWe44Juw04v91YIWodtU1ikT/9BN/xYdZWzWUisfKUJXMfV9n77FH9si3VKwL/rJquR3az5aJbvxWekkXPKmjHhHnxcM7vkQYaxMxWpDdt5O2iav+RwtKArp/ogjuR6OntzB/lRjOzVvhSjaCLu7Um5I7FE2Rdwi024s9wxYIghnydl/tOz+o/c8fJ6CZELLTH8pgmbD1LEo3jtbcxQzL9eutmBNGvVghF/ZipPlM6aUNT92d8rJbz7RSB1JmfEK2YfSfy/SSQg/HIyWd0DQ23UGMK7PB9uRRf4crORoIVjvGmvH2jUPqS67ruGtgHK0EwItWkUrJTKywmAyZhUw9hzmjc4ZCb+xcAtusrC3qnXeL4NOz4ED2ctIO65UOWw6jd7spBF8wqxNsu0JWBiAZwHNxIs++hrkwwTKC+hzBzrVC7lN0tTj9KKohs6CBthIjrYnArBNsJEdK0lFJ96I9Pp90ydBr4h9ueZaMXtz1+GgDYnjHf3BdYb61qcME0rR9FS3OCNX557/cI07Pgkd3hYPc0Y6oZ7pnxEFdWqTOGXnVppiZkAAAAAAAAAAOxk9CEzxpbxtXxVacFrEXHBx5JvRn+Ir2VNlv4PPi6XFfk21ajEDhm4pyxSqfGulalRfaoh2xncWNJxBPoY7pRZGKFI8q2HgFzdFina9lfEgnTBUWT7bPrR+xPbxuBW8n1v2RDPYJ9qtj84vdmpqk09n+f69SbAA3S7xwaHFJne32MHNLa4Uio60+0DzQrCb/reryCDwCPUwA1CI07K4buFOMuoXNdulsQCJQ5uJFjrR7w0EwJqXQWv16cfEUJypJeN94TMP2LjuW38HqFEx4Ehss85FZbIrjGOTo2VCRbzzpVWzD6S5WM4WlCb3X0QRzWBKaC156+j5vOH42NwK3ngdV1WU+lAAXvpA6X/+fQSErU8LJDoDHUzB/MVhX7E24+vuGoMYdMe2eXdgYYhOVJ3+KrSn9Yi4iW9qBQ1eHH+dXEXSo+h8MoTf+xgmF1lYTBEnsGdvH/npUDU3UH0zyzcIGrgrnrpFluRHNDi2lWosjBfkPlHEx00S/nsvVLGt10XxmXSQz7QGCJP7sBesf2eWemShEtkV5pWjr+kpd0Ho8YOaHFtpFR+LLTE16IkVoexdjBMoLy+QTrupjLzNn2ZFeNrvGdmO0DwPuo6Rl9pHC0ow+CwCK1OaCoFSh5bsQXFt2EoW9BE4b+NGltcKRXywGF6wwFMdLf16PHRHMNZY8tMSz+nRe+dGoRGnInfa+M2MIJLK/s91fR09uYO76L1jGuD+y1OGEZ25F8K3zQRIHgfdR0jobq9Ypszgap+0a4dd1MZ9xuw/tHIDaMumoRVCQg/koJRcCmsAWNVV6cOp8lpRVGDHQSOZWgmBNS6ChH2UfiIKrdJ133JbvZ5PYrvJ5n1KwQtzUju8LB6hzDJIvGi7Q1Uc5JhQvHTL9CXx0pnTShq8OLhgP18yXSMvtJxfnBnr09JmpOCkKns0duziOOykzRN0XInNBWMJQ+j1g"));function f(e,t){return e[t>>2]>>((3&t)<<3)&255}function h(e,t){for(var r,n,i=0,a=0;a<16;a++)r=(65535&e[a])+(65535&t[a])+(i||0),n=(e[a]>>>16)+(t[a]>>>16)+(r>>>16),e[a]=65535&r|n<<16,i=n>>>16}function l(e){return new Int32Array(e.buffer,e.byteOffset,16)}function d(e,t){for(var r=0;r<16;r++)e[r]=t[r]}function p(){return new Int32Array(16)}function g(e,t){for(var r=0;r<16;r++)e[r]=e[r]^t[r]}var y=p();function v(e,t){d(y,e),g(y,t);for(var r=0;r<8;r++){var n,i,a=f(y,r)<<1;n=s[a],i=s[a+1];for(var o=1;o<8;o++)a=(o<<9)+(f(y,(o<<3)+r)<<1),n^=s[a],i^=s[a+1];e[r<<1]=n,e[1+(r<<1)]=i}}var m=p(),b=p();function w(e,t,r){var n;for(d(m,e),v(m,t),d(b,m),v(m,r),n=0;n<11;n++)v(b,a[n]),v(m,b);v(b,a[11]),g(m,b),g(e,m),g(e,r)}function S(e){var a=l(e);w(i,n,a),h(n,t),h(r,a)}function E(t){var a=t.length;if(!(a>63)){var s=new Int32Array(16);s[0]=a<<3;for(var o=new Uint8Array(64),c=0;c>>8}}var d=new Uint8Array([0,255,0,255,0,255,0,255,255,0,255,0,255,0,255,0,0,255,255,0,255,0,0,255,255,0,0,0,255,255,0,255]);return function(i){t=new Uint8Array(32),r=new Uint8Array(32),n=new Uint8Array(32),e=new Array(4);for(var a=0;a<4;a++)e[a]=new Uint8Array(32);s(d,0,e[2],0,d.length);var c=new Uint8Array(u(i)),f=c.length,p=f%32,g=(f-p)/32;for(a=0;a0){y=new Uint8Array(c.buffer,32*g);var v=new Uint8Array(32);s(y,0,v,0,p),l.call(this,v),h.call(this,v,0)}for(var m=new Uint8Array(32),b=8*f,w=0;b>0;)m[w++]=255&b,b=Math.floor(b/256);h.call(this,m,0),h.call(this,n,0);var S=t.buffer;return"SC"===this.procreator&&(S=o(S)),S}}(),l=function(){var e,t=new Uint32Array(80);function r(e,t,r,n,i){return i+t+r+n+(e<<5|e>>>27)>>>0}function n(e,t,n,i,a,s){return r(e,a,s,1518500249,i^t&(n^i))}function i(e,t,n,i,a,s){return r(e,a,s,1859775393,t^n^i)}function a(e,t,n,i,a,s){return r(e,a,s,2400959708,t&n|i&(t|n))}function s(e,t,n,i,a,s){return r(e,a,s,3395469782,t^n^i)}function o(e,t){for(var r=e[0],o=e[1],c=e[2],u=e[3],f=e[4],h=n,l=0;l<80;l+=5)20===l?h=i:40===l?h=a:60===l&&(h=s),f=h(r,o,c,u,f,t[l]),u=h(f,r,o=(o<<30|o>>>2)>>>0,c,u,t[l+1]),c=h(u,f,r=(r<<30|r>>>2)>>>0,o,c,t[l+2]),o=h(c,u,f=(f<<30|f>>>2)>>>0,r,o,t[l+3]),r=h(o,c,u=(u<<30|u>>>2)>>>0,f,r,t[l+4]),c=(c<<30|c>>>2)>>>0;e[0]+=r,e[1]+=o,e[2]+=c,e[3]+=u,e[4]+=f}function c(e){return(255&e)<<24|(65280&e)<<8|e>>8&65280|e>>24&255}return function(r){var n=new Uint8Array(u(r)),i=n.length,a=i+9;a%64&&(a+=64-a%64),(e=new Uint32Array(5))[0]=1732584193,e[1]=4023233417,e[2]=2562383102,e[3]=271733878,e[4]=3285377520;for(var s=0;s=0&&d<4&&(h=i<<3>>>8*d&255)}f%4==0?t[f>>2]=h<<24:t[f>>2]|=h<<8*(3-f%4)}for(f=16;f<80;f++){var p=t[f-3]^t[f-8]^t[f-14]^t[f-16];t[f]=p<<1|p>>>31}o(e,t)}for(f=0;f<5;f++)e[f]=c(e[f]);return e.buffer}}();function d(e,t){var r=this.digest===h?32:64,n=this.bitLength/8,i=u(e),a=u(t);if(i.byteLength===r)s=new Uint8Array(i);else{var s=new Uint8Array(r);i.byteLength>r?s.set(new Uint8Array(this.digest(i))):s.set(new Uint8Array(i))}for(var o=new Uint8Array(r+a.byteLength),c=new Uint8Array(r+n),f=0;f0)throw new a.DataError("Length must multiple of 8");for(var r=this.bitLength/8,n=this.digest===h?32:64,i=t/8,o=this.iterations,c=this.diversifier,f=new Uint8Array(n),l=0;l=0;--k)F=(I=S[n*B+k]+x[k]+F)>>>8,S[n*B+k]=255&I}var R=new Uint8Array(i);return s(C,0,R,0,i),R.buffer}function v(e,t){if(t%8>0)throw new a.DataError("Length must be multiple of 8");var r,n=t/8,i=new Uint8Array(u(this.context)),s=this.bitLength/8,o=Math.ceil(n/s);r=this.label?new Uint8Array(u(this.label)):new Uint8Array([38,189,184,120]);for(var c=new Uint8Array(n),f=0;f>>8,h[h.length-1]=255&t,c.set(new Uint8Array(d.call(this,e,h),0,f0)throw new a.DataError("Length must be more than "+this.bitLength/2+" bits and multiple of 8");var n=this.bitLength/8,i=t/8,o=this.iterations,c=new Uint8Array(u(e)),f=new Uint8Array(u(this.salt)),h=f.byteLength,l=new Uint8Array(h+4);if(s(f,0,l,0,h),i>137438953408)throw new a.DataError("Invalid parameters: Length value");for(var p=Math.ceil(i/n),g=new Uint8Array(i),y=1;y<=p;y++){l[h]=y>>>24&255,l[h+1]=y>>>16&255,l[h+2]=y>>>8&255,l[h+3]=255&y;for(var v=new Uint8Array(d.call(this,c,l)),m=v,b=1;b1){var E=i/r,C=new Uint8Array(E);return s(g,i-E,C,0,E),C.buffer}return g.buffer}function b(e,t){if(t>this.bitLength||t%8>0)throw new a.DataError("Length can't be more than "+this.bitLength+" bits and multiple of 8");var r=this.digest===h?32:64,n=this.bitLength/8,i=!!(e&&e.byteLength>0)&&new Uint8Array(u(e)),o=i?i.length:0,c=this.iterations,f=new Uint8Array(u(this.salt)),l=f.length,d=new Uint8Array(l+o);s(f,0,d,0,l),i&&s(i,0,d,l,o);for(var p=new Uint8Array(this.digest(d)),g=new Uint8Array(r),y=new Uint8Array(r),v=new Uint8Array(r),m=0;m<32;m++)g[m]="DENEFH028.760246785.IUEFHWUIO.EF".charCodeAt(m);d=new Uint8Array(2*(r+n));for(var b=0;b>3,this.name=(e.name||(1===e.version?"RC2":1989===e.version?"GOST 28147":"GOST R 34.12"))+(e.version>4?"-"+(e.version||1989)%100:"")+"-"+(64===this.blockLength?"":this.blockLength+"-")+("MAC"===e.mode?"MAC-"+(e.macLength||this.blockLength>>1):"KW"===e.mode||e.keyWrapping?("NO"!==(e.keyWrapping||"NO")?e.keyWrapping:"")+"KW":(e.block||"ECB")+(("CFB"===e.block||"OFB"===e.block||"CTR"===e.block&&2015===e.version)&&e.shiftBits&&e.shiftBits!==this.blockLength?"-"+e.shiftBits:"")+(e.padding?"-"+(e.padding||("CTR"===e.block||"CFB"===e.block||"OFB"===e.block?"NO":"ZERO"))+"PADDING":"")+("NO"!==(e.keyMeshing||"NO")?"-CPKEYMESHING":""))+(e.procreator?"/"+e.procreator:"")+("string"==typeof e.sBox?"/"+e.sBox:""),this.procreator=e.procreator,e.version||1989){case 1:this.process=O,this.keySchedule=N,this.blockLength=64,this.effectiveLength=e.length||32,this.keySize=8*Math.ceil(this.effectiveLength/8),this.blockSize=this.blockLength>>3;break;case 2015:if(this.version=2015,64===this.blockLength)this.process=R,this.keySchedule=_;else{if(128!==this.blockLength)throw new n.DataError("Invalid block length");this.process=I,this.keySchedule=T}this.processMAC=Y;break;case 1989:if(this.version=1989,this.process=k,this.processMAC=W,this.keySchedule=D,64!==this.blockLength)throw new n.DataError("Invalid block length");break;default:throw new n.NotSupportedError("Algorithm version "+e.version+" not supported")}switch(e.mode||e.keyWrapping&&"KW"||"ES"){case"ES":switch(e.block||"ECB"){case"ECB":this.encrypt=L,this.decrypt=U;break;case"CTR":1989===this.version?(this.encrypt=j,this.decrypt=j):(this.encrypt=V,this.decrypt=V,this.shiftBits=e.shiftBits||this.blockLength);break;case"CBC":this.encrypt=G,this.decrypt=q;break;case"CFB":this.encrypt=K,this.decrypt=M,this.shiftBits=e.shiftBits||this.blockLength;break;case"OFB":this.encrypt=H,this.decrypt=H,this.shiftBits=e.shiftBits||this.blockLength;break;default:throw new n.NotSupportedError("Block mode "+e.block+" not supported")}if("CP"===e.keyMeshing?this.keyMeshing=he:this.keyMeshing=le,this.encrypt===L||this.encrypt===G)switch(e.padding){case"PKCS5P":this.pad=pe,this.unpad=ge;break;case"RANDOM":this.pad=be,this.unpad=de;break;case"BIT":this.pad=ve,this.unpad=me;break;default:this.pad=ye,this.unpad=de}else this.pad=de,this.unpad=de;this.generateKey=z;break;case"MAC":this.sign=J,this.verify=Q,this.generateKey=z,this.macLength=e.macLength||this.blockLength>>1,this.pad=de,this.unpad=de,this.keyMeshing=le;break;case"KW":switch(this.pad=de,this.unpad=de,this.keyMeshing=le,e.keyWrapping){case"CP":this.wrapKey=te,this.unwrapKey=re,this.generateKey=z,this.shiftBits=e.shiftBits||this.blockLength;break;case"SC":this.wrapKey=ae,this.unwrapKey=se,this.generateKey=oe;break;default:this.wrapKey=Z,this.unwrapKey=$,this.generateKey=z}break;case"MASK":this.wrapKey=ue,this.unwrapKey=fe,this.generateKey=z;break;default:throw new n.NotSupportedError("Mode "+e.mode+" not supported")}var t,r=e.sBox;if(r){if("string"==typeof r){if(t=r.toUpperCase(),!(r=c[t]))throw new SyntaxError("Unknown sBox name: "+e.sBox)}else if(!r.length||r.length!==c["E-Z"].length)throw new SyntaxError("Length of sBox must be "+c["E-Z"].length)}else r=2015===this.version?c["E-Z"]:"SC"===this.procreator?c["E-SC"]:c["E-A"];if(this.sBox=r,e.iv){if(this.iv=new Uint8Array(e.iv),this.iv.byteLength!==this.blockSize&&1989===this.version)throw new SyntaxError("Length of iv must be "+this.blockLength+" bits");if(this.iv.byteLength!==this.blockSize>>1&&this.encrypt===V)throw new SyntaxError("Length of iv must be "+this.blockLength>>"1 bits");if(this.iv.byteLength%this.blockSize!=0&&this.encrypt!==V)throw new SyntaxError("Length of iv must be a multiple of "+this.blockLength+" bits")}else this.iv=128===this.blockLength?y:o;if(e.ukm&&(this.ukm=new Uint8Array(e.ukm),8*this.ukm.byteLength!==this.blockLength))throw new SyntaxError("Length of ukm must be "+this.blockLength+" bits")};var n=r(19),i=r(25),a=ArrayBuffer,s=function(){var e=new a(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}(),o=new Uint8Array([0,0,0,0,0,0,0,0]),c={"E-TEST":[4,2,15,5,9,1,0,8,14,3,11,12,13,7,10,6,12,9,15,14,8,1,3,10,2,7,4,13,6,0,11,5,13,8,14,12,7,3,9,10,1,5,2,4,6,15,0,11,14,9,11,2,5,15,7,1,0,13,12,6,10,4,3,8,3,14,5,9,6,8,0,13,10,11,7,12,2,1,15,4,8,15,6,11,1,9,12,5,13,3,7,10,0,14,2,4,9,11,12,0,3,6,7,5,4,8,14,15,1,10,2,13,12,6,5,2,11,0,9,13,3,14,7,10,15,4,1,8],"E-A":[9,6,3,2,8,11,1,7,10,4,14,15,12,0,13,5,3,7,14,9,8,10,15,0,5,2,6,12,11,4,13,1,14,4,6,2,11,3,13,8,12,15,5,10,0,7,1,9,14,7,10,12,13,1,3,9,0,2,11,4,15,8,5,6,11,5,1,9,8,13,15,0,14,4,2,3,12,7,10,6,3,10,13,12,1,2,0,11,7,5,9,4,8,15,14,6,1,13,2,9,7,10,6,0,8,12,4,5,15,3,11,14,11,10,15,5,0,12,14,8,6,2,3,9,1,7,13,4],"E-B":[8,4,11,1,3,5,0,9,2,14,10,12,13,6,7,15,0,1,2,10,4,13,5,12,9,7,3,15,11,8,6,14,14,12,0,10,9,2,13,11,7,5,8,15,3,6,1,4,7,5,0,13,11,6,1,2,3,10,12,15,4,14,9,8,2,7,12,15,9,5,10,11,1,4,0,13,6,8,14,3,8,3,2,6,4,13,14,11,12,1,7,15,10,0,9,5,5,2,10,11,9,1,12,3,7,4,13,0,6,15,8,14,0,4,11,14,8,3,7,1,10,2,9,6,15,13,5,12],"E-C":[1,11,12,2,9,13,0,15,4,5,8,14,10,7,6,3,0,1,7,13,11,4,5,2,8,14,15,12,9,10,6,3,8,2,5,0,4,9,15,10,3,7,12,13,6,14,1,11,3,6,0,1,5,13,10,8,11,2,9,7,14,15,12,4,8,13,11,0,4,5,1,2,9,3,12,14,6,15,10,7,12,9,11,1,8,14,2,4,7,3,6,5,10,0,15,13,10,9,6,8,13,14,2,0,15,3,5,11,4,1,12,7,7,4,0,5,10,2,15,14,12,6,1,11,13,9,3,8],"E-D":[15,12,2,10,6,4,5,0,7,9,14,13,1,11,8,3,11,6,3,4,12,15,14,2,7,13,8,0,5,10,9,1,1,12,11,0,15,14,6,5,10,13,4,8,9,3,7,2,1,5,14,12,10,7,0,13,6,2,11,4,9,3,15,8,0,12,8,9,13,2,10,11,7,3,6,5,4,14,15,1,8,0,15,3,2,5,14,11,1,10,4,7,12,9,13,6,3,0,6,15,1,14,9,2,13,8,12,4,11,10,5,7,1,10,6,8,15,11,0,4,12,3,5,9,7,13,2,14],"E-SC":[3,6,1,0,5,7,13,9,4,11,8,12,14,15,2,10,7,1,5,2,8,11,9,12,13,0,3,10,15,14,4,6,15,1,4,6,12,8,9,2,14,3,7,10,11,13,5,0,3,4,15,12,5,9,14,0,6,8,7,10,1,11,13,2,6,9,0,7,11,8,4,12,2,14,10,15,1,13,5,3,6,1,2,15,0,11,9,12,7,13,10,5,8,4,14,3,0,2,14,12,9,1,4,7,3,15,6,8,10,13,11,5,5,2,11,8,4,12,7,1,10,6,14,0,9,3,13,15],"E-Z":[12,4,6,2,10,5,11,9,14,8,13,7,0,3,15,1,6,8,2,3,9,10,5,12,1,14,4,7,11,13,0,15,11,3,5,8,2,15,10,13,14,1,7,4,12,9,6,0,12,8,2,1,13,4,15,6,7,0,10,5,3,14,9,11,7,15,5,10,8,1,6,13,0,9,3,14,11,4,2,12,5,13,15,6,9,2,12,10,11,7,8,1,4,3,14,0,8,14,2,5,6,9,1,12,15,4,11,0,13,10,3,7,1,7,14,13,0,5,8,3,4,15,10,6,9,12,11,2],"D-TEST":[4,10,9,2,13,8,0,14,6,11,1,12,7,15,5,3,14,11,4,12,6,13,15,10,2,3,8,1,0,7,5,9,5,8,1,13,10,3,4,2,14,15,12,7,6,0,9,11,7,13,10,1,0,8,9,15,14,4,6,12,11,2,5,3,6,12,7,1,5,15,13,8,4,10,9,14,0,3,11,2,4,11,10,0,7,2,1,13,3,6,8,5,9,12,15,14,13,11,4,1,3,15,5,9,0,10,14,7,6,8,2,12,1,15,13,0,5,7,10,4,9,2,3,14,6,11,8,12],"D-A":[10,4,5,6,8,1,3,7,13,12,14,0,9,2,11,15,5,15,4,0,2,13,11,9,1,7,6,3,12,14,10,8,7,15,12,14,9,4,1,0,3,11,5,2,6,10,8,13,4,10,7,12,0,15,2,8,14,1,6,5,13,11,9,3,7,6,4,11,9,12,2,10,1,8,0,14,15,13,3,5,7,6,2,4,13,9,15,0,10,1,5,11,8,14,12,3,13,14,4,1,7,0,5,10,3,12,8,15,6,2,9,11,1,3,10,9,5,11,4,15,8,6,7,14,13,0,2,12],"D-SC":[11,13,7,0,5,4,1,15,9,14,6,10,3,12,8,2,1,2,7,9,13,11,15,8,14,12,4,0,5,6,10,3,5,1,13,3,15,6,12,7,9,8,11,2,4,14,0,10,13,1,11,4,9,12,14,0,7,5,8,15,6,2,10,3,2,13,10,15,9,11,3,7,8,12,5,14,6,0,1,4,0,4,6,12,5,3,8,13,10,11,15,2,1,9,7,14,1,3,12,8,10,6,11,0,2,14,7,9,15,4,5,13,10,11,6,0,1,3,4,7,14,13,5,15,8,2,9,12]},u=new Uint8Array([105,0,114,34,100,201,4,35,141,58,219,150,70,233,42,196,24,254,172,148,0,237,7,18,192,134,220,194,239,76,169,43]);function f(e){return e>=2147483648?e-4294967296:e}function h(e){return e<0?e+4294967296:e}function l(e){if(e instanceof a)return e;if(e&&e.buffer&&e.buffer instanceof a)return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(new Uint8Array(e,e.byteOffset,e.byteLength)).buffer;throw new n.DataError("CryptoOperationData required")}function d(e){return new Uint8Array(l(e))}function p(e){return new Uint8Array(d(e))}function g(e){return(255&e)<<24|(65280&e)<<8|e>>8&65280|e>>24&255}var y=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),v=function(){function e(e,t){var r,n,i=0;for(r=0;r<8;r++)1&t&&(i^=e),n=128&e,e=e<<1&255,n&&(e^=195),t>>=1;return 255&i}for(var t=[1,16,32,133,148,192,194,251],r=[],n=0;n<8;n++){r[n]=[];for(var i=0;i<256;i++)r[n][i]=e(t[n],i)}return r}(),m=[4,2,3,1,6,5,0,7,0,5,6,1,3,2,4,0];function b(e){for(var t=0,r=0;r<16;r++)t^=v[m[r]][e[r]];for(r=16;r>0;--r)e[r]=e[r-1];e[0]=t}function w(e){for(var t=e[0],r=0;r<15;r++)e[r]=e[r+1];e[15]=t;var n=0;for(r=0;r<16;r++)n^=v[m[r]][e[r]];e[15]=n}var S=[252,238,221,17,207,110,49,22,251,196,250,218,35,197,4,77,233,119,240,219,147,46,153,186,23,54,241,187,20,205,95,193,249,24,101,90,226,92,239,33,129,28,60,66,139,1,142,79,5,132,2,174,227,106,143,160,6,11,237,152,127,212,211,31,235,52,44,81,234,200,72,171,242,42,104,162,253,58,206,204,181,112,14,86,8,12,118,18,191,114,19,71,156,183,93,135,21,161,150,41,16,123,154,199,243,145,120,111,157,158,178,177,50,117,25,61,255,53,138,126,109,84,198,128,195,189,13,87,223,245,36,169,62,168,67,201,215,121,214,246,124,34,185,3,224,15,236,222,122,148,176,188,220,232,40,80,78,51,10,74,167,151,96,115,30,0,98,68,26,184,56,130,100,159,38,65,173,69,70,146,39,94,85,47,140,163,165,125,105,213,149,59,7,88,179,64,134,172,29,247,48,55,107,228,136,217,231,137,225,27,131,73,76,63,248,254,141,83,170,144,202,216,133,97,32,113,103,164,45,43,9,91,203,155,37,208,190,229,108,82,89,166,116,210,230,244,180,192,209,102,175,194,57,75,99,182],E=function(){for(var e=[],t=0,r=S.length;t>4&15)]<<4,i|=e[32+(n>>8&15)]<<8,i|=e[48+(n>>12&15)]<<12,i|=e[64+(n>>16&15)]<<16,i|=e[80+(n>>20&15)]<<20,i|=e[96+(n>>24&15)]<<24,n=(i|=e[112+(n>>28&15)]<<28)<<11|i>>>21,n^=t[1],t[1]=t[0],t[0]=n}function k(e,t,r){r=r||t.byteOffset;for(var n=this.sBox,i=new Int32Array(t.buffer,r,2),a=0;a<32;a++)F(n,i,e[a]);var s=i[0];i[0]=i[1],i[1]=s}function R(e,t,r){r=r||t.byteOffset;var n=this.sBox,i=new Int32Array(t.buffer,r,2),a=g(i[0]);i[0]=g(i[1]),i[1]=a;for(var s=0;s<32;s++)F(n,i,e[s]);i[0]=g(i[0]),i[1]=g(i[1])}function D(e,t){for(var r=new Int32Array(32),n=new Int32Array(l(e)),i=0;i<8;i++)r[i]=n[i];if(t){for(i=0;i<8;i++)r[i+8]=r[7-i];for(i=0;i<8;i++)r[i+16]=r[7-i]}else{for(i=0;i<8;i++)r[i+8]=r[i];for(i=0;i<8;i++)r[i+16]=r[i]}for(i=0;i<8;i++)r[i+24]=r[7-i];return r}function _(e,t){for(var r=new Int32Array(32),n=new Int32Array(l(e)),i=0;i<8;i++)r[i]=g(n[i]);if(t){for(i=0;i<8;i++)r[i+8]=r[7-i];for(i=0;i<8;i++)r[i+16]=r[7-i]}else{for(i=0;i<8;i++)r[i+8]=r[i];for(i=0;i<8;i++)r[i+16]=r[i]}for(i=0;i<8;i++)r[i+24]=r[7-i];return r}var P,N=(P=new Uint8Array([217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173]),function(e){for(var t=new Uint8Array(l(e)),r=Math.min(t.length,128),n=this.effectiveLength,i=Math.floor((n+7)/8),a=255%Math.pow(2,8+n-8*i),s=new Uint8Array(128),o=new Uint16Array(s.buffer),c=0;c=0;--c)s[c]=P[s[c+1]^s[c+i]];return o}),O=function(){var e,t,r,n=new Uint16Array(4),i=new Uint16Array([1,2,3,5]);function a(a){r?(n[a]=function(e,t){return 65535&(e>>>t|e<<16-t)}(n[a],i[a]),n[a]=n[a]-e[t]-(n[(a+3)%4]&n[(a+2)%4])-(~n[(a+3)%4]&n[(a+1)%4]),t-=1):(n[a]=n[a]+e[t]+(n[(a+3)%4]&n[(a+2)%4])+(~n[(a+3)%4]&n[(a+1)%4]),t+=1,n[a]=function(e,t){return 65535&(e<>>16-t)}(n[a],i[a]))}function s(t){n[t]=r?n[t]-e[63&n[(t+3)%4]]:n[t]+e[63&n[(t+3)%4]]}function o(e,t){t=t||1;for(var n=0;n=0;--i)e(i);else for(i=0;i<4;i++)e(i)}return function(i,c,u,f){r=f,n=new Uint16Array(c.buffer,u||c.byteOffset,4),e=i,t=f?63:0,o(a,5),o(s),o(a,6),o(s),o(a,5)}}();function L(e,t){for(var r=this.pad(d(t)),n=this.blockSize,i=r.byteLength/n,a=this.keySchedule(e),s=0;s>3,c=i.length,u=c%o,f=(c-u)/o,h=this.keySchedule(e),l=0;l0)for(this.process(h,n),l=0;l>3,c=i.length,u=c%o,f=(c-u)/o,h=this.keySchedule(e),l=0;l0)for(this.process(h,n),l=0;l>3,c=new Uint8Array(o),u=i.length,f=u%o,h=(u-f)/o,l=this.keySchedule(e),d=0;d0)for(this.process(l,n),d=0;d0)for(d[0]=d[0]+16843009&4294967295,y=h(d[1])+16843012,d[1]=f(y<4294967296?y:y-4294967295),this.process(l,d),g=0;g>3,s=n.length,o=s%a,c=(s-o)/a,u=new Uint8Array(i),f=new Int32Array(i),h=this.keySchedule(e);u.set(r||this.iv);for(var l=0;l=0;--l){if(!(u[d]>254)){u[d]++;break}u[d]-=254}}if(o>0)for(this.process(h,u),d=0;d=0;--n){var i=e[n]>>>7;e[n]=e[n]<<1&255|t,t=i}0!==t&&(16===r?e[15]^=135:e[7]^=27)}function Y(e,t,r){var n=this.blockSize,i=(this.sBox,d(r)),a=new Uint8Array(n);this.process(e,a),X(a),r.byteLength%n!=0&&(i=ve.call(this,d(r)),X(a));for(var s=0,o=i.length/n;s>3)||this.blockSize>>1;this.processMAC(n,i,t);var s=new Uint8Array(a);return s.set(new Uint8Array(i.buffer,0,a)),s.buffer}function Q(e,t,r,n){var i=new Uint8Array(J.call(this,e,r,n)),a=d(t);if(i.length!==a.length)return!1;for(var s=0,o=i.length;s>1);if(!this.ukm)throw new n.DataError("UKM must be defined");var s=new Uint8Array(this.ukm),o=J.call(this,e,t,s),c=L.call(this,e,t),u=new Uint8Array(a);return u.set(new Uint8Array(c),0),u.set(new Uint8Array(o),i),u.buffer}function $(e,t){var r=this.blockSize,i=this.keySize,a=i+(r>>1),s=l(t);if(s.byteLength!==a)throw new n.DataError("Wrapping key size must be "+a+" bytes");if(!this.ukm)throw new n.DataError("UKM must be defined");var o=new Uint8Array(this.ukm),c=new Uint8Array(s,0,i),u=new Uint8Array(s,i,r>>1),f=U.call(this,e,c);if(!Q.call(this,e,u,f,o))throw new n.DataError("Error verify MAC of wrapping key");return f}function ee(e,t){for(var r=this.blockSize,n=new Int32Array(l(e)),i=[],a=0;a>>s&1}for(a=0;a>1);if(!this.ukm)throw new n.DataError("UKM must be defined");var s=new Uint8Array(this.ukm),o=ee.call(this,e,s),c=J.call(this,o,t,s),u=L.call(this,o,t),f=new Uint8Array(a);return f.set(new Uint8Array(u),0),f.set(new Uint8Array(c),i),f.buffer}function re(e,t){var r=this.blockSize,i=this.keySize,a=i+(r>>1),s=l(t);if(s.byteLength!==a)throw new n.DataError("Wrapping key size must be "+a+" bytes");if(!this.ukm)throw new n.DataError("UKM must be defined");var o=new Uint8Array(this.ukm),c=new Uint8Array(s,0,i),u=new Uint8Array(s,i,r>>1),f=ee.call(this,e,o),h=U.call(this,f,c);if(!Q.call(this,f,u,h,o))throw new n.DataError("Error verify MAC of wrapping key");return h}function ne(e,t){var r=this.blockSize>>1,a=this.keySize,s=8,o=new Uint8Array(l(e));if(o.byteLength!==a)throw new n.DataError("Wrong cleartext size "+o.byteLength+" bytes");if(t=t||this.ukm){if(!((t=new Uint8Array(l(t))).byteLength>0&&t.byteLength%a==0))throw new n.DataError("Wrong rand size "+t.byteLength+" bytes");s=t.byteLength/a+1}else(0,i.randomSeed)(t=new Uint8Array((s-1)*a));var c=new Uint8Array(s*a+r+2),u=c.buffer,f=new Uint8Array(a),h=J.call(this,o,f);c[0]=34,c[1]=s,c.set(new Uint8Array(h),2),c.set(t,a+r+2);for(var d=1;d>1,r=this.keySize,i=l(e);if(34!==new Uint8Array(i,0,1)[0])throw new n.DataError("Invalid magic number");for(var a=new Uint8Array(i,1,1)[0],s=new Uint8Array(i,2,t),o=new Uint8Array(r),u=0;u>1,n=this.keySize,i=l(e),a=l(t);i.byteLength!==n&&(i=ie.call(this,i));var s=L.call(this,i,a),o=J.call(this,i,a),c=new Uint8Array(r+n);return c.set(new Uint8Array(s),0),c.set(new Uint8Array(o),n),c.buffer}function se(e,t){var r=this.blockSize>>1,i=this.keySize,a=l(e),s=l(t);a.byteLength!==i&&(a=ie.call(this,a));var o=new Uint8Array(s,0,i),c=new Uint8Array(s,i,r),u=U.call(this,a,o);if(!Q.call(this,a,c,u))throw new n.DataError("Invalid key MAC");return u}function oe(){return ne.call(this,z.call(this))}function ce(e,t,r,n){var i=n/4,a=new Int32Array(l(e)),s=new Int32Array(l(t)),o=new Int32Array(i);if(r)for(var c=0;cr)throw(0,n.DataError)("Invalid padding");var s=new Uint8Array(a);return a>0&&s.set(new Uint8Array(e.buffer,0,a)),s}function ye(e){var t=e.byteLength,r=this.blockSize,n=Math.ceil(t/r)*r,i=new Uint8Array(n);i.set(e);for(var a=t;a1&&0===e[t-1];)t--;if(1!==e[t-1])throw(0,n.DataError)("Invalid padding");t--;var r=new Uint8Array(t);return t>0&&r.set(new Uint8Array(e.buffer,0,t)),r}function be(e){var t=e.byteLength,r=this.blockSize,n=r-t%r,a=Math.ceil(t/r)*r,s=new Uint8Array(a),o=new Uint8Array(s.buffer,t,n);return s.set(e),(0,i.randomSeed)(o),s}},function(e,t,r){(function(t){var n=r(3);e.exports=function(e,r){return new t(e.toRed(n.mont(r.modulus)).redPow(new n(r.publicExponent)).fromRed().toArray())}}).call(this,r(2).Buffer)},function(e,t){e.exports=function(e,t){for(var r=e.length,n=-1;++n=31?n.error("Multi-octet tag encoding unsupported"):(t||(i|=32),i|=o.tagClassByName[r||"universal"]<<6)}(e,t,r,this.reporter);if(n.length<128)return(a=new i(2))[0]=s,a[1]=n.length,this._createEncoderBuffer([a,n]);for(var c=1,u=n.length;u>=256;u>>=8)c++;(a=new i(2+c))[0]=s,a[1]=128|c,u=1+c;for(var f=n.length;f>0;u--,f>>=8)a[u]=255&f;return this._createEncoderBuffer([a,n])},u.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new i(2*e.length),n=0;n=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var a=0;for(n=0;n=128;s>>=7)a++}var o=new i(a),c=o.length-1;for(n=e.length-1;n>=0;n--)for(s=e[n],o[c--]=127&s;(s>>=7)>0;)o[c--]=128|127&s;return this._createEncoderBuffer(o)},u.prototype._encodeTime=function(e,t){var r,n=new Date(e);return"gentime"===t?r=[f(n.getFullYear()),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[f(n.getFullYear()%100),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new i(r)}if(i.isBuffer(e)){var n=e.length;0===e.length&&n++;var a=new i(n);return e.copy(a),0===e.length&&(a[0]=0),this._createEncoderBuffer(a)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);n=1;for(var s=e;s>=256;s>>=8)n++;for(s=(a=new Array(n)).length-1;s>=0;s--)a[s]=255&e,e>>=8;return 128&a[0]&&a.unshift(0),this._createEncoderBuffer(new i(a))},u.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},u.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},u.prototype._skipDefault=function(e,t,r){var n,i=this._baseState;if(null===i.default)return!1;var a=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),a.length!==i.defaultBuffer.length)return!1;for(n=0;n>6],i=!(32&r);if(31&~r)r&=31;else{var a=r;for(r=0;!(128&~a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}return{cls:n,primitive:i,tag:r,tagStr:o.tag[r]}}function h(e,t,r){var n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(!(128&n))return n;var i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(var a=0;a>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=t;function i(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r>8,s=255&i;a?r.push(a,s):r.push(s)}return r},n.zero2=i,n.toHex=a,n.encode=function(e,t){return"hex"===t?a(e):e}},function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r=0);return i},a.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},a.prototype.test=function(e,t,r){var i=e.bitLength(),a=n.mont(e),s=new n(1).toRed(a);t||(t=Math.max(1,i/48|0));for(var o=e.subn(1),c=0;!o.testn(c);c++);for(var u=e.shrn(c),f=o.toRed(a);t>0;t--){var h=this._randrange(new n(2),o);r&&r(h);var l=h.toRed(a).redPow(u);if(0!==l.cmp(s)&&0!==l.cmp(f)){for(var d=1;d0;t--){var f=this._randrange(new n(2),s),h=e.gcd(f);if(0!==h.cmpn(1))return h;var l=f.toRed(i).redPow(c);if(0!==l.cmp(a)&&0!==l.cmp(u)){for(var d=1;de;)r.ishrn(1);if(r.isEven()&&r.iadd(o),r.testn(1)||r.iadd(c),t.cmp(c)){if(!t.cmp(u))for(;r.mod(f).cmp(h);)r.iadd(d)}else for(;r.mod(a).cmp(l);)r.iadd(d);if(y(p=r.shrn(1))&&y(r)&&v(p)&&v(r)&&s.test(p)&&s.test(r))return r}}},function(e,t,r){var n=r(23),i=r(1).Buffer,a=r(8);function s(e,t,r,s){a.call(this),this._cipher=new n.AES(t),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._mode=e}r(0)(s,a),s.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},e.exports=s},function(e,t,r){var n=r(23),i=r(1).Buffer,a=r(8),s=r(0),o=r(135),c=r(16),u=r(60);function f(e,t,r,s){a.call(this);var c=i.alloc(4,0);this._cipher=new n.AES(t);var f=this._cipher.encryptBlock(c);this._ghash=new o(f),r=function(e,t,r){if(12===t.length)return e._finID=i.concat([t,i.from([0,0,0,1])]),i.concat([t,i.from([0,0,0,2])]);var n=new o(r),a=t.length,s=a%16;n.update(t),s&&(s=16-s,n.update(i.alloc(s,0))),n.update(i.alloc(8,0));var c=8*a,f=i.alloc(8);f.writeUIntBE(c,0,8),n.update(f),e._finID=n.state;var h=i.from(e._finID);return u(h),h}(this,r,f),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}s(f,a),f.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=i.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var n=Math.min(e.length,t.length),i=0;io?t=s(t):t.length=6?"utf-8":"binary",e.exports=r}).call(this,r(9))},function(e,t,r){(function(t){var r=Math.pow(2,30)-1;function n(e,r){if("string"!=typeof e&&!t.isBuffer(e))throw new TypeError(r+" must be a buffer or string")}e.exports=function(e,t,i,a){if(n(e,"Password"),n(t,"Salt"),"number"!=typeof i)throw new TypeError("Iterations not a number");if(i<0)throw new TypeError("Bad iterations");if("number"!=typeof a)throw new TypeError("Key length not a number");if(a<0||a>r||a!=a)throw new TypeError("Bad key length")}}).call(this,r(2).Buffer)},function(e,t,r){t.pbkdf2=r(150),t.pbkdf2Sync=r(62)},function(e){e.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},function(e,t,r){var n=r(38);e.exports=function(e){return(new n).update(e).digest()}},function(e,t,r){"use strict";var n=r(0),i=r(152),a=r(8),s=r(1).Buffer,o=r(67),c=r(32),u=r(31),f=s.alloc(128);function h(e,t){a.call(this,"digest"),"string"==typeof t&&(t=s.from(t));var r="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=t,t.length>r?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function l(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function v(e,t){return e>>>0>>0?1:0}n(c,i),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,a=0|this._dh,o=0|this._eh,c=0|this._fh,m=0|this._gh,b=0|this._hh,w=0|this._al,S=0|this._bl,E=0|this._cl,C=0|this._dl,A=0|this._el,B=0|this._fl,x=0|this._gl,T=0|this._hl,I=0;I<32;I+=2)t[I]=e.readInt32BE(4*I),t[I+1]=e.readInt32BE(4*I+4);for(;I<160;I+=2){var F=t[I-30],k=t[I-30+1],R=d(F,k),D=p(k,F),_=g(F=t[I-4],k=t[I-4+1]),P=y(k,F),N=t[I-14],O=t[I-14+1],L=t[I-32],U=t[I-32+1],K=D+O|0,M=R+N+v(K,D)|0;M=(M=M+_+v(K=K+P|0,P)|0)+L+v(K=K+U|0,U)|0,t[I]=M,t[I+1]=K}for(var H=0;H<160;H+=2){M=t[H],K=t[H+1];var j=f(r,n,i),V=f(w,S,E),G=h(r,w),q=h(w,r),z=l(o,A),W=l(A,o),X=s[H],Y=s[H+1],J=u(o,c,m),Q=u(A,B,x),Z=T+W|0,$=b+z+v(Z,T)|0;$=($=($=$+J+v(Z=Z+Q|0,Q)|0)+X+v(Z=Z+Y|0,Y)|0)+M+v(Z=Z+K|0,K)|0;var ee=q+V|0,te=G+j+v(ee,q)|0;b=m,T=x,m=c,x=B,c=o,B=A,o=a+$+v(A=C+Z|0,C)|0,a=i,C=E,i=n,E=S,n=r,S=w,r=$+te+v(w=Z+ee|0,Z)|0}this._al=this._al+w|0,this._bl=this._bl+S|0,this._cl=this._cl+E|0,this._dl=this._dl+C|0,this._el=this._el+A|0,this._fl=this._fl+B|0,this._gl=this._gl+x|0,this._hl=this._hl+T|0,this._ah=this._ah+r+v(this._al,w)|0,this._bh=this._bh+n+v(this._bl,S)|0,this._ch=this._ch+i+v(this._cl,E)|0,this._dh=this._dh+a+v(this._dl,C)|0,this._eh=this._eh+o+v(this._el,A)|0,this._fh=this._fh+c+v(this._fl,B)|0,this._gh=this._gh+m+v(this._gl,x)|0,this._hh=this._hh+b+v(this._hl,T)|0},c.prototype._hash=function(){var e=a.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=c},function(e,t,r){var n=r(0),i=r(11),a=r(1).Buffer,s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],o=new Array(64);function c(){this.init(),this._w=o,i.call(this,64,56)}function u(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function h(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function l(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(c,i),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,o=0|this._d,c=0|this._e,p=0|this._f,g=0|this._g,y=0|this._h,v=0;v<16;++v)r[v]=e.readInt32BE(4*v);for(;v<64;++v)r[v]=0|(((t=r[v-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[v-7]+d(r[v-15])+r[v-16];for(var m=0;m<64;++m){var b=y+l(c)+u(c,p,g)+s[m]+r[m]|0,w=h(n)+f(n,i,a)|0;y=g,g=p,p=c,c=o+b|0,o=a,a=i,i=n,n=b+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=o+this._d|0,this._e=c+this._e|0,this._f=p+this._f|0,this._g=g+this._g|0,this._h=y+this._h|0},c.prototype._hash=function(){var e=a.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},function(e,t,r){"use strict";e.exports=s;var n=r(10),i=r(17);function a(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length0?("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n?s.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):S(e,s,t,!0):s.ended?e.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?S(e,s,t,!1):x(e,s)):S(e,s,t,!1))):n||(s.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=E?e=E:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(B,e):B(e))}function B(e){d("emit readable"),e.emit("readable"),k(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(T,e,t))}function T(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return ea.length?a.length:e;if(s===a.length?i+=a:i+=a.slice(0,e),0==(e-=s)){s===a.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(s));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=u.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var a=n.data,s=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,s),0==(e-=s)){s===a.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(s));break}++i}return t.length-=i,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function D(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(_,t,e))}function _(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function P(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?D(this):A(this),null;if(0===(e=C(e,t))&&t.ended)return 0===t.length&&D(this),null;var n,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e0?R(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&D(this)),null!==n&&this.emit("data",n),n},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,d("pipe count=%d opts=%j",a.pipesCount,t);var c=t&&!1===t.end||e===n.stdout||e===n.stderr?m:u;function u(){d("onend"),e.end()}a.endEmitted?i.nextTick(c):r.once("end",c),e.on("unpipe",(function t(n,i){d("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,d("cleanup"),e.removeListener("close",y),e.removeListener("finish",v),e.removeListener("drain",f),e.removeListener("error",g),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",p),h=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}));var f=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,k(e))}}(r);e.on("drain",f);var h=!1,l=!1;function p(t){d("ondata"),l=!1,!1!==e.write(t)||l||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==P(a.pipes,e))&&!h&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,l=!0),r.pause())}function g(t){d("onerror",t),m(),e.removeListener("error",g),0===o(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",v),m()}function v(){d("onfinish"),e.removeListener("close",y),m()}function m(){d("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",g),e.once("close",y),e.once("finish",v),e.emit("pipe",r),a.flowing||(d("pipe resume"),r.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a=this._blockSize;){for(var a=this._blockOffset;a0;++s)this._length[s]+=o,(o=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*o);return this},a.prototype._update=function(){throw new Error("_update is not implemented")},a.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},a.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=a},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gostASN1Instance=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.GostASN1=Ta;var i=r(176),a=r(78),s=r(39),o=ArrayBuffer,c=a.gostSecurityInstance.algorithms,u=a.gostSecurityInstance.names,f=a.gostSecurityInstance.identifiers,h=a.gostSecurityInstance.attributes,l=a.gostSecurityInstance.parameters,d=s.gostCodingInstance.BER,p=s.gostCodingInstance.PEM,g=s.gostCodingInstance.Chars,y=s.gostCodingInstance.Hex,v=s.gostCodingInstance.Int16;function m(e){e instanceof o&&(e=new Uint8Array(e));for(var t=new Uint8Array(e.length),r=0,n=e.length;r=i?n:new Array(i-n.length+1).join("0")+n),t)};function C(e){if(e)throw Error("Invalid format")}function A(e,t,r,i){"object"!==(void 0===r?"undefined":n(r))&&(r={value:r}),void 0!==i&&(r.enumerable=i),Object.defineProperty(e,t,r)}function B(e,t,r){for(var n in t)A(e,n,t[n],r)}function x(e,t){return Object.getOwnPropertyDescriptor(e,t)}function T(e,t,r,n,i,a){C(void 0===t);var s={tagNumber:r,tagClass:n||0,tagConstructed:i||!1,object:t};return"DER"!==(e=e||"DER")&&"CER"!==e||(s=d.encode(s,e)),"PEM"===e&&(s=p.encode(s,a)),s}function I(e,t,r,n,i){if(C(void 0===e),"string"==typeof e&&(e=p.decode(e,i,!1)),e instanceof o)try{e=p.decode(g.encode(e),i,!0)}catch(t){e=d.decode(e)}return r=r||0,n=n||!1,void 0===e.tagNumber&&(e=T(!0,e.object,t,r,e.object instanceof Array),e=d.decode(e)),C(e.tagClass!==r||e.tagNumber!==t||e.tagConstructed!==n),0===r&&5===t?null:e.object}function F(e,t,r,n){if("function"!=typeof t&&(n=r,r=t,t=function(){e.apply(this,arguments)}),t.prototype=Object.create(e.prototype,{constructor:{value:t},superclass:{value:e.prototype}}),r&&B(t.prototype,r),e!==Object)for(var i in e)t[i]=e[i];return t.super=e,n&&B(t,n,!0),t}var k,R,D,_=F(Object,(function(e){this.object=e}),{_set:function(e,t,r){e.property(t).set.call(this,r)},_get:function(e,t){return e.property(t).get.call(this)},_call:function(e,t,r){return e.method(t).apply(this,r)},hasProperty:function(e){return this.hasOwnProperty(e)||!!this.constructor.property(e)},encode:function(){return this.object}},{decode:function(e){return new this(e)},property:function(e){for(var t=this.prototype;t;){var r=x(t,e);if(r)return r;t=t.superclass}},method:function(e){for(var t=this.prototype;t;){if(t[e])return t[e];t=t.superclass}}}),P=function(e){return F(_,{encode:function(t){return T(t,this.object,e)}},{decode:function(t){return new this(I(t,e))}})},N=_,O=P(1),L=P(22),U=P(18),K=P(19),M=P(20),H=P(12),j=P(23),V=P(24),G=P(28),q=P(30),z=F(P(5),{object:{get:function(){return null},set:function(e){C(null!==e)}}}),W=function(e){var t=F(P(e),(function(r){if(!(this instanceof t))return n=r,F(P(e),(function(e){t.super.call(this,e)}),{encode:function(t){return T(t,n[this.object],e)}},{decode:function(t){var r=I(t,e);for(var i in n)if(r===n[i])return new this(i);C(!0)}});var n;t.super.apply(this,arguments)}));return t},X=W(2),Y=W(10),J=(k=F(P(4),(function(e){if(!(this instanceof k))return(t=e)?F(t,{encode:function(e){return T(e,t.method("encode").call(this,!0),4)}},{decode:function(e){return t.decode.call(this,I(e,4))}}):k;var t;k.super.apply(this,arguments)})),k),Q=function(){var e=F(P(3),(function(t){if(!(this instanceof e))return"object"===(void 0===t?"undefined":n(t))?(i=t,F(_,(function(e,t){_.call(this,e),this.numbits=t||0}),{encode:function(e){var t=this.object,r=[];if(t instanceof Array){for(var n=0,a=t.length;n\<\|\~]*$/.test(e)?"printableString":"utf8String"})),ge=fe({utcTime:j,generalTime:V},(function(e){return e.getYear()>=2050?"generalTime":"utcTime"})),ye=te,ve=N,me=ee({type:ye,value:ve}),be={typeName:"type",valueName:"value"},we=ue(me({serialName:K,countryName:K,dnQualifier:K,emailAddress:L,domainComponent:L,SNILS:U,OGRN:U,INN:U},pe)),Se=se(we,be)(),Ee=fe({rdnSequence:Se},"rdnSequence"),Ce=Z($({notBefore:ge,notAfter:ge})),Ae=X,Be=ee({type:te,value:N}),xe=oe(Be,be),Te=se(Be,be),Ie=X,Fe=$({a:Ie,b:Ie,seed:de(Q)}),ke=J(F(_,{encode:function(){var e=this.object,t=Math.max(w(e.x.length-2),w(e.y.length-2))/2,r=new Uint8Array(2*t+1);return r[0]=4,r.set(new Uint8Array(E(e.x,!1,t)),1),r.set(new Uint8Array(E(e.y,!1,t)),t+1),r.buffer}},{decode:function(e){var t=(e.byteLength-1)/2;return new this({x:S(new Uint8Array(e,1,t)),y:S(new Uint8Array(e,t+1,t))})}})),Re=$({fieldType:te,parameters:X}),De=$({version:Ae,fieldID:Re,curve:Fe,base:ke,order:X,cofactor:de(X)}),_e=$({publicKeyParamSet:te,digestParamSet:te,encryptionParamSet:de(te)}),Pe=function(e,t){return F(e=e||N,{encode:function(r){return this.object===t?new z(null).encode(r):e.method("encode").call(this,r)}},{decode:function(r){if(void 0!==r){if(null===r||5===r.tagNumber&&0===r.tagClass)return new this(t);try{return e.decode.call(this,r)}catch(e){return}}}})}(te,"id-GostR3411-94-CryptoProParamSet"),Ne=fe({namedParameters:te,ecParameters:De,implicitly:de(z)},(function(e){return"string"==typeof e||e instanceof String?"namedParameters":"ecParameters"})),Oe=function(e,t){return ce($({algorithm:te,parameters:de(e)}),t)},Le=function(){var e=Oe(N),t=F(_,(function(e){if(!(this instanceof t))return r(e);t.super.apply(this,arguments)}),{encode:function(t){return new e(this.object).encode(t)}},{decode:function(t){return new this(e.decode(t).object)}}),r=function(e){return F(_,{object:{get:function(){return this.item?this.item.object:void 0},set:function(t){if(t){var r=e[t.id];if(!r)throw new Error("Algorithm not supported");this.item=new r(t)}else delete this.item}},encode:function(e){return this.item.encode(e)}},{decode:function(t){"string"==typeof t&&(t=p.decode(t,void 0,!1)),t instanceof o&&(t=d.decode(t));var r=e[u[t.object[0].object]];if(r){var n=new this;return n.item=r.decode(t),n}throw new Error("Algorithm not supported")}})};return t}(),Ue=Oe(Ne,{encode:function(e){var t;return t="string"==typeof e.namedCurve?h.namedCurve[e.namedCurve]:{version:1,fieldID:{fieldType:"id-prime-Field",parameters:e.curve.p},curve:{a:e.curve.a,b:e.curve.b},base:{x:e.curve.x,y:e.curve.y},order:e.curve.q,cofactor:1},{algorithm:e.id,parameters:t}},decode:function(e){var t=e.parameters,r=c[e.algorithm];if("string"==typeof t||t instanceof String)r=(0,i.expand)(r,l[t]);else{if("object"!==(void 0===t?"undefined":n(t)))throw new DataError("Invalid key paramters");r=(0,i.expand)(r,{curve:{p:t.fieldID.parameters,a:t.curve.a,b:t.curve.b,x:t.base.x,y:t.base.y,q:t.order}})}return r}}),Ke=Oe(_e,{encode:function(e){var t=e.namedCurve?"namedCurve":"namedParam",r=e.name.indexOf("-94")>=0||e.name.indexOf("-2001")>=0||1994===e.version||2001===e.version?e.sBox||"D-A":e.name.indexOf("-512")>=0||512===e.length?"D-512":"D-256";return{algorithm:e.id,parameters:{publicKeyParamSet:h[t][e[t]],digestParamSet:h.sBox[r],encryptionParamSet:e.encParams&&e.encParams.sBox?h.sBox[e.encParams.sBox]:void 0}}},decode:function(e){var t=e.parameters,r=(0,i.expand)(c[e.algorithm],l[t.publicKeyParamSet],l[t.digestParamSet]);return t.encryptionParamSet&&(r.encParams=l[t.encryptionParamSet]),r}}),Me=Oe(N,{encode:function(e){return{algorithm:e.id}},decode:function(e){return c[e.algorithm]}}),He=Oe(z,{encode:function(e){return{algorithm:e.id,parameters:null}},decode:function(e){return c[e.algorithm]}}),je=Oe(Pe,{encode:function(e){return{algorithm:e.id,parameters:h.sBox[e.sBox||e.hash&&e.hash.sBox||"D-A"]}},decode:function(e){var t=(0,i.expand)(c[e.algorithm]),r=l[e.parameters];return t.hash?t.hash=(0,i.expand)(t.hash,r):t=(0,i.expand)(t,r),t}}),Ve=Le({ecdsa:Ue,noSignature:He,rsaEncryption:He,"id-sc-gostR3410-2001":Ue,"id-GostR3410-2001":Ke,"id-GostR3410-94":Ke,"id-GostR3410-2001DH":Ke,"id-GostR3410-94DH":Ke,"id-tc26-gost3410-12-256":Ke,"id-tc26-gost3410-12-512":Ke,"id-tc26-agreement-gost-3410-12-256":Ke,"id-tc26-agreement-gost-3410-12-512":Ke,"id-sc-gost28147-gfb":Me,"id-Gost28147-89":Me}),Ge=Le({noSignature:He,rsaEncryption:He,sha1withRSAEncryption:He,sha256withRSAEncryption:He,sha384withRSAEncryption:He,sha512withRSAEncryption:He,ecdsa:Me,"ecdsa-with-SHA1":Me,"ecdsa-with-SHA256":Me,"ecdsa-with-SHA384":Me,"ecdsa-with-SHA512":Me,"id-GostR3410-94":He,"id-GostR3410-2001":He,"id-GostR3411-94-with-GostR3410-2001":Me,"id-GostR3411-94-with-GostR3410-94":Me,"id-tc26-gost3410-12-256":He,"id-tc26-gost3410-12-512":He,"id-tc26-signwithdigest-gost3410-12-94":Me,"id-tc26-signwithdigest-gost3410-12-256":Me,"id-tc26-signwithdigest-gost3410-12-512":Me,"id-sc-gostR3410-94":He,"id-sc-gostR3410-2001":He,"id-sc-gostR3411-94-with-gostR3410-94":He,"id-sc-gostR3411-94-with-gostR3410-2001":He}),qe=Le({sha1:Me,sha256:He,sha384:He,sha512:He,"id-GostR3411-94":je,"id-tc26-gost3411-94":je,"id-tc26-gost3411-12-256":He,"id-tc26-gost3411-12-512":He,"id-sc-gostR3411-94":Me}),ze=J,We=J,Xe=te,Ye=J,Je=$({iv:Ye,encryptionParamSet:Xe}),Qe=$({encryptionParamSet:Xe,ukm:de(J)}),Ze=Oe(Je,{encode:function(e){return{algorithm:e.id,parameters:{iv:e.iv,encryptionParamSet:h.sBox[e.sBox||"E-A"]}}},decode:function(e){var t=(0,i.expand)(c[e.algorithm],l[e.parameters.encryptionParamSet]);return t.iv=e.parameters.iv,t}}),$e=Oe(Ye,{encode:function(e){return{algorithm:e.id,parameters:e.iv}},decode:function(e){var t=(0,i.expand)(c[e.algorithm]);return t.iv=e.parameters||new Uint8Array([0,0,0,0,0,0,0,0]),t}}),et=Oe(Qe,{encode:function(e){return{algorithm:e.id,parameters:{encryptionParamSet:h.sBox[e.sBox||"E-A"],ukm:e.ukm}}},decode:function(e){var t=(0,i.expand)(c[e.algorithm],l[e.parameters.encryptionParamSet]);return e.parameters.ukm&&(t.ukm=e.parameters.ukm),t}}),tt=Le({"id-Gost28147-89-None-KeyWrap":et,"id-Gost28147-89-CryptoPro-KeyWrap":et}),rt=Oe(tt,{encode:function(e){return{algorithm:e.id,parameters:e.wrapping}},decode:function(e){var t=(0,i.expand)(c[e.algorithm]);return t.wrapping=e.parameters,t}}),nt=Le({"id-sc-gost28147-gfb":$e,"id-Gost28147-89":Ze}),it=Le({"id-Gost28147-89-MAC":Je,"id-HMACGostR3411-94":je,"id-tc26-hmac-gost-3411-12-256":je,"id-tc26-hmac-gost-3411-12-512":je,hmacWithSHA1:Me,hmacWithSHA224:Me,hmacWithSHA256:Me,hmacWithSHA384:Me,hmacWithSHA512:Me,"id-sc-gost28147-mac":Me,"id-sc-hmacWithGostR3411":Me}),at=$({salt:fe({specified:J,otherSource:Le},(function(e){return b(e)?"specified":"otherSource"})),iterationCount:X,keyLength:de(X),prf:it}),st=Oe(at,{encode:function(e){return{algorithm:e.id,parameters:{salt:e.salt,iterationCount:e.iterations,prf:e.hmac}}},decode:function(e){var t=(0,i.expand)(c[e.algorithm]);return t.salt=e.parameters.salt,t.iterations=e.parameters.iterationCount,t.hmac=e.parameters.prf,t.hash=t.hmac.hash,t}}),ot=Le({PBKDF2:st}),ct=$({salt:J,iterationCount:X}),ut=Oe(ct,{paramType:ct,encode:function(e){return{algorithm:e.id,parameters:{salt:e.derivation.salt,iterationCount:e.derivation.iterations}}},decode:function(e){var t=(0,i.expand)(c[e.algorithm]);return t.derivation=(0,i.expand)(t.derivation,{salt:e.parameters.salt,iterations:e.parameters.iterationCount}),t}}),ft=$({keyDerivationFunc:ot,encryptionScheme:nt}),ht=Oe(ft,{encode:function(e){return{algorithm:e.id,parameters:{keyDerivationFunc:e.derivation,encryptionScheme:e.encryption}}},decode:function(e){var t=(0,i.expand)(c[e.algorithm]);return t.derivation=e.parameters.keyDerivationFunc,t.encryption=e.parameters.encryptionScheme,t}}),lt=(Le({"pbeWithSHAAndAES128-CBC":ut,"pbeWithSHAAndAES192-CBC":ut,"pbeWithSHAAndAES256-CBC":ut,"pbeWithSHA256AndAES128-CBC":ut,"pbeWithSHA256AndAES192-CBC":ut,"pbeWithSHA256AndAES256-CBC":ut,"id-sc-pbeWithGost3411AndGost28147":ut,"id-sc-pbeWithGost3411AndGost28147CFB":ut,"pbeWithSHAAnd3-KeyTripleDES-CBC":ut,"pbeWithSHAAnd2-KeyTripleDES-CBC":ut,"pbeWithSHAAnd128BitRC2-CBC":ut,"pbeWithSHAAnd40BitRC2-CBC":ut,pbeUnknownGost:ut,PBES2:ht}),Le({ecdsa:Ue,rsaEncryption:He,"id-sc-gost28147-gfb":$e,"id-Gost28147-89":Ze,"id-sc-gostR3410-2001":Ue,"id-GostR3410-2001":Ke,"id-GostR3410-94":Ke,"id-tc26-gost3410-12-256":Ke,"id-tc26-gost3410-12-512":Ke,"id-GostR3410-94-CryptoPro-ESDH":rt,"id-GostR3410-2001-CryptoPro-ESDH":rt,"id-tc26-agreement-gost-3410-12-256":rt,"id-tc26-agreement-gost-3410-12-512":rt,"id-sc-r3410-ESDH-r3411kdf":He,"id-Gost28147-89-None-KeyWrap":et,"id-Gost28147-89-CryptoPro-KeyWrap":et,"id-sc-cmsGostWrap":Me,"id-sc-cmsGost28147Wrap":Me,"pbeWithSHAAndAES128-CBC":ut,"pbeWithSHAAndAES192-CBC":ut,"pbeWithSHAAndAES256-CBC":ut,"pbeWithSHA256AndAES128-CBC":ut,"pbeWithSHA256AndAES192-CBC":ut,"pbeWithSHA256AndAES256-CBC":ut,"id-sc-pbeWithGost3411AndGost28147":ut,"id-sc-pbeWithGost3411AndGost28147CFB":ut,"pbeWithSHAAnd3-KeyTripleDES-CBC":ut,"pbeWithSHAAnd2-KeyTripleDES-CBC":ut,"pbeWithSHAAnd128BitRC2-CBC":ut,"pbeWithSHAAnd40BitRC2-CBC":ut,pbeUnknownGost:ut,PBES2:ht})),dt=$({keyDerivationFunc:ot,messageAuthScheme:it}),pt=Oe(dt,{encode:function(e){return{algorithm:e.id,parameters:{keyDerivationFunc:e.derivation,messageAuthScheme:e.hmac}}},decode:function(e){var t=(0,i.expand)(c[e.algorithm]);return t.derivation=e.parameters.keyDerivationFunc,t.hmac=e.parameters.messageAuthScheme,t}}),gt=(Le({PBMAC1:pt}),Le({"id-sc-gost28147-gfb":$e,"id-Gost28147-89":Ze,"pbeWithSHAAndAES128-CBC":ut,"pbeWithSHAAndAES192-CBC":ut,"pbeWithSHAAndAES256-CBC":ut,"pbeWithSHA256AndAES128-CBC":ut,"pbeWithSHA256AndAES192-CBC":ut,"pbeWithSHA256AndAES256-CBC":ut,"id-sc-pbeWithGost3411AndGost28147":ut,"id-sc-pbeWithGost3411AndGost28147CFB":ut,"pbeWithSHAAnd3-KeyTripleDES-CBC":ut,"pbeWithSHAAnd2-KeyTripleDES-CBC":ut,"pbeWithSHAAnd128BitRC2-CBC":ut,"pbeWithSHAAnd40BitRC2-CBC":ut,pbeUnknownGost:ut,PBES2:ht})),yt=ce,vt=yt(Q(he(X)),{encode:function(e){return v.encode(m(e))},decode:function(e){return m(v.decode(e))}}),mt=yt(Q(he(J)),{encode:function(e){var t=new Uint8Array(e.byteLength+1),r=m(e),n=e.byteLength/2;return t[0]=4,t.set(new Uint8Array(r,n,n),1),t.set(new Uint8Array(r,0,n),n+1),t.buffer},decode:function(e){C(!(1&e.byteLength));var t=new Uint8Array(e.byteLength-1),r=t.byteLength/2;return t.set(new Uint8Array(e,r+1,r),0),t.set(new Uint8Array(e,1,r),r),m(t)}}),bt=Q(he(J)),wt=$({algorithm:Ve,subjectPublicKey:Q},"PUBLIC KEY"),St=(R={"id-sc-gostR3410-2001":mt,"id-sc-gostR3410-94":vt,"id-GostR3410-2001":bt,"id-GostR3410-94":bt,"id-tc26-gost3410-12-256":bt,"id-tc26-gost3410-12-512":bt},ce(ee({algorithm:Ve,subjectPublicKey:N},"algorithm","subjectPublicKey")((function(e){return R[e.id]})),{encode:function(e){return{algorithm:e.algorithm,subjectPublicKey:e.buffer}},decode:function(e){return{algorithm:e.algorithm,type:"public",extractable:!0,usages:["verify","deriveKey","deriveBits"],buffer:e.subjectPublicKey}}})),Et=J,Ct=yt(Et(he(X)),{encode:function(e){return S(e,!0)},decode:function(e){return E(e,!0)}}),At=J,Bt=$({keyValueMask:At,keyValyePublicKey:J}),xt=fe({privateKey:Et(he(fe({keyValueMask:At,keyValueInfo:Bt},(function(e){return b(e)?"keyValueMask":"keyValueInfo"})))),keyValueMask:At},(function(e){return e.enclosed?"keyValueMask":"privateKey"})),Tt=function(e){return ee({version:Ae,privateKeyAlgorithm:Ve,privateKeyWrapped:yt(Et(he($({keyData:X,keyMac:X}))),{encode:function(e){var t=e.byteLength-4;return{keyData:S(new Uint8Array(e,0,t)),keyMac:S(new Uint8Array(e,t,4))}},decode:function(e){var t=E(e.keyData),r=E(e.keyMac),n=new Uint8Array(t.byteLength+r.byteLength);return n.set(new Uint8Array(t)),n.set(new Uint8Array(r),t.byteLength),n}}),attributes:N},"privateKeyAlgorithm","attributes")((function(t){return de(ie(0,re(xe({"id-sc-gostR3410-2001-publicKey":ue(e[t.id])}))))}))}({"id-sc-gostR3410-2001":mt,"id-sc-gostR3410-94":vt,"id-GostR3410-2001":bt,"id-GostR3410-94":bt,"id-GostR3410-2001DH":bt,"id-GostR3410-94DH":bt,"id-tc26-gost3410-12-256":bt,"id-tc26-gost3410-12-512":bt,"id-tc26-agreement-gost-3410-12-256":bt,"id-tc26-agreement-gost-3410-12-512":bt}),It=$({version:Ae,privateKeyAlgorithm:Ve,privateKey:Et,attributes:de(ie(0,re(xe)))},"PRIVATE KEY"),Ft=Ve,kt=Q,Rt=$({version:Ae,privateKeyAlgorithm:Ft,privateKey:Et,attributes:de(ie(0,re(xe))),publicKey:de(ie(1,re(kt)))}),Dt=se(Rt),_t=function(e){return ce(ee({version:Ae,privateKeyAlgorithm:Ve,privateKey:N,attributes:de(ie(0,re(xe)))},"privateKeyAlgorithm","privateKey")((function(t){return e[t.id]})),{encode:function(e){return{version:0,privateKeyAlgorithm:e.algorithm,privateKey:e.buffer}},decode:function(e){return{algorithm:e.privateKeyAlgorithm,type:"private",extractable:!0,usages:["sign","deriveKey","deriveBits"],buffer:b(e.privateKey)?e.privateKey:e.privateKey.keyValueMask}}})}({"id-sc-gostR3410-2001":Ct,"id-sc-gostR3410-94":Ct,"id-GostR3410-2001":xt,"id-GostR3410-94":xt,"id-GostR3410-2001DH":xt,"id-GostR3410-94DH":xt,"id-tc26-gost3410-12-256":xt,"id-tc26-gost3410-12-512":xt,"id-tc26-agreement-gost-3410-12-256":xt,"id-tc26-agreement-gost-3410-12-512":xt}),Pt=J,Nt=$({encryptionAlgorithm:lt,encryptedData:Pt},"ENCRYPTED PRIVATE KEY"),Ot=Q,Lt=X,Ut=$({cA:le(O,!1),pathLenConstraint:de(X)}),Kt=Q({digitalSignature:0,nonRepudiation:1,keyEncipherment:2,dataEncipherment:3,keyAgreement:4,keyCertSign:5,cRLSign:6,encipherOnly:7,decipherOnly:8}),Mt=te,Ht=se(Mt),jt=J,Vt=$({type:te,value:ie(0,ne(N))}),Gt=$({nameAssigner:de(ie(0,re(pe))),partyName:de(ie(1,re(pe)))}),qt=$({}),zt=fe({otherName:ie(0,re(Vt)),rfc822Name:ie(1,re(pe)),dNSName:ie(2,re(pe)),x400Address:ie(3,re(qt)),directoryName:ie(4,ne(Ee)),ediPartyName:ie(5,re(Gt)),uniformResourceIdentifier:ie(6,re(pe)),iPAddress:ie(7,re(J)),registeredID:ie(8,re(te))},(function(e){return"string"==typeof e||e instanceof String?e.indexOf("@")>=0?"rfc822Name":"dNSName":b(e)?"iPAddress":"directoryName"})),Wt=se(zt),Xt=$({keyIdentifier:de(ie(0,re(jt))),authorityCertIssuer:de(ie(1,re(Wt))),authorityCertSerialNumber:de(ie(2,re(Lt)))}),Yt=$({notBefore:de(ie(0,re(V))),notAfter:de(ie(1,re(V)))}),Jt=te,Qt=$({policyQualifierId:te,qualifier:N}),Zt=$({policyIdentifier:Jt,policyQualifiers:de(se(Qt))}),$t=$({issuerDomainPolicy:Jt,subjectDomainPolicy:Jt}),er=X,tr=se($({base:zt,minimum:le(ie(0,re(er)),0),maximum:de(ie(1,re(er)))})),rr=$({permittedSubtrees:de(ie(0,re(tr))),excludedSubtrees:de(ie(1,re(tr)))}),nr=X,ir=$({requireExplicitPolicy:de(ie(0,re(nr))),inhibitPolicyMapping:de(ie(1,re(nr)))}),ar=Q({unused:0,keyCompromise:1,cACompromise:2,affiliationChanged:3,superseded:4,cessationOfOperation:5,certificateHold:6,privilegeWithdrawn:7,aACompromise:8}),sr=fe({fullName:ie(0,re(Wt)),nameRelativeToCRLIssuer:ie(1,re(we))},(function(e){return e instanceof Array?"fullName":"nameRelativeToCRLIssuer"})),or=se($({distributionPoint:de(ie(0,ne(sr))),reasons:de(ie(1,re(ar))),cRLIssuer:de(ie(2,re(Wt)))})),cr=or,ur=$({accessMethod:te,accessLocation:zt}),fr=function(e,t){var r=F(ee({extnID:te,critical:le(O,!1),extnValue:function(e){return J(he(e))}},"extnID","extnValue")(e),{object:{get:function(){var e=this._get(r.super,"object");return e&&"object"===n(e.extnValue)&&this.defineValue(e.extnValue),e},set:function(e){this._set(r.super,"object",e),e&&e.extnValue&&(void 0!==e.extnValue.critical?this.critical=e.extnValue.critical:void 0===this.critical&&t&&(this.critical=t(this.extnID,e.extnValue)))}},extnValue:{get:function(){var e=this._get(r.super,"extnValue");return"object"===(void 0===e?"undefined":n(e))&&this.defineValue(e),e},set:function(e){this._set(r.super,"extnValue",e),e&&(void 0!==e.critical?this.critical=e.critical:void 0===this.critical&&t&&(this.critical=t(this.extnID,e)))}},defineValue:function(e){if("object"===(void 0===e?"undefined":n(e))&&!x(e,"critical")){var t=this;A(e,"critical",{get:function(){return t.critical},set:function(e){t.critical=e},enumerable:!0,configurable:!1})}}});return r},hr=$({signTool:H,cATool:H,signToolCert:H,cAToolCert:H}),lr=se(fr,{typeName:"extnID",valueName:"extnValue"}),dr=lr({authorityKeyIdentifier:Xt,subjectKeyIdentifier:jt,keyUsage:Kt,privateKeyUsagePeriod:Yt,certificatePolicies:se(Zt),policyMappings:se($t),subjectAltName:Wt,issuerAltName:Wt,subjectDirectoryAttributes:Te,basicConstraints:Ut,nameConstraints:rr,policyConstraints:ir,extKeyUsage:Ht,cRLDistributionPoints:or,inhibitAnyPolicy:nr,freshestCRL:cr,authorityInfoAccess:se(ur),subjectInfoAccess:se(ur),subjectSignTool:H,issuerSignTool:hr},(function(e,t){return"keyUsage"===e||"basicConstraints"===e&&void 0===t.pathLenConstraint})),pr=$({r:X,s:X}),gr=Z($({version:ie(0,ne(Ae)),serialNumber:Lt,signature:Ge,issuer:Ee,validity:Ce,subject:Ee,subjectPublicKeyInfo:wt,issuerUniqueID:de(ie(1,re(Ot))),subjectUniqueID:de(ie(2,re(Ot))),extensions:de(ie(3,ne(dr)))})),yr=$({tbsCertificate:gr,signatureAlgorithm:Ge,signatureValue:Q},"CERTIFICATE"),vr=dr,mr=xe({challengePassword:ue(pe),extensionRequest:ue(vr),msCertExtensions:ue(dr),extendedCertificateAttributes:ue(xe)}),br=Z($({version:X,subject:Ee,subjectPublicKeyInfo:wt,attributes:ie(0,re(mr))})),wr=$({requestInfo:br,signatureAlgorithm:Ge,signatureValue:Q},"CERTIFICATE REQUEST"),Sr=X,Er=Y({unspecified:0,keyCompromise:1,cACompromise:2,affiliationChanged:3,superseded:4,cessationOfOperation:5,certificateHold:6,removeFromCRL:8,privilegeWithdrawn:9,aACompromise:10}),Cr=lr({authorityKeyIdentifier:Xt,issuerAltName:Wt,cRLNumber:Sr,deltaCRLIndicator:Sr,issuingDistributionPoint:$({distributionPoint:de(ie(0,ne(sr))),onlyContainsUserCerts:le(ie(1,re(O)),!1),onlyContainsCACerts:le(ie(2,re(O)),!1),onlySomeReasons:de(ie(3,re(ar))),indirectCRL:le(ie(4,re(O)),!1),onlyContainsAttributeCerts:le(ie(5,re(O)),!1)}),freshestCRL:cr},(function(e){return"cRLNumber"===e})),Ar=lr({cRLReason:Er,instructionCode:te,invalidityDate:V,certificateIssuer:Wt}),Br=Z($({version:de(Ae),signature:Ge,issuer:Ee,thisUpdate:ge,nextUpdate:de(ge),revokedCertificates:de(se($({userCertificate:Lt,revocationDate:ge,crlEntryExtensions:de(Ar)}))),crlExtensions:de(ie(0,ne(Cr)))})),xr=$({tbsCertList:Br,signatureAlgorithm:Ge,signatureValue:Q},"CRL"),Tr=X,Ir=$({digestedObjectType:Y({publicKey:0,publicKeyCert:1,otherObjectTypes:2}),otherObjectTypeID:de(te),digestAlgorithm:qe,objectDigest:Q}),Fr=$({issuer:Wt,serial:Lt,issuerUID:de(Ot)}),kr=$({issuerName:de(Wt),baseCertificateID:de(ie(0,re(Fr))),objectDigestInfo:de(ie(1,re(Ir)))}),Rr=$({targetCertificate:Fr,targetName:de(zt),certDigestInfo:de(Ir)}),Dr=se(fe({targetName:ie(0,ne(zt)),targetGroup:ie(1,ne(zt)),targetCert:ie(2,re(Rr))})),_r=lr({auditIdentity:J,targetInformation:Dr,authorityKeyIdentifier:Xt,authorityInfoAccess:se(ur),cRLDistributionPoints:or,noRevAvail:z},(function(e){return"auditIdentity"===e||"targetInformation"===e})),Pr=$({baseCertificateID:de(ie(0,re(Fr))),entityName:de(ie(1,re(Wt))),objectDigestInfo:de(ie(2,re(Ir)))}),Nr=fe({v1Form:Wt,v2Form:ie(0,re(kr))},"v2Form"),Or=$({notBeforeTime:V,notAfterTime:V}),Lr=$({service:zt,ident:zt,authInfo:de(J)}),Ur=$({roleAuthority:de(ie(0,re(Wt))),roleName:ie(1,ne(zt))}),Kr=Q({unmarked:0,unclassified:1,restricted:2,confidential:3,secret:4,topSecret:5}),Mr=$({type:ie(0,re(te)),value:ie(1,re(N))}),Hr=$({policyId:ie(0,re(te)),classList:le(ie(1,re(Kr)),["unclassified"]),securityCategories:de(ie(2,re(oe(Mr))))}),jr=$({policyAuthority:de(ie(0,re(Wt))),values:se(fe({octets:J,oid:te,string:H},(function(e){return b?"octets":getIdentifier(e)?"oid":"string"})))}),Vr=Z($({version:Tr,holder:Pr,issuer:Nr,signature:Ge,serialNumber:Lt,attrCertValidityPeriod:Or,attributes:Te({authenticationInfo:oe(Lr),accessIdentity:oe(Lr),chargingIdentity:ue(jr),group:ue(jr),role:oe(Ur),clearance:oe(Hr)}),issuerUniqueID:de(Ot),extensions:de(_r)})),Gr=$({acinfo:Vr,signatureAlgorithm:Ge,signatureValue:Q},"ATTRIBUTE CERTIFICATE"),qr=J,zr=J,Wr=J,Xr=($({keyInfo:tt,entityUInfo:de(ie(0,ne(J))),suppPubInfo:ie(2,ne(J))}),ce($({encryptedKey:ze,maskKey:de(ie(0,re(ze))),macKey:We}),{encode:function(e){return{encryptedKey:new Uint8Array(new Uint8Array(e,0,32)).buffer,macKey:new Uint8Array(new Uint8Array(e,32,4)).buffer}},decode:function(e){var t=e.encryptedKey,r=e.maskKey,n=e.macKey;if(r)for(var i=new Int32Array(r),a=new Int32Array(t),s=0,o=i.length/a.length;s=1024&&(this.setIndex=0),this.seed[this.setIndex++]=e},get:function(){return this.getIndex>=1024&&(this.getIndex=0),this.seed[this.getIndex++]}};if((0,n.isBrowser)()){try{document.addEventListener("mousemove",(function(e){o.set(255&(new Date).getTime()^255&(e.clientX||e.pageX)^255&(e.clientY||e.pageY))}),!1)}catch(e){}try{document.addEventListener("keydown",(function(e){o.set(255&(new Date).getTime()^255&e.keyCode)}),!1)}catch(e){}}var c=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,Error),t}(),u=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,Error),t}();function f(){}var h=(0,n.getCryptoModule)();f.prototype.getRandomValues=function(e){if(!e.byteLength)throw new c("Array is not of an integer type (Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, or Uint32Array)");if(e.byteLength>65536)throw new u("Byte length of array can't be greate then 65536");var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(h&&h.getRandomValues)h.getRandomValues(t);else for(var r=0,n=t.length;r508&&r<=512)r=512;else{if(!(r>254&&r<=256))throw new i.NotSupportedError("Support keys only 256 or 512 bits length");r=256}t=r}else{if((r=e.modulusLength||L(this.p))>1016&&r<=1024)r=1024;else{if(!(r>508&&r<=512))throw new i.NotSupportedError("Support keys only 512 or 1024 bits length");r=512}t=256}this.bitLength=t,this.keyLength=r,this.procreator=e.procreator;var h=e.hash;h&&(("string"==typeof h||h instanceof String)&&(h={name:h}),1994===e.version||2001===e.version?(h.version=1994,h.length=256,h.sBox=e.sBox||h.sBox):(h.version=2012,h.length=t),h.procreator=h.procreator||e.procreator,this.hash=new n.GostDigest(h)),e.ukm&&(this.ukm=e.ukm)};var n=r(40),i=r(19),a=r(25),s=ArrayBuffer,o={"S-256-TEST":{a:7,b:"0x5FBFF498AA938CE739B8E022FBAFEF40563F6E6A3472FC2A514C0CE9DAE23B7E",p:"0x8000000000000000000000000000000000000000000000000000000000000431",q:"0x8000000000000000000000000000000150FE8A1892976154C59CFC193ACCF5B3",x:2,y:"0x8E2A8A0E65147D4BD6316030E16D19C85C97F0A9CA267122B96ABBCEA7E8FC8"},"S-256-A":{a:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD94",b:166,p:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD97",q:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6C611070995AD10045841B09B761B893",x:1,y:"0x8D91E471E0989CDA27DF505A453F2B7635294F2DDF23E3B122ACC99C9E9F1E14"},"S-256-B":{a:"0x8000000000000000000000000000000000000000000000000000000000000C96",b:"0x3E1AF419A269A5F866A7D3C25C3DF80AE979259373FF2B182F49D4CE7E1BBC8B",p:"0x8000000000000000000000000000000000000000000000000000000000000C99",q:"0x800000000000000000000000000000015F700CFFF1A624E5E497161BCC8A198F",x:1,y:"0x3FA8124359F96680B83D1C3EB2C070E5C545C9858D03ECFB744BF8D717717EFC"},"S-256-C":{a:"0x9B9F605F5A858107AB1EC85E6B41C8AACF846E86789051D37998F7B9022D7598",b:32858,p:"0x9B9F605F5A858107AB1EC85E6B41C8AACF846E86789051D37998F7B9022D759B",q:"0x9B9F605F5A858107AB1EC85E6B41C8AA582CA3511EDDFB74F02F3A6598980BB9",x:0,y:"0x41ECE55743711A8C3CBF3783CD08C0EE4D4DC440D4641A8F366E550DFDB3BB67"},"P-256":{p:"0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF",a:"0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC",b:"0x5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B",x:"0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296",y:"0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",q:"0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"},"T-512-TEST":{a:7,b:"0x1CFF0806A31116DA29D8CFA54E57EB748BC5F377E49400FDD788B649ECA1AC4361834013B2AD7322480A89CA58E0CF74BC9E540C2ADD6897FAD0A3084F302ADC",p:"0x4531ACD1FE0023C7550D267B6B2FEE80922B14B2FFB90F04D4EB7C09B5D2D15DF1D852741AF4704A0458047E80E4546D35B8336FAC224DD81664BBF528BE6373",q:"0x4531ACD1FE0023C7550D267B6B2FEE80922B14B2FFB90F04D4EB7C09B5D2D15DA82F2D7ECB1DBAC719905C5EECC423F1D86E25EDBE23C595D644AAF187E6E6DF",x:"0x24D19CC64572EE30F396BF6EBBFD7A6C5213B3B3D7057CC825F91093A68CD762FD60611262CD838DC6B60AA7EEE804E28BC849977FAC33B4B530F1B120248A9A",y:"0x2BB312A43BD2CE6E0D020613C857ACDDCFBF061E91E5F2C3F32447C259F39B2C83AB156D77F1496BF7EB3351E1EE4E43DC1A18B91B24640B6DBB92CB1ADD371E"},"T-512-A":{p:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC7",a:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC4",b:"0xE8C2505DEDFC86DDC1BD0B2B6667F1DA34B82574761CB0E879BD081CFD0B6265EE3CB090F30D27614CB4574010DA90DD862EF9D4EBEE4761503190785A71C760",q:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF27E69532F48D89116FF22B8D4E0560609B4B38ABFAD2B85DCACDB1411F10B275",x:3,y:"0x7503CFE87A836AE3A61B8816E25450E6CE5E1C93ACF1ABC1778064FDCBEFA921DF1626BE4FD036E93D75E6A50E3A41E98028FE5FC235F5B889A589CB5215F2A4"},"T-512-B":{p:"0x8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006F",a:"0x8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006C",b:"0x687D1B459DC841457E3E06CF6F5E2517B97C7D614AF138BCBF85DC806C4B289F3E965D2DB1416D217F8B276FAD1AB69C50F78BEE1FA3106EFB8CCBC7C5140116",q:"0x800000000000000000000000000000000000000000000000000000000000000149A1EC142565A545ACFDB77BD9D40CFA8B996712101BEA0EC6346C54374F25BD",x:2,y:"0x1A8F7EDA389B094C2C071E3647A8940F3C123B697578C213BE6DD9E6C8EC7335DCB228FD1EDF4A39152CBCAAF8C0398828041055F94CEEEC7E21340780FE41BD"}};o["X-256-A"]=o["S-256-A"],o["X-256-B"]=o["S-256-C"],o["T-256-TEST"]=o["S-256-TEST"],o["T-256-A"]=o["S-256-A"],o["T-256-B"]=o["S-256-B"],o["T-256-C"]=o["S-256-C"];var c={"S-TEST":{modulusLength:512,p:"0xEE8172AE8996608FB69359B89EB82A69854510E2977A4D63BC97322CE5DC3386EA0A12B343E9190F23177539845839786BB0C345D165976EF2195EC9B1C379E3",q:"0x98915E7EC8265EDFCDA31E88F24809DDB064BDC7285DD50D7289F0AC6F49DD2D",a:"0x9e96031500c8774a869582d4afde2127afad2538b4b6270a6f7c8837b50d50f206755984a49e509304d648be2ab5aab18ebe2cd46ac3d8495b142aa6ce23e21c"},"S-A":{modulusLength:1024,p:"0xB4E25EFB018E3C8B87505E2A67553C5EDC56C2914B7E4F89D23F03F03377E70A2903489DD60E78418D3D851EDB5317C4871E40B04228C3B7902963C4B7D85D52B9AA88F2AFDBEB28DA8869D6DF846A1D98924E925561BD69300B9DDD05D247B5922D967CBB02671881C57D10E5EF72D3E6DAD4223DC82AA1F7D0294651A480DF",q:"0x972432A437178B30BD96195B773789AB2FFF15594B176DD175B63256EE5AF2CF",a:"0x8FD36731237654BBE41F5F1F8453E71CA414FFC22C25D915309E5D2E62A2A26C7111F3FC79568DAFA028042FE1A52A0489805C0DE9A1A469C844C7CABBEE625C3078888C1D85EEA883F1AD5BC4E6776E8E1A0750912DF64F79956499F1E182475B0B60E2632ADCD8CF94E9C54FD1F3B109D81F00BF2AB8CB862ADF7D40B9369A"},"S-B":{modulusLength:1024,p:"0xC6971FC57524B30C9018C5E621DE15499736854F56A6F8AEE65A7A404632B1BCF0349FFCAFCB0A103177971FC1612ADCDB8C8CC938C70225C8FD12AFF01B1D064E0AD6FDE6AB9159166CB9F2FC171D92F0CC7B6A6B2CD7FA342ACBE2C9315A42D576B1ECCE77A963157F3D0BD96A8EB0B0F3502AD238101B05116334F1E5B7AB",q:"0xB09D634C10899CD7D4C3A7657403E05810B07C61A688BAB2C37F475E308B0607",a:"0x3D26B467D94A3FFC9D71BF8DB8934084137264F3C2E9EB16DCA214B8BC7C872485336744934FD2EF5943F9ED0B745B90AA3EC8D70CDC91682478B664A2E1F8FB56CEF2972FEE7EDB084AF746419B854FAD02CC3E3646FF2E1A18DD4BEB3C44F7F2745588029649674546CC9187C207FB8F2CECE8E2293F68395C4704AF04BAB5"},"S-C":{modulusLength:1024,p:"0x9D88E6D7FE3313BD2E745C7CDD2AB9EE4AF3C8899E847DE74A33783EA68BC30588BA1F738C6AAF8AB350531F1854C3837CC3C860FFD7E2E106C3F63B3D8A4C034CE73942A6C3D585B599CF695ED7A3C4A93B2B947B7157BB1A1C043AB41EC8566C6145E938A611906DE0D32E562494569D7E999A0DDA5C879BDD91FE124DF1E9",q:"0xFADD197ABD19A1B4653EECF7ECA4D6A22B1F7F893B641F901641FBB555354FAF",a:"0x7447ED7156310599070B12609947A5C8C8A8625CF1CF252B407B331F93D639DDD1BA392656DECA992DD035354329A1E95A6E32D6F47882D960B8F10ACAFF796D13CD9611F853DAB6D2623483E46788708493937A1A29442598AEC2E0742022563440FE9C18740ECE6765AC05FAF024A64B026E7E408840819E962E7E5F401AE3"},"S-D":{modulusLength:1024,p:"0x80F102D32B0FD167D069C27A307ADAD2C466091904DBAA55D5B8CC7026F2F7A1919B890CB652C40E054E1E9306735B43D7B279EDDF9102001CD9E1A831FE8A163EED89AB07CF2ABE8242AC9DEDDDBF98D62CDDD1EA4F5F15D3A42A6677BDD293B24260C0F27C0F1D15948614D567B66FA902BAA11A69AE3BCEADBB83E399C9B5",q:"0xF0F544C418AAC234F683F033511B65C21651A6078BDA2D69BB9F732867502149",a:"0x6BCC0B4FADB3889C1E06ADD23CC09B8AB6ECDEDF73F04632595EE4250005D6AF5F5ADE44CB1E26E6263C672347CFA26F9E9393681E6B759733784CDE5DBD9A14A39369DFD99FA85CC0D10241C4010343F34A91393A706CF12677CBFA1F578D6B6CFBE8A1242CFCC94B3B653A476E145E3862C18CC3FED8257CFEF74CDB205BF1"},"X-A":{modulusLength:1024,p:"0xCA3B3F2EEE9FD46317D49595A9E7518E6C63D8F4EB4D22D10D28AF0B8839F079F8289E603B03530784B9BB5A1E76859E4850C670C7B71C0DF84CA3E0D6C177FE9F78A9D8433230A883CD82A2B2B5C7A3306980278570CDB79BF01074A69C9623348824B0C53791D53C6A78CAB69E1CFB28368611A397F50F541E16DB348DBE5F",q:"0xCAE4D85F80C147704B0CA48E85FB00A9057AA4ACC44668E17F1996D7152690D9",a:"0xBE27D652F2F1E339DA734211B85B06AE4DE236AA8FBEEB3F1ADCC52CD43853777E834A6A518138678A8ADBD3A55C70A7EAB1BA7A0719548677AAF4E609FFB47F6B9D7E45B0D06D83D7ADC53310ABD85783E7317F7EC73268B6A9C08D260B85D8485696CA39C17B17F044D1E050489036ABD381C5E6BF82BA352A1AFF136601AF"},"X-B":{modulusLength:1024,p:"0x9286DBDA91ECCFC3060AA5598318E2A639F5BA90A4CA656157B2673FB191CD0589EE05F4CEF1BD13508408271458C30851CE7A4EF534742BFB11F4743C8F787B11193BA304C0E6BCA25701BF88AF1CB9B8FD4711D89F88E32B37D95316541BF1E5DBB4989B3DF13659B88C0F97A3C1087B9F2D5317D557DCD4AFC6D0A754E279",q:"0xC966E9B3B8B7CDD82FF0F83AF87036C38F42238EC50A876CD390E43D67B6013F",a:"0x7E9C3096676F51E3B2F9884CF0AC2156779496F410E049CED7E53D8B7B5B366B1A6008E5196605A55E89C3190DABF80B9F1163C979FCD18328DAE5E9048811B370107BB7715F82091BB9DE0E33EE2FED6255474F8769FCE5EAFAEEF1CB5A32E0D5C6C2F0FC0B3447072947F5B4C387666993A333FC06568E534AD56D2338D729"},"X-C":{modulusLength:1024,p:"0xB194036ACE14139D36D64295AE6C50FC4B7D65D8B340711366CA93F383653908EE637BE428051D86612670AD7B402C09B820FA77D9DA29C8111A8496DA6C261A53ED252E4D8A69A20376E6ADDB3BDCD331749A491A184B8FDA6D84C31CF05F9119B5ED35246EA4562D85928BA1136A8D0E5A7E5C764BA8902029A1336C631A1D",q:"0x96120477DF0F3896628E6F4A88D83C93204C210FF262BCCB7DAE450355125259",a:"0x3F1817052BAA7598FE3E4F4FC5C5F616E122CFF9EBD89EF81DC7CE8BF56CC64B43586C80F1C4F56DD5718FDD76300BE336784259CA25AADE5A483F64C02A20CF4A10F9C189C433DEFE31D263E6C9764660A731ECCAECB74C8279303731E8CF69205BC73E5A70BDF93E5BB681DAB4EEB9C733CAAB2F673C475E0ECA921D29782E"}},u=28,f=(1<>14;--s>=0;){var u=16383&e[t],f=e[t++]>>14,h=c*u+f*o;a=((u=o*u+((16383&h)<<14)+n[i]+a)>>28)+(h>>14)+c*f,n[i++]=268435455&u}return a}function y(e){var t=new Array(Math.ceil(e));return t.s=0,t.t=0,t}function v(e,t){for(var r=e.t-1;r>=0;--r)t[r]=e[r];return t.t=e.t,t.s=e.s,t}function m(e){return v(e,y(e.t))}function b(e,t){return e.t=1,e.s=t<0?-1:0,t>0?e[0]=t:t<-1?e[0]=t+h:e.t=0,e}function w(e){var t=y(1);return b(t,e),t}var S=w(0),E=w(1),C=w(3);function A(e){for(var t=e.s&f;e.t>0&&e[e.t-1]===t;)--e.t;return e}function B(e,t,r){for(var n=0,i=0,a=Math.min(t.t,e.t);n>=u;if(t.t>=u;i+=e.s}else{for(i+=e.s;n>=u;i-=t.s}return r.s=i<0?-1:0,i<-1?r[n++]=h+i:i>0&&(r[n++]=i),r.t=n,A(r)}function x(e,t){return B(e,t,y(e.t))}function T(e,t,r){for(var n=0,i=0,a=Math.min(t.t,e.t);n>=u;if(t.t>=u;i+=e.s}else{for(i+=e.s;n>=u;i+=t.s}return r.s=i<0?-1:0,i>0?r[n++]=i:i<-1&&(r[n++]=h+i),r.t=n,A(r)}function I(e,t){return T(e,t,y(e.t))}function F(e,t){return B(S,e,t)}function k(e){return e.s<0?function(e){return F(e,y(e.t))}(e):e}function R(e,t){var r=e.s-t.s;if(0!==r)return r;var n=e.t;if(0!=(r=n-t.t))return e.s<0?-r:r;for(;--n>=0;)if(0!=(r=e[n]-t[n]))return r;return 0}function D(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function _(e,t,r){var n;for(n=e.t-1;n>=0;--n)r[n+t]=e[n];for(n=t-1;n>=0;--n)r[n]=0;return r.t=e.t+t,r.s=e.s,r}function P(e,t,r){for(var n=t;n=0;--n)r[n+o+1]=e[n]>>a|c,c=(e[n]&s)<=0;--n)r[n]=0;return r[o]=c,r.t=e.t+o+1,r.s=e.s,A(r)}function O(e,t,r){r.s=e.s;var n=Math.floor(t/u);if(!(n>=e.t)){var i=t%u,a=u-i,s=(1<>i;for(var o=n+1;o>i;return i>0&&(r[e.t-n-1]|=(e.s&s)<=0;)r[a]=0;for(a=0;a=0;)t[n]=0;for(n=0;n=r.DV&&(t[n+r.t]-=r.DV,t[n+r.t+1]=1)}return t.t>0&&(t[t.t-1]+=g(r,n,r[n],t,2*n,0,1)),t.s=0,A(t)}function H(e,t,r,n){var i=k(t);if(i.t<=0)throw new OperationError("Division by zero");var a=k(e);if(a.t0?(N(i,h,s),N(a,h,n)):(v(i,s),v(a,n));var m=s.t,w=s[m-1];if(0===w)return r;var C=w*(1<1?s[m-2]>>p:0),x=l/C,T=(1<=0&&(n[n.t++]=1,B(n,U,n)),_(E,m,U),B(U,s,s);s.t=0;){var K=n[--F]===w?f:Math.floor(n[F]*x+(n[F-1]+I)*T);if((n[F]+=g(s,0,K,n,L,0,m))0&&O(n,h,n),o<0&&B(S,n,n),r}function j(e,t,r){return H(k(e),t,null,r),e.s<0&&R(r,S)>0&&B(t,r,r),r}function V(e,t){return j(e,t,y(t.t))}function G(e){return 0===(e.t>0?1&e[0]:e.s)}function q(e){return function(e,t){return 0===R(e,t)}(e,S)}function z(e){return e.s<0?-1:e.t<=0||1===e.t&&e[0]<=0?0:1}function W(e,t){var r=G(t);if(G(e)&&r||0===z(t))return S;for(var n=m(t),i=m(e),a=w(1),s=w(0),o=w(0),c=w(1);0!==z(n);){for(;G(n);)O(n,1,n),r?(G(a)&&G(s)||(T(a,e,a),B(s,t,s)),O(a,1,a)):G(s)||B(s,t,s),O(s,1,s);for(;G(i);)O(i,1,i),r?(G(o)&&G(c)||(T(o,e,o),B(c,t,c)),O(o,1,o)):G(c)||B(c,t,c),O(c,1,c);R(n,i)>=0?(B(n,i,n),r&&B(a,o,a),B(s,c,s)):(B(i,n,i),r&&B(o,a,o),B(c,s,c))}return 0!==R(i,E)?S:R(c,t)>=0?x(c,t):z(c)<0?(T(c,t,c),z(c)<0?I(c,t):c):c}function X(e,t){var r=Math.floor(t/u);return r>=e.t?0!==e.s:!!(e[r]&1<=0?V(e,this.m):e},revert:function(e){return e},reduce:function(e){j(e,this.m,e)},sqrTo:function(e,t){M(e,t),this.reduce(t)},mulTo:function(e,t,r){U(e,t,r),this.reduce(r)}});var Q=function(e){this.m=e,this.mp=function(e){if(e.t<1)return 0;var t=e[0];if(!(1&t))return 0;var r=3&t;return(r=(r=(r=(r=r*(2-(15&t)*r)&15)*(2-(255&t)*r)&255)*(2-((65535&t)*r&65535))&65535)*(2-t*r%h)%h)>0?h-r:-r}(e),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<=h;)e[r]-=h,++r>=e.t&&(e[e.t++]=0),++e[r]}}function $(e){var t,r;this.r2=y(2*e.t),this.q3=y(2*e.t),_(E,2*e.t,this.r2),this.mu=H(t=this.r2,r=e,y(Math.max(t.t-r.t,1)),null),this.m=e}function ee(e,t,r){var n,i,a=L(t),s=w(1);if(a<=0)return s;n=a<18?1:a<48?3:a<144?4:a<768?5:6,i=a<8?new J(r):G(r)?new $(r):new Q(r);var o=new Array,c=3,f=n-1,h=(1<1){var l=y(2*r.t);for(i.sqrTo(o[1],l);c<=h;)o[c]=y(2*r.t),i.mulTo(l,o[c-2],o[c]),c+=2}var d,p,g=t.t-1,m=!0,b=y(2*r.t);for(a=D(t[g])-1;g>=0;){for(a>=f?d=t[g]>>a-f&h:(d=(t[g]&(1<0&&(d|=t[g-1]>>u+a-f)),c=n;!(1&d);)d>>=1,--c;if((a-=c)<0&&(a+=u,--g),m)v(o[d],s),m=!1;else{for(;c>1;)i.sqrTo(s,b),i.sqrTo(b,s),c-=2;c>0?i.sqrTo(s,b):(p=s,s=b,b=p),i.mulTo(b,o[d],s)}for(;g>=0&&!(t[g]&1<0&&B(r,e.q,r),re(e,r)}function ie(e,t){var r=x(e,t);return r.s<0&&T(e.q,r,r),re(e,r)}function ae(e,t){return te(e,K(e,t))}function se(e){return te(e,function(e){return M(e,y(2*e.t))}(e))}function oe(e,t){return te(e,(n=t,i=y((r=e).t),n<0?O(r,-n,i):N(r,n,i),i));var r,n,i}function ce(e){return re(e,W(e,e.q))}function ue(e,t,r,n){return{curve:e,x:t,y:r,z:n||te(e,E)}}function fe(e){return e.zinv||(e.zinv=ce(e.z)),ae(e.x,e.zinv)}function he(e){return e.zinv||(e.zinv=ce(e.z)),ae(e.y,e.zinv)}function le(e){return!e.x&&!e.y||q(e.z)&&!q(e.y)}function de(e){return e.curve.infinity}function pe(e,t){if(le(e))return t;if(le(t))return e;var r=ie(ae(t.y,e.z),ae(e.y,t.z)),n=ie(ae(t.x,e.z),ae(e.x,t.z));if(q(n))return q(r)?ge(e):de(e);var i=e.x,a=e.y,s=se(n),o=ae(s,n),c=ae(i,s),u=ae(se(r),e.z),f=ae(ie(ae(ie(u,oe(c,1)),t.z),o),n),h=ne(ae(ie(ie(ae(ae(c,C),r),ae(a,o)),ae(u,r)),t.z),ae(r,o)),l=ae(ae(o,e.z),t.z);return ue(e.curve,f,h,l)}function ge(e){if(le(e))return e;if(0===z(e.y))return de(e);var t=e.x,r=e.y,n=ae(r,e.z),i=ae(n,r),a=e.curve.a,s=ae(se(t),C);q(a)||(s=ne(s,ae(se(e.z),a)));var o=ae(oe(ie(se(s),ae(oe(t,3),i)),1),n),c=ie(ae(oe(ie(ae(ae(s,C),t),oe(i,1)),2),i),ae(se(s),s)),u=oe(ae(se(n),n),3);return ue(e.curve,o,c,u)}function ye(e,t){if(le(e))return e;if(0===z(t))return de(e);var r,n=t,i=K(n,C),a=function(e){return ue(e.curve,e.x,function(e){return re(e,x(e.q,e))}(e.y),e.z)}(e),s=e;for(r=L(i)-2;r>0;--r){s=ge(s);var o=X(i,r);o!==X(n,r)&&(s=pe(s,o?e:a))}return s}function ve(e){var t=new Uint8Array(e),r=y(8*t.length/u);r.t=0,r.s=0;for(var n=0,i=0,a=t.length;iu?(r[r.t-1]|=(s&(1<>u-n):r[r.t-1]|=s<=u&&(n-=u)}return A(r)}function me(e,t){var r,n=!1,i=[],a=e.t,s=u-a*u%8;if(a-- >0)for(s>s)>0&&(n=!0,i.push(r));a>=0;)s<8?(r=(e[a]&(1<>(s+=u-8)):(r=e[a]>>(s-=8)&255,s<=0&&(s+=u,--a)),r>0&&(n=!0),n&&i.push(r);var o=new Uint8Array(t?t/8:i.length);return n&&o.set(i.reverse()),o.buffer}function be(e){if("number"==typeof e||e instanceof Number)return w(e);(e=e.replace(/[^\-A-Fa-f0-9]/g,""))||(e="0");for(var t=y(e.length/7),r=e.length,n=!1,i=0;--r>=0;)if("-"!==e.charAt(r)){var a=parseInt(e.charAt(r),16);n=!1,0===i?t[t.t++]=a:i+4>u?(t[t.t-1]|=(a&(1<>u-i):t[t.t-1]|=a<=u&&(i-=u)}else n=!0;return n&&B(S,t,t),A(t)}function we(e){if(e.s<0)return"-"+we(F(e,y(e.t)));var t,r=!1,n="",i=e.t,a=u-i*u%4;if(i-- >0)for(a>a)>0&&(r=!0,n=t.toString(16));i>=0;)a<4?(t=(e[i]&(1<>(a+=u-4)):(t=e[i]>>(a-=4)&15,a<=0&&(a+=u,--i)),t>0&&(r=!0),r&&(n+=t.toString(16));return"0x"+(r?n:"0")}function Se(e){for(var t=new Uint8Array(e),r=new Uint8Array(t.length),n=0,i=t.length;n0)throw new i.DataError("Buffer length must be even");var r=t.byteLength/2;return[ve(new Uint8Array(t,0,r)),ve(new Uint8Array(t,r,r))]}function Be(e,t,r){var n=me(e,r),i=me(t,r),a=new Uint8Array(n.byteLength+i.byteLength);return a.set(new Uint8Array(n)),a.set(new Uint8Array(i),n.byteLength),a.buffer}function xe(e,t){var r=Ce(t),n=ve(Ee.call(this,r)),i=this.q,s=V(ve(Ce(e)),i),o=V(n,i);q(o)&&(o=E);for(var c,u=S;q(u);){for(var f=S;q(f);){var h=V(ve(this.ukm||(0,a.getSeed)(this.bitLength)),i);if(this.curve)f=V(fe(ye(this.P,h)),i);else{var l=this.p;f=V(ee(this.a,h,l),i)}}u=V(I(K(f,s),K(h,o)),i)}return"SC"===this.procreator?c={r:we(f),s:we(u)}:(c=Be(f,u,this.bitLength),"CP"!==this.procreator&&"VN"!==this.procreator||(c=Se(c))),c}function Te(e,t,r){var n,i,a=this.q;if("SC"===this.procreator)n=be(t.r),i=be(t.s);else{"CP"!==this.procreator&&"VN"!==this.procreator||(t=Se(t));var s=Ae(t);i=s[1],n=s[0]}if(R(n,a)>=0||R(i,a)>=0)return!1;var o=Ce(r),c=V(ve(Ee.call(this,o)),a);0===q(c)&&(c=E);var u=W(c,a),f=V(K(i,u),a),h=x(a,V(K(n,u),a));if(this.curve)var l=Ae(e),d=this.curve,p=function(e,t,r,n){var i;i=L(t)>L(n)?L(t)-1:L(n)-1;for(var a=de(e),s=pe(e,r);i>=0;)a=ge(a),X(t,i)?a=X(n,i)?pe(a,s):pe(a,e):X(n,i)&&(a=pe(a,r)),--i;return a}(this.P,f,new ue(d,te(d,l[0]),m=te(d,l[1])),h),g=V(fe(p),a);else{var y=this.p,v=this.a,m=ve(e);g=V(V(K(ee(v,f,y),ee(m,h,y)),y),a)}return 0===R(g,n)}function Ie(){var e=this.curve;if(e){for(var t=e.infinity;le(t);){var r=S;if(this.ukm)r=ve(this.ukm);else for(;q(r);)r=V(ve((0,a.getSeed)(this.bitLength)),this.q);var n=fe(t=ye(this.P,r)),s=he(t)}return{privateKey:me(r,this.bitLength),publicKey:Be(n,s,this.bitLength)}}throw new i.NotSupportedError("Key generation for GOST R 34.10-94 not supported")}function Fe(){if(this.curve){for(var e=S;q(e);)e=V(ve((0,a.getSeed)(this.bitLength)),this.q);return me(e,this.bitLength)}throw new i.NotSupportedError("Key generation for GOST R 34.10-94 not supported")}function ke(e,t){if(this.curve){var r=this.q,n=V(ve(Ce(t)),r),a=V(ve(Ce(e)),r);return me("VN"===this.procreator?V(K(n,a),r):V(K(n,W(a,r)),r))}throw new i.NotSupportedError("Key wrapping GOST R 34.10-94 not supported")}function Re(e,t){if(this.curve){var r=this.q,n=V(ve(Ce(t)),r),a=V(ve(Ce(e)),r);return me("VN"===this.procreator?V(K(n,W(a,r)),r):V(K(n,a),r))}throw new i.NotSupportedError("Key wrapping GOST R 34.10-94 not supported")}function De(e){var t,r=ve(this.ukm),n=this.q,i=V(ve(Ce(e)),n);if(this.curve){var a=ye(this.peer_Q,V(K(r,i),n));t=Be(fe(a),he(a),this.bitLength)}else{var s=this.p;this.a,t=me(ee(this.peer_y,i,s))}return Ee.call(this,t)}function _e(e,t){if(t<8||t>this.bitLength||t%8>0)throw new i.DataError("Length must be no more than "+this.bitLength+" bits and multiple of 8");var r=t/8,n=De.call(this,e),a=new Uint8Array(r);return a.set(new Uint8Array(n,0,r)),a.buffer}function Pe(e){var t=De.call(this,e),r=new Uint8Array(32);return r.set(new Uint8Array(t,0,32)),r.buffer}Y(Q,{convert:function(e){var t=y(e.t);return _(k(e),this.m.t,t),H(t,this.m,null,t),e.s<0&&R(t,S)>0&&B(this.m,t,t),t},revert:function(e){var t=y(e.t);return v(e,t),this.reduce(t),t},reduce:function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&f;for(e[r=t+this.m.t]+=g(this.m,0,n,e,t,0,this.m.t);e[r]>=h;)e[r]-=h,e[++r]++}A(e),P(e,this.m.t,e),R(e,this.m)>=0&&B(e,this.m,e)},sqrTo:function(e,t){M(e,t),this.reduce(t)},mulTo:function(e,t,r){U(e,t,r),this.reduce(r)}}),Y($,{convert:function(e){if(e.s<0||e.t>2*this.m.t)return V(e,this.m);if(R(e,this.m)<0)return e;var t=y(e.t);return v(e,t),this.reduce(t),t},revert:function(e){return e},reduce:function(e){for(P(e,this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,A(e)),function(e,t,r,n){--r;var i=n.t=e.t+t.t-r;for(n.s=0;--i>=0;)n[i]=0;for(i=Math.max(r-e.t,0);i0;)n[--a]=0;for(i=n.t-e.t;a=0;)B(e,this.m,e)},sqrTo:function(e,t){M(e,t),this.reduce(t)},mulTo:function(e,t,r){U(e,t,r),this.reduce(r)}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gostEngine=void 0;var n=r(41),i=r(40),a=r(81),s=r(19),o={execute:function(e,t,r){var n=function(e,t){if(!t)throw new(SyntaxError||Error)("Algorithm not defined");if(!t.name)throw new(SyntaxError||Error)("Algorithm name not defined");var r=t.name,n=t.mode;if("GOST 28147"!==r&&"GOST R 34.12"!==r&&"RC2"!==r||"generateKey"!==e&&("MAC"!==n||"sign"!==e&&"verify"!==e)&&("KW"!==n&&"MASK"!==n||"wrapKey"!==e&&"unwrapKey"!==e)&&(n&&"ES"!==n||"encrypt"!==e&&"decrypt"!==e)){if("GOST R 34.11"!==r&&"SHA"!==r||"digest"!==e&&("HMAC"!==n||"sign"!==e&&"verify"!==e&&"generateKey"!==e)&&("KDF"!==n&&"PBKDF2"!==n&&"PFXKDF"!==n&&"CPKDF"!==n||"deriveKey"!==e&&"deriveBits"!==e&&"generateKey"!==e)){if("GOST R 34.10"!==r||"generateKey"!==e&&(n&&"SIGN"!==n||"sign"!==e&&"verify"!==e)&&("MASK"!==n||"wrapKey"!==e&&"unwrapKey"!==e)&&("DH"!==n||"deriveKey"!==e&&"deriveBits"!==e))throw new s.NotSupportedError("Algorithm "+r+"-"+n+" is not valid for "+e);return"GostSign"}return"GostDigest"}return"GostCipher"}(t,e),i=this["get"+n](e);return i[t].apply(i,r)},getGostCipher:function(e){return new n.GostCipher(e)},getGostDigest:function(e){return new i.GostDigest(e)},getGostSign:function(e){return new a.GostSign(e)}};t.gostEngine=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gostSubtleInstance=void 0,t.SubtleCrypto=E;var n=r(82),i=r(79),a=r(19),s=r(77);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=function(e){function t(){return o(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,Error),t}(),h=function(e){function t(){return o(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,Error),t}(),l=(0,i.getCryptoModule)();function d(e,t){("string"==typeof e||e instanceof String)&&(e={name:e});var r=e.name;if(!r)throw new SyntaxError("Algorithm name not defined");var n=(n=r.split("/"))[0].split("-").concat(n.slice(1)),i={};if(r=n[0].replace(/[\.\s]/g,""),n=n.slice(1),r.indexOf("28147")>=0)i={name:"GOST 28147",version:1989,mode:(e.mode||("sign"===t||"verify"===t?"MAC":"wrapKey"===t||"unwrapKey"===t?"KW":"ES")).toUpperCase(),length:e.length||64};else if(r.indexOf("3412")>=0)i={name:"GOST R 34.12",version:2015,mode:(e.mode||("sign"===t||"verify"===t?"MAC":"wrapKey"===t||"unwrapKey"===t?"KW":"ES")).toUpperCase(),length:e.length||64};else if(r.indexOf("3411")>=0)i={name:"GOST R 34.11",version:2012,mode:(e.mode||("deriveKey"===t||"deriveBits"===t?"KDF":"sign"===t||"verify"===t?"HMAC":"HASH")).toUpperCase(),length:e.length||256};else if(r.indexOf("3410")>=0)i={name:"GOST R 34.10",version:2012,mode:(e.mode||("deriveKey"===t||"deriveBits"===t?"DH":"SIGN")).toUpperCase(),length:e.length||256};else if(r.indexOf("SHA")>=0)i={name:"SHA",version:160===(e.length||160)?1:2,mode:(e.mode||("deriveKey"===t||"deriveBits"===t?"KDF":"sign"===t||"verify"===t?"HMAC":"HASH")).toUpperCase(),length:e.length||160};else if(r.indexOf("RC2")>=0)i={name:"RC2",version:1,mode:(e.mode||("sign"===t||"verify"===t?"MAC":"wrapKey"===t||"unwrapKey"===t?"KW":"ES")).toUpperCase(),length:e.length||32};else if(r.indexOf("PBKDF2")>=0)(i=d(e.hash,"digest")).mode="PBKDF2";else if(r.indexOf("PFXKDF")>=0)(i=d(e.hash,"digest")).mode="PFXKDF";else if(r.indexOf("CPKDF")>=0)(i=d(e.hash,"digest")).mode="CPKDF";else{if(!(r.indexOf("HMAC")>=0))throw new a.NotSupportedError("Algorithm not supported");(i=d(e.hash,"digest")).mode="HMAC"}switch(n.forEach((function(e){if(e=e.toUpperCase(),/^[0-9]+$/.test(e))if(["8","16","32"].indexOf(e)>=0||"128"===i.length&&"64"===e)if("ES"===i.mode)i.shiftBits=parseInt(e);else{if("MAC"!==i.mode)throw new a.NotSupportedError("Algorithm "+i.name+" mode "+e+" not supported");i.macLength=parseInt(e)}else if(["89","94","01","12","15","1989","1994","2001","2012","2015"].indexOf(e)>=0){var t=parseInt(e);t=t<1900?t<80?2e3+t:1900+t:t,i.version=t}else["1"].indexOf(e)>=0&&"SHA"===i.name?(i.version=1,i.length=160):["256","384","512"].indexOf(e)>=0&&"SHA"===i.name?(i.version=2,i.length=parseInt(e)):["40","128"].indexOf(e)>=0&&"RC2"===i.name?(i.version=1,i.length=parseInt(e)):["64","128","256","512"].indexOf(e)>=0?i.length=parseInt(e):["1000","2000"].indexOf(e)>=0&&(i.iterations=parseInt(e));else if(["E-TEST","E-A","E-B","E-C","E-D","E-SC","E-Z","D-TEST","D-A","D-SC"].indexOf(e)>=0)i.sBox=e;else if(["S-TEST","S-A","S-B","S-C","S-D","X-A","X-B","X-C"].indexOf(e)>=0)i.namedParam=e;else if(["S-256-TEST","S-256-A","S-256-B","S-256-C","P-256","T-512-TEST","T-512-A","T-512-B","X-256-A","X-256-B","T-256-TEST","T-256-A","T-256-B","S-256-B","T-256-C","S-256-C"].indexOf(e)>=0)i.namedCurve=e;else if(["SC","CP","VN"].indexOf(e)>=0)i.procreator=e;else if("GOST 28147"===i.name||"GOST R 34.12"===i.name||"RC2"===i.name)if(["ES","MAC","KW","MASK"].indexOf(e)>=0)i.mode=e;else if(["ECB","CFB","OFB","CTR","CBC"].indexOf(e)>=0)i.mode="ES",i.block=e;else if(["CPKW","NOKW","SCKW"].indexOf(e)>=0)i.mode="KW",i.keyWrapping=e.replace("KW","");else if(["ZEROPADDING","PKCS5PADDING","NOPADDING","RANDOMPADDING","BITPADDING"].indexOf(e)>=0)i.padding=e.replace("PADDING","");else{if(!(["NOKM","CPKM"].indexOf(e)>=0))throw new a.NotSupportedError("Algorithm "+i.name+" mode "+e+" not supported");i.keyMeshing=e.replace("KM","")}else if("GOST R 34.11"===i.name||"SHA"===i.name){if(!(["HASH","KDF","HMAC","PBKDF2","PFXKDF","CPKDF"].indexOf(e)>=0))throw new a.NotSupportedError("Algorithm "+i.name+" mode "+e+" not supported");i.mode=e}else if("GOST R 34.10"===i.name){var r=e.replace(/[\.\s]/g,"");if(r.indexOf("GOST")>=0&&r.indexOf("3411")>=0)i.hash=e;else{if(!["SIGN","DH","MASK"].indexOf(e))throw new a.NotSupportedError("Algorithm "+i.name+" mode "+e+" not supported");i.mode=e}}})),i.procreator=e.procreator||i.procreator||"CP",i.name){case"GOST R 34.10":i.keySize=i.length/(1994===i.version?4:8);break;case"GOST R 34.11":case"GOST 28147":case"GOST R 34.12":i.keySize=32;break;case"RC2":i.keySize=Math.ceil(i.length/8);break;case"SHA":i.keySize=i.length/8}switch("ES"===i.mode&&(e.block&&(i.block=e.block),i.block&&(i.block=i.block.toUpperCase()),e.padding&&(i.padding=e.padding),i.padding&&(i.padding=i.padding.toUpperCase()),e.shiftBits&&(i.shiftBits=e.shiftBits),e.keyMeshing&&(i.keyMeshing=e.keyMeshing),i.keyMeshing&&(i.keyMeshing=i.keyMeshing.toUpperCase()),"importKey"!==t&&"generateKey"!==t&&(i.block=i.block||"ECB",i.padding=i.padding||("CBC"===i.block||"ECB"===i.block?"ZERO":"NO"),"CFB"!==i.block&&"OFB"!==i.block||(i.shiftBits=i.shiftBits||i.length),i.keyMeshing=i.keyMeshing||"NO")),"KW"===i.mode&&(e.keyWrapping&&(i.keyWrapping=e.keyWrapping),i.keyWrapping&&(i.keyWrapping=i.keyWrapping.toUpperCase()),"importKey"!==t&&"generateKey"!==t&&(i.keyWrapping=i.keyWrapping||"NO")),["sBox","namedParam","namedCurve","curve","param","modulusLength"].forEach((function(t){e[t]&&(i[t]=e[t])})),"importKey"!==t&&"generateKey"!==t&&("GOST 28147"===i.name?i.sBox=i.sBox||("SC"===i.procreator?"E-SC":"E-A"):"GOST R 34.12"===i.name&&64===i.length?i.sBox="E-Z":"GOST R 34.11"===i.name&&1994===i.version?i.sBox=i.sBox||("SC"===i.procreator?"D-SC":"D-A"):"GOST R 34.10"===i.name&&1994===i.version?i.namedParam=i.namedParam||("DH"===i.mode?"X-A":"S-A"):("GOST R 34.10"===i.name&&2001===i.version||"GOST R 34.10"===i.name&&2012===i.version)&&(i.namedCurve=i.namedCurve||(256===i.length?"SC"===i.procreator?"P-256":"DH"===i.mode?"X-256-A":"S-256-A":"T-512-A"===i.mode))),i.mode){case"DH":e.ukm&&(i.ukm=e.ukm),e.public&&(i.public=e.public);break;case"SIGN":case"KW":e.ukm&&(i.ukm=e.ukm);break;case"ES":case"MAC":e.iv&&(i.iv=e.iv);break;case"KDF":e.label&&(i.label=e.label),e.contex&&(i.context=e.contex);break;case"PBKDF2":case"PFXKDF":e.salt&&(i.salt=e.salt),e.iterations&&(i.iterations=e.iterations),e.diversifier&&(i.diversifier=e.diversifier);break;case"CPKDF":e.salt&&(i.salt=e.salt),e.iterations&&(i.iterations=e.iterations)}if(t&&("ES"!==i.mode&&"SIGN"!==i.mode&&"MAC"!==i.mode&&"HMAC"!==i.mode&&"KW"!==i.mode&&"DH"!==i.mode&&"MASK"!==i.mode&&"generateKey"===t||"ES"!==i.mode&&("encrypt"===t||"decrypt"===t)||"SIGN"!==i.mode&&"MAC"!==i.mode&&"HMAC"!==i.mode&&("sign"===t||"verify"===t)||"HASH"!==i.mode&&"digest"===t||"KW"!==i.mode&&"MASK"!==i.mode&&("wrapKey"===t||"unwrapKey"===t)||"DH"!==i.mode&&"PBKDF2"!==i.mode&&"PFXKDF"!==i.mode&&"CPKDF"!==i.mode&&"KDF"!==i.mode&&("deriveKey"===t||"deriveBits"===t)))throw new a.NotSupportedError("Algorithm mode "+i.mode+" not valid for method "+t);return e.hash&&(i.hash=e.hash),i.hash&&(("string"==typeof i.hash||i.hash instanceof String)&&i.procreator&&(i.hash=i.hash+"/"+i.procreator),i.hash=d(i.hash,"digest")),e.id&&(i.id=e.id),i}function p(e){if(!l||!l.subtle||!e)return!1;var t="string"==typeof e||e instanceof String?t=e:e.name;return!!t&&(((t=t.toUpperCase()).indexOf("KDF")>=0||t.indexOf("HMAC")>=0)&&e.hash?p(e.hash):-1===t.indexOf("GOST")&&-1===t.indexOf("SHA-1")&&-1===t.indexOf("RC2")&&-1===t.indexOf("?DES"))}function g(e,t){if(!e.algorithm)throw new SyntaxError("Key algorithm not defined");if(!e.algorithm.name)throw new SyntaxError("Key algorithm name not defined");var r=e.algorithm.name,n="GOST 28147"===r||"GOST R 34.12"===r||"RC2"===r,i="GOST R 34.11"===r||"SHA"===r,s="GOST R 34.10"===r;if(!n&&!s&&!i)throw new a.NotSupportedError("Key algorithm "+r+" is unsupproted");if(!e.type)throw new SyntaxError("Key type not defined");if((n||i)&&"secret"!==e.type||s&&"public"!==e.type&&"private"!==e.type)throw new a.DataError("Key type "+e.type+" is not valid for algorithm "+r);if(!e.usages||!e.usages.indexOf)throw new SyntaxError("Key usages not defined");for(var o=0,c=e.usages.length;o=0||e.usages.indexOf("decrypt")>=0)||"private"===e.type&&256!==l&&512!==l||"public"===e.type&&512!==l&&1024!==l)throw new SyntaxError("Key buffer has wrong size "+l+" bit")}function y(e,t,r){if(g(r,e),t){var n;switch(t.mode){case"ES":n=["sBox","keyMeshing","padding","block"];break;case"SIGN":n=["namedCurve","namedParam","sBox","curve","param","modulusLength"];break;case"MAC":n=["sBox"];break;case"KW":n=["keyWrapping","ukm"];break;case"DH":n=["namedCurve","namedParam","sBox","ukm","curve","param","modulusLength"];break;case"KDF":n=["context","label"];break;case"PBKDF2":n=["sBox","iterations","salt"];break;case"PFXKDF":n=["sBox","iterations","salt","diversifier"];break;case"CPKDF":n=["sBox","salt"]}n&&n.forEach((function(e){r.algorithm[e]&&(t[e]=r.algorithm[e])}))}return r.buffer}function v(e,t,r,n,i){var a={type:i||("GOST R 34.10"===e.name?"private":"secret"),extractable:t||"false",algorithm:e,usages:r||[],buffer:n};return g(a),a}function m(e){e instanceof S&&(e=new Uint8Array(e));for(var t=new Uint8Array(e.length),r=0,n=e.length;r=0&&i.indexOf("sign")>=0?o="private":c.indexOf("3410")>=0&&i.indexOf("verify")>=0&&(o="public")}return t}var u;if("pkcs8"===e)u=s.gostASN1Instance.GostPrivateKeyInfo.decode(t).object;else{if("spki"!==e)throw new a.NotSupportedError("Key format not supported");u=s.gostASN1Instance.GostSubjectPublicKeyInfo.decode(t).object}if(r=d(u.algorithm,"importKey"),o=u.type,!1!==n&&(n=n||u.extractable),i){for(var f=0;f0)throw new a.DataError("Invalid key size");r.mode="MASK",r.procreator="VN";var v=[];for(f=g;f=0&&o.indexOf("sign")>=0?t="private":r.indexOf("3410")>=0&&o.indexOf("verify")>=0&&(t="public")}return"SC"===n.procreator&&"private"===t&&(e=m(e)),v(i,s,o,e,t)}))}))},t.gostSubtleInstance=new E},function(e,t,r){"use strict";(function(e,n){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var a=r(1),s=r(12),o=a.Buffer,c=a.kMaxLength,u=e.crypto||e.msCrypto,f=Math.pow(2,32)-1;function h(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>f||e<0)throw new TypeError("offset must be a uint32");if(e>c||e>t)throw new RangeError("offset out of range")}function l(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>f||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>c)throw new RangeError("buffer too small")}function d(e,t,r,i){if(n.browser){var a=e.buffer,o=new Uint8Array(a,t,r);return u.getRandomValues(o),i?void n.nextTick((function(){i(null,e)})):e}if(!i)return s(r).copy(e,t),e;s(r,(function(r,n){if(r)return i(r);n.copy(e,t),i(null,e)}))}u&&u.getRandomValues||!n.browser?(t.randomFill=function(t,r,n,i){if(!(o.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)i=r,r=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-r;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return h(r,t.length),l(n,r,t.length),d(t,r,n,i)},t.randomFillSync=function(t,r,n){if(void 0===r&&(r=0),!(o.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return h(r,t.length),void 0===n&&(n=t.length-r),l(n,r,t.length),d(t,r,n)}):(t.randomFill=i,t.randomFillSync=i)}).call(this,r(7),r(9))},function(e,t,r){(function(t){var n=r(20),i=r(44),a=r(43),s=r(3),o=r(27),c=r(18),u=r(42);e.exports=function(e,r,f){var h;h=e.padding?e.padding:f?1:4;var l,d=n(e),p=d.modulus.byteLength();if(r.length>p||new s(r).cmp(d.modulus)>=0)throw new Error("decryption error");l=f?u(new s(r),d):o(r,d);var g=new t(p-l.length);if(g.fill(0),l=t.concat([g,l],p),4===h)return function(e,r){e.modulus;var n=e.modulus.byteLength(),s=(r.length,c("sha1").update(new t("")).digest()),o=s.length;if(0!==r[0])throw new Error("decryption error");var u=r.slice(1,o+1),f=r.slice(o+1),h=a(u,i(f,o)),l=a(f,i(h,n-o-1));if(function(e,r){e=new t(e),r=new t(r);var n=0,i=e.length;e.length!==r.length&&(n++,i=Math.min(e.length,r.length));for(var a=-1;++a=t.length){a++;break}var s=t.slice(2,i-1);if(t.slice(i-1,i),("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&a++,s.length<8&&a++,a)throw new Error("decryption error");return t.slice(i)}(0,l,f);if(3===h)return l;throw new Error("unknown padding")}}).call(this,r(2).Buffer)},function(e,t,r){(function(t){var n=r(20),i=r(12),a=r(18),s=r(44),o=r(43),c=r(3),u=r(42),f=r(27);e.exports=function(e,r,h){var l;l=e.padding?e.padding:h?1:4;var d,p=n(e);if(4===l)d=function(e,r){var n=e.modulus.byteLength(),u=r.length,f=a("sha1").update(new t("")).digest(),h=f.length,l=2*h;if(u>n-l-2)throw new Error("message too long");var d=new t(n-u-l-2);d.fill(0);var p=n-h-1,g=i(h),y=o(t.concat([f,d,new t([1]),r],p),s(g,p)),v=o(g,s(y,h));return new c(t.concat([new t([0]),v,y],n))}(p,r);else if(1===l)d=function(e,r,n){var a,s=r.length,o=e.modulus.byteLength();if(s>o-11)throw new Error("message too long");return n?(a=new t(o-s-3)).fill(255):a=function(e,r){for(var n,a=new t(e),s=0,o=i(2*e),c=0;s=0)throw new Error("data too long for modulus")}return h?f(d,p):u(d,p)}}).call(this,r(2).Buffer)},function(e,t,r){t.publicEncrypt=r(86),t.privateDecrypt=r(85),t.privateEncrypt=function(e,r){return t.publicEncrypt(e,r,!0)},t.publicDecrypt=function(e,r){return t.privateDecrypt(e,r,!0)}},function(e,t,r){(function(t){var n=r(4),i=r(3);e.exports=function(e){return new s(e)};var a={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function s(e){this.curveType=a[e],this.curveType||(this.curveType={name:e}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function o(e,r,n){Array.isArray(e)||(e=e.toArray());var i=new t(e);if(n&&i.length=t)throw new Error("invalid sig")}e.exports=function(e,r,c,u,f){var h=a(c);if("ec"===h.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var n=s[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var a=new i(n),o=r.data.subjectPrivateKey.data;return a.verify(t,e,o)}(e,r,h)}if("dsa"===h.type){if("dsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,s=r.data.q,c=r.data.g,u=r.data.pub_key,f=a.signature.decode(e,"der"),h=f.s,l=f.r;o(h,s),o(l,s);var d=n.mont(i),p=h.invm(s);return 0===c.toRed(d).redPow(new n(t).mul(p).mod(s)).fromRed().mul(u.toRed(d).redPow(l.mul(p).mod(s)).fromRed()).mod(i).mod(s).cmp(l)}(e,r,h)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");r=t.concat([f,r]);for(var l=h.modulus.byteLength(),d=[1],p=0;r.length+d.length+2>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new o;if(48!==e[r.place++])return!1;if(c(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=c(e,r),s=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var u=c(e,r);if(e.length!==u+r.place)return!1;var f=e.slice(r.place,u+r.place);return 0===s[0]&&128&s[1]&&(s=s.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new n(s),this.s=new n(f),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,t.length),(n=n.concat(t)).push(2),f(n,r.length);var a=n.concat(r),s=[48];return f(s,a.length),s=s.concat(a),i.encode(s,e)}},function(e,t,r){"use strict";var n=r(3),i=r(4).utils.assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=a,a.fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return""}},function(e,t,r){"use strict";var n=r(26),i=r(53),a=r(5);function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var a=[];a.length0))return o.iaddn(1),this.keyFromPrivate(o)}},u.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},u.prototype.sign=function(e,t,r,a){"object"==typeof r&&(a=r,r=null),a||(a={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var s=this.n.byteLength(),o=t.getPrivate().toArray("be",s),u=e.toArray("be",s),f=new i({hash:this.hash,entropy:o,nonce:u,pers:a.pers,persEnc:a.persEnc||"utf8"}),h=this.n.sub(new n(1)),l=0;;l++){var d=a.k?a.k(l):new n(f.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(h)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var g=p.getX(),y=g.umod(this.n);if(0!==y.cmpn(0)){var v=d.invm(this.n).mul(y.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var m=(p.getY().isOdd()?1:0)|(0!==g.cmp(y)?2:0);return a.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),m^=1),new c({r:y,s:v,recoveryParam:m})}}}}}},u.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var a=(t=new c(t,"hex")).r,s=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o,u=s.invm(this.n),f=u.mul(e).umod(this.n),h=u.mul(a).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(f,r.getPublic(),h)).isInfinity()&&o.eqXToP(a):!(o=this.g.mulAdd(f,r.getPublic(),h)).isInfinity()&&0===o.getX().umod(this.n).cmp(a)},u.prototype.recoverPubKey=function(e,t,r,i){s((3&r)===r,"The recovery param is more than two bits"),t=new c(t,i);var a=this.n,o=new n(e),u=t.r,f=t.s,h=1&r,l=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");u=l?this.curve.pointFromX(u.add(this.curve.n),h):this.curve.pointFromX(u,h);var d=t.r.invm(a),p=a.sub(o).mul(d).umod(a),g=f.mul(d).umod(a);return this.g.mulAdd(p,u,g)},u.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new c(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(e,t,r){"use strict";var n=r(6),i=r(5);function a(e,t,r){if(!(this instanceof a))return new a(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=a,a.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=n.redAdd(t),s=a.redSub(r),o=n.redSub(t),c=i.redMul(s),u=a.redMul(o),f=i.redMul(o),h=s.redMul(a);return this.curve.point(c,u,h,f)},f.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var s=(u=this.curve._mulA(i)).redAdd(a);if(this.zOne)e=n.redSub(i).redSub(a).redMul(s.redSub(this.curve.two)),t=s.redMul(u.redSub(a)),r=s.redSqr().redSub(s).redSub(s);else{var o=this.z.redSqr(),c=s.redSub(o).redISub(o);e=n.redSub(i).redISub(a).redMul(c),t=s.redMul(u.redSub(a)),r=s.redMul(c)}}else{var u=i.redAdd(a);o=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(o).redSub(o),e=this.curve._mulC(n.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(i.redISub(a)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),a=r.redSub(t),s=i.redSub(n),o=i.redAdd(n),c=r.redAdd(t),u=a.redMul(s),f=o.redMul(c),h=a.redMul(c),l=s.redMul(o);return this.curve.point(u,f,l,h)},f.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),a=this.x.redMul(e.x),s=this.y.redMul(e.y),o=this.curve.d.redMul(a).redMul(s),c=i.redSub(o),u=i.redAdd(o),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(s),h=n.redMul(c).redMul(f);return this.curve.twisted?(t=n.redMul(u).redMul(s.redSub(this.curve._mulA(a))),r=c.redMul(u)):(t=n.redMul(u).redMul(s.redSub(a)),r=this.curve._mulC(c).redMul(u)),this.curve.point(h,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}return!1},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},function(e,t,r){"use strict";var n=r(21),i=r(3),a=r(0),s=n.base,o=r(4).utils;function c(e){s.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){s.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(c,s),e.exports=c,c.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},a(u,s.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},c.prototype.point=function(e,t){return new u(this,e,t)},c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),s=i.redMul(n),o=t.z.redMul(a.redAdd(s).redSqr()),c=t.x.redMul(a.redISub(s).redSqr());return this.curve.point(o,c)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var a=i.length-1;a>=0;a--)0===i[a]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(21),i=r(4),a=r(3),s=r(0),o=n.base,c=i.utils.assert;function u(e){o.call(this,"short",e),this.a=new a(e.a,16).toRed(this.red),this.b=new a(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function f(e,t,r,n){o.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new a(t,16),this.y=new a(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(e,t,r,n){o.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new a(0)):(this.x=new a(t,16),this.y=new a(r,16),this.z=new a(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}s(u,o),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new a(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new a(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],c(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new a(e.a,16),b:new a(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:a.mont(e),r=new a(2).toRed(t).redInvm(),n=r.redNeg(),i=new a(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,i,s,o,c,u,f,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,d=this.n.clone(),p=new a(1),g=new a(0),y=new a(0),v=new a(1),m=0;0!==l.cmpn(0);){var b=d.div(l);u=d.sub(b.mul(l)),f=y.sub(b.mul(p));var w=v.sub(b.mul(g));if(!n&&u.cmp(h)<0)t=c.neg(),r=p,n=u.neg(),i=f;else if(n&&2==++m)break;c=u,d=l,l=u,y=p,p=f,v=g,g=w}s=u.neg(),o=f;var S=n.sqr().add(i.sqr());return s.sqr().add(o.sqr()).cmp(S)>=0&&(s=t,o=r),n.negative&&(n=n.neg(),i=i.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:n,b:i},{a:s,b:o}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),o=a.mul(n.a),c=i.mul(r.b),u=a.mul(n.b);return{k1:e.sub(s).sub(o),k2:c.add(u).neg()}},u.prototype.pointFromX=function(e,t){(e=new a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a":""},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},f.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(e){return e=new a(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},f.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},f.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},f.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(h,o.BasePoint),u.prototype.jpoint=function(e,t,r){return new h(this,e,t,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),o=n.redSub(i),c=a.redSub(s);if(0===o.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),f=u.redMul(o),h=n.redMul(u),l=c.redSqr().redIAdd(f).redISub(h).redISub(h),d=c.redMul(h.redISub(l)).redISub(a.redMul(f)),p=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(l,d,p)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),s=r.redSub(n),o=i.redSub(a);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),f=r.redMul(c),h=o.redSqr().redIAdd(u).redISub(f).redISub(f),l=o.redMul(f.redISub(h)).redISub(i.redMul(u)),d=this.z.redMul(s);return this.curve.jpoint(h,l,d)},h.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}return!1},h.prototype.inspect=function(){return this.isInfinity()?"":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(3),i=r(4).utils,a=i.getNAF,s=i.getJSF,o=i.assert;function c(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){o(e.precomputed);var r=e._getDoubles(),n=a(t,1),i=(1<=c;t--)u=(u<<1)+n[t];s.push(u)}for(var f=this.jpoint(null,null,null),h=this.jpoint(null,null,null),l=i;l>0;l--){for(c=0;c=0;u--){for(t=0;u>=0&&0===s[u];u--)t++;if(u>=0&&t++,c=c.dblp(t),u<0)break;var f=s[u];o(0!==f),c="affine"===e.type?f>0?c.mixedAdd(i[f-1>>1]):c.mixedAdd(i[-f-1>>1].neg()):f>0?c.add(i[f-1>>1]):c.add(i[-f-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,n,i){for(var o=this._wnafT1,c=this._wnafT2,u=this._wnafT3,f=0,h=0;h=1;h-=2){var d=h-1,p=h;if(1===o[d]&&1===o[p]){var g=[t[d],null,null,t[p]];0===t[d].y.cmp(t[p].y)?(g[1]=t[d].add(t[p]),g[2]=t[d].toJ().mixedAdd(t[p].neg())):0===t[d].y.cmp(t[p].y.redNeg())?(g[1]=t[d].toJ().mixedAdd(t[p]),g[2]=t[d].add(t[p].neg())):(g[1]=t[d].toJ().mixedAdd(t[p]),g[2]=t[d].toJ().mixedAdd(t[p].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[d],r[p]);f=Math.max(v[0].length,f),u[d]=new Array(f),u[p]=new Array(f);for(var m=0;m=0;h--){for(var C=0;h>=0;){var A=!0;for(m=0;m=0&&C++,S=S.dblp(C),h<0)break;for(m=0;m0?B=c[m][x-1>>1]:x<0&&(B=c[m][-x-1>>1].neg()),S="affine"===B.type?S.mixedAdd(B):S.add(B))}}for(h=0;h=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0;){var a;if(i.isOdd()){var s=i.andln(n-1);a=s>(n>>1)-1?(n>>1)-s:s,i.isubn(a)}else a=0;r.push(a);for(var o=0!==i.cmpn(0)&&0===i.andln(n-1)?t+1:1,c=1;c0||t.cmpn(-i)>0;){var a,s,o,c=e.andln(3)+n&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),a=1&c?3!=(o=e.andln(7)+n&7)&&5!==o||2!==u?c:-c:0,r[0].push(a),s=1&u?3!=(o=t.andln(7)+i&7)&&5!==o||2!==c?u:-u:0,r[1].push(s),2*n===a+1&&(n=1-n),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e){e.exports={_args:[["elliptic@6.4.0","/Users/mtokarev/projects/js/crypto"]],_development:!0,_from:"elliptic@6.4.0",_id:"elliptic@6.4.0",_inBundle:!1,_integrity:"sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=",_location:"/elliptic",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"elliptic@6.4.0",name:"elliptic",escapedName:"elliptic",rawSpec:"6.4.0",saveSpec:null,fetchSpec:"6.4.0"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",_spec:"6.4.0",_where:"/Users/mtokarev/projects/js/crypto",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.0"}},function(e,t,r){(function(t){var n=r(68),i=r(27),a=r(4).ec,s=r(3),o=r(20),c=r(45);function u(e,r,i,a){if((e=new t(e.toArray())).length0&&r.ishrn(n),r}function h(e,r,i){var a,s;do{for(a=new t(0);8*a.length16)throw new Error("unable to decrypt data");for(var r=-1;++r16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},h.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=a[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=u(t,!1,r.key,r.iv);return l(e,n.key,n.iv)},t.createDecipheriv=l},function(e,t,r){var n=r(1).Buffer,i=n.alloc(16,0);function a(e){var t=n.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function s(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(e){for(var t=-1;++t0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=a(i)},s.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},s.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(a([0,e,0,t])),this.state},e.exports=s},function(e,t,r){(function(e){var n=r(16);function i(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(t,r){for(;t._cache.length>s%8,e._prev=a(e._prev,r?n:i);return o}function a(e,t){var r=e.length,i=-1,a=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i>7;return a}t.encrypt=function(e,t,r){for(var a=t.length,s=n.allocUnsafe(a),o=-1;++o15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},l.prototype.flush=function(){for(var e=16-this.cache.length,t=a.allocUnsafe(e),r=-1;++r>>1];r=s.r28shl(r,o),i=s.r28shl(i,o),s.pc2(r,i,e.keys,a)}},u.prototype._update=function(e,t,r,n){var i=this._desState,a=s.readUInt32BE(e,t),o=s.readUInt32BE(e,t+4);s.ip(a,o,i.tmp,0),a=i.tmp[0],o=i.tmp[1],"encrypt"===this.type?this._encrypt(i,a,o,i.tmp,0):this._decrypt(i,a,o,i.tmp,0),a=i.tmp[0],o=i.tmp[1],s.writeUInt32BE(r,a,n),s.writeUInt32BE(r,o,n+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n>>0,a=l}s.rip(o,a,n,i)},u.prototype._decrypt=function(e,t,r,n,i){for(var a=r,o=t,c=e.keys.length-2;c>=0;c-=2){var u=e.keys[c],f=e.keys[c+1];s.expand(a,e.tmp,0),u^=e.tmp[0],f^=e.tmp[1];var h=s.substitute(u,f),l=a;a=(o^s.permute(h))>>>0,o=l}s.rip(a,o,n,i)}},function(e,t,r){"use strict";var n=r(5);function i(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},i.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),n=0;n0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,a=0,s=6;s>=0;s-=2){for(var o=0;o<=24;o+=8)i<<=1,i|=t>>>o+s&1;for(o=0;o<=24;o+=8)i<<=1,i|=e>>>o+s&1}for(s=6;s>=0;s-=2){for(o=1;o<=25;o+=8)a<<=1,a|=t>>>o+s&1;for(o=1;o<=25;o+=8)a<<=1,a|=e>>>o+s&1}r[n+0]=i>>>0,r[n+1]=a>>>0},t.rip=function(e,t,r,n){for(var i=0,a=0,s=0;s<4;s++)for(var o=24;o>=0;o-=8)i<<=1,i|=t>>>o+s&1,i<<=1,i|=e>>>o+s&1;for(s=4;s<8;s++)for(o=24;o>=0;o-=8)a<<=1,a|=t>>>o+s&1,a<<=1,a|=e>>>o+s&1;r[n+0]=i>>>0,r[n+1]=a>>>0},t.pc1=function(e,t,r,n){for(var i=0,a=0,s=7;s>=5;s--){for(var o=0;o<=24;o+=8)i<<=1,i|=t>>o+s&1;for(o=0;o<=24;o+=8)i<<=1,i|=e>>o+s&1}for(o=0;o<=24;o+=8)i<<=1,i|=t>>o+s&1;for(s=1;s<=3;s++){for(o=0;o<=24;o+=8)a<<=1,a|=t>>o+s&1;for(o=0;o<=24;o+=8)a<<=1,a|=e>>o+s&1}for(o=0;o<=24;o+=8)a<<=1,a|=e>>o+s&1;r[n+0]=i>>>0,r[n+1]=a>>>0},t.r28shl=function(e,t){return e<>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,r,i){for(var a=0,s=0,o=n.length>>>1,c=0;c>>n[c]&1;for(c=o;c>>n[c]&1;r[i+0]=a>>>0,r[i+1]=s>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var a=23;a>=15;a-=4)n<<=6,n|=e>>>a&63;for(a=11;a>=3;a-=4)i|=e>>>a&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,n=0;n<4;n++)r<<=4,r|=i[64*n+(e>>>18-6*n&63)];for(n=0;n<4;n++)r<<=4,r|=i[256+64*n+(t>>>18-6*n&63)];return r>>>0};var a=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r>>a[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.lengtho?t=e(t):t.length>>27}function f(e){return e<<30|e>>>2}function h(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,o=0|this._d,c=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=(t=r[l-3]^r[l-8]^r[l-14]^r[l-16])<<1|t>>>31;for(var d=0;d<80;++d){var p=~~(d/20),g=u(n)+h(p,i,a,o)+c+r[d]+s[p]|0;c=o,o=a,a=f(i),i=n,n=g}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=o+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=a.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},function(e,t,r){var n=r(0),i=r(11),a=r(1).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function c(){this.init(),this._w=o,i.call(this,64,56)}function u(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,o=0|this._d,c=0|this._e,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<80;++h)r[h]=r[h-3]^r[h-8]^r[h-14]^r[h-16];for(var l=0;l<80;++l){var d=~~(l/20),p=0|((t=n)<<5|t>>>27)+f(d,i,a,o)+c+r[l]+s[d];c=o,o=a,a=u(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=o+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=a.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},function(e,t,r){e.exports=r(35).PassThrough},function(e,t,r){e.exports=r(35).Transform},function(e,t,r){e.exports=r(10)},function(e,t,r){e.exports=r(34)},function(e,t,r){"use strict";e.exports=a;var n=r(71),i=r(17);function a(e){if(!(this instanceof a))return new a(e);n.call(this,e)}i.inherits=r(0),i.inherits(a,n),a.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(7))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,a,s,o,c=1,u={},f=!1,h=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(s="setImmediate$"+Math.random()+"$",o=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",o,!1):e.attachEvent("onmessage",o),n=function(t){e.postMessage(s+t,"*")}):e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){a.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,n=function(e){var t=h.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)},l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(163),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(7))},function(e,t){},function(e,t,r){"use strict";var n=r(1).Buffer,i=r(165);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i=n.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=i,r=s,a.data.copy(t,r),s+=a.data.length,a=a.next;return i},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t){t.read=function(e,t,r,n,i){var a,s,o=8*i-n-1,c=(1<>1,f=-7,h=r?i-1:0,l=r?-1:1,d=e[t+h];for(h+=l,a=d&(1<<-f)-1,d>>=-f,f+=o;f>0;a=256*a+e[t+h],h+=l,f-=8);for(s=a&(1<<-f)-1,a>>=-f,f+=n;f>0;s=256*s+e[t+h],h+=l,f-=8);if(0===a)a=1-u;else{if(a===c)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),a-=u}return(d?-1:1)*s*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var s,o,c,u=8*a-i-1,f=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+h>=1?l/c:l*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=f?(o=0,s=f):s+h>=1?(o=(t*c-1)*Math.pow(2,i),s+=h):(o=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&o,d+=p,o/=256,i-=8);for(s=s<0;e[r+d]=255&s,d+=p,s/=256,u-=8);e[r+d-p]|=128*g}},function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){for(var t,r=c(e),n=r[0],s=r[1],o=new a(function(e,t,r){return 3*(t+r)/4-r}(0,n,s)),u=0,f=s>0?n-4:n,h=0;h>16&255,o[u++]=t>>8&255,o[u++]=255&t;return 2===s&&(t=i[e.charCodeAt(h)]<<2|i[e.charCodeAt(h+1)]>>4,o[u++]=255&t),1===s&&(t=i[e.charCodeAt(h)]<<10|i[e.charCodeAt(h+1)]<<4|i[e.charCodeAt(h+2)]>>2,o[u++]=t>>8&255,o[u++]=255&t),o},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],s=16383,o=0,c=r-i;oc?c:o+s));return 1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=s[o],i[s.charCodeAt(o)]=o;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,r){for(var i,a,s=[],o=t;o>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t,r){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=r(12),t.createHash=t.Hash=r(18),t.createHmac=t.Hmac=r(68);var n=r(151),i=Object.keys(n),a=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return a};var s=r(65);t.pbkdf2=s.pbkdf2,t.pbkdf2Sync=s.pbkdf2Sync;var o=r(149);t.Cipher=o.Cipher,t.createCipher=o.createCipher,t.Cipheriv=o.Cipheriv,t.createCipheriv=o.createCipheriv,t.Decipher=o.Decipher,t.createDecipher=o.createDecipher,t.Decipheriv=o.Decipheriv,t.createDecipheriv=o.createDecipheriv,t.getCiphers=o.getCiphers,t.listCiphers=o.listCiphers;var c=r(132);t.DiffieHellmanGroup=c.DiffieHellmanGroup,t.createDiffieHellmanGroup=c.createDiffieHellmanGroup,t.getDiffieHellman=c.getDiffieHellman,t.createDiffieHellman=c.createDiffieHellman,t.DiffieHellman=c.DiffieHellman;var u=r(126);t.createSign=u.createSign,t.Sign=u.Sign,t.createVerify=u.createVerify,t.Verify=u.Verify,t.createECDH=r(88);var f=r(87);t.publicEncrypt=f.publicEncrypt,t.privateEncrypt=f.privateEncrypt,t.publicDecrypt=f.publicDecrypt,t.privateDecrypt=f.privateDecrypt;var h=r(84);t.randomFill=h.randomFill,t.randomFillSync=h.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gostCertInstance=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.GostCert=k;var i=r(173),a=r(78),s=r(39),o=r(77),c=r(83),u=ArrayBuffer,f=s.gostCodingInstance,h=a.gostSecurityInstance.providers,l=o.gostASN1Instance,d=c.gostSubtleInstance;function p(e){for(var t=1,r=arguments.length;tt.date.getTime())}function C(e,t,r){var n={subject:e.issuer,date:r},i=t&&t.authorityKeyIdentifier;return i&&(n.subjectKeyIdentifier=i.keyIdentifier,i.authorityCertIssuer&&i.authorityCertIssuer[0]&&i.authorityCertSerialNumber&&(n.issuer=i.authorityCertIssuer[0],n.serialNumber=i.authorityCertSerialNumber)),n}function A(e,t){for(var r=[],n=0,i=e.length;n=0},a.basicConstraints.cA){var o=s&&s.basicConstraints&&s.pathLenConstraint;if(void 0!==o){if(!(o>0))throw new Error("Path length constraint exceeded");a.basicConstraints.pathLenConstraint=o-1}}}return a.subjectKeyIdentifier=n,s&&s.subjectKeyIdentifier&&(a.authorityKeyIdentifier={keyIdentifier:s.subjectKeyIdentifier,authorityCertIssuer:[t.issuer],authorityCertSerialNumber:t.serialNumber}),d.importKey("pkcs8",e.encode(),e.privateKeyAlgorithm,!1,["sign"])})).then((function(e){return d.sign(r.signatureAlgorithm,e,r.tbsCertificate.encode())})).then((function(e){return r.signatureValue=e,r}))},generate:function(e){var t,r,n=this;return(r=e?h[e]:this.getProvider()||h[R.providerName])&&(e=p(r.publicKey,{privateKey:r.privateKey})),new Promise(v).then((function(){return d.generateKey(e,"true",["sign","verify"])})).then((function(e){return t=e.privateKey,d.exportKey("spki",e.publicKey)})).then((function(e){return n.subjectPublicKeyInfo=new l.SubjectPublicKeyInfo(e),d.exportKey("pkcs8",t)})).then((function(e){return new l.PrivateKeyInfo(e)}))},getPublicKey:function(){var e=this.subjectPublicKeyInfo,t="rsaEncryption"===e.algorithm.id?["verify"]:["verify","deriveKey","deriveBits"];return d.importKey("spki",e.encode(),e.algorithm,"false",t)},getProvider:function(){return T(this.subjectPublicKeyInfo.algorithm)},verify:function(e,t,r){var n=this,i=n.extensions;return new Promise(v).then((function(){if(r=r||y(),n.notBefore.getTime()>r.getTime()||n.notAfter.getTime()<=r.getTime())throw new Error("The certificate has not yet started or expired");for(var t in i)if(i[t].critical&&["authorityKeyIdentifier","subjectKeyIdentifier","keyUsage","certificatePolicies","policyMappings","basicConstraints","nameConstraints","policyConstraints","extKeyUsage"].indexOf(t)<0)throw new Error("The critical extension '"+t+"' is unrecognized");var a=C(n,i,n.notBefore);if(!e&&E(n,a)&&(e=n),e){if(!E(e,a)||!e.checkUsage("keyCertSign",n.notBefore))throw new Error("The issuer's certificate is not valid");return e.verifySignature(n.tbsCertificate.encode(),n.signatureValue,n.signatureAlgorithm)}return!0})).then((function(e){if(!e)throw new Error("The certificate has invalid signature");if(t){if(!B(t,{issuer:n.issuer,date:r}))throw new Error("The issuer's CRL is not valid");if(t.isRevoked(n.serialNumber))throw new Error("The certificate is revoked")}return n}))},verifySignature:function(e,t,r){return this.getPublicKey().then((function(n){return d.verify(r,n,t,e)}))},checkUsage:function(e,t){var r=this,n=r.extensions;return t=t||y(),r.notBefore.getTime()<=t.getTime()&&r.notAfter.getTime()>t.getTime()&&(!n||!(["keyCertSign","cRLSign"].indexOf(e)>0&&n.basicConstraints&&!n.basicConstraints.cA||n.keyUsage&&n.keyUsage.indexOf(e)<0&&n.extKeyUsage&&n.extKeyUsage.indexOf(e)<0))}}),k.prototype.X509=D;var _=function e(t){e.super.call(this,t),this.version||(this.version=1),this.revokedCertificates||(this.revokedCertificates=[]),this.thisUpdate||(this.thisUpdate=y())};function P(e){try{l.CertificationRequest.call(this,e,!0)}catch(t){e=e||{},l.CertificationRequest.call(this,{version:0,subject:e.subject||R.subject,subjectPublicKeyInfo:e.subjectPublicKeyInfo||{algorithm:{id:"noSignature"},subjectPublicKey:new u(0)},attributes:e.attributes||{extensionRequest:{keyUsage:R.userKeyUsage,extKeyUsage:R.userExtKeyUsage}},signatureAlgorithm:{id:"noSignature"},signatureValue:new u(0)})}}function N(e,t){this.certificates=e||[],this.crls=t||[]}function O(e){this.certStore=e}function L(){}function U(e,t,r){this.trustedCACerts=e||[],this.requireCRL=t||!1,this.requireCA=r||!0}g(l.CertificateList,_,{sign:function(e,t){var r=this;return new Promise(v).then((function(){if(!e)throw new Error("The issuer's private key is not defined");if(!t)throw new Error("The issuer's certificate is not defined");if(r.issuer){if(!S(r.issuer,t.issuer))throw new Error("The CRL prototype and authority certificate have different issuers")}else r.issuer=t.issuer;if(!t.checkUsage("cRLSign",r.thisUpdate))throw new Error("The issuer's certificate is not valid for signing a CRL");var n=t.getProvider()||h[R.providerName];r.signature||(r.signature=n.signature),r.signatureAlgorithm=r.signature,r.issuer=t.subject,r.crlExtensions||(r.crlExtensions={});var i=r.crlExtensions,a=t.extensions;return a&&a.subjectKeyIdentifier&&(i.authorityKeyIdentifier={keyIdentifier:a.subjectKeyIdentifier,authorityCertIssuer:[t.issuer],authorityCertSerialNumber:t.serialNumber}),i.cRLNumber=i.cRLNumber||0,d.importKey("pkcs8",e.encode(),e.privateKeyAlgorithm,!1,["sign"])})).then((function(e){return d.sign(r.signatureAlgorithm,e,r.tbsCertList.encode())})).then((function(e){return r.signatureValue=e,r}))},verify:function(e,t){var r=this,n=r.crlExtensions;return new Promise(v).then((function(){if(t=t||y(),!r.thisUpdate.getTime()>t.getTime())throw new Error("The CRL has not yet started");if(e){if(!E(e,C(r,n,r.thisUpdate))||!e.checkUsage("cRLSign",r.thisUpdate))throw new Error("The issuer's certificate is not valid");if(!r.signatureValue||!r.signatureAlgorithm)throw new Error("The has no signature");return e.verifySignature(r.tbsCertList.encode(),r.signatureValue,r.signatureAlgorithm)}})).then((function(e){if(!e)throw new Error("The CRL has invalid signature");return r}))},isRevoked:function(e,t){var r=this.revokedCertificates;t=t||y();for(var n=0;n=r[n].revocationDate.getTime()&&w(r[n].userCertificate,e))return!0;return!1}}),k.prototype.CRL=_,g(l.CertificationRequest,P,{generate:function(e){var t,r,n=this;return(r=e?h[e]:this.getProvider()||h[R.providerName])&&(e=p(r.publicKey,{privateKey:r.privateKey})),new Promise(v).then((function(){return d.generateKey(e,"true",["sign","verify"])})).then((function(e){return t=e.privateKey,d.exportKey("spki",e.publicKey)})).then((function(e){return n.subjectPublicKeyInfo=new l.SubjectPublicKeyInfo(e),d.exportKey("pkcs8",t)})).then((function(e){return t=new l.PrivateKeyInfo(e),n.sign(t)})).then((function(){return t}))},getProvider:function(){return T(this.subjectPublicKeyInfo.algorithm)},sign:function(e){var t=this,r=t.subjectPublicKeyInfo;return new Promise(v).then((function(){if(!r||!r.algorithm||"noSignature"===r.algorithm)throw new Error("Key pair was not generated for the certificate");if(!e)throw new Error("The private key is not defined");var n=T(r.algorithm)||h[R.providerName];return t.signatureAlgorithm=n.signature,d.importKey("pkcs8",e.encode(),e.privateKeyAlgorithm,!1,["sign"])})).then((function(e){return d.sign(t.signatureAlgorithm,e,t.requestInfo.encode())})).then((function(e){return t.signatureValue=e,t}))},verify:function(){var e=this,t=e.subjectPublicKeyInfo;return new Promise(v).then((function(){return d.importKey("spki",t.encode(),t.algorithm,"false",["verify"])})).then((function(t){return d.verify(e.signatureAlgorithm,t,e.signatureValue,e.requestInfo.encode())})).then((function(t){if(!t)throw new Error("The certification request has invalid signature");return e}))}}),k.prototype.Request=P,g(Object,N,{getCertificates:function(e){return A(this.certificates,e)},getCRLs:function(e){return x(this.certificates,e)},load:function(e){for(var t=new l.ContentInfo(e),r=t.certificates,n=t.crls,i=0;i0&&new D(c[0]),h=o.length>0&&new _(o[0]);h&&s.push(h.verify(f,t)),s.push(n.verify(f,h,t)),n=f}if(!a)throw new Error("Root certificate is not found");return Promise.all(s).then((function(e){for(var t=0;t0)return new D(s[0]);if(0!==(s=A(t,e)).length){var o=new D(s[0]),c=!1,u=[];for(i=[];o;){var f=[],h=[];if(i.push(o),!c){if(0===(f=x(r,{issuer:o.issuer,date:n})).length&&a.requireCRL)return;if(e=C(o,o.extensions,o.notBefore),0===(h=A(a.trustedCACerts,e)).length){if(!E(o,e)){if(!((h=A(t,e)).length>0))return;var l=h[0].extensions;if(a.requireCA){if(!l||!l.basicConstraints||!l.basicConstraints.cA)return;if(void 0!==l.basicConstraints.pathLenConstraint&&l.basicConstraints.pathLenConstraint0&&new D(h[0]),p=f.length>0&&new _(f[0]);p&&u.push(p.verify(d,n)),u.push(o.verify(d,p,n)),o=d}if(!c)throw new Error("Trusted root certificate is not found");return Promise.all(u).then((function(e){for(var t=0;t=0){for(var r=[],n=0;n>>8&255),r.push(0),r.push(0)}return new Uint8Array(r).buffer}return e.name.indexOf("PFXKDF")>=0?h.Chars.decode(t+"\0","unicode"):h.Chars.decode(t,"utf8")}function _(){}var P={providerName:"CP-01",autoAddCert:!1,useKeyIdentifier:!1};function N(e,t){if(l.ContentInfo.call(this,e||t||{contentType:"data"}),t&&this.contentType!==(t.contentType||"data"))throw new Error("Invalid content type")}function O(e){N.call(this,e,{contentType:"digestedData",version:0,digestAlgorithm:f[P.providerName].digest,encapContentInfo:{eContentType:"data"},digest:new u(0)})}function L(e){N.call(this,e,{contentType:"signedData",version:1,digestAlgorithms:[],encapContentInfo:{eContentType:"data"},signerInfos:[]})}function U(e){N.call(this,e,{contentType:"encryptedData",version:0,encryptedContentInfo:{contentType:"data",contentEncryptionAlgorithm:f[P.providerName].encryption}})}function K(e){N.call(this,e,{contentType:"envelopedData",version:0,recipientInfos:[],encryptedContentInfo:{contentType:"data",contentEncryptionAlgorithm:f[P.providerName].encryption}})}_.prototype.options=P,m(l.ContentInfo,N,{isDetached:{value:!1,enumerable:!0,writable:!0},writeDetached:function(e){this.isDetached=e},encode:function(e){if(this.isDetached){var t=T(this);x(this,{contentType:t.contentType});var r=l.ContentInfo.method("encode").call(this,e);return x(this,t),r}return l.ContentInfo.method("encode").call(this,e)},encloseContent:function(e){var t=this;return new Promise(b).then((function(){return t.setEnclosed(e),t}))},setEnclosed:function(e){x(this,I(e))},getEnclosed:function(){return F(T(this))}}),_.prototype.DataContentInfo=N,m(N,O,{encloseContent:function(e,t){var r=this;return new Promise(b).then((function(){if(r.setEnclosed(e),t){var n=f[t];r.digestAlgorithm=n&&n.digest||t}return d.digest(r.digestAlgorithm,r.encapContentInfo.eContent)})).then((function(e){r.digest=e}))},verify:function(e){var t=this;return new Promise(b).then((function(){if(e&&t.setEnclosed(e),!t.encapContentInfo||!t.encapContentInfo.eContent)throw new Error("Detached content is not found");return d.digest(t.digestAlgorithm,t.encapContentInfo.eContent)})).then((function(e){if(!w(e,t.digest))throw Error("Message digest is not verified");return F({contentType:t.encapContentInfo.eContentType,content:t.encapContentInfo.eContent})}))}}),_.prototype.DigestedDataContentInfo=O,m(N,L,{addSignature:function(e,t,r,i){var a,s,o,c=this;return new Promise(b).then((function(){if(!e||!t)throw new Error("Signer key or certificate is not defined");t instanceof Array?t=(o=t)[0]:o=[t];var u=t.getProvider()||f[P.providerName],h=P.useKeyIdentifier&&t.extensions&&t.extensions.subjectKeyIdentifier;if(s=c.encapContentInfo.eContent,a={version:h?2:0,sid:h?t.extensions.subjectKeyIdentifier:{issuer:t.issuer,serialNumber:t.serialNumber},digestAlgorithm:u.digest,signatureAlgorithm:t.subjectPublicKeyInfo.algorithm},i&&(a.unsignedAttrs=i),r)return"object"!==(void 0===r?"undefined":n(r))&&(r={}),d.digest(a.digestAlgorithm,s)})).then((function(t){return t&&(r.contentType=c.encapContentInfo.eContentType,r.messageDigest=t,r.signingTime=new Date,a.signedAttrs=r,s=l.SignedAttributes.encode(a.signedAttrs)),d.importKey("pkcs8",l.PrivateKeyInfo.encode(e),e.privateKeyAlgorithm,!1,["sign"])})).then((function(e){var t=g(a.signatureAlgorithm,{hash:a.digestAlgorithm});return d.sign(t,e,s)})).then((function(e){if(a.signatureValue=e,B(c.digestAlgorithms,a.digestAlgorithm,(function(e,t){return e.id===t.id})),P.autoAddCert){c.certificates||(c.certificates=[]);for(var t=0,r=o.length;t0)}},verify:function(e,t){var r,n=this;return new Promise(b).then((function(){if(t&&n.setEnclosed(t),!n.signerInfos||0===n.signerInfos.length)throw new Error("No signatures found");return Promise.all(n.signerInfos.map((function(t,r){var i,a=t.sid,s=a instanceof u?{subjectKeyIdentifier:a}:{issuer:a.issuer,serialNumber:a.serialNumber};return t.signedAttrs&&t.signedAttrs.signingTime&&(i=t.signedAttrs.signingTime),e.getValidCertificate(s,n.certificates,n.crls,i).catch((function(){}))})))})).then((function(e){var t=[];if(e.forEach((function(e){e&&t.push(n.verifySignature(e).then((function(e){r=e}),(function(){})))})),0===t.length)throw new Error("Valid verification path not found");return Promise.all(t)})).then((function(){if(!r)throw Error("Verification path found but no valid signature");return r}))},verifySignature:function(e,t){var r,n,i,a=this;return new Promise(b).then((function(){if(t&&a.setEnclosed(t),!(n=a.encapContentInfo&&a.encapContentInfo.eContent))throw new Error("Detached content is not found");for(var s=0;s=0)return i.diversifier=2,d.deriveBits(i,a,64)})).then((function(e){return e&&(n.iv=e),i.diversifier=1,d.deriveKey(i,a,n,!1,["encrypt"])})).then((function(e){return e}));if(n=g(r),t instanceof u)return d.importKey("raw",t,n,!1,["encrypt"]);if("secret"===t.type)return t;throw new Error("Content encryption key must be raw data or secret key type")})).then((function(t){return n.iv||(n.iv=R(8)),d.encrypt(n,t,e.content)})).then((function(t){return r.derivation?(delete i.diversifier,r=g(r,{derivation:i,encryption:n})):r=n,a.encryptedContentInfo={contentType:e.contentType,contentEncryptionAlgorithm:r,encryptedContent:t},a}))},getEnclosed:function(e,t){var r,n,i,a=this;return new Promise(b).then((function(){if(t&&a.setEnclosed(t),!(i=a.encryptedContentInfo.encryptedContent))throw new Error("Encrypted content must be specified");var s;if((r=g(a.encryptedContentInfo.contentEncryptionAlgorithm)).derivation)return n=g(r.derivation),r=g(r.encryption),d.importKey("raw",D(n,e),n,!1,["deriveKey","deriveBits"]).then((function(e){if(s=e,n.name.indexOf("PFXKDF")>=0)return n.diversifier=2,d.deriveBits(n,s,64)})).then((function(e){return e&&(r.iv=e),n.diversifier=1,d.deriveKey(n,s,r,!1,["decrypt"])}));if(e instanceof u)return d.importKey("raw",e,r,!1,["decrypt"]);if("secret"===e.type)return e;throw new Error("Decryption key must be raw data or secret key type")})).then((function(e){return d.decrypt(r,e,i)})).then((function(e){return F({contentType:a.encryptedContentInfo.contentType,content:e})}))}}),_.prototype.EncryptedDataContentInfo=U,m(N,K,{encloseContent:function(e,t){var r=this;return new Promise(b).then((function(){if(!(e=I(e)).content)throw new Error("Content for encryption must be specified");if(t){var r=f[t];t=r&&r.encryption||t}else t=f[P.providerName].encryption;return d.generateKey(t,!0,["encrypt"])})).then((function(n){return r.contentEncryptionKey=n,t.iv||(t.iv=R(8)),d.encrypt(t,n,e.content)})).then((function(n){return r.encryptedContentInfo={contentType:e.contentType,contentEncryptionAlgorithm:t,encryptedContent:n},r}))},addRecipient:function(e,t,r,n){var i,a,s,o,c=this;return new Promise(b).then((function(){if(e=new p.X509(e),t&&"string"!=typeof t&&!t.algorithm&&(n=r,r=t,t=void 0),a=t?f[t]:e.getProvider(),!c.contentEncryptionKey)throw new Error("The content encryption key is not assigned");if(n){var i;if(n instanceof Array?n=(i=n)[0]:i=[n],P.autoAddCert){c.originatorInfo?c.originatorInfo.certs||(c.originatorInfo.certs=[]):c.originatorInfo={certs:[]};for(var s=0,o=i.length;s>>24,n[2]=r>>>16&255,n[1]=r>>>8&255,n[0]=255&r,n}function F(e){switch(e.id){case"pbeWithSHAAnd40BitRC2-CBC":case"pbeWithSHAAnd128BitRC2-CBC":return 8;case"pbeUnknownGost":return 16;case"sha1":return 20;default:return 32}}function k(e,t){if(!t)return new f(0);if(e.name.indexOf("CPKDF")>=0){for(var r=[],n=0;n>>8&255),r.push(0),r.push(0)}return new Uint8Array(r).buffer}return e.name.indexOf("PFXKDF")>=0?h.Chars.decode(t+"\0","unicode"):h.Chars.decode(t,"utf8")}function R(){}var D={providerName:"CP-01",days:7305};function _(e){d.PrivateKeyInfo.call(this,e)}function P(e){d.EncryptedPrivateKeyInfo.call(this,e)}function N(e){if(e){var t=this;["mk.db3","masks.db3","kek.opq","rand.opq"].forEach((function(r){t[r]=e[r]}))}}function O(e,t){d.GostWrappedPrivateKey.call(this,e),N.call(this,t)}function L(e){e&&(this.header=d.GostKeyContainer.decode(e.header),this.name=d.GostKeyContainerName.decode(e.name),this.primary=d.GostPrivateKeys.decode(e.primary),this.masks=d.GostPrivateMasks.decode(e.masks),e.primary2&&e.masks2&&(this.primary2=d.GostPrivateKeys.decode(e.primary2),this.masks2=d.GostPrivateMasks.decode(e.masks2)))}function U(e){d.ViPNetInfo.call(this,e||{version:3,keyInfo:{keyClass:1,keyType:43556,flags:1},defenceKeyInfo:{keyClass:1024,keyType:24622,keyUID:S(32),flags:-2147483648}})}function K(e){e&&(e instanceof f||e.buffer instanceof f||"string"==typeof e)?this.decode(e):(e=e||{},this.fileType=e.fileType||"ITCS",this.fileVersion=e.fileVersion||16,e.applicationHeader&&(this.applicationHeader=e.applicationHeader),this.entries=e.entries||[])}function M(e){d.PFX.call(this,e||{version:3,authSafe:{contentType:"data"}})}function H(e){if(this.entries={},e)for(var t in e)this.setEntry(t,e[t])}R.prototype.options=D,w(d.PrivateKeyInfo,_,{getPrivateKey:function(){var e="rsaEncryption"===this.privateKeyAlgorithm.id?["sign"]:["sign","deriveKey","deriveBits"];return p.importKey("pkcs8",this.encode(),this.privateKeyAlgorithm,"true",e)},setPrivateKey:function(e){var t=this;return p.exportKey("pkcs8",e).then((function(e){return d.PrivateKeyInfo.call(t,e),t}))},generate:function(e,t){var r=this;return new Promise(E).then((function(){return e instanceof g.Request||(e=new g.Request(e)),e.generate(t)})).then((function(t){return d.PrivateKeyInfo.call(r,t),e}))}}),R.prototype.PKCS8=_,w(d.EncryptedPrivateKeyInfo,P,{getKey:function(e){var t=this;return new Promise(E).then((function(){return new y.EncryptedDataContentInfo({contentType:"encryptedData",version:0,encryptedContentInfo:{contentType:"data",contentEncryptionAlgorithm:t.encryptionAlgorithm,encryptedContent:t.encryptedData}}).getEnclosed(e)})).then((function(e){return _.decode(e.content)}))},getPrivateKey:function(e){return this.getKey(e).then((function(e){return e.getPrivateKey()}))},setKey:function(e,t,r){var n,i=this;return new Promise(E).then((function(){return e=new _(e),(n=new y.EncryptedDataContentInfo).encloseContent(e.encode(),t,r||D.providerName)})).then((function(){return i.encryptionAlgorithm=n.encryptedContentInfo.contentEncryptionAlgorithm,i.encryptedData=n.encryptedContentInfo.encryptedContent,i}))},setPrivateKey:function(e,t,r){var n=this;return(new _).setPrivateKey(e).then((function(e){return n.setKey(e,t,r)}))},generate:function(e,t,r,n){var i=this;return new Promise(E).then((function(){return e instanceof g.Request||(e=new g.Request(e)),e.generate(r)})).then((function(e){return i.setKey(e,t,n)})).then((function(){return e}))}}),R.prototype.PKCS8Encrypted=P,w(Object,N,{getEncryptionKey:function(e){var t=this,r=l["SC-01"].wrapping,n=l["SC-01"].encryption,i=l["SC-01"].derivation,a=t["masks.db3"],s=t["mk.db3"],o=t["kek.opq"];return new Promise(E).then((function(){if(!a||!s||!o)throw new Error("Not enougth key container files");if(a.byteLength>32){if(e)return p.importKey("raw",h.Chars.decode(e,"utf8"),i,!1,["deriveKey","deriveBits"]).then((function(e){return p.deriveKey(v(i,{salt:new Uint8Array([0,0,0,0,0,0,0,0])}),e,n,!1,["decrypt"])})).then((function(e){return new y.EncryptedDataContentInfo(a).getEnclosed(e)})).then((function(e){return e.verify()})).then((function(e){return e.content}));throw new Error("Key password is required")}if(e)throw new Error("Key password is not required");return a})).then((function(e){a=e;var t=new Uint8Array(s.byteLength+a.byteLength);return t.set(new Uint8Array(s),0),t.set(new Uint8Array(a),s.byteLength),p.importKey("raw",t.buffer,r,!1,["unwrapKey"])})).then((function(e){return p.unwrapKey("raw",o,e,r,n,!1,["wrapKey","unwrapKey"])}))},generateContainer:function(e){var t,r,n=this,i=l["SC-01"].wrapping,a=l["SC-01"].encryption,s=l["SC-01"].derivation,o=l["SC-01"].digest;return new Promise(E).then((function(){return p.generateKey(i,!0,["wrapKey"])})).then((function(t){var i=(r=t).buffer.byteLength;n["mk.db3"]=new Uint8Array(new Uint8Array(r.buffer,0,i-32)).buffer;var c=new Uint8Array(new Uint8Array(r.buffer,i-32,32)).buffer;if(e){var u=new y.EncryptedDataContentInfo,f=new y.DigestedDataContentInfo;return f.encloseContent(c,o).then((function(){return f={contentType:"digestedData",content:f.encode()},p.importKey("raw",h.Chars.decode(e,"utf8"),s,!1,["deriveKey","deriveBits"])})).then((function(e){return p.deriveKey(v(s,{salt:new Uint8Array([0,0,0,0,0,0,0,0])}),e,a,!1,["encrypt"])})).then((function(e){return u.encloseContent(f,e,a)})).then((function(){return u.encode()}))}return c})).then((function(e){return n["masks.db3"]=e,p.generateKey(a,!1,["wrapKey","unwrapKey"])})).then((function(e){return t=e,p.wrapKey("raw",e,r,i)})).then((function(e){return n["kek.opq"]=e,p.generateKey(a,!1,["wrapKey","unwrapKey"])})).then((function(e){return p.wrapKey("raw",e,r,i)})).then((function(e){return n["rand.opq"]=e,t}))}}),R.prototype.SignalComKeyContainer=N,w(d.GostWrappedPrivateKey,O,{getKey:function(e){return this.getPrivateKey(e).then((function(e){return(new _).setPrivateKey(e)}))},getPrivateKey:function(e){var t,r=this,n=l["SC-01"].wrapping;return new Promise(E).then((function(){return r.getEncryptionKey(e,!0)})).then((function(e){return p.unwrapKey("raw",r.privateKeyWrapped,e,n,r.privateKeyAlgorithm,!0,["sign","deriveKey","deriveBits"])})).then((function(e){return(t=r.attributes&&r.attributes["id-sc-gostR3410-2001-publicKey"])?p.generateKey(v(e.algorithm,{ukm:e.buffer}),e.extractable,e.usages):{privateKey:e}})).then((function(e){if(t&&!x(e.publicKey.buffer,t))throw new Error("Check public key failed");return e.privateKey}))},setKey:function(e,t){var r=this;return new _(e).getPrivateKey().then((function(e){return r.setPrivateKey(e,t)}))},setPrivateKey:function(e,t){var r,n=this,i=l["SC-01"].wrapping;return new Promise(E).then((function(){return n.getEncryptionKey(t).catch((function(){return n.generateContainer(t)}))})).then((function(t){return p.wrapKey("raw",e,t,i)})).then((function(t){return r=t,p.generateKey(v(e.algorithm,{ukm:e.buffer}),!0,["sign","verify"])})).then((function(t){return n.object={version:0,privateKeyAlgorithm:e.algorithm,privateKeyWrapped:r,attributes:{"id-sc-gostR3410-2001-publicKey":t.publicKey.buffer}},n}))},changePassword:function(e,t){var r=this;return r.getPrivateKey(e).then((function(e){return r.setPrivateKey(e,t)}))},generate:function(e,t,r){var n,i=this;return new Promise(E).then((function(){return e instanceof g.Request||(e=new g.Request(e)),e.generate(r)})).then((function(e){return n=e,i.setKey(n,t)})).then((function(){return e}))}}),b(O.prototype,N.prototype),R.prototype.SignalComPrivateKeyInfo=O,w(Object,L,function(){function e(e,t,r){var n=function(e){return!(e.name.indexOf("-94")>=0||e.name.indexOf("-2001")>=0||1994===e.version||2001===e.version)}(e)?"GOST R 34.11-256":"GOST R 34.11-94/"+(e.sBox||"D-A"),i={name:"CPKDF",hash:n,salt:r,iterations:t?2e3:2};return p.importKey("raw",k(i,t),i,!1,["deriveKey","deriveBits"]).then((function(e){return p.deriveKey(i,e,"GOST 28147",!1,["sign","verify","encrypt","decrypt"])}))}function t(t,r,n){var i=v({name:"GOST 28147-MAC"},t.encParams);return e(t,r,n).then((function(e){return p.sign(i,e,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]))}))}function r(e,t){var r=v({name:"GOST 28147-MAC"},e.encParams),n=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);return p.importKey("raw",n,r,!1,["sign"]).then((function(e){return p.sign(r,e,t.encode())}))}function n(e,t,r){var n=v({name:"GOST 28147-MAC"},e.encParams),i=64===t.byteLength?new Uint8Array(new Uint8Array(t,32,32)).buffer:t;return p.importKey("raw",i,n,!1,["sign"]).then((function(e){return p.sign(n,e,r)}))}function i(e){return p.generateKey(v(e.algorithm,{ukm:e.buffer}),!0,["sign","verify"]).then((function(e){return new Uint8Array(new Uint8Array(e.publicKey.buffer,0,8)).buffer}))}function a(e,t,r,n,a){var s,o,c={name:"GOST 28147-ECB",sBox:e.encParams&&e.encParams.sBox},u=v(e,{mode:"MASK"});return u.name=u.name.replace("-DH",""),p.decrypt(c,t,r).then((function(e){return o=e,p.importKey("raw",n,u,"false",["sign","unwrapKey"])})).then((function(t){return p.unwrapKey("raw",o,t,u,e,"true",["sign"])})).then((function(e){return i(s=e)})).then((function(e){if(!x(e,a))throw new Error("Incorrect fp");return s}))}function s(t,r,i,s,o){var c=t.primaryPrivateKeyParameters.privateKeyAlgorithm;return new Promise(E).then((function(){if(r.hmacKey)throw new Error("Old key format");if(i.randomStatus.byteLength<12)throw new Error("Invalid random status length");return n(c,i.mask,i.randomStatus)})).then((function(t){if(!x(t,i.hmacRandom))throw new Error("Imita for mask is invalid");return e(c,s,new Uint8Array(i.randomStatus,0,12))})).then((function(e){return o&&r.secondaryKey?a(t.secondaryPrivateKeyParameters.privateKeyAlgorithm,e,r.secondaryKey,i.mask,t.secondaryFP):a(c,e,r.primaryKey,i.mask,t.primaryFP)}))}return{getKey:function(e,t){return this.getPrivateKey(e,t).then((function(e){return(new _).setPrivateKey(e)}))},getPrivateKey:function(e,t){var r=this,n=r.header.keyContainerContent;return s(n,r.primary,r.masks,e,t).catch((function(i){if(r.primary2&&r.masks2)return s(n,r.primary2,r.masks2,e,t);throw i}))},getCertificate:function(e){var t=this.header.keyContainerContent;return new Promise(E).then((function(){return e?new g.X509(t.secondaryCertificate):new g.X509(t.primaryCertificate)}))},getContainerName:function(){return this.name.containerName},setKey:function(e,t,r,n){var i=this;return new _(e).getPrivateKey().then((function(e){return i.setPrivateKey(e,t,r,n)}))},setPrivateKey:function(a,s,o,c){var u,f,h=this;return new Promise(E).then((function(){h.header=h.header||new d.GostKeyContainer({keyContainerContent:{containerAlgoritmIdentifier:{algorithm:"id-CryptoPro-GostPrivateKeys-V2-Full"},attributes:["kccaReservePrimary","kccaPrimaryKeyAbsent"],extensions:{keyValidity:{notAfter:A(c||D.days)}}}}),u=h.header.keyContainerContent;var e=o?u.secondaryPrivateKeyParameters:u.primaryPrivateKeyParameters;if(e)f=e.privateKeyAlgorithm;else if(e={attributes:["pkaExportable","pkaExchange","pkaDhAllowed"],privateKeyAlgorithm:f=v(a.algorithm,{sBox:"D-A",encParams:{block:"CFB",sBox:"E-A",keyMeshing:"CP"}})},o){if(!u.primaryPrivateKeyParameters)throw new Error("Primary key must be defined first");u.secondaryPrivateKeyParameters=e}else{u.primaryPrivateKeyParameters=e;var t=u.attributes.indexOf("kccaPrimaryKeyAbsent");t>=0&&u.attributes.splice(t,1)}var r=[];return[0,1].forEach((function(e){var t="masks"+(e>0?"2":"");h[t]||r.push(function(e){var t,r=v(e,{mode:"MASK"}),i=S(12);return r.name=r.name.replace("-DH",""),p.generateKey(r,!0,["wrapKey","unwrapKey"]).then((function(e){return p.exportKey("raw",e)})).then((function(r){return n(e,t=r,i)})).then((function(e){return new d.GostPrivateMasks({mask:t,randomStatus:i,hmacRandom:e})}))}(f).then((function(e){h[t]=e})))})),Promise.all(r)})).then((function(){var t=[];return[0,1].forEach((function(r){var n="primary"+(r>0?"2":""),i="masks"+(r>0?"2":"");t.push(function(t,r,n,i,a,s){return e(t,i,new Uint8Array(n.randomStatus,0,12)).then((function(e){return function(e,t,r,n){var i={name:"GOST 28147-ECB",sBox:e.encParams&&e.encParams.sBox},a=v(e,{mode:"MASK"});return a.name=a.name.replace("-DH",""),p.importKey("raw",n,a,!1,["sign","wrapKey"]).then((function(e){return p.wrapKey("raw",r,e,a)})).then((function(e){return p.encrypt(i,t,e)}))}(t,e,s,n.mask)})).then((function(e){return r||(r=new d.GostPrivateKeys),a?r.secondaryKey=e:r.primaryKey=e,r}))}(f,h[n],h[i],s,o,a).then((function(e){h[n]=e})))})),Promise.all(t)})).then((function(){return i(a).then((function(e){o?u.secondaryFP=e:u.primaryFP=e}))})).then((function(){var e=u.attributes.indexOf("kccaSoftPassword");if(s)return e<0&&u.attributes.push("kccaSoftPassword"),t(f,s,u.primaryFP);e>=0&&u.attributes.splice(e,1)})).then((function(e){return e&&(u.hmacPassword=e),r(f,u)})).then((function(e){return h.header.hmacKeyContainerContent=e,h}))},setCertificate:function(e,t,n){var i,a,s=this;return new Promise(E).then((function(){return s.header=s.header||new d.GostKeyContainer({keyContainerContent:{containerAlgoritmIdentifier:{algorithm:"id-CryptoPro-GostPrivateKeys-V2-Full"},attributes:["kccaReservePrimary","kccaPrimaryKeyAbsent"],extensions:{keyValidity:{notAfter:A(n||D.days)}}}}),i=s.header.keyContainerContent,e=new g.X509(e),a=i.primaryPrivateKeyParameters&&i.primaryPrivateKeyParameters.privateKeyAlgorithm||v(e.subjectPublicKeyInfo.algorithm,{sBox:"D-A",encParams:{block:"CFB",sBox:"E-A",keyMeshing:"CP"}}),e.getPublicKey()})).then((function(n){if(t){if(i.secondaryFP&&!x(i.secondaryFP,new Uint8Array(n.buffer,0,i.secondaryFP.byteLength)))throw new Error("The public key of the certificate does not match the private key");i.secondaryCertificate=e}else{if(i.primaryFP&&!x(i.primaryFP,new Uint8Array(n.buffer,0,i.primaryFP.byteLength)))throw new Error("The public key of the certificate does not match the private key");i.primaryCertificate=e}return r(a,i)})).then((function(e){return s.header.hmacKeyContainerContent=e,s}))},setContainerName:function(e){this.name=new d.GostKeyContainerName({containerName:e})},verify:function(e){var n,i,a=this;return new Promise(E).then((function(){return n=a.header.keyContainerContent,r(i=n.primaryPrivateKeyParameters.privateKeyAlgorithm,n)})).then((function(r){if(!x(r,a.header.hmacKeyContainerContent))throw new Error("Container is not valid.");var s=n.attributes.indexOf("kccaSoftPassword")>=0;if(!e&&s)throw new Error("Password is required");if(e&&!s)throw new Error("Password is not reqiured.");return e?t(i,e,n.primaryFP).then((function(e){if(!x(e,n.hmacPassword))throw new Error("Password is not valid.");return a})):a}))},changePassword:function(e,t){var r,n=this;return new Promise(E).then((function(){if(!(r=n.header.keyContainerContent).primaryPrivateKeyParameters)throw new Error("Private key not yet defined");return n.getPrivateKey(e).then((function(e){return n.setPrivateKey(e,t)}))})).then((function(){return r.secondaryPrivateKeyParameters?n.getPrivateKey(e,!0).then((function(e){return n.setPrivateKey(e,t,!0)})):n}))},generate:function(e,t,r){var n,i,a=this;return new Promise(E).then((function(){return e instanceof g.Request||(e=new g.Request(e)),e.generate(r)})).then((function(e){return i=e,a.setKey(i,t)})).then((function(){return(n=new g.X509(e)).sign(i)})).then((function(){return a.setCertificate(n)})).then((function(){return e}))},encode:function(e){return{header:this.header.encode(e),name:this.name.encode(e),masks:this.masks.encode(e),primary:this.primary.encode(e),masks2:this.masks2.encode(e),primary2:this.primary2.encode(e)}}}}()),R.prototype.CryptoProKeyContainer=L,w(d.ViPNetInfo,U,function(){function e(e){void 0===e&&(e="");var t,r=h.Chars.decode(e,"win1251");return p.digest("GOST R 34.11-94",r).then((function(e){t=e;var n=new Uint8Array(r.byteLength+t.byteLength);return n.set(new Uint8Array(r),0),n.set(new Uint8Array(t),r.byteLength),p.digest("GOST R 34.11-94",n)})).then((function(e){return p.importKey("raw",e,"GOST 28147",!1,["unwrapKey"])})).then((function(e){return p.unwrapKey("raw",t,e,"GOST 28147-MASK/VN","GOST 28147-89","false",["encrypt","decrypt","sign","verify"])}))}return{getPrivateKey:function(t){var r,n,i=this;return new Promise(E).then((function(){return t&&"string"!=typeof t?t:e(t)})).then((function(e){t=e,r=i.keyPart,n=new Uint8Array(r,0,r.byteLength-4-8);var a=new Uint8Array(r,n.byteLength,4),s=i.keyInfo.encode(),o=new Uint8Array(n.byteLength+s.byteLength);return o.set(new Uint8Array(n),0),o.set(new Uint8Array(s),n.byteLength),p.verify({name:"GOST 28147-89-MAC"},t,a,o)})).then((function(e){if(!e)throw new Error("Invalid key password");var i=new Uint8Array(r,r.byteLength-8,8);return p.decrypt({name:"GOST 28147-89-CFB",iv:i},t,n)})).then((function(e){var t=e.byteLength/2;if(!1&i.keyInfo.keyClass)return p.importKey("raw",new Int32Array(e,t,t),"GOST 28147",!1,["unwrapKey"]).then((function(r){return p.unwrapKey("raw",new Int32Array(e,0,t),r,"GOST 28147-MASK/VN","GOST 28147-89","false",["encrypt","decrypt","sign","verify"])}));var r=i.keyInfo.algorithm||i.certificate&&i.certificate.subjectPublicKeyInfo.algorithm;if(!r)throw new Error("Algorithm is not specified");var n=v(r,{mode:"MASK",procreator:"VN"});n.name=n.name.replace("-DH","");var a=new Uint8Array(e,0,t),s=new Uint8Array(e,t,t);return p.importKey("raw",s,n,"false",["sign","unwrapKey"]).then((function(e){return p.unwrapKey("raw",a,e,n,r,"true",["sign","deriveBits","deriveKey"])})).then((function(e){return i.publicKey?p.generateKey(v(e.algorithm,{ukm:e.buffer}),e.extractable,e.usages):{privateKey:e}})).then((function(e){if(i.publicKey&&!x(e.publicKey.buffer,i.publicKey))throw new Error("Check public key failed");return e.privateKey}))}))},setPrivateKey:function(t,r,n){var i,a,s,o,c=this;return new Promise(E).then((function(){return r&&"string"!=typeof r?r:e(r)})).then((function(e){r=e;var a=t.algorithm;if(c.keyInfo.algorithm=a,c.keyInfo.serialNumber=S(16),c.keyInfo.keyUID=S(8),c.keyInfo.validity={notBefore:B(),notAfter:B(n||D.days)},"private"===t.type)return(i=v(a,{mode:"MASK",procreator:"VN"})).name=i.name.replace("-DH",""),c.keyInfo.keyClass=1,c.keyInfo.keyType=43556,p.generateKey(v(a,{ukm:t.buffer}),!0,["sign","verify"]).then((function(e){if(c.publicKey=e.publicKey.buffer,c.certificate){var t=c.certificate.subjectPublicKeyInfo;return p.importKey("spki",t.encode(),t.algorithm,!0,["verify"])}})).then((function(e){e&&!x(e.buffer,c.publicKey)&&delete c.certificate}));if("secret"!==t.type)throw new Error("Invalid key type");i="GOST 28147/MASK/VN",delete c.certificate,delete c.publicKey,c.keyInfo.keyClass=64,c.keyInfo.keyType=24622})).then((function(){return p.generateKey(i,!0,["wrapKey","unwrapKey"])})).then((function(e){return a=e,p.wrapKey("raw",t,a,i)})).then((function(e){return(s=new Uint8Array(2*e.byteLength)).set(new Uint8Array(e)),p.exportKey("raw",a)})).then((function(e){s.set(new Uint8Array(e),e.byteLength),o=new Uint8Array(s.byteLength+12);var t={name:"GOST 28147-CFB",iv:S(8)};return o.set(new Uint8Array(t.iv),o.byteLength-8),p.encrypt(t,r,s)})).then((function(e){o.set(new Uint8Array(e));var t=c.keyInfo.encode(),n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),p.sign({name:"GOST 28147-89-MAC"},r,n)})).then((function(e){return o.set(new Uint8Array(e),o.byteLength-12),c.keyPart=o.buffer,c}))},encode:function(e){var t=d.ViPNetInfo.method("encode").call(this),r=new Uint8Array(8+t.byteLength+this.keyPart.byteLength);return I(r.buffer,0,4+t.byteLength+this.keyPart.byteLength),r.set(new Uint8Array(t),4),I(r.buffer,4+t.byteLength,this.keyPart.byteLength),r.set(new Uint8Array(this.keyPart),8+t.byteLength),"PEM"===e?h.Base64.encode(r.buffer):r.buffer}}}(),{decode:function(e){"string"==typeof e&&(e=h.Base64.decode(e));var t=T(e=C(e),0);if(e.byteLength!==t+4)throw new Error("Invalid container entry size");var r=h.BER.decode(new Uint8Array(e,4,t)),n=d.ViPNetInfo.decode.call(this,r),i=r.header.byteLength+r.content.byteLength,a=T(e,4+i);if(e.byteLength!==i+a+8)throw new Error("Invalid container key part size");return n.keyPart=new Uint8Array(new Uint8Array(e,i+8,a)).buffer,n}}),R.prototype.ViPNetContainerEntry=U,w(Object,K,{getCertificate:function(e){var t=this;return new Promise(E).then((function(){var r=t.entries[e||0];if(!r)throw new Error("Entry not defined");if(r.certificate)return new g.X509(r.certificate)}))},getKey:function(e,t){return this.getPrivateKey(e,t).then((function(e){return(new _).setPrivateKey(e)}))},getPrivateKey:function(e,t){var r=this;return new Promise(E).then((function(){var n=r.entries[t||0];if(!n)throw new Error("Entry not defined");return n.getPrivateKey(e)}))},setCertificate:function(e,t){var r,n=this;return new Promise(E).then((function(){if(r=n.entries[t||0]||(n.entries[t||0]=new U),e=new g.X509(e),r.publicKey)return e.getPublicKey()})).then((function(t){if(t&&!x(r.publicKey,t.buffer))throw new Error("Invalid certificate for private key");return r.certificate=e,n}))},setKey:function(e,t,r,n){var i=this;return new _(e).getPrivateKey().then((function(e){return i.setPrivateKey(e,t,r,n)}))},setPrivateKey:function(e,t,r,n){var i=this;return new Promise(E).then((function(){return(i.entries[r||0]||(i.entries[r||0]=new U)).setPrivateKey(e,t,n)})).then((function(){return i}))},changePassword:function(e,t){var r=this;return new Promise(E).then((function(){return r.getPrivateKey(e).then((function(e){return r.setPrivateKey(e,t)}))}))},generate:function(e,t,r){var n,i,a=this;return new Promise(E).then((function(){return e instanceof g.Request||(e=new g.Request(e)),e.generate(r)})).then((function(e){return i=e,a.setKey(i,t)})).then((function(){return(n=new g.X509(e)).sign(i)})).then((function(){return a.setCertificate(n)})).then((function(){return e}))},encode:function(e){var t=[],r=0;this.entries.forEach((function(e){var n=e.encode();r+=n.byteLength,t.push(n)}));var n=this.applicationHeader?this.applicationHeader.byteLength:0,i=new Uint8Array(12+n+r);i.set(new Uint8Array(h.Chars.decode(this.fileType,"ascii"))),I(i.buffer,4,this.fileVersion),I(i.buffer,8,n),n>0&&i.set(new Uint8Array(this.applicationHeader),12);var a=12+n;return t.forEach((function(e){i.set(new Uint8Array(e),a),a+=e.byteLength})),"PEM"===e?h.Base64.encode(i.buffer):i.buffer},decode:function(e){e=this.constructor.decode(e),this.fileType=e.fileType,this.fileVersion=e.fileVersion,e.applicationHeader&&(this.applicationHeader=e.applicationHeader),this.entries=e.entries}},{encode:function(e,t){return new this(e).encode(t)},decode:function(e){"string"==typeof e&&(e=h.Base64.decode(e)),e=C(e);var t=h.Chars.encode(new Uint8Array(e,0,4),"ascii");if("ITCS"!==t&&"PKEY"!==t&&"_CCK"!==t&&"_LCK"!==t)throw new Error("Unsupported ViPNet container type");var r=T(e,4),n=r>>>16;if(0!==n&&1!==n||(65535&r)>255)throw new Error("Unsupported ViPNet container version");var i,a=T(e,8);a>0&&(i=C(new Uint8Array(e,12,a)));for(var s=12+a,o=[];s0)return Promise.all(i)})).then((function(t){if(t){var n=d.SafeContents.encode(t);s.push(new y.DataContentInfo({contentType:"data",content:n}))}if(a.length>0)return a=d.SafeContents.encode(a),r&&e?(new y.EncryptedDataContentInfo).encloseContent(a,e,r):(new y.DataContentInfo).encloseContent(a)})).then((function(r){s.push(r),s=new d.AuthenticatedSafe(s);var n=new M;return n.authSafe={contentType:"data",content:s.encode()},n.sign(e,t)}))}}),R.prototype.KeyStore=H,t.gostKeysInstance=new R},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.expand=function(){for(var e={},t=0,r=arguments.length;t{e.exports=r(42531)},67526:(e,t)=>{"use strict";t.byteLength=function(e){var t=o(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=o(e),s=a[0],c=a[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,c)),f=0,h=c>0?s-4:s;for(r=0;r>16&255,u[f++]=t>>8&255,u[f++]=255&t;return 2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[f++]=255&t),1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],s=16383,o=0,u=n-i;ou?u:o+s));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=a[s],n[a.charCodeAt(s)]=s;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,a,s=[],o=t;o>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},48287:(e,t,r)=>{"use strict";const n=r(67526),i=r(251),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.INSPECT_MAX_BYTES=50;const s=2147483647;function o(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|g(e,t);let n=o(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Y(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|p(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?o(0):l(e):"Buffer"===e.type&&Array.isArray(e.data)?l(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return f(e),o(e<0?0:0|p(e))}function l(e){const t=e.length<0?0:0|p(e.length),r=o(t);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return F(this,t,r);case"base64":return B(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let a,s=1,o=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,o/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(a=r;ao&&(r=o-c),a=r;a>=0;a--){let r=!0;for(let n=0;ni&&(n=i):n=i;const a=t.length;let s;for(n>a/2&&(n=a/2),s=0;s>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function B(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,o,c;switch(s){case 1:t<128&&(a=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(a=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:r=e[i+1],n=e[i+2],o=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&o)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&o,c>65535&&c<1114112&&(a=c))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(Y(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const o=Math.min(a,s),u=this.slice(n,i),f=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;in)&&(r=n);let i="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function _(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function P(e,t,r,n,i){j(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function N(e,t,r,n,i){j(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function O(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,a){return t=+t,r>>>=0,a||O(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,a){return t=+t,r>>>=0,a||O(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],i=1,a=0;for(;++a>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Z((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],i=1,a=0;for(;++a=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=t,i=1,a=this[e+--n];for(;n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Z((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||D(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||_(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||_(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=Z((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Z((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);_(this,e,t,r,n-1,-n)}let i=0,a=1,s=0;for(this[t]=255&e;++i>>=0,!n){const n=Math.pow(2,8*r-1);_(this,e,t,r,n-1,-n)}let i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a|0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=Z((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Z((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=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),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function j(e,t,r,n,i,a){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new K.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){V(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||G(t,e.length-(r+1))}(n,i,a)}function V(e,t){if("number"!=typeof e)throw new K.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,r){if(Math.floor(e)!==e)throw V(e,r),new K.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new K.ERR_BUFFER_OUT_OF_BOUNDS;throw new K.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}M("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),M("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),M("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=H(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=H(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function z(e,t){let r;t=t||1/0;const n=e.length;let i=null;const a=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function W(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Q=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Z(e){return"undefined"==typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},40955:function(e,t,r){var n;e.exports=(n=r(19021),r(80754),r(84636),r(39506),r(57165),function(){var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],a=[],s=[],o=[],c=[],u=[],f=[],h=[],l=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,a[p]=r;var g=e[r],y=e[g],v=e[y],m=257*e[p]^16843008*p;s[r]=m<<24|m>>>8,o[r]=m<<16|m>>>16,c[r]=m<<8|m>>>24,u[r]=m,m=16843009*v^65537*y^257*g^16843008*r,f[p]=m<<24|m>>>8,h[p]=m<<16|m>>>16,l[p]=m<<8|m>>>24,d[p]=m,r?(r=g^e[e[e[v^g]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],g=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),a=this._keySchedule=[],s=0;s6&&s%r==4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u]):(u=i[(u=u<<8|u>>>24)>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u],u^=p[s/r|0]<<24),a[s]=a[s-r]^u);for(var o=this._invKeySchedule=[],c=0;c>>24]]^h[i[u>>>16&255]]^l[i[u>>>8&255]]^d[i[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,o,c,u,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,f,h,l,d,a),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,a,s,o){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],h=e[t+2]^r[2],l=e[t+3]^r[3],d=4,p=1;p>>24]^i[f>>>16&255]^a[h>>>8&255]^s[255&l]^r[d++],y=n[f>>>24]^i[h>>>16&255]^a[l>>>8&255]^s[255&u]^r[d++],v=n[h>>>24]^i[l>>>16&255]^a[u>>>8&255]^s[255&f]^r[d++],m=n[l>>>24]^i[u>>>16&255]^a[f>>>8&255]^s[255&h]^r[d++];u=g,f=y,h=v,l=m}g=(o[u>>>24]<<24|o[f>>>16&255]<<16|o[h>>>8&255]<<8|o[255&l])^r[d++],y=(o[f>>>24]<<24|o[h>>>16&255]<<16|o[l>>>8&255]<<8|o[255&u])^r[d++],v=(o[h>>>24]<<24|o[l>>>16&255]<<16|o[u>>>8&255]<<8|o[255&f])^r[d++],m=(o[l>>>24]<<24|o[u>>>16&255]<<16|o[f>>>8&255]<<8|o[255&h])^r[d++],e[t]=g,e[t+1]=y,e[t+2]=v,e[t+3]=m},keySize:8});e.AES=t._createHelper(g)}(),n.AES)},43128:function(e,t,r){var n;e.exports=(n=r(19021),r(80754),r(84636),r(39506),r(57165),function(){var e=n,t=e.lib.BlockCipher,r=e.algo;const i=16,a=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var o={pbox:[],sbox:[]};function c(e,t){let r=t>>24&255,n=t>>16&255,i=t>>8&255,a=255&t,s=e.sbox[0][r]+e.sbox[1][n];return s^=e.sbox[2][i],s+=e.sbox[3][a],s}function u(e,t,r){let n,a=t,s=r;for(let t=0;t=r&&(n=0);let o=0,c=0,f=0;for(let t=0;t1;--t)a^=e.pbox[t],s=c(e,a)^s,n=a,a=s,s=n;return n=a,a=s,s=n,s^=e.pbox[1],a^=e.pbox[0],{left:a,right:s}}(o,e[t],e[t+1]);e[t]=r.left,e[t+1]=r.right},blockSize:2,keySize:4,ivSize:2});e.Blowfish=t._createHelper(f)}(),n.Blowfish)},57165:function(e,t,r){var n,i,a,s,o,c,u,f,h,l,d,p,g,y,v,m,b,w,S;e.exports=(n=r(19021),r(39506),void(n.lib.Cipher||(i=n,a=i.lib,s=a.Base,o=a.WordArray,c=a.BufferedBlockAlgorithm,u=i.enc,u.Utf8,f=u.Base64,h=i.algo.EvpKDF,l=a.Cipher=c.extend({cfg:s.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?S:b}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),a.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),d=i.mode={},p=a.BlockCipherMode=s.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),g=d.CBC=function(){var e=p.extend();function t(e,t,r){var n,i=this._iv;i?(n=i,this._iv=void 0):n=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},a.BlockCipher=l.extend({cfg:l.cfg.extend({mode:g,padding:y}),reset:function(){var e;l.reset.call(this);var t=this.cfg,r=t.iv,n=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=n.createEncryptor:(e=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(n,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),v=a.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(i.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?o.create([1398893684,1701076831]).concat(r).concat(t):t).toString(f)},parse:function(e){var t,r=f.parse(e),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(t=o.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),v.create({ciphertext:r,salt:t})}},b=a.SerializableCipher=s.extend({cfg:s.extend({format:m}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),a=i.finalize(t),s=i.cfg;return v.create({ciphertext:a,key:r,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),w=(i.kdf={}).OpenSSL={execute:function(e,t,r,n,i){if(n||(n=o.random(8)),i)a=h.create({keySize:t+r,hasher:i}).compute(e,n);else var a=h.create({keySize:t+r}).compute(e,n);var s=o.create(a.words.slice(t),4*r);return a.sigBytes=4*t,v.create({key:a,iv:s,salt:n})}},S=a.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:w}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize,n.salt,n.hasher);n.iv=i.iv;var a=b.encrypt.call(this,e,t,i.key,n);return a.mixIn(i),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt,n.hasher);return n.iv=i.iv,b.decrypt.call(this,e,t,i.key,n)}}))))},19021:function(e,t,r){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==r.g&&r.g.crypto&&(n=r.g.crypto),!n)try{n=r(50477)}catch(e){}var i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),s={},o=s.lib={},c=o.Base={extend:function(e){var t=a(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=o.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a>>2]>>>24-a%4*8&255;t[n+a>>>2]|=s<<24-(n+a)%4*8}else for(var o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new u.init(r,t/2)}},l=f.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new u.init(r,t)}},d=f.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},p=o.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,i=n.words,a=n.sigBytes,s=this.blockSize,o=a/(4*s),c=(o=t?e.ceil(o):e.max((0|o)-this._minBufferSize,0))*s,f=e.min(4*c,a);if(c){for(var h=0;h>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,o=0;o<4&&a+.75*o>>6*(3-o)&63));var c=n.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var i=0;i>>6-s%4*2;n[i>>>2]|=o<<24-i%4*8,i++}return a.create(n,i)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},n.enc.Base64)},64725:function(e,t,r){var n,i,a;e.exports=(n=r(19021),a=(i=n).lib.WordArray,i.enc.Base64url={stringify:function(e,t){void 0===t&&(t=!0);var r=e.words,n=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var a=[],s=0;s>>2]>>>24-s%4*8&255)<<16|(r[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|r[s+2>>>2]>>>24-(s+2)%4*8&255,c=0;c<4&&s+.75*c>>6*(3-c)&63));var u=i.charAt(64);if(u)for(;a.length%4;)a.push(u);return a.join("")},parse:function(e,t){void 0===t&&(t=!0);var r=e.length,n=t?this._safe_map:this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var s=0;s>>6-s%4*2;n[i>>>2]|=o<<24-i%4*8,i++}return a.create(n,i)}(e,r,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},n.enc.Base64url)},45503:function(e,t,r){var n;e.exports=(n=r(19021),function(){var e=n,t=e.lib.WordArray,r=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},r.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],a=0;a>>2]>>>16-a%4*8&65535);n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var r=e.length,n=[],a=0;a>>1]|=i(e.charCodeAt(a)<<16-a%2*16);return t.create(n,2*r)}}}(),n.enc.Utf16)},39506:function(e,t,r){var n,i,a,s,o,c,u,f;e.exports=(f=r(19021),r(45471),r(51025),a=(i=(n=f).lib).Base,s=i.WordArray,c=(o=n.algo).MD5,u=o.EvpKDF=a.extend({cfg:a.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,i=n.hasher.create(),a=s.create(),o=a.words,c=n.keySize,u=n.iterations;o.lengthn&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),s=this._iKey=t.clone(),o=i.words,c=s.words,u=0;u>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)};r.prototype=e}}(),n.lib.WordArray)},84636:function(e,t,r){var n;e.exports=(n=r(19021),function(e){var t=n,r=t.lib,i=r.WordArray,a=r.Hasher,s=t.algo,o=[];!function(){for(var t=0;t<64;t++)o[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=s.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a=this._hash.words,s=e[t+0],c=e[t+1],d=e[t+2],p=e[t+3],g=e[t+4],y=e[t+5],v=e[t+6],m=e[t+7],b=e[t+8],w=e[t+9],S=e[t+10],E=e[t+11],C=e[t+12],A=e[t+13],B=e[t+14],x=e[t+15],T=a[0],I=a[1],F=a[2],k=a[3];T=u(T,I,F,k,s,7,o[0]),k=u(k,T,I,F,c,12,o[1]),F=u(F,k,T,I,d,17,o[2]),I=u(I,F,k,T,p,22,o[3]),T=u(T,I,F,k,g,7,o[4]),k=u(k,T,I,F,y,12,o[5]),F=u(F,k,T,I,v,17,o[6]),I=u(I,F,k,T,m,22,o[7]),T=u(T,I,F,k,b,7,o[8]),k=u(k,T,I,F,w,12,o[9]),F=u(F,k,T,I,S,17,o[10]),I=u(I,F,k,T,E,22,o[11]),T=u(T,I,F,k,C,7,o[12]),k=u(k,T,I,F,A,12,o[13]),F=u(F,k,T,I,B,17,o[14]),T=f(T,I=u(I,F,k,T,x,22,o[15]),F,k,c,5,o[16]),k=f(k,T,I,F,v,9,o[17]),F=f(F,k,T,I,E,14,o[18]),I=f(I,F,k,T,s,20,o[19]),T=f(T,I,F,k,y,5,o[20]),k=f(k,T,I,F,S,9,o[21]),F=f(F,k,T,I,x,14,o[22]),I=f(I,F,k,T,g,20,o[23]),T=f(T,I,F,k,w,5,o[24]),k=f(k,T,I,F,B,9,o[25]),F=f(F,k,T,I,p,14,o[26]),I=f(I,F,k,T,b,20,o[27]),T=f(T,I,F,k,A,5,o[28]),k=f(k,T,I,F,d,9,o[29]),F=f(F,k,T,I,m,14,o[30]),T=h(T,I=f(I,F,k,T,C,20,o[31]),F,k,y,4,o[32]),k=h(k,T,I,F,b,11,o[33]),F=h(F,k,T,I,E,16,o[34]),I=h(I,F,k,T,B,23,o[35]),T=h(T,I,F,k,c,4,o[36]),k=h(k,T,I,F,g,11,o[37]),F=h(F,k,T,I,m,16,o[38]),I=h(I,F,k,T,S,23,o[39]),T=h(T,I,F,k,A,4,o[40]),k=h(k,T,I,F,s,11,o[41]),F=h(F,k,T,I,p,16,o[42]),I=h(I,F,k,T,v,23,o[43]),T=h(T,I,F,k,w,4,o[44]),k=h(k,T,I,F,C,11,o[45]),F=h(F,k,T,I,x,16,o[46]),T=l(T,I=h(I,F,k,T,d,23,o[47]),F,k,s,6,o[48]),k=l(k,T,I,F,m,10,o[49]),F=l(F,k,T,I,B,15,o[50]),I=l(I,F,k,T,y,21,o[51]),T=l(T,I,F,k,C,6,o[52]),k=l(k,T,I,F,p,10,o[53]),F=l(F,k,T,I,S,15,o[54]),I=l(I,F,k,T,c,21,o[55]),T=l(T,I,F,k,b,6,o[56]),k=l(k,T,I,F,x,10,o[57]),F=l(F,k,T,I,v,15,o[58]),I=l(I,F,k,T,A,21,o[59]),T=l(T,I,F,k,g,6,o[60]),k=l(k,T,I,F,E,10,o[61]),F=l(F,k,T,I,d,15,o[62]),I=l(I,F,k,T,w,21,o[63]),a[0]=a[0]+T|0,a[1]=a[1]+I|0,a[2]=a[2]+F|0,a[3]=a[3]+k|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var a=e.floor(n/4294967296),s=n;r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(r.length+1),this._process();for(var o=this._hash,c=o.words,u=0;u<4;u++){var f=c[u];c[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return o},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,n,i,a,s){var o=e+(t&r|~t&n)+i+s;return(o<>>32-a)+t}function f(e,t,r,n,i,a,s){var o=e+(t&n|r&~n)+i+s;return(o<>>32-a)+t}function h(e,t,r,n,i,a,s){var o=e+(t^r^n)+i+s;return(o<>>32-a)+t}function l(e,t,r,n,i,a,s){var o=e+(r^(t|~n))+i+s;return(o<>>32-a)+t}t.MD5=a._createHelper(c),t.HmacMD5=a._createHmacHelper(c)}(Math),n.MD5)},82169:function(e,t,r){var n;e.exports=(n=r(19021),r(57165),n.mode.CFB=function(){var e=n.lib.BlockCipherMode.extend();function t(e,t,r,n){var i,a=this._iv;a?(i=a.slice(0),this._iv=void 0):i=this._prevBlock,n.encryptBlock(i,0);for(var s=0;s>24))e+=1<<24;else{var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}return e}var r=e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,a=this._iv,s=this._counter;a&&(s=this._counter=a.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(s);var o=s.slice(0);n.encryptBlock(o,0);for(var c=0;c>>2]|=i<<24-a%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Ansix923)},54905:function(e,t,r){var n;e.exports=(n=r(19021),r(57165),n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126)},10482:function(e,t,r){var n;e.exports=(n=r(19021),r(57165),n.pad.Iso97971={pad:function(e,t){e.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(e,t)},unpad:function(e){n.pad.ZeroPadding.unpad(e),e.sigBytes--}},n.pad.Iso97971)},58124:function(e,t,r){var n;e.exports=(n=r(19021),r(57165),n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)},52155:function(e,t,r){var n;e.exports=(n=r(19021),r(57165),n.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){var t=e.words,r=e.sigBytes-1;for(r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},n.pad.ZeroPadding)},70019:function(e,t,r){var n,i,a,s,o,c,u,f,h;e.exports=(h=r(19021),r(63009),r(51025),a=(i=(n=h).lib).Base,s=i.WordArray,c=(o=n.algo).SHA256,u=o.HMAC,f=o.PBKDF2=a.extend({cfg:a.extend({keySize:4,hasher:c,iterations:25e4}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=u.create(r.hasher,e),i=s.create(),a=s.create([1]),o=i.words,c=a.words,f=r.keySize,h=r.iterations;o.length>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var a=t.words,s=a[0],o=a[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),h=u>>>16|4294901760&f,l=f<<16|65535&u;for(n[0]^=u,n[1]^=h,n[2]^=f,n[3]^=l,n[4]^=u,n[5]^=h,n[6]^=f,n[7]^=l,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)a[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,o=n>>>16,c=((i*i>>>17)+i*o>>>15)+o*o,u=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=c^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=t._createHelper(o)}(),n.RabbitLegacy)},96298:function(e,t,r){var n;e.exports=(n=r(19021),r(80754),r(84636),r(39506),r(57165),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],a=[],s=[],o=r.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)c.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var a=t.words,s=a[0],o=a[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),h=u>>>16|4294901760&f,l=f<<16|65535&u;for(i[0]^=u,i[1]^=h,i[2]^=f,i[3]^=l,i[4]^=u,i[5]^=h,i[6]^=f,i[7]^=l,r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)a[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,o=n>>>16,c=((i*i>>>17)+i*o>>>15)+o*o,u=((4294901760&n)*n|0)+((65535&n)*n|0);s[r]=c^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=t._createHelper(o)}(),n.Rabbit)},77193:function(e,t,r){var n;e.exports=(n=r(19021),r(80754),r(84636),r(39506),r(57165),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var a=0;i<256;i++){var s=i%r,o=t[s>>>2]>>>24-s%4*8&255;a=(a+n[i]+o)%256;var c=n[i];n[i]=n[a],n[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=a.call(this)},keySize:8,ivSize:0});function a(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var a=e[t];e[t]=e[r],e[r]=a,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var s=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)a.call(this)}});e.RC4Drop=t._createHelper(s)}(),n.RC4)},78056:function(e,t,r){var n;e.exports=(n=r(19021),function(e){var t=n,r=t.lib,i=r.WordArray,a=r.Hasher,s=t.algo,o=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=i.create([0,1518500249,1859775393,2400959708,2840853838]),l=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=s.RIPEMD160=a.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a,s,d,w,S,E,C,A,B,x,T,I=this._hash.words,F=h.words,k=l.words,R=o.words,D=c.words,_=u.words,P=f.words;for(E=a=I[0],C=s=I[1],A=d=I[2],B=w=I[3],x=S=I[4],r=0;r<80;r+=1)T=a+e[t+R[r]]|0,T+=r<16?p(s,d,w)+F[0]:r<32?g(s,d,w)+F[1]:r<48?y(s,d,w)+F[2]:r<64?v(s,d,w)+F[3]:m(s,d,w)+F[4],T=(T=b(T|=0,_[r]))+S|0,a=S,S=w,w=b(d,10),d=s,s=T,T=E+e[t+D[r]]|0,T+=r<16?m(C,A,B)+k[0]:r<32?v(C,A,B)+k[1]:r<48?y(C,A,B)+k[2]:r<64?g(C,A,B)+k[3]:p(C,A,B)+k[4],T=(T=b(T|=0,P[r]))+x|0,E=x,x=B,B=b(A,10),A=C,C=T;T=I[1]+d+B|0,I[1]=I[2]+w+x|0,I[2]=I[3]+S+E|0,I[3]=I[4]+a+C|0,I[4]=I[0]+s+A|0,I[0]=T},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,a=i.words,s=0;s<5;s++){var o=a[s];a[s]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}return i},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,r){return e^t^r}function g(e,t,r){return e&t|~e&r}function y(e,t,r){return(e|~t)^r}function v(e,t,r){return e&r|t&~r}function m(e,t,r){return e^(t|~r)}function b(e,t){return e<>>32-t}t.RIPEMD160=a._createHelper(d),t.HmacRIPEMD160=a._createHmacHelper(d)}(Math),n.RIPEMD160)},45471:function(e,t,r){var n,i,a,s,o,c,u,f;e.exports=(i=(n=f=r(19021)).lib,a=i.WordArray,s=i.Hasher,o=n.algo,c=[],u=o.SHA1=s.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],s=r[3],o=r[4],u=0;u<80;u++){if(u<16)c[u]=0|e[t+u];else{var f=c[u-3]^c[u-8]^c[u-14]^c[u-16];c[u]=f<<1|f>>>31}var h=(n<<5|n>>>27)+o+c[u];h+=u<20?1518500249+(i&a|~i&s):u<40?1859775393+(i^a^s):u<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,o=s,s=a,a=i<<30|i>>>2,i=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+o|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=s._createHelper(u),n.HmacSHA1=s._createHmacHelper(u),f.SHA1)},36308:function(e,t,r){var n,i,a,s,o,c;e.exports=(c=r(19021),r(63009),i=(n=c).lib.WordArray,a=n.algo,s=a.SHA256,o=a.SHA224=s.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=s._createHelper(o),n.HmacSHA224=s._createHmacHelper(o),c.SHA224)},63009:function(e,t,r){var n;e.exports=(n=r(19021),function(e){var t=n,r=t.lib,i=r.WordArray,a=r.Hasher,s=t.algo,o=[],c=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(o[i]=r(e.pow(n,.5))),c[i]=r(e.pow(n,1/3)),i++),n++}();var u=[],f=s.SHA256=a.extend({_doReset:function(){this._hash=new i.init(o.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],s=r[3],o=r[4],f=r[5],h=r[6],l=r[7],d=0;d<64;d++){if(d<16)u[d]=0|e[t+d];else{var p=u[d-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,y=u[d-2],v=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;u[d]=g+u[d-7]+v+u[d-16]}var m=n&i^n&a^i&a,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=l+((o<<26|o>>>6)^(o<<21|o>>>11)^(o<<7|o>>>25))+(o&f^~o&h)+c[d]+u[d];l=h,h=f,f=o,o=s+w|0,s=a,a=i,i=n,n=w+(b+m)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+o|0,r[5]=r[5]+f|0,r[6]=r[6]+h|0,r[7]=r[7]+l|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=a._createHelper(f),t.HmacSHA256=a._createHmacHelper(f)}(Math),n.SHA256)},45953:function(e,t,r){var n;e.exports=(n=r(19021),r(43240),function(e){var t=n,r=t.lib,i=r.WordArray,a=r.Hasher,s=t.x64.Word,o=t.algo,c=[],u=[],f=[];!function(){for(var e=1,t=0,r=0;r<24;r++){c[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,a=0;a<24;a++){for(var o=0,h=0,l=0;l<7;l++){if(1&i){var d=(1<>>24)|4278255360&(a<<24|a>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(I=r[i]).high^=s,I.low^=a}for(var o=0;o<24;o++){for(var l=0;l<5;l++){for(var d=0,p=0,g=0;g<5;g++)d^=(I=r[l+5*g]).high,p^=I.low;var y=h[l];y.high=d,y.low=p}for(l=0;l<5;l++){var v=h[(l+4)%5],m=h[(l+1)%5],b=m.high,w=m.low;for(d=v.high^(b<<1|w>>>31),p=v.low^(w<<1|b>>>31),g=0;g<5;g++)(I=r[l+5*g]).high^=d,I.low^=p}for(var S=1;S<25;S++){var E=(I=r[S]).high,C=I.low,A=c[S];A<32?(d=E<>>32-A,p=C<>>32-A):(d=C<>>64-A,p=E<>>64-A);var B=h[u[S]];B.high=d,B.low=p}var x=h[0],T=r[0];for(x.high=T.high,x.low=T.low,l=0;l<5;l++)for(g=0;g<5;g++){var I=r[S=l+5*g],F=h[S],k=h[(l+1)%5+5*g],R=h[(l+2)%5+5*g];I.high=F.high^~k.high&R.high,I.low=F.low^~k.low&R.low}I=r[0];var D=f[o];I.high^=D.high,I.low^=D.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),a=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/a)*a>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var s=this._state,o=this.cfg.outputLength/8,c=o/8,u=[],f=0;f>>24)|4278255360&(l<<24|l>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),u.push(d),u.push(l)}return new i.init(u,o)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=a._createHelper(l),t.HmacSHA3=a._createHmacHelper(l)}(Math),n.SHA3)},89557:function(e,t,r){var n,i,a,s,o,c,u,f;e.exports=(f=r(19021),r(43240),r(81380),i=(n=f).x64,a=i.Word,s=i.WordArray,o=n.algo,c=o.SHA512,u=o.SHA384=c.extend({_doReset:function(){this._hash=new s.init([new a.init(3418070365,3238371032),new a.init(1654270250,914150663),new a.init(2438529370,812702999),new a.init(355462360,4144912697),new a.init(1731405415,4290775857),new a.init(2394180231,1750603025),new a.init(3675008525,1694076839),new a.init(1203062813,3204075428)])},_doFinalize:function(){var e=c._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=c._createHelper(u),n.HmacSHA384=c._createHmacHelper(u),f.SHA384)},81380:function(e,t,r){var n;e.exports=(n=r(19021),r(43240),function(){var e=n,t=e.lib.Hasher,r=e.x64,i=r.Word,a=r.WordArray,s=e.algo;function o(){return i.create.apply(i,arguments)}var c=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=o()}();var f=s.SHA512=t.extend({_doReset:function(){this._hash=new a.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],s=r[3],o=r[4],f=r[5],h=r[6],l=r[7],d=n.high,p=n.low,g=i.high,y=i.low,v=a.high,m=a.low,b=s.high,w=s.low,S=o.high,E=o.low,C=f.high,A=f.low,B=h.high,x=h.low,T=l.high,I=l.low,F=d,k=p,R=g,D=y,_=v,P=m,N=b,O=w,L=S,U=E,K=C,M=A,H=B,j=x,V=T,G=I,q=0;q<80;q++){var z,W,X=u[q];if(q<16)W=X.high=0|e[t+2*q],z=X.low=0|e[t+2*q+1];else{var Y=u[q-15],J=Y.high,Q=Y.low,Z=(J>>>1|Q<<31)^(J>>>8|Q<<24)^J>>>7,$=(Q>>>1|J<<31)^(Q>>>8|J<<24)^(Q>>>7|J<<25),ee=u[q-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ae=u[q-7],se=ae.high,oe=ae.low,ce=u[q-16],ue=ce.high,fe=ce.low;W=(W=(W=Z+se+((z=$+oe)>>>0<$>>>0?1:0))+ne+((z+=ie)>>>0>>0?1:0))+ue+((z+=fe)>>>0>>0?1:0),X.high=W,X.low=z}var he,le=L&K^~L&H,de=U&M^~U&j,pe=F&R^F&_^R&_,ge=k&D^k&P^D&P,ye=(F>>>28|k<<4)^(F<<30|k>>>2)^(F<<25|k>>>7),ve=(k>>>28|F<<4)^(k<<30|F>>>2)^(k<<25|F>>>7),me=(L>>>14|U<<18)^(L>>>18|U<<14)^(L<<23|U>>>9),be=(U>>>14|L<<18)^(U>>>18|L<<14)^(U<<23|L>>>9),we=c[q],Se=we.high,Ee=we.low,Ce=V+me+((he=G+be)>>>0>>0?1:0),Ae=ve+ge;V=H,G=j,H=K,j=M,K=L,M=U,L=N+(Ce=(Ce=(Ce=Ce+le+((he+=de)>>>0>>0?1:0))+Se+((he+=Ee)>>>0>>0?1:0))+W+((he+=z)>>>0>>0?1:0))+((U=O+he|0)>>>0>>0?1:0)|0,N=_,O=P,_=R,P=D,R=F,D=k,F=Ce+(ye+pe+(Ae>>>0>>0?1:0))+((k=he+Ae|0)>>>0>>0?1:0)|0}p=n.low=p+k,n.high=d+F+(p>>>0>>0?1:0),y=i.low=y+D,i.high=g+R+(y>>>0>>0?1:0),m=a.low=m+P,a.high=v+_+(m>>>0

>>0?1:0),w=s.low=w+O,s.high=b+N+(w>>>0>>0?1:0),E=o.low=E+U,o.high=S+L+(E>>>0>>0?1:0),A=f.low=A+M,f.high=C+K+(A>>>0>>0?1:0),x=h.low=x+j,h.high=B+H+(x>>>0>>0?1:0),I=l.low=I+G,l.high=T+V+(I>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(f),e.HmacSHA512=t._createHmacHelper(f)}(),n.SHA512)},7628:function(e,t,r){var n;e.exports=(n=r(19021),r(80754),r(84636),r(39506),r(57165),function(){var e=n,t=e.lib,r=t.WordArray,i=t.BlockCipher,a=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=a.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=s[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],a=0;a<16;a++){var u=i[a]=[],f=c[a];for(r=0;r<24;r++)u[r/6|0]|=t[(o[r]-1+f)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(o[r+24]-1+f)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var h=this._invSubKeys=[];for(r=0;r<16;r++)h[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],l.call(this,4,252645135),l.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),l.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],a=this._lBlock,s=this._rBlock,o=0,c=0;c<8;c++)o|=u[c][((s^i[c])&f[c])>>>0];this._lBlock=s,this._rBlock=a^o}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,l.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),l.call(this,16,65535),l.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function l(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<192.");var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=h.createEncryptor(r.create(t)),this._des2=h.createEncryptor(r.create(n)),this._des3=h.createEncryptor(r.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(p)}(),n.TripleDES)},43240:function(e,t,r){var n,i,a,s,o,c;e.exports=(n=r(19021),a=(i=n).lib,s=a.Base,o=a.WordArray,(c=i.x64={}).Word=s.extend({init:function(e,t){this.high=e,this.low=t}}),c.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n{t.read=function(e,t,r,n,i){var a,s,o=8*i-n-1,c=(1<>1,f=-7,h=r?i-1:0,l=r?-1:1,d=e[t+h];for(h+=l,a=d&(1<<-f)-1,d>>=-f,f+=o;f>0;a=256*a+e[t+h],h+=l,f-=8);for(s=a&(1<<-f)-1,a>>=-f,f+=n;f>0;s=256*s+e[t+h],h+=l,f-=8);if(0===a)a=1-u;else{if(a===c)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),a-=u}return(d?-1:1)*s*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var s,o,c,u=8*a-i-1,f=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+h>=1?l/c:l*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=f?(o=0,s=f):s+h>=1?(o=(t*c-1)*Math.pow(2,i),s+=h):(o=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&o,d+=p,o/=256,i-=8);for(s=s<0;e[r+d]=255&s,d+=p,s/=256,u-=8);e[r+d-p]|=128*g}},72057:(e,t,r)=>{var n=r(28413);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(10207),r(19111),r(23564),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=g({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return g({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=g({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return g({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){f||l();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return p(r._w,e,t,!1)},decrypt:function(e,t){return p(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var i=0;i>>=2,i=0;i>8^255&h^99,a[g]=h,s[h]=g,d=(l=e[h])<<24^h<<16^h<<8^h^l,p=((r=e[g])^(n=e[r])^(i=e[n]))<<24^(g^i)<<16^(g^n^i)<<8^g^r^i;for(var v=0;v<4;++v)c[v][g]=d,u[v][h]=p,d=d<<24|d>>>8,p=p<<24|p>>>8;0===g?g=y=1:(g=r^e[e[e[r^i]]],y^=e[e[y]])}}function d(e,t){for(var r,n=e.slice(0),i=1,s=n.length,c=h*(s+6+1),f=s;f>>16&255]<<24^a[r>>>8&255]<<16^a[255&r]<<8^a[r>>>24]^o[i]<<24,i++):s>6&&f%s==4&&(r=a[r>>>24]<<24^a[r>>>16&255]<<16^a[r>>>8&255]<<8^a[255&r]),n[f]=n[f-s]^r;if(t){for(var l,d=u[0],p=u[1],g=u[2],y=u[3],v=n.slice(0),m=(f=0,(c=n.length)-h);f>>24]]^p[a[l>>>16&255]]^g[a[l>>>8&255]]^y[a[255&l]];n=v}return n}function p(e,t,r,n){var i,o,f,h,l,d,p,g,y,v,m,b,w=e.length/4-1;n?(i=u[0],o=u[1],f=u[2],h=u[3],l=s):(i=c[0],o=c[1],f=c[2],h=c[3],l=a),d=t[0]^e[0],p=t[n?3:1]^e[1],g=t[2]^e[2],y=t[n?1:3]^e[3];for(var S=3,E=1;E>>24]^o[p>>>16&255]^f[g>>>8&255]^h[255&y]^e[++S],m=i[p>>>24]^o[g>>>16&255]^f[y>>>8&255]^h[255&d]^e[++S],b=i[g>>>24]^o[y>>>16&255]^f[d>>>8&255]^h[255&p]^e[++S],y=i[y>>>24]^o[d>>>16&255]^f[p>>>8&255]^h[255&g]^e[++S],d=v,p=m,g=b;r[0]=l[d>>>24]<<24^l[p>>>16&255]<<16^l[g>>>8&255]<<8^l[255&y]^e[++S],r[n?3:1]=l[p>>>24]<<24^l[g>>>16&255]<<16^l[y>>>8&255]<<8^l[255&d]^e[++S],r[2]=l[g>>>24]<<24^l[y>>>16&255]<<16^l[d>>>8&255]<<8^l[255&p]^e[++S],r[n?1:3]=l[y>>>24]<<24^l[d>>>16&255]<<16^l[p>>>8&255]<<8^l[255&g]^e[++S]}function g(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},73115:(e,t,r)=>{var n=r(28413);r(72057),r(88415);var i=e.exports=n.tls;function a(e,t,r){var a=t.entity===n.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:n.cipher.createDecipher("AES-CBC",a?r.keys.server_write_key:r.keys.client_write_key),iv:a?r.keys.server_write_IV:r.keys.client_write_IV},e.write.cipherState={init:!1,cipher:n.cipher.createCipher("AES-CBC",a?r.keys.client_write_key:r.keys.server_write_key),iv:a?r.keys.client_write_IV:r.keys.server_write_IV},e.read.cipherFunction=u,e.write.cipherFunction=s,e.read.macLength=e.write.macLength=r.mac_length,e.read.macFunction=e.write.macFunction=i.hmac_sha1}function s(e,t){var r,a=!1,s=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(s),t.updateSequenceNumber(),r=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:n.random.getBytesSync(16),t.cipherState.init=!0;var c=t.cipherState.cipher;return c.start({iv:r}),e.version.minor>=i.Versions.TLS_1_1.minor&&c.output.putBytes(r),c.update(e.fragment),c.finish(o)&&(e.fragment=c.output,e.length=e.fragment.length(),a=!0),a}function o(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function c(e,t,r){var n=!0;if(r){for(var i=t.length(),a=t.last(),s=i-1-a;s=o?(e.fragment=s.output.getBytes(f-o),u=s.output.getBytes(o)):e.fragment=s.output.getBytes(),e.fragment=n.util.createBuffer(e.fragment),e.length=e.fragment.length();var h=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),a=function(e,t,r){var i=n.hmac.create();return i.start("SHA1",e),i.update(t),t=i.digest().getBytes(),i.start(null,null),i.update(r),t===(r=i.digest().getBytes())}(t.macKey,u,h)&&a,a}i.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:a},i.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:a}},36166:(e,t,r)=>{var n=r(28413);r(25129);var i=n.asn1;t.privateKeyValidator={name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},t.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},25129:(e,t,r)=>{var n=r(28413);r(23564),r(12889);var i=e.exports=n.asn1=n.asn1||{};function a(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}function s(e,t,r,n){var o;a(e,t,2);var c=e.getByte();t--;var u=192&c,f=31&c;o=e.length();var h,l,d=function(e,t){var r=e.getByte();if(t--,128!==r){var n;if(128&r){var i=127&r;a(e,t,i),n=e.getInt(i<<3)}else n=r;if(n<0)throw new Error("Negative length: "+n);return n}}(e,t);if(t-=o-e.length(),void 0!==d&&d>t){if(n.strict){var p=new Error("Too few bytes to read ASN.1 value.");throw p.available=e.length(),p.remaining=t,p.requested=d,p}d=t}var g=!(32&~c);if(g)if(h=[],void 0===d)for(;;){if(a(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}o=e.length(),h.push(s(e,t,r+1,n)),t-=o-e.length()}else for(;d>0;)o=e.length(),h.push(s(e,d,r+1,n)),t-=o-e.length(),d-=o-e.length();if(void 0===h&&u===i.Class.UNIVERSAL&&f===i.Type.BITSTRING&&(l=e.bytes(d)),void 0===h&&n.decodeBitStrings&&u===i.Class.UNIVERSAL&&f===i.Type.BITSTRING&&d>1){var y=e.read,v=t,m=0;if(f===i.Type.BITSTRING&&(a(e,t,1),m=e.getByte(),t--),0===m)try{o=e.length();var b=s(e,t,r+1,{strict:!0,decodeBitStrings:!0}),w=o-e.length();t-=w,f==i.Type.BITSTRING&&w++;var S=b.tagClass;w!==d||S!==i.Class.UNIVERSAL&&S!==i.Class.CONTEXT_SPECIFIC||(h=[b])}catch(e){}void 0===h&&(e.read=y,t=v)}if(void 0===h){if(void 0===d){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");d=t}if(f===i.Type.BMPSTRING)for(h="";d>0;d-=2)a(e,t,2),h+=String.fromCharCode(e.getInt16()),t-=2;else h=e.getBytes(d),t-=d}var E=void 0===l?null:{bitStringContents:l};return i.create(u,f,g,h,E)}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,a,s){if(n.util.isArray(a)){for(var o=[],c=0;c1)||(0!==e.value.charCodeAt(0)||128&e.value.charCodeAt(1))&&(255!==e.value.charCodeAt(0)||128&~e.value.charCodeAt(1))?a.putBytes(e.value):a.putBytes(e.value.substr(1));if(t.putByte(r),a.length()<=127)t.putByte(127&a.length());else{var c=a.length(),u="";do{u+=String.fromCharCode(255&c),c>>>=8}while(c>0);for(t.putByte(128|u.length),o=u.length-1;o>=0;--o)t.putByte(u.charCodeAt(o))}return t.putBuffer(a),t},i.oidToDer=function(e){var t,r,i,a,s=e.split("."),o=n.util.createBuffer();o.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var c=2;c>>=7,t||(a|=128),r.push(a),t=!1}while(i>0);for(var u=r.length-1;u>=0;--u)o.putByte(r[u])}return o},i.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),u=10;"+"!==c&&"-"!==c&&(o=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,s,o,0),u&&("+"===(c=e.charAt(u))||"-"===c)){var f=60*parseInt(e.substr(u+1,2),10)+parseInt(e.substr(u+4,2),10);f*=6e4,"+"===c?t.setTime(+t-f):t.setTime(+t+f)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),c=0,u=0,f=!1;"Z"===e.charAt(e.length-1)&&(f=!0);var h=e.length-5,l=e.charAt(h);return"+"!==l&&"-"!==l||(u=60*parseInt(e.substr(h+1,2),10)+parseInt(e.substr(h+4,2),10),u*=6e4,"+"===l&&(u*=-1),f=!0),"."===e.charAt(14)&&(c=1e3*parseFloat(e.substr(14),10)),f?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,s,o,c),t.setTime(+t+u)):(t.setFullYear(r,n,i),t.setHours(a,s,o,c)),t},i.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,a){var s=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)a&&(e.tagClass!==t.tagClass&&a.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&a.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(s=!0,t.value&&n.util.isArray(t.value))for(var o=0,c=0;s&&c0&&(a+="\n");for(var s="",c=0;c1?a+="0x"+n.util.bytesToHex(e.value.slice(1)):a+="(none)",e.value.length>0){var l=e.value.charCodeAt(0);1==l?a+=" (1 unused bit shown)":l>1&&(a+=" ("+l+" unused bits shown)")}}else if(e.type===i.Type.OCTETSTRING)o.test(e.value)||(a+="("+e.value+") "),a+="0x"+n.util.bytesToHex(e.value);else if(e.type===i.Type.UTF8)try{a+=n.util.decodeUtf8(e.value)}catch(t){if("URI malformed"!==t.message)throw t;a+="0x"+n.util.bytesToHex(e.value)+" (malformed UTF8)"}else e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?a+=e.value:o.test(e.value)?a+="0x"+n.util.bytesToHex(e.value):0===e.value.length?a+="[null]":a+=e.value}return a}},84775:(e,t,r)=>{var n=r(42363).Buffer,i={};e.exports=i;var a={};i.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,a=t.length,s=t.charAt(0),o=[0];for(i=0;i0;)o.push(u%a),u=u/a|0}for(i=0;0===e[i]&&i=0;--i)n+=t[o[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r0;)a.push(o%n),o=o/n|0}var c="";for(r=0;0===e.at(r)&&r=0;--r)c+=t[a[r]];return c}(e,t);if(r){var f=new RegExp(".{1,"+r+"}","g");n=n.match(f).join("\r\n")}return n},i.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var r=a[t];if(!r){r=a[t]=[];for(var i=0;i>=8;for(;h>0;)c.push(255&h),h>>=8}for(var l=0;e[l]===o&&l{var n=r(28413);r(23564),e.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[e]:null};var i=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t)||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},19111:(e,t,r)=>{var n=r(28413);r(23564),n.cipher=n.cipher||{};var i=e.exports=n.cipher.modes=n.cipher.modes||{};function a(e,t){if("string"==typeof e&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var r=e;e=n.util.createBuffer();for(var i=0;i0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2||(e.truncate(n),0))},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2||(e.truncate(n),0))},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(8*i)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=o(8*t.length());var a=t.length()%this.blockSize;for(a&&t.fillWithByte(0,this.blockSize-a),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),s(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),s=0;s>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a{var n=r(28413);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.des.Algorithm(e,t)}))}r(10207),r(19111),r(23564),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return d(r._keys,e,t,!1)},decrypt:function(e,t){return d(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],c=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],l=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],g=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=e.length()>8?3:1,v=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,w=0;w>>4^E))<<4,S^=t=65535&((E^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(E^=t<<-16)))<<2,S^=t=65535&((E^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(E^=t<<-16)))<<1,S^=t=16711935&((E^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(E^=t<<8)))<<1)<<8|(E^=t)>>>20&240,S=E<<24|E<<8&16711680|E>>>8&65280|E>>>24&240,E=t;for(var C=0;C>>26,E=E<<2|E>>>26):(S=S<<1|S>>>27,E=E<<1|E>>>27);var A=r[(S&=-15)>>>28]|n[S>>>24&15]|i[S>>>20&15]|a[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|c[S>>>4&15],B=u[(E&=-15)>>>28]|f[E>>>24&15]|h[E>>>20&15]|l[E>>>16&15]|d[E>>>12&15]|p[E>>>8&15]|g[E>>>4&15];t=65535&(B>>>16^A),v[b++]=A^t,v[b++]=B^t<<16}}return v}(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var a=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],o=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],u=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],f=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],h=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],l=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function d(e,t,r,n){var i,d,p=32===e.length?3:9;i=3===p?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var g=t[0],y=t[1];g^=(d=252645135&(g>>>4^y))<<4,g^=(d=65535&(g>>>16^(y^=d)))<<16,g^=d=858993459&((y^=d)>>>2^g),g^=d=16711935&((y^=d<<2)>>>8^g),g=(g^=(d=1431655765&(g>>>1^(y^=d<<8)))<<1)<<1|g>>>31,y=(y^=d)<<1|y>>>31;for(var v=0;v>>4|y<<28)^e[w+1];d=g,g=y,y=d^(s[S>>>24&63]|c[S>>>16&63]|f[S>>>8&63]|l[63&S]|a[E>>>24&63]|o[E>>>16&63]|u[E>>>8&63]|h[63&E])}d=g,g=y,y=d}y=y>>>1|y<<31,y^=d=1431655765&((g=g>>>1|g<<31)>>>1^y),y^=(d=16711935&(y>>>8^(g^=d<<1)))<<8,y^=(d=858993459&(y>>>2^(g^=d)))<<2,y^=d=65535&((g^=d)>>>16^y),y^=d=252645135&((g^=d<<16)>>>4^y),g^=d<<4,r[0]=g,r[1]=y}function p(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},7931:(e,t,r)=>{var n=r(42363).Buffer,i=r(28413);r(29127),r(93851),r(39194),r(23564);var a=r(36166),s=a.publicKeyValidator,o=a.privateKeyValidator;if(void 0===c)var c=i.jsbn.BigInteger;var u=i.util.ByteBuffer,f=void 0===n?Uint8Array:n;i.pki=i.pki||{},e.exports=i.pki.ed25519=i.ed25519=i.ed25519||{};var h=i.ed25519;function l(e){var t=e.message;if(t instanceof Uint8Array||t instanceof f)return t;var r=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');t=e.md.digest().getBytes(),r="binary"}if("string"==typeof t&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if(void 0!==n)return n.from(t,r);t=new u(t,r)}else if(!(t instanceof u))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var i=new f(t.length()),a=0;a=0;--r)K(n,n),1!==r&&M(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(r,r),M(r,r,i),M(r,r,a),M(r,r,a),M(e[0],r,a),K(n,e[0]),M(n,n,a),I(n,i)&&M(e[0],e[0],w),K(n,e[0]),M(n,n,a),I(n,i)?-1:(k(e[0])===t[31]>>7&&U(e[0],d,e[0]),M(e[3],e[0],e[1]),0)}(o,n))return-1;for(i=0;i=0};var d=O(),p=O([1]),g=O([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=O([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),v=O([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),m=O([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),b=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),w=O([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function S(e,t){var r=i.md.sha512.create(),a=new u(e);r.update(a.getBytes(t),"binary");var s=r.digest().getBytes();if(void 0!==n)return n.from(s,"binary");for(var o=new f(h.constants.HASH_BYTE_LENGTH),c=0;c<64;++c)o[c]=s.charCodeAt(c);return o}function E(e,t){var r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i>8,t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;++i)t[i]+=r-(t[31]>>4)*b[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*b[i];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function C(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;E(e,t)}function A(e,t){var r=O(),n=O(),i=O(),a=O(),s=O(),o=O(),c=O(),u=O(),f=O();U(r,e[1],e[0]),U(f,t[1],t[0]),M(r,r,f),L(n,e[0],e[1]),L(f,t[0],t[1]),M(n,n,f),M(i,e[3],t[3]),M(i,i,y),M(a,e[2],t[2]),L(a,a,a),U(s,n,r),U(o,a,i),L(c,a,i),L(u,n,r),M(e[0],s,o),M(e[1],u,c),M(e[2],c,o),M(e[3],s,u)}function B(e,t,r){for(var n=0;n<4;++n)N(e[n],t[n],r)}function x(e,t){var r=O(),n=O(),i=O();!function(e,t){var r,n=O();for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)K(n,n),2!==r&&4!==r&&M(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(i,t[2]),M(r,t[0],i),M(n,t[1],i),T(e,n),e[31]^=k(r)<<7}function T(e,t){var r,n,i,a=O(),s=O();for(r=0;r<16;++r)s[r]=t[r];for(P(s),P(s),P(s),n=0;n<2;++n){for(a[0]=s[0]-65517,r=1;r<15;++r)a[r]=s[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=s[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,N(s,a,1-i)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function I(e,t){var r=new f(32),n=new f(32);return T(r,e),T(n,t),F(r,0,n,0)}function F(e,t,r,n){return function(e,t,r,n,i){var a,s=0;for(a=0;a<32;++a)s|=e[t+a]^r[n+a];return(1&s-1>>>8)-1}(e,t,r,n)}function k(e){var t=new f(32);return T(t,e),1&t[0]}function R(e,t,r){var n,i;for(_(e[0],d),_(e[1],p),_(e[2],p),_(e[3],d),i=255;i>=0;--i)B(e,t,n=r[i/8|0]>>(7&i)&1),A(t,e),A(e,e),B(e,t,n)}function D(e,t){var r=[O(),O(),O(),O()];_(r[0],v),_(r[1],m),_(r[2],p),M(r[3],v,m),R(e,r,t)}function _(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function P(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function N(e,t,r){for(var n,i=~(r-1),a=0;a<16;++a)n=i&(e[a]^t[a]),e[a]^=n,t[a]^=n}function O(e){var t,r=new Float64Array(16);if(e)for(t=0;t{e.exports={options:{usePureJavaScript:!1}}},77827:(e,t,r)=>{var n=r(28413);r(25853),r(23564),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,a={start:function(a,s){if(null!==a)if("string"==typeof a){if(!((a=a.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+a+'"');t=n.md.algorithms[a].create()}else t=a;if(null===s)s=e;else{if("string"==typeof s)s=n.util.createBuffer(s);else if(n.util.isArray(s)){var o=s;s=n.util.createBuffer();for(var c=0;ct.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),u=s.length(),c=0;c{e.exports=r(28413),r(72057),r(73115),r(25129),r(10207),r(35690),r(7931),r(77827),r(26177),r(54728),r(53372),r(81321),r(59065),r(67928),r(26036),r(30996),r(43474),r(3174),r(16721),r(71177),r(26892),r(93851),r(94281),r(78560),r(88415),r(23564)},29127:(e,t,r)=>{var n,i=r(28413);function a(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function s(){return new a(null)}function o(e,t,r,n,i,a){for(var s=16383&t,o=t>>14;--a>=0;){var c=16383&this.data[e],u=this.data[e++]>>14,f=o*c+u*s;i=((c=s*c+((16383&f)<<14)+r.data[n]+i)>>28)+(f>>14)+o*u,r.data[n++]=268435455&c}return i}e.exports=i.jsbn=i.jsbn||{},i.jsbn.BigInteger=a,"undefined"==typeof navigator?(a.prototype.am=o,n=28):"Microsoft Internet Explorer"==navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(var s=32767&t,o=t>>15;--a>=0;){var c=32767&this.data[e],u=this.data[e++]>>15,f=o*c+u*s;i=((c=s*c+((32767&f)<<15)+r.data[n]+(1073741823&i))>>>30)+(f>>>15)+o*u+(i>>>30),r.data[n++]=1073741823&c}return i},n=30):"Netscape"!=navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var s=t*this.data[e++]+r.data[n]+i;i=Math.floor(s/67108864),r.data[n++]=67108863&s}return i},n=26):(a.prototype.am=o,n=28),a.prototype.DB=n,a.prototype.DM=(1<>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function g(e){this.m=e}function y(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,t+=16),255&e||(e>>=8,t+=8),15&e||(e>>=4,t+=4),3&e||(e>>=2,t+=2),1&e||++t,t}function E(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function C(){}function A(e){return e}function B(e){this.r2=s(),this.q3=s(),a.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}g.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},g.prototype.revert=function(e){return e},g.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},g.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},g.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.convert=function(e){var t=s();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(a.ZERO)>0&&this.m.subTo(t,t),t},y.prototype.revert=function(e){var t=s();return e.copyTo(t),this.reduce(t),t},y.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},a.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},a.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},a.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,s=0;--n>=0;){var o=8==r?255&e[n]:l(e,n);o<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==s?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB))}8==r&&128&e[0]&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==e;)--this.t},a.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},a.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t.data[r+s+1]=this.data[r]>>i|o,o=(this.data[r]&a)<=0;--r)t.data[r]=0;t.data[s]=o,t.t=this.t+s+1,t.s=this.s,t.clamp()},a.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<>n;for(var s=r+1;s>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},a.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i=0;)e.data[r]=0;for(r=0;r=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},a.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(f,o),i.lShiftTo(f,r)):(n.copyTo(o),i.copyTo(r));var h=o.t,l=o.data[h-1];if(0!=l){var d=l*(1<1?o.data[h-2]>>this.F2:0),g=this.FV/d,y=(1<=0&&(r.data[r.t++]=1,r.subTo(w,r)),a.ONE.dlShiftTo(h,w),w.subTo(o,o);o.t=0;){var S=r.data[--m]==l?this.DM:Math.floor(r.data[m]*g+(r.data[m-1]+v)*y);if((r.data[m]+=o.am(0,S,r,b,0,h))0&&r.rShiftTo(f,r),c<0&&a.ZERO.subTo(r,r)}}},a.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},a.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},a.prototype.exp=function(e,t){if(e>4294967295||e<1)return a.ONE;var r=s(),n=s(),i=t.convert(this),o=p(e)-1;for(i.copyTo(r);--o>=0;)if(t.sqrTo(r,n),(e&1<0)t.mulTo(n,i,r);else{var c=r;r=n,n=c}return t.revert(r)},a.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<0)for(o>o)>0&&(i=!0,a=h(r));s>=0;)o>(o+=this.DB-t)):(r=this.data[s]>>(o-=t)&n,o<=0&&(o+=this.DB,--s)),r>0&&(i=!0),i&&(a+=h(r));return i?a:"0"},a.prototype.negate=function(){var e=s();return a.ZERO.subTo(this,e),e},a.prototype.abs=function(){return this.s<0?this.negate():this},a.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},a.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+p(this.data[this.t-1]^this.s&this.DM)},a.prototype.mod=function(e){var t=s();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(a.ZERO)>0&&e.subTo(t,t),t},a.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new g(t):new y(t),this.exp(e,r)},a.ZERO=d(0),a.ONE=d(1),C.prototype.convert=A,C.prototype.revert=A,C.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},C.prototype.sqrTo=function(e,t){e.squareTo(t)},B.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=s();return e.copyTo(t),this.reduce(t),t},B.prototype.revert=function(e){return e},B.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},B.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},B.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],T=(1<<26)/x[x.length-1];a.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},a.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=d(r),i=s(),a=s(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(e).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(e)+o},a.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,s=0,o=0,c=0;c=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(o,0)),i&&a.ZERO.subTo(this,this)},a.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(a.ONE.shiftLeft(e-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(a.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},a.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},a.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},a.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},a.prototype.millerRabin=function(e){var t=this.subtract(a.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),s={nextBytes:function(e){for(var t=0;t=0);var c=n.modPow(i,this);if(0!=c.compareTo(a.ONE)&&0!=c.compareTo(t)){for(var u=1;u++>24},a.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},a.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},a.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<=0;)n<8?(r=(this.data[e]&(1<>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),128&r&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},a.prototype.equals=function(e){return 0==this.compareTo(e)},a.prototype.min=function(e){return this.compareTo(e)<0?this:e},a.prototype.max=function(e){return this.compareTo(e)>0?this:e},a.prototype.and=function(e){var t=s();return this.bitwiseTo(e,v,t),t},a.prototype.or=function(e){var t=s();return this.bitwiseTo(e,m,t),t},a.prototype.xor=function(e){var t=s();return this.bitwiseTo(e,b,t),t},a.prototype.andNot=function(e){var t=s();return this.bitwiseTo(e,w,t),t},a.prototype.not=function(){for(var e=s(),t=0;t=this.t?0!=this.s:!!(this.data[t]&1<1){var h=s();for(n.sqrTo(o[1],h);c<=f;)o[c]=s(),n.mulTo(h,o[c-2],o[c]),c+=2}var l,v,m=e.t-1,b=!0,w=s();for(i=p(e.data[m])-1;m>=0;){for(i>=u?l=e.data[m]>>i-u&f:(l=(e.data[m]&(1<0&&(l|=e.data[m-1]>>this.DB+i-u)),c=r;!(1&l);)l>>=1,--c;if((i-=c)<0&&(i+=this.DB,--m),b)o[l].copyTo(a),b=!1;else{for(;c>1;)n.sqrTo(a,w),n.sqrTo(w,a),c-=2;c>0?n.sqrTo(a,w):(v=a,a=w,w=v),n.mulTo(w,o[l],a)}for(;m>=0&&!(e.data[m]&1<=0?(r.subTo(n,r),t&&i.subTo(o,i),s.subTo(c,s)):(n.subTo(r,n),t&&o.subTo(i,o),c.subTo(s,c))}return 0!=n.compareTo(a.ONE)?a.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c},a.prototype.pow=function(e){return this.exp(e,new C)},a.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},a.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=x[x.length-1]){for(t=0;t{var n=r(28413);r(23564),r(93851),r(29127),e.exports=n.kem=n.kem||{};var i=n.jsbn.BigInteger;function a(e,t,r,i){e.generate=function(e,a){for(var s=new n.util.ByteBuffer,o=Math.ceil(a/i)+r,c=new n.util.ByteBuffer,u=r;u0&&(s=n.util.fillString(String.fromCharCode(0),c)+s),{encapsulation:t.encrypt(s,"NONE"),key:e.generate(s,a)}},decrypt:function(t,r,n){var i=t.decrypt(r,"NONE");return e.generate(i,n)}}},n.kem.kdf1=function(e,t){a(this,e,0,t||e.digestLength)},n.kem.kdf2=function(e,t){a(this,e,1,t||e.digestLength)}},54728:(e,t,r)=>{var n=r(28413);r(23564),e.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var i={},a=[],s=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var o=0;o{e.exports=r(25853),r(22926),r(13417),r(24955),r(39194)},25853:(e,t,r)=>{var n=r(28413);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},22926:(e,t,r)=>{var n=r(28413);r(25853),r(23564);var i=e.exports=n.md5=n.md5||{};n.md.md5=n.md.algorithms.md5=i,i.create=function(){u||function(){a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],o=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],c=new Array(64);for(var e=0;e<64;++e)c[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));u=!0}();var e=null,t=n.util.createBuffer(),r=new Array(16),i={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a>>0,o>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=o[1],o[1]=o[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(a),f(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var o=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(a.substr(0,i.blockLength-o));for(var c,u=0,h=i.fullMessageLength.length-1;h>=0;--h)u=(c=8*i.fullMessageLength[h]+u)/4294967296>>>0,s.putInt32Le(c>>>0);var l={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};f(l,r,s);var d=n.util.createBuffer();return d.putInt32Le(l.h0),d.putInt32Le(l.h1),d.putInt32Le(l.h2),d.putInt32Le(l.h3),d},i};var a=null,s=null,o=null,c=null,u=!1;function f(e,t,r){for(var n,i,a,u,f,h,l,d=r.length();d>=64;){for(i=e.h0,a=e.h1,u=e.h2,f=e.h3,l=0;l<16;++l)t[l]=r.getInt32Le(),n=i+(f^a&(u^f))+c[l]+t[l],i=f,f=u,u=a,a+=n<<(h=o[l])|n>>>32-h;for(;l<32;++l)n=i+(u^f&(a^u))+c[l]+t[s[l]],i=f,f=u,u=a,a+=n<<(h=o[l])|n>>>32-h;for(;l<48;++l)n=i+(a^u^f)+c[l]+t[s[l]],i=f,f=u,u=a,a+=n<<(h=o[l])|n>>>32-h;for(;l<64;++l)n=i+(u^(a|~f))+c[l]+t[s[l]],i=f,f=u,u=a,a+=n<<(h=o[l])|n>>>32-h;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+u|0,e.h3=e.h3+f|0,d-=64}}},22328:(e,t,r)=>{var n=r(28413);r(81321),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},81321:(e,t,r)=>{var n=r(28413);r(23564),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var i=new n.util.ByteBuffer,a=Math.ceil(r/e.digestLength),s=0;s{var n=r(28413);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function a(e,t){i[e]=t,i[t]=e}function s(e,t){i[e]=t}a("1.2.840.113549.1.1.1","rsaEncryption"),a("1.2.840.113549.1.1.4","md5WithRSAEncryption"),a("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),a("1.2.840.113549.1.1.7","RSAES-OAEP"),a("1.2.840.113549.1.1.8","mgf1"),a("1.2.840.113549.1.1.9","pSpecified"),a("1.2.840.113549.1.1.10","RSASSA-PSS"),a("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),a("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),a("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),a("1.3.101.112","EdDSA25519"),a("1.2.840.10040.4.3","dsa-with-sha1"),a("1.3.14.3.2.7","desCBC"),a("1.3.14.3.2.26","sha1"),a("1.3.14.3.2.29","sha1WithRSASignature"),a("2.16.840.1.101.3.4.2.1","sha256"),a("2.16.840.1.101.3.4.2.2","sha384"),a("2.16.840.1.101.3.4.2.3","sha512"),a("2.16.840.1.101.3.4.2.4","sha224"),a("2.16.840.1.101.3.4.2.5","sha512-224"),a("2.16.840.1.101.3.4.2.6","sha512-256"),a("1.2.840.113549.2.2","md2"),a("1.2.840.113549.2.5","md5"),a("1.2.840.113549.1.7.1","data"),a("1.2.840.113549.1.7.2","signedData"),a("1.2.840.113549.1.7.3","envelopedData"),a("1.2.840.113549.1.7.4","signedAndEnvelopedData"),a("1.2.840.113549.1.7.5","digestedData"),a("1.2.840.113549.1.7.6","encryptedData"),a("1.2.840.113549.1.9.1","emailAddress"),a("1.2.840.113549.1.9.2","unstructuredName"),a("1.2.840.113549.1.9.3","contentType"),a("1.2.840.113549.1.9.4","messageDigest"),a("1.2.840.113549.1.9.5","signingTime"),a("1.2.840.113549.1.9.6","counterSignature"),a("1.2.840.113549.1.9.7","challengePassword"),a("1.2.840.113549.1.9.8","unstructuredAddress"),a("1.2.840.113549.1.9.14","extensionRequest"),a("1.2.840.113549.1.9.20","friendlyName"),a("1.2.840.113549.1.9.21","localKeyId"),a("1.2.840.113549.1.9.22.1","x509Certificate"),a("1.2.840.113549.1.12.10.1.1","keyBag"),a("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),a("1.2.840.113549.1.12.10.1.3","certBag"),a("1.2.840.113549.1.12.10.1.4","crlBag"),a("1.2.840.113549.1.12.10.1.5","secretBag"),a("1.2.840.113549.1.12.10.1.6","safeContentsBag"),a("1.2.840.113549.1.5.13","pkcs5PBES2"),a("1.2.840.113549.1.5.12","pkcs5PBKDF2"),a("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),a("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),a("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),a("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),a("1.2.840.113549.2.7","hmacWithSHA1"),a("1.2.840.113549.2.8","hmacWithSHA224"),a("1.2.840.113549.2.9","hmacWithSHA256"),a("1.2.840.113549.2.10","hmacWithSHA384"),a("1.2.840.113549.2.11","hmacWithSHA512"),a("1.2.840.113549.3.7","des-EDE3-CBC"),a("2.16.840.1.101.3.4.1.2","aes128-CBC"),a("2.16.840.1.101.3.4.1.22","aes192-CBC"),a("2.16.840.1.101.3.4.1.42","aes256-CBC"),a("2.5.4.3","commonName"),a("2.5.4.4","surname"),a("2.5.4.5","serialNumber"),a("2.5.4.6","countryName"),a("2.5.4.7","localityName"),a("2.5.4.8","stateOrProvinceName"),a("2.5.4.9","streetAddress"),a("2.5.4.10","organizationName"),a("2.5.4.11","organizationalUnitName"),a("2.5.4.12","title"),a("2.5.4.13","description"),a("2.5.4.15","businessCategory"),a("2.5.4.17","postalCode"),a("2.5.4.42","givenName"),a("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),a("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),a("2.16.840.1.113730.1.1","nsCertType"),a("2.16.840.1.113730.1.13","nsComment"),s("2.5.29.1","authorityKeyIdentifier"),s("2.5.29.2","keyAttributes"),s("2.5.29.3","certificatePolicies"),s("2.5.29.4","keyUsageRestriction"),s("2.5.29.5","policyMapping"),s("2.5.29.6","subtreesConstraint"),s("2.5.29.7","subjectAltName"),s("2.5.29.8","issuerAltName"),s("2.5.29.9","subjectDirectoryAttributes"),s("2.5.29.10","basicConstraints"),s("2.5.29.11","nameConstraints"),s("2.5.29.12","policyConstraints"),s("2.5.29.13","basicConstraints"),a("2.5.29.14","subjectKeyIdentifier"),a("2.5.29.15","keyUsage"),s("2.5.29.16","privateKeyUsagePeriod"),a("2.5.29.17","subjectAltName"),a("2.5.29.18","issuerAltName"),a("2.5.29.19","basicConstraints"),s("2.5.29.20","cRLNumber"),s("2.5.29.21","cRLReason"),s("2.5.29.22","expirationDate"),s("2.5.29.23","instructionCode"),s("2.5.29.24","invalidityDate"),s("2.5.29.25","cRLDistributionPoints"),s("2.5.29.26","issuingDistributionPoint"),s("2.5.29.27","deltaCRLIndicator"),s("2.5.29.28","issuingDistributionPoint"),s("2.5.29.29","certificateIssuer"),s("2.5.29.30","nameConstraints"),a("2.5.29.31","cRLDistributionPoints"),a("2.5.29.32","certificatePolicies"),s("2.5.29.33","policyMappings"),s("2.5.29.34","policyConstraints"),a("2.5.29.35","authorityKeyIdentifier"),s("2.5.29.36","policyConstraints"),a("2.5.29.37","extKeyUsage"),s("2.5.29.46","freshestCRL"),s("2.5.29.54","inhibitAnyPolicy"),a("1.3.6.1.4.1.11129.2.4.2","timestampList"),a("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),a("1.3.6.1.5.5.7.3.1","serverAuth"),a("1.3.6.1.5.5.7.3.2","clientAuth"),a("1.3.6.1.5.5.7.3.3","codeSigning"),a("1.3.6.1.5.5.7.3.4","emailProtection"),a("1.3.6.1.5.5.7.3.8","timeStamping")},76259:(e,t,r)=>{var n=r(28413);if(r(72057),r(25129),r(35690),r(25853),r(12889),r(59065),r(67928),r(93851),r(94281),r(72112),r(23564),void 0===i)var i=n.jsbn.BigInteger;var a=n.asn1,s=n.pki=n.pki||{};e.exports=s.pbe=n.pbe=n.pbe||{};var o=s.oids,c={name:"EncryptedPrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},u={name:"PBES2Algorithms",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},f={name:"pkcs-12PbeParams",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"iterations"}]};function h(e,t){return e.start().update(t).digest().getBytes()}function l(e){var t;if(e){if(!(t=s.oids[a.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return d(t)}function d(e){var t=n.md;switch(e){case"hmacWithSHA224":t=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}s.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,c,u,f=n.random.getBytesSync(r.saltSize),h=r.count,l=a.integerToDer(h);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var p,g,y;switch(r.algorithm){case"aes128":i=16,p=16,g=o["aes128-CBC"],y=n.aes.createEncryptionCipher;break;case"aes192":i=24,p=16,g=o["aes192-CBC"],y=n.aes.createEncryptionCipher;break;case"aes256":i=32,p=16,g=o["aes256-CBC"],y=n.aes.createEncryptionCipher;break;case"des":i=8,p=8,g=o.desCBC,y=n.des.createEncryptionCipher;break;default:throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E}var v="hmacWith"+r.prfAlgorithm.toUpperCase(),m=d(v),b=n.pkcs5.pbkdf2(t,f,h,i,m),w=n.random.getBytesSync(p);(C=y(b)).start(w),C.update(a.toDer(e)),C.finish(),u=C.output.getBytes();var S=function(e,t,r,i){var o=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,e),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,t.getBytes())]);return"hmacWithSHA1"!==i&&o.value.push(a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s.oids[i]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")])),o}(f,l,i,v);c=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o.pkcs5PBES2).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o.pkcs5PBKDF2).getBytes()),S]),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(g).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,w)])])])}else{var E;if("3des"!==r.algorithm)throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E;i=24;var C,A=new n.util.ByteBuffer(f);b=s.pbe.generatePkcs12Key(t,A,1,h,i),w=s.pbe.generatePkcs12Key(t,A,2,h,i),(C=n.des.createEncryptionCipher(b)).start(w),C.update(a.toDer(e)),C.finish(),u=C.output.getBytes(),c=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,f),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,l.getBytes())])])}return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[c,a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,u)])},s.decryptPrivateKeyInfo=function(e,t){var r=null,i={},o=[];if(!a.validate(e,c,i,o)){var u=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw u.errors=o,u}var f=a.derToOid(i.encryptionOid),h=s.pbe.getCipher(f,i.encryptionParams,t),l=n.util.createBuffer(i.encryptedData);return h.update(l),h.finish()&&(r=a.fromDer(h.output)),r},s.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:a.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},s.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return a.fromDer(t.body)},s.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=s.wrapRsaPrivateKey(s.privateKeyToAsn1(e));return i=s.encryptPrivateKeyInfo(i,t,r),s.encryptedPrivateKeyToPem(i)}var o,c,u,f;switch(r.algorithm){case"aes128":o="AES-128-CBC",u=16,c=n.random.getBytesSync(16),f=n.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",u=24,c=n.random.getBytesSync(16),f=n.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",u=32,c=n.random.getBytesSync(16),f=n.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",u=24,c=n.random.getBytesSync(8),f=n.des.createEncryptionCipher;break;case"des":o="DES-CBC",u=8,c=n.random.getBytesSync(8),f=n.des.createEncryptionCipher;break;default:var h=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw h.algorithm=r.algorithm,h}var l=f(n.pbe.opensslDeriveBytes(t,c.substr(0,8),u));l.start(c),l.update(a.toDer(s.privateKeyToAsn1(e))),l.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:n.util.bytesToHex(c).toUpperCase()},body:l.output.getBytes()};return n.pem.encode(d)},s.decryptRsaPrivateKey=function(e,t){var r=null,i=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(u=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=u,u;if(i.procType&&"ENCRYPTED"===i.procType.type){var o,c;switch(i.dekInfo.algorithm){case"DES-CBC":o=8,c=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":o=24,c=n.des.createDecryptionCipher;break;case"AES-128-CBC":o=16,c=n.aes.createDecryptionCipher;break;case"AES-192-CBC":o=24,c=n.aes.createDecryptionCipher;break;case"AES-256-CBC":o=32,c=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":o=5,c=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":o=8,c=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":o=16,c=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var u;throw(u=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,u}var f=n.util.hexToBytes(i.dekInfo.parameters),h=c(n.pbe.opensslDeriveBytes(t,f.substr(0,8),o));if(h.start(f),h.update(n.util.createBuffer(i.body)),!h.finish())return r;r=h.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?s.decryptPrivateKeyInfo(a.fromDer(r),t):a.fromDer(r))&&(r=s.privateKeyFromAsn1(r)),r},s.pbe.generatePkcs12Key=function(e,t,r,i,a,s){var o,c;if(null==s){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');s=n.md.sha1.create()}var u=s.digestLength,f=s.blockLength,h=new n.util.ByteBuffer,l=new n.util.ByteBuffer;if(null!=e){for(c=0;c=0;c--)F>>=8,F+=B.at(c)+I.at(c),I.setAt(c,255&F);T.putBuffer(I)}w=T,h.putBuffer(C)}return h.truncate(h.length()-a),h},s.pbe.getCipher=function(e,t,r){switch(e){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(e,t,r);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},s.pbe.getCipherForPBES2=function(e,t,r){var i,o={},c=[];if(!a.validate(t,u,o,c))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=c,i;if((e=a.derToOid(o.kdfOid))!==s.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=a.derToOid(o.encOid))!==s.oids["aes128-CBC"]&&e!==s.oids["aes192-CBC"]&&e!==s.oids["aes256-CBC"]&&e!==s.oids["des-EDE3-CBC"]&&e!==s.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var f,h,d=o.kdfSalt,p=n.util.createBuffer(o.kdfIterationCount);switch(p=p.getInt(p.length()<<3),s.oids[e]){case"aes128-CBC":f=16,h=n.aes.createDecryptionCipher;break;case"aes192-CBC":f=24,h=n.aes.createDecryptionCipher;break;case"aes256-CBC":f=32,h=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":f=24,h=n.des.createDecryptionCipher;break;case"desCBC":f=8,h=n.des.createDecryptionCipher}var g=l(o.prfOid),y=n.pkcs5.pbkdf2(r,d,p,f,g),v=o.encIv,m=h(y);return m.start(v),m},s.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},o=[];if(!a.validate(t,f,i,o))throw(g=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=o,g;var c,u,h,d=n.util.createBuffer(i.salt),p=n.util.createBuffer(i.iterations);switch(p=p.getInt(p.length()<<3),e){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,u=8,h=n.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,u=8,h=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var g;throw(g=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,g}var y=l(i.prfOid),v=s.pbe.generatePkcs12Key(r,d,1,p,c,y);return y.start(),h(v,s.pbe.generatePkcs12Key(r,d,2,p,u,y))},s.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var a=[h(i,e+t)],s=16,o=1;s{var n=r(42363).Buffer,i=r(28413);r(77827),r(25853),r(23564);var a,s=i.pkcs5=i.pkcs5||{};i.util.isNodejs&&!i.options.usePureJavaScript&&(a=r(50310)),e.exports=i.pbkdf2=s.pbkdf2=function(e,t,r,s,o,c){if("function"==typeof o&&(c=o,o=null),i.util.isNodejs&&!i.options.usePureJavaScript&&a.pbkdf2&&(null===o||"object"!=typeof o)&&(a.pbkdf2Sync.length>4||!o||"sha1"===o))return"string"!=typeof o&&(o="sha1"),e=n.from(e,"binary"),t=n.from(t,"binary"),c?4===a.pbkdf2Sync.length?a.pbkdf2(e,t,r,s,(function(e,t){if(e)return c(e);c(null,t.toString("binary"))})):a.pbkdf2(e,t,r,s,o,(function(e,t){if(e)return c(e);c(null,t.toString("binary"))})):4===a.pbkdf2Sync.length?a.pbkdf2Sync(e,t,r,s).toString("binary"):a.pbkdf2Sync(e,t,r,s,o).toString("binary");if(null==o&&(o="sha1"),"string"==typeof o){if(!(o in i.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=i.md[o].create()}var u=o.digestLength;if(s>4294967295*u){var f=new Error("Derived key is too long.");if(c)return c(f);throw f}var h=Math.ceil(s/u),l=s-(h-1)*u,d=i.hmac.create();d.start(o,e);var p,g,y,v="";if(!c){for(var m=1;m<=h;++m){d.start(null,null),d.update(t),d.update(i.util.int32ToBytes(m)),p=y=d.digest().getBytes();for(var b=2;b<=r;++b)d.start(null,null),d.update(y),g=d.digest().getBytes(),p=i.util.xorBytes(p,g,u),y=g;v+=mh)return c(null,v);d.start(null,null),d.update(t),d.update(i.util.int32ToBytes(m)),p=y=d.digest().getBytes(),b=2,S()}function S(){if(b<=r)return d.start(null,null),d.update(y),g=d.digest().getBytes(),p=i.util.xorBytes(p,g,u),y=g,++b,i.util.setImmediate(S);v+=m{var n=r(28413);r(23564);var i=e.exports=n.pem=n.pem||{};function a(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i65&&-1!==s){var o=t[s];","===o?(++s,t=t.substr(0,s)+"\r\n "+t.substr(s)):t=t.substr(0,s)+"\r\n"+o+t.substr(s+1),a=i-s-1,s=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(s=i);return t}function s(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=a(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=a(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=a(r)),e.headers)for(var s=0;s{var n=r(28413);r(23564),r(93851),r(13417);var i=e.exports=n.pkcs1=n.pkcs1||{};function a(e,t,r){r||(r=n.md.sha1.create());for(var i="",a=Math.ceil(t/r.digestLength),s=0;s>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(e+o),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,s,o,c;"string"==typeof r?(i=r,s=arguments[3]||void 0,o=arguments[4]||void 0):r&&(i=r.label||void 0,s=r.seed||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),o?o.start():o=n.md.sha1.create(),c||(c=o);var u=Math.ceil(e.n.bitLength()/8),f=u-2*o.digestLength-2;if(t.length>f)throw(y=new Error("RSAES-OAEP input message length is too long.")).length=t.length,y.maxLength=f,y;i||(i=""),o.update(i,"raw");for(var h=o.digest(),l="",d=f-t.length,p=0;p{var n=r(28413);r(25129),r(77827),r(12889),r(56435),r(76259),r(93851),r(72112),r(13417),r(23564),r(14284);var i=n.asn1,a=n.pki,s=e.exports=n.pkcs12=n.pkcs12||{},o={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},c={name:"PFX",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},o,{name:"PFX.macData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},u={name:"SafeBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},f={name:"Attribute",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,capture:"values"}]},h={name:"CertBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:i.Class.UNIVERSAL,type:i.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function l(e,t,r,n){for(var i=[],a=0;a=0&&i.push(o):i.push(o))}return i}function d(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r0&&(c=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,h));var l=[],d=[];null!==t&&(d=n.util.isArray(t)?t:[t]);for(var p=[],g=0;g0){var b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,p),w=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(b).getBytes())])]);l.push(w)}var S=null;if(null!==e){var E=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));S=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[E]),c]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[a.encryptPrivateKeyInfo(E,r,o)]),c]);var C=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[S]),A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(C).getBytes())])]);l.push(A)}var B,x=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,l);if(o.useMac){var T=n.md.sha1.create(),I=new n.util.ByteBuffer(n.random.getBytes(o.saltSize)),F=o.count,k=(e=s.generateKey(r,I,3,F,20),n.hmac.create());k.start(T,e),k.update(i.toDer(x).getBytes());var R=k.getMac();B=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,R.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,I.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(F).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(x).getBytes())])]),B])},s.generateKey=n.pbe.generatePkcs12Key},43474:(e,t,r)=>{var n=r(28413);r(72057),r(25129),r(35690),r(12889),r(67928),r(56435),r(93851),r(23564),r(14284);var i=n.asn1,a=e.exports=n.pkcs7=n.pkcs7||{};function s(e){var t={},r=[];if(!i.validate(e,a.asn1.recipientInfoValidator,t,r)){var s=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw s.errors=r,s}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function o(e){for(var t,r=[],a=0;a0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),a=0;a=r&&s0&&s.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),a.length>0&&s.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,a)),s.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),s])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var a=t.certificate;"string"==typeof a&&(a=n.pki.certificateFromPem(a)),r=a.issuer.attributes,i=a.serialNumber}var s=t.key;if(!s)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof s&&(s=n.pki.privateKeyFromPem(s));var o=t.digestAlgorithm||n.pki.oids.sha1;switch(o){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+o)}var c=t.authenticatedAttributes||[];if(c.length>0){for(var u=!1,f=!1,h=0;h{var n=r(28413);r(25129),r(23564);var i=n.asn1,a=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=a;var s={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};a.contentInfoValidator=s;var o={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};a.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(o)},a.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(o)};var c={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};a.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},s,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[c]}]},a.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},3174:(e,t,r)=>{var n=r(28413);r(25129),r(12889),r(76259),r(67928),r(59065),r(30996),r(26892),r(72112),r(23564),r(14284);var i=n.asn1,a=e.exports=n.pki=n.pki||{};a.pemToDer=function(e){var t=n.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return n.util.createBuffer(t.body)},a.privateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var s=i.fromDer(t.body);return a.privateKeyFromAsn1(s)},a.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(a.privateKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:i.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})}},16721:(e,t,r)=>{var n=r(28413);r(23564),r(29127),r(93851),function(){if(n.prime)e.exports=n.prime;else{var t=e.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],a=new r(null);a.fromInt(30);var s=function(e,t){return e|t};t.generateProbablePrime=function(e,t,i){"function"==typeof t&&(i=t,t={});var a=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof a&&(a={name:a}),a.options=a.options||{};var s=t.prng||n.random,c={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;re&&(s=u(e,t));var d=s.toString(16);i.target.postMessage({hex:d,workLoad:f}),s.dAddOffset(h,0)}}}d()}(e,t,i,a):o(e,t,i,a)}(e,c,a.options,i);throw new Error("Invalid prime generation algorithm: "+a.name)}}function o(e,t,r,n){var i=u(e,t),a=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(i.bitLength());"millerRabinTests"in r&&(a=r.millerRabinTests);var s=10;"maxBlockTime"in r&&(s=r.maxBlockTime),c(i,e,t,0,a,s,n)}function c(e,t,r,a,s,o,f){var h=+new Date;do{if(e.bitLength()>t&&(e=u(t,r)),e.isProbablePrime(s))return f(null,e);e.dAddOffset(i[a++%8],0)}while(o<0||+new Date-h{var n=r(35208),i=r(28413);r(23564);var a=null;!i.util.isNodejs||i.options.usePureJavaScript||n.versions["node-webkit"]||(a=r(50310)),(e.exports=i.prng=i.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,n=new Array(32),s=0;s<32;++s)n[s]=r.create();function o(){if(t.pools[0].messageLength>=32)return c();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),c()}function c(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function u(e){var t=null,r=i.util.globalScope,n=r.crypto||r.msCrypto;n&&n.getRandomValues&&(t=function(e){return n.getRandomValues(e)});var a=i.util.createBuffer();if(t)for(;a.length()>16)))<<16,l=4294967295&(f=(2147483647&(f+=u>>15))+(f>>31)),c=0;c<3;++c)h=l>>>(c<<3),h^=Math.floor(256*Math.random()),a.putByte(255&h);return a.getBytes(e)}return t.pools=n,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var n=t.plugin.cipher,a=t.plugin.increment,s=t.plugin.formatKey,o=t.plugin.formatSeed,u=i.util.createBuffer();t.key=null,function f(h){if(h)return r(h);if(u.length()>=e)return r(null,u.getBytes(e));if(t.generated>1048575&&(t.key=null),null===t.key)return i.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return c(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),c(),e()}))}(f)}));var l=n(t.key,t.seed);t.generated+=l.length,u.putBytes(l),t.key=s(n(t.key,a(t.seed))),t.seed=o(n(t.key,t.seed)),i.util.setImmediate(f)}()},t.generateSync=function(e){var r=t.plugin.cipher,n=t.plugin.increment,a=t.plugin.formatKey,s=t.plugin.formatSeed;t.key=null;for(var c=i.util.createBuffer();c.length()1048575&&(t.key=null),null===t.key&&o();var u=r(t.key,t.seed);t.generated+=u.length,c.putBytes(u),t.key=a(r(t.key,n(t.seed))),t.seed=s(r(t.key,t.seed))}return c.getBytes(e)},a?(t.seedFile=function(e,t){a.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return a.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,u(e))}catch(e){t(e)}},t.seedFileSync=u),t.collect=function(e){for(var r=e.length,n=0;n>i&255);t.collect(n)},t.registerWorker=function(e){e===self?t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})}:e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))},t}},26892:(e,t,r)=>{var n=r(28413);r(93851),r(23564),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,a=r.digestLength,s=e.salt||null;if("string"==typeof s&&(s=n.util.createBuffer(s)),"saltLength"in e)t=e.saltLength;else{if(null===s)throw new Error("Salt length not specified or specific salt not given.");t=s.length()}if(null!==s&&s.length()!==t)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||n.random;return{encode:function(e,c){var u,f,h=c-1,l=Math.ceil(h/8),d=e.digest().getBytes();if(l>8*l-h&255;return(w=String.fromCharCode(w.charCodeAt(0)&~S)+w.substr(1))+g+String.fromCharCode(188)},verify:function(e,s,o){var c,u=o-1,f=Math.ceil(u/8);if(s=s.substr(-f),f>8*f-u&255;if(l.charCodeAt(0)&p)throw new Error("Bits beyond keysize not zero as expected.");var g=i.generate(d,h),y="";for(c=0;c{var n=r(28413);r(72057),r(24955),r(71177),r(23564),n.random&&n.random.getBytes?e.exports=n.random:function(t){var r={},i=new Array(4),a=n.util.createBuffer();function s(){var e=n.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return n.aes._updateBlock(e,t,i,!1),a.putInt32(i[0]),a.putInt32(i[1]),a.putInt32(i[2]),a.putInt32(i[3]),a.getBytes()},r.increment=function(e){return++e[3],e},r.md=n.md.sha256;var o=s(),c=null,u=n.util.globalScope,f=u.crypto||u.msCrypto;if(f&&f.getRandomValues&&(c=function(e){return f.getRandomValues(e)}),n.options.usePureJavaScript||!n.util.isNodejs&&!c){if("undefined"==typeof window||window.document,o.collectInt(+new Date,32),"undefined"!=typeof navigator){var h="";for(var l in navigator)try{"string"==typeof navigator[l]&&(h+=navigator[l])}catch(e){}o.collect(h),h=null}t&&(t().mousemove((function(e){o.collectInt(e.clientX,16),o.collectInt(e.clientY,16)})),t().keypress((function(e){o.collectInt(e.charCode,8)})))}if(n.random)for(var l in o)n.random[l]=o[l];else n.random=o;n.random.createInstance=s,e.exports=n.random}(!1)},94281:(e,t,r)=>{var n=r(28413);r(23564);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],a=[1,2,3,5],s=function(e,t){return e<>16-t},o=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,a=e,s=e.length(),o=t,c=Math.ceil(o/8),u=255>>(7&o);for(r=s;r<128;r++)a.putByte(i[a.at(r-1)+a.at(r-s)&255]);for(a.setAt(128-c,i[a.at(128-c)&u]),r=127-c;r>=0;r--)a.setAt(r,i[a.at(r+1)^a.at(r+c)]);return a};var c=function(e,t,r){var i,c,u,f,h=!1,l=null,d=null,p=null,g=[];for(e=n.rc2.expandKey(e,t),u=0;u<64;u++)g.push(e.getInt16Le());r?(i=function(e){for(u=0;u<4;u++)e[u]+=g[f]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),e[u]=s(e[u],a[u]),f++},c=function(e){for(u=0;u<4;u++)e[u]+=g[63&e[(u+3)%4]]}):(i=function(e){for(u=3;u>=0;u--)e[u]=o(e[u],a[u]),e[u]-=g[f]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),f--},c=function(e){for(u=3;u>=0;u--)e[u]-=g[63&e[(u+3)%4]]});var y=function(e){var t=[];for(u=0;u<4;u++){var n=l.getInt16Le();null!==p&&(r?n^=p.getInt16Le():p.putInt16Le(n)),t.push(65535&n)}f=r?0:63;for(var i=0;i=8;)y([[5,i],[1,c],[6,i],[1,c],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,l,!r);else{var n=8===l.length()?8:8-l.length();l.fillWithByte(n,n)}if(t&&(h=!0,v.update()),!r&&(t=0===l.length()))if(e)t=e(8,d,!r);else{var i=d.length(),a=d.at(i-1);a>i?t=!1:d.truncate(a)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return c(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return c(e,t,!1)}},72112:(e,t,r)=>{var n=r(28413);if(r(25129),r(29127),r(12889),r(26036),r(16721),r(93851),r(23564),void 0===i)var i=n.jsbn.BigInteger;var a=n.util.isNodejs?r(50310):null,s=n.asn1,o=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var c=n.pki,u=[6,4,2,4,2,4,6,2],f={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},h={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},l={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},d=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},p={name:"DigestInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:s.Class.UNIVERSAL,type:s.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},g=function(e){var t;if(!(e.algorithm in c.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=c.oids[e.algorithm];var n=s.oidToDer(t).getBytes(),i=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),a=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);a.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,n)),a.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var o=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(o),s.toDer(i).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var a;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{a=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(a.compareTo(t.n)>=0||!a.gcd(t.n).equals(i.ONE));for(var s=(e=e.multiply(a.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),o=e.mod(t.q).modPow(t.dQ,t.q);s.compareTo(o)<0;)s=s.add(t.p);var c=s.subtract(o).multiply(t.qInv).mod(t.p).multiply(t.q).add(o);return c.multiply(a.modInverse(t.n)).mod(t.n)};function v(e,t,r){var i=n.util.createBuffer(),a=Math.ceil(t.n.bitLength()/8);if(e.length>a-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=e.length,s.max=a-11,s}i.putByte(0),i.putByte(r);var o,c=a-3-e.length;if(0===r||1===r){o=0===r?0:255;for(var u=0;u0;){var f=0,h=n.random.getBytes(c);for(u=0;u1;){if(255!==s.getByte()){--s.read;break}++u}else if(2===c)for(u=0;s.length()>1;){if(0===s.getByte()){--s.read;break}++u}if(0!==s.getByte()||u!==a-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function b(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return!(r.length>1)||(0!==r.charCodeAt(0)||128&r.charCodeAt(1))&&(255!==r.charCodeAt(0)||128&~r.charCodeAt(1))?r:r.substr(1)}function w(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function S(e){return n.util.isNodejs&&"function"==typeof a[e]}function E(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.crypto&&"object"==typeof o.globalScope.crypto.subtle&&"function"==typeof o.globalScope.crypto.subtle[e]}function C(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.msCrypto&&"object"==typeof o.globalScope.msCrypto.subtle&&"function"==typeof o.globalScope.msCrypto.subtle[e]}function A(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i0;)f.putByte(0),--h;return f.putBytes(n.util.hexToBytes(u)),f.getBytes()},c.rsa.decrypt=function(e,t,r,a){var s=Math.ceil(t.n.bitLength()/8);if(e.length!==s){var o=new Error("Encrypted message length is invalid.");throw o.length=e.length,o.expected=s,o}var c=new i(n.util.createBuffer(e).toHex(),16);if(c.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var u=y(c,t,r).toString(16),f=n.util.createBuffer(),h=s-Math.ceil(u.length/2);h>0;)f.putByte(0),--h;return f.putBytes(n.util.hexToBytes(u)),!1!==a?m(f.getBytes(),t,r):f.getBytes()},c.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var a,s=(r=r||{}).prng||n.random,o={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(a.eInt),a},c.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,a=0,s=function(e,t){return e|t},o=+new Date,f=0;null===e.keys&&(t<=0||fh?e.pqState=0:e.num.isProbablePrime(w(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(u[a++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var d=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,d,e.p,e.q,d.mod(e.p1),d.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)}}f+=(n=+new Date)-o,o=n}return null!==e.keys},c.rsa.generateKeyPair=function(e,t,r,u){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(u=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(u=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,u=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(u=r,r=void 0):(u=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(u){if(S("generateKeyPair"))return a.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return u(e);u(null,{privateKey:c.privateKeyFromPem(r),publicKey:c.publicKeyFromPem(t)})}));if(E("generateKey")&&E("exportKey"))return o.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return o.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){u(e)})).then((function(e){if(e){var t=c.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(e)));u(null,{privateKey:t,publicKey:c.setRsaPublicKey(t.n,t.e)})}}));if(C("generateKey")&&C("exportKey")){var f=o.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return f.oncomplete=function(e){var t=e.target.result,r=o.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=c.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(t)));u(null,{privateKey:r,publicKey:c.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){u(e)}},void(f.onerror=function(e){u(e)})}}else if(S("generateKeyPairSync")){var h=a.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:c.privateKeyFromPem(h.privateKey),publicKey:c.publicKeyFromPem(h.publicKey)}}var l=c.rsa.createKeyPairGenerationState(e,t,r);if(!u)return c.rsa.stepKeyPairGenerationState(l,0),l.keys;!function(e,t,r){"function"==typeof t&&(r=t,t={});var a={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function s(){o(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?u(t,e.q):void o(e.qBits,u))}))}function o(e,t){n.prime.generateProbablePrime(e,a,t)}function u(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var a=e.p;e.p=e.q,e.q=a}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void s();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void o(e.qBits,u);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void s();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void o(e.qBits,u);var f=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,f,e.p,e.q,f.mod(e.p1),f.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(a.prng=t.prng),s()}(l,r,u)},c.setRsaPublicKey=c.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return v(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var a=t.encode(e,r,!0);return c.rsa.encrypt(a,r,!0)},verify:function(e,t,i,a){"string"==typeof i?i=i.toUpperCase():void 0===i&&(i="RSASSA-PKCS1-V1_5"),void 0===a&&(a={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in a||(a._parseAllDigestBytes=!0),"RSASSA-PKCS1-V1_5"===i?i={verify:function(e,t){t=m(t,r,!0);var i=s.fromDer(t,{parseAllBytes:a._parseAllDigestBytes}),o={},c=[];if(!s.validate(i,p,o,c))throw(u=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.")).errors=c,u;var u,f=s.derToOid(o.algorithmIdentifier);if(f!==n.oids.md2&&f!==n.oids.md5&&f!==n.oids.sha1&&f!==n.oids.sha224&&f!==n.oids.sha256&&f!==n.oids.sha384&&f!==n.oids.sha512&&f!==n.oids["sha512-224"]&&f!==n.oids["sha512-256"])throw(u=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.")).oid=f,u;if((f===n.oids.md2||f===n.oids.md5)&&!("parameters"in o))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return e===o.digest}}:"NONE"!==i&&"NULL"!==i&&null!==i||(i={verify:function(e,t){return e===m(t,r,!0)}});var o=c.rsa.decrypt(t,r,!0,!1);return i.verify(e,o,r.n.bitLength())}};return r},c.setRsaPrivateKey=c.rsa.setPrivateKey=function(e,t,r,i,a,s,o,u){var f={n:e,e:t,d:r,p:i,q:a,dP:s,dQ:o,qInv:u,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=c.rsa.decrypt(e,f,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:m};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,f,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:g},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,f.n.bitLength());return c.rsa.encrypt(n,f,r)}};return f},c.wrapRsaPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(e).getBytes())])},c.privateKeyFromAsn1=function(e){var t,r,a,o,u,l,d,p,g={},y=[];if(s.validate(e,f,g,y)&&(e=s.fromDer(n.util.createBuffer(g.privateKey))),g={},y=[],!s.validate(e,h,g,y)){var v=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw v.errors=y,v}return t=n.util.createBuffer(g.privateKeyModulus).toHex(),r=n.util.createBuffer(g.privateKeyPublicExponent).toHex(),a=n.util.createBuffer(g.privateKeyPrivateExponent).toHex(),o=n.util.createBuffer(g.privateKeyPrime1).toHex(),u=n.util.createBuffer(g.privateKeyPrime2).toHex(),l=n.util.createBuffer(g.privateKeyExponent1).toHex(),d=n.util.createBuffer(g.privateKeyExponent2).toHex(),p=n.util.createBuffer(g.privateKeyCoefficient).toHex(),c.setRsaPrivateKey(new i(t,16),new i(r,16),new i(a,16),new i(o,16),new i(u,16),new i(l,16),new i(d,16),new i(p,16))},c.privateKeyToAsn1=c.privateKeyToRSAPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.qInv))])},c.publicKeyFromAsn1=function(e){var t={},r=[];if(s.validate(e,d,t,r)){var a,o=s.derToOid(t.publicKeyOid);if(o!==c.oids.rsaEncryption)throw(a=new Error("Cannot read public key. Unknown OID.")).oid=o,a;e=t.rsaPublicKey}if(r=[],!s.validate(e,l,t,r))throw(a=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,a;var u=n.util.createBuffer(t.publicKeyModulus).toHex(),f=n.util.createBuffer(t.publicKeyExponent).toHex();return c.setRsaPublicKey(new i(u,16),new i(f,16))},c.publicKeyToAsn1=c.publicKeyToSubjectPublicKeyInfo=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[c.publicKeyToRSAPublicKey(e)])])},c.publicKeyToRSAPublicKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,b(e.e))])}},13417:(e,t,r)=>{var n=r(28413);r(25853),r(23564);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){s||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),s=!0);var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a>>0,c>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=c[1],c[1]=c[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,c[0]=c[1]/4294967296>>>0;return t.putBytes(a),o(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var c,u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(a.substr(0,i.blockLength-u));for(var f=8*i.fullMessageLength[0],h=0;h>>0,s.putInt32(f>>>0),f=c>>>0;s.putInt32(f);var l={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};o(l,r,s);var d=n.util.createBuffer();return d.putInt32(l.h0),d.putInt32(l.h1),d.putInt32(l.h2),d.putInt32(l.h3),d.putInt32(l.h4),d},i};var a=null,s=!1;function o(e,t,r){for(var n,i,a,s,o,c,u,f=r.length();f>=64;){for(i=e.h0,a=e.h1,s=e.h2,o=e.h3,c=e.h4,u=0;u<16;++u)n=r.getInt32(),t[u]=n,n=(i<<5|i>>>27)+(o^a&(s^o))+c+1518500249+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<20;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(i<<5|i>>>27)+(o^a&(s^o))+c+1518500249+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<32;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(i<<5|i>>>27)+(a^s^o)+c+1859775393+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<40;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(a^s^o)+c+1859775393+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<60;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(a&s|o&(a^s))+c+2400959708+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<80;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(a^s^o)+c+3395469782+n,c=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,f-=64}}},24955:(e,t,r)=>{var n=r(28413);r(25853),r(23564);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){s||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=!0);var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a>>0,o>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=o[1],o[1]=o[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(a),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var o,u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(a.substr(0,i.blockLength-u));for(var f=8*i.fullMessageLength[0],h=0;h>>0,s.putInt32(f>>>0),f=o>>>0;s.putInt32(f);var l={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};c(l,r,s);var d=n.util.createBuffer();return d.putInt32(l.h0),d.putInt32(l.h1),d.putInt32(l.h2),d.putInt32(l.h3),d.putInt32(l.h4),d.putInt32(l.h5),d.putInt32(l.h6),d.putInt32(l.h7),d},i};var a=null,s=!1,o=null;function c(e,t,r){for(var n,i,a,s,c,u,f,h,l,d,p,g,y,v=r.length();v>=64;){for(c=0;c<16;++c)t[c]=r.getInt32();for(;c<64;++c)n=((n=t[c-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[c-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[c]=n+t[c-7]+i+t[c-16]|0;for(u=e.h0,f=e.h1,h=e.h2,l=e.h3,d=e.h4,p=e.h5,g=e.h6,y=e.h7,c=0;c<64;++c)a=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),s=u&f|h&(u^f),n=y+((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(g^d&(p^g))+o[c]+t[c],y=g,g=p,p=d,d=l+n>>>0,l=h,h=f,f=u,u=n+(i=a+s)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+f|0,e.h2=e.h2+h|0,e.h3=e.h3+l|0,e.h4=e.h4+d|0,e.h5=e.h5+p|0,e.h6=e.h6+g|0,e.h7=e.h7+y|0,v-=64}}},39194:(e,t,r)=>{var n=r(28413);r(25853),r(23564);var i=e.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var a=n.sha384=n.sha512.sha384=n.sha512.sha384||{};a.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=a,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(e){if(o||(s=String.fromCharCode(128),s+=n.util.fillString(String.fromCharCode(0),128),c=[[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]],(u={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],u["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],u["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],u["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],o=!0),void 0===e&&(e="SHA-512"),!(e in u))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=u[e],r=null,i=n.util.createBuffer(),a=new Array(80),h=0;h<80;++h)a[h]=new Array(2);var l=64;switch(e){case"SHA-384":l=48;break;case"SHA-512/256":l=32;break;case"SHA-512/224":l=28}var d={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:l,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){d.messageLength=0,d.fullMessageLength=d.messageLength128=[];for(var e=d.messageLengthSize/4,a=0;a>>0,s>>>0];for(var o=d.fullMessageLength.length-1;o>=0;--o)d.fullMessageLength[o]+=s[1],s[1]=s[0]+(d.fullMessageLength[o]/4294967296>>>0),d.fullMessageLength[o]=d.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return i.putBytes(e),f(r,a,i),(i.read>2048||0===i.length())&&i.compact(),d},d.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var o,c=d.fullMessageLength[d.fullMessageLength.length-1]+d.messageLengthSize&d.blockLength-1;t.putBytes(s.substr(0,d.blockLength-c));for(var u=8*d.fullMessageLength[0],h=0;h>>0,t.putInt32(u>>>0),u=o>>>0;t.putInt32(u);var l=new Array(r.length);for(h=0;h=128;){for(k=0;k<16;++k)t[k][0]=r.getInt32()>>>0,t[k][1]=r.getInt32()>>>0;for(;k<80;++k)n=(((R=(_=t[k-2])[0])>>>19|(D=_[1])<<13)^(D>>>29|R<<3)^R>>>6)>>>0,i=((R<<13|D>>>19)^(D<<3|R>>>29)^(R<<26|D>>>6))>>>0,a=(((R=(N=t[k-15])[0])>>>1|(D=N[1])<<31)^(R>>>8|D<<24)^R>>>7)>>>0,s=((R<<31|D>>>1)^(R<<24|D>>>8)^(R<<25|D>>>7))>>>0,P=t[k-7],O=t[k-16],D=i+P[1]+s+O[1],t[k][0]=n+P[0]+a+O[0]+(D/4294967296>>>0)>>>0,t[k][1]=D>>>0;for(p=e[0][0],g=e[0][1],y=e[1][0],v=e[1][1],m=e[2][0],b=e[2][1],w=e[3][0],S=e[3][1],E=e[4][0],C=e[4][1],A=e[5][0],B=e[5][1],x=e[6][0],T=e[6][1],I=e[7][0],F=e[7][1],k=0;k<80;++k)f=((E>>>14|C<<18)^(E>>>18|C<<14)^(C>>>9|E<<23))>>>0,h=(x^E&(A^x))>>>0,o=((p>>>28|g<<4)^(g>>>2|p<<30)^(g>>>7|p<<25))>>>0,u=((p<<4|g>>>28)^(g<<30|p>>>2)^(g<<25|p>>>7))>>>0,l=(p&y|m&(p^y))>>>0,d=(g&v|b&(g^v))>>>0,D=F+(((E<<18|C>>>14)^(E<<14|C>>>18)^(C<<23|E>>>9))>>>0)+((T^C&(B^T))>>>0)+c[k][1]+t[k][1],n=I+f+h+c[k][0]+t[k][0]+(D/4294967296>>>0)>>>0,i=D>>>0,a=o+l+((D=u+d)/4294967296>>>0)>>>0,s=D>>>0,I=x,F=T,x=A,T=B,A=E,B=C,E=w+n+((D=S+i)/4294967296>>>0)>>>0,C=D>>>0,w=m,S=b,m=y,b=v,y=p,v=g,p=n+a+((D=i+s)/4294967296>>>0)>>>0,g=D>>>0;D=e[0][1]+g,e[0][0]=e[0][0]+p+(D/4294967296>>>0)>>>0,e[0][1]=D>>>0,D=e[1][1]+v,e[1][0]=e[1][0]+y+(D/4294967296>>>0)>>>0,e[1][1]=D>>>0,D=e[2][1]+b,e[2][0]=e[2][0]+m+(D/4294967296>>>0)>>>0,e[2][1]=D>>>0,D=e[3][1]+S,e[3][0]=e[3][0]+w+(D/4294967296>>>0)>>>0,e[3][1]=D>>>0,D=e[4][1]+C,e[4][0]=e[4][0]+E+(D/4294967296>>>0)>>>0,e[4][1]=D>>>0,D=e[5][1]+B,e[5][0]=e[5][0]+A+(D/4294967296>>>0)>>>0,e[5][1]=D>>>0,D=e[6][1]+T,e[6][0]=e[6][0]+x+(D/4294967296>>>0)>>>0,e[6][1]=D>>>0,D=e[7][1]+F,e[7][0]=e[7][0]+I+(D/4294967296>>>0)>>>0,e[7][1]=D>>>0,L-=128}}},78560:(e,t,r)=>{var n=r(28413);r(72057),r(77827),r(22926),r(13417),r(23564);var i=e.exports=n.ssh=n.ssh||{};function a(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var i=n.util.hexToBytes(r);e.putInt32(i.length),e.putBytes(i)}function s(e,t){e.putInt32(t.length),e.putString(t)}function o(){for(var e=n.md.sha1.create(),t=arguments.length,r=0;r{var n=r(28413);r(25129),r(77827),r(22926),r(67928),r(3174),r(93851),r(13417),r(23564);var i=function(e,t,r,i){var a=n.util.createBuffer(),s=e.length>>1,o=s+(1&e.length),c=e.substr(0,o),u=e.substr(s,o),f=n.util.createBuffer(),h=n.hmac.create();r=t+r;var l=Math.ceil(i/16),d=Math.ceil(i/20);h.start("MD5",c);var p=n.util.createBuffer();f.putBytes(r);for(var g=0;g0&&(u.queue(e,u.createAlert(e,{level:u.Alert.Level.warning,description:u.Alert.Description.no_renegotiation})),u.flush(e)),e.process()},u.parseHelloMessage=function(e,t,r){var i=null,a=e.entity===u.ConnectionEnd.client;if(r<38)e.error(e,{message:a?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});else{var s=t.fragment,c=s.length();if(i={version:{major:s.getByte(),minor:s.getByte()},random:n.util.createBuffer(s.getBytes(32)),session_id:o(s,1),extensions:[]},a?(i.cipher_suite=s.getBytes(2),i.compression_method=s.getByte()):(i.cipher_suites=o(s,2),i.compression_methods=o(s,1)),(c=r-(c-s.length()))>0){for(var f=o(s,2);f.length()>0;)i.extensions.push({type:[f.getByte(),f.getByte()],data:o(f,2)});if(!a)for(var h=0;h0&&0===d.getByte();)e.session.extensions.server_name.serverNameList.push(o(d,2).getBytes())}}if(e.session.version&&(i.version.major!==e.session.version.major||i.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});if(a)e.session.cipherSuite=u.getCipherSuite(i.cipher_suite);else for(var p=n.util.createBuffer(i.cipher_suites.bytes());p.length()>0&&(e.session.cipherSuite=u.getCipherSuite(p.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(i.cipher_suite)});e.session.compressionMethod=a?i.compression_method:u.CompressionMethod.none}return i},u.createSecurityParameters=function(e,t){var r=e.entity===u.ConnectionEnd.client,n=t.random.bytes(),i=r?e.session.sp.client_random:n,a=r?n:u.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:u.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:a}},u.handleServerHello=function(e,t,r){var n=u.parseHelloMessage(e,t,r);if(!e.fail){if(!(n.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});e.version.minor=n.version.minor,e.session.version=e.version;var i=n.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=p,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=f,e.session.resuming=!1,u.createSecurityParameters(e,n)),e.session.id=i,e.process()}},u.handleClientHello=function(e,t,r){var i=u.parseHelloMessage(e,t,r);if(!e.fail){var a=i.session_id.bytes(),s=null;if(e.sessionCache&&(null===(s=e.sessionCache.getSession(a))?a="":(s.version.major!==i.version.major||s.version.minor>i.version.minor)&&(s=null,a="")),0===a.length&&(a=n.random.getBytes(32)),e.session.id=a,e.session.clientHelloVersion=i.version,e.session.sp={},s)e.version=e.session.version=s.version,e.session.sp=s.sp;else{for(var o,c=1;c0;)i=o(c.certificate_list,3),a=n.asn1.fromDer(i),i=n.pki.certificateFromAsn1(a,!0),f.push(i)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var l=e.entity===u.ConnectionEnd.client;!l&&!0!==e.verifyClient||0!==f.length?0===f.length?e.expect=l?h:b:(l?e.session.serverCertificate=f[0]:e.session.clientCertificate=f[0],u.verifyCertificateChain(e,f)&&(e.expect=l?h:b)):e.error(e,{message:l?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}}),e.process()},u.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});e.expect=l,e.process()},u.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});var i=t.fragment,a={enc_pre_master_secret:o(i,2).getBytes()},s=null;if(e.getPrivateKey)try{s=e.getPrivateKey(e,e.session.serverCertificate),s=n.pki.privateKeyFromPem(s)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}if(null===s)return e.error(e,{message:"No private key set.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}});try{var c=e.session.sp;c.pre_master_secret=s.decrypt(a.enc_pre_master_secret);var f=e.session.clientHelloVersion;if(f.major!==c.pre_master_secret.charCodeAt(0)||f.minor!==c.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){c.pre_master_secret=n.random.getBytes(48)}e.expect=S,null!==e.session.clientCertificate&&(e.expect=w),e.process()},u.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var n=t.fragment,i={certificate_types:o(n,1),certificate_authorities:o(n,2)};e.session.certificateRequest=i,e.expect=d,e.process()},u.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var i=t.fragment;i.read-=4;var a=i.bytes();i.read+=4;var s={signature:o(i,2).getBytes()},c=n.util.createBuffer();c.putBuffer(e.session.md5.digest()),c.putBuffer(e.session.sha1.digest()),c=c.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(c,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(a),e.session.sha1.update(a)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure}})}e.expect=S,e.process()},u.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.record_overflow}});if(null===e.serverCertificate){var i={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.insufficient_security}},a=e.verify(e,i.alert.description,0,[]);if(!0!==a)return(a||0===a)&&("object"!=typeof a||n.util.isArray(a)?"number"==typeof a&&(i.alert.description=a):(a.message&&(i.message=a.message),a.alert&&(i.alert.description=a.alert))),e.error(e,i)}null!==e.session.certificateRequest&&(t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)}),u.queue(e,t)),t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createClientKeyExchange(e)}),u.queue(e,t),e.expect=v;var s=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateVerify(e,t)})),u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)})),e.expect=p,u.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return s(e,null);u.getClientSignature(e,s)},u.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var r=e.entity===u.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=u.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?g:E,e.process()},u.handleFinished=function(e,t,r){var a=t.fragment;a.read-=4;var s=a.bytes();a.read+=4;var o=t.fragment.getBytes();(a=n.util.createBuffer()).putBuffer(e.session.md5.digest()),a.putBuffer(e.session.sha1.digest());var c=e.entity===u.ConnectionEnd.client,f=c?"server finished":"client finished",h=e.session.sp;if((a=i(h.master_secret,f,a.getBytes(),12)).getBytes()!==o)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decrypt_error}});e.session.md5.update(s),e.session.sha1.update(s),(e.session.resuming&&c||!e.session.resuming&&!c)&&(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))),e.expect=c?y:C,e.handshaking=!1,++e.handshakes,e.peerCertificate=c?e.session.serverCertificate:e.session.clientCertificate,u.flush(e),e.isConnected=!0,e.connected(e),e.process()},u.handleAlert=function(e,t){var r,n=t.fragment,i={level:n.getByte(),description:n.getByte()};switch(i.description){case u.Alert.Description.close_notify:r="Connection closed.";break;case u.Alert.Description.unexpected_message:r="Unexpected message.";break;case u.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case u.Alert.Description.decryption_failed:r="Decryption failed.";break;case u.Alert.Description.record_overflow:r="Record overflow.";break;case u.Alert.Description.decompression_failure:r="Decompression failed.";break;case u.Alert.Description.handshake_failure:r="Handshake failure.";break;case u.Alert.Description.bad_certificate:r="Bad certificate.";break;case u.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case u.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case u.Alert.Description.certificate_expired:r="Certificate expired.";break;case u.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case u.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case u.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case u.Alert.Description.access_denied:r="Access denied.";break;case u.Alert.Description.decode_error:r="Decode error.";break;case u.Alert.Description.decrypt_error:r="Decrypt error.";break;case u.Alert.Description.export_restriction:r="Export restriction.";break;case u.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case u.Alert.Description.insufficient_security:r="Insufficient security.";break;case u.Alert.Description.internal_error:r="Internal error.";break;case u.Alert.Description.user_canceled:r="User canceled.";break;case u.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(i.description===u.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===u.ConnectionEnd.client?"server":"client",alert:i}),e.process()},u.handleHandshake=function(e,t){var r=t.fragment,i=r.getByte(),a=r.getInt24();if(a>r.length())return e.fragmented=t,t.fragment=n.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var s=r.bytes(a+4);r.read+=4,i in U[e.entity][e.expect]?(e.entity!==u.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),i!==u.HandshakeType.hello_request&&i!==u.HandshakeType.certificate_verify&&i!==u.HandshakeType.finished&&(e.session.md5.update(s),e.session.sha1.update(s)),U[e.entity][e.expect][i](e,t,a)):u.handleUnexpected(e,t)},u.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},u.handleHeartbeat=function(e,t){var r=t.fragment,i=r.getByte(),a=r.getInt16(),s=r.getBytes(a);if(i===u.HeartbeatMessageType.heartbeat_request){if(e.handshaking||a>s.length)return e.process();u.queue(e,u.createRecord(e,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_response,s)})),u.flush(e)}else if(i===u.HeartbeatMessageType.heartbeat_response){if(s!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,n.util.createBuffer(s))}e.process()};var f=1,h=2,l=3,d=4,p=5,g=6,y=7,v=8,m=1,b=2,w=3,S=4,E=5,C=6,A=u.handleUnexpected,B=u.handleChangeCipherSpec,x=u.handleAlert,T=u.handleHandshake,I=u.handleApplicationData,F=u.handleHeartbeat,k=[];k[u.ConnectionEnd.client]=[[A,x,T,A,F],[A,x,T,A,F],[A,x,T,A,F],[A,x,T,A,F],[A,x,T,A,F],[B,x,A,A,F],[A,x,T,A,F],[A,x,T,I,F],[A,x,T,A,F]],k[u.ConnectionEnd.server]=[[A,x,T,A,F],[A,x,T,A,F],[A,x,T,A,F],[A,x,T,A,F],[B,x,A,A,F],[A,x,T,A,F],[A,x,T,I,F],[A,x,T,A,F]];var R=u.handleHelloRequest,D=u.handleServerHello,_=u.handleCertificate,P=u.handleServerKeyExchange,N=u.handleCertificateRequest,O=u.handleServerHelloDone,L=u.handleFinished,U=[];U[u.ConnectionEnd.client]=[[A,A,D,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[R,A,A,A,A,A,A,A,A,A,A,_,P,N,O,A,A,A,A,A,A],[R,A,A,A,A,A,A,A,A,A,A,A,P,N,O,A,A,A,A,A,A],[R,A,A,A,A,A,A,A,A,A,A,A,A,N,O,A,A,A,A,A,A],[R,A,A,A,A,A,A,A,A,A,A,A,A,A,O,A,A,A,A,A,A],[R,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[R,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,L],[R,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[R,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A]];var K=u.handleClientHello,M=u.handleClientKeyExchange,H=u.handleCertificateVerify;U[u.ConnectionEnd.server]=[[A,K,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,_,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,M,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,H,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,L],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A]],u.generateKeys=function(e,t){var r=i,n=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",n,48).bytes(),t.pre_master_secret=null),n=t.server_random+t.client_random;var a=2*t.mac_key_length+2*t.enc_key_length,s=e.version.major===u.Versions.TLS_1_0.major&&e.version.minor===u.Versions.TLS_1_0.minor;s&&(a+=2*t.fixed_iv_length);var o=r(t.master_secret,"key expansion",n,a),c={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return s&&(c.client_write_IV=o.getBytes(t.fixed_iv_length),c.server_write_IV=o.getBytes(t.fixed_iv_length)),c},u.createConnectionState=function(e){var t=e.entity===u.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},n={read:r(),write:r()};if(n.read.update=function(e,t){return n.read.cipherFunction(t,n.read)?n.read.compressFunction(e,t,n.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_record_mac}}),!e.fail},n.write.update=function(e,t){return n.write.compressFunction(e,t,n.write)?n.write.cipherFunction(t,n.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=u.generateKeys(e,i),n.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,n.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(n,e,i),i.compression_algorithm){case u.CompressionMethod.none:break;case u.CompressionMethod.deflate:n.read.compressFunction=s,n.write.compressFunction=a;break;default:throw new Error("Unsupported compression algorithm.")}}return n},u.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=n.util.createBuffer();return r.putInt32(t),r.putBytes(n.random.getBytes(28)),r},u.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},u.createAlert=function(e,t){var r=n.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),u.createRecord(e,{type:u.ContentType.alert,data:r})},u.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=n.util.createBuffer(),r=0;r0&&(p+=2);var g=e.session.id,y=g.length+1+2+4+28+2+a+1+o+p,v=n.util.createBuffer();return v.putByte(u.HandshakeType.client_hello),v.putInt24(y),v.putByte(e.version.major),v.putByte(e.version.minor),v.putBytes(e.session.sp.client_random),c(v,1,n.util.createBuffer(g)),c(v,2,t),c(v,1,s),p>0&&c(v,2,f),v},u.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,i=n.util.createBuffer();return i.putByte(u.HandshakeType.server_hello),i.putInt24(r),i.putByte(e.version.major),i.putByte(e.version.minor),i.putBytes(e.session.sp.server_random),c(i,1,n.util.createBuffer(t)),i.putByte(e.session.cipherSuite.id[0]),i.putByte(e.session.cipherSuite.id[1]),i.putByte(e.session.compressionMethod),i},u.createCertificate=function(e){var t,r=e.entity===u.ConnectionEnd.client,i=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,i=e.getCertificate(e,t));var a=n.util.createBuffer();if(null!==i)try{n.util.isArray(i)||(i=[i]);for(var s=null,o=0;ou.MaxFragment;)i.push(u.createRecord(e,{type:t.type,data:n.util.createBuffer(a.slice(0,u.MaxFragment))})),a=a.slice(u.MaxFragment);a.length>0&&i.push(u.createRecord(e,{type:t.type,data:n.util.createBuffer(a)}))}for(var s=0;s0&&(i=r.order[0]),null!==i&&i in r.cache)for(var a in t=r.cache[i],delete r.cache[i],r.order)if(r.order[a]===i){r.order.splice(a,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}i=n.util.bytesToHex(e),r.order.push(i),r.cache[i]=t}}return r},u.createConnection=function(e){var t;t=e.caStore?n.util.isArray(e.caStore)?n.pki.createCaStore(e.caStore):e.caStore:n.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var i in r=[],u.CipherSuites)r.push(u.CipherSuites[i]);var a=e.server?u.ConnectionEnd.server:u.ConnectionEnd.client,s=e.sessionCache?u.createSessionCache(e.sessionCache):null,o={version:{major:u.Version.major,minor:u.Version.minor},entity:a,sessionId:e.sessionId,caStore:t,sessionCache:s,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,n){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===u.ConnectionEnd.client?"client":"server"),r.send&&(u.queue(t,u.createAlert(t,r.alert)),u.flush(t));var n=!1!==r.fatal;n&&(t.fail=!0),e.error(t,r),n&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){o.version={major:u.Version.major,minor:u.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=(o.entity,u.ConnectionEnd.client,0),o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(e||void 0===e),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=u.createConnectionState(o)}};return o.reset(),o.handshake=function(e){if(o.entity!==u.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&0===o.handshakes&&(o.fail=!1),o.handshaking=!0;var t=null;(e=e||"").length>0&&(o.sessionCache&&(t=o.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&o.sessionCache&&null!==(t=o.sessionCache.getSession())&&(e=t.id),o.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:n.md.md5.create(),sha1:n.md.sha1.create()},t&&(o.version=t.version,o.session.sp=t.sp),o.session.sp.client_random=u.createRandom().getBytes(),o.open=!0,u.queue(o,u.createRecord(o,{type:u.ContentType.handshake,data:u.createClientHello(o)})),u.flush(o)}},o.process=function(e){var t=0;return e&&o.input.putBytes(e),o.fail||(null!==o.record&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),null===o.record&&(t=function(e){var t=0,r=e.input,i=r.length();if(i<5)t=5-i;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var a=e.record.version.major===e.version.major;a&&e.session&&e.session.version&&(a=e.record.version.minor===e.version.minor),a||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}})}return t}(o)),o.fail||null===o.record||o.record.ready||(t=function(e){var t=0,r=e.input,n=r.length();return n{var n=r(35208),i=r(42363).Buffer,a=r(28413),s=r(84775),o=e.exports=a.util=a.util||{};function c(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function u(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(o.isArrayBuffer(e)||o.isArrayBufferView(e))if(void 0!==i&&e instanceof i)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r15?(r=Date.now(),s(e)):(t.push(e),1===t.length&&a.setAttribute("a",i=!i))}}o.nextTick=o.setImmediate}(),o.isNodejs=void 0!==n&&n.versions&&n.versions.node,o.globalScope=o.isNodejs?r.g:"undefined"==typeof self?window:self,o.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},o.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},o.isArrayBufferView=function(e){return e&&o.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},o.ByteBuffer=u,o.ByteStringBuffer=u,o.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},o.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},o.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},o.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},o.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},o.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},o.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(o.encodeUtf8(e))},o.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},o.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},o.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},o.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},o.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},o.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},o.ByteStringBuffer.prototype.putInt=function(e,t){c(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},o.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},o.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},o.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},o.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},o.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},o.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},o.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},o.ByteStringBuffer.prototype.copy=function(){var e=o.createBuffer(this.data);return e.read=this.read,e},o.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},o.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},o.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},o.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},o.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},o.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},o.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},o.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},o.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},o.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},o.DataBuffer.prototype.putInt=function(e,t){c(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},o.DataBuffer.prototype.putSignedInt=function(e,t){return c(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},o.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},o.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},o.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},o.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},o.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},o.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},o.DataBuffer.prototype.copy=function(){return new o.DataBuffer(this)},o.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},o.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},o.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},o.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},o.xorBytes=function(e,t,r){for(var n="",i="",a="",s=0,o=0;r>0;--r,++s)i=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(n+=a,a="",o=0),a+=String.fromCharCode(i),++o;return n+a},o.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",h=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";o.encode64=function(e,t){for(var r,n,i,a="",s="",o=0;o>2),a+=f.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=f.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":f.charAt(63&i)),t&&a.length>t&&(s+=a.substr(0,t)+"\r\n",a=a.substr(t));return s+a},o.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",s=0;s>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},o.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},o.decodeUtf8=function(e){return decodeURIComponent(escape(e))},o.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:s.encode,decode:s.decode}},o.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},o.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a>2),a+=f.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=f.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":f.charAt(63&i)),t&&a.length>t&&(s+=a.substr(0,t)+"\r\n",a=a.substr(t));return s+a},o.binary.base64.decode=function(e,t,r){var n,i,a,s,o=t;o||(o=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var c=0,u=r=r||0;c>4,64!==a&&(o[u++]=(15&i)<<4|a>>2,64!==s&&(o[u++]=(3&a)<<6|s));return t?u-r:o.subarray(0,u)},o.binary.base58.encode=function(e,t){return o.binary.baseN.encode(e,l,t)},o.binary.base58.decode=function(e,t){return o.binary.baseN.decode(e,l,t)},o.text={utf8:{},utf16:{}},o.text.utf8.encode=function(e,t,r){e=o.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a0&&a.push(r),s=n.lastIndex;var o=t[0][1];switch(o){case"s":case"o":i");break;case"%":a.push("%");break;default:a.push("<%"+o+"?>")}}return a.push(e.substring(s)),a.join("")},o.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,s=void 0===r?",":r,o=void 0===n?".":n,c=i<0?"-":"",u=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",f=u.length>3?u.length%3:0;return c+(f?u.substr(0,f)+o:"")+u.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+o)+(a?s+Math.abs(i-u).toFixed(a).slice(2):"")},o.formatSize=function(e){return e>=1073741824?o.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?o.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?o.formatNumber(e/1024,0)+" KiB":o.formatNumber(e,0)+" bytes"},o.bytesFromIP=function(e){return-1!==e.indexOf(".")?o.bytesFromIPv4(e):-1!==e.indexOf(":")?o.bytesFromIPv6(e):null},o.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=o.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:c,end:c})}t.push(a)}if(r.length>0){var u=r[n];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),0===u.start&&t.unshift(""),7===u.end&&t.push(""))}return t.join(":")},o.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in o&&!e.update)return t(null,o.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return o.cores=navigator.hardwareConcurrency,t(null,o.cores);if("undefined"==typeof Worker)return o.cores=1,t(null,o.cores);if("undefined"==typeof Blob)return o.cores=2,t(null,o.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()o.st&&i.sti.st&&o.st{var n=r(28413);r(72057),r(25129),r(35690),r(25853),r(22328),r(12889),r(67928),r(26892),r(72112),r(23564);var i=n.asn1,a=e.exports=n.pki=n.pki||{},s=a.oids,o={};o.CN=s.commonName,o.commonName="CN",o.C=s.countryName,o.countryName="C",o.L=s.localityName,o.localityName="L",o.ST=s.stateOrProvinceName,o.stateOrProvinceName="ST",o.O=s.organizationName,o.organizationName="O",o.OU=s.organizationalUnitName,o.organizationalUnitName="OU",o.E=s.emailAddress,o.emailAddress="E";var c=n.pki.rsa.publicKeyValidator,u={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},c,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},f={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},h={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},c,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},l={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[h,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function d(e,t){"string"==typeof t&&(t={shortName:t});for(var r,n=null,i=0;null===n&&i128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var d=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=d.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,d.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){if(e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),f=e.value.value,e.keyIdentifier){var p=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;f.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,p))}if(e.authorityCertIssuer){var g=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[v(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];f.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,g))}if(e.serialNumber){var y=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);f.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,y))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),f=e.value.value;var m,b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),w=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(l=0;l2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(h.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=h[0],c.validity.notAfter=h[1],c.tbsCertificate=r.tbsCertificate,t){c.md=g({signatureOid:c.signatureOid,type:"certificate"});var l=i.toDer(c.tbsCertificate);c.md.update(l.getBytes())}var y=n.md.sha1.create(),v=i.toDer(r.certIssuer);y.update(v.getBytes()),c.issuer.getField=function(e){return d(c.issuer,e)},c.issuer.addField=function(e){m([e]),c.issuer.attributes.push(e)},c.issuer.attributes=a.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=y.digest().toHex();var b=n.md.sha1.create(),w=i.toDer(r.certSubject);return b.update(w.getBytes()),c.subject.getField=function(e){return d(c.subject,e)},c.subject.addField=function(e){m([e]),c.subject.attributes.push(e)},c.subject.attributes=a.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=b.digest().toHex(),r.certExtensions?c.extensions=a.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),c},a.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r1&&(r=c.value.charCodeAt(1),a=c.value.length>2?c.value.charCodeAt(2):0),t.digitalSignature=!(128&~r),t.nonRepudiation=!(64&~r),t.keyEncipherment=!(32&~r),t.dataEncipherment=!(16&~r),t.keyAgreement=!(8&~r),t.keyCertSign=!(4&~r),t.cRLSign=!(2&~r),t.encipherOnly=!(1&~r),t.decipherOnly=!(128&~a)}else if("basicConstraints"===t.name){(c=i.fromDer(t.value)).value.length>0&&c.value[0].type===i.Type.BOOLEAN?t.cA=0!==c.value[0].value.charCodeAt(0):t.cA=!1;var o=null;c.value.length>0&&c.value[0].type===i.Type.INTEGER?o=c.value[0].value:c.value.length>1&&(o=c.value[1].value),null!==o&&(t.pathLenConstraint=i.derToInteger(o))}else if("extKeyUsage"===t.name)for(var c=i.fromDer(t.value),u=0;u1&&(r=c.value.charCodeAt(1)),t.client=!(128&~r),t.server=!(64&~r),t.email=!(32&~r),t.objsign=!(16&~r),t.reserved=!(8&~r),t.sslCA=!(4&~r),t.emailCA=!(2&~r),t.objCA=!(1&~r);else if("subjectAltName"===t.name||"issuerAltName"===t.name){var h;t.altNames=[],c=i.fromDer(t.value);for(var l=0;l=E&&e0&&s.value.push(a.certificateExtensionsToAsn1(e.extensions)),s},a.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),v(e.subject),a.publicKeyToAsn1(e.publicKey),S(e)])},a.distinguishedNameToAsn1=function(e){return v(e)},a.certificateToAsn1=function(e){var t=e.tbsCertificate||a.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),w(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;nf.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:a.certificateError.certificate_expired,notBefore:f.validity.notBefore,notAfter:f.validity.notAfter,now:s}),null===c){if(null===(h=t[0]||e.getIssuer(f))&&f.isIssuer(f)&&(l=!0,h=f),h){var d=h;n.util.isArray(d)||(d=[d]);for(var p=!1;!p&&d.length>0;){h=d.shift();try{p=h.verify(f)}catch(e){}}p||(c={message:"Certificate signature is invalid.",error:a.certificateError.bad_certificate})}null!==c||h&&!l||e.hasCertificate(f)||(c={message:"Certificate is not trusted.",error:a.certificateError.unknown_ca})}if(null===c&&h&&!f.isIssuer(h)&&(c={message:"Certificate issuer is invalid.",error:a.certificateError.bad_certificate}),null===c)for(var g={keyUsage:!0,basicConstraints:!0},y=0;null===c&&ym.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:a.certificateError.bad_certificate})}var w=null===c||c.error,S=r.verify?r.verify(w,u,i):w;if(!0!==S)throw!0===w&&(c={message:"The application rejected the certificate.",error:a.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||n.util.isArray(S)?"string"==typeof S&&(c.error=S):(S.message&&(c.message=S.message),S.error&&(c.error=S.error))),c;c=null,o=!1,++u}while(t.length>0);return!0}},95355:(e,t,r)=>{var n,i,a,s,o,c,u,f,h,l,d,p=r(48287).Buffer,g={userAgent:!1},y={},v=v||(n=Math,a=(i={}).lib={},s=a.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var r=new e;return t&&r.mixIn(t),r.hasOwnProperty("init")||(r.init=function(){r.$super.init.apply(this,arguments)}),r.init.prototype=r,r.$super=this,r},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=a.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a>>2]>>>24-a%4*8&255;t[n+a>>>2]|=s<<24-(n+a)%4*8}else for(a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=n.ceil(t/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(r,t/2)}},f=c.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(r,t)}},h=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},l=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,a=this.blockSize,s=i/(4*a),c=(s=e?n.ceil(s):n.max((0|s)-this._minBufferSize,0))*a,u=n.min(4*c,i);if(c){for(var f=0;f>>2]}},t.BlockCipher=o.extend({cfg:o.cfg.extend({mode:c,padding:f}),reset:function(){o.reset.call(this);var e=(t=this.cfg).iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=t.createEncryptor;else r=t.createDecryptor,this._minBufferSize=1;this._mode=r.call(t,this,e&&e.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var h=t.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),l=(c=(d.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return((e=e.salt)?n.create([1398893684,1701076831]).concat(e).concat(t):t).toString(a)},parse:function(e){var t=(e=a.parse(e)).words;if(1398893684==t[0]&&1701076831==t[1]){var r=n.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return h.create({ciphertext:e,salt:r})}},t.SerializableCipher=r.extend({cfg:r.extend({format:c}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n);return t=i.finalize(t),i=i.cfg,h.create({ciphertext:t,key:r,iv:i.iv,algorithm:e,mode:i.mode,padding:i.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}})),d=(d.kdf={}).OpenSSL={execute:function(e,t,r,i){return i||(i=n.random(8)),e=s.create({keySize:t+r}).compute(e,i),r=n.create(e.words.slice(t),4*r),e.sigBytes=4*t,h.create({key:e,iv:r,salt:i})}},p=t.PasswordBasedCipher=l.extend({cfg:l.cfg.extend({kdf:d}),encrypt:function(e,t,r,n){return r=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize),n.iv=r.iv,(e=l.encrypt.call(this,e,t,r.key,n)).mixIn(r),e},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),r=n.kdf.execute(r,e.keySize,e.ivSize,t.salt),n.iv=r.iv,l.decrypt.call(this,e,t,r.key,n)}})}(),function(){for(var e=v,t=e.lib.BlockCipher,r=e.algo,n=[],i=[],a=[],s=[],o=[],c=[],u=[],f=[],h=[],l=[],d=[],p=0;256>p;p++)d[p]=128>p?p<<1:p<<1^283;var g=0,y=0;for(p=0;256>p;p++){var m=(m=y^y<<1^y<<2^y<<3^y<<4)>>>8^255&m^99;n[g]=m,i[m]=g;var b=d[g],w=d[b],S=d[w],E=257*d[m]^16843008*m;a[g]=E<<24|E>>>8,s[g]=E<<16|E>>>16,o[g]=E<<8|E>>>24,c[g]=E,E=16843009*S^65537*w^257*b^16843008*g,u[m]=E<<24|E>>>8,f[m]=E<<16|E>>>16,h[m]=E<<8|E>>>24,l[m]=E,g?(g=b^d[d[d[S^b]]],y^=d[d[y]]):g=y=1}var C=[0,1,2,4,8,16,32,64,128,27,54];r=r.AES=t.extend({_doReset:function(){for(var e=(r=this._key).words,t=r.sigBytes/4,r=4*((this._nRounds=t+6)+1),i=this._keySchedule=[],a=0;a>>24]<<24|n[s>>>16&255]<<16|n[s>>>8&255]<<8|n[255&s]):(s=n[(s=s<<8|s>>>24)>>>24]<<24|n[s>>>16&255]<<16|n[s>>>8&255]<<8|n[255&s],s^=C[a/t|0]<<24),i[a]=i[a-t]^s}for(e=this._invKeySchedule=[],t=0;tt||4>=a?s:u[n[s>>>24]]^f[n[s>>>16&255]]^h[n[s>>>8&255]]^l[n[255&s]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,o,c,n)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,u,f,h,l,i),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,a,s,o){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],h=e[t+2]^r[2],l=e[t+3]^r[3],d=4,p=1;p>>24]^i[f>>>16&255]^a[h>>>8&255]^s[255&l]^r[d++],y=n[f>>>24]^i[h>>>16&255]^a[l>>>8&255]^s[255&u]^r[d++],v=n[h>>>24]^i[l>>>16&255]^a[u>>>8&255]^s[255&f]^r[d++];l=n[l>>>24]^i[u>>>16&255]^a[f>>>8&255]^s[255&h]^r[d++],u=g,f=y,h=v}g=(o[u>>>24]<<24|o[f>>>16&255]<<16|o[h>>>8&255]<<8|o[255&l])^r[d++],y=(o[f>>>24]<<24|o[h>>>16&255]<<16|o[l>>>8&255]<<8|o[255&u])^r[d++],v=(o[h>>>24]<<24|o[l>>>16&255]<<16|o[u>>>8&255]<<8|o[255&f])^r[d++],l=(o[l>>>24]<<24|o[u>>>16&255]<<16|o[f>>>8&255]<<8|o[255&h])^r[d++],e[t]=g,e[t+1]=y,e[t+2]=v,e[t+3]=l},keySize:8}),e.AES=t._createHelper(r)}(),function(){function e(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<r;r++){var n=s[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(e=this._subKeys=[],n=0;16>n;n++){var i=e[n]=[],a=c[n];for(r=0;24>r;r++)i[r/6|0]|=t[(o[r]-1+a)%28]<<31-r%6,i[4+(r/6|0)]|=t[28+(o[r+24]-1+a)%28]<<31-r%6;for(i[0]=i[0]<<1|i[0]>>>31,r=1;7>r;r++)i[r]>>>=4*(r-1)+3;i[7]=i[7]<<5|i[7]>>>27}for(t=this._invSubKeys=[],r=0;16>r;r++)t[r]=e[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(r,n,i){this._lBlock=r[n],this._rBlock=r[n+1],e.call(this,4,252645135),e.call(this,16,65535),t.call(this,2,858993459),t.call(this,8,16711935),e.call(this,1,1431655765);for(var a=0;16>a;a++){for(var s=i[a],o=this._lBlock,c=this._rBlock,h=0,l=0;8>l;l++)h|=u[l][((c^s[l])&f[l])>>>0];this._lBlock=c,this._rBlock=o^h}i=this._lBlock,this._lBlock=this._rBlock,this._rBlock=i,e.call(this,1,1431655765),t.call(this,8,16711935),t.call(this,2,858993459),e.call(this,16,65535),e.call(this,4,252645135),r[n]=this._lBlock,r[n+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});r.DES=i._createHelper(h),a=a.TripleDES=i.extend({_doReset:function(){var e=this._key.words;this._des1=h.createEncryptor(n.create(e.slice(0,2))),this._des2=h.createEncryptor(n.create(e.slice(2,4))),this._des3=h.createEncryptor(n.create(e.slice(4,6)))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2}),r.TripleDES=i._createHelper(a)}(),function(){var e=v,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp(),e=[];for(var i=0;i>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;4>s&&i+.75*s>>6*(3-s)&63));if(t=n.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var r=e.length,n=this._map;(i=n.charAt(64))&&-1!=(i=e.indexOf(i))&&(r=i);for(var i=[],a=0,s=0;s>>6-s%4*2;i[a>>>2]|=(o|c)<<24-a%4*8,a++}return t.create(i,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){function t(e,t,r,n,i,a,s){return((e=e+(t&r|~t&n)+i+s)<>>32-a)+t}function r(e,t,r,n,i,a,s){return((e=e+(t&n|r&~n)+i+s)<>>32-a)+t}function n(e,t,r,n,i,a,s){return((e=e+(t^r^n)+i+s)<>>32-a)+t}function i(e,t,r,n,i,a,s){return((e=e+(r^(t|~n))+i+s)<>>32-a)+t}for(var a=v,s=(c=a.lib).WordArray,o=c.Hasher,c=a.algo,u=[],f=0;64>f;f++)u[f]=4294967296*e.abs(e.sin(f+1))|0;c=c.MD5=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,a){for(var s=0;16>s;s++){var o=e[c=a+s];e[c]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}s=this._hash.words;var c=e[a+0],f=(o=e[a+1],e[a+2]),h=e[a+3],l=e[a+4],d=e[a+5],p=e[a+6],g=e[a+7],y=e[a+8],v=e[a+9],m=e[a+10],b=e[a+11],w=e[a+12],S=e[a+13],E=e[a+14],C=e[a+15],A=t(A=s[0],T=s[1],x=s[2],B=s[3],c,7,u[0]),B=t(B,A,T,x,o,12,u[1]),x=t(x,B,A,T,f,17,u[2]),T=t(T,x,B,A,h,22,u[3]);A=t(A,T,x,B,l,7,u[4]),B=t(B,A,T,x,d,12,u[5]),x=t(x,B,A,T,p,17,u[6]),T=t(T,x,B,A,g,22,u[7]),A=t(A,T,x,B,y,7,u[8]),B=t(B,A,T,x,v,12,u[9]),x=t(x,B,A,T,m,17,u[10]),T=t(T,x,B,A,b,22,u[11]),A=t(A,T,x,B,w,7,u[12]),B=t(B,A,T,x,S,12,u[13]),x=t(x,B,A,T,E,17,u[14]),A=r(A,T=t(T,x,B,A,C,22,u[15]),x,B,o,5,u[16]),B=r(B,A,T,x,p,9,u[17]),x=r(x,B,A,T,b,14,u[18]),T=r(T,x,B,A,c,20,u[19]),A=r(A,T,x,B,d,5,u[20]),B=r(B,A,T,x,m,9,u[21]),x=r(x,B,A,T,C,14,u[22]),T=r(T,x,B,A,l,20,u[23]),A=r(A,T,x,B,v,5,u[24]),B=r(B,A,T,x,E,9,u[25]),x=r(x,B,A,T,h,14,u[26]),T=r(T,x,B,A,y,20,u[27]),A=r(A,T,x,B,S,5,u[28]),B=r(B,A,T,x,f,9,u[29]),x=r(x,B,A,T,g,14,u[30]),A=n(A,T=r(T,x,B,A,w,20,u[31]),x,B,d,4,u[32]),B=n(B,A,T,x,y,11,u[33]),x=n(x,B,A,T,b,16,u[34]),T=n(T,x,B,A,E,23,u[35]),A=n(A,T,x,B,o,4,u[36]),B=n(B,A,T,x,l,11,u[37]),x=n(x,B,A,T,g,16,u[38]),T=n(T,x,B,A,m,23,u[39]),A=n(A,T,x,B,S,4,u[40]),B=n(B,A,T,x,c,11,u[41]),x=n(x,B,A,T,h,16,u[42]),T=n(T,x,B,A,p,23,u[43]),A=n(A,T,x,B,v,4,u[44]),B=n(B,A,T,x,w,11,u[45]),x=n(x,B,A,T,C,16,u[46]),A=i(A,T=n(T,x,B,A,f,23,u[47]),x,B,c,6,u[48]),B=i(B,A,T,x,g,10,u[49]),x=i(x,B,A,T,E,15,u[50]),T=i(T,x,B,A,d,21,u[51]),A=i(A,T,x,B,w,6,u[52]),B=i(B,A,T,x,h,10,u[53]),x=i(x,B,A,T,m,15,u[54]),T=i(T,x,B,A,o,21,u[55]),A=i(A,T,x,B,y,6,u[56]),B=i(B,A,T,x,C,10,u[57]),x=i(x,B,A,T,p,15,u[58]),T=i(T,x,B,A,S,21,u[59]),A=i(A,T,x,B,l,6,u[60]),B=i(B,A,T,x,b,10,u[61]),x=i(x,B,A,T,f,15,u[62]),T=i(T,x,B,A,v,21,u[63]),s[0]=s[0]+A|0,s[1]=s[1]+T|0,s[2]=s[2]+x|0,s[3]=s[3]+B|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var a=e.floor(n/4294967296);for(r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(r.length+1),this._process(),r=(t=this._hash).words,n=0;4>n;n++)i=r[n],r[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return t},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}}),a.MD5=o._createHelper(c),a.HmacMD5=o._createHmacHelper(c)}(Math),function(){var e=v,t=(i=e.lib).WordArray,r=i.Hasher,n=[],i=e.algo.SHA1=r.extend({_doReset:function(){this._hash=new t.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],a=r[1],s=r[2],o=r[3],c=r[4],u=0;80>u;u++){if(16>u)n[u]=0|e[t+u];else{var f=n[u-3]^n[u-8]^n[u-14]^n[u-16];n[u]=f<<1|f>>>31}f=(i<<5|i>>>27)+c+n[u],f=20>u?f+(1518500249+(a&s|~a&o)):40>u?f+(1859775393+(a^s^o)):60>u?f+((a&s|a&o|s&o)-1894007588):f+((a^s^o)-899497514),c=o,o=s,s=a<<30|a>>>2,a=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+a|0,r[2]=r[2]+s|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=r._createHelper(i),e.HmacSHA1=r._createHmacHelper(i)}(),function(e){for(var t=v,r=(i=t.lib).WordArray,n=i.Hasher,i=t.algo,a=[],s=[],o=function(e){return 4294967296*(e-(0|e))|0},c=2,u=0;64>u;){var f;e:{f=c;for(var h=e.sqrt(f),l=2;l<=h;l++)if(!(f%l)){f=!1;break e}f=!0}f&&(8>u&&(a[u]=o(e.pow(c,.5))),s[u]=o(e.pow(c,1/3)),u++),c++}var d=[];i=i.SHA256=n.extend({_doReset:function(){this._hash=new r.init(a.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],c=r[4],u=r[5],f=r[6],h=r[7],l=0;64>l;l++){if(16>l)d[l]=0|e[t+l];else{var p=d[l-15],g=d[l-2];d[l]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+d[l-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+d[l-16]}p=h+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&u^~c&f)+s[l]+d[l],g=((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+(n&i^n&a^i&a),h=f,f=u,u=c,c=o+p|0,o=a,a=i,i=n,n=p+g|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0,r[5]=r[5]+u|0,r[6]=r[6]+f|0,r[7]=r[7]+h|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA256=n._createHelper(i),t.HmacSHA256=n._createHmacHelper(i)}(Math),function(){var e=v,t=e.lib.WordArray,r=(n=e.algo).SHA256,n=n.SHA224=r.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=r._doFinalize.call(this);return e.sigBytes-=4,e}});e.SHA224=r._createHelper(n),e.HmacSHA224=r._createHmacHelper(n)}(),function(){function e(){return n.create.apply(n,arguments)}for(var t=v,r=t.lib.Hasher,n=(a=t.x64).Word,i=a.WordArray,a=t.algo,s=[e(1116352408,3609767458),e(1899447441,602891725),e(3049323471,3964484399),e(3921009573,2173295548),e(961987163,4081628472),e(1508970993,3053834265),e(2453635748,2937671579),e(2870763221,3664609560),e(3624381080,2734883394),e(310598401,1164996542),e(607225278,1323610764),e(1426881987,3590304994),e(1925078388,4068182383),e(2162078206,991336113),e(2614888103,633803317),e(3248222580,3479774868),e(3835390401,2666613458),e(4022224774,944711139),e(264347078,2341262773),e(604807628,2007800933),e(770255983,1495990901),e(1249150122,1856431235),e(1555081692,3175218132),e(1996064986,2198950837),e(2554220882,3999719339),e(2821834349,766784016),e(2952996808,2566594879),e(3210313671,3203337956),e(3336571891,1034457026),e(3584528711,2466948901),e(113926993,3758326383),e(338241895,168717936),e(666307205,1188179964),e(773529912,1546045734),e(1294757372,1522805485),e(1396182291,2643833823),e(1695183700,2343527390),e(1986661051,1014477480),e(2177026350,1206759142),e(2456956037,344077627),e(2730485921,1290863460),e(2820302411,3158454273),e(3259730800,3505952657),e(3345764771,106217008),e(3516065817,3606008344),e(3600352804,1432725776),e(4094571909,1467031594),e(275423344,851169720),e(430227734,3100823752),e(506948616,1363258195),e(659060556,3750685593),e(883997877,3785050280),e(958139571,3318307427),e(1322822218,3812723403),e(1537002063,2003034995),e(1747873779,3602036899),e(1955562222,1575990012),e(2024104815,1125592928),e(2227730452,2716904306),e(2361852424,442776044),e(2428436474,593698344),e(2756734187,3733110249),e(3204031479,2999351573),e(3329325298,3815920427),e(3391569614,3928383900),e(3515267271,566280711),e(3940187606,3454069534),e(4118630271,4000239992),e(116418474,1914138554),e(174292421,2731055270),e(289380356,3203993006),e(460393269,320620315),e(685471733,587496836),e(852142971,1086792851),e(1017036298,365543100),e(1126000580,2618297676),e(1288033470,3409855158),e(1501505948,4234509866),e(1607167915,987167468),e(1816402316,1246189591)],o=[],c=0;80>c;c++)o[c]=e();a=a.SHA512=r.extend({_doReset:function(){this._hash=new i.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=(h=this._hash.words)[0],n=h[1],i=h[2],a=h[3],c=h[4],u=h[5],f=h[6],h=h[7],l=r.high,d=r.low,p=n.high,g=n.low,y=i.high,v=i.low,m=a.high,b=a.low,w=c.high,S=c.low,E=u.high,C=u.low,A=f.high,B=f.low,x=h.high,T=h.low,I=l,F=d,k=p,R=g,D=y,_=v,P=m,N=b,O=w,L=S,U=E,K=C,M=A,H=B,j=x,V=T,G=0;80>G;G++){var q=o[G];if(16>G)var z=q.high=0|e[t+2*G],W=q.low=0|e[t+2*G+1];else{z=((W=(z=o[G-15]).high)>>>1|(X=z.low)<<31)^(W>>>8|X<<24)^W>>>7;var X=(X>>>1|W<<31)^(X>>>8|W<<24)^(X>>>7|W<<25),Y=((W=(Y=o[G-2]).high)>>>19|(J=Y.low)<<13)^(W<<3|J>>>29)^W>>>6,J=(J>>>19|W<<13)^(J<<3|W>>>29)^(J>>>6|W<<26),Q=(W=o[G-7]).high,Z=($=o[G-16]).high,$=$.low;z=(z=(z=z+Q+((W=X+W.low)>>>0>>0?1:0))+Y+((W+=J)>>>0>>0?1:0))+Z+((W+=$)>>>0<$>>>0?1:0),q.high=z,q.low=W}Q=O&U^~O&M,$=L&K^~L&H,q=I&k^I&D^k&D;var ee=F&R^F&_^R&_,te=(X=(I>>>28|F<<4)^(I<<30|F>>>2)^(I<<25|F>>>7),Y=(F>>>28|I<<4)^(F<<30|I>>>2)^(F<<25|I>>>7),(J=s[G]).high),re=J.low;Z=j+((O>>>14|L<<18)^(O>>>18|L<<14)^(O<<23|L>>>9))+((J=V+((L>>>14|O<<18)^(L>>>18|O<<14)^(L<<23|O>>>9)))>>>0>>0?1:0),j=M,V=H,M=U,H=K,U=O,K=L,O=P+(Z=(Z=(Z=Z+Q+((J+=$)>>>0<$>>>0?1:0))+te+((J+=re)>>>0>>0?1:0))+z+((J+=W)>>>0>>0?1:0))+((L=N+J|0)>>>0>>0?1:0)|0,P=D,N=_,D=k,_=R,k=I,R=F,I=Z+(q=X+q+((W=Y+ee)>>>0>>0?1:0))+((F=J+W|0)>>>0>>0?1:0)|0}d=r.low=d+F,r.high=l+I+(d>>>0>>0?1:0),g=n.low=g+R,n.high=p+k+(g>>>0>>0?1:0),v=i.low=v+_,i.high=y+D+(v>>>0<_>>>0?1:0),b=a.low=b+N,a.high=m+P+(b>>>0>>0?1:0),S=c.low=S+L,c.high=w+O+(S>>>0>>0?1:0),C=u.low=C+K,u.high=E+U+(C>>>0>>0?1:0),B=f.low=B+H,f.high=A+M+(B>>>0>>0?1:0),T=h.low=T+V,h.high=x+j+(T>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32}),t.SHA512=r._createHelper(a),t.HmacSHA512=r._createHmacHelper(a)}(),function(){var e=v,t=(i=e.x64).Word,r=i.WordArray,n=(i=e.algo).SHA512,i=i.SHA384=n.extend({_doReset:function(){this._hash=new r.init([new t.init(3418070365,3238371032),new t.init(1654270250,914150663),new t.init(2438529370,812702999),new t.init(355462360,4144912697),new t.init(1731405415,4290775857),new t.init(2394180231,1750603025),new t.init(3675008525,1694076839),new t.init(1203062813,3204075428)])},_doFinalize:function(){var e=n._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=n._createHelper(i),e.HmacSHA384=n._createHmacHelper(i)}(),function(){var e=v,t=(n=e.lib).WordArray,r=n.Hasher,n=e.algo,i=t.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),a=t.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),s=t.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),o=t.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),c=t.create([0,1518500249,1859775393,2400959708,2840853838]),u=t.create([1352829926,1548603684,1836072691,2053994217,0]);n=n.RIPEMD160=r.extend({_doReset:function(){this._hash=t.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;16>r;r++){var n=e[S=t+r];e[S]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var f,h,l,d,p,g,y,v,m,b,w,S=this._hash.words,E=(n=c.words,u.words),C=i.words,A=a.words,B=s.words,x=o.words;for(g=f=S[0],y=h=S[1],v=l=S[2],m=d=S[3],b=p=S[4],r=0;80>r;r+=1)w=f+e[t+C[r]]|0,w=16>r?w+((h^l^d)+n[0]):32>r?w+((h&l|~h&d)+n[1]):48>r?w+(((h|~l)^d)+n[2]):64>r?w+((h&d|l&~d)+n[3]):w+((h^(l|~d))+n[4]),w=(w=(w|=0)<>>32-B[r])+p|0,f=p,p=d,d=l<<10|l>>>22,l=h,h=w,w=g+e[t+A[r]]|0,w=16>r?w+((y^(v|~m))+E[0]):32>r?w+((y&m|v&~m)+E[1]):48>r?w+(((y|~v)^m)+E[2]):64>r?w+((y&v|~y&m)+E[3]):w+((y^v^m)+E[4]),w=(w=(w|=0)<>>32-x[r])+b|0,g=b,b=m,m=v<<10|v>>>22,v=y,y=w;w=S[1]+l+m|0,S[1]=S[2]+d+b|0,S[2]=S[3]+p+g|0,S[3]=S[4]+f+y|0,S[4]=S[0]+h+v|0,S[0]=w},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;for(t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process(),t=(e=this._hash).words,r=0;5>r;r++)n=t[r],t[r]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8);return e},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}}),e.RIPEMD160=r._createHelper(n),e.HmacRIPEMD160=r._createHmacHelper(n)}(Math),function(){var e=v,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,r){e=this._hasher=new e.init,"string"==typeof r&&(r=t.parse(r));var n=e.blockSize,i=4*n;r.sigBytes>i&&(r=e.finalize(r)),r.clamp();for(var a=this._oKey=r.clone(),s=this._iKey=r.clone(),o=a.words,c=s.words,u=0;u>6)+b.charAt(63&r);if(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=b.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=b.charAt(r>>2)+b.charAt((3&r)<<4)),w)for(;(3&n.length)>0;)n+=w;return n}function E(e){var t,r,n,i="",a=0;for(t=0;t>2),r=3&n,a=1):1==a?(i+=F(r<<2|n>>4),r=15&n,a=2):2==a?(i+=F(r),i+=F(n>>2),r=3&n,a=3):(i+=F(r<<2|n>>4),i+=F(15&n),a=0));return 1==a&&(i+=F(r<<2)),i}function C(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function A(){return new C(null)}"Microsoft Internet Explorer"==g.appName?(C.prototype.am=function(e,t,r,n,i,a){for(var s=32767&t,o=t>>15;--a>=0;){var c=32767&this[e],u=this[e++]>>15,f=o*c+u*s;i=((c=s*c+((32767&f)<<15)+r[n]+(1073741823&i))>>>30)+(f>>>15)+o*u+(i>>>30),r[n++]=1073741823&c}return i},m=30):"Netscape"!=g.appName?(C.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var s=t*this[e++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i},m=26):(C.prototype.am=function(e,t,r,n,i,a){for(var s=16383&t,o=t>>14;--a>=0;){var c=16383&this[e],u=this[e++]>>14,f=o*c+u*s;i=((c=s*c+((16383&f)<<14)+r[n]+i)>>28)+(f>>14)+o*u,r[n++]=268435455&c}return i},m=28),C.prototype.DB=m,C.prototype.DM=(1<>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function _(e){this.m=e}function P(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,t+=16),255&e||(e>>=8,t+=8),15&e||(e>>=4,t+=4),3&e||(e>>=2,t+=2),1&e||++t,t}function M(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function H(){}function j(e){return e}function V(e){this.r2=A(),this.q3=A(),C.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}_.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},_.prototype.revert=function(e){return e},_.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},_.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},_.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},P.prototype.convert=function(e){var t=A();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(C.ZERO)>0&&this.m.subTo(t,t),t},P.prototype.revert=function(e){var t=A();return e.copyTo(t),this.reduce(t),t},P.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},P.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},P.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},C.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},C.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},C.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,a=0;--n>=0;){var s=8==r?255&e[n]:k(e,n);s<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==a?this[this.t++]=s:a+r>this.DB?(this[this.t-1]|=(s&(1<>this.DB-a):this[this.t-1]|=s<=this.DB&&(a-=this.DB))}8==r&&128&e[0]&&(this.s=-1,a>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==e;)--this.t},C.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},C.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t[r+s+1]=this[r]>>i|o,o=(this[r]&a)<=0;--r)t[r]=0;t[s]=o,t.t=this.t+s+1,t.s=this.s,t.clamp()},C.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<>n;for(var s=r+1;s>n;n>0&&(t[this.t-r-1]|=(this.s&a)<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},C.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t[i]=0;for(i=0;i=0;)e[r]=0;for(r=0;r=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},C.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,a),i.lShiftTo(c,r)):(n.copyTo(a),i.copyTo(r));var u=a.t,f=a[u-1];if(0!=f){var h=f*(1<1?a[u-2]>>this.F2:0),l=this.FV/h,d=(1<=0&&(r[r.t++]=1,r.subTo(v,r)),C.ONE.dlShiftTo(u,v),v.subTo(a,a);a.t=0;){var m=r[--g]==f?this.DM:Math.floor(r[g]*l+(r[g-1]+p)*d);if((r[g]+=a.am(0,m,r,y,0,u))0&&r.rShiftTo(c,r),s<0&&C.ZERO.subTo(r,r)}}},C.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},C.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},C.prototype.exp=function(e,t){if(e>4294967295||e<1)return C.ONE;var r=A(),n=A(),i=t.convert(this),a=D(e)-1;for(i.copyTo(r);--a>=0;)if(t.sqrTo(r,n),(e&1<0)t.mulTo(n,i,r);else{var s=r;r=n,n=s}return t.revert(r)},C.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<0)for(o>o)>0&&(i=!0,a=F(r));s>=0;)o>(o+=this.DB-t)):(r=this[s]>>(o-=t)&n,o<=0&&(o+=this.DB,--s)),r>0&&(i=!0),i&&(a+=F(r));return i?a:"0"},C.prototype.negate=function(){var e=A();return C.ZERO.subTo(this,e),e},C.prototype.abs=function(){return this.s<0?this.negate():this},C.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},C.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+D(this[this.t-1]^this.s&this.DM)},C.prototype.mod=function(e){var t=A();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(C.ZERO)>0&&e.subTo(t,t),t},C.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new _(t):new P(t),this.exp(e,r)},C.ZERO=R(0),C.ONE=R(1),H.prototype.convert=j,H.prototype.revert=j,H.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},H.prototype.sqrTo=function(e,t){e.squareTo(t)},V.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=A();return e.copyTo(t),this.reduce(t),t},V.prototype.revert=function(e){return e},V.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},V.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},V.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var G=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],q=(1<<26)/G[G.length-1];function z(){this.i=0,this.j=0,this.S=new Array}C.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},C.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=R(r),i=A(),a=A(),s="";for(this.divRemTo(n,i,a);i.signum()>0;)s=(r+a.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,a);return a.intValue().toString(e)+s},C.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,a=0,s=0,o=0;o=r&&(this.dMultiply(n),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(s,0)),i&&C.ZERO.subTo(this,this)},C.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(C.ONE.shiftLeft(e-1),O,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(C.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},C.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},C.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},C.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i=0;)r[n]=0;for(n=Math.max(t-this.t,0);n0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},C.prototype.millerRabin=function(e){var t=this.subtract(C.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);(e=e+1>>1)>G.length&&(e=G.length);for(var i=A(),a=0;a>24},C.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},C.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},C.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<=0;)n<8?(r=(this[e]&(1<>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),128&r&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},C.prototype.equals=function(e){return 0==this.compareTo(e)},C.prototype.min=function(e){return this.compareTo(e)<0?this:e},C.prototype.max=function(e){return this.compareTo(e)>0?this:e},C.prototype.and=function(e){var t=A();return this.bitwiseTo(e,N,t),t},C.prototype.or=function(e){var t=A();return this.bitwiseTo(e,O,t),t},C.prototype.xor=function(e){var t=A();return this.bitwiseTo(e,L,t),t},C.prototype.andNot=function(e){var t=A();return this.bitwiseTo(e,U,t),t},C.prototype.not=function(){for(var e=A(),t=0;t=this.t?0!=this.s:!!(this[t]&1<1){var f=A();for(n.sqrTo(s[1],f);o<=u;)s[o]=A(),n.mulTo(f,s[o-2],s[o]),o+=2}var h,l,d=e.t-1,p=!0,g=A();for(i=D(e[d])-1;d>=0;){for(i>=c?h=e[d]>>i-c&u:(h=(e[d]&(1<0&&(h|=e[d-1]>>this.DB+i-c)),o=r;!(1&h);)h>>=1,--o;if((i-=o)<0&&(i+=this.DB,--d),p)s[h].copyTo(a),p=!1;else{for(;o>1;)n.sqrTo(a,g),n.sqrTo(g,a),o-=2;o>0?n.sqrTo(a,g):(l=a,a=g,g=l),n.mulTo(g,s[h],a)}for(;d>=0&&!(e[d]&1<=0?(r.subTo(n,r),t&&i.subTo(s,i),a.subTo(o,a)):(n.subTo(r,n),t&&s.subTo(i,s),o.subTo(a,o))}return 0!=n.compareTo(C.ONE)?C.ZERO:o.compareTo(e)>=0?o.subtract(e):o.signum()<0?(o.addTo(e,o),o.signum()<0?o.add(e):o):o},C.prototype.pow=function(e){return this.exp(e,new H)},C.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},C.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=G[G.length-1]){for(t=0;t>8&255,X[Y++]^=e>>16&255,X[Y++]^=e>>24&255,Y>=J&&(Y-=J)}((new Date).getTime())}if(null==X){var Z;if(X=new Array,Y=0,void 0!==y&&(void 0!==y.crypto||void 0!==y.msCrypto)){var $=y.crypto||y.msCrypto;if($.getRandomValues){var ee=new Uint8Array(32);for($.getRandomValues(ee),Z=0;Z<32;++Z)X[Y++]=ee[Z]}else if("Netscape"==g.appName&&g.appVersion<"5"){var te=y.crypto.random(32);for(Z=0;Z>>8,X[Y++]=255&Z;Y=0,Q()}function re(){if(null==W){for(Q(),(W=new z).init(X),Y=0;Y0&&t.length>0))throw"Invalid RSA public key";this.n=ie(e,16),this.e=parseInt(t,16)}},ae.prototype.type="RSA",ae.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),r=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(r)<0;)t=t.add(this.p);return t.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},ae.prototype.setPrivate=function(e,t,r){if(this.isPrivate=!0,"string"!=typeof e)this.n=e,this.e=t,this.d=r;else{if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA private key";this.n=ie(e,16),this.e=parseInt(t,16),this.d=ie(r,16)}},ae.prototype.setPrivateEx=function(e,t,r,n,i,a,s,o){if(this.isPrivate=!0,this.isPublic=!1,null==e)throw"RSASetPrivateEx N == null";if(null==t)throw"RSASetPrivateEx E == null";if(0==e.length)throw"RSASetPrivateEx N.length == 0";if(0==t.length)throw"RSASetPrivateEx E.length == 0";if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA private key in RSASetPrivateEx";this.n=ie(e,16),this.e=parseInt(t,16),this.d=ie(r,16),this.p=ie(n,16),this.q=ie(i,16),this.dmp1=ie(a,16),this.dmq1=ie(s,16),this.coeff=ie(o,16)},ae.prototype.generate=function(e,t){var r=new ne,n=e>>1;this.e=parseInt(t,16);for(var i=new C(t,16),a=e/2-100,s=C.ONE.shiftLeft(a);;){for(;this.p=new C(e-n,1,r),0!=this.p.subtract(C.ONE).gcd(i).compareTo(C.ONE)||!this.p.isProbablePrime(10););for(;this.q=new C(n,1,r),0!=this.q.subtract(C.ONE).gcd(i).compareTo(C.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var c=this.q.subtract(this.p).abs();if(!(c.bitLength()0;--t){a=a.twice();var f=n.testBit(t);f!=r.testBit(t)&&(a=a.add(f?this:i))}for(t=o.bitLength()-2;t>0;--t){c=c.twice();var h=o.testBit(t);h!=s.testBit(t)&&(c=c.add(h?c:u))}return a},oe.prototype.multiplyTwo=function(e,t,r){var n;n=e.bitLength()>r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var i=this.curve.getInfinity(),a=this.add(t);n>=0;)i=i.twice(),e.testBit(n)?i=r.testBit(n)?i.add(a):i.add(this):r.testBit(n)&&(i=i.add(t)),--n;return i},ce.prototype.getQ=function(){return this.q},ce.prototype.getA=function(){return this.a},ce.prototype.getB=function(){return this.b},ce.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},ce.prototype.getInfinity=function(){return this.infinity},ce.prototype.fromBigInteger=function(e){return new se(this.q,e)},ce.prototype.decodePointHex=function(e){switch(parseInt(e.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var t=e.substr(0,2),r=(e.substr(2),this.fromBigInteger(new C(o,16))),n=this.getA(),i=this.getB(),a=r.square().add(n).multiply(r).add(i).sqrt();return"03"==t&&(a=a.negate()),new oe(this,r,a);case 4:case 6:case 7:var s=(e.length-2)/2,o=e.substr(2,s),c=e.substr(s+2,s);return new oe(this,this.fromBigInteger(new C(o,16)),this.fromBigInteger(new C(c,16)));default:return null}},se.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},oe.prototype.getEncoded=function(e){var t=function(e,t){var r=e.toByteArrayUnsigned();if(tr.length;)r.unshift(0);return r},r=this.getX().toBigInteger(),n=this.getY().toBigInteger(),i=t(r,32);return e?n.isEven()?i.unshift(2):i.unshift(3):(i.unshift(4),i=i.concat(t(n,32))),i},oe.decodeFrom=function(e,t){t[0];var r=t.length-1,n=t.slice(1,1+r/2),i=t.slice(1+r/2,1+r);n.unshift(0),i.unshift(0);var a=new C(n),s=new C(i);return new oe(e,e.fromBigInteger(a),e.fromBigInteger(s))},oe.decodeFromHex=function(e,t){t.substr(0,2);var r=t.length-2,n=t.substr(2,r/2),i=t.substr(2+r/2,r/2),a=new C(n,16),s=new C(i,16);return new oe(e,e.fromBigInteger(a),e.fromBigInteger(s))},oe.prototype.add2D=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.x.equals(e.x))return this.y.equals(e.y)?this.twice():this.curve.getInfinity();var t=e.x.subtract(this.x),r=e.y.subtract(this.y).divide(t),n=r.square().subtract(this.x).subtract(e.x),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new oe(this.curve,n,i)},oe.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=this.curve.fromBigInteger(C.valueOf(2)),t=this.curve.fromBigInteger(C.valueOf(3)),r=this.x.square().multiply(t).add(this.curve.a).divide(this.y.multiply(e)),n=r.square().subtract(this.x.multiply(e)),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new oe(this.curve,n,i)},oe.prototype.multiply2D=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,n=r.multiply(new C("3")),i=this.negate(),a=this;for(t=n.bitLength()-2;t>0;--t){a=a.twice();var s=n.testBit(t);s!=r.testBit(t)&&(a=a.add2D(s?this:i))}return a},oe.prototype.isOnCurve=function(){var e=this.getX().toBigInteger(),t=this.getY().toBigInteger(),r=this.curve.getA().toBigInteger(),n=this.curve.getB().toBigInteger(),i=this.curve.getQ(),a=t.multiply(t).mod(i),s=e.multiply(e).multiply(e).add(r.multiply(e)).add(n).mod(i);return a.equals(s)},oe.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},oe.prototype.validate=function(){var e=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var t=this.getX().toBigInteger(),r=this.getY().toBigInteger();if(t.compareTo(C.ONE)<0||t.compareTo(e.subtract(C.ONE))>0)throw new Error("x coordinate out of bounds");if(r.compareTo(C.ONE)<0||r.compareTo(e.subtract(C.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(e).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};var ue=function(){var e=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),t=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),r={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function n(e,t,n){return t?r[t]:String.fromCharCode(parseInt(n,16))}var i=new String(""),a=Object.hasOwnProperty;return function(r,s){var o,c,u=r.match(e),f=u[0],h=!1;"{"===f?o={}:"["===f?o=[]:(o=[],h=!0);for(var l=[o],d=1-h,p=u.length;d=0;)delete r[n[c]]}return s.call(e,t,r)};o=y({"":o},"")}return o}}();void 0!==fe&&fe||(fe={}),void 0!==fe.asn1&&fe.asn1||(fe.asn1={}),fe.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){return Ve(e)},this.getPEMStringFromHex=function(e,t){return Be(e,t)},this.newObject=function(e){var t=fe.asn1,r=t.ASN1Object,n=t.DERBoolean,i=t.DERInteger,a=t.DERBitString,s=t.DEROctetString,o=t.DERNull,c=t.DERObjectIdentifier,u=t.DEREnumerated,f=t.DERUTF8String,h=t.DERNumericString,l=t.DERPrintableString,d=t.DERTeletexString,p=t.DERIA5String,g=t.DERUTCTime,y=t.DERGeneralizedTime,v=t.DERVisibleString,m=t.DERBMPString,b=t.DERSequence,w=t.DERSet,S=t.DERTaggedObject,E=t.ASN1Util.newObject;if(e instanceof t.ASN1Object)return e;var C=Object.keys(e);if(1!=C.length)throw new Error("key of param shall be only one.");var A=C[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+A+":"))throw new Error("undefined key: "+A);if("bool"==A)return new n(e[A]);if("int"==A)return new i(e[A]);if("bitstr"==A)return new a(e[A]);if("octstr"==A)return new s(e[A]);if("null"==A)return new o(e[A]);if("oid"==A)return new c(e[A]);if("enum"==A)return new u(e[A]);if("utf8str"==A)return new f(e[A]);if("numstr"==A)return new h(e[A]);if("prnstr"==A)return new l(e[A]);if("telstr"==A)return new d(e[A]);if("ia5str"==A)return new p(e[A]);if("utctime"==A)return new g(e[A]);if("gentime"==A)return new y(e[A]);if("visstr"==A)return new v(e[A]);if("bmpstr"==A)return new m(e[A]);if("asn1"==A)return new r(e[A]);if("seq"==A){for(var B=e[A],x=[],T=0;T15)throw new Error("ASN.1 length too long to represent by 8x: n = "+e.toString(16));return(128+r).toString(16)+t},this.tohex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.getValueHex=function(){return this.tohex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(e){this.params=e},null!=e&&null!=e.tlv&&(this.hTLV=e.tlv,this.isModified=!1)},fe.asn1.DERAbstractString=function(e){fe.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=we(this.s).toLowerCase()},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},We(fe.asn1.DERAbstractString,fe.asn1.ASN1Object),fe.asn1.DERAbstractTime=function(e){fe.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){var t=e.getTime()+6e4*e.getTimezoneOffset();return new Date(t)},this.formatDate=function(e,t,r){var n=this.zeroPadding,i=this.localDateToUTC(e),a=String(i.getFullYear());"utc"==t&&(a=a.substr(2,2));var s=a+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var o=i.getMilliseconds();if(0!=o){var c=n(String(o),3);s=s+"."+(c=c.replace(/[0]+$/,""))}}return s+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.setByParam=function(e){this.hV=null,this.hTLV=null,this.params=e},this.getString=function(){},this.setString=function(e){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.str=e},this.setByDate=function(e){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.date=e},this.setByDateValue=function(e,t,r,n,i,a){var s=new Date(Date.UTC(e,t-1,r,n,i,a,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},We(fe.asn1.DERAbstractTime,fe.asn1.ASN1Object),fe.asn1.DERAbstractStructured=function(e){fe.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},We(fe.asn1.DERAbstractStructured,fe.asn1.ASN1Object),fe.asn1.DERBoolean=function(e){fe.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==e?"010100":"0101ff"},We(fe.asn1.DERBoolean,fe.asn1.ASN1Object),fe.asn1.DERInteger=function(e){fe.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.params=null;var t=Ve;this.setByBigInteger=function(e){this.isModified=!0,this.params={bigint:e}},this.setByInteger=function(e){this.isModified=!0,this.params=e},this.setValueHex=function(e){this.isModified=!0,this.params={hex:e}},this.getFreshValueHex=function(){var e=this.params,r=null;if(null==e)throw new Error("value not set");if("object"==typeof e&&null!=e.hex)return this.hV=e.hex,this.hV;if("number"==typeof e)r=new C(String(e),10);else if(null!=e.int)r=new C(String(e.int),10);else{if(null==e.bigint)throw new Error("wrong parameter");r=e.bigint}return this.hV=t(r),this.hV},null!=e&&(this.params=e)},We(fe.asn1.DERInteger,fe.asn1.ASN1Object),fe.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=fe.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.tohex()}fe.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7>6).toString(16)+n.toString(16))}n=128|(15&t)<<2|(192&r)>>6;var i=128|63&r;return Se((224|(240&t)>>4).toString(16)+n.toString(16)+i.toString(16))}));return t.join("")}function Le(e){for(var t=encodeURIComponent(e),r="",n=0;n"7"?"00"+e:e}function He(e){if(!Ue(e))return null;try{var t=[],r=e.substr(0,2),n=parseInt(r,16);t[0]=new String(Math.floor(n/40)),t[1]=new String(n%40);for(var i=e.substr(2),a=[],s=0;s0&&(u=u+"."+o.join(".")),u}catch(e){return null}}function je(e){return Ve(new C(String(e),10))}function Ve(e){var t=e.toString(16);if("-"!=t.substr(0,1))return t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t),t;var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i=n)break}return s},de.getNthChildIdx=function(e,t,r){return de.getChildIdx(e,t)[r]},de.getIdxbyList=function(e,t,r,n){var i,a,s=de;return 0==r.length?void 0!==n&&e.substr(t,2)!==n?-1:t:(i=r.shift())>=(a=s.getChildIdx(e,t)).length?-1:s.getIdxbyList(e,a[i],r,n)},de.getIdxbyListEx=function(e,t,r,n){var i,a,s=de;if(0==r.length)return void 0!==n&&e.substr(t,2)!==n?-1:t;i=r.shift(),a=s.getChildIdx(e,t);for(var o=0,c=0;c=e.length?null:i.getTLV(e,a)},de.getTLVbyListEx=function(e,t,r,n){var i=de,a=i.getIdxbyListEx(e,t,r,n);return-1==a?null:i.getTLV(e,a)},de.getVbyList=function(e,t,r,n,i){var a,s,o=de;return-1==(a=o.getIdxbyList(e,t,r,n))||a>=e.length?null:(s=o.getV(e,a),!0===i&&(s=s.substr(2)),s)},de.getVbyListEx=function(e,t,r,n,i){var a,s,o=de;return-1==(a=o.getIdxbyListEx(e,t,r,n))?null:(s=o.getV(e,a),"03"==e.substr(a,2)&&!1!==i&&(s=s.substr(2)),s)},de.getInt=function(e,t,r){null==r&&(r=-1);try{var n=e.substr(t,2);if("02"!=n&&"03"!=n)return r;var i=de.getV(e,t);return"02"==n?parseInt(i,16):function(e){if(e.length%2!=0)return-1;if(null==(e=e.toLowerCase()).match(/^[0-9a-f]+$/))return-1;try{var t=e.substr(0,2);if("00"==t)return parseInt(e.substr(2),16);var r=parseInt(t,16);if(r>7)return-1;var n=e.substr(2),i=parseInt(n,16).toString(2);"0"==i&&(i="00000000"),i=i.slice(0,0-r);var a=parseInt(i,2);return NaN==a?-1:a}catch(e){return-1}}(i)}catch(e){return r}},de.getOID=function(e,t,r){null==r&&(r=null);try{return"06"!=e.substr(t,2)?r:He(de.getV(e,t))}catch(e){return r}},de.getOIDName=function(e,t,r){null==r&&(r=null);try{var n=de.getOID(e,t,r);if(n==r)return r;var i=fe.asn1.x509.OID.oid2name(n);return""==i?n:i}catch(e){return r}},de.getString=function(e,t,r){null==r&&(r=null);try{return Ce(de.getV(e,t))}catch(e){return r}},de.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},r=[],n=e.substr(0,2),i=parseInt(n,16);r[0]=new String(Math.floor(i/40)),r[1]=new String(i%40);for(var a=e.substr(2),s=[],o=0;o0&&(f=f+"."+c.join(".")),f},de.dump=function(e,t,r,n){var i=de,a=i.getV,s=i.dump,o=i.getChildIdx,c=e;e instanceof fe.asn1.ASN1Object&&(c=e.tohex());var u=function(e,t){return e.length<=2*t?e:e.substr(0,t)+"..(total "+e.length/2+"bytes).."+e.substr(e.length-t,t)};void 0===t&&(t={ommit_long_octet:32}),void 0===r&&(r=0),void 0===n&&(n="");var f,h=t.ommit_long_octet;if("01"==(f=c.substr(r,2)))return"00"==(l=a(c,r))?n+"BOOLEAN FALSE\n":n+"BOOLEAN TRUE\n";if("02"==f)return n+"INTEGER "+u(l=a(c,r),h)+"\n";if("03"==f){var l=a(c,r);return i.isASN1HEX(l.substr(2))?(S=n+"BITSTRING, encapsulates\n")+s(l.substr(2),t,0,n+" "):n+"BITSTRING "+u(l,h)+"\n"}if("04"==f)return l=a(c,r),i.isASN1HEX(l)?(S=n+"OCTETSTRING, encapsulates\n")+s(l,t,0,n+" "):n+"OCTETSTRING "+u(l,h)+"\n";if("05"==f)return n+"NULL\n";if("06"==f){var d=a(c,r),p=fe.asn1.ASN1Util.oidHexToInt(d),g=fe.asn1.x509.OID.oid2name(p),y=p.replace(/\./g," ");return""!=g?n+"ObjectIdentifier "+g+" ("+y+")\n":n+"ObjectIdentifier ("+y+")\n"}if("0a"==f)return n+"ENUMERATED "+parseInt(a(c,r))+"\n";if("0c"==f)return n+"UTF8String '"+Se(a(c,r))+"'\n";if("13"==f)return n+"PrintableString '"+Se(a(c,r))+"'\n";if("14"==f)return n+"TeletexString '"+Se(a(c,r))+"'\n";if("16"==f)return n+"IA5String '"+Se(a(c,r))+"'\n";if("17"==f)return n+"UTCTime "+Se(a(c,r))+"\n";if("18"==f)return n+"GeneralizedTime "+Se(a(c,r))+"\n";if("1a"==f)return n+"VisualString '"+Se(a(c,r))+"'\n";if("1e"==f)return n+"BMPString '"+Oe(a(c,r))+"'\n";if("30"==f){if("3000"==c.substr(r,4))return n+"SEQUENCE {}\n";S=n+"SEQUENCE\n";var v=t;if((2==(w=o(c,r)).length||3==w.length)&&"06"==c.substr(w[0],2)&&"04"==c.substr(w[w.length-1],2)){g=i.oidname(a(c,w[0]));var m=JSON.parse(JSON.stringify(t));m.x509ExtName=g,v=m}for(var b=0;b4?{enum:{hex:y}}:{enum:parseInt(y,16)};if("30"==p||"31"==p)return g[d[p]]=function(e){for(var t=[],n=s(e,0),i=0;i31)&&128==(192&r)&&(31&r)==n}catch(e){return!1}},de.isASN1HEX=function(e){var t=de;if(e.length%2==1)return!1;var r=t.getVblen(e,0),n=e.substr(0,2),i=t.getL(e,0);return e.length-n.length-i.length==2*r},de.checkStrictDER=function(e,t,r,n,i){var a=de;if(void 0===r){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!fe.lang.String.isHex(e))throw new Error("not hex string");r=e.length,i=(n=e.length/2)<128?1:Math.ceil(n.toString(16))+1}if(a.getL(e,t).length>2*i)throw new Error("L of TLV too long: idx="+t);var s=a.getVblen(e,t);if(s>n)throw new Error("value of L too long than hex: idx="+t);var o=a.getTLV(e,t),c=o.length-2-a.getL(e,t).length;if(c!==2*s)throw new Error("V string length and L's value not the same:"+c+"/"+2*s);if(0===t&&e.length!=o.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+o.length);var u=e.substr(t,2);if("02"===u){var f=a.getVidx(e,t);if("00"==e.substr(f,2)&&e.charCodeAt(f+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(u,16)){for(var h=a.getVblen(e,t),l=0,d=a.getChildIdx(e,t),p=0;p0&&e.push(new n({tag:"a3",obj:new u(t.ext)})),new fe.asn1.DERSequence({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.x509.TBSCertificate,fe.asn1.ASN1Object),fe.asn1.x509.Extensions=function(e){fe.asn1.x509.Extensions.superclass.constructor.call(this);var t=fe.asn1,r=t.DERSequence,n=t.x509;this.aParam=[],this.setByParam=function(e){this.aParam=e},this.tohex=function(){for(var e=[],t=0;t-1&&e.push(new n({int:this.pathLen}));var t=new i({array:e});return this.asn1ExtnValue=t,this.asn1ExtnValue.tohex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==e&&(void 0!==e.cA&&(this.cA=e.cA),void 0!==e.pathLen&&(this.pathLen=e.pathLen))},We(fe.asn1.x509.BasicConstraints,fe.asn1.x509.Extension),fe.asn1.x509.CRLDistributionPoints=function(e){fe.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,e);var t=fe.asn1,r=t.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.setByDPArray=function(e){for(var n=[],i=0;i0&&e.push(new r({array:t}))}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},We(fe.asn1.x509.PolicyInformation,fe.asn1.ASN1Object),fe.asn1.x509.PolicyQualifierInfo=function(e){fe.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var t=fe.asn1,r=t.DERSequence,n=t.DERIA5String,i=t.DERObjectIdentifier,a=t.x509.UserNotice;this.params=null,this.tohex=function(){return void 0!==this.params.cps?new r({array:[new i({oid:"1.3.6.1.5.5.7.2.1"}),new n({str:this.params.cps})]}).tohex():null!=this.params.unotice?new r({array:[new i({oid:"1.3.6.1.5.5.7.2.2"}),new a(this.params.unotice)]}).tohex():void 0},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},We(fe.asn1.x509.PolicyQualifierInfo,fe.asn1.ASN1Object),fe.asn1.x509.UserNotice=function(e){fe.asn1.x509.UserNotice.superclass.constructor.call(this,e);var t=fe.asn1.DERSequence,r=(fe.asn1.DERInteger,fe.asn1.x509.DisplayText),n=fe.asn1.x509.NoticeReference;this.params=null,this.tohex=function(){var e=[];return void 0!==this.params.noticeref&&e.push(new n(this.params.noticeref)),void 0!==this.params.exptext&&e.push(new r(this.params.exptext)),new t({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},We(fe.asn1.x509.UserNotice,fe.asn1.ASN1Object),fe.asn1.x509.NoticeReference=function(e){fe.asn1.x509.NoticeReference.superclass.constructor.call(this,e);var t=fe.asn1.DERSequence,r=fe.asn1.DERInteger,n=fe.asn1.x509.DisplayText;this.params=null,this.tohex=function(){var e=[];if(void 0!==this.params.org&&e.push(new n(this.params.org)),void 0!==this.params.noticenum){for(var i=[],a=this.params.noticenum,s=0;s0)for(var e=0;e0;i++){var a=t.shift();if(!0===r){var s=(n.pop()+","+a).replace(/\\,/g,",");n.push(s),r=!1}else n.push(a);"\\"===a.substr(-1,1)&&(r=!0)}return n=n.map((function(e){return e.replace("/","\\/")})),n.reverse(),"/"+n.join("/")},fe.asn1.x509.X500Name.ldapToOneline=function(e){return fe.asn1.x509.X500Name.ldapToCompat(e)},fe.asn1.x509.RDN=function(e){fe.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=fe.asn1.x509.AttributeTypeAndValue;this.setByParam=function(e){void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.str&&this.addByMultiValuedString(e.str),void 0!==e.array&&(this.paramArray=e.array)},this.addByString=function(e){this.asn1Array.push(new fe.asn1.x509.AttributeTypeAndValue({str:e,rule:this.sRule}))},this.addByMultiValuedString=function(e){for(var t=fe.asn1.x509.RDN.parseString(e),r=0;r0)for(var e=0;e0;i++){var a=t.shift();if(!0===r){var s=(n.pop()+"+"+a).replace(/\\\+/g,"+");n.push(s),r=!1}else n.push(a);"\\"===a.substr(-1,1)&&(r=!0)}var o=!1,c=[];for(i=0;n.length>0;i++){if(a=n.shift(),!0===o){var u=c.pop();a.match(/"$/)?(s=(u+"+"+a).replace(/^([^=]+)="(.*)"$/,"$1=$2"),c.push(s),o=!1):c.push(u+"+"+a)}else c.push(a);a.match(/^[^=]+="/)&&(o=!0)}return c},fe.asn1.x509.AttributeTypeAndValue=function(e){fe.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var t=fe,r=t.asn1,n=r.DERSequence,i=r.DERUTF8String,a=r.DERPrintableString,s=r.DERTeletexString,o=r.DERIA5String,c=r.DERVisibleString,u=r.DERBMPString,f=t.lang.String.isMail,h=t.lang.String.isPrintable;this.setByParam=function(e){if(void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.ds&&(this.dsType=e.ds),void 0===e.value&&void 0!==e.str){var t=e.str.match(/^([^=]+)=(.+)$/);if(!t)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.sType=t[1],this.sValue=t[2]}else this.sType=e.type,this.sValue=e.value},this.setByString=function(e,t){void 0!==t&&(this.sRule=t);var r=e.match(/^([^=]+)=(.+)$/);if(!r)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.setByAttrTypeAndValueStr(r[1],r[2])},this._getDsType=function(){var e=this.sType,t=this.sValue,r=this.sRule;return"prn"===r?"CN"==e&&f(t)?"ia5":h(t)?"prn":"utf8":"utf8"===r?"CN"==e&&f(t)?"ia5":"C"==e?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(e,t,r){void 0!==r&&(this.sRule=r),this.sType=e,this.sValue=t},this.getValueObj=function(e,t){if("utf8"==e)return new i({str:t});if("prn"==e)return new a({str:t});if("tel"==e)return new s({str:t});if("ia5"==e)return new o({str:t});if("vis"==e)return new c({str:t});if("bmp"==e)return new u({str:t});throw new Error("unsupported directory string type: type="+e+" value="+t)},this.tohex=function(){null==this.dsType&&(this.dsType=this._getDsType());var e=fe.asn1.x509.OID.atype2obj(this.sType),t=this.getValueObj(this.dsType,this.sValue),r=new n({array:[e,t]});return this.TLV=r.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.x509.AttributeTypeAndValue,fe.asn1.ASN1Object),fe.asn1.x509.SubjectPublicKeyInfo=function(e){fe.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var t=fe,r=t.asn1,n=r.DERInteger,i=r.DERBitString,a=r.DERObjectIdentifier,s=r.DERSequence,o=r.ASN1Util.newObject,c=r.x509.AlgorithmIdentifier,u=t.crypto;u.ECDSA,u.DSA,this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new s({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.tohex=function(){var e=this.getASN1Object();return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.setPubKey=function(e){try{if(e instanceof ae){var t=o({seq:[{int:{bigint:e.n}},{int:{int:e.e}}]}).tohex();this.asn1AlgId=new c({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+t})}}catch(e){}try{if(e instanceof fe.crypto.ECDSA){var r=new a({name:e.curveName});this.asn1AlgId=new c({name:"ecPublicKey",asn1params:r}),this.asn1SubjPKey=new i({hex:"00"+e.pubKeyHex})}}catch(e){}try{if(e instanceof fe.crypto.DSA){r=new o({seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}),this.asn1AlgId=new c({name:"dsa",asn1params:r});var s=new n({bigint:e.y});this.asn1SubjPKey=new i({hex:"00"+s.tohex()})}}catch(e){}},void 0!==e&&this.setPubKey(e)},We(fe.asn1.x509.SubjectPublicKeyInfo,fe.asn1.ASN1Object),fe.asn1.x509.Time=function(e){fe.asn1.x509.Time.superclass.constructor.call(this);var t=fe.asn1,r=t.DERUTCTime,n=t.DERGeneralizedTime;this.params=null,this.type=null,this.setTimeParams=function(e){this.timeParams=e},this.setByParam=function(e){this.params=e},this.getType=function(e){return e.match(/^[0-9]{12}Z$/)?"utc":e.match(/^[0-9]{14}Z$/)?"gen":e.match(/^[0-9]{12}\.[0-9]+Z$/)?"utc":e.match(/^[0-9]{14}\.[0-9]+Z$/)?"gen":null},this.tohex=function(){var e=this.params,t=null;if("string"==typeof e&&(e={str:e}),null==e||!e.str||null!=e.type&&null!=e.type||(e.type=this.getType(e.str)),null!=e&&e.str?("utc"==e.type&&(t=new r(e.str)),"gen"==e.type&&(t=new n(e.str))):t="gen"==this.type?new n:new r,null==t)throw new Error("wrong setting for Time");return this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},fe.asn1.x509.Time_bak=function(e){fe.asn1.x509.Time_bak.superclass.constructor.call(this);var t=fe.asn1,r=t.DERUTCTime,n=t.DERGeneralizedTime;this.setTimeParams=function(e){this.timeParams=e},this.tohex=function(){var e=null;return e=null!=this.timeParams?"utc"==this.type?new r(this.timeParams):new n(this.timeParams):"utc"==this.type?new r:new n,this.TLV=e.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},this.type="utc",void 0!==e&&(void 0!==e.type?this.type=e.type:void 0!==e.str&&(e.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),e.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=e)},We(fe.asn1.x509.Time,fe.asn1.ASN1Object),fe.asn1.x509.AlgorithmIdentifier=function(e){fe.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var t=fe.asn1,r=t.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.tohex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw new Error("algorithm not specified");if(null!==this.nameAlg){var e=null;for(var n in r)n===this.nameAlg&&(e=r[n]);if(null!==e)return this.hTLV=e,this.hTLV}null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=t.x509.OID.name2obj(this.nameAlg));var i=[this.asn1Alg];null!==this.asn1Params&&i.push(this.asn1Params);var a=new t.DERSequence({array:i});return this.hTLV=a.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(void 0!==e.name&&(this.nameAlg=e.name),void 0!==e.asn1params&&(this.asn1Params=e.asn1params),void 0!==e.paramempty&&(this.paramEmpty=e.paramempty)),null===this.asn1Params&&!1===this.paramEmpty&&null!==this.nameAlg){void 0!==this.nameAlg.name&&(this.nameAlg=this.nameAlg.name);var n=this.nameAlg.toLowerCase();"withdsa"!==n.substr(-7,7)&&"withecdsa"!==n.substr(-9,9)&&(this.asn1Params=new t.DERNull)}},We(fe.asn1.x509.AlgorithmIdentifier,fe.asn1.ASN1Object),fe.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},fe.asn1.x509.GeneralName=function(e){fe.asn1.x509.GeneralName.superclass.constructor.call(this);var t=fe.asn1,r=t.x509,n=r.X500Name,i=r.OtherName,a=t.DERIA5String,s=(t.DERPrintableString,t.DEROctetString),o=t.DERTaggedObject,c=t.ASN1Object,u=Error;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e,t,r=this.params,f=!1;if(void 0!==r.other)e="a0",t=new i(r.other);else if(void 0!==r.rfc822)e="81",t=new a({str:r.rfc822});else if(void 0!==r.dns)e="82",t=new a({str:r.dns});else if(void 0!==r.dn)e="a4",f=!0,t="string"==typeof r.dn?new n({str:r.dn}):r.dn instanceof fe.asn1.x509.X500Name?r.dn:new n(r.dn);else if(void 0!==r.ldapdn)e="a4",f=!0,t=new n({ldapstr:r.ldapdn});else if(void 0!==r.certissuer||void 0!==r.certsubj){var h,l;e="a4",f=!0;var d=null;if(void 0!==r.certsubj?(h=!1,l=r.certsubj):(h=!0,l=r.certissuer),l.match(/^[0-9A-Fa-f]+$/),-1!=l.indexOf("-----BEGIN ")&&(d=xe(l)),null==d)throw new Error("certsubj/certissuer not cert");var p,g=new Ze;g.hex=d,p=h?g.getIssuerHex():g.getSubjectHex(),(t=new c).hTLV=p}else if(void 0!==r.uri)e="86",t=new a({str:r.uri});else{if(void 0===r.ip)throw new u("improper params");var y;e="87";var v=r.ip;try{if(v.match(/^[0-9a-f]+$/)){var m=v.length;if(8!=m&&16!=m&&32!=m&&64!=m)throw"err";y=v}else y=Pe(v)}catch(e){throw new u("malformed IP address: "+r.ip+":"+e.message)}t=new s({hex:y})}return new o({tag:e,explicit:f,obj:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},We(fe.asn1.x509.GeneralName,fe.asn1.ASN1Object),fe.asn1.x509.GeneralNames=function(e){fe.asn1.x509.GeneralNames.superclass.constructor.call(this);var t=fe.asn1;this.setByParamArray=function(e){for(var r=0;r0){for(var r=a(e.valhex,t[0]),n=f(r,0),i=[],s=0;s1){var u=a(e.valhex,t[1]);e.polhex=u}delete e.valhex},this.setSignaturePolicyIdentifier=function(e){var r=f(e.valhex,0);if(r.length>0){var s=n.getOID(e.valhex,r[0]);e.oid=s}if(r.length>1){var o=new t,c=f(e.valhex,r[1]),u=a(e.valhex,c[0]),h=o.getAlgorithmIdentifierName(u);e.alg=h;var l=i(e.valhex,c[1]);e.hash=l}delete e.valhex},this.setSigningCertificateV2=function(e){var t=f(e.valhex,0);if(t.length>0){for(var r=a(e.valhex,t[0]),n=f(r,0),i=[],s=0;s1){var u=a(e.valhex,t[1]);e.polhex=u}delete e.valhex},this.getESSCertID=function(e){var t={},r=f(e,0);if(r.length>0){var n=i(e,r[0]);t.hash=n}if(r.length>1){var s=a(e,r[1]),o=this.getIssuerSerial(s);null!=o.serial&&(t.serial=o.serial),null!=o.issuer&&(t.issuer=o.issuer)}return t},this.getESSCertIDv2=function(t){var n={},s=f(t,0);if(s.length<1||3o+1){var h=a(t,s[o+1]),l=this.getIssuerSerial(h);n.issuer=l.issuer,n.serial=l.serial}return n},this.getIssuerSerial=function(e){var t={},n=f(e,0),s=a(e,n[0]),o=r.getGeneralNames(s)[0].dn;t.issuer=o;var c=i(e,n[1]);return t.serial={hex:c},t},this.getCertificateSet=function(e){for(var t=f(e,0),r=[],n=0;n=0;s--)i+=n[s];return i}if("string"==typeof e&&null!=a[e])return qe([e],a);if("object"==typeof e&&null!=e.length)return qe(e,a);throw new t("wrong params")},this.tohex=function(){this.params;var e=this.getBinValue();return new n({bin:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},We(fe.asn1.tsp.PKIFailureInfo,fe.asn1.ASN1Object),fe.asn1.tsp.AbstractTSAAdapter=function(e){this.getTSTHex=function(e,t){throw"not implemented yet"}},fe.asn1.tsp.SimpleTSAAdapter=function(e){var t=fe,r=t.asn1.tsp,n=t.crypto.Util.hashHex;r.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(e,t){var i=n(e,t);this.params.econtent.content.messageImprint={alg:t,hash:i},this.params.econtent.content.serial={int:this.serial++};var a=Math.floor(1e9*Math.random());return this.params.econtent.content.nonce={int:a},new r.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==e&&(this.params=e)},We(fe.asn1.tsp.SimpleTSAAdapter,fe.asn1.tsp.AbstractTSAAdapter),fe.asn1.tsp.FixedTSAAdapter=function(e){var t=fe,r=t.asn1.tsp,n=t.crypto.Util.hashHex;r.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(e,t){var i=n(e,t);return this.params.econtent.content.messageImprint={alg:t,hash:i},new r.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==e&&(this.params=e)},We(fe.asn1.tsp.FixedTSAAdapter,fe.asn1.tsp.AbstractTSAAdapter),fe.asn1.tsp.TSPUtil=new function(){},fe.asn1.tsp.TSPUtil.newTimeStampToken=function(e){return new fe.asn1.tsp.TimeStampToken(e)},fe.asn1.tsp.TSPUtil.parseTimeStampReq=function(e){return(new fe.asn1.tsp.TSPParser).getTimeStampReq(e)},fe.asn1.tsp.TSPUtil.parseMessageImprint=function(e){return(new fe.asn1.tsp.TSPParser).getMessageImprint(e)},fe.asn1.tsp.TSPParser=function(){Error;var e=new Ze,t=de,r=t.getV,n=t.getTLV,i=t.getIdxbyList,a=(t.getTLVbyListEx,t.getChildIdx),s=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],o={0:"badAlg",2:"badRequest",5:"badDataFormat",14:"timeNotAvailable",15:"unacceptedPolicy",16:"unacceptedExtension",17:"addInfoNotAvailable",25:"systemFailure"};this.getResponse=function(e){var t=a(e,0);if(1==t.length)return this.getPKIStatusInfo(n(e,t[0]));if(t.length>1){var r=this.getPKIStatusInfo(n(e,t[0])),i=n(e,t[1]),s=this.getToken(i);return s.statusinfo=r,s}},this.getToken=function(e){var t=(new fe.asn1.cms.CMSParser).getCMSSignedData(e);return this.setTSTInfo(t),t},this.setTSTInfo=function(e){var t=e.econtent;if("tstinfo"==t.type){var r=t.content.hex,n=this.getTSTInfo(r);t.content=n}},this.getTSTInfo=function(t){var i={},s=a(t,0),o=r(t,s[1]);i.policy=He(o);var c=n(t,s[2]);i.messageImprint=this.getMessageImprint(c);var u=r(t,s[3]);i.serial={hex:u};var f=r(t,s[4]);i.genTime={str:Se(f)};var h=0;if(s.length>5&&"30"==t.substr(s[5],2)){var l=n(t,s[5]);i.accuracy=this.getAccuracy(l),h++}if(s.length>5+h&&"01"==t.substr(s[5+h],2)&&("ff"==r(t,s[5+h])&&(i.ordering=!0),h++),s.length>5+h&&"02"==t.substr(s[5+h],2)){var d=r(t,s[5+h]);i.nonce={hex:d},h++}if(s.length>5+h&&"a0"==t.substr(s[5+h],2)){var p=n(t,s[5+h]);p="30"+p.substr(2),pGeneralNames=e.getGeneralNames(p);var g=pGeneralNames[0].dn;i.tsa=g,h++}if(s.length>5+h&&"a1"==t.substr(s[5+h],2)){var y=n(t,s[5+h]);y="30"+y.substr(2);var v=e.getExtParamArray(y);i.ext=v,h++}return i},this.getAccuracy=function(e){for(var t={},n=a(e,0),i=0;i1&&"30"==e.substr(i[1],2)){var f=n(e,i[1]);t.statusstr=this.getPKIFreeText(f),o++}if(i.length>o&&"03"==e.substr(i[1+o],2)){var h=n(e,i[1+o]);t.failinfo=this.getPKIFailureInfo(h)}return t},this.getPKIFreeText=function(e){for(var r=[],n=a(e,0),i=0;i=t?e:new Array(t-e.length+1).join(r)+e};function qe(e,t){for(var r=0,n=0;n=0;n--)a+=i[n];return a}function ze(e,t,r){if("object"==typeof e){t=String(t).split(".");for(var n=0;ni)throw"key is too short for SigAlg: keylen="+r+","+t;for(var a="00"+n,s="",o=i-4-a.length,c=0;c=0)return!1;if(n.compareTo(r.ONE)<0||n.compareTo(a)>=0)return!1;var o=n.modInverse(a),c=e.multiply(o).mod(a),u=t.multiply(o).mod(a);return s.multiply(c).add(i.multiply(u)).getX().toBigInteger().mod(a).equals(t)},this.serializeSig=function(e,t){var r=e.toByteArraySigned(),n=t.toByteArraySigned(),i=[];return i.push(2),i.push(r.length),(i=i.concat(r)).push(2),i.push(n.length),(i=i.concat(n)).unshift(i.length),i.unshift(48),i},this.parseSig=function(e){var t;if(48!=e[0])throw new Error("Signature not a valid DERSequence");if(2!=e[t=2])throw new Error("First element in signature must be a DERInteger");var n=e.slice(t+2,t+2+e[t+1]);if(2!=e[t+=2+e[t+1]])throw new Error("Second element in signature must be a DERInteger");var i=e.slice(t+2,t+2+e[t+1]);return t+=2+e[t+1],{r:r.fromByteArrayUnsigned(n),s:r.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(e){if(65!==e.length)throw"Signature has the wrong length";var t=e[0]-27;if(t<0||t>7)throw"Invalid signature type";var n=this.ecparams.n;return{r:r.fromByteArrayUnsigned(e.slice(1,33)).mod(n),s:r.fromByteArrayUnsigned(e.slice(33,65)).mod(n),i:t}},this.readPKCS5PrvKeyHex=function(e){if(!1===u(e))throw new Error("not ASN.1 hex string");var t,r,n;try{t=c(e,0,["[0]",0],"06"),r=c(e,0,[1],"04");try{n=c(e,0,["[1]",0],"03")}catch(e){}}catch(e){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=s(t),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(n),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(e){if(!1===u(e))throw new t("not ASN.1 hex string");var r,n,i;try{c(e,0,[1,0],"06"),r=c(e,0,[1,1],"06"),n=c(e,0,[2,0,1],"04");try{i=c(e,0,[2,0,"[1]",0],"03")}catch(e){}}catch(e){throw new t("malformed PKCS#8 plain ECC private key")}if(this.curveName=s(r),void 0===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PubKeyHex=function(e){if(!1===u(e))throw new t("not ASN.1 hex string");var r,n;try{c(e,0,[0,0],"06"),r=c(e,0,[0,1],"06"),n=c(e,0,[1],"03")}catch(e){throw new t("malformed PKCS#8 ECC public key")}if(this.curveName=s(r),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(n)},this.readCertPubKeyHex=function(e,r){if(!1===u(e))throw new t("not ASN.1 hex string");var n,i;try{n=c(e,0,[0,5,0,1],"06"),i=c(e,0,[0,5,1],"03")}catch(e){throw new t("malformed X.509 certificate ECC public key")}if(this.curveName=s(n),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==e&&void 0!==e.curve&&(this.curveName=e.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==e&&(void 0!==e.prv&&this.setPrivateKeyHex(e.prv),void 0!==e.pub&&this.setPublicKeyHex(e.pub))},fe.crypto.ECDSA.parseSigHex=function(e){var t=fe.crypto.ECDSA.parseSigHexInHexRS(e);return{r:new C(t.r,16),s:new C(t.s,16)}},fe.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=de,r=t.getChildIdx,n=t.getV;if(t.checkStrictDER(e,0),"30"!=e.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=r(e,0);if(2!=i.length)throw new Error("signature shall have two elements");var a=i[0],s=i[1];if("02"!=e.substr(a,2))throw new Error("1st item not ASN.1 integer");if("02"!=e.substr(s,2))throw new Error("2nd item not ASN.1 integer");return{r:n(e,a),s:n(e,s)}},fe.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=fe.crypto.ECDSA.parseSigHexInHexRS(e),r=t.r,n=t.s;if(r.length>=130&&r.length<=134){if(r.length%2!=0)throw Error("unknown ECDSA sig r length error");if(n.length%2!=0)throw Error("unknown ECDSA sig s length error");"00"==r.substr(0,2)&&(r=r.substr(2)),"00"==n.substr(0,2)&&(n=n.substr(2));var i=Math.max(r.length,n.length);return(r=("000000"+r).slice(-i))+("000000"+n).slice(-i)}if("00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),"00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),r.length%32==30&&(r="00"+r),n.length%32==30&&(n="00"+n),r.length%32!=0)throw Error("unknown ECDSA sig r length error");if(n.length%32!=0)throw Error("unknown ECDSA sig s length error");return r+n},fe.crypto.ECDSA.concatSigToASN1Sig=function(e){if(e.length%4!=0)throw Error("unknown ECDSA concatinated r-s sig length error");var t=e.substr(0,e.length/2),r=e.substr(e.length/2);return fe.crypto.ECDSA.hexRSSigToASN1Sig(t,r)},fe.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var r=new C(e,16),n=new C(t,16);return fe.crypto.ECDSA.biRSSigToASN1Sig(r,n)},fe.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var r=fe.asn1,n=new r.DERInteger({bigint:e}),i=new r.DERInteger({bigint:t});return new r.DERSequence({array:[n,i]}).tohex()},fe.crypto.ECDSA.getName=function(e){return"2b8104001f"===e?"secp192k1":"2a8648ce3d030107"===e?"secp256r1":"2b8104000a"===e?"secp256k1":"2b81040021"===e?"secp224r1":"2b81040022"===e?"secp384r1":"2b81040023"===e?"secp521r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(e)?"secp256r1":-1!=="|secp256k1|".indexOf(e)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(e)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(e)?"secp384r1":-1!=="|secp521r1|NIST P-521|P-521|".indexOf(e)?"secp521r1":null},void 0!==fe&&fe||(fe={}),void 0!==fe.crypto&&fe.crypto||(fe.crypto={}),fe.crypto.ECParameterDB=new function(){var e={},t={};function r(e){return new C(e,16)}this.getByName=function(r){var n=r;if(void 0!==t[n]&&(n=t[r]),void 0!==e[n])return e[n];throw"unregistered EC curve name: "+n},this.regist=function(n,i,a,s,o,c,u,f,h,l,d,p){e[n]={};var g=r(a),y=r(s),v=r(o),m=r(c),b=r(u),w=new ce(g,y,v),S=w.decodePointHex("04"+f+h);e[n].name=n,e[n].keylen=i,e[n].keycharlen=2*Math.ceil(i/8),e[n].curve=w,e[n].G=S,e[n].n=m,e[n].h=b,e[n].oid=d,e[n].info=p;for(var E=0;E1?new C(n,16):null,u=new C(i,16),this.setPrivate(a,s,o,c,u)},this.setPublic=function(e,t,r,n){this.isPublic=!0,this.p=e,this.q=t,this.g=r,this.y=n,this.x=null},this.setPublicHex=function(e,t,r,n){var i,a,s,o;i=new C(e,16),a=new C(t,16),s=new C(r,16),o=new C(n,16),this.setPublic(i,a,s,o)},this.signWithMessageHash=function(e){var t=this.p,r=this.q,n=this.g,i=(this.y,this.x),a=fe.crypto.Util.getRandomBigIntegerMinToMax(C.ONE.add(C.ONE),r.subtract(C.ONE)),s=new C(e.substr(0,r.bitLength()/4),16),o=n.modPow(a,t).mod(r),c=a.modInverse(r).multiply(s.add(i.multiply(o))).mod(r);return fe.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:o}},{int:{bigint:c}}]})},this.verifyWithMessageHash=function(e,t){var r=this.p,n=this.q,i=this.g,a=this.y,s=this.parseASN1Signature(t),o=s[0],c=s[1],u=new C(e.substr(0,n.bitLength()/4),16);if(C.ZERO.compareTo(o)>0||o.compareTo(n)>0)throw"invalid DSA signature";if(C.ZERO.compareTo(c)>=0||c.compareTo(n)>0)throw"invalid DSA signature";var f=c.modInverse(n),h=u.multiply(f).mod(n),l=o.multiply(f).mod(n);return 0==i.modPow(h,r).multiply(a.modPow(l,r)).mod(r).mod(n).compareTo(o)},this.parseASN1Signature=function(e){try{return[new n(t(e,0,[0],"02"),16),new n(t(e,0,[1],"02"),16)]}catch(e){throw new Error("malformed ASN.1 DSA signature")}},this.readPKCS5PrvKeyHex=function(e){var n,i,a,s,o;if(!1===r(e))throw new Error("not ASN.1 hex string");try{n=t(e,0,[1],"02"),i=t(e,0,[2],"02"),a=t(e,0,[3],"02"),s=t(e,0,[4],"02"),o=t(e,0,[5],"02")}catch(e){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(n,i,a,s,o)},this.readPKCS8PrvKeyHex=function(e){var n,i,a,s;if(!1===r(e))throw new Error("not ASN.1 hex string");try{n=t(e,0,[1,1,0],"02"),i=t(e,0,[1,1,1],"02"),a=t(e,0,[1,1,2],"02"),s=t(e,0,[2,0],"02")}catch(e){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(n,i,a,null,s)},this.readPKCS8PubKeyHex=function(e){var n,i,a,s;if(!1===r(e))throw new Error("not ASN.1 hex string");try{n=t(e,0,[0,1,0],"02"),i=t(e,0,[0,1,1],"02"),a=t(e,0,[0,1,2],"02"),s=t(e,0,[1,0],"02")}catch(e){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(n,i,a,s)},this.readCertPubKeyHex=function(e,n){var i,a,s,o;if(!1===r(e))throw new Error("not ASN.1 hex string");try{i=t(e,0,[0,5,0,1,0],"02"),a=t(e,0,[0,5,0,1,1],"02"),s=t(e,0,[0,5,0,1,2],"02"),o=t(e,0,[0,5,1,0],"02")}catch(e){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(i,a,s,o)}};var Xe=function(){var e=function(e,r,n){return t(v.AES,e,r,n)},t=function(e,t,r,n){var i=v.enc.Hex.parse(t),a=v.enc.Hex.parse(r),s=v.enc.Hex.parse(n),o={};o.key=a,o.iv=s,o.ciphertext=i;var c=e.decrypt(o,a,{iv:s});return v.enc.Hex.stringify(c)},r=function(e,t,r){return n(v.AES,e,t,r)},n=function(e,t,r,n){var i=v.enc.Hex.parse(t),a=v.enc.Hex.parse(r),s=v.enc.Hex.parse(n),o=e.encrypt(i,a,{iv:s}),c=v.enc.Hex.parse(o.toString());return v.enc.Base64.stringify(c)},i={"AES-256-CBC":{proc:e,eproc:r,keylen:32,ivlen:16},"AES-192-CBC":{proc:e,eproc:r,keylen:24,ivlen:16},"AES-128-CBC":{proc:e,eproc:r,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(e,r,n){return t(v.TripleDES,e,r,n)},eproc:function(e,t,r){return n(v.TripleDES,e,t,r)},keylen:24,ivlen:8},"DES-CBC":{proc:function(e,r,n){return t(v.DES,e,r,n)},eproc:function(e,t,r){return n(v.DES,e,t,r)},keylen:8,ivlen:8}},a=function(e){var t={},r=e.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));r&&(t.cipher=r[1],t.ivsalt=r[2]);var n=e.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));n&&(t.type=n[1]);var i=-1,a=0;-1!=e.indexOf("\r\n\r\n")&&(i=e.indexOf("\r\n\r\n"),a=2),-1!=e.indexOf("\n\n")&&(i=e.indexOf("\n\n"),a=1);var s=e.indexOf("-----END");if(-1!=i&&-1!=s){var o=e.substring(i+2*a,s-a);o=o.replace(/\s+/g,""),t.data=o}return t},s=function(e,t,r){for(var n=r.substring(0,16),a=v.enc.Hex.parse(n),s=v.enc.Utf8.parse(t),o=i[e].keylen+i[e].ivlen,c="",u=null;;){var f=v.algo.MD5.create();if(null!=u&&f.update(u),f.update(s),f.update(a),u=f.finalize(),(c+=v.enc.Hex.stringify(u)).length>=2*o)break}var h={};return h.keyhex=c.substr(0,2*i[e].keylen),h.ivhex=c.substr(2*i[e].keylen,2*i[e].ivlen),h},o=function(e,t,r,n){var a=v.enc.Base64.parse(e),s=v.enc.Hex.stringify(a);return(0,i[t].proc)(s,r,n)};return{version:"1.0.0",parsePKCS5PEM:function(e){return a(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,r){return s(e,t,r)},decryptKeyB64:function(e,t,r,n){return o(e,t,r,n)},getDecryptedKeyHex:function(e,t){var r=a(e),n=(r.type,r.cipher),i=r.ivsalt,c=r.data,u=s(n,t,i).keyhex;return o(c,n,u,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,r,n,a){var o="";if(void 0!==n&&null!=n||(n="AES-256-CBC"),void 0===i[n])throw new Error("KEYUTIL unsupported algorithm: "+n);if(void 0===a||null==a){var c=function(e){var t=v.lib.WordArray.random(e);return v.enc.Hex.stringify(t)}(i[n].ivlen);a=c.toUpperCase()}var u=function(e,t,r,n){return(0,i[t].eproc)(e,r,n)}(t,n,s(n,r,a).keyhex,a);return o="-----BEGIN "+e+" PRIVATE KEY-----\r\n",o+="Proc-Type: 4,ENCRYPTED\r\n",o+="DEK-Info: "+n+","+a+"\r\n",o+="\r\n",(o+=u.replace(/(.{64})/g,"$1\r\n"))+"\r\n-----END "+e+" PRIVATE KEY-----\r\n"},getEncryptedPKCS8PEM:function(e,t,r){return Be(this.getEncryptedPKCS8Hex(e,t,r),"ENCRYPTED PRIVATE KEY")},getEncryptedPKCS8Hex:function(e,t,r){var n;(n=null==r||null==r?{}:JSON.parse(JSON.stringify(r))).plain=e,this.initPBES2Param(n),this.encryptPBES2Param(n,t);var i=this.generatePBES2ASN1Param(n);return fe.asn1.ASN1Util.newObject(i).tohex()},initPBES2Param:function(e){var t;null==ze(e,"encalg")&&(e.encalg="aes256-CBC"),null==ze(e,"iter")&&(e.iter=2048),null==ze(e,"prf")&&(e.prf="hmacWithSHA256"),null==ze(e,"salt")&&(e.salt=v.enc.Hex.stringify(v.lib.WordArray.random(8))),null==ze(e,"enciv")&&("des-EDE3-CBC"==e.encalg&&(t=8),"aes128-CBC"==e.encalg&&(t=16),"aes256-CBC"==e.encalg&&(t=16),e.enciv=v.enc.Hex.stringify(v.lib.WordArray.random(t)))},encryptPBES2Param:function(e,t){var r=Xe.getDKFromPBES2Param(e,t);try{var n=fe.crypto.Cipher.encrypt(e.plain,r,e.encalg,{iv:e.enciv})}catch(t){throw new Error("encrypt error: "+e.plain+" "+r+" "+e.encalg+" "+e.enciv)}e.enc=n},generatePBES2ASN1Param:function(e){var t={seq:[{seq:[{oid:"pkcs5PBES2"},{seq:[{seq:[{oid:"pkcs5PBKDF2"},{seq:[{octstr:{hex:e.salt}},{int:{hex:je(e.iter)}}]}]},{seq:[{oid:e.encalg},{octstr:{hex:e.enciv}}]}]}]},{octstr:{hex:e.enc}}]};return"hmacWithSHA1"!=e.prf&&t.seq[0].seq[1].seq[0].seq[1].seq.push({seq:[{oid:e.prf},{null:""}]}),t},parseHexOfEncryptedPKCS8:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={},a=r(e,0);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0).items != 2: "+a.length);i.ciphertext=n(e,a[1]);var s=r(e,a[0]);if(2!=s.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+s.length);if("2a864886f70d01050d"!=n(e,s[0]))throw new Error("this only supports pkcs5PBES2");var o=r(e,s[1]);if(2!=s.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+o.length);var c=r(e,o[1]);if(2!=c.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+c.length);if("2a864886f70d0307"!=n(e,c[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=n(e,c[1]);var u=r(e,o[0]);if(2!=u.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+u.length);if("2a864886f70d01050c"!=n(e,u[0]))throw new Error("this only supports pkcs5PBKDF2");var f=r(e,u[1]);if(f.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+f.length);i.pbkdf2Salt=n(e,f[0]);var h=n(e,f[1]);try{i.pbkdf2Iter=parseInt(h,16)}catch(e){throw new Error("malformed format pbkdf2Iter: "+h)}return i},getPBKDF2KeyHexFromParam:function(e,t){var r=v.enc.Hex.parse(e.pbkdf2Salt),n=e.pbkdf2Iter,i=v.PBKDF2(t,r,{keySize:6,iterations:n});return v.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var r=xe(e,"ENCRYPTED PRIVATE KEY"),n=this.parseHexOfEncryptedPKCS8(r),i=Xe.getPBKDF2KeyHexFromParam(n,t),a={};a.ciphertext=v.enc.Hex.parse(n.ciphertext);var s=v.enc.Hex.parse(i),o=v.enc.Hex.parse(n.encryptionSchemeIV),c=v.TripleDES.decrypt(a,s,{iv:o});return v.enc.Hex.stringify(c)},parsePBES2:function(e){var t=de.parse(e);if("pkcs5PBES2"!=ze(t,"seq.0.seq.0.oid")||"pkcs5PBKDF2"!=ze(t,"seq.0.seq.1.seq.0.seq.0.oid"))throw new Error("not pkcs5PBES2 and pkcs5PBKDF2 used");var r=ze(t,"seq.0.seq.1.seq.0.seq.1.seq");if(null==r)throw new Error("PBKDF2 parameter not found");var n=ze(r,"0.octstr.hex"),i=ze(r,"1.int.hex"),a=ze(r,"2.seq.0.oid","hmacWithSHA1"),s=-1;try{s=parseInt(i,16)}catch(e){throw new Error("iter not proper value")}var o=ze(t,"seq.0.seq.1.seq.1.seq.0.oid"),c=ze(t,"seq.0.seq.1.seq.1.seq.1.octstr.hex"),u=ze(t,"seq.1.octstr.hex");if(null==o||null==c||null==u)throw new Error("encalg, enciv or enc is undefined");return{salt:n,iter:s,prf:a,encalg:o,enciv:c,enc:u}},getDKFromPBES2Param:function(e,t){var r={hmacWithSHA1:v.algo.SHA1,hmacWithSHA224:v.algo.SHA224,hmacWithSHA256:v.algo.SHA256,hmacWithSHA384:v.algo.SHA384,hmacWithSHA512:v.algo.SHA512}[e.prf];if(null==r)throw new Error("unsupported prf");var n={"des-EDE3-CBC":6,"aes128-CBC":4,"aes256-CBC":8}[e.encalg];if(null==n)throw new Error("unsupported encalg");var i=v.enc.Hex.parse(e.salt),a=e.iter;try{var s=v.PBKDF2(t,i,{keySize:n,iterations:a,hasher:r});return v.enc.Hex.stringify(s)}catch(r){throw new Error("PBKDF2 error: "+r+" "+JSON.stringify(e)+" "+t)}},getPlainHexFromEncryptedPKCS8PEM:function(e,t){if(-1==e.indexOf("BEGIN ENCRYPTED PRIVATE KEY"))throw new Error("not Encrypted PKCS#8 PEM string");var r,n=xe(e);try{r=Xe.parsePBES2(n)}catch(e){throw new Error("malformed PBES2 format: "+e.message)}var i=Xe.getDKFromPBES2Param(r,t);return fe.crypto.Cipher.decrypt(r.enc,i,r.encalg,{iv:r.enciv})},getKeyFromEncryptedPKCS8PEM:function(e,t){var r=this.getPlainHexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(r)},parsePlainPrivatePKCS8Hex:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={algparam:null};if("30"!=e.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var a=r(e,0);if(a.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=e.substr(a[1],2))throw new Error("malformed PKCS8 private key(code:003)");var s=r(e,a[1]);if(2!=s.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=e.substr(s[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=n(e,s[0]),"06"==e.substr(s[1],2)&&(i.algparam=n(e,s[1])),"04"!=e.substr(a[2],2))throw new Error("malformed PKCS8 private key(code:006)");return i.keyidx=t.getVidx(e,a[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=xe(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,r=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==r.algoid)t=new ae;else if("2a8648ce380401"==r.algoid)t=new fe.crypto.DSA;else{if("2a8648ce3d0201"!=r.algoid)throw new Error("unsupported private key algorithm");t=new fe.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,r=de.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===r)t=new ae;else if("2a8648ce380401"===r)t=new fe.crypto.DSA;else{if("2a8648ce3d0201"!==r)throw new Error("unsupported PKCS#8 public key hex");t=new fe.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={};if("30"!=e.substr(0,2))throw new Error("malformed RSA key(code:001)");var a=r(e,0);if(2!=a.length)throw new Error("malformed RSA key(code:002)");if("02"!=e.substr(a[0],2))throw new Error("malformed RSA key(code:003)");if(i.n=n(e,a[0]),"02"!=e.substr(a[1],2))throw new Error("malformed RSA key(code:004)");return i.e=n(e,a[1]),i},parsePublicPKCS8Hex:function(e){var t=de,r=t.getChildIdx,n=t.getV,i={algparam:null},a=r(e,0);if(2!=a.length)throw new Error("outer DERSequence shall have 2 elements: "+a.length);var s=a[0];if("30"!=e.substr(s,2))throw new Error("malformed PKCS8 public key(code:001)");var o=r(e,s);if(2!=o.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=e.substr(o[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(i.algoid=n(e,o[0]),"06"==e.substr(o[1],2)?i.algparam=n(e,o[1]):"30"==e.substr(o[1],2)&&(i.algparam={},i.algparam.p=t.getVbyList(e,o[1],[0],"02"),i.algparam.q=t.getVbyList(e,o[1],[1],"02"),i.algparam.g=t.getVbyList(e,o[1],[2],"02")),"03"!=e.substr(a[1],2))throw new Error("malformed PKCS8 public key(code:004)");return i.key=n(e,a[1]).substr(2),i}}}();function Ye(e,t){for(var r="",n=t/4-e.length,i=0;i>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return n}function Qe(e){for(var t in fe.crypto.Util.DIGESTINFOHEAD){var r=fe.crypto.Util.DIGESTINFOHEAD[t],n=r.length;if(e.substring(0,n)==r)return[t,e.substring(n)]}return[]}function Ze(e){var t,r=de,n=r.getChildIdx,i=r.getV,a=(r.dump,r.parse),s=r.getTLV,o=r.getVbyList,c=r.getVbyListEx,u=r.getTLVbyList,f=r.getTLVbyListEx,h=r.getIdxbyList,l=r.getIdxbyListEx,d=r.getVidx,p=r.getInt,g=r.oidname,y=r.hextooidstr,v=xe,m=Error;try{t=fe.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(e){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var e=u(this.hex,0,[0,0]);if("a0"==e.substr(0,2)){var t=u(e,0,[0]),r=p(t,0);if(r<0||20?t:void 0}catch(e){return}},this._asn1ToNoticeRef=function(e){try{for(var t={},r=ze(e,"seq"),n=0;n0?t:void 0}catch(e){return}},this._asn1ToNoticeNum=function(e){try{for(var t=ze(e,"seq"),r=[],n=0;n1){var o=s(e,a[1]),c=this.getGeneralName(o);null!=c.uri&&(i.uri=c.uri)}if(a.length>2){var u=s(e,a[2]);"0101ff"==u&&(i.reqauth=!0),"010100"==u&&(i.reqauth=!1)}return i},this.getExtSubjectDirectoryAttributes=function(e,t){if(void 0===e&&void 0===t){var r=this.getExtInfo("subjectDirectoryAttributes");if(void 0===r)return;e=s(this.hex,r.vidx),t=r.critical}var n={extname:"subjectDirectoryAttributes"};t&&(n.critical=!0);try{for(var i=a(e),o=[],c=0;c0&&(t.ext=this.getExtParamArray()),t.sighex=this.getSignatureValueHex(),1==e.tbshex&&(t.tbshex=u(this.hex,0,[0])),1==e.nodnarray&&(delete t.issuer.array,delete t.subject.array),t},this.getExtParamArray=function(e){null==e&&-1!=l(this.hex,0,[0,"[3]"])&&(e=f(this.hex,0,[0,"[3]",0],"30"));for(var t=[],r=n(e,0),i=0;i2&&"04"===y.substr(g[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(F=new o).readPKCS5PrvKeyHex(y)}return F}if("pkcs8prv"===r)return h.getKeyFromPlainPrivatePKCS8Hex(e);if("pkcs8pub"===r)return h._getKeyFromPublicPKCS8Hex(e);if("x509pub"===r)return Ze.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return Ze.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var m=xe(e,"PUBLIC KEY");return h._getKeyFromPublicPKCS8Hex(m)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var b=f(e,"RSA PRIVATE KEY");return h.getKey(b,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var w=a(n=f(e,"DSA PRIVATE KEY"),0,[1],"02"),S=a(n,0,[2],"02"),E=a(n,0,[3],"02"),A=a(n,0,[4],"02"),B=a(n,0,[5],"02");return(F=new c).setPrivate(new C(w,16),new C(S,16),new C(E,16),new C(A,16),new C(B,16)),F}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED"))return b=f(e,"EC PRIVATE KEY"),h.getKey(b,null,"pkcs5prv");if(-1!=e.indexOf("-END PRIVATE KEY-"))return h.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var x=h.getDecryptedKeyHex(e,t),T=new ae;return T.readPKCS5PrvKeyHex(x),T}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var I,F=a(n=h.getDecryptedKeyHex(e,t),0,[1],"04"),k=a(n,0,[2,0],"06"),R=a(n,0,[3,0],"03").substr(2);if(void 0===fe.crypto.OID.oidhex2name[k])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+k);return(I=new o({curve:fe.crypto.OID.oidhex2name[k]})).setPublicKeyHex(R),I.setPrivateKeyHex(F),I.isPublic=!1,I}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED"))return w=a(n=h.getDecryptedKeyHex(e,t),0,[1],"02"),S=a(n,0,[2],"02"),E=a(n,0,[3],"02"),A=a(n,0,[4],"02"),B=a(n,0,[5],"02"),(F=new c).setPrivate(new C(w,16),new C(S,16),new C(E,16),new C(A,16),new C(B,16)),F;if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return h.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")},Xe.generateKeypair=function(e,t){if("RSA"==e){var r=t;(s=new ae).generate(r,"10001"),s.isPrivate=!0,s.isPublic=!0;var n=new ae,i=s.n.toString(16),a=s.e.toString(16);return n.setPublic(i,a),n.isPrivate=!1,n.isPublic=!0,(o={}).prvKeyObj=s,o.pubKeyObj=n,o}if("EC"==e){var s,o,c=t,u=new fe.crypto.ECDSA({curve:c}).generateKeyPairHex();return(s=new fe.crypto.ECDSA({curve:c})).setPublicKeyHex(u.ecpubhex),s.setPrivateKeyHex(u.ecprvhex),s.isPrivate=!0,s.isPublic=!1,(n=new fe.crypto.ECDSA({curve:c})).setPublicKeyHex(u.ecpubhex),n.isPrivate=!1,n.isPublic=!0,(o={}).prvKeyObj=s,o.pubKeyObj=n,o}throw new Error("unknown algorithm: "+e)},Xe.getPEM=function(e,t,r,n,i,a){var s=fe,o=s.asn1,c=o.DERObjectIdentifier,u=o.DERInteger,f=o.ASN1Util.newObject,h=o.x509.SubjectPublicKeyInfo,l=s.crypto,d=l.DSA,p=l.ECDSA,g=ae;function y(e){return f({seq:[{int:0},{int:{bigint:e.n}},{int:e.e},{int:{bigint:e.d}},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.dmp1}},{int:{bigint:e.dmq1}},{int:{bigint:e.coeff}}]})}function v(e){return f({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a0",!0,{oid:{name:e.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]})}function m(e){return f({seq:[{int:0},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}},{int:{bigint:e.y}},{int:{bigint:e.x}}]})}if((void 0!==g&&e instanceof g||void 0!==d&&e instanceof d||void 0!==p&&e instanceof p)&&1==e.isPublic&&(void 0===t||"PKCS8PUB"==t))return Be(E=new h(e).tohex(),"PUBLIC KEY");if("PKCS1PRV"==t&&void 0!==g&&e instanceof g&&(void 0===r||null==r)&&1==e.isPrivate)return Be(E=y(e).tohex(),"RSA PRIVATE KEY");if("PKCS1PRV"==t&&void 0!==p&&e instanceof p&&(void 0===r||null==r)&&1==e.isPrivate){var b=new c({name:e.curveName}).tohex(),w=v(e).tohex(),S="";return(S+=Be(b,"EC PARAMETERS"))+Be(w,"EC PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==d&&e instanceof d&&(void 0===r||null==r)&&1==e.isPrivate)return Be(E=m(e).tohex(),"DSA PRIVATE KEY");if("PKCS5PRV"==t&&void 0!==g&&e instanceof g&&void 0!==r&&null!=r&&1==e.isPrivate){var E=y(e).tohex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",E,r,n,a)}if("PKCS5PRV"==t&&void 0!==p&&e instanceof p&&void 0!==r&&null!=r&&1==e.isPrivate)return E=v(e).tohex(),void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",E,r,n,a);if("PKCS5PRV"==t&&void 0!==d&&e instanceof d&&void 0!==r&&null!=r&&1==e.isPrivate)return E=m(e).tohex(),void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",E,r,n,a);var C=function(e,t){if("string"==typeof t)return Xe.getEncryptedPKCS8PEM(e,t);if("object"==typeof t&&null!=ze(t,"passcode")){var r=JSON.parse(JSON.stringify(t)),n=r.passcode;return delete r.passcode,Xe.getEncryptedPKCS8PEM(e,n,r)}};if("PKCS8PRV"==t&&null!=g&&e instanceof g&&1==e.isPrivate){var A=y(e).tohex();return E=f({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:A}}]}).tohex(),void 0===r||null==r?Be(E,"PRIVATE KEY"):C(E,r)}if("PKCS8PRV"==t&&void 0!==p&&e instanceof p&&1==e.isPrivate){var B={seq:[{int:1},{octstr:{hex:e.prvKeyHex}}]};return"string"==typeof e.pubKeyHex&&B.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}),A=new f(B).tohex(),E=f({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:A}}]}).tohex(),void 0===r||null==r?Be(E,"PRIVATE KEY"):C(E,r)}if("PKCS8PRV"==t&&void 0!==d&&e instanceof d&&1==e.isPrivate)return A=new u({bigint:e.x}).tohex(),E=f({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:A}}]}).tohex(),void 0===r||null==r?Be(E,"PRIVATE KEY"):C(E,r);throw new Error("unsupported object nor format")},Xe.getKeyFromCSRPEM=function(e){var t=xe(e,"CERTIFICATE REQUEST");return Xe.getKeyFromCSRHex(t)},Xe.getKeyFromCSRHex=function(e){var t=Xe.parseCSRHex(e);return Xe.getKey(t.p8pubkeyhex,null,"pkcs8pub")},Xe.parseCSRHex=function(e){var t=de,r=t.getChildIdx,n=t.getTLV,i={},a=e;if("30"!=a.substr(0,2))throw new Error("malformed CSR(code:001)");var s=r(a,0);if(s.length<1)throw new Error("malformed CSR(code:002)");if("30"!=a.substr(s[0],2))throw new Error("malformed CSR(code:003)");var o=r(a,s[0]);if(o.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=n(a,o[2]),i},Xe.getKeyID=function(e){var t=Xe,r=de;"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&(e=t.getKey(e));var n=xe(t.getPEM(e)),i=r.getIdxbyList(n,0,[1]),a=r.getV(n,i).substring(2);return fe.crypto.Util.hashHex(a,"sha1")},Xe.getJWK=function(e,t,r,n,i){var a,s,o={},c=fe.crypto.Util.hashHex;if("string"==typeof e)a=Xe.getKey(e),-1!=e.indexOf("CERTIFICATE")&&(s=xe(e));else{if("object"!=typeof e)throw new Error("unsupported keyinfo type");e instanceof Ze?(a=e.getPublicKey(),s=e.hex):a=e}if(a instanceof ae&&a.isPrivate)o.kty="RSA",o.n=me(a.n.toString(16)),o.e=me(a.e.toString(16)),o.d=me(a.d.toString(16)),o.p=me(a.p.toString(16)),o.q=me(a.q.toString(16)),o.dp=me(a.dmp1.toString(16)),o.dq=me(a.dmq1.toString(16)),o.qi=me(a.coeff.toString(16));else if(a instanceof ae&&a.isPublic)o.kty="RSA",o.n=me(a.n.toString(16)),o.e=me(a.e.toString(16));else if(a instanceof fe.crypto.ECDSA&&a.isPrivate){if("P-256"!==(f=a.getShortNISTPCurveName())&&"P-384"!==f&&"P-521"!==f)throw new Error("unsupported curve name for JWT: "+f);var u=a.getPublicKeyXYHex();o.kty="EC",o.crv=f,o.x=me(u.x),o.y=me(u.y),o.d=me(a.prvKeyHex)}else if(a instanceof fe.crypto.ECDSA&&a.isPublic){var f;if("P-256"!==(f=a.getShortNISTPCurveName())&&"P-384"!==f&&"P-521"!==f)throw new Error("unsupported curve name for JWT: "+f);u=a.getPublicKeyXYHex(),o.kty="EC",o.crv=f,o.x=me(u.x),o.y=me(u.y)}if(null==o.kty)throw new Error("unsupported keyinfo");return a.isPrivate||1==t||(o.kid=fe.jws.JWS.getJWKthumbprint(o)),null!=s&&1!=r&&(o.x5c=[S(s)]),null!=s&&1!=n&&(o.x5t=ye(S(c(s,"sha1")))),null!=s&&1!=i&&(o["x5t#S256"]=ye(S(c(s,"sha256")))),o},Xe.getJWKFromKey=function(e){return Xe.getJWK(e,!0,!0,!0,!0)},ae.getPosArrayOfChildrenFromHex=function(e){return de.getChildIdx(e,0)},ae.getHexValueArrayOfChildrenFromHex=function(e){var t,r=de.getV,n=r(e,(t=ae.getPosArrayOfChildrenFromHex(e))[0]),i=r(e,t[1]),a=r(e,t[2]),s=r(e,t[3]),o=r(e,t[4]),c=r(e,t[5]),u=r(e,t[6]),f=r(e,t[7]),h=r(e,t[8]);return(t=new Array).push(n,i,a,s,o,c,u,f,h),t},ae.prototype.readPrivateKeyFromPEMString=function(e){var t=xe(e),r=ae.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])},ae.prototype.readPKCS5PrvKeyHex=function(e){var t=ae.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},ae.prototype.readPKCS8PrvKeyHex=function(e){var t,r,n,i,a,s,o,c,u=de,f=u.getVbyListEx;if(!1===u.isASN1HEX(e))throw new Error("not ASN.1 hex string");try{t=f(e,0,[2,0,1],"02"),r=f(e,0,[2,0,2],"02"),n=f(e,0,[2,0,3],"02"),i=f(e,0,[2,0,4],"02"),a=f(e,0,[2,0,5],"02"),s=f(e,0,[2,0,6],"02"),o=f(e,0,[2,0,7],"02"),c=f(e,0,[2,0,8],"02")}catch(e){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,r,n,i,a,s,o,c)},ae.prototype.readPKCS5PubKeyHex=function(e){var t=de,r=t.getV;if(!1===t.isASN1HEX(e))throw new Error("keyHex is not ASN.1 hex string");var n=t.getChildIdx(e,0);if(2!==n.length||"02"!==e.substr(n[0],2)||"02"!==e.substr(n[1],2))throw new Error("wrong hex for PKCS#5 public key");var i=r(e,n[0]),a=r(e,n[1]);this.setPublic(i,a)},ae.prototype.readPKCS8PubKeyHex=function(e){var t=de;if(!1===t.isASN1HEX(e))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==t.getTLVbyListEx(e,0,[0,0]))throw new Error("not PKCS8 RSA public key");var r=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(r)},ae.prototype.readCertPubKeyHex=function(e,t){var r,n;(r=new Ze).readCertHex(e),n=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)},ae.prototype.sign=function(e,t){var r=function(e){return fe.crypto.Util.hashString(e,t)}(e);return this.signWithMessageHash(r,t)},ae.prototype.signWithMessageHash=function(e,t){var r=ie(fe.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),16);return Ye(this.doPrivate(r).toString(16),this.n.bitLength())},ae.prototype.signPSS=function(e,t,r){var n,i=(n=Ae(e),fe.crypto.Util.hashHex(n,t));return void 0===r&&(r=-1),this.signWithMessageHashPSS(i,t,r)},ae.prototype.signWithMessageHashPSS=function(e,t,r){var n,i=Ce(e),a=i.length,s=this.n.bitLength()-1,o=Math.ceil(s/8),c=function(e){return fe.crypto.Util.hashHex(e,t)};if(-1===r||void 0===r)r=a;else if(-2===r)r=o-a-2;else if(r<-2)throw new Error("invalid salt length");if(o0&&(u=new Array(r),(new ne).nextBytes(u),u=String.fromCharCode.apply(String,u));var f=Ce(c(Ae("\0\0\0\0\0\0\0\0"+i+u))),h=[];for(n=0;n>8*o-s&255;for(p[0]&=~g,n=0;nn)return!1;var i=this.doPublic(r).toString(16);if(i.length+3!=n/4)return!1;var a=Qe(i.replace(/^1f+00/,""));if(0==a.length)return!1;var s=a[0],o=a[1],c=function(e){return fe.crypto.Util.hashString(e,s)}(e);return o==c},ae.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var r=ie(t,16);if(r.bitLength()>this.n.bitLength())return 0;var n=Qe(this.doPublic(r).toString(16).replace(/^1f+00/,""));return 0!=n.length&&(n[0],n[1]==e)},ae.prototype.verifyPSS=function(e,t,r,n){var i,a=(i=Ae(e),fe.crypto.Util.hashHex(i,r));return void 0===n&&(n=-1),this.verifyWithMessageHashPSS(a,t,r,n)},ae.prototype.verifyWithMessageHashPSS=function(e,t,r,n){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,a=new C(t,16),s=function(e){return fe.crypto.Util.hashHex(e,r)},o=Ce(e),c=o.length,u=this.n.bitLength()-1,f=Math.ceil(u/8);if(-1===n||void 0===n)n=c;else if(-2===n)n=f-c-2;else if(n<-2)throw new Error("invalid salt length");if(f>8*f-u&255;if(l.charCodeAt(0)&p)throw new Error("bits beyond keysize not zero");var g=Je(d,l.length,s),y=[];for(i=0;i0&&-1==(":"+r.join(":")+":").indexOf(":"+y+":"))throw"algorithm '"+y+"' not accepted in the list";if("none"!=y&&null===t)throw"key shall be specified to verify.";if("string"==typeof t&&-1!=t.indexOf("-----BEGIN ")&&(t=Xe.getKey(t)),!("RS"!=l&&"PS"!=l||t instanceof n))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==l&&!(t instanceof c))throw"key shall be a ECDSA obj for ES* algs";var v=null;if(void 0===a.jwsalg2sigalg[g.alg])throw"unsupported alg name: "+y;if("none"==(v=a.jwsalg2sigalg[y]))throw"not supported";if("Hmac"==v.substr(0,4)){if(void 0===t)throw"hexadecimal key shall be specified for HMAC";var m=new u({alg:v,pass:t});return m.updateString(d),p==m.doFinal()}if(-1!=v.indexOf("withECDSA")){var b,w=null;try{w=c.concatSigToASN1Sig(p)}catch(e){return!1}return(b=new f({alg:v})).init(t),b.updateString(d),b.verify(w)}return(b=new f({alg:v})).init(t),b.updateString(d),b.verify(p)},fe.jws.JWS.parse=function(e){var t,r,n,i=e.split("."),a={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return t=i[0],r=i[1],3==i.length&&(n=i[2]),a.headerObj=fe.jws.JWS.readSafeJSONString(le(t)),a.payloadObj=fe.jws.JWS.readSafeJSONString(le(r)),a.headerPP=JSON.stringify(a.headerObj,null," "),null==a.payloadObj?a.payloadPP=le(r):a.payloadPP=JSON.stringify(a.payloadObj,null," "),void 0!==n&&(a.sigHex=be(n)),a},fe.jws.JWS.verifyJWT=function(e,t,r){var n=fe.jws,i=n.JWS,a=i.readSafeJSONString,s=i.inArray,o=i.includedArray;if(!Ke(e))return!1;var c=e.split(".");if(3!=c.length)return!1;var u=c[0],f=c[1],h=(be(c[2]),a(le(u))),l=a(le(f));if(void 0===h.alg)return!1;if(void 0===r.alg)throw"acceptField.alg shall be specified";if(!s(h.alg,r.alg))return!1;if(void 0!==l.iss&&"object"==typeof r.iss&&!s(l.iss,r.iss))return!1;if(void 0!==l.sub&&"object"==typeof r.sub&&!s(l.sub,r.sub))return!1;if(void 0!==l.aud&&"object"==typeof r.aud)if("string"==typeof l.aud){if(!s(l.aud,r.aud))return!1}else if("object"==typeof l.aud&&!o(l.aud,r.aud))return!1;var d=n.IntDate.getNow();return void 0!==r.verifyAt&&"number"==typeof r.verifyAt&&(d=r.verifyAt),void 0!==r.gracePeriod&&"number"==typeof r.gracePeriod||(r.gracePeriod=0),!(void 0!==l.exp&&"number"==typeof l.exp&&l.exp+r.gracePeriodi&&this.aHeader.pop(),this.aSignature.length>i&&this.aSignature.pop(),"addSignature failed: "+e}},this.verifyAll=function(e){if(this.aHeader.length!==e.length||this.aSignature.length!==e.length)return!1;for(var t=0;t0))throw"malformed header";if(this.aHeader=e.headers,"string"!=typeof e.payload)throw"malformed signatures";if(this.sPayload=e.payload,!(e.signatures.length>0))throw"malformed signatures";this.aSignature=e.signatures}catch(e){throw"malformed JWS-JS JSON object: "+e}},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return 0==this.aHeader.length?1:0}},fe.crypto.ECDSA,fe.crypto.DSA,fe.crypto.Signature,fe.crypto.MessageDigest,fe.crypto.Mac,t.ym=Xe,t.d6=de,t.pj=fe,fe.crypto,fe.asn1,fe.jws,fe.lang},73065:function(e,t,r){var n,i;!function(a,s){"use strict";n=function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"],i={},a=null;function s(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(){for(var r=this.getLevel(),i=0;i=0&&t<=h.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?l+=":"+e:"symbol"==typeof e&&(l=void 0),h.name=e,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=r||f,h.getLevel=function(){return null!=u?u:null!=o?o:s},h.setLevel=function(e,r){return u=p(e),!1!==r&&function(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t&&l){try{return void(window.localStorage[l]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"="+r+";"}catch(e){}}}(u),c.call(h)},h.setDefaultLevel=function(e){o=p(e),d()||h.setLevel(e,!1)},h.resetLevel=function(){u=null,function(){if(typeof window!==t&&l){try{window.localStorage.removeItem(l)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),c.call(h)},h.enableAll=function(e){h.setLevel(h.levels.TRACE,e)},h.disableAll=function(e){h.setLevel(h.levels.SILENT,e)},h.rebuild=function(){if(a!==h&&(s=p(a.getLevel())),c.call(h),a===h)for(var e in i)i[e].rebuild()},s=p(a?a.getLevel():"WARN");var g=d();null!=g&&(u=p(g)),c.call(h)}(a=new h).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=i[e];return t||(t=i[e]=new h(e,a.methodFactory)),t};var l=typeof window!==t?window.log:void 0;return a.noConflict=function(){return typeof window!==t&&window.log===a&&(window.log=l),a},a.getLoggers=function(){return i},a.default=a,a},void 0===(i=n.call(t,r,t,e))||(e.exports=i)}()},65606:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var o,c=[],u=!1,f=-1;function h(){u&&o&&(u=!1,o.length?c=o.concat(c):f=-1,c.length&&l())}function l(){if(!u){var e=s(h);u=!0;for(var t=c.length;t;){for(o=c,c=[];++f1)for(var r=1;r{!function(e){var t,r,n,i=String.fromCharCode;function a(e){for(var t,r,n=[],i=0,a=e.length;i=55296&&t<=56319&&i=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function o(e,t){return i(e>>t&63|128)}function c(e){if(!(4294967168&e))return i(e);var t="";return 4294965248&e?4294901760&e?4292870144&e||(t=i(e>>18&7|240),t+=o(e,12),t+=o(e,6)):(s(e),t=i(e>>12&15|224),t+=o(e,6)):t=i(e>>6&31|192),t+i(63&e|128)}function u(){if(n>=r)throw Error("Invalid byte index");var e=255&t[n];if(n++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function f(){var e,i;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(e=255&t[n],n++,!(128&e))return e;if(192==(224&e)){if((i=(31&e)<<6|u())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if((i=(15&e)<<12|u()<<6|u())>=2048)return s(i),i;throw Error("Invalid continuation byte")}if(240==(248&e)&&(i=(7&e)<<18|u()<<12|u()<<6|u())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=a(e),r=t.length,n=-1,i="";++n65535&&(a+=i((t-=65536)>>>10&1023|55296),t=56320|1023&t),a+=i(t);return a}(o)}}(t)},50477:()=>{},42363:()=>{},50310:()=>{},35208:()=>{},4633:(e,t,r)=>{var n=r(73738).default;function i(){"use strict";e.exports=i=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},a=Object.prototype,s=a.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",f=c.asyncIterator||"@@asyncIterator",h=c.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i=t&&t.prototype instanceof w?t:w,a=Object.create(i.prototype),s=new _(n||[]);return o(a,"_invoke",{value:F(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=d;var g="suspendedStart",y="suspendedYield",v="executing",m="completed",b={};function w(){}function S(){}function E(){}var C={};l(C,u,(function(){return this}));var A=Object.getPrototypeOf,B=A&&A(A(P([])));B&&B!==a&&s.call(B,u)&&(C=B);var x=E.prototype=w.prototype=Object.create(C);function T(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function r(i,a,o,c){var u=p(e[i],e,a);if("throw"!==u.type){var f=u.arg,h=f.value;return h&&"object"==n(h)&&s.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,o,c)}),(function(e){r("throw",e,o,c)})):t.resolve(h).then((function(e){f.value=e,o(f)}),(function(e){return r("throw",e,o,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(a,a):a()}})}function F(e,r,n){var i=g;return function(a,s){if(i===v)throw Error("Generator is already running");if(i===m){if("throw"===a)throw s;return{value:t,done:!0}}for(n.method=a,n.arg=s;;){var o=n.delegate;if(o){var c=k(o,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===g)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=v;var u=p(e,r,n);if("normal"===u.type){if(i=n.done?m:y,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=m,n.method="throw",n.arg=u.arg)}}}function k(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=p(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var s=a.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function P(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=s.call(a,"catchLoc"),u=s.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;D(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},r}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},73738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},54756:(e,t,r)=>{var n=r(4633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};(()=>{"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:r+""}function n(e,t){for(var n=0;ne.length)&&(t=e.length);for(var r=0,n=Array(t);r1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=";if(!e)return"";if("string"==typeof e&&(e=O.strToArrayBuffer(e)),e instanceof ArrayBuffer&&(e=new Uint8Array(e)),64!==(t=O.expandAlphRange(t).join("")).length&&65!==t.length)throw new E(`Invalid Base64 alphabet length (${t.length}): ${t}`);for(var r,n,i,a,s,o,c,u="",f=0;f>2,s=(3&r)<<4|(n=e[f++])>>4,o=(15&n)<<2|(i=e[f++])>>6,c=63&i,isNaN(n)?o=c=64:isNaN(i)&&(c=64),u+=t.charAt(a)+t.charAt(s)+t.charAt(o)+t.charAt(c);return u}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"string",n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!e)return"string"===r?"":[];if(t=t||"A-Za-z0-9+/=",64!==(t=O.expandAlphRange(t).join("")).length&&65!==t.length)throw new E(`Error: Base64 alphabet should be 64 characters long, or 65 with a padding character. Found ${t.length}: ${t}`);if(n){var a=new RegExp("[^"+t.replace(/[[\]\\\-^$]/g,"\\$&")+"]","g");e=e.replace(a,"")}if(i){if(e.length%4==1)throw new E(`Error: Invalid Base64 input length (${e.length}). Cannot be 4n+1, even without padding chars.`);if(65===t.length){var s=t.charAt(64),o=e.indexOf(s);if(o>=0){if(o>2,f=(3&d)<<6|p,(c=h<<2|l>>4)>=0&&c<256&&g.push(c),u>=0&&u<256&&64!==d&&g.push(u),f>=0&&f<256&&64!==p&&g.push(f)}return"string"===r?O.byteArrayToUtf8(g):g}function B(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!e)return"";e instanceof ArrayBuffer&&(e=new Uint8Array(e));for(var a="",s="0x"===t||"\\x"===t,o=0;o>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")}function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(r<1||Math.round(r)!==r)throw new E("Byte length must be a positive integer");if("None"!==t){var n="Auto"===t?/[^a-f\d]|0x/gi:O.regexRep(t);e=e.split(n)}else e=[e];for(var i=[],a=0;a1&&void 0!==arguments[1]?arguments[1]:"Auto";t=O.charRep(t);var r=[],n=e.split(t);""===n[n.length-1]&&(n=n.slice(0,n.length-1));for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:"Space",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if(r<1||Math.round(r)!==r)throw new E("Byte length must be a positive integer");var n=O.regexRep(t);e=e.replace(n,"");for(var i=[],a=0;a65535){e-=65536;var t=String.fromCharCode(e>>>10&1023|55296);return e=56320|1023&e,t+String.fromCharCode(e)}return String.fromCharCode(e)}},{key:"ord",value:function(e){if(2===e.length){var t=e.charCodeAt(0),r=e.charCodeAt(1);if(t>=55296&&t<56320&&r>=56320&&r<57344)return 1024*(t-55296)+r-56320+65536}return e.charCodeAt(0)}},{key:"padBytesRight",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new Array(t);return n.fill(r),g(e).forEach((function(e,t){n[t]=e})),n}},{key:"truncate",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return e.length>t&&(e=e.slice(0,t-r.length)+r),e}},{key:"hex",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(e="string"==typeof e?t.ord(e):e).toString(16).padStart(r,"0")}},{key:"bin",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return(e="string"==typeof e?t.ord(e):e).toString(2).padStart(r,"0")}},{key:"printable",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?e.replace(/[^\x20-\x7f]/g,"."):(e=e.replace(/[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,"."),t||(e=e.replace(/[\x09-\x10\u2028\u2029]/g,".")),e)}},{key:"escapeWhitespace",value:function(e){return e.replace(/[\x09-\x10]/g,(function(e){return String.fromCharCode(57344+e.charCodeAt(0))}))}},{key:"parseEscapedChars",value:function(e){return e.replace(/\\([abfnrtv'"]|[0-3][0-7]{2}|[0-7]{1,2}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]{1,6}\}|\\)/g,(function(e,t){switch(t[0]){case"\\":return"\\";case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":return String.fromCharCode(parseInt(t,8));case"a":return String.fromCharCode(7);case"b":return"\b";case"t":return"\t";case"n":return"\n";case"v":return"\v";case"f":return"\f";case"r":return"\r";case'"':return'"';case"'":return"'";case"x":return String.fromCharCode(parseInt(t.substr(1),16));case"u":return"{"===t[1]?String.fromCodePoint(parseInt(t.slice(2,-1),16)):String.fromCharCode(parseInt(t.substr(1),16))}}))}},{key:"escapeRegex",value:function(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}},{key:"expandAlphRange",value:function(e){for(var r=[],n=0;n=0;i--)r=256*r+e[i];return r}},{key:"intToByteArray",value:function(e,t,r){var n=new Array(t);if("little"===r)for(var i=0;i>>=8;else for(var a=t-1;a>=0;a--)n[a]=255&e,e>>>=8;return n}},{key:"strToArrayBuffer",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to array buffer`),!e)return new ArrayBuffer;for(var r,n=new Uint8Array(e.length),i=e.length;i--;)if(r=e.charCodeAt(i),n[i]=r,r>255)return t.strToUtf8ArrayBuffer(e);return n.buffer}},{key:"strToUtf8ArrayBuffer",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to UTF8 array buffer`),!e)return new ArrayBuffer;var t=new TextEncoder("utf-8").encode(e);return e.length!==t.length&&(N()&&self&&"function"==typeof self.setOption?self.setOption("attemptHighlight",!1):P()&&(window.app.options.attemptHighlight=!1)),t.buffer}},{key:"strToByteArray",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to byte array`),!e)return[];for(var r,n=new Array(e.length),i=e.length;i--;)if(r=e.charCodeAt(i),n[i]=r,r>255)return t.strToUtf8ByteArray(e);return n}},{key:"strToUtf8ByteArray",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to UTF8 byte array`),!e)return[];var r=b().encode(e);return e.length!==r.length&&(N()?self.setOption("attemptHighlight",!1):P()&&(window.app.options.attemptHighlight=!1)),t.strToByteArray(r)}},{key:"strToCharcode",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to charcode`),!e)return[];for(var r=[],n=0;n=55296&&i<56320){var a=e[n+1].charCodeAt(0);a>=56320&&a<57344&&(i=t.ord(e[n]+e[++n]))}r.push(i)}return r}},{key:"byteArrayToUtf8",value:function(e){var r;if(v().debug(`Converting byte array[${null===(r=e)||void 0===r?void 0:r.length}] to UTF8`),!e||!e.length)return"";e instanceof Uint8Array||(e=new Uint8Array(e));try{var n=new TextDecoder("utf-8",{fatal:!0}).decode(e);return n.length!==e.length&&(N()?self.setOption("attemptHighlight",!1):P()&&(window.app.options.attemptHighlight=!1)),n}catch(r){return t.byteArrayToChars(e)}}},{key:"byteArrayToChars",value:function(e){if(v().debug(`Converting byte array[${null==e?void 0:e.length}] to chars`),!e||!e.length)return"";for(var t="",r=0;r1&&void 0!==arguments[1])||arguments[1];if(v().debug(`Converting array buffer[${null==e?void 0:e.byteLength}] to str`),!e||!e.byteLength)return"";var n=new Uint8Array(e);return r?t.byteArrayToUtf8(n):t.byteArrayToChars(n)}},{key:"calculateShannonEntropy",value:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var t,r=[],n=new Array(256).fill(0);for(t=0;t0&&r.push(n[t]/e.length);var i,a=0;for(t=0;t1&&void 0!==arguments[1]?arguments[1]:[","],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["\n","\r"],a=!1,s=!1,o="",c=[],u=[];e.length&&"\ufeff"===e[0]&&(e=e.substr(1));for(var f=0;f=0?(c.push(o),o=""):!s&&i.indexOf(t)>=0?(c.push(o),o="",u.push(c),c=[],i.indexOf(r)>=0&&r!==t&&f++):o+=t:s=!0;return c.length&&(c.push(o),u.push(c)),u}},{key:"stripHtmlTags",value:function(e){function t(e,r){var n=r.replace(e,"");return n.length===r.length?n:t(e,n)}return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(e=t(/]*>(\s|\S)*?<\/script[^>]*>/gi,e),e=t(/]*>(\s|\S)*?<\/style[^>]*>/gi,e)),t(/<[^>]+>/g,e)}},{key:"escapeHtml",value:function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","\0":""};return e?e.replace(/[&<>"'`\u0000]/g,(function(e){return t[e]})):e}},{key:"unescapeHtml",value:function(e){var t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/","`":"`","":"\0"};return e.replace(/(&#?x?[a-z0-9]{2,4};|\ue000)/gi,(function(e){return t[e]||e}))}},{key:"toTitleCase",value:function(e){return e.replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))}},{key:"encodeURIFragment",value:function(e){var t={"%2D":"-","%2E":".","%5F":"_","%7E":"~","%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2C":",","%3B":";","%3A":":","%40":"@","%2F":"/","%3F":"?"};return(e=encodeURIComponent(e)).replace(/%[0-9A-F]{2}/g,(function(e){return t[e]||e}))}},{key:"generatePrettyRecipe",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="",n="",i="",a="",s="";return e.forEach((function(e){n=e.op.replace(/ /g,"_"),i=JSON.stringify(e.args).slice(1,-1).replace(/'/g,"\\'").replace(/"((?:[^"\\]|\\.)*)"/g,"'$1'").replace(/\\"/g,'"'),a=e.disabled?"/disabled":"",s=e.breakpoint?"/breakpoint":"",r+=`${n}(${i}${a}${s})`,t&&(r+="\n")})),r}},{key:"parseRecipeConfig",value:function(e){if(0===(e=e.trim()).length)return[];if("["===e[0])return JSON.parse(e);var t,r;e=e.replace(/\n/g,"");for(var n=/([^(]+)\(((?:'[^'\\]*(?:\\.[^'\\]*)*'|[^)/'])*)(\/[^)]+)?\)/g,i=[];t=n.exec(e);){r="["+(r=t[2].replace(/"/g,'\\"').replace(/(^|,|{|:)'/g,'$1"').replace(/([^\\]|(?:\\\\)+)'(,|:|}|$)/g,'$1"$2').replace(/\\'/g,"'"))+"]";var a={op:t[1].replace(/_/g," "),args:JSON.parse(r)};t[3]&&t[3].indexOf("disabled")>0&&(a.disabled=!0),t[3]&&t[3].indexOf("breakpoint")>0&&(a.breakpoint=!0),i.push(a)}return i}},{key:"displayFilesAsHTML",value:(r=f(l().mark((function e(r){var n,i,a,s,o;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=function(e){return`

\n
\n
\n ${t.escapeHtml(e.name)}\n
\n
\n
`},i=function(e,r){if(r.startsWith("image")){var n="data:";return n+=r+";",""}return`
${t.escapeHtml(t.arrayBufferToStr(e.buffer))}
`},a=function(){var e=f(l().mark((function e(r,n){var a,s,o,c;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.readFile(r);case 2:return a=e.sent,s=new Blob([a],{type:r.type||"octet/stream"}),o=URL.createObjectURL(s),c=`
\n
\n
\n \n \n ${r.size.toLocaleString()} bytes\n \n save\n \n \n open_in_browser\n \n \n
\n
\n
\n
\n ${i(a,r.type)}\n
\n
\n
`,e.abrupt("return",c);case 7:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),s=`
\n ${r.length} file(s) found\n
`,o=0;case 5:if(!(o=e.size)t(i);else{var r=e.slice(a,a+s);n.readAsArrayBuffer(r)}};n.onload=function(e){i.set(new Uint8Array(n.result),a),a+=s,o()},n.onerror=function(e){r(n.error.message)},o()}))}},{key:"readFileSync",value:function(e){if(!_())throw new TypeError("Browser environment cannot support readFileSync");return Uint8Array.from(e.data).buffer}},{key:"mod",value:function(e,t){return(e%t+t)%t}},{key:"gcd",value:function(e,r){return r?t.gcd(r,e%r):e}},{key:"modInv",value:function(e,t){e%=t;for(var r=1;re?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),t.slice(0,e)+String(this))}),String.prototype.padEnd||(String.prototype.padEnd=function(e,t){return e|=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),String(this)+t.slice(0,e))});const K=function(t){function r(){var t;e(this,r);for(var n=arguments.length,i=new Array(n),a=0;a0||e===t?t:t-1}function Z(e){for(var t,r,n=1,i=e.length,a=e[0]+"";nu^r?1:-1;for(o=(c=i.length)<(u=a.length)?c:u,s=0;sa[s]^r?1:-1;return c==u?0:c>u^r?1:-1}function ee(e,t,r,n){if(er||e!==j(e))throw Error(V+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function te(e){var t=e.c.length-1;return Q(e.e/z)==t&&e.c[t]%2!=0}function re(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function ne(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else tb?l.c=l.e=null:e.e=10;c/=10,o++);return void(o>b?l.c=l.e=null:(l.e=o,l.c=[e]))}h=String(e)}else{if(!M.test(h=String(e)))return i(l,h,u);l.s=45==h.charCodeAt(0)?(h=h.slice(1),-1):1}(o=h.indexOf("."))>-1&&(h=h.replace(".","")),(c=h.search(/e/i))>0?(o<0&&(o=c),o+=+h.slice(c+1),h=h.substring(0,c)):o<0&&(o=h.length)}else{if(ee(t,2,A.length,"Base"),10==t&&B)return k(l=new x(e),p+l.e+1,g);if(h=String(e),u="number"==typeof e){if(0*e!=0)return i(l,h,u,t);if(l.s=1/e<0?(h=h.slice(1),-1):1,x.DEBUG&&h.replace(/^0\.0*|\./,"").length>15)throw Error(G+e)}else l.s=45===h.charCodeAt(0)?(h=h.slice(1),-1):1;for(r=A.slice(0,t),o=c=0,f=h.length;co){o=f;continue}}else if(!s&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){s=!0,c=-1,o=0;continue}return i(l,String(e),u,t)}u=!1,(o=(h=n(h,t,10,l.s)).indexOf("."))>-1?h=h.replace(".",""):o=h.length}for(c=0;48===h.charCodeAt(c);c++);for(f=h.length;48===h.charCodeAt(--f););if(h=h.slice(c,++f)){if(f-=c,u&&x.DEBUG&&f>15&&(e>W||e!==j(e)))throw Error(G+l.s*e);if((o=o-c-1)>b)l.c=l.e=null;else if(o=v)?re(c,s):ne(c,s,"0");else if(a=(e=k(new x(e),t,r)).e,o=(c=Z(e.c)).length,1==n||2==n&&(t<=a||a<=y)){for(;oo){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=a-o)>0)for(a+1==o&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function I(e,t){for(var r,n,i=1,a=new x(e[0]);i=10;i/=10,n++);return(r=n+r*z-1)>b?e.c=e.e=null:r=10;o/=10,i++);if((a=t-i)<0)a+=z,s=t,c=h[u=0],f=j(c/l[i-s-1]%10);else if((u=H((a+1)/z))>=h.length){if(!n)break e;for(;h.length<=u;h.push(0));c=f=0,i=1,s=(a%=z)-z+1}else{for(c=o=h[u],i=1;o>=10;o/=10,i++);f=(s=(a%=z)-z+i)<0?0:j(c/l[i-s-1]%10)}if(n=n||t<0||null!=h[u+1]||(s<0?c:c%l[i-s-1]),n=r<4?(f||n)&&(0==r||r==(e.s<0?3:2)):f>5||5==f&&(4==r||n||6==r&&(a>0?s>0?c/l[i-s]:0:h[u-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,n?(t-=e.e+1,h[0]=l[(z-t%z)%z],e.e=-t||0):h[0]=e.e=0,e;if(0==a?(h.length=u,o=1,u--):(h.length=u+1,o=l[z-a],h[u]=s>0?j(c/l[i-s]%l[s])*o:0),n)for(;;){if(0==u){for(a=1,s=h[0];s>=10;s/=10,a++);for(s=h[0]+=o,o=1;s>=10;s/=10,o++);a!=o&&(e.e++,h[0]==q&&(h[0]=1));break}if(h[u]+=o,h[u]!=q)break;h[u--]=0,o=1}for(a=h.length;0===h[--a];h.pop());}e.e>b?e.c=e.e=null:e.e=v?re(t,r):ne(t,r,"0"),e.s<0?"-"+t:t)}return x.clone=e,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(V+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(ee(r=e[t],0,J,t),p=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(ee(r=e[t],0,8,t),g=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(ee(r[0],-J,0,t),ee(r[1],0,J,t),y=r[0],v=r[1]):(ee(r,-J,J,t),y=-(v=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)ee(r[0],-J,-1,t),ee(r[1],1,J,t),m=r[0],b=r[1];else{if(ee(r,-J,J,t),!r)throw Error(V+t+" cannot be zero: "+r);m=-(b=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(V+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw w=!r,Error(V+"crypto unavailable");w=r}else w=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(ee(r=e[t],0,9,t),S=r),e.hasOwnProperty(t="POW_PRECISION")&&(ee(r=e[t],0,J,t),E=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(V+t+" not an object: "+r);C=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(V+t+" invalid: "+r);B="0123456789"==r.slice(0,10),A=r}}return{DECIMAL_PLACES:p,ROUNDING_MODE:g,EXPONENTIAL_AT:[y,v],RANGE:[m,b],CRYPTO:w,MODULO_MODE:S,POW_PRECISION:E,FORMAT:C,ALPHABET:A}},x.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!x.DEBUG)return!0;var t,r,n=e.c,i=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&i>=-J&&i<=J&&i===j(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%z)<1&&(t+=z),String(n[0]).length==t){for(t=0;t=q||r!==j(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===a||1===a||-1===a))return!0;throw Error(V+"Invalid BigNumber: "+e)},x.maximum=x.max=function(){return I(arguments,-1)},x.minimum=x.min=function(){return I(arguments,1)},x.random=(a=9007199254740992,s=Math.random()*a&2097151?function(){return j(Math.random()*a)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,a,o=0,c=[],u=new x(d);if(null==e?e=p:ee(e,0,J),i=H(e/z),w)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));o>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(c.push(a%1e14),o+=2);o=i/2}else{if(!crypto.randomBytes)throw w=!1,Error(V+"crypto unavailable");for(t=crypto.randomBytes(i*=7);o=9e15?crypto.randomBytes(7).copy(t,o):(c.push(a%1e14),o+=7);o=i/7}if(!w)for(;o=10;a/=10,o++);or-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,a,s,o){var c,u,f,h,l,d,y,v,m=n.indexOf("."),b=p,w=g;for(m>=0&&(h=E,E=0,n=n.replace(".",""),d=(v=new x(i)).pow(n.length-m),E=h,v.c=t(ne(Z(d.c),d.e,"0"),10,a,e),v.e=v.c.length),f=h=(y=t(n,i,a,o?(c=A,e):(c=e,A))).length;0==y[--h];y.pop());if(!y[0])return c.charAt(0);if(m<0?--f:(d.c=y,d.e=f,d.s=s,y=(d=r(d,v,b,w,a)).c,l=d.r,f=d.e),m=y[u=f+b+1],h=a/2,l=l||u<0||null!=y[u+1],l=w<4?(null!=m||l)&&(0==w||w==(d.s<0?3:2)):m>h||m==h&&(4==w||l||6==w&&1&y[u-1]||w==(d.s<0?8:7)),u<1||!y[0])n=l?ne(c.charAt(1),-b,c.charAt(0)):c.charAt(0);else{if(y.length=u,l)for(--a;++y[--u]>a;)y[u]=0,u||(++f,y=[1].concat(y));for(h=y.length;!y[--h];);for(m=0,n="";m<=h;n+=c.charAt(y[m++]));n=ne(n,f,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,a,s,o=0,c=e.length,u=t%Y,f=t/Y|0;for(e=e.slice();c--;)o=((i=u*(a=e[c]%Y)+(n=f*a+(s=e[c]/Y|0)*u)%Y*Y+o)/r|0)+(n/Y|0)+f*s,e[c]=i%r;return o&&(e=[o].concat(e)),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.splice(0,1));}return function(n,i,a,s,o){var c,u,f,h,l,d,p,g,y,v,m,b,w,S,E,C,A,B=n.s==i.s?1:-1,T=n.c,I=i.c;if(!(T&&T[0]&&I&&I[0]))return new x(n.s&&i.s&&(T?!I||T[0]!=I[0]:I)?T&&0==T[0]||!I?0*B:B/0:NaN);for(y=(g=new x(B)).c=[],B=a+(u=n.e-i.e)+1,o||(o=q,u=Q(n.e/z)-Q(i.e/z),B=B/z|0),f=0;I[f]==(T[f]||0);f++);if(I[f]>(T[f]||0)&&u--,B<0)y.push(1),h=!0;else{for(S=T.length,C=I.length,f=0,B+=2,(l=j(o/(I[0]+1)))>1&&(I=e(I,l,o),T=e(T,l,o),C=I.length,S=T.length),w=C,m=(v=T.slice(0,C)).length;m=o/2&&E++;do{if(l=0,(c=t(I,v,C,m))<0){if(b=v[0],C!=m&&(b=b*o+(v[1]||0)),(l=j(b/E))>1)for(l>=o&&(l=o-1),p=(d=e(I,l,o)).length,m=v.length;1==t(d,v,p,m);)l--,r(d,C=10;B/=10,f++);k(g,a+(g.e=f+u*z-1)+1,s,h)}else g.e=u,g.r=+h;return g}}(),o=/^(-?)0([xbo])(?=\w[\w.]*$)/i,c=/^([^.]+)\.$/,u=/^\.([^.]+)$/,f=/^-?(Infinity|NaN)$/,h=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,a=r?t:t.replace(h,"");if(f.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(o,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,a=a.replace(c,"$1").replace(u,"0.$1")),t!=a))return new x(a,i);if(x.DEBUG)throw Error(V+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},l.absoluteValue=l.abs=function(){var e=new x(this);return e.s<0&&(e.s=1),e},l.comparedTo=function(e,t){return $(this,new x(e,t))},l.decimalPlaces=l.dp=function(e,t){var r,n,i,a=this;if(null!=e)return ee(e,0,J),null==t?t=g:ee(t,0,8),k(new x(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((i=r.length-1)-Q(this.e/z))*z,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},l.dividedBy=l.div=function(e,t){return r(this,new x(e,t),p,g)},l.dividedToIntegerBy=l.idiv=function(e,t){return r(this,new x(e,t),0,1)},l.exponentiatedBy=l.pow=function(e,t){var r,n,i,a,s,o,c,u,f=this;if((e=new x(e)).c&&!e.isInteger())throw Error(V+"Exponent not an integer: "+R(e));if(null!=t&&(t=new x(t)),s=e.e>14,!f.c||!f.c[0]||1==f.c[0]&&!f.e&&1==f.c.length||!e.c||!e.c[0])return u=new x(Math.pow(+R(f),s?e.s*(2-te(e)):+R(e))),t?u.mod(t):u;if(o=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new x(NaN);(n=!o&&f.isInteger()&&t.isInteger())&&(f=f.mod(t))}else{if(e.e>9&&(f.e>0||f.e<-1||(0==f.e?f.c[0]>1||s&&f.c[1]>=24e7:f.c[0]<8e13||s&&f.c[0]<=9999975e7)))return a=f.s<0&&te(e)?-0:0,f.e>-1&&(a=1/a),new x(o?1/a:a);E&&(a=H(E/z+2))}for(s?(r=new x(.5),o&&(e.s=1),c=te(e)):c=(i=Math.abs(+R(e)))%2,u=new x(d);;){if(c){if(!(u=u.times(f)).c)break;a?u.c.length>a&&(u.c.length=a):n&&(u=u.mod(t))}if(i){if(0===(i=j(i/2)))break;c=i%2}else if(k(e=e.times(r),e.e+1,1),e.e>14)c=te(e);else{if(0==(i=+R(e)))break;c=i%2}f=f.times(f),a?f.c&&f.c.length>a&&(f.c.length=a):n&&(f=f.mod(t))}return n?u:(o&&(u=d.div(u)),t?u.mod(t):a?k(u,E,g,void 0):u)},l.integerValue=function(e){var t=new x(this);return null==e?e=g:ee(e,0,8),k(t,t.e+1,e)},l.isEqualTo=l.eq=function(e,t){return 0===$(this,new x(e,t))},l.isFinite=function(){return!!this.c},l.isGreaterThan=l.gt=function(e,t){return $(this,new x(e,t))>0},l.isGreaterThanOrEqualTo=l.gte=function(e,t){return 1===(t=$(this,new x(e,t)))||0===t},l.isInteger=function(){return!!this.c&&Q(this.e/z)>this.c.length-2},l.isLessThan=l.lt=function(e,t){return $(this,new x(e,t))<0},l.isLessThanOrEqualTo=l.lte=function(e,t){return-1===(t=$(this,new x(e,t)))||0===t},l.isNaN=function(){return!this.s},l.isNegative=function(){return this.s<0},l.isPositive=function(){return this.s>0},l.isZero=function(){return!!this.c&&0==this.c[0]},l.minus=function(e,t){var r,n,i,a,s=this,o=s.s;if(t=(e=new x(e,t)).s,!o||!t)return new x(NaN);if(o!=t)return e.s=-t,s.plus(e);var c=s.e/z,u=e.e/z,f=s.c,h=e.c;if(!c||!u){if(!f||!h)return f?(e.s=-t,e):new x(h?s:NaN);if(!f[0]||!h[0])return h[0]?(e.s=-t,e):new x(f[0]?s:3==g?-0:0)}if(c=Q(c),u=Q(u),f=f.slice(),o=c-u){for((a=o<0)?(o=-o,i=f):(u=c,i=h),i.reverse(),t=o;t--;i.push(0));i.reverse()}else for(n=(a=(o=f.length)<(t=h.length))?o:t,o=t=0;t0)for(;t--;f[r++]=0);for(t=q-1;n>o;){if(f[--n]=0;){for(r=0,l=b[i]%y,d=b[i]/y|0,a=i+(s=c);a>i;)r=((u=l*(u=m[--s]%y)+(o=d*u+(f=m[s]/y|0)*l)%y*y+p[a]+r)/g|0)+(o/y|0)+d*f,p[a--]=u%g;p[a]=r}return r?++n:p.splice(0,1),F(e,p,n)},l.negated=function(){var e=new x(this);return e.s=-e.s||null,e},l.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new x(e,t)).s,!i||!t)return new x(NaN);if(i!=t)return e.s=-t,n.minus(e);var a=n.e/z,s=e.e/z,o=n.c,c=e.c;if(!a||!s){if(!o||!c)return new x(i/0);if(!o[0]||!c[0])return c[0]?e:new x(o[0]?n:0*i)}if(a=Q(a),s=Q(s),o=o.slice(),i=a-s){for(i>0?(s=a,r=c):(i=-i,r=o),r.reverse();i--;r.push(0));r.reverse()}for((i=o.length)-(t=c.length)<0&&(r=c,c=o,o=r,t=i),i=0;t;)i=(o[--t]=o[t]+c[t]+i)/q|0,o[t]=q===o[t]?0:o[t]%q;return i&&(o=[i].concat(o),++s),F(e,o,s)},l.precision=l.sd=function(e,t){var r,n,i,a=this;if(null!=e&&e!==!!e)return ee(e,1,J),null==t?t=g:ee(t,0,8),k(new x(a),e,t);if(!(r=a.c))return null;if(n=(i=r.length-1)*z+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},l.shiftedBy=function(e){return ee(e,-9007199254740991,W),this.times("1e"+e)},l.squareRoot=l.sqrt=function(){var e,t,n,i,a,s=this,o=s.c,c=s.s,u=s.e,f=p+4,h=new x("0.5");if(1!==c||!o||!o[0])return new x(!c||c<0&&(!o||o[0])?NaN:o?s:1/0);if(0==(c=Math.sqrt(+R(s)))||c==1/0?(((t=Z(o)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=Q((u+1)/2)-(u<0||u%2),n=new x(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new x(c+""),n.c[0])for((c=(u=n.e)+f)<3&&(c=0);;)if(a=n,n=h.times(a.plus(r(s,a,f,1))),Z(a.c).slice(0,c)===(t=Z(n.c)).slice(0,c)){if(n.e0&&p>0){for(a=p%o||o,f=d.substr(0,a);a0&&(f+=u+d.slice(a)),l&&(f="-"+f)}n=h?f+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):f}return(r.prefix||"")+n+(r.suffix||"")},l.toFraction=function(e){var t,n,i,a,s,o,c,u,f,h,l,p,y=this,v=y.c;if(null!=e&&(!(c=new x(e)).isInteger()&&(c.c||1!==c.s)||c.lt(d)))throw Error(V+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+R(c));if(!v)return new x(y);for(t=new x(d),f=n=new x(d),i=u=new x(d),p=Z(v),s=t.e=p.length-y.e-1,t.c[0]=X[(o=s%z)<0?z+o:o],e=!e||c.comparedTo(t)>0?s>0?t:f:c,o=b,b=1/0,c=new x(p),u.c[0]=0;h=r(c,t,0,1),1!=(a=n.plus(h.times(i))).comparedTo(e);)n=i,i=a,f=u.plus(h.times(a=f)),u=a,t=c.minus(h.times(a=t)),c=a;return a=r(e.minus(n),i,0,1),u=u.plus(a.times(f)),n=n.plus(a.times(i)),u.s=f.s=y.s,l=r(f,i,s*=2,g).minus(y).abs().comparedTo(r(u,n,s,g).minus(y).abs())<1?[f,i]:[u,n],b=o,l},l.toNumber=function(){return+R(this)},l.toPrecision=function(e,t){return null!=e&&ee(e,1,J),T(this,e,t,2)},l.toString=function(e){var t,r=this,i=r.s,a=r.e;return null===a?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=a<=y||a>=v?re(Z(r.c),a):ne(Z(r.c),a,"0"):10===e&&B?t=ne(Z((r=k(new x(r),p+a+1,g)).c),r.e,"0"):(ee(e,2,A.length,"Base"),t=n(ne(Z(r.c),a,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},l.valueOf=l.toJSON=function(){return R(this)},l._isBigNumber=!0,l[Symbol.toStringTag]="BigNumber",l[Symbol.for("nodejs.util.inspect.custom")]=l.valueOf,null!=t&&x.set(t),x}();const ae=ie;function se(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,s,o=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var oe=function(){function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;e(this,t),this.bytes=r,this.length=this.bytes.length,this.position=n,this.bitPos=i}return i(t,[{key:"clone",value:function(){return new t(this.bytes,this.position,this.bitPos)}},{key:"getBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!(this.position>this.length)){var t=null!==e?this.position+e:this.length,r=this.bytes.slice(this.position,t);return this.position=t,this.bitPos=0,r}}},{key:"readString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(this.position>this.length)){-1===e&&(e=this.length-this.position);for(var t="",r=this.position;r1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r=0;if("be"===t)for(var n=this.position;n=this.position;i--)r<<=8,r|=this.bytes[i];return this.position+=e,this.bitPos=0,r}}},{key:"readBits",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r,n=0,i=0;for(n=this.bytes[this.position++]&(r=this.bitPos,"be"===t?(1<<8-r)-1:256-(1<>>=this.bitPos),i=8-this.bitPos,this.bitPos=0;ie){var a=i-e;"be"===t?n>>>=a:n&=(1<this.length))if(this.bitPos=0,"number"!=typeof e){var t=e.length,r=e[t-1];this.position=t;for(var n,i=function(e,t){var r=new Array;return e.forEach((function(e,n){r[e]=t-n})),r}(e,t);this.position=0;a--)if(this.bytes[this.position-t+a]!==e[a]){n=!1,this.position+=i[e[a]];break}if(n){this.position-=t;break}}}else for(;++this.positionthis.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsBy",value:function(e){var t=this.position-e;if(t<0||t>this.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsByBits",value:function(e){if(e<=this.bitPos)this.bitPos-=e;else for(this.bitPos>0&&(e-=this.bitPos,this.bitPos=0);e>0;)this.moveBackwardsBy(1),this.bitPos=8,this.moveBackwardsByBits(e),e-=8}},{key:"moveTo",value:function(e){if(e<0||e>this.length)throw new Error("Cannot move to position "+e+" in stream. Out of bounds.");this.position=e,this.bitPos=0}},{key:"hasMore",value:function(){return this.position0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position;return this.bitPos>0&&t++,this.bytes.slice(e,t)}}])}();function ce(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ue(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ue(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw a}}}}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r>4],c=i[(15&s)>>2],u=(2&s)>>1;if("free"===o||"bad"===o||"reserved"===c){r.moveBackwardsBy(1);break}var f=Math.floor(144*o/c+u);if(r.position+f>r.length){r.moveTo(r.length);break}r.moveForwardsBy(f-3)}return r.carve()}},{name:"MPEG-4 Part 14 audio",extension:"m4a",mime:"audio/m4a",description:"",signature:[{4:102,5:116,6:121,7:112,8:77,9:52,10:65},{0:77,1:52,2:65,3:32}],extractor:null},{name:"Free Lossless Audio Codec",extension:"flac",mime:"audio/x-flac",description:"",signature:{0:102,1:76,2:97,3:67},extractor:null},{name:"Adaptive Multi-Rate audio codec",extension:"amr",mime:"audio/amr",description:"",signature:{0:35,1:33,2:65,3:77,4:82,5:10},extractor:null},{name:"Audacity",extension:"au",mime:"audio/x-au",description:"",signature:{0:100,1:110,2:115,3:46,24:65,25:117,26:100,27:97,28:99,29:105,30:116,31:121,32:66,33:108,34:111,35:99,36:107,37:70,38:105,39:108,40:101},extractor:null},{name:"Audacity Block",extension:"auf",mime:"application/octet-stream",description:"",signature:{0:65,1:117,2:100,3:97,4:99,5:105,6:116,7:121,8:66,9:108,10:111,11:99,12:107,13:70,14:105,15:108,16:101},extractor:null},{name:"Audio Interchange File",extension:"aif",mime:"audio/x-aiff",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:70},extractor:null},{name:"Audio Interchange File (compressed)",extension:"aifc",mime:"audio/x-aifc",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:67},extractor:null}],Documents:[{name:"Portable Document Format",extension:"pdf",mime:"application/pdf",description:"",signature:{0:37,1:80,2:68,3:70},extractor:function(e,t){var r=new oe(e.slice(t));return r.continueUntil([37,37,69,79,70]),r.moveForwardsBy(5),r.consumeIf(13),r.consumeIf(10),r.carve()}},{name:"Portable Document Format (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:65,1:74,2:86,3:66,4:69,5:82,6:105},extractor:null},{name:"Adobe PostScript",extension:"ps,eps,ai,pfa",mime:"application/postscript",description:"",signature:{0:37,1:33,2:80,3:83,4:45,5:65,6:100,7:111,8:98,9:101},extractor:null},{name:"PostScript",extension:"ps",mime:"application/postscript",description:"",signature:{0:37,1:33},extractor:null},{name:"Encapsulated PostScript",extension:"eps,ai",mime:"application/eps",description:"",signature:{0:197,1:208,2:211,3:198},extractor:null},{name:"Rich Text Format",extension:"rtf",mime:"application/rtf",description:"",signature:{0:123,1:92,2:114,3:116},extractor:function(e,t){var r=new oe(e.slice(t)),n=0;if(123!==r.readInt(1))throw new Error("Not a valid RTF file");for(n++;n>0&&r.hasMore();)switch(r.readInt(1)){case 123:n++;break;case 125:n--;break;case 92:r.consumeIf(92),r.position++}return r.carve()}},{name:"Microsoft Office document/OLE2",extension:"ole2,doc,xls,dot,ppt,xla,ppa,pps,pot,msi,sdw,db,vsd,msg",mime:"application/msword,application/vnd.ms-excel,application/vnd.ms-powerpoint",description:"Microsoft Office documents",signature:{0:208,1:207,2:17,3:224,4:161,5:177,6:26,7:225},extractor:null},{name:"Microsoft Office document/OLE2 (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:48,1:77,2:56,3:82,4:52,5:75,6:71,7:120},extractor:null},{name:"Microsoft Office 2007+ document",extension:"docx,xlsx,pptx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.presentation",description:"",signature:{38:95,39:84,40:121,41:112,42:101,43:115,44:93,45:46,46:120,47:109,48:108},extractor:he},{name:"Microsoft Access database",extension:"mdb,mda,mde,mdt,fdb,psa",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:74,14:101,15:116},extractor:null},{name:"Microsoft Access 2007+ database",extension:"accdb,accde,accda,accdu",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:65,14:67,15:69,16:32},extractor:null},{name:"Microsoft OneNote document",extension:"one",mime:"application/onenote",description:"",signature:{0:228,1:82,2:92,3:123,4:140,5:216,6:167,7:77,8:174,9:177,10:83,11:120,12:208,13:41,14:150,15:211},extractor:null},{name:"Outlook Express database",extension:"dbx",mime:"application/octet-stream",description:"",signature:{0:207,1:173,2:18,3:254,4:[48,197,198,199],11:17},extractor:null},{name:"Personal Storage Table (Outlook)",extension:"pst,ost,fdb,pab",mime:"application/octet-stream",description:"",signature:{0:33,1:66,2:68,3:78},extractor:null},{name:"Microsoft Exchange Database",extension:"edb",mime:"application/octet-stream",description:"",signature:{4:239,5:205,6:171,7:137,8:[32,35],9:6,10:0,11:0,12:[0,1],13:0,14:0,15:0},extractor:null},{name:"WordPerfect document",extension:"wpd,wp,wp5,wp6,wpp,bk!,wcm",mime:"application/wordperfect",description:"",signature:{0:255,1:87,2:80,3:67,7:[0,1,2],8:1,9:10},extractor:null},{name:"EPUB e-book",extension:"epub",mime:"application/epub+zip",description:"",signature:{0:80,1:75,2:3,3:4,30:109,31:105,32:109,33:101,34:116,35:121,36:112,37:101,38:97,39:112,40:112,41:108,42:105,43:99,44:97,45:116,46:105,47:111,48:110,49:47,50:101,51:112,52:117,53:98,54:43,55:122,56:105,57:112},extractor:he}],Applications:[{name:"Windows Portable Executable",extension:"exe,dll,drv,vxd,sys,ocx,vbx,com,fon,scr",mime:"application/vnd.microsoft.portable-executable",description:"",signature:{0:77,1:90,3:[0,1,2],5:[0,1,2]},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(60);var n=r.readInt(4,"le");r.moveTo(n),r.moveForwardsBy(6);var i=r.readInt(2,"le");r.moveForwardsBy(16);var a=523===r.readInt(2,"le")?112:96;r.moveForwardsBy(a-2),r.moveForwardsBy(32);var s=r.readInt(4,"le"),o=r.readInt(4,"le");if(s>0)return r.moveTo(s+o),r.carve();r.moveForwardsBy(88),r.moveForwardsBy(40*(i-1)),r.moveForwardsBy(16);var c=r.readInt(4,"le"),u=r.readInt(4,"le");return r.moveTo(u+c),r.carve()}},{name:"Executable and Linkable Format",extension:"elf,bin,axf,o,prx,so",mime:"application/x-executable",description:"Executable and Linkable Format file. No standard file extension.",signature:{0:127,1:69,2:76,3:70},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(4);var n=1===r.readInt(1),i=1===r.readInt(1)?"le":"be";r.moveForwardsBy(n?26:34);var a=n?r.readInt(4,i):r.readInt(8,i);r.moveForwardsBy(10);var s=r.readInt(2,i),o=r.readInt(2,i);return r.moveTo(a),r.moveForwardsBy(s*o),r.carve()}},{name:"MacOS Mach-O object",extension:"dylib",mime:"application/octet-stream",description:"",signature:[{0:202,1:254,2:186,3:190,4:0,5:0,6:0,7:[1,2,3]},{0:206,1:250,2:237,3:254,4:7,5:0,6:0,7:0,8:[1,2,3]}],extractor:le},{name:"MacOS Mach-O 64-bit object",extension:"dylib",mime:"application/octet-stream",description:"",signature:{0:207,1:250,2:237,3:254},extractor:le},{name:"Adobe Flash",extension:"swf",mime:"application/x-shockwave-flash",description:"",signature:{0:[67,70],1:87,2:83},extractor:null},{name:"Java Class",extension:"class",mime:"application/java-vm",description:"",signature:{0:202,1:254,2:186,3:190},extractor:null},{name:"Dalvik Executable",extension:"dex",mime:"application/octet-stream",description:"Dalvik Executable as used by Android",signature:{0:100,1:101,2:120,3:10,4:48,5:51,6:53,7:0},extractor:null},{name:"Google Chrome Extension",extension:"crx",mime:"application/crx",description:"Google Chrome extension or packaged app",signature:{0:67,1:114,2:50,3:52},extractor:null}],Archives:[{name:"PKZIP archive",extension:"zip",mime:"application/zip",description:"",signature:{0:80,1:75,2:[3,5,7],3:[4,6,8]},extractor:he},{name:"PKZIP archive (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:85,1:69,2:115,3:68,4:66,5:66},extractor:null},{name:"TAR archive",extension:"tar",mime:"application/x-tar",description:"",signature:{257:117,258:115,259:116,260:97,261:114},extractor:function(e,t){for(var r=new oe(e.slice(t)),n=function(){if(r.moveForwardsBy(257),r.getBytes(5).join("")!==[117,115,116,97,114].join(""))return r.moveBackwardsBy(262),1;r.moveBackwardsBy(138);var e=0;r.getBytes(11).forEach((function(t,r){e+=(t-48).toString()})),e=512*Math.ceil(parseInt(e,8)/512),r.moveForwardsBy(e+377)};r.hasMore()&&!n(););return r.consumeWhile(0),r.carve()}},{name:"Roshal Archive",extension:"rar",mime:"application/x-rar-compressed",description:"",signature:{0:82,1:97,2:114,3:33,4:26,5:7,6:[0,1]},extractor:null},{name:"Gzip",extension:"gz",mime:"application/gzip",description:"",signature:{0:31,1:139,2:8},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(3);var n=r.readInt(1);if(r.moveForwardsBy(4),r.readInt(1),r.moveForwardsBy(1),4&n){var i=r.readInt(2,"le");r.moveForwardsby(i)}return 8&n&&(r.continueUntil(0),r.moveForwardsBy(1)),16&n&&(r.continueUntil(0),r.moveForwardsBy(1)),2&n&&r.moveForwardsBy(2),me(r),r.moveForwardsBy(8),r.carve()}},{name:"Bzip2",extension:"bz2",mime:"application/x-bzip2",description:"",signature:{0:66,1:90,2:104},extractor:function(e,t){for(var r=new oe(e.slice(t)),n=[[119,36,83,133,9],[238,72,167,10,18],[220,145,78,20,36],[185,34,156,40,72],[114,69,56,80,144],[187,146,41,194,132],[93,201,20,225,66],[46,228,138,112,161],[23,114,69,56,80]],i=0;i=2368&&r.moveForwardsBy(4);var o=r.readInt(1,"be");if(r.moveForwardsBy(o),64&s){var c=r.readInt(4,"be");r.moveForwardsBy(c)}for(r.moveForwardsBy(4);r.hasMore();){var u=r.readInt(4,"be");if(0===u)break;var f=r.readInt(4,"be"),h=u===f?i:i+n;r.moveForwardsBy(f+4*h)}return r.carve()}},{name:"Linux deb package",extension:"deb",mime:"application/vnd.debian.binary-package",description:"",signature:{0:33,1:60,2:97,3:114,4:99,5:104,6:62},extractor:function(e,t){var r=new oe(e.slice(t));for(r.moveForwardsBy(8);r.hasMore();){r.moveForwardsBy(48);var n,i="",a=ce(r.getBytes(10));try{for(a.s();!(n=a.n()).done;){var s=n.value;i+=String.fromCharCode(s)}}catch(e){a.e(e)}finally{a.f()}i=parseInt(i.trim(),10),r.moveForwardsBy(2),r.moveForwardsBy(i)}return r.carve()}},{name:"Apple Disk Image",extension:"dmg",mime:"application/x-apple-diskimage",description:"",signature:{0:120,1:1,2:115,3:13,4:98,5:98,6:96},extractor:null}],Miscellaneous:[{name:"UTF-8 text",extension:"txt",mime:"text/plain",description:"UTF-8 encoded Unicode byte order mark, commonly but not exclusively seen in text files.",signature:{0:239,1:187,2:191},extractor:null},{name:"UTF-32 LE text",extension:"utf32le",mime:"charset/utf32le",description:"Little-endian UTF-32 encoded Unicode byte order mark.",signature:{0:255,1:254,2:0,3:0},extractor:null},{name:"UTF-16 LE text",extension:"utf16le",mime:"charset/utf16le",description:"Little-endian UTF-16 encoded Unicode byte order mark.",signature:{0:255,1:254},extractor:null},{name:"Web Open Font Format",extension:"woff",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:70,4:0,5:1,6:0,7:0},extractor:null},{name:"Web Open Font Format 2",extension:"woff2",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:50,4:0,5:1,6:0,7:0},extractor:null},{name:"Embedded OpenType font",extension:"eot",mime:"application/octet-stream",description:"",signature:[{8:2,9:0,10:1,34:76,35:80},{8:1,9:0,10:0,34:76,35:80},{8:2,9:0,10:2,34:76,35:80}],extractor:null},{name:"TrueType Font",extension:"ttf",mime:"application/font-sfnt",description:"",signature:{0:0,1:1,2:0,3:0,4:0},extractor:null},{name:"OpenType Font",extension:"otf",mime:"application/font-sfnt",description:"",signature:{0:79,1:84,2:84,3:79,4:0},extractor:null},{name:"SQLite",extension:"sqlite",mime:"application/x-sqlite3",description:"",signature:{0:83,1:81,2:76,3:105},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(16);var n=r.readInt(2);r.moveTo(28);var i=r.readInt(4);return r.moveTo(n*i),r.carve()}},{name:"BitTorrent link",extension:"torrent",mime:"application/x-bittorrent",description:"",signature:[{0:100,1:56,2:58,3:97,4:110,5:110,6:111,7:117,8:110,9:99,10:101,11:35,12:35,13:58},{0:100,1:52,2:58,3:105,4:110,5:102,6:111,7:100,8:[52,53,54],9:58}],extractor:null},{name:"Cryptocurrency wallet",extension:"wallet",mime:"application/octet-stream",description:"",signature:{0:0,1:0,2:0,3:0,4:1,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:98,13:49,14:5,15:0},extractor:null},{name:"Registry fragment",extension:"hbin",mime:"application/octet-stream",description:"",signature:{0:104,1:98,2:105,3:110,4:0},extractor:null},{name:"Registry script",extension:"rgs",mime:"application/octet-stream",description:"",signature:{0:72,1:75,2:67,3:82,4:13,5:10,6:92,7:123},extractor:null},{name:"WinNT Registry Hive",extension:"registry",mime:"application/octet-stream",description:"",signature:{0:114,1:101,2:103,3:102},extractor:null},{name:"Windows Event Log",extension:"evt",mime:"application/octet-stream",description:"",signature:{0:48,1:0,2:0,3:0,4:76,5:102,6:76,7:101},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(20);var n=r.readInt(4,"le");r.moveTo(n);var i=r.readInt(4,"le");return r.moveForwardsBy(i-4),r.carve()}},{name:"Windows Event Log",extension:"evtx",mime:"application/octet-stream",description:"",signature:{0:69,1:108,2:102,3:70,4:105,5:108,6:101},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(40);var n=r.readInt(4,"le")-44;for(r.moveForwardsBy(n);r.hasMore()&&r.getBytes(7).join("")===[69,108,102,67,104,110,107].join("");)r.moveForwardsBy(65529);return r.consumeWhile(0),r.carve()}},{name:"Windows Pagedump",extension:"dmp",mime:"application/octet-stream",description:"",signature:{0:80,1:65,2:71,3:69,4:68,5:85,6:[77,54],7:[80,52]},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(112),r.moveTo(4096*(r.readInt(4,"le")+1)),r.carve()}},{name:"Windows Prefetch",extension:"pf",mime:"application/x-pf",description:"",signature:{0:[17,23,26],1:0,2:0,3:0,4:83,5:67,6:67,7:65},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(12),r.moveTo(r.readInt(4,"be")),r.carve()}},{name:"Windows Prefetch (Win 10)",extension:"pf",mime:"application/x-pf",description:"",signature:{0:77,1:65,2:77,3:4,7:0},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(r.readInt(4,"be")),r.carve()}},{name:"PList (XML)",extension:"plist",mime:"application/xml",description:"",signature:{39:60,40:33,41:68,42:79,43:67,44:84,45:89,46:80,47:69,48:32,49:112,50:108,51:105,52:115,53:116},extractor:function(e,t){var r=new oe(e.slice(t)),n=0;for(r.continueUntil([60,112,108,105,115,116]),r.moveForwardsBy(6),n++;n>0&&r.hasMore();)60===r.readInt(1)&&(r.getBytes(5).join("")===[112,108,105,115,116].join("")?n++:r.moveBackwardsBy(5),r.getBytes(7).join("")===[47,112,108,105,115,116,62].join("")?n--:r.moveBackwardsBy(7));return r.consumeIf(10),r.carve()}},{name:"PList (binary)",extension:"bplist,plist,ipmeta,abcdp,mdbackup,mdinfo,strings,nib,ichat,qtz,webbookmark,webhistory",mime:"application/x-plist",description:"",signature:{0:98,1:112,2:108,3:105,4:115,5:116,6:48,7:48},extractor:null},{name:"MacOS X Keychain",extension:"keychain",mime:"application/octet-stream",description:"",signature:{0:107,1:121,2:99,3:104,4:0,5:1},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(20),r.moveForwardsBy(r.readInt(4)),r.carve()}},{name:"TCP Packet",extension:"tcp",mime:"application/tcp",description:"",signature:{12:8,13:0,14:69,15:0,21:0,22:function(e){return e>=1&&e<=128},23:6},extractor:null},{name:"UDP Packet",extension:"udp",mime:"application/udp",description:"",signature:{12:8,13:0,14:69,15:0,16:[0,1,2,3,4,5],22:function(e){return e>=1&&e<=128},23:17},extractor:null},{name:"Compiled HTML",extension:"chm,chw,chi",mime:"application/vnd.ms-htmlhelp",description:"",signature:{0:73,1:84,2:83,3:70,4:3,5:0,6:0,7:0},extractor:null},{name:"Windows Password",extension:"pwl",mime:"application/octet-stream",description:"",signature:{0:227,1:130,2:133,3:150},extractor:null},{name:"Bitlocker recovery key",extension:"bitlocker",mime:"application/octet-stream",description:"",signature:{0:255,1:254,2:66,3:0,4:105,5:0,6:116,7:0,8:76,9:0,10:111,11:0,12:99,13:0,14:107,15:0,16:101,17:0,18:114,19:0,20:32,21:0},extractor:null},{name:"Certificate",extension:"cer,cat,p7b,p7c,p7m,p7s,swz,rsa,crl,crt,der",mime:"application/pkix-cert",description:"",signature:{0:48,1:130,4:[6,10,48]},extractor:null},{name:"Certificate",extension:"cat,swz,p7m",mime:"application/vnd.ms-pki.seccat",description:"",signature:{0:48,1:131,2:function(e){return 0!==e},5:6,6:9},extractor:null},{name:"PGP pubring",extension:"pkr,gpg",mime:"application/pgp-keys",description:"",signature:{0:153,1:1,2:[13,162],3:4},extractor:null},{name:"PGP secring",extension:"skr",mime:"application/pgp-keys",description:"",signature:[{0:149,1:1,2:207,3:4},{0:149,1:3,2:198,3:4},{0:149,1:5,2:134,3:4}],extractor:null},{name:"PGP Safe",extension:"pgd",mime:"application/pgp-keys",description:"",signature:{0:80,1:71,2:80,3:100,4:77,5:65,6:73,7:78,8:96,9:1,10:0},extractor:null},{name:"Task Scheduler",extension:"job",mime:"application/octet-stream",description:"",signature:{0:[0,1,2,3],1:[5,6],2:1,3:0,20:70,21:0},extractor:null},{name:"Windows Shortcut",extension:"lnk",mime:"application/x-ms-shortcut",description:"",signature:{0:76,1:0,2:0,3:0,4:1,5:20,6:2,7:0,8:0,9:0,10:0,11:0,12:192,13:0,14:0,15:0,16:0,17:0,18:0,19:70},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(52),r.moveTo(r.readInt(4,"le")),r.carve()}},{name:"Bash",extension:"bash",mime:"application/bash",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:98,8:97,9:115,10:104},extractor:null},{name:"Shell",extension:"sh",mime:"application/sh",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:115,8:104},extractor:null},{name:"Python",extension:"py,pyc,pyd,pyo,pyw,pyz",mime:"application/python",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:121,13:116,14:104,15:111,16:110,17:[50,51,10,13]},extractor:null},{name:"Ruby",extension:"rb",mime:"application/ruby",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:114,12:117,13:98,14:121},extractor:null},{name:"perl",extension:"pl,pm,t,pod",mime:"application/perl",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:101,13:114,14:108},extractor:null},{name:"php",extension:"php,phtml,php3,php4,php5,php7,phps,php-s,pht,phar",mime:"application/php",description:"",signature:{0:60,1:63,2:112,3:104,4:112},extractor:null},{name:"Smile",extension:"sml",mime:"\tapplication/x-jackson-smile",description:"",signature:{0:58,1:41,2:10},extractor:null},{name:"Lua Bytecode",extension:"luac",mime:"application/x-lua",description:"",signature:{0:27,1:76,2:117,3:97},extractor:null},{name:"WebAssembly binary",extension:"wasm",mime:"application/octet-stream",description:"",signature:{0:0,1:97,2:115,3:109},extractor:null}]};function he(e,t){var r=new oe(e.slice(t));r.continueUntil([80,75,5,6]),r.moveForwardsBy(20);var n=r.readInt(2,"le");return r.moveForwardsBy(n),r.carve()}function le(e,t){var r="207250237254",n=new oe(e.slice(t)),i=n.getBytes(4).join("");return n.moveTo(function(e,t,r){var n=28;t&&(n+=4),e.moveTo(16);var i=e.readInt(4,r);return function(e,t,r,n){for(var i=0,a=0;a0&&e.moveForwardsBy(1)}var be=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],we=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function Se(e,t,r){for(var n,i=0;(n=Ce(e,t))&&256!==n;){if(++i>1e4)throw new Error("Caught in probable infinite loop while parsing Huffman Block");n<256||(e.readBits(be[n-257],"le"),n=Ce(e,r),e.readBits(we[n],"le"))}}function Ee(e){for(var t=Math.max.apply(Math,e),r=Math.min.apply(Math,e),n=1<>=1;for(var l=a<<16|c,d=u;d>>16;if(s>i)throw new Error(`Invalid Huffman Code length while parsing DEFLATE block at pos ${e.position}: ${s}`);return e.moveBackwardsByBits(i-s),65535&a}function Ae(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e.length){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:0;for(var n in e){var i=parseInt(n,10)+r;switch(typeof e[n]){case"number":if(t[i]!==e[n])return!1;break;case"object":if(e[n].indexOf(t[i])<0)return!1;break;case"function":if(!e[n](t[i]))return!1;break;default:throw new Error(`Unrecognised signature type at offset ${n}`)}}return!0}const xe=function(){return i((function t(){e(this,t)}),null,[{key:"checkForValue",value:function(e){if(void 0===e)throw new Error("only use translation methods with .bind")}},{key:"toArrayBuffer",value:function(){throw new Error("toArrayBuffer has not been implemented")}},{key:"fromArrayBuffer",value:function(){throw new Error("fromArrayBuffer has not been implemented")}}])}();function Te(e,t,r){return t=s(t),a(e,Ie()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Ie(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ie=function(){return!!e})()}const Fe=function(t){function r(){return e(this,r),Te(this,r,arguments)}return c(r,t),i(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=new Uint8Array(this.value).buffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=Array.prototype.slice.call(new Uint8Array(this.value))}}])}(xe);function ke(e,t,r){return t=s(t),a(e,Re()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Re(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Re=function(){return!!e})()}const De=function(t){function r(){return e(this,r),ke(this,r,arguments)}return c(r,t),i(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=ae.isBigNumber(this.value)?O.strToArrayBuffer(this.value.toFixed()):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value);try{this.value=new ae(O.arrayBufferToStr(this.value))}catch(e){this.value=new ae(NaN)}}}])}(xe);function _e(e,t,r){return t=s(t),a(e,Pe()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Pe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pe=function(){return!!e})()}const Ne=function(t){function r(){return e(this,r),_e(this,r,arguments)}return c(r,t),i(r,null,[{key:"toArrayBuffer",value:function(){var e=this;if(r.checkForValue(this.value),!_())return new Promise((function(t,r){O.readFile(e.value).then((function(t){return e.value=t.buffer})).then(t).catch(r)}));this.value=O.readFileSync(this.value)}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=new File(this.value,"unknown")}}])}(xe);function Oe(e,t,r){return t=s(t),a(e,Le()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Le(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Le=function(){return!!e})()}const Ue=function(t){function r(){return e(this,r),Oe(this,r,arguments)}return c(r,t),i(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=this.value?O.strToArrayBuffer(this.value):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=this.value?O.arrayBufferToStr(this.value):""}}])}(xe);function Ke(e,t,r){return t=s(t),a(e,Me()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Me(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Me=function(){return!!e})()}const He=function(t){function r(){return e(this,r),Ke(this,r,arguments)}return c(r,t),i(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=this.value?O.strToArrayBuffer(O.unescapeHtml(O.stripHtmlTags(this.value,!0))):new ArrayBuffer}}])}(Ue);function je(e,t,r){return t=s(t),a(e,Ve()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Ve(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ve=function(){return!!e})()}const Ge=function(t){function r(){return e(this,r),je(this,r,arguments)}return c(r,t),i(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=void 0!==this.value?O.strToArrayBuffer(JSON.stringify(this.value,null,4)):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=JSON.parse(O.arrayBufferToStr(this.value))}}])}(xe);function qe(e,t,r){return t=s(t),a(e,ze()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function ze(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ze=function(){return!!e})()}const We=function(t){function r(){return e(this,r),qe(this,r,arguments)}return c(r,t),i(r,null,[{key:"toArrayBuffer",value:(a=f(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.checkForValue(this.value),!_()){e.next=5;break}this.value=this.value.map((function(e){return Uint8Array.from(e.data)})),e.next=8;break;case 5:return e.next=7,r.concatenateTypedArraysWithTypedElements.apply(r,g(this.value));case 7:this.value=e.sent;case 8:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=[new File(this.value,"unknown")]}},{key:"concatenateTypedArraysWithTypedElements",value:(n=f(l().mark((function e(){var t,r,n,i,a,s,o,c,u,f,h,d,p,g=arguments;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=0,r=g.length,n=new Array(r),i=0;i0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e(this,t),this.value=new ArrayBuffer(0),this.type=t.ARRAY_BUFFER,r&&Object.prototype.hasOwnProperty.call(r,"value")&&Object.prototype.hasOwnProperty.call(r,"type"))this.set(r.value,r.type);else if(r&&null!==n)this.set(r,n);else if(r){var i=t.typeEnum(r.constructor.name);this.set(r,i)}}return i(t,[{key:"get",value:function(e){var r=this;return"string"==typeof e&&(e=t.typeEnum(e)),this.type!==e?_()?(this._translate(e),this.value):new Promise((function(t,n){r._translate(e).then((function(){t(r.value)})).catch(n)})):this.value}},{key:"set",value:function(e,r){if("string"==typeof r&&(r=t.typeEnum(r)),v().debug("Dish type: "+t.enumLookup(r)),this.value=e,this.type=r,!this.valid()){var n=O.truncate(JSON.stringify(this.value),25);throw new K(`Data is not a valid ${t.enumLookup(r)}: ${n}`)}}},{key:"presentAs",value:function(e){return this.clone().get(e)}},{key:"detectDishType",value:function(){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.keys(fe);if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(e&&e.length>1))return[];var r=[],n={};for(var i in fe)t.includes(i)&&(n[i]=fe[i]);for(var a in n)n[a].forEach((function(t){Ae(t.signature,e)&&r.push(t)}));return r}(new Uint8Array(this.value.slice(0,2048)));return e.length&&e[0].mime&&"text/plain"===e[0].mime?e[0].mime:null}},{key:"getTitle",value:(r=f(l().mark((function e(r){var n,i;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n="",e.t0=this.type,e.next=e.t0===t.FILE?4:e.t0===t.LIST_FILE?6:e.t0===t.JSON?8:e.t0===t.NUMBER||e.t0===t.BIG_NUMBER?10:e.t0===t.ARRAY_BUFFER||e.t0===t.BYTE_ARRAY?12:15;break;case 4:return n=this.value.name,e.abrupt("break",26);case 6:return n=`${this.value.length} file(s)`,e.abrupt("break",26);case 8:return n="application/json",e.abrupt("break",26);case 10:return n=this.value.toString(),e.abrupt("break",26);case 12:if(null===(n=this.detectDishType())){e.next=15;break}return e.abrupt("break",26);case 15:return e.prev=15,(i=this.clone()).value=i.value.slice(0,256),e.next=20,i.get(t.STRING);case 20:n=e.sent,e.next=26;break;case 23:e.prev=23,e.t1=e.catch(15),v().error(`${t.enumLookup(this.type)} cannot be sliced. ${e.t1}`);case 26:return e.abrupt("return",n.slice(0,r));case 27:case"end":return e.stop()}}),e,this,[[15,23]])}))),function(e){return r.apply(this,arguments)})},{key:"valid",value:function(){switch(this.type){case t.BYTE_ARRAY:if(!(this.value instanceof Uint8Array||this.value instanceof Array))return!1;for(var e=0;e255)return!1;return!0;case t.STRING:case t.HTML:return"string"==typeof this.value;case t.NUMBER:return"number"==typeof this.value;case t.ARRAY_BUFFER:return this.value instanceof ArrayBuffer;case t.BIG_NUMBER:if(ae.isBigNumber(this.value))return!0;if(Object.keys(this.value).sort().equals(["c","e","s"])){var r=new ae;return r.c=this.value.c,r.e=this.value.e,r.s=this.value.s,this.value=r,!0}return!1;case t.JSON:return!0;case t.FILE:return this.value instanceof File;case t.LIST_FILE:return this.value instanceof Array&&this.value.reduce((function(e,t){return e&&t instanceof File}),!0);default:return!1}}},{key:"size",get:function(){switch(this.type){case t.BYTE_ARRAY:case t.STRING:case t.HTML:return this.value.length;case t.NUMBER:case t.BIG_NUMBER:return this.value.toString().length;case t.ARRAY_BUFFER:return this.value.byteLength;case t.JSON:return JSON.stringify(this.value).length;case t.FILE:return this.value.size;case t.LIST_FILE:return this.value.reduce((function(e,t){return e+t.size}),0);default:return-1}}},{key:"clone",value:function(){var e=new t;switch(this.type){case t.STRING:case t.HTML:case t.NUMBER:case t.BIG_NUMBER:e.set(this.value,this.type);break;case t.BYTE_ARRAY:case t.JSON:e.set(JSON.parse(JSON.stringify(this.value)),this.type);break;case t.ARRAY_BUFFER:e.set(this.value.slice(0),this.type);break;case t.FILE:e.set(new File([this.value],this.value.name,{type:this.value.type,lastModified:this.value.lastModified}),this.type);break;case t.LIST_FILE:e.set(this.value.map((function(e){return new File([e],e.name,{type:e.type,lastModified:e.lastModified})})),this.type);break;default:throw new K("Cannot clone Dish, unknown type")}return e}},{key:"_translate",value:function(e){var r=this;if(v().debug(`Translating Dish from ${t.enumLookup(this.type)} to ${t.enumLookup(e)}`),!_())return new Promise((function(n,i){r._toArrayBuffer().then((function(){return r.type=t.ARRAY_BUFFER})).then((function(){r._fromArrayBuffer(e),n()})).catch(i)}));this._toArrayBuffer(),this.type=t.ARRAY_BUFFER,this._fromArrayBuffer(e)}},{key:"_toArrayBuffer",value:function(){var e=this,r={browser:{[t.STRING]:function(){return Promise.resolve(Ue.toArrayBuffer.bind(e)())},[t.NUMBER]:function(){return Promise.resolve(Je.toArrayBuffer.bind(e)())},[t.HTML]:function(){return Promise.resolve(He.toArrayBuffer.bind(e)())},[t.ARRAY_BUFFER]:function(){return Promise.resolve()},[t.BIG_NUMBER]:function(){return Promise.resolve(De.toArrayBuffer.bind(e)())},[t.JSON]:function(){return Promise.resolve(Ge.toArrayBuffer.bind(e)())},[t.FILE]:function(){return Ne.toArrayBuffer.bind(e)()},[t.LIST_FILE]:function(){return Promise.resolve(We.toArrayBuffer.bind(e)())},[t.BYTE_ARRAY]:function(){return Promise.resolve(Fe.toArrayBuffer.bind(e)())}},node:{[t.STRING]:function(){return Ue.toArrayBuffer.bind(e)()},[t.NUMBER]:function(){return Je.toArrayBuffer.bind(e)()},[t.HTML]:function(){return He.toArrayBuffer.bind(e)()},[t.ARRAY_BUFFER]:function(){},[t.BIG_NUMBER]:function(){return De.toArrayBuffer.bind(e)()},[t.JSON]:function(){return Ge.toArrayBuffer.bind(e)()},[t.FILE]:function(){return Ne.toArrayBuffer.bind(e)()},[t.LIST_FILE]:function(){return We.toArrayBuffer.bind(e)()},[t.BYTE_ARRAY]:function(){return Fe.toArrayBuffer.bind(e)()}}};try{return r[_()?"node":"browser"][this.type]()}catch(e){throw new K(`Error translating from ${t.enumLookup(this.type)} to ArrayBuffer: ${e}`)}}},{key:"_fromArrayBuffer",value:function(e){var r=this,n={[t.STRING]:function(){return Ue.fromArrayBuffer.bind(r)()},[t.NUMBER]:function(){return Je.fromArrayBuffer.bind(r)()},[t.HTML]:function(){return He.fromArrayBuffer.bind(r)()},[t.ARRAY_BUFFER]:function(){},[t.BIG_NUMBER]:function(){return De.fromArrayBuffer.bind(r)()},[t.JSON]:function(){return Ge.fromArrayBuffer.bind(r)()},[t.FILE]:function(){return Ne.fromArrayBuffer.bind(r)()},[t.LIST_FILE]:function(){return We.fromArrayBuffer.bind(r)()},[t.BYTE_ARRAY]:function(){return Fe.fromArrayBuffer.bind(r)()}};try{n[e](),this.type=e}catch(r){throw new K(`Error translating from ArrayBuffer to ${t.enumLookup(e)}: ${r}`)}}}],[{key:"typeEnum",value:function(e){switch(e.toLowerCase()){case"bytearray":case"byte array":return t.BYTE_ARRAY;case"string":return t.STRING;case"number":return t.NUMBER;case"html":return t.HTML;case"arraybuffer":case"array buffer":return t.ARRAY_BUFFER;case"bignumber":case"big number":return t.BIG_NUMBER;case"json":case"object":return t.JSON;case"file":return t.FILE;case"list":return t.LIST_FILE;default:throw new K("Invalid data type string. No matching enum.")}}},{key:"enumLookup",value:function(e){switch(e){case t.BYTE_ARRAY:return"byteArray";case t.STRING:return"string";case t.NUMBER:return"number";case t.HTML:return"html";case t.ARRAY_BUFFER:return"ArrayBuffer";case t.BIG_NUMBER:return"BigNumber";case t.JSON:return"JSON";case t.FILE:return"File";case t.LIST_FILE:return"List";default:throw new K("Invalid data type enum. No matching type.")}}}]);var r}();Qe.BYTE_ARRAY=0,Qe.STRING=1,Qe.NUMBER=2,Qe.HTML=3,Qe.ARRAY_BUFFER=4,Qe.BIG_NUMBER=5,Qe.JSON=6,Qe.FILE=7,Qe.LIST_FILE=8;const Ze=Qe,$e=function(){function t(r){e(this,t),this.name="",this.type="",this._value=null,this.disabled=!1,this.hint="",this.rows=0,this.toggleValues=[],this.target=null,this.defaultIndex=0,this.maxLength=null,this.min=null,this.max=null,this.step=1,r&&this._parseConfig(r)}return i(t,[{key:"_parseConfig",value:function(e){this.name=e.name,this.type=e.type,this.defaultValue=e.value,this.disabled=!!e.disabled,this.hint=e.hint||!1,this.rows=e.rows||!1,this.toggleValues=e.toggleValues,this.target=void 0!==e.target?e.target:null,this.defaultIndex=void 0!==e.defaultIndex?e.defaultIndex:0,this.maxLength=e.maxLength||null,this.min=e.min,this.max=e.max,this.step=e.step}},{key:"config",get:function(){return this._value}},{key:"value",get:function(){return this._value},set:function(e){this._value=t.prepare(e,this.type)}}],[{key:"prepare",value:function(e,t){var r;switch(t){case"binaryString":case"binaryShortString":case"editableOption":case"editableOptionShort":return O.parseEscapedChars(e);case"byteArray":return"string"==typeof e?T(e=e.replace(/\s+/g,"")):e;case"number":if(null===e)return e;if(r=parseFloat(e),isNaN(r))throw"Invalid ingredient value. Not a number: "+O.truncate(e.toString(),10);return r;default:return e}}}])}();var et=function(){return i((function t(){e(this,t),this._inputType=-1,this._outputType=-1,this._presentType=-1,this._breakpoint=!1,this._disabled=!1,this._flowControl=!1,this._manualBake=!1,this._ingList=[],this.name="",this.module="",this.description="",this.infoURL=null}),[{key:"run",value:function(e,t){return e}},{key:"highlight",value:function(e,t){return!1}},{key:"highlightReverse",value:function(e,t){return!1}},{key:"present",value:function(e,t){return e}},{key:"inputType",get:function(){return Ze.enumLookup(this._inputType)},set:function(e){this._inputType=Ze.typeEnum(e)}},{key:"outputType",get:function(){return Ze.enumLookup(this._outputType)},set:function(e){this._outputType=Ze.typeEnum(e),this._presentType<0&&(this._presentType=this._outputType)}},{key:"presentType",get:function(){return Ze.enumLookup(this._presentType)},set:function(e){this._presentType=Ze.typeEnum(e)}},{key:"args",get:function(){return this._ingList.map((function(e){var t={name:e.name,type:e.type,value:e.defaultValue};return e.toggleValues&&(t.toggleValues=e.toggleValues),e.hint&&(t.hint=e.hint),e.rows&&(t.rows=e.rows),e.disabled&&(t.disabled=e.disabled),e.target&&(t.target=e.target),e.defaultIndex&&(t.defaultIndex=e.defaultIndex),e.maxLength&&(t.maxLength=e.maxLength),"number"==typeof e.min&&(t.min=e.min),"number"==typeof e.max&&(t.max=e.max),e.step&&(t.step=e.step),t}))},set:function(e){var t=this;e.forEach((function(e){var r=new $e(e);t.addIngredient(r)}))}},{key:"config",get:function(){return{op:this.name,args:this._ingList.map((function(e){return e.config}))}}},{key:"addIngredient",value:function(e){this._ingList.push(e)}},{key:"ingValues",get:function(){return this._ingList.map((function(e){return e.value}))},set:function(e){var t=this;e.forEach((function(e,r){t._ingList[r].value=e}))}},{key:"breakpoint",get:function(){return this._breakpoint},set:function(e){this._breakpoint=!!e}},{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=!!e}},{key:"flowControl",get:function(){return this._flowControl},set:function(e){this._flowControl=!!e}},{key:"manualBake",get:function(){return this._manualBake},set:function(e){this._manualBake=!!e}}])}();const tt=et;var rt=["Space","Comma","Semi-colon","Colon","Line feed","CRLF"];function nt(e,t,r){return t=s(t),a(e,it()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function it(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(it=function(){return!!e})()}var at=function(t){function r(){var t;return e(this,r),(t=nt(this,r)).name="A1Z26 Cipher Decode",t.module="Ciphers",t.description="Converts alphabet order numbers into their corresponding alphabet character.

e.g. 1 becomes a and 2 becomes b.",t.infoURL="",t.inputType="string",t.outputType="string",t.args=[{name:"Delimiter",type:"option",value:rt}],t.checks=[{pattern:"^\\s*([12]?[0-9] )+[12]?[0-9]\\s*$",flags:"",args:["Space"]},{pattern:"^\\s*([12]?[0-9],)+[12]?[0-9]\\s*$",flags:"",args:["Comma"]},{pattern:"^\\s*([12]?[0-9];)+[12]?[0-9]\\s*$",flags:"",args:["Semi-colon"]},{pattern:"^\\s*([12]?[0-9]:)+[12]?[0-9]\\s*$",flags:"",args:["Colon"]},{pattern:"^\\s*([12]?[0-9]\\n)+[12]?[0-9]\\s*$",flags:"",args:["Line feed"]},{pattern:"^\\s*([12]?[0-9]\\r\\n)+[12]?[0-9]\\s*$",flags:"",args:["CRLF"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.charRep(t[0]||"Space");if(0===e.length)return[];for(var n=e.split(r),i="",a=0;a26)throw new E("Error: all numbers must be between 1 and 26.");i+=O.chr(parseInt(n[a],10)+96)}return i}}])}(tt);const st=at;function ot(e,t,r){return t=s(t),a(e,ct()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function ct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ct=function(){return!!e})()}var ut=function(t){function r(){var t;return e(this,r),(t=ot(this,r)).name="A1Z26 Cipher Encode",t.module="Ciphers",t.description="Converts alphabet characters into their corresponding alphabet order number.

e.g. a becomes 1 and b becomes 2.

Non-alphabet characters are dropped.",t.infoURL="",t.inputType="string",t.outputType="string",t.args=[{name:"Delimiter",type:"option",value:rt}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){for(var r=O.charRep(t[0]||"Space"),n="",i=e.toLowerCase(),a=O.strToCharcode(i),s=0;s0&&o<=26&&(n+=o.toString(10)+r)}return n.slice(0,-r.length)}}])}(tt);const ft=ut;var ht=__webpack_require__(88802),lt=__webpack_require__.n(ht);function dt(e,t,r){return t=s(t),a(e,pt()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function pt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pt=function(){return!!e})()}const gt=function(t){function r(){var t;return e(this,r),(t=dt(this,r)).name="AES Decrypt",t.module="Ciphers",t.description="Advanced Encryption Standard (AES) is a U.S. Federal Information Processing Standard (FIPS). It was selected after a 5-year process where 15 competing designs were evaluated.

Key: The following algorithms will be used based on the size of the key:
  • 16 bytes = AES-128
  • 24 bytes = AES-192
  • 32 bytes = AES-256


IV: The Initialization Vector should be 16 bytes long. If not entered, it will default to 16 null bytes.

Padding: In CBC and ECB mode, PKCS#7 padding will be used as a default.

GCM Tag: This field is ignored unless 'GCM' mode is used.",t.infoURL="https://wikipedia.org/wiki/Advanced_Encryption_Standard",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"argSelector",value:[{name:"CBC",off:[5,6]},{name:"CFB",off:[5,6]},{name:"OFB",off:[5,6]},{name:"CTR",off:[5,6]},{name:"GCM",on:[5,6]},{name:"ECB",off:[5,6]},{name:"CBC/NoPadding",off:[5,6]},{name:"ECB/NoPadding",off:[5,6]}]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]},{name:"GCM Tag",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Additional Authenticated Data",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteString(t[1].string,t[1].option),i=t[2].substring(0,3),a=t[2].endsWith("NoPadding"),s=t[3],o=t[4],c=O.convertToByteString(t[5].string,t[5].option),u=O.convertToByteString(t[6].string,t[6].option);if([16,24,32].indexOf(r.length)<0)throw new E(`Invalid key length: ${r.length} bytes\n\nThe following algorithms will be used based on the size of the key:\n 16 bytes = AES-128\n 24 bytes = AES-192\n 32 bytes = AES-256`);e=O.convertToByteString(e,s);var f=lt().cipher.createDecipher("AES-"+i,r);if(a&&(f.mode.unpad=function(e,t){return!0}),f.start({iv:0===n.length?"":n,tag:"GCM"===i?c:void 0,additionalData:"GCM"===i?u:void 0}),f.update(lt().util.createBuffer(e)),f.finish())return"Hex"===o?f.output.toHex():f.output.getBytes();throw new E("Unable to decrypt input with these parameters.")}}])}(tt);function yt(e,t,r){return t=s(t),a(e,vt()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function vt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vt=function(){return!!e})()}const mt=function(t){function r(){var t;return e(this,r),(t=yt(this,r)).name="AES Encrypt",t.module="Ciphers",t.description="Advanced Encryption Standard (AES) is a U.S. Federal Information Processing Standard (FIPS). It was selected after a 5-year process where 15 competing designs were evaluated.

Key: The following algorithms will be used based on the size of the key:
  • 16 bytes = AES-128
  • 24 bytes = AES-192
  • 32 bytes = AES-256
You can generate a password-based key using one of the KDF operations.

IV: The Initialization Vector should be 16 bytes long. If not entered, it will default to 16 null bytes.

Padding: In CBC and ECB mode, PKCS#7 padding will be used.",t.infoURL="https://wikipedia.org/wiki/Advanced_Encryption_Standard",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"argSelector",value:[{name:"CBC",off:[5]},{name:"CFB",off:[5]},{name:"OFB",off:[5]},{name:"CTR",off:[5]},{name:"GCM",on:[5]},{name:"ECB",off:[5]}]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]},{name:"Additional Authenticated Data",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteString(t[1].string,t[1].option),i=t[2],a=t[3],s=t[4],o=O.convertToByteString(t[5].string,t[5].option);if([16,24,32].indexOf(r.length)<0)throw new E(`Invalid key length: ${r.length} bytes\n\nThe following algorithms will be used based on the size of the key:\n 16 bytes = AES-128\n 24 bytes = AES-192\n 32 bytes = AES-256`);e=O.convertToByteString(e,a);var c=lt().cipher.createCipher("AES-"+i,r);return c.start({iv:n,additionalData:"GCM"===i?o:void 0}),c.update(lt().util.createBuffer(e)),c.finish(),"Hex"===s?"GCM"===i?c.output.toHex()+"\n\nTag: "+c.mode.tag.toHex():c.output.toHex():"GCM"===i?c.output.getBytes()+"\n\nTag: "+c.mode.tag.getBytes():c.output.getBytes()}}])}(tt);function bt(e,t,r){return t=s(t),a(e,wt()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function wt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wt=function(){return!!e})()}var St=function(t){function r(){var t;return e(this,r),(t=bt(this,r)).name="AES Key Unwrap",t.module="Ciphers",t.description="Decryptor for a key wrapping algorithm defined in RFC3394, which is used to protect keys in untrusted storage or communications, using AES.

This algorithm uses an AES key (KEK: key-encryption key) and a 64-bit IV to decrypt 64-bit blocks.",t.infoURL="https://wikipedia.org/wiki/Key_wrap",t.inputType="string",t.outputType="string",t.args=[{name:"Key (KEK)",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"a6a6a6a6a6a6a6a6",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Hex","Raw"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteString(t[1].string,t[1].option),i=t[2],a=t[3];if(16!==r.length&&24!==r.length&&32!==r.length)throw new E("KEK must be either 16, 24, or 32 bytes (currently "+r.length+" bytes)");if(8!==n.length)throw new E("IV must be 8 bytes (currently "+n.length+" bytes)");var s=O.convertToByteString(e,i);if(s.length%8!=0||s.length<24)throw new E("input must be 8n (n>=3) bytes (currently "+s.length+" bytes)");var o=lt().cipher.createCipher("AES-ECB",r);o.start(),o.update(lt().util.createBuffer("")),o.finish();for(var c=o.output.getBytes(),u=lt().cipher.createDecipher("AES-ECB",r),f=s.substring(0,8),h=[],l=8;l>>0,p=h.length/(4*(1<<30))>>>0;p=6*p+(6*d/(4*(1<<30))>>>0),d=6*d>>>0;for(var g=5;g>=0;g--)for(var y=h.length-1;y>=0;y--){var v=O.strToArrayBuffer(f),m=new DataView(v);m.setUint32(0,m.getUint32(0)^p),m.setUint32(4,m.getUint32(4)^d),f=O.arrayBufferToStr(v,!1),u.start(),u.update(lt().util.createBuffer(f+h[y]+c)),u.finish();var b=u.output.getBytes();f=b.substring(0,8),h[y]=b.substring(8,16),--d<0&&(p--,d=4294967295)}if(f!==n)throw new E("IV mismatch");var w=h.join("");return"Hex"===a?x(O.strToArrayBuffer(w)):w}}])}(tt);const Et=St;function Ct(e,t,r){return t=s(t),a(e,At()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function At(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(At=function(){return!!e})()}var Bt=function(t){function r(){var t;return e(this,r),(t=Ct(this,r)).name="AES Key Wrap",t.module="Ciphers",t.description="A key wrapping algorithm defined in RFC3394, which is used to protect keys in untrusted storage or communications, using AES.

This algorithm uses an AES key (KEK: key-encryption key) and a 64-bit IV to encrypt 64-bit blocks.",t.infoURL="https://wikipedia.org/wiki/Key_wrap",t.inputType="string",t.outputType="string",t.args=[{name:"Key (KEK)",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"a6a6a6a6a6a6a6a6",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Hex","Raw"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteString(t[1].string,t[1].option),i=t[2],a=t[3];if(16!==r.length&&24!==r.length&&32!==r.length)throw new E("KEK must be either 16, 24, or 32 bytes (currently "+r.length+" bytes)");if(8!==n.length)throw new E("IV must be 8 bytes (currently "+n.length+" bytes)");var s=O.convertToByteString(e,i);if(s.length%8!=0||s.length<16)throw new E("input must be 8n (n>=2) bytes (currently "+s.length+" bytes)");for(var o=lt().cipher.createCipher("AES-ECB",r),c=n,u=[],f=0;f4294967295&&(l++,h=0)}var m=c+u.join("");return"Hex"===a?x(O.strToArrayBuffer(m)):m}}])}(tt);const xt=Bt;function Tt(e,t,r){return t=s(t),a(e,It()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function It(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(It=function(){return!!e})()}var Ft=function(t){function r(){var t;return e(this,r),(t=Tt(this,r)).name="Affine Cipher Decode",t.module="Ciphers",t.description="The Affine cipher is a type of monoalphabetic substitution cipher. To decrypt, each letter in an alphabet is mapped to its numeric equivalent, decrypted by a mathematical function, and converted back to a letter.",t.infoURL="https://wikipedia.org/wiki/Affine_cipher",t.inputType="string",t.outputType="string",t.args=[{name:"a",type:"number",value:1},{name:"b",type:"number",value:0}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r="abcdefghijklmnopqrstuvwxyz",n=se(t,2),i=n[0],a=n[1],s=O.modInv(i,26),o="";if(!/^\+?(0|[1-9]\d*)$/.test(i)||!/^\+?(0|[1-9]\d*)$/.test(a))throw new E("The values of a and b can only be integers.");if(1!==O.gcd(i,26))throw new E("The value of `a` must be coprime to 26.");for(var c=0;c=0?o+=r[O.mod((r.indexOf(e[c])-a)*s,26)]:r.indexOf(e[c].toLowerCase())>=0?o+=r[O.mod((r.indexOf(e[c].toLowerCase())-a)*s,26)].toUpperCase():o+=e[c];return o}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);const kt=Ft;var Rt=__webpack_require__(21396),Dt=__webpack_require__.n(Rt);function _t(e,t){var r="abcdefghijklmnopqrstuvwxyz",n=t[0],i=t[1],a="";if(!/^\+?(0|[1-9]\d*)$/.test(n)||!/^\+?(0|[1-9]\d*)$/.test(i))throw new E("The values of a and b can only be integers.");if(1!==O.gcd(n,26))throw new E("The value of `a` must be coprime to 26.");for(var s=0;s=0?a+=r[(n*r.indexOf(e[s])+i)%26]:r.indexOf(e[s].toLowerCase())>=0?a+=r[(n*r.indexOf(e[s].toLowerCase())+i)%26].toUpperCase():a+=e[s];return a}function Pt(e){for(var t=`${e}ABCDEFGHIKLMNOPQRSTUVWXYZ`.split("").unique(),r=[],n=0;n<5;n++)r[n]=t.slice(5*n,5*n+5);return r}var Nt={Hex:Dt().enc.Hex,Base64:Dt().enc.Base64,UTF8:Dt().enc.Utf8,UTF16:Dt().enc.Utf16,UTF16LE:Dt().enc.Utf16LE,UTF16BE:Dt().enc.Utf16BE,Latin1:Dt().enc.Latin1};function Ot(e,t,r){return t=s(t),a(e,Lt()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Lt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lt=function(){return!!e})()}const Ut=function(t){function r(){var t;return e(this,r),(t=Ot(this,r)).name="Affine Cipher Encode",t.module="Ciphers",t.description="The Affine cipher is a type of monoalphabetic substitution cipher, wherein each letter in an alphabet is mapped to its numeric equivalent, encrypted using simple mathematical function, (ax + b) % 26, and converted back to a letter.",t.infoURL="https://wikipedia.org/wiki/Affine_cipher",t.inputType="string",t.outputType="string",t.args=[{name:"a",type:"number",value:1},{name:"b",type:"number",value:0}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){return _t(e,t)}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);function Kt(e,t,r){return t=s(t),a(e,Mt()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Mt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Mt=function(){return!!e})()}const Ht=function(t){function r(){var t;return e(this,r),(t=Kt(this,r)).name="Atbash Cipher",t.module="Ciphers",t.description="Atbash is a mono-alphabetic substitution cipher originally used to encode the Hebrew alphabet. It has been modified here for use with the Latin alphabet.",t.infoURL="https://wikipedia.org/wiki/Atbash",t.inputType="string",t.outputType="string",t.args=[],t}return c(r,t),i(r,[{key:"run",value:function(e,t){return _t(e,[25,25])}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);function jt(e,t,r){return t=s(t),a(e,Vt()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Vt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vt=function(){return!!e})()}var Gt=function(t){function r(){var t;return e(this,r),(t=jt(this,r)).name="Bifid Cipher Decode",t.module="Ciphers",t.description="The Bifid cipher is a cipher which uses a Polybius square in conjunction with transposition, which can be fairly difficult to decipher without knowing the alphabet keyword.",t.infoURL="https://wikipedia.org/wiki/Bifid_cipher",t.inputType="string",t.outputType="string",t.args=[{name:"Keyword",type:"string",value:""}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=t[0].toUpperCase().replace("J","I"),n=r.split("").unique(),i="ABCDEFGHIKLMNOPQRSTUVWXYZ",a=[],s="",o=0,c="";if(!/^[A-Z]+$/.test(r)&&n.length>0)throw new E("The key must consist only of letters in the English alphabet");var u=Pt(r);return e.replace("J","I").split("").forEach((function(e){var t,r=i.split("").indexOf(e.toLocaleUpperCase())>=0;if(r){for(var n=0;n<5;n++)(t=u[n].indexOf(e.toLocaleUpperCase()))>=0&&(c+=`${n}${t}`);i.split("").indexOf(e)>=0?a.push(!0):r&&a.push(!1)}else a.push(e)})),a.forEach((function(e){if("boolean"==typeof e){var t=[c[o],c[o+c.length/2]];s+=e?u[t[0]][t[1]]:u[t[0]][t[1]].toLocaleLowerCase(),o++}else s+=e})),s}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);const qt=Gt;function zt(e,t,r){return t=s(t),a(e,Wt()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Wt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wt=function(){return!!e})()}var Xt=function(t){function r(){var t;return e(this,r),(t=zt(this,r)).name="Bifid Cipher Encode",t.module="Ciphers",t.description="The Bifid cipher is a cipher which uses a Polybius square in conjunction with transposition, which can be fairly difficult to decipher without knowing the alphabet keyword.",t.infoURL="https://wikipedia.org/wiki/Bifid_cipher",t.inputType="string",t.outputType="string",t.args=[{name:"Keyword",type:"string",value:""}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=t[0].toUpperCase().replace("J","I"),n=r.split("").unique(),i="ABCDEFGHIKLMNOPQRSTUVWXYZ",a=[],s=[],o=[],c="",u=0;if(!/^[A-Z]+$/.test(r)&&n.length>0)throw new E("The key must consist only of letters in the English alphabet");var f=Pt(r);e.replace("J","I").split("").forEach((function(e){var t,r=i.split("").indexOf(e.toLocaleUpperCase())>=0;if(r){for(var n=0;n<5;n++)(t=f[n].indexOf(e.toLocaleUpperCase()))>=0&&(a.push(t),s.push(n));i.split("").indexOf(e)>=0?o.push(!0):r&&o.push(!1)}else o.push(e)}));var h=`${s.join("")}${a.join("")}`;return o.forEach((function(e){if("boolean"==typeof e){var t=h.substr(2*u,2).split("");c+=e?f[t[0]][t[1]]:f[t[0]][t[1]].toLocaleLowerCase(),u++}else c+=e})),c}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);const Yt=Xt;var Jt={},Qt=function(e){return"string"==typeof e||e instanceof String},Zt=function(e,t,r,n){var i=0,a=e&&e.length||0,s=new(n||Array)(a);if(a&&"string"==typeof e&&(e=e.split("")),r)for(;i>16^t>>16)<<16|65535&(65535&e^65535&t)},tr=function(e,t){var r=t.s3[255&e];e>>=8;var n=t.s2[255&e];e>>=8;var i=t.s1[255&e];e>>=8;var a=t.s0[255&e],s=(a>>16)+(i>>16)+((65535&a)+(65535&i)>>16)<<16|(65535&a)+(65535&i)&65535;return((s=(s>>16^n>>16)<<16|65535&(65535&s^65535&n))>>16)+(r>>16)+((65535&s)+(65535&r)>>16)<<16|(65535&s)+(65535&r)&65535},rr=function(e,t){var r=e.left,n=e.right;r=er(r,t.p[0]),n=er(n,er(tr(r,t),t.p[1])),r=er(r,er(tr(n,t),t.p[2])),n=er(n,er(tr(r,t),t.p[3])),r=er(r,er(tr(n,t),t.p[4])),n=er(n,er(tr(r,t),t.p[5])),r=er(r,er(tr(n,t),t.p[6])),n=er(n,er(tr(r,t),t.p[7])),r=er(r,er(tr(n,t),t.p[8])),n=er(n,er(tr(r,t),t.p[9])),r=er(r,er(tr(n,t),t.p[10])),n=er(n,er(tr(r,t),t.p[11])),r=er(r,er(tr(n,t),t.p[12])),n=er(n,er(tr(r,t),t.p[13])),r=er(r,er(tr(n,t),t.p[14])),n=er(n,er(tr(r,t),t.p[15])),r=er(r,er(tr(n,t),t.p[16])),e.right=r,e.left=er(n,t.p[17])};Jt.Blowfish=new function(){this.createCipher=function(e,t){return new(lt().cipher.BlockCipher)({algorithm:new nr.Algorithm(e,t),key:e,decrypt:!1})},this.createDecipher=function(e,t){return new(lt().cipher.BlockCipher)({algorithm:new nr.Algorithm(e,t),key:e,decrypt:!0})}},Jt.Blowfish.Algorithm=function(e,t){this.initialize({key:e});var r=this.box,n={blockSize:8,cipher:{encrypt:function(e,t){!function(e,t,r){var n={};n.left=e[0],n.right=e[1],rr(n,r),t[0]=n.left,t[1]=n.right}(e,t,r)},decrypt:function(e,t){!function(e,t,r){var n={};n.left=e[0],n.right=e[1],function(e,t){var r=e.left,n=e.right;r=er(r,t.p[17]),n=er(n,er(tr(r,t),t.p[16])),r=er(r,er(tr(n,t),t.p[15])),n=er(n,er(tr(r,t),t.p[14])),r=er(r,er(tr(n,t),t.p[13])),n=er(n,er(tr(r,t),t.p[12])),r=er(r,er(tr(n,t),t.p[11])),n=er(n,er(tr(r,t),t.p[10])),r=er(r,er(tr(n,t),t.p[9])),n=er(n,er(tr(r,t),t.p[8])),r=er(r,er(tr(n,t),t.p[7])),n=er(n,er(tr(r,t),t.p[6])),r=er(r,er(tr(n,t),t.p[5])),n=er(n,er(tr(r,t),t.p[4])),r=er(r,er(tr(n,t),t.p[3])),n=er(n,er(tr(r,t),t.p[2])),r=er(r,er(tr(n,t),t.p[1])),e.right=r,e.left=er(n,t.p[0])}(n,r),t[0]=n.left,t[1]=n.right}(e,t,r)}}};switch(t.toLowerCase()){case"ecb":default:this.mode=new(lt().cipher.modes.ecb)(n);break;case"cbc":this.mode=new(lt().cipher.modes.cbc)(n);break;case"cfb":this.mode=new(lt().cipher.modes.cfb)(n);break;case"ofb":this.mode=new(lt().cipher.modes.ofb)(n);break;case"ctr":this.mode=new(lt().cipher.modes.ctr)(n)}},Jt.Blowfish.Algorithm.prototype.initialize=function(e){var t=Math.pow(2,8),r=e.key;Qt(r)&&(r=Zt(r.split(""),(function(e){return 255&e.charCodeAt(0)})));for(var n=0,i=0,a={left:0,right:0},s={p:Zt($t.p.slice(0),(function(e){for(var a=r.length,s=0;s<4;s++)i=i*t|r[n++%a];return(e>>16^i>>16)<<16|65535&(65535&e^65535&i)})),s0:$t.s0.slice(0),s1:$t.s1.slice(0),s2:$t.s2.slice(0),s3:$t.s3.slice(0)},o=0,c=s.p.length;o56)throw new E(`Invalid key length: ${r.length} bytes\n\nBlowfish's key length needs to be between 4 and 56 bytes (32-448 bits).`);if(8!==n.length)throw new E(`Invalid IV length: ${n.length} bytes. Expected 8 bytes`);e=O.convertToByteString(e,a);var o=nr.createDecipher(r,i);if(o.start({iv:n}),o.update(lt().util.createBuffer(e)),o.finish())return"Hex"===s?o.output.toHex():o.output.getBytes();throw new E("Unable to decrypt input with these parameters.")}}])}(tt);function or(e,t,r){return t=s(t),a(e,cr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function cr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cr=function(){return!!e})()}const ur=function(t){function r(){var t;return e(this,r),(t=or(this,r)).name="Blowfish Encrypt",t.module="Ciphers",t.description="Blowfish is a symmetric-key block cipher designed in 1993 by Bruce Schneier and included in a large number of cipher suites and encryption products. AES now receives more attention.

IV: The Initialization Vector should be 8 bytes long. If not entered, it will default to 8 null bytes.",t.infoURL="https://wikipedia.org/wiki/Blowfish_(cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteString(t[1].string,t[1].option),i=t[2],a=t[3],s=t[4];if(r.length<4||r.length>56)throw new E(`Invalid key length: ${r.length} bytes\n \nBlowfish's key length needs to be between 4 and 56 bytes (32-448 bits).`);if(8!==n.length)throw new E(`Invalid IV length: ${n.length} bytes. Expected 8 bytes`);e=O.convertToByteString(e,a);var o=nr.createCipher(r,i);return o.start({iv:n}),o.update(lt().util.createBuffer(e)),o.finish(),"Hex"===s?o.output.toHex():o.output.getBytes()}}])}(tt);function fr(e,t,r){return t=s(t),a(e,hr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function hr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hr=function(){return!!e})()}var lr=function(t){function r(){var t;return e(this,r),(t=fr(this,r)).name="Caesar Box Cipher",t.module="Ciphers",t.description="Caesar Box is a transposition cipher used in the Roman Empire, in which letters of the message are written in rows in a square (or a rectangle) and then, read by column.",t.infoURL="https://www.dcode.fr/caesar-box-cipher",t.inputType="string",t.outputType="string",t.args=[{name:"Box Height",type:"number",value:1}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){for(var r=t[0],n=Math.ceil(e.length/r);-1!==e.indexOf(" ");)e=e.replace(" ","");for(var i=0;ie.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw a}}}}(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;" "===a?n.push.apply(n,[0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]):n.push("e"===a?1:0)}}catch(e){i.e(e)}finally{i.f()}for(var s=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:"Space",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if(null==e)throw new E("Unable to convert to binary: Empty input data enocuntered");t=O.charRep(t);var n="";if(!e.length)return"number"==typeof e?e.toString(2).padStart(r,"0"):"";for(var i=0;i>>32-t}function u(e,t,r,n,i){e[t]=e[t]+e[r]&4294967295,e[i]=c(e[i]^e[t],16),e[n]=e[n]+e[i]&4294967295,e[r]=c(e[r]^e[n],12),e[t]=e[t]+e[r]&4294967295,e[i]=c(e[i]^e[t],8),e[n]=e[n]+e[i]&4294967295,e[r]=c(e[r]^e[n],7)}for(var f=0;f
Key: ChaCha uses a key of 16 or 32 bytes (128 or 256 bits).

Nonce: ChaCha uses a nonce of 8 or 12 bytes (64 or 96 bits).

Counter: ChaCha uses a counter of 4 or 8 bytes (32 or 64 bits); together, the nonce and counter must add up to 16 bytes. The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes.",t.infoURL="https://wikipedia.org/wiki/Salsa20#ChaCha_variant",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Nonce",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64","Integer"]},{name:"Counter",type:"number",value:0,min:0},{name:"Rounds",type:"option",value:["20","12","8"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n,i,a=O.convertToByteArray(t[0].string,t[0].option),s=t[1].option,o=parseInt(t[3],10),c=t[4],u=t[5];if(16!==a.length&&32!==a.length)throw new E(`Invalid key length: ${a.length} bytes.\n\nChaCha uses a key of 16 or 32 bytes (128 or 256 bits).`);if("Integer"===s)n=O.intToByteArray(parseInt(t[1].string,10),12,"little"),i=4;else{if(12!==(n=O.convertToByteArray(t[1].string,t[1].option)).length&&8!==n.length)throw new E(`Invalid nonce length: ${n.length} bytes.\n\nChaCha uses a nonce of 8 or 12 bytes (64 or 96 bits).`);i=16-n.length}r=O.intToByteArray(t[2],i,"little");var f=[];e=O.convertToByteArray(e,c);for(var h=O.byteArrayToInt(r,"little"),l=0;l>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new(Dt().lib.WordArray.init)(r,t/2)};const Kr=function(t){function r(){var t;return e(this,r),(t=Lr(this,r)).name="Derive PBKDF2 key",t.module="Ciphers",t.description="PBKDF2 is a password-based key derivation function. It is part of RSA Laboratories' Public-Key Cryptography Standards (PKCS) series, specifically PKCS #5 v2.0, also published as Internet Engineering Task Force's RFC 2898.

In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.

A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.

If you leave the salt argument empty, a random salt will be generated.",t.infoURL="https://wikipedia.org/wiki/PBKDF2",t.inputType="string",t.outputType="string",t.args=[{name:"Passphrase",type:"toggleString",value:"",toggleValues:["UTF8","Latin1","Hex","Base64"]},{name:"Key size",type:"number",value:128},{name:"Iterations",type:"number",value:1},{name:"Hashing function",type:"option",value:["SHA1","SHA256","SHA384","SHA512","MD5"]},{name:"Salt",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=t[1],i=t[2],a=t[3],s=O.convertToByteString(t[4].string,t[4].option)||lt().random.getBytesSync(n),o=lt().pkcs5.pbkdf2(r,s,i,n/8,a.toLowerCase());return lt().util.bytesToHex(o)}}])}(tt);var Mr=__webpack_require__(95355);function Hr(e,t,r){return t=s(t),a(e,jr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function jr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jr=function(){return!!e})()}const Vr=function(t){function r(){var t;return e(this,r),(t=Hr(this,r)).name="ECDSA Sign",t.module="Ciphers",t.description="Sign a plaintext message with a PEM encoded EC key.",t.infoURL="https://wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm",t.inputType="string",t.outputType="string",t.args=[{name:"ECDSA Private Key (PEM)",type:"text",value:"-----BEGIN EC PRIVATE KEY-----"},{name:"Message Digest Algorithm",type:"option",value:["SHA-256","SHA-384","SHA-512","SHA-1","MD5"]},{name:"Output Format",type:"option",value:["ASN.1 HEX","P1363 HEX","JSON Web Signature","Raw JSON"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=se(t,3),n=r[0],i=r[1],a=r[2];if(0===n.replace("-----BEGIN EC PRIVATE KEY-----","").length)throw new E("Please enter a private key.");var s=i.replace("-","")+"withECDSA",o=new Mr.pj.crypto.Signature({alg:s}),c=Mr.ym.getKey(n);if("EC"!==c.type)throw new E("Provided key is not an EC key.");if(!c.isPrivate)throw new E("Provided key is not a private key.");o.init(c);var u,f=o.signString(e);switch(a){case"ASN.1 HEX":u=f;break;case"P1363 HEX":u=Mr.pj.crypto.ECDSA.asn1SigToConcatSig(f);break;case"JSON Web Signature":u=C(T(u=Mr.pj.crypto.ECDSA.asn1SigToConcatSig(f)),"A-Za-z0-9-_");break;case"Raw JSON":var h=Mr.pj.crypto.ECDSA.parseSigHexInHexRS(f);u=JSON.stringify(h)}return u}}])}(tt);function Gr(e,t,r){return t=s(t),a(e,qr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function qr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qr=function(){return!!e})()}const zr=function(t){function r(){var t;return e(this,r),(t=Gr(this,r)).name="ECDSA Signature Conversion",t.module="Ciphers",t.description="Convert an ECDSA signature between hex, asn1 and json.",t.infoURL="https://wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm",t.inputType="string",t.outputType="string",t.args=[{name:"Input Format",type:"option",value:["Auto","ASN.1 HEX","P1363 HEX","JSON Web Signature","Raw JSON"]},{name:"Output Format",type:"option",value:["ASN.1 HEX","P1363 HEX","JSON Web Signature","Raw JSON"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n,i,a,s=t[0],o=t[1];if("Auto"===s)try{"object"==typeof(r=JSON.parse(e))&&(s="Raw JSON")}catch(e){}if("Auto"===s&&/^[a-f\d]{2,}$/gi.test(e)&&(s="30"===e.substring(0,2)&&Mr.d6.isASN1HEX(e)?"ASN.1 HEX":"P1363 HEX"),"Auto"===s)try{n=A(e,"A-Za-z0-9-_",!1),s="JSON Web Signature"}catch(e){}switch(s){case"Auto":throw new E("Signature format could not be detected");case"ASN.1 HEX":i=e;break;case"P1363 HEX":i=Mr.pj.crypto.ECDSA.concatSigToASN1Sig(e);break;case"JSON Web Signature":n||(n=A(e,"A-Za-z0-9-_")),i=Mr.pj.crypto.ECDSA.concatSigToASN1Sig(x(n));break;case"Raw JSON":if(r||(r=JSON.parse(e)),!r.r)throw new E('No "r" value in the signature JSON');if(!r.s)throw new E('No "s" value in the signature JSON');i=Mr.pj.crypto.ECDSA.hexRSSigToASN1Sig(r.r,r.s)}switch(o){case"ASN.1 HEX":a=i;break;case"P1363 HEX":a=Mr.pj.crypto.ECDSA.asn1SigToConcatSig(i);break;case"JSON Web Signature":a=C(T(a=Mr.pj.crypto.ECDSA.asn1SigToConcatSig(i)),"A-Za-z0-9-_");break;case"Raw JSON":var c=Mr.pj.crypto.ECDSA.parseSigHexInHexRS(i);a=JSON.stringify(c)}return a}}])}(tt);function Wr(e,t,r){return t=s(t),a(e,Xr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Xr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xr=function(){return!!e})()}const Yr=function(t){function r(){var t;return e(this,r),(t=Wr(this,r)).name="ECDSA Verify",t.module="Ciphers",t.description="Verify a message against a signature and a public PEM encoded EC key.",t.infoURL="https://wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm",t.inputType="string",t.outputType="string",t.args=[{name:"Input Format",type:"option",value:["Auto","ASN.1 HEX","P1363 HEX","JSON Web Signature","Raw JSON"]},{name:"Message Digest Algorithm",type:"option",value:["SHA-256","SHA-384","SHA-512","SHA-1","MD5"]},{name:"ECDSA Public Key (PEM)",type:"text",value:"-----BEGIN PUBLIC KEY-----"},{name:"Message",type:"text",value:""}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n,i,a=t[0],s=se(t,4),o=s[1],c=s[2],u=s[3];if(0===c.replace("-----BEGIN PUBLIC KEY-----","").length)throw new E("Please enter a public key.");if("Auto"===a)try{"object"==typeof(r=JSON.parse(e))&&(a="Raw JSON")}catch(e){}if("Auto"===a&&/^[a-f\d]{2,}$/gi.test(e)&&(a="30"===e.substring(0,2)&&Mr.d6.isASN1HEX(e)?"ASN.1 HEX":"P1363 HEX"),"Auto"===a)try{n=A(e,"A-Za-z0-9-_",!1),a="JSON Web Signature"}catch(e){}switch(a){case"Auto":throw new E("Signature format could not be detected");case"ASN.1 HEX":i=e;break;case"P1363 HEX":i=Mr.pj.crypto.ECDSA.concatSigToASN1Sig(e);break;case"JSON Web Signature":n||(n=A(e,"A-Za-z0-9-_")),i=Mr.pj.crypto.ECDSA.concatSigToASN1Sig(x(n));break;case"Raw JSON":if(r||(r=JSON.parse(e)),!r.r)throw new E('No "r" value in the signature JSON');if(!r.s)throw new E('No "s" value in the signature JSON');i=Mr.pj.crypto.ECDSA.hexRSSigToASN1Sig(r.r,r.s)}var f=o.replace("-","")+"withECDSA",h=new Mr.pj.crypto.Signature({alg:f}),l=Mr.ym.getKey(c);if("EC"!==l.type)throw new E("Provided key is not an EC key.");if(!l.isPublic)throw new E("Provided key is not a public key.");return h.init(l),h.updateString(u),h.verify(i)?"Verified OK":"Verification Failure"}}])}(tt);var Jr=__webpack_require__(2754);function Qr(e,t,r){return t=s(t),a(e,Zr()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Zr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zr=function(){return!!e})()}const $r=function(t){function r(){var t;return e(this,r),(t=Qr(this,r)).name="GOST Decrypt",t.module="Ciphers",t.description="The GOST block cipher (Magma), defined in the standard GOST 28147-89 (RFC 5830), is a Soviet and Russian government standard symmetric key block cipher with a block size of 64 bits. The original standard, published in 1989, did not give the cipher any name, but the most recent revision of the standard, GOST R 34.12-2015 (RFC 7801, RFC 8891), specifies that it may be referred to as Magma. The GOST hash function is based on this cipher. The new standard also specifies a new 128-bit block cipher called Kuznyechik.

Developed in the 1970s, the standard had been marked 'Top Secret' and then downgraded to 'Secret' in 1990. Shortly after the dissolution of the USSR, it was declassified and it was released to the public in 1994. GOST 28147 was a Soviet alternative to the United States standard algorithm, DES. Thus, the two are very similar in structure.",t.infoURL="https://wikipedia.org/wiki/GOST_(block_cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input type",type:"option",value:["Hex","Raw"]},{name:"Output type",type:"option",value:["Raw","Hex"]},{name:"Algorithm",type:"argSelector",value:[{name:"GOST 28147 (1989)",on:[5]},{name:"GOST R 34.12 (Magma, 2015)",off:[5]},{name:"GOST R 34.12 (Kuznyechik, 2015)",off:[5]}]},{name:"sBox",type:"option",value:["E-TEST","E-A","E-B","E-C","E-D","E-SC","E-Z","D-TEST","D-A","D-SC"]},{name:"Block mode",type:"option",value:["ECB","CFB","OFB","CTR","CBC"]},{name:"Key meshing mode",type:"option",value:["NO","CP"]},{name:"Padding",type:"option",value:["NO","PKCS5","ZERO","RANDOM","BIT"]}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a,s,o,c,u,f,h,d,p,g,y,v,m,b,w,S;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=se(r,9),i=n[0],a=n[1],s=n[2],o=n[3],c=n[4],u=n[5],f=n[6],h=n[7],d=n[8],p=x(O.convertToByteArray(i.string,i.option)),g=x(O.convertToByteArray(a.string,a.option)),t="Hex"===s?t:x(O.strToArrayBuffer(t)),e.t0=c,e.next="GOST 28147 (1989)"===e.t0?7:"GOST R 34.12 (Magma, 2015)"===e.t0?10:"GOST R 34.12 (Kuznyechik, 2015)"===e.t0?13:16;break;case 7:return v=1989,y=64,e.abrupt("break",17);case 10:return v=2015,y=64,e.abrupt("break",17);case 13:return v=2015,y=128,e.abrupt("break",17);case 16:throw new E(`Unknown algorithm version: ${c}`);case 17:return m={version:v,length:y,mode:"ES",sBox:1989===v?u:null,block:f,keyMeshing:h,padding:d},e.prev=19,b=Jr.CryptoGost.coding.Hex,g&&(m.iv=b.decode(g)),w=Jr.GostEngine.getGostCipher(m),S=b.encode(w.decrypt(b.decode(p),b.decode(t))),e.abrupt("return","Hex"===o?S:O.byteArrayToChars(T(S)));case 27:throw e.prev=27,e.t1=e.catch(19),new E(e.t1);case 30:case"end":return e.stop()}}),e,null,[[19,27]])}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);function en(e,t,r){return t=s(t),a(e,tn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function tn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tn=function(){return!!e})()}const rn=function(t){function r(){var t;return e(this,r),(t=en(this,r)).name="GOST Encrypt",t.module="Ciphers",t.description="The GOST block cipher (Magma), defined in the standard GOST 28147-89 (RFC 5830), is a Soviet and Russian government standard symmetric key block cipher with a block size of 64 bits. The original standard, published in 1989, did not give the cipher any name, but the most recent revision of the standard, GOST R 34.12-2015 (RFC 7801, RFC 8891), specifies that it may be referred to as Magma. The GOST hash function is based on this cipher. The new standard also specifies a new 128-bit block cipher called Kuznyechik.

Developed in the 1970s, the standard had been marked 'Top Secret' and then downgraded to 'Secret' in 1990. Shortly after the dissolution of the USSR, it was declassified and it was released to the public in 1994. GOST 28147 was a Soviet alternative to the United States standard algorithm, DES. Thus, the two are very similar in structure.",t.infoURL="https://wikipedia.org/wiki/GOST_(block_cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input type",type:"option",value:["Raw","Hex"]},{name:"Output type",type:"option",value:["Hex","Raw"]},{name:"Algorithm",type:"argSelector",value:[{name:"GOST 28147 (1989)",on:[5]},{name:"GOST R 34.12 (Magma, 2015)",off:[5]},{name:"GOST R 34.12 (Kuznyechik, 2015)",off:[5]}]},{name:"sBox",type:"option",value:["E-TEST","E-A","E-B","E-C","E-D","E-SC","E-Z","D-TEST","D-A","D-SC"]},{name:"Block mode",type:"option",value:["ECB","CFB","OFB","CTR","CBC"]},{name:"Key meshing mode",type:"option",value:["NO","CP"]},{name:"Padding",type:"option",value:["NO","PKCS5","ZERO","RANDOM","BIT"]}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a,s,o,c,u,f,h,d,p,g,y,v,m,b,w,S;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=se(r,9),i=n[0],a=n[1],s=n[2],o=n[3],c=n[4],u=n[5],f=n[6],h=n[7],d=n[8],p=x(O.convertToByteArray(i.string,i.option)),g=x(O.convertToByteArray(a.string,a.option)),t="Hex"===s?t:x(O.strToArrayBuffer(t)),e.t0=c,e.next="GOST 28147 (1989)"===e.t0?7:"GOST R 34.12 (Magma, 2015)"===e.t0?10:"GOST R 34.12 (Kuznyechik, 2015)"===e.t0?13:16;break;case 7:return v=1989,y=64,e.abrupt("break",17);case 10:return v=2015,y=64,e.abrupt("break",17);case 13:return v=2015,y=128,e.abrupt("break",17);case 16:throw new E(`Unknown algorithm version: ${c}`);case 17:return m={version:v,length:y,mode:"ES",sBox:1989===v?u:null,block:f,keyMeshing:h,padding:d},e.prev=19,b=Jr.CryptoGost.coding.Hex,g&&(m.iv=b.decode(g)),w=Jr.GostEngine.getGostCipher(m),S=b.encode(w.encrypt(b.decode(p),b.decode(t))),e.abrupt("return","Hex"===o?S:O.byteArrayToChars(T(S)));case 27:throw e.prev=27,e.t1=e.catch(19),new E(e.t1);case 30:case"end":return e.stop()}}),e,null,[[19,27]])}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);function nn(e,t,r){return t=s(t),a(e,an()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function an(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(an=function(){return!!e})()}const sn=function(t){function r(){var t;return e(this,r),(t=nn(this,r)).name="GOST Key Unwrap",t.module="Ciphers",t.description="A decryptor for keys wrapped using one of the GOST block ciphers.",t.infoURL="https://wikipedia.org/wiki/GOST_(block_cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"User Key Material",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input type",type:"option",value:["Hex","Raw"]},{name:"Output type",type:"option",value:["Raw","Hex"]},{name:"Algorithm",type:"argSelector",value:[{name:"GOST 28147 (1989)",on:[5]},{name:"GOST R 34.12 (Magma, 2015)",off:[5]},{name:"GOST R 34.12 (Kuznyechik, 2015)",off:[5]}]},{name:"sBox",type:"option",value:["E-TEST","E-A","E-B","E-C","E-D","E-SC","E-Z","D-TEST","D-A","D-SC"]},{name:"Key wrapping",type:"option",value:["NO","CP","SC"]}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a,s,o,c,u,f,h,d,p,g,y,v,m,b;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=se(r,7),i=n[0],a=n[1],s=n[2],o=n[3],c=n[4],u=n[5],f=n[6],h=x(O.convertToByteArray(i.string,i.option)),d=x(O.convertToByteArray(a.string,a.option)),t="Hex"===s?t:x(O.strToArrayBuffer(t)),e.t0=c,e.next="GOST 28147 (1989)"===e.t0?7:"GOST R 34.12 (Magma, 2015)"===e.t0?10:"GOST R 34.12 (Kuznyechik, 2015)"===e.t0?13:16;break;case 7:return g=1989,p=64,e.abrupt("break",17);case 10:return g=2015,p=64,e.abrupt("break",17);case 13:return g=2015,p=128,e.abrupt("break",17);case 16:throw new E(`Unknown algorithm version: ${c}`);case 17:return y={version:g,length:p,mode:"KW",sBox:1989===g?u:null,keyWrapping:f},e.prev=19,v=Jr.CryptoGost.coding.Hex,y.ukm=v.decode(d),m=Jr.GostEngine.getGostCipher(y),b=v.encode(m.unwrapKey(v.decode(h),v.decode(t))),e.abrupt("return","Hex"===o?b:O.byteArrayToChars(T(b)));case 27:if(e.prev=27,e.t1=e.catch(19),!e.t1.toString().includes("Invalid typed array length")){e.next=31;break}throw new E("Incorrect input length. Must be a multiple of the block size.");case 31:throw new E(e.t1);case 32:case"end":return e.stop()}}),e,null,[[19,27]])}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);function on(e,t,r){return t=s(t),a(e,cn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function cn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cn=function(){return!!e})()}const un=function(t){function r(){var t;return e(this,r),(t=on(this,r)).name="GOST Key Wrap",t.module="Ciphers",t.description="A key wrapping algorithm for protecting keys in untrusted storage using one of the GOST block cipers.",t.infoURL="https://wikipedia.org/wiki/GOST_(block_cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"User Key Material",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input type",type:"option",value:["Raw","Hex"]},{name:"Output type",type:"option",value:["Hex","Raw"]},{name:"Algorithm",type:"argSelector",value:[{name:"GOST 28147 (1989)",on:[5]},{name:"GOST R 34.12 (Magma, 2015)",off:[5]},{name:"GOST R 34.12 (Kuznyechik, 2015)",off:[5]}]},{name:"sBox",type:"option",value:["E-TEST","E-A","E-B","E-C","E-D","E-SC","E-Z","D-TEST","D-A","D-SC"]},{name:"Key wrapping",type:"option",value:["NO","CP","SC"]}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a,s,o,c,u,f,h,d,p,g,y,v,m,b;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=se(r,7),i=n[0],a=n[1],s=n[2],o=n[3],c=n[4],u=n[5],f=n[6],h=x(O.convertToByteArray(i.string,i.option)),d=x(O.convertToByteArray(a.string,a.option)),t="Hex"===s?t:x(O.strToArrayBuffer(t)),e.t0=c,e.next="GOST 28147 (1989)"===e.t0?7:"GOST R 34.12 (Magma, 2015)"===e.t0?10:"GOST R 34.12 (Kuznyechik, 2015)"===e.t0?13:16;break;case 7:return g=1989,p=64,e.abrupt("break",17);case 10:return g=2015,p=64,e.abrupt("break",17);case 13:return g=2015,p=128,e.abrupt("break",17);case 16:throw new E(`Unknown algorithm version: ${c}`);case 17:return y={version:g,length:p,mode:"KW",sBox:1989===g?u:null,keyWrapping:f},e.prev=19,v=Jr.CryptoGost.coding.Hex,y.ukm=v.decode(d),m=Jr.GostEngine.getGostCipher(y),b=v.encode(m.wrapKey(v.decode(h),v.decode(t))),e.abrupt("return","Hex"===o?b:O.byteArrayToChars(T(b)));case 27:if(e.prev=27,e.t1=e.catch(19),!e.t1.toString().includes("Invalid typed array length")){e.next=31;break}throw new E("Incorrect input length. Must be a multiple of the block size.");case 31:throw new E(e.t1);case 32:case"end":return e.stop()}}),e,null,[[19,27]])}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);function fn(e,t,r){return t=s(t),a(e,hn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function hn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hn=function(){return!!e})()}const ln=function(t){function r(){var t;return e(this,r),(t=fn(this,r)).name="GOST Sign",t.module="Ciphers",t.description="Sign a plaintext message using one of the GOST block ciphers.",t.infoURL="https://wikipedia.org/wiki/GOST_(block_cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input type",type:"option",value:["Raw","Hex"]},{name:"Output type",type:"option",value:["Hex","Raw"]},{name:"Algorithm",type:"argSelector",value:[{name:"GOST 28147 (1989)",on:[5]},{name:"GOST R 34.12 (Magma, 2015)",off:[5]},{name:"GOST R 34.12 (Kuznyechik, 2015)",off:[5]}]},{name:"sBox",type:"option",value:["E-TEST","E-A","E-B","E-C","E-D","E-SC","E-Z","D-TEST","D-A","D-SC"]},{name:"MAC length",type:"number",value:32,min:8,max:64,step:8}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a,s,o,c,u,f,h,d,p,g,y,v,m,b;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=se(r,7),i=n[0],a=n[1],s=n[2],o=n[3],c=n[4],u=n[5],f=n[6],h=x(O.convertToByteArray(i.string,i.option)),d=x(O.convertToByteArray(a.string,a.option)),t="Hex"===s?t:x(O.strToArrayBuffer(t)),e.t0=c,e.next="GOST 28147 (1989)"===e.t0?7:"GOST R 34.12 (Magma, 2015)"===e.t0?10:"GOST R 34.12 (Kuznyechik, 2015)"===e.t0?13:16;break;case 7:return g=1989,p=64,e.abrupt("break",17);case 10:return g=2015,p=64,e.abrupt("break",17);case 13:return g=2015,p=128,e.abrupt("break",17);case 16:throw new E(`Unknown algorithm version: ${c}`);case 17:return y={version:g,length:p,mode:"MAC",sBox:1989===g?u:null,macLength:f},e.prev=19,v=Jr.CryptoGost.coding.Hex,d&&(y.iv=v.decode(d)),m=Jr.GostEngine.getGostCipher(y),b=v.encode(m.sign(v.decode(h),v.decode(t))),e.abrupt("return","Hex"===o?b:O.byteArrayToChars(T(b)));case 27:throw e.prev=27,e.t1=e.catch(19),new E(e.t1);case 30:case"end":return e.stop()}}),e,null,[[19,27]])}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);function dn(e,t,r){return t=s(t),a(e,pn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function pn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pn=function(){return!!e})()}const gn=function(t){function r(){var t;return e(this,r),(t=dn(this,r)).name="GOST Verify",t.module="Ciphers",t.description="Verify the signature of a plaintext message using one of the GOST block ciphers. Enter the signature in the MAC field.",t.infoURL="https://wikipedia.org/wiki/GOST_(block_cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"MAC",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input type",type:"option",value:["Raw","Hex"]},{name:"Algorithm",type:"argSelector",value:[{name:"GOST 28147 (1989)",on:[5]},{name:"GOST R 34.12 (Magma, 2015)",off:[5]},{name:"GOST R 34.12 (Kuznyechik, 2015)",off:[5]}]},{name:"sBox",type:"option",value:["E-TEST","E-A","E-B","E-C","E-D","E-SC","E-Z","D-TEST","D-A","D-SC"]}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a,s,o,c,u,f,h,d,p,g,y,v,m,b;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=se(r,6),i=n[0],a=n[1],s=n[2],o=n[3],c=n[4],u=n[5],f=x(O.convertToByteArray(i.string,i.option)),h=x(O.convertToByteArray(a.string,a.option)),d=x(O.convertToByteArray(s.string,s.option)),t="Hex"===o?t:x(O.strToArrayBuffer(t)),e.t0=c,e.next="GOST 28147 (1989)"===e.t0?8:"GOST R 34.12 (Magma, 2015)"===e.t0?11:"GOST R 34.12 (Kuznyechik, 2015)"===e.t0?14:17;break;case 8:return g=1989,p=64,e.abrupt("break",18);case 11:return g=2015,p=64,e.abrupt("break",18);case 14:return g=2015,p=128,e.abrupt("break",18);case 17:throw new E(`Unknown algorithm version: ${c}`);case 18:return y={version:g,length:p,mode:"MAC",sBox:1989===g?u:null,macLength:4*d.length},e.prev=20,v=Jr.CryptoGost.coding.Hex,h&&(y.iv=v.decode(h)),m=Jr.GostEngine.getGostCipher(y),b=m.verify(v.decode(f),v.decode(d),v.decode(t)),e.abrupt("return",b?"The signature matches":"The signature does not match");case 28:throw e.prev=28,e.t1=e.catch(20),new E(e.t1);case 31:case"end":return e.stop()}}),e,null,[[20,28]])}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);var yn="WARNING: Cryptographic operations in CyberChef should not be relied upon to provide security in any situation. No guarantee is offered for their correctness. We advise you not to use keys generated from CyberChef in operational contexts.";function vn(e,t,r){return t=s(t),a(e,mn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function mn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mn=function(){return!!e})()}const bn=function(t){function r(){var t;return e(this,r),(t=vn(this,r)).name="Generate ECDSA Key Pair",t.module="Ciphers",t.description=`Generate an ECDSA key pair with a given Curve.

${yn}`,t.infoURL="https://wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm",t.inputType="string",t.outputType="string",t.args=[{name:"Elliptic Curve",type:"option",value:["P-256","P-384","P-521"]},{name:"Output Format",type:"option",value:["PEM","DER","JWK"]}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=se(r,2),i=n[0],a=n[1],e.abrupt("return",new Promise((function(e,t){var r;switch(i){case"P-256":r="secp256r1";break;case"P-384":r="secp384r1";break;case"P-521":r="secp521r1"}var n,s,o,c=Mr.ym.generateKeypair("EC",r);switch(a){case"PEM":o=(n=Mr.ym.getPEM(c.pubKeyObj).replace(/\r/g,""))+"\n"+(s=Mr.ym.getPEM(c.prvKeyObj,"PKCS8PRV").replace(/\r/g,""));break;case"DER":o=c.prvKeyObj.prvKeyHex;break;case"JWK":(n=Mr.ym.getJWKFromKey(c.pubKeyObj)).key_ops=["verify"],n.kid="PublicKey",(s=Mr.ym.getJWKFromKey(c.prvKeyObj)).key_ops=["sign"],s.kid="PrivateKey",o=JSON.stringify({keys:[s,n]},null,4)}e(o)})));case 2:case"end":return e.stop()}}),e)}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);function wn(e,t,r){return t=s(t),a(e,Sn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Sn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Sn=function(){return!!e})()}const En=function(t){function r(){var t;return e(this,r),(t=wn(this,r)).name="Generate RSA Key Pair",t.module="Ciphers",t.description=`Generate an RSA key pair with a given number of bits.

${yn}`,t.infoURL="https://wikipedia.org/wiki/RSA_(cryptosystem)",t.inputType="string",t.outputType="string",t.args=[{name:"RSA Key Length",type:"option",value:["1024","2048","4096"]},{name:"Output Format",type:"option",value:["PEM","JSON","DER"]}],t}return c(r,t),i(r,[{key:"run",value:(n=f(l().mark((function e(t,r){var n,i,a;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=se(r,2),i=n[0],a=n[1],e.abrupt("return",new Promise((function(e,t){lt().pki.rsa.generateKeyPair({bits:Number(i),workers:-1,workerScript:"assets/forge/prime.worker.min.js"},(function(r,n){if(r)return t(r);var i;switch(a){case"PEM":i=lt().pki.publicKeyToPem(n.publicKey)+"\n"+lt().pki.privateKeyToPem(n.privateKey);break;case"JSON":i=JSON.stringify(n);break;case"DER":i=lt().asn1.toDer(lt().pki.privateKeyToAsn1(n.privateKey)).getBytes()}e(i)}))})));case 2:case"end":return e.stop()}}),e)}))),function(e,t){return n.apply(this,arguments)})}]);var n}(tt);function Cn(e,t,r){return t=s(t),a(e,An()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function An(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(An=function(){return!!e})()}var Bn=function(t){function r(){var t;return e(this,r),(t=Cn(this,r)).name="Pseudo-Random Number Generator",t.module="Ciphers",t.description="A cryptographically-secure pseudo-random number generator (PRNG).

This operation uses the browser's built-in crypto.getRandomValues() method if available. If this cannot be found, it falls back to a Fortuna-based PRNG algorithm.",t.infoURL="https://wikipedia.org/wiki/Pseudorandom_number_generator",t.inputType="string",t.outputType="string",t.args=[{name:"Number of bytes",type:"number",value:32},{name:"Output as",type:"option",value:["Hex","Integer","Byte array","Raw"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n=se(t,2),i=n[0],a=n[1];if(N()&&self.crypto){r=new ArrayBuffer(i);for(var s=0;s=0;o--)c=c.times(256).plus(r.charCodeAt(o));return c.toFixed();case"Byte array":return JSON.stringify(O.strToCharcode(r));default:return r}}}])}(tt);const xn=Bn;function Tn(e,t,r){return t=s(t),a(e,In()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function In(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(In=function(){return!!e})()}const Fn=function(t){function r(){var t;return e(this,r),(t=Tn(this,r)).name="RC2 Decrypt",t.module="Ciphers",t.description="RC2 (also known as ARC2) is a symmetric-key block cipher designed by Ron Rivest in 1987. 'RC' stands for 'Rivest Cipher'.

Key: RC2 uses a variable size key.

IV: To run the cipher in CBC mode, the Initialization Vector should be 8 bytes long. If the IV is left blank, the cipher will run in ECB mode.

Padding: In both CBC and ECB mode, PKCS#7 padding will be used.",t.infoURL="https://wikipedia.org/wiki/RC2",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteString(t[1].string,t[1].option),i=se(t,4),a=i[2],s=i[3],o=lt().rc2.createDecryptionCipher(r);return e=O.convertToByteString(e,a),o.start(n||null),o.update(lt().util.createBuffer(e)),o.finish(),"Hex"===s?o.output.toHex():o.output.getBytes()}}])}(tt);function kn(e,t,r){return t=s(t),a(e,Rn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Rn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rn=function(){return!!e})()}const Dn=function(t){function r(){var t;return e(this,r),(t=kn(this,r)).name="RC2 Encrypt",t.module="Ciphers",t.description="RC2 (also known as ARC2) is a symmetric-key block cipher designed by Ron Rivest in 1987. 'RC' stands for 'Rivest Cipher'.

Key: RC2 uses a variable size key.

You can generate a password-based key using one of the KDF operations.

IV: To run the cipher in CBC mode, the Initialization Vector should be 8 bytes long. If the IV is left blank, the cipher will run in ECB mode.

Padding: In both CBC and ECB mode, PKCS#7 padding will be used.",t.infoURL="https://wikipedia.org/wiki/RC2",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteString(t[0].string,t[0].option),n=O.convertToByteString(t[1].string,t[1].option),i=se(t,4),a=i[2],s=i[3],o=lt().rc2.createEncryptionCipher(r);return e=O.convertToByteString(e,a),o.start(n||null),o.update(lt().util.createBuffer(e)),o.finish(),"Hex"===s?o.output.toHex():o.output.getBytes()}}])}(tt);function _n(e,t,r){return t=s(t),a(e,Pn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Pn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pn=function(){return!!e})()}const Nn=function(t){function r(){var t;return e(this,r),(t=_n(this,r)).name="RC4",t.module="Ciphers",t.description="RC4 (also known as ARC4) is a widely-used stream cipher designed by Ron Rivest. It is used in popular protocols such as SSL and WEP. Although remarkable for its simplicity and speed, the algorithm's history doesn't inspire confidence in its security.",t.infoURL="https://wikipedia.org/wiki/RC4",t.inputType="string",t.outputType="string",t.args=[{name:"Passphrase",type:"toggleString",value:"",toggleValues:["UTF8","UTF16","UTF16LE","UTF16BE","Latin1","Hex","Base64"]},{name:"Input format",type:"option",value:["Latin1","UTF8","UTF16","UTF16LE","UTF16BE","Hex","Base64"]},{name:"Output format",type:"option",value:["Latin1","UTF8","UTF16","UTF16LE","UTF16BE","Hex","Base64"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=Nt[t[1]].parse(e),n=Nt[t[0].option].parse(t[0].string);return Dt().RC4.encrypt(r,n).ciphertext.toString(Nt[t[2]])}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);function On(e,t,r){return t=s(t),a(e,Ln()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Ln(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ln=function(){return!!e})()}const Un=function(t){function r(){var t;return e(this,r),(t=On(this,r)).name="RC4 Drop",t.module="Ciphers",t.description="It was discovered that the first few bytes of the RC4 keystream are strongly non-random and leak information about the key. We can defend against this attack by discarding the initial portion of the keystream. This modified algorithm is traditionally called RC4-drop.",t.infoURL="https://wikipedia.org/wiki/RC4#Fluhrer,_Mantin_and_Shamir_attack",t.inputType="string",t.outputType="string",t.args=[{name:"Passphrase",type:"toggleString",value:"",toggleValues:["UTF8","UTF16","UTF16LE","UTF16BE","Latin1","Hex","Base64"]},{name:"Input format",type:"option",value:["Latin1","UTF8","UTF16","UTF16LE","UTF16BE","Hex","Base64"]},{name:"Output format",type:"option",value:["Latin1","UTF8","UTF16","UTF16LE","UTF16BE","Hex","Base64"]},{name:"Number of dwords to drop",type:"number",value:192}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=Nt[t[1]].parse(e),n=Nt[t[0].option].parse(t[0].string),i=t[3];return Dt().RC4Drop.encrypt(r,n,{drop:i}).ciphertext.toString(Nt[t[2]])}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);var Kn={"SHA-1":lt().md.sha1,MD5:lt().md.md5,"SHA-256":lt().md.sha256,"SHA-384":lt().md.sha384,"SHA-512":lt().md.sha512};function Mn(e,t,r){return t=s(t),a(e,Hn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Hn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Hn=function(){return!!e})()}const jn=function(t){function r(){var t;return e(this,r),(t=Mn(this,r)).name="RSA Decrypt",t.module="Ciphers",t.description="Decrypt an RSA encrypted message with a PEM encoded private key.",t.infoURL="https://wikipedia.org/wiki/RSA_(cryptosystem)",t.inputType="string",t.outputType="string",t.args=[{name:"RSA Private Key (PEM)",type:"text",value:"-----BEGIN RSA PRIVATE KEY-----"},{name:"Key Password",type:"text",value:""},{name:"Encryption Scheme",type:"argSelector",value:[{name:"RSA-OAEP",on:[3]},{name:"RSAES-PKCS1-V1_5",off:[3]},{name:"RAW",off:[3]}]},{name:"Message Digest Algorithm",type:"option",value:Object.keys(Kn)}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=se(t,4),n=r[0],i=r[1],a=r[2],s=r[3];if(0===n.replace("-----BEGIN RSA PRIVATE KEY-----","").length)throw new E("Please enter a private key.");try{var o=lt().pki.decryptRsaPrivateKey(n,i).decrypt(e,a,{md:Kn[s].create()});return lt().util.decodeUtf8(o)}catch(e){throw new E(e)}}}])}(tt);function Vn(e,t,r){return t=s(t),a(e,Gn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Gn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gn=function(){return!!e})()}const qn=function(t){function r(){var t;return e(this,r),(t=Vn(this,r)).name="RSA Encrypt",t.module="Ciphers",t.description="Encrypt a message with a PEM encoded RSA public key.",t.infoURL="https://wikipedia.org/wiki/RSA_(cryptosystem)",t.inputType="string",t.outputType="string",t.args=[{name:"RSA Public Key (PEM)",type:"text",value:"-----BEGIN RSA PUBLIC KEY-----"},{name:"Encryption Scheme",type:"argSelector",value:[{name:"RSA-OAEP",on:[2]},{name:"RSAES-PKCS1-V1_5",off:[2]},{name:"RAW",off:[2]}]},{name:"Message Digest Algorithm",type:"option",value:Object.keys(Kn)}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=se(t,3),n=r[0],i=r[1],a=r[2];if(0===n.replace("-----BEGIN RSA PUBLIC KEY-----","").length)throw new E("Please enter a public key.");try{var s=lt().pki.publicKeyFromPem(n),o=lt().util.encodeUtf8(e);return s.encrypt(o,i,{md:Kn[a].create()})}catch(e){if("RSAES-OAEP input message length is too long."===e.message)throw new E(`RSAES-OAEP input message length (${e.length}) is longer than the maximum allowed length (${e.maxLength}).`);throw new E(e)}}}])}(tt);function zn(e,t,r){return t=s(t),a(e,Wn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Wn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wn=function(){return!!e})()}const Xn=function(t){function r(){var t;return e(this,r),(t=zn(this,r)).name="RSA Sign",t.module="Ciphers",t.description="Sign a plaintext message with a PEM encoded RSA key.",t.infoURL="https://wikipedia.org/wiki/RSA_(cryptosystem)",t.inputType="string",t.outputType="string",t.args=[{name:"RSA Private Key (PEM)",type:"text",value:"-----BEGIN RSA PRIVATE KEY-----"},{name:"Key Password",type:"text",value:""},{name:"Message Digest Algorithm",type:"option",value:Object.keys(Kn)}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=se(t,3),n=r[0],i=r[1],a=r[2];if(0===n.replace("-----BEGIN RSA PRIVATE KEY-----","").length)throw new E("Please enter a private key.");try{var s=lt().pki.decryptRsaPrivateKey(n,i),o=Kn[a].create();return o.update(e,"raw"),s.sign(o)}catch(e){throw new E(e)}}}])}(tt);function Yn(e,t,r){return t=s(t),a(e,Jn()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Jn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jn=function(){return!!e})()}var Qn=function(t){function r(){var t;return e(this,r),(t=Yn(this,r)).name="RSA Verify",t.module="Ciphers",t.description="Verify a message against a signature and a public PEM encoded RSA key.",t.infoURL="https://wikipedia.org/wiki/RSA_(cryptosystem)",t.inputType="string",t.outputType="string",t.args=[{name:"RSA Public Key (PEM)",type:"text",value:"-----BEGIN RSA PUBLIC KEY-----"},{name:"Message",type:"text",value:""},{name:"Message format",type:"option",value:["Raw","Hex","Base64"]},{name:"Message Digest Algorithm",type:"option",value:Object.keys(Kn)}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=se(t,4),n=r[0],i=r[1],a=r[2],s=r[3];if(0===n.replace("-----BEGIN RSA PUBLIC KEY-----","").length)throw new E("Please enter a public key.");try{var o=lt().pki.publicKeyFromPem(n),c=Kn[s].create(),u=O.convertToByteString(i,a);return c.update(u,"raw"),o.verify(c.digest().bytes(),e)?"Verified OK":"Verification Failure"}catch(e){if("Encrypted message length is invalid."===e.message)throw new E(`Signature length (${e.length}) does not match expected length based on key (${e.expected}).`);throw new E(e)}}}])}(tt);const Zn=Qn;function $n(e,t,r){return t=s(t),a(e,ei()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function ei(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ei=function(){return!!e})()}var ti=function(t){function r(){var t;return e(this,r),(t=$n(this,r)).name="Rabbit",t.module="Ciphers",t.description="Rabbit is a high-speed stream cipher introduced in 2003 and defined in RFC 4503.

The cipher uses a 128-bit key and an optional 64-bit initialization vector (IV).

big-endian: based on RFC4503 and RFC3447
little-endian: compatible with Crypto++",t.infoURL="https://wikipedia.org/wiki/Rabbit_(cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Endianness",type:"option",value:["Big","Little"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Raw","Hex"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteArray(t[0].string,t[0].option),n=O.convertToByteArray(t[1].string,t[1].option),i=t[2],a=t[3],s=t[4],o="Little"===i;if(16!==r.length)throw new E(`Invalid key length: ${r.length} bytes (expected: 16)`);if(0!==n.length&&8!==n.length)throw new E(`Invalid IV length: ${n.length} bytes (expected: 0 or 8)`);var c=new Uint32Array(8),u=new Uint32Array(8),f=0,h=[1295307597,3545052371,886263092,1295307597,3545052371,886263092,1295307597,3545052371],l=function(){for(var e=0;e<8;e++){var t=u[e]+h[e]+f;f=t/(4*(1<<30))>>>0,u[e]=t}},d=function(e,t){return e<>>32-t},p=function(e,t,r){return e+d(t,16)+d(r,16)},g=function(e,t,r){return e+d(t,8)+r},y=new Uint32Array(8),v=function(){for(var e=0;e<8;e++)y[e]=(void 0,void 0,void 0,void 0,void 0,(a=(n=65535&(t=c[e]+u[e]>>>0))*n+65536*(65535&(i=2*(r=t>>>16)*n)))>>>0^r*r+(i/65536>>>0)+(a/(4*(1<<30))>>>0));var t,r,n,i,a;c[0]=p(y[0],y[7],y[6]),c[1]=g(y[1],y[0],y[7]),c[2]=p(y[2],y[1],y[0]),c[3]=g(y[3],y[2],y[1]),c[4]=p(y[4],y[3],y[2]),c[5]=g(y[5],y[4],y[3]),c[6]=p(y[6],y[5],y[4]),c[7]=g(y[7],y[6],y[5])},m=new Uint16Array(8);if(o)for(var b=0;b<8;b++)m[b]=r[1+2*b]<<8|r[2*b];else for(var w=0;w<8;w++)m[w]=r[14-2*w]<<8|r[15-2*w];for(var S=0;S<8;S++)S%2==0?(c[S]=m[(S+1)%8]<<16|m[S],u[S]=m[(S+4)%8]<<16|m[(S+5)%8]):(c[S]=m[(S+5)%8]<<16|m[(S+4)%8],u[S]=m[S]<<16|m[(S+1)%8]);for(var C=0;C<4;C++)l(),v();for(var A=0;A<8;A++)u[A]=u[A]^c[(A+4)%8];if(8===n.length){var B=function(e,t,r,i){return o?n[e]<<24|n[t]<<16|n[r]<<8|n[i]:n[7-e]<<24|n[7-t]<<16|n[7-r]<<8|n[7-i]};u[0]=u[0]^B(3,2,1,0),u[1]=u[1]^B(7,6,3,2),u[2]=u[2]^B(7,6,5,4),u[3]=u[3]^B(5,4,1,0),u[4]=u[4]^B(3,2,1,0),u[5]=u[5]^B(7,6,3,2),u[6]=u[6]^B(7,6,5,4),u[7]=u[7]^B(5,4,1,0);for(var T=0;T<4;T++)l(),v()}for(var I=new Uint8Array(16),F=function(){var e=0,t=function(t){I[e++]=t>>>8,I[e++]=255&t};if(l(),v(),t(c[6]>>>16^65535&c[1]),t(65535&c[6]^c[3]>>>16),t(c[4]>>>16^65535&c[7]),t(65535&c[4]^c[1]>>>16),t(c[2]>>>16^65535&c[5]),t(65535&c[2]^c[7]>>>16),t(c[0]>>>16^65535&c[3]),t(65535&c[0]^c[5]>>>16),o)for(var r=0,n=I.length-1;ra.length)throw new E("Key should be smaller than the cipher's length");if(i<0)throw new E("Offset has to be a positive integer");var s,o,c=2*(n-1),u=new Array(a.length),f=0;for(o=0;oa.length)throw new E("Key should be smaller than the plain text's length");if(i<0)throw new E("Offset has to be a positive integer");for(var s=2*(n-1),o=new Array(n).fill(""),c=0;c>>32-t}function pi(e){for(var t,r=e.map((function(e,t){return e^li[t]})),n=[],i=0;i<32;i++)n[i]=r[i+4]=r[i]^(t=r[i+1]^r[i+2]^r[i+3]^hi[i],(t=fi[t>>>24&255]<<24|fi[t>>>16&255]<<16|fi[t>>>8&255]<<8|fi[255&t])^di(t,13)^di(t,23));return n}function gi(e,t){for(var r=0;r<32;r++)e[r+4]=e[r]^(n=e[r+1]^e[r+2]^e[r+3]^t[r],(n=fi[n>>>24&255]<<24|fi[n>>>16&255]<<16|fi[n>>>8&255]<<8|fi[255&n])^di(n,2)^di(n,10)^di(n,18)^di(n,24));var n;return[e[35],e[34],e[33],e[32]]}function yi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return[e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],e[t+=4]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],e[t+=4]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],e[t+=4]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]]}function vi(e){for(var t=[],r=0;r>24&255),t.push(e[r]>>16&255),t.push(e[r]>>8&255),t.push(255&e[r]);return t}function mi(e,t,r){return t=s(t),a(e,bi()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function bi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bi=function(){return!!e})()}var wi=function(t){function r(){var t;return e(this,r),(t=mi(this,r)).name="SM4 Decrypt",t.module="Ciphers",t.description="SM4 is a 128-bit block cipher, currently established as a national standard (GB/T 32907-2016) of China.",t.infoURL="https://wikipedia.org/wiki/SM4_(cipher)",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"IV",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Mode",type:"option",value:["CBC","CFB","OFB","CTR","ECB","CBC/NoPadding","ECB/NoPadding"]},{name:"Input",type:"option",value:["Raw","Hex"]},{name:"Output",type:"option",value:["Hex","Raw"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=O.convertToByteArray(t[0].string,t[0].option),n=O.convertToByteArray(t[1].string,t[1].option),i=se(t,5),a=i[2],s=i[3],o=i[4];if(16!==r.length)throw new E(`Invalid key length: ${r.length} bytes\n\nSM4 uses a key length of 16 bytes (128 bits).`);if(16!==n.length&&!a.startsWith("ECB"))throw new E(`Invalid IV length: ${n.length} bytes\n\nSM4 uses an IV length of 16 bytes (128 bits).\nMake sure you have specified the type correctly (e.g. Hex vs UTF8).`);var c=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ECB",i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=e.length;if(0===a)return[];var s=pi(yi(t,0));if("ECB"===n||"CBC"===n){if(s=s.reverse(),15&a&&!i)throw new E(`With ECB or CBC modes, the input must be divisible into 16 byte blocks. (${15&e.length} bytes extra)`)}else for(;15&e.length;)e.push(0);var o=[];switch(n){case"ECB":for(var c=0;c>4,v=gi(v,s);var m=yi(e,y);m[0]^=v[0],m[1]^=v[1],m[2]^=v[2],m[3]^=v[3],Array.prototype.push.apply(o,vi(m))}break;default:throw new E(`Invalid block cipher mode: ${n}`)}if("ECB"===n||"CBC"===n){if(i)return o;var b=o[o.length-1];if(b>16)throw new E("Invalid PKCS#7 padding.");for(var w=0;w3&&void 0!==arguments[3]?arguments[3]:"ECB",i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=e.length;if(0===a)return[];var s=pi(yi(t,0)),o=0,c=16-(15&e.length);if("ECB"===n||"CBC"===n)if(i){if(16!==c)throw new E(`No padding requested in ${n} mode but input is not a 16-byte multiple.`);c=0}else o=c;for(var u=0;u>4,w=gi(w,s);var S=yi(e,b);S[0]^=w[0],S[1]^=w[1],S[2]^=w[2],S[3]^=w[3],Array.prototype.push.apply(f,vi(S))}break;default:throw new E("Invalid block cipher mode: "+n)}return"ECB"!==n&&"CBC"!==n?f.slice(0,a):f}(e=O.convertToByteArray(e,s),r,n,a.substring(0,3),a.endsWith("NoPadding"));return"Hex"===o?B(c):O.byteArrayToUtf8(c)}}])}(tt);const Bi=Ai;function xi(e,t){function r(e,t){return e<>>32-t}function n(e,t,n,i,a){e[n]^=r(e[t]+e[a]&4294967295,7),e[i]^=r(e[n]+e[t]&4294967295,9),e[a]^=r(e[i]+e[n]&4294967295,13),e[t]^=r(e[a]+e[i]&4294967295,18)}for(var i=0;i
Key: Salsa20 uses a key of 16 or 32 bytes (128 or 256 bits).

Nonce: Salsa20 uses a nonce of 8 bytes (64 bits).

Counter: Salsa uses a counter of 8 bytes (64 bits). The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes.",t.infoURL="https://wikipedia.org/wiki/Salsa20",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Nonce",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64","Integer"]},{name:"Counter",type:"number",value:0,min:0},{name:"Rounds",type:"option",value:["20","12","8"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n,i=O.convertToByteArray(t[0].string,t[0].option),a=t[1].option,s=parseInt(t[3],10),o=t[4],c=t[5];if(16!==i.length&&32!==i.length)throw new E(`Invalid key length: ${i.length} bytes.\n\nSalsa20 uses a key of 16 or 32 bytes (128 or 256 bits).`);if("Integer"===a)n=O.intToByteArray(parseInt(t[1].string,10),8,"little");else if(8!==(n=O.convertToByteArray(t[1].string,t[1].option)).length)throw new E(`Invalid nonce length: ${n.length} bytes.\n\nSalsa20 uses a nonce of 8 bytes (64 bits).`);r=O.intToByteArray(t[2],8,"little");var u=[];e=O.convertToByteArray(e,o);for(var f=O.byteArrayToInt(r,"little"),h=0;h=0?(i=s[(u-c)%s.length],r=a.indexOf(i),n=a.indexOf(e[u]),o+=a[(n-r+26)%26]):a.indexOf(e[u].toLowerCase())>=0?(i=s[(u-c)%s.length].toLowerCase(),r=a.indexOf(i),n=a.indexOf(e[u].toLowerCase()),o+=a[(n+26-r)%26].toUpperCase()):(o+=e[u],c++);return o}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);const Hi=Mi;function ji(e,t,r){return t=s(t),a(e,Vi()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Vi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vi=function(){return!!e})()}var Gi=function(t){function r(){var t;return e(this,r),(t=ji(this,r)).name="Vigenère Encode",t.module="Ciphers",t.description="The Vigenere cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution.",t.infoURL="https://wikipedia.org/wiki/Vigenère_cipher",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"string",value:""}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n,i,a="abcdefghijklmnopqrstuvwxyz",s=t[0].toLowerCase(),o="",c=0;if(!s)throw new E("No key entered");if(!/^[a-zA-Z]+$/.test(s))throw new E("The key must consist only of letters");for(var u=0;u=0?(i=s[(u-c)%s.length],r=a.indexOf(i),n=a.indexOf(e[u]),o+=a[(r+n)%26]):a.indexOf(e[u].toLowerCase())>=0?(i=s[(u-c)%s.length].toLowerCase(),r=a.indexOf(i),n=a.indexOf(e[u].toLowerCase()),o+=a[(r+n)%26].toUpperCase()):(o+=e[u],c++);return o}},{key:"highlight",value:function(e,t){return e}},{key:"highlightReverse",value:function(e,t){return e}}])}(tt);const qi=Gi;function zi(e,t,r){return t=s(t),a(e,Wi()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function Wi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wi=function(){return!!e})()}var Xi=function(t){function r(){var t;return e(this,r),(t=zi(this,r)).name="XSalsa20",t.module="Ciphers",t.description="XSalsa20 is a variant of the Salsa20 stream cipher designed by Daniel J. Bernstein; XSalsa uses longer nonces.

Key: XSalsa20 uses a key of 16 or 32 bytes (128 or 256 bits).

Nonce: XSalsa20 uses a nonce of 24 bytes (192 bits).

Counter: XSalsa uses a counter of 8 bytes (64 bits). The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes.",t.infoURL="https://en.wikipedia.org/wiki/Salsa20#XSalsa20_with_192-bit_nonce",t.inputType="string",t.outputType="string",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]},{name:"Nonce",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64","Integer"]},{name:"Counter",type:"number",value:0,min:0},{name:"Rounds",type:"option",value:["20","12","8"]},{name:"Input",type:"option",value:["Hex","Raw"]},{name:"Output",type:"option",value:["Raw","Hex"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r,n,i=O.convertToByteArray(t[0].string,t[0].option),a=t[1].option,s=parseInt(t[3],10),o=t[4],c=t[5];if(16!==i.length&&32!==i.length)throw new E(`Invalid key length: ${i.length} bytes.\n\nXSalsa20 uses a key of 16 or 32 bytes (128 or 256 bits).`);if("Integer"===a)n=O.intToByteArray(parseInt(t[1].string,10),8,"little");else if(24!==(n=O.convertToByteArray(t[1].string,t[1].option)).length)throw new E(`Invalid nonce length: ${n.length} bytes.\n\nXSalsa20 uses a nonce of 24 bytes (192 bits).`);r=O.intToByteArray(t[2],8,"little");var u=function(e,t,r){var n,i;16===e.length?(i=O.strToByteArray("expand 16-byte k"),e=e.concat(e)):i=O.strToByteArray("expand 32-byte k"),n=(n=(n=(n=(n=(n=(n=i.slice(0,4)).concat(e.slice(0,16))).concat(i.slice(4,8))).concat(t)).concat(i.slice(8,12))).concat(e.slice(16,32))).concat(i.slice(12,16));for(var a=Array(),s=0;s<64;s+=4)a.push(O.byteArrayToInt(n.slice(s,s+4),"little"));xi(a,r);for(var o=Array(),c=[0,5,10,15,6,7,8,9],u=0;u<8;u++)o=o.concat(O.intToByteArray(a[c[u]],4,"little"));return o}(i,n.slice(0,16),s),f=[];e=O.convertToByteArray(e,o);for(var h=O.byteArrayToInt(r,"little"),l=0;ln)return null;n=i}for(var a=new Uint8Array(n),s=0;s>2]>>((3&s)<<3);return a}function Zi(e,t){var r,n=e.length,i=n>>2;3&n&&++i,t?(r=new Uint32Array(i+1))[i]=n:r=new Uint32Array(i);for(var a=0;a>2]|=e[a]<<((3&a)<<3);return r}function $i(e){return 4294967295&e}function ea(e,t,r,n,i,a){return(r>>>5^t<<2)+(t>>>3^r<<4)^(e^t)+(a[3&n^i]^r)}function ta(e){if(e.length<16){var t=new Uint8Array(16);return t.set(e),t}return e}function ra(e,t,r){return t=s(t),a(e,na()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function na(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(na=function(){return!!e})()}const ia=function(t){function r(){var t;return e(this,r),(t=ra(this,r)).name="XXTEA Decrypt",t.module="Ciphers",t.description="Corrected Block TEA (often referred to as XXTEA) is a block cipher designed to correct weaknesses in the original Block TEA. XXTEA operates on variable-length blocks that are some arbitrary multiple of 32 bits in size (minimum 64 bits). The number of full cycles depends on the block size, but there are at least six (rising to 32 for small block sizes). The original Block TEA applies the XTEA round function to each word in the block and combines it additively with its leftmost neighbour. Slow diffusion rate of the decryption process was immediately exploited to break the cipher. Corrected Block TEA uses a more involved round function which makes use of both immediate neighbours in processing each word in the block.",t.infoURL="https://wikipedia.org/wiki/XXTEA",t.inputType="ArrayBuffer",t.outputType="ArrayBuffer",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=new Uint8Array(O.convertToByteArray(t[0].string,t[0].option));try{return function(e,t){return null==e||0===e.length?e:Qi(function(e,t){var r,n,i,a,s,o=e.length,c=o-1;for(r=e[0],i=$i(Math.floor(6+52/o)*Ji);0!==i;i=$i(i-Ji)){for(a=i>>>2&3,s=c;s>0;--s)n=e[s-1],r=e[s]=$i(e[s]-ea(i,r,n,s,a,t));n=e[c],r=e[0]=$i(e[0]-ea(i,r,n,0,a,t))}return e}(Zi(e,!1),Zi(ta(t),!1)),!0)}(new Uint8Array(e),r).buffer}catch(e){throw new E("Unable to decrypt using this key")}}}])}(tt);function aa(e,t,r){return t=s(t),a(e,sa()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function sa(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(sa=function(){return!!e})()}const oa=function(t){function r(){var t;return e(this,r),(t=aa(this,r)).name="XXTEA Encrypt",t.module="Ciphers",t.description="Corrected Block TEA (often referred to as XXTEA) is a block cipher designed to correct weaknesses in the original Block TEA. XXTEA operates on variable-length blocks that are some arbitrary multiple of 32 bits in size (minimum 64 bits). The number of full cycles depends on the block size, but there are at least six (rising to 32 for small block sizes). The original Block TEA applies the XTEA round function to each word in the block and combines it additively with its leftmost neighbour. Slow diffusion rate of the decryption process was immediately exploited to break the cipher. Corrected Block TEA uses a more involved round function which makes use of both immediate neighbours in processing each word in the block.",t.infoURL="https://wikipedia.org/wiki/XXTEA",t.inputType="ArrayBuffer",t.outputType="ArrayBuffer",t.args=[{name:"Key",type:"toggleString",value:"",toggleValues:["Hex","UTF8","Latin1","Base64"]}],t}return c(r,t),i(r,[{key:"run",value:function(e,t){var r=new Uint8Array(O.convertToByteArray(t[0].string,t[0].option));return function(e,t){return null==e||0===e.length?e:Qi(function(e,t){var r,n,i,a,s,o,c=e.length,u=c-1;for(n=e[u],i=0,o=0|Math.floor(6+52/c);o>0;--o){for(a=(i=$i(i+Ji))>>>2&3,s=0;s