0) {\n\t if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n\t while(i >= 0) {\n\t if(p < k) {\n\t d = (this[i]&((1<>(p+=this.DB-k);\n\t }\n\t else {\n\t d = (this[i]>>(p-=k))&km;\n\t if(p <= 0) { p += this.DB; --i; }\n\t }\n\t if(d > 0) m = true;\n\t if(m) r += int2char(d);\n\t }\n\t }\n\t return m?r:\"0\";\n\t }\n\t\n\t // (public) -this\n\t function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }\n\t\n\t // (public) |this|\n\t function bnAbs() { return (this.s<0)?this.negate():this; }\n\t\n\t // (public) return + if this > a, - if this < a, 0 if equal\n\t function bnCompareTo(a) {\n\t var r = this.s-a.s;\n\t if(r != 0) return r;\n\t var i = this.t;\n\t r = i-a.t;\n\t if(r != 0) return (this.s<0)?-r:r;\n\t while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n\t return 0;\n\t }\n\t\n\t // returns bit length of the integer x\n\t function nbits(x) {\n\t var r = 1, t;\n\t if((t=x>>>16) != 0) { x = t; r += 16; }\n\t if((t=x>>8) != 0) { x = t; r += 8; }\n\t if((t=x>>4) != 0) { x = t; r += 4; }\n\t if((t=x>>2) != 0) { x = t; r += 2; }\n\t if((t=x>>1) != 0) { x = t; r += 1; }\n\t return r;\n\t }\n\t\n\t // (public) return the number of bits in \"this\"\n\t function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }\n\t\n\t // (protected) r = this << n*DB\n\t function bnpDLShiftTo(n,r) {\n\t var i;\n\t for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];\n\t for(i = n-1; i >= 0; --i) r[i] = 0;\n\t r.t = this.t+n;\n\t r.s = this.s;\n\t }\n\t\n\t // (protected) r = this >> n*DB\n\t function bnpDRShiftTo(n,r) {\n\t for(var i = n; i < this.t; ++i) r[i-n] = this[i];\n\t r.t = Math.max(this.t-n,0);\n\t r.s = this.s;\n\t }\n\t\n\t // (protected) r = this << n\n\t function bnpLShiftTo(n,r) {\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<= 0; --i) {\n\t r[i+ds+1] = (this[i]>>cbs)|c;\n\t c = (this[i]&bm)<= 0; --i) r[i] = 0;\n\t r[ds] = c;\n\t r.t = this.t+ds+1;\n\t r.s = this.s;\n\t r.clamp();\n\t }\n\t\n\t // (protected) r = this >> n\n\t function bnpRShiftTo(n,r) {\n\t r.s = this.s;\n\t var ds = Math.floor(n/this.DB);\n\t if(ds >= this.t) { r.t = 0; return; }\n\t var bs = n%this.DB;\n\t var cbs = this.DB-bs;\n\t var bm = (1<>bs;\n\t for(var i = ds+1; i < this.t; ++i) {\n\t r[i-ds-1] |= (this[i]&bm)<>bs;\n\t }\n\t if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB;\n\t }\n\t if(a.t < this.t) {\n\t c -= a.s;\n\t while(i < this.t) {\n\t c += this[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c += this.s;\n\t }\n\t else {\n\t c += this.s;\n\t while(i < a.t) {\n\t c -= a[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c -= a.s;\n\t }\n\t r.s = (c<0)?-1:0;\n\t if(c < -1) r[i++] = this.DV+c;\n\t else if(c > 0) r[i++] = c;\n\t r.t = i;\n\t r.clamp();\n\t }\n\t\n\t // (protected) r = this * a, r != this,a (HAC 14.12)\n\t // \"this\" should be the larger one if appropriate.\n\t function bnpMultiplyTo(a,r) {\n\t var x = this.abs(), y = a.abs();\n\t var i = x.t;\n\t r.t = i+y.t;\n\t while(--i >= 0) r[i] = 0;\n\t for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);\n\t r.s = 0;\n\t r.clamp();\n\t if(this.s != a.s) BigInteger.ZERO.subTo(r,r);\n\t }\n\t\n\t // (protected) r = this^2, r != this (HAC 14.16)\n\t function bnpSquareTo(r) {\n\t var x = this.abs();\n\t var i = r.t = 2*x.t;\n\t while(--i >= 0) r[i] = 0;\n\t for(i = 0; i < x.t-1; ++i) {\n\t var c = x.am(i,x[i],r,2*i,0,1);\n\t if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {\n\t r[i+x.t] -= x.DV;\n\t r[i+x.t+1] = 1;\n\t }\n\t }\n\t if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);\n\t r.s = 0;\n\t r.clamp();\n\t }\n\t\n\t // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n\t // r != q, this != m. q or r may be null.\n\t function bnpDivRemTo(m,q,r) {\n\t var pm = m.abs();\n\t if(pm.t <= 0) return;\n\t var pt = this.abs();\n\t if(pt.t < pm.t) {\n\t if(q != null) q.fromInt(0);\n\t if(r != null) this.copyTo(r);\n\t return;\n\t }\n\t if(r == null) r = nbi();\n\t var y = nbi(), ts = this.s, ms = m.s;\n\t var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n\t if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n\t else { pm.copyTo(y); pt.copyTo(r); }\n\t var ys = y.t;\n\t var y0 = y[ys-1];\n\t if(y0 == 0) return;\n\t var yt = y0*(1<1)?y[ys-2]>>this.F2:0);\n\t var d1 = this.FV/yt, d2 = (1<= 0) {\n\t r[r.t++] = 1;\n\t r.subTo(t,r);\n\t }\n\t BigInteger.ONE.dlShiftTo(ys,t);\n\t t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n\t while(y.t < ys) y[y.t++] = 0;\n\t while(--j >= 0) {\n\t // Estimate quotient digit\n\t var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n\t if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n\t y.dlShiftTo(j,t);\n\t r.subTo(t,r);\n\t while(r[i] < --qd) r.subTo(t,r);\n\t }\n\t }\n\t if(q != null) {\n\t r.drShiftTo(ys,q);\n\t if(ts != ms) BigInteger.ZERO.subTo(q,q);\n\t }\n\t r.t = ys;\n\t r.clamp();\n\t if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n\t if(ts < 0) BigInteger.ZERO.subTo(r,r);\n\t }\n\t\n\t // (public) this mod a\n\t function bnMod(a) {\n\t var r = nbi();\n\t this.abs().divRemTo(a,null,r);\n\t if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);\n\t return r;\n\t }\n\t\n\t // Modular reduction using \"classic\" algorithm\n\t function Classic(m) { this.m = m; }\n\t function cConvert(x) {\n\t if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);\n\t else return x;\n\t }\n\t function cRevert(x) { return x; }\n\t function cReduce(x) { x.divRemTo(this.m,null,x); }\n\t function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\t function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\t\n\t Classic.prototype.convert = cConvert;\n\t Classic.prototype.revert = cRevert;\n\t Classic.prototype.reduce = cReduce;\n\t Classic.prototype.mulTo = cMulTo;\n\t Classic.prototype.sqrTo = cSqrTo;\n\t\n\t // (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n\t // justification:\n\t // xy == 1 (mod m)\n\t // xy = 1+km\n\t // xy(2-xy) = (1+km)(1-km)\n\t // x[y(2-xy)] = 1-k^2m^2\n\t // x[y(2-xy)] == 1 (mod m^2)\n\t // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n\t // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n\t // JS multiply \"overflows\" differently from C/C++, so care is needed here.\n\t function bnpInvDigit() {\n\t if(this.t < 1) return 0;\n\t var x = this[0];\n\t if((x&1) == 0) return 0;\n\t var y = x&3; // y == 1/x mod 2^2\n\t y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4\n\t y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8\n\t y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16\n\t // last step - calculate inverse mod DV directly;\n\t // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n\t y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits\n\t // we really want the negative inverse, and -DV < y < DV\n\t return (y>0)?this.DV-y:-y;\n\t }\n\t\n\t // Montgomery reduction\n\t function Montgomery(m) {\n\t this.m = m;\n\t this.mp = m.invDigit();\n\t this.mpl = this.mp&0x7fff;\n\t this.mph = this.mp>>15;\n\t this.um = (1<<(m.DB-15))-1;\n\t this.mt2 = 2*m.t;\n\t }\n\t\n\t // xR mod m\n\t function montConvert(x) {\n\t var r = nbi();\n\t x.abs().dlShiftTo(this.m.t,r);\n\t r.divRemTo(this.m,null,r);\n\t if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);\n\t return r;\n\t }\n\t\n\t // x/R mod m\n\t function montRevert(x) {\n\t var r = nbi();\n\t x.copyTo(r);\n\t this.reduce(r);\n\t return r;\n\t }\n\t\n\t // x = x/R mod m (HAC 14.32)\n\t function montReduce(x) {\n\t while(x.t <= this.mt2) // pad x so am has enough room later\n\t x[x.t++] = 0;\n\t for(var i = 0; i < this.m.t; ++i) {\n\t // faster way of calculating u0 = x[i]*mp mod DV\n\t var j = x[i]&0x7fff;\n\t var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n\t // use am to combine the multiply-shift-add into one call\n\t j = i+this.m.t;\n\t x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n\t // propagate carry\n\t while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n\t }\n\t x.clamp();\n\t x.drShiftTo(this.m.t,x);\n\t if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n\t }\n\t\n\t // r = \"x^2/R mod m\"; x != r\n\t function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\t\n\t // r = \"xy/R mod m\"; x,y != r\n\t function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\t\n\t Montgomery.prototype.convert = montConvert;\n\t Montgomery.prototype.revert = montRevert;\n\t Montgomery.prototype.reduce = montReduce;\n\t Montgomery.prototype.mulTo = montMulTo;\n\t Montgomery.prototype.sqrTo = montSqrTo;\n\t\n\t // (protected) true iff this is even\n\t function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }\n\t\n\t // (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)\n\t function bnpExp(e,z) {\n\t if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n\t var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n\t g.copyTo(r);\n\t while(--i >= 0) {\n\t z.sqrTo(r,r2);\n\t if((e&(1< 0) z.mulTo(r2,g,r);\n\t else { var t = r; r = r2; r2 = t; }\n\t }\n\t return z.revert(r);\n\t }\n\t\n\t // (public) this^e % m, 0 <= e < 2^32\n\t function bnModPowInt(e,m) {\n\t var z;\n\t if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n\t return this.exp(e,z);\n\t }\n\t\n\t // protected\n\t BigInteger.prototype.copyTo = bnpCopyTo;\n\t BigInteger.prototype.fromInt = bnpFromInt;\n\t BigInteger.prototype.fromString = bnpFromString;\n\t BigInteger.prototype.clamp = bnpClamp;\n\t BigInteger.prototype.dlShiftTo = bnpDLShiftTo;\n\t BigInteger.prototype.drShiftTo = bnpDRShiftTo;\n\t BigInteger.prototype.lShiftTo = bnpLShiftTo;\n\t BigInteger.prototype.rShiftTo = bnpRShiftTo;\n\t BigInteger.prototype.subTo = bnpSubTo;\n\t BigInteger.prototype.multiplyTo = bnpMultiplyTo;\n\t BigInteger.prototype.squareTo = bnpSquareTo;\n\t BigInteger.prototype.divRemTo = bnpDivRemTo;\n\t BigInteger.prototype.invDigit = bnpInvDigit;\n\t BigInteger.prototype.isEven = bnpIsEven;\n\t BigInteger.prototype.exp = bnpExp;\n\t\n\t // public\n\t BigInteger.prototype.toString = bnToString;\n\t BigInteger.prototype.negate = bnNegate;\n\t BigInteger.prototype.abs = bnAbs;\n\t BigInteger.prototype.compareTo = bnCompareTo;\n\t BigInteger.prototype.bitLength = bnBitLength;\n\t BigInteger.prototype.mod = bnMod;\n\t BigInteger.prototype.modPowInt = bnModPowInt;\n\t\n\t // \"constants\"\n\t BigInteger.ZERO = nbv(0);\n\t BigInteger.ONE = nbv(1);\n\t\n\t // Copyright (c) 2005-2009 Tom Wu\n\t // All Rights Reserved.\n\t // See \"LICENSE\" for details.\n\t\n\t // Extended JavaScript BN functions, required for RSA private ops.\n\t\n\t // Version 1.1: new BigInteger(\"0\", 10) returns \"proper\" zero\n\t // Version 1.2: square() API, isProbablePrime fix\n\t\n\t // (public)\n\t function bnClone() { var r = nbi(); this.copyTo(r); return r; }\n\t\n\t // (public) return value as integer\n\t function bnIntValue() {\n\t if(this.s < 0) {\n\t if(this.t == 1) return this[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t }\n\t else if(this.t == 1) return this[0];\n\t else if(this.t == 0) return 0;\n\t // assumes 16 < DB < 32\n\t return ((this[1]&((1<<(32-this.DB))-1))<>24; }\n\t\n\t // (public) return value as short (assumes DB>=16)\n\t function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }\n\t\n\t // (protected) return x s.t. r^x < DV\n\t function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }\n\t\n\t // (public) 0 if this == 0, 1 if this > 0\n\t function bnSigNum() {\n\t if(this.s < 0) return -1;\n\t else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n\t else return 1;\n\t }\n\t\n\t // (protected) convert to radix string\n\t function bnpToRadix(b) {\n\t if(b == null) b = 10;\n\t if(this.signum() == 0 || b < 2 || b > 36) return \"0\";\n\t var cs = this.chunkSize(b);\n\t var a = Math.pow(b,cs);\n\t var d = nbv(a), y = nbi(), z = nbi(), r = \"\";\n\t this.divRemTo(d,y,z);\n\t while(y.signum() > 0) {\n\t r = (a+z.intValue()).toString(b).substr(1) + r;\n\t y.divRemTo(d,y,z);\n\t }\n\t return z.intValue().toString(b) + r;\n\t }\n\t\n\t // (protected) convert from radix string\n\t function bnpFromRadix(s,b) {\n\t this.fromInt(0);\n\t if(b == null) b = 10;\n\t var cs = this.chunkSize(b);\n\t var d = Math.pow(b,cs), mi = false, j = 0, w = 0;\n\t for(var i = 0; i < s.length; ++i) {\n\t var x = intAt(s,i);\n\t if(x < 0) {\n\t if(s.charAt(i) == \"-\" && this.signum() == 0) mi = true;\n\t continue;\n\t }\n\t w = b*w+x;\n\t if(++j >= cs) {\n\t this.dMultiply(d);\n\t this.dAddOffset(w,0);\n\t j = 0;\n\t w = 0;\n\t }\n\t }\n\t if(j > 0) {\n\t this.dMultiply(Math.pow(b,j));\n\t this.dAddOffset(w,0);\n\t }\n\t if(mi) BigInteger.ZERO.subTo(this,this);\n\t }\n\t\n\t // (protected) alternate constructor\n\t function bnpFromNumber(a,b,c) {\n\t if(\"number\" == typeof b) {\n\t // new BigInteger(int,int,RNG)\n\t if(a < 2) this.fromInt(1);\n\t else {\n\t this.fromNumber(a,c);\n\t if(!this.testBit(a-1))\t// force MSB set\n\t this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);\n\t if(this.isEven()) this.dAddOffset(1,0); // force odd\n\t while(!this.isProbablePrime(b)) {\n\t this.dAddOffset(2,0);\n\t if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);\n\t }\n\t }\n\t }\n\t else {\n\t // new BigInteger(int,RNG)\n\t var x = new Array(), t = a&7;\n\t x.length = (a>>3)+1;\n\t b.nextBytes(x);\n\t if(t > 0) x[0] &= ((1< 0) {\n\t if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)\n\t r[k++] = d|(this.s<<(this.DB-p));\n\t while(i >= 0) {\n\t if(p < 8) {\n\t d = (this[i]&((1<>(p+=this.DB-8);\n\t }\n\t else {\n\t d = (this[i]>>(p-=8))&0xff;\n\t if(p <= 0) { p += this.DB; --i; }\n\t }\n\t if((d&0x80) != 0) d |= -256;\n\t if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;\n\t if(k > 0 || d != this.s) r[k++] = d;\n\t }\n\t }\n\t return r;\n\t }\n\t\n\t function bnEquals(a) { return(this.compareTo(a)==0); }\n\t function bnMin(a) { return(this.compareTo(a)<0)?this:a; }\n\t function bnMax(a) { return(this.compareTo(a)>0)?this:a; }\n\t\n\t // (protected) r = this op a (bitwise)\n\t function bnpBitwiseTo(a,op,r) {\n\t var i, f, m = Math.min(a.t,this.t);\n\t for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);\n\t if(a.t < this.t) {\n\t f = a.s&this.DM;\n\t for(i = m; i < this.t; ++i) r[i] = op(this[i],f);\n\t r.t = this.t;\n\t }\n\t else {\n\t f = this.s&this.DM;\n\t for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);\n\t r.t = a.t;\n\t }\n\t r.s = op(this.s,a.s);\n\t r.clamp();\n\t }\n\t\n\t // (public) this & a\n\t function op_and(x,y) { return x&y; }\n\t function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }\n\t\n\t // (public) this | a\n\t function op_or(x,y) { return x|y; }\n\t function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }\n\t\n\t // (public) this ^ a\n\t function op_xor(x,y) { return x^y; }\n\t function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }\n\t\n\t // (public) this & ~a\n\t function op_andnot(x,y) { return x&~y; }\n\t function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }\n\t\n\t // (public) ~this\n\t function bnNot() {\n\t var r = nbi();\n\t for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];\n\t r.t = this.t;\n\t r.s = ~this.s;\n\t return r;\n\t }\n\t\n\t // (public) this << n\n\t function bnShiftLeft(n) {\n\t var r = nbi();\n\t if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n\t return r;\n\t }\n\t\n\t // (public) this >> n\n\t function bnShiftRight(n) {\n\t var r = nbi();\n\t if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n\t return r;\n\t }\n\t\n\t // return index of lowest 1-bit in x, x < 2^31\n\t function lbit(x) {\n\t if(x == 0) return -1;\n\t var r = 0;\n\t if((x&0xffff) == 0) { x >>= 16; r += 16; }\n\t if((x&0xff) == 0) { x >>= 8; r += 8; }\n\t if((x&0xf) == 0) { x >>= 4; r += 4; }\n\t if((x&3) == 0) { x >>= 2; r += 2; }\n\t if((x&1) == 0) ++r;\n\t return r;\n\t }\n\t\n\t // (public) returns index of lowest 1-bit (or -1 if none)\n\t function bnGetLowestSetBit() {\n\t for(var i = 0; i < this.t; ++i)\n\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\t if(this.s < 0) return this.t*this.DB;\n\t return -1;\n\t }\n\t\n\t // return number of 1 bits in x\n\t function cbit(x) {\n\t var r = 0;\n\t while(x != 0) { x &= x-1; ++r; }\n\t return r;\n\t }\n\t\n\t // (public) return number of set bits\n\t function bnBitCount() {\n\t var r = 0, x = this.s&this.DM;\n\t for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n\t return r;\n\t }\n\t\n\t // (public) true iff nth bit is set\n\t function bnTestBit(n) {\n\t var j = Math.floor(n/this.DB);\n\t if(j >= this.t) return(this.s!=0);\n\t return((this[j]&(1<<(n%this.DB)))!=0);\n\t }\n\t\n\t // (protected) this op (1<>= this.DB;\n\t }\n\t if(a.t < this.t) {\n\t c += a.s;\n\t while(i < this.t) {\n\t c += this[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c += this.s;\n\t }\n\t else {\n\t c += this.s;\n\t while(i < a.t) {\n\t c += a[i];\n\t r[i++] = c&this.DM;\n\t c >>= this.DB;\n\t }\n\t c += a.s;\n\t }\n\t r.s = (c<0)?-1:0;\n\t if(c > 0) r[i++] = c;\n\t else if(c < -1) r[i++] = this.DV+c;\n\t r.t = i;\n\t r.clamp();\n\t }\n\t\n\t // (public) this + a\n\t function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }\n\t\n\t // (public) this - a\n\t function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }\n\t\n\t // (public) this * a\n\t function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }\n\t\n\t // (public) this^2\n\t function bnSquare() { var r = nbi(); this.squareTo(r); return r; }\n\t\n\t // (public) this / a\n\t function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }\n\t\n\t // (public) this % a\n\t function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }\n\t\n\t // (public) [this/a,this%a]\n\t function bnDivideAndRemainder(a) {\n\t var q = nbi(), r = nbi();\n\t this.divRemTo(a,q,r);\n\t return new Array(q,r);\n\t }\n\t\n\t // (protected) this *= n, this >= 0, 1 < n < DV\n\t function bnpDMultiply(n) {\n\t this[this.t] = this.am(0,n-1,this,0,0,this.t);\n\t ++this.t;\n\t this.clamp();\n\t }\n\t\n\t // (protected) this += n << w words, this >= 0\n\t function bnpDAddOffset(n,w) {\n\t if(n == 0) return;\n\t while(this.t <= w) this[this.t++] = 0;\n\t this[w] += n;\n\t while(this[w] >= this.DV) {\n\t this[w] -= this.DV;\n\t if(++w >= this.t) this[this.t++] = 0;\n\t ++this[w];\n\t }\n\t }\n\t\n\t // A \"null\" reducer\n\t function NullExp() {}\n\t function nNop(x) { return x; }\n\t function nMulTo(x,y,r) { x.multiplyTo(y,r); }\n\t function nSqrTo(x,r) { x.squareTo(r); }\n\t\n\t NullExp.prototype.convert = nNop;\n\t NullExp.prototype.revert = nNop;\n\t NullExp.prototype.mulTo = nMulTo;\n\t NullExp.prototype.sqrTo = nSqrTo;\n\t\n\t // (public) this^e\n\t function bnPow(e) { return this.exp(e,new NullExp()); }\n\t\n\t // (protected) r = lower n words of \"this * a\", a.t <= n\n\t // \"this\" should be the larger one if appropriate.\n\t function bnpMultiplyLowerTo(a,n,r) {\n\t var i = Math.min(this.t+a.t,n);\n\t r.s = 0; // assumes a,this >= 0\n\t r.t = i;\n\t while(i > 0) r[--i] = 0;\n\t var j;\n\t for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);\n\t for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);\n\t r.clamp();\n\t }\n\t\n\t // (protected) r = \"this * a\" without lower n words, n > 0\n\t // \"this\" should be the larger one if appropriate.\n\t function bnpMultiplyUpperTo(a,n,r) {\n\t --n;\n\t var i = r.t = this.t+a.t-n;\n\t r.s = 0; // assumes a,this >= 0\n\t while(--i >= 0) r[i] = 0;\n\t for(i = Math.max(n-this.t,0); i < a.t; ++i)\n\t r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);\n\t r.clamp();\n\t r.drShiftTo(1,r);\n\t }\n\t\n\t // Barrett modular reduction\n\t function Barrett(m) {\n\t // setup Barrett\n\t this.r2 = nbi();\n\t this.q3 = nbi();\n\t BigInteger.ONE.dlShiftTo(2*m.t,this.r2);\n\t this.mu = this.r2.divide(m);\n\t this.m = m;\n\t }\n\t\n\t function barrettConvert(x) {\n\t if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);\n\t else if(x.compareTo(this.m) < 0) return x;\n\t else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }\n\t }\n\t\n\t function barrettRevert(x) { return x; }\n\t\n\t // x = x mod m (HAC 14.42)\n\t function barrettReduce(x) {\n\t x.drShiftTo(this.m.t-1,this.r2);\n\t if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }\n\t this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);\n\t this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);\n\t while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);\n\t x.subTo(this.r2,x);\n\t while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n\t }\n\t\n\t // r = x^2 mod m; x != r\n\t function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\t\n\t // r = x*y mod m; x,y != r\n\t function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\t\n\t Barrett.prototype.convert = barrettConvert;\n\t Barrett.prototype.revert = barrettRevert;\n\t Barrett.prototype.reduce = barrettReduce;\n\t Barrett.prototype.mulTo = barrettMulTo;\n\t Barrett.prototype.sqrTo = barrettSqrTo;\n\t\n\t // (public) this^e % m (HAC 14.85)\n\t function bnModPow(e,m) {\n\t var i = e.bitLength(), k, r = nbv(1), z;\n\t if(i <= 0) return r;\n\t else if(i < 18) k = 1;\n\t else if(i < 48) k = 3;\n\t else if(i < 144) k = 4;\n\t else if(i < 768) k = 5;\n\t else k = 6;\n\t if(i < 8)\n\t z = new Classic(m);\n\t else if(m.isEven())\n\t z = new Barrett(m);\n\t else\n\t z = new Montgomery(m);\n\t\n\t // precomputation\n\t var g = new Array(), n = 3, k1 = k-1, km = (1< 1) {\n\t var g2 = nbi();\n\t z.sqrTo(g[1],g2);\n\t while(n <= km) {\n\t g[n] = nbi();\n\t z.mulTo(g2,g[n-2],g[n]);\n\t n += 2;\n\t }\n\t }\n\t\n\t var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n\t i = nbits(e[j])-1;\n\t while(j >= 0) {\n\t if(i >= k1) w = (e[j]>>(i-k1))&km;\n\t else {\n\t w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n\t if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n\t }\n\t\n\t n = k;\n\t while((w&1) == 0) { w >>= 1; --n; }\n\t if((i -= n) < 0) { i += this.DB; --j; }\n\t if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n\t g[w].copyTo(r);\n\t is1 = false;\n\t }\n\t else {\n\t while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n\t if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n\t z.mulTo(r2,g[w],r);\n\t }\n\t\n\t while(j >= 0 && (e[j]&(1< 0) {\n\t x.rShiftTo(g,x);\n\t y.rShiftTo(g,y);\n\t }\n\t while(x.signum() > 0) {\n\t if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n\t if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n\t if(x.compareTo(y) >= 0) {\n\t x.subTo(y,x);\n\t x.rShiftTo(1,x);\n\t }\n\t else {\n\t y.subTo(x,y);\n\t y.rShiftTo(1,y);\n\t }\n\t }\n\t if(g > 0) y.lShiftTo(g,y);\n\t return y;\n\t }\n\t\n\t // (protected) this % n, n < 2^26\n\t function bnpModInt(n) {\n\t if(n <= 0) return 0;\n\t var d = this.DV%n, r = (this.s<0)?n-1:0;\n\t if(this.t > 0)\n\t if(d == 0) r = this[0]%n;\n\t else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;\n\t return r;\n\t }\n\t\n\t // (public) 1/this % m (HAC 14.61)\n\t function bnModInverse(m) {\n\t var ac = m.isEven();\n\t if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;\n\t var u = m.clone(), v = this.clone();\n\t var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);\n\t while(u.signum() != 0) {\n\t while(u.isEven()) {\n\t u.rShiftTo(1,u);\n\t if(ac) {\n\t if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }\n\t a.rShiftTo(1,a);\n\t }\n\t else if(!b.isEven()) b.subTo(m,b);\n\t b.rShiftTo(1,b);\n\t }\n\t while(v.isEven()) {\n\t v.rShiftTo(1,v);\n\t if(ac) {\n\t if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }\n\t c.rShiftTo(1,c);\n\t }\n\t else if(!d.isEven()) d.subTo(m,d);\n\t d.rShiftTo(1,d);\n\t }\n\t if(u.compareTo(v) >= 0) {\n\t u.subTo(v,u);\n\t if(ac) a.subTo(c,a);\n\t b.subTo(d,b);\n\t }\n\t else {\n\t v.subTo(u,v);\n\t if(ac) c.subTo(a,c);\n\t d.subTo(b,d);\n\t }\n\t }\n\t if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;\n\t if(d.compareTo(m) >= 0) return d.subtract(m);\n\t if(d.signum() < 0) d.addTo(m,d); else return d;\n\t if(d.signum() < 0) return d.add(m); else return d;\n\t }\n\t\n\t var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];\n\t var lplim = (1<<26)/lowprimes[lowprimes.length-1];\n\t\n\t // (public) test primality with certainty >= 1-.5^t\n\t function bnIsProbablePrime(t) {\n\t var i, x = this.abs();\n\t if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {\n\t for(i = 0; i < lowprimes.length; ++i)\n\t if(x[0] == lowprimes[i]) return true;\n\t return false;\n\t }\n\t if(x.isEven()) return false;\n\t i = 1;\n\t while(i < lowprimes.length) {\n\t var m = lowprimes[i], j = i+1;\n\t while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];\n\t m = x.modInt(m);\n\t while(i < j) if(m%lowprimes[i++] == 0) return false;\n\t }\n\t return x.millerRabin(t);\n\t }\n\t\n\t // (protected) true if probably prime (HAC 4.24, Miller-Rabin)\n\t function bnpMillerRabin(t) {\n\t var n1 = this.subtract(BigInteger.ONE);\n\t var k = n1.getLowestSetBit();\n\t if(k <= 0) return false;\n\t var r = n1.shiftRight(k);\n\t t = (t+1)>>1;\n\t if(t > lowprimes.length) t = lowprimes.length;\n\t var a = nbi();\n\t for(var i = 0; i < t; ++i) {\n\t //Pick bases at random, instead of starting at 2\n\t a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);\n\t var y = a.modPow(r,this);\n\t if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {\n\t var j = 1;\n\t while(j++ < k && y.compareTo(n1) != 0) {\n\t y = y.modPowInt(2,this);\n\t if(y.compareTo(BigInteger.ONE) == 0) return false;\n\t }\n\t if(y.compareTo(n1) != 0) return false;\n\t }\n\t }\n\t return true;\n\t }\n\t\n\t // protected\n\t BigInteger.prototype.chunkSize = bnpChunkSize;\n\t BigInteger.prototype.toRadix = bnpToRadix;\n\t BigInteger.prototype.fromRadix = bnpFromRadix;\n\t BigInteger.prototype.fromNumber = bnpFromNumber;\n\t BigInteger.prototype.bitwiseTo = bnpBitwiseTo;\n\t BigInteger.prototype.changeBit = bnpChangeBit;\n\t BigInteger.prototype.addTo = bnpAddTo;\n\t BigInteger.prototype.dMultiply = bnpDMultiply;\n\t BigInteger.prototype.dAddOffset = bnpDAddOffset;\n\t BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;\n\t BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;\n\t BigInteger.prototype.modInt = bnpModInt;\n\t BigInteger.prototype.millerRabin = bnpMillerRabin;\n\t\n\t // public\n\t BigInteger.prototype.clone = bnClone;\n\t BigInteger.prototype.intValue = bnIntValue;\n\t BigInteger.prototype.byteValue = bnByteValue;\n\t BigInteger.prototype.shortValue = bnShortValue;\n\t BigInteger.prototype.signum = bnSigNum;\n\t BigInteger.prototype.toByteArray = bnToByteArray;\n\t BigInteger.prototype.equals = bnEquals;\n\t BigInteger.prototype.min = bnMin;\n\t BigInteger.prototype.max = bnMax;\n\t BigInteger.prototype.and = bnAnd;\n\t BigInteger.prototype.or = bnOr;\n\t BigInteger.prototype.xor = bnXor;\n\t BigInteger.prototype.andNot = bnAndNot;\n\t BigInteger.prototype.not = bnNot;\n\t BigInteger.prototype.shiftLeft = bnShiftLeft;\n\t BigInteger.prototype.shiftRight = bnShiftRight;\n\t BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;\n\t BigInteger.prototype.bitCount = bnBitCount;\n\t BigInteger.prototype.testBit = bnTestBit;\n\t BigInteger.prototype.setBit = bnSetBit;\n\t BigInteger.prototype.clearBit = bnClearBit;\n\t BigInteger.prototype.flipBit = bnFlipBit;\n\t BigInteger.prototype.add = bnAdd;\n\t BigInteger.prototype.subtract = bnSubtract;\n\t BigInteger.prototype.multiply = bnMultiply;\n\t BigInteger.prototype.divide = bnDivide;\n\t BigInteger.prototype.remainder = bnRemainder;\n\t BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;\n\t BigInteger.prototype.modPow = bnModPow;\n\t BigInteger.prototype.modInverse = bnModInverse;\n\t BigInteger.prototype.pow = bnPow;\n\t BigInteger.prototype.gcd = bnGCD;\n\t BigInteger.prototype.isProbablePrime = bnIsProbablePrime;\n\t\n\t // JSBN-specific extension\n\t BigInteger.prototype.square = bnSquare;\n\t\n\t // Expose the Barrett function\n\t BigInteger.prototype.Barrett = Barrett\n\t\n\t // BigInteger interfaces not implemented in jsbn:\n\t\n\t // BigInteger(int signum, byte[] magnitude)\n\t // double doubleValue()\n\t // float floatValue()\n\t // int hashCode()\n\t // long longValue()\n\t // static BigInteger valueOf(long val)\n\t\n\t\t// Random number generator - requires a PRNG backend, e.g. prng4.js\n\t\n\t\t// For best results, put code like\n\t\t// \n\t\t// in your main HTML document.\n\t\n\t\tvar rng_state;\n\t\tvar rng_pool;\n\t\tvar rng_pptr;\n\t\n\t\t// Mix in a 32-bit integer into the pool\n\t\tfunction rng_seed_int(x) {\n\t\t rng_pool[rng_pptr++] ^= x & 255;\n\t\t rng_pool[rng_pptr++] ^= (x >> 8) & 255;\n\t\t rng_pool[rng_pptr++] ^= (x >> 16) & 255;\n\t\t rng_pool[rng_pptr++] ^= (x >> 24) & 255;\n\t\t if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;\n\t\t}\n\t\n\t\t// Mix in the current time (w/milliseconds) into the pool\n\t\tfunction rng_seed_time() {\n\t\t rng_seed_int(new Date().getTime());\n\t\t}\n\t\n\t\t// Initialize the pool with junk if needed.\n\t\tif(rng_pool == null) {\n\t\t rng_pool = new Array();\n\t\t rng_pptr = 0;\n\t\t var t;\n\t\t if(typeof window !== \"undefined\" && window.crypto) {\n\t\t\tif (window.crypto.getRandomValues) {\n\t\t\t // Use webcrypto if available\n\t\t\t var ua = new Uint8Array(32);\n\t\t\t window.crypto.getRandomValues(ua);\n\t\t\t for(t = 0; t < 32; ++t)\n\t\t\t\trng_pool[rng_pptr++] = ua[t];\n\t\t\t}\n\t\t\telse if(navigator.appName == \"Netscape\" && navigator.appVersion < \"5\") {\n\t\t\t // Extract entropy (256 bits) from NS4 RNG if available\n\t\t\t var z = window.crypto.random(32);\n\t\t\t for(t = 0; t < z.length; ++t)\n\t\t\t\trng_pool[rng_pptr++] = z.charCodeAt(t) & 255;\n\t\t\t}\n\t\t }\n\t\t while(rng_pptr < rng_psize) { // extract some randomness from Math.random()\n\t\t\tt = Math.floor(65536 * Math.random());\n\t\t\trng_pool[rng_pptr++] = t >>> 8;\n\t\t\trng_pool[rng_pptr++] = t & 255;\n\t\t }\n\t\t rng_pptr = 0;\n\t\t rng_seed_time();\n\t\t //rng_seed_int(window.screenX);\n\t\t //rng_seed_int(window.screenY);\n\t\t}\n\t\n\t\tfunction rng_get_byte() {\n\t\t if(rng_state == null) {\n\t\t\trng_seed_time();\n\t\t\trng_state = prng_newstate();\n\t\t\trng_state.init(rng_pool);\n\t\t\tfor(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)\n\t\t\t rng_pool[rng_pptr] = 0;\n\t\t\trng_pptr = 0;\n\t\t\t//rng_pool = null;\n\t\t }\n\t\t // TODO: allow reseeding after first request\n\t\t return rng_state.next();\n\t\t}\n\t\n\t\tfunction rng_get_bytes(ba) {\n\t\t var i;\n\t\t for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();\n\t\t}\n\t\n\t\tfunction SecureRandom() {}\n\t\n\t\tSecureRandom.prototype.nextBytes = rng_get_bytes;\n\t\n\t\t// prng4.js - uses Arcfour as a PRNG\n\t\n\t\tfunction Arcfour() {\n\t\t this.i = 0;\n\t\t this.j = 0;\n\t\t this.S = new Array();\n\t\t}\n\t\n\t\t// Initialize arcfour context from key, an array of ints, each from [0..255]\n\t\tfunction ARC4init(key) {\n\t\t var i, j, t;\n\t\t for(i = 0; i < 256; ++i)\n\t\t\tthis.S[i] = i;\n\t\t j = 0;\n\t\t for(i = 0; i < 256; ++i) {\n\t\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\t\tt = this.S[i];\n\t\t\tthis.S[i] = this.S[j];\n\t\t\tthis.S[j] = t;\n\t\t }\n\t\t this.i = 0;\n\t\t this.j = 0;\n\t\t}\n\t\n\t\tfunction ARC4next() {\n\t\t var t;\n\t\t this.i = (this.i + 1) & 255;\n\t\t this.j = (this.j + this.S[this.i]) & 255;\n\t\t t = this.S[this.i];\n\t\t this.S[this.i] = this.S[this.j];\n\t\t this.S[this.j] = t;\n\t\t return this.S[(t + this.S[this.i]) & 255];\n\t\t}\n\t\n\t\tArcfour.prototype.init = ARC4init;\n\t\tArcfour.prototype.next = ARC4next;\n\t\n\t\t// Plug in your RNG constructor here\n\t\tfunction prng_newstate() {\n\t\t return new Arcfour();\n\t\t}\n\t\n\t\t// Pool size must be a multiple of 4 and greater than 32.\n\t\t// An array of bytes the size of the pool will be passed to init()\n\t\tvar rng_psize = 256;\n\t\n\t if (true) {\n\t exports = module.exports = {\n\t\t\t\tBigInteger: BigInteger,\n\t\t\t\tSecureRandom: SecureRandom,\n\t\t\t};\n\t } else {\n\t this.BigInteger = BigInteger;\n\t this.SecureRandom = SecureRandom;\n\t }\n\t\n\t}).call(this);\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\tfunction DummyCache() {}\n\t\n\tDummyCache.prototype.get = function (key) {\n\t return null;\n\t};\n\t\n\tDummyCache.prototype.has = function (key) {\n\t return false;\n\t};\n\t\n\tDummyCache.prototype.set = function (key, value) {\n\t};\n\t\n\tmodule.exports = DummyCache;\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\tfunction ConfigurationError(message) {\n\t this.name = 'ConfigurationError';\n\t this.message = (message || '');\n\t}\n\tConfigurationError.prototype = Error.prototype;\n\t\n\tfunction TokenValidationError(message) {\n\t this.name = 'TokenValidationError';\n\t this.message = (message || '');\n\t}\n\tTokenValidationError.prototype = Error.prototype;\n\t\n\tmodule.exports = {\n\t ConfigurationError: ConfigurationError,\n\t TokenValidationError: TokenValidationError\n\t};\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar urljoin = __webpack_require__(3);\n\tvar base64 = __webpack_require__(11);\n\tvar request = __webpack_require__(12);\n\t\n\tfunction process(jwks) {\n\t var modulus = base64.decodeToHEX(jwks.n);\n\t var exp = base64.decodeToHEX(jwks.e);\n\t\n\t return {\n\t modulus: modulus,\n\t exp: exp\n\t };\n\t}\n\t\n\tfunction getJWKS(options, cb) {\n\t var url = urljoin(options.iss, '.well-known', 'jwks.json');\n\t\n\t return request\n\t .get(url)\n\t .end(function (err, data) {\n\t if (err) {\n\t cb(err);\n\t }\n\t\n\t var matchingKey = null;\n\t\n\t for (var a = 0; a < data.body.keys.length && matchingKey === null; a ++) {\n\t var key = data.body.keys[a];\n\t if (key.kid === options.kid) {\n\t matchingKey = key;\n\t }\n\t }\n\t\n\t cb(null, process(matchingKey));\n\t });\n\t}\n\t\n\tmodule.exports = {\n\t process: process,\n\t getJWKS: getJWKS\n\t};\n\n\n/***/ },\n/* 24 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/*\n\tBased on the work of Tom Wu\n\thttp://www-cs-students.stanford.edu/~tjw/jsbn/\n\thttp://www-cs-students.stanford.edu/~tjw/jsbn/LICENSE\n\t*/\n\t\n\tvar BigInteger = __webpack_require__(20).BigInteger;\n\tvar SHA256 = __webpack_require__(19);\n\t\n\tvar DigestInfoHead = {\n\t sha1: '3021300906052b0e03021a05000414',\n\t sha224: '302d300d06096086480165030402040500041c',\n\t sha256: '3031300d060960864801650304020105000420',\n\t sha384: '3041300d060960864801650304020205000430',\n\t sha512: '3051300d060960864801650304020305000440',\n\t md2: '3020300c06082a864886f70d020205000410',\n\t md5: '3020300c06082a864886f70d020505000410',\n\t ripemd160: '3021300906052b2403020105000414'\n\t};\n\t\n\tvar DigestAlgs = {\n\t sha256: SHA256\n\t};\n\t\n\tfunction RSAVerifier(modulus, exp) {\n\t this.n = null;\n\t this.e = 0;\n\t\n\t if (modulus != null && exp != null && modulus.length > 0 && exp.length > 0) {\n\t this.n = new BigInteger(modulus, 16);\n\t this.e = parseInt(exp, 16);\n\t } else {\n\t throw new Error('Invalid key data');\n\t }\n\t}\n\t\n\tfunction getAlgorithmFromDigest(hDigestInfo) {\n\t for (var algName in DigestInfoHead) {\n\t var head = DigestInfoHead[algName];\n\t var len = head.length;\n\t\n\t if (hDigestInfo.substring(0, len) === head) {\n\t return {\n\t alg: algName,\n\t hash: hDigestInfo.substring(len)\n\t };\n\t }\n\t }\n\t return [];\n\t}\n\t\n\t\n\tRSAVerifier.prototype.verify = function (msg, encsig) {\n\t encsig = encsig.replace(/[^0-9a-f]|[\\s\\n]]/ig, '');\n\t\n\t var sig = new BigInteger(encsig, 16);\n\t if (sig.bitLength() > this.n.bitLength()) {\n\t throw new Error('Signature does not match with the key modulus.');\n\t }\n\t\n\t var decryptedSig = sig.modPowInt(this.e, this.n);\n\t var digest = decryptedSig.toString(16).replace(/^1f+00/, '');\n\t\n\t var digestInfo = getAlgorithmFromDigest(digest);\n\t if (digestInfo.length === 0) {\n\t return false;\n\t }\n\t\n\t if (!DigestAlgs.hasOwnProperty(digestInfo.alg)) {\n\t throw new Error('Hashing algorithm is not supported.');\n\t }\n\t\n\t var msgHash = DigestAlgs[digestInfo.alg](msg).toString();\n\t return (digestInfo.hash === msgHash);\n\t};\n\t\n\tmodule.exports = RSAVerifier;\n\n\n/***/ },\n/* 25 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar RSAVerifier = __webpack_require__(24);\n\tvar base64 = __webpack_require__(11);\n\tvar jwks = __webpack_require__(23);\n\tvar error = __webpack_require__(22);\n\tvar DummyCache = __webpack_require__(21);\n\tvar supportedAlgs = ['RS256'];\n\t\n\tfunction IdTokenVerifier(options) {\n\t options = options || {};\n\t\n\t this.jwksCache = options.jwksCache || new DummyCache();\n\t this.expectedAlg = options.expectedAlg || 'RS256';\n\t this.issuer = options.issuer;\n\t this.audience = options.audience;\n\t this.leeway = options.leeway || 0;\n\t this.__disableExpirationCheck = options.__disableExpirationCheck || false;\n\t\n\t if (this.leeway < 0 || this.leeway > 60) {\n\t throw new error.ConfigurationError('The leeway should be positive and lower than a minute.');\n\t }\n\t\n\t if (supportedAlgs.indexOf(this.expectedAlg) === -1) {\n\t throw new error.ConfigurationError('Algorithm ' + this.expectedAlg +\n\t ' is not supported. (Expected algs: [' + supportedAlgs.join(',') + '])');\n\t }\n\t}\n\t\n\tIdTokenVerifier.prototype.verify = function (token, nonce, cb) {\n\t var jwt = this.decode(token);\n\t\n\t if (jwt instanceof Error) {\n\t return cb(jwt, false);\n\t }\n\t\n\t var headAndPayload = jwt.encoded.header + '.' + jwt.encoded.payload;\n\t var signature = base64.decodeToHEX(jwt.encoded.signature);\n\t\n\t var alg = jwt.header.alg;\n\t var kid = jwt.header.kid;\n\t\n\t var aud = jwt.payload.aud;\n\t var iss = jwt.payload.iss;\n\t var exp = jwt.payload.exp;\n\t var iat = jwt.payload.iat;\n\t var tnonce = jwt.payload.nonce || null;\n\t\n\t if (this.issuer !== iss) {\n\t return cb(new error.TokenValidationError('Issuer ' + iss + ' is not valid.'), false);\n\t }\n\t\n\t if (this.audience !== aud) {\n\t return cb(new error.TokenValidationError('Audience ' + aud + ' is not valid.'), false);\n\t }\n\t\n\t if (this.expectedAlg !== alg) {\n\t return cb(new error.TokenValidationError('Algorithm ' + alg +\n\t ' is not supported. (Expected algs: [' + supportedAlgs.join(',') + '])'), false);\n\t }\n\t\n\t if (tnonce !== nonce) {\n\t return cb(new error.TokenValidationError('Nonce does not match.'), false);\n\t }\n\t\n\t var expirationError = this.verifyExpAndIat(exp, iat);\n\t\n\t if (expirationError) {\n\t return cb(expirationError, false);\n\t }\n\t\n\t this.getRsaVerifier(iss, kid, function (err, rsaVerifier) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t if (rsaVerifier.verify(headAndPayload, signature)) {\n\t cb(null, jwt.payload);\n\t } else {\n\t cb(new error.TokenValidationError('Invalid signature.'));\n\t }\n\t });\n\t};\n\t\n\tIdTokenVerifier.prototype.verifyExpAndIat = function (exp, iat) {\n\t if (this.__disableExpirationCheck) {\n\t return null;\n\t }\n\t\n\t var now = new Date();\n\t\n\t var expDate = new Date(0);\n\t expDate.setUTCSeconds(exp + this.leeway);\n\t\n\t if (now > expDate) {\n\t return new error.TokenValidationError('Expired token.');\n\t }\n\t\n\t var iatDate = new Date(0);\n\t iatDate.setUTCSeconds(iat - this.leeway);\n\t\n\t if (now < iatDate) {\n\t return new error.TokenValidationError('The token was issued in the future. ' +\n\t 'Please check your computed clock.');\n\t }\n\t\n\t return null;\n\t};\n\t\n\tIdTokenVerifier.prototype.getRsaVerifier = function (iss, kid, cb) {\n\t var _this = this;\n\t var cachekey = iss + kid;\n\t\n\t if (!this.jwksCache.has(cachekey)) {\n\t jwks.getJWKS({\n\t iss: iss,\n\t kid: kid\n\t }, function (err, keyInfo) {\n\t if (err) {\n\t cb(err);\n\t }\n\t _this.jwksCache.set(cachekey, keyInfo);\n\t cb(null, new RSAVerifier(keyInfo.modulus, keyInfo.exp));\n\t });\n\t } else {\n\t var keyInfo = this.jwksCache.get(cachekey);\n\t cb(null, new RSAVerifier(keyInfo.modulus, keyInfo.exp));\n\t }\n\t};\n\t\n\tIdTokenVerifier.prototype.decode = function (token) {\n\t var parts = token.split('.');\n\t var header;\n\t var payload;\n\t\n\t if (parts.length !== 3) {\n\t return new error.TokenValidationError('Cannot decode a malformed JWT');\n\t }\n\t\n\t try {\n\t header = JSON.parse(base64.decodeToString(parts[0]));\n\t payload = JSON.parse(base64.decodeToString(parts[1]));\n\t } catch (e) {\n\t return new error.TokenValidationError('Token header or payload is not valid JSON');\n\t }\n\t\n\t return {\n\t header: header,\n\t payload: payload,\n\t encoded: {\n\t header: parts[0],\n\t payload: parts[1],\n\t signature: parts[2]\n\t }\n\t };\n\t};\n\t\n\tmodule.exports = IdTokenVerifier;\n\n\n/***/ },\n/* 26 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/**\n\t * Check if `fn` is a function.\n\t *\n\t * @param {Function} fn\n\t * @return {Boolean}\n\t * @api private\n\t */\n\tvar isObject = __webpack_require__(7);\n\t\n\tfunction isFunction(fn) {\n\t var tag = isObject(fn) ? Object.prototype.toString.call(fn) : '';\n\t return tag === '[object Function]';\n\t}\n\t\n\tmodule.exports = isFunction;\n\n\n/***/ },\n/* 27 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/**\n\t * Module of mixed-in functions shared between node and client code\n\t */\n\tvar isObject = __webpack_require__(7);\n\t\n\t/**\n\t * Expose `RequestBase`.\n\t */\n\t\n\tmodule.exports = RequestBase;\n\t\n\t/**\n\t * Initialize a new `RequestBase`.\n\t *\n\t * @api public\n\t */\n\t\n\tfunction RequestBase(obj) {\n\t if (obj) return mixin(obj);\n\t}\n\t\n\t/**\n\t * Mixin the prototype properties.\n\t *\n\t * @param {Object} obj\n\t * @return {Object}\n\t * @api private\n\t */\n\t\n\tfunction mixin(obj) {\n\t for (var key in RequestBase.prototype) {\n\t obj[key] = RequestBase.prototype[key];\n\t }\n\t return obj;\n\t}\n\t\n\t/**\n\t * Clear previous timeout.\n\t *\n\t * @return {Request} for chaining\n\t * @api public\n\t */\n\t\n\tRequestBase.prototype.clearTimeout = function _clearTimeout(){\n\t this._timeout = 0;\n\t this._responseTimeout = 0;\n\t clearTimeout(this._timer);\n\t clearTimeout(this._responseTimeoutTimer);\n\t return this;\n\t};\n\t\n\t/**\n\t * Override default response body parser\n\t *\n\t * This function will be called to convert incoming data into request.body\n\t *\n\t * @param {Function}\n\t * @api public\n\t */\n\t\n\tRequestBase.prototype.parse = function parse(fn){\n\t this._parser = fn;\n\t return this;\n\t};\n\t\n\t/**\n\t * Set format of binary response body.\n\t * In browser valid formats are 'blob' and 'arraybuffer',\n\t * which return Blob and ArrayBuffer, respectively.\n\t *\n\t * In Node all values result in Buffer.\n\t *\n\t * Examples:\n\t *\n\t * req.get('/')\n\t * .responseType('blob')\n\t * .end(callback);\n\t *\n\t * @param {String} val\n\t * @return {Request} for chaining\n\t * @api public\n\t */\n\t\n\tRequestBase.prototype.responseType = function(val){\n\t this._responseType = val;\n\t return this;\n\t};\n\t\n\t/**\n\t * Override default request body serializer\n\t *\n\t * This function will be called to convert data set via .send or .attach into payload to send\n\t *\n\t * @param {Function}\n\t * @api public\n\t */\n\t\n\tRequestBase.prototype.serialize = function serialize(fn){\n\t this._serializer = fn;\n\t return this;\n\t};\n\t\n\t/**\n\t * Set timeouts.\n\t *\n\t * - response timeout is time between sending request and receiving the first byte of the response. Includes DNS and connection time.\n\t * - deadline is the time from start of the request to receiving response body in full. If the deadline is too short large files may not load at all on slow connections.\n\t *\n\t * Value of 0 or false means no timeout.\n\t *\n\t * @param {Number|Object} ms or {response, read, deadline}\n\t * @return {Request} for chaining\n\t * @api public\n\t */\n\t\n\tRequestBase.prototype.timeout = function timeout(options){\n\t if (!options || 'object' !== typeof options) {\n\t this._timeout = options;\n\t this._responseTimeout = 0;\n\t return this;\n\t }\n\t\n\t if ('undefined' !== typeof options.deadline) {\n\t this._timeout = options.deadline;\n\t }\n\t if ('undefined' !== typeof options.response) {\n\t this._responseTimeout = options.response;\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Promise support\n\t *\n\t * @param {Function} resolve\n\t * @param {Function} reject\n\t * @return {Request}\n\t */\n\t\n\tRequestBase.prototype.then = function then(resolve, reject) {\n\t if (!this._fullfilledPromise) {\n\t var self = this;\n\t if (this._endCalled) {\n\t console.warn(\"Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises\");\n\t }\n\t this._fullfilledPromise = new Promise(function(innerResolve, innerReject){\n\t self.end(function(err, res){\n\t if (err) innerReject(err); else innerResolve(res);\n\t });\n\t });\n\t }\n\t return this._fullfilledPromise.then(resolve, reject);\n\t}\n\t\n\tRequestBase.prototype.catch = function(cb) {\n\t return this.then(undefined, cb);\n\t};\n\t\n\t/**\n\t * Allow for extension\n\t */\n\t\n\tRequestBase.prototype.use = function use(fn) {\n\t fn(this);\n\t return this;\n\t}\n\t\n\tRequestBase.prototype.ok = function(cb) {\n\t if ('function' !== typeof cb) throw Error(\"Callback required\");\n\t this._okCallback = cb;\n\t return this;\n\t};\n\t\n\tRequestBase.prototype._isResponseOK = function(res) {\n\t if (!res) {\n\t return false;\n\t }\n\t\n\t if (this._okCallback) {\n\t return this._okCallback(res);\n\t }\n\t\n\t return res.status >= 200 && res.status < 300;\n\t};\n\t\n\t\n\t/**\n\t * Get request header `field`.\n\t * Case-insensitive.\n\t *\n\t * @param {String} field\n\t * @return {String}\n\t * @api public\n\t */\n\t\n\tRequestBase.prototype.get = function(field){\n\t return this._header[field.toLowerCase()];\n\t};\n\t\n\t/**\n\t * Get case-insensitive header `field` value.\n\t * This is a deprecated internal API. Use `.get(field)` instead.\n\t *\n\t * (getHeader is no longer used internally by the superagent code base)\n\t *\n\t * @param {String} field\n\t * @return {String}\n\t * @api private\n\t * @deprecated\n\t */\n\t\n\tRequestBase.prototype.getHeader = RequestBase.prototype.get;\n\t\n\t/**\n\t * Set header `field` to `val`, or multiple fields with one object.\n\t * Case-insensitive.\n\t *\n\t * Examples:\n\t *\n\t * req.get('/')\n\t * .set('Accept', 'application/json')\n\t * .set('X-API-Key', 'foobar')\n\t * .end(callback);\n\t *\n\t * req.get('/')\n\t * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' })\n\t * .end(callback);\n\t *\n\t * @param {String|Object} field\n\t * @param {String} val\n\t * @return {Request} for chaining\n\t * @api public\n\t */\n\t\n\tRequestBase.prototype.set = function(field, val){\n\t if (isObject(field)) {\n\t for (var key in field) {\n\t this.set(key, field[key]);\n\t }\n\t return this;\n\t }\n\t this._header[field.toLowerCase()] = val;\n\t this.header[field] = val;\n\t return this;\n\t};\n\t\n\t/**\n\t * Remove header `field`.\n\t * Case-insensitive.\n\t *\n\t * Example:\n\t *\n\t * req.get('/')\n\t * .unset('User-Agent')\n\t * .end(callback);\n\t *\n\t * @param {String} field\n\t */\n\tRequestBase.prototype.unset = function(field){\n\t delete this._header[field.toLowerCase()];\n\t delete this.header[field];\n\t return this;\n\t};\n\t\n\t/**\n\t * Write the field `name` and `val`, or multiple fields with one object\n\t * for \"multipart/form-data\" request bodies.\n\t *\n\t * ``` js\n\t * request.post('/upload')\n\t * .field('foo', 'bar')\n\t * .end(callback);\n\t *\n\t * request.post('/upload')\n\t * .field({ foo: 'bar', baz: 'qux' })\n\t * .end(callback);\n\t * ```\n\t *\n\t * @param {String|Object} name\n\t * @param {String|Blob|File|Buffer|fs.ReadStream} val\n\t * @return {Request} for chaining\n\t * @api public\n\t */\n\tRequestBase.prototype.field = function(name, val) {\n\t\n\t // name should be either a string or an object.\n\t if (null === name || undefined === name) {\n\t throw new Error('.field(name, val) name can not be empty');\n\t }\n\t\n\t if (isObject(name)) {\n\t for (var key in name) {\n\t this.field(key, name[key]);\n\t }\n\t return this;\n\t }\n\t\n\t if (Array.isArray(val)) {\n\t for (var i in val) {\n\t this.field(name, val[i]);\n\t }\n\t return this;\n\t }\n\t\n\t // val should be defined now\n\t if (null === val || undefined === val) {\n\t throw new Error('.field(name, val) val can not be empty');\n\t }\n\t if ('boolean' === typeof val) {\n\t val = '' + val;\n\t }\n\t this._getFormData().append(name, val);\n\t return this;\n\t};\n\t\n\t/**\n\t * Abort the request, and clear potential timeout.\n\t *\n\t * @return {Request}\n\t * @api public\n\t */\n\tRequestBase.prototype.abort = function(){\n\t if (this._aborted) {\n\t return this;\n\t }\n\t this._aborted = true;\n\t this.xhr && this.xhr.abort(); // browser\n\t this.req && this.req.abort(); // node\n\t this.clearTimeout();\n\t this.emit('abort');\n\t return this;\n\t};\n\t\n\t/**\n\t * Enable transmission of cookies with x-domain requests.\n\t *\n\t * Note that for this to work the origin must not be\n\t * using \"Access-Control-Allow-Origin\" with a wildcard,\n\t * and also must set \"Access-Control-Allow-Credentials\"\n\t * to \"true\".\n\t *\n\t * @api public\n\t */\n\t\n\tRequestBase.prototype.withCredentials = function(){\n\t // This is browser-only functionality. Node side is no-op.\n\t this._withCredentials = true;\n\t return this;\n\t};\n\t\n\t/**\n\t * Set the max redirects to `n`. Does noting in browser XHR implementation.\n\t *\n\t * @param {Number} n\n\t * @return {Request} for chaining\n\t * @api public\n\t */\n\t\n\tRequestBase.prototype.redirects = function(n){\n\t this._maxRedirects = n;\n\t return this;\n\t};\n\t\n\t/**\n\t * Convert to a plain javascript object (not JSON string) of scalar properties.\n\t * Note as this method is designed to return a useful non-this value,\n\t * it cannot be chained.\n\t *\n\t * @return {Object} describing method, url, and data of this request\n\t * @api public\n\t */\n\t\n\tRequestBase.prototype.toJSON = function(){\n\t return {\n\t method: this.method,\n\t url: this.url,\n\t data: this._data,\n\t headers: this._header\n\t };\n\t};\n\t\n\t\n\t/**\n\t * Send `data` as the request body, defaulting the `.type()` to \"json\" when\n\t * an object is given.\n\t *\n\t * Examples:\n\t *\n\t * // manual json\n\t * request.post('/user')\n\t * .type('json')\n\t * .send('{\"name\":\"tj\"}')\n\t * .end(callback)\n\t *\n\t * // auto json\n\t * request.post('/user')\n\t * .send({ name: 'tj' })\n\t * .end(callback)\n\t *\n\t * // manual x-www-form-urlencoded\n\t * request.post('/user')\n\t * .type('form')\n\t * .send('name=tj')\n\t * .end(callback)\n\t *\n\t * // auto x-www-form-urlencoded\n\t * request.post('/user')\n\t * .type('form')\n\t * .send({ name: 'tj' })\n\t * .end(callback)\n\t *\n\t * // defaults to x-www-form-urlencoded\n\t * request.post('/user')\n\t * .send('name=tobi')\n\t * .send('species=ferret')\n\t * .end(callback)\n\t *\n\t * @param {String|Object} data\n\t * @return {Request} for chaining\n\t * @api public\n\t */\n\t\n\tRequestBase.prototype.send = function(data){\n\t var isObj = isObject(data);\n\t var type = this._header['content-type'];\n\t\n\t if (isObj && !this._data) {\n\t if (Array.isArray(data)) {\n\t this._data = [];\n\t } else if (!this._isHost(data)) {\n\t this._data = {};\n\t }\n\t } else if (data && this._data && this._isHost(this._data)) {\n\t throw Error(\"Can't merge these send calls\");\n\t }\n\t\n\t // merge\n\t if (isObj && isObject(this._data)) {\n\t for (var key in data) {\n\t this._data[key] = data[key];\n\t }\n\t } else if ('string' == typeof data) {\n\t // default to x-www-form-urlencoded\n\t if (!type) this.type('form');\n\t type = this._header['content-type'];\n\t if ('application/x-www-form-urlencoded' == type) {\n\t this._data = this._data\n\t ? this._data + '&' + data\n\t : data;\n\t } else {\n\t this._data = (this._data || '') + data;\n\t }\n\t } else {\n\t this._data = data;\n\t }\n\t\n\t if (!isObj || this._isHost(data)) {\n\t return this;\n\t }\n\t\n\t // default to json\n\t if (!type) this.type('json');\n\t return this;\n\t};\n\t\n\t\n\t/**\n\t * Sort `querystring` by the sort function\n\t *\n\t *\n\t * Examples:\n\t *\n\t * // default order\n\t * request.get('/user')\n\t * .query('name=Nick')\n\t * .query('search=Manny')\n\t * .sortQuery()\n\t * .end(callback)\n\t *\n\t * // customized sort function\n\t * request.get('/user')\n\t * .query('name=Nick')\n\t * .query('search=Manny')\n\t * .sortQuery(function(a, b){\n\t * return a.length - b.length;\n\t * })\n\t * .end(callback)\n\t *\n\t *\n\t * @param {Function} sort\n\t * @return {Request} for chaining\n\t * @api public\n\t */\n\t\n\tRequestBase.prototype.sortQuery = function(sort) {\n\t // _sort default to true but otherwise can be a function or boolean\n\t this._sort = typeof sort === 'undefined' ? true : sort;\n\t return this;\n\t};\n\t\n\t/**\n\t * Invoke callback with timeout error.\n\t *\n\t * @api private\n\t */\n\t\n\tRequestBase.prototype._timeoutError = function(reason, timeout){\n\t if (this._aborted) {\n\t return;\n\t }\n\t var err = new Error(reason + timeout + 'ms exceeded');\n\t err.timeout = timeout;\n\t err.code = 'ECONNABORTED';\n\t this.timedout = true;\n\t this.abort();\n\t this.callback(err);\n\t};\n\t\n\tRequestBase.prototype._setTimeouts = function() {\n\t var self = this;\n\t\n\t // deadline\n\t if (this._timeout && !this._timer) {\n\t this._timer = setTimeout(function(){\n\t self._timeoutError('Timeout of ', self._timeout);\n\t }, this._timeout);\n\t }\n\t // response timeout\n\t if (this._responseTimeout && !this._responseTimeoutTimer) {\n\t this._responseTimeoutTimer = setTimeout(function(){\n\t self._timeoutError('Response timeout of ', self._responseTimeout);\n\t }, this._responseTimeout);\n\t }\n\t}\n\n\n/***/ },\n/* 28 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar utils = __webpack_require__(29);\n\t\n\t/**\n\t * Expose `ResponseBase`.\n\t */\n\t\n\tmodule.exports = ResponseBase;\n\t\n\t/**\n\t * Initialize a new `ResponseBase`.\n\t *\n\t * @api public\n\t */\n\t\n\tfunction ResponseBase(obj) {\n\t if (obj) return mixin(obj);\n\t}\n\t\n\t/**\n\t * Mixin the prototype properties.\n\t *\n\t * @param {Object} obj\n\t * @return {Object}\n\t * @api private\n\t */\n\t\n\tfunction mixin(obj) {\n\t for (var key in ResponseBase.prototype) {\n\t obj[key] = ResponseBase.prototype[key];\n\t }\n\t return obj;\n\t}\n\t\n\t/**\n\t * Get case-insensitive `field` value.\n\t *\n\t * @param {String} field\n\t * @return {String}\n\t * @api public\n\t */\n\t\n\tResponseBase.prototype.get = function(field){\n\t return this.header[field.toLowerCase()];\n\t};\n\t\n\t/**\n\t * Set header related properties:\n\t *\n\t * - `.type` the content type without params\n\t *\n\t * A response of \"Content-Type: text/plain; charset=utf-8\"\n\t * will provide you with a `.type` of \"text/plain\".\n\t *\n\t * @param {Object} header\n\t * @api private\n\t */\n\t\n\tResponseBase.prototype._setHeaderProperties = function(header){\n\t // TODO: moar!\n\t // TODO: make this a util\n\t\n\t // content-type\n\t var ct = header['content-type'] || '';\n\t this.type = utils.type(ct);\n\t\n\t // params\n\t var params = utils.params(ct);\n\t for (var key in params) this[key] = params[key];\n\t\n\t this.links = {};\n\t\n\t // links\n\t try {\n\t if (header.link) {\n\t this.links = utils.parseLinks(header.link);\n\t }\n\t } catch (err) {\n\t // ignore\n\t }\n\t};\n\t\n\t/**\n\t * Set flags such as `.ok` based on `status`.\n\t *\n\t * For example a 2xx response will give you a `.ok` of __true__\n\t * whereas 5xx will be __false__ and `.error` will be __true__. The\n\t * `.clientError` and `.serverError` are also available to be more\n\t * specific, and `.statusType` is the class of error ranging from 1..5\n\t * sometimes useful for mapping respond colors etc.\n\t *\n\t * \"sugar\" properties are also defined for common cases. Currently providing:\n\t *\n\t * - .noContent\n\t * - .badRequest\n\t * - .unauthorized\n\t * - .notAcceptable\n\t * - .notFound\n\t *\n\t * @param {Number} status\n\t * @api private\n\t */\n\t\n\tResponseBase.prototype._setStatusProperties = function(status){\n\t var type = status / 100 | 0;\n\t\n\t // status / class\n\t this.status = this.statusCode = status;\n\t this.statusType = type;\n\t\n\t // basics\n\t this.info = 1 == type;\n\t this.ok = 2 == type;\n\t this.redirect = 3 == type;\n\t this.clientError = 4 == type;\n\t this.serverError = 5 == type;\n\t this.error = (4 == type || 5 == type)\n\t ? this.toError()\n\t : false;\n\t\n\t // sugar\n\t this.accepted = 202 == status;\n\t this.noContent = 204 == status;\n\t this.badRequest = 400 == status;\n\t this.unauthorized = 401 == status;\n\t this.notAcceptable = 406 == status;\n\t this.forbidden = 403 == status;\n\t this.notFound = 404 == status;\n\t};\n\n\n/***/ },\n/* 29 */\n/***/ function(module, exports) {\n\n\t\n\t/**\n\t * Return the mime type for the given `str`.\n\t *\n\t * @param {String} str\n\t * @return {String}\n\t * @api private\n\t */\n\t\n\texports.type = function(str){\n\t return str.split(/ *; */).shift();\n\t};\n\t\n\t/**\n\t * Return header field parameters.\n\t *\n\t * @param {String} str\n\t * @return {Object}\n\t * @api private\n\t */\n\t\n\texports.params = function(str){\n\t return str.split(/ *; */).reduce(function(obj, str){\n\t var parts = str.split(/ *= */);\n\t var key = parts.shift();\n\t var val = parts.shift();\n\t\n\t if (key && val) obj[key] = val;\n\t return obj;\n\t }, {});\n\t};\n\t\n\t/**\n\t * Parse Link header fields.\n\t *\n\t * @param {String} str\n\t * @return {Object}\n\t * @api private\n\t */\n\t\n\texports.parseLinks = function(str){\n\t return str.split(/ *, */).reduce(function(obj, str){\n\t var parts = str.split(/ *; */);\n\t var url = parts[0].slice(1, -1);\n\t var rel = parts[1].split(/ *= */)[1].slice(1, -1);\n\t obj[rel] = url;\n\t return obj;\n\t }, {});\n\t};\n\t\n\t/**\n\t * Strip content related fields from `header`.\n\t *\n\t * @param {Object} header\n\t * @return {Object} header\n\t * @api private\n\t */\n\t\n\texports.cleanHeader = function(header, shouldStripCookie){\n\t delete header['content-type'];\n\t delete header['content-length'];\n\t delete header['transfer-encoding'];\n\t delete header['host'];\n\t if (shouldStripCookie) {\n\t delete header['cookie'];\n\t }\n\t return header;\n\t};\n\n\n/***/ },\n/* 30 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\r\n\t/**\r\n\t * Expose `Emitter`.\r\n\t */\r\n\t\r\n\tif (true) {\r\n\t module.exports = Emitter;\r\n\t}\r\n\t\r\n\t/**\r\n\t * Initialize a new `Emitter`.\r\n\t *\r\n\t * @api public\r\n\t */\r\n\t\r\n\tfunction Emitter(obj) {\r\n\t if (obj) return mixin(obj);\r\n\t};\r\n\t\r\n\t/**\r\n\t * Mixin the emitter properties.\r\n\t *\r\n\t * @param {Object} obj\r\n\t * @return {Object}\r\n\t * @api private\r\n\t */\r\n\t\r\n\tfunction mixin(obj) {\r\n\t for (var key in Emitter.prototype) {\r\n\t obj[key] = Emitter.prototype[key];\r\n\t }\r\n\t return obj;\r\n\t}\r\n\t\r\n\t/**\r\n\t * Listen on the given `event` with `fn`.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Function} fn\r\n\t * @return {Emitter}\r\n\t * @api public\r\n\t */\r\n\t\r\n\tEmitter.prototype.on =\r\n\tEmitter.prototype.addEventListener = function(event, fn){\r\n\t this._callbacks = this._callbacks || {};\r\n\t (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n\t .push(fn);\r\n\t return this;\r\n\t};\r\n\t\r\n\t/**\r\n\t * Adds an `event` listener that will be invoked a single\r\n\t * time then automatically removed.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Function} fn\r\n\t * @return {Emitter}\r\n\t * @api public\r\n\t */\r\n\t\r\n\tEmitter.prototype.once = function(event, fn){\r\n\t function on() {\r\n\t this.off(event, on);\r\n\t fn.apply(this, arguments);\r\n\t }\r\n\t\r\n\t on.fn = fn;\r\n\t this.on(event, on);\r\n\t return this;\r\n\t};\r\n\t\r\n\t/**\r\n\t * Remove the given callback for `event` or all\r\n\t * registered callbacks.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Function} fn\r\n\t * @return {Emitter}\r\n\t * @api public\r\n\t */\r\n\t\r\n\tEmitter.prototype.off =\r\n\tEmitter.prototype.removeListener =\r\n\tEmitter.prototype.removeAllListeners =\r\n\tEmitter.prototype.removeEventListener = function(event, fn){\r\n\t this._callbacks = this._callbacks || {};\r\n\t\r\n\t // all\r\n\t if (0 == arguments.length) {\r\n\t this._callbacks = {};\r\n\t return this;\r\n\t }\r\n\t\r\n\t // specific event\r\n\t var callbacks = this._callbacks['$' + event];\r\n\t if (!callbacks) return this;\r\n\t\r\n\t // remove all handlers\r\n\t if (1 == arguments.length) {\r\n\t delete this._callbacks['$' + event];\r\n\t return this;\r\n\t }\r\n\t\r\n\t // remove specific handler\r\n\t var cb;\r\n\t for (var i = 0; i < callbacks.length; i++) {\r\n\t cb = callbacks[i];\r\n\t if (cb === fn || cb.fn === fn) {\r\n\t callbacks.splice(i, 1);\r\n\t break;\r\n\t }\r\n\t }\r\n\t return this;\r\n\t};\r\n\t\r\n\t/**\r\n\t * Emit `event` with the given args.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Mixed} ...\r\n\t * @return {Emitter}\r\n\t */\r\n\t\r\n\tEmitter.prototype.emit = function(event){\r\n\t this._callbacks = this._callbacks || {};\r\n\t var args = [].slice.call(arguments, 1)\r\n\t , callbacks = this._callbacks['$' + event];\r\n\t\r\n\t if (callbacks) {\r\n\t callbacks = callbacks.slice(0);\r\n\t for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n\t callbacks[i].apply(this, args);\r\n\t }\r\n\t }\r\n\t\r\n\t return this;\r\n\t};\r\n\t\r\n\t/**\r\n\t * Return array of callbacks for `event`.\r\n\t *\r\n\t * @param {String} event\r\n\t * @return {Array}\r\n\t * @api public\r\n\t */\r\n\t\r\n\tEmitter.prototype.listeners = function(event){\r\n\t this._callbacks = this._callbacks || {};\r\n\t return this._callbacks['$' + event] || [];\r\n\t};\r\n\t\r\n\t/**\r\n\t * Check if this emitter has `event` handlers.\r\n\t *\r\n\t * @param {String} event\r\n\t * @return {Boolean}\r\n\t * @api public\r\n\t */\r\n\t\r\n\tEmitter.prototype.hasListeners = function(event){\r\n\t return !! this.listeners(event).length;\r\n\t};\r\n\n\n/***/ },\n/* 31 */\n/***/ function(module, exports) {\n\n\tvar WinChan = (function() {\n\t var RELAY_FRAME_NAME = \"__winchan_relay_frame\";\n\t var CLOSE_CMD = \"die\";\n\t\n\t // a portable addListener implementation\n\t function addListener(w, event, cb) {\n\t if(w.attachEvent) w.attachEvent('on' + event, cb);\n\t else if (w.addEventListener) w.addEventListener(event, cb, false);\n\t }\n\t\n\t // a portable removeListener implementation\n\t function removeListener(w, event, cb) {\n\t if(w.detachEvent) w.detachEvent('on' + event, cb);\n\t else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n\t }\n\t\n\t\n\t // checking for IE8 or above\n\t function isInternetExplorer() {\n\t if (typeof navigator === 'undefined') {\n\t return false;\n\t }\n\t\n\t var rv = -1; // Return value assumes failure.\n\t var ua = navigator.userAgent;\n\t if (navigator.appName === 'Microsoft Internet Explorer') {\n\t var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t if (re.exec(ua) != null)\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t // IE > 11\n\t else if (ua.indexOf(\"Trident\") > -1) {\n\t var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n\t if (re.exec(ua) !== null) {\n\t rv = parseFloat(RegExp.$1);\n\t }\n\t }\n\t\n\t return rv >= 8;\n\t }\n\t\n\t // checking Mobile Firefox (Fennec)\n\t function isFennec() {\n\t try {\n\t // We must check for both XUL and Java versions of Fennec. Both have\n\t // distinct UA strings.\n\t var userAgent = navigator.userAgent;\n\t return (userAgent.indexOf('Fennec/') != -1) || // XUL\n\t (userAgent.indexOf('Firefox/') != -1 && userAgent.indexOf('Android') != -1); // Java\n\t } catch(e) {}\n\t return false;\n\t }\n\t\n\t // feature checking to see if this platform is supported at all\n\t function isSupported() {\n\t return (typeof window !== 'undefined' && window.JSON && window.JSON.stringify &&\n\t window.JSON.parse && window.postMessage);\n\t }\n\t\n\t // given a URL, extract the origin. Taken from: https://github.com/firebase/firebase-simple-login/blob/d2cb95b9f812d8488bdbfba51c3a7c153ba1a074/js/src/simple-login/transports/WinChan.js#L25-L30\n\t function extractOrigin(url) {\n\t if (!/^https?:\\/\\//.test(url)) url = window.location.href;\n\t var m = /^(https?:\\/\\/[\\-_a-zA-Z\\.0-9:]+)/.exec(url);\n\t if (m) return m[1];\n\t return url;\n\t }\n\t\n\t // find the relay iframe in the opener\n\t function findRelay() {\n\t var loc = window.location;\n\t var frames = window.opener.frames;\n\t for (var i = frames.length - 1; i >= 0; i--) {\n\t try {\n\t if (frames[i].location.protocol === window.location.protocol &&\n\t frames[i].location.host === window.location.host &&\n\t frames[i].name === RELAY_FRAME_NAME)\n\t {\n\t return frames[i];\n\t }\n\t } catch(e) { }\n\t }\n\t return;\n\t }\n\t\n\t var isIE = isInternetExplorer();\n\t\n\t if (isSupported()) {\n\t /* General flow:\n\t * 0. user clicks\n\t * (IE SPECIFIC) 1. caller adds relay iframe (served from trusted domain) to DOM\n\t * 2. caller opens window (with content from trusted domain)\n\t * 3. window on opening adds a listener to 'message'\n\t * (IE SPECIFIC) 4. window on opening finds iframe\n\t * 5. window checks if iframe is \"loaded\" - has a 'doPost' function yet\n\t * (IE SPECIFIC5) 5a. if iframe.doPost exists, window uses it to send ready event to caller\n\t * (IE SPECIFIC5) 5b. if iframe.doPost doesn't exist, window waits for frame ready\n\t * (IE SPECIFIC5) 5bi. once ready, window calls iframe.doPost to send ready event\n\t * 6. caller upon reciept of 'ready', sends args\n\t */\n\t return {\n\t open: function(opts, cb) {\n\t if (!cb) throw \"missing required callback argument\";\n\t\n\t // test required options\n\t var err;\n\t if (!opts.url) err = \"missing required 'url' parameter\";\n\t if (!opts.relay_url) err = \"missing required 'relay_url' parameter\";\n\t if (err) setTimeout(function() { cb(err); }, 0);\n\t\n\t // supply default options\n\t if (!opts.window_name) opts.window_name = null;\n\t if (!opts.window_features || isFennec()) opts.window_features = undefined;\n\t\n\t // opts.params may be undefined\n\t\n\t var iframe;\n\t\n\t // sanity check, are url and relay_url the same origin?\n\t var origin = extractOrigin(opts.url);\n\t if (origin !== extractOrigin(opts.relay_url)) {\n\t return setTimeout(function() {\n\t cb('invalid arguments: origin of url and relay_url must match');\n\t }, 0);\n\t }\n\t\n\t var messageTarget;\n\t\n\t if (isIE) {\n\t // first we need to add a \"relay\" iframe to the document that's served\n\t // from the target domain. We can postmessage into a iframe, but not a\n\t // window\n\t iframe = document.createElement(\"iframe\");\n\t // iframe.setAttribute('name', framename);\n\t iframe.setAttribute('src', opts.relay_url);\n\t iframe.style.display = \"none\";\n\t iframe.setAttribute('name', RELAY_FRAME_NAME);\n\t document.body.appendChild(iframe);\n\t messageTarget = iframe.contentWindow;\n\t }\n\t\n\t var w = opts.popup || window.open(opts.url, opts.window_name, opts.window_features);\n\t if (opts.popup) {\n\t w.location.href = opts.url;\n\t }\n\t\n\t if (!messageTarget) messageTarget = w;\n\t\n\t // lets listen in case the window blows up before telling us\n\t var closeInterval = setInterval(function() {\n\t if (w && w.closed) {\n\t cleanup();\n\t if (cb) {\n\t cb('User closed the popup window');\n\t cb = null;\n\t }\n\t }\n\t }, 500);\n\t\n\t var req = JSON.stringify({a: 'request', d: opts.params});\n\t\n\t // cleanup on unload\n\t function cleanup() {\n\t if (iframe) document.body.removeChild(iframe);\n\t iframe = undefined;\n\t if (closeInterval) closeInterval = clearInterval(closeInterval);\n\t removeListener(window, 'message', onMessage);\n\t removeListener(window, 'unload', cleanup);\n\t if (w) {\n\t try {\n\t w.close();\n\t } catch (securityViolation) {\n\t // This happens in Opera 12 sometimes\n\t // see https://github.com/mozilla/browserid/issues/1844\n\t messageTarget.postMessage(CLOSE_CMD, origin);\n\t }\n\t }\n\t w = messageTarget = undefined;\n\t }\n\t\n\t addListener(window, 'unload', cleanup);\n\t\n\t function onMessage(e) {\n\t if (e.origin !== origin) { return; }\n\t try {\n\t var d = JSON.parse(e.data);\n\t if (d.a === 'ready') messageTarget.postMessage(req, origin);\n\t else if (d.a === 'error') {\n\t cleanup();\n\t if (cb) {\n\t cb(d.d);\n\t cb = null;\n\t }\n\t } else if (d.a === 'response') {\n\t cleanup();\n\t if (cb) {\n\t cb(null, d.d);\n\t cb = null;\n\t }\n\t }\n\t } catch(err) { }\n\t }\n\t\n\t addListener(window, 'message', onMessage);\n\t\n\t return {\n\t close: cleanup,\n\t focus: function() {\n\t if (w) {\n\t try {\n\t w.focus();\n\t } catch (e) {\n\t // IE7 blows up here, do nothing\n\t }\n\t }\n\t }\n\t };\n\t },\n\t onOpen: function(cb) {\n\t var o = \"*\";\n\t var msgTarget = isIE ? findRelay() : window.opener;\n\t if (!msgTarget) throw \"can't find relay frame\";\n\t function doPost(msg) {\n\t msg = JSON.stringify(msg);\n\t if (isIE) msgTarget.doPost(msg, o);\n\t else msgTarget.postMessage(msg, o);\n\t }\n\t\n\t function onMessage(e) {\n\t // only one message gets through, but let's make sure it's actually\n\t // the message we're looking for (other code may be using\n\t // postmessage) - we do this by ensuring the payload can\n\t // be parsed, and it's got an 'a' (action) value of 'request'.\n\t var d;\n\t try {\n\t d = JSON.parse(e.data);\n\t } catch(err) { }\n\t if (!d || d.a !== 'request') return;\n\t removeListener(window, 'message', onMessage);\n\t o = e.origin;\n\t if (cb) {\n\t // this setTimeout is critically important for IE8 -\n\t // in ie8 sometimes addListener for 'message' can synchronously\n\t // cause your callback to be invoked. awesome.\n\t setTimeout(function() {\n\t cb(o, d.d, function(r) {\n\t cb = undefined;\n\t doPost({a: 'response', d: r});\n\t });\n\t }, 0);\n\t }\n\t }\n\t\n\t function onDie(e) {\n\t if (e.data === CLOSE_CMD) {\n\t try { window.close(); } catch (o_O) {}\n\t }\n\t }\n\t addListener(isIE ? msgTarget : window, 'message', onMessage);\n\t addListener(isIE ? msgTarget : window, 'message', onDie);\n\t\n\t // we cannot post to our parent that we're ready before the iframe\n\t // is loaded. (IE specific possible failure)\n\t try {\n\t doPost({a: \"ready\"});\n\t } catch(e) {\n\t // this code should never be exectued outside IE\n\t addListener(msgTarget, 'load', function(e) {\n\t doPost({a: \"ready\"});\n\t });\n\t }\n\t\n\t // if window is unloaded and the client hasn't called cb, it's an error\n\t var onUnload = function() {\n\t try {\n\t // IE8 doesn't like this...\n\t removeListener(isIE ? msgTarget : window, 'message', onDie);\n\t } catch (ohWell) { }\n\t if (cb) doPost({ a: 'error', d: 'client closed window' });\n\t cb = undefined;\n\t // explicitly close the window, in case the client is trying to reload or nav\n\t try { window.close(); } catch (e) { }\n\t };\n\t addListener(window, 'unload', onUnload);\n\t return {\n\t detach: function() {\n\t removeListener(window, 'unload', onUnload);\n\t }\n\t };\n\t }\n\t };\n\t } else {\n\t return {\n\t open: function(url, winopts, arg, cb) {\n\t setTimeout(function() { cb(\"unsupported browser\"); }, 0);\n\t },\n\t onOpen: function(cb) {\n\t setTimeout(function() { cb(\"unsupported browser\"); }, 0);\n\t }\n\t };\n\t }\n\t})();\n\t\n\tif (typeof module !== 'undefined' && module.exports) {\n\t module.exports = WinChan;\n\t}\n\n\n/***/ },\n/* 32 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar urljoin = __webpack_require__(3);\n\t\n\tvar objectHelper = __webpack_require__(1);\n\tvar assert = __webpack_require__(4);\n\tvar responseHandler = __webpack_require__(5);\n\t\n\tfunction DBConnection(request, options) {\n\t this.baseOptions = options;\n\t this.request = request;\n\t}\n\t\n\t/**\n\t * Signup a new user\n\t *\n\t * @method signup\n\t * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup\n\t * @param {Function} cb\n\t */\n\tDBConnection.prototype.signup = function (options, cb) {\n\t var url;\n\t var body;\n\t\n\t assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n\t connection: { type: 'string', message: 'connection option is required' },\n\t email: { type: 'string', message: 'email option is required' },\n\t password: { type: 'string', message: 'password option is required' }\n\t });\n\t assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\t\n\t url = urljoin(this.baseOptions.rootUrl, 'dbconnections', 'signup');\n\t\n\t body = objectHelper.merge(this.baseOptions, ['clientID'])\n\t .with(options);\n\t\n\t body = objectHelper.blacklist(body, ['scope']);\n\t\n\t body = objectHelper.toSnakeCase(body, ['auth0Client']);\n\t\n\t return this.request\n\t .post(url)\n\t .send(body)\n\t .end(responseHandler(cb));\n\t};\n\t\n\t/**\n\t * Initializes the change password flow\n\t *\n\t * @method signup\n\t * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password\n\t * @param {Function} cb\n\t */\n\tDBConnection.prototype.changePassword = function (options, cb) {\n\t var url;\n\t var body;\n\t\n\t assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n\t connection: { type: 'string', message: 'connection option is required' },\n\t email: { type: 'string', message: 'email option is required' }\n\t });\n\t assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\t\n\t url = urljoin(this.baseOptions.rootUrl, 'dbconnections', 'change_password');\n\t\n\t body = objectHelper.merge(this.baseOptions, ['clientID'])\n\t .with(options, ['email', 'connection']);\n\t\n\t body = objectHelper.toSnakeCase(body, ['auth0Client']);\n\t\n\t return this.request\n\t .post(url)\n\t .send(body)\n\t .end(responseHandler(cb));\n\t};\n\t\n\tmodule.exports = DBConnection;\n\n\n/***/ },\n/* 33 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar urljoin = __webpack_require__(3);\n\t\n\tvar objectHelper = __webpack_require__(1);\n\tvar assert = __webpack_require__(4);\n\tvar qs = __webpack_require__(8);\n\tvar responseHandler = __webpack_require__(5);\n\t\n\tfunction PasswordlessAuthentication(request, options) {\n\t this.baseOptions = options;\n\t this.request = request;\n\t}\n\t\n\t/**\n\t * Builds and returns the passwordless TOTP verify url in order to initialize a new authN/authZ transaction\n\t *\n\t * @method buildVerifyUrl\n\t * @param {Object} options\n\t * @param {Function} cb\n\t */\n\tPasswordlessAuthentication.prototype.buildVerifyUrl = function (options) {\n\t var params;\n\t var qString;\n\t\n\t /* eslint-disable */\n\t assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n\t connection: { type: 'string', message: 'connection option is required' },\n\t type: { type: 'string', message: 'type option is required', values: ['sms', 'email'],\n\t value_message: 'type is not valid ([email,sms])' },\n\t verificationCode: { type: 'string', message: 'verificationCode option is required' },\n\t phoneNumber: { required: true, type: 'string', message: 'phoneNumber option is required',\n\t condition: function (o) { return o.type === 'sms'; } },\n\t email: { required: true, type: 'string', message: 'email option is required',\n\t condition: function (o) { return o.type === 'email'; } }\n\t });\n\t /* eslint-enable */\n\t\n\t assert.check(options, {\n\t optional: true,\n\t type: 'object',\n\t message: 'options parameter is not valid'\n\t });\n\t\n\t params = objectHelper.merge(this.baseOptions, [\n\t 'clientID',\n\t 'responseType',\n\t 'responseMode',\n\t 'redirectUri',\n\t 'scope',\n\t 'audience'\n\t ]).with(options);\n\t\n\t params = objectHelper.blacklist(params, ['type']);\n\t\n\t // eslint-disable-next-line\n\t if (this.baseOptions._sendTelemetry) {\n\t params.auth0Client = this.request.getTelemetryData();\n\t }\n\t\n\t params = objectHelper.toSnakeCase(params, ['auth0Client']);\n\t\n\t qString = qs.build(params);\n\t\n\t return urljoin(this.baseOptions.rootUrl, 'passwordless', 'verify_redirect', '?' + qString);\n\t};\n\t\n\t/**\n\t * Initializes a new passwordless authN/authZ transaction\n\t *\n\t * @method start\n\t * @param {Object} options: https://auth0.com/docs/api/authentication#passwordless\n\t * @param {Function} cb\n\t */\n\tPasswordlessAuthentication.prototype.start = function (options, cb) {\n\t var url;\n\t var body;\n\t var cleanOption;\n\t\n\t /* eslint-disable */\n\t assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n\t connection: { type: 'string', message: 'connection option is required' },\n\t type: { type: 'string', message: 'type option is required', values: ['sms', 'email'],\n\t value_message: 'type is not valid ([email,sms])' },\n\t phoneNumber: { required: true, type: 'string', message: 'phoneNumber option is required',\n\t condition: function (o) { return o.type === 'sms'; } },\n\t email: { required: true, type: 'string', message: 'email option is required',\n\t condition: function (o) { return o.type === 'email'; } }\n\t });\n\t /* eslint-enable */\n\t\n\t assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\t\n\t cleanOption = objectHelper.blacklist(options, ['type']);\n\t\n\t url = urljoin(this.baseOptions.rootUrl, 'passwordless', 'start');\n\t\n\t body = objectHelper.merge(this.baseOptions, ['clientID'])\n\t .with(cleanOption);\n\t\n\t body = objectHelper.toSnakeCase(body, ['auth0Client']);\n\t\n\t return this.request\n\t .post(url)\n\t .send(body)\n\t .end(responseHandler(cb));\n\t};\n\t\n\t/**\n\t * Verifies the passwordless TOTP and returns an error if any.\n\t *\n\t * @method buildVerifyUrl\n\t * @param {Object} options\n\t * @param {Function} cb\n\t */\n\tPasswordlessAuthentication.prototype.verify = function (options, cb) {\n\t var url;\n\t var cleanOption;\n\t\n\t /* eslint-disable */\n\t assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n\t connection: { type: 'string', message: 'connection option is required' },\n\t type: { type: 'string', message: 'type option is required', values: ['sms', 'email'],\n\t value_message: 'type is not valid ([email,sms])' },\n\t verificationCode: { type: 'string', message: 'verificationCode option is required' },\n\t phoneNumber: { required: true, type: 'string', message: 'phoneNumber option is required',\n\t condition: function (o) { return o.type === 'sms'; } },\n\t email: { required: true, type: 'string', message: 'email option is required',\n\t condition: function (o) { return o.type === 'email'; } }\n\t });\n\t /* eslint-enable */\n\t\n\t assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\t\n\t cleanOption = objectHelper.blacklist(options, ['type']);\n\t\n\t cleanOption = objectHelper.toSnakeCase(cleanOption, ['auth0Client']);\n\t\n\t url = urljoin(this.baseOptions.rootUrl, 'passwordless', 'verify');\n\t\n\t return this.request\n\t .post(url)\n\t .send(cleanOption)\n\t .end(responseHandler(cb));\n\t};\n\t\n\tmodule.exports = PasswordlessAuthentication;\n\n\n/***/ },\n/* 34 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar windowHandler = __webpack_require__(2);\n\tvar base64Url = __webpack_require__(14);\n\t\n\tfunction create(name, value, days) {\n\t var date;\n\t var expires;\n\t\n\t if (windowHandler.getDocument().cookie === undefined\n\t || windowHandler.getDocument().cookie === null) {\n\t throw new Error('cookie storage not available');\n\t }\n\t\n\t if (days) {\n\t date = new Date();\n\t date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n\t expires = '; expires=' + date.toGMTString();\n\t } else {\n\t expires = '';\n\t }\n\t\n\t windowHandler.getDocument().cookie = name + '=' + base64Url.encode(value) + expires + '; path=/';\n\t}\n\t\n\tfunction read(name) {\n\t var i;\n\t var cookie;\n\t var cookies;\n\t var nameEQ = name + '=';\n\t\n\t if (windowHandler.getDocument().cookie === undefined\n\t || windowHandler.getDocument().cookie === null) {\n\t throw new Error('cookie storage not available');\n\t }\n\t\n\t cookies = windowHandler.getDocument().cookie.split(';');\n\t\n\t for (i = 0; i < cookies.length; i++) {\n\t cookie = cookies[i];\n\t while (cookie.charAt(0) === ' ') {\n\t cookie = cookie.substring(1, cookie.length);\n\t }\n\t if (cookie.indexOf(nameEQ) === 0) {\n\t return base64Url.decode(cookie.substring(nameEQ.length, cookie.length));\n\t }\n\t }\n\t\n\t return null;\n\t}\n\t\n\tfunction erase(name) {\n\t create(name, '', -1);\n\t}\n\t\n\tmodule.exports = {\n\t create: create,\n\t read: read,\n\t erase: erase\n\t};\n\n\n/***/ },\n/* 35 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar windowHelper = __webpack_require__(2);\n\t\n\tfunction IframeHandler(options) {\n\t this.auth0 = options.auth0;\n\t this.url = options.url;\n\t this.callback = options.callback;\n\t this.timeout = options.timeout || 60 * 1000;\n\t this.timeoutCallback = options.timeoutCallback || null;\n\t this.usePostMessage = options.usePostMessage || false;\n\t this.iframe = null;\n\t this.timeoutHandle = null;\n\t this._destroyTimeout = null;\n\t this.transientMessageEventListener = null;\n\t this.transientEventListener = null;\n\t}\n\t\n\tIframeHandler.prototype.init = function () {\n\t var _this = this;\n\t var _window = windowHelper.getWindow();\n\t\n\t this.iframe = _window.document.createElement('iframe');\n\t this.iframe.style.display = 'none';\n\t this.iframe.src = this.url;\n\t\n\t if (this.usePostMessage) {\n\t // Workaround to avoid using bind that does not work in IE8\n\t this.transientMessageEventListener = function (e) {\n\t _this.messageEventListener(e);\n\t };\n\t\n\t _window.addEventListener('message', this.transientMessageEventListener, false);\n\t } else {\n\t // Workaround to avoid using bind that does not work in IE8\n\t this.transientEventListener = function () {\n\t _this.loadEventListener();\n\t };\n\t\n\t this.iframe.addEventListener('load', this.transientEventListener, false);\n\t }\n\t\n\t _window.document.body.appendChild(this.iframe);\n\t\n\t this.timeoutHandle = setTimeout(function () {\n\t _this.timeoutHandler();\n\t }, this.timeout);\n\t};\n\t\n\tIframeHandler.prototype.messageEventListener = function (e) {\n\t this.destroy();\n\t this.callbackHandler(e.data);\n\t};\n\t\n\tIframeHandler.prototype.loadEventListener = function () {\n\t var _this = this;\n\t this.auth0.parseHash(\n\t { hash: this.iframe.contentWindow.location.hash },\n\t function (error, result) {\n\t if (error || result) {\n\t _this.destroy();\n\t _this.callback(error, result);\n\t }\n\t }\n\t );\n\t};\n\t\n\tIframeHandler.prototype.callbackHandler = function (result) {\n\t var error = null;\n\t\n\t if (result.error) {\n\t error = result;\n\t result = null;\n\t }\n\t\n\t this.callback(error, result);\n\t};\n\t\n\tIframeHandler.prototype.timeoutHandler = function () {\n\t this.destroy();\n\t if (this.timeoutCallback) {\n\t this.timeoutCallback();\n\t }\n\t};\n\t\n\tIframeHandler.prototype.destroy = function () {\n\t var _this = this;\n\t var _window = windowHelper.getWindow();\n\t\n\t clearTimeout(this.timeoutHandle);\n\t\n\t this._destroyTimeout = setTimeout(function () {\n\t if (_this.usePostMessage) {\n\t _window.removeEventListener('message', _this.transientMessageEventListener, false);\n\t } else {\n\t _this.iframe.removeEventListener('load', _this.transientEventListener, false);\n\t }\n\t\n\t _window.document.body.removeChild(_this.iframe);\n\t }, 0);\n\t};\n\t\n\tmodule.exports = IframeHandler;\n\n\n/***/ },\n/* 36 */\n/***/ function(module, exports) {\n\n\tfunction get() {\n\t if (!Object.assign) {\n\t return objectAssignPolyfill;\n\t }\n\t\n\t return Object.assign;\n\t}\n\t\n\tfunction objectAssignPolyfill(target) {\n\t 'use strict';\n\t if (target === undefined || target === null) {\n\t throw new TypeError('Cannot convert first argument to object');\n\t }\n\t\n\t var to = Object(target);\n\t for (var i = 1; i < arguments.length; i++) {\n\t var nextSource = arguments[i];\n\t if (nextSource === undefined || nextSource === null) {\n\t continue;\n\t }\n\t\n\t var keysArray = Object.keys(Object(nextSource));\n\t for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {\n\t var nextKey = keysArray[nextIndex];\n\t var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n\t if (desc !== undefined && desc.enumerable) {\n\t to[nextKey] = nextSource[nextKey];\n\t }\n\t }\n\t }\n\t return to;\n\t}\n\t\n\tmodule.exports = {\n\t get: get,\n\t objectAssignPolyfill: objectAssignPolyfill\n\t};\n\n/***/ },\n/* 37 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar objectHelper = __webpack_require__(1);\n\t\n\tvar token_params = [\n\t// auth0\n\t 'realm',\n\t 'audience',\n\t// oauth2\n\t 'client_id',\n\t 'client_secret',\n\t 'redirect_uri',\n\t 'scope',\n\t 'code',\n\t 'grant_type',\n\t 'username',\n\t 'password',\n\t 'refresh_token',\n\t 'assertion',\n\t 'client_assertion',\n\t 'client_assertion_type',\n\t 'code_verifier'\n\t];\n\t\n\tvar authorize_params = [\n\t// auth0\n\t 'connection',\n\t 'connection_scope',\n\t 'auth0Client',\n\t 'owp',\n\t// oauth2\n\t 'client_id',\n\t 'response_type',\n\t 'response_mode',\n\t 'redirect_uri',\n\t 'audience',\n\t 'scope',\n\t 'state',\n\t 'nonce',\n\t 'display',\n\t 'prompt',\n\t 'max_age',\n\t 'ui_locales',\n\t 'claims_locales',\n\t 'id_token_hint',\n\t 'login_hint',\n\t 'acr_values',\n\t 'claims',\n\t 'registration',\n\t 'request',\n\t 'request_uri',\n\t 'code_challenge',\n\t 'code_challenge_method'\n\t];\n\t\n\tfunction oauthAuthorizeParams(params) {\n\t return objectHelper.pick(params, authorize_params);\n\t}\n\t\n\tfunction oauthTokenParams(params) {\n\t return objectHelper.pick(params, token_params);\n\t}\n\t\n\tmodule.exports = {\n\t oauthTokenParams: oauthTokenParams,\n\t oauthAuthorizeParams: oauthAuthorizeParams\n\t};\n\n\n/***/ },\n/* 38 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar WinChan = __webpack_require__(31);\n\t\n\tvar windowHandler = __webpack_require__(2);\n\tvar objectHelper = __webpack_require__(1);\n\t\n\tfunction PopupHandler() {\n\t this._current_popup = null;\n\t}\n\t\n\tPopupHandler.prototype.stringifyPopupSettings = function (options) {\n\t var settings = '';\n\t\n\t for (var key in options) {\n\t settings += key + '=' + options[key] + ',';\n\t }\n\t\n\t return settings.slice(0, -1);\n\t};\n\t\n\tPopupHandler.prototype.calculatePosition = function (options) {\n\t var width = options.width || 500;\n\t var height = options.height || 600;\n\t var _window = windowHandler.getWindow();\n\t\n\t var screenX = typeof _window.screenX !== 'undefined' ? _window.screenX : _window.screenLeft;\n\t var screenY = typeof _window.screenY !== 'undefined' ? _window.screenY : _window.screenTop;\n\t\n\t var outerWidth = typeof _window.outerWidth !== 'undefined'\n\t ? _window.outerWidth\n\t : _window.document.body.clientWidth;\n\t\n\t var outerHeight = typeof _window.outerHeight !== 'undefined'\n\t ? _window.outerHeight\n\t : _window.document.body.clientHeight;\n\t\n\t var left = screenX + ((outerWidth - width) / 2);\n\t var top = screenY + ((outerHeight - height) / 2);\n\t\n\t return { width: width, height: height, left: left, top: top };\n\t};\n\t\n\tPopupHandler.prototype.preload = function (options) {\n\t var _this = this;\n\t var _window = windowHandler.getWindow();\n\t var popupPosition = this.calculatePosition(options.popupOptions || {});\n\t var popupOptions = objectHelper.merge(popupPosition).with(options.popupOptions);\n\t var url = options.url || 'about:blank';\n\t var windowFeatures = this.stringifyPopupSettings(popupOptions);\n\t\n\t if (this._current_popup && !this._current_popup.closed) {\n\t return this._current_popup;\n\t }\n\t\n\t this._current_popup = _window.open(url, 'auth0_signup_popup', windowFeatures);\n\t\n\t this._current_popup.kill = function () {\n\t this.close();\n\t _this._current_popup = null;\n\t };\n\t\n\t return this._current_popup;\n\t};\n\t\n\tPopupHandler.prototype.load = function (url, relayUrl, options, cb) {\n\t var _this = this;\n\t var popupPosition = this.calculatePosition(options.popupOptions || {});\n\t var popupOptions = objectHelper.merge(popupPosition).with(options.popupOptions);\n\t\n\t var winchanOptions = {\n\t url: url,\n\t relay_url: relayUrl,\n\t window_features: this.stringifyPopupSettings(popupOptions),\n\t popup: this._current_popup,\n\t params: options\n\t };\n\t\n\t var popup = WinChan.open(winchanOptions, function (err, data) {\n\t _this._current_popup = null;\n\t return cb(err, data);\n\t });\n\t\n\t popup.focus();\n\t\n\t return popup;\n\t};\n\t\n\tmodule.exports = PopupHandler;\n\n\n/***/ },\n/* 39 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar windowHelper = __webpack_require__(2);\n\t\n\tfunction randomString(length) {\n\t var bytes = new Uint8Array(length);\n\t var result = [];\n\t var charset = '0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~';\n\t\n\t var cryptoObj = windowHelper.getWindow().crypto || windowHelper.getWindow().msCrypto;\n\t if (!cryptoObj) {\n\t return null;\n\t }\n\t\n\t var random = cryptoObj.getRandomValues(bytes);\n\t\n\t for (var a = 0; a < random.length; a++) {\n\t result.push(charset[random[a] % charset.length]);\n\t }\n\t\n\t return result.join('');\n\t}\n\t\n\tmodule.exports = {\n\t randomString: randomString\n\t};\n\n\n/***/ },\n/* 40 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar StorageHandler = __webpack_require__(43);\n\tvar storage;\n\t\n\tfunction getStorage(force) {\n\t if (!storage || force) {\n\t storage = new StorageHandler();\n\t }\n\t return storage;\n\t}\n\t\n\tmodule.exports = {\n\t getItem: function (key) {\n\t var value = getStorage().getItem(key);\n\t return value ? JSON.parse(value) : value;\n\t },\n\t removeItem: function (key) {\n\t return getStorage().removeItem(key);\n\t },\n\t setItem: function (key, value) {\n\t var json = JSON.stringify(value);\n\t return getStorage().setItem(key, json);\n\t },\n\t reload: function() {\n\t getStorage(true);\n\t }\n\t};\n\n\n/***/ },\n/* 41 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar windowHandler = __webpack_require__(2);\n\tvar cookies = __webpack_require__(34);\n\t\n\tfunction CookieStorage() {}\n\t\n\tCookieStorage.prototype.getItem = function (key) {\n\t return cookies.read(key);\n\t};\n\t\n\tCookieStorage.prototype.removeItem = function (key) {\n\t cookies.erase(key);\n\t};\n\t\n\tCookieStorage.prototype.setItem = function (key, value) {\n\t cookies.create(key, value, 1);\n\t};\n\t\n\tmodule.exports = CookieStorage;\n\n/***/ },\n/* 42 */\n/***/ function(module, exports) {\n\n\tfunction DummyStorage() {}\n\t\n\tDummyStorage.prototype.getItem = function (key) { return null; };\n\t\n\tDummyStorage.prototype.removeItem = function (key) {};\n\t\n\tDummyStorage.prototype.setItem = function (key, value) {};\n\t\n\tmodule.exports = DummyStorage;\n\n/***/ },\n/* 43 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar windowHandler = __webpack_require__(2);\n\tvar DummyStorage = __webpack_require__(42);\n\tvar CookieStorage = __webpack_require__(41);\n\tvar Warn = __webpack_require__(6);\n\t\n\tfunction StorageHandler() {\n\t this.warn = new Warn({});\n\t this.storage = windowHandler.getWindow().localStorage || new CookieStorage();\n\t}\n\t\n\tStorageHandler.prototype.failover = function () {\n\t if (this.storage instanceof DummyStorage) {\n\t this.warn.warning('DummyStorage: ignore failover');\n\t return;\n\t } else if (this.storage instanceof CookieStorage) {\n\t this.warn.warning('CookieStorage: failing over DummyStorage');\n\t this.storage = new DummyStorage();\n\t } else {\n\t this.warn.warning('LocalStorage: failing over CookieStorage');\n\t this.storage = new CookieStorage();\n\t }\n\t};\n\t\n\tStorageHandler.prototype.getItem = function (key) {\n\t try {\n\t return this.storage.getItem(key);\n\t } catch (e) {\n\t this.warn.warning(e);\n\t this.failover();\n\t return this.getItem(key);\n\t }\n\t};\n\t\n\tStorageHandler.prototype.removeItem = function (key) {\n\t try {\n\t return this.storage.removeItem(key);\n\t } catch (e) {\n\t this.warn.warning(e);\n\t this.failover();\n\t return this.removeItem(key);\n\t }\n\t};\n\t\n\tStorageHandler.prototype.setItem = function (key, value) {\n\t try {\n\t return this.storage.setItem(key, value);\n\t } catch (e) {\n\t this.warn.warning(e);\n\t this.failover();\n\t return this.setItem(key, value);\n\t }\n\t};\n\t\n\tmodule.exports = StorageHandler;\n\n\n/***/ },\n/* 44 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar urljoin = __webpack_require__(3);\n\t\n\tvar RequestBuilder = __webpack_require__(9);\n\tvar assert = __webpack_require__(4);\n\tvar responseHandler = __webpack_require__(5);\n\t\n\t/**\n\t * Auth0 Management API Client (methods allowed to be called from the browser only)\n\t * @constructor\n\t * @param {Object} options\n\t * @param {Object} options.domain\n\t * @param {Object} options.token\n\t */\n\tfunction Management(options) {\n\t /* eslint-disable */\n\t assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n\t domain: { type: 'string', message: 'domain option is required' },\n\t token: { type: 'string', message: 'token option is required' },\n\t _sendTelemetry: { optional: true, type: 'boolean', message: '_sendTelemetry option is not valid' },\n\t _telemetryInfo: { optional: true, type: 'object', message: '_telemetryInfo option is not valid' }\n\t });\n\t /* eslint-enable */\n\t\n\t this.baseOptions = options;\n\t\n\t this.baseOptions.headers = { Authorization: 'Bearer ' + this.baseOptions.token };\n\t\n\t this.request = new RequestBuilder(this.baseOptions);\n\t this.baseOptions.rootUrl = urljoin('https://' + this.baseOptions.domain, 'api', 'v2');\n\t}\n\t\n\t/**\n\t * Returns the user profile. https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id\n\t *\n\t * @method getUser\n\t * @param {String} userId\n\t * @param {Function} cb\n\t */\n\tManagement.prototype.getUser = function (userId, cb) {\n\t var url;\n\t\n\t assert.check(userId, { type: 'string', message: 'userId parameter is not valid' });\n\t assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\t\n\t url = urljoin(this.baseOptions.rootUrl, 'users', userId);\n\t\n\t return this.request\n\t .get(url)\n\t .end(responseHandler(cb));\n\t};\n\t\n\t/**\n\t * Updates the user metdata. It will patch the user metdata with the attributes sent.\n\t * https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id\n\t *\n\t * @method patchUserMetadata\n\t * @param {String} userId\n\t * @param {Object} userMetadata\n\t * @param {Function} cb\n\t */\n\tManagement.prototype.patchUserMetadata = function (userId, userMetadata, cb) {\n\t var url;\n\t\n\t assert.check(userId, { type: 'string', message: 'userId parameter is not valid' });\n\t assert.check(userMetadata, { type: 'object', message: 'userMetadata parameter is not valid' });\n\t assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\t\n\t url = urljoin(this.baseOptions.rootUrl, 'users', userId);\n\t\n\t return this.request\n\t .patch(url)\n\t .send({ user_metadata: userMetadata })\n\t .end(responseHandler(cb));\n\t};\n\t\n\t/**\n\t * Link two users. https://auth0.com/docs/api/management/v2#!/Users/post_identities\n\t *\n\t * @method linkUser\n\t * @param {String} userId\n\t * @param {Object} secondaryUserToken\n\t * @param {Function} cb\n\t */\n\tManagement.prototype.linkUser = function (userId, secondaryUserToken, cb) {\n\t var url;\n\t /* eslint-disable */\n\t assert.check(userId, { type: 'string', message: 'userId parameter is not valid' });\n\t assert.check(secondaryUserToken, { type: 'string',\n\t message: 'secondaryUserToken parameter is not valid' });\n\t assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\t /* eslint-enable */\n\t\n\t url = urljoin(this.baseOptions.rootUrl, 'users', userId, 'identities');\n\t\n\t return this.request\n\t .post(url)\n\t .send({ link_with: secondaryUserToken })\n\t .end(responseHandler(cb));\n\t};\n\t\n\tmodule.exports = Management;\n\n\n/***/ },\n/* 45 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar IdTokenVerifier = __webpack_require__(25);\n\t\n\tvar assert = __webpack_require__(4);\n\tvar error = __webpack_require__(15);\n\tvar qs = __webpack_require__(8);\n\tvar windowHelper = __webpack_require__(2);\n\tvar objectHelper = __webpack_require__(1);\n\tvar TransactionManager = __webpack_require__(17);\n\tvar Authentication = __webpack_require__(13);\n\tvar Redirect = __webpack_require__(47);\n\tvar Popup = __webpack_require__(46);\n\tvar SilentAuthenticationHandler = __webpack_require__(48);\n\t\n\t/**\n\t * Handles all the browser's authentication flows\n\t * @constructor\n\t * @param {Object} options\n\t * @param {Object} options.domain\n\t * @param {Object} options.clienID\n\t * @param {Object} options.responseType\n\t * @param {Object} options.responseMode\n\t * @param {Object} options.scope\n\t * @param {Object} options.audience\n\t * @param {Object} options._disableDeprecationWarnings\n\t */\n\tfunction WebAuth(options) {\n\t /* eslint-disable */\n\t assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n\t domain: { type: 'string', message: 'domain option is required' },\n\t clientID: { type: 'string', message: 'clientID option is required' },\n\t responseType: { optional: true, type: 'string', message: 'responseType is not valid' },\n\t responseMode: { optional: true, type: 'string', message: 'responseMode is not valid' },\n\t redirectUri: { optional: true, type: 'string', message: 'redirectUri is not valid' },\n\t scope: { optional: true, type: 'string', message: 'audience is not valid' },\n\t audience: { optional: true, type: 'string', message: 'scope is not valid' },\n\t leeway: { optional: true, type: 'number', message: 'leeway is not valid' },\n\t _disableDeprecationWarnings: { optional: true, type: 'boolean', message: '_disableDeprecationWarnings option is not valid' },\n\t _sendTelemetry: { optional: true, type: 'boolean', message: '_sendTelemetry option is not valid' },\n\t _telemetryInfo: { optional: true, type: 'object', message: '_telemetryInfo option is not valid' }\n\t });\n\t\n\t if (options.overrides) {\n\t assert.check(options.overrides, { type: 'object', message: 'overrides option is not valid' }, {\n\t __tenant: { type: 'string', message: '__tenant option is required' },\n\t __token_issuer: { type: 'string', message: '__token_issuer option is required' }\n\t });\n\t }\n\t /* eslint-enable */\n\t\n\t this.baseOptions = options;\n\t\n\t this.baseOptions._sendTelemetry = this.baseOptions._sendTelemetry === false ?\n\t this.baseOptions._sendTelemetry : true;\n\t\n\t this.baseOptions.tenant = (this.overrides && this.overrides.__tenant)\n\t || this.baseOptions.domain.split('.')[0];\n\t\n\t this.baseOptions.token_issuer = (this.overrides && this.overrides.__token_issuer)\n\t || 'https://' + this.baseOptions.domain + '/';\n\t\n\t this.transactionManager = new TransactionManager(this.baseOptions.transaction);\n\t\n\t this.client = new Authentication(this.baseOptions);\n\t this.redirect = new Redirect(this.client, this.baseOptions);\n\t this.popup = new Popup(this.client, this.baseOptions);\n\t}\n\t\n\t/**\n\t * Parse the url hash and extract the returned tokens depending on the transaction.\n\t *\n\t * Only validates id_tokens signed by Auth0 using the RS256 algorithm using the public key exposed\n\t * by the `/.well-known/jwks.json` endpoint. Id tokens signed with other algorithms will not be\n\t * accepted.\n\t *\n\t * @method parseHash\n\t * @param {Object} options:\n\t * @param {String} options.state [OPTIONAL] to verify the response\n\t * @param {String} options.nonce [OPTIONAL] to verify the id_token\n\t * @param {String} options.hash [OPTIONAL] the url hash. If not provided it will extract from window.location.hash\n\t * @param {Function} cb: function(err, token_payload)\n\t */\n\tWebAuth.prototype.parseHash = function (options, cb) {\n\t var parsedQs;\n\t var err;\n\t var token;\n\t\n\t if (!cb && typeof options === 'function') {\n\t cb = options;\n\t options = {};\n\t } else {\n\t options = options || {};\n\t }\n\t\n\t var _window = windowHelper.getWindow();\n\t\n\t var hashStr = options.hash === undefined ? _window.location.hash : options.hash;\n\t hashStr = hashStr.replace(/^#?\\/?/, '');\n\t\n\t parsedQs = qs.parse(hashStr);\n\t\n\t if (parsedQs.hasOwnProperty('error')) {\n\t err = error.buildResponse(parsedQs.error, parsedQs.error_description);\n\t\n\t if (parsedQs.state) {\n\t err.state = parsedQs.state;\n\t }\n\t\n\t return cb(err);\n\t }\n\t\n\t if (!parsedQs.hasOwnProperty('access_token')\n\t && !parsedQs.hasOwnProperty('id_token')\n\t && !parsedQs.hasOwnProperty('refresh_token')) {\n\t return cb(null, null);\n\t }\n\t\n\t if (parsedQs.id_token) {\n\t this.validateToken(parsedQs.id_token, parsedQs.state || options.state, options.nonce, function (err, response) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t\n\t return cb(null, buildParseHashResponse(parsedQs, response));\n\t });\n\t } else {\n\t cb(null, buildParseHashResponse(parsedQs, null));\n\t }\n\t};\n\t\n\tfunction buildParseHashResponse(qs, token) {\n\t return {\n\t accessToken: qs.access_token || null,\n\t idToken: qs.id_token || null,\n\t idTokenPayload: token && token.payload ? token.payload : null,\n\t appStatus: token ? token.appStatus || null : null,\n\t refreshToken: qs.refresh_token || null,\n\t state: qs.state || null,\n\t expiresIn: qs.expires_in || null,\n\t tokenType: qs.token_type || null\n\t };\n\t}\n\t\n\t/**\n\t * Decodes the id_token and verifies the nonce.\n\t *\n\t * @method validateToken\n\t * @param {String} token\n\t * @param {String} state\n\t * @param {String} nonce\n\t * @param {Function} cb: function(err, {payload, transaction})\n\t */\n\tWebAuth.prototype.validateToken = function (token, state, nonce, cb) {\n\t var audiences;\n\t var transaction;\n\t var transactionNonce;\n\t var tokenNonce;\n\t\n\t transaction = this.transactionManager.getStoredTransaction(state);\n\t transactionNonce = (transaction && transaction.nonce) || nonce || null;\n\t\n\t var verifier = new IdTokenVerifier({\n\t issuer: this.baseOptions.token_issuer,\n\t audience: this.baseOptions.clientID,\n\t leeway: this.baseOptions.leeway || 0,\n\t __disableExpirationCheck: this.baseOptions.__disableExpirationCheck\n\t });\n\t\n\t verifier.verify(token, transactionNonce, function (err, payload) {\n\t if (err) {\n\t return cb(error.invalidJwt(err.message));\n\t }\n\t\n\t cb(null, {\n\t payload: payload,\n\t transaction: transaction\n\t });\n\t });\n\t};\n\t\n\t/**\n\t * Executes a silent authentication transaction under the hood in order to fetch a new token.\n\t *\n\t * @method renewAuth\n\t * @param {Object} options: any valid oauth2 parameter to be sent to the `/authorize` endpoint\n\t * @param {Function} cb\n\t */\n\tWebAuth.prototype.renewAuth = function (options, cb) {\n\t var handler;\n\t var prof;\n\t var usePostMessage = !!options.usePostMessage;\n\t var _this = this;\n\t\n\t var params = objectHelper.merge(this.baseOptions, [\n\t 'clientID',\n\t 'redirectUri',\n\t 'responseType',\n\t 'scope',\n\t 'audience'\n\t ]).with(options);\n\t\n\t params.responseType = params.responseType || 'token';\n\t params.responseMode = params.responseMode || 'fragment';\n\t\n\t params = this.transactionManager.process(params);\n\t\n\t assert.check(params, { type: 'object', message: 'options parameter is not valid' }, {\n\t scope: { type: 'string', message: 'scope option is required' },\n\t audience: { type: 'string', message: 'audience option is required' }\n\t });\n\t assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\t\n\t params.prompt = 'none';\n\t\n\t params = objectHelper.blacklist(params, ['usePostMessage', 'tenant']);\n\t\n\t handler = new SilentAuthenticationHandler(this, this.client.buildAuthorizeUrl(params));\n\t\n\t handler.login(usePostMessage, function (err, data) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t\n\t if (data.id_token) {\n\t return _this.validateToken(data.id_token, options.state, options.nonce, function (err, payload) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t\n\t data.idTokenPayload = payload;\n\t\n\t return cb(null, data);\n\t });\n\t }\n\t\n\t return cb(err, data);\n\t });\n\t};\n\t\n\t/**\n\t * Initialices a change password transaction\n\t *\n\t * @method changePassword\n\t * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password\n\t * @param {Function} cb\n\t */\n\tWebAuth.prototype.changePassword = function (options, cb) {\n\t return this.client.dbConnection.changePassword(options, cb);\n\t};\n\t\n\t/**\n\t * Initialices a passwordless authentication transaction\n\t *\n\t * @method passwordlessStart\n\t * @param {Object} options: https://auth0.com/docs/api/authentication#passwordless\n\t * @param {Object} options.type: `sms` or `email`\n\t * @param {Object} options.phoneNumber: only if type = sms\n\t * @param {Object} options.email: only if type = email\n\t * @param {Function} cb\n\t */\n\tWebAuth.prototype.passwordlessStart = function (options, cb) {\n\t return this.client.passwordless.start(options, cb);\n\t};\n\t\n\t/**\n\t * Signs up a new user\n\t *\n\t * @method signup\n\t * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup\n\t * @param {Function} cb\n\t */\n\tWebAuth.prototype.signup = function (options, cb) {\n\t return this.client.dbConnection.signup(options, cb);\n\t};\n\t\n\t/**\n\t * Redirects to the hosted login page (`/authorize`) in order to initialize a new authN/authZ transaction\n\t *\n\t * @method authorize\n\t * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db\n\t * @param {Function} cb\n\t */\n\tWebAuth.prototype.authorize = function (options) {\n\t var params = objectHelper.merge(this.baseOptions, [\n\t 'clientID',\n\t 'responseType',\n\t 'responseMode',\n\t 'redirectUri',\n\t 'scope',\n\t 'audience'\n\t ]).with(options);\n\t\n\t assert.check(params, { type: 'object', message: 'options parameter is not valid' }, {\n\t responseType: { type: 'string', message: 'responseType option is required' }\n\t });\n\t\n\t params = this.transactionManager.process(params);\n\t\n\t windowHelper.redirect(this.client.buildAuthorizeUrl(params));\n\t};\n\t\n\t/**\n\t * Signs up a new user, automatically logs the user in after the signup and returns the user token.\n\t * The login will be done using /oauth/token with password-realm grant type.\n\t *\n\t * @method signupAndAuthorize\n\t * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup\n\t * @param {Function} cb\n\t */\n\tWebAuth.prototype.signupAndAuthorize = function (options, cb) {\n\t var _this = this;\n\t\n\t return this.client.dbConnection.signup(objectHelper.blacklist(options, ['popupHandler']),\n\t function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t options.realm = options.connection;\n\t if (!options.username) {\n\t options.username = options.email;\n\t }\n\t _this.client.login(options, cb);\n\t });\n\t};\n\t\n\t/**\n\t * Redirects to the auth0 logout page\n\t *\n\t * @method logout\n\t * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--v2-logout\n\t */\n\tWebAuth.prototype.logout = function (options) {\n\t windowHelper.redirect(this.client.buildLogoutUrl(options));\n\t};\n\t\n\t/**\n\t * Verifies the passwordless TOTP and redirects to finish the passwordless transaction\n\t *\n\t * @method passwordlessVerify\n\t * @param {Object} options:\n\t * @param {Object} options.type: `sms` or `email`\n\t * @param {Object} options.phoneNumber: only if type = sms\n\t * @param {Object} options.email: only if type = email\n\t * @param {Object} options.connection: the connection name\n\t * @param {Object} options.verificationCode: the TOTP code\n\t * @param {Function} cb\n\t */\n\tWebAuth.prototype.passwordlessVerify = function (options, cb) {\n\t var _this = this;\n\t return this.client.passwordless.verify(options, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t return windowHelper.redirect(_this.client.passwordless.buildVerifyUrl(options));\n\t });\n\t};\n\t\n\tmodule.exports = WebAuth;\n\n\n/***/ },\n/* 46 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar urljoin = __webpack_require__(3);\n\t\n\tvar assert = __webpack_require__(4);\n\tvar responseHandler = __webpack_require__(5);\n\tvar PopupHandler = __webpack_require__(38);\n\tvar objectHelper = __webpack_require__(1);\n\tvar Warn = __webpack_require__(6);\n\tvar TransactionManager = __webpack_require__(17);\n\t\n\tfunction Popup(client, options) {\n\t this.baseOptions = options;\n\t this.client = client;\n\t\n\t this.transactionManager = new TransactionManager(this.baseOptions.transaction);\n\t this.warn = new Warn({\n\t disableWarnings: !!options._disableDeprecationWarnings\n\t });\n\t}\n\t\n\t/**\n\t * Initializes the popup window and returns the instance to be used later in order to avoid being blocked by the browser.\n\t *\n\t * @method preload\n\t * @param {Object} options: receives the window height and width and any other window feature to be sent to window.open\n\t */\n\tPopup.prototype.preload = function (options) {\n\t var popup = new PopupHandler();\n\t popup.preload(options || {});\n\t return popup;\n\t};\n\t\n\t/**\n\t * Internal use.\n\t *\n\t * @method getPopupHandler\n\t */\n\tPopup.prototype.getPopupHandler = function (options, preload) {\n\t if (options.popupHandler) {\n\t return options.popupHandler;\n\t }\n\t return !!preload ? this.preload(options) : new PopupHandler();\n\t};\n\t\n\t/**\n\t * Opens in a popup the hosted login page (`/authorize`) in order to initialize a new authN/authZ transaction\n\t *\n\t * @method authorize\n\t * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db\n\t * @param {Function} cb\n\t */\n\tPopup.prototype.authorize = function (options, cb) {\n\t var popup;\n\t var url;\n\t var relayUrl;\n\t\n\t var params = objectHelper.merge(this.baseOptions, [\n\t 'clientID',\n\t 'scope',\n\t 'audience',\n\t 'responseType'\n\t ]).with(objectHelper.blacklist(options, ['popupHandler']));\n\t\n\t assert.check(params, { type: 'object', message: 'options parameter is not valid' }, {\n\t responseType: { type: 'string', message: 'responseType option is required' }\n\t });\n\t\n\t // used by server to render the relay page instead of sending the chunk in the\n\t // url to the callback\n\t params.owp = true;\n\t\n\t params = this.transactionManager.process(params);\n\t\n\t url = this.client.buildAuthorizeUrl(params);\n\t\n\t popup = this.getPopupHandler(options);\n\t\n\t relayUrl = urljoin(this.baseOptions.rootUrl, 'relay.html');\n\t\n\t return popup.load(url, relayUrl, {}, responseHandler(cb));\n\t};\n\t\n\t/**\n\t * Initializes the legacy Lock login flow in a popup\n\t *\n\t * @method loginWithCredentials\n\t * @param {Object} options\n\t * @param {Function} cb\n\t * @deprecated `webauth.popup.loginWithCredentials` will be soon deprecated, use `webauth.client.login` instead.\n\t */\n\tPopup.prototype.loginWithCredentials = function (options, cb) {\n\t var params;\n\t var popup;\n\t var url;\n\t var relayUrl;\n\t\n\t this.warn.warning('`webauth.popup.loginWithCredentials` will be soon deprecated, use `webauth.client.login` instead.');\n\t\n\t /* eslint-disable */\n\t assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n\t clientID: { optional: true, type: 'string', message: 'clientID option is required' },\n\t redirectUri: { optional: true, type: 'string', message: 'redirectUri option is required' },\n\t responseType: { optional: true, type: 'string', message: 'responseType option is required' },\n\t scope: { optional: true, type: 'string', message: 'scope option is required' },\n\t audience: { optional: true, type: 'string', message: 'audience option is required' }\n\t });\n\t /* eslint-enable */\n\t\n\t popup = this.getPopupHandler(options);\n\t\n\t options = objectHelper.merge(this.baseOptions, [\n\t 'clientID',\n\t 'scope',\n\t 'domain',\n\t 'audience'\n\t ]).with(objectHelper.blacklist(options, ['popupHandler']));\n\t\n\t params = objectHelper.pick(options, ['clientID', 'domain']);\n\t params.options = objectHelper.toSnakeCase(\n\t objectHelper.blacklist(options, ['clientID', 'domain'])\n\t );\n\t\n\t url = urljoin(this.baseOptions.rootUrl, 'sso_dbconnection_popup', options.clientID);\n\t relayUrl = urljoin(this.baseOptions.rootUrl, 'relay.html');\n\t\n\t return popup.load(url, relayUrl, params, responseHandler(cb));\n\t};\n\t\n\t/**\n\t * Verifies the passwordless TOTP and returns the requested token\n\t *\n\t * @method passwordlessVerify\n\t * @param {Object} options:\n\t * @param {Object} options.type: `sms` or `email`\n\t * @param {Object} options.phoneNumber: only if type = sms\n\t * @param {Object} options.email: only if type = email\n\t * @param {Object} options.connection: the connection name\n\t * @param {Object} options.verificationCode: the TOTP code\n\t * @param {Function} cb\n\t */\n\tPopup.prototype.passwordlessVerify = function (options, cb) {\n\t var _this = this;\n\t return this.client.passwordless.verify(objectHelper.blacklist(options, ['popupHandler']),\n\t function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t\n\t options.username = options.phoneNumber || options.email;\n\t options.password = options.verificationCode;\n\t\n\t delete options.email;\n\t delete options.phoneNumber;\n\t delete options.verificationCode;\n\t delete options.type;\n\t\n\t _this.client.loginWithResourceOwner(options, cb);\n\t });\n\t};\n\t\n\t/**\n\t * Signs up a new user and automatically logs the user in after the signup.\n\t *\n\t * @method signupAndLogin\n\t * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup\n\t * @param {Function} cb\n\t */\n\tPopup.prototype.signupAndLogin = function (options, cb) {\n\t var _this = this;\n\t\n\t // Preload popup to avoid the browser to block it since the login happens later\n\t var popupHandler = this.getPopupHandler(options, true);\n\t options.popupHandler = popupHandler;\n\t\n\t return this.client.dbConnection.signup(objectHelper.blacklist(options, ['popupHandler']),\n\t function (err) {\n\t if (err) {\n\t if (popupHandler._current_popup) {\n\t popupHandler._current_popup.kill();\n\t }\n\t return cb(err);\n\t }\n\t _this.loginWithCredentials(options, cb);\n\t });\n\t};\n\t\n\tmodule.exports = Popup;\n\n/***/ },\n/* 47 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar UsernamePassword = __webpack_require__(49);\n\tvar objectHelper = __webpack_require__(1);\n\tvar Warn = __webpack_require__(6);\n\tvar assert = __webpack_require__(4);\n\t\n\tfunction Redirect(client, options) {\n\t this.baseOptions = options;\n\t this.client = client;\n\t\n\t this.warn = new Warn({\n\t disableWarnings: !!options._disableDeprecationWarnings\n\t });\n\t}\n\t\n\t/**\n\t * Initializes the legacy Lock login flow in redirect mode\n\t *\n\t * @method loginWithCredentials\n\t * @param {Object} options\n\t * @param {Function} cb\n\t * @deprecated `webauth.redirect.loginWithCredentials` will be soon deprecated, use `webauth.login` instead.\n\t */\n\tRedirect.prototype.loginWithCredentials = function (options, cb) {\n\t var usernamePassword;\n\t\n\t var params = objectHelper.merge(this.baseOptions, [\n\t 'clientID',\n\t 'redirectUri',\n\t 'tenant',\n\t 'responseType',\n\t 'responseMode',\n\t 'scope',\n\t 'audience'\n\t ]).with(options);\n\t\n\t this.warn.warning('`webauth.redirect.loginWithCredentials` will be soon deprecated, use `webauth.login` instead.');\n\t\n\t assert.check(params, { type: 'object', message: 'options parameter is not valid' }, {\n\t responseType: { type: 'string', message: 'responseType option is required' }\n\t });\n\t\n\t usernamePassword = new UsernamePassword(this.baseOptions);\n\t return usernamePassword.login(params, function (err, data) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t return usernamePassword.callback(data);\n\t });\n\t};\n\t\n\t/**\n\t * Signs up a new user and automatically logs the user in after the signup.\n\t *\n\t * @method signupAndLogin\n\t * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup\n\t * @param {Function} cb\n\t */\n\tRedirect.prototype.signupAndLogin = function (options, cb) {\n\t var _this = this;\n\t return this.client.dbConnection.signup(options, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t return _this.loginWithCredentials(options, cb);\n\t });\n\t};\n\t\n\tmodule.exports = Redirect;\n\n\n/***/ },\n/* 48 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar IframeHandler = __webpack_require__(35);\n\t\n\tfunction SilentAuthenticationHandler(auth0, authenticationUrl, timeout) {\n\t this.auth0 = auth0;\n\t this.authenticationUrl = authenticationUrl;\n\t this.timeout = timeout || 60 * 1000;\n\t this.handler = null;\n\t}\n\t\n\tSilentAuthenticationHandler.prototype.login = function (usePostMessage, callback) {\n\t this.handler = new IframeHandler({\n\t auth0: this.auth0,\n\t url: this.authenticationUrl,\n\t callback: callback,\n\t timeout: this.timeout,\n\t timeoutCallback: function () {\n\t callback({\n\t error: 'timeout',\n\t description: 'Timeout during authentication renew.'\n\t });\n\t },\n\t usePostMessage: usePostMessage || false\n\t });\n\t\n\t this.handler.init();\n\t};\n\t\n\tmodule.exports = SilentAuthenticationHandler;\n\n\n/***/ },\n/* 49 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar urljoin = __webpack_require__(3);\n\t\n\tvar objectHelper = __webpack_require__(1);\n\tvar RequestBuilder = __webpack_require__(9);\n\tvar responseHandler = __webpack_require__(5);\n\tvar windowHelper = __webpack_require__(2);\n\t\n\tfunction UsernamePassword(options) {\n\t this.baseOptions = options;\n\t this.request = new RequestBuilder(options);\n\t}\n\t\n\tUsernamePassword.prototype.login = function (options, cb) {\n\t var url;\n\t var body;\n\t\n\t url = urljoin(this.baseOptions.rootUrl, 'usernamepassword', 'login');\n\t\n\t options.username = options.username || options.email; // eslint-disable-line\n\t\n\t options = objectHelper.blacklist(options, ['email']); // eslint-disable-line\n\t\n\t body = objectHelper.merge(this.baseOptions, [\n\t 'clientID',\n\t 'redirectUri',\n\t 'tenant',\n\t 'responseType',\n\t 'responseMode',\n\t 'scope',\n\t 'audience'\n\t ]).with(options);\n\t\n\t body = objectHelper.toSnakeCase(body, ['auth0Client']);\n\t\n\t return this.request\n\t .post(url)\n\t .send(body)\n\t .end(responseHandler(cb));\n\t};\n\t\n\tUsernamePassword.prototype.callback = function (formHtml) {\n\t var div;\n\t var form;\n\t var _document = windowHelper.getDocument();\n\t\n\t div = _document.createElement('div');\n\t div.innerHTML = formHtml;\n\t form = _document.body.appendChild(div).children[0];\n\t\n\t form.submit();\n\t};\n\t\n\tmodule.exports = UsernamePassword;\n\n\n/***/ }\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// auth0.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 07074083df98c51f3f81","var Authentication = require('./authentication');\nvar Management = require('./management');\nvar WebAuth = require('./web-auth');\nvar version = require('./version');\n\nmodule.exports = {\n Authentication: Authentication,\n Management: Management,\n WebAuth: WebAuth,\n version: version.raw\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/index.js\n// module id = 0\n// module chunks = 0","/* eslint-disable no-param-reassign */\n\nvar objectAssign = require('./object-assign');\n\nfunction pick(object, keys) {\n return keys.reduce(function (prev, key) {\n if (object[key]) {\n prev[key] = object[key];\n }\n return prev;\n }, {});\n}\n\nfunction objectValues(obj) {\n var values = [];\n for (key in obj) {\n values.push(obj[key]);\n }\n return values;\n}\n\nfunction extend() {\n var params = objectValues(arguments);\n params.unshift({});\n return objectAssign.get().apply(undefined, params);\n}\n\nfunction merge(object, keys) {\n return {\n base: keys ? pick(object, keys) : object,\n with: function (object2, keys2) {\n object2 = keys2 ? pick(object2, keys2) : object2;\n return extend(this.base, object2);\n }\n };\n}\n\nfunction blacklist(object, blacklistedKeys) {\n return Object.keys(object).reduce(function (p, key) {\n if (blacklistedKeys.indexOf(key) === -1) {\n p[key] = object[key];\n }\n return p;\n }, {});\n}\n\nfunction camelToSnake(str) {\n var newKey = '';\n var index = 0;\n var code;\n var wasPrevNumber = true;\n var wasPrevUppercase = true;\n\n while (index < str.length) {\n code = str.charCodeAt(index);\n if ((!wasPrevUppercase && code >= 65 && code <= 90) || (!wasPrevNumber && code >= 48 && code <= 57)) {\n newKey += '_';\n newKey += str[index].toLowerCase();\n } else {\n newKey += str[index].toLowerCase();\n }\n wasPrevNumber = (code >= 48 && code <= 57);\n wasPrevUppercase = (code >= 65 && code <= 90);\n index++;\n }\n\n return newKey;\n}\n\nfunction snakeToCamel(str) {\n var parts = str.split('_');\n return parts.reduce(function (p, c) {\n return p + c.charAt(0).toUpperCase() + c.slice(1);\n }, parts.shift());\n}\n\nfunction toSnakeCase(object, exceptions) {\n exceptions = exceptions || [];\n\n return Object.keys(object).reduce(function (p, key) {\n var newKey = exceptions.indexOf(key) === -1 ? camelToSnake(key) : key;\n p[newKey] = typeof(object[key]) === 'object' ? toSnakeCase(object[key]) : object[key];\n return p;\n }, {});\n}\n\nfunction toCamelCase(object, exceptions) {\n exceptions = exceptions || [];\n\n return Object.keys(object).reduce(function (p, key) {\n var newKey = exceptions.indexOf(key) === -1 ? snakeToCamel(key) : key;\n p[newKey] = typeof(object[key]) === 'object' ? toCamelCase(object[key]) : object[key];\n return p;\n }, {});\n}\n\nmodule.exports = {\n toSnakeCase: toSnakeCase,\n toCamelCase: toCamelCase,\n blacklist: blacklist,\n merge: merge,\n pick: pick,\n extend: extend\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/object.js\n// module id = 1\n// module chunks = 0","function redirect(url) {\n global.window.location = url;\n}\n\nfunction getDocument() {\n return global.window.document;\n}\n\nfunction getWindow() {\n return global.window;\n}\n\nmodule.exports = {\n redirect: redirect,\n getDocument: getDocument,\n getWindow: getWindow\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/window.js\n// module id = 2\n// module chunks = 0","(function (name, context, definition) {\n if (typeof module !== 'undefined' && module.exports) module.exports = definition();\n else if (typeof define === 'function' && define.amd) define(definition);\n else context[name] = definition();\n})('urljoin', this, function () {\n\n function normalize (str, options) {\n\n // make sure protocol is followed by two slashes\n str = str.replace(/:\\//g, '://');\n\n // remove consecutive slashes\n str = str.replace(/([^:\\s])\\/+/g, '$1/');\n\n // remove trailing slash before parameters or hash\n str = str.replace(/\\/(\\?|&|#[^!])/g, '$1');\n\n // replace ? in parameters with &\n str = str.replace(/(\\?.+)\\?/g, '$1&');\n\n return str;\n }\n\n return function () {\n var input = arguments;\n var options = {};\n\n if (typeof arguments[0] === 'object') {\n // new syntax with array and options\n input = arguments[0];\n options = arguments[1] || {};\n }\n\n var joined = [].slice.call(input, 0).join('/');\n return normalize(joined, options);\n };\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/url-join/lib/url-join.js\n// module id = 3\n// module chunks = 0","var toString = Object.prototype.toString;\n\nfunction attribute(o, attr, type, text) {\n if (o && typeof o[attr] !== type) {\n throw new Error(text);\n }\n}\n\nfunction variable(o, type, text) {\n if (typeof o !== type) {\n throw new Error(text);\n }\n}\n\nfunction value(o, values, text) {\n if (values.indexOf(o) === -1) {\n throw new Error(text);\n }\n}\n\nfunction check(o, config, attributes) {\n if (!config.optional || o) {\n variable(o, config.type, config.message);\n }\n if (config.type === 'object' && attributes) {\n var keys = Object.keys(attributes);\n\n for (var index = 0; index < keys.length; index++ ) {\n var a = keys[index];\n if (!attributes[a].optional || o[a]) {\n if (!attributes[a].condition || attributes[a].condition(o)) {\n attribute(o, a, attributes[a].type, attributes[a].message);\n if (attributes[a].values) {\n value(o[a], attributes[a].values, attributes[a].value_message);\n }\n }\n }\n }\n\n }\n}\n\n/**\n * Wrap `Array.isArray` Polyfill for IE9\n * source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray\n *\n * @param {Array} array\n * @public\n */\nfunction isArray(array) {\n if (this.supportsIsArray()) {\n return Array.isArray(array);\n }\n\n return toString.call(array) === '[object Array]';\n}\n\nfunction supportsIsArray() {\n return (Array.isArray != null);\n}\n\nmodule.exports = {\n check: check,\n attribute: attribute,\n variable: variable,\n value: value,\n isArray: isArray,\n supportsIsArray: supportsIsArray\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/assert.js\n// module id = 4\n// module chunks = 0","var error = require('./error');\nvar objectHelper = require('./object');\n\nfunction wrapCallback(cb) {\n return function (err, data) {\n var errObj;\n\n if (!err && !data) {\n return cb(error.buildResponse('generic_error', 'Something went wrong'));\n }\n\n if (!err && data.err) {\n err = data.err;\n data = null;\n }\n\n if (err) {\n errObj = {\n original: err\n };\n\n if (err.response && err.response.statusCode) {\n errObj.statusCode = err.response.statusCode;\n }\n\n if (err.response && err.response.statusText) {\n errObj.statusText = err.response.statusText;\n }\n\n if (err.response && err.response.body) {\n err = err.response.body;\n }\n\n if (err.err) {\n err = err.err;\n }\n\n errObj.code = err.error || err.code || err.error_code || err.status || null;\n errObj.description = err.error_description || err.description || err.error || err.details || err.err || null;\n\n if (err.name) {\n errObj.name = err.name;\n }\n\n if (err.policy) {\n errObj.policy = err.policy;\n }\n\n return cb(errObj);\n }\n\n return cb(null, ((data.type && data.type === 'text/html') ? data.text : objectHelper.toCamelCase(data.body || data)));\n };\n}\n\nmodule.exports = wrapCallback;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/response-handler.js\n// module id = 5\n// module chunks = 0","function Warn(options) {\n this.disableWarnings = options.disableWarnings;\n}\n\nWarn.prototype.warning = function (message) {\n if (this.disableWarnings) {\n return;\n }\n\n console.warn(message);\n};\n\nmodule.exports = Warn;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/warn.js\n// module id = 6\n// module chunks = 0","/**\n * Check if `obj` is an object.\n *\n * @param {Object} obj\n * @return {Boolean}\n * @api private\n */\n\nfunction isObject(obj) {\n return null !== obj && 'object' === typeof obj;\n}\n\nmodule.exports = isObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/superagent/lib/is-object.js\n// module id = 7\n// module chunks = 0","function build(params) {\n return Object.keys(params).reduce(function (arr, key) {\n if (typeof params[key] !== 'undefined') {\n arr.push(key + '=' + encodeURIComponent(params[key]));\n }\n return arr;\n }, []).join('&');\n}\n\nfunction parse(qs) {\n return qs.split('&').reduce(function (prev, curr) {\n var param = curr.split('=');\n prev[param[0]] = param[1];\n return prev;\n }, {});\n}\n\nmodule.exports = {\n build: build,\n parse: parse\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/qs.js\n// module id = 8\n// module chunks = 0","/* eslint-disable no-param-reassign */\nvar request = require('superagent');\nvar base64Url = require('./base64_url');\nvar version = require('../version');\n\n// ------------------------------------------------ RequestWrapper\n\nfunction RequestWrapper(req) {\n this.request = req;\n this.method = req.method;\n this.url = req.url;\n this.body = req._data;\n this.headers = req._header;\n}\n\nRequestWrapper.prototype.abort = function () {\n this.request.abort();\n};\n\nRequestWrapper.prototype.getMethod = function () {\n return this.method;\n};\n\nRequestWrapper.prototype.getBody = function () {\n return this.body;\n};\n\nRequestWrapper.prototype.getUrl = function () {\n return this.url;\n};\n\nRequestWrapper.prototype.getHeaders = function () {\n return this.headers;\n};\n\n// ------------------------------------------------ RequestObj\n\nfunction RequestObj(req) {\n this.request = req;\n}\n\nRequestObj.prototype.set = function (key, value) {\n this.request = this.request.set(key, value);\n return this;\n};\n\nRequestObj.prototype.send = function (body) {\n this.request = this.request.send(body);\n return this;\n};\n\nRequestObj.prototype.withCredentials = function () {\n this.request = this.request.withCredentials();\n return this;\n};\n\nRequestObj.prototype.end = function (cb) {\n this.request = this.request.end(cb);\n return new RequestWrapper(this.request);\n};\n\n// ------------------------------------------------ RequestBuilder\n\nfunction RequestBuilder(options) {\n this._sendTelemetry = options._sendTelemetry === false ? options._sendTelemetry : true;\n this._telemetryInfo = options._telemetryInfo || null;\n this.headers = options.headers || {};\n}\n\nRequestBuilder.prototype.setCommonConfiguration = function (ongoingRequest, options) {\n options = options || {};\n\n if (options.noHeaders) {\n return ongoingRequest;\n }\n\n var headers = this.headers;\n ongoingRequest = ongoingRequest.set('Content-Type', 'application/json');\n\n var keys = Object.keys(this.headers);\n\n for (var a = 0; a < keys.length; a++) {\n ongoingRequest = ongoingRequest.set(keys[a], headers[keys[a]]);\n }\n\n if (this._sendTelemetry) {\n ongoingRequest = ongoingRequest.set('Auth0-Client', this.getTelemetryData());\n }\n return ongoingRequest;\n};\n\nRequestBuilder.prototype.getTelemetryData = function () {\n var clientInfo = this._telemetryInfo || { name: 'auth0.js', version: version.raw };\n var jsonClientInfo = JSON.stringify(clientInfo);\n return base64Url.encode(jsonClientInfo);\n};\n\nRequestBuilder.prototype.get = function (url, options) {\n return new RequestObj(this.setCommonConfiguration(request.get(url), options));\n};\n\nRequestBuilder.prototype.post = function (url, options) {\n return new RequestObj(this.setCommonConfiguration(request.post(url), options));\n};\n\nRequestBuilder.prototype.patch = function (url, options) {\n return new RequestObj(this.setCommonConfiguration(request.patch(url), options));\n};\n\nmodule.exports = RequestBuilder;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/request-builder.js\n// module id = 9\n// module chunks = 0","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction placeHoldersCount (b64) {\n var len = b64.length\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n}\n\nfunction byteLength (b64) {\n // base64 is 4/3 + up to two characters of the original data\n return b64.length * 3 / 4 - placeHoldersCount(b64)\n}\n\nfunction toByteArray (b64) {\n var i, j, l, tmp, placeHolders, arr\n var len = b64.length\n placeHolders = placeHoldersCount(b64)\n\n arr = new Arr(len * 3 / 4 - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0, j = 0; i < l; i += 4, j += 3) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xFF\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xFF\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3F]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3F]\n output += lookup[(tmp << 2) & 0x3F]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/base64-js/index.js\n// module id = 10\n// module chunks = 0","var base64 = require('base64-js');\n\nfunction padding(str) {\n var mod = (str.length % 4);\n var pad = 4 - mod;\n\n if (mod === 0) {\n return str;\n }\n\n return str + (new Array(1 + pad)).join('=');\n}\n\nfunction byteArrayToString(array) {\n var result = \"\";\n for (var i = 0; i < array.length; i++) {\n result += String.fromCharCode(array[i]);\n }\n return result;\n}\n\nfunction stringToByteArray(str) {\n var arr = new Array(str.length);\n for (var a = 0; a < str.length; a++) {\n arr[a] = str.charCodeAt(a);\n }\n return arr;\n}\n\nfunction byteArrayToHex(raw) {\n var HEX = '';\n\n for (var i = 0; i < raw.length; i++) {\n var _hex = raw[i].toString(16);\n HEX += (_hex.length === 2 ? _hex : '0' + _hex);\n }\n\n return HEX;\n}\n\nfunction encodeString(str) {\n return base64.fromByteArray(stringToByteArray(str))\n .replace(/\\+/g, '-') // Convert '+' to '-'\n .replace(/\\//g, '_'); // Convert '/' to '_'\n}\n\n\nfunction decodeToString(str) {\n str = padding(str)\n .replace(/\\-/g, '+') // Convert '-' to '+'\n .replace(/_/g, '/'); // Convert '_' to '/'\n\n return byteArrayToString(base64.toByteArray(str));\n}\n\n\nfunction decodeToHEX(str) {\n return byteArrayToHex(base64.toByteArray(padding(str)));\n}\n\nmodule.exports = {\n encodeString: encodeString,\n decodeToString: decodeToString,\n byteArrayToString: byteArrayToString,\n stringToByteArray: stringToByteArray,\n padding: padding,\n byteArrayToHex: byteArrayToHex,\n decodeToHEX: decodeToHEX\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/idtoken-verifier/src/helpers/base64.js\n// module id = 11\n// module chunks = 0","/**\n * Root reference for iframes.\n */\n\nvar root;\nif (typeof window !== 'undefined') { // Browser window\n root = window;\n} else if (typeof self !== 'undefined') { // Web Worker\n root = self;\n} else { // Other environments\n console.warn(\"Using browser-only version of superagent in non-browser environment\");\n root = this;\n}\n\nvar Emitter = require('emitter');\nvar RequestBase = require('./request-base');\nvar isObject = require('./is-object');\nvar isFunction = require('./is-function');\nvar ResponseBase = require('./response-base');\n\n/**\n * Noop.\n */\n\nfunction noop(){};\n\n/**\n * Expose `request`.\n */\n\nvar request = exports = module.exports = function(method, url) {\n // callback\n if ('function' == typeof url) {\n return new exports.Request('GET', method).end(url);\n }\n\n // url first\n if (1 == arguments.length) {\n return new exports.Request('GET', method);\n }\n\n return new exports.Request(method, url);\n}\n\nexports.Request = Request;\n\n/**\n * Determine XHR.\n */\n\nrequest.getXHR = function () {\n if (root.XMLHttpRequest\n && (!root.location || 'file:' != root.location.protocol\n || !root.ActiveXObject)) {\n return new XMLHttpRequest;\n } else {\n try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) {}\n try { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch(e) {}\n try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch(e) {}\n try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {}\n }\n throw Error(\"Browser-only verison of superagent could not find XHR\");\n};\n\n/**\n * Removes leading and trailing whitespace, added to support IE.\n *\n * @param {String} s\n * @return {String}\n * @api private\n */\n\nvar trim = ''.trim\n ? function(s) { return s.trim(); }\n : function(s) { return s.replace(/(^\\s*|\\s*$)/g, ''); };\n\n/**\n * Serialize the given `obj`.\n *\n * @param {Object} obj\n * @return {String}\n * @api private\n */\n\nfunction serialize(obj) {\n if (!isObject(obj)) return obj;\n var pairs = [];\n for (var key in obj) {\n pushEncodedKeyValuePair(pairs, key, obj[key]);\n }\n return pairs.join('&');\n}\n\n/**\n * Helps 'serialize' with serializing arrays.\n * Mutates the pairs array.\n *\n * @param {Array} pairs\n * @param {String} key\n * @param {Mixed} val\n */\n\nfunction pushEncodedKeyValuePair(pairs, key, val) {\n if (val != null) {\n if (Array.isArray(val)) {\n val.forEach(function(v) {\n pushEncodedKeyValuePair(pairs, key, v);\n });\n } else if (isObject(val)) {\n for(var subkey in val) {\n pushEncodedKeyValuePair(pairs, key + '[' + subkey + ']', val[subkey]);\n }\n } else {\n pairs.push(encodeURIComponent(key)\n + '=' + encodeURIComponent(val));\n }\n } else if (val === null) {\n pairs.push(encodeURIComponent(key));\n }\n}\n\n/**\n * Expose serialization method.\n */\n\n request.serializeObject = serialize;\n\n /**\n * Parse the given x-www-form-urlencoded `str`.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\nfunction parseString(str) {\n var obj = {};\n var pairs = str.split('&');\n var pair;\n var pos;\n\n for (var i = 0, len = pairs.length; i < len; ++i) {\n pair = pairs[i];\n pos = pair.indexOf('=');\n if (pos == -1) {\n obj[decodeURIComponent(pair)] = '';\n } else {\n obj[decodeURIComponent(pair.slice(0, pos))] =\n decodeURIComponent(pair.slice(pos + 1));\n }\n }\n\n return obj;\n}\n\n/**\n * Expose parser.\n */\n\nrequest.parseString = parseString;\n\n/**\n * Default MIME type map.\n *\n * superagent.types.xml = 'application/xml';\n *\n */\n\nrequest.types = {\n html: 'text/html',\n json: 'application/json',\n xml: 'application/xml',\n urlencoded: 'application/x-www-form-urlencoded',\n 'form': 'application/x-www-form-urlencoded',\n 'form-data': 'application/x-www-form-urlencoded'\n};\n\n/**\n * Default serialization map.\n *\n * superagent.serialize['application/xml'] = function(obj){\n * return 'generated xml here';\n * };\n *\n */\n\n request.serialize = {\n 'application/x-www-form-urlencoded': serialize,\n 'application/json': JSON.stringify\n };\n\n /**\n * Default parsers.\n *\n * superagent.parse['application/xml'] = function(str){\n * return { object parsed from str };\n * };\n *\n */\n\nrequest.parse = {\n 'application/x-www-form-urlencoded': parseString,\n 'application/json': JSON.parse\n};\n\n/**\n * Parse the given header `str` into\n * an object containing the mapped fields.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\nfunction parseHeader(str) {\n var lines = str.split(/\\r?\\n/);\n var fields = {};\n var index;\n var line;\n var field;\n var val;\n\n lines.pop(); // trailing CRLF\n\n for (var i = 0, len = lines.length; i < len; ++i) {\n line = lines[i];\n index = line.indexOf(':');\n field = line.slice(0, index).toLowerCase();\n val = trim(line.slice(index + 1));\n fields[field] = val;\n }\n\n return fields;\n}\n\n/**\n * Check if `mime` is json or has +json structured syntax suffix.\n *\n * @param {String} mime\n * @return {Boolean}\n * @api private\n */\n\nfunction isJSON(mime) {\n return /[\\/+]json\\b/.test(mime);\n}\n\n/**\n * Initialize a new `Response` with the given `xhr`.\n *\n * - set flags (.ok, .error, etc)\n * - parse header\n *\n * Examples:\n *\n * Aliasing `superagent` as `request` is nice:\n *\n * request = superagent;\n *\n * We can use the promise-like API, or pass callbacks:\n *\n * request.get('/').end(function(res){});\n * request.get('/', function(res){});\n *\n * Sending data can be chained:\n *\n * request\n * .post('/user')\n * .send({ name: 'tj' })\n * .end(function(res){});\n *\n * Or passed to `.send()`:\n *\n * request\n * .post('/user')\n * .send({ name: 'tj' }, function(res){});\n *\n * Or passed to `.post()`:\n *\n * request\n * .post('/user', { name: 'tj' })\n * .end(function(res){});\n *\n * Or further reduced to a single call for simple cases:\n *\n * request\n * .post('/user', { name: 'tj' }, function(res){});\n *\n * @param {XMLHTTPRequest} xhr\n * @param {Object} options\n * @api private\n */\n\nfunction Response(req, options) {\n options = options || {};\n this.req = req;\n this.xhr = this.req.xhr;\n // responseText is accessible only if responseType is '' or 'text' and on older browsers\n this.text = ((this.req.method !='HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text')) || typeof this.xhr.responseType === 'undefined')\n ? this.xhr.responseText\n : null;\n this.statusText = this.req.xhr.statusText;\n var status = this.xhr.status;\n // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request\n if (status === 1223) {\n status = 204;\n }\n this._setStatusProperties(status);\n this.header = this.headers = parseHeader(this.xhr.getAllResponseHeaders());\n // getAllResponseHeaders sometimes falsely returns \"\" for CORS requests, but\n // getResponseHeader still works. so we get content-type even if getting\n // other headers fails.\n this.header['content-type'] = this.xhr.getResponseHeader('content-type');\n this._setHeaderProperties(this.header);\n\n if (null === this.text && req._responseType) {\n this.body = this.xhr.response;\n } else {\n this.body = this.req.method != 'HEAD'\n ? this._parseBody(this.text ? this.text : this.xhr.response)\n : null;\n }\n}\n\nResponseBase(Response.prototype);\n\n/**\n * Parse the given body `str`.\n *\n * Used for auto-parsing of bodies. Parsers\n * are defined on the `superagent.parse` object.\n *\n * @param {String} str\n * @return {Mixed}\n * @api private\n */\n\nResponse.prototype._parseBody = function(str){\n var parse = request.parse[this.type];\n if(this.req._parser) {\n return this.req._parser(this, str);\n }\n if (!parse && isJSON(this.type)) {\n parse = request.parse['application/json'];\n }\n return parse && str && (str.length || str instanceof Object)\n ? parse(str)\n : null;\n};\n\n/**\n * Return an `Error` representative of this response.\n *\n * @return {Error}\n * @api public\n */\n\nResponse.prototype.toError = function(){\n var req = this.req;\n var method = req.method;\n var url = req.url;\n\n var msg = 'cannot ' + method + ' ' + url + ' (' + this.status + ')';\n var err = new Error(msg);\n err.status = this.status;\n err.method = method;\n err.url = url;\n\n return err;\n};\n\n/**\n * Expose `Response`.\n */\n\nrequest.Response = Response;\n\n/**\n * Initialize a new `Request` with the given `method` and `url`.\n *\n * @param {String} method\n * @param {String} url\n * @api public\n */\n\nfunction Request(method, url) {\n var self = this;\n this._query = this._query || [];\n this.method = method;\n this.url = url;\n this.header = {}; // preserves header name case\n this._header = {}; // coerces header names to lowercase\n this.on('end', function(){\n var err = null;\n var res = null;\n\n try {\n res = new Response(self);\n } catch(e) {\n err = new Error('Parser is unable to parse the response');\n err.parse = true;\n err.original = e;\n // issue #675: return the raw response if the response parsing fails\n if (self.xhr) {\n // ie9 doesn't have 'response' property\n err.rawResponse = typeof self.xhr.responseType == 'undefined' ? self.xhr.responseText : self.xhr.response;\n // issue #876: return the http status code if the response parsing fails\n err.status = self.xhr.status ? self.xhr.status : null;\n err.statusCode = err.status; // backwards-compat only\n } else {\n err.rawResponse = null;\n err.status = null;\n }\n\n return self.callback(err);\n }\n\n self.emit('response', res);\n\n var new_err;\n try {\n if (!self._isResponseOK(res)) {\n new_err = new Error(res.statusText || 'Unsuccessful HTTP response');\n new_err.original = err;\n new_err.response = res;\n new_err.status = res.status;\n }\n } catch(e) {\n new_err = e; // #985 touching res may cause INVALID_STATE_ERR on old Android\n }\n\n // #1000 don't catch errors from the callback to avoid double calling it\n if (new_err) {\n self.callback(new_err, res);\n } else {\n self.callback(null, res);\n }\n });\n}\n\n/**\n * Mixin `Emitter` and `RequestBase`.\n */\n\nEmitter(Request.prototype);\nRequestBase(Request.prototype);\n\n/**\n * Set Content-Type to `type`, mapping values from `request.types`.\n *\n * Examples:\n *\n * superagent.types.xml = 'application/xml';\n *\n * request.post('/')\n * .type('xml')\n * .send(xmlstring)\n * .end(callback);\n *\n * request.post('/')\n * .type('application/xml')\n * .send(xmlstring)\n * .end(callback);\n *\n * @param {String} type\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.type = function(type){\n this.set('Content-Type', request.types[type] || type);\n return this;\n};\n\n/**\n * Set Accept to `type`, mapping values from `request.types`.\n *\n * Examples:\n *\n * superagent.types.json = 'application/json';\n *\n * request.get('/agent')\n * .accept('json')\n * .end(callback);\n *\n * request.get('/agent')\n * .accept('application/json')\n * .end(callback);\n *\n * @param {String} accept\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.accept = function(type){\n this.set('Accept', request.types[type] || type);\n return this;\n};\n\n/**\n * Set Authorization field value with `user` and `pass`.\n *\n * @param {String} user\n * @param {String} pass\n * @param {Object} options with 'type' property 'auto' or 'basic' (default 'basic')\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.auth = function(user, pass, options){\n if (!options) {\n options = {\n type: 'function' === typeof btoa ? 'basic' : 'auto',\n }\n }\n\n switch (options.type) {\n case 'basic':\n this.set('Authorization', 'Basic ' + btoa(user + ':' + pass));\n break;\n\n case 'auto':\n this.username = user;\n this.password = pass;\n break;\n }\n return this;\n};\n\n/**\n* Add query-string `val`.\n*\n* Examples:\n*\n* request.get('/shoes')\n* .query('size=10')\n* .query({ color: 'blue' })\n*\n* @param {Object|String} val\n* @return {Request} for chaining\n* @api public\n*/\n\nRequest.prototype.query = function(val){\n if ('string' != typeof val) val = serialize(val);\n if (val) this._query.push(val);\n return this;\n};\n\n/**\n * Queue the given `file` as an attachment to the specified `field`,\n * with optional `options` (or filename).\n *\n * ``` js\n * request.post('/upload')\n * .attach('content', new Blob(['hey!'], { type: \"text/html\"}))\n * .end(callback);\n * ```\n *\n * @param {String} field\n * @param {Blob|File} file\n * @param {String|Object} options\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.attach = function(field, file, options){\n if (this._data) {\n throw Error(\"superagent can't mix .send() and .attach()\");\n }\n\n this._getFormData().append(field, file, options || file.name);\n return this;\n};\n\nRequest.prototype._getFormData = function(){\n if (!this._formData) {\n this._formData = new root.FormData();\n }\n return this._formData;\n};\n\n/**\n * Invoke the callback with `err` and `res`\n * and handle arity check.\n *\n * @param {Error} err\n * @param {Response} res\n * @api private\n */\n\nRequest.prototype.callback = function(err, res){\n var fn = this._callback;\n this.clearTimeout();\n\n if (err) {\n this.emit('error', err);\n }\n\n fn(err, res);\n};\n\n/**\n * Invoke callback with x-domain error.\n *\n * @api private\n */\n\nRequest.prototype.crossDomainError = function(){\n var err = new Error('Request has been terminated\\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.');\n err.crossDomain = true;\n\n err.status = this.status;\n err.method = this.method;\n err.url = this.url;\n\n this.callback(err);\n};\n\n// This only warns, because the request is still likely to work\nRequest.prototype.buffer = Request.prototype.ca = Request.prototype.agent = function(){\n console.warn(\"This is not supported in browser version of superagent\");\n return this;\n};\n\n// This throws, because it can't send/receive data as expected\nRequest.prototype.pipe = Request.prototype.write = function(){\n throw Error(\"Streaming is not supported in browser version of superagent\");\n};\n\n/**\n * Compose querystring to append to req.url\n *\n * @api private\n */\n\nRequest.prototype._appendQueryString = function(){\n var query = this._query.join('&');\n if (query) {\n this.url += (this.url.indexOf('?') >= 0 ? '&' : '?') + query;\n }\n\n if (this._sort) {\n var index = this.url.indexOf('?');\n if (index >= 0) {\n var queryArr = this.url.substring(index + 1).split('&');\n if (isFunction(this._sort)) {\n queryArr.sort(this._sort);\n } else {\n queryArr.sort();\n }\n this.url = this.url.substring(0, index) + '?' + queryArr.join('&');\n }\n }\n};\n\n/**\n * Check if `obj` is a host object,\n * we don't want to serialize these :)\n *\n * @param {Object} obj\n * @return {Boolean}\n * @api private\n */\nRequest.prototype._isHost = function _isHost(obj) {\n // Native objects stringify to [object File], [object Blob], [object FormData], etc.\n return obj && 'object' === typeof obj && !Array.isArray(obj) && Object.prototype.toString.call(obj) !== '[object Object]';\n}\n\n/**\n * Initiate request, invoking callback `fn(res)`\n * with an instanceof `Response`.\n *\n * @param {Function} fn\n * @return {Request} for chaining\n * @api public\n */\n\nRequest.prototype.end = function(fn){\n var self = this;\n var xhr = this.xhr = request.getXHR();\n var data = this._formData || this._data;\n\n if (this._endCalled) {\n console.warn(\"Warning: .end() was called twice. This is not supported in superagent\");\n }\n this._endCalled = true;\n\n // store callback\n this._callback = fn || noop;\n\n // state change\n xhr.onreadystatechange = function(){\n var readyState = xhr.readyState;\n if (readyState >= 2 && self._responseTimeoutTimer) {\n clearTimeout(self._responseTimeoutTimer);\n }\n if (4 != readyState) {\n return;\n }\n\n // In IE9, reads to any property (e.g. status) off of an aborted XHR will\n // result in the error \"Could not complete the operation due to error c00c023f\"\n var status;\n try { status = xhr.status } catch(e) { status = 0; }\n\n if (!status) {\n if (self.timedout || self._aborted) return;\n return self.crossDomainError();\n }\n self.emit('end');\n };\n\n // progress\n var handleProgress = function(direction, e) {\n if (e.total > 0) {\n e.percent = e.loaded / e.total * 100;\n }\n e.direction = direction;\n self.emit('progress', e);\n }\n if (this.hasListeners('progress')) {\n try {\n xhr.onprogress = handleProgress.bind(null, 'download');\n if (xhr.upload) {\n xhr.upload.onprogress = handleProgress.bind(null, 'upload');\n }\n } catch(e) {\n // Accessing xhr.upload fails in IE from a web worker, so just pretend it doesn't exist.\n // Reported here:\n // https://connect.microsoft.com/IE/feedback/details/837245/xmlhttprequest-upload-throws-invalid-argument-when-used-from-web-worker-context\n }\n }\n\n // querystring\n this._appendQueryString();\n\n this._setTimeouts();\n\n // initiate request\n if (this.username && this.password) {\n xhr.open(this.method, this.url, true, this.username, this.password);\n } else {\n xhr.open(this.method, this.url, true);\n }\n\n // CORS\n if (this._withCredentials) xhr.withCredentials = true;\n\n // body\n if (!this._formData && 'GET' != this.method && 'HEAD' != this.method && 'string' != typeof data && !this._isHost(data)) {\n // serialize stuff\n var contentType = this._header['content-type'];\n var serialize = this._serializer || request.serialize[contentType ? contentType.split(';')[0] : ''];\n if (!serialize && isJSON(contentType)) {\n serialize = request.serialize['application/json'];\n }\n if (serialize) data = serialize(data);\n }\n\n // set header fields\n for (var field in this.header) {\n if (null == this.header[field]) continue;\n xhr.setRequestHeader(field, this.header[field]);\n }\n\n if (this._responseType) {\n xhr.responseType = this._responseType;\n }\n\n // send stuff\n this.emit('request', this);\n\n // IE11 xhr.send(undefined) sends 'undefined' string as POST payload (instead of nothing)\n // We need null here if data is undefined\n xhr.send(typeof data !== 'undefined' ? data : null);\n return this;\n};\n\n/**\n * GET `url` with optional callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed|Function} [data] or fn\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.get = function(url, data, fn){\n var req = request('GET', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.query(data);\n if (fn) req.end(fn);\n return req;\n};\n\n/**\n * HEAD `url` with optional callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed|Function} [data] or fn\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.head = function(url, data, fn){\n var req = request('HEAD', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.send(data);\n if (fn) req.end(fn);\n return req;\n};\n\n/**\n * OPTIONS query to `url` with optional callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed|Function} [data] or fn\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.options = function(url, data, fn){\n var req = request('OPTIONS', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.send(data);\n if (fn) req.end(fn);\n return req;\n};\n\n/**\n * DELETE `url` with optional callback `fn(res)`.\n *\n * @param {String} url\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nfunction del(url, fn){\n var req = request('DELETE', url);\n if (fn) req.end(fn);\n return req;\n};\n\nrequest['del'] = del;\nrequest['delete'] = del;\n\n/**\n * PATCH `url` with optional `data` and callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed} [data]\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.patch = function(url, data, fn){\n var req = request('PATCH', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.send(data);\n if (fn) req.end(fn);\n return req;\n};\n\n/**\n * POST `url` with optional `data` and callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed} [data]\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.post = function(url, data, fn){\n var req = request('POST', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.send(data);\n if (fn) req.end(fn);\n return req;\n};\n\n/**\n * PUT `url` with optional `data` and callback `fn(res)`.\n *\n * @param {String} url\n * @param {Mixed|Function} [data] or fn\n * @param {Function} [fn]\n * @return {Request}\n * @api public\n */\n\nrequest.put = function(url, data, fn){\n var req = request('PUT', url);\n if ('function' == typeof data) fn = data, data = null;\n if (data) req.send(data);\n if (fn) req.end(fn);\n return req;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/superagent/lib/client.js\n// module id = 12\n// module chunks = 0","var urljoin = require('url-join');\n\nvar RequestBuilder = require('../helper/request-builder');\nvar qs = require('../helper/qs');\nvar objectHelper = require('../helper/object');\nvar assert = require('../helper/assert');\nvar responseHandler = require('../helper/response-handler');\nvar parametersWhitelist = require('../helper/parameters-whitelist');\nvar Warn = require('../helper/warn');\n\nvar PasswordlessAuthentication = require('./passwordless-authentication');\nvar DBConnection = require('./db-connection');\n\n/**\n * Auth0 Authentication API client\n * @constructor\n * @param {Object} options\n * @param {Object} options.domain\n * @param {Object} options.clienID\n * @param {Object} options.responseType\n * @param {Object} options.responseMode\n * @param {Object} options.scope\n * @param {Object} options.audience\n * @param {Object} options._disableDeprecationWarnings\n */\nfunction Authentication(options) {\n /* eslint-disable */\n assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n domain: { type: 'string', message: 'domain option is required' },\n clientID: { type: 'string', message: 'clientID option is required' },\n responseType: { optional: true, type: 'string', message: 'responseType is not valid' },\n responseMode: { optional: true, type: 'string', message: 'responseMode is not valid' },\n redirectUri: { optional: true, type: 'string', message: 'redirectUri is not valid' },\n scope: { optional: true, type: 'string', message: 'scope is not valid' },\n audience: { optional: true, type: 'string', message: 'audience is not valid' },\n _disableDeprecationWarnings: { optional: true, type: 'boolean', message: '_disableDeprecationWarnings option is not valid' },\n _sendTelemetry: { optional: true, type: 'boolean', message: '_sendTelemetry option is not valid' },\n _telemetryInfo: { optional: true, type: 'object', message: '_telemetryInfo option is not valid' }\n });\n /* eslint-enable */\n\n this.baseOptions = options;\n\n this.baseOptions._sendTelemetry = this.baseOptions._sendTelemetry === false ?\n this.baseOptions._sendTelemetry : true;\n\n this.baseOptions.rootUrl = 'https://' + this.baseOptions.domain;\n\n this.request = new RequestBuilder(this.baseOptions);\n\n this.passwordless = new PasswordlessAuthentication(this.request, this.baseOptions);\n this.dbConnection = new DBConnection(this.request, this.baseOptions);\n\n this.warn = new Warn({\n disableWarnings: !!options._disableDeprecationWarnings\n });\n}\n\n/**\n * Builds and returns the `/authorize` url in order to initialize a new authN/authZ transaction\n *\n * @method buildAuthorizeUrl\n * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db\n * @param {Function} cb\n */\nAuthentication.prototype.buildAuthorizeUrl = function (options) {\n var params;\n var qString;\n\n assert.check(options, { type: 'object', message: 'options parameter is not valid' });\n\n params = objectHelper.merge(this.baseOptions, [\n 'clientID',\n 'responseType',\n 'responseMode',\n 'redirectUri',\n 'scope',\n 'audience'\n ]).with(options);\n\n /* eslint-disable */\n assert.check(params, { type: 'object', message: 'options parameter is not valid' }, {\n clientID: { type: 'string', message: 'clientID option is required' },\n redirectUri: { type: 'string', message: 'redirectUri option is required' },\n responseType: { type: 'string', message: 'responseType option is required' },\n nonce: { type: 'string', message: 'nonce option is required', condition: function(o) {\n return o.responseType.indexOf('code') === -1 && o.responseType.indexOf('id_token') !== -1;\n } },\n state: { type: 'string', message: 'state option is required', condition: function(o) {\n return o.responseType.indexOf('code') === -1;\n } },\n scope: { optional: true, type: 'string', message: 'scope option is required' },\n audience: { optional: true, type: 'string', message: 'audience option is required' }\n });\n /* eslint-enable */\n\n // eslint-disable-next-line\n if (this.baseOptions._sendTelemetry) {\n params.auth0Client = this.request.getTelemetryData();\n }\n\n if (params.connection_scope && assert.isArray(params.connection_scope)) {\n params.connection_scope = params.connection_scope.join(',');\n }\n\n params = objectHelper.toSnakeCase(params, ['auth0Client']);\n params = parametersWhitelist.oauthAuthorizeParams(params);\n\n qString = qs.build(params);\n\n return urljoin(this.baseOptions.rootUrl, 'authorize', '?' + qString);\n};\n\n/**\n * Builds and returns the Logout url in order to initialize a new authN/authZ transaction\n *\n * @method buildLogoutUrl\n * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--v2-logout\n */\nAuthentication.prototype.buildLogoutUrl = function (options) {\n var params;\n var qString;\n\n assert.check(options, {\n optional: true,\n type: 'object',\n message: 'options parameter is not valid'\n });\n\n params = objectHelper.merge(this.baseOptions, ['clientID'])\n .with(options || {});\n\n // eslint-disable-next-line\n if (this.baseOptions._sendTelemetry) {\n params.auth0Client = this.request.getTelemetryData();\n }\n\n params = objectHelper.toSnakeCase(params, ['auth0Client', 'returnTo']);\n\n qString = qs.build(params);\n\n return urljoin(this.baseOptions.rootUrl, 'v2', 'logout', '?' + qString);\n};\n\n/**\n * Makes a call to the `oauth/token` endpoint with `password` grant type\n *\n * @method loginWithDefaultDirectory\n * @param {Object} options: https://auth0.com/docs/api-auth/grant/password\n * @param {Function} cb\n */\nAuthentication.prototype.loginWithDefaultDirectory = function (options, cb) {\n assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n username: { type: 'string', message: 'username option is required' },\n password: { type: 'string', message: 'password option is required' },\n scope: { optional: true, type: 'string', message: 'scope option is required' },\n audience: { optional: true, type: 'string', message: 'audience option is required' }\n });\n\n options.grantType = 'password';\n\n return this.oauthToken(options, cb);\n};\n\n/**\n * Makes a call to the `oauth/token` endpoint with `password-realm` grant type\n *\n * @method login\n * @param {Object} options:\n * @param {Object} options.username\n * @param {Object} options.password\n * @param {Object} options.scope\n * @param {Object} options.audience\n * @param {Object} options.realm: the HRD domain or the connection name\n * @param {Function} cb\n */\nAuthentication.prototype.login = function (options, cb) {\n assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n username: { type: 'string', message: 'username option is required' },\n password: { type: 'string', message: 'password option is required' },\n realm: { type: 'string', message: 'realm option is required' },\n scope: { optional: true, type: 'string', message: 'scope option is required' },\n audience: { optional: true, type: 'string', message: 'audience option is required' }\n });\n\n options.grantType = 'http://auth0.com/oauth/grant-type/password-realm';\n\n return this.oauthToken(options, cb);\n};\n\n/**\n * Makes a call to the `oauth/token` endpoint\n *\n * @method oauthToken\n * @param {Object} options:\n * @param {Object} options.username\n * @param {Object} options.password\n * @param {Object} options.scope\n * @param {Object} options.audience\n * @param {Object} options.grantType\n * @param {Function} cb\n */\nAuthentication.prototype.oauthToken = function (options, cb) {\n var url;\n var body;\n\n assert.check(options, { type: 'object', message: 'options parameter is not valid' });\n assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\n url = urljoin(this.baseOptions.rootUrl, 'oauth', 'token');\n\n body = objectHelper.merge(this.baseOptions, [\n 'clientID',\n 'scope',\n 'audience'\n ]).with(options);\n\n assert.check(body, { type: 'object', message: 'options parameter is not valid' }, {\n clientID: { type: 'string', message: 'clientID option is required' },\n grantType: { type: 'string', message: 'grantType option is required' },\n scope: { optional: true, type: 'string', message: 'scope option is required' },\n audience: { optional: true, type: 'string', message: 'audience option is required' }\n });\n\n body = objectHelper.toSnakeCase(body, ['auth0Client']);\n body = parametersWhitelist.oauthTokenParams(body);\n\n body.grant_type = body.grant_type;\n\n return this.request\n .post(url)\n .send(body)\n .end(responseHandler(cb));\n};\n\n/**\n * Makes a call to the `/ro` endpoint\n *\n * @method loginWithResourceOwner\n * @param {Object} options:\n * @param {Object} options.username\n * @param {Object} options.password\n * @param {Object} options.connection\n * @param {Object} options.scope\n * @param {Object} options.audience\n * @param {Function} cb\n * @deprecated `loginWithResourceOwner` will be soon deprecated, user `login` instead.\n */\nAuthentication.prototype.loginWithResourceOwner = function (options, cb) {\n var url;\n var body;\n\n this.warn.warning('`loginWithResourceOwner` will be soon deprecated, user `login` instead.');\n\n assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n username: { type: 'string', message: 'username option is required' },\n password: { type: 'string', message: 'password option is required' },\n connection: { type: 'string', message: 'connection option is required' },\n scope: { optional: true, type: 'string', message: 'scope option is required' },\n audience: { optional: true, type: 'string', message: 'audience option is required' }\n });\n assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\n url = urljoin(this.baseOptions.rootUrl, 'oauth', 'ro');\n\n body = objectHelper.merge(this.baseOptions, [\n 'clientID',\n 'scope',\n 'audience'\n ]).with(options);\n\n body = objectHelper.toSnakeCase(body, ['auth0Client']);\n\n body.grant_type = body.grant_type || 'password';\n\n return this.request\n .post(url)\n .send(body)\n .end(responseHandler(cb));\n};\n\n/**\n * Makes a call to the `/ssodata` endpoint\n *\n * @method getSSOData\n * @param {Boolean} withActiveDirectories\n * @param {Function} cb\n * @deprecated `getSSOData` will be soon deprecated.\n */\nAuthentication.prototype.getSSOData = function (withActiveDirectories, cb) {\n var url;\n var params = '';\n\n this.warn.warning('`getSSOData` will be soon deprecated.');\n\n if (typeof withActiveDirectories === 'function') {\n cb = withActiveDirectories;\n withActiveDirectories = false;\n }\n\n assert.check(withActiveDirectories, { type: 'boolean', message: 'withActiveDirectories parameter is not valid' });\n assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\n if (withActiveDirectories) {\n params = '?' + qs.build({\n ldaps: 1,\n client_id: this.baseOptions.clientID\n });\n }\n\n url = urljoin(this.baseOptions.rootUrl, 'user', 'ssodata', params);\n\n return this.request\n .get(url, {noHeaders: true})\n .withCredentials()\n .end(responseHandler(cb));\n};\n\n/**\n * Makes a call to the `/userinfo` endpoint and returns the user profile\n *\n * @method userInfo\n * @param {String} accessToken\n * @param {Function} cb\n */\nAuthentication.prototype.userInfo = function (accessToken, cb) {\n var url;\n\n assert.check(accessToken, { type: 'string', message: 'accessToken parameter is not valid' });\n assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\n url = urljoin(this.baseOptions.rootUrl, 'userinfo');\n\n return this.request\n .get(url)\n .set('Authorization', 'Bearer ' + accessToken)\n .end(responseHandler(cb));\n};\n\n/**\n * Makes a call to the `/delegation` endpoint\n *\n * @method delegation\n * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--delegation\n * @param {Function} cb\n * @deprecated `delegation` will be soon deprecated.\n */\nAuthentication.prototype.delegation = function (options, cb) {\n var url;\n var body;\n\n this.warn.warning('`delegation` will be soon deprecated.');\n\n assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n grant_type: { type: 'string', message: 'grant_type option is required' }\n });\n assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\n url = urljoin(this.baseOptions.rootUrl, 'delegation');\n\n body = objectHelper.merge(this.baseOptions, ['clientID'])\n .with(options);\n\n body = objectHelper.toSnakeCase(body, ['auth0Client']);\n\n return this.request\n .post(url)\n .send(body)\n .end(responseHandler(cb));\n};\n\n/**\n * Fetches the user country based on the ip.\n *\n * @method getUserCountry\n * @param {Function} cb\n */\nAuthentication.prototype.getUserCountry = function (cb) {\n var url;\n\n assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\n url = urljoin(this.baseOptions.rootUrl, 'user', 'geoloc', 'country');\n\n return this.request\n .get(url)\n .end(responseHandler(cb));\n};\n\nmodule.exports = Authentication;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/authentication/index.js\n// module id = 13\n// module chunks = 0","var base64 = require('base64-js');\n\nfunction padding(str) {\n var mod = (str.length % 4);\n var pad = 4 - mod;\n\n if (mod === 0) {\n return str;\n }\n\n return str + (new Array(1 + pad)).join('=');\n}\n\nfunction stringToByteArray(str) {\n var arr = new Array(str.length);\n for (var a = 0; a < str.length; a++) {\n arr[a] = str.charCodeAt(a);\n }\n return arr;\n}\n\nfunction byteArrayToString(array) {\n var result = \"\";\n for (var i = 0; i < array.length; i++) {\n result += String.fromCharCode(array[i]);\n }\n return result;\n}\n\nfunction encode(str) {\n return base64.fromByteArray(stringToByteArray(str))\n .replace(/\\+/g, '-') // Convert '+' to '-'\n .replace(/\\//g, '_'); // Convert '/' to '_'\n}\n\nfunction decode(str) {\n str = padding(str)\n .replace(/\\-/g, '+') // Convert '-' to '+'\n .replace(/_/g, '/'); // Convert '_' to '/'\n\n return byteArrayToString(base64.toByteArray(str));\n}\n\nmodule.exports = {\n encode: encode,\n decode: decode\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/base64_url.js\n// module id = 14\n// module chunks = 0","function buildResponse(error, description) {\n return {\n error: error,\n errorDescription: description\n };\n}\n\nfunction invalidJwt(description) {\n return buildResponse('invalid_token', description);\n}\n\nmodule.exports = {\n buildResponse: buildResponse,\n invalidJwt: invalidJwt\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/error.js\n// module id = 15\n// module chunks = 0","module.exports = {raw:\"8.0.3\"};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/version.js\n// module id = 16\n// module chunks = 0","var random = require('../helper/random');\nvar storage = require('../helper/storage');\n\nvar DEFAULT_NAMESPACE = 'com.auth0.auth.';\n\nfunction TransactionManager(options) {\n options = options || {};\n this.namespace = options.namespace || DEFAULT_NAMESPACE;\n this.keyLength = options.keyLength || 32;\n}\n\nTransactionManager.prototype.process = function (options) {\n var transaction;\n\n if (options.responseType.indexOf('code') !== -1) {\n return options;\n }\n\n if (options.responseType.indexOf('id_token') !== -1 && !!options.nonce) {\n return options;\n }\n\n transaction = this.generateTransaction(options.appState, options.state, options.nonce);\n\n options.state = transaction.state;\n\n if (options.responseType.indexOf('id_token') !== -1) {\n options.nonce = transaction.nonce;\n }\n\n return options;\n};\n\nTransactionManager.prototype.generateTransaction = function (appState, state, nonce) {\n var transaction;\n var nonce;\n\n transaction = state || random.randomString(this.keyLength);\n nonce = nonce || random.randomString(this.keyLength);\n\n storage.setItem(this.namespace + transaction, {\n nonce:nonce,\n appState: appState\n });\n\n return {\n state: transaction,\n nonce: nonce\n };\n};\n\nTransactionManager.prototype.getStoredTransaction = function (transaction) {\n var transactionData;\n\n transactionData = storage.getItem(this.namespace + transaction);\n storage.removeItem(this.namespace + transaction);\n return transactionData;\n};\n\nmodule.exports = TransactionManager;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/web-auth/transaction-manager.js\n// module id = 17\n// module chunks = 0",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory();\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory();\n\t}\n}(this, function () {\n\n\t/**\n\t * CryptoJS core components.\n\t */\n\tvar CryptoJS = CryptoJS || (function (Math, undefined) {\n\t /*\n\t * Local polyfil of Object.create\n\t */\n\t var create = Object.create || (function () {\n\t function F() {};\n\n\t return function (obj) {\n\t var subtype;\n\n\t F.prototype = obj;\n\n\t subtype = new F();\n\n\t F.prototype = null;\n\n\t return subtype;\n\t };\n\t }())\n\n\t /**\n\t * CryptoJS namespace.\n\t */\n\t var C = {};\n\n\t /**\n\t * Library namespace.\n\t */\n\t var C_lib = C.lib = {};\n\n\t /**\n\t * Base object for prototypal inheritance.\n\t */\n\t var Base = C_lib.Base = (function () {\n\n\n\t return {\n\t /**\n\t * Creates a new object that inherits from this object.\n\t *\n\t * @param {Object} overrides Properties to copy into the new object.\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * field: 'value',\n\t *\n\t * method: function () {\n\t * }\n\t * });\n\t */\n\t extend: function (overrides) {\n\t // Spawn\n\t var subtype = create(this);\n\n\t // Augment\n\t if (overrides) {\n\t subtype.mixIn(overrides);\n\t }\n\n\t // Create default initializer\n\t if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t subtype.init = function () {\n\t subtype.$super.init.apply(this, arguments);\n\t };\n\t }\n\n\t // Initializer's prototype is the subtype object\n\t subtype.init.prototype = subtype;\n\n\t // Reference supertype\n\t subtype.$super = this;\n\n\t return subtype;\n\t },\n\n\t /**\n\t * Extends this object and runs the init method.\n\t * Arguments to create() will be passed to init().\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var instance = MyType.create();\n\t */\n\t create: function () {\n\t var instance = this.extend();\n\t instance.init.apply(instance, arguments);\n\n\t return instance;\n\t },\n\n\t /**\n\t * Initializes a newly created object.\n\t * Override this method to add some logic when your objects are created.\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * init: function () {\n\t * // ...\n\t * }\n\t * });\n\t */\n\t init: function () {\n\t },\n\n\t /**\n\t * Copies properties into this object.\n\t *\n\t * @param {Object} properties The properties to mix in.\n\t *\n\t * @example\n\t *\n\t * MyType.mixIn({\n\t * field: 'value'\n\t * });\n\t */\n\t mixIn: function (properties) {\n\t for (var propertyName in properties) {\n\t if (properties.hasOwnProperty(propertyName)) {\n\t this[propertyName] = properties[propertyName];\n\t }\n\t }\n\n\t // IE won't copy toString using the loop above\n\t if (properties.hasOwnProperty('toString')) {\n\t this.toString = properties.toString;\n\t }\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = instance.clone();\n\t */\n\t clone: function () {\n\t return this.init.prototype.extend(this);\n\t }\n\t };\n\t }());\n\n\t /**\n\t * An array of 32-bit words.\n\t *\n\t * @property {Array} words The array of 32-bit words.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var WordArray = C_lib.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of 32-bit words.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.create();\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 4;\n\t }\n\t },\n\n\t /**\n\t * Converts this word array to a string.\n\t *\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n\t *\n\t * @return {string} The stringified word array.\n\t *\n\t * @example\n\t *\n\t * var string = wordArray + '';\n\t * var string = wordArray.toString();\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\n\t */\n\t toString: function (encoder) {\n\t return (encoder || Hex).stringify(this);\n\t },\n\n\t /**\n\t * Concatenates a word array to this word array.\n\t *\n\t * @param {WordArray} wordArray The word array to append.\n\t *\n\t * @return {WordArray} This word array.\n\t *\n\t * @example\n\t *\n\t * wordArray1.concat(wordArray2);\n\t */\n\t concat: function (wordArray) {\n\t // Shortcuts\n\t var thisWords = this.words;\n\t var thatWords = wordArray.words;\n\t var thisSigBytes = this.sigBytes;\n\t var thatSigBytes = wordArray.sigBytes;\n\n\t // Clamp excess bits\n\t this.clamp();\n\n\t // Concat\n\t if (thisSigBytes % 4) {\n\t // Copy one byte at a time\n\t for (var i = 0; i < thatSigBytes; i++) {\n\t var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\n\t }\n\t } else {\n\t // Copy one word at a time\n\t for (var i = 0; i < thatSigBytes; i += 4) {\n\t thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];\n\t }\n\t }\n\t this.sigBytes += thatSigBytes;\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Removes insignificant bits.\n\t *\n\t * @example\n\t *\n\t * wordArray.clamp();\n\t */\n\t clamp: function () {\n\t // Shortcuts\n\t var words = this.words;\n\t var sigBytes = this.sigBytes;\n\n\t // Clamp\n\t words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\n\t words.length = Math.ceil(sigBytes / 4);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = wordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone.words = this.words.slice(0);\n\n\t return clone;\n\t },\n\n\t /**\n\t * Creates a word array filled with random bytes.\n\t *\n\t * @param {number} nBytes The number of random bytes to generate.\n\t *\n\t * @return {WordArray} The random word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\n\t */\n\t random: function (nBytes) {\n\t var words = [];\n\n\t var r = (function (m_w) {\n\t var m_w = m_w;\n\t var m_z = 0x3ade68b1;\n\t var mask = 0xffffffff;\n\n\t return function () {\n\t m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;\n\t m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;\n\t var result = ((m_z << 0x10) + m_w) & mask;\n\t result /= 0x100000000;\n\t result += 0.5;\n\t return result * (Math.random() > .5 ? 1 : -1);\n\t }\n\t });\n\n\t for (var i = 0, rcache; i < nBytes; i += 4) {\n\t var _r = r((rcache || Math.random()) * 0x100000000);\n\n\t rcache = _r() * 0x3ade67b7;\n\t words.push((_r() * 0x100000000) | 0);\n\t }\n\n\t return new WordArray.init(words, nBytes);\n\t }\n\t });\n\n\t /**\n\t * Encoder namespace.\n\t */\n\t var C_enc = C.enc = {};\n\n\t /**\n\t * Hex encoding strategy.\n\t */\n\t var Hex = C_enc.Hex = {\n\t /**\n\t * Converts a word array to a hex string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The hex string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var hexChars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t hexChars.push((bite >>> 4).toString(16));\n\t hexChars.push((bite & 0x0f).toString(16));\n\t }\n\n\t return hexChars.join('');\n\t },\n\n\t /**\n\t * Converts a hex string to a word array.\n\t *\n\t * @param {string} hexStr The hex string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n\t */\n\t parse: function (hexStr) {\n\t // Shortcut\n\t var hexStrLength = hexStr.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < hexStrLength; i += 2) {\n\t words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\n\t }\n\n\t return new WordArray.init(words, hexStrLength / 2);\n\t }\n\t };\n\n\t /**\n\t * Latin1 encoding strategy.\n\t */\n\t var Latin1 = C_enc.Latin1 = {\n\t /**\n\t * Converts a word array to a Latin1 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Latin1 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var latin1Chars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t latin1Chars.push(String.fromCharCode(bite));\n\t }\n\n\t return latin1Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Latin1 string to a word array.\n\t *\n\t * @param {string} latin1Str The Latin1 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n\t */\n\t parse: function (latin1Str) {\n\t // Shortcut\n\t var latin1StrLength = latin1Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < latin1StrLength; i++) {\n\t words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\n\t }\n\n\t return new WordArray.init(words, latin1StrLength);\n\t }\n\t };\n\n\t /**\n\t * UTF-8 encoding strategy.\n\t */\n\t var Utf8 = C_enc.Utf8 = {\n\t /**\n\t * Converts a word array to a UTF-8 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-8 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t try {\n\t return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t } catch (e) {\n\t throw new Error('Malformed UTF-8 data');\n\t }\n\t },\n\n\t /**\n\t * Converts a UTF-8 string to a word array.\n\t *\n\t * @param {string} utf8Str The UTF-8 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n\t */\n\t parse: function (utf8Str) {\n\t return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t }\n\t };\n\n\t /**\n\t * Abstract buffered block algorithm template.\n\t *\n\t * The property blockSize must be implemented in a concrete subtype.\n\t *\n\t * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n\t */\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t /**\n\t * Resets this block algorithm's data buffer to its initial state.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm.reset();\n\t */\n\t reset: function () {\n\t // Initial values\n\t this._data = new WordArray.init();\n\t this._nDataBytes = 0;\n\t },\n\n\t /**\n\t * Adds new data to this block algorithm's buffer.\n\t *\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm._append('data');\n\t * bufferedBlockAlgorithm._append(wordArray);\n\t */\n\t _append: function (data) {\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof data == 'string') {\n\t data = Utf8.parse(data);\n\t }\n\n\t // Append\n\t this._data.concat(data);\n\t this._nDataBytes += data.sigBytes;\n\t },\n\n\t /**\n\t * Processes available data blocks.\n\t *\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n\t *\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n\t *\n\t * @return {WordArray} The processed data.\n\t *\n\t * @example\n\t *\n\t * var processedData = bufferedBlockAlgorithm._process();\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n\t */\n\t _process: function (doFlush) {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var dataSigBytes = data.sigBytes;\n\t var blockSize = this.blockSize;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count blocks ready\n\t var nBlocksReady = dataSigBytes / blockSizeBytes;\n\t if (doFlush) {\n\t // Round up to include partial blocks\n\t nBlocksReady = Math.ceil(nBlocksReady);\n\t } else {\n\t // Round down to include only full blocks,\n\t // less the number of blocks that must remain in the buffer\n\t nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t }\n\n\t // Count words ready\n\t var nWordsReady = nBlocksReady * blockSize;\n\n\t // Count bytes ready\n\t var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t // Process blocks\n\t if (nWordsReady) {\n\t for (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t // Perform concrete-algorithm logic\n\t this._doProcessBlock(dataWords, offset);\n\t }\n\n\t // Remove processed words\n\t var processedWords = dataWords.splice(0, nWordsReady);\n\t data.sigBytes -= nBytesReady;\n\t }\n\n\t // Return processed words\n\t return new WordArray.init(processedWords, nBytesReady);\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = bufferedBlockAlgorithm.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone._data = this._data.clone();\n\n\t return clone;\n\t },\n\n\t _minBufferSize: 0\n\t });\n\n\t /**\n\t * Abstract hasher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n\t */\n\t var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Initializes a newly created hasher.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n\t *\n\t * @example\n\t *\n\t * var hasher = CryptoJS.algo.SHA256.create();\n\t */\n\t init: function (cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this hasher to its initial state.\n\t *\n\t * @example\n\t *\n\t * hasher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-hasher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Updates this hasher with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {Hasher} This hasher.\n\t *\n\t * @example\n\t *\n\t * hasher.update('message');\n\t * hasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t // Append\n\t this._append(messageUpdate);\n\n\t // Update the hash\n\t this._process();\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the hash computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @example\n\t *\n\t * var hash = hasher.finalize();\n\t * var hash = hasher.finalize('message');\n\t * var hash = hasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Final message update\n\t if (messageUpdate) {\n\t this._append(messageUpdate);\n\t }\n\n\t // Perform concrete-hasher logic\n\t var hash = this._doFinalize();\n\n\t return hash;\n\t },\n\n\t blockSize: 512/32,\n\n\t /**\n\t * Creates a shortcut function to a hasher's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to create a helper for.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHelper: function (hasher) {\n\t return function (message, cfg) {\n\t return new hasher.init(cfg).finalize(message);\n\t };\n\t },\n\n\t /**\n\t * Creates a shortcut function to the HMAC's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHmacHelper: function (hasher) {\n\t return function (message, key) {\n\t return new C_algo.HMAC.init(hasher, key).finalize(message);\n\t };\n\t }\n\t });\n\n\t /**\n\t * Algorithm namespace.\n\t */\n\t var C_algo = C.algo = {};\n\n\t return C;\n\t}(Math));\n\n\n\treturn CryptoJS;\n\n}));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/idtoken-verifier/~/crypto-js/core.js\n// module id = 18\n// module chunks = 0",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Initialization and round constants tables\n\t var H = [];\n\t var K = [];\n\n\t // Compute constants\n\t (function () {\n\t function isPrime(n) {\n\t var sqrtN = Math.sqrt(n);\n\t for (var factor = 2; factor <= sqrtN; factor++) {\n\t if (!(n % factor)) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t }\n\n\t function getFractionalBits(n) {\n\t return ((n - (n | 0)) * 0x100000000) | 0;\n\t }\n\n\t var n = 2;\n\t var nPrime = 0;\n\t while (nPrime < 64) {\n\t if (isPrime(n)) {\n\t if (nPrime < 8) {\n\t H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));\n\t }\n\t K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));\n\n\t nPrime++;\n\t }\n\n\t n++;\n\t }\n\t }());\n\n\t // Reusable object\n\t var W = [];\n\n\t /**\n\t * SHA-256 hash algorithm.\n\t */\n\t var SHA256 = C_algo.SHA256 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init(H.slice(0));\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var H = this._hash.words;\n\n\t // Working variables\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\t var e = H[4];\n\t var f = H[5];\n\t var g = H[6];\n\t var h = H[7];\n\n\t // Computation\n\t for (var i = 0; i < 64; i++) {\n\t if (i < 16) {\n\t W[i] = M[offset + i] | 0;\n\t } else {\n\t var gamma0x = W[i - 15];\n\t var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^\n\t ((gamma0x << 14) | (gamma0x >>> 18)) ^\n\t (gamma0x >>> 3);\n\n\t var gamma1x = W[i - 2];\n\t var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^\n\t ((gamma1x << 13) | (gamma1x >>> 19)) ^\n\t (gamma1x >>> 10);\n\n\t W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\n\t }\n\n\t var ch = (e & f) ^ (~e & g);\n\t var maj = (a & b) ^ (a & c) ^ (b & c);\n\n\t var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));\n\t var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));\n\n\t var t1 = h + sigma1 + ch + K[i] + W[i];\n\t var t2 = sigma0 + maj;\n\n\t h = g;\n\t g = f;\n\t f = e;\n\t e = (d + t1) | 0;\n\t d = c;\n\t c = b;\n\t b = a;\n\t a = (t1 + t2) | 0;\n\t }\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t H[4] = (H[4] + e) | 0;\n\t H[5] = (H[5] + f) | 0;\n\t H[6] = (H[6] + g) | 0;\n\t H[7] = (H[7] + h) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Return final computed hash\n\t return this._hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA256('message');\n\t * var hash = CryptoJS.SHA256(wordArray);\n\t */\n\t C.SHA256 = Hasher._createHelper(SHA256);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA256(message, key);\n\t */\n\t C.HmacSHA256 = Hasher._createHmacHelper(SHA256);\n\t}(Math));\n\n\n\treturn CryptoJS.SHA256;\n\n}));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/idtoken-verifier/~/crypto-js/sha256.js\n// module id = 19\n// module chunks = 0","(function(){\n\n // Copyright (c) 2005 Tom Wu\n // All Rights Reserved.\n // See \"LICENSE\" for details.\n\n // Basic JavaScript BN library - subset useful for RSA encryption.\n\n // Bits per digit\n var dbits;\n\n // JavaScript engine analysis\n var canary = 0xdeadbeefcafe;\n var j_lm = ((canary&0xffffff)==0xefcafe);\n\n // (public) Constructor\n function BigInteger(a,b,c) {\n if(a != null)\n if(\"number\" == typeof a) this.fromNumber(a,b,c);\n else if(b == null && \"string\" != typeof a) this.fromString(a,256);\n else this.fromString(a,b);\n }\n\n // return new, unset BigInteger\n function nbi() { return new BigInteger(null); }\n\n // am: Compute w_j += (x*this_i), propagate carries,\n // c is initial carry, returns final carry.\n // c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n // We need to select the fastest one that works in this environment.\n\n // am1: use a single mult and divide to get the high bits,\n // max digit bits should be 26 because\n // max internal value = 2*dvalue^2-2*dvalue (< 2^53)\n function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this[i++]+w[j]+c;\n c = Math.floor(v/0x4000000);\n w[j++] = v&0x3ffffff;\n }\n return c;\n }\n // am2 avoids a big mult-and-extract completely.\n // Max digit bits should be <= 30 because we do bitwise ops\n // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\n function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }\n // Alternately, set max digit bits to 28 since some\n // browsers slow down when dealing with 32-bit numbers.\n function am3(i,x,w,j,c,n) {\n var xl = x&0x3fff, xh = x>>14;\n while(--n >= 0) {\n var l = this[i]&0x3fff;\n var h = this[i++]>>14;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n c = (l>>28)+(m>>14)+xh*h;\n w[j++] = l&0xfffffff;\n }\n return c;\n }\n var inBrowser = typeof navigator !== \"undefined\";\n if(inBrowser && j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n BigInteger.prototype.am = am2;\n dbits = 30;\n }\n else if(inBrowser && j_lm && (navigator.appName != \"Netscape\")) {\n BigInteger.prototype.am = am1;\n dbits = 26;\n }\n else { // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n }\n\n BigInteger.prototype.DB = dbits;\n BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }\n\n // (protected) set from integer value x, -DV <= x < DV\n function bnpFromInt(x) {\n this.t = 1;\n this.s = (x<0)?-1:0;\n if(x > 0) this[0] = x;\n else if(x < -1) this[0] = x+this.DV;\n else this.t = 0;\n }\n\n // return bigint initialized to value\n function nbv(i) { var r = nbi(); r.fromInt(i); return r; }\n\n // (protected) set from string and radix\n function bnpFromString(s,b) {\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 256) k = 8; // byte array\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else { this.fromRadix(s,b); return; }\n this.t = 0;\n this.s = 0;\n var i = s.length, mi = false, sh = 0;\n while(--i >= 0) {\n var x = (k==8)?s[i]&0xff:intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if(sh == 0)\n this[this.t++] = x;\n else if(sh+k > this.DB) {\n this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh));\n }\n else\n this[this.t-1] |= x<= this.DB) sh -= this.DB;\n }\n if(k == 8 && (s[0]&0x80) != 0) {\n this.s = -1;\n if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t;\n }\n\n // (public) return string representation in given radix\n function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1< 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }\n\n // (public) -this\n function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }\n\n // (public) |this|\n function bnAbs() { return (this.s<0)?this.negate():this; }\n\n // (public) return + if this > a, - if this < a, 0 if equal\n function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }\n\n // returns bit length of the integer x\n function nbits(x) {\n var r = 1, t;\n if((t=x>>>16) != 0) { x = t; r += 16; }\n if((t=x>>8) != 0) { x = t; r += 8; }\n if((t=x>>4) != 0) { x = t; r += 4; }\n if((t=x>>2) != 0) { x = t; r += 2; }\n if((t=x>>1) != 0) { x = t; r += 1; }\n return r;\n }\n\n // (public) return the number of bits in \"this\"\n function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }\n\n // (protected) r = this << n*DB\n function bnpDLShiftTo(n,r) {\n var i;\n for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];\n for(i = n-1; i >= 0; --i) r[i] = 0;\n r.t = this.t+n;\n r.s = this.s;\n }\n\n // (protected) r = this >> n*DB\n function bnpDRShiftTo(n,r) {\n for(var i = n; i < this.t; ++i) r[i-n] = this[i];\n r.t = Math.max(this.t-n,0);\n r.s = this.s;\n }\n\n // (protected) r = this << n\n function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }\n\n // (protected) r = this >> n\n function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB;\n }\n if(a.t < this.t) {\n c -= a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c -= a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = (c<0)?-1:0;\n if(c < -1) r[i++] = this.DV+c;\n else if(c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n }\n\n // (protected) r = this * a, r != this,a (HAC 14.12)\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyTo(a,r) {\n var x = this.abs(), y = a.abs();\n var i = x.t;\n r.t = i+y.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);\n r.s = 0;\n r.clamp();\n if(this.s != a.s) BigInteger.ZERO.subTo(r,r);\n }\n\n // (protected) r = this^2, r != this (HAC 14.16)\n function bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2*x.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < x.t-1; ++i) {\n var c = x.am(i,x[i],r,2*i,0,1);\n if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {\n r[i+x.t] -= x.DV;\n r[i+x.t+1] = 1;\n }\n }\n if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);\n r.s = 0;\n r.clamp();\n }\n\n // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n // r != q, this != m. q or r may be null.\n function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }\n\n // (public) this mod a\n function bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a,null,r);\n if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);\n return r;\n }\n\n // Modular reduction using \"classic\" algorithm\n function Classic(m) { this.m = m; }\n function cConvert(x) {\n if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);\n else return x;\n }\n function cRevert(x) { return x; }\n function cReduce(x) { x.divRemTo(this.m,null,x); }\n function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n Classic.prototype.convert = cConvert;\n Classic.prototype.revert = cRevert;\n Classic.prototype.reduce = cReduce;\n Classic.prototype.mulTo = cMulTo;\n Classic.prototype.sqrTo = cSqrTo;\n\n // (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n // justification:\n // xy == 1 (mod m)\n // xy = 1+km\n // xy(2-xy) = (1+km)(1-km)\n // x[y(2-xy)] = 1-k^2m^2\n // x[y(2-xy)] == 1 (mod m^2)\n // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n // JS multiply \"overflows\" differently from C/C++, so care is needed here.\n function bnpInvDigit() {\n if(this.t < 1) return 0;\n var x = this[0];\n if((x&1) == 0) return 0;\n var y = x&3; // y == 1/x mod 2^2\n y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4\n y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8\n y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return (y>0)?this.DV-y:-y;\n }\n\n // Montgomery reduction\n function Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp&0x7fff;\n this.mph = this.mp>>15;\n this.um = (1<<(m.DB-15))-1;\n this.mt2 = 2*m.t;\n }\n\n // xR mod m\n function montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t,r);\n r.divRemTo(this.m,null,r);\n if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);\n return r;\n }\n\n // x/R mod m\n function montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n }\n\n // x = x/R mod m (HAC 14.32)\n function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }\n\n // r = \"x^2/R mod m\"; x != r\n function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n // r = \"xy/R mod m\"; x,y != r\n function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\n Montgomery.prototype.convert = montConvert;\n Montgomery.prototype.revert = montRevert;\n Montgomery.prototype.reduce = montReduce;\n Montgomery.prototype.mulTo = montMulTo;\n Montgomery.prototype.sqrTo = montSqrTo;\n\n // (protected) true iff this is even\n function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }\n\n // (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)\n function bnpExp(e,z) {\n if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n g.copyTo(r);\n while(--i >= 0) {\n z.sqrTo(r,r2);\n if((e&(1< 0) z.mulTo(r2,g,r);\n else { var t = r; r = r2; r2 = t; }\n }\n return z.revert(r);\n }\n\n // (public) this^e % m, 0 <= e < 2^32\n function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }\n\n // protected\n BigInteger.prototype.copyTo = bnpCopyTo;\n BigInteger.prototype.fromInt = bnpFromInt;\n BigInteger.prototype.fromString = bnpFromString;\n BigInteger.prototype.clamp = bnpClamp;\n BigInteger.prototype.dlShiftTo = bnpDLShiftTo;\n BigInteger.prototype.drShiftTo = bnpDRShiftTo;\n BigInteger.prototype.lShiftTo = bnpLShiftTo;\n BigInteger.prototype.rShiftTo = bnpRShiftTo;\n BigInteger.prototype.subTo = bnpSubTo;\n BigInteger.prototype.multiplyTo = bnpMultiplyTo;\n BigInteger.prototype.squareTo = bnpSquareTo;\n BigInteger.prototype.divRemTo = bnpDivRemTo;\n BigInteger.prototype.invDigit = bnpInvDigit;\n BigInteger.prototype.isEven = bnpIsEven;\n BigInteger.prototype.exp = bnpExp;\n\n // public\n BigInteger.prototype.toString = bnToString;\n BigInteger.prototype.negate = bnNegate;\n BigInteger.prototype.abs = bnAbs;\n BigInteger.prototype.compareTo = bnCompareTo;\n BigInteger.prototype.bitLength = bnBitLength;\n BigInteger.prototype.mod = bnMod;\n BigInteger.prototype.modPowInt = bnModPowInt;\n\n // \"constants\"\n BigInteger.ZERO = nbv(0);\n BigInteger.ONE = nbv(1);\n\n // Copyright (c) 2005-2009 Tom Wu\n // All Rights Reserved.\n // See \"LICENSE\" for details.\n\n // Extended JavaScript BN functions, required for RSA private ops.\n\n // Version 1.1: new BigInteger(\"0\", 10) returns \"proper\" zero\n // Version 1.2: square() API, isProbablePrime fix\n\n // (public)\n function bnClone() { var r = nbi(); this.copyTo(r); return r; }\n\n // (public) return value as integer\n function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<>24; }\n\n // (public) return value as short (assumes DB>=16)\n function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }\n\n // (protected) return x s.t. r^x < DV\n function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }\n\n // (public) 0 if this == 0, 1 if this > 0\n function bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n }\n\n // (protected) convert to radix string\n function bnpToRadix(b) {\n if(b == null) b = 10;\n if(this.signum() == 0 || b < 2 || b > 36) return \"0\";\n var cs = this.chunkSize(b);\n var a = Math.pow(b,cs);\n var d = nbv(a), y = nbi(), z = nbi(), r = \"\";\n this.divRemTo(d,y,z);\n while(y.signum() > 0) {\n r = (a+z.intValue()).toString(b).substr(1) + r;\n y.divRemTo(d,y,z);\n }\n return z.intValue().toString(b) + r;\n }\n\n // (protected) convert from radix string\n function bnpFromRadix(s,b) {\n this.fromInt(0);\n if(b == null) b = 10;\n var cs = this.chunkSize(b);\n var d = Math.pow(b,cs), mi = false, j = 0, w = 0;\n for(var i = 0; i < s.length; ++i) {\n var x = intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\" && this.signum() == 0) mi = true;\n continue;\n }\n w = b*w+x;\n if(++j >= cs) {\n this.dMultiply(d);\n this.dAddOffset(w,0);\n j = 0;\n w = 0;\n }\n }\n if(j > 0) {\n this.dMultiply(Math.pow(b,j));\n this.dAddOffset(w,0);\n }\n if(mi) BigInteger.ZERO.subTo(this,this);\n }\n\n // (protected) alternate constructor\n function bnpFromNumber(a,b,c) {\n if(\"number\" == typeof b) {\n // new BigInteger(int,int,RNG)\n if(a < 2) this.fromInt(1);\n else {\n this.fromNumber(a,c);\n if(!this.testBit(a-1))\t// force MSB set\n this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);\n if(this.isEven()) this.dAddOffset(1,0); // force odd\n while(!this.isProbablePrime(b)) {\n this.dAddOffset(2,0);\n if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);\n }\n }\n }\n else {\n // new BigInteger(int,RNG)\n var x = new Array(), t = a&7;\n x.length = (a>>3)+1;\n b.nextBytes(x);\n if(t > 0) x[0] &= ((1< 0) {\n if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)\n r[k++] = d|(this.s<<(this.DB-p));\n while(i >= 0) {\n if(p < 8) {\n d = (this[i]&((1<>(p+=this.DB-8);\n }\n else {\n d = (this[i]>>(p-=8))&0xff;\n if(p <= 0) { p += this.DB; --i; }\n }\n if((d&0x80) != 0) d |= -256;\n if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;\n if(k > 0 || d != this.s) r[k++] = d;\n }\n }\n return r;\n }\n\n function bnEquals(a) { return(this.compareTo(a)==0); }\n function bnMin(a) { return(this.compareTo(a)<0)?this:a; }\n function bnMax(a) { return(this.compareTo(a)>0)?this:a; }\n\n // (protected) r = this op a (bitwise)\n function bnpBitwiseTo(a,op,r) {\n var i, f, m = Math.min(a.t,this.t);\n for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);\n if(a.t < this.t) {\n f = a.s&this.DM;\n for(i = m; i < this.t; ++i) r[i] = op(this[i],f);\n r.t = this.t;\n }\n else {\n f = this.s&this.DM;\n for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);\n r.t = a.t;\n }\n r.s = op(this.s,a.s);\n r.clamp();\n }\n\n // (public) this & a\n function op_and(x,y) { return x&y; }\n function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }\n\n // (public) this | a\n function op_or(x,y) { return x|y; }\n function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }\n\n // (public) this ^ a\n function op_xor(x,y) { return x^y; }\n function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }\n\n // (public) this & ~a\n function op_andnot(x,y) { return x&~y; }\n function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }\n\n // (public) ~this\n function bnNot() {\n var r = nbi();\n for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];\n r.t = this.t;\n r.s = ~this.s;\n return r;\n }\n\n // (public) this << n\n function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }\n\n // (public) this >> n\n function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }\n\n // return index of lowest 1-bit in x, x < 2^31\n function lbit(x) {\n if(x == 0) return -1;\n var r = 0;\n if((x&0xffff) == 0) { x >>= 16; r += 16; }\n if((x&0xff) == 0) { x >>= 8; r += 8; }\n if((x&0xf) == 0) { x >>= 4; r += 4; }\n if((x&3) == 0) { x >>= 2; r += 2; }\n if((x&1) == 0) ++r;\n return r;\n }\n\n // (public) returns index of lowest 1-bit (or -1 if none)\n function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }\n\n // return number of 1 bits in x\n function cbit(x) {\n var r = 0;\n while(x != 0) { x &= x-1; ++r; }\n return r;\n }\n\n // (public) return number of set bits\n function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }\n\n // (public) true iff nth bit is set\n function bnTestBit(n) {\n var j = Math.floor(n/this.DB);\n if(j >= this.t) return(this.s!=0);\n return((this[j]&(1<<(n%this.DB)))!=0);\n }\n\n // (protected) this op (1<>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }\n\n // (public) this + a\n function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }\n\n // (public) this - a\n function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }\n\n // (public) this * a\n function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }\n\n // (public) this^2\n function bnSquare() { var r = nbi(); this.squareTo(r); return r; }\n\n // (public) this / a\n function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }\n\n // (public) this % a\n function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }\n\n // (public) [this/a,this%a]\n function bnDivideAndRemainder(a) {\n var q = nbi(), r = nbi();\n this.divRemTo(a,q,r);\n return new Array(q,r);\n }\n\n // (protected) this *= n, this >= 0, 1 < n < DV\n function bnpDMultiply(n) {\n this[this.t] = this.am(0,n-1,this,0,0,this.t);\n ++this.t;\n this.clamp();\n }\n\n // (protected) this += n << w words, this >= 0\n function bnpDAddOffset(n,w) {\n if(n == 0) return;\n while(this.t <= w) this[this.t++] = 0;\n this[w] += n;\n while(this[w] >= this.DV) {\n this[w] -= this.DV;\n if(++w >= this.t) this[this.t++] = 0;\n ++this[w];\n }\n }\n\n // A \"null\" reducer\n function NullExp() {}\n function nNop(x) { return x; }\n function nMulTo(x,y,r) { x.multiplyTo(y,r); }\n function nSqrTo(x,r) { x.squareTo(r); }\n\n NullExp.prototype.convert = nNop;\n NullExp.prototype.revert = nNop;\n NullExp.prototype.mulTo = nMulTo;\n NullExp.prototype.sqrTo = nSqrTo;\n\n // (public) this^e\n function bnPow(e) { return this.exp(e,new NullExp()); }\n\n // (protected) r = lower n words of \"this * a\", a.t <= n\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyLowerTo(a,n,r) {\n var i = Math.min(this.t+a.t,n);\n r.s = 0; // assumes a,this >= 0\n r.t = i;\n while(i > 0) r[--i] = 0;\n var j;\n for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);\n for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);\n r.clamp();\n }\n\n // (protected) r = \"this * a\" without lower n words, n > 0\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyUpperTo(a,n,r) {\n --n;\n var i = r.t = this.t+a.t-n;\n r.s = 0; // assumes a,this >= 0\n while(--i >= 0) r[i] = 0;\n for(i = Math.max(n-this.t,0); i < a.t; ++i)\n r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);\n r.clamp();\n r.drShiftTo(1,r);\n }\n\n // Barrett modular reduction\n function Barrett(m) {\n // setup Barrett\n this.r2 = nbi();\n this.q3 = nbi();\n BigInteger.ONE.dlShiftTo(2*m.t,this.r2);\n this.mu = this.r2.divide(m);\n this.m = m;\n }\n\n function barrettConvert(x) {\n if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);\n else if(x.compareTo(this.m) < 0) return x;\n else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }\n }\n\n function barrettRevert(x) { return x; }\n\n // x = x mod m (HAC 14.42)\n function barrettReduce(x) {\n x.drShiftTo(this.m.t-1,this.r2);\n if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }\n this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);\n this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);\n while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);\n x.subTo(this.r2,x);\n while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }\n\n // r = x^2 mod m; x != r\n function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n // r = x*y mod m; x,y != r\n function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\n Barrett.prototype.convert = barrettConvert;\n Barrett.prototype.revert = barrettRevert;\n Barrett.prototype.reduce = barrettReduce;\n Barrett.prototype.mulTo = barrettMulTo;\n Barrett.prototype.sqrTo = barrettSqrTo;\n\n // (public) this^e % m (HAC 14.85)\n function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1< 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1< 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n }\n\n // (protected) this % n, n < 2^26\n function bnpModInt(n) {\n if(n <= 0) return 0;\n var d = this.DV%n, r = (this.s<0)?n-1:0;\n if(this.t > 0)\n if(d == 0) r = this[0]%n;\n else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;\n return r;\n }\n\n // (public) 1/this % m (HAC 14.61)\n function bnModInverse(m) {\n var ac = m.isEven();\n if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;\n var u = m.clone(), v = this.clone();\n var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);\n while(u.signum() != 0) {\n while(u.isEven()) {\n u.rShiftTo(1,u);\n if(ac) {\n if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }\n a.rShiftTo(1,a);\n }\n else if(!b.isEven()) b.subTo(m,b);\n b.rShiftTo(1,b);\n }\n while(v.isEven()) {\n v.rShiftTo(1,v);\n if(ac) {\n if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }\n c.rShiftTo(1,c);\n }\n else if(!d.isEven()) d.subTo(m,d);\n d.rShiftTo(1,d);\n }\n if(u.compareTo(v) >= 0) {\n u.subTo(v,u);\n if(ac) a.subTo(c,a);\n b.subTo(d,b);\n }\n else {\n v.subTo(u,v);\n if(ac) c.subTo(a,c);\n d.subTo(b,d);\n }\n }\n if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;\n if(d.compareTo(m) >= 0) return d.subtract(m);\n if(d.signum() < 0) d.addTo(m,d); else return d;\n if(d.signum() < 0) return d.add(m); else return d;\n }\n\n var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];\n var lplim = (1<<26)/lowprimes[lowprimes.length-1];\n\n // (public) test primality with certainty >= 1-.5^t\n function bnIsProbablePrime(t) {\n var i, x = this.abs();\n if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {\n for(i = 0; i < lowprimes.length; ++i)\n if(x[0] == lowprimes[i]) return true;\n return false;\n }\n if(x.isEven()) return false;\n i = 1;\n while(i < lowprimes.length) {\n var m = lowprimes[i], j = i+1;\n while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];\n m = x.modInt(m);\n while(i < j) if(m%lowprimes[i++] == 0) return false;\n }\n return x.millerRabin(t);\n }\n\n // (protected) true if probably prime (HAC 4.24, Miller-Rabin)\n function bnpMillerRabin(t) {\n var n1 = this.subtract(BigInteger.ONE);\n var k = n1.getLowestSetBit();\n if(k <= 0) return false;\n var r = n1.shiftRight(k);\n t = (t+1)>>1;\n if(t > lowprimes.length) t = lowprimes.length;\n var a = nbi();\n for(var i = 0; i < t; ++i) {\n //Pick bases at random, instead of starting at 2\n a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);\n var y = a.modPow(r,this);\n if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {\n var j = 1;\n while(j++ < k && y.compareTo(n1) != 0) {\n y = y.modPowInt(2,this);\n if(y.compareTo(BigInteger.ONE) == 0) return false;\n }\n if(y.compareTo(n1) != 0) return false;\n }\n }\n return true;\n }\n\n // protected\n BigInteger.prototype.chunkSize = bnpChunkSize;\n BigInteger.prototype.toRadix = bnpToRadix;\n BigInteger.prototype.fromRadix = bnpFromRadix;\n BigInteger.prototype.fromNumber = bnpFromNumber;\n BigInteger.prototype.bitwiseTo = bnpBitwiseTo;\n BigInteger.prototype.changeBit = bnpChangeBit;\n BigInteger.prototype.addTo = bnpAddTo;\n BigInteger.prototype.dMultiply = bnpDMultiply;\n BigInteger.prototype.dAddOffset = bnpDAddOffset;\n BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;\n BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;\n BigInteger.prototype.modInt = bnpModInt;\n BigInteger.prototype.millerRabin = bnpMillerRabin;\n\n // public\n BigInteger.prototype.clone = bnClone;\n BigInteger.prototype.intValue = bnIntValue;\n BigInteger.prototype.byteValue = bnByteValue;\n BigInteger.prototype.shortValue = bnShortValue;\n BigInteger.prototype.signum = bnSigNum;\n BigInteger.prototype.toByteArray = bnToByteArray;\n BigInteger.prototype.equals = bnEquals;\n BigInteger.prototype.min = bnMin;\n BigInteger.prototype.max = bnMax;\n BigInteger.prototype.and = bnAnd;\n BigInteger.prototype.or = bnOr;\n BigInteger.prototype.xor = bnXor;\n BigInteger.prototype.andNot = bnAndNot;\n BigInteger.prototype.not = bnNot;\n BigInteger.prototype.shiftLeft = bnShiftLeft;\n BigInteger.prototype.shiftRight = bnShiftRight;\n BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;\n BigInteger.prototype.bitCount = bnBitCount;\n BigInteger.prototype.testBit = bnTestBit;\n BigInteger.prototype.setBit = bnSetBit;\n BigInteger.prototype.clearBit = bnClearBit;\n BigInteger.prototype.flipBit = bnFlipBit;\n BigInteger.prototype.add = bnAdd;\n BigInteger.prototype.subtract = bnSubtract;\n BigInteger.prototype.multiply = bnMultiply;\n BigInteger.prototype.divide = bnDivide;\n BigInteger.prototype.remainder = bnRemainder;\n BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;\n BigInteger.prototype.modPow = bnModPow;\n BigInteger.prototype.modInverse = bnModInverse;\n BigInteger.prototype.pow = bnPow;\n BigInteger.prototype.gcd = bnGCD;\n BigInteger.prototype.isProbablePrime = bnIsProbablePrime;\n\n // JSBN-specific extension\n BigInteger.prototype.square = bnSquare;\n\n // Expose the Barrett function\n BigInteger.prototype.Barrett = Barrett\n\n // BigInteger interfaces not implemented in jsbn:\n\n // BigInteger(int signum, byte[] magnitude)\n // double doubleValue()\n // float floatValue()\n // int hashCode()\n // long longValue()\n // static BigInteger valueOf(long val)\n\n\t// Random number generator - requires a PRNG backend, e.g. prng4.js\n\n\t// For best results, put code like\n\t// \n\t// in your main HTML document.\n\n\tvar rng_state;\n\tvar rng_pool;\n\tvar rng_pptr;\n\n\t// Mix in a 32-bit integer into the pool\n\tfunction rng_seed_int(x) {\n\t rng_pool[rng_pptr++] ^= x & 255;\n\t rng_pool[rng_pptr++] ^= (x >> 8) & 255;\n\t rng_pool[rng_pptr++] ^= (x >> 16) & 255;\n\t rng_pool[rng_pptr++] ^= (x >> 24) & 255;\n\t if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;\n\t}\n\n\t// Mix in the current time (w/milliseconds) into the pool\n\tfunction rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}\n\n\t// Initialize the pool with junk if needed.\n\tif(rng_pool == null) {\n\t rng_pool = new Array();\n\t rng_pptr = 0;\n\t var t;\n\t if(typeof window !== \"undefined\" && window.crypto) {\n\t\tif (window.crypto.getRandomValues) {\n\t\t // Use webcrypto if available\n\t\t var ua = new Uint8Array(32);\n\t\t window.crypto.getRandomValues(ua);\n\t\t for(t = 0; t < 32; ++t)\n\t\t\trng_pool[rng_pptr++] = ua[t];\n\t\t}\n\t\telse if(navigator.appName == \"Netscape\" && navigator.appVersion < \"5\") {\n\t\t // Extract entropy (256 bits) from NS4 RNG if available\n\t\t var z = window.crypto.random(32);\n\t\t for(t = 0; t < z.length; ++t)\n\t\t\trng_pool[rng_pptr++] = z.charCodeAt(t) & 255;\n\t\t}\n\t }\n\t while(rng_pptr < rng_psize) { // extract some randomness from Math.random()\n\t\tt = Math.floor(65536 * Math.random());\n\t\trng_pool[rng_pptr++] = t >>> 8;\n\t\trng_pool[rng_pptr++] = t & 255;\n\t }\n\t rng_pptr = 0;\n\t rng_seed_time();\n\t //rng_seed_int(window.screenX);\n\t //rng_seed_int(window.screenY);\n\t}\n\n\tfunction rng_get_byte() {\n\t if(rng_state == null) {\n\t\trng_seed_time();\n\t\trng_state = prng_newstate();\n\t\trng_state.init(rng_pool);\n\t\tfor(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)\n\t\t rng_pool[rng_pptr] = 0;\n\t\trng_pptr = 0;\n\t\t//rng_pool = null;\n\t }\n\t // TODO: allow reseeding after first request\n\t return rng_state.next();\n\t}\n\n\tfunction rng_get_bytes(ba) {\n\t var i;\n\t for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();\n\t}\n\n\tfunction SecureRandom() {}\n\n\tSecureRandom.prototype.nextBytes = rng_get_bytes;\n\n\t// prng4.js - uses Arcfour as a PRNG\n\n\tfunction Arcfour() {\n\t this.i = 0;\n\t this.j = 0;\n\t this.S = new Array();\n\t}\n\n\t// Initialize arcfour context from key, an array of ints, each from [0..255]\n\tfunction ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}\n\n\tfunction ARC4next() {\n\t var t;\n\t this.i = (this.i + 1) & 255;\n\t this.j = (this.j + this.S[this.i]) & 255;\n\t t = this.S[this.i];\n\t this.S[this.i] = this.S[this.j];\n\t this.S[this.j] = t;\n\t return this.S[(t + this.S[this.i]) & 255];\n\t}\n\n\tArcfour.prototype.init = ARC4init;\n\tArcfour.prototype.next = ARC4next;\n\n\t// Plug in your RNG constructor here\n\tfunction prng_newstate() {\n\t return new Arcfour();\n\t}\n\n\t// Pool size must be a multiple of 4 and greater than 32.\n\t// An array of bytes the size of the pool will be passed to init()\n\tvar rng_psize = 256;\n\n if (typeof exports !== 'undefined') {\n exports = module.exports = {\n\t\t\tBigInteger: BigInteger,\n\t\t\tSecureRandom: SecureRandom,\n\t\t};\n } else {\n this.BigInteger = BigInteger;\n this.SecureRandom = SecureRandom;\n }\n\n}).call(this);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/idtoken-verifier/~/jsbn/index.js\n// module id = 20\n// module chunks = 0","function DummyCache() {}\n\nDummyCache.prototype.get = function (key) {\n return null;\n};\n\nDummyCache.prototype.has = function (key) {\n return false;\n};\n\nDummyCache.prototype.set = function (key, value) {\n};\n\nmodule.exports = DummyCache;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/idtoken-verifier/src/helpers/dummy-cache.js\n// module id = 21\n// module chunks = 0","function ConfigurationError(message) {\n this.name = 'ConfigurationError';\n this.message = (message || '');\n}\nConfigurationError.prototype = Error.prototype;\n\nfunction TokenValidationError(message) {\n this.name = 'TokenValidationError';\n this.message = (message || '');\n}\nTokenValidationError.prototype = Error.prototype;\n\nmodule.exports = {\n ConfigurationError: ConfigurationError,\n TokenValidationError: TokenValidationError\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/idtoken-verifier/src/helpers/error.js\n// module id = 22\n// module chunks = 0","var urljoin = require('url-join');\nvar base64 = require('./base64');\nvar request = require('superagent');\n\nfunction process(jwks) {\n var modulus = base64.decodeToHEX(jwks.n);\n var exp = base64.decodeToHEX(jwks.e);\n\n return {\n modulus: modulus,\n exp: exp\n };\n}\n\nfunction getJWKS(options, cb) {\n var url = urljoin(options.iss, '.well-known', 'jwks.json');\n\n return request\n .get(url)\n .end(function (err, data) {\n if (err) {\n cb(err);\n }\n\n var matchingKey = null;\n\n for (var a = 0; a < data.body.keys.length && matchingKey === null; a ++) {\n var key = data.body.keys[a];\n if (key.kid === options.kid) {\n matchingKey = key;\n }\n }\n\n cb(null, process(matchingKey));\n });\n}\n\nmodule.exports = {\n process: process,\n getJWKS: getJWKS\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/idtoken-verifier/src/helpers/jwks.js\n// module id = 23\n// module chunks = 0","/*\nBased on the work of Tom Wu\nhttp://www-cs-students.stanford.edu/~tjw/jsbn/\nhttp://www-cs-students.stanford.edu/~tjw/jsbn/LICENSE\n*/\n\nvar BigInteger = require('jsbn').BigInteger;\nvar SHA256 = require('crypto-js/sha256');\n\nvar DigestInfoHead = {\n sha1: '3021300906052b0e03021a05000414',\n sha224: '302d300d06096086480165030402040500041c',\n sha256: '3031300d060960864801650304020105000420',\n sha384: '3041300d060960864801650304020205000430',\n sha512: '3051300d060960864801650304020305000440',\n md2: '3020300c06082a864886f70d020205000410',\n md5: '3020300c06082a864886f70d020505000410',\n ripemd160: '3021300906052b2403020105000414'\n};\n\nvar DigestAlgs = {\n sha256: SHA256\n};\n\nfunction RSAVerifier(modulus, exp) {\n this.n = null;\n this.e = 0;\n\n if (modulus != null && exp != null && modulus.length > 0 && exp.length > 0) {\n this.n = new BigInteger(modulus, 16);\n this.e = parseInt(exp, 16);\n } else {\n throw new Error('Invalid key data');\n }\n}\n\nfunction getAlgorithmFromDigest(hDigestInfo) {\n for (var algName in DigestInfoHead) {\n var head = DigestInfoHead[algName];\n var len = head.length;\n\n if (hDigestInfo.substring(0, len) === head) {\n return {\n alg: algName,\n hash: hDigestInfo.substring(len)\n };\n }\n }\n return [];\n}\n\n\nRSAVerifier.prototype.verify = function (msg, encsig) {\n encsig = encsig.replace(/[^0-9a-f]|[\\s\\n]]/ig, '');\n\n var sig = new BigInteger(encsig, 16);\n if (sig.bitLength() > this.n.bitLength()) {\n throw new Error('Signature does not match with the key modulus.');\n }\n\n var decryptedSig = sig.modPowInt(this.e, this.n);\n var digest = decryptedSig.toString(16).replace(/^1f+00/, '');\n\n var digestInfo = getAlgorithmFromDigest(digest);\n if (digestInfo.length === 0) {\n return false;\n }\n\n if (!DigestAlgs.hasOwnProperty(digestInfo.alg)) {\n throw new Error('Hashing algorithm is not supported.');\n }\n\n var msgHash = DigestAlgs[digestInfo.alg](msg).toString();\n return (digestInfo.hash === msgHash);\n};\n\nmodule.exports = RSAVerifier;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/idtoken-verifier/src/helpers/rsa-verifier.js\n// module id = 24\n// module chunks = 0","var RSAVerifier = require('./helpers/rsa-verifier');\nvar base64 = require('./helpers/base64');\nvar jwks = require('./helpers/jwks');\nvar error = require('./helpers/error');\nvar DummyCache = require('./helpers/dummy-cache');\nvar supportedAlgs = ['RS256'];\n\nfunction IdTokenVerifier(options) {\n options = options || {};\n\n this.jwksCache = options.jwksCache || new DummyCache();\n this.expectedAlg = options.expectedAlg || 'RS256';\n this.issuer = options.issuer;\n this.audience = options.audience;\n this.leeway = options.leeway || 0;\n this.__disableExpirationCheck = options.__disableExpirationCheck || false;\n\n if (this.leeway < 0 || this.leeway > 60) {\n throw new error.ConfigurationError('The leeway should be positive and lower than a minute.');\n }\n\n if (supportedAlgs.indexOf(this.expectedAlg) === -1) {\n throw new error.ConfigurationError('Algorithm ' + this.expectedAlg +\n ' is not supported. (Expected algs: [' + supportedAlgs.join(',') + '])');\n }\n}\n\nIdTokenVerifier.prototype.verify = function (token, nonce, cb) {\n var jwt = this.decode(token);\n\n if (jwt instanceof Error) {\n return cb(jwt, false);\n }\n\n var headAndPayload = jwt.encoded.header + '.' + jwt.encoded.payload;\n var signature = base64.decodeToHEX(jwt.encoded.signature);\n\n var alg = jwt.header.alg;\n var kid = jwt.header.kid;\n\n var aud = jwt.payload.aud;\n var iss = jwt.payload.iss;\n var exp = jwt.payload.exp;\n var iat = jwt.payload.iat;\n var tnonce = jwt.payload.nonce || null;\n\n if (this.issuer !== iss) {\n return cb(new error.TokenValidationError('Issuer ' + iss + ' is not valid.'), false);\n }\n\n if (this.audience !== aud) {\n return cb(new error.TokenValidationError('Audience ' + aud + ' is not valid.'), false);\n }\n\n if (this.expectedAlg !== alg) {\n return cb(new error.TokenValidationError('Algorithm ' + alg +\n ' is not supported. (Expected algs: [' + supportedAlgs.join(',') + '])'), false);\n }\n\n if (tnonce !== nonce) {\n return cb(new error.TokenValidationError('Nonce does not match.'), false);\n }\n\n var expirationError = this.verifyExpAndIat(exp, iat);\n\n if (expirationError) {\n return cb(expirationError, false);\n }\n\n this.getRsaVerifier(iss, kid, function (err, rsaVerifier) {\n if (err) {\n return cb(err);\n }\n if (rsaVerifier.verify(headAndPayload, signature)) {\n cb(null, jwt.payload);\n } else {\n cb(new error.TokenValidationError('Invalid signature.'));\n }\n });\n};\n\nIdTokenVerifier.prototype.verifyExpAndIat = function (exp, iat) {\n if (this.__disableExpirationCheck) {\n return null;\n }\n\n var now = new Date();\n\n var expDate = new Date(0);\n expDate.setUTCSeconds(exp + this.leeway);\n\n if (now > expDate) {\n return new error.TokenValidationError('Expired token.');\n }\n\n var iatDate = new Date(0);\n iatDate.setUTCSeconds(iat - this.leeway);\n\n if (now < iatDate) {\n return new error.TokenValidationError('The token was issued in the future. ' +\n 'Please check your computed clock.');\n }\n\n return null;\n};\n\nIdTokenVerifier.prototype.getRsaVerifier = function (iss, kid, cb) {\n var _this = this;\n var cachekey = iss + kid;\n\n if (!this.jwksCache.has(cachekey)) {\n jwks.getJWKS({\n iss: iss,\n kid: kid\n }, function (err, keyInfo) {\n if (err) {\n cb(err);\n }\n _this.jwksCache.set(cachekey, keyInfo);\n cb(null, new RSAVerifier(keyInfo.modulus, keyInfo.exp));\n });\n } else {\n var keyInfo = this.jwksCache.get(cachekey);\n cb(null, new RSAVerifier(keyInfo.modulus, keyInfo.exp));\n }\n};\n\nIdTokenVerifier.prototype.decode = function (token) {\n var parts = token.split('.');\n var header;\n var payload;\n\n if (parts.length !== 3) {\n return new error.TokenValidationError('Cannot decode a malformed JWT');\n }\n\n try {\n header = JSON.parse(base64.decodeToString(parts[0]));\n payload = JSON.parse(base64.decodeToString(parts[1]));\n } catch (e) {\n return new error.TokenValidationError('Token header or payload is not valid JSON');\n }\n\n return {\n header: header,\n payload: payload,\n encoded: {\n header: parts[0],\n payload: parts[1],\n signature: parts[2]\n }\n };\n};\n\nmodule.exports = IdTokenVerifier;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/idtoken-verifier/src/index.js\n// module id = 25\n// module chunks = 0","/**\n * Check if `fn` is a function.\n *\n * @param {Function} fn\n * @return {Boolean}\n * @api private\n */\nvar isObject = require('./is-object');\n\nfunction isFunction(fn) {\n var tag = isObject(fn) ? Object.prototype.toString.call(fn) : '';\n return tag === '[object Function]';\n}\n\nmodule.exports = isFunction;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/superagent/lib/is-function.js\n// module id = 26\n// module chunks = 0","/**\n * Module of mixed-in functions shared between node and client code\n */\nvar isObject = require('./is-object');\n\n/**\n * Expose `RequestBase`.\n */\n\nmodule.exports = RequestBase;\n\n/**\n * Initialize a new `RequestBase`.\n *\n * @api public\n */\n\nfunction RequestBase(obj) {\n if (obj) return mixin(obj);\n}\n\n/**\n * Mixin the prototype properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in RequestBase.prototype) {\n obj[key] = RequestBase.prototype[key];\n }\n return obj;\n}\n\n/**\n * Clear previous timeout.\n *\n * @return {Request} for chaining\n * @api public\n */\n\nRequestBase.prototype.clearTimeout = function _clearTimeout(){\n this._timeout = 0;\n this._responseTimeout = 0;\n clearTimeout(this._timer);\n clearTimeout(this._responseTimeoutTimer);\n return this;\n};\n\n/**\n * Override default response body parser\n *\n * This function will be called to convert incoming data into request.body\n *\n * @param {Function}\n * @api public\n */\n\nRequestBase.prototype.parse = function parse(fn){\n this._parser = fn;\n return this;\n};\n\n/**\n * Set format of binary response body.\n * In browser valid formats are 'blob' and 'arraybuffer',\n * which return Blob and ArrayBuffer, respectively.\n *\n * In Node all values result in Buffer.\n *\n * Examples:\n *\n * req.get('/')\n * .responseType('blob')\n * .end(callback);\n *\n * @param {String} val\n * @return {Request} for chaining\n * @api public\n */\n\nRequestBase.prototype.responseType = function(val){\n this._responseType = val;\n return this;\n};\n\n/**\n * Override default request body serializer\n *\n * This function will be called to convert data set via .send or .attach into payload to send\n *\n * @param {Function}\n * @api public\n */\n\nRequestBase.prototype.serialize = function serialize(fn){\n this._serializer = fn;\n return this;\n};\n\n/**\n * Set timeouts.\n *\n * - response timeout is time between sending request and receiving the first byte of the response. Includes DNS and connection time.\n * - deadline is the time from start of the request to receiving response body in full. If the deadline is too short large files may not load at all on slow connections.\n *\n * Value of 0 or false means no timeout.\n *\n * @param {Number|Object} ms or {response, read, deadline}\n * @return {Request} for chaining\n * @api public\n */\n\nRequestBase.prototype.timeout = function timeout(options){\n if (!options || 'object' !== typeof options) {\n this._timeout = options;\n this._responseTimeout = 0;\n return this;\n }\n\n if ('undefined' !== typeof options.deadline) {\n this._timeout = options.deadline;\n }\n if ('undefined' !== typeof options.response) {\n this._responseTimeout = options.response;\n }\n return this;\n};\n\n/**\n * Promise support\n *\n * @param {Function} resolve\n * @param {Function} reject\n * @return {Request}\n */\n\nRequestBase.prototype.then = function then(resolve, reject) {\n if (!this._fullfilledPromise) {\n var self = this;\n if (this._endCalled) {\n console.warn(\"Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises\");\n }\n this._fullfilledPromise = new Promise(function(innerResolve, innerReject){\n self.end(function(err, res){\n if (err) innerReject(err); else innerResolve(res);\n });\n });\n }\n return this._fullfilledPromise.then(resolve, reject);\n}\n\nRequestBase.prototype.catch = function(cb) {\n return this.then(undefined, cb);\n};\n\n/**\n * Allow for extension\n */\n\nRequestBase.prototype.use = function use(fn) {\n fn(this);\n return this;\n}\n\nRequestBase.prototype.ok = function(cb) {\n if ('function' !== typeof cb) throw Error(\"Callback required\");\n this._okCallback = cb;\n return this;\n};\n\nRequestBase.prototype._isResponseOK = function(res) {\n if (!res) {\n return false;\n }\n\n if (this._okCallback) {\n return this._okCallback(res);\n }\n\n return res.status >= 200 && res.status < 300;\n};\n\n\n/**\n * Get request header `field`.\n * Case-insensitive.\n *\n * @param {String} field\n * @return {String}\n * @api public\n */\n\nRequestBase.prototype.get = function(field){\n return this._header[field.toLowerCase()];\n};\n\n/**\n * Get case-insensitive header `field` value.\n * This is a deprecated internal API. Use `.get(field)` instead.\n *\n * (getHeader is no longer used internally by the superagent code base)\n *\n * @param {String} field\n * @return {String}\n * @api private\n * @deprecated\n */\n\nRequestBase.prototype.getHeader = RequestBase.prototype.get;\n\n/**\n * Set header `field` to `val`, or multiple fields with one object.\n * Case-insensitive.\n *\n * Examples:\n *\n * req.get('/')\n * .set('Accept', 'application/json')\n * .set('X-API-Key', 'foobar')\n * .end(callback);\n *\n * req.get('/')\n * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' })\n * .end(callback);\n *\n * @param {String|Object} field\n * @param {String} val\n * @return {Request} for chaining\n * @api public\n */\n\nRequestBase.prototype.set = function(field, val){\n if (isObject(field)) {\n for (var key in field) {\n this.set(key, field[key]);\n }\n return this;\n }\n this._header[field.toLowerCase()] = val;\n this.header[field] = val;\n return this;\n};\n\n/**\n * Remove header `field`.\n * Case-insensitive.\n *\n * Example:\n *\n * req.get('/')\n * .unset('User-Agent')\n * .end(callback);\n *\n * @param {String} field\n */\nRequestBase.prototype.unset = function(field){\n delete this._header[field.toLowerCase()];\n delete this.header[field];\n return this;\n};\n\n/**\n * Write the field `name` and `val`, or multiple fields with one object\n * for \"multipart/form-data\" request bodies.\n *\n * ``` js\n * request.post('/upload')\n * .field('foo', 'bar')\n * .end(callback);\n *\n * request.post('/upload')\n * .field({ foo: 'bar', baz: 'qux' })\n * .end(callback);\n * ```\n *\n * @param {String|Object} name\n * @param {String|Blob|File|Buffer|fs.ReadStream} val\n * @return {Request} for chaining\n * @api public\n */\nRequestBase.prototype.field = function(name, val) {\n\n // name should be either a string or an object.\n if (null === name || undefined === name) {\n throw new Error('.field(name, val) name can not be empty');\n }\n\n if (isObject(name)) {\n for (var key in name) {\n this.field(key, name[key]);\n }\n return this;\n }\n\n if (Array.isArray(val)) {\n for (var i in val) {\n this.field(name, val[i]);\n }\n return this;\n }\n\n // val should be defined now\n if (null === val || undefined === val) {\n throw new Error('.field(name, val) val can not be empty');\n }\n if ('boolean' === typeof val) {\n val = '' + val;\n }\n this._getFormData().append(name, val);\n return this;\n};\n\n/**\n * Abort the request, and clear potential timeout.\n *\n * @return {Request}\n * @api public\n */\nRequestBase.prototype.abort = function(){\n if (this._aborted) {\n return this;\n }\n this._aborted = true;\n this.xhr && this.xhr.abort(); // browser\n this.req && this.req.abort(); // node\n this.clearTimeout();\n this.emit('abort');\n return this;\n};\n\n/**\n * Enable transmission of cookies with x-domain requests.\n *\n * Note that for this to work the origin must not be\n * using \"Access-Control-Allow-Origin\" with a wildcard,\n * and also must set \"Access-Control-Allow-Credentials\"\n * to \"true\".\n *\n * @api public\n */\n\nRequestBase.prototype.withCredentials = function(){\n // This is browser-only functionality. Node side is no-op.\n this._withCredentials = true;\n return this;\n};\n\n/**\n * Set the max redirects to `n`. Does noting in browser XHR implementation.\n *\n * @param {Number} n\n * @return {Request} for chaining\n * @api public\n */\n\nRequestBase.prototype.redirects = function(n){\n this._maxRedirects = n;\n return this;\n};\n\n/**\n * Convert to a plain javascript object (not JSON string) of scalar properties.\n * Note as this method is designed to return a useful non-this value,\n * it cannot be chained.\n *\n * @return {Object} describing method, url, and data of this request\n * @api public\n */\n\nRequestBase.prototype.toJSON = function(){\n return {\n method: this.method,\n url: this.url,\n data: this._data,\n headers: this._header\n };\n};\n\n\n/**\n * Send `data` as the request body, defaulting the `.type()` to \"json\" when\n * an object is given.\n *\n * Examples:\n *\n * // manual json\n * request.post('/user')\n * .type('json')\n * .send('{\"name\":\"tj\"}')\n * .end(callback)\n *\n * // auto json\n * request.post('/user')\n * .send({ name: 'tj' })\n * .end(callback)\n *\n * // manual x-www-form-urlencoded\n * request.post('/user')\n * .type('form')\n * .send('name=tj')\n * .end(callback)\n *\n * // auto x-www-form-urlencoded\n * request.post('/user')\n * .type('form')\n * .send({ name: 'tj' })\n * .end(callback)\n *\n * // defaults to x-www-form-urlencoded\n * request.post('/user')\n * .send('name=tobi')\n * .send('species=ferret')\n * .end(callback)\n *\n * @param {String|Object} data\n * @return {Request} for chaining\n * @api public\n */\n\nRequestBase.prototype.send = function(data){\n var isObj = isObject(data);\n var type = this._header['content-type'];\n\n if (isObj && !this._data) {\n if (Array.isArray(data)) {\n this._data = [];\n } else if (!this._isHost(data)) {\n this._data = {};\n }\n } else if (data && this._data && this._isHost(this._data)) {\n throw Error(\"Can't merge these send calls\");\n }\n\n // merge\n if (isObj && isObject(this._data)) {\n for (var key in data) {\n this._data[key] = data[key];\n }\n } else if ('string' == typeof data) {\n // default to x-www-form-urlencoded\n if (!type) this.type('form');\n type = this._header['content-type'];\n if ('application/x-www-form-urlencoded' == type) {\n this._data = this._data\n ? this._data + '&' + data\n : data;\n } else {\n this._data = (this._data || '') + data;\n }\n } else {\n this._data = data;\n }\n\n if (!isObj || this._isHost(data)) {\n return this;\n }\n\n // default to json\n if (!type) this.type('json');\n return this;\n};\n\n\n/**\n * Sort `querystring` by the sort function\n *\n *\n * Examples:\n *\n * // default order\n * request.get('/user')\n * .query('name=Nick')\n * .query('search=Manny')\n * .sortQuery()\n * .end(callback)\n *\n * // customized sort function\n * request.get('/user')\n * .query('name=Nick')\n * .query('search=Manny')\n * .sortQuery(function(a, b){\n * return a.length - b.length;\n * })\n * .end(callback)\n *\n *\n * @param {Function} sort\n * @return {Request} for chaining\n * @api public\n */\n\nRequestBase.prototype.sortQuery = function(sort) {\n // _sort default to true but otherwise can be a function or boolean\n this._sort = typeof sort === 'undefined' ? true : sort;\n return this;\n};\n\n/**\n * Invoke callback with timeout error.\n *\n * @api private\n */\n\nRequestBase.prototype._timeoutError = function(reason, timeout){\n if (this._aborted) {\n return;\n }\n var err = new Error(reason + timeout + 'ms exceeded');\n err.timeout = timeout;\n err.code = 'ECONNABORTED';\n this.timedout = true;\n this.abort();\n this.callback(err);\n};\n\nRequestBase.prototype._setTimeouts = function() {\n var self = this;\n\n // deadline\n if (this._timeout && !this._timer) {\n this._timer = setTimeout(function(){\n self._timeoutError('Timeout of ', self._timeout);\n }, this._timeout);\n }\n // response timeout\n if (this._responseTimeout && !this._responseTimeoutTimer) {\n this._responseTimeoutTimer = setTimeout(function(){\n self._timeoutError('Response timeout of ', self._responseTimeout);\n }, this._responseTimeout);\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/superagent/lib/request-base.js\n// module id = 27\n// module chunks = 0","\n/**\n * Module dependencies.\n */\n\nvar utils = require('./utils');\n\n/**\n * Expose `ResponseBase`.\n */\n\nmodule.exports = ResponseBase;\n\n/**\n * Initialize a new `ResponseBase`.\n *\n * @api public\n */\n\nfunction ResponseBase(obj) {\n if (obj) return mixin(obj);\n}\n\n/**\n * Mixin the prototype properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in ResponseBase.prototype) {\n obj[key] = ResponseBase.prototype[key];\n }\n return obj;\n}\n\n/**\n * Get case-insensitive `field` value.\n *\n * @param {String} field\n * @return {String}\n * @api public\n */\n\nResponseBase.prototype.get = function(field){\n return this.header[field.toLowerCase()];\n};\n\n/**\n * Set header related properties:\n *\n * - `.type` the content type without params\n *\n * A response of \"Content-Type: text/plain; charset=utf-8\"\n * will provide you with a `.type` of \"text/plain\".\n *\n * @param {Object} header\n * @api private\n */\n\nResponseBase.prototype._setHeaderProperties = function(header){\n // TODO: moar!\n // TODO: make this a util\n\n // content-type\n var ct = header['content-type'] || '';\n this.type = utils.type(ct);\n\n // params\n var params = utils.params(ct);\n for (var key in params) this[key] = params[key];\n\n this.links = {};\n\n // links\n try {\n if (header.link) {\n this.links = utils.parseLinks(header.link);\n }\n } catch (err) {\n // ignore\n }\n};\n\n/**\n * Set flags such as `.ok` based on `status`.\n *\n * For example a 2xx response will give you a `.ok` of __true__\n * whereas 5xx will be __false__ and `.error` will be __true__. The\n * `.clientError` and `.serverError` are also available to be more\n * specific, and `.statusType` is the class of error ranging from 1..5\n * sometimes useful for mapping respond colors etc.\n *\n * \"sugar\" properties are also defined for common cases. Currently providing:\n *\n * - .noContent\n * - .badRequest\n * - .unauthorized\n * - .notAcceptable\n * - .notFound\n *\n * @param {Number} status\n * @api private\n */\n\nResponseBase.prototype._setStatusProperties = function(status){\n var type = status / 100 | 0;\n\n // status / class\n this.status = this.statusCode = status;\n this.statusType = type;\n\n // basics\n this.info = 1 == type;\n this.ok = 2 == type;\n this.redirect = 3 == type;\n this.clientError = 4 == type;\n this.serverError = 5 == type;\n this.error = (4 == type || 5 == type)\n ? this.toError()\n : false;\n\n // sugar\n this.accepted = 202 == status;\n this.noContent = 204 == status;\n this.badRequest = 400 == status;\n this.unauthorized = 401 == status;\n this.notAcceptable = 406 == status;\n this.forbidden = 403 == status;\n this.notFound = 404 == status;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/superagent/lib/response-base.js\n// module id = 28\n// module chunks = 0","\n/**\n * Return the mime type for the given `str`.\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\nexports.type = function(str){\n return str.split(/ *; */).shift();\n};\n\n/**\n * Return header field parameters.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\nexports.params = function(str){\n return str.split(/ *; */).reduce(function(obj, str){\n var parts = str.split(/ *= */);\n var key = parts.shift();\n var val = parts.shift();\n\n if (key && val) obj[key] = val;\n return obj;\n }, {});\n};\n\n/**\n * Parse Link header fields.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\nexports.parseLinks = function(str){\n return str.split(/ *, */).reduce(function(obj, str){\n var parts = str.split(/ *; */);\n var url = parts[0].slice(1, -1);\n var rel = parts[1].split(/ *= */)[1].slice(1, -1);\n obj[rel] = url;\n return obj;\n }, {});\n};\n\n/**\n * Strip content related fields from `header`.\n *\n * @param {Object} header\n * @return {Object} header\n * @api private\n */\n\nexports.cleanHeader = function(header, shouldStripCookie){\n delete header['content-type'];\n delete header['content-length'];\n delete header['transfer-encoding'];\n delete header['host'];\n if (shouldStripCookie) {\n delete header['cookie'];\n }\n return header;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/superagent/lib/utils.js\n// module id = 29\n// module chunks = 0","\r\n/**\r\n * Expose `Emitter`.\r\n */\r\n\r\nif (typeof module !== 'undefined') {\r\n module.exports = Emitter;\r\n}\r\n\r\n/**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\r\n\r\nfunction Emitter(obj) {\r\n if (obj) return mixin(obj);\r\n};\r\n\r\n/**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\r\n\r\nfunction mixin(obj) {\r\n for (var key in Emitter.prototype) {\r\n obj[key] = Emitter.prototype[key];\r\n }\r\n return obj;\r\n}\r\n\r\n/**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.on =\r\nEmitter.prototype.addEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n .push(fn);\r\n return this;\r\n};\r\n\r\n/**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.once = function(event, fn){\r\n function on() {\r\n this.off(event, on);\r\n fn.apply(this, arguments);\r\n }\r\n\r\n on.fn = fn;\r\n this.on(event, on);\r\n return this;\r\n};\r\n\r\n/**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.off =\r\nEmitter.prototype.removeListener =\r\nEmitter.prototype.removeAllListeners =\r\nEmitter.prototype.removeEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n\r\n // all\r\n if (0 == arguments.length) {\r\n this._callbacks = {};\r\n return this;\r\n }\r\n\r\n // specific event\r\n var callbacks = this._callbacks['$' + event];\r\n if (!callbacks) return this;\r\n\r\n // remove all handlers\r\n if (1 == arguments.length) {\r\n delete this._callbacks['$' + event];\r\n return this;\r\n }\r\n\r\n // remove specific handler\r\n var cb;\r\n for (var i = 0; i < callbacks.length; i++) {\r\n cb = callbacks[i];\r\n if (cb === fn || cb.fn === fn) {\r\n callbacks.splice(i, 1);\r\n break;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\r\n\r\nEmitter.prototype.emit = function(event){\r\n this._callbacks = this._callbacks || {};\r\n var args = [].slice.call(arguments, 1)\r\n , callbacks = this._callbacks['$' + event];\r\n\r\n if (callbacks) {\r\n callbacks = callbacks.slice(0);\r\n for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n callbacks[i].apply(this, args);\r\n }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.listeners = function(event){\r\n this._callbacks = this._callbacks || {};\r\n return this._callbacks['$' + event] || [];\r\n};\r\n\r\n/**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.hasListeners = function(event){\r\n return !! this.listeners(event).length;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/superagent/~/component-emitter/index.js\n// module id = 30\n// module chunks = 0","var WinChan = (function() {\n var RELAY_FRAME_NAME = \"__winchan_relay_frame\";\n var CLOSE_CMD = \"die\";\n\n // a portable addListener implementation\n function addListener(w, event, cb) {\n if(w.attachEvent) w.attachEvent('on' + event, cb);\n else if (w.addEventListener) w.addEventListener(event, cb, false);\n }\n\n // a portable removeListener implementation\n function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }\n\n\n // checking for IE8 or above\n function isInternetExplorer() {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n var rv = -1; // Return value assumes failure.\n var ua = navigator.userAgent;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n // IE > 11\n else if (ua.indexOf(\"Trident\") > -1) {\n var re = new RegExp(\"rv:([0-9]{2,2}[\\.0-9]{0,})\");\n if (re.exec(ua) !== null) {\n rv = parseFloat(RegExp.$1);\n }\n }\n\n return rv >= 8;\n }\n\n // checking Mobile Firefox (Fennec)\n function isFennec() {\n try {\n // We must check for both XUL and Java versions of Fennec. Both have\n // distinct UA strings.\n var userAgent = navigator.userAgent;\n return (userAgent.indexOf('Fennec/') != -1) || // XUL\n (userAgent.indexOf('Firefox/') != -1 && userAgent.indexOf('Android') != -1); // Java\n } catch(e) {}\n return false;\n }\n\n // feature checking to see if this platform is supported at all\n function isSupported() {\n return (typeof window !== 'undefined' && window.JSON && window.JSON.stringify &&\n window.JSON.parse && window.postMessage);\n }\n\n // given a URL, extract the origin. Taken from: https://github.com/firebase/firebase-simple-login/blob/d2cb95b9f812d8488bdbfba51c3a7c153ba1a074/js/src/simple-login/transports/WinChan.js#L25-L30\n function extractOrigin(url) {\n if (!/^https?:\\/\\//.test(url)) url = window.location.href;\n var m = /^(https?:\\/\\/[\\-_a-zA-Z\\.0-9:]+)/.exec(url);\n if (m) return m[1];\n return url;\n }\n\n // find the relay iframe in the opener\n function findRelay() {\n var loc = window.location;\n var frames = window.opener.frames;\n for (var i = frames.length - 1; i >= 0; i--) {\n try {\n if (frames[i].location.protocol === window.location.protocol &&\n frames[i].location.host === window.location.host &&\n frames[i].name === RELAY_FRAME_NAME)\n {\n return frames[i];\n }\n } catch(e) { }\n }\n return;\n }\n\n var isIE = isInternetExplorer();\n\n if (isSupported()) {\n /* General flow:\n * 0. user clicks\n * (IE SPECIFIC) 1. caller adds relay iframe (served from trusted domain) to DOM\n * 2. caller opens window (with content from trusted domain)\n * 3. window on opening adds a listener to 'message'\n * (IE SPECIFIC) 4. window on opening finds iframe\n * 5. window checks if iframe is \"loaded\" - has a 'doPost' function yet\n * (IE SPECIFIC5) 5a. if iframe.doPost exists, window uses it to send ready event to caller\n * (IE SPECIFIC5) 5b. if iframe.doPost doesn't exist, window waits for frame ready\n * (IE SPECIFIC5) 5bi. once ready, window calls iframe.doPost to send ready event\n * 6. caller upon reciept of 'ready', sends args\n */\n return {\n open: function(opts, cb) {\n if (!cb) throw \"missing required callback argument\";\n\n // test required options\n var err;\n if (!opts.url) err = \"missing required 'url' parameter\";\n if (!opts.relay_url) err = \"missing required 'relay_url' parameter\";\n if (err) setTimeout(function() { cb(err); }, 0);\n\n // supply default options\n if (!opts.window_name) opts.window_name = null;\n if (!opts.window_features || isFennec()) opts.window_features = undefined;\n\n // opts.params may be undefined\n\n var iframe;\n\n // sanity check, are url and relay_url the same origin?\n var origin = extractOrigin(opts.url);\n if (origin !== extractOrigin(opts.relay_url)) {\n return setTimeout(function() {\n cb('invalid arguments: origin of url and relay_url must match');\n }, 0);\n }\n\n var messageTarget;\n\n if (isIE) {\n // first we need to add a \"relay\" iframe to the document that's served\n // from the target domain. We can postmessage into a iframe, but not a\n // window\n iframe = document.createElement(\"iframe\");\n // iframe.setAttribute('name', framename);\n iframe.setAttribute('src', opts.relay_url);\n iframe.style.display = \"none\";\n iframe.setAttribute('name', RELAY_FRAME_NAME);\n document.body.appendChild(iframe);\n messageTarget = iframe.contentWindow;\n }\n\n var w = opts.popup || window.open(opts.url, opts.window_name, opts.window_features);\n if (opts.popup) {\n w.location.href = opts.url;\n }\n\n if (!messageTarget) messageTarget = w;\n\n // lets listen in case the window blows up before telling us\n var closeInterval = setInterval(function() {\n if (w && w.closed) {\n cleanup();\n if (cb) {\n cb('User closed the popup window');\n cb = null;\n }\n }\n }, 500);\n\n var req = JSON.stringify({a: 'request', d: opts.params});\n\n // cleanup on unload\n function cleanup() {\n if (iframe) document.body.removeChild(iframe);\n iframe = undefined;\n if (closeInterval) closeInterval = clearInterval(closeInterval);\n removeListener(window, 'message', onMessage);\n removeListener(window, 'unload', cleanup);\n if (w) {\n try {\n w.close();\n } catch (securityViolation) {\n // This happens in Opera 12 sometimes\n // see https://github.com/mozilla/browserid/issues/1844\n messageTarget.postMessage(CLOSE_CMD, origin);\n }\n }\n w = messageTarget = undefined;\n }\n\n addListener(window, 'unload', cleanup);\n\n function onMessage(e) {\n if (e.origin !== origin) { return; }\n try {\n var d = JSON.parse(e.data);\n if (d.a === 'ready') messageTarget.postMessage(req, origin);\n else if (d.a === 'error') {\n cleanup();\n if (cb) {\n cb(d.d);\n cb = null;\n }\n } else if (d.a === 'response') {\n cleanup();\n if (cb) {\n cb(null, d.d);\n cb = null;\n }\n }\n } catch(err) { }\n }\n\n addListener(window, 'message', onMessage);\n\n return {\n close: cleanup,\n focus: function() {\n if (w) {\n try {\n w.focus();\n } catch (e) {\n // IE7 blows up here, do nothing\n }\n }\n }\n };\n },\n onOpen: function(cb) {\n var o = \"*\";\n var msgTarget = isIE ? findRelay() : window.opener;\n if (!msgTarget) throw \"can't find relay frame\";\n function doPost(msg) {\n msg = JSON.stringify(msg);\n if (isIE) msgTarget.doPost(msg, o);\n else msgTarget.postMessage(msg, o);\n }\n\n function onMessage(e) {\n // only one message gets through, but let's make sure it's actually\n // the message we're looking for (other code may be using\n // postmessage) - we do this by ensuring the payload can\n // be parsed, and it's got an 'a' (action) value of 'request'.\n var d;\n try {\n d = JSON.parse(e.data);\n } catch(err) { }\n if (!d || d.a !== 'request') return;\n removeListener(window, 'message', onMessage);\n o = e.origin;\n if (cb) {\n // this setTimeout is critically important for IE8 -\n // in ie8 sometimes addListener for 'message' can synchronously\n // cause your callback to be invoked. awesome.\n setTimeout(function() {\n cb(o, d.d, function(r) {\n cb = undefined;\n doPost({a: 'response', d: r});\n });\n }, 0);\n }\n }\n\n function onDie(e) {\n if (e.data === CLOSE_CMD) {\n try { window.close(); } catch (o_O) {}\n }\n }\n addListener(isIE ? msgTarget : window, 'message', onMessage);\n addListener(isIE ? msgTarget : window, 'message', onDie);\n\n // we cannot post to our parent that we're ready before the iframe\n // is loaded. (IE specific possible failure)\n try {\n doPost({a: \"ready\"});\n } catch(e) {\n // this code should never be exectued outside IE\n addListener(msgTarget, 'load', function(e) {\n doPost({a: \"ready\"});\n });\n }\n\n // if window is unloaded and the client hasn't called cb, it's an error\n var onUnload = function() {\n try {\n // IE8 doesn't like this...\n removeListener(isIE ? msgTarget : window, 'message', onDie);\n } catch (ohWell) { }\n if (cb) doPost({ a: 'error', d: 'client closed window' });\n cb = undefined;\n // explicitly close the window, in case the client is trying to reload or nav\n try { window.close(); } catch (e) { }\n };\n addListener(window, 'unload', onUnload);\n return {\n detach: function() {\n removeListener(window, 'unload', onUnload);\n }\n };\n }\n };\n } else {\n return {\n open: function(url, winopts, arg, cb) {\n setTimeout(function() { cb(\"unsupported browser\"); }, 0);\n },\n onOpen: function(cb) {\n setTimeout(function() { cb(\"unsupported browser\"); }, 0);\n }\n };\n }\n})();\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = WinChan;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/winchan/winchan.js\n// module id = 31\n// module chunks = 0","var urljoin = require('url-join');\n\nvar objectHelper = require('../helper/object');\nvar assert = require('../helper/assert');\nvar responseHandler = require('../helper/response-handler');\n\nfunction DBConnection(request, options) {\n this.baseOptions = options;\n this.request = request;\n}\n\n/**\n * Signup a new user\n *\n * @method signup\n * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup\n * @param {Function} cb\n */\nDBConnection.prototype.signup = function (options, cb) {\n var url;\n var body;\n\n assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n connection: { type: 'string', message: 'connection option is required' },\n email: { type: 'string', message: 'email option is required' },\n password: { type: 'string', message: 'password option is required' }\n });\n assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\n url = urljoin(this.baseOptions.rootUrl, 'dbconnections', 'signup');\n\n body = objectHelper.merge(this.baseOptions, ['clientID'])\n .with(options);\n\n body = objectHelper.blacklist(body, ['scope']);\n\n body = objectHelper.toSnakeCase(body, ['auth0Client']);\n\n return this.request\n .post(url)\n .send(body)\n .end(responseHandler(cb));\n};\n\n/**\n * Initializes the change password flow\n *\n * @method signup\n * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password\n * @param {Function} cb\n */\nDBConnection.prototype.changePassword = function (options, cb) {\n var url;\n var body;\n\n assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n connection: { type: 'string', message: 'connection option is required' },\n email: { type: 'string', message: 'email option is required' }\n });\n assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\n url = urljoin(this.baseOptions.rootUrl, 'dbconnections', 'change_password');\n\n body = objectHelper.merge(this.baseOptions, ['clientID'])\n .with(options, ['email', 'connection']);\n\n body = objectHelper.toSnakeCase(body, ['auth0Client']);\n\n return this.request\n .post(url)\n .send(body)\n .end(responseHandler(cb));\n};\n\nmodule.exports = DBConnection;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/authentication/db-connection.js\n// module id = 32\n// module chunks = 0","var urljoin = require('url-join');\n\nvar objectHelper = require('../helper/object');\nvar assert = require('../helper/assert');\nvar qs = require('../helper/qs');\nvar responseHandler = require('../helper/response-handler');\n\nfunction PasswordlessAuthentication(request, options) {\n this.baseOptions = options;\n this.request = request;\n}\n\n/**\n * Builds and returns the passwordless TOTP verify url in order to initialize a new authN/authZ transaction\n *\n * @method buildVerifyUrl\n * @param {Object} options\n * @param {Function} cb\n */\nPasswordlessAuthentication.prototype.buildVerifyUrl = function (options) {\n var params;\n var qString;\n\n /* eslint-disable */\n assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n connection: { type: 'string', message: 'connection option is required' },\n type: { type: 'string', message: 'type option is required', values: ['sms', 'email'],\n value_message: 'type is not valid ([email,sms])' },\n verificationCode: { type: 'string', message: 'verificationCode option is required' },\n phoneNumber: { required: true, type: 'string', message: 'phoneNumber option is required',\n condition: function (o) { return o.type === 'sms'; } },\n email: { required: true, type: 'string', message: 'email option is required',\n condition: function (o) { return o.type === 'email'; } }\n });\n /* eslint-enable */\n\n assert.check(options, {\n optional: true,\n type: 'object',\n message: 'options parameter is not valid'\n });\n\n params = objectHelper.merge(this.baseOptions, [\n 'clientID',\n 'responseType',\n 'responseMode',\n 'redirectUri',\n 'scope',\n 'audience'\n ]).with(options);\n\n params = objectHelper.blacklist(params, ['type']);\n\n // eslint-disable-next-line\n if (this.baseOptions._sendTelemetry) {\n params.auth0Client = this.request.getTelemetryData();\n }\n\n params = objectHelper.toSnakeCase(params, ['auth0Client']);\n\n qString = qs.build(params);\n\n return urljoin(this.baseOptions.rootUrl, 'passwordless', 'verify_redirect', '?' + qString);\n};\n\n/**\n * Initializes a new passwordless authN/authZ transaction\n *\n * @method start\n * @param {Object} options: https://auth0.com/docs/api/authentication#passwordless\n * @param {Function} cb\n */\nPasswordlessAuthentication.prototype.start = function (options, cb) {\n var url;\n var body;\n var cleanOption;\n\n /* eslint-disable */\n assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n connection: { type: 'string', message: 'connection option is required' },\n type: { type: 'string', message: 'type option is required', values: ['sms', 'email'],\n value_message: 'type is not valid ([email,sms])' },\n phoneNumber: { required: true, type: 'string', message: 'phoneNumber option is required',\n condition: function (o) { return o.type === 'sms'; } },\n email: { required: true, type: 'string', message: 'email option is required',\n condition: function (o) { return o.type === 'email'; } }\n });\n /* eslint-enable */\n\n assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\n cleanOption = objectHelper.blacklist(options, ['type']);\n\n url = urljoin(this.baseOptions.rootUrl, 'passwordless', 'start');\n\n body = objectHelper.merge(this.baseOptions, ['clientID'])\n .with(cleanOption);\n\n body = objectHelper.toSnakeCase(body, ['auth0Client']);\n\n return this.request\n .post(url)\n .send(body)\n .end(responseHandler(cb));\n};\n\n/**\n * Verifies the passwordless TOTP and returns an error if any.\n *\n * @method buildVerifyUrl\n * @param {Object} options\n * @param {Function} cb\n */\nPasswordlessAuthentication.prototype.verify = function (options, cb) {\n var url;\n var cleanOption;\n\n /* eslint-disable */\n assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n connection: { type: 'string', message: 'connection option is required' },\n type: { type: 'string', message: 'type option is required', values: ['sms', 'email'],\n value_message: 'type is not valid ([email,sms])' },\n verificationCode: { type: 'string', message: 'verificationCode option is required' },\n phoneNumber: { required: true, type: 'string', message: 'phoneNumber option is required',\n condition: function (o) { return o.type === 'sms'; } },\n email: { required: true, type: 'string', message: 'email option is required',\n condition: function (o) { return o.type === 'email'; } }\n });\n /* eslint-enable */\n\n assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\n cleanOption = objectHelper.blacklist(options, ['type']);\n\n cleanOption = objectHelper.toSnakeCase(cleanOption, ['auth0Client']);\n\n url = urljoin(this.baseOptions.rootUrl, 'passwordless', 'verify');\n\n return this.request\n .post(url)\n .send(cleanOption)\n .end(responseHandler(cb));\n};\n\nmodule.exports = PasswordlessAuthentication;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/authentication/passwordless-authentication.js\n// module id = 33\n// module chunks = 0","var windowHandler = require('./window');\nvar base64Url = require('./base64_url');\n\nfunction create(name, value, days) {\n var date;\n var expires;\n\n if (windowHandler.getDocument().cookie === undefined\n || windowHandler.getDocument().cookie === null) {\n throw new Error('cookie storage not available');\n }\n\n if (days) {\n date = new Date();\n date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n expires = '; expires=' + date.toGMTString();\n } else {\n expires = '';\n }\n\n windowHandler.getDocument().cookie = name + '=' + base64Url.encode(value) + expires + '; path=/';\n}\n\nfunction read(name) {\n var i;\n var cookie;\n var cookies;\n var nameEQ = name + '=';\n\n if (windowHandler.getDocument().cookie === undefined\n || windowHandler.getDocument().cookie === null) {\n throw new Error('cookie storage not available');\n }\n\n cookies = windowHandler.getDocument().cookie.split(';');\n\n for (i = 0; i < cookies.length; i++) {\n cookie = cookies[i];\n while (cookie.charAt(0) === ' ') {\n cookie = cookie.substring(1, cookie.length);\n }\n if (cookie.indexOf(nameEQ) === 0) {\n return base64Url.decode(cookie.substring(nameEQ.length, cookie.length));\n }\n }\n\n return null;\n}\n\nfunction erase(name) {\n create(name, '', -1);\n}\n\nmodule.exports = {\n create: create,\n read: read,\n erase: erase\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/cookies.js\n// module id = 34\n// module chunks = 0","var windowHelper = require('./window');\n\nfunction IframeHandler(options) {\n this.auth0 = options.auth0;\n this.url = options.url;\n this.callback = options.callback;\n this.timeout = options.timeout || 60 * 1000;\n this.timeoutCallback = options.timeoutCallback || null;\n this.usePostMessage = options.usePostMessage || false;\n this.iframe = null;\n this.timeoutHandle = null;\n this._destroyTimeout = null;\n this.transientMessageEventListener = null;\n this.transientEventListener = null;\n}\n\nIframeHandler.prototype.init = function () {\n var _this = this;\n var _window = windowHelper.getWindow();\n\n this.iframe = _window.document.createElement('iframe');\n this.iframe.style.display = 'none';\n this.iframe.src = this.url;\n\n if (this.usePostMessage) {\n // Workaround to avoid using bind that does not work in IE8\n this.transientMessageEventListener = function (e) {\n _this.messageEventListener(e);\n };\n\n _window.addEventListener('message', this.transientMessageEventListener, false);\n } else {\n // Workaround to avoid using bind that does not work in IE8\n this.transientEventListener = function () {\n _this.loadEventListener();\n };\n\n this.iframe.addEventListener('load', this.transientEventListener, false);\n }\n\n _window.document.body.appendChild(this.iframe);\n\n this.timeoutHandle = setTimeout(function () {\n _this.timeoutHandler();\n }, this.timeout);\n};\n\nIframeHandler.prototype.messageEventListener = function (e) {\n this.destroy();\n this.callbackHandler(e.data);\n};\n\nIframeHandler.prototype.loadEventListener = function () {\n var _this = this;\n this.auth0.parseHash(\n { hash: this.iframe.contentWindow.location.hash },\n function (error, result) {\n if (error || result) {\n _this.destroy();\n _this.callback(error, result);\n }\n }\n );\n};\n\nIframeHandler.prototype.callbackHandler = function (result) {\n var error = null;\n\n if (result.error) {\n error = result;\n result = null;\n }\n\n this.callback(error, result);\n};\n\nIframeHandler.prototype.timeoutHandler = function () {\n this.destroy();\n if (this.timeoutCallback) {\n this.timeoutCallback();\n }\n};\n\nIframeHandler.prototype.destroy = function () {\n var _this = this;\n var _window = windowHelper.getWindow();\n\n clearTimeout(this.timeoutHandle);\n\n this._destroyTimeout = setTimeout(function () {\n if (_this.usePostMessage) {\n _window.removeEventListener('message', _this.transientMessageEventListener, false);\n } else {\n _this.iframe.removeEventListener('load', _this.transientEventListener, false);\n }\n\n _window.document.body.removeChild(_this.iframe);\n }, 0);\n};\n\nmodule.exports = IframeHandler;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/iframe-handler.js\n// module id = 35\n// module chunks = 0","function get() {\n if (!Object.assign) {\n return objectAssignPolyfill;\n }\n\n return Object.assign;\n}\n\nfunction objectAssignPolyfill(target) {\n 'use strict';\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert first argument to object');\n }\n\n var to = Object(target);\n for (var i = 1; i < arguments.length; i++) {\n var nextSource = arguments[i];\n if (nextSource === undefined || nextSource === null) {\n continue;\n }\n\n var keysArray = Object.keys(Object(nextSource));\n for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {\n var nextKey = keysArray[nextIndex];\n var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n if (desc !== undefined && desc.enumerable) {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n return to;\n}\n\nmodule.exports = {\n get: get,\n objectAssignPolyfill: objectAssignPolyfill\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/object-assign.js\n// module id = 36\n// module chunks = 0","var objectHelper = require('../helper/object');\n\nvar token_params = [\n// auth0\n 'realm',\n 'audience',\n// oauth2\n 'client_id',\n 'client_secret',\n 'redirect_uri',\n 'scope',\n 'code',\n 'grant_type',\n 'username',\n 'password',\n 'refresh_token',\n 'assertion',\n 'client_assertion',\n 'client_assertion_type',\n 'code_verifier'\n];\n\nvar authorize_params = [\n// auth0\n 'connection',\n 'connection_scope',\n 'auth0Client',\n 'owp',\n// oauth2\n 'client_id',\n 'response_type',\n 'response_mode',\n 'redirect_uri',\n 'audience',\n 'scope',\n 'state',\n 'nonce',\n 'display',\n 'prompt',\n 'max_age',\n 'ui_locales',\n 'claims_locales',\n 'id_token_hint',\n 'login_hint',\n 'acr_values',\n 'claims',\n 'registration',\n 'request',\n 'request_uri',\n 'code_challenge',\n 'code_challenge_method'\n];\n\nfunction oauthAuthorizeParams(params) {\n return objectHelper.pick(params, authorize_params);\n}\n\nfunction oauthTokenParams(params) {\n return objectHelper.pick(params, token_params);\n}\n\nmodule.exports = {\n oauthTokenParams: oauthTokenParams,\n oauthAuthorizeParams: oauthAuthorizeParams\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/parameters-whitelist.js\n// module id = 37\n// module chunks = 0","var WinChan = require('winchan');\n\nvar windowHandler = require('../helper/window');\nvar objectHelper = require('../helper/object');\n\nfunction PopupHandler() {\n this._current_popup = null;\n}\n\nPopupHandler.prototype.stringifyPopupSettings = function (options) {\n var settings = '';\n\n for (var key in options) {\n settings += key + '=' + options[key] + ',';\n }\n\n return settings.slice(0, -1);\n};\n\nPopupHandler.prototype.calculatePosition = function (options) {\n var width = options.width || 500;\n var height = options.height || 600;\n var _window = windowHandler.getWindow();\n\n var screenX = typeof _window.screenX !== 'undefined' ? _window.screenX : _window.screenLeft;\n var screenY = typeof _window.screenY !== 'undefined' ? _window.screenY : _window.screenTop;\n\n var outerWidth = typeof _window.outerWidth !== 'undefined'\n ? _window.outerWidth\n : _window.document.body.clientWidth;\n\n var outerHeight = typeof _window.outerHeight !== 'undefined'\n ? _window.outerHeight\n : _window.document.body.clientHeight;\n\n var left = screenX + ((outerWidth - width) / 2);\n var top = screenY + ((outerHeight - height) / 2);\n\n return { width: width, height: height, left: left, top: top };\n};\n\nPopupHandler.prototype.preload = function (options) {\n var _this = this;\n var _window = windowHandler.getWindow();\n var popupPosition = this.calculatePosition(options.popupOptions || {});\n var popupOptions = objectHelper.merge(popupPosition).with(options.popupOptions);\n var url = options.url || 'about:blank';\n var windowFeatures = this.stringifyPopupSettings(popupOptions);\n\n if (this._current_popup && !this._current_popup.closed) {\n return this._current_popup;\n }\n\n this._current_popup = _window.open(url, 'auth0_signup_popup', windowFeatures);\n\n this._current_popup.kill = function () {\n this.close();\n _this._current_popup = null;\n };\n\n return this._current_popup;\n};\n\nPopupHandler.prototype.load = function (url, relayUrl, options, cb) {\n var _this = this;\n var popupPosition = this.calculatePosition(options.popupOptions || {});\n var popupOptions = objectHelper.merge(popupPosition).with(options.popupOptions);\n\n var winchanOptions = {\n url: url,\n relay_url: relayUrl,\n window_features: this.stringifyPopupSettings(popupOptions),\n popup: this._current_popup,\n params: options\n };\n\n var popup = WinChan.open(winchanOptions, function (err, data) {\n _this._current_popup = null;\n return cb(err, data);\n });\n\n popup.focus();\n\n return popup;\n};\n\nmodule.exports = PopupHandler;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/popup-handler.js\n// module id = 38\n// module chunks = 0","var windowHelper = require('./window');\n\nfunction randomString(length) {\n var bytes = new Uint8Array(length);\n var result = [];\n var charset = '0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~';\n\n var cryptoObj = windowHelper.getWindow().crypto || windowHelper.getWindow().msCrypto;\n if (!cryptoObj) {\n return null;\n }\n\n var random = cryptoObj.getRandomValues(bytes);\n\n for (var a = 0; a < random.length; a++) {\n result.push(charset[random[a] % charset.length]);\n }\n\n return result.join('');\n}\n\nmodule.exports = {\n randomString: randomString\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/random.js\n// module id = 39\n// module chunks = 0","var StorageHandler = require('./storage/handler');\nvar storage;\n\nfunction getStorage(force) {\n if (!storage || force) {\n storage = new StorageHandler();\n }\n return storage;\n}\n\nmodule.exports = {\n getItem: function (key) {\n var value = getStorage().getItem(key);\n return value ? JSON.parse(value) : value;\n },\n removeItem: function (key) {\n return getStorage().removeItem(key);\n },\n setItem: function (key, value) {\n var json = JSON.stringify(value);\n return getStorage().setItem(key, json);\n },\n reload: function() {\n getStorage(true);\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/storage.js\n// module id = 40\n// module chunks = 0","var windowHandler = require('../window');\nvar cookies = require('../cookies');\n\nfunction CookieStorage() {}\n\nCookieStorage.prototype.getItem = function (key) {\n return cookies.read(key);\n};\n\nCookieStorage.prototype.removeItem = function (key) {\n cookies.erase(key);\n};\n\nCookieStorage.prototype.setItem = function (key, value) {\n cookies.create(key, value, 1);\n};\n\nmodule.exports = CookieStorage;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/storage/cookie.js\n// module id = 41\n// module chunks = 0","function DummyStorage() {}\n\nDummyStorage.prototype.getItem = function (key) { return null; };\n\nDummyStorage.prototype.removeItem = function (key) {};\n\nDummyStorage.prototype.setItem = function (key, value) {};\n\nmodule.exports = DummyStorage;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/storage/dummy.js\n// module id = 42\n// module chunks = 0","var windowHandler = require('../window');\nvar DummyStorage = require('./dummy');\nvar CookieStorage = require('./cookie');\nvar Warn = require('../warn');\n\nfunction StorageHandler() {\n this.warn = new Warn({});\n this.storage = windowHandler.getWindow().localStorage || new CookieStorage();\n}\n\nStorageHandler.prototype.failover = function () {\n if (this.storage instanceof DummyStorage) {\n this.warn.warning('DummyStorage: ignore failover');\n return;\n } else if (this.storage instanceof CookieStorage) {\n this.warn.warning('CookieStorage: failing over DummyStorage');\n this.storage = new DummyStorage();\n } else {\n this.warn.warning('LocalStorage: failing over CookieStorage');\n this.storage = new CookieStorage();\n }\n};\n\nStorageHandler.prototype.getItem = function (key) {\n try {\n return this.storage.getItem(key);\n } catch (e) {\n this.warn.warning(e);\n this.failover();\n return this.getItem(key);\n }\n};\n\nStorageHandler.prototype.removeItem = function (key) {\n try {\n return this.storage.removeItem(key);\n } catch (e) {\n this.warn.warning(e);\n this.failover();\n return this.removeItem(key);\n }\n};\n\nStorageHandler.prototype.setItem = function (key, value) {\n try {\n return this.storage.setItem(key, value);\n } catch (e) {\n this.warn.warning(e);\n this.failover();\n return this.setItem(key, value);\n }\n};\n\nmodule.exports = StorageHandler;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/helper/storage/handler.js\n// module id = 43\n// module chunks = 0","var urljoin = require('url-join');\n\nvar RequestBuilder = require('../helper/request-builder');\nvar assert = require('../helper/assert');\nvar responseHandler = require('../helper/response-handler');\n\n/**\n * Auth0 Management API Client (methods allowed to be called from the browser only)\n * @constructor\n * @param {Object} options\n * @param {Object} options.domain\n * @param {Object} options.token\n */\nfunction Management(options) {\n /* eslint-disable */\n assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n domain: { type: 'string', message: 'domain option is required' },\n token: { type: 'string', message: 'token option is required' },\n _sendTelemetry: { optional: true, type: 'boolean', message: '_sendTelemetry option is not valid' },\n _telemetryInfo: { optional: true, type: 'object', message: '_telemetryInfo option is not valid' }\n });\n /* eslint-enable */\n\n this.baseOptions = options;\n\n this.baseOptions.headers = { Authorization: 'Bearer ' + this.baseOptions.token };\n\n this.request = new RequestBuilder(this.baseOptions);\n this.baseOptions.rootUrl = urljoin('https://' + this.baseOptions.domain, 'api', 'v2');\n}\n\n/**\n * Returns the user profile. https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id\n *\n * @method getUser\n * @param {String} userId\n * @param {Function} cb\n */\nManagement.prototype.getUser = function (userId, cb) {\n var url;\n\n assert.check(userId, { type: 'string', message: 'userId parameter is not valid' });\n assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\n url = urljoin(this.baseOptions.rootUrl, 'users', userId);\n\n return this.request\n .get(url)\n .end(responseHandler(cb));\n};\n\n/**\n * Updates the user metdata. It will patch the user metdata with the attributes sent.\n * https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id\n *\n * @method patchUserMetadata\n * @param {String} userId\n * @param {Object} userMetadata\n * @param {Function} cb\n */\nManagement.prototype.patchUserMetadata = function (userId, userMetadata, cb) {\n var url;\n\n assert.check(userId, { type: 'string', message: 'userId parameter is not valid' });\n assert.check(userMetadata, { type: 'object', message: 'userMetadata parameter is not valid' });\n assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\n url = urljoin(this.baseOptions.rootUrl, 'users', userId);\n\n return this.request\n .patch(url)\n .send({ user_metadata: userMetadata })\n .end(responseHandler(cb));\n};\n\n/**\n * Link two users. https://auth0.com/docs/api/management/v2#!/Users/post_identities\n *\n * @method linkUser\n * @param {String} userId\n * @param {Object} secondaryUserToken\n * @param {Function} cb\n */\nManagement.prototype.linkUser = function (userId, secondaryUserToken, cb) {\n var url;\n /* eslint-disable */\n assert.check(userId, { type: 'string', message: 'userId parameter is not valid' });\n assert.check(secondaryUserToken, { type: 'string',\n message: 'secondaryUserToken parameter is not valid' });\n assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n /* eslint-enable */\n\n url = urljoin(this.baseOptions.rootUrl, 'users', userId, 'identities');\n\n return this.request\n .post(url)\n .send({ link_with: secondaryUserToken })\n .end(responseHandler(cb));\n};\n\nmodule.exports = Management;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/management/index.js\n// module id = 44\n// module chunks = 0","var IdTokenVerifier = require('idtoken-verifier');\n\nvar assert = require('../helper/assert');\nvar error = require('../helper/error');\nvar qs = require('../helper/qs');\nvar windowHelper = require('../helper/window');\nvar objectHelper = require('../helper/object');\nvar TransactionManager = require('./transaction-manager');\nvar Authentication = require('../authentication');\nvar Redirect = require('./redirect');\nvar Popup = require('./popup');\nvar SilentAuthenticationHandler = require('./silent-authentication-handler');\n\n/**\n * Handles all the browser's authentication flows\n * @constructor\n * @param {Object} options\n * @param {Object} options.domain\n * @param {Object} options.clienID\n * @param {Object} options.responseType\n * @param {Object} options.responseMode\n * @param {Object} options.scope\n * @param {Object} options.audience\n * @param {Object} options._disableDeprecationWarnings\n */\nfunction WebAuth(options) {\n /* eslint-disable */\n assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n domain: { type: 'string', message: 'domain option is required' },\n clientID: { type: 'string', message: 'clientID option is required' },\n responseType: { optional: true, type: 'string', message: 'responseType is not valid' },\n responseMode: { optional: true, type: 'string', message: 'responseMode is not valid' },\n redirectUri: { optional: true, type: 'string', message: 'redirectUri is not valid' },\n scope: { optional: true, type: 'string', message: 'audience is not valid' },\n audience: { optional: true, type: 'string', message: 'scope is not valid' },\n leeway: { optional: true, type: 'number', message: 'leeway is not valid' },\n _disableDeprecationWarnings: { optional: true, type: 'boolean', message: '_disableDeprecationWarnings option is not valid' },\n _sendTelemetry: { optional: true, type: 'boolean', message: '_sendTelemetry option is not valid' },\n _telemetryInfo: { optional: true, type: 'object', message: '_telemetryInfo option is not valid' }\n });\n\n if (options.overrides) {\n assert.check(options.overrides, { type: 'object', message: 'overrides option is not valid' }, {\n __tenant: { type: 'string', message: '__tenant option is required' },\n __token_issuer: { type: 'string', message: '__token_issuer option is required' }\n });\n }\n /* eslint-enable */\n\n this.baseOptions = options;\n\n this.baseOptions._sendTelemetry = this.baseOptions._sendTelemetry === false ?\n this.baseOptions._sendTelemetry : true;\n\n this.baseOptions.tenant = (this.overrides && this.overrides.__tenant)\n || this.baseOptions.domain.split('.')[0];\n\n this.baseOptions.token_issuer = (this.overrides && this.overrides.__token_issuer)\n || 'https://' + this.baseOptions.domain + '/';\n\n this.transactionManager = new TransactionManager(this.baseOptions.transaction);\n\n this.client = new Authentication(this.baseOptions);\n this.redirect = new Redirect(this.client, this.baseOptions);\n this.popup = new Popup(this.client, this.baseOptions);\n}\n\n/**\n * Parse the url hash and extract the returned tokens depending on the transaction.\n *\n * Only validates id_tokens signed by Auth0 using the RS256 algorithm using the public key exposed\n * by the `/.well-known/jwks.json` endpoint. Id tokens signed with other algorithms will not be\n * accepted.\n *\n * @method parseHash\n * @param {Object} options:\n * @param {String} options.state [OPTIONAL] to verify the response\n * @param {String} options.nonce [OPTIONAL] to verify the id_token\n * @param {String} options.hash [OPTIONAL] the url hash. If not provided it will extract from window.location.hash\n * @param {Function} cb: function(err, token_payload)\n */\nWebAuth.prototype.parseHash = function (options, cb) {\n var parsedQs;\n var err;\n var token;\n\n if (!cb && typeof options === 'function') {\n cb = options;\n options = {};\n } else {\n options = options || {};\n }\n\n var _window = windowHelper.getWindow();\n\n var hashStr = options.hash === undefined ? _window.location.hash : options.hash;\n hashStr = hashStr.replace(/^#?\\/?/, '');\n\n parsedQs = qs.parse(hashStr);\n\n if (parsedQs.hasOwnProperty('error')) {\n err = error.buildResponse(parsedQs.error, parsedQs.error_description);\n\n if (parsedQs.state) {\n err.state = parsedQs.state;\n }\n\n return cb(err);\n }\n\n if (!parsedQs.hasOwnProperty('access_token')\n && !parsedQs.hasOwnProperty('id_token')\n && !parsedQs.hasOwnProperty('refresh_token')) {\n return cb(null, null);\n }\n\n if (parsedQs.id_token) {\n this.validateToken(parsedQs.id_token, parsedQs.state || options.state, options.nonce, function (err, response) {\n if (err) {\n return cb(err);\n }\n\n return cb(null, buildParseHashResponse(parsedQs, response));\n });\n } else {\n cb(null, buildParseHashResponse(parsedQs, null));\n }\n};\n\nfunction buildParseHashResponse(qs, token) {\n return {\n accessToken: qs.access_token || null,\n idToken: qs.id_token || null,\n idTokenPayload: token && token.payload ? token.payload : null,\n appStatus: token ? token.appStatus || null : null,\n refreshToken: qs.refresh_token || null,\n state: qs.state || null,\n expiresIn: qs.expires_in || null,\n tokenType: qs.token_type || null\n };\n}\n\n/**\n * Decodes the id_token and verifies the nonce.\n *\n * @method validateToken\n * @param {String} token\n * @param {String} state\n * @param {String} nonce\n * @param {Function} cb: function(err, {payload, transaction})\n */\nWebAuth.prototype.validateToken = function (token, state, nonce, cb) {\n var audiences;\n var transaction;\n var transactionNonce;\n var tokenNonce;\n\n transaction = this.transactionManager.getStoredTransaction(state);\n transactionNonce = (transaction && transaction.nonce) || nonce || null;\n\n var verifier = new IdTokenVerifier({\n issuer: this.baseOptions.token_issuer,\n audience: this.baseOptions.clientID,\n leeway: this.baseOptions.leeway || 0,\n __disableExpirationCheck: this.baseOptions.__disableExpirationCheck\n });\n\n verifier.verify(token, transactionNonce, function (err, payload) {\n if (err) {\n return cb(error.invalidJwt(err.message));\n }\n\n cb(null, {\n payload: payload,\n transaction: transaction\n });\n });\n};\n\n/**\n * Executes a silent authentication transaction under the hood in order to fetch a new token.\n *\n * @method renewAuth\n * @param {Object} options: any valid oauth2 parameter to be sent to the `/authorize` endpoint\n * @param {Function} cb\n */\nWebAuth.prototype.renewAuth = function (options, cb) {\n var handler;\n var prof;\n var usePostMessage = !!options.usePostMessage;\n var _this = this;\n\n var params = objectHelper.merge(this.baseOptions, [\n 'clientID',\n 'redirectUri',\n 'responseType',\n 'scope',\n 'audience'\n ]).with(options);\n\n params.responseType = params.responseType || 'token';\n params.responseMode = params.responseMode || 'fragment';\n\n params = this.transactionManager.process(params);\n\n assert.check(params, { type: 'object', message: 'options parameter is not valid' }, {\n scope: { type: 'string', message: 'scope option is required' },\n audience: { type: 'string', message: 'audience option is required' }\n });\n assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });\n\n params.prompt = 'none';\n\n params = objectHelper.blacklist(params, ['usePostMessage', 'tenant']);\n\n handler = new SilentAuthenticationHandler(this, this.client.buildAuthorizeUrl(params));\n\n handler.login(usePostMessage, function (err, data) {\n if (err) {\n return cb(err);\n }\n\n if (data.id_token) {\n return _this.validateToken(data.id_token, options.state, options.nonce, function (err, payload) {\n if (err) {\n return cb(err);\n }\n\n data.idTokenPayload = payload;\n\n return cb(null, data);\n });\n }\n\n return cb(err, data);\n });\n};\n\n/**\n * Initialices a change password transaction\n *\n * @method changePassword\n * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password\n * @param {Function} cb\n */\nWebAuth.prototype.changePassword = function (options, cb) {\n return this.client.dbConnection.changePassword(options, cb);\n};\n\n/**\n * Initialices a passwordless authentication transaction\n *\n * @method passwordlessStart\n * @param {Object} options: https://auth0.com/docs/api/authentication#passwordless\n * @param {Object} options.type: `sms` or `email`\n * @param {Object} options.phoneNumber: only if type = sms\n * @param {Object} options.email: only if type = email\n * @param {Function} cb\n */\nWebAuth.prototype.passwordlessStart = function (options, cb) {\n return this.client.passwordless.start(options, cb);\n};\n\n/**\n * Signs up a new user\n *\n * @method signup\n * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup\n * @param {Function} cb\n */\nWebAuth.prototype.signup = function (options, cb) {\n return this.client.dbConnection.signup(options, cb);\n};\n\n/**\n * Redirects to the hosted login page (`/authorize`) in order to initialize a new authN/authZ transaction\n *\n * @method authorize\n * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db\n * @param {Function} cb\n */\nWebAuth.prototype.authorize = function (options) {\n var params = objectHelper.merge(this.baseOptions, [\n 'clientID',\n 'responseType',\n 'responseMode',\n 'redirectUri',\n 'scope',\n 'audience'\n ]).with(options);\n\n assert.check(params, { type: 'object', message: 'options parameter is not valid' }, {\n responseType: { type: 'string', message: 'responseType option is required' }\n });\n\n params = this.transactionManager.process(params);\n\n windowHelper.redirect(this.client.buildAuthorizeUrl(params));\n};\n\n/**\n * Signs up a new user, automatically logs the user in after the signup and returns the user token.\n * The login will be done using /oauth/token with password-realm grant type.\n *\n * @method signupAndAuthorize\n * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup\n * @param {Function} cb\n */\nWebAuth.prototype.signupAndAuthorize = function (options, cb) {\n var _this = this;\n\n return this.client.dbConnection.signup(objectHelper.blacklist(options, ['popupHandler']),\n function (err) {\n if (err) {\n return cb(err);\n }\n options.realm = options.connection;\n if (!options.username) {\n options.username = options.email;\n }\n _this.client.login(options, cb);\n });\n};\n\n/**\n * Redirects to the auth0 logout page\n *\n * @method logout\n * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--v2-logout\n */\nWebAuth.prototype.logout = function (options) {\n windowHelper.redirect(this.client.buildLogoutUrl(options));\n};\n\n/**\n * Verifies the passwordless TOTP and redirects to finish the passwordless transaction\n *\n * @method passwordlessVerify\n * @param {Object} options:\n * @param {Object} options.type: `sms` or `email`\n * @param {Object} options.phoneNumber: only if type = sms\n * @param {Object} options.email: only if type = email\n * @param {Object} options.connection: the connection name\n * @param {Object} options.verificationCode: the TOTP code\n * @param {Function} cb\n */\nWebAuth.prototype.passwordlessVerify = function (options, cb) {\n var _this = this;\n return this.client.passwordless.verify(options, function (err) {\n if (err) {\n return cb(err);\n }\n return windowHelper.redirect(_this.client.passwordless.buildVerifyUrl(options));\n });\n};\n\nmodule.exports = WebAuth;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/web-auth/index.js\n// module id = 45\n// module chunks = 0","var urljoin = require('url-join');\n\nvar assert = require('../helper/assert');\nvar responseHandler = require('../helper/response-handler');\nvar PopupHandler = require('../helper/popup-handler');\nvar objectHelper = require('../helper/object');\nvar Warn = require('../helper/warn');\nvar TransactionManager = require('./transaction-manager');\n\nfunction Popup(client, options) {\n this.baseOptions = options;\n this.client = client;\n\n this.transactionManager = new TransactionManager(this.baseOptions.transaction);\n this.warn = new Warn({\n disableWarnings: !!options._disableDeprecationWarnings\n });\n}\n\n/**\n * Initializes the popup window and returns the instance to be used later in order to avoid being blocked by the browser.\n *\n * @method preload\n * @param {Object} options: receives the window height and width and any other window feature to be sent to window.open\n */\nPopup.prototype.preload = function (options) {\n var popup = new PopupHandler();\n popup.preload(options || {});\n return popup;\n};\n\n/**\n * Internal use.\n *\n * @method getPopupHandler\n */\nPopup.prototype.getPopupHandler = function (options, preload) {\n if (options.popupHandler) {\n return options.popupHandler;\n }\n return !!preload ? this.preload(options) : new PopupHandler();\n};\n\n/**\n * Opens in a popup the hosted login page (`/authorize`) in order to initialize a new authN/authZ transaction\n *\n * @method authorize\n * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db\n * @param {Function} cb\n */\nPopup.prototype.authorize = function (options, cb) {\n var popup;\n var url;\n var relayUrl;\n\n var params = objectHelper.merge(this.baseOptions, [\n 'clientID',\n 'scope',\n 'audience',\n 'responseType'\n ]).with(objectHelper.blacklist(options, ['popupHandler']));\n\n assert.check(params, { type: 'object', message: 'options parameter is not valid' }, {\n responseType: { type: 'string', message: 'responseType option is required' }\n });\n\n // used by server to render the relay page instead of sending the chunk in the\n // url to the callback\n params.owp = true;\n\n params = this.transactionManager.process(params);\n\n url = this.client.buildAuthorizeUrl(params);\n\n popup = this.getPopupHandler(options);\n\n relayUrl = urljoin(this.baseOptions.rootUrl, 'relay.html');\n\n return popup.load(url, relayUrl, {}, responseHandler(cb));\n};\n\n/**\n * Initializes the legacy Lock login flow in a popup\n *\n * @method loginWithCredentials\n * @param {Object} options\n * @param {Function} cb\n * @deprecated `webauth.popup.loginWithCredentials` will be soon deprecated, use `webauth.client.login` instead.\n */\nPopup.prototype.loginWithCredentials = function (options, cb) {\n var params;\n var popup;\n var url;\n var relayUrl;\n\n this.warn.warning('`webauth.popup.loginWithCredentials` will be soon deprecated, use `webauth.client.login` instead.');\n\n /* eslint-disable */\n assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {\n clientID: { optional: true, type: 'string', message: 'clientID option is required' },\n redirectUri: { optional: true, type: 'string', message: 'redirectUri option is required' },\n responseType: { optional: true, type: 'string', message: 'responseType option is required' },\n scope: { optional: true, type: 'string', message: 'scope option is required' },\n audience: { optional: true, type: 'string', message: 'audience option is required' }\n });\n /* eslint-enable */\n\n popup = this.getPopupHandler(options);\n\n options = objectHelper.merge(this.baseOptions, [\n 'clientID',\n 'scope',\n 'domain',\n 'audience'\n ]).with(objectHelper.blacklist(options, ['popupHandler']));\n\n params = objectHelper.pick(options, ['clientID', 'domain']);\n params.options = objectHelper.toSnakeCase(\n objectHelper.blacklist(options, ['clientID', 'domain'])\n );\n\n url = urljoin(this.baseOptions.rootUrl, 'sso_dbconnection_popup', options.clientID);\n relayUrl = urljoin(this.baseOptions.rootUrl, 'relay.html');\n\n return popup.load(url, relayUrl, params, responseHandler(cb));\n};\n\n/**\n * Verifies the passwordless TOTP and returns the requested token\n *\n * @method passwordlessVerify\n * @param {Object} options:\n * @param {Object} options.type: `sms` or `email`\n * @param {Object} options.phoneNumber: only if type = sms\n * @param {Object} options.email: only if type = email\n * @param {Object} options.connection: the connection name\n * @param {Object} options.verificationCode: the TOTP code\n * @param {Function} cb\n */\nPopup.prototype.passwordlessVerify = function (options, cb) {\n var _this = this;\n return this.client.passwordless.verify(objectHelper.blacklist(options, ['popupHandler']),\n function (err) {\n if (err) {\n return cb(err);\n }\n\n options.username = options.phoneNumber || options.email;\n options.password = options.verificationCode;\n\n delete options.email;\n delete options.phoneNumber;\n delete options.verificationCode;\n delete options.type;\n\n _this.client.loginWithResourceOwner(options, cb);\n });\n};\n\n/**\n * Signs up a new user and automatically logs the user in after the signup.\n *\n * @method signupAndLogin\n * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup\n * @param {Function} cb\n */\nPopup.prototype.signupAndLogin = function (options, cb) {\n var _this = this;\n\n // Preload popup to avoid the browser to block it since the login happens later\n var popupHandler = this.getPopupHandler(options, true);\n options.popupHandler = popupHandler;\n\n return this.client.dbConnection.signup(objectHelper.blacklist(options, ['popupHandler']),\n function (err) {\n if (err) {\n if (popupHandler._current_popup) {\n popupHandler._current_popup.kill();\n }\n return cb(err);\n }\n _this.loginWithCredentials(options, cb);\n });\n};\n\nmodule.exports = Popup;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/web-auth/popup.js\n// module id = 46\n// module chunks = 0","var UsernamePassword = require('./username-password');\nvar objectHelper = require('../helper/object');\nvar Warn = require('../helper/warn');\nvar assert = require('../helper/assert');\n\nfunction Redirect(client, options) {\n this.baseOptions = options;\n this.client = client;\n\n this.warn = new Warn({\n disableWarnings: !!options._disableDeprecationWarnings\n });\n}\n\n/**\n * Initializes the legacy Lock login flow in redirect mode\n *\n * @method loginWithCredentials\n * @param {Object} options\n * @param {Function} cb\n * @deprecated `webauth.redirect.loginWithCredentials` will be soon deprecated, use `webauth.login` instead.\n */\nRedirect.prototype.loginWithCredentials = function (options, cb) {\n var usernamePassword;\n\n var params = objectHelper.merge(this.baseOptions, [\n 'clientID',\n 'redirectUri',\n 'tenant',\n 'responseType',\n 'responseMode',\n 'scope',\n 'audience'\n ]).with(options);\n\n this.warn.warning('`webauth.redirect.loginWithCredentials` will be soon deprecated, use `webauth.login` instead.');\n\n assert.check(params, { type: 'object', message: 'options parameter is not valid' }, {\n responseType: { type: 'string', message: 'responseType option is required' }\n });\n\n usernamePassword = new UsernamePassword(this.baseOptions);\n return usernamePassword.login(params, function (err, data) {\n if (err) {\n return cb(err);\n }\n return usernamePassword.callback(data);\n });\n};\n\n/**\n * Signs up a new user and automatically logs the user in after the signup.\n *\n * @method signupAndLogin\n * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup\n * @param {Function} cb\n */\nRedirect.prototype.signupAndLogin = function (options, cb) {\n var _this = this;\n return this.client.dbConnection.signup(options, function (err) {\n if (err) {\n return cb(err);\n }\n return _this.loginWithCredentials(options, cb);\n });\n};\n\nmodule.exports = Redirect;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/web-auth/redirect.js\n// module id = 47\n// module chunks = 0","var IframeHandler = require('../helper/iframe-handler');\n\nfunction SilentAuthenticationHandler(auth0, authenticationUrl, timeout) {\n this.auth0 = auth0;\n this.authenticationUrl = authenticationUrl;\n this.timeout = timeout || 60 * 1000;\n this.handler = null;\n}\n\nSilentAuthenticationHandler.prototype.login = function (usePostMessage, callback) {\n this.handler = new IframeHandler({\n auth0: this.auth0,\n url: this.authenticationUrl,\n callback: callback,\n timeout: this.timeout,\n timeoutCallback: function () {\n callback({\n error: 'timeout',\n description: 'Timeout during authentication renew.'\n });\n },\n usePostMessage: usePostMessage || false\n });\n\n this.handler.init();\n};\n\nmodule.exports = SilentAuthenticationHandler;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/web-auth/silent-authentication-handler.js\n// module id = 48\n// module chunks = 0","var urljoin = require('url-join');\n\nvar objectHelper = require('../helper/object');\nvar RequestBuilder = require('../helper/request-builder');\nvar responseHandler = require('../helper/response-handler');\nvar windowHelper = require('../helper/window');\n\nfunction UsernamePassword(options) {\n this.baseOptions = options;\n this.request = new RequestBuilder(options);\n}\n\nUsernamePassword.prototype.login = function (options, cb) {\n var url;\n var body;\n\n url = urljoin(this.baseOptions.rootUrl, 'usernamepassword', 'login');\n\n options.username = options.username || options.email; // eslint-disable-line\n\n options = objectHelper.blacklist(options, ['email']); // eslint-disable-line\n\n body = objectHelper.merge(this.baseOptions, [\n 'clientID',\n 'redirectUri',\n 'tenant',\n 'responseType',\n 'responseMode',\n 'scope',\n 'audience'\n ]).with(options);\n\n body = objectHelper.toSnakeCase(body, ['auth0Client']);\n\n return this.request\n .post(url)\n .send(body)\n .end(responseHandler(cb));\n};\n\nUsernamePassword.prototype.callback = function (formHtml) {\n var div;\n var form;\n var _document = windowHelper.getDocument();\n\n div = _document.createElement('div');\n div.innerHTML = formHtml;\n form = _document.body.appendChild(div).children[0];\n\n form.submit();\n};\n\nmodule.exports = UsernamePassword;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/web-auth/username-password.js\n// module id = 49\n// module chunks = 0"],"sourceRoot":""}
\ No newline at end of file