Skip to content

Instantly share code, notes, and snippets.

@hjanuschka
Created September 28, 2016 11:07
Show Gist options
  • Save hjanuschka/8ce524b0033fabe385b5866bd6fab298 to your computer and use it in GitHub Desktop.
Save hjanuschka/8ce524b0033fabe385b5866bd6fab298 to your computer and use it in GitHub Desktop.
! function() {
function t(e, n) {
e instanceof t ? (this.enc = e.enc, this.pos = e.pos) : (this.enc = e, this.pos = n)
}
function e(t, e, n, i, o) {
this.stream = t, this.header = e, this.length = n, this.tag = i, this.sub = o
}
function n(t) {
var e, n, i = "";
for (e = 0; e + 3 <= t.length; e += 3) n = parseInt(t.substring(e, e + 3), 16), i += et.charAt(n >> 6) + et.charAt(63 & n);
for (e + 1 == t.length ? (n = parseInt(t.substring(e, e + 1), 16), i += et.charAt(n << 2)) : e + 2 == t.length && (n = parseInt(t.substring(e, e + 2), 16), i += et.charAt(n >> 2) + et.charAt((3 & n) << 4));
(3 & i.length) > 0;) i += nt;
return i
}
function i(t) {
var e, n, i, o = "",
r = 0;
for (e = 0; e < t.length && t.charAt(e) != nt; ++e) i = et.indexOf(t.charAt(e)), 0 > i || (0 == r ? (o += l(i >> 2), n = 3 & i, r = 1) : 1 == r ? (o += l(n << 2 | i >> 4), n = 15 & i, r = 2) : 2 == r ? (o += l(n), o += l(i >> 2), n = 3 & i, r = 3) : (o += l(n << 2 | i >> 4), o += l(15 & i), r = 0));
return 1 == r && (o += l(n << 2)), o
}
function o(t) {
var e, n = i(t),
o = new Array;
for (e = 0; 2 * e < n.length; ++e) o[e] = parseInt(n.substring(2 * e, 2 * e + 2), 16);
return o
}
function r(t, e, n) {
null != t && ("number" == typeof t ? this.fromNumber(t, e, n) : null == e && "string" != typeof t ? this.fromString(t, 256) : this.fromString(t, e))
}
function s() {
return new r(null)
}
function a(t, e, n, i, o, r) {
for (; --r >= 0;) {
var s = e * this[t++] + n[i] + o;
o = Math.floor(s / 67108864), n[i++] = 67108863 & s
}
return o
}
function c(t, e, n, i, o, r) {
for (var s = 32767 & e, a = e >> 15; --r >= 0;) {
var c = 32767 & this[t],
u = this[t++] >> 15,
l = a * c + u * s;
c = s * c + ((32767 & l) << 15) + n[i] + (1073741823 & o), o = (c >>> 30) + (l >>> 15) + a * u + (o >>> 30), n[i++] = 1073741823 & c
}
return o
}
function u(t, e, n, i, o, r) {
for (var s = 16383 & e, a = e >> 14; --r >= 0;) {
var c = 16383 & this[t],
u = this[t++] >> 14,
l = a * c + u * s;
c = s * c + ((16383 & l) << 14) + n[i] + o, o = (c >> 28) + (l >> 14) + a * u, n[i++] = 268435455 & c
}
return o
}
function l(t) {
return ct.charAt(t)
}
function h(t, e) {
var n = ut[t.charCodeAt(e)];
return null == n ? -1 : n
}
function p(t) {
for (var e = this.t - 1; e >= 0; --e) t[e] = this[e];
t.t = this.t, t.s = this.s
}
function f(t) {
this.t = 1, this.s = 0 > t ? -1 : 0, t > 0 ? this[0] = t : -1 > t ? this[0] = t + this.DV : this.t = 0
}
function d(t) {
var e = s();
return e.fromInt(t), e
}
function m(t, e) {
var n;
if (16 == e) n = 4;
else if (8 == e) n = 3;
else if (256 == e) n = 8;
else if (2 == e) n = 1;
else if (32 == e) n = 5;
else {
if (4 != e) return void this.fromRadix(t, e);
n = 2
}
this.t = 0, this.s = 0;
for (var i = t.length, o = !1, s = 0; --i >= 0;) {
var a = 8 == n ? 255 & t[i] : h(t, i);
0 > a ? "-" == t.charAt(i) && (o = !0) : (o = !1, 0 == s ? this[this.t++] = a : s + n > this.DB ? (this[this.t - 1] |= (a & (1 << this.DB - s) - 1) << s, this[this.t++] = a >> this.DB - s) : this[this.t - 1] |= a << s, s += n, s >= this.DB && (s -= this.DB))
}
8 == n && 0 != (128 & t[0]) && (this.s = -1, s > 0 && (this[this.t - 1] |= (1 << this.DB - s) - 1 << s)), this.clamp(), o && r.ZERO.subTo(this, this)
}
function y() {
for (var t = this.s & this.DM; this.t > 0 && this[this.t - 1] == t;) --this.t
}
function g(t) {
if (this.s < 0) return "-" + this.negate().toString(t);
var e;
if (16 == t) e = 4;
else if (8 == t) e = 3;
else if (2 == t) e = 1;
else if (32 == t) e = 5;
else {
if (4 != t) return this.toRadix(t);
e = 2
}
var n, i = (1 << e) - 1,
o = !1,
r = "",
s = this.t,
a = this.DB - s * this.DB % e;
if (s-- > 0)
for (a < this.DB && (n = this[s] >> a) > 0 && (o = !0, r = l(n)); s >= 0;) e > a ? (n = (this[s] & (1 << a) - 1) << e - a, n |= this[--s] >> (a += this.DB - e)) : (n = this[s] >> (a -= e) & i, 0 >= a && (a += this.DB, --s)), n > 0 && (o = !0), o && (r += l(n));
return o ? r : "0"
}
function v() {
var t = s();
return r.ZERO.subTo(this, t), t
}
function _() {
return this.s < 0 ? this.negate() : this
}
function b(t) {
var e = this.s - t.s;
if (0 != e) return e;
var n = this.t;
if (e = n - t.t, 0 != e) return this.s < 0 ? -e : e;
for (; --n >= 0;)
if (0 != (e = this[n] - t[n])) return e;
return 0
}
function E(t) {
var e, n = 1;
return 0 != (e = t >>> 16) && (t = e, n += 16), 0 != (e = t >> 8) && (t = e, n += 8), 0 != (e = t >> 4) && (t = e, n += 4), 0 != (e = t >> 2) && (t = e, n += 2), 0 != (e = t >> 1) && (t = e, n += 1), n
}
function w() {
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + E(this[this.t - 1] ^ this.s & this.DM)
}
function A(t, e) {
var n;
for (n = this.t - 1; n >= 0; --n) e[n + t] = this[n];
for (n = t - 1; n >= 0; --n) e[n] = 0;
e.t = this.t + t, e.s = this.s
}
function C(t, e) {
for (var n = t; n < this.t; ++n) e[n - t] = this[n];
e.t = Math.max(this.t - t, 0), e.s = this.s
}
function N(t, e) {
var n, i = t % this.DB,
o = this.DB - i,
r = (1 << o) - 1,
s = Math.floor(t / this.DB),
a = this.s << i & this.DM;
for (n = this.t - 1; n >= 0; --n) e[n + s + 1] = this[n] >> o | a, a = (this[n] & r) << i;
for (n = s - 1; n >= 0; --n) e[n] = 0;
e[s] = a, e.t = this.t + s + 1, e.s = this.s, e.clamp()
}
function T(t, e) {
e.s = this.s;
var n = Math.floor(t / this.DB);
if (n >= this.t) return void(e.t = 0);
var i = t % this.DB,
o = this.DB - i,
r = (1 << i) - 1;
e[0] = this[n] >> i;
for (var s = n + 1; s < this.t; ++s) e[s - n - 1] |= (this[s] & r) << o, e[s - n] = this[s] >> i;
i > 0 && (e[this.t - n - 1] |= (this.s & r) << o), e.t = this.t - n, e.clamp()
}
function S(t, e) {
for (var n = 0, i = 0, o = Math.min(t.t, this.t); o > n;) i += this[n] - t[n], e[n++] = i & this.DM, i >>= this.DB;
if (t.t < this.t) {
for (i -= t.s; n < this.t;) i += this[n], e[n++] = i & this.DM, i >>= this.DB;
i += this.s
} else {
for (i += this.s; n < t.t;) i -= t[n], e[n++] = i & this.DM, i >>= this.DB;
i -= t.s
}
e.s = 0 > i ? -1 : 0, -1 > i ? e[n++] = this.DV + i : i > 0 && (e[n++] = i), e.t = n, e.clamp()
}
function O(t, e) {
var n = this.abs(),
i = t.abs(),
o = n.t;
for (e.t = o + i.t; --o >= 0;) e[o] = 0;
for (o = 0; o < i.t; ++o) e[o + n.t] = n.am(0, i[o], e, o, 0, n.t);
e.s = 0, e.clamp(), this.s != t.s && r.ZERO.subTo(e, e)
}
function x(t) {
for (var e = this.abs(), n = t.t = 2 * e.t; --n >= 0;) t[n] = 0;
for (n = 0; n < e.t - 1; ++n) {
var i = e.am(n, e[n], t, 2 * n, 0, 1);
(t[n + e.t] += e.am(n + 1, 2 * e[n], t, 2 * n + 1, i, e.t - n - 1)) >= e.DV && (t[n + e.t] -= e.DV, t[n + e.t + 1] = 1)
}
t.t > 0 && (t[t.t - 1] += e.am(n, e[n], t, 2 * n, 0, 1)), t.s = 0, t.clamp()
}
function I(t, e, n) {
var i = t.abs();
if (!(i.t <= 0)) {
var o = this.abs();
if (o.t < i.t) return null != e && e.fromInt(0), void(null != n && this.copyTo(n));
null == n && (n = s());
var a = s(),
c = this.s,
u = t.s,
l = this.DB - E(i[i.t - 1]);
l > 0 ? (i.lShiftTo(l, a), o.lShiftTo(l, n)) : (i.copyTo(a), o.copyTo(n));
var h = a.t,
p = a[h - 1];
if (0 != p) {
var f = p * (1 << this.F1) + (h > 1 ? a[h - 2] >> this.F2 : 0),
d = this.FV / f,
m = (1 << this.F1) / f,
y = 1 << this.F2,
g = n.t,
v = g - h,
_ = null == e ? s() : e;
for (a.dlShiftTo(v, _), n.compareTo(_) >= 0 && (n[n.t++] = 1, n.subTo(_, n)), r.ONE.dlShiftTo(h, _), _.subTo(a, a); a.t < h;) a[a.t++] = 0;
for (; --v >= 0;) {
var b = n[--g] == p ? this.DM : Math.floor(n[g] * d + (n[g - 1] + y) * m);
if ((n[g] += a.am(0, b, n, v, 0, h)) < b)
for (a.dlShiftTo(v, _), n.subTo(_, n); n[g] < --b;) n.subTo(_, n)
}
null != e && (n.drShiftTo(h, e), c != u && r.ZERO.subTo(e, e)), n.t = h, n.clamp(), l > 0 && n.rShiftTo(l, n), 0 > c && r.ZERO.subTo(n, n)
}
}
}
function P(t) {
var e = s();
return this.abs().divRemTo(t, null, e), this.s < 0 && e.compareTo(r.ZERO) > 0 && t.subTo(e, e), e
}
function R(t) {
this.m = t
}
function D(t) {
return t.s < 0 || t.compareTo(this.m) >= 0 ? t.mod(this.m) : t
}
function M(t) {
return t
}
function U(t) {
t.divRemTo(this.m, null, t)
}
function k(t, e, n) {
t.multiplyTo(e, n), this.reduce(n)
}
function F(t, e) {
t.squareTo(e), this.reduce(e)
}
function L() {
if (this.t < 1) return 0;
var t = this[0];
if (0 == (1 & t)) return 0;
var e = 3 & t;
return e = e * (2 - (15 & t) * e) & 15, e = e * (2 - (255 & t) * e) & 255, e = e * (2 - ((65535 & t) * e & 65535)) & 65535, e = e * (2 - t * e % this.DV) % this.DV, e > 0 ? this.DV - e : -e
}
function j(t) {
this.m = t, this.mp = t.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15, this.um = (1 << t.DB - 15) - 1, this.mt2 = 2 * t.t
}
function B(t) {
var e = s();
return t.abs().dlShiftTo(this.m.t, e), e.divRemTo(this.m, null, e), t.s < 0 && e.compareTo(r.ZERO) > 0 && this.m.subTo(e, e), e
}
function V(t) {
var e = s();
return t.copyTo(e), this.reduce(e), e
}
function H(t) {
for (; t.t <= this.mt2;) t[t.t++] = 0;
for (var e = 0; e < this.m.t; ++e) {
var n = 32767 & t[e],
i = n * this.mpl + ((n * this.mph + (t[e] >> 15) * this.mpl & this.um) << 15) & t.DM;
for (n = e + this.m.t, t[n] += this.m.am(0, i, t, e, 0, this.m.t); t[n] >= t.DV;) t[n] -= t.DV, t[++n] ++
}
t.clamp(), t.drShiftTo(this.m.t, t), t.compareTo(this.m) >= 0 && t.subTo(this.m, t)
}
function Y(t, e) {
t.squareTo(e), this.reduce(e)
}
function z(t, e, n) {
t.multiplyTo(e, n), this.reduce(n)
}
function G() {
return 0 == (this.t > 0 ? 1 & this[0] : this.s)
}
function W(t, e) {
if (t > 4294967295 || 1 > t) return r.ONE;
var n = s(),
i = s(),
o = e.convert(this),
a = E(t) - 1;
for (o.copyTo(n); --a >= 0;)
if (e.sqrTo(n, i), (t & 1 << a) > 0) e.mulTo(i, o, n);
else {
var c = n;
n = i, i = c
}
return e.revert(n)
}
function q(t, e) {
var n;
return n = 256 > t || e.isEven() ? new R(e) : new j(e), this.exp(t, n)
}
function K(t, e) {
return new r(t, e)
}
function Q(t, e) {
if (e < t.length + 11) throw new Error("Message too long for RSA");
for (var n = new Array, i = t.length - 1; i >= 0 && e > 0;) {
var o = t.charCodeAt(i--);
128 > o ? n[--e] = o : o > 127 && 2048 > o ? (n[--e] = 63 & o | 128, n[--e] = o >> 6 | 192) : (n[--e] = 63 & o | 128, n[--e] = o >> 6 & 63 | 128, n[--e] = o >> 12 | 224)
}
n[--e] = 0;
for (var s = 0, a = 0, c = 0; e > 2;) 0 == c && (a = lt.random.randomWords(1, 0)[0]), s = a >> c & 255, c = (c + 8) % 32, 0 != s && (n[--e] = s);
return n[--e] = 2, n[--e] = 0, new r(n)
}
function $() {
this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null, this.dmq1 = null, this.coeff = null
}
function Z(t, e) {
if (!(null != t && null != e && t.length > 0 && e.length > 0)) throw new Error("Invalid RSA public key");
this.n = K(t, 16), this.e = parseInt(e, 16)
}
function X(t) {
return t.modPowInt(this.e, this.n)
}
function J(t) {
var e = Q(t, this.n.bitLength() + 7 >> 3);
if (null == e) return null;
var n = this.doPublic(e);
if (null == n) return null;
var i = n.toString(16);
return 0 == (1 & i.length) ? i : "0" + i
}
t.prototype.get = function(t) {
if (void 0 == t && (t = this.pos++), t >= this.enc.length) throw "Requesting byte offset " + t + " on a stream of length " + this.enc.length;
return this.enc[t]
}, t.prototype.hexDigits = "0123456789ABCDEF", t.prototype.hexByte = function(t) {
return this.hexDigits.charAt(t >> 4 & 15) + this.hexDigits.charAt(15 & t)
}, t.prototype.hexDump = function(t, e) {
for (var n = "", i = t; e > i; ++i) switch (n += this.hexByte(this.get(i)), 15 & i) {
case 7:
n += " ";
break;
case 15:
n += "\n";
break;
default:
n += " "
}
return n
}, t.prototype.parseStringISO = function(t, e) {
for (var n = "", i = t; e > i; ++i) n += String.fromCharCode(this.get(i));
return n
}, t.prototype.parseStringUTF = function(t, e) {
for (var n = "", i = 0, o = t; e > o;) {
var i = this.get(o++);
n += String.fromCharCode(128 > i ? i : i > 191 && 224 > i ? (31 & i) << 6 | 63 & this.get(o++) : (15 & i) << 12 | (63 & this.get(o++)) << 6 | 63 & this.get(o++))
}
return n
}, t.prototype.reTime = /^((?:1[89]|2\d)?\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/, t.prototype.parseTime = function(t, e) {
var n = this.parseStringISO(t, e),
i = this.reTime.exec(n);
return i ? (n = i[1] + "-" + i[2] + "-" + i[3] + " " + i[4], i[5] && (n += ":" + i[5], i[6] && (n += ":" + i[6], i[7] && (n += "." + i[7]))), i[8] && (n += " UTC", "Z" != i[8] && (n += i[8], i[9] && (n += ":" + i[9]))), n) : "Unrecognized time: " + n
}, t.prototype.parseInteger = function(t, e) {
var n = e - t;
if (n > 4) {
n <<= 3;
var i = this.get(t);
if (0 == i) n -= 8;
else
for (; 128 > i;) i <<= 1, --n;
return "(" + n + " bit)"
}
for (var o = 0, r = t; e > r; ++r) o = o << 8 | this.get(r);
return o
}, t.prototype.parseBitString = function(t, e) {
var n = this.get(t),
i = (e - t - 1 << 3) - n,
o = "(" + i + " bit)";
if (20 >= i) {
var r = n;
o += " ";
for (var s = e - 1; s > t; --s) {
for (var a = this.get(s), c = r; 8 > c; ++c) o += a >> c & 1 ? "1" : "0";
r = 0
}
}
return o
}, t.prototype.parseOctetString = function(t, e) {
var n = e - t,
i = "(" + n + " byte) ";
n > 20 && (e = t + 20);
for (var o = t; e > o; ++o) i += this.hexByte(this.get(o));
return n > 20 && (i += String.fromCharCode(8230)), i
}, t.prototype.parseOID = function(t, e) {
for (var n, i = 0, o = 0, r = t; e > r; ++r) {
var s = this.get(r);
i = i << 7 | 127 & s, o += 7, 128 & s || (void 0 == n ? n = parseInt(i / 40) + "." + i % 40 : n += "." + (o >= 31 ? "bigint" : i), i = o = 0), n += String.fromCharCode()
}
return n
}, e.prototype.typeName = function() {
if (void 0 == this.tag) return "unknown";
var t = this.tag >> 6,
e = (this.tag >> 5 & 1, 31 & this.tag);
switch (t) {
case 0:
switch (e) {
case 0:
return "EOC";
case 1:
return "BOOLEAN";
case 2:
return "INTEGER";
case 3:
return "BIT_STRING";
case 4:
return "OCTET_STRING";
case 5:
return "NULL";
case 6:
return "OBJECT_IDENTIFIER";
case 7:
return "ObjectDescriptor";
case 8:
return "EXTERNAL";
case 9:
return "REAL";
case 10:
return "ENUMERATED";
case 11:
return "EMBEDDED_PDV";
case 12:
return "UTF8String";
case 16:
return "SEQUENCE";
case 17:
return "SET";
case 18:
return "NumericString";
case 19:
return "PrintableString";
case 20:
return "TeletexString";
case 21:
return "VideotexString";
case 22:
return "IA5String";
case 23:
return "UTCTime";
case 24:
return "GeneralizedTime";
case 25:
return "GraphicString";
case 26:
return "VisibleString";
case 27:
return "GeneralString";
case 28:
return "UniversalString";
case 30:
return "BMPString";
default:
return "Universal_" + e.toString(16)
}
case 1:
return "Application_" + e.toString(16);
case 2:
return "[" + e + "]";
case 3:
return "Private_" + e.toString(16)
}
}, e.prototype.content = function() {
if (void 0 == this.tag) return null;
var t = this.tag >> 6;
if (0 != t) return null == this.sub ? null : "(" + this.sub.length + ")";
var e = 31 & this.tag,
n = this.posContent(),
i = Math.abs(this.length);
switch (e) {
case 1:
return 0 == this.stream.get(n) ? "false" : "true";
case 2:
return this.stream.parseInteger(n, n + i);
case 3:
return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(n, n + i);
case 4:
return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(n, n + i);
case 6:
return this.stream.parseOID(n, n + i);
case 16:
case 17:
return "(" + this.sub.length + " elem)";
case 12:
return this.stream.parseStringUTF(n, n + i);
case 18:
case 19:
case 20:
case 21:
case 22:
case 26:
return this.stream.parseStringISO(n, n + i);
case 23:
case 24:
return this.stream.parseTime(n, n + i)
}
return null
}, e.prototype.toString = function() {
return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (null == this.sub ? "null" : this.sub.length) + "]"
}, e.prototype.print = function(t) {
if (void 0 == t && (t = ""), document.writeln(t + this), null != this.sub) {
t += " ";
for (var e = 0, n = this.sub.length; n > e; ++e) this.sub[e].print(t)
}
}, e.prototype.toPrettyString = function(t) {
void 0 == t && (t = "");
var e = t + this.typeName() + " @" + this.stream.pos;
if (this.length >= 0 && (e += "+"), e += this.length, 32 & this.tag ? e += " (constructed)" : 3 != this.tag && 4 != this.tag || null == this.sub || (e += " (encapsulates)"), e += "\n", null != this.sub) {
t += " ";
for (var n = 0, i = this.sub.length; i > n; ++n) e += this.sub[n].toPrettyString(t)
}
return e
}, e.prototype.posStart = function() {
return this.stream.pos
}, e.prototype.posContent = function() {
return this.stream.pos + this.header
}, e.prototype.posEnd = function() {
return this.stream.pos + this.header + Math.abs(this.length)
}, e.decodeLength = function(t) {
var e = t.get(),
n = 127 & e;
if (n == e) return n;
if (n > 3) throw "Length over 24 bits not supported at position " + (t.pos - 1);
if (0 == n) return -1;
e = 0;
for (var i = 0; n > i; ++i) e = e << 8 | t.get();
return e
}, e.hasContent = function(n, i, o) {
if (32 & n) return !0;
if (3 > n || n > 4) return !1;
var r = new t(o);
3 == n && r.get();
var s = r.get();
if (s >> 6 & 1) return !1;
try {
var a = e.decodeLength(r);
return r.pos - o.pos + a == i
} catch (c) {
return !1
}
}, e.decode = function(n) {
n instanceof t || (n = new t(n, 0));
var i = new t(n),
o = n.get(),
r = e.decodeLength(n),
s = n.pos - i.pos,
a = null;
if (e.hasContent(o, r, n)) {
var c = n.pos;
if (3 == o && n.get(), a = [], r >= 0) {
for (var u = c + r; n.pos < u;) a[a.length] = e.decode(n);
if (n.pos != u) throw "Content size is not correct for container starting at offset " + c
} else try {
for (;;) {
var l = e.decode(n);
if (0 == l.tag) break;
a[a.length] = l
}
r = c - n.pos
} catch (h) {
throw "Exception while decoding undefined length content: " + h
}
} else n.pos += r;
return new e(i, s, r, o, a)
};
var tt, et = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
nt = "=",
it = 0xdeadbeefcafe,
ot = 15715070 == (16777215 & it);
ot && "Microsoft Internet Explorer" == navigator.appName ? (r.prototype.am = c, tt = 30) : ot && "Netscape" != navigator.appName ? (r.prototype.am = a, tt = 26) : (r.prototype.am = u, tt = 28), r.prototype.DB = tt, r.prototype.DM = (1 << tt) - 1, r.prototype.DV = 1 << tt;
var rt = 52;
r.prototype.FV = Math.pow(2, rt), r.prototype.F1 = rt - tt, r.prototype.F2 = 2 * tt - rt;
var st, at, ct = "0123456789abcdefghijklmnopqrstuvwxyz",
ut = new Array;
for (st = "0".charCodeAt(0), at = 0; 9 >= at; ++at) ut[st++] = at;
for (st = "a".charCodeAt(0), at = 10; 36 > at; ++at) ut[st++] = at;
for (st = "A".charCodeAt(0), at = 10; 36 > at; ++at) ut[st++] = at;
R.prototype.convert = D, R.prototype.revert = M, R.prototype.reduce = U, R.prototype.mulTo = k, R.prototype.sqrTo = F, j.prototype.convert = B, j.prototype.revert = V, j.prototype.reduce = H, j.prototype.mulTo = z, j.prototype.sqrTo = Y, r.prototype.copyTo = p, r.prototype.fromInt = f, r.prototype.fromString = m, r.prototype.clamp = y, r.prototype.dlShiftTo = A, r.prototype.drShiftTo = C, r.prototype.lShiftTo = N, r.prototype.rShiftTo = T, r.prototype.subTo = S, r.prototype.multiplyTo = O, r.prototype.squareTo = x, r.prototype.divRemTo = I, r.prototype.invDigit = L, r.prototype.isEven = G, r.prototype.exp = W, r.prototype.toString = g, r.prototype.negate = v, r.prototype.abs = _, r.prototype.compareTo = b, r.prototype.bitLength = w, r.prototype.mod = P, r.prototype.modPowInt = q, r.ZERO = d(0), r.ONE = d(1), $.prototype.doPublic = X, $.prototype.setPublic = Z, $.prototype.encrypt = J;
var lt = {
cipher: {},
hash: {},
keyexchange: {},
mode: {},
misc: {},
codec: {},
exception: {
corrupt: function(t) {
this.toString = function() {
return "CORRUPT: " + this.message
}, this.message = t
},
invalid: function(t) {
this.toString = function() {
return "INVALID: " + this.message
}, this.message = t
},
bug: function(t) {
this.toString = function() {
return "BUG: " + this.message
}, this.message = t
},
notReady: function(t) {
this.toString = function() {
return "NOT READY: " + this.message
}, this.message = t
}
}
};
"undefined" != typeof module && module.exports && (module.exports = lt), lt.cipher.aes = function(t) {
this._tables[0][0][0] || this._precompute();
var e, n, i, o, r, s = this._tables[0][4],
a = this._tables[1],
c = t.length,
u = 1;
if (4 !== c && 6 !== c && 8 !== c) throw new lt.exception.invalid("invalid aes key size");
for (this._key = [o = t.slice(0), r = []], e = c; 4 * c + 28 > e; e++) i = o[e - 1], (e % c === 0 || 8 === c && e % c === 4) && (i = s[i >>> 24] << 24 ^ s[i >> 16 & 255] << 16 ^ s[i >> 8 & 255] << 8 ^ s[255 & i], e % c === 0 && (i = i << 8 ^ i >>> 24 ^ u << 24, u = u << 1 ^ 283 * (u >> 7))), o[e] = o[e - c] ^ i;
for (n = 0; e; n++, e--) i = o[3 & n ? e : e - 4], r[n] = 4 >= e || 4 > n ? i : a[0][s[i >>> 24]] ^ a[1][s[i >> 16 & 255]] ^ a[2][s[i >> 8 & 255]] ^ a[3][s[255 & i]]
}, lt.cipher.aes.prototype = {
encrypt: function(t) {
return this._crypt(t, 0)
},
decrypt: function(t) {
return this._crypt(t, 1)
},
_tables: [
[
[],
[],
[],
[],
[]
],
[
[],
[],
[],
[],
[]
]
],
_precompute: function() {
var t, e, n, i, o, r, s, a, c, u = this._tables[0],
l = this._tables[1],
h = u[4],
p = l[4],
f = [],
d = [];
for (t = 0; 256 > t; t++) d[(f[t] = t << 1 ^ 283 * (t >> 7)) ^ t] = t;
for (e = n = 0; !h[e]; e ^= i || 1, n = d[n] || 1)
for (s = n ^ n << 1 ^ n << 2 ^ n << 3 ^ n << 4, s = s >> 8 ^ 255 & s ^ 99, h[e] = s, p[s] = e, r = f[o = f[i = f[e]]], c = 16843009 * r ^ 65537 * o ^ 257 * i ^ 16843008 * e, a = 257 * f[s] ^ 16843008 * s, t = 0; 4 > t; t++) u[t][e] = a = a << 24 ^ a >>> 8, l[t][s] = c = c << 24 ^ c >>> 8;
for (t = 0; 5 > t; t++) u[t] = u[t].slice(0), l[t] = l[t].slice(0)
},
_crypt: function(t, e) {
if (4 !== t.length) throw new lt.exception.invalid("invalid aes block size");
var n, i, o, r, s = this._key[e],
a = t[0] ^ s[0],
c = t[e ? 3 : 1] ^ s[1],
u = t[2] ^ s[2],
l = t[e ? 1 : 3] ^ s[3],
h = s.length / 4 - 2,
p = 4,
f = [0, 0, 0, 0],
d = this._tables[e],
m = d[0],
y = d[1],
g = d[2],
v = d[3],
_ = d[4];
for (r = 0; h > r; r++) n = m[a >>> 24] ^ y[c >> 16 & 255] ^ g[u >> 8 & 255] ^ v[255 & l] ^ s[p], i = m[c >>> 24] ^ y[u >> 16 & 255] ^ g[l >> 8 & 255] ^ v[255 & a] ^ s[p + 1], o = m[u >>> 24] ^ y[l >> 16 & 255] ^ g[a >> 8 & 255] ^ v[255 & c] ^ s[p + 2], l = m[l >>> 24] ^ y[a >> 16 & 255] ^ g[c >> 8 & 255] ^ v[255 & u] ^ s[p + 3], p += 4, a = n, c = i, u = o;
for (r = 0; 4 > r; r++) f[e ? 3 & -r : r] = _[a >>> 24] << 24 ^ _[c >> 16 & 255] << 16 ^ _[u >> 8 & 255] << 8 ^ _[255 & l] ^ s[p++], n = a, a = c, c = u, u = l, l = n;
return f
}
}, lt.bitArray = {
bitSlice: function(t, e, n) {
return t = lt.bitArray._shiftRight(t.slice(e / 32), 32 - (31 & e)).slice(1), void 0 === n ? t : lt.bitArray.clamp(t, n - e)
},
extract: function(t, e, n) {
var i, o = Math.floor(-e - n & 31);
return i = -32 & (e + n - 1 ^ e) ? t[e / 32 | 0] << 32 - o ^ t[e / 32 + 1 | 0] >>> o : t[e / 32 | 0] >>> o, i & (1 << n) - 1
},
concat: function(t, e) {
if (0 === t.length || 0 === e.length) return t.concat(e);
var n = t[t.length - 1],
i = lt.bitArray.getPartial(n);
return 32 === i ? t.concat(e) : lt.bitArray._shiftRight(e, i, 0 | n, t.slice(0, t.length - 1))
},
bitLength: function(t) {
var e, n = t.length;
return 0 === n ? 0 : (e = t[n - 1], 32 * (n - 1) + lt.bitArray.getPartial(e))
},
clamp: function(t, e) {
if (32 * t.length < e) return t;
t = t.slice(0, Math.ceil(e / 32));
var n = t.length;
return e = 31 & e, n > 0 && e && (t[n - 1] = lt.bitArray.partial(e, t[n - 1] & 2147483648 >> e - 1, 1)), t
},
partial: function(t, e, n) {
return 32 === t ? e : (n ? 0 | e : e << 32 - t) + 1099511627776 * t
},
getPartial: function(t) {
return Math.round(t / 1099511627776) || 32
},
equal: function(t, e) {
if (lt.bitArray.bitLength(t) !== lt.bitArray.bitLength(e)) return !1;
var n, i = 0;
for (n = 0; n < t.length; n++) i |= t[n] ^ e[n];
return 0 === i
},
_shiftRight: function(t, e, n, i) {
var o, r, s = 0;
for (void 0 === i && (i = []); e >= 32; e -= 32) i.push(n), n = 0;
if (0 === e) return i.concat(t);
for (o = 0; o < t.length; o++) i.push(n | t[o] >>> e), n = t[o] << 32 - e;
return s = t.length ? t[t.length - 1] : 0, r = lt.bitArray.getPartial(s), i.push(lt.bitArray.partial(e + r & 31, e + r > 32 ? n : i.pop(), 1)), i
},
_xor4: function(t, e) {
return [t[0] ^ e[0], t[1] ^ e[1], t[2] ^ e[2], t[3] ^ e[3]]
}
}, lt.codec.hex = {
fromBits: function(t) {
var e, n = "";
for (e = 0; e < t.length; e++) n += ((0 | t[e]) + 0xf00000000000).toString(16).substr(4);
return n.substr(0, lt.bitArray.bitLength(t) / 4)
},
toBits: function(t) {
var e, n, i = [];
for (t = t.replace(/\s|0x/g, ""), n = t.length, t += "00000000", e = 0; e < t.length; e += 8) i.push(0 ^ parseInt(t.substr(e, 8), 16));
return lt.bitArray.clamp(i, 4 * n)
}
}, lt.codec.utf8String = {
fromBits: function(t) {
var e, n, i = "",
o = lt.bitArray.bitLength(t);
for (e = 0; o / 8 > e; e++) 0 === (3 & e) && (n = t[e / 4]), i += String.fromCharCode(n >>> 24), n <<= 8;
return decodeURIComponent(escape(i))
},
toBits: function(t) {
t = unescape(encodeURIComponent(t));
var e, n = [],
i = 0;
for (e = 0; e < t.length; e++) i = i << 8 | t.charCodeAt(e), 3 === (3 & e) && (n.push(i), i = 0);
return 3 & e && n.push(lt.bitArray.partial(8 * (3 & e), i)), n
}
}, lt.codec.base64 = {
_chars: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
fromBits: function(t, e, n) {
var i, o = "",
r = 0,
s = lt.codec.base64._chars,
a = 0,
c = lt.bitArray.bitLength(t);
for (n && (s = s.substr(0, 62) + "-_"), i = 0; 6 * o.length < c;) o += s.charAt((a ^ t[i] >>> r) >>> 26), 6 > r ? (a = t[i] << 6 - r, r += 26, i++) : (a <<= 6, r -= 6);
for (; 3 & o.length && !e;) o += "=";
return o
},
toBits: function(t, e) {
t = t.replace(/\s|=/g, "");
var n, i, o = [],
r = 0,
s = lt.codec.base64._chars,
a = 0;
for (e && (s = s.substr(0, 62) + "-_"), n = 0; n < t.length; n++) {
if (i = s.indexOf(t.charAt(n)), 0 > i) throw new lt.exception.invalid("this isn't base64!");
r > 26 ? (r -= 26, o.push(a ^ i >>> r), a = i << 32 - r) : (r += 6, a ^= i << 32 - r)
}
return 56 & r && o.push(lt.bitArray.partial(56 & r, a, 1)), o
}
}, lt.codec.base64url = {
fromBits: function(t) {
return lt.codec.base64.fromBits(t, 1, 1)
},
toBits: function(t) {
return lt.codec.base64.toBits(t, 1)
}
}, void 0 === lt.beware && (lt.beware = {}), lt.beware["CBC mode is dangerous because it doesn't protect message integrity."] = function() {
lt.mode.cbc = {
name: "cbc",
encrypt: function(t, e, n, i) {
if (i && i.length) throw new lt.exception.invalid("cbc can't authenticate data");
if (128 !== lt.bitArray.bitLength(n)) throw new lt.exception.invalid("cbc iv must be 128 bits");
var o, r = lt.bitArray,
s = r._xor4,
a = r.bitLength(e),
c = 0,
u = [];
if (7 & a) throw new lt.exception.invalid("pkcs#5 padding only works for multiples of a byte");
for (o = 0; a >= c + 128; o += 4, c += 128) n = t.encrypt(s(n, e.slice(o, o + 4))), u.splice(o, 0, n[0], n[1], n[2], n[3]);
return a = 16843009 * (16 - (a >> 3 & 15)), n = t.encrypt(s(n, r.concat(e, [a, a, a, a]).slice(o, o + 4))), u.splice(o, 0, n[0], n[1], n[2], n[3]), u
},
decrypt: function(t, e, n, i) {
if (i && i.length) throw new lt.exception.invalid("cbc can't authenticate data");
if (128 !== lt.bitArray.bitLength(n)) throw new lt.exception.invalid("cbc iv must be 128 bits");
if (127 & lt.bitArray.bitLength(e) || !e.length) throw new lt.exception.corrupt("cbc ciphertext must be a positive multiple of the block size");
var o, r, s, a = lt.bitArray,
c = a._xor4,
u = [];
for (i = i || [], o = 0; o < e.length; o += 4) r = e.slice(o, o + 4), s = c(n, t.decrypt(r)), u.splice(o, 0, s[0], s[1], s[2], s[3]), n = r;
if (r = 255 & u[o - 1], 0 == r || r > 16) throw new lt.exception.corrupt("pkcs#5 padding corrupt");
if (s = 16843009 * r, !a.equal(a.bitSlice([s, s, s, s], 0, 8 * r), a.bitSlice(u, 32 * u.length - 8 * r, 32 * u.length))) throw new lt.exception.corrupt("pkcs#5 padding corrupt");
return a.bitSlice(u, 0, 32 * u.length - 8 * r)
}
}
}, lt.misc.hmac = function(t, e) {
this._hash = e = e || lt.hash.sha256;
var n, i = [
[],
[]
],
o = e.prototype.blockSize / 32;
for (this._baseHash = [new e, new e], t.length > o && (t = e.hash(t)), n = 0; o > n; n++) i[0][n] = 909522486 ^ t[n], i[1][n] = 1549556828 ^ t[n];
this._baseHash[0].update(i[0]), this._baseHash[1].update(i[1])
}, lt.misc.hmac.prototype.encrypt = lt.misc.hmac.prototype.mac = function(t, e) {
var n = new this._hash(this._baseHash[0]).update(t, e).finalize();
return new this._hash(this._baseHash[1]).update(n).finalize()
}, lt.hash.sha256 = function(t) {
this._key[0] || this._precompute(), t ? (this._h = t._h.slice(0), this._buffer = t._buffer.slice(0), this._length = t._length) : this.reset()
}, lt.hash.sha256.hash = function(t) {
return (new lt.hash.sha256).update(t).finalize()
}, lt.hash.sha256.prototype = {
blockSize: 512,
reset: function() {
return this._h = this._init.slice(0), this._buffer = [], this._length = 0, this
},
update: function(t) {
"string" == typeof t && (t = lt.codec.utf8String.toBits(t));
var e, n = this._buffer = lt.bitArray.concat(this._buffer, t),
i = this._length,
o = this._length = i + lt.bitArray.bitLength(t);
for (e = 512 + i & -512; o >= e; e += 512) this._block(n.splice(0, 16));
return this
},
finalize: function() {
var t, e = this._buffer,
n = this._h;
for (e = lt.bitArray.concat(e, [lt.bitArray.partial(1, 1)]), t = e.length + 2; 15 & t; t++) e.push(0);
for (e.push(Math.floor(this._length / 4294967296)), e.push(0 | this._length); e.length;) this._block(e.splice(0, 16));
return this.reset(), n
},
_init: [],
_key: [],
_precompute: function() {
function t(t) {
return 4294967296 * (t - Math.floor(t)) | 0
}
var e, n = 0,
i = 2;
t: for (; 64 > n; i++) {
for (e = 2; i >= e * e; e++)
if (i % e === 0) continue t;
8 > n && (this._init[n] = t(Math.pow(i, .5))), this._key[n] = t(Math.pow(i, 1 / 3)), n++
}
},
_block: function(t) {
var e, n, i, o, r = t.slice(0),
s = this._h,
a = this._key,
c = s[0],
u = s[1],
l = s[2],
h = s[3],
p = s[4],
f = s[5],
d = s[6],
m = s[7];
for (e = 0; 64 > e; e++) 16 > e ? n = r[e] : (i = r[e + 1 & 15], o = r[e + 14 & 15], n = r[15 & e] = (i >>> 7 ^ i >>> 18 ^ i >>> 3 ^ i << 25 ^ i << 14) + (o >>> 17 ^ o >>> 19 ^ o >>> 10 ^ o << 15 ^ o << 13) + r[15 & e] + r[e + 9 & 15] | 0), n = n + m + (p >>> 6 ^ p >>> 11 ^ p >>> 25 ^ p << 26 ^ p << 21 ^ p << 7) + (d ^ p & (f ^ d)) + a[e], m = d, d = f, f = p, p = h + n | 0, h = l, l = u, u = c, c = n + (u & l ^ h & (u ^ l)) + (u >>> 2 ^ u >>> 13 ^ u >>> 22 ^ u << 30 ^ u << 19 ^ u << 10) | 0;
s[0] = s[0] + c | 0, s[1] = s[1] + u | 0, s[2] = s[2] + l | 0, s[3] = s[3] + h | 0, s[4] = s[4] + p | 0, s[5] = s[5] + f | 0, s[6] = s[6] + d | 0, s[7] = s[7] + m | 0
}
}, lt.random = {
randomWords: function(t, e) {
var n, i, o = [],
r = this.isReady(e);
if (r === this._NOT_READY) throw new lt.exception.notReady("generator isn't seeded");
for (r & this._REQUIRES_RESEED && this._reseedFromPools(!(r & this._READY)), n = 0; t > n; n += 4)(n + 1) % this._MAX_WORDS_PER_BURST === 0 && this._gate(), i = this._gen4words(), o.push(i[0], i[1], i[2], i[3]);
return this._gate(), o.slice(0, t)
},
setDefaultParanoia: function(t) {
this._defaultParanoia = t
},
addEntropy: function(t, e, n) {
n = n || "user";
var i, o, r, s = (new Date).valueOf(),
a = this._robins[n],
c = this.isReady(),
u = 0;
switch (i = this._collectorIds[n], void 0 === i && (i = this._collectorIds[n] = this._collectorIdNext++), void 0 === a && (a = this._robins[n] = 0), this._robins[n] = (this._robins[n] + 1) % this._pools.length, typeof t) {
case "number":
void 0 === e && (e = 1), this._pools[a].update([i, this._eventId++, 1, e, s, 1, 0 | t]);
break;
case "object":
var l = Object.prototype.toString.call(t);
if ("[object Uint32Array]" === l) {
for (r = [], o = 0; o < t.length; o++) r.push(t[o]);
t = r
} else
for ("[object Array]" !== l && (u = 1), o = 0; o < t.length && !u; o++) "number" != typeof t[o] && (u = 1);
if (!u) {
if (void 0 === e)
for (e = 0, o = 0; o < t.length; o++)
for (r = t[o]; r > 0;) e++, r >>>= 1;
this._pools[a].update([i, this._eventId++, 2, e, s, t.length].concat(t))
}
break;
case "string":
void 0 === e && (e = t.length), this._pools[a].update([i, this._eventId++, 3, e, s, t.length]), this._pools[a].update(t);
break;
default:
u = 1
}
if (u) throw new lt.exception.bug("random: addEntropy only supports number, array of numbers or string");
this._poolEntropy[a] += e, this._poolStrength += e, c === this._NOT_READY && (this.isReady() !== this._NOT_READY && this._fireEvent("seeded", Math.max(this._strength, this._poolStrength)), this._fireEvent("progress", this.getProgress()))
},
isReady: function(t) {
var e = this._PARANOIA_LEVELS[void 0 !== t ? t : this._defaultParanoia];
return this._strength && this._strength >= e ? this._poolEntropy[0] > this._BITS_PER_RESEED && (new Date).valueOf() > this._nextReseed ? this._REQUIRES_RESEED | this._READY : this._READY : this._poolStrength >= e ? this._REQUIRES_RESEED | this._NOT_READY : this._NOT_READY
},
getProgress: function(t) {
var e = this._PARANOIA_LEVELS[t ? t : this._defaultParanoia];
return this._strength >= e ? 1 : this._poolStrength > e ? 1 : this._poolStrength / e
},
startCollectors: function() {
if (!this._collectorsStarted) {
if (window.addEventListener) window.addEventListener("load", this._loadTimeCollector, !1), window.addEventListener("mousemove", this._mouseCollector, !1);
else {
if (!document.attachEvent) throw new lt.exception.bug("can't attach event");
document.attachEvent("onload", this._loadTimeCollector), document.attachEvent("onmousemove", this._mouseCollector)
}
this._collectorsStarted = !0
}
},
stopCollectors: function() {
this._collectorsStarted && (window.removeEventListener ? (window.removeEventListener("load", this._loadTimeCollector, !1), window.removeEventListener("mousemove", this._mouseCollector, !1)) : window.detachEvent && (window.detachEvent("onload", this._loadTimeCollector), window.detachEvent("onmousemove", this._mouseCollector)), this._collectorsStarted = !1)
},
addEventListener: function(t, e) {
this._callbacks[t][this._callbackI++] = e
},
removeEventListener: function(t, e) {
var n, i, o = this._callbacks[t],
r = [];
for (i in o) o.hasOwnProperty(i) && o[i] === e && r.push(i);
for (n = 0; n < r.length; n++) i = r[n], delete o[i]
},
_pools: [new lt.hash.sha256],
_poolEntropy: [0],
_reseedCount: 0,
_robins: {},
_eventId: 0,
_collectorIds: {},
_collectorIdNext: 0,
_strength: 0,
_poolStrength: 0,
_nextReseed: 0,
_key: [0, 0, 0, 0, 0, 0, 0, 0],
_counter: [0, 0, 0, 0],
_cipher: void 0,
_defaultParanoia: 6,
_collectorsStarted: !1,
_callbacks: {
progress: {},
seeded: {}
},
_callbackI: 0,
_NOT_READY: 0,
_READY: 1,
_REQUIRES_RESEED: 2,
_MAX_WORDS_PER_BURST: 65536,
_PARANOIA_LEVELS: [0, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024],
_MILLISECONDS_PER_RESEED: 3e4,
_BITS_PER_RESEED: 80,
_gen4words: function() {
for (var t = 0; 4 > t && (this._counter[t] = this._counter[t] + 1 | 0, !this._counter[t]); t++);
return this._cipher.encrypt(this._counter)
},
_gate: function() {
this._key = this._gen4words().concat(this._gen4words()), this._cipher = new lt.cipher.aes(this._key)
},
_reseed: function(t) {
this._key = lt.hash.sha256.hash(this._key.concat(t)), this._cipher = new lt.cipher.aes(this._key);
for (var e = 0; 4 > e && (this._counter[e] = this._counter[e] + 1 | 0, !this._counter[e]); e++);
},
_reseedFromPools: function(t) {
var e, n = [],
i = 0;
for (this._nextReseed = n[0] = (new Date).valueOf() + this._MILLISECONDS_PER_RESEED, e = 0; 16 > e; e++) n.push(4294967296 * Math.random() | 0);
for (e = 0; e < this._pools.length && (n = n.concat(this._pools[e].finalize()), i += this._poolEntropy[e], this._poolEntropy[e] = 0, t || !(this._reseedCount & 1 << e)); e++);
this._reseedCount >= 1 << this._pools.length && (this._pools.push(new lt.hash.sha256), this._poolEntropy.push(0)), this._poolStrength -= i, i > this._strength && (this._strength = i), this._reseedCount++, this._reseed(n)
},
_mouseCollector: function(t) {
var e = t.x || t.clientX || t.offsetX || 0,
n = t.y || t.clientY || t.offsetY || 0;
lt.random.addEntropy([e, n], 2, "mouse")
},
_loadTimeCollector: function(t) {
lt.random.addEntropy((new Date).valueOf(), 2, "loadtime")
},
_fireEvent: function(t, e) {
var n, i = lt.random._callbacks[t],
o = [];
for (n in i) i.hasOwnProperty(n) && o.push(i[n]);
for (n = 0; n < o.length; n++) o[n](e)
}
},
function() {
try {
var t = new Uint32Array(32);
crypto.getRandomValues(t), lt.random.addEntropy(t, 1024, "crypto.getRandomValues")
} catch (e) {}
}(),
function() {
for (var t in lt.beware) lt.beware.hasOwnProperty(t) && lt.beware[t]()
}();
var ht = {
sjcl: lt,
version: "1.3.10"
};
ht.generateAesKey = function() {
return {
key: lt.random.randomWords(8, 0),
encrypt: function(t) {
return this.encryptWithIv(t, lt.random.randomWords(4, 0))
},
encryptWithIv: function(t, e) {
var n = new lt.cipher.aes(this.key),
i = lt.codec.utf8String.toBits(t),
o = lt.mode.cbc.encrypt(n, i, e),
r = lt.bitArray.concat(e, o);
return lt.codec.base64.fromBits(r)
}
}
}, ht.create = function(t) {
return new ht.EncryptionClient(t)
}, ht.EncryptionClient = function(t) {
var i = this,
r = [];
i.publicKey = t, i.version = ht.version;
var s = function(t, e) {
var n, i, o;
n = document.createElement(t);
for (i in e) e.hasOwnProperty(i) && (o = e[i], n.setAttribute(i, o));
return n
},
a = function(t) {
return window.jQuery && t instanceof jQuery ? t[0] : t.nodeType && 1 === t.nodeType ? t : document.getElementById(t)
},
c = function(t) {
var e, n, i, o, r = [];
if ("INTEGER" === t.typeName() && (e = t.posContent(), n = t.posEnd(), i = t.stream.hexDump(e, n).replace(/[ \n]/g, ""), r.push(i)), null !== t.sub)
for (o = 0; o < t.sub.length; o++) r = r.concat(c(t.sub[o]));
return r
},
u = function(t) {
var e, n, i = [],
o = t.children;
for (n = 0; n < o.length; n++) e = o[n], 1 === e.nodeType && e.attributes["data-encrypted-name"] ? i.push(e) : e.children && e.children.length > 0 && (i = i.concat(u(e)));
return i
},
l = function() {
var n, i, r, s, a, u;
try {
a = o(t), n = e.decode(a)
} catch (l) {
throw "Invalid encryption key. Please use the key labeled 'Client-Side Encryption Key'"
}
if (r = c(n), 2 !== r.length) throw "Invalid encryption key. Please use the key labeled 'Client-Side Encryption Key'";
return s = r[0], i = r[1], u = new $, u.setPublic(s, i), u
},
h = function() {
return {
key: lt.random.randomWords(8, 0),
sign: function(t) {
var e = new lt.misc.hmac(this.key, lt.hash.sha256),
n = e.encrypt(t);
return lt.codec.base64.fromBits(n)
}
}
};
i.encrypt = function(t) {
var e = l(),
o = ht.generateAesKey(),
r = h(),
s = o.encrypt(t),
a = r.sign(lt.codec.base64.toBits(s)),
c = lt.bitArray.concat(o.key, r.key),
u = lt.codec.base64.fromBits(c),
p = e.encrypt(u),
f = "$bt4|javascript_" + i.version.replace(/\./g, "_") + "$",
d = null;
return p && (d = n(p)), f + d + "$" + s + "$" + a
}, i.encryptForm = function(t) {
var e, n, o, c, l, h;
for (t = a(t), h = u(t); r.length > 0;) {
try {
t.removeChild(r[0])
} catch (p) {}
r.splice(0, 1)
}
for (l = 0; l < h.length; l++) e = h[l], o = e.getAttribute("data-encrypted-name"), n = i.encrypt(e.value), e.removeAttribute("name"), c = s("input", {
value: n,
type: "hidden",
name: o
}), r.push(c), t.appendChild(c)
}, i.onSubmitEncryptForm = function(t, e) {
var n;
t = a(t), n = function(n) {
return i.encryptForm(t), e ? e(n) : n
}, window.jQuery ? window.jQuery(t).submit(n) : t.addEventListener ? t.addEventListener("submit", n, !1) : t.attachEvent && t.attachEvent("onsubmit", n)
}, i.formEncrypter = {
encryptForm: i.encryptForm,
extractForm: a,
onSubmitEncryptForm: i.onSubmitEncryptForm
}, lt.random.startCollectors()
}, window.Braintree = ht;
}(),
function(t) {
if ("object" == typeof exports && "undefined" != typeof module) module.exports = t();
else if ("function" == typeof define && define.amd) define([], t);
else {
var e;
e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, e.braintree = t()
}
}(function() {
var t;
return function e(t, n, i) {
function o(s, a) {
if (!n[s]) {
if (!t[s]) {
var c = "function" == typeof require && require;
if (!a && c) return c(s, !0);
if (r) return r(s, !0);
var u = new Error("Cannot find module '" + s + "'");
throw u.code = "MODULE_NOT_FOUND", u
}
var l = n[s] = {
exports: {}
};
t[s][0].call(l.exports, function(e) {
var n = t[s][1][e];
return o(n ? n : e)
}, l, l.exports, e, t, n, i)
}
return n[s].exports
}
for (var r = "function" == typeof require && require, s = 0; s < i.length; s++) o(i[s]);
return o
}({
1: [function(t, e, n) {
(function(n) {
"use strict";
function i(t) {
var e = t.analyticsConfiguration || {},
i = n.braintree ? n.braintree.VERSION : null,
o = i ? "braintree/web/" + i : "";
return {
sdkVersion: e.sdkVersion || o,
merchantAppId: e.merchantAppId || n.location.host
}
}
function o(t) {
var e, n, o;
this.attrs = {}, t.hasOwnProperty("sharedCustomerIdentifier") && (this.attrs.sharedCustomerIdentifier = t.sharedCustomerIdentifier), e = a(t.clientToken), o = i(t), this.driver = t.driver || m({
enableCORS: y(t)
}), this.analyticsUrl = e.analytics ? e.analytics.url : null, this.clientApiUrl = e.clientApiUrl, this.customerId = t.customerId, this.challenges = e.challenges, this.integration = t.integration || "", this.sdkVersion = o.sdkVersion, this.merchantAppId = o.merchantAppId, n = s.create(this, {
container: t.container,
clientToken: e
}), this.verify3DS = r(n.verify, n), this.attrs.sharedCustomerIdentifierType = t.sharedCustomerIdentifierType, this.attrs.braintreeLibraryVersion = this.sdkVersion, e.merchantAccountId && (this.attrs.merchantAccountId = e.merchantAccountId), t.clientKey ? this.attrs.clientKey = t.clientKey : e.authorizationFingerprint && (this.attrs.authorizationFingerprint = e.authorizationFingerprint), this.requestTimeout = t.hasOwnProperty("timeout") ? t.timeout : 6e4
}
var r = t(95),
s = t(26),
a = t(8),
c = t(13),
u = t(11),
l = t(5),
h = t(4),
p = t(2),
f = t(9),
d = t(7).normalizeCreditCardFields,
m = t(40).chooseDriver,
y = t(12),
g = t(3);
o.prototype.getCreditCards = function(t) {
this.driver.get(c.joinUrlFragments([this.clientApiUrl, "v1", "payment_methods"]), this.attrs, function(t) {
var e = 0,
n = t.paymentMethods.length,
i = [];
for (e; n > e; e++) i.push(new h(t.paymentMethods[e]));
return i
}, t, this.requestTimeout)
}, o.prototype.tokenizeCoinbase = function(t, e) {
t.options = {
validate: !1
}, this.addCoinbase(t, function(t, n) {
t ? e(t, null) : n && n.nonce ? e(t, n) : e("Unable to tokenize coinbase account.", null)
})
}, o.prototype.tokenizePayPalAccount = function(t, e) {
t.options = {
validate: !1
}, this.addPayPalAccount(t, function(t, n) {
t ? e(t, null) : n && n.nonce ? e(null, n) : e("Unable to tokenize paypal account.", null)
})
}, o.prototype.tokenizeCard = function(t, e) {
t.options = {
validate: !1
}, this.addCreditCard(t, function(t, n) {
n && n.nonce ? e(t, n.nonce, {
type: n.type,
details: n.details
}) : e("Unable to tokenize card.", null)
})
}, o.prototype.lookup3DS = function(t, e) {
var n = c.joinUrlFragments([this.clientApiUrl, "v1/payment_methods", t.nonce, "three_d_secure/lookup"]),
i = c.mergeOptions(this.attrs, {
amount: t.amount
});
this.driver.post(n, i, function(t) {
return t
}, e, this.requestTimeout)
}, o.prototype.createSEPAMandate = function(t, e) {
var n = c.mergeOptions(this.attrs, {
sepaMandate: t
});
this.driver.post(c.joinUrlFragments([this.clientApiUrl, "v1", "sepa_mandates.json"]), n, function(t) {
return {
sepaMandate: new u(t.europeBankAccounts[0].sepaMandates[0]),
sepaBankAccount: new l(t.europeBankAccounts[0])
}
}, e, this.requestTimeout)
}, o.prototype.getSEPAMandate = function(t, e) {
var n = c.mergeOptions(this.attrs, t);
this.driver.get(c.joinUrlFragments([this.clientApiUrl, "v1", "sepa_mandates.json"]), n, function(t) {
return {
sepaMandate: new u(t.sepaMandates[0])
}
}, e, this.requestTimeout)
}, o.prototype.addCoinbase = function(t, e) {
var n;
delete t.share, n = c.mergeOptions(this.attrs, {
coinbaseAccount: t,
_meta: {
integration: this.integration || "custom",
source: "coinbase"
}
}), this.driver.post(c.joinUrlFragments([this.clientApiUrl, "v1", "payment_methods/coinbase_accounts"]), n, function(t) {
return new p(t.coinbaseAccounts[0])
}, e, this.requestTimeout)
}, o.prototype.addPayPalAccount = function(t, e) {
var n;
delete t.share, n = c.mergeOptions(this.attrs, {
paypalAccount: t,
_meta: {
integration: this.integration || "paypal",
source: "paypal"
}
}), this.driver.post(c.joinUrlFragments([this.clientApiUrl, "v1", "payment_methods", "paypal_accounts"]), n, function(t) {
return new f(t.paypalAccounts[0])
}, e, this.requestTimeout)
}, o.prototype.addCreditCard = function(t, e) {
var n, i, o = t.share;
delete t.share, i = d(t), n = c.mergeOptions(this.attrs, {
share: o,
creditCard: i,
_meta: {
integration: this.integration || "custom",
source: "form"
}
}), this.driver.post(c.joinUrlFragments([this.clientApiUrl, "v1", "payment_methods/credit_cards"]), n, function(t) {
return new h(t.creditCards[0])
}, e, this.requestTimeout)
}, o.prototype.sendAnalyticsEvents = function(t, e) {
var i, o, r = this.analyticsUrl,
s = [];
if (t = c.isArray(t) ? t : [t], !r) return void(e && e(null, {}));
for (o in t) t.hasOwnProperty(o) && s.push({
kind: t[o]
});
i = c.mergeOptions(this.attrs, {
analytics: s,
_meta: {
merchantAppId: this.merchantAppId,
platform: "web",
platformVersion: n.navigator.userAgent,
integrationType: this.integration,
sdkVersion: this.sdkVersion
}
}), this.driver.post(r, i, function(t) {
return t
}, e, g.ANALYTICS_TIMEOUT_MS)
}, o.prototype.decryptBrowserswitchPayload = function(t, e) {
var n = c.mergeOptions(this.attrs, {
asymmetric_encrypted_payload: t
}),
i = c.joinUrlFragments([this.clientApiUrl, "/v1/paypal_browser_switch/decrypt"]);
this.driver.post(i, n, function(t) {
return t
}, e, this.requestTimeout)
}, o.prototype.encryptBrowserswitchReturnPayload = function(t, e, n) {
var i = c.mergeOptions(this.attrs, {
payload: t,
aesKey: e
}),
o = c.joinUrlFragments([this.clientApiUrl, "/v1/paypal_browser_switch/encrypt"]);
this.driver.post(o, i, function(t) {
return t
}, n, this.requestTimeout)
}, o.prototype.exchangePaypalTokenForConsentCode = function(t, e) {
var n = c.mergeOptions(this.attrs, t);
this.attrs.merchantAccountId && (n.merchant_account_id = this.attrs.merchantAccountId);
var i = c.joinUrlFragments([this.clientApiUrl, "/v1/paypal_account_service/merchant_consent"]);
this.driver.post(i, n, function(t) {
return t
}, e, this.requestTimeout)
}, o.prototype.getAmexRewardsBalance = function(t, e) {
var n = c.mergeOptions(this.attrs, t);
n.nonce && (n.payment_method_nonce = n.nonce, delete n.nonce), this.driver.get(c.joinUrlFragments([this.clientApiUrl, "v1/payment_methods/amex_rewards_balance"]), n, function(t) {
return t
}, e, this.requestTimeout)
}, o.prototype.getAmexExpressCheckoutNonceProfile = function(t, e) {
var n = c.mergeOptions(this.attrs, t);
n.nonce && (n.payment_method_nonce = n.nonce, delete n.nonce), this.driver.get(c.joinUrlFragments([this.clientApiUrl, "v1/payment_methods/amex_express_checkout_cards", n.payment_method_nonce]), n, function(t) {
return t
}, e, this.requestTimeout)
}, e.exports = o
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
11: 11,
12: 12,
13: 13,
2: 2,
26: 26,
3: 3,
4: 4,
40: 40,
5: 5,
7: 7,
8: 8,
9: 9,
95: 95
}],
2: [function(t, e, n) {
"use strict";
function i(t) {
var e, n;
for (e = 0; e < o.length; e++) n = o[e], this[n] = t[n]
}
var o = ["nonce", "type", "description", "details"];
e.exports = i
}, {}],
3: [function(t, e, n) {
"use strict";
var i = {
production: "https://api.braintreegateway.com:443",
sandbox: "https://api.sandbox.braintreegateway.com:443"
};
e.exports = {
apiUrls: i,
errors: {
UNKNOWN_ERROR: "Unknown error",
INVALID_TIMEOUT: "Timeout must be a number"
},
ANALYTICS_TIMEOUT_MS: 4e3
}
}, {}],
4: [function(t, e, n) {
"use strict";
function i(t) {
var e, n;
for (e = 0; e < o.length; e++) n = o[e], this[n] = t[n]
}
var o = ["billingAddress", "branding", "createdAt", "createdAtMerchant", "createdAtMerchantName", "details", "isLocked", "lastUsedAt", "lastUsedAtMerchant", "lastUsedAtMerchantName", "lastUsedByCurrentMerchant", "nonce", "securityQuestions", "type"];
e.exports = i
}, {}],
5: [function(t, e, n) {
"use strict";
function i(t) {
var e, n = ["bic", "maskedIBAN", "nonce", "accountHolderName"],
i = 0;
for (i = 0; i < n.length; i++) e = n[i], this[e] = t[e]
}
e.exports = i
}, {}],
6: [function(t, e, n) {
"use strict";
function i(t) {
var e = t.split("_"),
n = e[0],
i = e.slice(2).join("_");
return {
merchantId: i,
environment: n
}
}
function o(t, e) {
var n, o, l, h = a({
enableCORS: c(t)
}),
p = t.clientKey,
f = {};
p ? (f.clientKey = p, o = i(p), n = u.apiUrls[o.environment] + "/merchants/" + o.merchantId + "/client_api/v1/configuration") : (l = r(t.clientToken), l.authorizationFingerprint && (f.authorizationFingerprint = l.authorizationFingerprint, n = l.configUrl)), h.get(n, f, function(t) {
return s.mergeOptions(l, t)
}, e, t.timeout)
}
var r = t(8),
s = t(13),
a = t(40).chooseDriver,
c = t(12),
u = t(3);
e.exports = o
}, {
12: 12,
13: 13,
3: 3,
40: 40,
8: 8
}],
7: [function(t, e, n) {
"use strict";
function i(t) {
var e, n = {
billingAddress: t.billingAddress || {}
};
for (e in t)
if (t.hasOwnProperty(e)) switch (e.replace(/_/g, "").toLowerCase()) {
case "postalcode":
case "countryname":
case "countrycodenumeric":
case "countrycodealpha2":
case "countrycodealpha3":
case "region":
case "extendedaddress":
case "locality":
case "firstname":
case "lastname":
case "company":
case "streetaddress":
n.billingAddress[e] = t[e];
break;
default:
n[e] = t[e]
}
return n
}
e.exports = {
normalizeCreditCardFields: i
}
}, {}],
8: [function(t, e, n) {
"use strict";
function i(t) {
var e;
if (!t) throw new Error("Braintree API Client Misconfigured: clientToken required.");
if ("object" == typeof t && null !== t) e = t;
else {
try {
t = window.atob(t)
} catch (n) {}
try {
e = JSON.parse(t)
} catch (i) {
throw new Error("Braintree API Client Misconfigured: clientToken is not valid JSON.")
}
}
if (!e.hasOwnProperty("clientApiUrl") || !o.isWhitelistedDomain(e.clientApiUrl)) throw new Error("Braintree API Client Misconfigured: the clientApiUrl provided in the clientToken is invalid.");
return e
}
var o = t(57);
t(10), e.exports = i
}, {
10: 10,
57: 57
}],
9: [function(t, e, n) {
"use strict";
function i(t) {
var e, n;
for (e = 0; e < o.length; e++) n = o[e], this[n] = t[n]
}
var o = ["nonce", "type", "description", "details"];
e.exports = i
}, {}],
10: [function(t, e, n) {
(function(t) {
"use strict";
var n = function(t) {
var e = new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),
n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
i = "";
if (!e.test(t)) throw new Error("Non base64 encoded input passed to window.atob polyfill");
var o = 0;
do {
var r = n.indexOf(t.charAt(o++)),
s = n.indexOf(t.charAt(o++)),
a = n.indexOf(t.charAt(o++)),
c = n.indexOf(t.charAt(o++)),
u = (63 & r) << 2 | s >> 4 & 3,
l = (15 & s) << 4 | a >> 2 & 15,
h = (3 & a) << 6 | 63 & c;
i += String.fromCharCode(u) + (l ? String.fromCharCode(l) : "") + (h ? String.fromCharCode(h) : "")
} while (o < t.length);
return i
};
t.atob = t.atob || n, e.exports = {
atobPolyfill: n
}
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {}],
11: [function(t, e, n) {
"use strict";
function i(t) {
var e, n = 0,
i = ["accountHolderName", "bic", "longFormURL", "mandateReferenceNumber", "maskedIBAN", "shortForm"];
for (n = 0; n < i.length; n++) e = i[n], this[e] = t[e]
}
e.exports = i
}, {}],
12: [function(t, e, n) {
"use strict";
e.exports = function(t) {
return null != t.enableCORS ? t.enableCORS : t.merchantConfiguration ? t.merchantConfiguration.enableCORS : !1
}
}, {}],
13: [function(t, e, n) {
"use strict";
function i(t) {
var e, n, i = [];
for (n = 0; n < t.length; n++) e = t[n], "/" === e.charAt(e.length - 1) && (e = e.substring(0, e.length - 1)), "/" === e.charAt(0) && (e = e.substring(1)), i.push(e);
return i.join("/")
}
function o(t) {
return t && "object" == typeof t && "number" == typeof t.length && "[object Array]" === Object.prototype.toString.call(t) || !1
}
function r(t, e) {
var n, i = {};
for (n in t) t.hasOwnProperty(n) && (i[n] = t[n]);
for (n in e) e.hasOwnProperty(n) && (i[n] = e[n]);
return i
}
e.exports = {
joinUrlFragments: i,
isArray: o,
mergeOptions: r
}
}, {}],
14: [function(t, e, n) {
"use strict";
function i(t) {
return new o(t)
}
var o = t(1),
r = t(13),
s = t(8),
a = t(6);
e.exports = {
Client: o,
configure: i,
util: r,
parseClientToken: s,
_getConfiguration: a
}
}, {
1: 1,
13: 13,
6: 6,
8: 8
}],
15: [function(t, e, n) {
"use strict";
var i, o = Array.prototype.indexOf;
i = o ? function(t, e) {
return t.indexOf(e)
} : function(t, e) {
for (var n = 0, i = t.length; i > n; n++)
if (t[n] === e) return n;
return -1
}, e.exports = {
indexOf: i
}
}, {}],
16: [function(t, e, n) {
"use strict";
function i(t) {
var e, n, i = "";
for (e = 0; e < t.length; e++) i += "%", n = t[e].charCodeAt(0).toString(16).toUpperCase(), n.length < 2 && (i += "0"), i += n;
return i
}
function o(t) {
return decodeURIComponent(i(atob(t)))
}
e.exports = {
decodeUtf8: o
}
}, {}],
17: [function(t, e, n) {
"use strict";
function i(t, e) {
if (e = e || "[" + t + "] is not a valid DOM Element", t && t.nodeType && 1 === t.nodeType) return t;
if (t && window.jQuery && (t instanceof jQuery || "jquery" in Object(t)) && 0 !== t.length) return t[0];
if ("string" == typeof t && document.getElementById(t)) return document.getElementById(t);
throw new Error(e)
}
e.exports = {
normalizeElement: i
}
}, {}],
18: [function(t, e, n) {
"use strict";
function i(t, e, n, i) {
t.addEventListener ? t.addEventListener(e, n, i || !1) : t.attachEvent && t.attachEvent("on" + e, n)
}
function o(t, e, n, i) {
t.removeEventListener ? t.removeEventListener(e, n, i || !1) : t.detachEvent && t.detachEvent("on" + e, n)
}
function r(t) {
t.preventDefault ? t.preventDefault() : t.returnValue = !1
}
e.exports = {
addEventListener: i,
removeEventListener: o,
preventDefault: r
}
}, {}],
19: [function(t, e, n) {
"use strict";
function i(t) {
return "[object Function]" === r.call(t)
}
function o(t, e) {
return function() {
return t.apply(e, arguments)
}
}
var r = Object.prototype.toString;
e.exports = {
bind: o,
isFunction: i
}
}, {}],
20: [function(t, e, n) {
"use strict";
function i(t) {
var e, n, i, o, r = [{
min: 0,
max: 180,
chars: 7
}, {
min: 181,
max: 620,
chars: 14
}, {
min: 621,
max: 960,
chars: 22
}];
for (o = r.length, t = t || window.innerWidth, n = 0; o > n; n++) i = r[n], t >= i.min && t <= i.max && (e = i.chars);
return e || 60
}
function o(t, e) {
var n, i;
return -1 === t.indexOf("@") ? t : (t = t.split("@"), n = t[0], i = t[1], n.length > e && (n = n.slice(0, e) + "..."), i.length > e && (i = "..." + i.slice(-e)), n + "@" + i)
}
e.exports = {
truncateEmail: o,
getMaxCharLength: i
}
}, {}],
21: [function(t, e, n) {
"use strict";
function i() {
return "https:" === window.location.protocol
}
function o(t) {
switch (t) {
case null:
case void 0:
return "";
case !0:
return "1";
case !1:
return "0";
default:
return encodeURIComponent(t)
}
}
function r(t, e) {
var n, i, s = [];
for (i in t)
if (t.hasOwnProperty(i)) {
var a = t[i];
n = e ? e + "[" + i + "]" : i, "object" == typeof a ? s.push(r(a, n)) : void 0 !== a && null !== a && s.push(o(n) + "=" + o(a))
}
return s.join("&")
}
function s(t) {
for (var e = {}, n = t.split("&"), i = 0; i < n.length; i++) {
var o = n[i].split("="),
r = o[0],
s = decodeURIComponent(o[1]);
e[r] = s
}
return e
}
function a(t) {
var e = t.split("?");
return 2 !== e.length ? {} : s(e[1])
}
function c(t) {
if (t = t.toLowerCase(), !/^http/.test(t)) return !1;
l.href = t;
var e = l.hostname.split("."),
n = e.slice(-2).join(".");
return -1 === u.indexOf(h, n) ? !1 : !0
}
var u = t(15),
l = document.createElement("a"),
h = ["paypal.com", "braintreepayments.com", "braintreegateway.com", "localhost"];
e.exports = {
isBrowserHttps: i,
makeQueryString: r,
decodeQueryString: s,
getParams: a,
isWhitelistedDomain: c
}
}, {
15: 15
}],
22: [function(t, e, n) {
"use strict";
function i() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
var e = 16 * Math.random() | 0,
n = "x" === t ? e : 3 & e | 8;
return n.toString(16)
})
}
e.exports = i
}, {}],
23: [function(t, e, n) {
var i = t(17),
o = t(21),
r = t(19),
s = t(18),
a = t(20),
c = t(15),
u = t(16),
l = t(22);
e.exports = {
string: a,
array: c,
normalizeElement: i.normalizeElement,
isBrowserHttps: o.isBrowserHttps,
makeQueryString: o.makeQueryString,
decodeQueryString: o.decodeQueryString,
getParams: o.getParams,
isWhitelistedDomain: o.isWhitelistedDomain,
removeEventListener: s.removeEventListener,
addEventListener: s.addEventListener,
preventDefault: s.preventDefault,
bind: r.bind,
isFunction: r.isFunction,
base64ToUtf8: u.decodeUtf8,
uuid: l
}
}, {
15: 15,
16: 16,
17: 17,
18: 18,
19: 19,
20: 20,
21: 21,
22: 22
}],
24: [function(t, e, n) {
"use strict";
function i(t, e) {
var n = window.getComputedStyle ? getComputedStyle(t) : t.currentStyle;
return n[e]
}
function o() {
return {
html: {
height: s.style.height || "",
overflow: i(s, "overflow"),
position: i(s, "position")
},
body: {
height: a.style.height || "",
overflow: i(a, "overflow")
}
}
}
function r(t, e) {
this.assetsUrl = t, this.container = e || document.body, this.iframe = null, s = document.documentElement, a = document.body, this.merchantPageDefaultStyles = o()
}
var s, a, c = t(23),
u = t(151),
l = t(31),
h = "1.3.3";
r.prototype.get = function(t, e) {
var n = this,
i = this.constructAuthorizationURL(t);
this.container && u(this.container) ? this.container(i + "&no_style=1") : this.insertIframe(i), new l(function(t) {
u(n.container) || n.removeIframe(), e(t)
})
}, r.prototype.removeIframe = function() {
this.container && this.container.nodeType && 1 === this.container.nodeType ? this.container.removeChild(this.iframe) : this.container && window.jQuery && this.container instanceof jQuery ? $(this.iframe, this.container).remove() : "string" == typeof this.container && document.getElementById(this.container).removeChild(this.iframe), this.unlockMerchantWindowSize()
}, r.prototype.insertIframe = function(t) {
var e = document.createElement("iframe");
if (e.src = t, this.applyStyles(e), this.lockMerchantWindowSize(), this.container && this.container.nodeType && 1 === this.container.nodeType) this.container.appendChild(e);
else if (this.container && window.jQuery && this.container instanceof jQuery && 0 !== this.container.length) this.container.append(e);
else {
if ("string" != typeof this.container || !document.getElementById(this.container)) throw new Error("Unable to find valid container for iframe.");
document.getElementById(this.container).appendChild(e)
}
this.iframe = e
}, r.prototype.applyStyles = function(t) {
t.style.position = "fixed", t.style.top = "0", t.style.left = "0", t.style.height = "100%", t.style.width = "100%", t.setAttribute("frameborder", "0"), t.setAttribute("allowTransparency", "true"), t.style.border = "0", t.style.zIndex = "99999"
}, r.prototype.lockMerchantWindowSize = function() {
s.style.overflow = "hidden", a.style.overflow = "hidden", a.style.height = "100%"
}, r.prototype.unlockMerchantWindowSize = function() {
var t = this.merchantPageDefaultStyles;
a.style.height = t.body.height, a.style.overflow = t.body.overflow, s.style.overflow = t.html.overflow
}, r.prototype.constructAuthorizationURL = function(t) {
var e, n = window.location.href;
return n.indexOf("#") > -1 && (n = n.split("#")[0]), e = c.makeQueryString({
acsUrl: t.acsUrl,
pareq: t.pareq,
termUrl: t.termUrl + "&three_d_secure_version=" + h,
md: t.md,
parentUrl: n
}), this.assetsUrl + "/3ds/" + h + "/html/style_frame?" + e
}, e.exports = r
}, {
151: 151,
23: 23,
31: 31
}],
25: [function(t, e, n) {
"use strict";
function i() {}
function o(t, e) {
e = e || {}, this.clientToken = e.clientToken, this.container = e.container, this.api = t, this.nonce = null, this._loader = null, this._boundHandleUserClose = s(this._handleUserClose, this)
}
var r = t(23),
s = t(95),
a = t(151),
c = t(24),
u = t(27);
o.prototype.verify = function(t, e) {
if (!a(e)) throw this.api.sendAnalyticsEvents("3ds.web.no_callback"), new Error("No suitable callback argument was given");
a(t.onUserClose) && (this._onUserClose = t.onUserClose), a(t.onLookupComplete) && (this._onLookupComplete = t.onLookupComplete), (void 0 === t.useDefaultLoader || t.useDefaultLoader === !0) && this._createDefaultLoader();
var n = {
nonce: "",
amount: t.amount
},
i = t.creditCard;
if ("string" == typeof i) n.nonce = i, this.api.sendAnalyticsEvents("3ds.web.verify.nonce"), this.startVerification(n, e);
else {
var o = this,
r = function(t, i) {
return t ? (o._removeDefaultLoader(), e(t)) : (n.nonce = i, void o.startVerification(n, e))
};
this.api.sendAnalyticsEvents("3ds.web.verify.credit_card"), this.api.tokenizeCard(i, r)
}
}, o.prototype.startVerification = function(t, e) {
this.api.lookup3DS(t, s(this.handleLookupResponse(e), this))
}, o.prototype.handleLookupResponse = function(t) {
var e = this;
return function(n, i) {
var o;
this._onLookupComplete(), n ? t(n.error) : i.lookup && i.lookup.acsUrl && i.lookup.acsUrl.length > 0 ? (e.nonce = i.paymentMethod.nonce, o = new c(this.clientToken.assetsUrl, this.container), o.get(i.lookup, s(this.handleAuthenticationResponse(t), this)), this._detachListeners(), this._attachListeners()) : (e.nonce = i.paymentMethod.nonce, t(null, {
nonce: e.nonce,
verificationDetails: i.threeDSecureInfo
}))
}
}, o.prototype.handleAuthenticationResponse = function(t) {
return function(e) {
var n, i = r.decodeQueryString(e);
i.user_closed || (n = JSON.parse(i.auth_response), n.success ? t(null, {
nonce: n.paymentMethod.nonce,
verificationDetails: n.threeDSecureInfo
}) : n.threeDSecureInfo && n.threeDSecureInfo.liabilityShiftPossible ? t(null, {
nonce: this.nonce,
verificationDetails: n.threeDSecureInfo
}) : t(n.error))
}
}, o.prototype._attachListeners = function() {
r.addEventListener(window, "message", this._boundHandleUserClose)
}, o.prototype._detachListeners = function() {
r.removeEventListener(window, "message", this._boundHandleUserClose)
}, o.prototype._createDefaultLoader = function() {
this._loader = new u, document.body.appendChild(this._loader.getElement())
}, o.prototype._removeDefaultLoader = function() {
if (this._loader) {
var t = this._loader.getElement(),
e = t.parentNode;
e && e.removeChild(t), this._loader.dispose(), this._loader = null
}
}, o.prototype._handleUserClose = function(t) {
"user_closed=true" === t.data && this._onUserClose()
}, o.prototype._onUserClose = i, o.prototype._onLookupComplete = function() {
this._removeDefaultLoader()
}, e.exports = o
}, {
151: 151,
23: 23,
24: 24,
27: 27,
95: 95
}],
26: [function(t, e, n) {
"use strict";
var i = t(25);
e.exports = {
create: function(t, e) {
var n = new i(t, e);
return n
}
}
}, {
25: 25
}],
27: [function(t, e, n) {
"use strict";
function i() {
this._element = document.createElement("div"), this._element.style.cssText = this._cssDeclarations, this._display = null, this._initialize()
}
var o = t(28),
r = t(29),
s = t(30);
i.prototype._cssDeclarations = ["filter:progid:DXImageTransform.Microsoft.Gradient(StartColorStr=#7F000000, EndColorStr=#7F000000)", "background-color: rgba(0, 0, 0, 0.5)", "display: table", "height: 100%", "left: 0", "position: fixed", "right: 0", "top: 0", "width: 100%", "z-index: 99999"].join(";"), i.prototype.getElement = function() {
return this._element
}, i.prototype.dispose = function() {
this._display.dispose(), this._display = null, this._element = null
}, i.prototype._initialize = function() {
var t = new s,
e = window.SVGElement && window.SVGAnimateElement && window.SVGAnimateTransformElement;
e || (t = new r("Loading...")), this._display = new o(t), this.getElement().appendChild(this._display.getElement())
}, e.exports = i
}, {
28: 28,
29: 29,
30: 30
}],
28: [function(t, e, n) {
"use strict";
function i(t) {
this._element = document.createElement("div"), this._element.style.cssText = this._cssDeclarations, this._displayObject = t, this._initialize()
}
i.prototype._cssDeclarations = ["display: table-cell", "vertical-align: middle"].join(";"), i.prototype.getElement = function() {
return this._element
}, i.prototype.dispose = function() {
this._displayObject.dispose(), this._displayObject = null, this._element = null
}, i.prototype._initialize = function() {
this.getElement().appendChild(this._displayObject.getElement())
}, e.exports = i
}, {}],
29: [function(t, e, n) {
"use strict";
function i(t) {
this._element = document.createElement("div"), this._element.style.cssText = this._cssDeclarations, this._element.innerHTML = t
}
i.prototype._cssDeclarations = ["color: #fff", "font-family: Helvetica, sans-serif", "font-size: 12px", "text-align: center"].join(";"), i.prototype.getElement = function() {
return this._element
}, i.prototype.dispose = function() {
this._element = null
}, e.exports = i
}, {}],
30: [function(t, e, n) {
"use strict";
function i() {
this._element = document.createElement("div"), this._element.style.cssText = this._cssDeclarations, this._element.innerHTML = this._markup
}
i.prototype._cssDeclarations = ["height: 36px", "margin-left: auto", "margin-right: auto", "width: 36px"].join(";"), i.prototype._markup = ['<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"', 'width="100%" height="100%" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">', ' <path fill="#FFF" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">', ' <animateTransform attributeType="xml"', ' attributeName="transform"', ' type="rotate"', ' from="0 25 25"', ' to="360 25 25"', ' dur="780ms"', ' repeatCount="indefinite"', ' calcMode="spline"', ' keySplines="0.44, 0.22, 0, 1"', ' keyTimes="0;1"/>', " </path>", "</svg>"].join(""), i.prototype.getElement = function() {
return this._element
}, i.prototype.dispose = function() {
this._element = null
}, e.exports = i
}, {}],
31: [function(t, e, n) {
"use strict";
function i(t) {
this.postMessageReceiver(t), this.hashChangeReceiver(t)
}
var o = t(23);
i.prototype.postMessageReceiver = function(t) {
var e = this;
this.wrappedCallback = function(n) {
var i = n.data;
(/^(auth_response=)/.test(i) || "user_closed=true" === i) && (t(i), e.stopListening())
}, o.addEventListener(window, "message", this.wrappedCallback)
}, i.prototype.hashChangeReceiver = function(t) {
var e, n = window.location.hash,
i = this;
this.poll = setInterval(function() {
e = window.location.hash, e.length > 0 && e !== n && (i.stopListening(), e = e.substring(1, e.length), t(e), window.location.hash = n.length > 0 ? n : "")
}, 10)
}, i.prototype.stopListening = function() {
clearTimeout(this.poll), o.removeEventListener(window, "message", this.wrappedCallback)
}, e.exports = i
}, {
23: 23
}],
32: [function(t, e, n) {
(function(n) {
"use strict";
function i() {
return h ? new XMLHttpRequest : new XDomainRequest
}
function o(t, e, n, i, o) {
var r = a.createURLParams(t, e);
s("GET", r, null, n, i, o)
}
function r(t, e, n, i, o) {
s("POST", t, e, n, i, o)
}
function s(t, e, n, o, r, s) {
var a, p, f = i();
r = r || function() {}, h ? f.onreadystatechange = function() {
4 === f.readyState && (a = f.status, p = u(f.responseText), a >= 400 || 0 === a ? r.call(null, p || {
errors: l.errors.UNKNOWN_ERROR
}, null) : a > 0 && r.call(null, null, o(p)))
} : (f.onload = function() {
r.call(null, null, o(u(f.responseText)))
}, f.onerror = function() {
r.call(null, f.responseText, null)
}, f.onprogress = function() {}, f.ontimeout = function() {
r.call(null, {
errors: l.errors.UNKNOWN_ERROR
}, null)
}), f.open(t, e, !0), f.timeout = null == s ? 6e4 : s, h && "POST" === t && f.setRequestHeader("Content-Type", "application/json"), setTimeout(function() {
f.send(c(t, n))
}, 0)
}
var a = t(39),
c = t(38),
u = t(37),
l = t(34),
h = n.XMLHttpRequest && "withCredentials" in new n.XMLHttpRequest;
e.exports = {
get: o,
post: r
}
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
34: 34,
37: 37,
38: 38,
39: 39
}],
33: [function(t, e, n) {
"use strict";
function i(t) {
var e = s.getUserAgent(),
n = !(s.isHTTP() && /(MSIE\s(8|9))|(Phantom)/.test(e));
return t = t || {}, t.enableCORS && n ? r : o
}
var o = t(35),
r = t(32),
s = t(39);
e.exports = i
}, {
32: 32,
35: 35,
39: 39
}],
34: [function(t, e, n) {
e.exports = {
errors: {
UNKNOWN_ERROR: "Unknown error",
INVALID_TIMEOUT: "Timeout must be a number"
}
}
}, {}],
35: [function(t, e, n) {
"use strict";
function i(t, e) {
return t.status >= 400 ? [t, null] : [null, e(t)]
}
function o() {}
function r(t, e, n, r, s, a) {
var c;
s = s || o, null == a && (a = 6e4), c = r(t, e, function(t, e) {
l[e] && (clearTimeout(l[e]), s.apply(null, i(t, function(t) {
return n(t)
})))
}), "number" == typeof a ? l[c] = setTimeout(function() {
l[c] = null, s.apply(null, [{
errors: u.errors.UNKNOWN_ERROR
}, null])
}, a) : s.apply(null, [{
errors: u.errors.INVALID_TIMEOUT
}, null])
}
function s(t, e, n, i, o) {
e._method = "POST", r(t, e, n, c.get, i, o)
}
function a(t, e, n, i, o) {
r(t, e, n, c.get, i, o)
}
var c = t(36),
u = t(34),
l = [];
e.exports = {
get: a,
post: s
}
}, {
34: 34,
36: 36
}],
36: [function(t, e, n) {
(function(n) {
"use strict";
function i(t, e) {
var n = document.createElement("script"),
i = !1;
n.src = t, n.async = !0;
var o = e || u.error;
"function" == typeof o && (n.onerror = function(e) {
o({
url: t,
event: e
})
}), n.onload = n.onreadystatechange = function() {
i || this.readyState && "loaded" !== this.readyState && "complete" !== this.readyState || (i = !0, n.onload = n.onreadystatechange = null, n && n.parentNode && n.parentNode.removeChild(n))
}, s || (s = document.getElementsByTagName("head")[0]), s.appendChild(n)
}
function o(t, e, n, o) {
var r, s;
return o = o || u.callbackName || "callback", s = o + "_json" + a.generateUUID(), e[o] = s, r = a.createURLParams(t, e), c[s] = function(t) {
n(t, s);
try {
delete c[s]
} catch (e) {}
c[s] = null
}, i(r), s
}
function r(t) {
u = t
}
var s, a = t(39),
c = n,
u = {};
e.exports = {
get: o,
init: r
}
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
39: 39
}],
37: [function(t, e, n) {
"use strict";
e.exports = function(t) {
try {
t = JSON.parse(t)
} catch (e) {}
return t
}
}, {}],
38: [function(t, e, n) {
"use strict";
var i = t(48);
e.exports = function(t, e) {
if (!i(t)) throw new Error("Method must be a string");
return "get" !== t.toLowerCase() && null != e && (e = i(e) ? e : JSON.stringify(e)), e
}
}, {
48: 48
}],
39: [function(t, e, n) {
(function(n) {
"use strict";
function i(t) {
return t && "object" == typeof t && "number" == typeof t.length && "[object Array]" === Object.prototype.toString.call(t) || !1
}
function o(t, e) {
var n, r, s, a = [];
for (s in t) t.hasOwnProperty(s) && (r = t[s], n = e ? i(t) ? e + "[]" : e + "[" + s + "]" : s, a.push("object" == typeof r ? o(r, n) : encodeURIComponent(n) + "=" + encodeURIComponent(r)));
return a.join("&")
}
function r() {
return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, function(t) {
var e = Math.floor(16 * Math.random()),
n = "x" === t ? e : 3 & e | 8;
return n.toString(16)
})
}
function s(t, e) {
return t = t || "", !u(e) && l(e) && (t += -1 === t.indexOf("?") ? "?" : "", t += -1 !== t.indexOf("=") ? "&" : "", t += o(e)), t
}
function a() {
return n.navigator.userAgent
}
function c() {
return "http:" === n.location.protocol
}
var u = t(41),
l = t(47);
e.exports = {
isArray: i,
generateUUID: r,
stringify: o,
createURLParams: s,
getUserAgent: a,
isHTTP: c
}
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
41: 41,
47: 47
}],
40: [function(t, e, n) {
"use strict";
var i = t(32),
o = t(35),
r = t(33),
s = t(39);
e.exports = {
AJAXDriver: i,
JSONPDriver: o,
chooseDriver: r,
util: s
}
}, {
32: 32,
33: 33,
35: 35,
39: 39
}],
41: [function(t, e, n) {
function i(t) {
return !!t && "object" == typeof t
}
function o(t) {
return function(e) {
return null == e ? void 0 : e[t]
}
}
function r(t) {
return null != t && s(d(t))
}
function s(t) {
return "number" == typeof t && t > -1 && t % 1 == 0 && f >= t
}
function a(t) {
return null == t ? !0 : r(t) && (u(t) || h(t) || c(t) || i(t) && l(t.splice)) ? !t.length : !p(t).length
}
var c = t(42),
u = t(43),
l = t(44),
h = t(48),
p = t(45),
f = 9007199254740991,
d = o("length");
e.exports = a
}, {
42: 42,
43: 43,
44: 44,
45: 45,
48: 48
}],
42: [function(t, e, n) {
function i(t) {
return function(e) {
return null == e ? void 0 : e[t]
}
}
function o(t) {
return s(t) && y.call(t, "callee") && (!v.call(t, "callee") || g.call(t) == p)
}
function r(t) {
return null != t && c(_(t)) && !a(t)
}
function s(t) {
return l(t) && r(t)
}
function a(t) {
var e = u(t) ? g.call(t) : "";
return e == f || e == d
}
function c(t) {
return "number" == typeof t && t > -1 && t % 1 == 0 && h >= t
}
function u(t) {
var e = typeof t;
return !!t && ("object" == e || "function" == e)
}
function l(t) {
return !!t && "object" == typeof t
}
var h = 9007199254740991,
p = "[object Arguments]",
f = "[object Function]",
d = "[object GeneratorFunction]",
m = Object.prototype,
y = m.hasOwnProperty,
g = m.toString,
v = m.propertyIsEnumerable,
_ = i("length");
e.exports = o
}, {}],
43: [function(t, e, n) {
function i(t) {
return !!t && "object" == typeof t
}
function o(t, e) {
var n = null == t ? void 0 : t[e];
return c(n) ? n : void 0
}
function r(t) {
return "number" == typeof t && t > -1 && t % 1 == 0 && v >= t
}
function s(t) {
return a(t) && m.call(t) == l
}
function a(t) {
var e = typeof t;
return !!t && ("object" == e || "function" == e)
}
function c(t) {
return null == t ? !1 : s(t) ? y.test(f.call(t)) : i(t) && h.test(t)
}
var u = "[object Array]",
l = "[object Function]",
h = /^\[object .+?Constructor\]$/,
p = Object.prototype,
f = Function.prototype.toString,
d = p.hasOwnProperty,
m = p.toString,
y = RegExp("^" + f.call(d).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"),
g = o(Array, "isArray"),
v = 9007199254740991,
_ = g || function(t) {
return i(t) && r(t.length) && m.call(t) == u
};
e.exports = _
}, {}],
44: [function(t, e, n) {
function i(t) {
var e = o(t) ? c.call(t) : "";
return e == r || e == s
}
function o(t) {
var e = typeof t;
return !!t && ("object" == e || "function" == e)
}
var r = "[object Function]",
s = "[object GeneratorFunction]",
a = Object.prototype,
c = a.toString;
e.exports = i
}, {}],
45: [function(t, e, n) {
function i(t) {
return function(e) {
return null == e ? void 0 : e[t]
}
}
function o(t) {
return null != t && s(v(t))
}
function r(t, e) {
return t = "number" == typeof t || f.test(t) ? +t : -1, e = null == e ? g : e, t > -1 && t % 1 == 0 && e > t
}
function s(t) {
return "number" == typeof t && t > -1 && t % 1 == 0 && g >= t
}
function a(t) {
for (var e = u(t), n = e.length, i = n && t.length, o = !!i && s(i) && (p(t) || h(t)), a = -1, c = []; ++a < n;) {
var l = e[a];
(o && r(l, i) || m.call(t, l)) && c.push(l)
}
return c
}
function c(t) {
var e = typeof t;
return !!t && ("object" == e || "function" == e)
}
function u(t) {
if (null == t) return [];
c(t) || (t = Object(t));
var e = t.length;
e = e && s(e) && (p(t) || h(t)) && e || 0;
for (var n = t.constructor, i = -1, o = "function" == typeof n && n.prototype === t, a = Array(e), u = e > 0; ++i < e;) a[i] = i + "";
for (var l in t) u && r(l, e) || "constructor" == l && (o || !m.call(t, l)) || a.push(l);
return a
}
var l = t(46),
h = t(42),
p = t(43),
f = /^\d+$/,
d = Object.prototype,
m = d.hasOwnProperty,
y = l(Object, "keys"),
g = 9007199254740991,
v = i("length"),
_ = y ? function(t) {
var e = null == t ? void 0 : t.constructor;
return "function" == typeof e && e.prototype === t || "function" != typeof t && o(t) ? a(t) : c(t) ? y(t) : []
} : a;
e.exports = _
}, {
42: 42,
43: 43,
46: 46
}],
46: [function(t, e, n) {
function i(t) {
return !!t && "object" == typeof t
}
function o(t, e) {
var n = null == t ? void 0 : t[e];
return a(n) ? n : void 0;
}
function r(t) {
return s(t) && f.call(t) == c
}
function s(t) {
var e = typeof t;
return !!t && ("object" == e || "function" == e)
}
function a(t) {
return null == t ? !1 : r(t) ? d.test(h.call(t)) : i(t) && u.test(t)
}
var c = "[object Function]",
u = /^\[object .+?Constructor\]$/,
l = Object.prototype,
h = Function.prototype.toString,
p = l.hasOwnProperty,
f = l.toString,
d = RegExp("^" + h.call(p).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
e.exports = o
}, {}],
47: [function(t, e, n) {
function i(t) {
var e = typeof t;
return !!t && ("object" == e || "function" == e)
}
e.exports = i
}, {}],
48: [function(t, e, n) {
function i(t) {
return !!t && "object" == typeof t
}
function o(t) {
return "string" == typeof t || i(t) && a.call(t) == r
}
var r = "[object String]",
s = Object.prototype,
a = s.toString;
e.exports = o
}, {}],
49: [function(t, e, n) {
arguments[4][15][0].apply(n, arguments)
}, {
15: 15
}],
50: [function(t, e, n) {
arguments[4][16][0].apply(n, arguments)
}, {
16: 16
}],
51: [function(t, e, n) {
arguments[4][17][0].apply(n, arguments)
}, {
17: 17
}],
52: [function(t, e, n) {
arguments[4][18][0].apply(n, arguments)
}, {
18: 18
}],
53: [function(t, e, n) {
arguments[4][19][0].apply(n, arguments)
}, {
19: 19
}],
54: [function(t, e, n) {
arguments[4][20][0].apply(n, arguments)
}, {
20: 20
}],
55: [function(t, e, n) {
arguments[4][21][0].apply(n, arguments)
}, {
21: 21,
49: 49
}],
56: [function(t, e, n) {
arguments[4][22][0].apply(n, arguments)
}, {
22: 22
}],
57: [function(t, e, n) {
arguments[4][23][0].apply(n, arguments)
}, {
23: 23,
49: 49,
50: 50,
51: 51,
52: 52,
53: 53,
54: 54,
55: 55,
56: 56
}],
58: [function(t, e, n) {
"use strict";
function i(t, e) {
this.host = t || window, this.channel = e || null, this.handlers = [], o.addEventListener(this.host, "message", o.bind(this.receive, this))
}
var o = t(72);
i.prototype.receive = function(t) {
var e, n, o, r;
try {
o = JSON.parse(t.data)
} catch (s) {
return
}
for (r = o.type, n = new i.Message(this, t.source, o.data), e = 0; e < this.handlers.length; e++) this.handlers[e].type === r && this.handlers[e].handler(n)
}, i.prototype.send = function(t, e, n) {
t.postMessage(JSON.stringify({
type: this._namespaceEvent(e),
data: n
}), "*")
}, i.prototype.register = function(t, e) {
this.handlers.push({
type: this._namespaceEvent(t),
handler: e
})
}, i.prototype.unregister = function(t, e) {
for (var n = this.handlers.length - 1; n >= 0; n--)
if (this.handlers[n].type === t && this.handlers[n].handler === e) return this.handlers.splice(n, 1)
}, i.prototype._namespaceEvent = function(t) {
return this.channel ? ["braintree", this.channel, t].join(":") : t
}, i.Message = function(t, e, n) {
this.bus = t, this.source = e, this.content = n
}, i.Message.prototype.reply = function(t, e) {
this.bus.send(this.source, t, e)
}, e.exports = i
}, {
72: 72
}],
59: [function(t, e, n) {
"use strict";
function i(t, e) {
this.bus = t, this.target = e, this.handlers = [], this.bus.register("publish", o.bind(this._handleMessage, this))
}
var o = t(72);
i.prototype._handleMessage = function(t) {
var e, n = t.content,
i = this.handlers[n.channel];
if ("undefined" != typeof i)
for (e = 0; e < i.length; e++) i[e](n.data)
}, i.prototype.publish = function(t, e) {
this.bus.send(this.target, "publish", {
channel: t,
data: e
})
}, i.prototype.subscribe = function(t, e) {
this.handlers[t] = this.handlers[t] || [], this.handlers[t].push(e)
}, i.prototype.unsubscribe = function(t, e) {
var n, i = this.handlers[t];
if ("undefined" != typeof i)
for (n = 0; n < i.length; n++) i[n] === e && i.splice(n, 1)
}, e.exports = i
}, {
72: 72
}],
60: [function(t, e, n) {
"use strict";
function i(t) {
this.bus = t, this.frames = [], this.handlers = []
}
i.prototype.subscribe = function(t, e) {
this.handlers[t] = this.handlers[t] || [], this.handlers[t].push(e)
}, i.prototype.registerFrame = function(t) {
this.frames.push(t)
}, i.prototype.unregisterFrame = function(t) {
for (var e = 0; e < this.frames.length; e++) this.frames[e] === t && this.frames.splice(e, 1)
}, i.prototype.publish = function(t, e) {
var n, i = this.handlers[t];
if ("undefined" != typeof i)
for (n = 0; n < i.length; n++) i[n](e);
for (n = 0; n < this.frames.length; n++) this.bus.send(this.frames[n], "publish", {
channel: t,
data: e
})
}, i.prototype.unsubscribe = function(t, e) {
var n, i = this.handlers[t];
if ("undefined" != typeof i)
for (n = 0; n < i.length; n++) i[n] === e && i.splice(n, 1)
}, e.exports = i
}, {}],
61: [function(t, e, n) {
"use strict";
function i(t, e) {
this.bus = t, this.target = e || window.parent, this.counter = 0, this.callbacks = {}, this.bus.register("rpc_response", o.bind(this._handleResponse, this))
}
var o = t(72);
i.prototype._handleResponse = function(t) {
var e = t.content,
n = this.callbacks[e.id];
"function" == typeof n && (n.apply(null, e.response), delete this.callbacks[e.id])
}, i.prototype.invoke = function(t, e, n) {
var i = this.counter++;
this.callbacks[i] = n, this.bus.send(this.target, "rpc_request", {
id: i,
method: t,
args: e
})
}, e.exports = i
}, {
72: 72
}],
62: [function(t, e, n) {
"use strict";
function i(t) {
this.bus = t, this.methods = {}, this.bus.register("rpc_request", o.bind(this._handleRequest, this))
}
var o = t(72);
i.prototype._handleRequest = function(t) {
var e, n = t.content,
i = n.args || [],
o = this.methods[n.method];
"function" == typeof o && (e = function() {
t.reply("rpc_response", {
id: n.id,
response: Array.prototype.slice.call(arguments)
})
}, i.push(e), o.apply(null, i))
}, i.prototype.reset = function() {
this.methods = {}
}, i.prototype.define = function(t, e) {
this.methods[t] = e
}, e.exports = i
}, {
72: 72
}],
63: [function(t, e, n) {
var i = t(58),
o = t(59),
r = t(60),
s = t(61),
a = t(62);
e.exports = {
MessageBus: i,
PubsubClient: o,
PubsubServer: r,
RPCClient: s,
RPCServer: a
}
}, {
58: 58,
59: 59,
60: 60,
61: 61,
62: 62
}],
64: [function(t, e, n) {
arguments[4][15][0].apply(n, arguments)
}, {
15: 15
}],
65: [function(t, e, n) {
arguments[4][16][0].apply(n, arguments)
}, {
16: 16
}],
66: [function(t, e, n) {
arguments[4][17][0].apply(n, arguments)
}, {
17: 17
}],
67: [function(t, e, n) {
arguments[4][18][0].apply(n, arguments)
}, {
18: 18
}],
68: [function(t, e, n) {
arguments[4][19][0].apply(n, arguments)
}, {
19: 19
}],
69: [function(t, e, n) {
arguments[4][20][0].apply(n, arguments)
}, {
20: 20
}],
70: [function(t, e, n) {
arguments[4][21][0].apply(n, arguments)
}, {
21: 21,
64: 64
}],
71: [function(t, e, n) {
arguments[4][22][0].apply(n, arguments)
}, {
22: 22
}],
72: [function(t, e, n) {
arguments[4][23][0].apply(n, arguments)
}, {
23: 23,
64: 64,
65: 65,
66: 66,
67: 67,
68: 68,
69: 69,
70: 70,
71: 71
}],
73: [function(t, e, n) {
arguments[4][15][0].apply(n, arguments)
}, {
15: 15
}],
74: [function(t, e, n) {
arguments[4][16][0].apply(n, arguments)
}, {
16: 16
}],
75: [function(t, e, n) {
arguments[4][17][0].apply(n, arguments)
}, {
17: 17
}],
76: [function(t, e, n) {
arguments[4][18][0].apply(n, arguments)
}, {
18: 18
}],
77: [function(t, e, n) {
arguments[4][19][0].apply(n, arguments)
}, {
19: 19
}],
78: [function(t, e, n) {
arguments[4][20][0].apply(n, arguments)
}, {
20: 20
}],
79: [function(t, e, n) {
arguments[4][21][0].apply(n, arguments)
}, {
21: 21,
73: 73
}],
80: [function(t, e, n) {
arguments[4][22][0].apply(n, arguments)
}, {
22: 22
}],
81: [function(t, e, n) {
arguments[4][23][0].apply(n, arguments)
}, {
23: 23,
73: 73,
74: 74,
75: 75,
76: 76,
77: 77,
78: 78,
79: 79,
80: 80
}],
82: [function(t, e, n) {
"use strict";
function i(t) {
if (!(this instanceof i)) return new i(t);
var e, n = r(t.className).split(/\s+/);
for (this._elem = t, this.length = 0, e = 0; e < n.length; e += 1) n[e] && s.push.call(this, n[e])
}
e.exports = i;
var o = t(83),
r = t(84),
s = Array.prototype;
i.prototype.add = function() {
var t, e;
for (e = 0; e < arguments.length; e += 1) t = "" + arguments[e], o(this, t) >= 0 || s.push.call(this, t);
return this._elem.className = this.toString(), this
}, i.prototype.remove = function() {
var t, e, n;
for (n = 0; n < arguments.length; n += 1) e = "" + arguments[n], t = o(this, e), 0 > t || s.splice.call(this, t, 1);
return this._elem.className = this.toString(), this
}, i.prototype.contains = function(t) {
return t += "", o(this, t) >= 0
}, i.prototype.toggle = function(t, e) {
return t += "", e === !0 ? this.add(t) : e === !1 ? this.remove(t) : this[this.contains(t) ? "remove" : "add"](t)
}, i.prototype.toString = function() {
return s.join.call(this, " ")
}
}, {
83: 83,
84: 84
}],
83: [function(t, e, n) {
e.exports = function(t, e) {
if (t.indexOf) return t.indexOf(e);
for (var n = 0; n < t.length; ++n)
if (t[n] === e) return n;
return -1
}
}, {}],
84: [function(t, e, n) {
function i(t) {
return t.replace(/^\s*|\s*$/g, "")
}
n = e.exports = i, n.left = function(t) {
return t.replace(/^\s*/, "")
}, n.right = function(t) {
return t.replace(/\s*$/, "")
}
}, {}],
85: [function(t, e, n) {
"use strict";
function i() {
this._teardownRegistry = []
}
var o = t(86),
r = t(87);
i.prototype.registerFunctionForTeardown = function(t) {
r.isFunction(t) && this._teardownRegistry.push(t)
}, i.prototype.teardown = function(t) {
o(this._teardownRegistry, r.bind(function(e) {
this._teardownRegistry = [], r.isFunction(t) && t(e)
}, this))
}, e.exports = i
}, {
86: 86,
87: 87
}],
86: [function(t, e, n) {
"use strict";
function i(t, e) {
var n, i = 0 === t.length;
i ? (t(), e(null)) : (n = o(e), t(n))
}
function o(t) {
var e = !1;
return function() {
e || (e = !0, t.apply(this, arguments))
}
}
e.exports = function(t, e) {
var n = t.length,
o = n;
if (0 === n) return void e(null);
for (var r = 0; n > r; r++) i(t[r], function(t) {
return t ? void e(t) : (o -= 1, void(0 === o && e(null)))
})
}
}, {}],
87: [function(t, e, n) {
arguments[4][19][0].apply(n, arguments)
}, {
19: 19
}],
88: [function(t, e, n) {
(function(t) {
"use strict";
function n(t) {
if (("string" == typeof t || t instanceof String) && (t = document.getElementById(t)), !(t instanceof HTMLFormElement)) throw new TypeError("FormNapper requires an HTMLFormElement element or the id string of one.");
this.htmlForm = t
}
n.prototype.hijack = function(e) {
this.submitHandler || (this.submitHandler = function(t) {
t.preventDefault ? t.preventDefault() : t.returnValue = !1, e(t)
}, null != t.addEventListener ? this.htmlForm.addEventListener("submit", this.submitHandler, !1) : null != t.attachEvent ? this.htmlForm.attachEvent("onsubmit", this.submitHandler) : this.htmlForm.onsubmit = this.submitHandler)
}, n.prototype.inject = function(t, e) {
var n = this.htmlForm.querySelector('input[name="' + t + '"]');
return null == n && (n = document.createElement("input"), n.type = "hidden", n.name = t, this.htmlForm.appendChild(n)), n.value = e, n
}, n.prototype.submit = function() {
HTMLFormElement.prototype.submit.call(this.htmlForm)
}, n.prototype.detach = function() {
this.submitHandler && (null != t.removeEventListener ? this.htmlForm.removeEventListener("submit", this.submitHandler, !1) : null != t.detachEvent ? this.htmlForm.detachEvent("onsubmit", this.submitHandler) : this.htmlForm.onsubmit = null, delete this.submitHandler)
}, e.exports = n
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {}],
89: [function(e, n, i) {
"use strict";
! function(e, o) {
"object" == typeof i && "undefined" != typeof n ? n.exports = o() : "function" == typeof t && t.amd ? t([], o) : e.framebus = o()
}(this, function() {
function t(t) {
return null == t ? !1 : null == t.Window ? !1 : t.constructor !== t.Window ? !1 : (_.push(t), !0)
}
function e(t) {
var e, n = {};
for (e in v) v.hasOwnProperty(e) && (n[e] = v[e]);
return n._origin = t || "*", n
}
function n(t) {
var e, n, i = r(this);
return s(t) ? !1 : s(i) ? !1 : (n = Array.prototype.slice.call(arguments, 1), e = a(t, n, i), e === !1 ? !1 : (f(g.top, e, i), !0))
}
function i(t, e) {
var n = r(this);
return y(t, e, n) ? !1 : (b[n] = b[n] || {}, b[n][t] = b[n][t] || [], b[n][t].push(e), !0)
}
function o(t, e) {
var n, i, o = r(this);
if (y(t, e, o)) return !1;
if (i = b[o] && b[o][t], !i) return !1;
for (n = 0; n < i.length; n++)
if (i[n] === e) return i.splice(n, 1), !0;
return !1
}
function r(t) {
return t && t._origin || "*"
}
function s(t) {
return "string" != typeof t
}
function a(t, e, n) {
var i = !1,
o = {
event: t,
origin: n
},
r = e[e.length - 1];
"function" == typeof r && (o.reply = m(r, n), e = e.slice(0, -1)), o.args = e;
try {
i = E + JSON.stringify(o)
} catch (s) {
throw new Error("Could not stringify event: " + s.message)
}
return i
}
function c(t) {
var e, n, i, o;
if (t.data.slice(0, E.length) !== E) return !1;
try {
e = JSON.parse(t.data.slice(E.length))
} catch (r) {
return !1
}
return null != e.reply && (n = t.origin, i = t.source, o = e.reply, e.reply = function(t) {
var e = a(o, [t], n);
return e === !1 ? !1 : void i.postMessage(e, n)
}, e.args.push(e.reply)), e
}
function u(t) {
g || (g = t || window, g.addEventListener ? g.addEventListener("message", h, !1) : g.attachEvent ? g.attachEvent("onmessage", h) : null === g.onmessage ? g.onmessage = h : g = null)
}
function l() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
var e = 16 * Math.random() | 0,
n = "x" === t ? e : 3 & e | 8;
return n.toString(16)
})
}
function h(t) {
var e;
s(t.data) || (e = c(t), e && (p("*", e.event, e.args, t), p(t.origin, e.event, e.args, t), d(t.data, e.origin, t.source)))
}
function p(t, e, n, i) {
var o;
if (b[t] && b[t][e])
for (o = 0; o < b[t][e].length; o++) b[t][e][o].apply(i, n)
}
function f(t, e, n) {
var i;
try {
t.postMessage(e, n)
} catch (o) {
return
}
for (t.opener && t.opener !== t && !t.opener.closed && t.opener !== g && f(t.opener.top, e, n), i = 0; i < t.frames.length; i++) f(t.frames[i], e, n)
}
function d(t, e, n) {
var i, o;
for (i = _.length - 1; i >= 0; i--) o = _[i], o.closed === !0 ? _ = _.slice(i, 1) : n !== o && f(o.top, t, e)
}
function m(t, e) {
function n(o, r) {
t(o, r), v.target(e).unsubscribe(i, n)
}
var i = l();
return v.target(e).subscribe(i, n), i
}
function y(t, e, n) {
return s(t) ? !0 : "function" != typeof e ? !0 : s(n) ? !0 : !1
}
var g, v, _ = [],
b = {},
E = "/*framebus*/";
return u(), v = {
target: e,
include: t,
publish: n,
pub: n,
trigger: n,
emit: n,
subscribe: i,
sub: i,
on: i,
unsubscribe: o,
unsub: o,
off: o
}
})
}, {}],
90: [function(t, e, n) {
"use strict";
var i = t(155),
o = t(154),
r = t(92),
s = t(91);
e.exports = function(t) {
var e = document.createElement("iframe"),
n = i({}, s, t);
return n.style && !o(n.style) && (i(e.style, n.style), delete n.style), r(e, n), e.getAttribute("id") || (e.id = e.name), e
}
}, {
154: 154,
155: 155,
91: 91,
92: 92
}],
91: [function(t, e, n) {
e.exports = {
src: "about:blank",
frameBorder: 0,
allowtransparency: !0,
scrolling: "no"
}
}, {}],
92: [function(t, e, n) {
e.exports = function(t, e) {
var n;
for (var i in e) e.hasOwnProperty(i) && (n = e[i], null == n ? t.removeAttribute(i) : t.setAttribute(i, n))
}
}, {}],
93: [function(t, e, n) {
function i(t) {
if (c(t) && !a(t) && !(t instanceof o)) {
if (t instanceof r) return t;
if (h.call(t, "__chain__") && h.call(t, "__wrapped__")) return u(t)
}
return new r(t)
}
var o = t(98),
r = t(99),
s = t(112),
a = t(150),
c = t(138),
u = t(147),
l = Object.prototype,
h = l.hasOwnProperty;
i.prototype = s.prototype, e.exports = i
}, {
112: 112,
138: 138,
147: 147,
150: 150,
98: 98,
99: 99
}],
94: [function(t, e, n) {
var i = t(129),
o = i(Date, "now"),
r = o || function() {
return (new Date).getTime()
};
e.exports = r
}, {
129: 129
}],
95: [function(t, e, n) {
var i = t(125),
o = t(143),
r = t(97),
s = 1,
a = 32,
c = r(function(t, e, n) {
var r = s;
if (n.length) {
var u = o(n, c.placeholder);
r |= a
}
return i(t, r, e, n, u)
});
c.placeholder = {}, e.exports = c
}, {
125: 125,
143: 143,
97: 97
}],
96: [function(t, e, n) {
var i = t(108),
o = t(125),
r = t(157),
s = t(97),
a = 1,
c = s(function(t, e) {
e = e.length ? i(e) : r(t);
for (var n = -1, s = e.length; ++n < s;) {
var c = e[n];
t[c] = o(t[c], a, t)
}
return t
});
e.exports = c
}, {
108: 108,
125: 125,
157: 157,
97: 97
}],
97: [function(t, e, n) {
function i(t, e) {
if ("function" != typeof t) throw new TypeError(o);
return e = r(void 0 === e ? t.length - 1 : +e || 0, 0),
function() {
for (var n = arguments, i = -1, o = r(n.length - e, 0), s = Array(o); ++i < o;) s[i] = n[e + i];
switch (e) {
case 0:
return t.call(this, s);
case 1:
return t.call(this, n[0], s);
case 2:
return t.call(this, n[0], n[1], s)
}
var a = Array(e + 1);
for (i = -1; ++i < e;) a[i] = n[i];
return a[e] = s, t.apply(this, a)
}
}
var o = "Expected a function",
r = Math.max;
e.exports = i
}, {}],
98: [function(t, e, n) {
function i(t) {
this.__wrapped__ = t, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this.__iteratees__ = [], this.__takeCount__ = s, this.__views__ = []
}
var o = t(107),
r = t(112),
s = Number.POSITIVE_INFINITY;
i.prototype = o(r.prototype), i.prototype.constructor = i, e.exports = i
}, {
107: 107,
112: 112
}],
99: [function(t, e, n) {
function i(t, e, n) {
this.__wrapped__ = t, this.__actions__ = n || [], this.__chain__ = !!e
}
var o = t(107),
r = t(112);
i.prototype = o(r.prototype), i.prototype.constructor = i, e.exports = i
}, {
107: 107,
112: 112
}],
100: [function(t, e, n) {
function i(t, e) {
var n = -1,
i = t.length;
for (e || (e = Array(i)); ++n < i;) e[n] = t[n];
return e
}
e.exports = i
}, {}],
101: [function(t, e, n) {
function i(t, e) {
for (var n = -1, i = t.length; ++n < i && e(t[n], n, t) !== !1;);
return t
}
e.exports = i
}, {}],
102: [function(t, e, n) {
function i(t, e) {
for (var n = -1, i = e.length, o = t.length; ++n < i;) t[o + n] = e[n];
return t
}
e.exports = i
}, {}],
103: [function(t, e, n) {
function i(t, e, n) {
for (var i = -1, r = o(e), s = r.length; ++i < s;) {
var a = r[i],
c = t[a],
u = n(c, e[a], a, t, e);
(u === u ? u === c : c !== c) && (void 0 !== c || a in t) || (t[a] = u)
}
return t
}
var o = t(158);
e.exports = i
}, {
158: 158
}],
104: [function(t, e, n) {
function i(t, e) {
return null == e ? t : o(e, r(e), t)
}
var o = t(106),
r = t(158);
e.exports = i
}, {
106: 106,
158: 158
}],
105: [function(t, e, n) {
function i(t, e, n, d, m, y, g) {
var _;
if (n && (_ = m ? n(t, d, m) : n(t)), void 0 !== _) return _;
if (!p(t)) return t;
var b = h(t);
if (b) {
if (_ = c(t), !e) return o(t, _)
} else {
var w = L.call(t),
A = w == v;
if (w != E && w != f && (!A || m)) return k[w] ? u(t, w, e) : m ? t : {};
if (_ = l(A ? {} : t), !e) return s(_, t)
}
y || (y = []), g || (g = []);
for (var C = y.length; C--;)
if (y[C] == t) return g[C];
return y.push(t), g.push(_), (b ? r : a)(t, function(o, r) {
_[r] = i(o, e, n, r, t, y, g)
}), _
}
var o = t(100),
r = t(101),
s = t(104),
a = t(110),
c = t(130),
u = t(131),
l = t(132),
h = t(150),
p = t(153),
f = "[object Arguments]",
d = "[object Array]",
m = "[object Boolean]",
y = "[object Date]",
g = "[object Error]",
v = "[object Function]",
_ = "[object Map]",
b = "[object Number]",
E = "[object Object]",
w = "[object RegExp]",
A = "[object Set]",
C = "[object String]",
N = "[object WeakMap]",
T = "[object ArrayBuffer]",
S = "[object Float32Array]",
O = "[object Float64Array]",
x = "[object Int8Array]",
I = "[object Int16Array]",
P = "[object Int32Array]",
R = "[object Uint8Array]",
D = "[object Uint8ClampedArray]",
M = "[object Uint16Array]",
U = "[object Uint32Array]",
k = {};
k[f] = k[d] = k[T] = k[m] = k[y] = k[S] = k[O] = k[x] = k[I] = k[P] = k[b] = k[E] = k[w] = k[C] = k[R] = k[D] = k[M] = k[U] = !0, k[g] = k[v] = k[_] = k[A] = k[N] = !1;
var F = Object.prototype,
L = F.toString;
e.exports = i
}, {
100: 100,
101: 101,
104: 104,
110: 110,
130: 130,
131: 131,
132: 132,
150: 150,
153: 153
}],
106: [function(t, e, n) {
function i(t, e, n) {
n || (n = {});
for (var i = -1, o = e.length; ++i < o;) {
var r = e[i];
n[r] = t[r]
}
return n
}
e.exports = i
}, {}],
107: [function(t, e, n) {
var i = t(153),
o = function() {
function t() {}
return function(e) {
if (i(e)) {
t.prototype = e;
var n = new t;
t.prototype = void 0
}
return n || {}
}
}();
e.exports = o
}, {
153: 153
}],
108: [function(t, e, n) {
function i(t, e, n, u) {
u || (u = []);
for (var l = -1, h = t.length; ++l < h;) {
var p = t[l];
c(p) && a(p) && (n || s(p) || r(p)) ? e ? i(p, e, n, u) : o(u, p) : n || (u[u.length] = p)
}
return u
}
var o = t(102),
r = t(149),
s = t(150),
a = t(133),
c = t(138);
e.exports = i
}, {
102: 102,
133: 133,
138: 138,
149: 149,
150: 150
}],
109: [function(t, e, n) {
var i = t(120),
o = i();
e.exports = o
}, {
120: 120
}],
110: [function(t, e, n) {
function i(t, e) {
return o(t, e, r)
}
var o = t(109),
r = t(158);
e.exports = i
}, {
109: 109,
158: 158
}],
111: [function(t, e, n) {
function i(t, e) {
for (var n = -1, i = e.length, r = -1, s = []; ++n < i;) {
var a = e[n];
o(t[a]) && (s[++r] = a)
}
return s
}
var o = t(151);
e.exports = i
}, {
151: 151
}],
112: [function(t, e, n) {
function i() {}
e.exports = i
}, {}],
113: [function(t, e, n) {
function i(t) {
return function(e) {
return null == e ? void 0 : e[t]
}
}
e.exports = i
}, {}],
114: [function(t, e, n) {
var i = t(160),
o = t(140),
r = o ? function(t, e) {
return o.set(t, e), t
} : i;
e.exports = r
}, {
140: 140,
160: 160
}],
115: [function(t, e, n) {
function i(t, e, n) {
if ("function" != typeof t) return o;
if (void 0 === e) return t;
switch (n) {
case 1:
return function(n) {
return t.call(e, n)
};
case 3:
return function(n, i, o) {
return t.call(e, n, i, o)
};
case 4:
return function(n, i, o, r) {
return t.call(e, n, i, o, r)
};
case 5:
return function(n, i, o, r, s) {
return t.call(e, n, i, o, r, s)
}
}
return function() {
return t.apply(e, arguments)
}
}
var o = t(160);
e.exports = i
}, {
160: 160
}],
116: [function(t, e, n) {
(function(t) {
function n(t) {
var e = new i(t.byteLength),
n = new o(e);
return n.set(new o(t)), e
}
var i = t.ArrayBuffer,
o = t.Uint8Array;
e.exports = n
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {}],
117: [function(t, e, n) {
function i(t, e, n) {
for (var i = n.length, r = -1, s = o(t.length - i, 0), a = -1, c = e.length, u = Array(c + s); ++a < c;) u[a] = e[a];
for (; ++r < i;) u[n[r]] = t[r];
for (; s--;) u[a++] = t[r++];
return u
}
var o = Math.max;
e.exports = i
}, {}],
118: [function(t, e, n) {
function i(t, e, n) {
for (var i = -1, r = n.length, s = -1, a = o(t.length - r, 0), c = -1, u = e.length, l = Array(a + u); ++s < a;) l[s] = t[s];
for (var h = s; ++c < u;) l[h + c] = e[c];
for (; ++i < r;) l[h + n[i]] = t[s++];
return l
}
var o = Math.max;
e.exports = i
}, {}],
119: [function(t, e, n) {
function i(t) {
return s(function(e, n) {
var i = -1,
s = null == e ? 0 : n.length,
a = s > 2 ? n[s - 2] : void 0,
c = s > 2 ? n[2] : void 0,
u = s > 1 ? n[s - 1] : void 0;
for ("function" == typeof a ? (a = o(a, u, 5), s -= 2) : (a = "function" == typeof u ? u : void 0, s -= a ? 1 : 0), c && r(n[0], n[1], c) && (a = 3 > s ? void 0 : a, s = 1); ++i < s;) {
var l = n[i];
l && t(e, l, a)
}
return e
})
}
var o = t(115),
r = t(135),
s = t(97);
e.exports = i
}, {
115: 115,
135: 135,
97: 97
}],
120: [function(t, e, n) {
function i(t) {
return function(e, n, i) {
for (var r = o(e), s = i(e), a = s.length, c = t ? a : -1; t ? c-- : ++c < a;) {
var u = s[c];
if (n(r[u], u, r) === !1) break
}
return e
}
}
var o = t(146);
e.exports = i
}, {
146: 146
}],
121: [function(t, e, n) {
(function(n) {
function i(t, e) {
function i() {
var o = this && this !== n && this instanceof i ? r : t;
return o.apply(e, arguments)
}
var r = o(t);
return i
}
var o = t(122);
e.exports = i
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
122: 122
}],
122: [function(t, e, n) {
function i(t) {
return function() {
var e = arguments;
switch (e.length) {
case 0:
return new t;
case 1:
return new t(e[0]);
case 2:
return new t(e[0], e[1]);
case 3:
return new t(e[0], e[1], e[2]);
case 4:
return new t(e[0], e[1], e[2], e[3]);
case 5:
return new t(e[0], e[1], e[2], e[3], e[4]);
case 6:
return new t(e[0], e[1], e[2], e[3], e[4], e[5]);
case 7:
return new t(e[0], e[1], e[2], e[3], e[4], e[5], e[6])
}
var n = o(t.prototype),
i = t.apply(n, e);
return r(i) ? i : n
}
}
var o = t(107),
r = t(153);
e.exports = i
}, {
107: 107,
153: 153
}],
123: [function(t, e, n) {
(function(n) {
function i(t, e, E, w, A, C, N, T, S, O) {
function x() {
for (var d = arguments.length, m = d, y = Array(d); m--;) y[m] = arguments[m];
if (w && (y = r(y, w, A)), C && (y = s(y, C, N)), D || U) {
var _ = x.placeholder,
F = l(y, _);
if (d -= F.length, O > d) {
var L = T ? o(T) : void 0,
j = b(O - d, 0),
B = D ? F : void 0,
V = D ? void 0 : F,
H = D ? y : void 0,
Y = D ? void 0 : y;
e |= D ? g : v, e &= ~(D ? v : g), M || (e &= ~(p | f));
var z = [t, e, E, H, B, Y, V, L, S, j],
G = i.apply(void 0, z);
return c(t) && h(G, z), G.placeholder = _, G
}
}
var W = P ? E : this,
q = R ? W[t] : t;
return T && (y = u(y, T)), I && S < y.length && (y.length = S), this && this !== n && this instanceof x && (q = k || a(t)), q.apply(W, y)
}
var I = e & _,
P = e & p,
R = e & f,
D = e & m,
M = e & d,
U = e & y,
k = R ? void 0 : a(t);
return x
}
var o = t(100),
r = t(117),
s = t(118),
a = t(122),
c = t(136),
u = t(142),
l = t(143),
h = t(144),
p = 1,
f = 2,
d = 4,
m = 8,
y = 16,
g = 32,
v = 64,
_ = 128,
b = Math.max;
e.exports = i
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
100: 100,
117: 117,
118: 118,
122: 122,
136: 136,
142: 142,
143: 143,
144: 144
}],
124: [function(t, e, n) {
(function(n) {
function i(t, e, i, s) {
function a() {
for (var e = -1, o = arguments.length, r = -1, l = s.length, h = Array(l + o); ++r < l;) h[r] = s[r];
for (; o--;) h[r++] = arguments[++e];
var p = this && this !== n && this instanceof a ? u : t;
return p.apply(c ? i : this, h)
}
var c = e & r,
u = o(t);
return a
}
var o = t(122),
r = 1;
e.exports = i
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
122: 122
}],
125: [function(t, e, n) {
function i(t, e, n, i, g, v, _, b) {
var E = e & p;
if (!E && "function" != typeof t) throw new TypeError(m);
var w = i ? i.length : 0;
if (w || (e &= ~(f | d), i = g = void 0), w -= g ? g.length : 0, e & d) {
var A = i,
C = g;
i = g = void 0
}
var N = E ? void 0 : c(t),
T = [t, e, n, i, g, A, C, v, _, b];
if (N && (u(T, N), e = T[1], b = T[9]), T[9] = null == b ? E ? 0 : t.length : y(b - w, 0) || 0, e == h) var S = r(T[0], T[2]);
else S = e != f && e != (h | f) || T[4].length ? s.apply(void 0, T) : a.apply(void 0, T);
var O = N ? o : l;
return O(S, T)
}
var o = t(114),
r = t(121),
s = t(123),
a = t(124),
c = t(126),
u = t(139),
l = t(144),
h = 1,
p = 2,
f = 32,
d = 64,
m = "Expected a function",
y = Math.max;
e.exports = i
}, {
114: 114,
121: 121,
123: 123,
124: 124,
126: 126,
139: 139,
144: 144
}],
126: [function(t, e, n) {
var i = t(140),
o = t(161),
r = i ? function(t) {
return i.get(t)
} : o;
e.exports = r
}, {
140: 140,
161: 161
}],
127: [function(t, e, n) {
function i(t) {
for (var e = t.name + "", n = o[e], i = n ? n.length : 0; i--;) {
var r = n[i],
s = r.func;
if (null == s || s == t) return r.name
}
return e
}
var o = t(141);
e.exports = i
}, {
141: 141
}],
128: [function(t, e, n) {
var i = t(113),
o = i("length");
e.exports = o
}, {
113: 113
}],
129: [function(t, e, n) {
function i(t, e) {
var n = null == t ? void 0 : t[e];
return o(n) ? n : void 0
}
var o = t(152);
e.exports = i
}, {
152: 152
}],
130: [function(t, e, n) {
function i(t) {
var e = t.length,
n = new t.constructor(e);
return e && "string" == typeof t[0] && r.call(t, "index") && (n.index = t.index, n.input = t.input), n
}
var o = Object.prototype,
r = o.hasOwnProperty;
e.exports = i
}, {}],
131: [function(t, e, n) {
function i(t, e, n) {
var i = t.constructor;
switch (e) {
case l:
return o(t);
case r:
case s:
return new i(+t);
case h:
case p:
case f:
case d:
case m:
case y:
case g:
case v:
case _:
var E = t.buffer;
return new i(n ? o(E) : E, t.byteOffset, t.length);
case a:
case u:
return new i(t);
case c:
var w = new i(t.source, b.exec(t));
w.lastIndex = t.lastIndex
}
return w
}
var o = t(116),
r = "[object Boolean]",
s = "[object Date]",
a = "[object Number]",
c = "[object RegExp]",
u = "[object String]",
l = "[object ArrayBuffer]",
h = "[object Float32Array]",
p = "[object Float64Array]",
f = "[object Int8Array]",
d = "[object Int16Array]",
m = "[object Int32Array]",
y = "[object Uint8Array]",
g = "[object Uint8ClampedArray]",
v = "[object Uint16Array]",
_ = "[object Uint32Array]",
b = /\w*$/;
e.exports = i
}, {
116: 116
}],
132: [function(t, e, n) {
function i(t) {
var e = t.constructor;
return "function" == typeof e && e instanceof e || (e = Object), new e
}
e.exports = i
}, {}],
133: [function(t, e, n) {
function i(t) {
return null != t && r(o(t))
}
var o = t(128),
r = t(137);
e.exports = i
}, {
128: 128,
137: 137
}],
134: [function(t, e, n) {
function i(t, e) {
return t = "number" == typeof t || o.test(t) ? +t : -1, e = null == e ? r : e, t > -1 && t % 1 == 0 && e > t
}
var o = /^\d+$/,
r = 9007199254740991;
e.exports = i
}, {}],
135: [function(t, e, n) {
function i(t, e, n) {
if (!s(n)) return !1;
var i = typeof e;
if ("number" == i ? o(n) && r(e, n.length) : "string" == i && e in n) {
var a = n[e];
return t === t ? t === a : a !== a
}
return !1
}
var o = t(133),
r = t(134),
s = t(153);
e.exports = i
}, {
133: 133,
134: 134,
153: 153
}],
136: [function(t, e, n) {
function i(t) {
var e = s(t),
n = a[e];
if ("function" != typeof n || !(e in o.prototype)) return !1;
if (t === n) return !0;
var i = r(n);
return !!i && t === i[0]
}
var o = t(98),
r = t(126),
s = t(127),
a = t(93);
e.exports = i
}, {
126: 126,
127: 127,
93: 93,
98: 98
}],
137: [function(t, e, n) {
function i(t) {
return "number" == typeof t && t > -1 && t % 1 == 0 && o >= t
}
var o = 9007199254740991;
e.exports = i
}, {}],
138: [function(t, e, n) {
function i(t) {
return !!t && "object" == typeof t
}
e.exports = i
}, {}],
139: [function(t, e, n) {
function i(t, e) {
var n = t[1],
i = e[1],
m = n | i,
y = h > m,
g = i == h && n == l || i == h && n == p && t[7].length <= e[8] || i == (h | p) && n == l;
if (!y && !g) return t;
i & c && (t[2] = e[2], m |= n & c ? 0 : u);
var v = e[3];
if (v) {
var _ = t[3];
t[3] = _ ? r(_, v, e[4]) : o(v), t[4] = _ ? a(t[3], f) : o(e[4])
}
return v = e[5], v && (_ = t[5], t[5] = _ ? s(_, v, e[6]) : o(v), t[6] = _ ? a(t[5], f) : o(e[6])), v = e[7], v && (t[7] = o(v)), i & h && (t[8] = null == t[8] ? e[8] : d(t[8], e[8])), null == t[9] && (t[9] = e[9]), t[0] = e[0], t[1] = m, t
}
var o = t(100),
r = t(117),
s = t(118),
a = t(143),
c = 1,
u = 4,
l = 8,
h = 128,
p = 256,
f = "__lodash_placeholder__",
d = Math.min;
e.exports = i
}, {
100: 100,
117: 117,
118: 118,
143: 143
}],
140: [function(t, e, n) {
(function(n) {
var i = t(129),
o = i(n, "WeakMap"),
r = o && new o;
e.exports = r
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
129: 129
}],
141: [function(t, e, n) {
var i = {};
e.exports = i
}, {}],
142: [function(t, e, n) {
function i(t, e) {
for (var n = t.length, i = s(e.length, n), a = o(t); i--;) {
var c = e[i];
t[i] = r(c, n) ? a[c] : void 0
}
return t
}
var o = t(100),
r = t(134),
s = Math.min;
e.exports = i
}, {
100: 100,
134: 134
}],
143: [function(t, e, n) {
function i(t, e) {
for (var n = -1, i = t.length, r = -1, s = []; ++n < i;) t[n] === e && (t[n] = o, s[++r] = n);
return s
}
var o = "__lodash_placeholder__";
e.exports = i
}, {}],
144: [function(t, e, n) {
var i = t(114),
o = t(94),
r = 150,
s = 16,
a = function() {
var t = 0,
e = 0;
return function(n, a) {
var c = o(),
u = s - (c - e);
if (e = c, u > 0) {
if (++t >= r) return n
} else t = 0;
return i(n, a)
}
}();
e.exports = a
}, {
114: 114,
94: 94
}],
145: [function(t, e, n) {
function i(t) {
for (var e = c(t), n = e.length, i = n && t.length, u = !!i && a(i) && (r(t) || o(t)), h = -1, p = []; ++h < n;) {
var f = e[h];
(u && s(f, i) || l.call(t, f)) && p.push(f)
}
return p
}
var o = t(149),
r = t(150),
s = t(134),
a = t(137),
c = t(159),
u = Object.prototype,
l = u.hasOwnProperty;
e.exports = i
}, {
134: 134,
137: 137,
149: 149,
150: 150,
159: 159
}],
146: [function(t, e, n) {
function i(t) {
return o(t) ? t : Object(t)
}
var o = t(153);
e.exports = i
}, {
153: 153
}],
147: [function(t, e, n) {
function i(t) {
return t instanceof o ? t.clone() : new r(t.__wrapped__, t.__chain__, s(t.__actions__))
}
var o = t(98),
r = t(99),
s = t(100);
e.exports = i
}, {
100: 100,
98: 98,
99: 99
}],
148: [function(t, e, n) {
function i(t, e, n) {
return "function" == typeof e ? o(t, !0, r(e, n, 3)) : o(t, !0)
}
var o = t(105),
r = t(115);
e.exports = i
}, {
105: 105,
115: 115
}],
149: [function(t, e, n) {
function i(t) {
return r(t) && o(t) && a.call(t, "callee") && !c.call(t, "callee")
}
var o = t(133),
r = t(138),
s = Object.prototype,
a = s.hasOwnProperty,
c = s.propertyIsEnumerable;
e.exports = i
}, {
133: 133,
138: 138
}],
150: [function(t, e, n) {
var i = t(129),
o = t(137),
r = t(138),
s = "[object Array]",
a = Object.prototype,
c = a.toString,
u = i(Array, "isArray"),
l = u || function(t) {
return r(t) && o(t.length) && c.call(t) == s
};
e.exports = l
}, {
129: 129,
137: 137,
138: 138
}],
151: [function(t, e, n) {
function i(t) {
return o(t) && a.call(t) == r
}
var o = t(153),
r = "[object Function]",
s = Object.prototype,
a = s.toString;
e.exports = i
}, {
153: 153
}],
152: [function(t, e, n) {
function i(t) {
return null == t ? !1 : o(t) ? l.test(c.call(t)) : r(t) && s.test(t)
}
var o = t(151),
r = t(138),
s = /^\[object .+?Constructor\]$/,
a = Object.prototype,
c = Function.prototype.toString,
u = a.hasOwnProperty,
l = RegExp("^" + c.call(u).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
e.exports = i
}, {
138: 138,
151: 151
}],
153: [function(t, e, n) {
function i(t) {
var e = typeof t;
return !!t && ("object" == e || "function" == e)
}
e.exports = i
}, {}],
154: [function(t, e, n) {
function i(t) {
return "string" == typeof t || o(t) && a.call(t) == r
}
var o = t(138),
r = "[object String]",
s = Object.prototype,
a = s.toString;
e.exports = i
}, {
138: 138
}],
155: [function(t, e, n) {
var i = t(103),
o = t(104),
r = t(119),
s = r(function(t, e, n) {
return n ? i(t, e, n) : o(t, e)
});
e.exports = s
}, {
103: 103,
104: 104,
119: 119
}],
156: [function(t, e, n) {
function i(t, e, n) {
var i = r(t);
return n && s(t, e, n) && (e = void 0), e ? o(i, e) : i
}
var o = t(104),
r = t(107),
s = t(135);
e.exports = i
}, {
104: 104,
107: 107,
135: 135
}],
157: [function(t, e, n) {
function i(t) {
return o(t, r(t))
}
var o = t(111),
r = t(159);
e.exports = i
}, {
111: 111,
159: 159
}],
158: [function(t, e, n) {
var i = t(129),
o = t(133),
r = t(153),
s = t(145),
a = i(Object, "keys"),
c = a ? function(t) {
var e = null == t ? void 0 : t.constructor;
return "function" == typeof e && e.prototype === t || "function" != typeof t && o(t) ? s(t) : r(t) ? a(t) : []
} : s;
e.exports = c
}, {
129: 129,
133: 133,
145: 145,
153: 153
}],
159: [function(t, e, n) {
function i(t) {
if (null == t) return [];
c(t) || (t = Object(t));
var e = t.length;
e = e && a(e) && (r(t) || o(t)) && e || 0;
for (var n = t.constructor, i = -1, u = "function" == typeof n && n.prototype === t, h = Array(e), p = e > 0; ++i < e;) h[i] = i + "";
for (var f in t) p && s(f, e) || "constructor" == f && (u || !l.call(t, f)) || h.push(f);
return h
}
var o = t(149),
r = t(150),
s = t(134),
a = t(137),
c = t(153),
u = Object.prototype,
l = u.hasOwnProperty;
e.exports = i
}, {
134: 134,
137: 137,
149: 149,
150: 150,
153: 153
}],
160: [function(t, e, n) {
function i(t) {
return t
}
e.exports = i
}, {}],
161: [function(t, e, n) {
function i() {}
e.exports = i
}, {}],
162: [function(t, e, n) {
function i(t) {
try {
return Array.prototype.slice.call(t)
} catch (e) {
for (var n = [], i = 0; i < t.length; i++) n.push(t[i]);
return n
}
}
"undefined" != typeof e && (e.exports = i)
}, {}],
163: [function(t, e, n) {
"use strict";
function i(t) {
if (t = t || {}, this.channel = t.channel, !this.channel) throw new Error("Channel ID must be specified");
this.merchantUrl = t.merchantUrl, this._isDestroyed = !1, this._isVerbose = !1, this._listeners = [], this._log("new bus on channel " + this.channel, [location.href])
}
var o = t(89),
r = t(165),
s = t(164).checkOrigin;
i.prototype.on = function(t, e) {
var n, i, r = e,
a = this;
this._isDestroyed || (this.merchantUrl && (r = function() {
s(this.origin, a.merchantUrl) && e.apply(this, arguments)
}), n = this._namespaceEvent(t), i = Array.prototype.slice.call(arguments), i[0] = n, i[1] = r, this._log("on", i), o.on.apply(o, i), this._listeners.push({
eventName: t,
handler: r,
originalHandler: e
}))
}, i.prototype.emit = function(t) {
var e;
this._isDestroyed || (e = Array.prototype.slice.call(arguments), e[0] = this._namespaceEvent(t), this._log("emit", e), o.emit.apply(o, e))
}, i.prototype._offDirect = function(t) {
var e = Array.prototype.slice.call(arguments);
this._isDestroyed || (e[0] = this._namespaceEvent(t), this._log("off", e), o.off.apply(o, e))
}, i.prototype.off = function(t, e) {
var n, i, o = e;
if (!this._isDestroyed) {
if (this.merchantUrl)
for (n = 0; n < this._listeners.length; n++) i = this._listeners[n], i.originalHandler === e && (o = i.handler);
this._offDirect(t, o)
}
}, i.prototype._namespaceEvent = function(t) {
return ["braintree", this.channel, t].join(":")
}, i.prototype.teardown = function() {
var t, e;
for (e = 0; e < this._listeners.length; e++) t = this._listeners[e], this._offDirect(t.eventName, t.handler);
this._listeners.length = 0, this._isDestroyed = !0
}, i.prototype._log = function(t, e) {
this._isVerbose && console.log(t, e)
}, i.events = r, e.exports = i
}, {
164: 164,
165: 165,
89: 89
}],
164: [function(t, e, n) {
"use strict";
function i(t, e) {
var n, i, r = document.createElement("a");
return r.href = e, i = "https:" === r.protocol ? r.host.replace(/:443$/, "") : "http:" === r.protocol ? r.host.replace(/:80$/, "") : r.host, n = r.protocol + "//" + i, n === t || o.test(t)
}
var o = /^https:\/\/([a-zA-Z0-9-]+\.)*(braintreepayments|braintreegateway|paypal)\.com(:\d{1,5})?$/;
e.exports = {
checkOrigin: i
}
}, {}],
165: [function(t, e, n) {
"use strict";
var i, o, r = ["PAYMENT_METHOD_REQUEST", "PAYMENT_METHOD_RECEIVED", "PAYMENT_METHOD_GENERATED", "PAYMENT_METHOD_NOT_GENERATED", "PAYMENT_METHOD_CANCELLED", "PAYMENT_METHOD_ERROR", "CONFIGURATION_REQUEST", "ROOT_METADATA_REQUEST", "ERROR", "WARNING", "UI_POPUP_DID_OPEN", "UI_POPUP_DID_CLOSE", "UI_POPUP_FORCE_CLOSE", "ASYNC_DEPENDENCY_INITIALIZING", "ASYNC_DEPENDENCY_READY", "USER_FORM_SUBMIT_REQUEST", "SEND_ANALYTICS_EVENTS"],
s = {};
for (i = 0; i < r.length; i++) o = r[i], s[o] = o;
e.exports = s
}, {}],
166: [function(t, e, n) {
"use strict";
function i(t) {
var e, n = {};
if (t) {
for (e in t) t.hasOwnProperty(e) && (n[o(e)] = t[e]);
return n
}
}
function o(t) {
return t.replace(/([A-Z])/g, function(t) {
return "_" + t.toLowerCase()
})
}
e.exports = {
convertToLegacyShippingAddress: i
}
}, {}],
167: [function(t, e, n) {
"use strict";
e.exports = {
ROOT_SUCCESS_CALLBACK: "onPaymentMethodReceived",
ROOT_ERROR_CALLBACK: "onError",
ROOT_READY_CALLBACK: "onReady",
TEARDOWN_STATE: {
IN_PROGRESS: "inProgress",
COMPLETE: "complete"
}
}
}, {}],
168: [function(t, e, n) {
(function(n) {
"use strict";
function i() {}
function o() {
this._dependenciesRemaining++
}
function r() {
this._dependenciesRemaining--, 0 === this._dependenciesRemaining && (delete this._dependenciesRemaining, this.bus.off(u.events.ASYNC_DEPENDENCY_INITIALIZING, this._handleDependencyInitializing), this.bus.off(u.events.ASYNC_DEPENDENCY_READY, this._handleDependencyReady), this._onIntegrationReady())
}
function s(t) {
this.configuration = t, this.isReady = !1, this.destructor = new l, this.bus = new u({
channel: this.configuration.channel,
merchantUrl: n.location.href
}), this._createApiClient(), this._configureCallbacks(), this._configureAnalytics(), this._attachEvents(), this._emitInitializing()
}
var a = t(148),
c = t(14),
u = t(163),
l = t(85),
h = t(95),
p = t(167),
f = t(178),
d = t(176),
m = t(174),
y = t(177),
g = y.isJQueryElement,
v = y.isHTMLElement;
s.prototype._emitInitializing = function() {
this.bus.emit(u.events.ASYNC_DEPENDENCY_INITIALIZING)
}, s.prototype._createApiClient = function() {
var t = {
clientToken: this.configuration.gatewayConfiguration,
integration: this.configuration.integrationType,
analyticsConfiguration: this.configuration.analyticsConfiguration
};
this.configuration.merchantConfiguration.enableCORS && (t.enableCORS = !0), this.apiClient = new c.Client(t)
}, s.prototype._configureCallbacks = function() {
function t(t) {
return function(e) {
t(f(e))
}
}
var e = d(this.configuration.merchantConfiguration);
this.onSuccess = t(e(p.ROOT_SUCCESS_CALLBACK)), this.onError = e(p.ROOT_ERROR_CALLBACK, m), this.onReady = e(p.ROOT_READY_CALLBACK)
}, s.prototype._configureAnalytics = function() {
var t = "web." + this.configuration.integrationType + ".",
e = this.apiClient;
this.bus.on(u.events.SEND_ANALYTICS_EVENTS, function(n, i) {
var o;
for (n instanceof Array || (n = [n]), o = 0; o < n.length; o++) n[o] = t + n[o];
e.sendAnalyticsEvents(n, i)
})
}, s.prototype._attachEvents = function() {
var t, e = this.configuration;
this.bus.on(u.events.ERROR, this.onError), this.bus.on(u.events.PAYMENT_METHOD_RECEIVED, this.onSuccess), this.bus.on(u.events.WARNING, function(t) {
try {
console.warn(t)
} catch (e) {}
}), t = {
enableCORS: e.merchantConfiguration.enableCORS,
configuration: e.gatewayConfiguration,
integration: e.integrationType,
analyticsConfiguration: e.analyticsConfiguration,
merchantConfiguration: a(e.merchantConfiguration, function(t) {
return g(t) || v(t) ? {} : void 0
})
}, this.bus.on(u.events.CONFIGURATION_REQUEST, function(e) {
e(t)
}), this._dependenciesRemaining = 0, this._handleDependencyInitializing = h(o, this), this._handleDependencyReady = h(r, this), this.bus.on(u.events.ASYNC_DEPENDENCY_INITIALIZING, this._handleDependencyInitializing), this.bus.on(u.events.ASYNC_DEPENDENCY_READY, this._handleDependencyReady)
}, s.prototype.teardown = function(t) {
if (this.teardownState === p.TEARDOWN_STATE.IN_PROGRESS) throw new Error("Cannot call teardown while in progress");
if (this.teardownState === p.TEARDOWN_STATE.COMPLETE) throw new Error("Cannot teardown integration more than once");
this.teardownMerchantCallback = t || i, this.teardownState = p.TEARDOWN_STATE.IN_PROGRESS, this.destructor.teardown(h(this._handleTeardown, this))
}, s.prototype._handleTeardown = function() {
this.bus.teardown(), this.teardownState = p.TEARDOWN_STATE.COMPLETE, this.teardownMerchantCallback()
}, s.prototype._wrapWithTeardownReply = function(t, e) {
var n = this;
return function() {
if (n.teardownState === p.TEARDOWN_STATE.IN_PROGRESS) throw new Error("Cannot call " + t + " while teardown is in progress");
if (n.teardownState === p.TEARDOWN_STATE.COMPLETE) throw new Error("Cannot call " + t + " after teardown has completed");
e()
}
}, s.prototype._onIntegrationReady = function(t) {
this.returnedInstance = t || {}, this.returnedInstance.teardown = h(this.teardown, this), this.isReady = !0, this.onReady(this.returnedInstance)
}, e.exports = s
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
14: 14,
148: 148,
163: 163,
167: 167,
174: 174,
176: 176,
177: 177,
178: 178,
85: 85,
95: 95
}],
169: [function(t, e, n) {
"use strict";
function i() {
var t, e;
l.apply(this, arguments), t = o(this.configuration.merchantConfiguration), this._attachBusEvents(), t.channel = this.configuration.channel, t.configuration = o(this.configuration.gatewayConfiguration), t.coinbase = o(t.coinbase || {}), t.apiClient = new a.Client({
enableCORS: this.configuration.merchantConfiguration.enableCORS || !1,
clientToken: this.configuration.gatewayConfiguration,
analyticsConfiguration: this.configuration.analyticsConfiguration,
integration: "coinbase"
}), e = c.create(t), null != t && this.destructor.registerFunctionForTeardown(function(t) {
e.teardown(t)
}), this.bus.emit(u.events.ASYNC_DEPENDENCY_READY)
}
var o = t(148),
r = t(156),
s = t(95),
a = t(14),
c = t(180),
u = t(163),
l = t(168);
i.prototype = r(l.prototype, {
constructor: i
}), i.prototype._attachBusEvents = function() {
this.bus.on(u.events.PAYMENT_METHOD_GENERATED, s(this._onPaymentMethodGenerated, this))
}, i.prototype._onPaymentMethodGenerated = function(t) {
this.bus.emit(u.events.PAYMENT_METHOD_RECEIVED, t)
}, e.exports = i
}, {
14: 14,
148: 148,
156: 156,
163: 163,
168: 168,
180: 180,
95: 95
}],
170: [function(t, e, n) {
"use strict";
function i() {
g.apply(this, arguments), null != this.configuration.merchantConfiguration.hostedFields ? this._setupHostedFields() : this._setupForm(), this._setupPayPal(), this._setupCoinbase(), this.bus.emit(m.events.ASYNC_DEPENDENCY_READY)
}
function o(t, e) {
return function(n) {
return e in t && h(t[e][n]) ? t[e][n] : function() {}
}
}
var r = t(148),
s = t(156),
a = t(198),
c = t(210),
u = t(180),
l = t(95),
h = t(151),
p = t(204),
f = t(88),
d = t(167),
m = t(163),
y = t(166).convertToLegacyShippingAddress,
g = t(168),
v = t(177),
_ = v.isJQueryElement,
b = v.isHTMLElement,
E = t(175);
i.prototype = s(g.prototype, {
constructor: i
}), i.prototype._setupHostedFields = function() {
var t, e = this.configuration.merchantConfiguration,
n = e[d.ROOT_SUCCESS_CALLBACK],
i = new f(e.id),
o = p.create(this.configuration),
r = new E({
formNapper: i,
rootCallback: n,
channel: this.configuration.channel
});
return null == i.htmlForm ? void this.bus.emit(m.events.ERROR, {
type: "CONFIGURATION",
message: "options.id does not reference a valid DOM element"
}) : (t = l(r.handleSubmitRequest, r), i.hijack(t), this.bus.on(m.events.USER_FORM_SUBMIT_REQUEST, t), void this.destructor.registerFunctionForTeardown(l(function(t) {
r.teardown(), i.detach(), o.teardown(t)
}, this)))
}, i.prototype._setupForm = function() {
var t, e, n, i = this.configuration.merchantConfiguration;
i.id ? (n = a.setup(this.apiClient, this.configuration), t = !h(i[d.ROOT_SUCCESS_CALLBACK]), t || (e = this.onSuccess, n.onNonceReceived = l(function(t, n) {
t ? this.bus.emit(m.events.ERROR, t) : e(n)
}, this)), this.destructor.registerFunctionForTeardown(function() {
n.teardown()
})) : this.bus.on(m.events.PAYMENT_METHOD_GENERATED, l(function(t) {
this.bus.emit(m.events.PAYMENT_METHOD_RECEIVED, t)
}, this))
}, i.prototype._setupPayPal = function() {
var t, e, n, i, s, a = this.configuration.merchantConfiguration;
a.paypal && (s = r(a.paypal, function(t) {
return _(t) ? t[0] : b(t) ? t : void 0
}), t = o(a, "paypal"), e = t("onSuccess"), n = t("onCancelled"), s.paymentMethodNonceInputField || (i = document.createElement("input"), i.id = "braintree-custom-integration-dummy-input", s.paymentMethodNonceInputField = i), s.onSuccess = function(t) {
e(t.nonce, t.details.email, y(t.details.shippingAddress))
}, s.onCancelled = function() {
n()
}, a.enableCORS && (s.enableCORS = !0), this.paypalIntegration = c.create(this.configuration.gatewayConfiguration, s, this.configuration.channel), null != this.paypalIntegration && this.destructor.registerFunctionForTeardown(l(function() {
this.paypalIntegration.teardown()
}, this)))
}, i.prototype._setupCoinbase = function() {
var t, e;
this.configuration.merchantConfiguration.coinbase && (navigator.userAgent.match(/MSIE 8\.0/) || (t = r(this.configuration.merchantConfiguration), t.channel = this.configuration.channel, t.configuration = this.configuration.gatewayConfiguration, t.apiClient = this.apiClient, delete t.paypal, e = u.create(t), null != e && this.destructor.registerFunctionForTeardown(function(t) {
e.teardown(t)
})))
}, i.prototype._onIntegrationReady = function() {
var t = this,
e = {};
this.paypalIntegration && (e.paypal = {
initAuthFlow: this._wrapWithTeardownReply("initAuthFlow", function() {
t.bus.emit(m.events.SEND_ANALYTICS_EVENTS, "paypal.auth.init"), t.paypalIntegration.initAuthFlow()
}),
closeAuthFlow: this._wrapWithTeardownReply("closeAuthFlow", function() {
t.bus.emit(m.events.SEND_ANALYTICS_EVENTS, "paypal.auth.close"), t.paypalIntegration.closeAuthFlow()
})
}), g.prototype._onIntegrationReady.call(this, e)
}, e.exports = i
}, {
148: 148,
151: 151,
156: 156,
163: 163,
166: 166,
167: 167,
168: 168,
175: 175,
177: 177,
180: 180,
198: 198,
204: 204,
210: 210,
88: 88,
95: 95
}],
171: [function(t, e, n) {
"use strict";
function i(t) {
return u(t.paymentMethodNonceReceived) ? t.paymentMethodNonceReceived : null
}
function o(t) {
return u(t[h.ROOT_SUCCESS_CALLBACK])
}
function r() {
var t, e, n, r;
f.apply(this, arguments), t = this.configuration.merchantConfiguration, e = i(t), n = o(t), (e || n) && (t.paymentMethodNonceReceived = c(function(t) {
e && e(t.originalEvent, t.nonce), this.bus.emit(l.events.PAYMENT_METHOD_RECEIVED, p(t))
}, this)), r = a.create(this.configuration), this.destructor.registerFunctionForTeardown(function(t) {
r.teardown(t)
}), this.bus.emit(l.events.ASYNC_DEPENDENCY_READY)
}
var s = t(156),
a = t(196),
c = t(95),
u = t(151),
l = t(163),
h = t(167),
p = t(178),
f = t(168);
r.prototype = s(f.prototype, {
constructor: r
}), e.exports = r
}, {
151: 151,
156: 156,
163: 163,
167: 167,
168: 168,
178: 178,
196: 196,
95: 95
}],
172: [function(t, e, n) {
"use strict";
e.exports = {
custom: t(170),
dropin: t(171),
paypal: t(173),
coinbase: t(169)
}
}, {
169: 169,
170: 170,
171: 171,
173: 173
}],
173: [function(t, e, n) {
"use strict";
function i(t) {
return "onSuccess" in t && u(t.onSuccess) ? t.onSuccess : "paypal" in t && u(t.paypal.onSuccess) ? t.paypal.onSuccess : null
}
function o(t) {
return u(t[l.ROOT_SUCCESS_CALLBACK])
}
function r() {
var t, e, n;
f.apply(this, arguments), t = this.configuration.merchantConfiguration, e = i(t), n = o(t), (e || n) && (t.onSuccess = c(function(t) {
e && e(t.nonce, t.details.email, p(t.details.shippingAddress)), this.bus.emit(h.events.PAYMENT_METHOD_RECEIVED, t)
}, this)), this.paypalIntegration = a.create(this.configuration.gatewayConfiguration, t, this.configuration.channel), this.destructor.registerFunctionForTeardown(c(function() {
this.paypalIntegration.teardown()
}, this)), this.bus.emit(h.events.ASYNC_DEPENDENCY_READY)
}
var s = t(156),
a = t(210),
c = t(95),
u = t(151),
l = t(167),
h = t(163),
p = t(166).convertToLegacyShippingAddress,
f = t(168);
r.prototype = s(f.prototype, {
constructor: r
}), r.prototype._onIntegrationReady = function() {
var t = this,
e = {};
this.paypalIntegration && (e.paypal = {
initAuthFlow: this._wrapWithTeardownReply("initAuthFlow", function() {
t.bus.emit(h.events.SEND_ANALYTICS_EVENTS, "paypal.auth.init"), t.paypalIntegration.initAuthFlow()
}),
closeAuthFlow: this._wrapWithTeardownReply("closeAuthFlow", function() {
t.bus.emit(h.events.SEND_ANALYTICS_EVENTS, "paypal.auth.close"), t.paypalIntegration.closeAuthFlow()
})
}), f.prototype._onIntegrationReady.call(this, e)
}, e.exports = r
}, {
151: 151,
156: 156,
163: 163,
166: 166,
167: 167,
168: 168,
210: 210,
95: 95
}],
174: [function(t, e, n) {
"use strict";
e.exports = function(t) {
if ("CONFIGURATION" === t.type || "IMMEDIATE" === t.type) throw new Error(t.message);
try {
console.error(-1 === navigator.userAgent.indexOf("MSIE") ? t : JSON.stringify(t, null, 2))
} catch (e) {}
}
}, {}],
175: [function(t, e, n) {
"use strict";
function i(t) {
this.paymentMethod = null, this.nonceInputElement = null, this.bus = new o({
channel: t.channel
}), this.formNapper = t.formNapper, this.rootCallback = t.rootCallback, this._attachEvents()
}
var o = t(163),
r = t(204),
s = "web.custom.hosted-fields.via.",
a = "payment_method_nonce";
i.prototype._shouldStrictlyValidate = function(t) {
return null != t ? !1 : null == this.paymentMethod || "CreditCard" === this.paymentMethod.type
}, i.prototype._clearNonce = function() {
this.paymentMethod = null, this.nonceInputElement = this.formNapper.inject(a, "")
}, i.prototype._attachEvents = function() {
var t = this;
this.bus.on(o.events.PAYMENT_METHOD_CANCELLED, function() {
t._clearNonce()
}), this.bus.on(o.events.PAYMENT_METHOD_GENERATED, function(e) {
t.paymentMethod = e, t.nonceInputElement = t.formNapper.inject(a, t.paymentMethod.nonce)
})
}, i.prototype.handleSubmitRequest = function() {
var t = this;
this.bus.emit(r.events.TOKENIZATION_REQUEST, function(e) {
var n = e[0],
i = e[1];
return n ? void t.bus.emit(o.events.ERROR, n) : (t.paymentMethod = i || t.paymentMethod, t._shouldStrictlyValidate(i) ? (t.bus.emit(r.events.VALIDATE_STRICT), void t.bus.emit(o.events.ERROR, {
type: "VALIDATION",
message: "User did not enter a payment method"
})) : void(t.rootCallback ? t.bus.emit(o.events.SEND_ANALYTICS_EVENTS, s + "callback.success", function() {
t.rootCallback(t.paymentMethod)
}) : t.bus.emit(o.events.SEND_ANALYTICS_EVENTS, s + "formsubmit.success", function() {
t.nonceInputElement = t.formNapper.inject(a, t.paymentMethod.nonce), t.formNapper.submit()
})))
})
}, i.prototype.teardown = function() {
this._clearNonce()
}, e.exports = i
}, {
163: 163,
204: 204
}],
176: [function(t, e, n) {
"use strict";
function i() {}
var o = t(151);
e.exports = function(t) {
return function(e, n) {
return o(t[e]) ? t[e] : o(n) ? n : i
}
}
}, {
151: 151
}],
177: [function(t, e, n) {
"use strict";
function i(t) {
return "object" == typeof t && "jquery" in t && 0 !== t.length
}
function o(t) {
return t && 1 === t.nodeType
}
e.exports = {
isJQueryElement: i,
isHTMLElement: o
}
}, {}],
178: [function(t, e, n) {
"use strict";
e.exports = function(t) {
return {
nonce: t.nonce,
details: t.details,
type: t.type
}
}
}, {}],
179: [function(t, e, n) {
(function(n) {
"use strict";
function i(t, e, i) {
if (!c.hasOwnProperty(e)) throw new Error(e + " is an unsupported integration");
i = i || {}, r._getConfiguration({
enableCORS: i.enableCORS || !1,
clientToken: t
}, function(t, r) {
var s;
return t ? (s = h(i)(u.ROOT_ERROR_CALLBACK, l), void s({
message: t.errors
})) : void new c[e]({
channel: p(),
gatewayConfiguration: r,
integrationType: e,
merchantConfiguration: i,
analyticsConfiguration: {
sdkVersion: "braintree/web/" + o,
merchantAppId: n.location.host
}
})
})
}
var o = "2.15.5",
r = t(14),
s = t(210),
a = t(196),
c = t(172),
u = t(167),
l = t(174),
h = t(176),
p = t(81).uuid;
e.exports = {
api: r,
cse: n.Braintree,
paypal: s,
dropin: a,
hostedFields: {
VERSION: t(204).VERSION
},
setup: i,
VERSION: o
}
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
14: 14,
167: 167,
172: 172,
174: 174,
176: 176,
196: 196,
204: 204,
210: 210,
81: 81
}],
180: [function(t, e, n) {
"use strict";
function i(t) {
var e = new o(t);
return e.canCreateIntegration ? e : null
}
var o = t(183);
e.exports = {
create: i
}
}, {
183: 183
}],
181: [function(t, e, n) {
(function(t) {
"use strict";
function n(e) {
return e = e || t.navigator.userAgent, /AppleWebKit\//.test(e) && /Mobile\//.test(e) ? e.replace(/.* OS ([0-9_]+) like Mac OS X.*/, "$1").replace(/_/g, ".") : null
}
function i(e) {
var n = e || t.navigator.userAgent,
i = null,
o = /MSIE.(\d+)/.exec(n);
return /Trident/.test(n) && (i = 11), o && (i = parseInt(o[1], 10)), i
}
function o(e) {
return e = e || t.navigator.userAgent, /Android/.test(e) ? e.replace(/^.* Android ([0-9\.]+).*$/, "$1") : null
}
e.exports = {
ieVersion: i,
iOSSafariVersion: n,
androidVersion: o
}
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {}],
182: [function(t, e, n) {
"use strict";
function i(t, e, n) {
return t ? (n.bus.emit(o.ERROR, t.error), void n.bus.emit(o.SEND_ANALYTICS_EVENTS, "coinbase.generate.nonce.failed")) : (n.bus.emit(o.PAYMENT_METHOD_GENERATED, e), void n.bus.emit(o.SEND_ANALYTICS_EVENTS, "coinbase.generate.nonce.succeeded"))
}
var o = t(163).events;
e.exports = {
tokenize: i
}
}, {
163: 163
}],
183: [function(t, e, n) {
(function(n) {
"use strict";
function i(t) {
return {
clientId: t.configuration.coinbase.clientId,
redirectUrl: t.configuration.coinbase.redirectUrl,
scopes: t.configuration.coinbase.scopes || f.SCOPES,
meta: {
authorizations_merchant_account: t.configuration.coinbase.merchantAccount || ""
}
}
}
function o(t) {
return function(e, n) {
t.emit(m.events.ERROR, {
type: n,
message: e
})
}
}
function r(t, e) {
var n = (t || {}).coinbase,
i = o(e);
if (null == t.apiClient) i("settings.apiClient is required for coinbase", f.CONFIGURATION_ERROR);
else if (t.configuration.coinbaseEnabled)
if (n && (n.container || n.button))
if (n.container && n.button) i("options.coinbase.container and options.coinbase.button are mutually exclusive", f.CONFIGURATION_ERROR);
else {
if (d.isSupportedBrowser()) return !0;
i("Coinbase is not supported by your browser. Please consider upgrading", f.UNSUPPORTED_BROWSER_ERROR)
} else i("Either options.coinbase.container or options.coinbase.button is required for Coinbase integrations", f.CONFIGURATION_ERROR);
else i("Coinbase is not enabled for your merchant account", f.CONFIGURATION_ERROR);
return !1
}
function s(t) {
var e, o, s = this;
this.destructor = new u, this.channel = t.channel, o = {
channel: this.channel
};
try {
t.coinbase.container && (o.merchantUrl = n.location.href)
} catch (l) {}
this.bus = t.bus || new m(o), this.canCreateIntegration = r(t, this.bus), this.canCreateIntegration && (this.buttonId = t.coinbase.button || f.BUTTON_ID, this.apiClient = t.apiClient, this.assetsUrl = t.configuration.assetsUrl, this.environment = t.configuration.coinbase.environment, this._onOAuthSuccess = a(this._onOAuthSuccess, this), this._handleButtonClick = a(this._handleButtonClick, this), this.popupParams = i(t), this.redirectDoneInterval = null, t.coinbase.container ? (e = c.normalizeElement(t.coinbase.container), this._insertFrame(e)) : (n.braintreeCoinbasePopupCallback = this._onOAuthSuccess, e = document.body, c.addEventListener(e, "click", this._handleButtonClick), this.bus.emit(m.events.SEND_ANALYTICS_EVENTS, "coinbase.initialized"), this.destructor.registerFunctionForTeardown(function() {
s._closePopup()
}), this.bus.on(f.TEARDOWN_EVENT, a(this.destructor.teardown, this.destructor))))
}
var a = t(95),
c = t(81),
u = t(85),
l = t(187),
h = t(190),
p = t(182),
f = t(184),
d = t(185),
m = t(163);
s.prototype._insertFrame = function(t) {
var e = this,
n = l.createFrame({
channel: this.channel
});
this.bus.emit(m.events.ASYNC_DEPENDENCY_INITIALIZING), t.appendChild(n), this.destructor.registerFunctionForTeardown(function() {
t.removeChild(n)
}), setTimeout(function() {
n.src = e.assetsUrl + "/coinbase/" + f.VERSION + "/coinbase-frame.html#" + e.channel
}, 0)
}, s.prototype._onOAuthSuccess = function(t) {
var e = this;
return t.code ? (this.bus.emit("coinbase:view:navigate", "loading"), this.bus.emit(m.events.SEND_ANALYTICS_EVENTS, "coinbase.popup.authorized"), this.apiClient.tokenizeCoinbase({
code: t.code,
query: h.getQueryString()
}, function(t, n) {
p.tokenize.apply(null, [t, n, e])
}), void this._closePopup()) : (this.bus.emit(m.events.SEND_ANALYTICS_EVENTS, "coinbase.popup.denied"), void this._closePopup())
}, s.prototype._clearPollForRedirectDone = function() {
this.redirectDoneInterval && (clearInterval(this.redirectDoneInterval), this.redirectDoneInterval = null)
}, s.prototype._closePopup = function(t) {
t = t || this.popup, null != t && (d.shouldCloseFromParent() && t.close(), this._popupCleanup())
}, s.prototype._popupCleanup = function() {
this._clearPollForRedirectDone(), this.bus.emit(m.events.UI_POPUP_DID_CLOSE, {
source: f.INTEGRATION_NAME
})
}, s.prototype._pollForRedirectDone = function(t) {
var e = this,
n = setInterval(function() {
var n;
if (null == t || t.closed) return e.bus.emit(m.events.SEND_ANALYTICS_EVENTS, "coinbase.popup.aborted"), void e._popupCleanup();
try {
if ("about:blank" === t.location.href) throw new Error("Not finished loading");
n = c.decodeQueryString(t.location.search.replace(/^\?/, "")).code
} catch (i) {
return
}
e._onOAuthSuccess({
code: n
})
}, 100);
return this.redirectDoneInterval = n, n
}, s.prototype._openPopup = function() {
var t;
this.bus.emit(m.events.SEND_ANALYTICS_EVENTS, "coinbase.popup.started"), t = l.createPopup(h.compose(this._getOAuthBaseUrl(), this.popupParams)), t.focus(), this._pollForRedirectDone(t), this.bus.emit(m.events.UI_POPUP_DID_OPEN, {
source: f.INTEGRATION_NAME
}), this.bus.on(m.events.UI_POPUP_FORCE_CLOSE, function(e) {
e.target === f.INTEGRATION_NAME && t.close()
}), this.popup = t
}, s.prototype._getOAuthBaseUrl = function() {
var t;
return t = "shared_sandbox" === this.environment ? f.SANDBOX_OAUTH_BASE_URL : f.PRODUCTION_OAUTH_BASE_URL
}, s.prototype._handleButtonClick = function(t) {
for (var e = t.target || t.srcElement;;) {
if (null == e) return;
if (e === t.currentTarget) return;
if (e.id === this.buttonId) break;
e = e.parentNode
}
t && t.preventDefault ? t.preventDefault() : t.returnValue = !1, this._openPopup()
}, s.prototype.teardown = function(t) {
var e = this;
return this.canCreateIntegration ? void this.bus.emit(f.TEARDOWN_EVENT, function() {
e.destructor.teardown(function(n) {
return n ? t(n) : (e.bus.teardown(), void t(null))
})
}) : void t(null)
}, e.exports = s
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
163: 163,
182: 182,
184: 184,
185: 185,
187: 187,
190: 190,
81: 81,
85: 85,
95: 95
}],
184: [function(t, e, n) {
"use strict";
e.exports = {
PRODUCTION_OAUTH_BASE_URL: "https://coinbase.com",
SANDBOX_OAUTH_BASE_URL: "https://sandbox.coinbase.com",
ORIGIN_URL: "https://www.coinbase.com",
FRAME_NAME: "braintree-coinbase-frame",
POPUP_NAME: "coinbase",
BUTTON_ID: "bt-coinbase-button",
SCOPES: "send",
VERSION: "2.15.5",
INTEGRATION_NAME: "Coinbase",
CONFIGURATION_ERROR: "CONFIGURATION",
UNSUPPORTED_BROWSER_ERROR: "UNSUPPORTED_BROWSER",
TEARDOWN_EVENT: "coinbase:TEARDOWN"
}
}, {}],
185: [function(t, e, n) {
"use strict";
function i() {
var t = a.ieVersion();
return !t || t > 8
}
function o() {
var t = a.androidVersion();
return null == t ? !1 : /^5/.test(t)
}
function r() {
return !(o() || s())
}
function s() {
var t = a.iOSSafariVersion();
return null == t ? !1 : /^8\.0/.test(t) || /^8\.1$/.test(t)
}
var a = t(181);
e.exports = {
isSupportedBrowser: i,
shouldCloseFromParent: r,
shouldDisplayIOSClose: s,
shouldDisplayLollipopClose: o
}
}, {
181: 181
}],
186: [function(t, e, n) {
"use strict";
function i(t) {
var e = document.createElement("button");
return t = t || {}, e.id = t.id || "coinbase-button", e.style.backgroundColor = t.backgroundColor || "#EEE", e.style.color = t.color || "#4597C3", e.style.border = t.border || "0", e.style.borderRadius = t.borderRadius || "6px", e.style.padding = t.padding || "12px", e.innerHTML = t.innerHTML || "coinbase", e
}
e.exports = {
create: i
}
}, {}],
187: [function(t, e, n) {
"use strict";
var i = t(189),
o = t(186),
r = t(188);
e.exports = {
createButton: o.create,
createPopup: i.create,
createFrame: r.create
}
}, {
186: 186,
188: 188,
189: 189
}],
188: [function(t, e, n) {
"use strict";
function i() {
return r({
name: o.FRAME_NAME,
height: "70px",
width: "100%",
style: {
padding: 0,
margin: 0,
border: 0,
outline: "none"
}
})
}
var o = t(184),
r = t(90);
e.exports = {
create: i
}
}, {
184: 184,
90: 90
}],
189: [function(t, e, n) {
(function(n) {
"use strict";
function i(t) {
var e, n = [];
for (e in t) t.hasOwnProperty(e) && n.push([e, t[e]].join("="));
return n.join(",")
}
function o() {
var t = 580,
e = 810;
return i({
width: t,
height: e,
left: (screen.width - t) / 2,
top: (screen.height - e) / 4
})
}
function r(t) {
return n.open(t, s.POPUP_NAME, o())
}
var s = t(184);
e.exports = {
create: r
}
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
184: 184
}],
190: [function(t, e, n) {
"use strict";
function i() {
return "version=" + r.VERSION
}
function o(t, e) {
var n, o = t + "/oauth/authorize?response_type=code",
r = e.redirectUrl + "?" + i();
if (o += "&redirect_uri=" + encodeURIComponent(r), o += "&client_id=" + e.clientId, e.scopes && (o += "&scope=" + encodeURIComponent(e.scopes)), e.meta)
for (n in e.meta) e.meta.hasOwnProperty(n) && (o += "&meta[" + encodeURIComponent(n) + "]=" + encodeURIComponent(e.meta[n]));
return o
}
var r = t(184);
e.exports = {
compose: o,
getQueryString: i
}
}, {
184: 184
}],
191: [function(t, e, n) {
"use strict";
function i(t) {
this.apiClient = t
}
var o = ["unlockCreditCard"];
i.prototype.attach = function(t) {
function e(e) {
t.define(e, function() {
n.apiClient[e].apply(n.apiClient, arguments)
})
}
var n = this,
i = 0,
r = o.length;
for (i; r > i; i++) e(o[i])
}, e.exports = i
}, {}],
192: [function(t, e, n) {
(function(n) {
"use strict";
function i(t, e) {
var n = window.getComputedStyle ? getComputedStyle(t) : t.currentStyle;
return n[e]
}
function o() {
return {
html: {
height: a.style.height || "",
overflow: i(a, "overflow"),
position: i(a, "position")
},
body: {
height: c.style.height || "",
overflow: i(c, "overflow")
}
}
}
function r() {
var t = /Android|iPhone|iPod|iPad/i.test(window.navigator.userAgent);
return t
}
function s(t) {
var e, i, o, r = this;
this.channel = t.channel, this.destructor = new h, this.merchantConfiguration = t.merchantConfiguration, this.encodedClientToken = t.gatewayConfiguration, this.analyticsConfiguration = t.analyticsConfiguration, this.paypalOptions = t.merchantConfiguration.paypal || {}, this.container = null, this.merchantFormManager = null, this.root = t.root, this.configurationRequests = [], this.braintreeApiClient = u.configure({
clientToken: t.gatewayConfiguration,
analyticsConfiguration: this.analyticsConfiguration,
integration: "dropin",
enableCORS: this.merchantConfiguration.enableCORS
}), this.paymentMethodNonceReceivedCallback = t.merchantConfiguration.paymentMethodNonceReceived, this.clientToken = u.parseClientToken(t.gatewayConfiguration), this.braintreeBus = new l({
merchantUrl: n.location.href,
channel: t.channel
}), this.bus = new p.MessageBus(this.root, this.channel), this.rpcServer = new p.RPCServer(this.bus), this.apiProxyServer = new g(this.braintreeApiClient), this.apiProxyServer.attach(this.rpcServer), e = t.inlineFramePath || this.clientToken.assetsUrl + "/dropin/" + E + "/inline-frame.html", i = t.modalFramePath || this.clientToken.assetsUrl + "/dropin/" + E + "/modal-frame.html", a = document.documentElement, c = document.body, this.frames = {
inline: this._createFrame(e, b.INLINE_FRAME_NAME),
modal: this._createFrame(i, b.MODAL_FRAME_NAME)
}, this.container = d(t.merchantConfiguration.container, "Unable to find valid container."), o = d(t.merchantConfiguration.form || this._findClosest(this.container, "form")), this.merchantFormManager = new v({
form: o,
frames: this.frames,
onSubmit: this.paymentMethodNonceReceivedCallback,
apiClient: this.braintreeApiClient
}).initialize(), this.destructor.registerFunctionForTeardown(function() {
r.merchantFormManager.teardown()
}), t.gatewayConfiguration.paypalEnabled && this._configurePayPal(), this.braintreeApiClient.sendAnalyticsEvents("dropin.web.initialized")
}
var a, c, u = t(14),
l = t(163),
h = t(85),
p = t(63),
f = t(81),
d = f.normalizeElement,
m = t(95),
y = f.isBrowserHttps,
g = t(191),
v = t(195),
_ = t(194),
b = t(197),
E = "2.15.5",
w = t(214);
s.prototype.initialize = function() {
var t, e = this;
this._initializeModal(), this.braintreeBus.emit(l.events.ASYNC_DEPENDENCY_INITIALIZING), this.container.appendChild(this.frames.inline.element), c.appendChild(this.frames.modal.element), this.destructor.registerFunctionForTeardown(function(t) {
e._hideModal(function() {
e.container.removeChild(e.frames.inline.element), c.removeChild(e.frames.modal.element), t()
})
}), this.rpcServer.define("receiveSharedCustomerIdentifier", function(n) {
for (e.braintreeApiClient.attrs.sharedCustomerIdentifier = n, e.braintreeApiClient.attrs.sharedCustomerIdentifierType = "browser_session_cookie_store", t = 0; t < e.configurationRequests.length; t++) e.configurationRequests[t](e.encodedClientToken);
e.configurationRequests = []
}), this.braintreeBus.on(l.events.PAYMENT_METHOD_GENERATED, m(this._handleAltPayData, this)), this.rpcServer.define("getConfiguration", function(t) {
t({
enableCORS: e.merchantConfiguration.enableCORS,
clientToken: e.encodedClientToken,
paypalOptions: e.paypalOptions,
analyticsConfiguration: e.analyticsConfiguration,
merchantHttps: y()
})
}), this.rpcServer.define("selectPaymentMethod", function(t) {
e.frames.modal.rpcClient.invoke("selectPaymentMethod", [t]), e._showModal()
}), this.rpcServer.define("sendAddedPaymentMethod", function(t) {
e.merchantFormManager.setNoncePayload(t), e.frames.inline.rpcClient.invoke("receiveNewPaymentMethod", [t])
}), this.rpcServer.define("sendUsedPaymentMethod", function(t) {
e.frames.inline.rpcClient.invoke("selectPaymentMethod", [t])
}), this.rpcServer.define("sendUnlockedNonce", function(t) {
e.merchantFormManager.setNoncePayload(t)
}), this.rpcServer.define("clearNonce", function() {
e.merchantFormManager.clearNoncePayload()
}), this.rpcServer.define("closeDropInModal", function() {
e._hideModal()
}), this.rpcServer.define("setInlineFrameHeight", function(t) {
e.frames.inline.element.style.height = t + "px"
}), this.bus.register("ready", function(t) {
t.source === e.frames.inline.element.contentWindow ? e.frames.inline.rpcClient = new p.RPCClient(e.bus, t.source) : t.source === e.frames.modal.element.contentWindow && (e.frames.modal.rpcClient = new p.RPCClient(e.bus, t.source))
})
}, s.prototype._createFrame = function(t, e) {
return new _(t, e, this.braintreeBus)
}, s.prototype._initializeModal = function() {
this.frames.modal.element.style.display = "none", this.frames.modal.element.style.position = r() ? "absolute" : "fixed", this.frames.modal.element.style.top = "0", this.frames.modal.element.style.left = "0", this.frames.modal.element.style.height = "100%", this.frames.modal.element.style.width = "100%"
}, s.prototype._lockMerchantWindowSize = function() {
setTimeout(function() {
a.style.overflow = "hidden", c.style.overflow = "hidden", c.style.height = "100%", r() && (a.style.position = "relative", a.style.height = window.innerHeight + "px")
}, 160)
}, s.prototype._unlockMerchantWindowSize = function() {
var t = this.merchantPageDefaultStyles;
t && (c.style.height = t.body.height, c.style.overflow = t.body.overflow, a.style.overflow = t.html.overflow, r() && (a.style.height = t.html.height, a.style.position = t.html.position), delete this.merchantPageDefaultStyles)
}, s.prototype._showModal = function() {
var t = this,
e = this.frames.modal.element;
this.merchantPageDefaultStyles = o(), e.style.display = "block", this.frames.modal.rpcClient.invoke("open", [], function() {
setTimeout(function() {
t._lockMerchantWindowSize(), e.contentWindow.focus()
}, 200)
})
}, s.prototype._hideModal = function(t) {
this._unlockMerchantWindowSize(), this.frames.modal.element.style.display = "none", t && t()
}, s.prototype._configurePayPal = function() {
this.paypalModalView = new w({
channel: this.channel,
insertFrameFunction: this.paypalOptions.insertFrame,
paypalAssetsUrl: this.clientToken.paypal.assetsUrl,
isHermes: Boolean(this.paypalOptions.singleUse) && Boolean(this.paypalOptions.amount) && Boolean(this.paypalOptions.currency)
})
}, s.prototype._handleAltPayData = function(t) {
this.merchantFormManager.setNoncePayload(t), this.frames.inline.rpcClient.invoke("receiveNewPaymentMethod", [t]), this.frames.modal.rpcClient.invoke("modalViewClose")
}, s.prototype._findClosest = function(t, e) {
e = e.toUpperCase();
do {
if (t.nodeName === e) return t;
t = t.parentNode
} while (t);
throw new Error("Unable to find a valid " + e)
}, s.prototype.teardown = function(t) {
var e = this;
this.paypalModalView && this.paypalModalView.teardown(), this.braintreeBus.emit(b.MODAL_FRAME_TEARDOWN_EVENT, function() {
e.braintreeBus.emit(b.INLINE_FRAME_TEARDOWN_EVENT, function() {
e.destructor.teardown(function(n) {
return n ? t(n) : (e.braintreeBus.teardown(), void t())
})
})
})
}, e.exports = s
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
14: 14,
163: 163,
191: 191,
194: 194,
195: 195,
197: 197,
214: 214,
63: 63,
81: 81,
85: 85,
95: 95
}],
193: [function(t, e, n) {
"use strict";
function i(t) {
var e = new o(t);
return e.initialize(), e
}
var o = t(192),
r = "2.15.5";
e.exports = {
create: i,
VERSION: r
}
}, {
192: 192
}],
194: [function(t, e, n) {
"use strict";
function i() {
var t, e = document.createElement("fakeelement");
for (t in u)
if ("undefined" != typeof e.style[t]) return u[t];
return null
}
function o(t, e) {
function n(i) {
i.target === t && "height" === i.propertyName && (e.emit(s.events.ASYNC_DEPENDENCY_READY), t.removeEventListener(o, n))
}
var o = i();
o ? t.addEventListener(o, n) : setTimeout(function() {
e.emit(s.events.ASYNC_DEPENDENCY_READY)
}, 500)
}
function r(t, e, n) {
var i = "height 210ms cubic-bezier(0.390, 0.575, 0.565, 1.000)",
r = c({
name: e,
width: "100%",
height: "68",
style: {
transition: i,
WebkitTransition: i,
MozTransition: i,
msTransition: i,
OTransition: i,
border: "0",
zIndex: "9999"
}
});
this.element = r, setTimeout(function() {
r.src = t + "#" + n.channel
}, 0), e === a.INLINE_FRAME_NAME && o(r, n)
}
var s = t(163),
a = t(197),
c = t(90),
u = {
transition: "transitionend",
"-o-transition": "otransitionEnd",
"-moz-transition": "transitionend",
"-webkit-transition": "webkitTransitionEnd"
};
e.exports = r
}, {
163: 163,
197: 197,
90: 90
}],
195: [function(t, e, n) {
"use strict";
function i(t) {
this.formNapper = new r(t.form), this.frames = t.frames, this.onSubmit = t.onSubmit, this.apiClient = t.apiClient
}
var o = t(95),
r = t(88);
i.prototype.initialize = function() {
return this._isSubmitBased() && this._setElements(), this._setEvents(), this
}, i.prototype.setNoncePayload = function(t) {
this.noncePayload = t
}, i.prototype.clearNoncePayload = function() {
this.noncePayload = null
}, i.prototype._isSubmitBased = function() {
return !this.onSubmit
}, i.prototype._isCallbackBased = function() {
return Boolean(this.onSubmit)
}, i.prototype._setElements = function() {
this.nonceInput = this.formNapper.inject("payment_method_nonce", "")
}, i.prototype._setEvents = function() {
this.formNapper.hijack(o(this._handleFormSubmit, this));
}, i.prototype._handleFormSubmit = function(t) {
var e = this;
this.noncePayload && this.noncePayload.nonce ? this._handleNonceReply(t) : this.frames.inline.rpcClient.invoke("requestNonce", [], function(n) {
e.setNoncePayload(n), e._handleNonceReply(t)
})
}, i.prototype._handleNonceReply = function(t) {
var e = this;
this._isCallbackBased() ? this.apiClient.sendAnalyticsEvents("dropin.web.end.callback", function() {
var n = e.noncePayload;
n.originalEvent = t, e.onSubmit(n), setTimeout(function() {
delete n.originalEvent, e.frames.inline.rpcClient.invoke("clearLoadingState"), e.frames.inline.rpcClient.invoke("receiveNewPaymentMethod", [n])
}, 200)
}) : this._triggerFormSubmission()
}, i.prototype._triggerFormSubmission = function() {
var t = this;
this.nonceInput = this.formNapper.inject("payment_method_nonce", this.noncePayload.nonce), this.apiClient.sendAnalyticsEvents("dropin.web.end.auto-submit", function() {
t.formNapper.submit()
})
}, i.prototype.teardown = function() {
var t;
this.nonceInput && (t = this.formNapper.htmlForm, t.removeChild(this.nonceInput)), this.formNapper.detach()
}, e.exports = i
}, {
88: 88,
95: 95
}],
196: [function(t, e, n) {
"use strict";
e.exports = t(193)
}, {
193: 193
}],
197: [function(t, e, n) {
e.exports = {
PAYPAL_INTEGRATION_NAME: "PayPal",
INLINE_FRAME_NAME: "braintree-dropin-frame",
MODAL_FRAME_NAME: "braintree-dropin-modal-frame",
PAYMENT_METHOD_TYPES: ["CoinbaseAccount", "PayPalAccount", "CreditCard"],
cssClassMap: {
"American Express": "american-express",
"Diners Club": "diners-club",
DinersClub: "diners-club",
Discover: "discover",
JCB: "jcb",
Maestro: "maestro",
MasterCard: "master-card",
Solo: "solo",
Switch: "switch",
UKMaestro: "maestro",
UnionPay: "unionpay",
Visa: "visa"
},
INLINE_FRAME_TEARDOWN_EVENT: "dropin:TEARDOWN_INLINE_FRAME",
MODAL_FRAME_TEARDOWN_EVENT: "dropin:TEARDOWN_MODAL_FRAME"
}
}, {}],
198: [function(t, e, n) {
"use strict";
function i(t, e) {
var n = e.merchantConfiguration || {},
i = document.getElementById(n.id),
s = n.useCreditCard !== !1;
if (!i) throw new Error('Unable to find form with id: "' + n.id + '"');
return s && r(i), new o(t, e)
}
var o = t(200),
r = t(203);
e.exports = {
setup: i
}
}, {
200: 200,
203: 203
}],
199: [function(t, e, n) {
(function(t) {
"use strict";
function n(t, e) {
var o, s, a, c = t.children;
for (e = e || {}, s = 0; s < c.length; s++) o = c[s], r(o) ? (a = o.getAttribute("data-braintree-name"), "postal_code" === a ? e.billingAddress = {
postalCode: o.value
} : e[a] = o.value, i(o)) : o.children && o.children.length > 0 && n(o, e);
return e
}
function i(t) {
try {
t.attributes.removeNamedItem("name")
} catch (e) {}
}
function o(t) {
n(t)
}
function r(t) {
return t.nodeType === s && t.attributes["data-braintree-name"]
}
var s = t.Node ? t.Node.ELEMENT_NODE : 1;
e.exports = {
extractValues: n,
scrubAllAttributes: o,
scrubAttributes: i,
isBraintreeNode: r
}
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {}],
200: [function(t, e, n) {
(function(n) {
"use strict";
function i(t, e) {
var i = e.merchantConfiguration,
o = "object" == typeof i.paymentMethodNonceInputField,
r = this;
this.destructor = new a, this.apiClient = t, this.isCreditCardForm = i.useCreditCard !== !1, this.htmlForm = document.getElementById(i.id), this.paymentMethodNonceInput = l(i.paymentMethodNonceInputField), this.htmlForm.appendChild(this.paymentMethodNonceInput), this.destructor.registerFunctionForTeardown(function() {
o ? r.paymentMethodNonceInput.value = "" : r.htmlForm.removeChild(r.paymentMethodNonceInput)
}), this.model = new u, this.bus = new c({
merchantUrl: n.location.href,
channel: e.channel
}), this.setEvents(), this.destructor.registerFunctionForTeardown(function() {
r.bus.teardown()
})
}
var o = t(95),
r = t(81),
s = t(199),
a = t(85),
c = t(163),
u = t(202),
l = t(201),
h = {
message: "Unable to process payments at this time",
type: "IMMEDIATE"
};
i.prototype.setEvents = function() {
var t = this;
this.onSubmitHandler = o(this.handleSubmit, this), this.onExternalNonceReceived = o(this.onExternalNonceReceived, this), this.clearExternalNonce = o(this.clearExternalNonce, this), r.addEventListener(this.htmlForm, "submit", this.onSubmitHandler), this.destructor.registerFunctionForTeardown(function() {
r.removeEventListener(t.htmlForm, "submit", t.onSubmitHandler)
}), this.bus.on(c.events.PAYMENT_METHOD_GENERATED, this.onExternalNonceReceived), this.bus.on(c.events.PAYMENT_METHOD_CANCELLED, this.clearExternalNonce)
}, i.prototype.handleSubmit = function(t) {
var e, n = this;
return t.preventDefault ? t.preventDefault() : t.returnValue = !1, this.isCreditCardForm ? (e = this.model.get("type"), e && "CreditCard" !== e ? (s.scrubAllAttributes(this.htmlForm), void this.onNonceReceived(null, this.model.attributes)) : void this.apiClient.tokenizeCard(s.extractValues(this.htmlForm), function(t, e, i) {
t ? n.onNonceReceived(h, null) : (n.model.set({
nonce: e,
type: i.type,
details: i.details
}), n.onNonceReceived(null, n.model.attributes))
})) : void this.onNonceReceived(null, this.model.attributes)
}, i.prototype.writeNonceToDOM = function() {
this.paymentMethodNonceInput.value = this.model.get("nonce")
}, i.prototype.onExternalNonceReceived = function(t) {
this.model.set(t), this.writeNonceToDOM()
}, i.prototype.clearExternalNonce = function() {
this.model.reset()
}, i.prototype.onNonceReceived = function(t) {
var e = this.htmlForm;
return t ? void this.bus.emit(c.events.ERROR, h) : (r.removeEventListener(e, "submit", this.onSubmitHandler), this.writeNonceToDOM(), void(e.submit && ("function" == typeof e.submit || e.submit.call) ? e.submit() : setTimeout(function() {
e.querySelector('[type="submit"]').click()
}, 1)))
}, i.prototype.teardown = function() {
this.destructor.teardown()
}, e.exports = i
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
163: 163,
199: 199,
201: 201,
202: 202,
81: 81,
85: 85,
95: 95
}],
201: [function(t, e, n) {
"use strict";
e.exports = function(t) {
var e, n;
return "object" == typeof t ? t : (e = "payment_method_nonce", "string" == typeof t && (e = t), n = document.createElement("input"), n.name = e, n.type = "hidden", n)
}
}, {}],
202: [function(t, e, n) {
"use strict";
function i() {
this.reset()
}
i.prototype.get = function(t) {
return this.attributes[t]
}, i.prototype.set = function(t) {
this.attributes = t || {}
}, i.prototype.reset = function() {
this.attributes = {}
}, e.exports = i
}, {}],
203: [function(t, e, n) {
"use strict";
e.exports = function(t) {
var e, n, i = t.getElementsByTagName("*"),
o = {};
for (e = 0; e < i.length; e++) n = i[e].getAttribute("data-braintree-name"), o[n] = !0;
if (!o.number) throw new Error('Unable to find an input with data-braintree-name="number" in your form. Please add one.');
if (o.expiration_date) {
if (o.expiration_month || o.expiration_year) throw new Error('You have inputs with data-braintree-name="expiration_date" AND data-braintree-name="expiration_(year|month)". Please use either "expiration_date" or "expiration_year" and "expiration_month".')
} else {
if (!o.expiration_month && !o.expiration_year) throw new Error('Unable to find an input with data-braintree-name="expiration_date" in your form. Please add one.');
if (!o.expiration_month) throw new Error('Unable to find an input with data-braintree-name="expiration_month" in your form. Please add one.');
if (!o.expiration_year) throw new Error('Unable to find an input with data-braintree-name="expiration_year" in your form. Please add one.')
}
}
}, {}],
204: [function(t, e, n) {
"use strict";
var i = t(206),
o = t(208).events,
r = "2.15.5";
e.exports = {
create: function(t) {
return new i(t)
},
events: o,
VERSION: r
}
}, {
206: 206,
208: 208
}],
205: [function(t, e, n) {
"use strict";
var i = t(208);
e.exports = function(t, e) {
return t + "/hosted-fields/" + i.VERSION + "/hosted-fields-frame.html#" + e
}
}, {
208: 208
}],
206: [function(t, e, n) {
"use strict";
function i(t, e) {
var n = document.createElement("div");
return n.style.clear = "both", e = e || document.body, e.appendChild(t), e.appendChild(n), {
parent: e,
children: [t, n]
}
}
function o(t, e) {
return function(n) {
var i = t[n.fieldKey].containerElement,
o = a(i);
n.target = {
fieldKey: n.fieldKey,
container: i
}, o.toggle(h.externalClasses.FOCUSED, n.isFocused).toggle(h.externalClasses.VALID, n.isValid), n.isStrictlyValidating ? o.toggle(h.externalClasses.INVALID, !n.isValid) : o.toggle(h.externalClasses.INVALID, !n.isPotentiallyValid), delete n.fieldKey, delete n.isStrictlyValidating, e && e(n)
}
}
function r(t) {
var e, n, r, p, f, d = this,
m = {},
g = 0;
this.injectedNodes = [], this.destructor = new s, this.bus = new u({
channel: t.channel,
merchantUrl: location.href
}), this.destructor.registerFunctionForTeardown(function() {
d.bus.teardown()
}), this.bus.emit(u.events.ASYNC_DEPENDENCY_INITIALIZING), this.bus.emit(u.events.SEND_ANALYTICS_EVENTS, "hosted-fields.initialized");
for (p in h.whitelistedFields)
if (h.whitelistedFields.hasOwnProperty(p)) {
if (e = t.merchantConfiguration.hostedFields[p], !e) continue;
if (n = document.querySelector(e.selector), !n) {
f = 'Unable to find element with selector "' + e.selector + '" for hostedFields.' + p, this.bus.emit(u.events.ERROR, {
message: f
});
continue
}
if (n.querySelector('iframe[name^="braintree-"]')) {
this.bus.emit(u.events.ERROR, {
message: 'Cannot place two elements in "' + e.selector + '"'
});
continue
}
r = c({
type: p,
name: "braintree-hosted-field-" + p,
style: h.defaultIFrameStyle
}), this.injectedNodes.push(i(r, n)), this.setupLabelFocus(p, n), m[p] = {
frameElement: r,
containerElement: n
}, g++, setTimeout(function(e) {
return function() {
e.src = l(t.gatewayConfiguration.assetsUrl, t.channel)
}
}(r), 0)
}
this.bus.on(y.FRAME_READY, function(t) {
g--, t(0 === g ? !0 : !1)
}), this.bus.on(y.INPUT_EVENT, o(m, t.merchantConfiguration.hostedFields.onFieldEvent)), this.destructor.registerFunctionForTeardown(function() {
var t, e, n;
for (t = 0; t < d.injectedNodes.length; t++) {
for (n = d.injectedNodes[t], e = 0; e < n.children.length; e++) n.parent.removeChild(n.children[e]);
a(n.parent).remove(h.externalClasses.FOCUSED, h.externalClasses.INVALID, h.externalClasses.VALID)
}
})
}
var s = t(85),
a = t(82),
c = t(90),
u = t(163),
l = t(205),
h = t(208),
p = t(162),
f = t(81),
d = t(209),
m = t(207),
y = h.events;
r.prototype.setupLabelFocus = function(t, e) {
function n() {
r.emit(y.TRIGGER_INPUT_FOCUS, t)
}
var i, o, r = this.bus;
if (m() && null != e.id) {
for (i = p(document.querySelectorAll('label[for="' + e.id + '"]')), i = i.concat(d(e, "label")), o = 0; o < i.length; o++) f.addEventListener(i[o], "click", n, !1);
this.destructor.registerFunctionForTeardown(function() {
for (o = 0; o < i.length; o++) f.removeEventListener(i[o], "click", n, !1)
})
}
}, r.prototype.teardown = function(t) {
this.destructor.teardown(t)
}, e.exports = r
}, {
162: 162,
163: 163,
205: 205,
207: 207,
208: 208,
209: 209,
81: 81,
82: 82,
85: 85,
90: 90
}],
207: [function(t, e, n) {
"use strict";
e.exports = function() {
return !/(iPad|iPhone|iPod)/i.test(navigator.userAgent)
}
}, {}],
208: [function(t, e, n) {
"use strict";
var i = "2.15.5";
e.exports = {
VERSION: i,
events: {
FRAME_READY: "hosted-fields:FRAME_READY",
VALIDATE_STRICT: "hosted-fields:VALIDATE_STRICT",
CONFIGURATION: "hosted-fields:CONFIGURATION",
TOKENIZATION_REQUEST: "hosted-fields:TOKENIZATION_REQUEST",
INPUT_EVENT: "hosted-fields:INPUT_EVENT",
TRIGGER_INPUT_FOCUS: "hosted-fields:TRIGGER_INPUT_FOCUS"
},
externalEvents: {
FOCUS: "focus",
BLUR: "blur",
FIELD_STATE_CHANGE: "fieldStateChange"
},
defaultMaxLengths: {
number: 19,
postalCode: 8,
expirationDate: 7,
expirationMonth: 2,
expirationYear: 4,
cvv: 3
},
externalClasses: {
FOCUSED: "braintree-hosted-fields-focused",
INVALID: "braintree-hosted-fields-invalid",
VALID: "braintree-hosted-fields-valid"
},
defaultIFrameStyle: {
border: "none",
width: "100%",
height: "100%",
"float": "left"
},
whitelistedStyles: ["-moz-osx-font-smoothing", "-moz-transition", "-webkit-font-smoothing", "-webkit-transition", "color", "font", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric", "font-weight", "line-height", "opacity", "outline", "text-shadow", "transition"],
whitelistedFields: {
number: {
name: "credit-card-number",
label: "Credit Card Number"
},
cvv: {
name: "cvv",
label: "CVV"
},
expirationDate: {
name: "expiration",
label: "Expiration Date"
},
expirationMonth: {
name: "expiration-month",
label: "Expiration Month"
},
expirationYear: {
name: "expiration-year",
label: "Expiration Year"
},
postalCode: {
name: "postal-code",
label: "Postal Code"
}
}
}
}, {}],
209: [function(t, e, n) {
"use strict";
function i(t, e) {
for (var n = t.parentNode, i = []; null != n;) null != n.tagName && n.tagName.toLowerCase() === e && i.push(n), n = n.parentNode;
return i
}
e.exports = i
}, {}],
210: [function(t, e, n) {
"use strict";
e.exports = t(212)
}, {
212: 212
}],
211: [function(t, e, n) {
(function(n) {
"use strict";
function i(t, e, i) {
e = e || {}, this._clientToken = t, this._clientOptions = e, this._clientToken.correlationId = v.generateUid(), this.destructor = new a, this.channel = i, this.bus = new c({
merchantUrl: n.location.href,
channel: this.channel
}), this.container = o.normalizeElement(e.container || document.body), this.paymentMethodNonceInputField = e.paymentMethodNonceInputField, this.insertFrameFunction = e.insertFrame, this.onSuccess = e.onSuccess, this.onCancelled = e.onCancelled, this.loggedInView = null, this.loggedOutView = null, this.appView = null, this.merchantPageView = null, this.paymentMethodNonceInputFieldView = null, this.overlayView = null, this.bridgeIframeView = null, this.headless = e.headless, this.isDropin = e.isDropin, _(this, ["initAuthFlow", "closeAuthFlow"])
}
var o = t(81),
r = t(95),
s = t(151),
a = t(85),
c = t(163),
u = t(214),
l = t(216),
h = t(217),
p = t(220),
f = t(218),
d = t(221),
m = t(215),
y = t(231),
g = t(223),
v = t(233),
_ = t(96);
i.prototype.initialize = function() {
var t = r(this._handleClickLogin, this);
this._createViews(), this.bus.on(g.events.GET_CLIENT_TOKEN, r(this._handleGetClientToken, this)), this.bus.on(g.events.GET_CLIENT_OPTIONS, r(this._handleGetClientOptions, this)), this.bus.on(c.events.PAYMENT_METHOD_CANCELLED, r(this._handlePaymentMethodCancelled, this)), this.isDropin || this.bus.on(c.events.PAYMENT_METHOD_GENERATED, r(this._handlePaymentMethodGenerated, this)), o.addEventListener(document.body, "click", t), this.destructor.registerFunctionForTeardown(function() {
o.removeEventListener(document.body, "click", t)
})
}, i.prototype._createViews = function() {
var t, e = [],
n = this;
y.isBridgeIframeRequired() && (this.bridgeIframeView = new m({
container: this.container,
paypalAssetsUrl: this._clientToken.paypal.assetsUrl,
channel: this.channel
}), e.push(this.bridgeIframeView)), this.appView = new u({
insertFrameFunction: this.insertFrameFunction,
paypalAssetsUrl: this._clientToken.paypal.assetsUrl,
isHermes: v.isHermesConfiguration(this._clientToken, this._clientOptions),
isDropin: this.isDropin,
channel: this.channel
}), e.push(this.appView), this.isDropin || (this.merchantPageView = new f({
channel: this.channel
}), e.push(this.merchantPageView), y.isPopupSupported() && y.isOverlaySupported() && (this.overlayView = new p({
paypalAssetsUrl: this._clientToken.paypal.assetsUrl,
onFocus: function() {
n.bus.emit(g.events.FOCUS_APP)
},
onClose: function() {
n.bus.emit(g.events.CLOSE_APP)
},
locale: this._clientOptions.locale,
channel: this.channel
}), e.push(this.overlayView))), this.isDropin || this.headless || (this.paymentMethodNonceInputFieldView = new d({
container: this.container,
el: this.paymentMethodNonceInputField,
channel: this.channel
}), e.push(this.paymentMethodNonceInputFieldView), this.loggedInView = new l({
paypalAssetsUrl: this._clientToken.paypal.assetsUrl,
container: this.container,
locale: this._clientOptions.locale,
channel: this.channel
}), e.push(this.loggedInView), this.loggedOutView = new h({
paypalAssetsUrl: this._clientToken.paypal.assetsUrl,
container: this.container,
enablePayPalButton: v.isOnetimeHermesConfiguration(this._clientToken, this._clientOptions),
locale: this._clientOptions.locale,
channel: this.channel
}), e.push(this.loggedOutView)), this.destructor.registerFunctionForTeardown(function() {
for (t = 0; t < e.length; t++) e[t].teardown()
})
}, i.prototype._handleClickLogin = function(t) {
for (var e = t.target || t.srcElement;;) {
if (null == e) return;
if (e === t.currentTarget) return;
if (this._isButton(e)) break;
e = e.parentNode
}
v.preventDefault(t), this.initAuthFlow()
}, i.prototype.initAuthFlow = function() {
this.appView.open()
}, i.prototype.closeAuthFlow = function() {
this.appView.close()
}, i.prototype._isButton = function(t) {
var e = "braintree-paypal-button" === t.id,
n = v.isOnetimeHermesConfiguration(this._clientToken, this._clientOptions) && t.className.match(/paypal-button(?!-widget)/);
return e || n
}, i.prototype._handlePaymentMethodGenerated = function(t) {
t.type === g.NONCE_TYPE && s(this.onSuccess) && this.onSuccess(t)
}, i.prototype._handlePaymentMethodCancelled = function(t) {
t.source === g.PAYPAL_INTEGRATION_NAME && s(this.onCancelled) && this.onCancelled()
}, i.prototype._clientTokenData = function() {
return {
analyticsUrl: this._clientToken.analytics ? this._clientToken.analytics.url : null,
authorizationFingerprint: this._clientToken.authorizationFingerprint,
clientApiUrl: this._clientToken.clientApiUrl,
displayName: this._clientOptions.displayName || this._clientToken.paypal.displayName,
paypalAssetsUrl: this._clientToken.paypal.assetsUrl,
paypalClientId: this._clientToken.paypal.clientId,
paypalPrivacyUrl: this._clientToken.paypal.privacyUrl,
paypalUserAgreementUrl: this._clientToken.paypal.userAgreementUrl,
billingAgreementsEnabled: this._clientToken.paypal.billingAgreementsEnabled,
unvettedMerchant: this._clientToken.paypal.unvettedMerchant,
payeeEmail: this._clientToken.paypal.payeeEmail,
correlationId: this._clientToken.correlationId,
offline: this._clientOptions.offline || this._clientToken.paypal.environmentNoNetwork,
sdkVersion: this._clientToken.sdkVersion,
merchantAppId: this._clientToken.merchantAppId
}
}, i.prototype._handleGetClientToken = function(t) {
t(this._clientTokenData())
}, i.prototype._clientOptionsData = function() {
return {
locale: this._clientOptions.locale || "en_us",
onetime: this._clientOptions.singleUse || !1,
integration: this._clientOptions.integration || "paypal",
enableShippingAddress: this._clientOptions.enableShippingAddress || !1,
enableBillingAddress: this._clientOptions.enableBillingAddress || !1,
enableHermes: v.isHermesConfiguration(this._clientToken, this._clientOptions),
amount: this._clientOptions.amount || null,
currency: this._clientOptions.currency || null,
shippingAddressOverride: this._clientOptions.shippingAddressOverride || null,
enableCORS: this._clientOptions.enableCORS
}
}, i.prototype._handleGetClientOptions = function(t) {
t(this._clientOptionsData())
}, i.prototype.teardown = function() {
var t = this;
this.destructor.teardown(function() {
t.bus.teardown()
})
}, e.exports = i
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
151: 151,
163: 163,
214: 214,
215: 215,
216: 216,
217: 217,
218: 218,
220: 220,
221: 221,
223: 223,
231: 231,
233: 233,
81: 81,
85: 85,
95: 95,
96: 96
}],
212: [function(t, e, n) {
"use strict";
function i(t, e, n) {
var i, o;
if (e = e || {}, o = e.onUnsupported, "function" != typeof o && (o = function(t) {
try {
console.log(t)
} catch (e) {}
}), !t) return o(new Error('Parameter "clientToken" cannot be null')), null;
if (t = v.parseClientToken(t), !t.paypalEnabled) return o(new Error("PayPal is not enabled")), null;
if (!h.detectedPostMessage()) return o(new Error("unsupported browser detected")), null;
if (!e.container && !e.headless) return o(new Error("Please supply a container for the PayPal button to be appended to")), null;
if (!u(t, e)) return o(new Error("unsupported protocol detected")), null;
if (c(t, e)) return o(new Error("Unvetted merchant client token does not include a payee email")), null;
if (d(t, e) && !s(e.locale)) return o(new Error("This PayPal integration does not support this country")), null;
if (m(t, e)) {
if (!r(e.currency)) return o(new Error("This PayPal integration does not support this currency")), null;
if (!a(e.amount)) return o(new Error("Amount must be a number")), null
}
return i = new l(t, e, n), i.initialize(), i
}
function o(t, e) {
var n, i = e.length,
o = !1;
for (n = 0; i > n; n++) t.toLowerCase() === e[n].toLowerCase() && (o = !0);
return o
}
function r(t) {
return o(t, p.HERMES_SUPPORTED_CURRENCIES)
}
function s(t) {
return o(f(t).split("_")[1], p.HERMES_SUPPORTED_COUNTRIES)
}
function a(t) {
return t = parseFloat(t), "number" == typeof t && !isNaN(t) && t >= 0
}
function c(t, e) {
return t.paypal.unvettedMerchant && (!d(t, e) || !t.paypal.payeeEmail)
}
function u(t, e) {
return t.paypal.allowHttp ? !0 : h.isPopupSupported() ? !0 : "merchantHttps" in e ? e.merchantHttps : g.isBrowserHttps()
}
var l = t(211),
h = t(231),
p = t(223),
f = t(225),
d = t(233).isHermesConfiguration,
m = t(233).isOnetimeHermesConfiguration,
y = "2.15.5",
g = t(81),
v = t(14);
e.exports = {
create: i,
VERSION: y
}
}, {
14: 14,
211: 211,
223: 223,
225: 225,
231: 231,
233: 233,
81: 81
}],
213: [function(t, e, n) {
e.exports = {
en_us: {
cancel: "Cancel",
overlay_text: "Don't see the secure PayPal browser? We'll help you re-launch the window to complete your purchase.",
continue_link: "Continue"
},
en_uk: {
cancel: "Cancel",
overlay_text: "Don't see the secure PayPal browser? We'll help you re-launch the window to complete your purchase.",
continue_link: "Continue"
},
en_au: {
cancel: "Cancel",
overlay_text: "Don't see the secure PayPal browser? We'll help you re-launch the window to complete your purchase.",
continue_link: "Continue"
},
sv_se: {
cancel: "Avbryt",
overlay_text: "Ser du inte den säkra PayPal-webbl&auml;saren? Vi hj&auml;lper dig att starta om f&ouml;nstret f&ouml;r att slutf&ouml;ra k&ouml;pet.",
continue_link: "Forts&auml;tt"
},
de_de: {
cancel: "Abbrechen",
overlay_text: "Sie sehen das sichere Browserfenster von PayPal nicht? Das Fenster wird neu ge&ouml;ffnet, damit Sie Ihren Einkauf abschlie&szlig;en k&ouml;nnen.",
continue_link: "Weiter"
},
fr_fr: {
cancel: "Annuler",
overlay_text: "Vous ne voyez pas le navigateur s&eacute;curis&eacute; PayPal ? Nous allons vous aider &agrave; relancer la fen&ecirc;tre pour effectuer votre achat.",
continue_link: "Continuer"
},
en_ca: {
cancel: "Cancel",
overlay_text: "Don't see the secure PayPal browser? We'll help you re-launch the window to complete your purchase.",
continue_link: "Continue"
},
fr_ca: {
cancel: "Annuler",
overlay_text: "Vous ne voyez pas le navigateur s&eacute;curis&eacute; de PayPal ? Nous vous aiderons &agrave; relancer la fen&ecirc;tre afin d'effectuer votre achat.",
continue_link: "Continuer"
},
es_es: {
cancel: "Cancelar",
overlay_text: "&iquest;No ves el s&iacute;mbolo de navegaci&oacute;n segura de PayPal? Te ayudaremos a abrir de nuevo la ventana para completar la compra.",
continue_link: "Continuar"
},
es_xc: {
cancel: "Cancelar",
overlay_text: "&iquest;No ve el s&iacute;mbolo de navegaci&oacute;n segura de PayPal? Abriremos la ventana nuevamente para que pueda completar su compra.",
continue_link: "Continuar"
},
fr_xc: {
cancel: "Annuler",
overlay_text: "Le navigateur s&eacute;curis&eacute; de PayPal n'appara&icirc;t pas ? Nous allons vous aider &agrave; rouvrir la fen&ecirc;tre pour finaliser votre achat.",
continue_link: "Continuer"
},
nl_nl: {
cancel: "Annuleren",
overlay_text: "Ziet u de beveiligde PayPal-browser niet? We helpen u het venster opnieuw te openen zodat u uw aankoop kunt voltooien.",
continue_link: "Doorgaan"
},
pt_pt: {
cancel: "Cancelar",
overlay_text: "N&atilde;o est&aacute; a ver a indica&ccedil;&atilde;o de liga&ccedil;&atilde;o segura PayPal no browser? Vamos ent&atilde;o voltar a abrir a janela para concluir a sua compra.",
continue_link: "Continuar"
},
ru_ru: {
cancel: "Отмена",
overlay_text: "Не отображается безопасная страница PayPal в браузере? Мы поможем вам повторно загрузить окно, чтобы завершить покупку.",
continue_link: "Продолжить"
},
da_dk: {
cancel: "Annuller",
overlay_text: "Kan du ikke se PayPals sikre browser? Vi hj&aelig;lper dig med at &aring;bne vinduet igen, s&aring; du kan betale.",
continue_link: "Forts&aelig;t"
},
it_it: {
cancel: "Annulla",
overlay_text: "Non vedi il browser sicuro di PayPal? Ti aiuteremo a riavviare la pagina per completare l'acquisto.",
continue_link: "Continua"
},
no_no: {
cancel: "Avbryt",
overlay_text: "Ser du ikke den sikre PayPal-nettleseren? Vi hjelper deg med &aring; &aring;pne vinduet p&aring; nytt s&aring; du kan fullf&oslash;re kj&oslash;pet.",
continue_link: "Fortsett"
},
pl_pl: {
cancel: "Anuluj",
overlay_text: "Nie widzisz bezpiecznej przeglądarki PayPal? Pomożemy Ci ponownie uruchomić to okno w celu dokonania zakupu.",
continue_link: "Kontynuuj"
},
tr_tr: {
cancel: "İptal",
overlay_text: "G&uuml;venli PayPal tarayıcısını g&ouml;rm&uuml;yor musunuz? Alışverişinizi tamamlamak i&ccedil;in pencereyi yeniden başlatmanıza yardımcı olacağız.",
continue_link: "Devam"
},
zh_xc: {
cancel: "取消",
overlay_text: "没有看到安全的PayPal浏览器?我们将帮助您重启窗口以完成购物。",
continue_link: "继续"
},
en_hk: {
cancel: "Cancel",
overlay_text: "Don't see the secure PayPal browser? We'll help you re-launch the window to complete your purchase.",
continue_link: "Continue"
},
zh_hk: {
cancel: "取消",
overlay_text: "看不到安全的 PayPal 瀏覽器視窗?我們會助你重新啟動視窗,以完成購物。",
continue_link: "繼續"
},
en_my: {
cancel: "Cancel",
overlay_text: "Don't see the secure PayPal browser? We'll help you re-launch the window to complete your purchase.",
continue_link: "Continue"
},
en_nz: {
cancel: "Cancel",
overlay_text: "Don't see the secure PayPal browser? We'll help you re-launch the window to complete your purchase.",
continue_link: "Continue"
},
en_sg: {
cancel: "Cancel",
overlay_text: "Don't see the secure PayPal browser? We'll help you re-launch the window to complete your purchase.",
continue_link: "Continue"
}
}
}, {}],
214: [function(t, e, n) {
(function(n) {
"use strict";
function i(t) {
var e = this;
this.options = t || {}, this.destructor = new a, this.bus = new c({
merchantUrl: n.location.href,
channel: this.options.channel
}), this.destructor.registerFunctionForTeardown(function() {
e.bus.teardown()
}), this._initialize()
}
var o = t(95),
r = t(151),
s = t(231),
a = t(85),
c = t(163),
u = t(223),
l = t(222),
h = t(219);
i.prototype._initialize = function() {
var t = this;
this.app = s.isPopupSupported() ? new l({
src: this._buildUrl(),
isHermes: this.options.isHermes,
channel: this.options.channel
}) : new h({
src: this._buildUrl(),
isDropin: this.options.isDropin,
isHermes: this.options.isHermes,
insertFrameFunction: this.options.insertFrameFunction,
channel: this.options.channel
}), this.destructor.registerFunctionForTeardown(function() {
t.app.teardown()
}), this.bus.on(u.events.CLOSE_APP, o(this.close, this)), this.bus.on(u.events.FOCUS_APP, o(this.focus, this)), this.bus.on(c.events.PAYMENT_METHOD_GENERATED, o(this._handlePaymentMethodGenerated, this)), this.bus.on(c.events.UI_POPUP_FORCE_CLOSE, o(this._handleForceClose, this))
}, i.prototype._buildUrl = function() {
var t = this.options.paypalAssetsUrl;
return t += "/pwpp/", t += u.VERSION, t += "/html/braintree-frame.html", t += "#" + this.options.channel
}, i.prototype.open = function() {
this.focus(), this.app.open(), this.poll()
}, i.prototype._handleForceClose = function(t) {
t.target === u.PAYPAL_INTEGRATION_NAME && this.close()
}, i.prototype.close = function() {
this.app.close()
}, i.prototype.focus = function() {
r(this.app.focus) && this.app.focus()
}, i.prototype.isClosed = function() {
return this.app.isClosed()
}, i.prototype.stopPolling = function() {
clearInterval(this.pollId)
}, i.prototype.poll = function() {
var t = this;
this.pollId = setInterval(function() {
t.isClosed() && t._handleClosed()
}, 100)
}, i.prototype._handlePaymentMethodGenerated = function(t) {
t.type === u.NONCE_TYPE && this.close()
}, i.prototype._handleClosed = function() {
this.stopPolling(), this.close(), s.isPopupSupported() && (this.app.el = null)
}, i.prototype.teardown = function() {
this.destructor.teardown()
}, e.exports = i
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
151: 151,
163: 163,
219: 219,
222: 222,
223: 223,
231: 231,
85: 85,
95: 95
}],
215: [function(t, e, n) {
"use strict";
function i(t) {
this.options = t || {}, this.el = r({
src: this._buildUrl(),
name: o.BRIDGE_FRAME_NAME,
height: 1,
width: 1,
style: {
position: "static",
top: 0,
left: 0,
bottom: 0,
padding: 0,
margin: 0,
border: 0,
outline: "none",
background: "transparent"
}
}), this.options.container.appendChild(this.el)
}
var o = t(223),
r = t(90);
i.prototype._buildUrl = function() {
var t = this.options.paypalAssetsUrl;
return t += "/pwpp/", t += o.VERSION, t += "/html/bridge-frame.html", t += "#" + this.options.channel
}, i.prototype.teardown = function() {
this.options.container.removeChild(this.el)
}, e.exports = i
}, {
223: 223,
90: 90
}],
216: [function(t, e, n) {
(function(n) {
"use strict";
function i(t) {
var e;
this.options = t || {}, this.wrapper = this.options.container || document.body, this.destructor = new s, this.bus = new a({
merchantUrl: n.location.href,
channel: t.channel
}), e = h(this.options.locale, p), this.translation = e.translation, this._initialize()
}
var o = t(81),
r = t(95),
s = t(85),
a = t(163),
c = t(233),
u = t(232),
l = t(223),
h = t(226),
p = t(213);
i.prototype._initialize = function() {
var t = this,
e = r(this._handleClickLogout, this);
this._createViewContainer(), this._createPayPalName(), this._createEmailNode(), this._createLogoutNode(), o.addEventListener(this.logoutNode, "click", e), this.destructor.registerFunctionForTeardown(function() {
o.removeEventListener(t.logoutNode, "click", e)
}), this.bus.on(a.events.PAYMENT_METHOD_GENERATED, r(this._handlePaymentMethodGenerated, this)), this.bus.on(a.events.PAYMENT_METHOD_CANCELLED, r(this._handlePaymentMethodCancelled, this))
}, i.prototype._createViewContainer = function() {
var t = ["display: none", "max-width: 500px", "overflow: hidden", "padding: 16px", "background-image: url(" + this.options.paypalAssetsUrl + "/pwpp/" + l.VERSION + "/images/paypal-small.png)", "background-image: url(" + this.options.paypalAssetsUrl + "/pwpp/" + l.VERSION + "/images/paypal-small.svg), none", "background-position: 20px 50%", "background-repeat: no-repeat", "background-size: 13px 15px", "border-top: 1px solid #d1d4d6", "border-bottom: 1px solid #d1d4d6"].join(";");
this.container = document.createElement("div"), this.container.id = "braintree-paypal-loggedin", this.container.style.cssText = t, this.wrapper.appendChild(this.container)
}, i.prototype._createPayPalName = function() {
var t = ["color: #283036", "font-size: 13px", "font-weight: 800", 'font-family: "Helvetica Neue", Helvetica, Arial, sans-serif', "margin-left: 36px", "-webkit-font-smoothing: antialiased", "-moz-font-smoothing: antialiased", "-ms-font-smoothing: antialiased", "font-smoothing: antialiased"].join(";");
return this.payPalName = document.createElement("span"), this.payPalName.id = "bt-pp-name", this.payPalName.innerHTML = "PayPal", this.payPalName.style.cssText = t, this.container.appendChild(this.payPalName)
}, i.prototype._createEmailNode = function() {
var t = ["color: #6e787f", "font-size: 13px", 'font-family: "Helvetica Neue", Helvetica, Arial, sans-serif', "margin-left: 5px", "-webkit-font-smoothing: antialiased", "-moz-font-smoothing: antialiased", "-ms-font-smoothing: antialiased", "font-smoothing: antialiased"].join(";");
this.emailNode = document.createElement("span"), this.emailNode.id = "bt-pp-email", this.emailNode.style.cssText = t, this.container.appendChild(this.emailNode)
}, i.prototype._createLogoutNode = function() {
var t = ["color: #3d95ce", "font-size: 11px", 'font-family: "Helvetica Neue", Helvetica, Arial, sans-serif', "line-height: 20px", "margin: 0 0 0 25px", "padding: 0", "background-color: transparent", "border: 0", "cursor: pointer", "text-decoration: underline", "float: right", "-webkit-font-smoothing: antialiased", "-moz-font-smoothing: antialiased", "-ms-font-smoothing: antialiased", "font-smoothing: antialiased"].join(";");
this.logoutNode = document.createElement("button"), this.logoutNode.id = "bt-pp-cancel", this.logoutNode.innerHTML = this.translation.cancel, this.logoutNode.style.cssText = t, this.container.appendChild(this.logoutNode)
}, i.prototype.show = function(t) {
this.container.style.display = "block", u.setTextContent(this.emailNode, t)
}, i.prototype.hide = function() {
this.container.style.display = "none"
}, i.prototype._handleClickLogout = function(t) {
c.preventDefault(t), this.bus.emit(a.events.PAYMENT_METHOD_CANCELLED, {
source: l.PAYPAL_INTEGRATION_NAME
})
}, i.prototype._handlePaymentMethodGenerated = function(t) {
var e;
t.type === l.NONCE_TYPE && (e = t && t.details && t.details.email ? t.details.email : "", this.show(e))
}, i.prototype._handlePaymentMethodCancelled = function(t) {
t.source === l.PAYPAL_INTEGRATION_NAME && this.hide()
}, i.prototype.teardown = function() {
this.wrapper.removeChild(this.container), this.destructor.teardown(), this.bus.teardown()
}, e.exports = i
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
163: 163,
213: 213,
223: 223,
226: 226,
232: 232,
233: 233,
81: 81,
85: 85,
95: 95
}],
217: [function(t, e, n) {
(function(n) {
"use strict";
function i(t) {
this.options = t, this.wrapper = this.options.container || document.body, this.bus = new r({
merchantUrl: n.location.href,
channel: t.channel
}), this._initialize()
}
var o = t(95),
r = t(163),
s = t(223),
a = t(225);
i.prototype._initialize = function() {
this.createViewContainer(), this.options.enablePayPalButton ? this.createCheckoutWithPayPalButton() : this.createPayWithPayPalButton(), this.bus.on(r.events.PAYMENT_METHOD_GENERATED, o(this._handlePaymentMethodGenerated, this)), this.bus.on(r.events.PAYMENT_METHOD_CANCELLED, o(this._handlePaymentMethodCancelled, this))
}, i.prototype.createViewContainer = function() {
this.container = document.createElement("div"), this.container.id = "braintree-paypal-loggedout", this.wrapper.appendChild(this.container), this.loginNode = this.container
}, i.prototype.createPayWithPayPalButton = function() {
var t = document.createElement("a"),
e = new Image,
n = ["max-width: 100%", "display: block", "width: 100%", "height: 100%", "outline: none", "border: 0"].join(";"),
i = ["display: block", "width: 115px", "height: 44px", "overflow: hidden"].join(";");
t.id = "braintree-paypal-button", t.href = "#", t.style.cssText = i, e.src = this.options.paypalAssetsUrl + "/pwpp/" + s.VERSION + "/images/pay-with-paypal.png", e.setAttribute("alt", "Pay with PayPal"), e.style.cssText = n, t.appendChild(e), this.container.appendChild(t)
}, i.prototype.createCheckoutWithPayPalButton = function() {
var t, e = document.createElement("script"),
n = {
"data-merchant": "merchant-id",
"data-button": "checkout",
"data-type": "button",
"data-color": "blue",
"data-lc": a(this.options.locale)
};
e.src = "//www.paypalobjects.com/api/button.js", e.async = !0;
for (t in n) n.hasOwnProperty(t) && e.setAttribute(t, n[t]);
this.container.appendChild(e)
}, i.prototype.show = function() {
this.container.style.display = "block"
}, i.prototype.hide = function() {
this.container.style.display = "none"
}, i.prototype._handlePaymentMethodGenerated = function(t) {
t.type === s.NONCE_TYPE && this.hide()
}, i.prototype._handlePaymentMethodCancelled = function(t) {
t.source === s.PAYPAL_INTEGRATION_NAME && this.show()
}, i.prototype.teardown = function() {
this.wrapper.removeChild(this.container), this.bus.teardown()
}, e.exports = i
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
163: 163,
223: 223,
225: 225,
95: 95
}],
218: [function(t, e, n) {
(function(n) {
"use strict";
function i(t) {
this.options = t, this.bus = new s({
merchantUrl: n.location.href,
channel: t.channel
}), this.bus.on(c.events.UI_MODAL_DID_OPEN, a(this.lockWindowSize, this)), this.bus.on(c.events.UI_MODAL_DID_CLOSE, a(this.unlockWindowSize, this))
}
function o(t) {
var e = window.getComputedStyle ? getComputedStyle(t) : t.currentStyle;
return {
overflow: e.overflow || "",
height: t.style.height || ""
}
}
function r() {
return {
html: {
node: document.documentElement,
styles: o(document.documentElement)
},
body: {
node: document.body,
styles: o(document.body)
}
}
}
var s = t(163),
a = t(95),
c = t(223);
i.prototype.lockWindowSize = function() {
this.defaultStyles = r(), document.documentElement.style.height = "100%", document.documentElement.style.overflow = "hidden", document.body.style.height = "100%", document.body.style.overflow = "hidden"
}, i.prototype.unlockWindowSize = function() {
this.defaultStyles && (document.documentElement.style.height = this.defaultStyles.html.styles.height, document.documentElement.style.overflow = this.defaultStyles.html.styles.overflow, document.body.style.height = this.defaultStyles.body.styles.height, document.body.style.overflow = this.defaultStyles.body.styles.overflow, delete this.defaultStyles)
}, i.prototype._handleUIModalDidOpen = function(t) {
t.source === c.PAYPAL_INTEGRATION_NAME && this.lockWindowSize()
}, i.prototype._handleUIModalDidClose = function(t) {
t.source === c.PAYPAL_INTEGRATION_NAME && this.unlockWindowSize()
}, i.prototype.teardown = function() {
this.unlockWindowSize(), this.bus.teardown()
}, e.exports = i
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
163: 163,
223: 223,
95: 95
}],
219: [function(t, e, n) {
(function(n) {
"use strict";
function i(t) {
this.options = t || {}, this.container = document.body, this.bus = new c({
merchantUrl: n.location.href,
channel: t.channel
}), this.options.isDropin ? this._open = this._openHeadless : this._attachBusEvents(), this._initialize()
}
var o = t(95),
r = t(151),
s = t(231),
a = t(223),
c = t(163),
u = t(90);
i.prototype._attachBusEvents = function() {
this.bus.on(a.events.OPEN_MODAL, o(this.open, this))
}, i.prototype._initialize = function() {
var t = this.options.isHermes ? a.HERMES_FRAME_NAME : a.FRAME_NAME;
this.el = u({
src: this.options.src,
name: t,
height: this.options.height || "100%",
width: this.options.width || "100%",
style: {
position: s.isMobile() ? "absolute" : "fixed",
top: 0,
left: 0,
bottom: 0,
padding: 0,
margin: 0,
border: 0,
outline: "none",
zIndex: 20001,
background: "#FFFFFF"
}
})
}, i.prototype.isClosed = function() {
return !this.container.contains(this.el)
}, i.prototype._openHeadless = function() {
this.bus.emit(a.events.OPEN_MODAL)
}, i.prototype._open = function() {
r(this.options.insertFrameFunction) ? this.options.insertFrameFunction(this.el.src) : this.container.appendChild(this.el), this.bus.emit(a.events.UI_MODAL_DID_OPEN, {
source: a.PAYPAL_INTEGRATION_NAME
})
}, i.prototype.open = function() {
this.isClosed() && this._open()
}, i.prototype.close = function() {
this.isClosed() || (this.container.removeChild(this.el), this.bus.emit(a.events.UI_MODAL_DID_CLOSE, {
source: a.PAYPAL_INTEGRATION_NAME
}))
}, i.prototype.teardown = function() {
this.close(), this.bus.teardown()
}, e.exports = i
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
151: 151,
163: 163,
223: 223,
231: 231,
90: 90,
95: 95
}],
220: [function(t, e, n) {
(function(n) {
"use strict";
function i(t) {
var e;
this.options = t, this.spriteSrc = this.options.paypalAssetsUrl + "/pwpp/" + u.VERSION + "/images/pp_overlay_sprite.png", this.bus = new c({
merchantUrl: n.location.href,
channel: t.channel
}), this.destructor = new a, e = l(this.options.locale, h), this.translation = e.translation, this._create(), this._setupEvents(), this.bus.on(c.events.UI_POPUP_DID_OPEN, r(this._handleUIPopupDidOpen, this)), this.bus.on(c.events.UI_POPUP_DID_CLOSE, r(this._handleUIPopupDidClose, this))
}
var o = t(81),
r = t(95),
s = t(151),
a = t(85),
c = t(163),
u = t(223),
l = t(226),
h = t(213);
i.prototype.open = function() {
document.body.contains(this.el) || document.body.appendChild(this.el)
}, i.prototype.close = function() {
document.body.contains(this.el) && document.body.removeChild(this.el)
}, i.prototype._handleUIPopupDidClose = function(t) {
t.source === u.PAYPAL_INTEGRATION_NAME && this.close()
}, i.prototype._handleUIPopupDidOpen = function(t) {
t.source === u.PAYPAL_INTEGRATION_NAME && this.open()
}, i.prototype._create = function() {
this.el = document.createElement("div"), this.el.className = "bt-overlay", this._setStyles(this.el, ["z-index: 20001", "position: fixed", "top: 0", "left: 0", "height: 100%", "width: 100%", "text-align: center", "background: #000", "background: rgba(0,0,0,0.7)", '-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=52)"']), this.el.appendChild(this._createCloseIcon()), this.el.appendChild(this._createMessage())
}, i.prototype._createCloseIcon = function() {
return this.closeIcon = document.createElement("div"), this.closeIcon.className = "bt-close-overlay", this._setStyles(this.closeIcon, ["position: absolute", "top: 10px", "right: 10px", "cursor: pointer", "background: url(" + this.spriteSrc + ") no-repeat 0 -67px", "height: 14px", "width: 14px"]), this.closeIcon
}, i.prototype._createMessage = function() {
var t = document.createElement("div");
return this._setStyles(t, ["position: relative", "top: 50%", "max-width: 350px", 'font-family: "HelveticaNeue", "HelveticaNeue-Light", "Helvetica Neue Light", helvetica, arial, sans-serif', "font-size: 14px", "line-height: 20px", "margin: -70px auto 0"]), t.appendChild(this._createLogo()), t.appendChild(this._createExplanation()), t.appendChild(this._createFocusLink()), t
}, i.prototype._createExplanation = function() {
return this.explanation = document.createElement("div"), this._setStyles(this.explanation, ["color: #FFF", "margin-bottom: 20px"]), this.explanation.innerHTML = this.translation.overlay_text, this.explanation
}, i.prototype._createLogo = function() {
var t = document.createElement("div");
return this._setStyles(t, ["background: url(" + this.spriteSrc + ") no-repeat 0 0", "width: 94px", "height: 25px", "margin: 0 auto 26px auto"]), t
}, i.prototype._createFocusLink = function() {
return this.focusLink = document.createElement("a"), this._setStyles(this.focusLink, ["color: #009be1", "cursor: pointer"]), this.focusLink.innerHTML = this.translation.continue_link, this.focusLink
}, i.prototype._setStyles = function(t, e) {
var n = e.join(";");
t.style.cssText = n
}, i.prototype._setupEvents = function() {
var t = this,
e = r(this._handleClose, this),
n = r(this._handleFocus, this);
o.addEventListener(this.closeIcon, "click", e), o.addEventListener(this.focusLink, "click", n), this.destructor.registerFunctionForTeardown(function() {
o.removeEventListener(t.closeIcon, "click", e), o.removeEventListener(t.focusLink, "click", n)
})
}, i.prototype._handleClose = function(t) {
t.preventDefault(), this.close(), s(this.options.onClose) && this.options.onClose()
}, i.prototype._handleFocus = function(t) {
t.preventDefault(), s(this.options.onFocus) && this.options.onFocus()
}, i.prototype.teardown = function() {
this.bus.teardown(), this.destructor.teardown(), this.close()
}, e.exports = i
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
151: 151,
163: 163,
213: 213,
223: 223,
226: 226,
81: 81,
85: 85,
95: 95
}],
221: [function(t, e, n) {
(function(n) {
"use strict";
function i(t) {
this.options = t || {}, this.container = this.options.container || document.body, this.el = this.options.el, this.destructor = new a, this.bus = new c({
merchantUrl: n.location.href,
channel: t.channel
}), this._initialize()
}
var o = t(81),
r = t(95),
s = t(151),
a = t(85),
c = t(163),
u = t(223);
i.prototype._initialize = function() {
var t = this;
s(this.el) || (null != this.el ? (this.el = o.normalizeElement(this.el), this.destructor.registerFunctionForTeardown(function() {
t.clear()
})) : this.el = this.create()), this.bus.on(c.events.PAYMENT_METHOD_GENERATED, r(this._handlePaymentMethodGenerated, this)), this.bus.on(c.events.PAYMENT_METHOD_CANCELLED, r(this._handlePaymentMethodCancelled, this))
}, i.prototype.create = function() {
var t = this,
e = document.createElement("input");
return e.name = "payment_method_nonce", e.type = "hidden", this.container.appendChild(e), this.destructor.registerFunctionForTeardown(function() {
t.container.removeChild(e)
}), e
}, i.prototype.value = function(t) {
s(this.el) ? this.el(t) : this.el.value = t
}, i.prototype.clear = function() {
this.value("")
}, i.prototype._handlePaymentMethodCancelled = function(t) {
t.source === u.PAYPAL_INTEGRATION_NAME && this.clear()
}, i.prototype._handlePaymentMethodGenerated = function(t) {
t.type === u.NONCE_TYPE && this.value(t.nonce)
}, i.prototype.teardown = function() {
this.destructor.teardown(), this.bus.teardown()
}, e.exports = i
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
151: 151,
163: 163,
223: 223,
81: 81,
85: 85,
95: 95
}],
222: [function(t, e, n) {
(function(n) {
"use strict";
function i(t) {
this.options = t, this.bus = new r({
merchantUrl: n.location.href,
channel: this.options.channel
}), t.isHermes ? (this.name = o.HERMES_POPUP_NAME, this.popupHeight = o.HERMES_POPUP_HEIGHT, this.popupWidth = o.HERMES_POPUP_WIDTH) : (this.name = o.POPUP_NAME, this.popupHeight = o.POPUP_HEIGHT, this.popupWidth = o.POPUP_WIDTH)
}
var o = t(223),
r = t(163),
s = t(227);
i.prototype._getPopupOptions = function() {
return ["height=" + this.popupHeight, "width=" + this.popupWidth, "top=" + this._getTopPosition(), "left=" + this._getLeftPosition(), o.POPUP_OPTIONS].join(",")
}, i.prototype._centerPosition = function(t, e, n) {
return (t - e) / 2 + n
}, i.prototype._getTopPosition = function() {
var t = window.outerHeight || document.documentElement.clientHeight,
e = "undefined" == typeof window.screenY ? window.screenTop : window.screenY;
return this._centerPosition(t, this.popupHeight, e)
}, i.prototype._getLeftPosition = function() {
var t = window.outerWidth || document.documentElement.clientWidth,
e = "undefined" == typeof window.screenX ? window.screenLeft : window.screenX;
return this._centerPosition(t, this.popupWidth, e)
}, i.prototype.isClosed = function() {
return this.el ? this.el.closed : void 0
}, i.prototype.open = function() {
this.el || (this.el = window.open(this.options.src, this.name, this._getPopupOptions()), this.focus(), this.bus.emit(r.events.UI_POPUP_DID_OPEN, {
source: o.PAYPAL_INTEGRATION_NAME
}))
}, i.prototype.close = function() {
this.el && ((s.isIE8() && !this.isClosed() || !s.isIE8()) && this.el.close(), this.bus.emit(r.events.UI_POPUP_DID_CLOSE, {
source: o.PAYPAL_INTEGRATION_NAME
}))
}, i.prototype.focus = function() {
this.el && this.el.focus()
}, i.prototype.teardown = function() {
this.close(), this.bus.teardown()
}, e.exports = i
}).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
}, {
163: 163,
223: 223,
227: 227
}],
223: [function(t, e, n) {
"use strict";
var i, o = "2.15.5",
r = ["GET_CLIENT_TOKEN", "GET_CLIENT_OPTIONS", "OPEN_MODAL", "CLOSE_APP", "FOCUS_APP", "UI_MODAL_DID_OPEN", "UI_MODAL_DID_CLOSE"],
s = {
LEGACY_ONETIME: "Legacy Onetime",
HERMES_ONETIME: "Hermes Onetime",
LEGACY_FUTURE_PAYMENTS: "Legacy Future Payments",
HERMES_BILLING_AGREEMENTS: "Hermes Billing Agreements"
};
for (n.VERSION = o, n.POPUP_NAME = "braintree_paypal_popup", n.HERMES_POPUP_NAME = "PPFrameRedirect", n.FRAME_NAME = "braintree-paypal-frame", n.HERMES_FRAME_NAME = "PPFrameRedirect", n.POPUP_PATH = "/pwpp/" + o + "/html/braintree-frame.html", n.POPUP_OPTIONS = "resizable,scrollbars", n.POPUP_HEIGHT = 470, n.POPUP_WIDTH = 410, n.HERMES_POPUP_HEIGHT = 535, n.HERMES_POPUP_WIDTH = 450, n.BRIDGE_FRAME_NAME = "bt-proxy-frame", n.HERMES_SUPPORTED_CURRENCIES = ["USD", "GBP", "EUR", "AUD", "CAD", "DKK", "NOK", "PLN", "SEK", "CHF", "TRY", "BRL"], n.HERMES_SUPPORTED_COUNTRIES = ["US", "GB", "AU", "CA", "ES", "FR", "DE", "IT", "NL", "NO", "PL", "CH", "TR", "DK", "BE", "AT"], n.NONCE_TYPE = "PayPalAccount", n.PAYPAL_INTEGRATION_NAME = "PayPal", n.ILLEGAL_XHR_ERROR = "Illegal XHR request attempted", n.CONFIGURATION_TYPES = s, n.events = {}, i = 0; i < r.length; i++) n.events[r[i]] = "paypal:" + r[i]
}, {}],
224: [function(t, e, n) {
"use strict";
e.exports = {
us: "en_us",
gb: "en_uk",
uk: "en_uk",
de: "de_de",
fr: "fr_fr",
it: "it_it",
es: "es_es",
ca: "en_ca",
au: "en_au",
at: "de_de",
be: "en_us",
ch: "de_de",
dk: "da_dk",
nl: "nl_nl",
no: "no_no",
pl: "pl_pl",
se: "sv_se",
tr: "tr_tr",
bg: "en_us",
cy: "en_us",
hr: "en_us",
is: "en_us",
kh: "en_us",
mt: "en_us",
my: "en_us",
ru: "ru_ru"
}
}, {}],
225: [function(t, e, n) {
"use strict";
function i(t) {
return -1 !== t.indexOf("_") && 5 === t.length
}
function o(t) {
var e, n;
for (e in s) s.hasOwnProperty(e) && (e === t ? n = s[e] : s[e] === t && (n = s[e]));
return n
}
function r(t) {
var e, n;
return t = t ? t.toLowerCase() : "us", t = t.replace(/-/g, "_"), e = i(t) ? t : o(t), e ? (n = e.split("_"), [n[0], n[1].toUpperCase()].join("_")) : "en_US"
}
var s = t(224);
e.exports = r
}, {
224: 224
}],
226: [function(t, e, n) {
"use strict";
function i(t) {
var e = t ? t.toLowerCase().replace(/-/g, "_") : "us";
return -1 !== e.indexOf("_") && (e = e.split("_")[1]), e = s[e] ? e : "us", "uk" === e && (e = "gb"), e
}
function o(t, e) {
return t = t.toLowerCase(), e[t] ? e[t] : e.en_us
}
function r(t, e) {
var n = i(t),
r = a(t),
s = o(r, e);
return {
country: n,
locale: r,
translation: s
}
}
var s = t(224),
a = t(225);
e.exports = r
}, {
224: 224,
225: 225
}],
227: [function(t, e, n) {
"use strict";
function i() {
return f.matchUserAgent("Android") && !o()
}
function o() {
return f.matchUserAgent("Chrome") || f.matchUserAgent("CriOS")
}
function r() {
return f.matchUserAgent("Firefox")
}
function s() {
return f.matchUserAgent("Trident") || f.matchUserAgent("MSIE")
}
function a() {
return f.matchUserAgent(/MSIE 8\.0/)
}
function c() {
return f.matchUserAgent("Opera") || f.matchUserAgent("OPR")
}
function u() {
return c() && "[object OperaMini]" === Object.prototype.toString.call(window.operamini)
}
function l() {
return f.matchUserAgent("Safari") && !o() && !i()
}
function h() {
return d.isIos() && !o() && !l()
}
function p() {
var t = /Version\/[\w\.]+ Chrome\/[\w\.]+ Mobile/;
return d.isAndroid() && f.matchUserAgent(t)
}
var f = t(230),
d = t(229);
e.exports = {
isAndroid: i,
isChrome: o,
isFirefox: r,
isIE: s,
isIE8: a,
isOpera: c,
isOperaMini: u,
isSafari: l,
isIosWebView: h,
isAndroidWebView: p
}
}, {
229: 229,
230: 230
}],
228: [function(t, e, n) {
"use strict";
function i() {
return !o() && (a.isAndroid() || a.isIpod() || a.isIphone() || s.matchUserAgent("IEMobile"))
}
function o() {
return a.isIpad() || a.isAndroid() && !s.matchUserAgent("Mobile")
}
function r() {
return !i() && !o()
}
var s = t(230),
a = t(229);
e.exports = {
isMobile: i,
isTablet: o,
isDesktop: r
}
}, {
229: 229,
230: 230
}],
229: [function(t, e, n) {
"use strict";
function i() {
return c.matchUserAgent("Android")
}
function o() {
return c.matchUserAgent("iPad")
}
function r() {
return c.matchUserAgent("iPod")
}
function s() {
return c.matchUserAgent("iPhone") && !r()
}
function a() {
return o() || r() || s()
}
var c = t(230);
e.exports = {
isAndroid: i,
isIpad: o,
isIpod: r,
isIphone: s,
isIos: a
}
}, {
230: 230
}],
230: [function(t, e, n) {
"use strict";
function i() {
return r
}
function o(t) {
var e = n.getNativeUserAgent(),
i = e.match(t);
return i ? !0 : !1
}
var r = window.navigator.userAgent;
n.getNativeUserAgent = i, n.matchUserAgent = o
}, {}],
231: [function(t, e, n) {
"use strict";
function i() {
return o() && window.outerWidth < 600
}
function o() {
return m.test(d)
}
function r() {
return Boolean(window.postMessage)
}
function s() {
if (l.isOperaMini()) return !1;
if (h.isDesktop()) return !0;
if (h.isMobile() || h.isTablet()) {
if (l.isIE()) return !1;
if (p.isAndroid()) return l.isAndroidWebView() ? !1 : !0;
if (p.isIos()) return l.isChrome() ? !1 : l.isSafari() && f.matchUserAgent(/OS (?:8_1|8_0|8)(?!_\d)/i) ? !1 : l.isIosWebView() ? !1 : !0
}
return !1
}
function a() {
if (l.isIE8()) return !1;
try {
return window.self === window.top
} catch (t) {
return !1
}
}
function c() {
return l.isIE()
}
function u() {
var t = null,
e = "";
try {
new ActiveXObject("")
} catch (n) {
e = n.name
}
try {
t = Boolean(new ActiveXObject("htmlfile"))
} catch (n) {
t = !1
}
return t = "ReferenceError" !== e && t === !1 ? !1 : !0, !t
}
var l = t(227),
h = t(228),
p = t(229),
f = t(230),
d = window.navigator.userAgent,
m = /[Mm]obi|tablet|iOS|Android|IEMobile|Windows\sPhone/;
e.exports = {
isMobile: i,
isMobileDevice: o,
detectedPostMessage: r,
isPopupSupported: s,
isOverlaySupported: a,
isBridgeIframeRequired: c,
isMetroBrowser: u
}
}, {
227: 227,
228: 228,
229: 229,
230: 230
}],
232: [function(t, e, n) {
"use strict";
function i(t, e) {
var n = "innerText";
document && document.body && "textContent" in document.body && (n = "textContent"), t[n] = e
}
e.exports = {
setTextContent: i
}
}, {}],
233: [function(t, e, n) {
"use strict";
function i() {
var t, e, n = "";
for (t = 0; 32 > t; t++) e = Math.floor(16 * Math.random()), n += e.toString(16);
return n
}
function o(t) {
return /^(true|1)$/i.test(t)
}
function r(t) {
return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\"/g, "&quot;").replace(/\'/g, "&apos;")
}
function s(t) {
var e, n, i, o, r, s, a, c, u = t.indexOf("?"),
l = {};
if (u >= 0 && (t = t.substr(u + 1)), 0 === t.length) return null;
for (e = t.split("&"), n = 0, i = e.length; i > n; n++) o = e[n], r = o.indexOf("="), s = o.substr(0, r), c = o.substr(r + 1), a = decodeURIComponent(c), a = a.replace(/</g, "&lt;").replace(/>/g, "&gt;"), "false" === a && (a = !1), (null == a || "true" === a) && (a = !0), l[s] = a;
return l
}
function a(t) {
t.preventDefault ? t.preventDefault() : t.returnValue = !1
}
function c(t) {
var e;
return e = Boolean(t.amount) && Boolean(t.currency) ? f.CONFIGURATION_TYPES.HERMES_ONETIME : f.CONFIGURATION_TYPES.LEGACY_ONETIME
}
function u(t) {
var e;
return e = Boolean(t.paypal.billingAgreementsEnabled) ? f.CONFIGURATION_TYPES.HERMES_BILLING_AGREEMENTS : f.CONFIGURATION_TYPES.LEGACY_FUTURE_PAYMENTS
}
function l(t, e) {
var n;
return n = Boolean(e.singleUse) ? c(e) : u(t)
}
function h(t, e) {
var n = l(t, e);
return n === f.CONFIGURATION_TYPES.HERMES_ONETIME || n === f.CONFIGURATION_TYPES.HERMES_BILLING_AGREEMENTS
}
function p(t, e) {
var n = l(t, e);
return n === f.CONFIGURATION_TYPES.HERMES_ONETIME
}
var f = t(223),
d = "function" == typeof String.prototype.trim ? function(t) {
return t.trim()
} : function(t) {
return t.replace(/^\s+|\s+$/, "")
},
m = "function" == typeof window.btoa ? function(t) {
return window.btoa(t)
} : function(t) {
for (var e, n, i, o, r, s, a, c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", u = "", l = 0; l < t.length;) e = t.charCodeAt(l++), n = t.charCodeAt(l++), i = t.charCodeAt(l++), o = e >> 2, r = (3 & e) << 4 | n >> 4, s = (15 & n) << 2 | i >> 6, a = 63 & i, isNaN(n) ? s = a = 64 : isNaN(i) && (a = 64), u = u + c.charAt(o) + c.charAt(r) + c.charAt(s) + c.charAt(a);
return u
};
e.exports = {
trim: d,
btoa: m,
generateUid: i,
castToBoolean: o,
htmlEscape: r,
parseUrlParams: s,
preventDefault: a,
isHermesConfiguration: h,
isOnetimeHermesConfiguration: p,
getConfigurationType: l
}
}, {
223: 223
}]
}, {}, [179])(179)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment