!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,r){this.stream=t,this.header=e,this.length=n,this.tag=i,this.sub=r}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+=ee.charAt(n>>6)+ee.charAt(63&n);for(e+1==t.length?(n=parseInt(t.substring(e,e+1),16),i+=ee.charAt(n<<2)):e+2==t.length&&(n=parseInt(t.substring(e,e+2),16),i+=ee.charAt(n>>2)+ee.charAt((3&n)<<4));(3&i.length)>0;)i+=ne;return i}function i(t){var e,n,i,r="",o=0;for(e=0;ei||(0==o?(r+=l(i>>2),n=3&i,o=1):1==o?(r+=l(n<<2|i>>4),n=15&i,o=2):2==o?(r+=l(n),r+=l(i>>2),n=3&i,o=3):(r+=l(n<<2|i>>4),r+=l(15&i),o=0));return 1==o&&(r+=l(n<<2)),r}function r(t){var e,n=i(t),r=new Array;for(e=0;2*e=0;){var s=e*this[t++]+n[i]+r;r=Math.floor(s/67108864),n[i++]=67108863&s}return r}function u(t,e,n,i,r,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],c=this[t++]>>15,l=a*u+c*s;u=s*u+((32767&l)<<15)+n[i]+(1073741823&r),r=(u>>>30)+(l>>>15)+a*c+(r>>>30),n[i++]=1073741823&u}return r}function c(t,e,n,i,r,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],c=this[t++]>>14,l=a*u+c*s;u=s*u+((16383&l)<<14)+n[i]+r,r=(u>>28)+(l>>14)+a*c,n[i++]=268435455&u}return r}function l(t){return ue.charAt(t)}function p(t,e){var n=ce[t.charCodeAt(e)];return null==n?-1:n}function h(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function d(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 f(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,r=!1,s=0;--i>=0;){var a=8==n?255&t[i]:p(t,i);0>a?"-"==t.charAt(i)&&(r=!0):(r=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<>this.DB-s):this[this.t-1]|=a<=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t}function y(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<0)for(a>a)>0&&(r=!0,o=l(n));s>=0;)e>a?(n=(this[s]&(1<>(a+=this.DB-e)):(n=this[s]>>(a-=e)&i,0>=a&&(a+=this.DB,--s)),n>0&&(r=!0),r&&(o+=l(n));return r?o:"0"}function b(){var t=s();return o.ZERO.subTo(this,t),t}function v(){return this.s<0?this.negate():this}function _(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=0;--n)e[n+s+1]=this[n]>>r|a,a=(this[n]&o)<=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,r=this.DB-i,o=(1<>i;for(var s=n+1;s>i;i>0&&(e[this.t-n-1]|=(this.s&o)<n;)i+=this[n]-t[n],e[n++]=i&this.DM,i>>=this.DB;if(t.t>=this.DB;i+=this.s}else{for(i+=this.s;n>=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 S(t,e){var n=this.abs(),i=t.abs(),r=n.t;for(e.t=r+i.t;--r>=0;)e[r]=0;for(r=0;r=0;)t[n]=0;for(n=0;n=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 r=this.abs();if(r.t0?(i.lShiftTo(l,a),r.lShiftTo(l,n)):(i.copyTo(a),r.copyTo(n));var p=a.t,h=a[p-1];if(0!=h){var d=h*(1<1?a[p-2]>>this.F2:0),f=this.FV/d,m=(1<=0&&(n[n.t++]=1,n.subTo(v,n)),o.ONE.dlShiftTo(p,v),v.subTo(a,a);a.t=0;){var _=n[--y]==h?this.DM:Math.floor(n[y]*f+(n[y-1]+g)*m);if((n[y]+=a.am(0,_,n,b,0,p))<_)for(a.dlShiftTo(b,v),n.subTo(v,n);n[y]<--_;)n.subTo(v,n)}null!=e&&(n.drShiftTo(p,e),u!=c&&o.ZERO.subTo(e,e)),n.t=p,n.clamp(),l>0&&n.rShiftTo(l,n),0>u&&o.ZERO.subTo(n,n)}}}function P(t){var e=s();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(o.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<0&&this.m.subTo(e,e),e}function H(t){var e=s();return t.copyTo(e),this.reduce(e),e}function V(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;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 z(t,e){t.squareTo(e),this.reduce(e)}function Y(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 o.ONE;var n=s(),i=s(),r=e.convert(this),a=E(t)-1;for(r.copyTo(n);--a>=0;)if(e.sqrTo(n,i),(t&1<0)e.mulTo(i,r,n);else{var u=n;n=i,i=u}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 Q(t,e){return new o(t,e)}function K(t,e){if(e=0&&e>0;){var r=t.charCodeAt(i--);128>r?n[--e]=r:r>127&&2048>r?(n[--e]=63&r|128,n[--e]=r>>6|192):(n[--e]=63&r|128,n[--e]=r>>6&63|128,n[--e]=r>>12|224)}n[--e]=0;for(var s=0,a=0,u=0;e>2;)0==u&&(a=le.random.randomWords(1,0)[0]),s=a>>u&255,u=(u+8)%32,0!=s&&(n[--e]=s);return n[--e]=2,n[--e]=0,new o(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=Q(t,16),this.e=parseInt(e,16)}function X(t){return t.modPowInt(this.e,this.n)}function J(t){var e=K(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,r=t;e>r;){var i=this.get(r++);n+=String.fromCharCode(128>i?i:i>191&&224>i?(31&i)<<6|63&this.get(r++):(15&i)<<12|(63&this.get(r++))<<6|63&this.get(r++))}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 r=0,o=t;e>o;++o)r=r<<8|this.get(o);return r},t.prototype.parseBitString=function(t,e){var n=this.get(t),i=(e-t-1<<3)-n,r="("+i+" bit)";if(20>=i){var o=n;r+=" ";for(var s=e-1;s>t;--s){for(var a=this.get(s),u=o;8>u;++u)r+=a>>u&1?"1":"0";o=0}}return r},t.prototype.parseOctetString=function(t,e){var n=e-t,i="("+n+" byte) ";n>20&&(e=t+20);for(var r=t;e>r;++r)i+=this.hexByte(this.get(r));return n>20&&(i+=String.fromCharCode(8230)),i},t.prototype.parseOID=function(t,e){for(var n,i=0,r=0,o=t;e>o;++o){var s=this.get(o);i=i<<7|127&s,r+=7,128&s||(void 0==n?n=parseInt(i/40)+"."+i%40:n+="."+(r>=31?"bigint":i),i=r=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,r){if(32&n)return!0;if(3>n||n>4)return!1;var o=new t(r);3==n&&o.get();var s=o.get();if(s>>6&1)return!1;try{var a=e.decodeLength(o);return o.pos-r.pos+a==i}catch(u){return!1}},e.decode=function(n){n instanceof t||(n=new t(n,0));var i=new t(n),r=n.get(),o=e.decodeLength(n),s=n.pos-i.pos,a=null;if(e.hasContent(r,o,n)){var u=n.pos;if(3==r&&n.get(),a=[],o>=0){for(var c=u+o;n.pos=ae;++ae)ce[se++]=ae;for(se="a".charCodeAt(0),ae=10;36>ae;++ae)ce[se++]=ae;for(se="A".charCodeAt(0),ae=10;36>ae;++ae)ce[se++]=ae;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=H,j.prototype.reduce=V,j.prototype.mulTo=Y,j.prototype.sqrTo=z,o.prototype.copyTo=h,o.prototype.fromInt=d,o.prototype.fromString=m,o.prototype.clamp=g,o.prototype.dlShiftTo=A,o.prototype.drShiftTo=C,o.prototype.lShiftTo=N,o.prototype.rShiftTo=T,o.prototype.subTo=O,o.prototype.multiplyTo=S,o.prototype.squareTo=x,o.prototype.divRemTo=I,o.prototype.invDigit=L,o.prototype.isEven=G,o.prototype.exp=W,o.prototype.toString=y,o.prototype.negate=b,o.prototype.abs=v,o.prototype.compareTo=_,o.prototype.bitLength=w,o.prototype.mod=P,o.prototype.modPowInt=q,o.ZERO=f(0),o.ONE=f(1),$.prototype.doPublic=X,$.prototype.setPublic=Z,$.prototype.encrypt=J;var le={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=le),le.cipher.aes=function(t){this._tables[0][0][0]||this._precompute();var e,n,i,r,o,s=this._tables[0][4],a=this._tables[1],u=t.length,c=1;if(4!==u&&6!==u&&8!==u)throw new le.exception.invalid("invalid aes key size");for(this._key=[r=t.slice(0),o=[]],e=u;4*u+28>e;e++)i=r[e-1],(e%u===0||8===u&&e%u===4)&&(i=s[i>>>24]<<24^s[i>>16&255]<<16^s[i>>8&255]<<8^s[255&i],e%u===0&&(i=i<<8^i>>>24^c<<24,c=c<<1^283*(c>>7))),r[e]=r[e-u]^i;for(n=0;e;n++,e--)i=r[3&n?e:e-4],o[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]]},le.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,r,o,s,a,u,c=this._tables[0],l=this._tables[1],p=c[4],h=l[4],d=[],f=[];for(t=0;256>t;t++)f[(d[t]=t<<1^283*(t>>7))^t]=t;for(e=n=0;!p[e];e^=i||1,n=f[n]||1)for(s=n^n<<1^n<<2^n<<3^n<<4,s=s>>8^255&s^99,p[e]=s,h[s]=e,o=d[r=d[i=d[e]]],u=16843009*o^65537*r^257*i^16843008*e,a=257*d[s]^16843008*s,t=0;4>t;t++)c[t][e]=a=a<<24^a>>>8,l[t][s]=u=u<<24^u>>>8;for(t=0;5>t;t++)c[t]=c[t].slice(0),l[t]=l[t].slice(0)},_crypt:function(t,e){if(4!==t.length)throw new le.exception.invalid("invalid aes block size");var n,i,r,o,s=this._key[e],a=t[0]^s[0],u=t[e?3:1]^s[1],c=t[2]^s[2],l=t[e?1:3]^s[3],p=s.length/4-2,h=4,d=[0,0,0,0],f=this._tables[e],m=f[0],g=f[1],y=f[2],b=f[3],v=f[4];for(o=0;p>o;o++)n=m[a>>>24]^g[u>>16&255]^y[c>>8&255]^b[255&l]^s[h],i=m[u>>>24]^g[c>>16&255]^y[l>>8&255]^b[255&a]^s[h+1],r=m[c>>>24]^g[l>>16&255]^y[a>>8&255]^b[255&u]^s[h+2],l=m[l>>>24]^g[a>>16&255]^y[u>>8&255]^b[255&c]^s[h+3],h+=4,a=n,u=i,c=r;for(o=0;4>o;o++)d[e?3&-o:o]=v[a>>>24]<<24^v[u>>16&255]<<16^v[c>>8&255]<<8^v[255&l]^s[h++],n=a,a=u,u=c,c=l,l=n;return d}},le.bitArray={bitSlice:function(t,e,n){return t=le.bitArray._shiftRight(t.slice(e/32),32-(31&e)).slice(1),void 0===n?t:le.bitArray.clamp(t,n-e)},extract:function(t,e,n){var i,r=Math.floor(-e-n&31);return i=-32&(e+n-1^e)?t[e/32|0]<<32-r^t[e/32+1|0]>>>r:t[e/32|0]>>>r,i&(1<0&&e&&(t[n-1]=le.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(le.bitArray.bitLength(t)!==le.bitArray.bitLength(e))return!1;var n,i=0;for(n=0;n=32;e-=32)i.push(n),n=0;if(0===e)return i.concat(t);for(r=0;r>>e),n=t[r]<<32-e;return s=t.length?t[t.length-1]:0,o=le.bitArray.getPartial(s),i.push(le.bitArray.partial(e+o&31,e+o>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]]}},le.codec.hex={fromBits:function(t){var e,n="";for(e=0;ee;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>>o)>>>26),6>o?(a=t[i]<<6-o,o+=26,i++):(a<<=6,o-=6);for(;3&r.length&&!e;)r+="=";return r},toBits:function(t,e){t=t.replace(/\s|=/g,"");var n,i,r=[],o=0,s=le.codec.base64._chars,a=0;for(e&&(s=s.substr(0,62)+"-_"),n=0;ni)throw new le.exception.invalid("this isn't base64!");o>26?(o-=26,r.push(a^i>>>o),a=i<<32-o):(o+=6,a^=i<<32-o)}return 56&o&&r.push(le.bitArray.partial(56&o,a,1)),r}},le.codec.base64url={fromBits:function(t){return le.codec.base64.fromBits(t,1,1)},toBits:function(t){return le.codec.base64.toBits(t,1)}},void 0===le.beware&&(le.beware={}),le.beware["CBC mode is dangerous because it doesn't protect message integrity."]=function(){le.mode.cbc={name:"cbc",encrypt:function(t,e,n,i){if(i&&i.length)throw new le.exception.invalid("cbc can't authenticate data");if(128!==le.bitArray.bitLength(n))throw new le.exception.invalid("cbc iv must be 128 bits");var r,o=le.bitArray,s=o._xor4,a=o.bitLength(e),u=0,c=[];if(7&a)throw new le.exception.invalid("pkcs#5 padding only works for multiples of a byte");for(r=0;a>=u+128;r+=4,u+=128)n=t.encrypt(s(n,e.slice(r,r+4))),c.splice(r,0,n[0],n[1],n[2],n[3]);return a=16843009*(16-(a>>3&15)),n=t.encrypt(s(n,o.concat(e,[a,a,a,a]).slice(r,r+4))),c.splice(r,0,n[0],n[1],n[2],n[3]),c},decrypt:function(t,e,n,i){if(i&&i.length)throw new le.exception.invalid("cbc can't authenticate data");if(128!==le.bitArray.bitLength(n))throw new le.exception.invalid("cbc iv must be 128 bits");if(127&le.bitArray.bitLength(e)||!e.length)throw new le.exception.corrupt("cbc ciphertext must be a positive multiple of the block size");var r,o,s,a=le.bitArray,u=a._xor4,c=[];for(i=i||[],r=0;r16)throw new le.exception.corrupt("pkcs#5 padding corrupt");if(s=16843009*o,!a.equal(a.bitSlice([s,s,s,s],0,8*o),a.bitSlice(c,32*c.length-8*o,32*c.length)))throw new le.exception.corrupt("pkcs#5 padding corrupt");return a.bitSlice(c,0,32*c.length-8*o)}}},le.misc.hmac=function(t,e){this._hash=e=e||le.hash.sha256;var n,i=[[],[]],r=e.prototype.blockSize/32;for(this._baseHash=[new e,new e],t.length>r&&(t=e.hash(t)),n=0;r>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])},le.misc.hmac.prototype.encrypt=le.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()},le.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()},le.hash.sha256.hash=function(t){return(new le.hash.sha256).update(t).finalize()},le.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=le.codec.utf8String.toBits(t));var e,n=this._buffer=le.bitArray.concat(this._buffer,t),i=this._length,r=this._length=i+le.bitArray.bitLength(t);for(e=512+i&-512;r>=e;e+=512)this._block(n.splice(0,16));return this},finalize:function(){var t,e=this._buffer,n=this._h;for(e=le.bitArray.concat(e,[le.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,r,o=t.slice(0),s=this._h,a=this._key,u=s[0],c=s[1],l=s[2],p=s[3],h=s[4],d=s[5],f=s[6],m=s[7];for(e=0;64>e;e++)16>e?n=o[e]:(i=o[e+1&15],r=o[e+14&15],n=o[15&e]=(i>>>7^i>>>18^i>>>3^i<<25^i<<14)+(r>>>17^r>>>19^r>>>10^r<<15^r<<13)+o[15&e]+o[e+9&15]|0),n=n+m+(h>>>6^h>>>11^h>>>25^h<<26^h<<21^h<<7)+(f^h&(d^f))+a[e],m=f,f=d,d=h,h=p+n|0,p=l,l=c,c=u,u=n+(c&l^p&(c^l))+(c>>>2^c>>>13^c>>>22^c<<30^c<<19^c<<10)|0;s[0]=s[0]+u|0,s[1]=s[1]+c|0,s[2]=s[2]+l|0,s[3]=s[3]+p|0,s[4]=s[4]+h|0,s[5]=s[5]+d|0,s[6]=s[6]+f|0,s[7]=s[7]+m|0}},le.random={randomWords:function(t,e){var n,i,r=[],o=this.isReady(e);if(o===this._NOT_READY)throw new le.exception.notReady("generator isn't seeded");for(o&this._REQUIRES_RESEED&&this._reseedFromPools(!(o&this._READY)),n=0;t>n;n+=4)(n+1)%this._MAX_WORDS_PER_BURST===0&&this._gate(),i=this._gen4words(),r.push(i[0],i[1],i[2],i[3]);return this._gate(),r.slice(0,t)},setDefaultParanoia:function(t){this._defaultParanoia=t},addEntropy:function(t,e,n){n=n||"user";var i,r,o,s=(new Date).valueOf(),a=this._robins[n],u=this.isReady(),c=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(o=[],r=0;r0;)e++,o>>>=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:c=1}if(c)throw new le.exception.bug("random: addEntropy only supports number, array of numbers or string");this._poolEntropy[a]+=e,this._poolStrength+=e,u===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 le.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,r=this._callbacks[t],o=[];for(i in r)r.hasOwnProperty(i)&&r[i]===e&&o.push(i);for(n=0;nt&&(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 le.cipher.aes(this._key)},_reseed:function(t){this._key=le.hash.sha256.hash(this._key.concat(t)),this._cipher=new le.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=1<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;le.random.addEntropy([e,n],2,"mouse")},_loadTimeCollector:function(){le.random.addEntropy((new Date).valueOf(),2,"loadtime")},_fireEvent:function(t,e){var n,i=le.random._callbacks[t],r=[];for(n in i)i.hasOwnProperty(n)&&r.push(i[n]);for(n=0;n0&&(i=i.concat(c(e)));return i},l=function(){var n,i,o,s,a,c;try{a=r(t),n=e.decode(a)}catch(l){throw"Invalid encryption key. Please use the key labeled 'Client-Side Encryption Key'"}if(o=u(n),2!==o.length)throw"Invalid encryption key. Please use the key labeled 'Client-Side Encryption Key'";return s=o[0],i=o[1],c=new $,c.setPublic(s,i),c},p=function(){return{key:le.random.randomWords(8,0),sign:function(t){var e=new le.misc.hmac(this.key,le.hash.sha256),n=e.encrypt(t);return le.codec.base64.fromBits(n)}}};i.encrypt=function(t){var e=l(),r=pe.generateAesKey(),o=p(),s=r.encrypt(t),a=o.sign(le.codec.base64.toBits(s)),u=le.bitArray.concat(r.key,o.key),c=le.codec.base64.fromBits(u),h=e.encrypt(c),d="$bt4|javascript_"+i.version.replace(/\./g,"_")+"$",f=null;return h&&(f=n(h)),d+f+"$"+s+"$"+a},i.encryptForm=function(t){var e,n,r,u,l,p;for(t=a(t),p=c(t);o.length>0;){try{t.removeChild(o[0])}catch(h){}o.splice(0,1)}for(l=0;le;e++)i.push(new p(t.paymentMethods[e]));return i},t,this.requestTimeout)},r.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)})},r.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)})},r.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)})},r.prototype.lookup3DS=function(t,e){var n=u.joinUrlFragments([this.clientApiUrl,"v1/payment_methods",t.nonce,"three_d_secure/lookup"]),i=u.mergeOptions(this.attrs,{amount:t.amount});this.driver.post(n,i,function(t){return t},e,this.requestTimeout)},r.prototype.createSEPAMandate=function(t,e){var n=u.mergeOptions(this.attrs,{sepaMandate:t});this.driver.post(u.joinUrlFragments([this.clientApiUrl,"v1","sepa_mandates.json"]),n,function(t){return{sepaMandate:new c(t.europeBankAccounts[0].sepaMandates[0]),sepaBankAccount:new l(t.europeBankAccounts[0])}},e,this.requestTimeout)},r.prototype.getSEPAMandate=function(t,e){var n=u.mergeOptions(this.attrs,t);this.driver.get(u.joinUrlFragments([this.clientApiUrl,"v1","sepa_mandates.json"]),n,function(t){return{sepaMandate:new c(t.sepaMandates[0])}},e,this.requestTimeout)},r.prototype.addCoinbase=function(t,e){var n;delete t.share,n=u.mergeOptions(this.attrs,{coinbaseAccount:t,_meta:{integration:this.integration||"custom",source:"coinbase"}}),this.driver.post(u.joinUrlFragments([this.clientApiUrl,"v1","payment_methods/coinbase_accounts"]),n,function(t){return new h(t.coinbaseAccounts[0])},e,this.requestTimeout)},r.prototype.addPayPalAccount=function(t,e){var n;delete t.share,n=u.mergeOptions(this.attrs,{paypalAccount:t,_meta:{integration:this.integration||"paypal",source:"paypal"}}),this.driver.post(u.joinUrlFragments([this.clientApiUrl,"v1","payment_methods","paypal_accounts"]),n,function(t){return new d(t.paypalAccounts[0])},e,this.requestTimeout)},r.prototype.addCreditCard=function(t,e){var n,i,r=t.share;delete t.share,i=f(t),n=u.mergeOptions(this.attrs,{share:r,creditCard:i,_meta:{integration:this.integration||"custom",source:"form"}}),this.driver.post(u.joinUrlFragments([this.clientApiUrl,"v1","payment_methods/credit_cards"]),n,function(t){return new p(t.creditCards[0])},e,this.requestTimeout)},r.prototype.sendAnalyticsEvents=function(t,e){var i,r,o=this.analyticsUrl,s=[];if(t=u.isArray(t)?t:[t],!o)return void(e&&e.apply(null,[null,{}]));for(r in t)t.hasOwnProperty(r)&&s.push({kind:t[r]});i=u.mergeOptions(this.attrs,{braintree_library_version:this.sdkVersion,analytics:s,_meta:{merchantAppId:this.merchantAppId,platform:"web",platformVersion:n.navigator.userAgent,integrationType:this.integration,sdkVersion:this.sdkVersion}}),this.driver.post(o,i,function(t){return t},e,y.ANALYTICS_TIMEOUT_MS)},r.prototype.decryptBrowserswitchPayload=function(t,e){var n=u.mergeOptions(this.attrs,{asymmetric_encrypted_payload:t}),i=u.joinUrlFragments([this.clientApiUrl,"/v1/paypal_browser_switch/decrypt"]);this.driver.post(i,n,function(t){return t},e,this.requestTimeout)},r.prototype.encryptBrowserswitchReturnPayload=function(t,e,n){var i=u.mergeOptions(this.attrs,{payload:t,aesKey:e}),r=u.joinUrlFragments([this.clientApiUrl,"/v1/paypal_browser_switch/encrypt"]);this.driver.post(r,i,function(t){return t},n,this.requestTimeout)},r.prototype.exchangePaypalTokenForConsentCode=function(t,e){var n=u.mergeOptions(this.attrs,t);this.attrs.merchantAccountId&&(n.merchant_account_id=this.attrs.merchantAccountId);var i=u.joinUrlFragments([this.clientApiUrl,"/v1/paypal_account_service/merchant_consent"]);this.driver.post(i,n,function(t){return t},e,this.requestTimeout)},r.prototype.getAmexRewardsBalance=function(t,e){var n=u.mergeOptions(this.attrs,t);n.nonce&&(n.payment_method_nonce=n.nonce,delete n.nonce),this.driver.get(u.joinUrlFragments([this.clientApiUrl,"v1/payment_methods/amex_rewards_balance"]),n,function(t){return t},e,this.requestTimeout)},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./coinbase-account":3,"./constants":4,"./credit-card":5,"./europe-bank-account":6,"./normalize-api-fields":8,"./parse-client-token":9,"./paypal-account":10,"./request/choose-driver":13,"./sepa-mandate":18,"./should-enable-cors":19,"./util":20,"braintree-3ds":29,"braintree-utilities":43}],3:[function(t,e){"use strict";function n(t){var e,n;for(e=0;e>4&3,l=(15&s)<<4|a>>2&15,p=(3&a)<<6|63&u;i+=String.fromCharCode(c)+(l?String.fromCharCode(l):"")+(p?String.fromCharCode(p):"")}while(r=400||0===a?o.call(null,h||{errors:l.errors.UNKNOWN_ERROR},null):a>0&&o.call(null,null,r(h)))}:(d.onload=function(){o.call(null,null,r(c(d.responseText)))},d.onerror=function(){o.call(null,d.responseText,null)},d.onprogress=function(){},d.ontimeout=function(){o.call(null,{errors:l.errors.UNKNOWN_ERROR},null)}),d.open(t,e,!0),d.timeout=null==s?6e4:s,p&&"POST"===t&&d.setRequestHeader("Content-Type","application/json"),setTimeout(function(){d.send(u(t,n))},0)}var a=t("../util"),u=t("./prep-body"),c=t("./parse-body"),l=t("../constants"),p=n.XMLHttpRequest&&"withCredentials"in new n.XMLHttpRequest;e.exports={get:r,post:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../constants":4,"../util":20,"./parse-body":16,"./prep-body":17}],13:[function(t,e){"use strict";function n(t){var e=o.getUserAgent(),n=!(o.isHTTP()&&/(MSIE\s(8|9))|(Phantom)/.test(e));return t=t||{},t.enableCORS&&n?r:i}var i=t("./jsonp-driver"),r=t("./ajax-driver"),o=t("../util");e.exports=n},{"../util":20,"./ajax-driver":12,"./jsonp-driver":14}],14:[function(t,e){"use strict";function n(t,e){return t.status>=400?[t,null]:[null,e(t)]}function i(){}function r(t,e,r,o,s,a){var l;s=s||i,null==a&&(a=6e4),l=o(t,e,function(t,e){c[e]&&(clearTimeout(c[e]),s.apply(null,n(t,function(t){return r(t)})))}),"number"==typeof a?c[l]=setTimeout(function(){c[l]=null,s.apply(null,[{errors:u.errors.UNKNOWN_ERROR},null])},a):s.apply(null,[{errors:u.errors.INVALID_TIMEOUT},null])}function o(t,e,n,i,o){e._method="POST",r(t,e,n,a.get,i,o)}function s(t,e,n,i,o){r(t,e,n,a.get,i,o)}var a=t("./jsonp"),u=t("../constants"),c=[];e.exports={get:s,post:o}},{"../constants":4,"./jsonp":15}],15:[function(t,e){(function(n){"use strict";function i(t,e){var n=document.createElement("script"),i=!1;n.src=t,n.async=!0;var r=e||c.error;"function"==typeof r&&(n.onerror=function(e){r({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 r(t,e,n,r){var o,s;return r=r||c.callbackName||"callback",s=r+"_json"+a.generateUUID(),e[r]=s,o=a.createURLParams(t,e),u[s]=function(t){n(t,s);try{delete u[s]}catch(e){}u[s]=null},i(o),s}function o(t){c=t}var s,a=t("../util"),u=n,c={};e.exports={get:r,init:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../util":20}],16:[function(t,e){"use strict";e.exports=function(t){try{t=JSON.parse(t)}catch(e){}return t}},{}],17:[function(t,e){"use strict";var n=t("lodash.isstring");e.exports=function(t,e){if(!n(t))throw new Error("Method must be a string");return"get"!==t.toLowerCase()&&null!=e&&(e=n(e)?e:JSON.stringify(e)),e}},{"lodash.isstring":51}],18:[function(t,e){"use strict";function n(t){var e,n=0,i=["accountHolderName","bic","longFormURL","mandateReferenceNumber","maskedIBAN","shortForm"];for(n=0;n-1&&(n=n.split("#")[0]),e=a.makeQueryString({acsUrl:t.acsUrl,pareq:t.pareq,termUrl:t.termUrl+"&three_d_secure_version="+c,md:t.md,parentUrl:n}),this.assetsUrl+"/3ds/"+c+"/html/style_frame?"+e},e.exports=r},{"../shared/receiver":34,"braintree-utilities":26}],28:[function(t,e){"use strict";function n(){}function i(t,e){e=e||{},this.clientToken=e.clientToken,this.container=e.container,this.api=t,this.nonce=null,this._loader=null,this._boundHandleUserClose=r.bind(this._handleUserClose,this)}var r=t("braintree-utilities"),o=t("./authorization_service"),s=t("./loader");i.prototype.verify=function(t,e){if(!r.isFunction(e))throw this.api.sendAnalyticsEvents("3ds.web.no_callback"),new Error("No suitable callback argument was given");r.isFunction(t.onUserClose)&&(this._onUserClose=t.onUserClose),r.isFunction(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,s=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,s)}},i.prototype.startVerification=function(t,e){this.api.lookup3DS(t,r.bind(this.handleLookupResponse(e),this))},i.prototype.handleLookupResponse=function(t){var e=this;return function(n,i){var s;this._onLookupComplete(),n?t(n.error):i.lookup&&i.lookup.acsUrl&&i.lookup.acsUrl.length>0?(e.nonce=i.paymentMethod.nonce,s=new o(this.clientToken.assetsUrl,this.container),s.get(i.lookup,r.bind(this.handleAuthenticationResponse(t),this)),this._detachListeners(),this._attachListeners()):(e.nonce=i.paymentMethod.nonce,t(null,{nonce:e.nonce,verificationDetails:i.threeDSecureInfo}))}},i.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))}},i.prototype._attachListeners=function(){r.addEventListener(window,"message",this._boundHandleUserClose)},i.prototype._detachListeners=function(){r.removeEventListener(window,"message",this._boundHandleUserClose)},i.prototype._createDefaultLoader=function(){this._loader=new s,document.body.appendChild(this._loader.getElement())},i.prototype._removeDefaultLoader=function(){if(this._loader){var t=this._loader.getElement(),e=t.parentNode;e&&e.removeChild(t),this._loader.dispose(),this._loader=null}},i.prototype._handleUserClose=function(t){"user_closed=true"===t.data&&this._onUserClose()},i.prototype._onUserClose=n,i.prototype._onLookupComplete=function(){this._removeDefaultLoader()},e.exports=i},{"./authorization_service":27,"./loader":30,"braintree-utilities":26}],29:[function(t,e){"use strict";var n=t("./client");e.exports={create:function(t,e){var i=new n(t,e);return i}}},{"./client":28}],30:[function(t,e){"use strict";function n(){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._display=null,this._initialize()}var i=t("./loader_display"),r=t("./loader_message"),o=t("./loader_spinner");n.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(";"),n.prototype.getElement=function(){return this._element},n.prototype.dispose=function(){this._display.dispose(),this._display=null,this._element=null},n.prototype._initialize=function(){var t=new o,e=window.SVGElement&&window.SVGAnimateElement&&window.SVGAnimateTransformElement;e||(t=new r("Loading...")),this._display=new i(t),this.getElement().appendChild(this._display.getElement())},e.exports=n},{"./loader_display":31,"./loader_message":32,"./loader_spinner":33}],31:[function(t,e){"use strict";function n(t){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._displayObject=t,this._initialize()}n.prototype._cssDeclarations=["display: table-cell","vertical-align: middle"].join(";"),n.prototype.getElement=function(){return this._element},n.prototype.dispose=function(){this._displayObject.dispose(),this._displayObject=null,this._element=null},n.prototype._initialize=function(){this.getElement().appendChild(this._displayObject.getElement())},e.exports=n},{}],32:[function(t,e){"use strict";function n(t){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._element.innerHTML=t}n.prototype._cssDeclarations=["color: #fff","font-family: Helvetica, sans-serif","font-size: 12px","text-align: center"].join(";"),n.prototype.getElement=function(){return this._element},n.prototype.dispose=function(){this._element=null},e.exports=n},{}],33:[function(t,e){"use strict";function n(){this._element=document.createElement("div"),this._element.style.cssText=this._cssDeclarations,this._element.innerHTML=this._markup}n.prototype._cssDeclarations=["height: 36px","margin-left: auto","margin-right: auto","width: 36px"].join(";"),n.prototype._markup=['',' ',' '," ",""].join(""),n.prototype.getElement=function(){return this._element},n.prototype.dispose=function(){this._element=null},e.exports=n},{}],34:[function(t,e){"use strict";function n(t){this.postMessageReceiver(t),this.hashChangeReceiver(t)}var i=t("braintree-utilities");n.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())},i.addEventListener(window,"message",this.wrappedCallback)},n.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)},n.prototype.stopListening=function(){clearTimeout(this.poll),i.removeEventListener(window,"message",this.wrappedCallback)},e.exports=n},{"braintree-utilities":26}],35:[function(t,e){"use strict";var n,i=Array.prototype.indexOf;n=i?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:n}},{}],36:[function(t,e){"use strict";function n(t){var e,n,i="";for(e=0;en;n++)i=o[n],t>=i.min&&t<=i.max&&(e=i.chars);return e||60}function i(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:i,getMaxCharLength:n}},{}],41:[function(t,e){"use strict";function n(){return"https:"===window.location.protocol}function i(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,o,s=[];for(o in t)if(t.hasOwnProperty(o)){var a=t[o];n=e?e+"["+o+"]":o,"object"==typeof a?s.push(r(a,n)):void 0!==a&&null!==a&&s.push(i(n)+"="+i(a))}return s.join("&")}function o(t){for(var e={},n=t.split("&"),i=0;i-1&&t%1==0&&h>=t}function s(t){return null==t?!0:r(t)&&(u(t)||l(t)||a(t)||n(t)&&c(t.splice))?!t.length:!p(t).length}var a=t("lodash.isarguments"),u=t("lodash.isarray"),c=t("lodash.isfunction"),l=t("lodash.isstring"),p=t("lodash.keys"),h=9007199254740991,d=i("length");e.exports=s},{"lodash.isarguments":45,"lodash.isarray":46,"lodash.isfunction":47,"lodash.isstring":51,"lodash.keys":48}],45:[function(t,e){function n(t){return!!t&&"object"==typeof t}function i(t){return function(e){return null==e?void 0:e[t]}}function r(t){return null!=t&&o(p(t))}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&l>=t}function s(t){return n(t)&&r(t)&&u.call(t,"callee")&&!c.call(t,"callee")}var a=Object.prototype,u=a.hasOwnProperty,c=a.propertyIsEnumerable,l=9007199254740991,p=i("length");e.exports=s},{}],46:[function(t,e){function n(t){return!!t&&"object"==typeof t}function i(t,e){var n=null==t?void 0:t[e];return a(n)?n:void 0}function r(t){return"number"==typeof t&&t>-1&&t%1==0&&y>=t}function o(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:o(t)?m.test(h.call(t)):n(t)&&l.test(t)}var u="[object Array]",c="[object Function]",l=/^\[object .+?Constructor\]$/,p=Object.prototype,h=Function.prototype.toString,d=p.hasOwnProperty,f=p.toString,m=RegExp("^"+h.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=i(Array,"isArray"),y=9007199254740991,b=g||function(t){return n(t)&&r(t.length)&&f.call(t)==u};e.exports=b},{}],47:[function(t,e){function n(t){return i(t)&&s.call(t)==r}function i(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var r="[object Function]",o=Object.prototype,s=o.toString;e.exports=n},{}],48:[function(t,e){function n(t){return function(e){return null==e?void 0:e[t]}}function i(t){return null!=t&&o(y(t))}function r(t,e){return t="number"==typeof t||h.test(t)?+t:-1,e=null==e?g:e,t>-1&&t%1==0&&e>t}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&g>=t}function s(t){for(var e=u(t),n=e.length,i=n&&t.length,s=!!i&&o(i)&&(p(t)||l(t)),a=-1,c=[];++a0;++i=0;i--)r=v[i],r.closed===!0?v=v.slice(i,1):n!==r&&d(r.top,t,e)}function m(t,e){function n(r,o){t(r,o),b.target(e).unsubscribe(i,n)}var i=l();return b.target(e).subscribe(i,n),i}function g(t,e,n){return s(t)?!0:"function"!=typeof e?!0:s(n)?!0:!1}var y,b,v=[],_={},E="/*framebus*/";return c(),b={target:e,include:t,publish:n,pub:n,trigger:n,emit:n,subscribe:i,sub:i,on:i,unsubscribe:r,unsub:r,off:r}})},{}],56:[function(t,e){"use strict";function n(t){return new i(t)}var i=t("./lib/coinbase");e.exports={create:n}},{"./lib/coinbase":59}],57:[function(t,e){(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){e=e||t.navigator.userAgent;var n=null,i=/MSIE.(\d+)/.exec(e);return/Trident/.test(e)&&(n=11),i&&(n=parseInt(i[1],10)),n}function r(e){return e=e||t.navigator.userAgent,/Android/.test(e)?e.replace(/^.* Android ([0-9\.]+).*$/,"$1"):null}e.exports={ieVersion:i,iOSSafariVersion:n,androidVersion:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],58:[function(t,e){"use strict";function n(t,e,n){return t?(n.bus.emit(i.ERROR,t.error),void n._sendAnalyticsEvent("generate.nonce.failed")):(n.bus.emit(i.PAYMENT_METHOD_GENERATED,e),void n._sendAnalyticsEvent("generate.nonce.succeeded"))}var i=t("braintree-bus").events;e.exports={tokenize:n}},{"braintree-bus":67}],59:[function(t,e){(function(n){"use strict";function i(t){return{clientId:t.configuration.coinbase.clientId,redirectUrl:t.configuration.coinbase.redirectUrl,scopes:t.configuration.coinbase.scopes||h.SCOPES,meta:{authorizations_merchant_account:t.configuration.coinbase.merchantAccount||""}}}function r(t){return function(e,n){t.emit(f.events.ERROR,{type:n,message:e})}}function o(t,e){var n=(t||{}).coinbase,i=r(e);if(null==t.apiClient)i("settings.apiClient is required for coinbase",h.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",h.CONFIGURATION_ERROR);else{if(d.isSupportedBrowser())return!0;i("Coinbase is not supported by your browser. Please consider upgrading",h.UNSUPPORTED_BROWSER_ERROR)}else i("Either options.coinbase.container or options.coinbase.button is required for Coinbase integrations",h.CONFIGURATION_ERROR);else i("Coinbase is not enabled for your merchant account",h.CONFIGURATION_ERROR);return!1}function s(t){var e,r;this.destructor=new u,this.channel=t.channel,r={channel:this.channel};try{t.coinbase.container&&(r.merchantUrl=n.location.href)}catch(s){}this.bus=t.bus||new f(r),this.canCreateIntegration=o(t,this.bus),this.canCreateIntegration&&(this.buttonId=t.coinbase.button||h.BUTTON_ID,this.apiClient=t.apiClient,this.assetsUrl=t.configuration.assetsUrl,this.environment=t.configuration.coinbase.environment,this._onOAuthSuccess=a.bind(this._onOAuthSuccess,this),this._handleButtonClick=a.bind(this._handleButtonClick,this),this.popupParams=i(t),this.redirectDoneInterval=null,t.coinbase.container?(e=a.normalizeElement(t.coinbase.container),this._insertFrame(e)):(n.braintreeCoinbasePopupCallback=this._onOAuthSuccess,e=document.body,a.addEventListener(e,"click",this._handleButtonClick),this._sendAnalyticsEvent("initialized"),this.destructor.registerFunctionForTeardown(a.bind(function(){this._closePopup()},this)),this.bus.on(h.TEARDOWN_EVENT,a.bind(this.destructor.teardown,this.destructor))))}var a=t("braintree-utilities"),u=t("destructor"),c=t("./dom/composer"),l=t("./url-composer"),p=t("./callbacks"),h=t("./constants"),d=t("./detector"),f=t("braintree-bus");s.prototype._sendAnalyticsEvent=function(t){var e=this.apiClient.integration+".web.coinbase.";this.apiClient.sendAnalyticsEvents(e+t)},s.prototype._insertFrame=function(t){var e=c.createFrame({channel:this.channel});this.bus.emit(f.events.ASYNC_DEPENDENCY_INITIALIZING),t.appendChild(e),this.destructor.registerFunctionForTeardown(function(){t.removeChild(e)}),setTimeout(a.bind(function(){e.src=this.assetsUrl+"/coinbase/"+h.VERSION+"/coinbase-frame.html#"+this.channel},this),0)},s.prototype._onOAuthSuccess=function(t){return t.code?(this.bus.emit("coinbase:view:navigate","loading"),this._sendAnalyticsEvent("popup.authorized"),this.apiClient.tokenizeCoinbase({code:t.code,query:l.getQueryString()},a.bind(function(t,e){p.tokenize.apply(null,[t,e,this])},this)),void this._closePopup()):(this._sendAnalyticsEvent("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(f.events.UI_POPUP_DID_CLOSE,{source:h.INTEGRATION_NAME})},s.prototype._pollForRedirectDone=function(t){var e=setInterval(a.bind(function(){var e;if(null==t||t.closed)return this._sendAnalyticsEvent("popup.aborted"),void this._popupCleanup();try{if("about:blank"===t.location.href)throw new Error("Not finished loading");e=a.decodeQueryString(t.location.search.replace(/^\?/,"")).code}catch(n){return}this._onOAuthSuccess({code:e})},this),100);return this.redirectDoneInterval=e,e},s.prototype._openPopup=function(){var t;this._sendAnalyticsEvent("popup.started"),t=c.createPopup(l.compose(this._getOAuthBaseUrl(),this.popupParams)),t.focus(),this._pollForRedirectDone(t),this.bus.emit(f.events.UI_POPUP_DID_OPEN,{source:h.INTEGRATION_NAME}),this.bus.on(f.events.UI_POPUP_FORCE_CLOSE,function(e){e.target===h.INTEGRATION_NAME&&t.close()}),this.popup=t},s.prototype._getOAuthBaseUrl=function(){var t;return t="shared_sandbox"===this.environment?h.SANDBOX_OAUTH_BASE_URL:h.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(h.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:{})},{"./callbacks":58,"./constants":60,"./detector":61,"./dom/composer":63,"./url-composer":66,"braintree-bus":67,"braintree-utilities":79,destructor:80}],60:[function(t,e){"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:"0.3.1",INTEGRATION_NAME:"Coinbase",CONFIGURATION_ERROR:"CONFIGURATION",UNSUPPORTED_BROWSER_ERROR:"UNSUPPORTED_BROWSER",TEARDOWN_EVENT:"coinbase:TEARDOWN"}},{}],61:[function(t,e){"use strict";function n(){var t=s.ieVersion();return!t||t>8}function i(){var t=s.androidVersion();return null==t?!1:/^5/.test(t)}function r(){return!(i()||o())}function o(){var t=s.iOSSafariVersion();return null==t?!1:/^8\.0/.test(t)||/^8\.1$/.test(t)}var s=t("./browser");e.exports={isSupportedBrowser:n,shouldCloseFromParent:r,shouldDisplayIOSClose:o,shouldDisplayLollipopClose:i}},{"./browser":57}],62:[function(t,e){"use strict";function n(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:n}},{}],63:[function(t,e){"use strict";var n=t("./popup"),i=t("./button"),r=t("./frame");e.exports={createButton:i.create,createPopup:n.create,createFrame:r.create}},{"./button":62,"./frame":64,"./popup":65}],64:[function(t,e){"use strict";function n(){return r({name:i.FRAME_NAME,height:"70px",width:"100%",style:{padding:0,margin:0,border:0,outline:"none"}})}var i=t("../constants"),r=t("iframer");e.exports={create:n}},{"../constants":60,iframer:83}],65:[function(t,e){(function(n){"use strict";function i(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push([n,t[n]].join("="));return e.join(",")}function r(){var t=850,e=600;return i({width:t,height:e,left:(screen.width-t)/2,top:(screen.height-e)/4})}function o(t){return n.open(t,s.POPUP_NAME,r())}var s=t("../constants");e.exports={create:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../constants":60}],66:[function(t,e){"use strict";function n(){return"version="+r.VERSION}function i(t,e){var i=t+"/oauth/authorize?response_type=code",r=e.redirectUrl+"?"+n();if(i+="&redirect_uri="+encodeURIComponent(r),i+="&client_id="+e.clientId,e.scopes&&(i+="&scope="+encodeURIComponent(e.scopes)),e.meta)for(var o in e.meta)e.meta.hasOwnProperty(o)&&(i+="&meta["+encodeURIComponent(o)+"]="+encodeURIComponent(e.meta[o]));return i}var r=t("./constants");e.exports={compose:i,getQueryString:n}},{"./constants":60}],67:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{"./lib/check-origin":68,"./lib/events":69,dup:52,framebus:70}],68:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53}],69:[function(t,e,n){arguments[4][54][0].apply(n,arguments)},{dup:54}],70:[function(t,e,n){arguments[4][55][0].apply(n,arguments)},{dup:55}],71:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{dup:35}],72:[function(t,e,n){arguments[4][36][0].apply(n,arguments)},{dup:36}],73:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22}],74:[function(t,e,n){arguments[4][38][0].apply(n,arguments)},{dup:38}],75:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],76:[function(t,e,n){arguments[4][40][0].apply(n,arguments)},{dup:40}],77:[function(t,e,n){arguments[4][41][0].apply(n,arguments)},{"./array":71,dup:41}],78:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],79:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"./lib/array":71,"./lib/base64":72,"./lib/dom":73,"./lib/events":74,"./lib/fn":75,"./lib/string":76,"./lib/url":77,"./lib/uuid":78,dup:43}],80:[function(t,e){"use strict";function n(){this._teardownRegistry=[]}var i=t("batch-execute-functions"),r=t("braintree-utilities/lib/fn");n.prototype.registerFunctionForTeardown=function(t){r.isFunction(t)&&this._teardownRegistry.push(t)},n.prototype.teardown=function(t){i(this._teardownRegistry,r.bind(function(e){this._teardownRegistry=[],r.isFunction(t)&&t(e)},this))},e.exports=n},{"batch-execute-functions":81,"braintree-utilities/lib/fn":82}],81:[function(t,e){"use strict";function n(t,e){var n,r=0===t.length;r?(t(),e(null)):(n=i(e),t(n))}function i(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}e.exports=function(t,e){var i=t.length,r=i;if(0===i)return void e(null);for(var o=0;i>o;o++)n(t[o],function(t){return t?void e(t):(r-=1,void(0===r&&e(null)))})}},{}],82:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],83:[function(t,e){"use strict";var n=t("lodash.assign"),i=t("lodash.isstring"),r=t("setattributes"),o=t("./lib/default-attributes");e.exports=function(t){var e=document.createElement("iframe"),s=n({},o,t);return s.style&&!i(s.style)&&(n(e.style,s.style),delete s.style),r(e,s),e.getAttribute("id")||(e.id=e.name),e}},{"./lib/default-attributes":84,"lodash.assign":85,"lodash.isstring":96,setattributes:97}],84:[function(t,e){e.exports={src:"about:blank",frameBorder:0,allowtransparency:!0,scrolling:"no"}},{}],85:[function(t,e){function n(t,e,n){for(var i=-1,r=o(e),s=r.length;++i2?n[s-2]:void 0,u=s>2?n[2]:void 0,c=s>1?n[s-1]:void 0;for("function"==typeof a?(a=i(a,c,5),s-=2):(a="function"==typeof c?c:void 0,s-=a?1:0),u&&r(n[0],n[1],u)&&(a=3>s?void 0:a,s=1);++o-1&&t%1==0&&e>t}function o(t,e,n){if(!a(n))return!1;var o=typeof e;if("number"==o?i(n)&&r(e,n.length):"string"==o&&e in n){var s=n[e];return t===t?t===s:s!==s}return!1}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&c>=t}function a(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var u=/^\d+$/,c=9007199254740991,l=n("length");e.exports=o},{}],91:[function(t,e){function n(t,e){if("function"!=typeof t)throw new TypeError(i);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=0;n--)if(this.handlers[n].type===t&&this.handlers[n].handler===e)return this.handlers.splice(n,1)},n.prototype._namespaceEvent=function(t){return this.channel?["braintree",this.channel,t].join(":"):t},n.Message=function(t,e,n){this.bus=t,this.source=e,this.content=n},n.Message.prototype.reply=function(t,e){this.bus.send(this.source,t,e)},e.exports=n},{"braintree-utilities":206}],193:[function(t,e){"use strict";function n(t,e){this.bus=t,this.target=e,this.handlers=[],this.bus.register("publish",i.bind(this._handleMessage,this))}var i=t("braintree-utilities");n.prototype._handleMessage=function(t){var e,n=t.content,i=this.handlers[n.channel];if("undefined"!=typeof i)for(e=0;er;r++)e(i[r])},e.exports=n},{}],235:[function(t,e){(function(n){"use strict";function i(t,e){var n=window.getComputedStyle?getComputedStyle(t):t.currentStyle;return n[e]}function r(){return{html:{height:a.style.height||"",overflow:i(a,"overflow"),position:i(a,"position")},body:{height:u.style.height||"",overflow:i(u,"overflow")}}}function o(){var t=/Android|iPhone|iPod|iPad/i.test(window.navigator.userAgent);return t}function s(t){var e,i,r;this.channel=t.channel,this.destructor=new p,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=c.configure({clientToken:t.gatewayConfiguration,analyticsConfiguration:this.analyticsConfiguration,integration:"dropin",enableCORS:this.merchantConfiguration.enableCORS}),this.paymentMethodNonceReceivedCallback=t.merchantConfiguration.paymentMethodNonceReceived,this.clientToken=c.parseClientToken(t.gatewayConfiguration),this.braintreeBus=new l({merchantUrl:n.location.href,channel:t.channel}),this.bus=new h.MessageBus(this.root,this.channel),this.rpcServer=new h.RPCServer(this.bus),this.apiProxyServer=new y(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,u=document.body,this.frames={inline:this._createFrame(e,_.INLINE_FRAME_NAME),modal:this._createFrame(i,_.MODAL_FRAME_NAME)},this.container=f(t.merchantConfiguration.container,"Unable to find valid container."),r=f(t.merchantConfiguration.form||this._findClosest(this.container,"form")),this.merchantFormManager=new b({form:r,frames:this.frames,onSubmit:this.paymentMethodNonceReceivedCallback,apiClient:this.braintreeApiClient}).initialize(),this.destructor.registerFunctionForTeardown(m(function(){this.merchantFormManager.teardown()},this)),t.gatewayConfiguration.paypalEnabled&&this._configurePayPal(),this.braintreeApiClient.sendAnalyticsEvents("dropin.web.initialized")}var a,u,c=t("braintree-api"),l=t("braintree-bus"),p=t("destructor"),h=t("braintree-rpc"),d=t("braintree-utilities"),f=d.normalizeElement,m=d.bind,g=d.isBrowserHttps,y=t("./api-proxy-server"),b=t("./merchant-form-manager"),v=t("./frame-container"),_=t("../shared/constants"),E="1.9.1",w=t("braintree-paypal/src/external/views/app-view");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),u.appendChild(this.frames.modal.element),this.destructor.registerFunctionForTeardown(function(t){e._hideModal(function(){e.container.removeChild(e.frames.inline.element),u.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;t0&&n(r,e);return e}function i(t){try{t.attributes.removeNamedItem("name")}catch(e){}}function r(t){n(t)}function o(t){return t.nodeType===s&&t.attributes["data-braintree-name"]}var s=t.Node?t.Node.ELEMENT_NODE:1;e.exports={extractValues:n,scrubAllAttributes:r,scrubAttributes:i,isBraintreeNode:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],241:[function(t,e){(function(n){"use strict";function i(t,e){var i=e.merchantConfiguration,o="object"==typeof i.paymentMethodNonceInputField;this.destructor=new s,this.apiClient=t,this.isCreditCardForm=i.useCreditCard===!1?!1:!0,this.htmlForm=document.getElementById(i.id),this.paymentMethodNonceInput=c(i.paymentMethodNonceInputField),this.htmlForm.appendChild(this.paymentMethodNonceInput),this.destructor.registerFunctionForTeardown(r.bind(function(){o?this.paymentMethodNonceInput.value="":this.htmlForm.removeChild(this.paymentMethodNonceInput)},this)),this.model=new u,this.bus=new a({merchantUrl:n.location.href,channel:e.channel}),this.setEvents(),this.destructor.registerFunctionForTeardown(r.bind(function(){this.bus.teardown()},this))}var r=t("braintree-utilities"),o=t("./fields"),s=t("destructor"),a=t("braintree-bus"),u=t("./models/payment-method-model"),c=t("./get-nonce-input"),l={message:"Unable to process payments at this time",type:"IMMEDIATE"};i.prototype.setEvents=function(){this.onSubmitHandler=r.bind(this.handleSubmit,this),this.onExternalNonceReceived=r.bind(this.onExternalNonceReceived,this),this.clearExternalNonce=r.bind(this.clearExternalNonce,this),r.addEventListener(this.htmlForm,"submit",this.onSubmitHandler),this.destructor.registerFunctionForTeardown(r.bind(function(){r.removeEventListener(this.htmlForm,"submit",this.onSubmitHandler)},this)),this.bus.on(a.events.PAYMENT_METHOD_GENERATED,this.onExternalNonceReceived),this.bus.on(a.events.PAYMENT_METHOD_CANCELLED,this.clearExternalNonce)},i.prototype.handleSubmit=function(t){var e;return t.preventDefault?t.preventDefault():t.returnValue=!1,this.isCreditCardForm?(e=this.model.get("type"),e&&"CreditCard"!==e?(o.scrubAllAttributes(this.htmlForm),void this.onNonceReceived(null,this.model.attributes)):void this.apiClient.tokenizeCard(o.extractValues(this.htmlForm),r.bind(function(t,e,n){t?this.onNonceReceived(l,null):(this.model.set({nonce:e,type:n.type,details:n.details}),this.onNonceReceived(null,this.model.attributes))},this))):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(a.events.ERROR,l):(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:{})},{"./fields":240,"./get-nonce-input":242,"./models/payment-method-model":243,"braintree-bus":246,"braintree-utilities":258,destructor:259}],242:[function(t,e){"use strict";e.exports=function(t){var e;if("object"==typeof t)return t;e="payment_method_nonce","string"==typeof t&&(e=t);var n=document.createElement("input");return n.name=e,n.type="hidden",n}},{}],243:[function(t,e){"use strict";function n(){this.reset()}n.prototype.get=function(t){return this.attributes[t]},n.prototype.set=function(t){this.attributes=t||{}},n.prototype.reset=function(){this.attributes={}},e.exports=n},{}],244:[function(t,e){"use strict";e.exports=function(t){for(var e=t.getElementsByTagName("*"),n={},i=0;in;n++)t.toLowerCase()===e[n].toLowerCase()&&(r=!0);return r}function r(t){return i(t,p.HERMES_SUPPORTED_CURRENCIES)}function o(t){return i(h(t).split("_")[1],p.HERMES_SUPPORTED_COUNTRIES)}function s(t){return t=parseFloat(t),"number"==typeof t&&!isNaN(t)&&t>=0}function a(t,e){return t.paypal.unvettedMerchant&&(!d(t,e)||!t.paypal.payeeEmail)}function u(t,e){return t.paypal.allowHttp?!0:l.isPopupSupported()?!0:"merchantHttps"in e?e.merchantHttps:g.isBrowserHttps()}var c=t("./client"),l=t("../shared/util/browser"),p=t("../shared/constants"),h=t("../shared/get-locale"),d=t("../shared/util/util").isHermesConfiguration,f=t("../shared/util/util").isOneTimeHermesConfiguration,m="1.6.1",g=t("braintree-utilities"),y=t("braintree-api");e.exports={create:n,VERSION:m}},{"../shared/constants":354,"../shared/get-locale":356,"../shared/util/browser":361,"../shared/util/util":363,"./client":343,"braintree-api":281,"braintree-utilities":324}],345:[function(t,e,n){arguments[4][183][0].apply(n,arguments)},{"../../shared/constants":354,"../../shared/util/browser":361,"./modal-view":350,"./popup-view":353,"braintree-bus":312,"braintree-utilities":324,destructor:325,dup:183}],346:[function(t,e){"use strict";function n(t){this.options=t||{},this.el=r({src:this._buildUrl(),name:i.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 i=t("../../shared/constants"),r=t("iframer");n.prototype._buildUrl=function(){var t=this.options.paypalAssetsUrl;return t+="/pwpp/",t+=i.VERSION,t+="/html/bridge-frame.html",t+="#"+this.options.channel},n.prototype.teardown=function(){this.options.container.removeChild(this.el)},e.exports=n},{"../../shared/constants":354,iframer:328}],347:[function(t,e){(function(n){"use strict";function i(t){this.options=t||{},this.wrapper=this.options.container||document.body,this.destructor=new o,this.bus=new s({merchantUrl:n.location.href,channel:t.channel}),this._initialize()}var r=t("braintree-utilities"),o=t("destructor"),s=t("braintree-bus"),a=t("../../shared/util/util"),u=t("../../shared/util/dom"),c=t("../../shared/constants");i.prototype._initialize=function(){var t=r.bind(this._handleClickLogout,this);this._createViewContainer(),this._createPayPalName(),this._createEmailNode(),this._createLogoutNode(),r.addEventListener(this.logoutNode,"click",t),this.destructor.registerFunctionForTeardown(r.bind(function(){r.removeEventListener(this.logoutNode,"click",t)},this)),this.bus.on(s.events.PAYMENT_METHOD_GENERATED,r.bind(this._handlePaymentMethodGenerated,this)),this.bus.on(s.events.PAYMENT_METHOD_CANCELLED,r.bind(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/"+c.VERSION+"/images/paypal-small.png)","background-image: url("+this.options.paypalAssetsUrl+"/pwpp/"+c.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="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){a.preventDefault(t),this.bus.emit(s.events.PAYMENT_METHOD_CANCELLED,{source:c.PAYPAL_INTEGRATION_NAME})},i.prototype._handlePaymentMethodGenerated=function(t){var e;t.type===c.NONCE_TYPE&&(e=t&&t.details&&t.details.email?t.details.email:"",this.show(e))},i.prototype._handlePaymentMethodCancelled=function(t){t.source===c.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:{})},{"../../shared/constants":354,"../../shared/util/dom":362,"../../shared/util/util":363,"braintree-bus":312,"braintree-utilities":324,destructor:325}],348:[function(t,e){(function(n){"use strict";function i(t){this.options=t,this.wrapper=this.options.container||document.body,this.bus=new o({merchantUrl:n.location.href,channel:t.channel}),this._initialize()}var r=t("braintree-utilities"),o=t("braintree-bus"),s=t("../../shared/constants"),a=t("../../shared/get-locale");i.prototype._initialize=function(){this.createViewContainer(),this.options.enablePayPalButton?this.createCheckoutWithPayPalButton():this.createPayWithPayPalButton(),this.bus.on(o.events.PAYMENT_METHOD_GENERATED,r.bind(this._handlePaymentMethodGenerated,this)),this.bus.on(o.events.PAYMENT_METHOD_CANCELLED,r.bind(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:{})},{"../../shared/constants":354,"../../shared/get-locale":356,"braintree-bus":312,"braintree-utilities":324}],349:[function(t,e){(function(n){"use strict";function i(t){this.options=t,this.bus=new s({merchantUrl:n.location.href,channel:t.channel}),this.bus.on(u.events.UI_MODAL_DID_OPEN,a.bind(this.lockWindowSize,this)),this.bus.on(u.events.UI_MODAL_DID_CLOSE,a.bind(this.unlockWindowSize,this))}function r(t){var e=window.getComputedStyle?getComputedStyle(t):t.currentStyle;return{overflow:e.overflow||"",height:t.style.height||""}}function o(){return{html:{node:document.documentElement,styles:r(document.documentElement)},body:{node:document.body,styles:r(document.body)}}}var s=t("braintree-bus"),a=t("braintree-utilities"),u=t("../../shared/constants");i.prototype.lockWindowSize=function(){this.defaultStyles=o(),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===u.PAYPAL_INTEGRATION_NAME&&this.lockWindowSize()},i.prototype._handleUIModalDidClose=function(t){t.source===u.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:{})},{"../../shared/constants":354,"braintree-bus":312,"braintree-utilities":324}],350:[function(t,e,n){arguments[4][184][0].apply(n,arguments)},{"../../shared/constants":354,"../../shared/util/browser":361,"braintree-bus":312,"braintree-utilities":324,dup:184,iframer:328}],351:[function(t,e){(function(n){"use strict";function i(t){this.options=t,this.spriteSrc=this.options.paypalAssetsUrl+"/pwpp/"+a.VERSION+"/images/pp_overlay_sprite.png",this.bus=new s({merchantUrl:n.location.href,channel:t.channel}),this.destructor=new o,this._create(),this._setupEvents(),this.bus.on(s.events.UI_POPUP_DID_OPEN,r.bind(this._handleUIPopupDidOpen,this)),this.bus.on(s.events.UI_POPUP_DID_CLOSE,r.bind(this._handleUIPopupDidClose,this))}var r=t("braintree-utilities"),o=t("destructor"),s=t("braintree-bus"),a=t("../../shared/constants");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===a.PAYPAL_INTEGRATION_NAME&&this.close()},i.prototype._handleUIPopupDidOpen=function(t){t.source===a.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(){var t=document.createElement("div");return this._setStyles(t,["color: #FFF","margin-bottom: 20px"]),t.innerHTML="Don't see the secure PayPal browser? We'll help you re-launch the window to complete your purchase.",t},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="Continue",this.focusLink},i.prototype._setStyles=function(t,e){var n=e.join(";");t.style.cssText=n},i.prototype._setupEvents=function(){var t=r.bind(this._handleClose,this),e=r.bind(this._handleFocus,this);r.addEventListener(this.closeIcon,"click",t),r.addEventListener(this.focusLink,"click",e),this.destructor.registerFunctionForTeardown(r.bind(function(){r.removeEventListener(this.closeIcon,"click",t),r.removeEventListener(this.focusLink,"click",e) },this))},i.prototype._handleClose=function(t){t.preventDefault(),this.close(),r.isFunction(this.options.onClose)&&this.options.onClose()},i.prototype._handleFocus=function(t){t.preventDefault(),r.isFunction(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:{})},{"../../shared/constants":354,"braintree-bus":312,"braintree-utilities":324,destructor:325}],352:[function(t,e){(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 o,this.bus=new s({merchantUrl:n.location.href,channel:t.channel}),this._initialize()}var r=t("braintree-utilities"),o=t("destructor"),s=t("braintree-bus"),a=t("../../shared/constants");i.prototype._initialize=function(){r.isFunction(this.el)||(null!=this.el?(this.el=r.normalizeElement(this.el),this.destructor.registerFunctionForTeardown(r.bind(function(){this.clear()},this))):this.el=this.create()),this.bus.on(s.events.PAYMENT_METHOD_GENERATED,r.bind(this._handlePaymentMethodGenerated,this)),this.bus.on(s.events.PAYMENT_METHOD_CANCELLED,r.bind(this._handlePaymentMethodCancelled,this))},i.prototype.create=function(){var t=document.createElement("input");return t.name="payment_method_nonce",t.type="hidden",this.container.appendChild(t),this.destructor.registerFunctionForTeardown(r.bind(function(){this.container.removeChild(t)},this)),t},i.prototype.value=function(t){r.isFunction(this.el)?this.el(t):this.el.value=t},i.prototype.clear=function(){this.value("")},i.prototype._handlePaymentMethodCancelled=function(t){t.source===a.PAYPAL_INTEGRATION_NAME&&this.clear()},i.prototype._handlePaymentMethodGenerated=function(t){t.type===a.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:{})},{"../../shared/constants":354,"braintree-bus":312,"braintree-utilities":324,destructor:325}],353:[function(t,e,n){arguments[4][185][0].apply(n,arguments)},{"../../shared/constants":354,"../../shared/useragent/browser":357,"braintree-bus":312,dup:185}],354:[function(t,e,n){arguments[4][186][0].apply(n,arguments)},{dup:186}],355:[function(t,e){"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"}},{}],356:[function(t,e){"use strict";function n(t){return-1!==t.indexOf("_")&&5===t.length}function i(t){var e,n;for(e in o)o.hasOwnProperty(e)&&(e===t?n=o[e]:o[e]===t&&(n=o[e]));return n}function r(t){var e,r;return t=t?t.toLowerCase():"us",t=t.replace(/-/g,"_"),e=n(t)?t:i(t),e?(r=e.split("_"),[r[0],r[1].toUpperCase()].join("_")):"en_US"}var o=t("../shared/data/country-code-lookup");e.exports=r},{"../shared/data/country-code-lookup":355}],357:[function(t,e,n){arguments[4][187][0].apply(n,arguments)},{"./platform":359,"./useragent":360,dup:187}],358:[function(t,e,n){arguments[4][188][0].apply(n,arguments)},{"./platform":359,"./useragent":360,dup:188}],359:[function(t,e,n){arguments[4][189][0].apply(n,arguments)},{"./useragent":360,dup:189}],360:[function(t,e,n){arguments[4][190][0].apply(n,arguments)},{dup:190}],361:[function(t,e,n){arguments[4][191][0].apply(n,arguments)},{"../useragent/browser":357,"../useragent/device":358,"../useragent/platform":359,"../useragent/useragent":360,dup:191}],362:[function(t,e){"use strict";function n(t,e){var n="innerText";document&&document.body&&"textContent"in document.body&&(n="textContent"),t[n]=e}e.exports={setTextContent:n}},{}],363:[function(t,e){"use strict";function n(){var t,e,n="";for(t=0;32>t;t++)e=Math.floor(16*Math.random()),n+=e.toString(16);return n}function i(t){return/^(true|1)$/i.test(t)}function r(t){return t.replace(/&/g,"&").replace(//g,">").replace(/\"/g,""").replace(/\'/g,"'")}function o(t){var e,n,i,r,o,s,a,u,c=t.indexOf("?"),l={};if(c>=0&&(t=t.substr(c+1)),0===t.length)return null;for(e=t.split("&"),n=0,i=e.length;i>n;n++)r=e[n],o=r.indexOf("="),s=r.substr(0,o),u=r.substr(o+1),a=decodeURIComponent(u),a=a.replace(//g,">"),"false"===a&&(a=!1),(null==a||"true"===a)&&(a=!0),l[s]=a;return l}function s(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function a(t){return Boolean(t.singleUse)&&Boolean(t.amount)&&Boolean(t.currency)}function u(t){return Boolean(t.paypal.billingAgreementsEnabled)}function c(t,e){return u(t)||a(e)}var l="function"==typeof String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/,"")},p="function"==typeof window.btoa?function(t){return window.btoa(t)}:function(t){for(var e,n,i,r,o,s,a,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",l=0;l>2,o=(3&e)<<4|n>>4,s=(15&n)<<2|i>>6,a=63&i,isNaN(n)?s=a=64:isNaN(i)&&(a=64),c=c+u.charAt(r)+u.charAt(o)+u.charAt(s)+u.charAt(a);return c};e.exports={trim:l,btoa:p,generateUid:n,castToBoolean:i,htmlEscape:r,parseUrlParams:o,preventDefault:s,isOneTimeHermesConfiguration:a,isBillingAgreementsHermesConfiguration:u,isHermesConfiguration:c}},{}],364:[function(t,e,n){arguments[4][35][0].apply(n,arguments)},{dup:35}],365:[function(t,e,n){arguments[4][36][0].apply(n,arguments)},{dup:36}],366:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{dup:22}],367:[function(t,e,n){arguments[4][38][0].apply(n,arguments)},{dup:38}],368:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],369:[function(t,e,n){arguments[4][40][0].apply(n,arguments)},{dup:40}],370:[function(t,e,n){arguments[4][41][0].apply(n,arguments)},{"./array":364,dup:41}],371:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],372:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"./lib/array":364,"./lib/base64":365,"./lib/dom":366,"./lib/events":367,"./lib/fn":368,"./lib/string":369,"./lib/url":370,"./lib/uuid":371,dup:43}],373:[function(t,e,n){arguments[4][80][0].apply(n,arguments)},{"batch-execute-functions":374,"braintree-utilities/lib/fn":375,dup:80}],374:[function(t,e,n){arguments[4][81][0].apply(n,arguments)},{dup:81}],375:[function(t,e,n){arguments[4][39][0].apply(n,arguments)},{dup:39}],376:[function(t,e){(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:{})},{}],377:[function(t,e){var n=t("./lib/external"),i=t("./lib/shared/constants").events,r="1.0.0";e.exports={create:function(t){return new n(t)},events:i,VERSION:r}},{"./lib/external":379,"./lib/shared/constants":381}],378:[function(t,e){var n=t("../shared/constants");e.exports=function(t,e){return t+"/hosted-fields/"+n.VERSION+"/hosted-fields-frame.html#"+e}},{"../shared/constants":381}],379:[function(t,e){"use strict";function n(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 i(t,e){return function(n){var i=t[n.fieldKey].containerElement,r=s(i);n.target={fieldKey:n.fieldKey,container:i},r.toggle(l.externalClasses.FOCUSED,n.isFocused).toggle(l.externalClasses.VALID,n.isValid),n.isStrictlyValidating?r.toggle(l.externalClasses.INVALID,!n.isValid):r.toggle(l.externalClasses.INVALID,!n.isPotentiallyValid),delete n.fieldKey,delete n.isStrictlyValidating,e&&e(n)}}function r(t){var e,r,p,d,f,g,y={},b=0;for(this.injectedNodes=[],this.destructor=new o,this.bus=new u({channel:t.channel,merchantUrl:location.href}),this.destructor.registerFunctionForTeardown(h.bind(function(){this.bus.teardown()},this)),this.bus.emit(u.events.ASYNC_DEPENDENCY_INITIALIZING),this.bus.emit(u.events.SEND_ANALYTICS_EVENTS,"hosted-fields.initialized"),f=0;f=0||o.push.call(this,t);return this._elem.className=this.toString(),this},n.prototype.remove=function(){var t,e,n;for(n=0;nt||o.splice.call(this,t,1);return this._elem.className=this.toString(),this},n.prototype.contains=function(t){return t+="",i(this,t)>=0},n.prototype.toggle=function(t,e){return t+="",e===!0?this.add(t):e===!1?this.remove(t):this[this.contains(t)?"remove":"add"](t)},n.prototype.toString=function(){return o.join.call(this," ")}},{"component-indexof":397,trim:398}],397:[function(t,e){e.exports=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n