diff --git a/dist/index.js b/dist/index.js index e55315453..27c7638cf 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5,4 +5,4 @@ * @author Feross Aboukhadijeh * @license MIT */ -var r=t(143),o=t(144),a=t(66);function n(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function c(e,t){if(n()=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function d(e,t){if(l.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 n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(r)return U(e).length;t=(""+t).toLowerCase(),r=!0}}function p(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):2147483647=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:_(e,t,n,r,i);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):_(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function _(e,t,n,r,i){var o,a=1,c=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;c/=a=2,s/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=n;o>>10&1023|55296),f=56320|1023&f),r.push(f),i+=l}return function(e){var t=e.length;if(t<=m)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return g(this,t,n);case"ascii":return S(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return v(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",t=x.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},l.prototype.compare=function(e,t,n,r,i){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(i<=r&&n<=t)return 0;if(i<=r)return-1;if(n<=t)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),c=Math.min(o,a),s=this.slice(r,i),u=e.slice(t,n),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o,a,c,s,u,f,l,h,d,p=!1;;)switch(r){case"hex":return E(this,e,t,n);case"utf8":case"utf-8":return h=t,d=n,k(U(e,(l=this).length-h),l,h,d);case"ascii":return y(this,e,t,n);case"latin1":case"binary":return y(this,e,t,n);case"base64":return s=this,u=t,f=n,k(j(e),s,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=t,c=n,k(function(e,t){for(var n,r,i,o=[],a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(e,(o=this).length-a),o,a,c);default:if(p)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),p=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var m=4096;function S(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ie.length)throw new RangeError("Index out of range")}function w(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function C(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function I(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(e,t,n,r,i){return i||I(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,i){return i||I(e,0,n,8),o.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):r>>8):w(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):w(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=0,a=1,c=0;for(this[t]=255&e;++o>0)-c&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=n-1,a=1,c=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===c&&0!==this[t+o+1]&&(c=1),this[t+o]=(e/a>>0)-c&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):w(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):w(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return P(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return P(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function j(e){return r.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function k(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,t(15))},function(e,t,A){(function(e){!function(e,t){"use strict";function _(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function E(e,t,n){if(E.isBN(e))return e;this.negative=0,this.words=null,this.length=0,(this.red=null)!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var r;"object"==typeof e?e.exports=E:t.BN=E,(E.BN=E).wordSize=26;try{r=A(185).Buffer}catch(e){}function a(e,t,n){for(var r=0,i=Math.min(e.length,n),o=t;o>>26-a&67108863,26<=(a+=24)&&(a-=26,i++);else if("le"===n)for(i=r=0;r>>26-a&67108863,26<=(a+=24)&&(a-=26,i++);return this.strip()},E.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n>>26-o&4194303,26<=(o+=24)&&(o-=26,r++);n+6!==t&&(i=a(e,t,n+6),this.words[r]|=i<>>26-o&4194303),this.strip()},E.prototype._parseBase=function(e,t,n){this.words=[0];for(var r=0,i=this.length=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,c=Math.min(o,o-a)+n,s=0,u=n;u"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function i(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;r=(n.length=r)-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,c=67108863&a,s=a/67108864|0;n.words[0]=c;for(var u=1;u>>26,l=67108863&s,h=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=h;d++){var p=u-d|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&a}n.words[u]=0|l,s=0|f}return 0!==s?n.words[u]=0|s:n.length--,n.strip()}E.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var r=0,i=0,o=0;o>>24-r&16777215)||o!==this.length-1?h[6-c.length]+c+n:c+n,26<=(r+=2)&&(r-=26,o--)}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&2<=e&&e<=36){var s=d[e],u=p[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var l=f.modn(u).toString(e);n=(f=f.idivn(u)).isZero()?l+n:h[s-l.length]+l+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}_(!1,"Base should be between 2 and 36")},E.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]:2>>=13),64<=t&&(n+=7,t>>>=7),8<=t&&(n+=4,t>>>=4),2<=t&&(n+=2,t>>>=2),n+t},E.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},E.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},E.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},E.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},E.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},E.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},E.prototype.iuxor=function(e){var t,n;n=this.length>e.length?(t=this,e):(t=e,this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},E.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},E.prototype.inotn=function(e){_("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),0>26-n),this.strip()},E.prototype.notn=function(e){return this.clone().inotn(e)},E.prototype.setn=function(e,t){_("number"==typeof e&&0<=e);var n=e/26|0,r=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,e):(n=e,this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},E.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 n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;r=0>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,b=d>>>13,_=0|a[2],E=8191&_,y=_>>>13,v=0|a[3],g=8191&v,m=v>>>13,S=0|a[4],A=8191&S,O=S>>>13,T=0|a[5],N=8191&T,M=T>>>13,w=0|a[6],C=8191&w,I=w>>>13,P=0|a[7],L=8191&P,R=P>>>13,D=0|a[8],U=8191&D,j=D>>>13,k=0|a[9],x=8191&k,B=k>>>13,F=0|c[0],V=8191&F,Y=F>>>13,G=0|c[1],H=8191&G,q=G>>>13,z=0|c[2],K=8191&z,W=z>>>13,X=0|c[3],J=8191&X,Q=X>>>13,$=0|c[4],Z=8191&$,ee=$>>>13,te=0|c[5],ne=8191&te,re=te>>>13,ie=0|c[6],oe=8191&ie,ae=ie>>>13,ce=0|c[7],se=8191&ce,ue=ce>>>13,fe=0|c[8],le=8191&fe,he=fe>>>13,de=0|c[9],pe=8191&de,be=de>>>13;n.negative=e.negative^t.negative,n.length=19;var _e=(u+(r=Math.imul(l,V))|0)+((8191&(i=(i=Math.imul(l,Y))+Math.imul(h,V)|0))<<13)|0;u=((o=Math.imul(h,Y))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(p,V),i=(i=Math.imul(p,Y))+Math.imul(b,V)|0,o=Math.imul(b,Y);var Ee=(u+(r=r+Math.imul(l,H)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(h,H)|0))<<13)|0;u=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(E,V),i=(i=Math.imul(E,Y))+Math.imul(y,V)|0,o=Math.imul(y,Y),r=r+Math.imul(p,H)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,q)|0;var ye=(u+(r=r+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,W)|0)+Math.imul(h,K)|0))<<13)|0;u=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(g,V),i=(i=Math.imul(g,Y))+Math.imul(m,V)|0,o=Math.imul(m,Y),r=r+Math.imul(E,H)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(y,H)|0,o=o+Math.imul(y,q)|0,r=r+Math.imul(p,K)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0;var ve=(u+(r=r+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,Q)|0)+Math.imul(h,J)|0))<<13)|0;u=((o=o+Math.imul(h,Q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(A,V),i=(i=Math.imul(A,Y))+Math.imul(O,V)|0,o=Math.imul(O,Y),r=r+Math.imul(g,H)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,q)|0,r=r+Math.imul(E,K)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,W)|0,r=r+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,Q)|0;var ge=(u+(r=r+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(h,Z)|0))<<13)|0;u=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(N,V),i=(i=Math.imul(N,Y))+Math.imul(M,V)|0,o=Math.imul(M,Y),r=r+Math.imul(A,H)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,q)|0,r=r+Math.imul(g,K)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,Q)|0,r=r+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,ee)|0;var me=(u+(r=r+Math.imul(l,ne)|0)|0)+((8191&(i=(i=i+Math.imul(l,re)|0)+Math.imul(h,ne)|0))<<13)|0;u=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(C,V),i=(i=Math.imul(C,Y))+Math.imul(I,V)|0,o=Math.imul(I,Y),r=r+Math.imul(N,H)|0,i=(i=i+Math.imul(N,q)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(A,K)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Q)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,Q)|0,r=r+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(b,ne)|0,o=o+Math.imul(b,re)|0;var Se=(u+(r=r+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ae)|0)+Math.imul(h,oe)|0))<<13)|0;u=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,V),i=(i=Math.imul(L,Y))+Math.imul(R,V)|0,o=Math.imul(R,Y),r=r+Math.imul(C,H)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,q)|0,r=r+Math.imul(N,K)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,W)|0,r=r+Math.imul(A,J)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Q)|0,r=r+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Ae=(u+(r=r+Math.imul(l,se)|0)|0)+((8191&(i=(i=i+Math.imul(l,ue)|0)+Math.imul(h,se)|0))<<13)|0;u=((o=o+Math.imul(h,ue)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(U,V),i=(i=Math.imul(U,Y))+Math.imul(j,V)|0,o=Math.imul(j,Y),r=r+Math.imul(L,H)|0,i=(i=i+Math.imul(L,q)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,q)|0,r=r+Math.imul(C,K)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,W)|0,r=r+Math.imul(N,J)|0,i=(i=i+Math.imul(N,Q)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,Q)|0,r=r+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(p,se)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,se)|0,o=o+Math.imul(b,ue)|0;var Oe=(u+(r=r+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,he)|0)+Math.imul(h,le)|0))<<13)|0;u=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(x,V),i=(i=Math.imul(x,Y))+Math.imul(B,V)|0,o=Math.imul(B,Y),r=r+Math.imul(U,H)|0,i=(i=i+Math.imul(U,q)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,q)|0,r=r+Math.imul(L,K)|0,i=(i=i+Math.imul(L,W)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,W)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,Q)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,Q)|0,r=r+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(A,ne)|0,i=(i=i+Math.imul(A,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0,r=r+Math.imul(E,se)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(y,se)|0,o=o+Math.imul(y,ue)|0,r=r+Math.imul(p,le)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,he)|0;var Te=(u+(r=r+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,be)|0)+Math.imul(h,pe)|0))<<13)|0;u=((o=o+Math.imul(h,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(x,H),i=(i=Math.imul(x,q))+Math.imul(B,H)|0,o=Math.imul(B,q),r=r+Math.imul(U,K)|0,i=(i=i+Math.imul(U,W)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,W)|0,r=r+Math.imul(L,J)|0,i=(i=i+Math.imul(L,Q)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,Q)|0,r=r+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,ee)|0,r=r+Math.imul(N,ne)|0,i=(i=i+Math.imul(N,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,r=r+Math.imul(g,se)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(m,se)|0,o=o+Math.imul(m,ue)|0,r=r+Math.imul(E,le)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,he)|0;var Ne=(u+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(x,K),i=(i=Math.imul(x,W))+Math.imul(B,K)|0,o=Math.imul(B,W),r=r+Math.imul(U,J)|0,i=(i=i+Math.imul(U,Q)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,Q)|0,r=r+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(I,ne)|0,o=o+Math.imul(I,re)|0,r=r+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(A,se)|0,i=(i=i+Math.imul(A,ue)|0)+Math.imul(O,se)|0,o=o+Math.imul(O,ue)|0,r=r+Math.imul(g,le)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,he)|0;var Me=(u+(r=r+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(y,pe)|0))<<13)|0;u=((o=o+Math.imul(y,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,J),i=(i=Math.imul(x,Q))+Math.imul(B,J)|0,o=Math.imul(B,Q),r=r+Math.imul(U,Z)|0,i=(i=i+Math.imul(U,ee)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,ee)|0,r=r+Math.imul(L,ne)|0,i=(i=i+Math.imul(L,re)|0)+Math.imul(R,ne)|0,o=o+Math.imul(R,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,r=r+Math.imul(N,se)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(M,se)|0,o=o+Math.imul(M,ue)|0,r=r+Math.imul(A,le)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(O,le)|0,o=o+Math.imul(O,he)|0;var we=(u+(r=r+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,be)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(x,Z),i=(i=Math.imul(x,ee))+Math.imul(B,Z)|0,o=Math.imul(B,ee),r=r+Math.imul(U,ne)|0,i=(i=i+Math.imul(U,re)|0)+Math.imul(j,ne)|0,o=o+Math.imul(j,re)|0,r=r+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,r=r+Math.imul(C,se)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(I,se)|0,o=o+Math.imul(I,ue)|0,r=r+Math.imul(N,le)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(M,le)|0,o=o+Math.imul(M,he)|0;var Ce=(u+(r=r+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,be)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(x,ne),i=(i=Math.imul(x,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(U,oe)|0,i=(i=i+Math.imul(U,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,r=r+Math.imul(L,se)|0,i=(i=i+Math.imul(L,ue)|0)+Math.imul(R,se)|0,o=o+Math.imul(R,ue)|0,r=r+Math.imul(C,le)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(I,le)|0,o=o+Math.imul(I,he)|0;var Ie=(u+(r=r+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,be)|0)+Math.imul(M,pe)|0))<<13)|0;u=((o=o+Math.imul(M,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(x,oe),i=(i=Math.imul(x,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(U,se)|0,i=(i=i+Math.imul(U,ue)|0)+Math.imul(j,se)|0,o=o+Math.imul(j,ue)|0,r=r+Math.imul(L,le)|0,i=(i=i+Math.imul(L,he)|0)+Math.imul(R,le)|0,o=o+Math.imul(R,he)|0;var Pe=(u+(r=r+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(x,se),i=(i=Math.imul(x,ue))+Math.imul(B,se)|0,o=Math.imul(B,ue),r=r+Math.imul(U,le)|0,i=(i=i+Math.imul(U,he)|0)+Math.imul(j,le)|0,o=o+Math.imul(j,he)|0;var Le=(u+(r=r+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,be)|0)+Math.imul(R,pe)|0))<<13)|0;u=((o=o+Math.imul(R,be)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(x,le),i=(i=Math.imul(x,he))+Math.imul(B,le)|0,o=Math.imul(B,he);var Re=(u+(r=r+Math.imul(U,pe)|0)|0)+((8191&(i=(i=i+Math.imul(U,be)|0)+Math.imul(j,pe)|0))<<13)|0;u=((o=o+Math.imul(j,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var De=(u+(r=Math.imul(x,pe))|0)+((8191&(i=(i=Math.imul(x,be))+Math.imul(B,pe)|0))<<13)|0;return u=((o=Math.imul(B,be))+(i>>>13)|0)+(De>>>26)|0,De&=67108863,s[0]=_e,s[1]=Ee,s[2]=ye,s[3]=ve,s[4]=ge,s[5]=me,s[6]=Se,s[7]=Ae,s[8]=Oe,s[9]=Te,s[10]=Ne,s[11]=Me,s[12]=we,s[13]=Ce,s[14]=Ie,s[15]=Pe,s[16]=Le,s[17]=Re,s[18]=De,0!==u&&(s[19]=u,n.length++),n};function c(e,t,n){return(new s).mulp(e,t,n)}function s(e,t){this.x=e,this.y=t}Math.imul||(o=i),E.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?o(this,e,t):n<63?i(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=c,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):c(this,e,t)},s.prototype.makeRBT=function(e){for(var t=new Array(e),n=E.prototype._countBits(e)-1,r=0;r>=1;return r},s.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,t+=r/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},E.prototype.muln=function(e){return this.clone().imuln(e)},E.prototype.sqr=function(){return this.mul(this)},E.prototype.isqr=function(){return this.imul(this.clone())},E.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i}return t}(e);if(0===t.length)return new E(1);for(var n=this,r=0;r>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==r){for(t=this.length-1;0<=t;t--)this.words[t+r]=this.words[t];for(t=0;t>>i<o)for(this.length-=o,s=0;s>>i,u=f&a}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},E.prototype.ishrn=function(e,t,n){return _(0===this.negative),this.iushrn(e,t,n)},E.prototype.shln=function(e){return this.clone().ishln(e)},E.prototype.ushln=function(e){return this.clone().iushln(e)},E.prototype.shrn=function(e){return this.clone().ishrn(e)},E.prototype.ushrn=function(e){return this.clone().iushrn(e)},E.prototype.testn=function(e){_("number"==typeof e&&0<=e);var t=e%26,n=(e-t)/26,r=1<>>t<>26)-(c/67108864|0),this.words[r+n]=67108863&i}for(;r>26,this.words[r+n]=67108863&i;if(0===a)return this.strip();for(_(-1===a),r=a=0;r>26,this.words[r]=67108863&i;return this.negative=1,this.strip()},E.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,o=0|i.words[i.length-1];0!==(n=26-this._countBits(o))&&(i=i.ushln(n),r.iushln(n),o=0|i.words[i.length-1]);var a,c=r.length-i.length;if("mod"!==t){(a=new E(null)).length=c+1,a.words=new Array(a.length);for(var s=0;sthis.length||this.cmp(e)<0?{div:new E(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new E(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new E(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,i,o},E.prototype.div=function(e){return this.divmod(e,"div",!1).div},E.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},E.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},E.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},E.prototype.modn=function(e){_(e<=67108863);for(var t=(1<<26)%e,n=0,r=this.length-1;0<=r;r--)n=(t*n+(0|this.words[r]))%e;return n},E.prototype.idivn=function(e){_(e<=67108863);for(var t=0,n=this.length-1;0<=n;n--){var r=(0|this.words[n])+67108864*t;this.words[n]=r/e|0,t=r%e}return this.strip()},E.prototype.divn=function(e){return this.clone().idivn(e)},E.prototype.egcd=function(e){_(0===e.negative),_(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new E(1),i=new E(0),o=new E(0),a=new E(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var s=n.clone(),u=t.clone();!t.isZero();){for(var f=0,l=1;0==(t.words[0]&l)&&f<26;++f,l<<=1);if(0>>26,a&=67108863,this.words[o]=a}return 0!==i&&(this.words[o]=i,this.length++),this},E.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},E.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),1e.length)return 1;if(this.lengththis.n;);var r=t>>22,i=o}i>>>=22,0===(e.words[r-10]=i)&&10>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},E._prime=function(e){if(u[e])return u[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new y;else if("p192"===e)t=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new g}return u[e]=t},m.prototype._verify1=function(e){_(0===e.negative,"red works only with positives"),_(e.red,"red works only with red numbers")},m.prototype._verify2=function(e,t){_(0==(e.negative|t.negative),"red works only with positives"),_(e.red&&e.red===t.red,"red works only with red numbers")},m.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},m.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},m.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return 0<=n.cmp(this.m)&&n.isub(this.m),n._forceRed(this)},m.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return 0<=n.cmp(this.m)&&n.isub(this.m),n},m.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},m.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},m.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},m.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},m.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},m.prototype.isqr=function(e){return this.imul(e,e.clone())},m.prototype.sqr=function(e){return this.mul(e,e)},m.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(_(t%2==1),3===t){var n=this.m.add(new E(1)).iushrn(2);return this.pow(e,n)}for(var r=this.m.subn(1),i=0;!r.isZero()&&0===r.andln(1);)i++,r.iushrn(1);_(!r.isZero());var o=new E(1).toRed(this),a=o.redNeg(),c=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new E(2*s*s).toRed(this);0!==this.pow(s,c).cmp(a);)s.redIAdd(a);for(var u=this.pow(s,r),f=this.pow(e,r.addn(1).iushrn(1)),l=this.pow(e,r),h=i;0!==l.cmp(o);){for(var d=l,p=0;0!==d.cmp(o);p++)d=d.redSqr();_(p>u&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++a||0===r&&0===u)&&(i=this.mul(i,n[o]),o=a=0)):a=0}c=26}return i},m.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},m.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},E.mont=function(e){return new S(e)},n(S,m),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new E(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,A(184)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NAMED_TAG="named",t.NAME_TAG="name",t.UNMANAGED_TAG="unmanaged",t.OPTIONAL_TAG="optional",t.INJECT_TAG="inject",t.MULTI_INJECT_TAG="multi_inject",t.TAGGED="inversify:tagged",t.TAGGED_PROP="inversify:tagged_props",t.PARAM_TYPES="inversify:paramtypes",t.DESIGN_PARAM_TYPES="design:paramtypes",t.POST_CONSTRUCT="post_construct"},function(e,t,n){"use strict";var r=t;r.version=n(191).version,r.utils=n(192),r.rand=n(90),r.curve=n(39),r.curves=n(197),r.ec=n(205),r.eddsa=n(209)},function(e,t,n){e.exports=function(){"use strict";var s="millisecond",d="second",p="minute",b="hour",_="day",E="week",y="month",u="quarter",v="year",i=/^(\d{4})-?(\d{1,2})-?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/,g=/\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,o=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},e={s:o,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+o(r,2,"0")+":"+o(i,2,"0")},m:function(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,y),i=t-r<0,o=e.clone().add(n+(i?-1:1),y);return Number(-(n+(t-r)/(i?r-o:o-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:y,y:v,w:E,d:_,h:b,m:p,s:d,ms:s,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},t={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},a="en",c={};c[a]=t;var f=function(e){return e instanceof h},r=function(e,t,n){var r;if(!e)return a;if("string"==typeof e)c[e]&&(r=e),t&&(c[e]=t,r=e);else{var i=e.name;c[i]=e,r=i}return n||(a=r),r},l=function(e,t,n){if(f(e))return e.clone();var r=t?"string"==typeof t?{format:t,pl:n}:t:{};return r.date=e,new h(r)},m=e;m.l=r,m.i=f,m.w=function(e,t){return l(e,{locale:t.$L,utc:t.$u,$offset:t.$offset})};var h=function(){function e(e){this.$L=this.$L||r(e.locale,null,!0),this.parse(e)}var t=e.prototype;return t.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(m.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(i);if(r)return n?new Date(Date.UTC(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)):new Date(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)}return new Date(t)}(e),this.init()},t.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},t.$utils=function(){return m},t.isValid=function(){return!("Invalid Date"===this.$d.toString())},t.isSame=function(e,t){var n=l(e);return this.startOf(t)<=n&&n<=this.endOf(t)},t.isAfter=function(e,t){return l(e)= than the number of constructor arguments of its base class."},t.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",t.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",t.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",t.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",t.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",t.POST_CONSTRUCT_ERROR=function(){for(var e=[],t=0;tt.size())return!1;var n=!0;return this.forEach(function(e){return!!t.contains(e)||(n=!1)}),n},e.prototype.remove=function(e){return!!this.contains(e)&&(this.dictionary.remove(e),!0)},e.prototype.forEach=function(n){this.dictionary.forEach(function(e,t){return n(t)})},e.prototype.toArray=function(){return this.dictionary.values()},e.prototype.isEmpty=function(){return this.dictionary.isEmpty()},e.prototype.size=function(){return this.dictionary.size()},e.prototype.clear=function(){this.dictionary.clear()},e.prototype.toString=function(){return i.toString(this.toArray())},e}();t.default=a},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],f=!1,l=-1;function h(){f&&s&&(f=!1,s.length?u=s.concat(u):l=-1,u.length&&d())}function d(){if(!f){var e=c(h);f=!0;for(var t=u.length;t;){for(s=u,u=[];++l>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function i(e){return 1===e.length?"0"+e:e}function a(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=r,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n,r,i=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a>6|192:(r=a,55296!=(64512&(n=e).charCodeAt(r))||r<0||r+1>=n.length||56320!=(64512&n.charCodeAt(r+1))?i[o++]=c>>12|224:(c=65536+((1023&c)<<10)+(1023&e.charCodeAt(++a)),i[o++]=c>>18|240,i[o++]=c>>12&63|128),c>>6&63|128),63&c|128)}else for(a=0;a>>0}return o},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},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,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,i){return e+t+n+r+i>>>0},t.sum64=function(e,t,n,r){var i=e[t],o=r+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,n,r){return(t+r>>>0>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,i,o,a,c){var s=0,u=t;return s+=(u=u+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,n,r,i,o,a,c){return t+r+o+c>>>0},t.sum64_5_hi=function(e,t,n,r,i,o,a,c,s,u){var f=0,l=t;return f+=(l=l+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,n,r,i,o,a,c,s,u){return t+r+o+c+u>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n=Object.prototype.hasOwnProperty;function r(e){return"function"==typeof e}function a(e){return void 0===e}function c(e){return"[object String]"===Object.prototype.toString.call(e)}o.has=function(e,t){return n.call(e,t)},o.defaultCompare=function(e,t){return e=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=r},function(e,t,n){var r,i,o,a,c,s,l,u;e.exports=(r=n(109),o=(i=r).lib,a=o.WordArray,c=o.Hasher,s=i.algo,l=[],u=s.SHA1=c.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],c=n[4],s=0;s<80;s++){if(s<16)l[s]=0|e[t+s];else{var u=l[s-3]^l[s-8]^l[s-14]^l[s-16];l[s]=u<<1|u>>>31}var f=(r<<5|r>>>27)+c+l[s];f+=s<20?1518500249+(i&o|~i&a):s<40?1859775393+(i^o^a):s<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,c=a,a=o,o=i<<30|i>>>2,i=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=c.clone.call(this);return e._hash=this._hash.clone(),e}}),i.SHA1=c._createHelper(u),i.HmacSHA1=c._createHmacHelper(u),r.SHA1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10);function i(e){return"function"!=typeof e?"symbol"==typeof e?e.toString():e:e.name}function o(e){if(e.name)return e.name;var t=e.toString(),n=t.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+t}t.getServiceIdentifierAsString=i,t.listRegisteredBindingsForServiceIdentifier=function(e,t,n){var r="",i=n(e,t);return 0!==i.length&&(r="\nRegistered bindings:",i.forEach(function(e){var t="Object";null!==e.implementationType&&(t=o(e.implementationType)),r=r+"\n "+t,e.constraint.metaData&&(r=r+" - "+e.constraint.metaData)})),r},t.circularDependencyToException=function n(e){e.childRequests.forEach(function(e){if(function e(t,n){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===n||e(t.parentRequest,n))}(e,e.serviceIdentifier)){var t=function e(t,n){void 0===n&&(n=[]);var r=i(t.serviceIdentifier);return n.push(r),null!==t.parentRequest?e(t.parentRequest,n):n}(e).reverse().join(" --\x3e ");throw new Error(r.CIRCULAR_DEPENDENCY+" "+t)}n(e)})},t.listMetadataForTarget=function(e,t){if(t.isTagged()||t.isNamed()){var n="",r=t.getNamedTag(),i=t.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach(function(e){n+=e.toString()+"\n"})," "+e+"\n "+e+" - "+n}return" "+e},t.getFunctionName=o},function(e,n,t){(function(e){function t(e){return Object.prototype.toString.call(e)}n.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},n.isBoolean=function(e){return"boolean"==typeof e},n.isNull=function(e){return null===e},n.isNullOrUndefined=function(e){return null==e},n.isNumber=function(e){return"number"==typeof e},n.isString=function(e){return"string"==typeof e},n.isSymbol=function(e){return"symbol"==typeof e},n.isUndefined=function(e){return void 0===e},n.isRegExp=function(e){return"[object RegExp]"===t(e)},n.isObject=function(e){return"object"==typeof e&&null!==e},n.isDate=function(e){return"[object Date]"===t(e)},n.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},n.isFunction=function(e){return"function"==typeof e},n.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},n.isBuffer=e.isBuffer}).call(this,t(5).Buffer)},function(e,t,n){"use strict";var r=n(4),i=n(49),o=n(50),a=n(51),c=n(21);function s(e){c.call(this,"digest"),this._hash=e}r(s,c),s.prototype._update=function(e){this._hash.update(e)},s.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new s(a(e))}},function(e,t,n){(function(o){e.exports=function(e,t){for(var n=Math.min(e.length,t.length),r=new o(n),i=0;i=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-n,this.endian);for(var r=0;r>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o>>24]^f[p>>>16&255]^l[b>>>8&255]^h[255&_]^t[E++],a=u[p>>>24]^f[b>>>16&255]^l[_>>>8&255]^h[255&d]^t[E++],c=u[b>>>24]^f[_>>>16&255]^l[d>>>8&255]^h[255&p]^t[E++],s=u[_>>>24]^f[d>>>16&255]^l[p>>>8&255]^h[255&b]^t[E++],d=o,p=a,b=c,_=s;return o=(r[d>>>24]<<24|r[p>>>16&255]<<16|r[b>>>8&255]<<8|r[255&_])^t[E++],a=(r[p>>>24]<<24|r[b>>>16&255]<<16|r[_>>>8&255]<<8|r[255&d])^t[E++],c=(r[b>>>24]<<24|r[_>>>16&255]<<16|r[d>>>8&255]<<8|r[255&p])^t[E++],s=(r[_>>>24]<<24|r[d>>>16&255]<<16|r[p>>>8&255]<<8|r[255&b])^t[E++],[o>>>=0,a>>>=0,c>>>=0,s>>>=0]}var l=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=[],r=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,c=0,s=0;s<256;++s){var u=c^c<<1^c<<2^c<<3^c<<4;u=u>>>8^255&u^99;var f=e[r[n[a]=u]=a],l=e[f],h=e[l],d=257*e[u]^16843008*u;i[0][a]=d<<24|d>>>8,i[1][a]=d<<16|d>>>16,i[2][a]=d<<8|d>>>24,i[3][a]=d,d=16843009*h^65537*l^257*f^16843008*a,o[0][u]=d<<24|d>>>8,o[1][u]=d<<16|d>>>16,o[2][u]=d<<8|d>>>24,o[3][u]=d,0===a?a=c=1:(a=f^e[e[e[h^f]]],c^=e[e[c]])}return{SBOX:n,INV_SBOX:r,SUB_MIX:i,INV_SUB_MIX:o}}();function c(e){this._key=o(e),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var e=this._key,t=e.length,n=t+6,r=4*(n+1),i=[],o=0;o>>24,a=h.SBOX[a>>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a],a^=l[o/t|0]<<24):6>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a]),i[o]=i[o-t]^a}for(var c=[],s=0;s>>24]]^h.INV_SUB_MIX[1][h.SBOX[f>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[f>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&f]]}this._nRounds=n,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(e){return a(e=o(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},c.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),n=i.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[1],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[3],12),n},c.prototype.decryptBlock=function(e){var t=(e=o(e))[1];e[1]=e[3],e[3]=t;var n=a(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),r=i.allocUnsafe(16);return r.writeUInt32BE(n[0],0),r.writeUInt32BE(n[3],4),r.writeUInt32BE(n[2],8),r.writeUInt32BE(n[1],12),r},c.prototype.scrub=function(){r(this._keySchedule),r(this._invKeySchedule),r(this._key)},e.exports.AES=c},function(e,t,n){var d=n(3).Buffer,p=n(49);e.exports=function(e,t,n,r){if(d.isBuffer(e)||(e=d.from(e,"binary")),t&&(d.isBuffer(t)||(t=d.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var i=n/8,o=d.alloc(i),a=d.alloc(r||0),c=d.alloc(0);0n&&(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.once=function(e,t){if(!s(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var n,r,i,o;if(!s(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||s(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(n)){for(o=i;0>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1>>32-t}function u(e,t,n,r,i,o,a){return s(e+(t&n|~t&r)+i+o|0,a)+t|0}function f(e,t,n,r,i,o,a){return s(e+(t&r|n&~r)+i+o|0,a)+t|0}function l(e,t,n,r,i,o,a){return s(e+(t^n^r)+i+o|0,a)+t|0}function h(e,t,n,r,i,o,a){return s(e+(n^(t|~r))+i+o|0,a)+t|0}r(c,i),c.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,r=this._b,i=this._c,o=this._d;r=h(r=h(r=h(r=h(r=l(r=l(r=l(r=l(r=f(r=f(r=f(r=f(r=u(r=u(r=u(r=u(r,i=u(i,o=u(o,n=u(n,r,i,o,e[0],3614090360,7),r,i,e[1],3905402710,12),n,r,e[2],606105819,17),o,n,e[3],3250441966,22),i=u(i,o=u(o,n=u(n,r,i,o,e[4],4118548399,7),r,i,e[5],1200080426,12),n,r,e[6],2821735955,17),o,n,e[7],4249261313,22),i=u(i,o=u(o,n=u(n,r,i,o,e[8],1770035416,7),r,i,e[9],2336552879,12),n,r,e[10],4294925233,17),o,n,e[11],2304563134,22),i=u(i,o=u(o,n=u(n,r,i,o,e[12],1804603682,7),r,i,e[13],4254626195,12),n,r,e[14],2792965006,17),o,n,e[15],1236535329,22),i=f(i,o=f(o,n=f(n,r,i,o,e[1],4129170786,5),r,i,e[6],3225465664,9),n,r,e[11],643717713,14),o,n,e[0],3921069994,20),i=f(i,o=f(o,n=f(n,r,i,o,e[5],3593408605,5),r,i,e[10],38016083,9),n,r,e[15],3634488961,14),o,n,e[4],3889429448,20),i=f(i,o=f(o,n=f(n,r,i,o,e[9],568446438,5),r,i,e[14],3275163606,9),n,r,e[3],4107603335,14),o,n,e[8],1163531501,20),i=f(i,o=f(o,n=f(n,r,i,o,e[13],2850285829,5),r,i,e[2],4243563512,9),n,r,e[7],1735328473,14),o,n,e[12],2368359562,20),i=l(i,o=l(o,n=l(n,r,i,o,e[5],4294588738,4),r,i,e[8],2272392833,11),n,r,e[11],1839030562,16),o,n,e[14],4259657740,23),i=l(i,o=l(o,n=l(n,r,i,o,e[1],2763975236,4),r,i,e[4],1272893353,11),n,r,e[7],4139469664,16),o,n,e[10],3200236656,23),i=l(i,o=l(o,n=l(n,r,i,o,e[13],681279174,4),r,i,e[0],3936430074,11),n,r,e[3],3572445317,16),o,n,e[6],76029189,23),i=l(i,o=l(o,n=l(n,r,i,o,e[9],3654602809,4),r,i,e[12],3873151461,11),n,r,e[15],530742520,16),o,n,e[2],3299628645,23),i=h(i,o=h(o,n=h(n,r,i,o,e[0],4096336452,6),r,i,e[7],1126891415,10),n,r,e[14],2878612391,15),o,n,e[5],4237533241,21),i=h(i,o=h(o,n=h(n,r,i,o,e[12],1700485571,6),r,i,e[3],2399980690,10),n,r,e[10],4293915773,15),o,n,e[1],2240044497,21),i=h(i,o=h(o,n=h(n,r,i,o,e[8],1873313359,6),r,i,e[15],4264355552,10),n,r,e[6],2734768916,15),o,n,e[13],1309151649,21),i=h(i,o=h(o,n=h(n,r,i,o,e[4],4149444226,6),r,i,e[11],3174756917,10),n,r,e[2],718787259,15),o,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+i|0,this._d=this._d+o|0},c.prototype._digest=function(){this._block[this._blockOffset++]=128,56>>32-t}function O(e,t,n,r,i,o,a,c){return A(e+(t^n^r)+o+a|0,c)+i|0}function T(e,t,n,r,i,o,a,c){return A(e+(t&n|~t&r)+o+a|0,c)+i|0}function N(e,t,n,r,i,o,a,c){return A(e+((t|~n)^r)+o+a|0,c)+i|0}function M(e,t,n,r,i,o,a,c){return A(e+(t&r|n&~r)+o+a|0,c)+i|0}function w(e,t,n,r,i,o,a,c){return A(e+(t^(n|~r))+o+a|0,c)+i|0}i(a,o),a.prototype._update=function(){for(var e=_,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,c=0|this._a,s=0|this._b,u=0|this._c,f=0|this._d,l=0|this._e,h=0;h<80;h+=1){var d,p;p=h<16?(d=O(n,r,i,o,a,e[E[h]],m[0],v[h]),w(c,s,u,f,l,e[y[h]],S[0],g[h])):h<32?(d=T(n,r,i,o,a,e[E[h]],m[1],v[h]),M(c,s,u,f,l,e[y[h]],S[1],g[h])):h<48?(d=N(n,r,i,o,a,e[E[h]],m[2],v[h]),N(c,s,u,f,l,e[y[h]],S[2],g[h])):h<64?(d=M(n,r,i,o,a,e[E[h]],m[3],v[h]),T(c,s,u,f,l,e[y[h]],S[3],g[h])):(d=w(n,r,i,o,a,e[E[h]],m[4],v[h]),O(c,s,u,f,l,e[y[h]],S[4],g[h])),n=a,a=o,o=A(i,10),i=r,r=d,c=l,l=f,f=A(u,10),u=s,s=p}var b=this._b+i+f|0;this._b=this._c+o+l|0,this._c=this._d+a+c|0,this._d=this._e+n+s|0,this._e=this._a+r+u|0,this._a=b},a.prototype._digest=function(){this._block[this._blockOffset++]=128,56t.highWaterMark&&(t.highWaterMark=(b<=(n=e)?n=b:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var n}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(g("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?E.nextTick(A,e):A(e))}function A(e){g("emit readable"),e.emit("readable"),w(e)}function O(e,t){t.readingMore||(t.readingMore=!0,E.nextTick(T,e,t))}function T(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n).data=o.slice(a);break}++r}return t.length-=r,i}(e,t):function(e,t){var n=u.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0===(e-=a)){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=o.slice(a);break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function I(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return g("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):S(this),null;if(0===(e=m(e,t))&&t.ended)return 0===t.length&&I(this),null;var r,i=t.needReadable;return g("need readable",i),(0===t.length||t.length-e=this._blockSize;){for(var i=this._blockOffset;i>>17|n<<15)^(n>>>19|n<<13)^n>>>10)+s[E-7]+(((t=s[E-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+s[E-16];for(var y=0;y<64;++y){var v=_+(((c=d)>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+((a=b)^d&(p^a))+m[y]+s[y]|0,g=0|(((o=u)>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+((r=u)&(i=f)|l&(r|i));_=b,b=p,p=d,d=h+v|0,h=l,l=f,f=u,u=v+g|0}this._a=u+this._a|0,this._b=f+this._b|0,this._c=l+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=_+this._h|0},c.prototype._hash=function(){var e=o.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,n){var r=n(4),i=n(26),o=n(3).Buffer,ee=[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],a=new Array(160);function c(){this.init(),this._w=a,i.call(this,128,112)}function te(e,t,n){return n^e&(t^n)}function ne(e,t,n){return e&t|n&(e|t)}function re(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ie(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function oe(e,t){return e>>>0>>0?1:0}r(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,n,r,i,o,a,c,s,u=this._w,f=0|this._ah,l=0|this._bh,h=0|this._ch,d=0|this._dh,p=0|this._eh,b=0|this._fh,_=0|this._gh,E=0|this._hh,y=0|this._al,v=0|this._bl,g=0|this._cl,m=0|this._dl,S=0|this._el,A=0|this._fl,O=0|this._gl,T=0|this._hl,N=0;N<32;N+=2)u[N]=e.readInt32BE(4*N),u[N+1]=e.readInt32BE(4*N+4);for(;N<160;N+=2){var M=u[N-30],w=u[N-30+1],C=((c=M)>>>1|(s=w)<<31)^(c>>>8|s<<24)^c>>>7,I=((o=w)>>>1|(a=M)<<31)^(o>>>8|a<<24)^(o>>>7|a<<25);M=u[N-4],w=u[N-4+1];var P=((r=M)>>>19|(i=w)<<13)^(i>>>29|r<<3)^r>>>6,L=((t=w)>>>19|(n=M)<<13)^(n>>>29|t<<3)^(t>>>6|n<<26),R=u[N-14],D=u[N-14+1],U=u[N-32],j=u[N-32+1],k=I+D|0,x=C+R+oe(k,I)|0;x=(x=x+P+oe(k=k+L|0,L)|0)+U+oe(k=k+j|0,j)|0,u[N]=x,u[N+1]=k}for(var B=0;B<160;B+=2){x=u[B],k=u[B+1];var F=ne(f,l,h),V=ne(y,v,g),Y=re(f,y),G=re(y,f),H=ie(p,S),q=ie(S,p),z=ee[B],K=ee[B+1],W=te(p,b,_),X=te(S,A,O),J=T+q|0,Q=E+H+oe(J,T)|0;Q=(Q=(Q=Q+W+oe(J=J+X|0,X)|0)+z+oe(J=J+K|0,K)|0)+x+oe(J=J+k|0,k)|0;var $=G+V|0,Z=Y+F+oe($,G)|0;E=_,T=O,_=b,O=A,b=p,A=S,p=d+Q+oe(S=m+J|0,m)|0,d=h,m=g,h=l,g=v,l=f,v=y,f=Q+Z+oe(y=J+$|0,J)|0}this._al=this._al+y|0,this._bl=this._bl+v|0,this._cl=this._cl+g|0,this._dl=this._dl+m|0,this._el=this._el+S|0,this._fl=this._fl+A|0,this._gl=this._gl+O|0,this._hl=this._hl+T|0,this._ah=this._ah+f+oe(this._al,y)|0,this._bh=this._bh+l+oe(this._bl,v)|0,this._ch=this._ch+h+oe(this._cl,g)|0,this._dh=this._dh+d+oe(this._dl,m)|0,this._eh=this._eh+p+oe(this._el,S)|0,this._fh=this._fh+b+oe(this._fl,A)|0,this._gh=this._gh+_+oe(this._gl,O)|0,this._hh=this._hh+E+oe(this._hl,T)|0},c.prototype._hash=function(){var r=o.allocUnsafe(64);function e(e,t,n){r.writeInt32BE(e,n),r.writeInt32BE(t,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),r},e.exports=c},function(e,t,n){"use strict";var r=n(4),i=n(163),a=n(21),c=n(3).Buffer,o=n(77),s=n(50),u=n(51),f=c.alloc(128);function l(e,t){a.call(this,"digest"),"string"==typeof t&&(t=c.from(t));var n="sha512"===e||"sha384"===e?128:64;(this._alg=e,(this._key=t).length>n)?t=("rmd160"===e?new s:u(e)).update(t).digest():t.lengtho?t=i(t):t.lengthe;)n.ishrn(1);if(n.isEven()&&n.iadd(s),n.testn(1)||n.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;n.mod(l).cmp(h);)n.iadd(p)}else for(;n.mod(a).cmp(d);)n.iadd(p);if(_(r=n.shrn(1))&&_(n)&&E(r)&&E(n)&&c.test(r)&&c.test(n))return n}}},function(e,t,n){var d=n(6),r=n(90);function i(e){this.rand=e||new r.Rand}(e.exports=i).create=function(e){return new i(e)},i.prototype._randbelow=function(e){var t=e.bitLength(),n=Math.ceil(t/8);do{var r=new d(this.rand.generate(n))}while(0<=r.cmp(e));return r},i.prototype._randrange=function(e,t){var n=t.sub(e);return e.add(this._randbelow(n))},i.prototype.test=function(e,t,n){var r=e.bitLength(),i=d.mont(e),o=new d(1).toRed(i);t||(t=Math.max(1,r/48|0));for(var a=e.subn(1),c=0;!a.testn(c);c++);for(var s=e.shrn(c),u=a.toRed(i);0>8,a=255&i;o?n.push(o,a):n.push(a)}return n},r.zero2=i,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,n){"use strict";var r=n(17).rotr32;function i(e,t,n){return e&t^~e&n}function o(e,t,n){return e&t^e&n^t&n}function a(e,t,n){return e^t^n}t.ft_1=function(e,t,n,r){return 0===e?i(t,n,r):1===e||3===e?a(t,n,r):2===e?o(t,n,r):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return r(e,2)^r(e,13)^r(e,22)},t.s1_256=function(e){return r(e,6)^r(e,11)^r(e,25)},t.g0_256=function(e){return r(e,7)^r(e,18)^e>>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},function(e,t,n){"use strict";var r=n(17),i=n(32),o=n(92),p=n(11),b=r.sum32,_=r.sum32_4,E=r.sum32_5,y=o.ch32,v=o.maj32,g=o.s0_256,m=o.s1_256,S=o.g0_256,A=o.g1_256,a=i.BlockHash,c=[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];function s(){if(!(this instanceof s))return new s;a.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=c,this.W=new Array(64)}r.inherits(s,a),(e.exports=s).blockSize=512,s.outSize=256,s.hmacStrength=192,s.padLength=64,s.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r>6],i=0==(32&n);if(31==(31&n)){var o=n;for(n=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;n<<=7,n|=127&o}}else n&=31;return{cls:r,primitive:i,tag:n,tagStr:c.tag[n]}}function l(e,t,n){var r=e.readUInt8(n);if(e.isError(r))return r;if(!t&&128===r)return null;if(0==(128&r))return r;var i=127&r;if(4>=8)a++;(i=new u(2+a))[0]=o,i[1]=128|a;c=1+a;for(var s=r.length;0>=8)i[c]=255&s;return this._createEncoderBuffer([i,r])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var n=new u(2*e.length),r=0;r>=7)i++}var a=new u(i),c=a.length-1;for(r=e.length-1;0<=r;r--){o=e[r];for(a[c--]=127&o;0<(o>>=7);)a[c--]=128|127&o}return this._createEncoderBuffer(a)},c.prototype._encodeTime=function(e,t){var n,r=new Date(e);return"gentime"===t?n=[s(r.getFullYear()),s(r.getUTCMonth()+1),s(r.getUTCDate()),s(r.getUTCHours()),s(r.getUTCMinutes()),s(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?n=[s(r.getFullYear()%100),s(r.getUTCMonth()+1),s(r.getUTCDate()),s(r.getUTCHours()),s(r.getUTCMinutes()),s(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.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&&!u.isBuffer(e)){var n=e.toArray();!e.sign&&128&n[0]&&n.unshift(0),e=new u(n)}if(u.isBuffer(e)){var r=e.length;0===e.length&&r++;var i=new u(r);return e.copy(i),0===e.length&&(i[0]=0),this._createEncoderBuffer(i)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);r=1;for(var o=e;256<=o;o>>=8)r++;for(o=(i=new Array(r)).length-1;0<=o;o--)i[o]=255&e,e>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(new u(i))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,n){var r,i=this._baseState;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,n).join()),o.length!==i.defaultBuffer.length)return!1;for(r=0;r>6]+c[128|63&a]:a<55296||57344<=a?i+=c[224|a>>12]+c[128|a>>6&63]+c[128|63&a]:(o+=1,a=65536+((1023&a)<<10|1023&r.charCodeAt(o)),i+=c[240|a>>18]+c[128|a>>12&63]+c[128|a>>6&63]+c[128|63&a])}return i},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function r(n,i,o){if(!i)return n;if("object"!=typeof i){if(Array.isArray(n))n.push(i);else{if("object"!=typeof n)return[n,i];(o&&(o.plainObjects||o.allowPrototypes)||!a.call(Object.prototype,i))&&(n[i]=!0)}return n}if("object"!=typeof n)return[n].concat(i);var e=n;return Array.isArray(n)&&!Array.isArray(i)&&(e=s(n,o)),Array.isArray(n)&&Array.isArray(i)?(i.forEach(function(e,t){a.call(n,t)?n[t]&&"object"==typeof n[t]?n[t]=r(n[t],e,o):n.push(e):n[t]=e}),n):Object.keys(i).reduce(function(e,t){var n=i[t];return a.call(e,t)?e[t]=r(e[t],n,o):e[t]=n,e},e)}}},function(e,t,n){"use strict";var r=String.prototype.replace,i=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,i,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){var r,l,i,o,a,c,h,s,u,f,d,p,b;e.exports=(r=r||(l=Math,i=Object.create||function(){function n(){}return function(e){var t;return n.prototype=e,t=new n,n.prototype=null,t}}(),a=(o={}).lib={},c=a.Base={extend:function(e){var t=i(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).$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)}},h=a.WordArray=c.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,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(var o=0;o>>2]=n[o>>>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=l.ceil(t/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,n=[],r=function(t){var t=t,n=987654321,r=4294967295;return function(){var e=((n=36969*(65535&n)+(n>>16)&r)<<16)+(t=18e3*(65535&t)+(t>>16)&r)&r;return e/=4294967296,(e+=.5)*(.5>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new h.init(n,t/2)}},f=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new h.init(n,t)}},d=s.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)))}},p=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new h.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,n=t.words,r=t.sigBytes,i=this.blockSize,o=4*i,a=r/o,c=(a=e?l.ceil(a):l.max((0|a)-this._minBufferSize,0))*i,s=l.min(4*c,r);if(c){for(var u=0;u=e.length||n<0||n>=e.length)return!1;var r=e[t];return e[t]=e[n],e[n]=r,!0},t.toString=function(e){return"["+e.toString()+"]"},t.forEach=function(e,t){for(var n=0,r=e;n>>6:(t[o++]=n<65536?224|n>>>12:(t[o++]=240|n>>>18,128|n>>>12&63),128|n>>>6&63),128|63&n);return t},n.buf2binstring=function(e){return f(e,e.length)},n.binstring2buf=function(e){for(var t=new s.Buf8(e.length),n=0,r=t.length;n>10&1023,56320|1023&i)}return f(c,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0?t:0===n?t:n+u[e[n]]>t?n:t}},{"./common":1}],3:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){for(n-=a=2e3>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,r){var i=c,o=r+n;e^=-1;for(var a=r;a>>8^i[255&(e^t[a])];return-1^e}},{}],5:[function(e,t,n){"use strict";var u,h=e("../utils/common"),f=e("./trees"),d=e("./adler32"),p=e("./crc32"),r=e("./messages"),l=0,b=4,_=0,E=-2,s=-1,y=4,i=2,v=8,g=9,o=286,a=30,c=19,m=2*o+1,S=15,A=3,O=258,T=O+A+1,N=42,M=113,w=1,C=2,I=3,P=4;function L(e,t){return e.msg=r[t],t}function R(e){return(e<<1)-(4e.avail_out&&(n=e.avail_out),0!==n&&(h.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function j(e,t){f._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,U(e.strm)}function k(e,t){e.pending_buf[e.pending++]=t}function x(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function B(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,c=e.nice_match,s=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,u=e.window,f=e.w_mask,l=e.prev,h=e.strstart+O,d=u[o+a-1],p=u[o+a];e.prev_length>=e.good_match&&(i>>=2),c>e.lookahead&&(c=e.lookahead);do{if(u[(n=t)+a]===p&&u[n+a-1]===d&&u[n]===u[o]&&u[++n]===u[o+1]){o+=2,n++;do{}while(u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&os&&0!=--i);return a<=e.lookahead?a:e.lookahead}function F(e){var t,n,r,i,o,a,c,s,u,f,l=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=l+(l-T)){for(h.arraySet(e.window,e.window,l,l,0),e.match_start-=l,e.strstart-=l,e.block_start-=l,n=e.hash_size,t=n;r=e.head[--t],e.head[t]=l<=r?r-l:0,--n;);for(t=n=l;r=e.prev[--t],e.prev[t]=l<=r?r-l:0,--n;);i+=l}if(0===e.strm.avail_in)break;if(a=e.strm,c=e.window,s=e.strstart+e.lookahead,u=i,f=void 0,f=a.avail_in,u=A)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<=A&&(e.ins_h=(e.ins_h<=A)if(r=f._tr_tally(e,e.strstart-e.match_start,e.match_length-A),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=A){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=A&&(e.ins_h=(e.ins_h<=A&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-A,r=f._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-A),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<=A&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=A?(n=f._tr_tally(e,1,e.match_length-A),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=f._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(j(e,!1),0===e.strm.avail_out))return w}return e.insert=0,t===b?(j(e,!0),0===e.strm.avail_out?I:P):e.last_lit&&(j(e,!1),0===e.strm.avail_out)?w:C}function H(e,t){for(var n;;){if(0===e.lookahead&&(F(e),0===e.lookahead)){if(t===l)return w;break}if(e.match_length=0,n=f._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(j(e,!1),0===e.strm.avail_out))return w}return e.insert=0,t===b?(j(e,!0),0===e.strm.avail_out?I:P):e.last_lit&&(j(e,!1),0===e.strm.avail_out)?w:C}function q(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function z(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new h.Buf16(2*m),this.dyn_dtree=new h.Buf16(2*(2*a+1)),this.bl_tree=new h.Buf16(2*(2*c+1)),D(this.dyn_ltree),D(this.dyn_dtree),D(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new h.Buf16(S+1),this.heap=new h.Buf16(2*o+1),D(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new h.Buf16(2*o+1),D(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function K(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=i,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?N:M,e.adler=2===t.wrap?0:1,t.last_flush=l,f._tr_init(t),_):L(e,E)}function W(e){var t,n=K(e);return n===_&&((t=e.state).window_size=2*t.w_size,D(t.head),t.max_lazy_match=u[t.level].max_lazy,t.good_match=u[t.level].good_length,t.nice_match=u[t.level].nice_length,t.max_chain_length=u[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=A-1,t.match_available=0,t.ins_h=0),n}function X(e,t,n,r,i,o){if(!e)return E;var a=1;if(t===s&&(t=6),r<0?(a=0,r=-r):15e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(F(e),0===e.lookahead&&t===l)return w;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,j(e,!1),0===e.strm.avail_out))return w;if(e.strstart-e.block_start>=e.w_size-T&&(j(e,!1),0===e.strm.avail_out))return w}return e.insert=0,t===b?(j(e,!0),0===e.strm.avail_out?I:P):(e.strstart>e.block_start&&(j(e,!1),e.strm.avail_out),w)}),new q(4,4,8,4,V),new q(4,5,16,8,V),new q(4,6,32,32,V),new q(4,4,16,16,Y),new q(8,16,32,32,Y),new q(8,16,128,128,Y),new q(8,32,128,256,Y),new q(32,128,258,1024,Y),new q(32,258,258,4096,Y)],n.deflateInit=function(e,t){return X(e,t,v,15,8,0)},n.deflateInit2=X,n.deflateReset=W,n.deflateResetKeep=K,n.deflateSetHeader=function(e,t){return e&&e.state&&2===e.state.wrap?(e.state.gzhead=t,_):E},n.deflate=function(e,t){var n,r,i,o;if(!e||!e.state||5>8&255),k(r,r.gzhead.time>>16&255),k(r,r.gzhead.time>>24&255),k(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),k(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(k(r,255&r.gzhead.extra.length),k(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=p(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(k(r,0),k(r,0),k(r,0),k(r,0),k(r,0),k(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),k(r,3),r.status=M);else{var a=v+(r.w_bits-8<<4)<<8,c=-1;c=2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3,a|=c<<6,0!==r.strstart&&(a|=32),a+=31-a%31,r.status=M,x(r,a),0!==r.strstart&&(x(r,e.adler>>>16),x(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>i&&(e.adler=p(e.adler,r.pending_buf,r.pending-i,i)),U(e),i=r.pending,r.pending!==r.pending_buf_size));)k(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=p(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=p(e.adler,r.pending_buf,r.pending-i,i)),U(e),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindexi&&(e.adler=p(e.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=p(e.adler,r.pending_buf,r.pending-i,i)),U(e),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindexi&&(e.adler=p(e.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&U(e),r.pending+2<=r.pending_buf_size&&(k(r,255&e.adler),k(r,e.adler>>8&255),e.adler=0,r.status=M)):r.status=M),0!==r.pending){if(U(e),0===e.avail_out)return r.last_flush=-1,_}else if(0===e.avail_in&&R(t)<=R(n)&&t!==b)return L(e,-5);if(666===r.status&&0!==e.avail_in)return L(e,-5);if(0!==e.avail_in||0!==r.lookahead||t!==l&&666!==r.status){var s=2===r.strategy?H(r,t):3===r.strategy?G(r,t):u[r.level].func(r,t);if(s!==I&&s!==P||(r.status=666),s===w||s===I)return 0===e.avail_out&&(r.last_flush=-1),_;if(s===C&&(1===t?f._tr_align(r):5!==t&&(f._tr_stored_block(r,0,0,!1),3===t&&(D(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),U(e),0===e.avail_out))return r.last_flush=-1,_}return t!==b?_:r.wrap<=0?1:(2===r.wrap?(k(r,255&e.adler),k(r,e.adler>>8&255),k(r,e.adler>>16&255),k(r,e.adler>>24&255),k(r,255&e.total_in),k(r,e.total_in>>8&255),k(r,e.total_in>>16&255),k(r,e.total_in>>24&255)):(x(r,e.adler>>>16),x(r,65535&e.adler)),U(e),0=n.w_size&&(0===o&&(D(n.head),n.strstart=0,n.block_start=0,n.insert=0),u=new h.Buf8(n.w_size),h.arraySet(u,t,f-n.w_size,n.w_size,0),t=u,f=n.w_size),a=e.avail_in,c=e.next_in,s=e.input,e.avail_in=f,e.next_in=0,e.input=t,F(n);n.lookahead>=A;){for(r=n.strstart,i=n.lookahead-(A-1);n.ins_h=(n.ins_h<>>7)]}function k(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function x(e,t,n){e.bi_valid>d-n?(e.bi_buf|=t<>d-e.bi_valid,e.bi_valid+=n-d):(e.bi_buf|=t<>>=1,n<<=1,0<--t;);return n>>>1}function V(e){16===e.bi_valid?(k(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}function Y(e,t,n){var r,i,o=new Array(E+1),a=0;for(r=1;r<=E;r++)o[r]=a=a+n[r-1]<<1;for(i=0;i<=t;i++){var c=e[2*i+1];0!==c&&(e[2*i]=F(o[c]++,c))}}function G(){var e,t,n,r,i,o=new Array(E+1);for(r=n=0;r>=7;r>1;1<=n;n--)K(e,o,n);for(i=s;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],K(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,K(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,o,a,c,s=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,l=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,b=0;for(o=0;o<=E;o++)e.bl_count[o]=0;for(s[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<_;n++)r=e.heap[n],o=s[2*s[2*r+1]+1]+1,p>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return r;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return i;for(t=32;t>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==t?ne(e,t,n,r):4===e.strategy||o===i?(x(e,2+(r?1:0),3),W(e,T,N)):(x(e,4+(r?1:0),3),Z(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),W(e,e.dyn_ltree,e.dyn_dtree)),H(e),r&&q(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(w[n]+f+1)]++,e.dyn_dtree[2*j(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){x(e,2,3),B(e,b,T),V(e)}},{"../utils/common":1}],8:[function(e,t,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/deflate.js":[function(e,t,n){"use strict";var a=e("./zlib/deflate"),c=e("./utils/common"),s=e("./utils/strings"),i=e("./zlib/messages"),o=e("./zlib/zstream"),u=Object.prototype.toString,f=0,l=-1,h=0,d=8;function p(e){if(!(this instanceof p))return new p(e);this.options=c.assign({level:l,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},e||{});var t=this.options;t.raw&&0>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],c=e[t+1],s=e[t+2],u=e[t+3],f=e[t+4],l=e[t+5],h=e[t+6],d=e[t+7],p=e[t+8],b=e[t+9],_=e[t+10],E=e[t+11],y=e[t+12],v=e[t+13],g=e[t+14],m=e[t+15],S=o[0],A=o[1],O=o[2],T=o[3];A=I(A=I(A=I(A=I(A=C(A=C(A=C(A=C(A=w(A=w(A=w(A=w(A=M(A=M(A=M(A=M(A,O=M(O,T=M(T,S=M(S,A,O,T,a,7,N[0]),A,O,c,12,N[1]),S,A,s,17,N[2]),T,S,u,22,N[3]),O=M(O,T=M(T,S=M(S,A,O,T,f,7,N[4]),A,O,l,12,N[5]),S,A,h,17,N[6]),T,S,d,22,N[7]),O=M(O,T=M(T,S=M(S,A,O,T,p,7,N[8]),A,O,b,12,N[9]),S,A,_,17,N[10]),T,S,E,22,N[11]),O=M(O,T=M(T,S=M(S,A,O,T,y,7,N[12]),A,O,v,12,N[13]),S,A,g,17,N[14]),T,S,m,22,N[15]),O=w(O,T=w(T,S=w(S,A,O,T,c,5,N[16]),A,O,h,9,N[17]),S,A,E,14,N[18]),T,S,a,20,N[19]),O=w(O,T=w(T,S=w(S,A,O,T,l,5,N[20]),A,O,_,9,N[21]),S,A,m,14,N[22]),T,S,f,20,N[23]),O=w(O,T=w(T,S=w(S,A,O,T,b,5,N[24]),A,O,g,9,N[25]),S,A,u,14,N[26]),T,S,p,20,N[27]),O=w(O,T=w(T,S=w(S,A,O,T,v,5,N[28]),A,O,s,9,N[29]),S,A,d,14,N[30]),T,S,y,20,N[31]),O=C(O,T=C(T,S=C(S,A,O,T,l,4,N[32]),A,O,p,11,N[33]),S,A,E,16,N[34]),T,S,g,23,N[35]),O=C(O,T=C(T,S=C(S,A,O,T,c,4,N[36]),A,O,f,11,N[37]),S,A,d,16,N[38]),T,S,_,23,N[39]),O=C(O,T=C(T,S=C(S,A,O,T,v,4,N[40]),A,O,a,11,N[41]),S,A,u,16,N[42]),T,S,h,23,N[43]),O=C(O,T=C(T,S=C(S,A,O,T,b,4,N[44]),A,O,y,11,N[45]),S,A,m,16,N[46]),T,S,s,23,N[47]),O=I(O,T=I(T,S=I(S,A,O,T,a,6,N[48]),A,O,d,10,N[49]),S,A,g,15,N[50]),T,S,l,21,N[51]),O=I(O,T=I(T,S=I(S,A,O,T,y,6,N[52]),A,O,u,10,N[53]),S,A,_,15,N[54]),T,S,c,21,N[55]),O=I(O,T=I(T,S=I(S,A,O,T,p,6,N[56]),A,O,m,10,N[57]),S,A,h,15,N[58]),T,S,v,21,N[59]),O=I(O,T=I(T,S=I(S,A,O,T,f,6,N[60]),A,O,E,10,N[61]),S,A,s,15,N[62]),T,S,b,21,N[63]),o[0]=o[0]+S|0,o[1]=o[1]+A|0,o[2]=o[2]+O|0,o[3]=o[3]+T|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32;var i=f.floor(n/4294967296),o=n;t[15+(r+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t[14+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(t.length+1),this._process();for(var a=this._hash,c=a.words,s=0;s<4;s++){var u=c[s];c[s]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});function M(e,t,n,r,i,o,a){var c=e+(t&n|~t&r)+i+a;return(c<>>32-o)+t}function w(e,t,n,r,i,o,a){var c=e+(t&r|n&~r)+i+a;return(c<>>32-o)+t}function C(e,t,n,r,i,o,a){var c=e+(t^n^r)+i+a;return(c<>>32-o)+t}function I(e,t,n,r,i,o,a){var c=e+(n^(t|~r))+i+a;return(c<>>32-o)+t}e.MD5=r._createHelper(o),e.HmacMD5=r._createHmacHelper(o)}(Math),a.MD5)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(250),i=function(){function e(){this.list=new r.default}return e.prototype.enqueue=function(e){return this.list.add(e)},e.prototype.add=function(e){return this.list.add(e)},e.prototype.dequeue=function(){if(0!==this.list.size()){var e=this.list.first();return this.list.removeElementAtIndex(0),e}},e.prototype.peek=function(){if(0!==this.list.size())return this.list.first()},e.prototype.size=function(){return this.list.size()},e.prototype.contains=function(e,t){return this.list.contains(e,t)},e.prototype.isEmpty=function(){return this.list.size()<=0},e.prototype.clear=function(){this.list.clear()},e.prototype.forEach=function(e){this.list.forEach(e)},e}();t.default=i},function(e,t,n){var r=n(251);function i(){}function o(e,t,n){null==n&&(n=a),cordova.exec(function(){var e=Array.prototype.slice.call(arguments);e.unshift(null),n.apply(null,e)},function(e){e=e instanceof Error?e:new Error(e),n(e)},"DownloadManagerPlugin",e,t||[])}function a(){}e.exports=new i,i.prototype.enqueue=function(e,t){"string"==typeof e&&(e={uri:e}),e.url&&(e.uri=e.url),r("string"==typeof e.uri,"req.uri must be string"),r(null==t||"function"==typeof t,"cb must be function"),r(null==e.title||"string"==typeof e.title,"req.title must be string"),r(null==e.description||"string"==typeof e.description,"req.description must be string"),r(null==e.mimeType||"string"==typeof e.mimeType,"req.mimeType must be string"),r(null==e.destinationInExternalFilesDir||"string"==typeof e.destinationInExternalFilesDir.dirType,"req.destinationInExternalFilesDir.dirType must be string"),r(null==e.destinationInExternalFilesDir||"string"==typeof e.destinationInExternalFilesDir.subPath,"req.destinationInExternalFilesDir.subPath must be string"),r(null==e.destinationInExternalPublicDir||"string"==typeof e.destinationInExternalPublicDir.dirType,"req.destinationInExternalPublicDir.dirType must be string"),r(null==e.destinationInExternalPublicDir||"string"==typeof e.destinationInExternalPublicDir.subPath,"req.destinationInExternalPublicDir.subPath must be string"),r(null==e.destinationUri||"string"==typeof e.destinationUri,"req.destinationUri must be string"),r(null==e.visibleInDownloadsUi||"boolean"==typeof e.visibleInDownloadsUi,"req.visibleInDownloadsUi must be boolean"),r(null==e.notificationVisibility||Number.isSafeInteger(e.notificationVisibility),"req.notificationVisibility must be safe integer"),o("enqueue",[e],t)},i.prototype.query=function(e,t){"function"==typeof e&&(t=e,e=null),null==e&&(e={}),r("function"==typeof t,"cb must be function"),o("query",[e],t)},i.prototype.remove=function(e,t){r(Array.isArray(e),"ids must be array"),r(null==t||"function"==typeof t,"cb must be function"),o("remove",e,t)}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(o,a,c,s){return new(c||(c=Promise))(function(e,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new c(function(e){e(t.value)}).then(n,r)}i((s=s.apply(o,a||[])).next())})},s=this&&this.__generator||function(n,r){var i,o,a,e,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,o&&(a=o[2&t[0]?"return":t[0]?"throw":"next"])&&!(a=a.call(o,t[1])).done)return a;switch(o=0,a&&(t=[0,a.value]),t[0]){case 0:case 1:a=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,o=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]>16&255,o[a++]=t>>8&255,o[a++]=255&t;var u,f;2===i&&(t=l[e.charCodeAt(s)]<<2|l[e.charCodeAt(s+1)]>>4,o[a++]=255&t);1===i&&(t=l[e.charCodeAt(s)]<<10|l[e.charCodeAt(s+1)]<<4|l[e.charCodeAt(s+2)]>>2,o[a++]=t>>8&255,o[a++]=255&t);return o},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,i=[],o=0,a=n-r;o>2]+c[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(c[t>>10]+c[t>>4&63]+c[t<<2&63]+"="));return i.join("")};for(var c=[],l=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=r.length;i>18&63]+c[i>>12&63]+c[i>>6&63]+c[63&i]);return o.join("")}l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,c=8*i-r-1,s=(1<>1,f=-7,l=n?i-1:0,h=n?-1:1,d=e[t+l];for(l+=h,o=d&(1<<-f)-1,d>>=-f,f+=c;0>=-f,f+=r;0>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),2<=(t+=1<=a+l?h/s:h*Math.pow(2,1-l))*s&&(a++,s/=2),f<=a+l?(c=0,a=f):1<=a+l?(c=(t*s-1)*Math.pow(2,i),a+=l):(c=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));8<=i;e[n+d]=255&c,d+=p,c/=256,i-=8);for(a=a<>>0),o=this.head,a=0;o;)t=o.data,n=i,r=a,t.copy(n,r),a+=o.data.length,o=o.next;return i},e}(),r&&r.inspect&&r.inspect.custom&&(e.exports.prototype[r.inspect.custom]=function(){var e=r.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,i,o){(function(e){var t=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function r(e,t){this._id=e,this._clearFn=t}i.setTimeout=function(){return new r(n.call(setTimeout,t,arguments),clearTimeout)},i.setInterval=function(){return new r(n.call(setInterval,t,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(t,this._id)},i.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},i.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},i._unrefActive=i.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},o(149),i.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,i.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,o(15))},function(e,t,n){(function(e,p){!function(n,r){"use strict";if(!n.setImmediate){var i,o,t,a,e,c=1,s={},u=!1,f=n.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(n);l=l&&l.setTimeout?l:n,i="[object process]"==={}.toString.call(n.process)?function(e){p.nextTick(function(){d(e)})}:function(){if(n.postMessage&&!n.importScripts){var e=!0,t=n.onmessage;return n.onmessage=function(){e=!1},n.postMessage("","*"),n.onmessage=t,e}}()?(a="setImmediate$"+Math.random()+"$",e=function(e){e.source===n&&"string"==typeof e.data&&0===e.data.indexOf(a)&&d(+e.data.slice(a.length))},n.addEventListener?n.addEventListener("message",e,!1):n.attachEvent("onmessage",e),function(e){n.postMessage(a+e,"*")}):n.MessageChannel?((t=new MessageChannel).port1.onmessage=function(e){d(e.data)},function(e){t.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):function(e){setTimeout(d,0,e)},l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n>>27)+(r=u,i=f,o=l,0===(n=b)?r&i|~r&o:2===n?r&i|r&o|i&o:r^i^o)+h+c[p]+E[b];h=l,l=f,f=(t=u)<<30|t>>>2,u=s,s=_}this._a=s+this._a|0,this._b=u+this._b|0,this._c=f+this._c|0,this._d=l+this._d|0,this._e=h+this._e|0},c.prototype._hash=function(){var e=o.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,n){var r=n(4),i=n(26),o=n(3).Buffer,y=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,i.call(this,64,56)}r(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,n,r,i,o,a,c,s=this._w,u=0|this._a,f=0|this._b,l=0|this._c,h=0|this._d,d=0|this._e,p=0;p<16;++p)s[p]=e.readInt32BE(4*p);for(;p<80;++p)s[p]=(t=s[p-3]^s[p-8]^s[p-14]^s[p-16])<<1|t>>>31;for(var b=0;b<80;++b){var _=~~(b/20),E=0|((c=u)<<5|c>>>27)+(i=f,o=l,a=h,0===(r=_)?i&o|~i&a:2===r?i&o|i&a|o&a:i^o^a)+d+s[b]+y[_];d=h,h=l,l=(n=f)<<30|n>>>2,f=u,u=E}this._a=u+this._a|0,this._b=f+this._b|0,this._c=l+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0},c.prototype._hash=function(){var e=o.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,n){var r=n(4),i=n(74),o=n(26),a=n(3).Buffer,c=new Array(64);function s(){this.init(),this._w=c,o.call(this,64,56)}r(s,i),s.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},s.prototype._hash=function(){var e=a.allocUnsafe(28);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},e.exports=s},function(e,t,n){var r=n(4),i=n(75),o=n(26),a=n(3).Buffer,c=new Array(160);function s(){this.init(),this._w=c,o.call(this,128,112)}r(s,i),s.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},s.prototype._hash=function(){var r=a.allocUnsafe(48);function e(e,t,n){r.writeInt32BE(e,n),r.writeInt32BE(t,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),r},e.exports=s},function(e,t,n){"use strict";var r=n(4),o=n(3).Buffer,a=n(21),c=o.alloc(128);function i(e,t){a.call(this,"digest"),"string"==typeof t&&(t=o.from(t)),this._alg=e,64<(this._key=t).length?t=e(t):t.length<64&&(t=o.concat([t,c],64));for(var n=this._ipad=o.allocUnsafe(64),r=this._opad=o.allocUnsafe(64),i=0;i<64;i++)n[i]=54^t[i],r[i]=92^t[i];this._hash=[n]}r(i,a),i.prototype._update=function(e){this._hash.push(e)},i.prototype._final=function(){var e=this._alg(o.concat(this._hash));return this._alg(o.concat([this._opad,e]))},e.exports=i},function(e,t,n){e.exports=n(78)},function(e,t,n){(function(u,f){var l,h=n(80),d=n(81),p=n(82),b=n(3).Buffer,_=u.crypto&&u.crypto.subtle,E={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},y=[];function v(e,t,n,r,i){return _.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){return _.deriveBits({name:"PBKDF2",salt:t,iterations:n,hash:{name:i}},e,r<<3)}).then(function(e){return b.from(e)})}e.exports=function(t,n,r,i,o,a){"function"==typeof o&&(a=o,o=void 0);var e,c,s=E[(o=o||"sha1").toLowerCase()];if(!s||"function"!=typeof u.Promise)return f.nextTick(function(){var e;try{e=p(t,n,r,i,o)}catch(e){return a(e)}a(null,e)});if(h(t,n,r,i),"function"!=typeof a)throw new Error("No callback provided to pbkdf2");b.isBuffer(t)||(t=b.from(t,d)),b.isBuffer(n)||(n=b.from(n,d)),e=function(e){if(u.process&&!u.process.browser)return Promise.resolve(!1);if(!_||!_.importKey||!_.deriveBits)return Promise.resolve(!1);if(void 0!==y[e])return y[e];var t=v(l=l||b.alloc(8),l,10,128,e).then(function(){return!0}).catch(function(){return!1});return y[e]=t}(s).then(function(e){return e?v(t,n,r,i,s):p(t,n,r,i,o)}),c=a,e.then(function(e){f.nextTick(function(){c(null,e)})},function(e){f.nextTick(function(){c(e)})})}}).call(this,n(15),n(16))},function(e,t,n){var r=n(167),i=n(53),o=n(54),a=n(182),c=n(38);function s(e,t,n){if(e=e.toLowerCase(),o[e])return i.createCipheriv(e,t,n);if(a[e])return new r({key:t,iv:n,mode:e});throw new TypeError("invalid suite type")}function u(e,t,n){if(e=e.toLowerCase(),o[e])return i.createDecipheriv(e,t,n);if(a[e])return new r({key:t,iv:n,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var n,r;if(e=e.toLowerCase(),o[e])n=o[e].key,r=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");n=8*a[e].key,r=a[e].iv}var i=c(t,!1,n,r);return s(e,i.key,i.iv)},t.createCipheriv=t.Cipheriv=s,t.createDecipher=t.Decipher=function(e,t){var n,r;if(e=e.toLowerCase(),o[e])n=o[e].key,r=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");n=8*a[e].key,r=a[e].iv}var i=c(t,!1,n,r);return u(e,i.key,i.iv)},t.createDecipheriv=t.Decipheriv=u,t.listCiphers=t.getCiphers=function(){return Object.keys(a).concat(i.getCiphers())}},function(e,t,n){var a=n(21),r=n(52),i=n(4),c=n(3).Buffer,s={"des-ede3-cbc":r.CBC.instantiate(r.EDE),"des-ede3":r.EDE,"des-ede-cbc":r.CBC.instantiate(r.EDE),"des-ede":r.EDE,"des-cbc":r.CBC.instantiate(r.DES),"des-ecb":r.DES};function o(e){a.call(this);var t,n=e.mode.toLowerCase(),r=s[n];t=e.decrypt?"decrypt":"encrypt";var i=e.key;c.isBuffer(i)||(i=c.from(i)),"des-ede"!==n&&"des-ede-cbc"!==n||(i=c.concat([i,i.slice(0,8)]));var o=e.iv;c.isBuffer(o)||(o=c.from(o)),this._des=r.create({key:i,iv:o,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],i(e.exports=o,a),o.prototype._update=function(e){return c.from(this._des.update(e))},o.prototype._final=function(){return c.from(this._des.final())}},function(e,t,n){"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,n){e[0+n]=t>>>24,e[1+n]=t>>>16&255,e[2+n]=t>>>8&255,e[3+n]=255&t},t.ip=function(e,t,n,r){for(var i=0,o=0,a=6;0<=a;a-=2){for(var c=0;c<=24;c+=8)i<<=1,i|=t>>>c+a&1;for(c=0;c<=24;c+=8)i<<=1,i|=e>>>c+a&1}for(a=6;0<=a;a-=2){for(c=1;c<=25;c+=8)o<<=1,o|=t>>>c+a&1;for(c=1;c<=25;c+=8)o<<=1,o|=e>>>c+a&1}n[r+0]=i>>>0,n[r+1]=o>>>0},t.rip=function(e,t,n,r){for(var i=0,o=0,a=0;a<4;a++)for(var c=24;0<=c;c-=8)i<<=1,i|=t>>>c+a&1,i<<=1,i|=e>>>c+a&1;for(a=4;a<8;a++)for(c=24;0<=c;c-=8)o<<=1,o|=t>>>c+a&1,o<<=1,o|=e>>>c+a&1;n[r+0]=i>>>0,n[r+1]=o>>>0},t.pc1=function(e,t,n,r){for(var i=0,o=0,a=7;5<=a;a--){for(var c=0;c<=24;c+=8)i<<=1,i|=t>>c+a&1;for(c=0;c<=24;c+=8)i<<=1,i|=e>>c+a&1}for(c=0;c<=24;c+=8)i<<=1,i|=t>>c+a&1;for(a=1;a<=3;a++){for(c=0;c<=24;c+=8)o<<=1,o|=t>>c+a&1;for(c=0;c<=24;c+=8)o<<=1,o|=e>>c+a&1}for(c=0;c<=24;c+=8)o<<=1,o|=e>>c+a&1;n[r+0]=i>>>0,n[r+1]=o>>>0},t.r28shl=function(e,t){return e<>>28-t};var s=[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,n,r){for(var i=0,o=0,a=s.length>>>1,c=0;c>>s[c]&1;for(c=a;c>>s[c]&1;n[r+0]=i>>>0,n[r+1]=o>>>0},t.expand=function(e,t,n){var r=0,i=0;r=(1&e)<<5|e>>>27;for(var o=23;15<=o;o-=4)r<<=6,r|=e>>>o&63;for(o=11;3<=o;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[n+0]=r>>>0,t[n+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 n=0,r=0;r<4;r++){n<<=4,n|=i[64*r+(e>>>18-6*r&63)]}for(r=0;r<4;r++){n<<=4,n|=i[256+64*r+(t>>>18-6*r&63)]}return n>>>0};var r=[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,n=0;n>>r[n]&1;return t>>>0},t.padSplit=function(e,t,n){for(var r=e.toString(2);r.length>>1];n=h.r28shl(n,o),r=h.r28shl(r,o),h.pc2(n,r,e.keys,i)}},s.prototype._update=function(e,t,n,r){var i=this._desState,o=h.readUInt32BE(e,t),a=h.readUInt32BE(e,t+4);h.ip(o,a,i.tmp,0),o=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,o,a,i.tmp,0):this._decrypt(i,o,a,i.tmp,0),o=i.tmp[0],a=i.tmp[1],h.writeUInt32BE(n,o,r),h.writeUInt32BE(n,a,r+4)},s.prototype._pad=function(e,t){for(var n=e.length-t,r=t;r>>0,o=l}h.rip(a,o,r,i)},s.prototype._decrypt=function(e,t,n,r,i){for(var o=n,a=t,c=e.keys.length-2;0<=c;c-=2){var s=e.keys[c],u=e.keys[c+1];h.expand(o,e.tmp,0),s^=e.tmp[0],u^=e.tmp[1];var f=h.substitute(s,u),l=o;o=(a^h.permute(f))>>>0,a=l}h.rip(o,a,r,i)}},function(e,t,n){"use strict";var r=n(11),o=n(4),a={};function i(e){r.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t>o%8,e._prev=s(e._prev,n?r:i);return a}function s(e,t){var n=e.length,r=-1,i=a.allocUnsafe(e.length);for(e=a.concat([e,a.from([t])]);++r>7;return i}t.encrypt=function(e,t,n){for(var r=t.length,i=a.allocUnsafe(r),o=-1;++o>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function o(e){this.h=e,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}o.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&r[t-1])<<31;r[0]=r[0]>>>1,n&&(r[0]=r[0]^225<<24)}this.state=a(i)},o.prototype.update=function(e){var t;for(this.cache=r.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},o.prototype.final=function(e,t){return this.cache.length&&this.ghash(r.concat([this.cache,i],16)),this.ghash(a([0,e,0,t])),this.state},e.exports=o},function(e,t,n){var i=n(86),o=n(3).Buffer,a=n(54),c=n(87),r=n(21),s=n(37),u=n(38);function f(e,t,n){r.call(this),this._cache=new l,this._last=void 0,this._cipher=new s.AES(t),this._prev=o.from(n),this._mode=e,this._autopadding=!0}function l(){this.cache=o.allocUnsafe(0)}function h(e,t,n){var r=a[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");if("string"==typeof n&&(n=o.from(n)),"GCM"!==r.mode&&n.length!==r.iv)throw new TypeError("invalid iv length "+n.length);if("string"==typeof t&&(t=o.from(t)),t.length!==r.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===r.type?new c(r.module,t,n,!0):"auth"===r.type?new i(r.module,t,n,!0):new f(r.module,t,n)}n(4)(f,r),f.prototype._update=function(e){var t,n;this._cache.add(e);for(var r=[];t=this._cache.get(this._autopadding);)n=this._mode.decrypt(this,t),r.push(n);return o.concat(r)},f.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||16>1)-1>1)-a:a,i.isubn(o)}else o=0;n.push(o);for(var c=0!==i.cmpn(0)&&0===i.andln(r-1)?t+1:1,s=1;s>1]):a.mixedAdd(i[-s-1>>1].neg()):0>1]):a.add(i[-s-1>>1].neg())}return"affine"===e.type?a.toP():a},o.prototype._wnafMulAdd=function(e,t,n,r,i){for(var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,s=0,u=0;u>1]:O<0&&(A=a[_][-O-1>>1].neg()),v="affine"===A.type?v.mixedAdd(A):v.add(A))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},a.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i":""},u.prototype.isInfinity=function(){return this.inf},u.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 n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},u.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,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new m(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},u.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},u.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))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,a.BasePoint),s.prototype.jpoint=function(e,t,n){return new f(this,e,t,n)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=r.redSub(i),s=o.redSub(a);if(0===c.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=c.redSqr(),f=u.redMul(c),l=r.redMul(u),h=s.redSqr().redIAdd(f).redISub(l).redISub(l),d=s.redMul(l.redISub(h)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(h,d,p)},f.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=n.redSub(r),c=i.redSub(o);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=a.redSqr(),u=s.redMul(a),f=n.redMul(s),l=c.redSqr().redIAdd(u).redISub(f).redISub(f),h=c.redMul(f.redISub(l)).redISub(i.redMul(u)),d=this.z.redMul(a);return this.curve.jpoint(l,h,d)},f.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,n=0;n":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,n){"use strict";var r=n(39),i=n(6),o=n(4),a=r.base,c=n(8).utils;function s(e){a.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,n){a.BasePoint.call(this,e,"projective"),null===t&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(s,a),(e.exports=s).prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),r=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},o(u,a.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(c.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.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(),n=e.redSub(t),r=e.redMul(t),i=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(r,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),r=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(n),a=i.redMul(r),c=t.z.redMul(o.redAdd(a).redSqr()),s=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(c,s)},u.prototype.mul=function(e){for(var t=e.clone(),n=this,r=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;0<=o;o--)0===i[o]?(n=n.diffAdd(r,this),r=r.dbl()):(r=n.diffAdd(r,this),n=n.dbl());return r},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,n){"use strict";var r=n(39),i=n(8),s=n(6),o=n(4),a=r.base,c=i.utils.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new s(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new s(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new s(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),c(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function f(e,t,n,r,i){a.BasePoint.call(this,e,"projective"),null===t&&null===n&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new s(t,16),this.y=new s(n,16),this.z=r?new s(r,16):this.curve.one,this.t=i&&new s(i,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,a),(e.exports=u).prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,n,r){return this.point(e,t,n,r)},u.prototype.pointFromX=function(e,t){(e=new s(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=this.c2.redSub(this.a.redMul(n)),i=this.one.redSub(this.c2.redMul(this.d).redMul(n)),o=r.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(t&&!c||!t&&c)&&(a=a.redNeg()),this.point(e,a)},u.prototype.pointFromY=function(e,t){(e=new s(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=n.redSub(this.c2),i=n.redMul(this.d).redMul(this.c2).redSub(this.a),o=r.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),r=t.redMul(this.a).redAdd(n),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return 0===r.cmp(i)},o(f,a.BasePoint),u.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},u.prototype.point=function(e,t,n,r){return new f(this,e,t,n,r)},f.fromJSON=function(e,t){return new f(e,t[0],t[1],t[2])},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var r=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=r.redAdd(t),a=o.redSub(n),c=r.redSub(t),s=i.redMul(a),u=o.redMul(c),f=i.redMul(c),l=a.redMul(o);return this.curve.point(s,u,l,f)},f.prototype._projDbl=function(){var e,t,n,r=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(u=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=r.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(u.redSub(o)),n=a.redSqr().redSub(a).redSub(a);else{var c=this.z.redSqr(),s=a.redSub(c).redISub(c);e=r.redSub(i).redISub(o).redMul(s),t=a.redMul(u.redSub(o)),n=a.redMul(s)}}else{var u=i.redAdd(o);c=this.curve._mulC(this.z).redSqr(),s=u.redSub(c).redSub(c);e=this.curve._mulC(r.redISub(u)).redMul(s),t=this.curve._mulC(u).redMul(i.redISub(o)),n=u.redMul(s)}return this.curve.point(e,t,n)},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)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(t),a=i.redSub(r),c=i.redAdd(r),s=n.redAdd(t),u=o.redMul(a),f=c.redMul(s),l=o.redMul(s),h=a.redMul(c);return this.curve.point(u,f,h,l)},f.prototype._projAdd=function(e){var t,n,r=this.z.redMul(e.z),i=r.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),c=this.curve.d.redMul(o).redMul(a),s=i.redSub(c),u=i.redAdd(c),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),l=r.redMul(s).redMul(f);return n=this.curve.twisted?(t=r.redMul(u).redMul(a.redSub(this.curve._mulA(o))),s.redMul(u)):(t=r.redMul(u).redMul(a.redSub(o)),this.curve._mulC(s).redMul(u)),this.curve.point(l,t,n)},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,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},f.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],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 n=e.clone(),r=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),0<=n.cmp(this.curve.p))return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},function(e,t,n){"use strict";var r,i=t,o=n(56),a=n(8),c=a.utils.assert;function s(e){"short"===e.type?this.curve=new a.curve.short(e):"edwards"===e.type?this.curve=new a.curve.edwards(e):this.curve=new a.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,c(this.g.validate(),"Invalid curve"),c(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,n){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var e=new s(n);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:e}),e}})}i.PresetCurve=s,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=n(204)}catch(e){r=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},function(e,t,n){"use strict";t.sha1=n(199),t.sha224=n(200),t.sha256=n(93),t.sha384=n(201),t.sha512=n(94)},function(e,t,n){"use strict";var r=n(17),i=n(32),o=n(92),l=r.rotl32,h=r.sum32,d=r.sum32_5,p=o.ft_1,a=i.BlockHash,b=[1518500249,1859775393,2400959708,3395469782];function c(){if(!(this instanceof c))return new c;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}r.inherits(c,a),(e.exports=c).blockSize=512,c.outSize=160,c.hmacStrength=80,c.padLength=64,c.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;rthis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t>1;if(0<=a.cmp(this.curve.p.umod(this.curve.n))&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),s):this.curve.pointFromX(a,s);var f=t.r.invm(i),l=i.sub(o).mul(f).umod(i),h=c.mul(f).umod(i);return this.g.mulAdd(l,a,h)},i.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new y(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,n){"use strict";var r=n(56),a=n(91),i=n(11);function o(e){if(!(this instanceof o))return new o(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=a.toArray(e.entropy,e.entropyEnc||"hex"),n=a.toArray(e.nonce,e.nonceEnc||"hex"),r=a.toArray(e.pers,e.persEnc||"hex");i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}(e.exports=o).prototype._init=function(e,t,n){var r=e.concat(t).concat(n);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(n||[])),this._reseed=1},o.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=n,n=t,t=null),n&&(n=a.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length"}},function(e,t,n){"use strict";var c=n(6),s=n(8).utils,r=s.assert;function i(e,t){if(e instanceof i)return e;this._importDER(e,t)||(r(e.r&&e.s,"Signature without r or s"),this.r=new c(e.r,16),this.s=new c(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function f(e,t){var n=e[t.place++];if(!(128&n))return n;for(var r=15&n,i=0,o=0,a=t.place;o>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}(e.exports=i).prototype._importDER=function(e,t){e=s.toArray(e,t);var n=new u;if(48!==e[n.place++])return!1;if(f(e,n)+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var r=f(e,n),i=e.slice(n.place,r+n.place);if(n.place+=r,2!==e[n.place++])return!1;var o=f(e,n);if(e.length!==o+n.place)return!1;var a=e.slice(n.place,o+n.place);return 0===i[0]&&128&i[1]&&(i=i.slice(1)),0===a[0]&&128&a[1]&&(a=a.slice(1)),this.r=new c(i),this.s=new c(a),!(this.recoveryParam=null)},i.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=a(t),n=a(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];l(r,t.length),(r=r.concat(t)).push(2),l(r,n.length);var i=r.concat(n),o=[48];return l(o,i.length),o=o.concat(i),s.encode(o,e)}},function(e,t,n){"use strict";var r=n(56),i=n(8),o=i.utils,a=o.assert,s=o.parseBytes,c=n(210),u=n(211);function f(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=i.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}(e.exports=f).prototype.sign=function(e,t){e=s(e);var n=this.keyFromSecret(t),r=this.hashInt(n.messagePrefix(),e),i=this.g.mul(r),o=this.encodePoint(i),a=this.hashInt(o,n.pubBytes(),e).mul(n.priv()),c=r.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},f.prototype.verify=function(e,t,n){e=s(e),t=this.makeSignature(t);var r=this.keyFromPublic(n),i=this.hashInt(t.Rencoded(),r.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(r.pub().mul(i)).eq(o)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t=t)throw new Error("invalid sig")}e.exports=function(e,t,n,r,i){var o=b(n);if("ec"===o.type){if("ecdsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong public key type");return function(e,t,n){var r=_[n.data.algorithm.curve.join(".")];if(!r)throw new Error("unknown curve "+n.data.algorithm.curve.join("."));var i=new p(r),o=n.data.subjectPrivateKey.data;return i.verify(t,e,o)}(e,t,o)}if("dsa"===o.type){if("dsa"!==r)throw new Error("wrong public key type");return function(e,t,n){var r=n.data.p,i=n.data.q,o=n.data.g,a=n.data.pub_key,c=b.signature.decode(e,"der"),s=c.s,u=c.r;E(s,i),E(u,i);var f=d.mont(r),l=s.invm(i);return 0===o.toRed(f).redPow(new d(t).mul(l).mod(i)).fromRed().mul(a.toRed(f).redPow(u.mul(l).mod(i)).fromRed()).mod(r).mod(i).cmp(u)}(e,t,o)}if("rsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong public key type");t=h.concat([i,t]);for(var a=o.modulus.byteLength(),c=[1],s=0;t.length+c.length+2a||0<=new u(t).cmp(o.modulus))throw new Error("decryption error");i=n?p(new u(t),o):h(t,o);var c=b.alloc(a-i.length);if(i=b.concat([c,i],a),4===r)return function(e,t){var n=e.modulus.byteLength(),r=d("sha1").update(b.alloc(0)).digest(),i=r.length;if(0!==t[0])throw new Error("decryption error");var o=t.slice(1,i+1),a=t.slice(i+1),c=l(o,f(a,i)),s=l(a,f(c,n-i-1));if(function(e,t){e=b.from(e),t=b.from(t);var n=0,r=e.length;e.length!==t.length&&(n++,r=Math.min(e.length,t.length));var i=-1;for(;++i=t.length){o++;break}var a=t.slice(2,i-1);("0002"!==r.toString("hex")&&!n||"0001"!==r.toString("hex")&&n)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,i,n);if(3===r)return i;throw new Error("unknown padding")}},function(e,n,d){"use strict";(function(i,a){function e(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var t=d(3),c=d(25),o=t.Buffer,r=t.kMaxLength,s=i.crypto||i.msCrypto,u=Math.pow(2,32)-1;function f(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(u=E&&--r,r}e.exports={derToJose:function(e,t){e=y(e);var n=_(t),r=n+1,i=e.length,o=0;if(48!==e[o++])throw new Error('Could not find expected "seq"');var a=e[o++];if(a===(1|E)&&(a=e[o++]),i-of+(s.clockTolerance||0))return u(new p("jwt not active",new Date(1e3*i.nbf)))}if(void 0!==i.exp&&!s.ignoreExpiration){if("number"!=typeof i.exp)return u(new d("invalid exp value"));if(f>=i.exp+(s.clockTolerance||0))return u(new b("jwt expired",new Date(1e3*i.exp)))}if(s.audience){var o=Array.isArray(s.audience)?s.audience:[s.audience];if(!(Array.isArray(i.aud)?i.aud:[i.aud]).some(function(t){return o.some(function(e){return e instanceof RegExp?e.test(t):e===t})}))return u(new d("jwt audience invalid. expected: "+o.join(" or ")))}if(s.issuer&&("string"==typeof s.issuer&&i.iss!==s.issuer||Array.isArray(s.issuer)&&-1===s.issuer.indexOf(i.iss)))return u(new d("jwt issuer invalid. expected: "+s.issuer));if(s.subject&&i.sub!==s.subject)return u(new d("jwt subject invalid. expected: "+s.subject));if(s.jwtid&&i.jti!==s.jwtid)return u(new d("jwt jwtid invalid. expected: "+s.jwtid));if(s.nonce&&i.nonce!==s.nonce)return u(new d("jwt nonce invalid. expected: "+s.nonce));if(s.maxAge){if("number"!=typeof i.iat)return u(new d("iat required when maxAge is specified"));var a=_(s.maxAge,i.iat);if(void 0===a)return u(new d('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(f>=a+(s.clockTolerance||0))return u(new b("maxAge exceeded",new Date(1e3*a)))}return u(null,i)})}},function(e,t){var r=864e5;function i(e,t,n,r){var i=1.5*n<=t;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,t){t=t||{};var n=typeof e;if("string"===n&&0>>((3&t)<<3)&255;return i}}},function(e,t){for(var i=[],n=0;n<256;++n)i[n]=(n+256).toString(16).substr(1);e.exports=function(e,t){var n=t||0,r=i;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(18),r=function(){function e(e){this.table={},this.nElements=0,this.toStr=e||o.defaultToString}return e.prototype.getValue=function(e){var t=this.table["$"+this.toStr(e)];if(!o.isUndefined(t))return t.value},e.prototype.setValue=function(e,t){if(!o.isUndefined(e)&&!o.isUndefined(t)){var n,r="$"+this.toStr(e),i=this.table[r];return n=o.isUndefined(i)?void this.nElements++:i.value,this.table[r]={key:e,value:t},n}},e.prototype.remove=function(e){var t="$"+this.toStr(e),n=this.table[t];if(!o.isUndefined(n))return delete this.table[t],this.nElements--,n.value},e.prototype.keys=function(){var e=[];for(var t in this.table)if(o.has(this.table,t)){var n=this.table[t];e.push(n.key)}return e},e.prototype.values=function(){var e=[];for(var t in this.table)if(o.has(this.table,t)){var n=this.table[t];e.push(n.value)}return e},e.prototype.forEach=function(e){for(var t in this.table)if(o.has(this.table,t)){var n=this.table[t];if(!1===e(n.key,n.value))return}},e.prototype.containsKey=function(e){return!o.isUndefined(this.getValue(e))},e.prototype.clear=function(){this.table={},this.nElements=0},e.prototype.size=function(){return this.nElements},e.prototype.isEmpty=function(){return this.nElements<=0},e.prototype.toString=function(){var n="{";return this.forEach(function(e,t){n+="\n\t"+e+" : "+t}),n+"\n}"},e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(18),i=n(110),r=function(){function r(){this.firstNode=null,this.lastNode=null,this.nElements=0}return r.prototype.add=function(e,t){if(o.isUndefined(t)&&(t=this.nElements),t<0||t>this.nElements||o.isUndefined(e))return!1;var n=this.createNode(e);if(0===this.nElements||null===this.lastNode)this.firstNode=n,this.lastNode=n;else if(t===this.nElements)this.lastNode.next=n,this.lastNode=n;else if(0===t)n.next=this.firstNode,this.firstNode=n;else{var r=this.nodeAtIndex(t-1);if(null==r)return!1;n.next=r.next,r.next=n}return this.nElements++,!0},r.prototype.first=function(){if(null!==this.firstNode)return this.firstNode.element},r.prototype.last=function(){if(null!==this.lastNode)return this.lastNode.element},r.prototype.elementAtIndex=function(e){var t=this.nodeAtIndex(e);if(null!==t)return t.element},r.prototype.indexOf=function(e,t){var n=t||o.defaultEquals;if(o.isUndefined(e))return-1;for(var r=this.firstNode,i=0;null!==r;){if(n(r.element,e))return i;i++,r=r.next}return-1},r.prototype.contains=function(e,t){return 0<=this.indexOf(e,t)},r.prototype.remove=function(e,t){var n=t||o.defaultEquals;if(this.nElements<1||o.isUndefined(e))return!1;for(var r=null,i=this.firstNode;null!==i;){if(n(i.element,e))return null==r?(this.firstNode=i.next,i===this.lastNode&&(this.lastNode=null)):(i===this.lastNode?(this.lastNode=r).next=i.next:r.next=i.next,i.next=null),this.nElements--,!0;i=(r=i).next}return!1},r.prototype.clear=function(){this.firstNode=null,this.lastNode=null,this.nElements=0},r.prototype.equals=function(e,t){var n=t||o.defaultEquals;return e instanceof r&&(this.size()===e.size()&&this.equalsAux(this.firstNode,e.firstNode,n))},r.prototype.equalsAux=function(e,t,n){for(;null!==e&&null!==t;){if(!n(e.element,t.element))return!1;e=e.next,t=t.next}return!0},r.prototype.removeElementAtIndex=function(e){if(!(e<0||e>=this.nElements||null===this.firstNode||null===this.lastNode)){var t;if(1===this.nElements)t=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var n=this.nodeAtIndex(e-1);null===n?(t=this.firstNode.element,this.firstNode=this.firstNode.next):n.next===this.lastNode&&(t=this.lastNode.element,this.lastNode=n),null!==n&&null!==n.next&&(t=n.next.element,n.next=n.next.next)}return this.nElements--,t}},r.prototype.forEach=function(e){for(var t=this.firstNode;null!==t&&!1!==e(t.element);)t=t.next},r.prototype.reverse=function(){for(var e=null,t=this.firstNode,n=null;null!==t;)n=t.next,t.next=e,e=t,t=n;n=this.firstNode,this.firstNode=this.lastNode,this.lastNode=n},r.prototype.toArray=function(){for(var e=[],t=this.firstNode;null!==t;)e.push(t.element),t=t.next;return e},r.prototype.size=function(){return this.nElements},r.prototype.isEmpty=function(){return this.nElements<=0},r.prototype.toString=function(){return i.toString(this.toArray())},r.prototype.nodeAtIndex=function(e){if(e<0||e>=this.nElements)return null;if(e===this.nElements-1)return this.lastNode;for(var t=this.firstNode,n=0;na[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]this.telemetryConfig.telemetryLogMinAllowedOffset?r:0)?[4,ni.log.interact({type:_t.OTHER,subType:yt.DEVICE_TIME_OFFSET_FOUND,env:"sdk",pageId:"sdk",id:"sdk",valueMap:{deviceTime:n,offsetTime:i}}).toPromise()]:[3,3];case 1:return e.sent(),[4,this.keyValueStore.setValue(c.TELEMETRY_LOG_MIN_ALLOWED_OFFSET_KEY,i+"").toPromise()];case 2:e.sent(),e.label=3;case 3:return[2]}})})}),Object(Pe.mergeMap)(function(){return Object(de.zip)(i.keyValueStore.setValue(c.LAST_SYNCED_DEVICE_REGISTER_ATTEMPT_TIME_STAMP_KEY,Date.now()+""),i.keyValueStore.setValue(c.LAST_SYNCED_DEVICE_REGISTER_IS_SUCCESSFUL_KEY,"true")).pipe(Object(Pe.mapTo)(void 0))}),Object(Pe.catchError)(function(e){return Object(de.zip)(i.keyValueStore.setValue(c.LAST_SYNCED_DEVICE_REGISTER_ATTEMPT_TIME_STAMP_KEY,Date.now()+""),i.keyValueStore.setValue(c.LAST_SYNCED_DEVICE_REGISTER_IS_SUCCESSFUL_KEY,"false")).pipe(Object(Pe.mergeMap)(function(){throw console.error(e),new Error("Device Registration Failed")}))}))}))},c.prototype.hasTelemetryThresholdCrossed=function(){var t=this;return this.dbService.execute("\n SELECT count(*) as COUNT FROM "+Ht.TABLE_NAME).pipe(Object(Pe.map)(function(e){return!!(e&&e[0]&&e[0].COUNT>=t.telemetryConfig.telemetrySyncThreshold)}))},c.prototype.fetchEvents=function(){return this.dbService.execute("\n SELECT * FROM "+Ht.TABLE_NAME+"\n WHERE "+Ht.COLUMN_NAME_PRIORITY+" = (SELECT MIN ("+Ht.COLUMN_NAME_PRIORITY+")\n FROM "+Ht.TABLE_NAME+")\n ORDER BY "+Ht.COLUMN_NAME_TIMESTAMP+"\n LIMIT "+this.telemetryConfig.telemetrySyncBandwidth)},c.prototype.processEvents=function(e){if(!e.length)return Object(de.of)({processedEventsSize:0});var t=zr.generateUniqueId();return Object(de.of)({processedEvents:this.preprocessors.reduce(function(e,t){return t.process(e)},{id:"ekstep.telemetry",ver:"1.0",ts:Ie()().format("YYYY-MM-DDTHH:mm:ss[Z]"),events:e.map(function(e){return JSON.parse(e[Ht.COLUMN_NAME_EVENT])}),params:{did:this.deviceInfo.getDeviceID(),msgid:t,key:"",requesterId:""}}),processedEventsSize:e.length,messageId:t})},c.prototype.persistProcessedEvents=function(e,t){var n,r=e.processedEvents,i=e.messageId;if(!r)return Object(de.of)(void 0);var o={table:zt.TABLE_NAME,modelJson:(n={},n[zt.COLUMN_NAME_MSG_ID]=i,n[zt.COLUMN_NAME_NUMBER_OF_EVENTS]=t,n[Ht.COLUMN_NAME_PRIORITY]=1,n[zt.COLUMN_NAME_DATA]=r,n)};return this.dbService.insert(o).pipe(Object(Pe.mapTo)(void 0))},c.prototype.deleteEvents=function(e){return e.length?this.dbService.execute("\n DELETE FROM "+Ht.TABLE_NAME+"\n WHERE "+Ht._ID+" IN ("+e.map(function(e){return e[Ht._ID]}).join(",")+")\n "):Object(de.of)(void 0)},c.prototype.handleProcessedEventsBatch=function(e){var n=this;return Object(de.iif)(function(){return!!e},Object(de.of)(void 0),this.sharedPreferences.getString(fe.KEY_AUTO_SYNC_MODE).pipe(Object(Pe.catchError)(function(){return Object(de.of)("")}),Object(Pe.mergeMap)(function(e){switch(e){case td.OFF:throw new Error("AUTO_SYNC_MODE: "+td.OFF);case td.OVER_WIFI:if(navigator.connection.type===Connection.WIFI)return Object(de.of)(void 0);throw new Error("AUTO_SYNC_MODE: "+td.OVER_WIFI);case td.ALWAYS_ON:default:return Object(de.of)(void 0)}}))).pipe(Object(Pe.mergeMap)(function(){return n.fetchProcessedEventsBatch().pipe(Object(Pe.mergeMap)(function(t){return n.syncProcessedEvent(t).pipe(Object(Pe.mergeMap)(function(e){return n.deleteProcessedEvent(t).pipe(Object(Pe.mapTo)(e||{syncedEventCount:0,syncTime:Date.now(),syncedFileSize:0}))}))}))}),Object(Pe.catchError)(function(e){return Object(de.of)({syncedEventCount:0,syncTime:Date.now(),syncedFileSize:0,error:e})}))},c.prototype.fetchProcessedEventsBatch=function(){return this.dbService.read({table:zt.TABLE_NAME,selection:"",selectionArgs:[],limit:"1"}).pipe(Object(Pe.map)(function(e){return e&&e[0]}))},c.prototype.syncProcessedEvent=function(e){var t=this;if(!e)return Object(de.of)(void 0);var n=e[zt.COLUMN_NAME_DATA].split("").map(function(e){return e.charCodeAt(0)}),r=new Uint8Array(n),i=(new H.Builder).withHost(this.telemetryConfig.host).withType(j.POST).withPath(this.telemetryConfig.apiPath+c.TELEMETRY_ENDPOINT).withBody(r).withApiToken(!0).build();return this.apiService.fetch(i).pipe(Object(Pe.tap)(function(o){return ri(t,void 0,void 0,function(){var t,n,r,i;return ii(this,function(e){switch(e.label){case 0:return[4,this.keyValueStore.getValue(c.LAST_SYNCED_DEVICE_REGISTER_IS_SUCCESSFUL_KEY).toPromise()];case 1:return"false"!==e.sent()?[3,3]:(t=new Date(o.body.ets).getTime(),n=Date.now(),r=t-n,(i=Math.abs(r)>this.telemetryConfig.telemetryLogMinAllowedOffset?r:0)?[4,this.keyValueStore.setValue(c.TELEMETRY_LOG_MIN_ALLOWED_OFFSET_KEY,i+"").toPromise()]:[3,3]);case 2:e.sent(),e.label=3;case 3:return[2]}})})}),Object(Pe.map)(function(){return{syncedEventCount:e[zt.COLUMN_NAME_NUMBER_OF_EVENTS],syncTime:Date.now(),syncedFileSize:(new TextEncoder).encode(e[zt.COLUMN_NAME_DATA]).length}}))},c.prototype.deleteProcessedEvent=function(e){return e?this.dbService.delete({table:zt.TABLE_NAME,selection:"_id = ?",selectionArgs:[e[zt._ID]]}):Object(de.of)(void 0)},c.TELEMETRY_LOG_MIN_ALLOWED_OFFSET_KEY="telemetry_log_min_allowed_offset_key",c.LAST_SYNCED_DEVICE_REGISTER_ATTEMPT_TIME_STAMP_KEY="last_synced_device_register_attempt_time_stamp",c.LAST_SYNCED_DEVICE_REGISTER_IS_SUCCESSFUL_KEY="last_synced_device_register_is_successful",c.TELEMETRY_ENDPOINT="/telemetry",c.REGISTER_API_SUCCESS_TTL=864e5,c.REGISTER_API_FAILURE_TTL=36e5,c}(),ai=function(){function e(e,t){this.fileService=e,this.deviceInfo=t}return e.prototype.execute=function(t){var n=this,r=new V;return this.fileService.createDir(t.destinationFolder.concat("Telemetry"),!1).then(function(e){return n.fileService.createFile(e.nativeURL,n.getExportedFileName(),!0)}).then(function(e){return t.destinationDBFilePath=e.nativeURL,r.body=t,r})},e.prototype.getExportedFileName=function(){return"tm_"+this.deviceInfo.getDeviceID()+"_"+Date.now()+".gsa"},e}(),ci=function(o,a,c,s){return new(c||(c=Promise))(function(e,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new c(function(e){e(t.value)}).then(n,r)}i((s=s.apply(o,a||[])).next())})},si=function(n,r){var i,o,a,e,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,o&&(a=o[2&t[0]?"return":t[0]?"throw":"next"])&&!(a=a.call(o,t[1])).done)return a;switch(o=0,a&&(t=[0,a.value]),t[0]){case 0:case 1:a=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,o=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]=e.minCompatibilityLevel&&t<=e.maxCompatibilityLevel},_.readCompatibilityLevel=function(e){var t=e.compatibilityLevel;return t||this.defaultCompatibilityLevel},_.isDraftContent=function(e){return e&&e===Er.DRAFT.valueOf()},_.isExpired=function(e){if(e){var t=new Date(e).getTime();if((new Date).getTime()>t)return!0}return!1},_.isDuplicateCheckRequired=function(e,t){return e&&0===t},_.isImportFileExist=function(e,t){if(!e||!t)return!1;var n=!1,r=e[mn.COLUMN_NAME_IDENTIFIER],i=t.identifier,o=e[mn.COLUMN_NAME_VISIBILITY],a=_.readVisibility(t);return r===i&&o===a&&(n=this.readPkgVersion(JSON.parse(e[mn.COLUMN_NAME_LOCAL_DATA]))>=this.readPkgVersion(t)),n},_.readPkgVersion=function(e){return e.pkgVersion},_.readContentType=function(e){var t=e.contentType;return t&&(t=t.toLowerCase()),t},_.readAudience=function(e){var t=e.audience,n=[];return"string"==typeof t&&n.push(t),n&&n.length||n.push("Learner"),n.sort(),n.join(",")},_.readPragma=function(e){var t=e.pragma;return t||(t=[]),t.join(",")},_.doesContentExist=function(e,t,n,r){if(!e)return!1;var i=!1,o=e[mn.COLUMN_NAME_IDENTIFIER],a=JSON.parse(e[mn.COLUMN_NAME_LOCAL_DATA]);if(o===t){var c=!1;r?c=!(_.readPkgVersion(a)_.MAX_CONTENT_NAME&&(a=a.substring(0,_.MAX_CONTENT_NAME-3)+"...");var c=o.pkgVersion;r=t.toLowerCase()+"_"+a+"-v"+c+".ecar"}return r},_.readOriginFromContentMap=function(e){var t=e.contentMetadata,n=t&&t.virality;return n?n.origin:""},_.readTransferCountFromContentMap=function(e){var t=e.contentMetadata,n=t&&t.virality;return n?Mt.parseInt(n.transferCount):0},_.readSizeFromContentMap=function(e){return e.size?e.size:""},_.getUidnIdentifierFiler=function(e,t){var n=e&&"uid = '"+e+"'",r=t&&"identifier = '"+t+"'",i="";return n&&r?i="WHERE ("+r+" AND "+n+")":r?i="WHERE ("+r+")":n&&(i="WHERE ("+n+")"),i},_.getBasePath=function(e){return e?e=-1!==e.indexOf("file://")?e.replace("file://",""):"file://".concat(e):""},_.getRollup=function(e,t){var n,r,i,o;if(t){var a=void 0;for(a=0;a 0";return"select * from "+mn.TABLE_NAME+" "+r+" "+n},_.getFindAllContentsQuery=function(){return"select * from "+mn.TABLE_NAME+" where "+mn.COLUMN_NAME_REF_COUNT+" > 0"},_.constructContentDBModel=function(e,t,n,r,i,o,a,c,s,u,f,l,h,d,p){var b;return(b={})[mn.COLUMN_NAME_IDENTIFIER]=e,b[mn.COLUMN_NAME_SERVER_DATA]="",b[mn.COLUMN_NAME_PATH]=_.getBasePath(a),b[mn.COLUMN_NAME_REF_COUNT]=c,b[mn.COLUMN_NAME_CONTENT_STATE]=s,b[mn.COLUMN_NAME_SIZE_ON_DEVICE]=l,b[mn.COLUMN_NAME_MANIFEST_VERSION]=t,b[mn.COLUMN_NAME_LOCAL_DATA]=n,b[mn.COLUMN_NAME_MIME_TYPE]=r,b[mn.COLUMN_NAME_CONTENT_TYPE]=i,b[mn.COLUMN_NAME_VISIBILITY]=o,b[mn.COLUMN_NAME_AUDIENCE]=u,b[mn.COLUMN_NAME_PRAGMA]=f,b[mn.COLUMN_NAME_LOCAL_LAST_UPDATED_ON]=Ce().format(),b[mn.COLUMN_NAME_BOARD]=_.getContentAttribute(h),b[mn.COLUMN_NAME_MEDIUM]=_.getContentAttribute(d),b[mn.COLUMN_NAME_GRADE]=_.getContentAttribute(p),b},_.getReferenceCount=function(e,t){var n;return e?(n=e[mn.COLUMN_NAME_REF_COUNT],br.DEFAULT.valueOf()===e[mn.COLUMN_NAME_VISIBILITY]&&br.DEFAULT.valueOf()===t||(n+=1)):n=1,n},_.getContentVisibility=function(e,t,n){var r;return"Library"===t?r=br.PARENT.valueOf():e&&!br.PARENT.valueOf()===e[mn.COLUMN_NAME_VISIBILITY]&&(r=e[mn.COLUMN_NAME_VISIBILITY]),r||n},_.getContentState=function(e,t){return e&&e[mn.COLUMN_NAME_CONTENT_STATE]>t&&(t=e[mn.COLUMN_NAME_CONTENT_STATE]),t},_.isFreeSpaceAvailable=function(e,t,n){var r=10240;return 0a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1] 0\n GROUP BY "+ln.COLUMN_NAME_QID},e.getQuestionReportsQuery=function(e,t){return"SELECT *, SUM("+ln.COLUMN_NAME_SCORE+") as marks,\n COUNT ("+ln.COLUMN_NAME_Q_INDEX+") as occurence_count,\n SUM ("+ln.COLUMN_NAME_MAX_SCORE+") as sum_max_score\n FROM "+ln.TABLE_NAME+"\n WHERE "+ln.COLUMN_NAME_UID+" IN("+di.joinPreservingQuotes(e)+")\n AND "+ln.COLUMN_NAME_CONTENT_ID+"='"+t+"'\n GROUP BY "+ln.COLUMN_NAME_QID},e.getFilterForLearnerAssessmentDetails=function(e,t,n,r){var i=ln.COLUMN_NAME_QID+" = '"+e+"'";return"WHERE "+(ln.COLUMN_NAME_UID+" = '"+t+"'")+" AND "+(ln.COLUMN_NAME_CONTENT_ID+" = '"+n+"'")+" AND "+(ln.COLUMN_NAME_HIERARCHY_DATA+" = '"+(r||"")+"'")+" "+(e?" AND "+i:"")},e.getLearnerAssessmentsQuery=function(e){return"SELECT * from "+ln.TABLE_NAME+" "+e+"\n ORDER BY "+ln.COLUMN_NAME_Q_INDEX},e.getUpdateSelection=function(){return ln.COLUMN_NAME_UID+" = ? AND\n "+ln.COLUMN_NAME_CONTENT_ID+" = ? AND\n "+ln.COLUMN_NAME_HIERARCHY_DATA+" = ? AND\n "+ln.COLUMN_NAME_QID+" = ? "},e.getLearnerSummaryReadSelection=function(e){return ln.COLUMN_NAME_UID+" = ? AND\n "+ln.COLUMN_NAME_CONTENT_ID+" = ? AND\n "+ln.COLUMN_NAME_HIERARCHY_DATA+" = ? "},e}(),Yo=function(){function e(e,t){this.apiService=e,this.courseServiceConfig=t,this.GET_BATCH_DETAILS_ENDPOINT="/batch/read/"}return e.prototype.handle=function(e){var t=(new H.Builder).withType(j.GET).withPath(this.courseServiceConfig.apiPath+this.GET_BATCH_DETAILS_ENDPOINT+e.batchId).withApiToken(!0).withSessionToken(!0).build();return this.apiService.fetch(t).pipe(Object(Pe.map)(function(e){return e.body.result.response}))},e}(),Go=function(){function e(e,t){this.apiService=e,this.courseServiceConfig=t,this.UPDATE_CONTENT_STATE_ENDPOINT="/content/state/update"}return e.prototype.handle=function(e){var t=(new H.Builder).withType(j.PATCH).withPath(this.courseServiceConfig.apiPath+this.UPDATE_CONTENT_STATE_ENDPOINT).withApiToken(!0).withSessionToken(!0).withBody({request:e}).build();return this.apiService.fetch(t).pipe(Object(Pe.map)(function(e){return e.body.result}))},e}(),Ho=function(){function e(e,t,n,r){this.apiService=e,this.courseServiceConfig=t,this.profileService=n,this.authService=r,this.GET_COURSE_BATCHES="/batch/list"}return e.prototype.handle=function(e){var n=this,t=(new H.Builder).withType(j.POST).withPath(this.courseServiceConfig.apiPath+this.GET_COURSE_BATCHES).withApiToken(!0).withSessionToken(!1).withBody({request:e}).build();return this.apiService.fetch(t).pipe(Object(Pe.map)(function(e){return Array.from(new Set(e.body.result.response.content))}),Object(Pe.switchMap)(function(t){return n.authService.getSession().pipe(Object(Pe.mergeMap)(function(e){return e?n.profileService.getServerProfiles({limit:t.length,filters:{identifier:new Set(t.map(function(e){return e.createdBy}))},fields:["firstName","lastName","identifier"]}).pipe(Object(Pe.map)(function(e){return t.forEach(function(t){t.creatorFirstName=e.find(function(e){return e.identifier===t.createdBy}).firstName,t.creatorLastName=e.find(function(e){return e.identifier===t.createdBy}).lastName}),t})):Object(de.of)(t)}))}))},e}(),qo=function(o,a,c,s){return new(c||(c=Promise))(function(e,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new c(function(e){e(t.value)}).then(n,r)}i((s=s.apply(o,a||[])).next())})},zo=function(n,r){var i,o,a,e,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,o&&(a=o[2&t[0]?"return":t[0]?"throw":"next"])&&!(a=a.call(o,t[1])).done)return a;switch(o=0,a&&(t=[0,a.value]),t[0]){case 0:case 1:a=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,o=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]=t},t.prototype.findValidProgress=function(e,t){var n=this;return e.find(function(e){return n.isProgressValid(e,t)})},t.prototype.updateLastReadContentId=function(e,t,n,r){var i=ga.LAST_READ_CONTENTID_PREFIX.concat("_").concat(e).concat("_").concat(t).concat("_").concat(n);return this.sharedPreference.putString(i,r)},t.prototype.handle=function(n){var e=this;return"START"===n.eid&&t.checkPData(n.context.pdata)?(this.courseService.resetCapturedAssessmentEvents(),this.processOEStart(n).pipe(Object(Pe.tap)(function(){return Ma(e,void 0,void 0,function(){return wa(this,function(e){switch(e.label){case 0:return[4,this.summarizerService.saveLearnerAssessmentDetails(n).pipe(Object(Pe.mapTo)(void 0)).toPromise()];case 1:return e.sent(),[2]}})})}),Object(Pe.tap)(function(){return Ma(e,void 0,void 0,function(){var t=this;return wa(this,function(e){switch(e.label){case 0:return[4,this.getCourseContext().pipe(Object(Pe.mergeMap)(function(){return t.updateContentState(n)})).toPromise()];case 1:return e.sent(),[2]}})})}),Object(Pe.tap)(function(){return Ma(e,void 0,void 0,function(){return wa(this,function(e){switch(e.label){case 0:return[4,this.markContentAsPlayed(n).toPromise()];case 1:return e.sent(),[2]}})})}))):"START"===n.eid&&t.checkIsCourse(n)?this.getCourseContext().pipe(Object(Pe.mapTo)(void 0)):"ASSESS"===n.eid&&t.checkPData(n.context.pdata)?this.processOEAssess(n).pipe(Object(Pe.tap)(function(){return Ma(e,void 0,void 0,function(){var t;return wa(this,function(e){switch(e.label){case 0:return[4,this.getCourseContext().toPromise()];case 1:return t=e.sent(),n.context.cdata.find(function(e){return"AttemptId"===e.type})&&t.userId&&t.courseId&&t.batchId?[4,this.courseService.captureAssessmentEvent({event:n,courseContext:t})]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2]}})})}),Object(Pe.tap)(function(){return Ma(e,void 0,void 0,function(){return wa(this,function(e){switch(e.label){case 0:return[4,this.summarizerService.saveLearnerAssessmentDetails(n).pipe(Object(Pe.mapTo)(void 0)).toPromise()];case 1:return e.sent(),[2]}})})})):"END"===n.eid&&t.checkPData(n.context.pdata)?this.processOEEnd(n).pipe(Object(Pe.tap)(function(){return Ma(e,void 0,void 0,function(){return wa(this,function(e){switch(e.label){case 0:return[4,this.summarizerService.saveLearnerContentSummaryDetails(n).pipe(Object(Pe.mapTo)(void 0)).toPromise()];case 1:return e.sent(),[2]}})})}),Object(Pe.tap)(function(){return Ma(e,void 0,void 0,function(){var t=this;return wa(this,function(e){switch(e.label){case 0:return[4,this.getCourseContext().pipe(Object(Pe.mergeMap)(function(){return t.updateContentState(n)})).toPromise()];case 1:return e.sent(),[2]}})})})):"END"===n.eid&&t.checkIsCourse(n)?this.setCourseContextEmpty():Object(de.of)(void 0)},t.prototype.markContentAsPlayed=function(e){var n=this,r=e.actor.id,i=e.object.id,t={contentId:i};return this.contentService.getContentDetails(t).pipe(Object(Pe.mergeMap)(function(t){var e={status:Pi.PLAYED,contentId:i,contentType:t.contentType};return n.profileService.addContentAccess(e).pipe(Object(Pe.mergeMap)(function(){var e={uid:r,contentId:i,data:JSON.stringify(t.contentData),marker:or.PREVIEWED,isMarked:!0,extraInfo:{}};return n.contentService.setContentMarker(e).pipe(Object(Pe.mapTo)(!0))}))}))},t.prototype.getCourseContext=function(){return this.sharedPreference.getString(te.COURSE_CONTEXT).pipe(Object(Pe.map)(function(e){return e?JSON.parse(e):{}}))},t.prototype.checkStatusOfContent=function(e,t,n,r){var i=this,o={userId:e,batchId:n,contentIds:[r],courseIds:[t]};return this.courseService.getContentState(o).pipe(Object(Pe.map)(function(e){var t=e&&e.contentList;return i.getStatus(t,r)}))},t.prototype.getStatus=function(e,t){void 0===e&&(e=[]);var n=e.find(function(e){return e.contentId===t});return n&&n.status||0},t.prototype.processOEStart=function(e){return this.currentUID=e.actor.id,this.currentContentID=e.object.id,Object(de.of)(void 0)},t.prototype.processOEAssess=function(e){var t=this;return this.currentUID&&this.currentContentID&&this.currentUID.toLocaleLowerCase()===e.actor.id.toLocaleLowerCase()&&this.currentContentID.toLocaleLowerCase()===e.object.id.toLocaleLowerCase()?this.summarizerService.deletePreviousAssessmentDetails(this.currentUID,this.currentContentID).pipe(Object(Pe.tap)(function(){t.currentUID=void 0,t.currentContentID=void 0}),Object(Pe.mapTo)(void 0)):Object(de.of)(void 0)},t.prototype.processOEEnd=function(e){return Object(de.of)(void 0)},t.CONTENT_PLAYER_PID="contentplayer",t}(),Ia=function(o,a,c,s){return new(c||(c=Promise))(function(e,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new c(function(e){e(t.value)}).then(n,r)}i((s=s.apply(o,a||[])).next())})},Pa=function(n,r){var i,o,a,e,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,o&&(a=o[2&t[0]?"return":t[0]?"throw":"next"])&&!(a=a.call(o,t[1])).done)return a;switch(o=0,a&&(t=[0,a.value]),t[0]){case 0:case 1:a=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,o=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]e?t.index:e},0);e.frameworks.sort(function(e,t){return(e.index||n+1)-(t.index||n+1)})}return e}))},e.prototype.fetchFromServer=function(e){var t=(new H.Builder).withType(j.GET).withPath(this.frameworkServiceConfig.channelApiPath+this.GET_FRAMEWORK_DETAILS_ENDPOINT+"/"+e.channelId).withApiToken(!0).build();return this.apiService.fetch(t).pipe(Object(Pe.map)(function(e){return e.body.result.channel}))},e.prototype.fetchFromFile=function(e){var t=oo.ASSETS_PATH+this.frameworkServiceConfig.channelConfigDirPath,n=this.CHANNEL_FILE_KEY_PREFIX+e.channelId+".json";return Object(de.from)(this.fileService.readFileFromAssets(t.concat("/",n))).pipe(Object(Pe.map)(function(e){return JSON.parse(e).result.channel}))},e}(),pc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=n.categories.length-1||e.category===n.categories[t+1].code})),e})}):e}),pc({},n)):n},n.prepareFrameworkTranslations=function(e,t){return e.name=n.getTranslatedValue(e.translations,t,e.name),e.categories&&(e.categories=e.categories.map(function(e){return e.name=n.getTranslatedValue(e.translations,t,e.name),e.terms&&(e.terms=e.terms.map(function(e){return e.name=n.getTranslatedValue(e.translations,t,e.name),e})),e})),e},n.prepareFrameworkCategoryTranslations=function(e,t){return e.name=n.getTranslatedValue(e.translations,t,e.name),e.terms&&(e.terms=e.terms.map(function(e){return e.name=n.getTranslatedValue(e.translations,t,e.name),e})),e},n.getTranslatedValue=function(e,t,n){return e&&JSON.parse(e)[t]||n},n}(),_c=function(){function e(e,t,n,r,i){this.frameworkService=e,this.apiService=t,this.frameworkServiceConfig=n,this.fileService=r,this.cachedItemStore=i,this.FRAMEWORK_FILE_KEY_PREFIX="framework-",this.FRAMEWORK_LOCAL_KEY="framework-",this.GET_FRAMEWORK_DETAILS_ENDPOINT="/read"}return e.prototype.handle=function(t){var n=this;return Object(de.iif)(function(){return!!t.frameworkId},Object(de.defer)(function(){return n.cachedItemStore.getCached(t.frameworkId,n.FRAMEWORK_LOCAL_KEY,"ttl_"+n.FRAMEWORK_LOCAL_KEY,function(){return n.fetchFromServer(t)},function(){return n.fetchFromFile(t)})}),Object(de.defer)(function(){return n.frameworkService.getDefaultChannelDetails().pipe(Object(Pe.mergeMap)(function(e){return n.frameworkService.getFrameworkDetails({frameworkId:e.defaultFramework,requiredCategories:t.requiredCategories})}))}))},e.prototype.fetchFromServer=function(e){var t=(new H.Builder).withType(j.GET).withPath(this.frameworkServiceConfig.frameworkApiPath+this.GET_FRAMEWORK_DETAILS_ENDPOINT+"/"+e.frameworkId).withParameters({categories:e.requiredCategories.join(",")}).withApiToken(!0).build();return this.apiService.fetch(t).pipe(Object(Pe.map)(function(e){return e.body.result.framework}),Object(Pe.map)(function(e){return bc.prepareFrameworkCategoryAssociations(e)}))},e.prototype.fetchFromFile=function(e){var t=oo.ASSETS_PATH+this.frameworkServiceConfig.frameworkConfigDirPath,n=this.FRAMEWORK_FILE_KEY_PREFIX+e.frameworkId+".json";return Object(de.from)(this.fileService.readFileFromAssets(t.concat("/",n))).pipe(Object(Pe.map)(function(e){return JSON.parse(e).result.framework}),Object(Pe.map)(function(e){return bc.prepareFrameworkCategoryAssociations(e)}))},e}(),Ec=(Oa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}Oa(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),yc=function(n){function r(e){var t=n.call(this,e,"NO_ACTIVE_CHANNEL_FOUND_ERROR")||this;return Object.setPrototypeOf(t,r.prototype),t}return Ec(r,n),r}(B),vc=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var c=e.length-1;0<=c;c--)(i=e[c])&&(a=(o<3?i(a):3a[0]&&t[1]e?t.index:e},0);return t.sort(function(e,t){return(e.index||n+1)-(t.index||n+1)}),t}))},e.prototype.getActiveChannelTranslatedDefaultFrameworkDetails=function(t,n){var r=this;return this.frameworkUtilService.getActiveChannel().pipe(Object(Pe.mergeMap)(function(e){return r.getTranslatedFrameworkDetails(e.defaultFramework,t,n)}))},e.prototype.getTranslatedFrameworkDetails=function(e,t,n){return this.frameworkService.getFrameworkDetails({frameworkId:e,requiredCategories:t}).pipe(Object(Pe.map)(function(e){return bc.prepareFrameworkTranslations(e,n)}))},e.prototype.getAllCategoriesTermsSet=function(e){return e.categories?e.categories.reduce(function(e,t){return e.concat([t.terms||[]])},[]).reduce(function(e,t){return e.concat(t)},[]).reduce(function(e,t){return e.add(t),e},new Tc.a(function(e){return Object(Nc.makeString)(e)})):new Tc.a},e.prototype.getCategoryTerms=function(e,t){return e.categories.find(function(e){return e.code===t.currentCategoryCode}).terms.reduce(function(e,t){return e.add(t),e},new Tc.a(function(e){return Object(Nc.makeString)(e)}))},e.prototype.getCategoryAssociationTerms=function(e,n){var r=this;if(!e.categories)return new Tc.a;var t=e.categories.find(function(e){return e.code===n.prevCategoryCode}).terms;if(!t)return new Tc.a;var i=t.filter(function(t){return n.selectedTermsCodes.find(function(e){return e===t.code})}).map(function(e){return e.associations||[]});return i.some(function(e){return 0===e.length})?e.categories.find(function(e){return e.code===n.currentCategoryCode}).terms.reduce(function(e,t){return e.add(t),e},new Tc.a(function(e){return Object(Nc.makeString)(e)})):i.reduce(function(e,t){return e.concat(t)}).reduce(function(e,t){return e.add(t),e},new Tc.a(function(e){return Object(Nc.makeString)(e)})).toArray().map(function(t){return r.getAllCategoriesTermsSet(e).toArray().find(function(e){return e.code===t.code})}).reduce(function(e,t){return e.add(t),e},new Tc.a(function(e){return Object(Nc.makeString)(e)}))},e}(),Ic=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var c=e.length-1;0<=c;c--)(i=e[c])&&(a=(o<3?i(a):3a[0]&&t[1]a[0]&&t[1]a[0]&&t[1] 0",r="SELECT * FROM "+mn.TABLE_NAME+" "+n;return this.dbService.execute(r).toPromise()},e.prototype.rm=function(e,r){return new Promise(function(t,n){try{buildconfigreader.rm(e,r,function(e){t(e)},function(e){console.error(e),n(!1)})}catch(e){console.error(e),n(!1)}})},e.prototype.getMetaData=function(r){return zc(this,void 0,void 0,function(){return Kc(this,function(e){return[2,new Promise(function(t,n){buildconfigreader.getMetaData(r,function(e){t(e)},function(e){console.error(e),n(e)})})]})})},e}(),Xc=Object.assign||function(e){for(var t,n=1,r=arguments.length;na[0]&&t[1]a[0]&&t[1] 0",o="select * from "+mn.TABLE_NAME+" "+i+" "+n;return this.dbService.execute(o).toPromise()},r.EKSTEP_CONTENT_ARCHIVE="ekstep.content.archive",r.SUPPORTED_MANIFEST_VERSION="1.1",r}(),as=function(){function i(e,t){this.dbService=e,this.exportHandler=t}return i.prototype.execute=function(e){var t=new V,n=this.exportHandler.populateItems(e.contentModelsToExport);e.items=[],e.manifest={},e.items=e.items.concat(n);var r={ttl:24};return r.count=e.items.length,r.items=e.items,e.manifest.id=i.EKSTEP_CONTENT_ARCHIVE,e.manifest.ver=i.SUPPORTED_MANIFEST_VERSION,e.manifest.ts=Ce().format(),e.manifest.archive=r,t.body=e,Promise.resolve(t)},i.EKSTEP_CONTENT_ARCHIVE="ekstep.content.archive",i.SUPPORTED_MANIFEST_VERSION="1.1",i}(),cs=function(){function e(e,t){this.fileService=e,this.deviceInfo=t}return e.prototype.execute=function(n){var r=this,i=new V;return this.deviceInfo.getAvailableInternalMemorySize().toPromise().then(function(e){var t=Number(e);if(0a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]T.pkgVersion&&T.childNodes&&0a[0]&&t[1] 0";return this.dbService.execute(t).toPromise()},e.prototype.updateAllRootContentSize=function(){var e=this,t="SELECT * FROM "+mn.TABLE_NAME+" WHERE "+mn.COLUMN_NAME_REF_COUNT+" > 0\n AND "+mn.COLUMN_NAME_VISIBILITY+" = '"+br.DEFAULT.valueOf()+"'";return this.dbService.execute(t).pipe(Object(Pe.tap)(function(){return Ns(e,void 0,void 0,function(){return Ms(this,function(e){return[2,this.sharedPreferences.putBoolean(te.KEY_IS_UPDATE_SIZE_ON_DEVICE_SUCCESSFUL,!1).toPromise()]})})}),Object(Pe.mergeMap)(function(n){return Ns(e,void 0,void 0,function(){var i,t=this;return Ms(this,function(e){switch(e.label){case 0:return i=[],[4,Promise.all(n.map(function(r){return Ns(t,void 0,void 0,function(){var t,n;return Ms(this,function(e){switch(e.label){case 0:return[4,this.getSizeOnDevice(r)];case 1:return t=e.sent(),(n=JSON.parse(r[mn.COLUMN_NAME_LOCAL_DATA]).childNodes)?[4,this.findAllChildContents(n)]:[3,3];case 2:e.sent().forEach(function(e){t+=e[mn.COLUMN_NAME_SIZE_ON_DEVICE]||0}),r[mn.COLUMN_NAME_SIZE_ON_DEVICE]=t,i.push(r),e.label=3;case 3:return[2]}})})}))];case 1:return e.sent(),this.updateInDb(i),[2]}})})}),Object(Pe.tap)(function(){return Ns(e,void 0,void 0,function(){return Ms(this,function(e){return[2,this.sharedPreferences.putBoolean(te.KEY_IS_UPDATE_SIZE_ON_DEVICE_SUCCESSFUL,!0).toPromise()]})})}))},e.prototype.getSizeOnDevice=function(a){return Ns(this,void 0,void 0,function(){var t,n,r,i,o;return Ms(this,function(e){switch(e.label){case 0:return t=0,a[mn.COLUMN_NAME_MIME_TYPE]!==dr.COLLECTION.valueOf()?[3,3]:a[mn.COLUMN_NAME_VISIBILITY]!==br.DEFAULT.valueOf()?[3,2]:(n=[],r={},i=a[mn.COLUMN_NAME_IDENTIFIER],r.identifier=i,r.path=a[mn.COLUMN_NAME_PATH],n.push(r),[4,this.getMetaData(n)]);case 1:o=e.sent(),t=o[i]?o[i].size:0,e.label=2;case 2:return[3,4];case 3:t=a[mn.COLUMN_NAME_SIZE_ON_DEVICE]?a[mn.COLUMN_NAME_SIZE_ON_DEVICE]:0,e.label=4;case 4:return[2,Promise.resolve(t||0)]}})})},e.prototype.updateInDb=function(a){return Ns(this,void 0,void 0,function(){var t,n,r,i,o;return Ms(this,function(e){for(this.dbService.beginTransaction(),t=0,n=a;ta[0]&&t[1]t&&(t=e[mn.COLUMN_NAME_CONTENT_STATE]),t},e.prototype.getBasePath=function(e,t,n){return e&&!t?e:n},e.prototype.getReferenceCount=function(e,t,n,r){var i;e?(i=e[mn.COLUMN_NAME_REF_COUNT],(r?r[e[mn.COLUMN_NAME_IDENTIFIER]]:void 0)||n||br.DEFAULT.valueOf()===e[Ps]&&br.DEFAULT.valueOf()===t||(i+=1)):i=1;return i},e.prototype.postImportProgressEvent=function(e,t){this.eventsBusService.emit({namespace:Te.CONTENT,event:{type:Lr.IMPORT_PROGRESS,payload:{totalCount:t,currentCount:e}}})},e.prototype.constructContentDBModel=function(e,t,n,r,i,o,a,c,s,u,f,l,h,d,p){var b;return(b={})[mn.COLUMN_NAME_IDENTIFIER]=e,b[mn.COLUMN_NAME_SERVER_DATA]="",b[mn.COLUMN_NAME_PATH]=co.getBasePath(a),b[mn.COLUMN_NAME_REF_COUNT]=c,b[mn.COLUMN_NAME_CONTENT_STATE]=s,b[mn.COLUMN_NAME_SIZE_ON_DEVICE]=l,b[mn.COLUMN_NAME_MANIFEST_VERSION]=t,b[mn.COLUMN_NAME_LOCAL_DATA]=n,b[mn.COLUMN_NAME_MIME_TYPE]=r,b[mn.COLUMN_NAME_CONTENT_TYPE]=i,b[mn.COLUMN_NAME_VISIBILITY]=o,b[mn.COLUMN_NAME_AUDIENCE]=u,b[mn.COLUMN_NAME_PRAGMA]=f,b[mn.COLUMN_NAME_LOCAL_LAST_UPDATED_ON]=Ce(Date.now()).format(),b[mn.COLUMN_NAME_BOARD]=co.getContentAttribute(h),b[mn.COLUMN_NAME_MEDIUM]=co.getContentAttribute(d),b[mn.COLUMN_NAME_GRADE]=co.getContentAttribute(p),b},e.prototype.createDirectories=function(r,i){return Cs(this,void 0,void 0,function(){return Is(this,function(e){return[2,new Promise(function(t,n){buildconfigreader.createDirectories(co.getBasePath(r),i,function(e){t(e)},function(e){console.error(e),n(e)})})]})})},e}(),Rs=n(114),Ds=n.n(Rs),Us=function(o,a,c,s){return new(c||(c=Promise))(function(e,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new c(function(e){e(t.value)}).then(n,r)}i((s=s.apply(o,a||[])).next())})},js=function(n,r){var i,o,a,e,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,o&&(a=o[2&t[0]?"return":t[0]?"throw":"next"])&&!(a=a.call(o,t[1])).done)return a;switch(o=0,a&&(t=[0,a.value]),t[0]){case 0:case 1:a=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,o=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1] ?",[Date.now().toString(),Date.now().toString()];break;case Th.UNREAD:Cn.COLUMN_NAME_NOTIFICATION_DISPLAY_TIME+" <= ?\n AND "+Cn.COLUMN_NAME_EXPIRY_TIME+" > ? AND\n AND "+Cn.COLUMN_NAME_IS_READ+" > ?",[Date.now().toString(),Date.now().toString(),0];break;case Th.READ:default:Cn.COLUMN_NAME_NOTIFICATION_DISPLAY_TIME+" <= ?\n AND "+Cn.COLUMN_NAME_EXPIRY_TIME+" > ?\n AND "+Cn.COLUMN_NAME_IS_READ+" > ?",[Date.now().toString(),Date.now().toString(),1]}return{table:Cn.TABLE_NAME,orderBy:Cn.COLUMN_NAME_NOTIFICATION_RECEIVED_AT+" desc"}},e}(),Kh=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var c=e.length-1;0<=c;c--)(i=e[c])&&(a=(o<3?i(a):3a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1] {\n window.location.href = `"+a.buildUrl(t,n,r)+"`;\n })()"}),[2]})})},a.prototype.success=function(){return Pp(this,void 0,void 0,function(){return Lp(this,function(e){return[2,Ip({},this.captured)]})})},a.prototype.fail=function(){return Pp(this,void 0,void 0,function(){return Lp(this,function(e){throw Ip({},this.captured)})})},a.prototype.getCaptureExtras=function(){return Pp(this,void 0,void 0,function(){return Lp(this,function(e){return[2,Ip({},this.extras)]})})},a}(),Dp=function(o,a,c,s){return new(c||(c=Promise))(function(e,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new c(function(e){e(t.value)}).then(n,r)}i((s=s.apply(o,a||[])).next())})},Up=function(n,r){var i,o,a,e,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,o&&(a=o[2&t[0]?"return":t[0]?"throw":"next"])&&!(a=a.call(o,t[1])).done)return a;switch(o=0,a&&(t=[0,a.value]),t[0]){case 0:case 1:a=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,o=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function d(e,t){if(l.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 n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(r)return U(e).length;t=(""+t).toLowerCase(),r=!0}}function p(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):2147483647=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:_(e,t,n,r,i);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):_(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function _(e,t,n,r,i){var o,a=1,c=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;c/=a=2,s/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=n;o>>10&1023|55296),f=56320|1023&f),r.push(f),i+=l}return function(e){var t=e.length;if(t<=m)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return g(this,t,n);case"ascii":return S(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return v(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",t=x.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},l.prototype.compare=function(e,t,n,r,i){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(i<=r&&n<=t)return 0;if(i<=r)return-1;if(n<=t)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),c=Math.min(o,a),s=this.slice(r,i),u=e.slice(t,n),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o,a,c,s,u,f,l,h,d,p=!1;;)switch(r){case"hex":return E(this,e,t,n);case"utf8":case"utf-8":return h=t,d=n,k(U(e,(l=this).length-h),l,h,d);case"ascii":return y(this,e,t,n);case"latin1":case"binary":return y(this,e,t,n);case"base64":return s=this,u=t,f=n,k(j(e),s,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=t,c=n,k(function(e,t){for(var n,r,i,o=[],a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(e,(o=this).length-a),o,a,c);default:if(p)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),p=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var m=4096;function S(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ie.length)throw new RangeError("Index out of range")}function w(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function C(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function I(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(e,t,n,r,i){return i||I(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,i){return i||I(e,0,n,8),o.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):r>>8):w(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):w(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=0,a=1,c=0;for(this[t]=255&e;++o>0)-c&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=n-1,a=1,c=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===c&&0!==this[t+o+1]&&(c=1),this[t+o]=(e/a>>0)-c&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):w(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):w(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return P(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return P(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function j(e){return r.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function k(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,t(15))},function(e,t,A){(function(e){!function(e,t){"use strict";function _(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function E(e,t,n){if(E.isBN(e))return e;this.negative=0,this.words=null,this.length=0,(this.red=null)!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var r;"object"==typeof e?e.exports=E:t.BN=E,(E.BN=E).wordSize=26;try{r=A(185).Buffer}catch(e){}function a(e,t,n){for(var r=0,i=Math.min(e.length,n),o=t;o>>26-a&67108863,26<=(a+=24)&&(a-=26,i++);else if("le"===n)for(i=r=0;r>>26-a&67108863,26<=(a+=24)&&(a-=26,i++);return this.strip()},E.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n>>26-o&4194303,26<=(o+=24)&&(o-=26,r++);n+6!==t&&(i=a(e,t,n+6),this.words[r]|=i<>>26-o&4194303),this.strip()},E.prototype._parseBase=function(e,t,n){this.words=[0];for(var r=0,i=this.length=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,c=Math.min(o,o-a)+n,s=0,u=n;u"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function i(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;r=(n.length=r)-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,c=67108863&a,s=a/67108864|0;n.words[0]=c;for(var u=1;u>>26,l=67108863&s,h=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=h;d++){var p=u-d|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&a}n.words[u]=0|l,s=0|f}return 0!==s?n.words[u]=0|s:n.length--,n.strip()}E.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var r=0,i=0,o=0;o>>24-r&16777215)||o!==this.length-1?h[6-c.length]+c+n:c+n,26<=(r+=2)&&(r-=26,o--)}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&2<=e&&e<=36){var s=d[e],u=p[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var l=f.modn(u).toString(e);n=(f=f.idivn(u)).isZero()?l+n:h[s-l.length]+l+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}_(!1,"Base should be between 2 and 36")},E.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]:2>>=13),64<=t&&(n+=7,t>>>=7),8<=t&&(n+=4,t>>>=4),2<=t&&(n+=2,t>>>=2),n+t},E.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},E.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},E.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},E.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},E.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},E.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},E.prototype.iuxor=function(e){var t,n;n=this.length>e.length?(t=this,e):(t=e,this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},E.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},E.prototype.inotn=function(e){_("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),0>26-n),this.strip()},E.prototype.notn=function(e){return this.clone().inotn(e)},E.prototype.setn=function(e,t){_("number"==typeof e&&0<=e);var n=e/26|0,r=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,e):(n=e,this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},E.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 n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;r=0>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,b=d>>>13,_=0|a[2],E=8191&_,y=_>>>13,v=0|a[3],g=8191&v,m=v>>>13,S=0|a[4],A=8191&S,O=S>>>13,T=0|a[5],N=8191&T,M=T>>>13,w=0|a[6],C=8191&w,I=w>>>13,P=0|a[7],L=8191&P,R=P>>>13,D=0|a[8],U=8191&D,j=D>>>13,k=0|a[9],x=8191&k,B=k>>>13,F=0|c[0],V=8191&F,Y=F>>>13,G=0|c[1],H=8191&G,q=G>>>13,z=0|c[2],K=8191&z,W=z>>>13,X=0|c[3],J=8191&X,Q=X>>>13,$=0|c[4],Z=8191&$,ee=$>>>13,te=0|c[5],ne=8191&te,re=te>>>13,ie=0|c[6],oe=8191&ie,ae=ie>>>13,ce=0|c[7],se=8191&ce,ue=ce>>>13,fe=0|c[8],le=8191&fe,he=fe>>>13,de=0|c[9],pe=8191&de,be=de>>>13;n.negative=e.negative^t.negative,n.length=19;var _e=(u+(r=Math.imul(l,V))|0)+((8191&(i=(i=Math.imul(l,Y))+Math.imul(h,V)|0))<<13)|0;u=((o=Math.imul(h,Y))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(p,V),i=(i=Math.imul(p,Y))+Math.imul(b,V)|0,o=Math.imul(b,Y);var Ee=(u+(r=r+Math.imul(l,H)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(h,H)|0))<<13)|0;u=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(E,V),i=(i=Math.imul(E,Y))+Math.imul(y,V)|0,o=Math.imul(y,Y),r=r+Math.imul(p,H)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,q)|0;var ye=(u+(r=r+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,W)|0)+Math.imul(h,K)|0))<<13)|0;u=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(g,V),i=(i=Math.imul(g,Y))+Math.imul(m,V)|0,o=Math.imul(m,Y),r=r+Math.imul(E,H)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(y,H)|0,o=o+Math.imul(y,q)|0,r=r+Math.imul(p,K)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0;var ve=(u+(r=r+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,Q)|0)+Math.imul(h,J)|0))<<13)|0;u=((o=o+Math.imul(h,Q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(A,V),i=(i=Math.imul(A,Y))+Math.imul(O,V)|0,o=Math.imul(O,Y),r=r+Math.imul(g,H)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,q)|0,r=r+Math.imul(E,K)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,W)|0,r=r+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,Q)|0;var ge=(u+(r=r+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(h,Z)|0))<<13)|0;u=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(N,V),i=(i=Math.imul(N,Y))+Math.imul(M,V)|0,o=Math.imul(M,Y),r=r+Math.imul(A,H)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,q)|0,r=r+Math.imul(g,K)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0,r=r+Math.imul(E,J)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,Q)|0,r=r+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,ee)|0;var me=(u+(r=r+Math.imul(l,ne)|0)|0)+((8191&(i=(i=i+Math.imul(l,re)|0)+Math.imul(h,ne)|0))<<13)|0;u=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(C,V),i=(i=Math.imul(C,Y))+Math.imul(I,V)|0,o=Math.imul(I,Y),r=r+Math.imul(N,H)|0,i=(i=i+Math.imul(N,q)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,q)|0,r=r+Math.imul(A,K)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Q)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,Q)|0,r=r+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(b,ne)|0,o=o+Math.imul(b,re)|0;var Se=(u+(r=r+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ae)|0)+Math.imul(h,oe)|0))<<13)|0;u=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,V),i=(i=Math.imul(L,Y))+Math.imul(R,V)|0,o=Math.imul(R,Y),r=r+Math.imul(C,H)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,q)|0,r=r+Math.imul(N,K)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,W)|0,r=r+Math.imul(A,J)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Q)|0,r=r+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Ae=(u+(r=r+Math.imul(l,se)|0)|0)+((8191&(i=(i=i+Math.imul(l,ue)|0)+Math.imul(h,se)|0))<<13)|0;u=((o=o+Math.imul(h,ue)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(U,V),i=(i=Math.imul(U,Y))+Math.imul(j,V)|0,o=Math.imul(j,Y),r=r+Math.imul(L,H)|0,i=(i=i+Math.imul(L,q)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,q)|0,r=r+Math.imul(C,K)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,W)|0,r=r+Math.imul(N,J)|0,i=(i=i+Math.imul(N,Q)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,Q)|0,r=r+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(p,se)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,se)|0,o=o+Math.imul(b,ue)|0;var Oe=(u+(r=r+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,he)|0)+Math.imul(h,le)|0))<<13)|0;u=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(x,V),i=(i=Math.imul(x,Y))+Math.imul(B,V)|0,o=Math.imul(B,Y),r=r+Math.imul(U,H)|0,i=(i=i+Math.imul(U,q)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,q)|0,r=r+Math.imul(L,K)|0,i=(i=i+Math.imul(L,W)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,W)|0,r=r+Math.imul(C,J)|0,i=(i=i+Math.imul(C,Q)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,Q)|0,r=r+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(A,ne)|0,i=(i=i+Math.imul(A,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0,r=r+Math.imul(E,se)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(y,se)|0,o=o+Math.imul(y,ue)|0,r=r+Math.imul(p,le)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,he)|0;var Te=(u+(r=r+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,be)|0)+Math.imul(h,pe)|0))<<13)|0;u=((o=o+Math.imul(h,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(x,H),i=(i=Math.imul(x,q))+Math.imul(B,H)|0,o=Math.imul(B,q),r=r+Math.imul(U,K)|0,i=(i=i+Math.imul(U,W)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,W)|0,r=r+Math.imul(L,J)|0,i=(i=i+Math.imul(L,Q)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,Q)|0,r=r+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,ee)|0,r=r+Math.imul(N,ne)|0,i=(i=i+Math.imul(N,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,r=r+Math.imul(g,se)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(m,se)|0,o=o+Math.imul(m,ue)|0,r=r+Math.imul(E,le)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,he)|0;var Ne=(u+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(x,K),i=(i=Math.imul(x,W))+Math.imul(B,K)|0,o=Math.imul(B,W),r=r+Math.imul(U,J)|0,i=(i=i+Math.imul(U,Q)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,Q)|0,r=r+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(I,ne)|0,o=o+Math.imul(I,re)|0,r=r+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(A,se)|0,i=(i=i+Math.imul(A,ue)|0)+Math.imul(O,se)|0,o=o+Math.imul(O,ue)|0,r=r+Math.imul(g,le)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,he)|0;var Me=(u+(r=r+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(y,pe)|0))<<13)|0;u=((o=o+Math.imul(y,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(x,J),i=(i=Math.imul(x,Q))+Math.imul(B,J)|0,o=Math.imul(B,Q),r=r+Math.imul(U,Z)|0,i=(i=i+Math.imul(U,ee)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,ee)|0,r=r+Math.imul(L,ne)|0,i=(i=i+Math.imul(L,re)|0)+Math.imul(R,ne)|0,o=o+Math.imul(R,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,r=r+Math.imul(N,se)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(M,se)|0,o=o+Math.imul(M,ue)|0,r=r+Math.imul(A,le)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(O,le)|0,o=o+Math.imul(O,he)|0;var we=(u+(r=r+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,be)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(x,Z),i=(i=Math.imul(x,ee))+Math.imul(B,Z)|0,o=Math.imul(B,ee),r=r+Math.imul(U,ne)|0,i=(i=i+Math.imul(U,re)|0)+Math.imul(j,ne)|0,o=o+Math.imul(j,re)|0,r=r+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,r=r+Math.imul(C,se)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(I,se)|0,o=o+Math.imul(I,ue)|0,r=r+Math.imul(N,le)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(M,le)|0,o=o+Math.imul(M,he)|0;var Ce=(u+(r=r+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,be)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(x,ne),i=(i=Math.imul(x,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(U,oe)|0,i=(i=i+Math.imul(U,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,r=r+Math.imul(L,se)|0,i=(i=i+Math.imul(L,ue)|0)+Math.imul(R,se)|0,o=o+Math.imul(R,ue)|0,r=r+Math.imul(C,le)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(I,le)|0,o=o+Math.imul(I,he)|0;var Ie=(u+(r=r+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,be)|0)+Math.imul(M,pe)|0))<<13)|0;u=((o=o+Math.imul(M,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(x,oe),i=(i=Math.imul(x,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(U,se)|0,i=(i=i+Math.imul(U,ue)|0)+Math.imul(j,se)|0,o=o+Math.imul(j,ue)|0,r=r+Math.imul(L,le)|0,i=(i=i+Math.imul(L,he)|0)+Math.imul(R,le)|0,o=o+Math.imul(R,he)|0;var Pe=(u+(r=r+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(x,se),i=(i=Math.imul(x,ue))+Math.imul(B,se)|0,o=Math.imul(B,ue),r=r+Math.imul(U,le)|0,i=(i=i+Math.imul(U,he)|0)+Math.imul(j,le)|0,o=o+Math.imul(j,he)|0;var Le=(u+(r=r+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,be)|0)+Math.imul(R,pe)|0))<<13)|0;u=((o=o+Math.imul(R,be)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(x,le),i=(i=Math.imul(x,he))+Math.imul(B,le)|0,o=Math.imul(B,he);var Re=(u+(r=r+Math.imul(U,pe)|0)|0)+((8191&(i=(i=i+Math.imul(U,be)|0)+Math.imul(j,pe)|0))<<13)|0;u=((o=o+Math.imul(j,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var De=(u+(r=Math.imul(x,pe))|0)+((8191&(i=(i=Math.imul(x,be))+Math.imul(B,pe)|0))<<13)|0;return u=((o=Math.imul(B,be))+(i>>>13)|0)+(De>>>26)|0,De&=67108863,s[0]=_e,s[1]=Ee,s[2]=ye,s[3]=ve,s[4]=ge,s[5]=me,s[6]=Se,s[7]=Ae,s[8]=Oe,s[9]=Te,s[10]=Ne,s[11]=Me,s[12]=we,s[13]=Ce,s[14]=Ie,s[15]=Pe,s[16]=Le,s[17]=Re,s[18]=De,0!==u&&(s[19]=u,n.length++),n};function c(e,t,n){return(new s).mulp(e,t,n)}function s(e,t){this.x=e,this.y=t}Math.imul||(o=i),E.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?o(this,e,t):n<63?i(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=c,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):c(this,e,t)},s.prototype.makeRBT=function(e){for(var t=new Array(e),n=E.prototype._countBits(e)-1,r=0;r>=1;return r},s.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,t+=r/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},E.prototype.muln=function(e){return this.clone().imuln(e)},E.prototype.sqr=function(){return this.mul(this)},E.prototype.isqr=function(){return this.imul(this.clone())},E.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i}return t}(e);if(0===t.length)return new E(1);for(var n=this,r=0;r>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==r){for(t=this.length-1;0<=t;t--)this.words[t+r]=this.words[t];for(t=0;t>>i<o)for(this.length-=o,s=0;s>>i,u=f&a}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},E.prototype.ishrn=function(e,t,n){return _(0===this.negative),this.iushrn(e,t,n)},E.prototype.shln=function(e){return this.clone().ishln(e)},E.prototype.ushln=function(e){return this.clone().iushln(e)},E.prototype.shrn=function(e){return this.clone().ishrn(e)},E.prototype.ushrn=function(e){return this.clone().iushrn(e)},E.prototype.testn=function(e){_("number"==typeof e&&0<=e);var t=e%26,n=(e-t)/26,r=1<>>t<>26)-(c/67108864|0),this.words[r+n]=67108863&i}for(;r>26,this.words[r+n]=67108863&i;if(0===a)return this.strip();for(_(-1===a),r=a=0;r>26,this.words[r]=67108863&i;return this.negative=1,this.strip()},E.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,o=0|i.words[i.length-1];0!==(n=26-this._countBits(o))&&(i=i.ushln(n),r.iushln(n),o=0|i.words[i.length-1]);var a,c=r.length-i.length;if("mod"!==t){(a=new E(null)).length=c+1,a.words=new Array(a.length);for(var s=0;sthis.length||this.cmp(e)<0?{div:new E(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new E(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new E(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,i,o},E.prototype.div=function(e){return this.divmod(e,"div",!1).div},E.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},E.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},E.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},E.prototype.modn=function(e){_(e<=67108863);for(var t=(1<<26)%e,n=0,r=this.length-1;0<=r;r--)n=(t*n+(0|this.words[r]))%e;return n},E.prototype.idivn=function(e){_(e<=67108863);for(var t=0,n=this.length-1;0<=n;n--){var r=(0|this.words[n])+67108864*t;this.words[n]=r/e|0,t=r%e}return this.strip()},E.prototype.divn=function(e){return this.clone().idivn(e)},E.prototype.egcd=function(e){_(0===e.negative),_(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new E(1),i=new E(0),o=new E(0),a=new E(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var s=n.clone(),u=t.clone();!t.isZero();){for(var f=0,l=1;0==(t.words[0]&l)&&f<26;++f,l<<=1);if(0>>26,a&=67108863,this.words[o]=a}return 0!==i&&(this.words[o]=i,this.length++),this},E.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},E.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),1e.length)return 1;if(this.lengththis.n;);var r=t>>22,i=o}i>>>=22,0===(e.words[r-10]=i)&&10>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},E._prime=function(e){if(u[e])return u[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new y;else if("p192"===e)t=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new g}return u[e]=t},m.prototype._verify1=function(e){_(0===e.negative,"red works only with positives"),_(e.red,"red works only with red numbers")},m.prototype._verify2=function(e,t){_(0==(e.negative|t.negative),"red works only with positives"),_(e.red&&e.red===t.red,"red works only with red numbers")},m.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},m.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},m.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return 0<=n.cmp(this.m)&&n.isub(this.m),n._forceRed(this)},m.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return 0<=n.cmp(this.m)&&n.isub(this.m),n},m.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},m.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},m.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},m.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},m.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},m.prototype.isqr=function(e){return this.imul(e,e.clone())},m.prototype.sqr=function(e){return this.mul(e,e)},m.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(_(t%2==1),3===t){var n=this.m.add(new E(1)).iushrn(2);return this.pow(e,n)}for(var r=this.m.subn(1),i=0;!r.isZero()&&0===r.andln(1);)i++,r.iushrn(1);_(!r.isZero());var o=new E(1).toRed(this),a=o.redNeg(),c=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new E(2*s*s).toRed(this);0!==this.pow(s,c).cmp(a);)s.redIAdd(a);for(var u=this.pow(s,r),f=this.pow(e,r.addn(1).iushrn(1)),l=this.pow(e,r),h=i;0!==l.cmp(o);){for(var d=l,p=0;0!==d.cmp(o);p++)d=d.redSqr();_(p>u&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++a||0===r&&0===u)&&(i=this.mul(i,n[o]),o=a=0)):a=0}c=26}return i},m.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},m.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},E.mont=function(e){return new S(e)},n(S,m),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new E(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,A(184)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NAMED_TAG="named",t.NAME_TAG="name",t.UNMANAGED_TAG="unmanaged",t.OPTIONAL_TAG="optional",t.INJECT_TAG="inject",t.MULTI_INJECT_TAG="multi_inject",t.TAGGED="inversify:tagged",t.TAGGED_PROP="inversify:tagged_props",t.PARAM_TYPES="inversify:paramtypes",t.DESIGN_PARAM_TYPES="design:paramtypes",t.POST_CONSTRUCT="post_construct"},function(e,t,n){"use strict";var r=t;r.version=n(191).version,r.utils=n(192),r.rand=n(90),r.curve=n(39),r.curves=n(197),r.ec=n(205),r.eddsa=n(209)},function(e,t,n){e.exports=function(){"use strict";var s="millisecond",d="second",p="minute",b="hour",_="day",E="week",y="month",u="quarter",v="year",i=/^(\d{4})-?(\d{1,2})-?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/,g=/\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,o=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},e={s:o,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+o(r,2,"0")+":"+o(i,2,"0")},m:function(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,y),i=t-r<0,o=e.clone().add(n+(i?-1:1),y);return Number(-(n+(t-r)/(i?r-o:o-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:y,y:v,w:E,d:_,h:b,m:p,s:d,ms:s,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},t={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},a="en",c={};c[a]=t;var f=function(e){return e instanceof h},r=function(e,t,n){var r;if(!e)return a;if("string"==typeof e)c[e]&&(r=e),t&&(c[e]=t,r=e);else{var i=e.name;c[i]=e,r=i}return n||(a=r),r},l=function(e,t,n){if(f(e))return e.clone();var r=t?"string"==typeof t?{format:t,pl:n}:t:{};return r.date=e,new h(r)},m=e;m.l=r,m.i=f,m.w=function(e,t){return l(e,{locale:t.$L,utc:t.$u,$offset:t.$offset})};var h=function(){function e(e){this.$L=this.$L||r(e.locale,null,!0),this.parse(e)}var t=e.prototype;return t.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(m.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(i);if(r)return n?new Date(Date.UTC(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)):new Date(r[1],r[2]-1,r[3]||1,r[4]||0,r[5]||0,r[6]||0,r[7]||0)}return new Date(t)}(e),this.init()},t.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},t.$utils=function(){return m},t.isValid=function(){return!("Invalid Date"===this.$d.toString())},t.isSame=function(e,t){var n=l(e);return this.startOf(t)<=n&&n<=this.endOf(t)},t.isAfter=function(e,t){return l(e)= than the number of constructor arguments of its base class."},t.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",t.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",t.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",t.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",t.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",t.POST_CONSTRUCT_ERROR=function(){for(var e=[],t=0;tt.size())return!1;var n=!0;return this.forEach(function(e){return!!t.contains(e)||(n=!1)}),n},e.prototype.remove=function(e){return!!this.contains(e)&&(this.dictionary.remove(e),!0)},e.prototype.forEach=function(n){this.dictionary.forEach(function(e,t){return n(t)})},e.prototype.toArray=function(){return this.dictionary.values()},e.prototype.isEmpty=function(){return this.dictionary.isEmpty()},e.prototype.size=function(){return this.dictionary.size()},e.prototype.clear=function(){this.dictionary.clear()},e.prototype.toString=function(){return i.toString(this.toArray())},e}();t.default=a},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],f=!1,l=-1;function h(){f&&s&&(f=!1,s.length?u=s.concat(u):l=-1,u.length&&d())}function d(){if(!f){var e=c(h);f=!0;for(var t=u.length;t;){for(s=u,u=[];++l>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function i(e){return 1===e.length?"0"+e:e}function a(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=r,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n,r,i=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a>6|192:(r=a,55296!=(64512&(n=e).charCodeAt(r))||r<0||r+1>=n.length||56320!=(64512&n.charCodeAt(r+1))?i[o++]=c>>12|224:(c=65536+((1023&c)<<10)+(1023&e.charCodeAt(++a)),i[o++]=c>>18|240,i[o++]=c>>12&63|128),c>>6&63|128),63&c|128)}else for(a=0;a>>0}return o},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},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,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,i){return e+t+n+r+i>>>0},t.sum64=function(e,t,n,r){var i=e[t],o=r+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,n,r){return(t+r>>>0>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,i,o,a,c){var s=0,u=t;return s+=(u=u+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,n,r,i,o,a,c){return t+r+o+c>>>0},t.sum64_5_hi=function(e,t,n,r,i,o,a,c,s,u){var f=0,l=t;return f+=(l=l+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,n,r,i,o,a,c,s,u){return t+r+o+c+u>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n=Object.prototype.hasOwnProperty;function r(e){return"function"==typeof e}function a(e){return void 0===e}function c(e){return"[object String]"===Object.prototype.toString.call(e)}o.has=function(e,t){return n.call(e,t)},o.defaultCompare=function(e,t){return e=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=r},function(e,t,n){var r,i,o,a,c,s,l,u;e.exports=(r=n(109),o=(i=r).lib,a=o.WordArray,c=o.Hasher,s=i.algo,l=[],u=s.SHA1=c.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],c=n[4],s=0;s<80;s++){if(s<16)l[s]=0|e[t+s];else{var u=l[s-3]^l[s-8]^l[s-14]^l[s-16];l[s]=u<<1|u>>>31}var f=(r<<5|r>>>27)+c+l[s];f+=s<20?1518500249+(i&o|~i&a):s<40?1859775393+(i^o^a):s<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,c=a,a=o,o=i<<30|i>>>2,i=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=c.clone.call(this);return e._hash=this._hash.clone(),e}}),i.SHA1=c._createHelper(u),i.HmacSHA1=c._createHmacHelper(u),r.SHA1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10);function i(e){return"function"!=typeof e?"symbol"==typeof e?e.toString():e:e.name}function o(e){if(e.name)return e.name;var t=e.toString(),n=t.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+t}t.getServiceIdentifierAsString=i,t.listRegisteredBindingsForServiceIdentifier=function(e,t,n){var r="",i=n(e,t);return 0!==i.length&&(r="\nRegistered bindings:",i.forEach(function(e){var t="Object";null!==e.implementationType&&(t=o(e.implementationType)),r=r+"\n "+t,e.constraint.metaData&&(r=r+" - "+e.constraint.metaData)})),r},t.circularDependencyToException=function n(e){e.childRequests.forEach(function(e){if(function e(t,n){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===n||e(t.parentRequest,n))}(e,e.serviceIdentifier)){var t=function e(t,n){void 0===n&&(n=[]);var r=i(t.serviceIdentifier);return n.push(r),null!==t.parentRequest?e(t.parentRequest,n):n}(e).reverse().join(" --\x3e ");throw new Error(r.CIRCULAR_DEPENDENCY+" "+t)}n(e)})},t.listMetadataForTarget=function(e,t){if(t.isTagged()||t.isNamed()){var n="",r=t.getNamedTag(),i=t.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach(function(e){n+=e.toString()+"\n"})," "+e+"\n "+e+" - "+n}return" "+e},t.getFunctionName=o},function(e,n,t){(function(e){function t(e){return Object.prototype.toString.call(e)}n.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},n.isBoolean=function(e){return"boolean"==typeof e},n.isNull=function(e){return null===e},n.isNullOrUndefined=function(e){return null==e},n.isNumber=function(e){return"number"==typeof e},n.isString=function(e){return"string"==typeof e},n.isSymbol=function(e){return"symbol"==typeof e},n.isUndefined=function(e){return void 0===e},n.isRegExp=function(e){return"[object RegExp]"===t(e)},n.isObject=function(e){return"object"==typeof e&&null!==e},n.isDate=function(e){return"[object Date]"===t(e)},n.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},n.isFunction=function(e){return"function"==typeof e},n.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},n.isBuffer=e.isBuffer}).call(this,t(5).Buffer)},function(e,t,n){"use strict";var r=n(4),i=n(49),o=n(50),a=n(51),c=n(21);function s(e){c.call(this,"digest"),this._hash=e}r(s,c),s.prototype._update=function(e){this._hash.update(e)},s.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new s(a(e))}},function(e,t,n){(function(o){e.exports=function(e,t){for(var n=Math.min(e.length,t.length),r=new o(n),i=0;i=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-n,this.endian);for(var r=0;r>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o>>24]^f[p>>>16&255]^l[b>>>8&255]^h[255&_]^t[E++],a=u[p>>>24]^f[b>>>16&255]^l[_>>>8&255]^h[255&d]^t[E++],c=u[b>>>24]^f[_>>>16&255]^l[d>>>8&255]^h[255&p]^t[E++],s=u[_>>>24]^f[d>>>16&255]^l[p>>>8&255]^h[255&b]^t[E++],d=o,p=a,b=c,_=s;return o=(r[d>>>24]<<24|r[p>>>16&255]<<16|r[b>>>8&255]<<8|r[255&_])^t[E++],a=(r[p>>>24]<<24|r[b>>>16&255]<<16|r[_>>>8&255]<<8|r[255&d])^t[E++],c=(r[b>>>24]<<24|r[_>>>16&255]<<16|r[d>>>8&255]<<8|r[255&p])^t[E++],s=(r[_>>>24]<<24|r[d>>>16&255]<<16|r[p>>>8&255]<<8|r[255&b])^t[E++],[o>>>=0,a>>>=0,c>>>=0,s>>>=0]}var l=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=[],r=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,c=0,s=0;s<256;++s){var u=c^c<<1^c<<2^c<<3^c<<4;u=u>>>8^255&u^99;var f=e[r[n[a]=u]=a],l=e[f],h=e[l],d=257*e[u]^16843008*u;i[0][a]=d<<24|d>>>8,i[1][a]=d<<16|d>>>16,i[2][a]=d<<8|d>>>24,i[3][a]=d,d=16843009*h^65537*l^257*f^16843008*a,o[0][u]=d<<24|d>>>8,o[1][u]=d<<16|d>>>16,o[2][u]=d<<8|d>>>24,o[3][u]=d,0===a?a=c=1:(a=f^e[e[e[h^f]]],c^=e[e[c]])}return{SBOX:n,INV_SBOX:r,SUB_MIX:i,INV_SUB_MIX:o}}();function c(e){this._key=o(e),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var e=this._key,t=e.length,n=t+6,r=4*(n+1),i=[],o=0;o>>24,a=h.SBOX[a>>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a],a^=l[o/t|0]<<24):6>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a]),i[o]=i[o-t]^a}for(var c=[],s=0;s>>24]]^h.INV_SUB_MIX[1][h.SBOX[f>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[f>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&f]]}this._nRounds=n,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(e){return a(e=o(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},c.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),n=i.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[1],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[3],12),n},c.prototype.decryptBlock=function(e){var t=(e=o(e))[1];e[1]=e[3],e[3]=t;var n=a(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),r=i.allocUnsafe(16);return r.writeUInt32BE(n[0],0),r.writeUInt32BE(n[3],4),r.writeUInt32BE(n[2],8),r.writeUInt32BE(n[1],12),r},c.prototype.scrub=function(){r(this._keySchedule),r(this._invKeySchedule),r(this._key)},e.exports.AES=c},function(e,t,n){var d=n(3).Buffer,p=n(49);e.exports=function(e,t,n,r){if(d.isBuffer(e)||(e=d.from(e,"binary")),t&&(d.isBuffer(t)||(t=d.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var i=n/8,o=d.alloc(i),a=d.alloc(r||0),c=d.alloc(0);0n&&(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.once=function(e,t){if(!s(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var n,r,i,o;if(!s(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||s(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(n)){for(o=i;0>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1>>32-t}function u(e,t,n,r,i,o,a){return s(e+(t&n|~t&r)+i+o|0,a)+t|0}function f(e,t,n,r,i,o,a){return s(e+(t&r|n&~r)+i+o|0,a)+t|0}function l(e,t,n,r,i,o,a){return s(e+(t^n^r)+i+o|0,a)+t|0}function h(e,t,n,r,i,o,a){return s(e+(n^(t|~r))+i+o|0,a)+t|0}r(c,i),c.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,r=this._b,i=this._c,o=this._d;r=h(r=h(r=h(r=h(r=l(r=l(r=l(r=l(r=f(r=f(r=f(r=f(r=u(r=u(r=u(r=u(r,i=u(i,o=u(o,n=u(n,r,i,o,e[0],3614090360,7),r,i,e[1],3905402710,12),n,r,e[2],606105819,17),o,n,e[3],3250441966,22),i=u(i,o=u(o,n=u(n,r,i,o,e[4],4118548399,7),r,i,e[5],1200080426,12),n,r,e[6],2821735955,17),o,n,e[7],4249261313,22),i=u(i,o=u(o,n=u(n,r,i,o,e[8],1770035416,7),r,i,e[9],2336552879,12),n,r,e[10],4294925233,17),o,n,e[11],2304563134,22),i=u(i,o=u(o,n=u(n,r,i,o,e[12],1804603682,7),r,i,e[13],4254626195,12),n,r,e[14],2792965006,17),o,n,e[15],1236535329,22),i=f(i,o=f(o,n=f(n,r,i,o,e[1],4129170786,5),r,i,e[6],3225465664,9),n,r,e[11],643717713,14),o,n,e[0],3921069994,20),i=f(i,o=f(o,n=f(n,r,i,o,e[5],3593408605,5),r,i,e[10],38016083,9),n,r,e[15],3634488961,14),o,n,e[4],3889429448,20),i=f(i,o=f(o,n=f(n,r,i,o,e[9],568446438,5),r,i,e[14],3275163606,9),n,r,e[3],4107603335,14),o,n,e[8],1163531501,20),i=f(i,o=f(o,n=f(n,r,i,o,e[13],2850285829,5),r,i,e[2],4243563512,9),n,r,e[7],1735328473,14),o,n,e[12],2368359562,20),i=l(i,o=l(o,n=l(n,r,i,o,e[5],4294588738,4),r,i,e[8],2272392833,11),n,r,e[11],1839030562,16),o,n,e[14],4259657740,23),i=l(i,o=l(o,n=l(n,r,i,o,e[1],2763975236,4),r,i,e[4],1272893353,11),n,r,e[7],4139469664,16),o,n,e[10],3200236656,23),i=l(i,o=l(o,n=l(n,r,i,o,e[13],681279174,4),r,i,e[0],3936430074,11),n,r,e[3],3572445317,16),o,n,e[6],76029189,23),i=l(i,o=l(o,n=l(n,r,i,o,e[9],3654602809,4),r,i,e[12],3873151461,11),n,r,e[15],530742520,16),o,n,e[2],3299628645,23),i=h(i,o=h(o,n=h(n,r,i,o,e[0],4096336452,6),r,i,e[7],1126891415,10),n,r,e[14],2878612391,15),o,n,e[5],4237533241,21),i=h(i,o=h(o,n=h(n,r,i,o,e[12],1700485571,6),r,i,e[3],2399980690,10),n,r,e[10],4293915773,15),o,n,e[1],2240044497,21),i=h(i,o=h(o,n=h(n,r,i,o,e[8],1873313359,6),r,i,e[15],4264355552,10),n,r,e[6],2734768916,15),o,n,e[13],1309151649,21),i=h(i,o=h(o,n=h(n,r,i,o,e[4],4149444226,6),r,i,e[11],3174756917,10),n,r,e[2],718787259,15),o,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+i|0,this._d=this._d+o|0},c.prototype._digest=function(){this._block[this._blockOffset++]=128,56>>32-t}function O(e,t,n,r,i,o,a,c){return A(e+(t^n^r)+o+a|0,c)+i|0}function T(e,t,n,r,i,o,a,c){return A(e+(t&n|~t&r)+o+a|0,c)+i|0}function N(e,t,n,r,i,o,a,c){return A(e+((t|~n)^r)+o+a|0,c)+i|0}function M(e,t,n,r,i,o,a,c){return A(e+(t&r|n&~r)+o+a|0,c)+i|0}function w(e,t,n,r,i,o,a,c){return A(e+(t^(n|~r))+o+a|0,c)+i|0}i(a,o),a.prototype._update=function(){for(var e=_,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,c=0|this._a,s=0|this._b,u=0|this._c,f=0|this._d,l=0|this._e,h=0;h<80;h+=1){var d,p;p=h<16?(d=O(n,r,i,o,a,e[E[h]],m[0],v[h]),w(c,s,u,f,l,e[y[h]],S[0],g[h])):h<32?(d=T(n,r,i,o,a,e[E[h]],m[1],v[h]),M(c,s,u,f,l,e[y[h]],S[1],g[h])):h<48?(d=N(n,r,i,o,a,e[E[h]],m[2],v[h]),N(c,s,u,f,l,e[y[h]],S[2],g[h])):h<64?(d=M(n,r,i,o,a,e[E[h]],m[3],v[h]),T(c,s,u,f,l,e[y[h]],S[3],g[h])):(d=w(n,r,i,o,a,e[E[h]],m[4],v[h]),O(c,s,u,f,l,e[y[h]],S[4],g[h])),n=a,a=o,o=A(i,10),i=r,r=d,c=l,l=f,f=A(u,10),u=s,s=p}var b=this._b+i+f|0;this._b=this._c+o+l|0,this._c=this._d+a+c|0,this._d=this._e+n+s|0,this._e=this._a+r+u|0,this._a=b},a.prototype._digest=function(){this._block[this._blockOffset++]=128,56t.highWaterMark&&(t.highWaterMark=(b<=(n=e)?n=b:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var n}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(g("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?E.nextTick(A,e):A(e))}function A(e){g("emit readable"),e.emit("readable"),w(e)}function O(e,t){t.readingMore||(t.readingMore=!0,E.nextTick(T,e,t))}function T(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n).data=o.slice(a);break}++r}return t.length-=r,i}(e,t):function(e,t){var n=u.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0===(e-=a)){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=o.slice(a);break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function I(e){var t=e._readableState;if(0=t.highWaterMark||t.ended))return g("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):S(this),null;if(0===(e=m(e,t))&&t.ended)return 0===t.length&&I(this),null;var r,i=t.needReadable;return g("need readable",i),(0===t.length||t.length-e=this._blockSize;){for(var i=this._blockOffset;i>>17|n<<15)^(n>>>19|n<<13)^n>>>10)+s[E-7]+(((t=s[E-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+s[E-16];for(var y=0;y<64;++y){var v=_+(((c=d)>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+((a=b)^d&(p^a))+m[y]+s[y]|0,g=0|(((o=u)>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+((r=u)&(i=f)|l&(r|i));_=b,b=p,p=d,d=h+v|0,h=l,l=f,f=u,u=v+g|0}this._a=u+this._a|0,this._b=f+this._b|0,this._c=l+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=_+this._h|0},c.prototype._hash=function(){var e=o.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,n){var r=n(4),i=n(26),o=n(3).Buffer,ee=[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],a=new Array(160);function c(){this.init(),this._w=a,i.call(this,128,112)}function te(e,t,n){return n^e&(t^n)}function ne(e,t,n){return e&t|n&(e|t)}function re(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ie(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function oe(e,t){return e>>>0>>0?1:0}r(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,n,r,i,o,a,c,s,u=this._w,f=0|this._ah,l=0|this._bh,h=0|this._ch,d=0|this._dh,p=0|this._eh,b=0|this._fh,_=0|this._gh,E=0|this._hh,y=0|this._al,v=0|this._bl,g=0|this._cl,m=0|this._dl,S=0|this._el,A=0|this._fl,O=0|this._gl,T=0|this._hl,N=0;N<32;N+=2)u[N]=e.readInt32BE(4*N),u[N+1]=e.readInt32BE(4*N+4);for(;N<160;N+=2){var M=u[N-30],w=u[N-30+1],C=((c=M)>>>1|(s=w)<<31)^(c>>>8|s<<24)^c>>>7,I=((o=w)>>>1|(a=M)<<31)^(o>>>8|a<<24)^(o>>>7|a<<25);M=u[N-4],w=u[N-4+1];var P=((r=M)>>>19|(i=w)<<13)^(i>>>29|r<<3)^r>>>6,L=((t=w)>>>19|(n=M)<<13)^(n>>>29|t<<3)^(t>>>6|n<<26),R=u[N-14],D=u[N-14+1],U=u[N-32],j=u[N-32+1],k=I+D|0,x=C+R+oe(k,I)|0;x=(x=x+P+oe(k=k+L|0,L)|0)+U+oe(k=k+j|0,j)|0,u[N]=x,u[N+1]=k}for(var B=0;B<160;B+=2){x=u[B],k=u[B+1];var F=ne(f,l,h),V=ne(y,v,g),Y=re(f,y),G=re(y,f),H=ie(p,S),q=ie(S,p),z=ee[B],K=ee[B+1],W=te(p,b,_),X=te(S,A,O),J=T+q|0,Q=E+H+oe(J,T)|0;Q=(Q=(Q=Q+W+oe(J=J+X|0,X)|0)+z+oe(J=J+K|0,K)|0)+x+oe(J=J+k|0,k)|0;var $=G+V|0,Z=Y+F+oe($,G)|0;E=_,T=O,_=b,O=A,b=p,A=S,p=d+Q+oe(S=m+J|0,m)|0,d=h,m=g,h=l,g=v,l=f,v=y,f=Q+Z+oe(y=J+$|0,J)|0}this._al=this._al+y|0,this._bl=this._bl+v|0,this._cl=this._cl+g|0,this._dl=this._dl+m|0,this._el=this._el+S|0,this._fl=this._fl+A|0,this._gl=this._gl+O|0,this._hl=this._hl+T|0,this._ah=this._ah+f+oe(this._al,y)|0,this._bh=this._bh+l+oe(this._bl,v)|0,this._ch=this._ch+h+oe(this._cl,g)|0,this._dh=this._dh+d+oe(this._dl,m)|0,this._eh=this._eh+p+oe(this._el,S)|0,this._fh=this._fh+b+oe(this._fl,A)|0,this._gh=this._gh+_+oe(this._gl,O)|0,this._hh=this._hh+E+oe(this._hl,T)|0},c.prototype._hash=function(){var r=o.allocUnsafe(64);function e(e,t,n){r.writeInt32BE(e,n),r.writeInt32BE(t,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),r},e.exports=c},function(e,t,n){"use strict";var r=n(4),i=n(163),a=n(21),c=n(3).Buffer,o=n(77),s=n(50),u=n(51),f=c.alloc(128);function l(e,t){a.call(this,"digest"),"string"==typeof t&&(t=c.from(t));var n="sha512"===e||"sha384"===e?128:64;(this._alg=e,(this._key=t).length>n)?t=("rmd160"===e?new s:u(e)).update(t).digest():t.lengtho?t=i(t):t.lengthe;)n.ishrn(1);if(n.isEven()&&n.iadd(s),n.testn(1)||n.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;n.mod(l).cmp(h);)n.iadd(p)}else for(;n.mod(a).cmp(d);)n.iadd(p);if(_(r=n.shrn(1))&&_(n)&&E(r)&&E(n)&&c.test(r)&&c.test(n))return n}}},function(e,t,n){var d=n(6),r=n(90);function i(e){this.rand=e||new r.Rand}(e.exports=i).create=function(e){return new i(e)},i.prototype._randbelow=function(e){var t=e.bitLength(),n=Math.ceil(t/8);do{var r=new d(this.rand.generate(n))}while(0<=r.cmp(e));return r},i.prototype._randrange=function(e,t){var n=t.sub(e);return e.add(this._randbelow(n))},i.prototype.test=function(e,t,n){var r=e.bitLength(),i=d.mont(e),o=new d(1).toRed(i);t||(t=Math.max(1,r/48|0));for(var a=e.subn(1),c=0;!a.testn(c);c++);for(var s=e.shrn(c),u=a.toRed(i);0>8,a=255&i;o?n.push(o,a):n.push(a)}return n},r.zero2=i,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,n){"use strict";var r=n(17).rotr32;function i(e,t,n){return e&t^~e&n}function o(e,t,n){return e&t^e&n^t&n}function a(e,t,n){return e^t^n}t.ft_1=function(e,t,n,r){return 0===e?i(t,n,r):1===e||3===e?a(t,n,r):2===e?o(t,n,r):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return r(e,2)^r(e,13)^r(e,22)},t.s1_256=function(e){return r(e,6)^r(e,11)^r(e,25)},t.g0_256=function(e){return r(e,7)^r(e,18)^e>>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},function(e,t,n){"use strict";var r=n(17),i=n(32),o=n(92),p=n(11),b=r.sum32,_=r.sum32_4,E=r.sum32_5,y=o.ch32,v=o.maj32,g=o.s0_256,m=o.s1_256,S=o.g0_256,A=o.g1_256,a=i.BlockHash,c=[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];function s(){if(!(this instanceof s))return new s;a.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=c,this.W=new Array(64)}r.inherits(s,a),(e.exports=s).blockSize=512,s.outSize=256,s.hmacStrength=192,s.padLength=64,s.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r>6],i=0==(32&n);if(31==(31&n)){var o=n;for(n=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;n<<=7,n|=127&o}}else n&=31;return{cls:r,primitive:i,tag:n,tagStr:c.tag[n]}}function l(e,t,n){var r=e.readUInt8(n);if(e.isError(r))return r;if(!t&&128===r)return null;if(0==(128&r))return r;var i=127&r;if(4>=8)a++;(i=new u(2+a))[0]=o,i[1]=128|a;c=1+a;for(var s=r.length;0>=8)i[c]=255&s;return this._createEncoderBuffer([i,r])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var n=new u(2*e.length),r=0;r>=7)i++}var a=new u(i),c=a.length-1;for(r=e.length-1;0<=r;r--){o=e[r];for(a[c--]=127&o;0<(o>>=7);)a[c--]=128|127&o}return this._createEncoderBuffer(a)},c.prototype._encodeTime=function(e,t){var n,r=new Date(e);return"gentime"===t?n=[s(r.getFullYear()),s(r.getUTCMonth()+1),s(r.getUTCDate()),s(r.getUTCHours()),s(r.getUTCMinutes()),s(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?n=[s(r.getFullYear()%100),s(r.getUTCMonth()+1),s(r.getUTCDate()),s(r.getUTCHours()),s(r.getUTCMinutes()),s(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.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&&!u.isBuffer(e)){var n=e.toArray();!e.sign&&128&n[0]&&n.unshift(0),e=new u(n)}if(u.isBuffer(e)){var r=e.length;0===e.length&&r++;var i=new u(r);return e.copy(i),0===e.length&&(i[0]=0),this._createEncoderBuffer(i)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);r=1;for(var o=e;256<=o;o>>=8)r++;for(o=(i=new Array(r)).length-1;0<=o;o--)i[o]=255&e,e>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(new u(i))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,n){var r,i=this._baseState;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,n).join()),o.length!==i.defaultBuffer.length)return!1;for(r=0;r>6]+c[128|63&a]:a<55296||57344<=a?i+=c[224|a>>12]+c[128|a>>6&63]+c[128|63&a]:(o+=1,a=65536+((1023&a)<<10|1023&r.charCodeAt(o)),i+=c[240|a>>18]+c[128|a>>12&63]+c[128|a>>6&63]+c[128|63&a])}return i},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function r(n,i,o){if(!i)return n;if("object"!=typeof i){if(Array.isArray(n))n.push(i);else{if("object"!=typeof n)return[n,i];(o&&(o.plainObjects||o.allowPrototypes)||!a.call(Object.prototype,i))&&(n[i]=!0)}return n}if("object"!=typeof n)return[n].concat(i);var e=n;return Array.isArray(n)&&!Array.isArray(i)&&(e=s(n,o)),Array.isArray(n)&&Array.isArray(i)?(i.forEach(function(e,t){a.call(n,t)?n[t]&&"object"==typeof n[t]?n[t]=r(n[t],e,o):n.push(e):n[t]=e}),n):Object.keys(i).reduce(function(e,t){var n=i[t];return a.call(e,t)?e[t]=r(e[t],n,o):e[t]=n,e},e)}}},function(e,t,n){"use strict";var r=String.prototype.replace,i=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,i,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){var r,l,i,o,a,c,h,s,u,f,d,p,b;e.exports=(r=r||(l=Math,i=Object.create||function(){function n(){}return function(e){var t;return n.prototype=e,t=new n,n.prototype=null,t}}(),a=(o={}).lib={},c=a.Base={extend:function(e){var t=i(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).$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)}},h=a.WordArray=c.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,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(var o=0;o>>2]=n[o>>>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=l.ceil(t/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t,n=[],r=function(t){var t=t,n=987654321,r=4294967295;return function(){var e=((n=36969*(65535&n)+(n>>16)&r)<<16)+(t=18e3*(65535&t)+(t>>16)&r)&r;return e/=4294967296,(e+=.5)*(.5>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new h.init(n,t/2)}},f=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new h.init(n,t)}},d=s.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)))}},p=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new h.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,n=t.words,r=t.sigBytes,i=this.blockSize,o=4*i,a=r/o,c=(a=e?l.ceil(a):l.max((0|a)-this._minBufferSize,0))*i,s=l.min(4*c,r);if(c){for(var u=0;u=e.length||n<0||n>=e.length)return!1;var r=e[t];return e[t]=e[n],e[n]=r,!0},t.toString=function(e){return"["+e.toString()+"]"},t.forEach=function(e,t){for(var n=0,r=e;n>>6:(t[o++]=n<65536?224|n>>>12:(t[o++]=240|n>>>18,128|n>>>12&63),128|n>>>6&63),128|63&n);return t},n.buf2binstring=function(e){return f(e,e.length)},n.binstring2buf=function(e){for(var t=new s.Buf8(e.length),n=0,r=t.length;n>10&1023,56320|1023&i)}return f(c,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0?t:0===n?t:n+u[e[n]]>t?n:t}},{"./common":1}],3:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){for(n-=a=2e3>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,r){var i=c,o=r+n;e^=-1;for(var a=r;a>>8^i[255&(e^t[a])];return-1^e}},{}],5:[function(e,t,n){"use strict";var u,h=e("../utils/common"),f=e("./trees"),d=e("./adler32"),p=e("./crc32"),r=e("./messages"),l=0,b=4,_=0,E=-2,s=-1,y=4,i=2,v=8,g=9,o=286,a=30,c=19,m=2*o+1,S=15,A=3,O=258,T=O+A+1,N=42,M=113,w=1,C=2,I=3,P=4;function L(e,t){return e.msg=r[t],t}function R(e){return(e<<1)-(4e.avail_out&&(n=e.avail_out),0!==n&&(h.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function j(e,t){f._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,U(e.strm)}function k(e,t){e.pending_buf[e.pending++]=t}function x(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function B(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,c=e.nice_match,s=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,u=e.window,f=e.w_mask,l=e.prev,h=e.strstart+O,d=u[o+a-1],p=u[o+a];e.prev_length>=e.good_match&&(i>>=2),c>e.lookahead&&(c=e.lookahead);do{if(u[(n=t)+a]===p&&u[n+a-1]===d&&u[n]===u[o]&&u[++n]===u[o+1]){o+=2,n++;do{}while(u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&os&&0!=--i);return a<=e.lookahead?a:e.lookahead}function F(e){var t,n,r,i,o,a,c,s,u,f,l=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=l+(l-T)){for(h.arraySet(e.window,e.window,l,l,0),e.match_start-=l,e.strstart-=l,e.block_start-=l,n=e.hash_size,t=n;r=e.head[--t],e.head[t]=l<=r?r-l:0,--n;);for(t=n=l;r=e.prev[--t],e.prev[t]=l<=r?r-l:0,--n;);i+=l}if(0===e.strm.avail_in)break;if(a=e.strm,c=e.window,s=e.strstart+e.lookahead,u=i,f=void 0,f=a.avail_in,u=A)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<=A&&(e.ins_h=(e.ins_h<=A)if(r=f._tr_tally(e,e.strstart-e.match_start,e.match_length-A),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=A){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=A&&(e.ins_h=(e.ins_h<=A&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-A,r=f._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-A),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<=A&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=A?(n=f._tr_tally(e,1,e.match_length-A),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=f._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(j(e,!1),0===e.strm.avail_out))return w}return e.insert=0,t===b?(j(e,!0),0===e.strm.avail_out?I:P):e.last_lit&&(j(e,!1),0===e.strm.avail_out)?w:C}function H(e,t){for(var n;;){if(0===e.lookahead&&(F(e),0===e.lookahead)){if(t===l)return w;break}if(e.match_length=0,n=f._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(j(e,!1),0===e.strm.avail_out))return w}return e.insert=0,t===b?(j(e,!0),0===e.strm.avail_out?I:P):e.last_lit&&(j(e,!1),0===e.strm.avail_out)?w:C}function q(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function z(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new h.Buf16(2*m),this.dyn_dtree=new h.Buf16(2*(2*a+1)),this.bl_tree=new h.Buf16(2*(2*c+1)),D(this.dyn_ltree),D(this.dyn_dtree),D(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new h.Buf16(S+1),this.heap=new h.Buf16(2*o+1),D(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new h.Buf16(2*o+1),D(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function K(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=i,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?N:M,e.adler=2===t.wrap?0:1,t.last_flush=l,f._tr_init(t),_):L(e,E)}function W(e){var t,n=K(e);return n===_&&((t=e.state).window_size=2*t.w_size,D(t.head),t.max_lazy_match=u[t.level].max_lazy,t.good_match=u[t.level].good_length,t.nice_match=u[t.level].nice_length,t.max_chain_length=u[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=A-1,t.match_available=0,t.ins_h=0),n}function X(e,t,n,r,i,o){if(!e)return E;var a=1;if(t===s&&(t=6),r<0?(a=0,r=-r):15e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(F(e),0===e.lookahead&&t===l)return w;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,j(e,!1),0===e.strm.avail_out))return w;if(e.strstart-e.block_start>=e.w_size-T&&(j(e,!1),0===e.strm.avail_out))return w}return e.insert=0,t===b?(j(e,!0),0===e.strm.avail_out?I:P):(e.strstart>e.block_start&&(j(e,!1),e.strm.avail_out),w)}),new q(4,4,8,4,V),new q(4,5,16,8,V),new q(4,6,32,32,V),new q(4,4,16,16,Y),new q(8,16,32,32,Y),new q(8,16,128,128,Y),new q(8,32,128,256,Y),new q(32,128,258,1024,Y),new q(32,258,258,4096,Y)],n.deflateInit=function(e,t){return X(e,t,v,15,8,0)},n.deflateInit2=X,n.deflateReset=W,n.deflateResetKeep=K,n.deflateSetHeader=function(e,t){return e&&e.state&&2===e.state.wrap?(e.state.gzhead=t,_):E},n.deflate=function(e,t){var n,r,i,o;if(!e||!e.state||5>8&255),k(r,r.gzhead.time>>16&255),k(r,r.gzhead.time>>24&255),k(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),k(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(k(r,255&r.gzhead.extra.length),k(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=p(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(k(r,0),k(r,0),k(r,0),k(r,0),k(r,0),k(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),k(r,3),r.status=M);else{var a=v+(r.w_bits-8<<4)<<8,c=-1;c=2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3,a|=c<<6,0!==r.strstart&&(a|=32),a+=31-a%31,r.status=M,x(r,a),0!==r.strstart&&(x(r,e.adler>>>16),x(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>i&&(e.adler=p(e.adler,r.pending_buf,r.pending-i,i)),U(e),i=r.pending,r.pending!==r.pending_buf_size));)k(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=p(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=p(e.adler,r.pending_buf,r.pending-i,i)),U(e),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindexi&&(e.adler=p(e.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=p(e.adler,r.pending_buf,r.pending-i,i)),U(e),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindexi&&(e.adler=p(e.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&U(e),r.pending+2<=r.pending_buf_size&&(k(r,255&e.adler),k(r,e.adler>>8&255),e.adler=0,r.status=M)):r.status=M),0!==r.pending){if(U(e),0===e.avail_out)return r.last_flush=-1,_}else if(0===e.avail_in&&R(t)<=R(n)&&t!==b)return L(e,-5);if(666===r.status&&0!==e.avail_in)return L(e,-5);if(0!==e.avail_in||0!==r.lookahead||t!==l&&666!==r.status){var s=2===r.strategy?H(r,t):3===r.strategy?G(r,t):u[r.level].func(r,t);if(s!==I&&s!==P||(r.status=666),s===w||s===I)return 0===e.avail_out&&(r.last_flush=-1),_;if(s===C&&(1===t?f._tr_align(r):5!==t&&(f._tr_stored_block(r,0,0,!1),3===t&&(D(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),U(e),0===e.avail_out))return r.last_flush=-1,_}return t!==b?_:r.wrap<=0?1:(2===r.wrap?(k(r,255&e.adler),k(r,e.adler>>8&255),k(r,e.adler>>16&255),k(r,e.adler>>24&255),k(r,255&e.total_in),k(r,e.total_in>>8&255),k(r,e.total_in>>16&255),k(r,e.total_in>>24&255)):(x(r,e.adler>>>16),x(r,65535&e.adler)),U(e),0=n.w_size&&(0===o&&(D(n.head),n.strstart=0,n.block_start=0,n.insert=0),u=new h.Buf8(n.w_size),h.arraySet(u,t,f-n.w_size,n.w_size,0),t=u,f=n.w_size),a=e.avail_in,c=e.next_in,s=e.input,e.avail_in=f,e.next_in=0,e.input=t,F(n);n.lookahead>=A;){for(r=n.strstart,i=n.lookahead-(A-1);n.ins_h=(n.ins_h<>>7)]}function k(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function x(e,t,n){e.bi_valid>d-n?(e.bi_buf|=t<>d-e.bi_valid,e.bi_valid+=n-d):(e.bi_buf|=t<>>=1,n<<=1,0<--t;);return n>>>1}function V(e){16===e.bi_valid?(k(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}function Y(e,t,n){var r,i,o=new Array(E+1),a=0;for(r=1;r<=E;r++)o[r]=a=a+n[r-1]<<1;for(i=0;i<=t;i++){var c=e[2*i+1];0!==c&&(e[2*i]=F(o[c]++,c))}}function G(){var e,t,n,r,i,o=new Array(E+1);for(r=n=0;r>=7;r>1;1<=n;n--)K(e,o,n);for(i=s;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],K(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,K(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,o,a,c,s=t.dyn_tree,u=t.max_code,f=t.stat_desc.static_tree,l=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,b=0;for(o=0;o<=E;o++)e.bl_count[o]=0;for(s[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<_;n++)r=e.heap[n],o=s[2*s[2*r+1]+1]+1,p>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return r;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return i;for(t=32;t>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==t?ne(e,t,n,r):4===e.strategy||o===i?(x(e,2+(r?1:0),3),W(e,T,N)):(x(e,4+(r?1:0),3),Z(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),W(e,e.dyn_ltree,e.dyn_dtree)),H(e),r&&q(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(w[n]+f+1)]++,e.dyn_dtree[2*j(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){x(e,2,3),B(e,b,T),V(e)}},{"../utils/common":1}],8:[function(e,t,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/deflate.js":[function(e,t,n){"use strict";var a=e("./zlib/deflate"),c=e("./utils/common"),s=e("./utils/strings"),i=e("./zlib/messages"),o=e("./zlib/zstream"),u=Object.prototype.toString,f=0,l=-1,h=0,d=8;function p(e){if(!(this instanceof p))return new p(e);this.options=c.assign({level:l,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},e||{});var t=this.options;t.raw&&0>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],c=e[t+1],s=e[t+2],u=e[t+3],f=e[t+4],l=e[t+5],h=e[t+6],d=e[t+7],p=e[t+8],b=e[t+9],_=e[t+10],E=e[t+11],y=e[t+12],v=e[t+13],g=e[t+14],m=e[t+15],S=o[0],A=o[1],O=o[2],T=o[3];A=I(A=I(A=I(A=I(A=C(A=C(A=C(A=C(A=w(A=w(A=w(A=w(A=M(A=M(A=M(A=M(A,O=M(O,T=M(T,S=M(S,A,O,T,a,7,N[0]),A,O,c,12,N[1]),S,A,s,17,N[2]),T,S,u,22,N[3]),O=M(O,T=M(T,S=M(S,A,O,T,f,7,N[4]),A,O,l,12,N[5]),S,A,h,17,N[6]),T,S,d,22,N[7]),O=M(O,T=M(T,S=M(S,A,O,T,p,7,N[8]),A,O,b,12,N[9]),S,A,_,17,N[10]),T,S,E,22,N[11]),O=M(O,T=M(T,S=M(S,A,O,T,y,7,N[12]),A,O,v,12,N[13]),S,A,g,17,N[14]),T,S,m,22,N[15]),O=w(O,T=w(T,S=w(S,A,O,T,c,5,N[16]),A,O,h,9,N[17]),S,A,E,14,N[18]),T,S,a,20,N[19]),O=w(O,T=w(T,S=w(S,A,O,T,l,5,N[20]),A,O,_,9,N[21]),S,A,m,14,N[22]),T,S,f,20,N[23]),O=w(O,T=w(T,S=w(S,A,O,T,b,5,N[24]),A,O,g,9,N[25]),S,A,u,14,N[26]),T,S,p,20,N[27]),O=w(O,T=w(T,S=w(S,A,O,T,v,5,N[28]),A,O,s,9,N[29]),S,A,d,14,N[30]),T,S,y,20,N[31]),O=C(O,T=C(T,S=C(S,A,O,T,l,4,N[32]),A,O,p,11,N[33]),S,A,E,16,N[34]),T,S,g,23,N[35]),O=C(O,T=C(T,S=C(S,A,O,T,c,4,N[36]),A,O,f,11,N[37]),S,A,d,16,N[38]),T,S,_,23,N[39]),O=C(O,T=C(T,S=C(S,A,O,T,v,4,N[40]),A,O,a,11,N[41]),S,A,u,16,N[42]),T,S,h,23,N[43]),O=C(O,T=C(T,S=C(S,A,O,T,b,4,N[44]),A,O,y,11,N[45]),S,A,m,16,N[46]),T,S,s,23,N[47]),O=I(O,T=I(T,S=I(S,A,O,T,a,6,N[48]),A,O,d,10,N[49]),S,A,g,15,N[50]),T,S,l,21,N[51]),O=I(O,T=I(T,S=I(S,A,O,T,y,6,N[52]),A,O,u,10,N[53]),S,A,_,15,N[54]),T,S,c,21,N[55]),O=I(O,T=I(T,S=I(S,A,O,T,p,6,N[56]),A,O,m,10,N[57]),S,A,h,15,N[58]),T,S,v,21,N[59]),O=I(O,T=I(T,S=I(S,A,O,T,f,6,N[60]),A,O,E,10,N[61]),S,A,s,15,N[62]),T,S,b,21,N[63]),o[0]=o[0]+S|0,o[1]=o[1]+A|0,o[2]=o[2]+O|0,o[3]=o[3]+T|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32;var i=f.floor(n/4294967296),o=n;t[15+(r+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t[14+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(t.length+1),this._process();for(var a=this._hash,c=a.words,s=0;s<4;s++){var u=c[s];c[s]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});function M(e,t,n,r,i,o,a){var c=e+(t&n|~t&r)+i+a;return(c<>>32-o)+t}function w(e,t,n,r,i,o,a){var c=e+(t&r|n&~r)+i+a;return(c<>>32-o)+t}function C(e,t,n,r,i,o,a){var c=e+(t^n^r)+i+a;return(c<>>32-o)+t}function I(e,t,n,r,i,o,a){var c=e+(n^(t|~r))+i+a;return(c<>>32-o)+t}e.MD5=r._createHelper(o),e.HmacMD5=r._createHmacHelper(o)}(Math),a.MD5)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(250),i=function(){function e(){this.list=new r.default}return e.prototype.enqueue=function(e){return this.list.add(e)},e.prototype.add=function(e){return this.list.add(e)},e.prototype.dequeue=function(){if(0!==this.list.size()){var e=this.list.first();return this.list.removeElementAtIndex(0),e}},e.prototype.peek=function(){if(0!==this.list.size())return this.list.first()},e.prototype.size=function(){return this.list.size()},e.prototype.contains=function(e,t){return this.list.contains(e,t)},e.prototype.isEmpty=function(){return this.list.size()<=0},e.prototype.clear=function(){this.list.clear()},e.prototype.forEach=function(e){this.list.forEach(e)},e}();t.default=i},function(e,t,n){var r=n(251);function i(){}function o(e,t,n){null==n&&(n=a),cordova.exec(function(){var e=Array.prototype.slice.call(arguments);e.unshift(null),n.apply(null,e)},function(e){e=e instanceof Error?e:new Error(e),n(e)},"DownloadManagerPlugin",e,t||[])}function a(){}e.exports=new i,i.prototype.enqueue=function(e,t){"string"==typeof e&&(e={uri:e}),e.url&&(e.uri=e.url),r("string"==typeof e.uri,"req.uri must be string"),r(null==t||"function"==typeof t,"cb must be function"),r(null==e.title||"string"==typeof e.title,"req.title must be string"),r(null==e.description||"string"==typeof e.description,"req.description must be string"),r(null==e.mimeType||"string"==typeof e.mimeType,"req.mimeType must be string"),r(null==e.destinationInExternalFilesDir||"string"==typeof e.destinationInExternalFilesDir.dirType,"req.destinationInExternalFilesDir.dirType must be string"),r(null==e.destinationInExternalFilesDir||"string"==typeof e.destinationInExternalFilesDir.subPath,"req.destinationInExternalFilesDir.subPath must be string"),r(null==e.destinationInExternalPublicDir||"string"==typeof e.destinationInExternalPublicDir.dirType,"req.destinationInExternalPublicDir.dirType must be string"),r(null==e.destinationInExternalPublicDir||"string"==typeof e.destinationInExternalPublicDir.subPath,"req.destinationInExternalPublicDir.subPath must be string"),r(null==e.destinationUri||"string"==typeof e.destinationUri,"req.destinationUri must be string"),r(null==e.visibleInDownloadsUi||"boolean"==typeof e.visibleInDownloadsUi,"req.visibleInDownloadsUi must be boolean"),r(null==e.notificationVisibility||Number.isSafeInteger(e.notificationVisibility),"req.notificationVisibility must be safe integer"),o("enqueue",[e],t)},i.prototype.query=function(e,t){"function"==typeof e&&(t=e,e=null),null==e&&(e={}),r("function"==typeof t,"cb must be function"),o("query",[e],t)},i.prototype.remove=function(e,t){r(Array.isArray(e),"ids must be array"),r(null==t||"function"==typeof t,"cb must be function"),o("remove",e,t)}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(o,a,c,s){return new(c||(c=Promise))(function(e,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new c(function(e){e(t.value)}).then(n,r)}i((s=s.apply(o,a||[])).next())})},s=this&&this.__generator||function(n,r){var i,o,a,e,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,o&&(a=o[2&t[0]?"return":t[0]?"throw":"next"])&&!(a=a.call(o,t[1])).done)return a;switch(o=0,a&&(t=[0,a.value]),t[0]){case 0:case 1:a=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,o=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]>16&255,o[a++]=t>>8&255,o[a++]=255&t;var u,f;2===i&&(t=l[e.charCodeAt(s)]<<2|l[e.charCodeAt(s+1)]>>4,o[a++]=255&t);1===i&&(t=l[e.charCodeAt(s)]<<10|l[e.charCodeAt(s+1)]<<4|l[e.charCodeAt(s+2)]>>2,o[a++]=t>>8&255,o[a++]=255&t);return o},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,i=[],o=0,a=n-r;o>2]+c[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(c[t>>10]+c[t>>4&63]+c[t<<2&63]+"="));return i.join("")};for(var c=[],l=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=r.length;i>18&63]+c[i>>12&63]+c[i>>6&63]+c[63&i]);return o.join("")}l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,c=8*i-r-1,s=(1<>1,f=-7,l=n?i-1:0,h=n?-1:1,d=e[t+l];for(l+=h,o=d&(1<<-f)-1,d>>=-f,f+=c;0>=-f,f+=r;0>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),2<=(t+=1<=a+l?h/s:h*Math.pow(2,1-l))*s&&(a++,s/=2),f<=a+l?(c=0,a=f):1<=a+l?(c=(t*s-1)*Math.pow(2,i),a+=l):(c=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));8<=i;e[n+d]=255&c,d+=p,c/=256,i-=8);for(a=a<>>0),o=this.head,a=0;o;)t=o.data,n=i,r=a,t.copy(n,r),a+=o.data.length,o=o.next;return i},e}(),r&&r.inspect&&r.inspect.custom&&(e.exports.prototype[r.inspect.custom]=function(){var e=r.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,i,o){(function(e){var t=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function r(e,t){this._id=e,this._clearFn=t}i.setTimeout=function(){return new r(n.call(setTimeout,t,arguments),clearTimeout)},i.setInterval=function(){return new r(n.call(setInterval,t,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(t,this._id)},i.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},i.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},i._unrefActive=i.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},o(149),i.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,i.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,o(15))},function(e,t,n){(function(e,p){!function(n,r){"use strict";if(!n.setImmediate){var i,o,t,a,e,c=1,s={},u=!1,f=n.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(n);l=l&&l.setTimeout?l:n,i="[object process]"==={}.toString.call(n.process)?function(e){p.nextTick(function(){d(e)})}:function(){if(n.postMessage&&!n.importScripts){var e=!0,t=n.onmessage;return n.onmessage=function(){e=!1},n.postMessage("","*"),n.onmessage=t,e}}()?(a="setImmediate$"+Math.random()+"$",e=function(e){e.source===n&&"string"==typeof e.data&&0===e.data.indexOf(a)&&d(+e.data.slice(a.length))},n.addEventListener?n.addEventListener("message",e,!1):n.attachEvent("onmessage",e),function(e){n.postMessage(a+e,"*")}):n.MessageChannel?((t=new MessageChannel).port1.onmessage=function(e){d(e.data)},function(e){t.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):function(e){setTimeout(d,0,e)},l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n>>27)+(r=u,i=f,o=l,0===(n=b)?r&i|~r&o:2===n?r&i|r&o|i&o:r^i^o)+h+c[p]+E[b];h=l,l=f,f=(t=u)<<30|t>>>2,u=s,s=_}this._a=s+this._a|0,this._b=u+this._b|0,this._c=f+this._c|0,this._d=l+this._d|0,this._e=h+this._e|0},c.prototype._hash=function(){var e=o.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,n){var r=n(4),i=n(26),o=n(3).Buffer,y=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,i.call(this,64,56)}r(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,n,r,i,o,a,c,s=this._w,u=0|this._a,f=0|this._b,l=0|this._c,h=0|this._d,d=0|this._e,p=0;p<16;++p)s[p]=e.readInt32BE(4*p);for(;p<80;++p)s[p]=(t=s[p-3]^s[p-8]^s[p-14]^s[p-16])<<1|t>>>31;for(var b=0;b<80;++b){var _=~~(b/20),E=0|((c=u)<<5|c>>>27)+(i=f,o=l,a=h,0===(r=_)?i&o|~i&a:2===r?i&o|i&a|o&a:i^o^a)+d+s[b]+y[_];d=h,h=l,l=(n=f)<<30|n>>>2,f=u,u=E}this._a=u+this._a|0,this._b=f+this._b|0,this._c=l+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0},c.prototype._hash=function(){var e=o.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,n){var r=n(4),i=n(74),o=n(26),a=n(3).Buffer,c=new Array(64);function s(){this.init(),this._w=c,o.call(this,64,56)}r(s,i),s.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},s.prototype._hash=function(){var e=a.allocUnsafe(28);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},e.exports=s},function(e,t,n){var r=n(4),i=n(75),o=n(26),a=n(3).Buffer,c=new Array(160);function s(){this.init(),this._w=c,o.call(this,128,112)}r(s,i),s.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},s.prototype._hash=function(){var r=a.allocUnsafe(48);function e(e,t,n){r.writeInt32BE(e,n),r.writeInt32BE(t,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),r},e.exports=s},function(e,t,n){"use strict";var r=n(4),o=n(3).Buffer,a=n(21),c=o.alloc(128);function i(e,t){a.call(this,"digest"),"string"==typeof t&&(t=o.from(t)),this._alg=e,64<(this._key=t).length?t=e(t):t.length<64&&(t=o.concat([t,c],64));for(var n=this._ipad=o.allocUnsafe(64),r=this._opad=o.allocUnsafe(64),i=0;i<64;i++)n[i]=54^t[i],r[i]=92^t[i];this._hash=[n]}r(i,a),i.prototype._update=function(e){this._hash.push(e)},i.prototype._final=function(){var e=this._alg(o.concat(this._hash));return this._alg(o.concat([this._opad,e]))},e.exports=i},function(e,t,n){e.exports=n(78)},function(e,t,n){(function(u,f){var l,h=n(80),d=n(81),p=n(82),b=n(3).Buffer,_=u.crypto&&u.crypto.subtle,E={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},y=[];function v(e,t,n,r,i){return _.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){return _.deriveBits({name:"PBKDF2",salt:t,iterations:n,hash:{name:i}},e,r<<3)}).then(function(e){return b.from(e)})}e.exports=function(t,n,r,i,o,a){"function"==typeof o&&(a=o,o=void 0);var e,c,s=E[(o=o||"sha1").toLowerCase()];if(!s||"function"!=typeof u.Promise)return f.nextTick(function(){var e;try{e=p(t,n,r,i,o)}catch(e){return a(e)}a(null,e)});if(h(t,n,r,i),"function"!=typeof a)throw new Error("No callback provided to pbkdf2");b.isBuffer(t)||(t=b.from(t,d)),b.isBuffer(n)||(n=b.from(n,d)),e=function(e){if(u.process&&!u.process.browser)return Promise.resolve(!1);if(!_||!_.importKey||!_.deriveBits)return Promise.resolve(!1);if(void 0!==y[e])return y[e];var t=v(l=l||b.alloc(8),l,10,128,e).then(function(){return!0}).catch(function(){return!1});return y[e]=t}(s).then(function(e){return e?v(t,n,r,i,s):p(t,n,r,i,o)}),c=a,e.then(function(e){f.nextTick(function(){c(null,e)})},function(e){f.nextTick(function(){c(e)})})}}).call(this,n(15),n(16))},function(e,t,n){var r=n(167),i=n(53),o=n(54),a=n(182),c=n(38);function s(e,t,n){if(e=e.toLowerCase(),o[e])return i.createCipheriv(e,t,n);if(a[e])return new r({key:t,iv:n,mode:e});throw new TypeError("invalid suite type")}function u(e,t,n){if(e=e.toLowerCase(),o[e])return i.createDecipheriv(e,t,n);if(a[e])return new r({key:t,iv:n,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var n,r;if(e=e.toLowerCase(),o[e])n=o[e].key,r=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");n=8*a[e].key,r=a[e].iv}var i=c(t,!1,n,r);return s(e,i.key,i.iv)},t.createCipheriv=t.Cipheriv=s,t.createDecipher=t.Decipher=function(e,t){var n,r;if(e=e.toLowerCase(),o[e])n=o[e].key,r=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");n=8*a[e].key,r=a[e].iv}var i=c(t,!1,n,r);return u(e,i.key,i.iv)},t.createDecipheriv=t.Decipheriv=u,t.listCiphers=t.getCiphers=function(){return Object.keys(a).concat(i.getCiphers())}},function(e,t,n){var a=n(21),r=n(52),i=n(4),c=n(3).Buffer,s={"des-ede3-cbc":r.CBC.instantiate(r.EDE),"des-ede3":r.EDE,"des-ede-cbc":r.CBC.instantiate(r.EDE),"des-ede":r.EDE,"des-cbc":r.CBC.instantiate(r.DES),"des-ecb":r.DES};function o(e){a.call(this);var t,n=e.mode.toLowerCase(),r=s[n];t=e.decrypt?"decrypt":"encrypt";var i=e.key;c.isBuffer(i)||(i=c.from(i)),"des-ede"!==n&&"des-ede-cbc"!==n||(i=c.concat([i,i.slice(0,8)]));var o=e.iv;c.isBuffer(o)||(o=c.from(o)),this._des=r.create({key:i,iv:o,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],i(e.exports=o,a),o.prototype._update=function(e){return c.from(this._des.update(e))},o.prototype._final=function(){return c.from(this._des.final())}},function(e,t,n){"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,n){e[0+n]=t>>>24,e[1+n]=t>>>16&255,e[2+n]=t>>>8&255,e[3+n]=255&t},t.ip=function(e,t,n,r){for(var i=0,o=0,a=6;0<=a;a-=2){for(var c=0;c<=24;c+=8)i<<=1,i|=t>>>c+a&1;for(c=0;c<=24;c+=8)i<<=1,i|=e>>>c+a&1}for(a=6;0<=a;a-=2){for(c=1;c<=25;c+=8)o<<=1,o|=t>>>c+a&1;for(c=1;c<=25;c+=8)o<<=1,o|=e>>>c+a&1}n[r+0]=i>>>0,n[r+1]=o>>>0},t.rip=function(e,t,n,r){for(var i=0,o=0,a=0;a<4;a++)for(var c=24;0<=c;c-=8)i<<=1,i|=t>>>c+a&1,i<<=1,i|=e>>>c+a&1;for(a=4;a<8;a++)for(c=24;0<=c;c-=8)o<<=1,o|=t>>>c+a&1,o<<=1,o|=e>>>c+a&1;n[r+0]=i>>>0,n[r+1]=o>>>0},t.pc1=function(e,t,n,r){for(var i=0,o=0,a=7;5<=a;a--){for(var c=0;c<=24;c+=8)i<<=1,i|=t>>c+a&1;for(c=0;c<=24;c+=8)i<<=1,i|=e>>c+a&1}for(c=0;c<=24;c+=8)i<<=1,i|=t>>c+a&1;for(a=1;a<=3;a++){for(c=0;c<=24;c+=8)o<<=1,o|=t>>c+a&1;for(c=0;c<=24;c+=8)o<<=1,o|=e>>c+a&1}for(c=0;c<=24;c+=8)o<<=1,o|=e>>c+a&1;n[r+0]=i>>>0,n[r+1]=o>>>0},t.r28shl=function(e,t){return e<>>28-t};var s=[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,n,r){for(var i=0,o=0,a=s.length>>>1,c=0;c>>s[c]&1;for(c=a;c>>s[c]&1;n[r+0]=i>>>0,n[r+1]=o>>>0},t.expand=function(e,t,n){var r=0,i=0;r=(1&e)<<5|e>>>27;for(var o=23;15<=o;o-=4)r<<=6,r|=e>>>o&63;for(o=11;3<=o;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[n+0]=r>>>0,t[n+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 n=0,r=0;r<4;r++){n<<=4,n|=i[64*r+(e>>>18-6*r&63)]}for(r=0;r<4;r++){n<<=4,n|=i[256+64*r+(t>>>18-6*r&63)]}return n>>>0};var r=[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,n=0;n>>r[n]&1;return t>>>0},t.padSplit=function(e,t,n){for(var r=e.toString(2);r.length>>1];n=h.r28shl(n,o),r=h.r28shl(r,o),h.pc2(n,r,e.keys,i)}},s.prototype._update=function(e,t,n,r){var i=this._desState,o=h.readUInt32BE(e,t),a=h.readUInt32BE(e,t+4);h.ip(o,a,i.tmp,0),o=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,o,a,i.tmp,0):this._decrypt(i,o,a,i.tmp,0),o=i.tmp[0],a=i.tmp[1],h.writeUInt32BE(n,o,r),h.writeUInt32BE(n,a,r+4)},s.prototype._pad=function(e,t){for(var n=e.length-t,r=t;r>>0,o=l}h.rip(a,o,r,i)},s.prototype._decrypt=function(e,t,n,r,i){for(var o=n,a=t,c=e.keys.length-2;0<=c;c-=2){var s=e.keys[c],u=e.keys[c+1];h.expand(o,e.tmp,0),s^=e.tmp[0],u^=e.tmp[1];var f=h.substitute(s,u),l=o;o=(a^h.permute(f))>>>0,a=l}h.rip(o,a,r,i)}},function(e,t,n){"use strict";var r=n(11),o=n(4),a={};function i(e){r.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t>o%8,e._prev=s(e._prev,n?r:i);return a}function s(e,t){var n=e.length,r=-1,i=a.allocUnsafe(e.length);for(e=a.concat([e,a.from([t])]);++r>7;return i}t.encrypt=function(e,t,n){for(var r=t.length,i=a.allocUnsafe(r),o=-1;++o>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function o(e){this.h=e,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}o.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&r[t-1])<<31;r[0]=r[0]>>>1,n&&(r[0]=r[0]^225<<24)}this.state=a(i)},o.prototype.update=function(e){var t;for(this.cache=r.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},o.prototype.final=function(e,t){return this.cache.length&&this.ghash(r.concat([this.cache,i],16)),this.ghash(a([0,e,0,t])),this.state},e.exports=o},function(e,t,n){var i=n(86),o=n(3).Buffer,a=n(54),c=n(87),r=n(21),s=n(37),u=n(38);function f(e,t,n){r.call(this),this._cache=new l,this._last=void 0,this._cipher=new s.AES(t),this._prev=o.from(n),this._mode=e,this._autopadding=!0}function l(){this.cache=o.allocUnsafe(0)}function h(e,t,n){var r=a[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");if("string"==typeof n&&(n=o.from(n)),"GCM"!==r.mode&&n.length!==r.iv)throw new TypeError("invalid iv length "+n.length);if("string"==typeof t&&(t=o.from(t)),t.length!==r.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===r.type?new c(r.module,t,n,!0):"auth"===r.type?new i(r.module,t,n,!0):new f(r.module,t,n)}n(4)(f,r),f.prototype._update=function(e){var t,n;this._cache.add(e);for(var r=[];t=this._cache.get(this._autopadding);)n=this._mode.decrypt(this,t),r.push(n);return o.concat(r)},f.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||16>1)-1>1)-a:a,i.isubn(o)}else o=0;n.push(o);for(var c=0!==i.cmpn(0)&&0===i.andln(r-1)?t+1:1,s=1;s>1]):a.mixedAdd(i[-s-1>>1].neg()):0>1]):a.add(i[-s-1>>1].neg())}return"affine"===e.type?a.toP():a},o.prototype._wnafMulAdd=function(e,t,n,r,i){for(var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,s=0,u=0;u>1]:O<0&&(A=a[_][-O-1>>1].neg()),v="affine"===A.type?v.mixedAdd(A):v.add(A))}}for(u=0;u=Math.ceil((e.bitLength()+1)/t.step)},a.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i":""},u.prototype.isInfinity=function(){return this.inf},u.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 n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},u.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,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new m(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},u.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},u.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))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,a.BasePoint),s.prototype.jpoint=function(e,t,n){return new f(this,e,t,n)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=r.redSub(i),s=o.redSub(a);if(0===c.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=c.redSqr(),f=u.redMul(c),l=r.redMul(u),h=s.redSqr().redIAdd(f).redISub(l).redISub(l),d=s.redMul(l.redISub(h)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(h,d,p)},f.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=n.redSub(r),c=i.redSub(o);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=a.redSqr(),u=s.redMul(a),f=n.redMul(s),l=c.redSqr().redIAdd(u).redISub(f).redISub(f),h=c.redMul(f.redISub(l)).redISub(i.redMul(u)),d=this.z.redMul(a);return this.curve.jpoint(l,h,d)},f.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,n=0;n":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,n){"use strict";var r=n(39),i=n(6),o=n(4),a=r.base,c=n(8).utils;function s(e){a.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,n){a.BasePoint.call(this,e,"projective"),null===t&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(s,a),(e.exports=s).prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),r=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},o(u,a.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(c.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.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(),n=e.redSub(t),r=e.redMul(t),i=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(r,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),r=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(n),a=i.redMul(r),c=t.z.redMul(o.redAdd(a).redSqr()),s=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(c,s)},u.prototype.mul=function(e){for(var t=e.clone(),n=this,r=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;0<=o;o--)0===i[o]?(n=n.diffAdd(r,this),r=r.dbl()):(r=n.diffAdd(r,this),n=n.dbl());return r},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,n){"use strict";var r=n(39),i=n(8),s=n(6),o=n(4),a=r.base,c=i.utils.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new s(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new s(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new s(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),c(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function f(e,t,n,r,i){a.BasePoint.call(this,e,"projective"),null===t&&null===n&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new s(t,16),this.y=new s(n,16),this.z=r?new s(r,16):this.curve.one,this.t=i&&new s(i,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,a),(e.exports=u).prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,n,r){return this.point(e,t,n,r)},u.prototype.pointFromX=function(e,t){(e=new s(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=this.c2.redSub(this.a.redMul(n)),i=this.one.redSub(this.c2.redMul(this.d).redMul(n)),o=r.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(t&&!c||!t&&c)&&(a=a.redNeg()),this.point(e,a)},u.prototype.pointFromY=function(e,t){(e=new s(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=n.redSub(this.c2),i=n.redMul(this.d).redMul(this.c2).redSub(this.a),o=r.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),r=t.redMul(this.a).redAdd(n),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return 0===r.cmp(i)},o(f,a.BasePoint),u.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},u.prototype.point=function(e,t,n,r){return new f(this,e,t,n,r)},f.fromJSON=function(e,t){return new f(e,t[0],t[1],t[2])},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var r=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=r.redAdd(t),a=o.redSub(n),c=r.redSub(t),s=i.redMul(a),u=o.redMul(c),f=i.redMul(c),l=a.redMul(o);return this.curve.point(s,u,l,f)},f.prototype._projDbl=function(){var e,t,n,r=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(u=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=r.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(u.redSub(o)),n=a.redSqr().redSub(a).redSub(a);else{var c=this.z.redSqr(),s=a.redSub(c).redISub(c);e=r.redSub(i).redISub(o).redMul(s),t=a.redMul(u.redSub(o)),n=a.redMul(s)}}else{var u=i.redAdd(o);c=this.curve._mulC(this.z).redSqr(),s=u.redSub(c).redSub(c);e=this.curve._mulC(r.redISub(u)).redMul(s),t=this.curve._mulC(u).redMul(i.redISub(o)),n=u.redMul(s)}return this.curve.point(e,t,n)},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)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(t),a=i.redSub(r),c=i.redAdd(r),s=n.redAdd(t),u=o.redMul(a),f=c.redMul(s),l=o.redMul(s),h=a.redMul(c);return this.curve.point(u,f,h,l)},f.prototype._projAdd=function(e){var t,n,r=this.z.redMul(e.z),i=r.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),c=this.curve.d.redMul(o).redMul(a),s=i.redSub(c),u=i.redAdd(c),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),l=r.redMul(s).redMul(f);return n=this.curve.twisted?(t=r.redMul(u).redMul(a.redSub(this.curve._mulA(o))),s.redMul(u)):(t=r.redMul(u).redMul(a.redSub(o)),this.curve._mulC(s).redMul(u)),this.curve.point(l,t,n)},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,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},f.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],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 n=e.clone(),r=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),0<=n.cmp(this.curve.p))return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},function(e,t,n){"use strict";var r,i=t,o=n(56),a=n(8),c=a.utils.assert;function s(e){"short"===e.type?this.curve=new a.curve.short(e):"edwards"===e.type?this.curve=new a.curve.edwards(e):this.curve=new a.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,c(this.g.validate(),"Invalid curve"),c(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,n){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var e=new s(n);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:e}),e}})}i.PresetCurve=s,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=n(204)}catch(e){r=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},function(e,t,n){"use strict";t.sha1=n(199),t.sha224=n(200),t.sha256=n(93),t.sha384=n(201),t.sha512=n(94)},function(e,t,n){"use strict";var r=n(17),i=n(32),o=n(92),l=r.rotl32,h=r.sum32,d=r.sum32_5,p=o.ft_1,a=i.BlockHash,b=[1518500249,1859775393,2400959708,3395469782];function c(){if(!(this instanceof c))return new c;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}r.inherits(c,a),(e.exports=c).blockSize=512,c.outSize=160,c.hmacStrength=80,c.padLength=64,c.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;rthis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t>1;if(0<=a.cmp(this.curve.p.umod(this.curve.n))&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),s):this.curve.pointFromX(a,s);var f=t.r.invm(i),l=i.sub(o).mul(f).umod(i),h=c.mul(f).umod(i);return this.g.mulAdd(l,a,h)},i.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new y(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,n){"use strict";var r=n(56),a=n(91),i=n(11);function o(e){if(!(this instanceof o))return new o(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=a.toArray(e.entropy,e.entropyEnc||"hex"),n=a.toArray(e.nonce,e.nonceEnc||"hex"),r=a.toArray(e.pers,e.persEnc||"hex");i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}(e.exports=o).prototype._init=function(e,t,n){var r=e.concat(t).concat(n);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(n||[])),this._reseed=1},o.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=n,n=t,t=null),n&&(n=a.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length"}},function(e,t,n){"use strict";var c=n(6),s=n(8).utils,r=s.assert;function i(e,t){if(e instanceof i)return e;this._importDER(e,t)||(r(e.r&&e.s,"Signature without r or s"),this.r=new c(e.r,16),this.s=new c(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function f(e,t){var n=e[t.place++];if(!(128&n))return n;for(var r=15&n,i=0,o=0,a=t.place;o>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}(e.exports=i).prototype._importDER=function(e,t){e=s.toArray(e,t);var n=new u;if(48!==e[n.place++])return!1;if(f(e,n)+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var r=f(e,n),i=e.slice(n.place,r+n.place);if(n.place+=r,2!==e[n.place++])return!1;var o=f(e,n);if(e.length!==o+n.place)return!1;var a=e.slice(n.place,o+n.place);return 0===i[0]&&128&i[1]&&(i=i.slice(1)),0===a[0]&&128&a[1]&&(a=a.slice(1)),this.r=new c(i),this.s=new c(a),!(this.recoveryParam=null)},i.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=a(t),n=a(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];l(r,t.length),(r=r.concat(t)).push(2),l(r,n.length);var i=r.concat(n),o=[48];return l(o,i.length),o=o.concat(i),s.encode(o,e)}},function(e,t,n){"use strict";var r=n(56),i=n(8),o=i.utils,a=o.assert,s=o.parseBytes,c=n(210),u=n(211);function f(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=i.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}(e.exports=f).prototype.sign=function(e,t){e=s(e);var n=this.keyFromSecret(t),r=this.hashInt(n.messagePrefix(),e),i=this.g.mul(r),o=this.encodePoint(i),a=this.hashInt(o,n.pubBytes(),e).mul(n.priv()),c=r.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},f.prototype.verify=function(e,t,n){e=s(e),t=this.makeSignature(t);var r=this.keyFromPublic(n),i=this.hashInt(t.Rencoded(),r.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(r.pub().mul(i)).eq(o)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t=t)throw new Error("invalid sig")}e.exports=function(e,t,n,r,i){var o=b(n);if("ec"===o.type){if("ecdsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong public key type");return function(e,t,n){var r=_[n.data.algorithm.curve.join(".")];if(!r)throw new Error("unknown curve "+n.data.algorithm.curve.join("."));var i=new p(r),o=n.data.subjectPrivateKey.data;return i.verify(t,e,o)}(e,t,o)}if("dsa"===o.type){if("dsa"!==r)throw new Error("wrong public key type");return function(e,t,n){var r=n.data.p,i=n.data.q,o=n.data.g,a=n.data.pub_key,c=b.signature.decode(e,"der"),s=c.s,u=c.r;E(s,i),E(u,i);var f=d.mont(r),l=s.invm(i);return 0===o.toRed(f).redPow(new d(t).mul(l).mod(i)).fromRed().mul(a.toRed(f).redPow(u.mul(l).mod(i)).fromRed()).mod(r).mod(i).cmp(u)}(e,t,o)}if("rsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong public key type");t=h.concat([i,t]);for(var a=o.modulus.byteLength(),c=[1],s=0;t.length+c.length+2a||0<=new u(t).cmp(o.modulus))throw new Error("decryption error");i=n?p(new u(t),o):h(t,o);var c=b.alloc(a-i.length);if(i=b.concat([c,i],a),4===r)return function(e,t){var n=e.modulus.byteLength(),r=d("sha1").update(b.alloc(0)).digest(),i=r.length;if(0!==t[0])throw new Error("decryption error");var o=t.slice(1,i+1),a=t.slice(i+1),c=l(o,f(a,i)),s=l(a,f(c,n-i-1));if(function(e,t){e=b.from(e),t=b.from(t);var n=0,r=e.length;e.length!==t.length&&(n++,r=Math.min(e.length,t.length));var i=-1;for(;++i=t.length){o++;break}var a=t.slice(2,i-1);("0002"!==r.toString("hex")&&!n||"0001"!==r.toString("hex")&&n)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,i,n);if(3===r)return i;throw new Error("unknown padding")}},function(e,n,d){"use strict";(function(i,a){function e(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var t=d(3),c=d(25),o=t.Buffer,r=t.kMaxLength,s=i.crypto||i.msCrypto,u=Math.pow(2,32)-1;function f(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(u=E&&--r,r}e.exports={derToJose:function(e,t){e=y(e);var n=_(t),r=n+1,i=e.length,o=0;if(48!==e[o++])throw new Error('Could not find expected "seq"');var a=e[o++];if(a===(1|E)&&(a=e[o++]),i-of+(s.clockTolerance||0))return u(new p("jwt not active",new Date(1e3*i.nbf)))}if(void 0!==i.exp&&!s.ignoreExpiration){if("number"!=typeof i.exp)return u(new d("invalid exp value"));if(f>=i.exp+(s.clockTolerance||0))return u(new b("jwt expired",new Date(1e3*i.exp)))}if(s.audience){var o=Array.isArray(s.audience)?s.audience:[s.audience];if(!(Array.isArray(i.aud)?i.aud:[i.aud]).some(function(t){return o.some(function(e){return e instanceof RegExp?e.test(t):e===t})}))return u(new d("jwt audience invalid. expected: "+o.join(" or ")))}if(s.issuer&&("string"==typeof s.issuer&&i.iss!==s.issuer||Array.isArray(s.issuer)&&-1===s.issuer.indexOf(i.iss)))return u(new d("jwt issuer invalid. expected: "+s.issuer));if(s.subject&&i.sub!==s.subject)return u(new d("jwt subject invalid. expected: "+s.subject));if(s.jwtid&&i.jti!==s.jwtid)return u(new d("jwt jwtid invalid. expected: "+s.jwtid));if(s.nonce&&i.nonce!==s.nonce)return u(new d("jwt nonce invalid. expected: "+s.nonce));if(s.maxAge){if("number"!=typeof i.iat)return u(new d("iat required when maxAge is specified"));var a=_(s.maxAge,i.iat);if(void 0===a)return u(new d('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(f>=a+(s.clockTolerance||0))return u(new b("maxAge exceeded",new Date(1e3*a)))}return u(null,i)})}},function(e,t){var r=864e5;function i(e,t,n,r){var i=1.5*n<=t;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,t){t=t||{};var n=typeof e;if("string"===n&&0>>((3&t)<<3)&255;return i}}},function(e,t){for(var i=[],n=0;n<256;++n)i[n]=(n+256).toString(16).substr(1);e.exports=function(e,t){var n=t||0,r=i;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(18),r=function(){function e(e){this.table={},this.nElements=0,this.toStr=e||o.defaultToString}return e.prototype.getValue=function(e){var t=this.table["$"+this.toStr(e)];if(!o.isUndefined(t))return t.value},e.prototype.setValue=function(e,t){if(!o.isUndefined(e)&&!o.isUndefined(t)){var n,r="$"+this.toStr(e),i=this.table[r];return n=o.isUndefined(i)?void this.nElements++:i.value,this.table[r]={key:e,value:t},n}},e.prototype.remove=function(e){var t="$"+this.toStr(e),n=this.table[t];if(!o.isUndefined(n))return delete this.table[t],this.nElements--,n.value},e.prototype.keys=function(){var e=[];for(var t in this.table)if(o.has(this.table,t)){var n=this.table[t];e.push(n.key)}return e},e.prototype.values=function(){var e=[];for(var t in this.table)if(o.has(this.table,t)){var n=this.table[t];e.push(n.value)}return e},e.prototype.forEach=function(e){for(var t in this.table)if(o.has(this.table,t)){var n=this.table[t];if(!1===e(n.key,n.value))return}},e.prototype.containsKey=function(e){return!o.isUndefined(this.getValue(e))},e.prototype.clear=function(){this.table={},this.nElements=0},e.prototype.size=function(){return this.nElements},e.prototype.isEmpty=function(){return this.nElements<=0},e.prototype.toString=function(){var n="{";return this.forEach(function(e,t){n+="\n\t"+e+" : "+t}),n+"\n}"},e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(18),i=n(110),r=function(){function r(){this.firstNode=null,this.lastNode=null,this.nElements=0}return r.prototype.add=function(e,t){if(o.isUndefined(t)&&(t=this.nElements),t<0||t>this.nElements||o.isUndefined(e))return!1;var n=this.createNode(e);if(0===this.nElements||null===this.lastNode)this.firstNode=n,this.lastNode=n;else if(t===this.nElements)this.lastNode.next=n,this.lastNode=n;else if(0===t)n.next=this.firstNode,this.firstNode=n;else{var r=this.nodeAtIndex(t-1);if(null==r)return!1;n.next=r.next,r.next=n}return this.nElements++,!0},r.prototype.first=function(){if(null!==this.firstNode)return this.firstNode.element},r.prototype.last=function(){if(null!==this.lastNode)return this.lastNode.element},r.prototype.elementAtIndex=function(e){var t=this.nodeAtIndex(e);if(null!==t)return t.element},r.prototype.indexOf=function(e,t){var n=t||o.defaultEquals;if(o.isUndefined(e))return-1;for(var r=this.firstNode,i=0;null!==r;){if(n(r.element,e))return i;i++,r=r.next}return-1},r.prototype.contains=function(e,t){return 0<=this.indexOf(e,t)},r.prototype.remove=function(e,t){var n=t||o.defaultEquals;if(this.nElements<1||o.isUndefined(e))return!1;for(var r=null,i=this.firstNode;null!==i;){if(n(i.element,e))return null==r?(this.firstNode=i.next,i===this.lastNode&&(this.lastNode=null)):(i===this.lastNode?(this.lastNode=r).next=i.next:r.next=i.next,i.next=null),this.nElements--,!0;i=(r=i).next}return!1},r.prototype.clear=function(){this.firstNode=null,this.lastNode=null,this.nElements=0},r.prototype.equals=function(e,t){var n=t||o.defaultEquals;return e instanceof r&&(this.size()===e.size()&&this.equalsAux(this.firstNode,e.firstNode,n))},r.prototype.equalsAux=function(e,t,n){for(;null!==e&&null!==t;){if(!n(e.element,t.element))return!1;e=e.next,t=t.next}return!0},r.prototype.removeElementAtIndex=function(e){if(!(e<0||e>=this.nElements||null===this.firstNode||null===this.lastNode)){var t;if(1===this.nElements)t=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var n=this.nodeAtIndex(e-1);null===n?(t=this.firstNode.element,this.firstNode=this.firstNode.next):n.next===this.lastNode&&(t=this.lastNode.element,this.lastNode=n),null!==n&&null!==n.next&&(t=n.next.element,n.next=n.next.next)}return this.nElements--,t}},r.prototype.forEach=function(e){for(var t=this.firstNode;null!==t&&!1!==e(t.element);)t=t.next},r.prototype.reverse=function(){for(var e=null,t=this.firstNode,n=null;null!==t;)n=t.next,t.next=e,e=t,t=n;n=this.firstNode,this.firstNode=this.lastNode,this.lastNode=n},r.prototype.toArray=function(){for(var e=[],t=this.firstNode;null!==t;)e.push(t.element),t=t.next;return e},r.prototype.size=function(){return this.nElements},r.prototype.isEmpty=function(){return this.nElements<=0},r.prototype.toString=function(){return i.toString(this.toArray())},r.prototype.nodeAtIndex=function(e){if(e<0||e>=this.nElements)return null;if(e===this.nElements-1)return this.lastNode;for(var t=this.firstNode,n=0;na[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]this.telemetryConfig.telemetryLogMinAllowedOffset?r:0)?[4,ni.log.interact({type:_t.OTHER,subType:yt.DEVICE_TIME_OFFSET_FOUND,env:"sdk",pageId:"sdk",id:"sdk",valueMap:{deviceTime:n,offsetTime:i}}).toPromise()]:[3,3];case 1:return e.sent(),[4,this.keyValueStore.setValue(c.TELEMETRY_LOG_MIN_ALLOWED_OFFSET_KEY,i+"").toPromise()];case 2:e.sent(),e.label=3;case 3:return[2]}})})}),Object(Pe.mergeMap)(function(){return Object(de.zip)(i.keyValueStore.setValue(c.LAST_SYNCED_DEVICE_REGISTER_ATTEMPT_TIME_STAMP_KEY,Date.now()+""),i.keyValueStore.setValue(c.LAST_SYNCED_DEVICE_REGISTER_IS_SUCCESSFUL_KEY,"true")).pipe(Object(Pe.mapTo)(void 0))}),Object(Pe.catchError)(function(e){return Object(de.zip)(i.keyValueStore.setValue(c.LAST_SYNCED_DEVICE_REGISTER_ATTEMPT_TIME_STAMP_KEY,Date.now()+""),i.keyValueStore.setValue(c.LAST_SYNCED_DEVICE_REGISTER_IS_SUCCESSFUL_KEY,"false")).pipe(Object(Pe.mergeMap)(function(){throw console.error(e),new Error("Device Registration Failed")}))}))}))},c.prototype.hasTelemetryThresholdCrossed=function(){var t=this;return this.dbService.execute("\n SELECT count(*) as COUNT FROM "+Ht.TABLE_NAME).pipe(Object(Pe.map)(function(e){return!!(e&&e[0]&&e[0].COUNT>=t.telemetryConfig.telemetrySyncThreshold)}))},c.prototype.fetchEvents=function(){return this.dbService.execute("\n SELECT * FROM "+Ht.TABLE_NAME+"\n WHERE "+Ht.COLUMN_NAME_PRIORITY+" = (SELECT MIN ("+Ht.COLUMN_NAME_PRIORITY+")\n FROM "+Ht.TABLE_NAME+")\n ORDER BY "+Ht.COLUMN_NAME_TIMESTAMP+"\n LIMIT "+this.telemetryConfig.telemetrySyncBandwidth)},c.prototype.processEvents=function(e){if(!e.length)return Object(de.of)({processedEventsSize:0});var t=zr.generateUniqueId();return Object(de.of)({processedEvents:this.preprocessors.reduce(function(e,t){return t.process(e)},{id:"ekstep.telemetry",ver:"1.0",ts:Ie()().format("YYYY-MM-DDTHH:mm:ss[Z]"),events:e.map(function(e){return JSON.parse(e[Ht.COLUMN_NAME_EVENT])}),params:{did:this.deviceInfo.getDeviceID(),msgid:t,key:"",requesterId:""}}),processedEventsSize:e.length,messageId:t})},c.prototype.persistProcessedEvents=function(e,t){var n,r=e.processedEvents,i=e.messageId;if(!r)return Object(de.of)(void 0);var o={table:zt.TABLE_NAME,modelJson:(n={},n[zt.COLUMN_NAME_MSG_ID]=i,n[zt.COLUMN_NAME_NUMBER_OF_EVENTS]=t,n[Ht.COLUMN_NAME_PRIORITY]=1,n[zt.COLUMN_NAME_DATA]=r,n)};return this.dbService.insert(o).pipe(Object(Pe.mapTo)(void 0))},c.prototype.deleteEvents=function(e){return e.length?this.dbService.execute("\n DELETE FROM "+Ht.TABLE_NAME+"\n WHERE "+Ht._ID+" IN ("+e.map(function(e){return e[Ht._ID]}).join(",")+")\n "):Object(de.of)(void 0)},c.prototype.handleProcessedEventsBatch=function(e){var n=this;return Object(de.iif)(function(){return!!e},Object(de.of)(void 0),this.sharedPreferences.getString(fe.KEY_AUTO_SYNC_MODE).pipe(Object(Pe.catchError)(function(){return Object(de.of)("")}),Object(Pe.mergeMap)(function(e){switch(e){case td.OFF:throw new Error("AUTO_SYNC_MODE: "+td.OFF);case td.OVER_WIFI:if(navigator.connection.type===Connection.WIFI)return Object(de.of)(void 0);throw new Error("AUTO_SYNC_MODE: "+td.OVER_WIFI);case td.ALWAYS_ON:default:return Object(de.of)(void 0)}}))).pipe(Object(Pe.mergeMap)(function(){return n.fetchProcessedEventsBatch().pipe(Object(Pe.mergeMap)(function(t){return n.syncProcessedEvent(t).pipe(Object(Pe.mergeMap)(function(e){return n.deleteProcessedEvent(t).pipe(Object(Pe.mapTo)(e||{syncedEventCount:0,syncTime:Date.now(),syncedFileSize:0}))}))}))}),Object(Pe.catchError)(function(e){return Object(de.of)({syncedEventCount:0,syncTime:Date.now(),syncedFileSize:0,error:e})}))},c.prototype.fetchProcessedEventsBatch=function(){return this.dbService.read({table:zt.TABLE_NAME,selection:"",selectionArgs:[],limit:"1"}).pipe(Object(Pe.map)(function(e){return e&&e[0]}))},c.prototype.syncProcessedEvent=function(e){var t=this;if(!e)return Object(de.of)(void 0);var n=e[zt.COLUMN_NAME_DATA].split("").map(function(e){return e.charCodeAt(0)}),r=new Uint8Array(n),i=(new H.Builder).withHost(this.telemetryConfig.host).withType(j.POST).withPath(this.telemetryConfig.apiPath+c.TELEMETRY_ENDPOINT).withBody(r).withApiToken(!0).build();return this.apiService.fetch(i).pipe(Object(Pe.tap)(function(o){return ri(t,void 0,void 0,function(){var t,n,r,i;return ii(this,function(e){switch(e.label){case 0:return[4,this.keyValueStore.getValue(c.LAST_SYNCED_DEVICE_REGISTER_IS_SUCCESSFUL_KEY).toPromise()];case 1:return"false"!==e.sent()?[3,3]:(t=new Date(o.body.ets).getTime(),n=Date.now(),r=t-n,(i=Math.abs(r)>this.telemetryConfig.telemetryLogMinAllowedOffset?r:0)?[4,this.keyValueStore.setValue(c.TELEMETRY_LOG_MIN_ALLOWED_OFFSET_KEY,i+"").toPromise()]:[3,3]);case 2:e.sent(),e.label=3;case 3:return[2]}})})}),Object(Pe.map)(function(){return{syncedEventCount:e[zt.COLUMN_NAME_NUMBER_OF_EVENTS],syncTime:Date.now(),syncedFileSize:(new TextEncoder).encode(e[zt.COLUMN_NAME_DATA]).length}}))},c.prototype.deleteProcessedEvent=function(e){return e?this.dbService.delete({table:zt.TABLE_NAME,selection:"_id = ?",selectionArgs:[e[zt._ID]]}):Object(de.of)(void 0)},c.TELEMETRY_LOG_MIN_ALLOWED_OFFSET_KEY="telemetry_log_min_allowed_offset_key",c.LAST_SYNCED_DEVICE_REGISTER_ATTEMPT_TIME_STAMP_KEY="last_synced_device_register_attempt_time_stamp",c.LAST_SYNCED_DEVICE_REGISTER_IS_SUCCESSFUL_KEY="last_synced_device_register_is_successful",c.TELEMETRY_ENDPOINT="/telemetry",c.REGISTER_API_SUCCESS_TTL=864e5,c.REGISTER_API_FAILURE_TTL=36e5,c}(),ai=function(){function e(e,t){this.fileService=e,this.deviceInfo=t}return e.prototype.execute=function(t){var n=this,r=new V;return this.fileService.createDir(t.destinationFolder.concat("Telemetry"),!1).then(function(e){return n.fileService.createFile(e.nativeURL,n.getExportedFileName(),!0)}).then(function(e){return t.destinationDBFilePath=e.nativeURL,r.body=t,r})},e.prototype.getExportedFileName=function(){return"tm_"+this.deviceInfo.getDeviceID()+"_"+Date.now()+".gsa"},e}(),ci=function(o,a,c,s){return new(c||(c=Promise))(function(e,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new c(function(e){e(t.value)}).then(n,r)}i((s=s.apply(o,a||[])).next())})},si=function(n,r){var i,o,a,e,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,o&&(a=o[2&t[0]?"return":t[0]?"throw":"next"])&&!(a=a.call(o,t[1])).done)return a;switch(o=0,a&&(t=[0,a.value]),t[0]){case 0:case 1:a=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,o=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]=e.minCompatibilityLevel&&t<=e.maxCompatibilityLevel},_.readCompatibilityLevel=function(e){var t=e.compatibilityLevel;return t||this.defaultCompatibilityLevel},_.isDraftContent=function(e){return e&&e===Er.DRAFT.valueOf()},_.isExpired=function(e){if(e){var t=new Date(e).getTime();if((new Date).getTime()>t)return!0}return!1},_.isDuplicateCheckRequired=function(e,t){return e&&0===t},_.isImportFileExist=function(e,t){if(!e||!t)return!1;var n=!1,r=e[mn.COLUMN_NAME_IDENTIFIER],i=t.identifier,o=e[mn.COLUMN_NAME_VISIBILITY],a=_.readVisibility(t);return r===i&&o===a&&(n=this.readPkgVersion(JSON.parse(e[mn.COLUMN_NAME_LOCAL_DATA]))>=this.readPkgVersion(t)),n},_.readPkgVersion=function(e){return e.pkgVersion},_.readContentType=function(e){var t=e.contentType;return t&&(t=t.toLowerCase()),t},_.readAudience=function(e){var t=e.audience,n=[];return"string"==typeof t&&n.push(t),n&&n.length||n.push("Learner"),n.sort(),n.join(",")},_.readPragma=function(e){var t=e.pragma;return t||(t=[]),t.join(",")},_.doesContentExist=function(e,t,n,r){if(!e)return!1;var i=!1,o=e[mn.COLUMN_NAME_IDENTIFIER],a=JSON.parse(e[mn.COLUMN_NAME_LOCAL_DATA]);if(o===t){var c=!1;r?c=!(_.readPkgVersion(a)_.MAX_CONTENT_NAME&&(a=a.substring(0,_.MAX_CONTENT_NAME-3)+"...");var c=o.pkgVersion;r=t.toLowerCase()+"_"+a+"-v"+c+".ecar"}return r},_.readOriginFromContentMap=function(e){var t=e.contentMetadata,n=t&&t.virality;return n?n.origin:""},_.readTransferCountFromContentMap=function(e){var t=e.contentMetadata,n=t&&t.virality;return n?Mt.parseInt(n.transferCount):0},_.readSizeFromContentMap=function(e){return e.size?e.size:""},_.getUidnIdentifierFiler=function(e,t){var n=e&&"uid = '"+e+"'",r=t&&"identifier = '"+t+"'",i="";return n&&r?i="WHERE ("+r+" AND "+n+")":r?i="WHERE ("+r+")":n&&(i="WHERE ("+n+")"),i},_.getBasePath=function(e){return e?e=-1!==e.indexOf("file://")?e.replace("file://",""):"file://".concat(e):""},_.getRollup=function(e,t){var n,r,i,o;if(t){var a=void 0;for(a=0;a 0";return"select * from "+mn.TABLE_NAME+" "+r+" "+n},_.getFindAllContentsQuery=function(){return"select * from "+mn.TABLE_NAME+" where "+mn.COLUMN_NAME_REF_COUNT+" > 0"},_.constructContentDBModel=function(e,t,n,r,i,o,a,c,s,u,f,l,h,d,p){var b;return(b={})[mn.COLUMN_NAME_IDENTIFIER]=e,b[mn.COLUMN_NAME_SERVER_DATA]="",b[mn.COLUMN_NAME_PATH]=_.getBasePath(a),b[mn.COLUMN_NAME_REF_COUNT]=c,b[mn.COLUMN_NAME_CONTENT_STATE]=s,b[mn.COLUMN_NAME_SIZE_ON_DEVICE]=l,b[mn.COLUMN_NAME_MANIFEST_VERSION]=t,b[mn.COLUMN_NAME_LOCAL_DATA]=n,b[mn.COLUMN_NAME_MIME_TYPE]=r,b[mn.COLUMN_NAME_CONTENT_TYPE]=i,b[mn.COLUMN_NAME_VISIBILITY]=o,b[mn.COLUMN_NAME_AUDIENCE]=u,b[mn.COLUMN_NAME_PRAGMA]=f,b[mn.COLUMN_NAME_LOCAL_LAST_UPDATED_ON]=Ce().format(),b[mn.COLUMN_NAME_BOARD]=_.getContentAttribute(h),b[mn.COLUMN_NAME_MEDIUM]=_.getContentAttribute(d),b[mn.COLUMN_NAME_GRADE]=_.getContentAttribute(p),b},_.getReferenceCount=function(e,t){var n;return e?(n=e[mn.COLUMN_NAME_REF_COUNT],br.DEFAULT.valueOf()===e[mn.COLUMN_NAME_VISIBILITY]&&br.DEFAULT.valueOf()===t||(n+=1)):n=1,n},_.getContentVisibility=function(e,t,n){var r;return"Library"===t?r=br.PARENT.valueOf():e&&!br.PARENT.valueOf()===e[mn.COLUMN_NAME_VISIBILITY]&&(r=e[mn.COLUMN_NAME_VISIBILITY]),r||n},_.getContentState=function(e,t){return e&&e[mn.COLUMN_NAME_CONTENT_STATE]>t&&(t=e[mn.COLUMN_NAME_CONTENT_STATE]),t},_.isFreeSpaceAvailable=function(e,t,n){var r=10240;return 0a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1] 0\n GROUP BY "+ln.COLUMN_NAME_QID},e.getQuestionReportsQuery=function(e,t){return"SELECT *, SUM("+ln.COLUMN_NAME_SCORE+") as marks,\n COUNT ("+ln.COLUMN_NAME_Q_INDEX+") as occurence_count,\n SUM ("+ln.COLUMN_NAME_MAX_SCORE+") as sum_max_score\n FROM "+ln.TABLE_NAME+"\n WHERE "+ln.COLUMN_NAME_UID+" IN("+di.joinPreservingQuotes(e)+")\n AND "+ln.COLUMN_NAME_CONTENT_ID+"='"+t+"'\n GROUP BY "+ln.COLUMN_NAME_QID},e.getFilterForLearnerAssessmentDetails=function(e,t,n,r){var i=ln.COLUMN_NAME_QID+" = '"+e+"'";return"WHERE "+(ln.COLUMN_NAME_UID+" = '"+t+"'")+" AND "+(ln.COLUMN_NAME_CONTENT_ID+" = '"+n+"'")+" AND "+(ln.COLUMN_NAME_HIERARCHY_DATA+" = '"+(r||"")+"'")+" "+(e?" AND "+i:"")},e.getLearnerAssessmentsQuery=function(e){return"SELECT * from "+ln.TABLE_NAME+" "+e+"\n ORDER BY "+ln.COLUMN_NAME_Q_INDEX},e.getUpdateSelection=function(){return ln.COLUMN_NAME_UID+" = ? AND\n "+ln.COLUMN_NAME_CONTENT_ID+" = ? AND\n "+ln.COLUMN_NAME_HIERARCHY_DATA+" = ? AND\n "+ln.COLUMN_NAME_QID+" = ? "},e.getLearnerSummaryReadSelection=function(e){return ln.COLUMN_NAME_UID+" = ? AND\n "+ln.COLUMN_NAME_CONTENT_ID+" = ? AND\n "+ln.COLUMN_NAME_HIERARCHY_DATA+" = ? "},e}(),Yo=function(){function e(e,t){this.apiService=e,this.courseServiceConfig=t,this.GET_BATCH_DETAILS_ENDPOINT="/batch/read/"}return e.prototype.handle=function(e){var t=(new H.Builder).withType(j.GET).withPath(this.courseServiceConfig.apiPath+this.GET_BATCH_DETAILS_ENDPOINT+e.batchId).withApiToken(!0).withSessionToken(!0).build();return this.apiService.fetch(t).pipe(Object(Pe.map)(function(e){return e.body.result.response}))},e}(),Go=function(){function e(e,t){this.apiService=e,this.courseServiceConfig=t,this.UPDATE_CONTENT_STATE_ENDPOINT="/content/state/update"}return e.prototype.handle=function(e){var t=(new H.Builder).withType(j.PATCH).withPath(this.courseServiceConfig.apiPath+this.UPDATE_CONTENT_STATE_ENDPOINT).withApiToken(!0).withSessionToken(!0).withBody({request:e}).build();return this.apiService.fetch(t).pipe(Object(Pe.map)(function(e){return e.body.result}))},e}(),Ho=function(){function e(e,t,n,r){this.apiService=e,this.courseServiceConfig=t,this.profileService=n,this.authService=r,this.GET_COURSE_BATCHES="/batch/list"}return e.prototype.handle=function(e){var n=this,t=(new H.Builder).withType(j.POST).withPath(this.courseServiceConfig.apiPath+this.GET_COURSE_BATCHES).withApiToken(!0).withSessionToken(!1).withBody({request:e}).build();return this.apiService.fetch(t).pipe(Object(Pe.map)(function(e){return Array.from(new Set(e.body.result.response.content))}),Object(Pe.switchMap)(function(t){return n.authService.getSession().pipe(Object(Pe.mergeMap)(function(e){return e?n.profileService.getServerProfiles({limit:t.length,filters:{identifier:new Set(t.map(function(e){return e.createdBy}))},fields:["firstName","lastName","identifier"]}).pipe(Object(Pe.map)(function(e){return t.forEach(function(t){t.creatorFirstName=e.find(function(e){return e.identifier===t.createdBy}).firstName,t.creatorLastName=e.find(function(e){return e.identifier===t.createdBy}).lastName}),t})):Object(de.of)(t)}))}))},e}(),qo=function(o,a,c,s){return new(c||(c=Promise))(function(e,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new c(function(e){e(t.value)}).then(n,r)}i((s=s.apply(o,a||[])).next())})},zo=function(n,r){var i,o,a,e,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,o&&(a=o[2&t[0]?"return":t[0]?"throw":"next"])&&!(a=a.call(o,t[1])).done)return a;switch(o=0,a&&(t=[0,a.value]),t[0]){case 0:case 1:a=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,o=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]=t},t.prototype.findValidProgress=function(e,t){var n=this;return e.find(function(e){return n.isProgressValid(e,t)})},t.prototype.updateLastReadContentId=function(e,t,n,r){var i=ga.LAST_READ_CONTENTID_PREFIX.concat("_").concat(e).concat("_").concat(t).concat("_").concat(n);return this.sharedPreference.putString(i,r)},t.prototype.handle=function(n){var e=this;return"START"===n.eid&&t.checkPData(n.context.pdata)?(this.courseService.resetCapturedAssessmentEvents(),this.processOEStart(n).pipe(Object(Pe.tap)(function(){return Ma(e,void 0,void 0,function(){return wa(this,function(e){switch(e.label){case 0:return[4,this.summarizerService.saveLearnerAssessmentDetails(n).pipe(Object(Pe.mapTo)(void 0)).toPromise()];case 1:return e.sent(),[2]}})})}),Object(Pe.tap)(function(){return Ma(e,void 0,void 0,function(){var t=this;return wa(this,function(e){switch(e.label){case 0:return[4,this.getCourseContext().pipe(Object(Pe.mergeMap)(function(){return t.updateContentState(n)})).toPromise()];case 1:return e.sent(),[2]}})})}),Object(Pe.tap)(function(){return Ma(e,void 0,void 0,function(){return wa(this,function(e){switch(e.label){case 0:return[4,this.markContentAsPlayed(n).toPromise()];case 1:return e.sent(),[2]}})})}))):"START"===n.eid&&t.checkIsCourse(n)?this.getCourseContext().pipe(Object(Pe.mapTo)(void 0)):"ASSESS"===n.eid&&t.checkPData(n.context.pdata)?this.processOEAssess(n).pipe(Object(Pe.tap)(function(){return Ma(e,void 0,void 0,function(){var t;return wa(this,function(e){switch(e.label){case 0:return[4,this.getCourseContext().toPromise()];case 1:return t=e.sent(),n.context.cdata.find(function(e){return"AttemptId"===e.type})&&t.userId&&t.courseId&&t.batchId?[4,this.courseService.captureAssessmentEvent({event:n,courseContext:t})]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2]}})})}),Object(Pe.tap)(function(){return Ma(e,void 0,void 0,function(){return wa(this,function(e){switch(e.label){case 0:return[4,this.summarizerService.saveLearnerAssessmentDetails(n).pipe(Object(Pe.mapTo)(void 0)).toPromise()];case 1:return e.sent(),[2]}})})})):"END"===n.eid&&t.checkPData(n.context.pdata)?this.processOEEnd(n).pipe(Object(Pe.tap)(function(){return Ma(e,void 0,void 0,function(){return wa(this,function(e){switch(e.label){case 0:return[4,this.summarizerService.saveLearnerContentSummaryDetails(n).pipe(Object(Pe.mapTo)(void 0)).toPromise()];case 1:return e.sent(),[2]}})})}),Object(Pe.tap)(function(){return Ma(e,void 0,void 0,function(){var t=this;return wa(this,function(e){switch(e.label){case 0:return[4,this.getCourseContext().pipe(Object(Pe.mergeMap)(function(){return t.updateContentState(n)})).toPromise()];case 1:return e.sent(),[2]}})})})):"END"===n.eid&&t.checkIsCourse(n)?this.setCourseContextEmpty():Object(de.of)(void 0)},t.prototype.markContentAsPlayed=function(e){var n=this,r=e.actor.id,i=e.object.id,t={contentId:i};return this.contentService.getContentDetails(t).pipe(Object(Pe.mergeMap)(function(t){var e={status:Pi.PLAYED,contentId:i,contentType:t.contentType};return n.profileService.addContentAccess(e).pipe(Object(Pe.mergeMap)(function(){var e={uid:r,contentId:i,data:JSON.stringify(t.contentData),marker:or.PREVIEWED,isMarked:!0,extraInfo:{}};return n.contentService.setContentMarker(e).pipe(Object(Pe.mapTo)(!0))}))}))},t.prototype.getCourseContext=function(){return this.sharedPreference.getString(te.COURSE_CONTEXT).pipe(Object(Pe.map)(function(e){return e?JSON.parse(e):{}}))},t.prototype.checkStatusOfContent=function(e,t,n,r){var i=this,o={userId:e,batchId:n,contentIds:[r],courseIds:[t]};return this.courseService.getContentState(o).pipe(Object(Pe.map)(function(e){var t=e&&e.contentList;return i.getStatus(t,r)}))},t.prototype.getStatus=function(e,t){void 0===e&&(e=[]);var n=e.find(function(e){return e.contentId===t});return n&&n.status||0},t.prototype.processOEStart=function(e){return this.currentUID=e.actor.id,this.currentContentID=e.object.id,Object(de.of)(void 0)},t.prototype.processOEAssess=function(e){var t=this;return this.currentUID&&this.currentContentID&&this.currentUID.toLocaleLowerCase()===e.actor.id.toLocaleLowerCase()&&this.currentContentID.toLocaleLowerCase()===e.object.id.toLocaleLowerCase()?this.summarizerService.deletePreviousAssessmentDetails(this.currentUID,this.currentContentID).pipe(Object(Pe.tap)(function(){t.currentUID=void 0,t.currentContentID=void 0}),Object(Pe.mapTo)(void 0)):Object(de.of)(void 0)},t.prototype.processOEEnd=function(e){return Object(de.of)(void 0)},t.CONTENT_PLAYER_PID="contentplayer",t}(),Ia=function(o,a,c,s){return new(c||(c=Promise))(function(e,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new c(function(e){e(t.value)}).then(n,r)}i((s=s.apply(o,a||[])).next())})},Pa=function(n,r){var i,o,a,e,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,o&&(a=o[2&t[0]?"return":t[0]?"throw":"next"])&&!(a=a.call(o,t[1])).done)return a;switch(o=0,a&&(t=[0,a.value]),t[0]){case 0:case 1:a=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,o=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]e?t.index:e},0);e.frameworks.sort(function(e,t){return(e.index||n+1)-(t.index||n+1)})}return e}))},e.prototype.fetchFromServer=function(e){var t=(new H.Builder).withType(j.GET).withPath(this.frameworkServiceConfig.channelApiPath+this.GET_FRAMEWORK_DETAILS_ENDPOINT+"/"+e.channelId).withApiToken(!0).build();return this.apiService.fetch(t).pipe(Object(Pe.map)(function(e){return e.body.result.channel}))},e.prototype.fetchFromFile=function(e){var t=oo.ASSETS_PATH+this.frameworkServiceConfig.channelConfigDirPath,n=this.CHANNEL_FILE_KEY_PREFIX+e.channelId+".json";return Object(de.from)(this.fileService.readFileFromAssets(t.concat("/",n))).pipe(Object(Pe.map)(function(e){return JSON.parse(e).result.channel}))},e}(),pc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=n.categories.length-1||e.category===n.categories[t+1].code})),e})}):e}),pc({},n)):n},n.prepareFrameworkTranslations=function(e,t){return e.name=n.getTranslatedValue(e.translations,t,e.name),e.categories&&(e.categories=e.categories.map(function(e){return e.name=n.getTranslatedValue(e.translations,t,e.name),e.terms&&(e.terms=e.terms.map(function(e){return e.name=n.getTranslatedValue(e.translations,t,e.name),e})),e})),e},n.prepareFrameworkCategoryTranslations=function(e,t){return e.name=n.getTranslatedValue(e.translations,t,e.name),e.terms&&(e.terms=e.terms.map(function(e){return e.name=n.getTranslatedValue(e.translations,t,e.name),e})),e},n.getTranslatedValue=function(e,t,n){return e&&JSON.parse(e)[t]||n},n}(),_c=function(){function e(e,t,n,r,i){this.frameworkService=e,this.apiService=t,this.frameworkServiceConfig=n,this.fileService=r,this.cachedItemStore=i,this.FRAMEWORK_FILE_KEY_PREFIX="framework-",this.FRAMEWORK_LOCAL_KEY="framework-",this.GET_FRAMEWORK_DETAILS_ENDPOINT="/read"}return e.prototype.handle=function(t){var n=this;return Object(de.iif)(function(){return!!t.frameworkId},Object(de.defer)(function(){return n.cachedItemStore.getCached(t.frameworkId,n.FRAMEWORK_LOCAL_KEY,"ttl_"+n.FRAMEWORK_LOCAL_KEY,function(){return n.fetchFromServer(t)},function(){return n.fetchFromFile(t)})}),Object(de.defer)(function(){return n.frameworkService.getDefaultChannelDetails().pipe(Object(Pe.mergeMap)(function(e){return n.frameworkService.getFrameworkDetails({frameworkId:e.defaultFramework,requiredCategories:t.requiredCategories})}))}))},e.prototype.fetchFromServer=function(e){var t=(new H.Builder).withType(j.GET).withPath(this.frameworkServiceConfig.frameworkApiPath+this.GET_FRAMEWORK_DETAILS_ENDPOINT+"/"+e.frameworkId).withParameters({categories:e.requiredCategories.join(",")}).withApiToken(!0).build();return this.apiService.fetch(t).pipe(Object(Pe.map)(function(e){return e.body.result.framework}),Object(Pe.map)(function(e){return bc.prepareFrameworkCategoryAssociations(e)}))},e.prototype.fetchFromFile=function(e){var t=oo.ASSETS_PATH+this.frameworkServiceConfig.frameworkConfigDirPath,n=this.FRAMEWORK_FILE_KEY_PREFIX+e.frameworkId+".json";return Object(de.from)(this.fileService.readFileFromAssets(t.concat("/",n))).pipe(Object(Pe.map)(function(e){return JSON.parse(e).result.framework}),Object(Pe.map)(function(e){return bc.prepareFrameworkCategoryAssociations(e)}))},e}(),Ec=(Oa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}Oa(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),yc=function(n){function r(e){var t=n.call(this,e,"NO_ACTIVE_CHANNEL_FOUND_ERROR")||this;return Object.setPrototypeOf(t,r.prototype),t}return Ec(r,n),r}(B),vc=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var c=e.length-1;0<=c;c--)(i=e[c])&&(a=(o<3?i(a):3a[0]&&t[1]e?t.index:e},0);return t.sort(function(e,t){return(e.index||n+1)-(t.index||n+1)}),t}))},e.prototype.getActiveChannelTranslatedDefaultFrameworkDetails=function(t,n){var r=this;return this.frameworkUtilService.getActiveChannel().pipe(Object(Pe.mergeMap)(function(e){return r.getTranslatedFrameworkDetails(e.defaultFramework,t,n)}))},e.prototype.getTranslatedFrameworkDetails=function(e,t,n){return this.frameworkService.getFrameworkDetails({frameworkId:e,requiredCategories:t}).pipe(Object(Pe.map)(function(e){return bc.prepareFrameworkTranslations(e,n)}))},e.prototype.getAllCategoriesTermsSet=function(e){return e.categories?e.categories.reduce(function(e,t){return e.concat([t.terms||[]])},[]).reduce(function(e,t){return e.concat(t)},[]).reduce(function(e,t){return e.add(t),e},new Tc.a(function(e){return Object(Nc.makeString)(e)})):new Tc.a},e.prototype.getCategoryTerms=function(e,t){return e.categories.find(function(e){return e.code===t.currentCategoryCode}).terms.reduce(function(e,t){return e.add(t),e},new Tc.a(function(e){return Object(Nc.makeString)(e)}))},e.prototype.getCategoryAssociationTerms=function(e,n){var r=this;if(!e.categories)return new Tc.a;var t=e.categories.find(function(e){return e.code===n.prevCategoryCode}).terms;if(!t)return new Tc.a;var i=t.filter(function(t){return n.selectedTermsCodes.find(function(e){return e===t.code})}).map(function(e){return e.associations||[]});return i.some(function(e){return 0===e.length})?e.categories.find(function(e){return e.code===n.currentCategoryCode}).terms.reduce(function(e,t){return e.add(t),e},new Tc.a(function(e){return Object(Nc.makeString)(e)})):i.reduce(function(e,t){return e.concat(t)}).reduce(function(e,t){return e.add(t),e},new Tc.a(function(e){return Object(Nc.makeString)(e)})).toArray().map(function(t){return r.getAllCategoriesTermsSet(e).toArray().find(function(e){return e.code===t.code})}).reduce(function(e,t){return e.add(t),e},new Tc.a(function(e){return Object(Nc.makeString)(e)}))},e}(),Ic=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var c=e.length-1;0<=c;c--)(i=e[c])&&(a=(o<3?i(a):3a[0]&&t[1]a[0]&&t[1]a[0]&&t[1] 0",r="SELECT * FROM "+mn.TABLE_NAME+" "+n;return this.dbService.execute(r).toPromise()},e.prototype.rm=function(e,r){return new Promise(function(t,n){try{buildconfigreader.rm(e,r,function(e){t(e)},function(e){console.error(e),n(!1)})}catch(e){console.error(e),n(!1)}})},e.prototype.getMetaData=function(r){return zc(this,void 0,void 0,function(){return Kc(this,function(e){return[2,new Promise(function(t,n){buildconfigreader.getMetaData(r,function(e){t(e)},function(e){console.error(e),n(e)})})]})})},e}(),Xc=Object.assign||function(e){for(var t,n=1,r=arguments.length;na[0]&&t[1]a[0]&&t[1] 0",o="select * from "+mn.TABLE_NAME+" "+i+" "+n;return this.dbService.execute(o).toPromise()},r.EKSTEP_CONTENT_ARCHIVE="ekstep.content.archive",r.SUPPORTED_MANIFEST_VERSION="1.1",r}(),as=function(){function i(e,t){this.dbService=e,this.exportHandler=t}return i.prototype.execute=function(e){var t=new V,n=this.exportHandler.populateItems(e.contentModelsToExport);e.items=[],e.manifest={},e.items=e.items.concat(n);var r={ttl:24};return r.count=e.items.length,r.items=e.items,e.manifest.id=i.EKSTEP_CONTENT_ARCHIVE,e.manifest.ver=i.SUPPORTED_MANIFEST_VERSION,e.manifest.ts=Ce().format(),e.manifest.archive=r,t.body=e,Promise.resolve(t)},i.EKSTEP_CONTENT_ARCHIVE="ekstep.content.archive",i.SUPPORTED_MANIFEST_VERSION="1.1",i}(),cs=function(){function e(e,t){this.fileService=e,this.deviceInfo=t}return e.prototype.execute=function(n){var r=this,i=new V;return this.deviceInfo.getAvailableInternalMemorySize().toPromise().then(function(e){var t=Number(e);if(0a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]T.pkgVersion&&T.childNodes&&0a[0]&&t[1] 0";return this.dbService.execute(t).toPromise()},e.prototype.updateAllRootContentSize=function(){var e=this,t="SELECT * FROM "+mn.TABLE_NAME+" WHERE "+mn.COLUMN_NAME_REF_COUNT+" > 0\n AND "+mn.COLUMN_NAME_VISIBILITY+" = '"+br.DEFAULT.valueOf()+"'";return this.dbService.execute(t).pipe(Object(Pe.tap)(function(){return Ns(e,void 0,void 0,function(){return Ms(this,function(e){return[2,this.sharedPreferences.putBoolean(te.KEY_IS_UPDATE_SIZE_ON_DEVICE_SUCCESSFUL,!1).toPromise()]})})}),Object(Pe.mergeMap)(function(n){return Ns(e,void 0,void 0,function(){var i,t=this;return Ms(this,function(e){switch(e.label){case 0:return i=[],[4,Promise.all(n.map(function(r){return Ns(t,void 0,void 0,function(){var t,n;return Ms(this,function(e){switch(e.label){case 0:return[4,this.getSizeOnDevice(r)];case 1:return t=e.sent(),(n=JSON.parse(r[mn.COLUMN_NAME_LOCAL_DATA]).childNodes)?[4,this.findAllChildContents(n)]:[3,3];case 2:e.sent().forEach(function(e){t+=e[mn.COLUMN_NAME_SIZE_ON_DEVICE]||0}),r[mn.COLUMN_NAME_SIZE_ON_DEVICE]=t,i.push(r),e.label=3;case 3:return[2]}})})}))];case 1:return e.sent(),this.updateInDb(i),[2]}})})}),Object(Pe.tap)(function(){return Ns(e,void 0,void 0,function(){return Ms(this,function(e){return[2,this.sharedPreferences.putBoolean(te.KEY_IS_UPDATE_SIZE_ON_DEVICE_SUCCESSFUL,!0).toPromise()]})})}))},e.prototype.getSizeOnDevice=function(a){return Ns(this,void 0,void 0,function(){var t,n,r,i,o;return Ms(this,function(e){switch(e.label){case 0:return t=0,a[mn.COLUMN_NAME_MIME_TYPE]!==dr.COLLECTION.valueOf()?[3,3]:a[mn.COLUMN_NAME_VISIBILITY]!==br.DEFAULT.valueOf()?[3,2]:(n=[],r={},i=a[mn.COLUMN_NAME_IDENTIFIER],r.identifier=i,r.path=a[mn.COLUMN_NAME_PATH],n.push(r),[4,this.getMetaData(n)]);case 1:o=e.sent(),t=o[i]?o[i].size:0,e.label=2;case 2:return[3,4];case 3:t=a[mn.COLUMN_NAME_SIZE_ON_DEVICE]?a[mn.COLUMN_NAME_SIZE_ON_DEVICE]:0,e.label=4;case 4:return[2,Promise.resolve(t||0)]}})})},e.prototype.updateInDb=function(a){return Ns(this,void 0,void 0,function(){var t,n,r,i,o;return Ms(this,function(e){for(this.dbService.beginTransaction(),t=0,n=a;ta[0]&&t[1]t&&(t=e[mn.COLUMN_NAME_CONTENT_STATE]),t},e.prototype.getBasePath=function(e,t,n){return e&&!t?e:n},e.prototype.getReferenceCount=function(e,t,n,r){var i;e?(i=e[mn.COLUMN_NAME_REF_COUNT],(r?r[e[mn.COLUMN_NAME_IDENTIFIER]]:void 0)||n||br.DEFAULT.valueOf()===e[Ps]&&br.DEFAULT.valueOf()===t||(i+=1)):i=1;return i},e.prototype.postImportProgressEvent=function(e,t){this.eventsBusService.emit({namespace:Te.CONTENT,event:{type:Lr.IMPORT_PROGRESS,payload:{totalCount:t,currentCount:e}}})},e.prototype.constructContentDBModel=function(e,t,n,r,i,o,a,c,s,u,f,l,h,d,p){var b;return(b={})[mn.COLUMN_NAME_IDENTIFIER]=e,b[mn.COLUMN_NAME_SERVER_DATA]="",b[mn.COLUMN_NAME_PATH]=co.getBasePath(a),b[mn.COLUMN_NAME_REF_COUNT]=c,b[mn.COLUMN_NAME_CONTENT_STATE]=s,b[mn.COLUMN_NAME_SIZE_ON_DEVICE]=l,b[mn.COLUMN_NAME_MANIFEST_VERSION]=t,b[mn.COLUMN_NAME_LOCAL_DATA]=n,b[mn.COLUMN_NAME_MIME_TYPE]=r,b[mn.COLUMN_NAME_CONTENT_TYPE]=i,b[mn.COLUMN_NAME_VISIBILITY]=o,b[mn.COLUMN_NAME_AUDIENCE]=u,b[mn.COLUMN_NAME_PRAGMA]=f,b[mn.COLUMN_NAME_LOCAL_LAST_UPDATED_ON]=Ce(Date.now()).format(),b[mn.COLUMN_NAME_BOARD]=co.getContentAttribute(h),b[mn.COLUMN_NAME_MEDIUM]=co.getContentAttribute(d),b[mn.COLUMN_NAME_GRADE]=co.getContentAttribute(p),b},e.prototype.createDirectories=function(r,i){return Cs(this,void 0,void 0,function(){return Is(this,function(e){return[2,new Promise(function(t,n){buildconfigreader.createDirectories(co.getBasePath(r),i,function(e){t(e)},function(e){console.error(e),n(e)})})]})})},e}(),Rs=n(114),Ds=n.n(Rs),Us=function(o,a,c,s){return new(c||(c=Promise))(function(e,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new c(function(e){e(t.value)}).then(n,r)}i((s=s.apply(o,a||[])).next())})},js=function(n,r){var i,o,a,e,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,o&&(a=o[2&t[0]?"return":t[0]?"throw":"next"])&&!(a=a.call(o,t[1])).done)return a;switch(o=0,a&&(t=[0,a.value]),t[0]){case 0:case 1:a=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,o=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1] ?",[Date.now().toString(),Date.now().toString()];break;case Th.UNREAD:Cn.COLUMN_NAME_NOTIFICATION_DISPLAY_TIME+" <= ?\n AND "+Cn.COLUMN_NAME_EXPIRY_TIME+" > ? AND\n AND "+Cn.COLUMN_NAME_IS_READ+" > ?",[Date.now().toString(),Date.now().toString(),0];break;case Th.READ:default:Cn.COLUMN_NAME_NOTIFICATION_DISPLAY_TIME+" <= ?\n AND "+Cn.COLUMN_NAME_EXPIRY_TIME+" > ?\n AND "+Cn.COLUMN_NAME_IS_READ+" > ?",[Date.now().toString(),Date.now().toString(),1]}return{table:Cn.TABLE_NAME,orderBy:Cn.COLUMN_NAME_NOTIFICATION_RECEIVED_AT+" desc"}},e}(),Kh=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var c=e.length-1;0<=c;c--)(i=e[c])&&(a=(o<3?i(a):3a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1] {\n window.location.href = `"+a.buildUrl(t,n,r)+"`;\n })()"}),[2]})})},a.prototype.success=function(){return Pp(this,void 0,void 0,function(){return Lp(this,function(e){return[2,Ip({},this.captured)]})})},a.prototype.fail=function(){return Pp(this,void 0,void 0,function(){return Lp(this,function(e){throw Ip({},this.captured)})})},a.prototype.getCaptureExtras=function(){return Pp(this,void 0,void 0,function(){return Lp(this,function(e){return[2,Ip({},this.extras)]})})},a}(),Dp=function(o,a,c,s){return new(c||(c=Promise))(function(e,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new c(function(e){e(t.value)}).then(n,r)}i((s=s.apply(o,a||[])).next())})},Up=function(n,r){var i,o,a,e,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,o&&(a=o[2&t[0]?"return":t[0]?"throw":"next"])&&!(a=a.call(o,t[1])).done)return a;switch(o=0,a&&(t=[0,a.value]),t[0]){case 0:case 1:a=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,o=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]a[0]&&t[1]