>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new s.init(n,e)}},c=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(p.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return p.parse(unescape(encodeURIComponent(t)))}},h=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=c.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,r=n.words,i=n.sigBytes,o=this.blockSize,a=4*o,u=i/a;u=e?t.ceil(u):t.max((0|u)-this._minBufferSize,0);var p=u*o,c=t.min(4*p,i);if(p){for(var h=0;h>>7)^(f<<14|f>>>18)^f>>>3,m=p[d-2],g=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;p[d]=y+p[d-7]+g+p[d-16]}var v=a&c^~a&h,b=r&i^r&o^i&o,w=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),_=(a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25),T=l+_+v+u[d]+p[d],O=w+b;l=h,h=c,c=a,a=s+T|0,s=o,o=i,i=r,r=T+O|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+c|0,n[6]=n[6]+h|0,n[7]=n[7]+l|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[(i+64>>>9<<4)+14]=e.floor(r/4294967296),n[(i+64>>>9<<4)+15]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});n.SHA256=o._createHelper(c),n.HmacSHA256=o._createHmacHelper(c)}(Math),t.SHA256})},function(t,e){function n(){}n.prototype.get=function(){return null},n.prototype.has=function(){return!1},n.prototype.set=function(){},t.exports=n},function(t,e){function n(t){this.name="ConfigurationError",this.message=t||""}function r(t){this.name="TokenValidationError",this.message=t||""}n.prototype=Error.prototype,r.prototype=Error.prototype,t.exports={ConfigurationError:n,TokenValidationError:r}},function(t,e,n){function r(t){var e=s.decodeToHEX(t.n),n=s.decodeToHEX(t.e);return{modulus:e,exp:n}}function i(t,e){var n=o(t.iss,".well-known","jwks.json");return a.get(n).end(function(n,i){var o,s,a=null;for(n&&e(n),o=0;o0&&e.length>0))throw new Error("Invalid key data");this.n=new o(t,16),this.e=parseInt(e,16)}function i(t){for(var e in a){var n=a[e],r=n.length;if(t.substring(0,r)===n)return{alg:e,hash:t.substring(r)}}return[]}var o=n(38).BigInteger,s=n(32),a={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},u={sha256:s};r.prototype.verify=function(t,e){e=e.replace(/[^0-9a-f]|[\s\n]]/gi,"");var n=new o(e,16);if(n.bitLength()>this.n.bitLength())throw new Error("Signature does not match with the key modulus.");var r=n.modPowInt(this.e,this.n),s=r.toString(16).replace(/^1f+00/,""),a=i(s);if(0===a.length)return!1;if(!u.hasOwnProperty(a.alg))throw new Error("Hashing algorithm is not supported.");var p=u[a.alg](t).toString();return a.hash===p},t.exports=r},function(t,e,n){function r(t){var e=t||{};if(this.jwksCache=e.jwksCache||new u,this.expectedAlg=e.expectedAlg||"RS256",this.issuer=e.issuer,this.audience=e.audience,this.leeway=e.leeway||0,this.__disableExpirationCheck=e.__disableExpirationCheck||!1,this.leeway<0||this.leeway>60)throw new a.ConfigurationError("The leeway should be positive and lower than a minute.");if(p.indexOf(this.expectedAlg)===-1)throw new a.ConfigurationError("Algorithm "+this.expectedAlg+" is not supported. (Expected algs: ["+p.join(",")+"])")}var i=n(36),o=n(18),s=n(35),a=n(34),u=n(33),p=["RS256"];r.prototype.verify=function(t,e,n){var r=this.decode(t);if(r instanceof Error)return n(r,!1);var i=r.encoded.header+"."+r.encoded.payload,s=o.decodeToHEX(r.encoded.signature),u=r.header.alg,c=r.header.kid,h=r.payload.aud,l=r.payload.iss,d=r.payload.exp,f=r.payload.nbf,y=r.payload.nonce||null;if(this.issuer!==l)return n(new a.TokenValidationError("Issuer "+l+" is not valid."),!1);if(this.audience!==h)return n(new a.TokenValidationError("Audience "+h+" is not valid."),!1);if(this.expectedAlg!==u)return n(new a.TokenValidationError("Algorithm "+u+" is not supported. (Expected algs: ["+p.join(",")+"])"),!1);if(y!==e)return n(new a.TokenValidationError("Nonce does not match."),!1);var m=this.verifyExpAndNbf(d,f);return m?n(m,!1):this.getRsaVerifier(l,c,function(t,e){return t?n(t):e.verify(i,s)?n(null,r.payload):n(new a.TokenValidationError("Invalid signature."))})},r.prototype.verifyExpAndNbf=function(t,e){var n=new Date,r=new Date(0),i=new Date(0);return this.__disableExpirationCheck?null:(r.setUTCSeconds(t+this.leeway),n>r?new a.TokenValidationError("Expired token."):"undefined"==typeof e?null:(i.setUTCSeconds(e-this.leeway),nr?new a.TokenValidationError("Expired token."):(i.setUTCSeconds(e-this.leeway),n=0;){var s=e*this[t++]+n[r]+i;i=Math.floor(s/67108864),n[r++]=67108863&s}return i}function o(t,e,n,r,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],p=this[t++]>>15,c=a*u+p*s;u=s*u+((32767&c)<<15)+n[r]+(1073741823&i),i=(u>>>30)+(c>>>15)+a*p+(i>>>30),n[r++]=1073741823&u}return i}function s(t,e,n,r,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],p=this[t++]>>14,c=a*u+p*s;u=s*u+((16383&c)<<14)+n[r]+i,i=(u>>28)+(c>>14)+a*p,n[r++]=268435455&u}return i}function a(t){return me.charAt(t)}function u(t,e){var n=ge[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 c(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function h(t){var e=r();return e.fromInt(t),e}function l(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var i=t.length,o=!1,s=0;--i>=0;){var a=8==r?255&t[i]:u(t,i);a<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+r>this.DB?(this[this.t-1]|=(a&(1<>this.DB-s):this[this.t-1]|=a<=this.DB&&(s-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t}function f(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,r=(1<0)for(u>u)>0&&(i=!0,o=a(n));s>=0;)u>(u+=this.DB-e)):(n=this[s]>>(u-=e)&r,u<=0&&(u+=this.DB,--s)),n>0&&(i=!0),i&&(o+=a(n));return i?o:"0"}function y(){var t=r();return n.ZERO.subTo(this,t),t}function m(){return this.s<0?this.negate():this}function g(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 v(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 b(){return this.t<=0?0:this.DB*(this.t-1)+v(this[this.t-1]^this.s&this.DM)}function w(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];
11 | for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s}function _(t,e){for(var n=t;n=0;--n)e[n+s+1]=this[n]>>i|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 O(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)return void(e.t=0);var r=t%this.DB,i=this.DB-r,o=(1<>r;for(var s=n+1;s>r;r>0&&(e[this.t-n-1]|=(this.s&o)<>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()}function x(t,e){var r=this.abs(),i=t.abs(),o=r.t;for(e.t=o+i.t;--o>=0;)e[o]=0;for(o=0;o=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 D(t,e,i){var o=t.abs();if(!(o.t<=0)){var s=this.abs();if(s.t0?(o.lShiftTo(c,a),s.lShiftTo(c,i)):(o.copyTo(a),s.copyTo(i));var h=a.t,l=a[h-1];if(0!=l){var d=l*(1<1?a[h-2]>>this.F2:0),f=this.FV/d,y=(1<=0&&(i[i.t++]=1,i.subTo(w,i)),n.ONE.dlShiftTo(h,w),w.subTo(a,a);a.t=0;){var _=i[--g]==l?this.DM:Math.floor(i[g]*f+(i[g-1]+m)*y);if((i[g]+=a.am(0,_,i,b,0,h))<_)for(a.dlShiftTo(b,w),i.subTo(w,i);i[g]<--_;)i.subTo(w,i)}null!=e&&(i.drShiftTo(h,e),u!=p&&n.ZERO.subTo(e,e)),i.t=h,i.clamp(),c>0&&i.rShiftTo(c,i),u<0&&n.ZERO.subTo(i,i)}}}function A(t){var e=r();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(n.ZERO)>0&&t.subTo(e,e),e}function S(t){this.m=t}function E(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function q(t){return t}function j(t){t.divRemTo(this.m,null,t)}function I(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function R(t,e){t.squareTo(e),this.reduce(e)}function M(){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 U(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 P(t){var e=r();return t.copyTo(e),this.reduce(e),e}function L(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,r,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 H(t,e){t.squareTo(e),this.reduce(e)}function N(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function V(){return 0==(this.t>0?1&this[0]:this.s)}function W(t,e){if(t>4294967295||t<1)return n.ONE;var i=r(),o=r(),s=e.convert(this),a=v(t)-1;for(s.copyTo(i);--a>=0;)if(e.sqrTo(i,o),(t&1<0)e.mulTo(o,s,i);else{var u=i;i=o,o=u}return e.revert(i)}function z(t,e){var n;return n=t<256||e.isEven()?new S(e):new U(e),this.exp(t,n)}function F(){var t=r();return this.copyTo(t),t}function J(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function $(){return 0==this.t?this.s:this[0]<<16>>16}function Z(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function K(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function G(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),i=h(n),o=r(),s=r(),a="";for(this.divRemTo(i,o,s);o.signum()>0;)a=(n+s.intValue()).toString(t).substr(1)+a,o.divRemTo(i,o,s);return s.intValue().toString(t)+a}function Q(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),i=Math.pow(e,r),o=!1,s=0,a=0,p=0;p=r&&(this.dMultiply(i),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),o&&n.ZERO.subTo(this,this)}function Y(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(n.ONE.shiftLeft(t-1),at,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(n.ONE.shiftLeft(t-1),this);else{var i=new Array,o=7&t;i.length=(t>>3)+1,e.nextBytes(i),o>0?i[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<=0;)r<8?(n=(this[t]&(1<>(r+=this.DB-8)):(n=this[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function et(t){return 0==this.compareTo(t)}function nt(t){return this.compareTo(t)<0?this:t}function rt(t){return this.compareTo(t)>0?this:t}function it(t,e,n){var r,i,o=Math.min(t.t,this.t);for(r=0;r>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function gt(){for(var t=0;t=this.t?0!=this.s:0!=(this[e]&1<>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e[n++]=r:r<-1&&(e[n++]=this.DV+r),e.t=n,e.clamp()}function Ct(t){var e=r();return this.addTo(t,e),e}function Dt(t){var e=r();return this.subTo(t,e),e}function At(t){var e=r();return this.multiplyTo(t,e),e}function St(){var t=r();return this.squareTo(t),t}function Et(t){var e=r();return this.divRemTo(t,e,null),e}function qt(t){var e=r();return this.divRemTo(t,null,e),e}function jt(t){var e=r(),n=r();return this.divRemTo(t,e,n),new Array(e,n)}function It(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Rt(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}function Mt(){}function Ut(t){return t}function Bt(t,e,n){t.multiplyTo(e,n)}function Pt(t,e){t.squareTo(e)}function Lt(t){return this.exp(t,new Mt)}function Ht(t,e,n){var r=Math.min(this.t+t.t,e);for(n.s=0,n.t=r;r>0;)n[--r]=0;var i;for(i=n.t-this.t;r=0;)n[r]=0;for(r=Math.max(e-this.t,0);r2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=r();return t.copyTo(e),this.reduce(e),e}function zt(t){return t}function Ft(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function Jt(t,e){t.squareTo(e),this.reduce(e)}function Xt(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function $t(t,e){var n,i,o=t.bitLength(),s=h(1);if(o<=0)return s;n=o<18?1:o<48?3:o<144?4:o<768?5:6,i=o<8?new S(e):e.isEven()?new Vt(e):new U(e);var a=new Array,u=3,p=n-1,c=(1<1){var l=r();for(i.sqrTo(a[1],l);u<=c;)a[u]=r(),i.mulTo(l,a[u-2],a[u]),u+=2}var d,f,y=t.t-1,m=!0,g=r();for(o=v(t[y])-1;y>=0;){for(o>=p?d=t[y]>>o-p&c:(d=(t[y]&(1<0&&(d|=t[y-1]>>this.DB+o-p)),u=n;0==(1&d);)d>>=1,--u;if((o-=u)<0&&(o+=this.DB,--y),m)a[d].copyTo(s),m=!1;else{for(;u>1;)i.sqrTo(s,g),i.sqrTo(g,s),u-=2;u>0?i.sqrTo(s,g):(f=s,s=g,g=f),i.mulTo(g,a[d],s)}for(;y>=0&&0==(t[y]&1<0&&(e.rShiftTo(o,e),n.rShiftTo(o,n));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n}function Kt(t){if(t<=0)return 0;var e=this.DV%t,n=this.s<0?t-1:0;if(this.t>0)if(0==e)n=this[0]%t;else for(var r=this.t-1;r>=0;--r)n=(e*n+this[r])%t;return n}function Gt(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return n.ZERO;for(var r=t.clone(),i=this.clone(),o=h(1),s=h(0),a=h(0),u=h(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),e?(o.isEven()&&s.isEven()||(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;i.isEven();)i.rShiftTo(1,i),e?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(t,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);r.compareTo(i)>=0?(r.subTo(i,r),e&&o.subTo(a,o),s.subTo(u,s)):(i.subTo(r,i),e&&a.subTo(o,a),u.subTo(s,u))}return 0!=i.compareTo(n.ONE)?n.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u}function Qt(t){var e,n=this.abs();if(1==n.t&&n[0]<=ve[ve.length-1]){for(e=0;e>1,t>ve.length&&(t=ve.length);for(var s=r(),a=0;a>8&255,_e[Te++]^=t>>16&255,_e[Te++]^=t>>24&255,Te>=Ce&&(Te-=Ce)}function ee(){te((new Date).getTime())}function ne(){if(null==we){for(ee(),we=ue(),we.init(_e),Te=0;Te<_e.length;++Te)_e[Te]=0;Te=0}return we.next()}function re(t){var e;for(e=0;e>>8,_e[Te++]=255&Oe;Te=0,ee()}ie.prototype.nextBytes=re,oe.prototype.init=se,oe.prototype.next=ae;var Ce=256;n.SecureRandom=ie,n.BigInteger=n,e=t.exports=n}).call(this)},function(t,e){function n(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach(function(t){n.prototype[t]=function(){return this._defaults.push({fn:t,arguments:arguments}),this}}),n.prototype._setDefaults=function(t){this._defaults.forEach(function(e){t[e.fn].apply(t,e.arguments)})},t.exports=n},function(t,e,n){"use strict";function r(t){if(t)return i(t)}function i(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}var o=n(20);t.exports=r,r.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,this},r.prototype.parse=function(t){return this._parser=t,this},r.prototype.responseType=function(t){return this._responseType=t,this},r.prototype.serialize=function(t){return this._serializer=t,this},r.prototype.timeout=function(t){if(!t||"object"!=typeof t)return this._timeout=t,this._responseTimeout=0,this;for(var e in t)switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;default:console.warn("Unknown timeout option",e)}return this},r.prototype.retry=function(t,e){return 0!==arguments.length&&t!==!0||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};var s=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];r.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var n=this._retryCallback(t,e);if(n===!0)return!0;if(n===!1)return!1}catch(t){console.error(t)}if(e&&e.status&&e.status>=500&&501!=e.status)return!0;if(t){if(t.code&&~s.indexOf(t.code))return!0;if(t.timeout&&"ECONNABORTED"==t.code)return!0;if(t.crossDomain)return!0}return!1},r.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},r.prototype.then=function(t,e){if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(t,e){n.end(function(n,r){n?e(n):t(r)})})}return this._fullfilledPromise.then(t,e)},r.prototype.catch=function(t){return this.then(void 0,t)},r.prototype.use=function(t){return t(this),this},r.prototype.ok=function(t){if("function"!=typeof t)throw Error("Callback required");return this._okCallback=t,this},r.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},r.prototype.get=function(t){return this._header[t.toLowerCase()]},r.prototype.getHeader=r.prototype.get,r.prototype.set=function(t,e){if(o(t)){for(var n in t)this.set(n,t[n]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},r.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},r.prototype.field=function(t,e){if(null===t||void 0===t)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),o(t)){for(var n in t)this.field(n,t[n]);return this}if(Array.isArray(e)){for(var r in e)this.field(t,e[r]);return this}if(null===e||void 0===e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=""+e),this._getFormData().append(t,e),this},r.prototype.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},r.prototype._auth=function(t,e,n,r){switch(n.type){case"basic":this.set("Authorization","Basic "+r(t+":"+e));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer "+t)}return this},r.prototype.withCredentials=function(t){return void 0==t&&(t=!0),this._withCredentials=t,this},r.prototype.redirects=function(t){return this._maxRedirects=t,this},r.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw TypeError("Invalid argument");return this._maxResponseSize=t,this},r.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},r.prototype.send=function(t){var e=o(t),n=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(e&&o(this._data))for(var r in t)this._data[r]=t[r];else"string"==typeof t?(n||this.type("form"),n=this._header["content-type"],"application/x-www-form-urlencoded"==n?this._data=this._data?this._data+"&"+t:t:this._data=(this._data||"")+t):this._data=t;return!e||this._isHost(t)?this:(n||this.type("json"),this)},r.prototype.sortQuery=function(t){return this._sort="undefined"==typeof t||t,this},r.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var n=this.url.substring(e+1).split("&");"function"==typeof this._sort?n.sort(this._sort):n.sort(),this.url=this.url.substring(0,e)+"?"+n.join("&")}}},r.prototype._appendQueryString=function(){console.trace("Unsupported")},r.prototype._timeoutError=function(t,e,n){if(!this._aborted){var r=new Error(t+e+"ms exceeded");r.timeout=e,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.abort(),this.callback(r)}},r.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},function(t,e,n){"use strict";function r(t){if(t)return i(t)}function i(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}var o=n(42);t.exports=r,r.prototype.get=function(t){return this.header[t.toLowerCase()]},r.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=o.type(e);var n=o.params(e);for(var r in n)this[r]=n[r];this.links={};try{t.link&&(this.links=o.parseLinks(t.link))}catch(t){}},r.prototype._setStatusProperties=function(t){var e=t/100|0;this.status=this.statusCode=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.redirect=3==e,this.clientError=4==e,this.serverError=5==e,this.error=(4==e||5==e)&&this.toError(),this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.forbidden=403==t,this.notFound=404==t}},function(t,e){"use strict";e.type=function(t){return t.split(/ *; */).shift()},e.params=function(t){return t.split(/ *; */).reduce(function(t,e){var n=e.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(t[r]=i),t},{})},e.parseLinks=function(t){return t.split(/ *, */).reduce(function(t,e){var n=e.split(/ *; */),r=n[0].slice(1,-1),i=n[1].split(/ *= */)[1].slice(1,-1);return t[i]=r,t},{})},e.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&(delete t.authorization,delete t.cookie),t}},,,,function(t,e,n){function r(t,e){this.baseOptions=e,this.request=t}var i=n(3),o=n(1),s=n(4),a=n(5);r.prototype.signup=function(t,e){var n,r,u;return s.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},email:{type:"string",message:"email option is required"},password:{type:"string",message:"password option is required"}}),s.check(e,{type:"function",message:"cb parameter is not valid"}),n=i(this.baseOptions.rootUrl,"dbconnections","signup"),r=o.merge(this.baseOptions,["clientID"]).with(t),u=r.user_metadata||r.userMetadata,r=o.blacklist(r,["scope","userMetadata","user_metadata"]),r=o.toSnakeCase(r,["auth0Client"]),u&&(r.user_metadata=u),this.request.post(n).send(r).end(a(e))},r.prototype.changePassword=function(t,e){var n,r;return s.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},email:{type:"string",message:"email option is required"}}),s.check(e,{type:"function",message:"cb parameter is not valid"}),n=i(this.baseOptions.rootUrl,"dbconnections","change_password"),r=o.merge(this.baseOptions,["clientID"]).with(t,["email","connection"]),r=o.toSnakeCase(r,["auth0Client"]),this.request.post(n).send(r).end(a(e))},t.exports=r},function(t,e,n){function r(t,e){this.baseOptions=e,this.request=t}var i=n(3),o=n(1),s=n(4),a=n(6),u=n(5);r.prototype.buildVerifyUrl=function(t){var e,n;return s.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},verificationCode:{type:"string",message:"verificationCode option is required"},phoneNumber:{optional:!1,type:"string",message:"phoneNumber option is required",condition:function(t){return!t.email}},email:{optional:!1,type:"string",message:"email option is required",condition:function(t){return!t.phoneNumber}}}),e=o.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","protocol","nonce"]).with(t),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e=o.toSnakeCase(e,["auth0Client"]),n=a.stringify(e),i(this.baseOptions.rootUrl,"passwordless","verify_redirect","?"+n)},r.prototype.start=function(t,e){var n,r;return s.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},send:{type:"string",message:"send option is required",values:["link","code"],value_message:"send is not valid ([link, code])"},phoneNumber:{optional:!0,type:"string",message:"phoneNumber option is required",condition:function(t){return"code"===t.send||!t.email}},email:{optional:!0,type:"string",message:"email option is required",condition:function(t){return"link"===t.send||!t.phoneNumber}},authParams:{optional:!0,type:"object",message:"authParams option is required"}}),s.check(e,{type:"function",message:"cb parameter is not valid"}),n=i(this.baseOptions.rootUrl,"passwordless","start"),r=o.merge(this.baseOptions,["clientID","responseType","redirectUri","scope"]).with(t),r.scope&&(r.authParams=r.authParams||{},r.authParams.scope=r.scope),r.redirectUri&&(r.authParams=r.authParams||{},r.authParams.redirect_uri=r.redirectUri),r.responseType&&(r.authParams=r.authParams||{},r.authParams.response_type=r.responseType),delete r.redirectUri,delete r.responseType,delete r.scope,r=o.toSnakeCase(r,["auth0Client","authParams"]),this.request.post(n).send(r).end(u(e))},r.prototype.verify=function(t,e){var n,r;return s.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},verificationCode:{type:"string",message:"verificationCode option is required"},phoneNumber:{optional:!1,type:"string",message:"phoneNumber option is required",condition:function(t){return!t.email}},email:{optional:!1,type:"string",message:"email option is required",condition:function(t){return!t.phoneNumber}}}),s.check(e,{type:"function",message:"cb parameter is not valid"}),r=o.pick(t,["connection","verificationCode","phoneNumber","email","auth0Client"]),r=o.toSnakeCase(r,["auth0Client"]),n=i(this.baseOptions.rootUrl,"passwordless","verify"),this.request.post(n).send(r).end(u(e))},t.exports=r},function(t,e,n){function r(t,e,n){var r,i;if(void 0===s.getDocument().cookie||null===s.getDocument().cookie)throw new Error("cookie storage not available");if(n){var o=24*n*60*60*1e3;r=new Date,r.setTime(r.getTime()+o),i="; expires="+r.toGMTString()}else i="";s.getDocument().cookie=t+"="+a.encode(e)+i+"; path=/"}function i(t){var e,n,r,i=t+"=";if(void 0===s.getDocument().cookie||null===s.getDocument().cookie)throw new Error("cookie storage not available");for(r=s.getDocument().cookie.split(";"),e=0;e0&&t.warning("Following parameters are not allowed on the `/authorize` endpoint: ["+n.join(",")+"]"),e}function i(t,e){return o.pick(e,s)}var o=n(1),s=["realm","audience","client_id","client_secret","redirect_uri","scope","code","grant_type","username","password","refresh_token","assertion","client_assertion","client_assertion_type","code_verifier"],a=["connection","connection_scope","auth0Client","owp","device","realm","protocol","_csrf","_intstate","login_ticket","client_id","response_type","response_mode","redirect_uri","audience","scope","state","nonce","display","prompt","max_age","ui_locales","claims_locales","id_token_hint","login_hint","acr_values","claims","registration","request","request_uri","code_challenge","code_challenge_method"];t.exports={oauthTokenParams:i,oauthAuthorizeParams:r}},function(t,e,n){function r(t,e){this.plugins=e;for(var n=0;n 0,
43 | hint: $.mage.__("This is a required field.")
44 | };
45 | }
46 | },
47 | {
48 | name: "lastname",
49 | placeholder: $.mage.__("Last Name"),
50 | validator: function (firstname) {
51 | return {
52 | valid: firstname.length > 0,
53 | hint: $.mage.__("This is a required field.")
54 | };
55 | }
56 | }
57 | ],
58 | auth: {
59 | redirectUrl: this.options.redirectUrl,
60 | responseType: 'code',
61 | params: {
62 | state: this.options.state,
63 | scope: 'openid' // Learn about scopes: https://auth0.com/docs/scopes
64 | }
65 | },
66 | allowLogin: this.options.allowLogin,
67 | allowSignUp: this.options.allowSignUp,
68 | allowForgotPassword: this.options.allowForgotPassword
69 | }
70 | );
71 |
72 | $(this.element).click(function (e) {
73 | e.preventDefault();
74 | this.lock.show();
75 | }.bind(this));
76 | }
77 | });
78 |
79 | return $.magefox.auth0;
80 | });
81 |
--------------------------------------------------------------------------------