1(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-vendors~bfebd808"],{"1f3a":function(e,t,n){"use strict";(function(e){n.d(t,"c",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return y}));var r=[{type:"text/plain",ext:"txt"},{type:"text/html",ext:"html"},{type:"text/javascript",ext:"js"},{type:"text/css",ext:"css"},{type:"text/csv",ext:"csv"},{type:"text/yaml",ext:"yml"},{type:"text/yaml",ext:"yaml"},{type:"text/calendar",ext:"ics"},{type:"text/calendar",ext:"ical"},{type:"image/apng",ext:"apng"},{type:"image/bmp",ext:"bmp"},{type:"image/gif",ext:"gif"},{type:"image/x-icon",ext:"ico"},{type:"image/x-icon",ext:"cur"},{type:"image/jpeg",ext:"jpg"},{type:"image/jpeg",ext:"jpeg"},{type:"image/jpeg",ext:"jfif"},{type:"image/jpeg",ext:"pjp"},{type:"image/jpeg",ext:"pjpeg"},{type:"image/png",ext:"png"},{type:"image/svg+xml",ext:"svg"},{type:"image/tiff",ext:"tif"},{type:"image/tiff",ext:"tiff"},{type:"image/webp",ext:"webp"},{type:"application/json",ext:"json"},{type:"application/xml",ext:"xml"},{type:"application/x-sh",ext:"sh"},{type:"application/zip",ext:"zip"},{type:"application/x-rar-compressed",ext:"rar"},{type:"application/x-tar",ext:"tar"},{type:"application/x-bzip",ext:"bz"},{type:"application/x-bzip2",ext:"bz2"},{type:"application/pdf",ext:"pdf"},{type:"application/java-archive",ext:"jar"},{type:"application/msword",ext:"doc"},{type:"application/vnd.ms-excel",ext:"xls"},{type:"application/vnd.ms-excel",ext:"xlsx"},{type:"message/rfc822",ext:"eml"}],i=function(e){return void 0===e&&(e={}),0===Object.keys(e).length},o=function(e,t,n){if(!e||!e.sort)return!1;var r=n&&"desc"===n?-1:1;return e.sort((function(e,n){var i=e[t],o=n[t];return"undefined"===typeof o?"undefined"===typeof i?0:1*r:"undefined"===typeof i||i<o?-1*r:i>o?1*r:0})),!0},s=function(e,t){var n=Object.assign({},e);return t&&("string"===typeof t?delete n[t]:t.forEach((function(e){delete n[e]}))),n},a=function(e,t){void 0===t&&(t="application/octet-stream");var n=e.toLowerCase(),i=r.filter((function(e){return n.endsWith("."+e.ext)}));return i.length>0?i[0].type:t},u=function(e){var t=e.toLowerCase();return!!t.startsWith("text/")||("application/json"===t||"application/xml"===t||"application/sh"===t)},c=function(){for(var e="",t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=32;n>0;n-=1)e+=t[Math.floor(Math.random()*t.length)];return e},l=function(e){if(e.isResolved)return e;var t=!0,n=!1,r=!1,i=e.then((function(e){return r=!0,t=!1,e}),(function(e){throw n=!0,t=!1,e}));return i.isFullfilled=function(){return r},i.isPending=function(){return t},i.isRejected=function(){return n},i},f=function(){if("undefined"===typeof self)return!1;var e=self;return"undefined"!==typeof e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope},d=function(){var t="undefined"!==typeof window&&"undefined"!==typeof window.document,n="undefined"!==typeof e&&null!=e.versions&&null!=e.versions.node;return{isBrowser:t,isNode:n}},h=function(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=[]),!g(e))return e;var r={};for(var i in e)if(e.hasOwnProperty(i)){var o=t.includes(i)?i:i[0].toLowerCase()+i.slice(1);r[o]=n.includes(i)?e[i]:h(e[i],t,n)}return r},p=function(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=[]),!g(e))return e;var r={};for(var i in e)if(e.hasOwnProperty(i)){var o=t.includes(i)?i:i[0].toUpperCase()+i.slice(1);r[o]=n.includes(i)?e[i]:p(e[i],t,n)}return r},g=function(e){return e instanceof Object&&!(e instanceof Array)&&!(e instanceof Function)&&!(e instanceof Number)&&!(e instanceof String)&&!(e instanceof Boolean)},y=function(){function e(){}return e.isEmpty=i,e.sortByField=o,e.objectLessAttributes=s,e.filenameToContentType=a,e.isTextFile=u,e.generateRandomString=c,e.makeQuerablePromise=l,e.isWebWorker=f,e.browserOrNode=d,e.transferKeyToLowerCase=h,e.transferKeyToUpperCase=p,e.isStrictObject=g,e}()}).call(this,n("4362"))},2126:function(e,t,n){(function(t,r){e.exports=r(n("b692"))})(0,(function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=t.enc;i.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],o=0;o<n;o+=3)for(var s=t[o>>>2]>>>24-o%4*8&255,a=t[o+1>>>2]>>>24-(o+1)%4*8&255,u=t[o+2>>>2]>>>24-(o+2)%4*8&255,c=s<<16|a<<8|u,l=0;l<4&&o+.75*l<n;l++)i.push(r.charAt(c>>>6*(3-l)&63));var f=r.charAt(64);if(f)while(i.length%4)i.push(f);return i.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i<n.length;
1i++)r[n.charCodeAt(i)]=i}var s=n.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return o(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function o(e,t,n){for(var i=[],o=0,s=0;s<t;s++)if(s%4){var a=n[e.charCodeAt(s-1)]<<s%4*2,u=n[e.charCodeAt(s)]>>>6-s%4*2;i[o>>>2]|=(a|u)<<24-o%4*8,o++}return r.create(i,o)}}(),e.enc.Base64}))},"36de":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{while((void 0===t||t-- >0)&&!(r=o.next()).done)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return s},i=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e},o={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5},s=function(){function e(e,t){void 0===t&&(t="WARN"),this.name=e,this.level=t}return e.prototype._padding=function(e){return e<10?"0"+e:""+e},e.prototype._ts=function(){var e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()},e.prototype._log=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this.level;e.LOG_LEVEL&&(i=e.LOG_LEVEL),"undefined"!==typeof window&&window.LOG_LEVEL&&(i=window.LOG_LEVEL);var s=o[i],a=o[t];if(a>=s){var u=console.log.bind(console);"ERROR"===t&&console.error&&(u=console.error.bind(console)),"WARN"===t&&console.warn&&(u=console.warn.bind(console));var c="["+t+"] "+this._ts()+" "+this.name;if(1===n.length&&"string"===typeof n[0])u(c+" - "+n[0]);else if(1===n.length)u(c,n[0]);else if("string"===typeof n[0]){var l=n.slice(1);1===l.length&&(l=l[0]),u(c+" - "+n[0],l)}else u(c,n)}},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,i(["INFO"],e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,i(["INFO"],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,i(["WARN"],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,i(["ERROR"],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,i(["DEBUG"],e))},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,i(["VERBOSE"],e))},e.LOG_LEVEL=null,e}()},"7d03":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n("36de"),i=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{while((void 0===t||t-- >0)&&!(r=o.next()).done)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return s},o=new r["a"]("Amplify"),s=function(){function e(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Logger=r["a"],this.ServiceWorker=null}return e.prototype.register=function(e){o.debug("component registered in amplify",e),this._components.push(e),"function"===typeof e.getModuleName?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):o.debug("no getModuleName method for component",e),e.configure(this._config)},e.prototype.configure=function(e){var t=this;return e?(this._config=Object.assign(this._config,e),o.debug("amplify config",this._config),Object.entries(this._modules).forEach((function(e){var n=i(e,2),r=(n[0],n[1]);Object.keys(r).forEach((function(e){t._modules[e]&&(r[e]=t._modules[e])}))})),this._components.map((function(e){e.configure(t._config)})),this._config):this._config},e.prototype.addPluggable=function(e){e&&e["getCategory"]&&"function"===typeof e["getCategory"]&&this._components.map((function(t){t["addPluggable"]&&"function"===typeof t["addPluggable"]&&t.addPluggable(e)}))},e}(),a=new s},a5e6:function(e,t,n){(function(t,r){e.exports=r(n("b692"))})(0,(function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,o=r.Hasher,s=n.algo,a=[],u=[];(function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}
1var r=2,i=0;while(i<64)e(r)&&(i<8&&(a[i]=n(t.pow(r,.5))),u[i]=n(t.pow(r,1/3)),i++),r++})();var c=[],l=s.SHA256=o.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],f=n[6],d=n[7],h=0;h<64;h++){if(h<16)c[h]=0|e[t+h];else{var p=c[h-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,y=c[h-2],m=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;c[h]=g+c[h-7]+m+c[h-16]}var b=a&l^~a&f,v=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),I=d+_+b+u[h]+c[h],P=w+v;d=f,f=l,l=a,a=s+I|0,s=o,o=i,i=r,r=I+P|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]+l|0,n[6]=n[6]+f|0,n[7]=n[7]+d|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=o._createHelper(l),n.HmacSHA256=o._createHmacHelper(l)}(Math),e.SHA256}))},b692:function(e,t,n){(function(t,n){e.exports=n()})(0,(function(){var e=e||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),r={},i=r.lib={},o=i.Base=function(){return{extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=i.WordArray=o.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var s=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=s<<24-(r+o)%4*8}else for(o=0;o<i;o+=4)t[r+o>>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,r=[],i=function(t){t=t;var n=987654321,r=4294967295;return function(){n=36969*(65535&n)+(n>>16)&r,t=18e3*(65535&t)+(t>>16)&r;var i=(n<<16)+t&r;return i/=4294967296,i+=.5,i*(e.random()>.5?1:-1)}},o=0;o<t;o+=4){var a=i(4294967296*(n||e.random()));n=987654071*a(),r.push(4294967296*a()|0)}return new s.init(r,t)}}),a=r.enc={},u=a.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new s.init(n,t/2)}},c=a.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new s.init(n,t)}},l=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},f=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,o=this.blockSize,a=4*o,u=i/a;u=t?e.ceil(u):e.max((0|u)-this._minBufferSize,0);var c=u*o,l=e.min(4*c,i);if(c){for(var f=0;f<c;f+=o)this._doProcessBlock(r,f);var d=r.splice(0,c);n.sigBytes-=l}return new s.init(d,l)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),d=(i.Hasher=f.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){e&&this._append(e);var t=this._doFinalize();return t},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new d.HMAC.init(e,n).finalize(t)}}}),r.algo={});return r}(Math);return e}))},bf82:function(e,t,n){"use strict";var r,i;function o(e){var t=["provider"];return e&&!!t.find((function(t){return e.hasOwnProperty(t)}))}function s(e){var t=["customProvider"];return e&&!!t.find((function(t){return e.hasOwnProperty(t)}))}function a(e){var t=["customState"];return e&&!!t.find((function(t){return e.hasOwnProperty(t)}))}function u(e){return void 0!==e.redirectSignIn}function c(e){return!!e.username}n.d(t,"a",(function(){return tt})),function(e){e["Cognito"]="COGNITO",e["Google"]="Google",e["Facebook"]="Facebook",e["Amazon"]="LoginWithAmazon",e["Apple"]="SignInWithApple"}(r||(r={})),function(e){e["NoConfig"]="noConfig",e["MissingAuthConfig"]="missingAuthConfig",e["EmptyUsername"]="emptyUsername",e["InvalidUsername"]="invalidUsername",e["EmptyPassword"]="emptyPassword",e["EmptyCode"]="emptyCode",e["SignUpError"]="signUpError",e["NoMFA"]="noMFA",e["InvalidMFA"]="invalidMFA",e["EmptyC
1hallengeResponse"]="emptyChallengeResponse",e["NoUserSession"]="noUserSession",e["Default"]="default"}(i||(i={}));var l=n("36de"),f=function(){return f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},f.apply(this,arguments)},d=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{while((void 0===t||t-- >0)&&!(r=o.next()).done)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return s},h=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(d(arguments[t]));return e},p=new l["a"]("Hub"),g="undefined"!==typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default";function y(e){return void 0!==e.onHubCapsule}var m=function(){function e(e){this.listeners=[],this.patterns=[],this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","xr"],this.name=e}return e.prototype.remove=function(e,t){if(e instanceof RegExp){var n=this.patterns.find((function(t){var n=t.pattern;return n.source===e.source}));if(!n)return void p.warn("No listeners for "+e);this.patterns=h(this.patterns.filter((function(e){return e!==n})))}else{var r=this.listeners[e];if(!r)return void p.warn("No listeners for "+e);this.listeners[e]=h(r.filter((function(e){var n=e.callback;return n!==t})))}},e.prototype.dispatch=function(e,t,n,r){if(void 0===n&&(n=""),this.protectedChannels.indexOf(e)>-1){var i=r===g;i||p.warn("WARNING: "+e+" is protected and dispatching on it can have unintended consequences")}var o={channel:e,payload:f({},t),source:n,patternInfo:[]};try{this._toListeners(o)}catch(s){p.error(s)}},e.prototype.listen=function(e,t,n){var r,i=this;if(void 0===n&&(n="noname"),y(t))p.warn("WARNING onHubCapsule is Deprecated. Please pass in a callback."),r=t.onHubCapsule.bind(t);else{if("function"!==typeof t)throw new Error("No callback supplied to Hub");r=t}if(e instanceof RegExp)this.patterns.push({pattern:e,callback:r});else{var o=this.listeners[e];o||(o=[],this.listeners[e]=o),o.push({name:n,callback:r})}return function(){i.remove(e,r)}},e.prototype._toListeners=function(e){var t=e.channel,n=e.payload,r=this.listeners[t];if(r&&r.forEach((function(r){p.debug("Dispatching to "+t+" with ",n);try{r.callback(e)}catch(i){p.error(i)}})),this.patterns.length>0){if(!n.message)return void p.warn("Cannot perform pattern matching without a message
1key");var i=n.message;this.patterns.forEach((function(t){var n=i.match(t.pattern);if(n){var r=d(n),o=r.slice(1),s=f(f({},e),{patternInfo:o});try{t.callback(s)}catch(a){p.error(a)}}}))}},e}(),b=new m("__default__"),v={},w=function(){function e(){}return e.setItem=function(e,t){return v[e]=t,v[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(v,e)?v[e]:void 0},e.removeItem=function(e){return delete v[e]},e.clear=function(){return v={},v},e}(),_=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.amplify.test-ls",1),this.storageWindow.removeItem("aws.amplify.test-ls")}catch(e){this.storageWindow=w}}return e.prototype.getStorage=function(){return this.storageWindow},e}(),I=n("1f3a"),P=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),S=function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r["throw"](e))}catch(t){o(t)}}function u(e){e.done?n(e.value):i(e.value).then(s,a)}u((r=r.apply(e,t||[])).next())}))},A=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return u([e,t])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!(i=i.length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},k=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{while((void 0===t||t-- >0)&&!(r=o.next()).done)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return s},C=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(k(arguments[t]));return e},O=new l["a"]("Util"),U=function(e){function t(t){var n=e.call(this,t)||this;return n.nonRetryable=!0,n}return P(t,e),t}(Error),j=function(e){var t="nonRetryable";return e&&e[t]};function E(e,t,n,r){return void 0===r&&(r=1),S(this,void 0,void 0,(function(){var i,o;return A(this,(function(s){switch(s.label){case 0:if("function"!==typeof e)throw Error("functionToRetry must be a function");O.debug(e.name+" attempt #"+r+" with this vars: "+JSON.stringify(t)),s.label=1;case 1:return s.trys.push([1,3,,8]),[4,e.apply(void 0,C(t))];case 2:return[2,s.sent()];case 3:if(i=s.sent(),O.debug("error on "+e.name,i),j(i))throw O.debug(e.name+" non retryable error",i),i;return o=n(r,t,i),O.debug(e.name+" retrying in "+o+" ms"),!1===o?[3,6]:[4,new Promise((function(e){return setTimeout(e,o)}))];case 4:return s.sent(),[4,E(e,t,n,r+1)];case 5:return[2,s.sent()];case 6:throw i;case 7:return[3,8];case 8:return[2]}}
1))}))}var x=3e5;function T(e){var t=100,n=100;return function(r){var i=Math.pow(2,r)*t+n*Math.random();return!(i>e)&&i}}var F=function(e,t,n){return void 0===n&&(n=x),E(e,t,T(n))},M=function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r["throw"](e))}catch(t){o(t)}}function u(e){e.done?n(e.value):i(e.value).then(s,a)}u((r=r.apply(e,t||[])).next())}))},N=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return u([e,t])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!(i=i.length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},R=new l["a"]("CognitoCredentials"),L=new Promise((function(e,t){if(!Object(I["b"])().isBrowser)return R.debug("not in the browser, directly resolved"),e();var n=window["gapi"]&&window["gapi"].auth2?window["gapi"].auth2:null;if(n)return R.debug("google api already loaded"),e();setTimeout((function(){return e()}),2e3)})),H=function(){function e(){this.initialized=!1,this.refreshGoogleToken=this.refreshGoogleToken.bind(this),this._refreshGoogleTokenImpl=this._refreshGoogleTokenImpl.bind(this)}return e.prototype.refreshGoogleToken=function(){return M(this,void 0,void 0,(function(){return N(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(R.debug("need to wait for the Google SDK loaded"),[4,L]);case 1:e.sent(),this.initialized=!0,R.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshGoogleTokenImpl()]}}))}))},e.prototype._refreshGoogleTokenImpl=function(){var e=null;return Object(I["b"])().isBrowser&&(e=window["gapi"]&&window["gapi"].auth2?window["gapi"].auth2:null),e?new Promise((function(t,n){e.getAuthInstance().then((function(e){e||(R.debug("google Auth undefined"),n(new U("google Auth undefined")));var r=e.currentUser.get();r.isSignedIn()?(R.debug("refreshing the google access token"),r.reloadAuthResponse().then((function(e){var n=e.id_token,r=e.expires_at;t({token:n,expires_at:r})})).catch((function(e){e&&"network_error"===e.error?n("Network error reloading google auth response"):n(new U("Failed to reload google auth response"))}))):n(new U("User is not signed in with Google"))})).catch((function(e){R.debug("Failed to refresh google token",e),n(new U("Failed to refresh google token"))}))})):(R.debug("no gapi auth2 available"),Promise.reject("no gapi auth2 available"))},e}(),D=function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r["throw"](e))}catch(t){o(t)}}function u(e){e.done?n(e.value):i(e.value).then(s,a)}u((r=r.apply(e,t||[])).next())}))},G=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return u([e,t])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!(i=i.length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},B=new l["a"]("CognitoCredentials"),W=new Promise((function(e,t){if(!Object(I["b"])().isBrowser)return B.debug("not in the browser, directly resolved"),e();var n=window["FB"];if(n)return B.debug("FB SDK already loaded"),e();setTimeout((function(){return e()}),2e3)})),z=function(){function e(){this.initialized=!1,this.refreshFacebookToken=this.refreshFacebookToken.bind(this),this._refreshFacebookTokenImpl=this._refreshFacebookTokenImpl.bind(this)}return e.prototype.refreshFacebookToken=function(){return D(this,void 0,void 0,(function(){return G(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(B.debug("need to wait for the Facebook SDK loaded"),[4,W]);case 1:e.sent(),this.initialized=!0,B.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshFacebookTokenImpl()]}}))}))},e.prototype._refreshFacebookTokenImpl=function(){var e=null;if(Object(I["b"])().isBrowser&&(e=window["FB"]),!e){var t="no fb sdk available";
1return B.debug(t),Promise.reject(new U(t))}return new Promise((function(t,n){e.getLoginStatus((function(e){if(e&&e.authResponse){var r=e.authResponse,i=r.accessToken,o=r.expiresIn,s=new Date,a=1e3*o+s.getTime();if(!i){u="the jwtToken is undefined";B.debug(u),n(new U(u))}t({token:i,expires_at:a})}else{var u="no response from facebook when refreshing the jwt token";B.debug(u),n(new U(u))}}),{scope:"public_profile,email"})}))},e}(),V=new H,q=new z,K="3.8.13",Y="aws-amplify/"+K,J={userAgent:Y+" js",product:"",navigator:null,isReactNative:!1};if("undefined"!==typeof navigator&&navigator.product)switch(J.product=navigator.product||"",J.navigator=navigator||null,navigator.product){case"ReactNative":J.userAgent=Y+" react-native",J.isReactNative=!0;break;default:J.userAgent=Y+" js",J.isReactNative=!1;break}var Q=function(){return J.userAgent},X=n("7d03"),Z=n("3492"),$=n("311b"),ee=n("8265"),te=n("44e3"),ne=function(){return ne=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ne.apply(this,arguments)},re=function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r["throw"](e))}catch(t){o(t)}}function u(e){e.done?n(e.value):i(e.value).then(s,a)}u((r=r.apply(e,t||[])).next())}))},ie=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return u([e,t])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!(i=i.length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},oe=new l["a"]("Credentials"),se=3e6,ae=function(){function e(e){this._gettingCredPromise=null,this._refreshHandlers={},this.Auth=void 0,this.configure(e),this._refreshHandlers["google"]=V.refreshGoogleToken,this._refreshHandlers["facebook"]=q.refreshFacebookToken}return e.prototype.getModuleName=function(){return"Credentials"},e.prototype.getCredSource=function(){return this._credentials_source},e.prototype.configure=function(e){if(!e)return this._config||{};this._config=Object.assign({},this._config,e);var t=this._config.refreshHandlers;return t&&(this._refreshHandlers=ne(ne({},this._refreshHandlers),t)),this._storage=this._config.storage,this._storage||(this._storage=(new _).getStorage()),this._storageSync=Promise.resolve(),"function"===typeof this._storage["sync"]&&(this._storageSync=this._storage["sync"]()),this._config},e.prototype.get=function(){return oe.debug("getting credentials"),this._pickupCredentials()},e.prototype._pickupCredentials=function(){return oe.debug("picking up credentials"),this._gettingCredPromise&&this._gettingCredPromise.isPending()?oe.debug("getting old cred promise"):(oe.debug("getting new cred promise"),this._gettingCredPromise=Object(I["c"])(this._keepAlive())),this._gettingCredPromise},e.prototype._keepAlive=function(){return re(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a;return ie(this,(function(u){switch(u.label){case 0:if(oe.debug("checking if credentials exists and not expired"),e=this._credentials,e&&!this._isExpired(e)&&!this._isPastTTL())return oe.debug("credentials not changed and not expired, directly return"),[2,Promise.resolve(e)];if(oe.debug("need to get a new credential or refresh the existing one"),t=this.Auth,n=void 0===t?X["a"].Auth:t,!n||"function"!==typeof n.currentUserCredentials)return[2,Promise.reject("No Auth module registered in Amplify")];if(this._isExpired(e)||!this._isPastTTL())return[3,6];oe.debug("ttl has passed but token is not yet expired"),u.label=1;case 1:return u.trys.push([1,5,,6]),[4,n.currentUserPoolUser()];case 2:return r=u.sent(),[4,n.currentSession()];case 3:return i=u.sent(),o=i.refreshToken,s=new Promise((function(e,t){r.refreshSession(o,(function(n,r){return n?t(n):e(r)}))})),[4,s];case 4:return u.sent(),[3,6];case 5:return a=u.sent(),oe.debug("Error attempting to refreshing the session",a),[3,6];case 6:return[2,n.currentUserCredentials()]}}))}))},e.prototype.refreshFederatedToken=function(e){oe.debug("Getting federated credentials");var t=e.provider,n=e.user,r=e.token,i=e.identity_id,o=e.expires_at;o=1970===new Date(o).getFullYear()?1e3*o:o;var s=this;return oe.debug("checking if federated jwt token expired"),o>(new Date).getTime()?(oe.debug("token not expired"),this._setCredentialsFromFederation({provider:t,token:r,user:n,identity_id:i,expires_at:o})):s._refreshHandlers[t]&&"function"===typeof s._refreshHandlers[t]?(oe.debug("getting refreshed jwt token from federation provider"),this._providerRefreshWithRetry({refreshHandler:s._refreshHandlers[t],provider:t,user:n})):(oe.debug("no refresh handler for provider:",t),this.clear(),Promise.reject("no refresh handler for provider"))},e.prototype._providerRefreshWithRetry=function(e){var t=this,n=e.refreshHandler,r=e.provider,i=e.user,o=1e4;return F(n,[],o).then((function(e){return oe.debug("refresh federated token sucessfully",e),t._setCredentialsFromFederation({provider:r,token:e.token,user:i,identity_id:e.identity_id,expires_at:e.expires_at})})).catch((function(e){var n="string"===typeof e&&0===e.toLowerCase().lastIndexOf("network error",e.length);return n||t.clear(),oe.debug("refresh federated token failed",e),Promise.reject("refreshing federation token failed: "+e)}))},e.prototype._isExpired=function(e){if(!e)return oe.debug("no credentials for expiration check"),!0;oe.debug("are these credentials expired?",e);var t=Date.now(),n=e.expiration;return n.getTime()<=t},e.prototype._isPastTTL=function(){return this._nextCredentialsRefresh<=Date.now()},e.prototype._setCredentialsForGuest=function(){return re(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a,u,c,l=this;return ie(this,(function(f){switch(f.label){case 0:if(oe.debug("setting credentials for guest"),e=this._config,t=e.identityPoolId,n=e.region,r=e.mandatorySignIn,r)return[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")];if(!t)return oe.debug("No Cognito Identity pool provided for unauthenticated access"),[2,Promise.reject("No Cognito Identity pool provided for unauthenticated access")];if(!n)return oe.debug("region is not configured for getting the credentials"),[2,Promise.reject("region is not configured for getting the credentials")];i=void 0,f.label=1;case 1:return f.trys.push([1,3,,4]),[4,this._storageSync];case 2:return f.sent(),i=this._storage.getItem("CognitoIdentityId-"+t),this._identityId=i,[3,4];case 3:return o=f.sent(),oe.debug("Failed to get the cached identityId",o),[3,4];case 4:return s=new ee["a"]({region:n,customUserAgent:Q()}),a=void 0,i?(u={identityId:i,client:s},a=Object(Z["a"])(u)()):(c=function(){return re(l,void 0,void 0,(function(){var e,n,r;return ie(this,(function(i){switch(i.label){case 0:return[4,s.send(new te["a"]({IdentityPoolId:t}))];case 1:return e=i.sent().IdentityId,this._identityId=e,n={client:s,identityId:e},r=Object(Z["a"])(n),[2,r()]}}))}))},a=c().catch((function(e){return re(l,void 0,void 0,(function(){return ie(this,(function(t){throw e}))}))}))),[2,this._loadCredentials(a,"guest",!1,null).then((function(e){return e})).catch((function(e){return re(l,void 0,void 0,(function(){var n,r=this;return ie(this,(function(o){return"ResourceNotFoundException"===e.name&&e.message==="Identity '"+i+"' not found."?(oe.debug("Failed to load guest credentials"),this._storage.removeItem("CognitoIdentityId-"+t),n=function(){return re(r,void 0,void 0,(function(){var e,n,r;return ie(this,(function(i){switch(i.label){case 0:return[4,s.send(new te["a"]({IdentityPoolId:t}))];case 1:return e=i.sent().IdentityId,this._identityId=e,n={client:s,identityId:e},r=Object(Z["a"])(n),[2,r()]}}))}))},a=n().catch((function(e){return re(r,void 0,void 0,(function(){return ie(this,(function(t){throw e}))}))})),[2,this._loadCredentials(a,"guest",!1,null)]):[2,e]}))}))}))]}}))}))},e.prototype._setCredentialsFromFederation=function(e){var t=e.provider,n=e.token,r=e.identity_id,i={google:"accounts.google.com",facebook:"graph.facebook.com",amazon:"www.amazon.com",developer:"cognito-identity.amazonaws.com"},o=i[t]||t;if(!o)return Promise.reject("You must specify a federated provider");var s={};s[o]=n;var a=this._config,u=a.identityPoolId,c=a.region;if(!u)return oe.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");
1if(!c)return oe.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var l=new ee["a"]({region:c,customUserAgent:Q()}),f=void 0;if(r){var d={identityId:r,logins:s,client:l};f=Object(Z["a"])(d)()}else{d={logins:s,identityPoolId:u,client:l};f=Object($["a"])(d)()}return this._loadCredentials(f,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){var t=this;oe.debug("set credentials from session");var n=e.getIdToken().getJwtToken(),r=this._config,i=r.region,o=r.userPoolId,s=r.identityPoolId;if(!s)return oe.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!i)return oe.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var a="cognito-idp."+i+".amazonaws.com/"+o,u={};u[a]=n;var c=new ee["a"]({region:i,customUserAgent:Q()}),l=function(){return re(t,void 0,void 0,(function(){var e,t,n;return ie(this,(function(r){switch(r.label){case 0:return[4,c.send(new te["a"]({IdentityPoolId:s,Logins:u}))];case 1:return e=r.sent().IdentityId,this._identityId=e,t={client:c,logins:u,identityId:e},n=Object(Z["a"])(t),[2,n()]}}))}))},f=l().catch((function(e){return re(t,void 0,void 0,(function(){return ie(this,(function(t){throw e}))}))}));return this._loadCredentials(f,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,n,r){var i=this,o=this,s=this._config.identityPoolId;return new Promise((function(a,u){e.then((function(e){return re(i,void 0,void 0,(function(){var i,u,c,l,f,d;return ie(this,(function(h){switch(h.label){case 0:if(oe.debug("Load credentials successfully",e),this._identityId&&!e.identityId&&(e["identityId"]=this._identityId),o._credentials=e,o._credentials.authenticated=n,o._credentials_source=t,o._nextCredentialsRefresh=(new Date).getTime()+se,"federated"===t){i=Object.assign({id:this._credentials.identityId},r.user),u=r.provider,c=r.token,l=r.expires_at,f=r.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:u,token:c,user:i,expires_at:l,identity_id:f}))}catch(p){oe.debug("Failed to put federated info into auth storage",p)}}if("guest"!==t)return[3,4];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,this._storageSync];case 2:return h.sent(),this._storage.setItem("CognitoIdentityId-"+s,e.identityId),[3,4];case 3:return d=h.sent(),oe.debug("Failed to cache identityId",d),[3,4];case 4:return a(o._credentials),[2]}}))}))})).catch((function(t){if(t)return oe.debug("Failed to load credentials",e),oe.debug("Error loading credentials",t),void u(t)}))}))},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(oe.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return re(this,void 0,void 0,(function(){return ie(this,(function(e){return this._credentials=null,this._credentials_source=null,oe.debug("removing aws-amplify-federatedInfo from storage"),this._storage.removeItem("aws-amplify-federatedInfo"),[2]}))}))},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}(),ue=new ae(null);X["a"].register(ue);var ce=new l["a"]("Parser"),le=function(e){var t,n={};if(e["aws_mobile_analytics_app_id"]){var r={AWSPinpoint:{appId:e["aws_mobile_analytics_app_id"],region:e["aws_mobile_analytics_app_region"]}};n.Analytics=r}return(e["aws_cognito_identity_pool_id"]||e["aws_user_pools_id"])&&(n.Auth={userPoolId:e["aws_user_pools_id"],userPoolWebClientId:e["aws_user_pools_web_client_id"],region:e["aws_cognito_region"],identityPoolId:e["aws_cognito_identity_pool_id"],identityPoolRegion:e["aws_cognito_region"],mandatorySignIn:"enable"===e["aws_mandatory_sign_in"]}),t=e["aws_user_files_s3_bucket"]?{AWSS3:{bucket:e["aws_user_files_s3_bucket"],region:e["aws_user_files_s3_bucket_region"],dangerouslyConnectToHttpEndpointForTesting:e["aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing"]}}:e?e.Storage||e:{},n.Analytics=Object.assign({},n.Analytics,e.Analytics),n.Auth=Object.assign({},n.Auth,e.Auth),n.Storage=Object.assign({},t),ce.debug("parse config",e,"to amplifyconfig",n),n},fe=function(){function e(){}return e.parseMobilehubConfig=le,e}(),de=n("f4e3"),he=Object(I["b"])().isBrowser,pe=function(){function e(e){void 0===e&&(e={}),this.cookies=new de["a"],this.store=he?window.localStorage:Object.create(null),this.cookies=e.req?new de["a"](e.req.headers.cookie):new de["a"],Object.assign(this.store,this.cookies.getAll())}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.entries(this.store).length},enumerable:!0,configurable:!0}),e.prototype.clear=function(){var e=this;Array.from(new Array(this.length)).map((function(t,n){return e.key(n)}
1)).forEach((function(t){return e.removeItem(t)}))},e.prototype.getItem=function(e){return this.getLocalItem(e)},e.prototype.getLocalItem=function(e){return Object.prototype.hasOwnProperty.call(this.store,e)?this.store[e]:null},e.prototype.getUniversalItem=function(e){return this.cookies.get(e)},e.prototype.key=function(e){return Object.keys(this.store)[e]},e.prototype.removeItem=function(e){this.removeLocalItem(e),this.removeUniversalItem(e)},e.prototype.removeLocalItem=function(e){delete this.store[e]},e.prototype.removeUniversalItem=function(e){this.cookies.remove(e,{path:"/"})},e.prototype.setItem=function(e,t){this.setLocalItem(e,t);var n=e.split(".").pop();switch(n){case"LastAuthUser":case"accessToken":case"idToken":this.setUniversalItem(e,t)}},e.prototype.setLocalItem=function(e,t){this.store[e]=t},e.prototype.setUniversalItem=function(e,t){this.cookies.set(e,t,{path:"/",sameSite:!0,secure:"localhost"!==window.location.hostname})},e}();function ge(e){return e.split("").map((function(e){return e.charCodeAt(0).toString(16).padStart(2,"0")})).join("")}function ye(e){return e.match(/.{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join("")}var me,be=n("4c44"),ve=n("0b16"),we="_self",_e=function(e){var t=window.open(e,we);return t?Promise.resolve(t):Promise.reject()},Ie=function(e){window.sessionStorage.setItem("oauth_state",e)},Pe=function(){var e=window.sessionStorage.getItem("oauth_state");return window.sessionStorage.removeItem("oauth_state"),e},Se=function(e){window.sessionStorage.setItem("ouath_pkce_key",e)},Ae=function(){var e=window.sessionStorage.getItem("ouath_pkce_key");return window.sessionStorage.removeItem("ouath_pkce_key"),e},ke=n("a5e6"),Ce=n.n(ke),Oe=n("2126"),Ue=n.n(Oe),je=function(){return je=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},je.apply(this,arguments)},Ee=function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r["throw"](e))}catch(t){o(t)}}function u(e){e.done?n(e.value):i(e.value).then(s,a)}u((r=r.apply(e,t||[])).next())}))},xe=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return u([e,t])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!(i=i.length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},Te=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{while((void 0===t||t-- >0)&&!(r=o.next()).done)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return s},Fe="undefined"!==typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Me=function(e,t,n){b.dispatch("auth",{event:e,data:t,message:n},"Auth",Fe)},Ne=new l["a"]("OAuth"),Re=function(){function e(e){var t=e.config,n=e.cognitoClientId,r=e.scopes,i=void 0===r?[]:r;if(this._urlOpener=t.urlOpener||_e,this._config=t,this._cognitoClientId=n,!this.isValidScopes(i))throw Error("scopes must be a String Array");this._scopes=i}return e.prototype.isValidScopes=function(e){return Array.isArray(e)&&e.every((function(e){return"string"===typeof e}))},e.prototype.oauthSignIn=function(e,t,n,i,o,s){void 0===e&&(e="code"),void 0===o&&(o=r.Cognito);var a=this._generateState(32),u=s?a+"-"+ge(s):a;Ie(u);var c=this._generateRandom(128);Se(c);var l=this._generateChallenge(c),f="S256",d=this._scopes.join(" "),h=Object.entries(je(je({redirect_uri:n,response_type:e,client_id:i,identity_provider:o,scope:d,state:u},"code"===e?{code_challenge:l}:{}),"code"===e?{code_challenge_method:f}:{})).map((function(e){var t=Te(e,2),n=t[0],r=t[1];return encodeURIComponent(n)+"="+encodeURIComponent(r)})).join("&"),p="https://"+t+"/oauth2/authorize?"+h;Ne.debug("Redirecting to "+p),this._urlOpener(p,n)},e.prototype._handleCodeFlow=function(e){return Ee(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,l,f,d,h;return xe(this,(function(p){switch(p.label){case 0:return t=(Object(ve["parse"])(e).query||"").split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n,r=Te(t,2),i=r[0],o=r[1];return je(je({},e),(n={},n[i]=o,n))}),{code:void 0}).code,t&&Object(ve["parse"])(e).pathname===Object(ve["parse"])(this._config.redirectSignIn).pathname?(n="https://"+this._config.domain+"/oauth2/token",Me("codeFlow",{},"Retrieving tokens from "+n),r=u(this._config)?this._cognitoClientId:this._config.clientID,i=u(this._config)?this._config.redirectSignIn:this._config.redirectUri,o=Ae(),s=je({grant_type:"authorization_code",code:t,client_id:r,redirect_uri:i},o?{code_verifier:o}:{}),Ne.debug("Calling token endpoint: "+n+" with",s),a=Object.entries(s).map((function(e){var t=Te(e,2),n=t[0],r=t[1];return encodeURIComponent(n)+"="+encodeURIComponent(r)})).join("&"),[4,fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:a})]):[2];case 1:return[4,p.sent().json()];case 2:if(c=p.sent(),l=c.access_token,f=c.refresh_token,d=c.id_token,h=c.error,h)throw new Error(h);return[2,{accessToken:l,refreshToken:f,idToken:d}]}}))}))},e.prototype._handleImplicitFlow=function(e){return Ee(this,void 0,void 0,(function(){var t,n,r;return xe(this,(function(i){return t=(Object(ve["parse"])(e).hash||"#").substr(1).split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n,r=Te(t,2),i=r[0],o=r[1];return je(je({},e),(n={},n[i]=o,n))}),{id_token:void 0,access_token:void 0}
1),n=t.id_token,r=t.access_token,Me("implicitFlow",{},"Got tokens from "+e),Ne.debug("Retrieving implicit tokens from "+e+" with"),[2,{accessToken:r,idToken:n,refreshToken:null}]}))}))},e.prototype.handleAuthResponse=function(e){return Ee(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return xe(this,(function(u){switch(u.label){case 0:if(u.trys.push([0,5,,6]),t=e?je(je({},(Object(ve["parse"])(e).hash||"#").substr(1).split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n=Te(t,2),r=n[0],i=n[1];return e[r]=i,e}),{})),(Object(ve["parse"])(e).query||"").split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n=Te(t,2),r=n[0],i=n[1];return e[r]=i,e}),{})):{},n=t.error,r=t.error_description,n)throw new Error(r);return i=this._validateState(t),Ne.debug("Starting "+this._config.responseType+" flow with "+e),"code"!==this._config.responseType?[3,2]:(o=[{}],[4,this._handleCodeFlow(e)]);case 1:return[2,je.apply(void 0,[je.apply(void 0,o.concat([u.sent()])),{state:i}])];case 2:return s=[{}],[4,this._handleImplicitFlow(e)];case 3:return[2,je.apply(void 0,[je.apply(void 0,s.concat([u.sent()])),{state:i}])];case 4:return[3,6];case 5:throw a=u.sent(),Ne.error("Error handling auth response.",a),a;case 6:return[2]}}
1))}))},e.prototype._validateState=function(e){if(e){var t=Pe(),n=e.state;if(t&&t!==n)throw new Error("Invalid state in OAuth flow");return n}},e.prototype.signOut=function(){return Ee(this,void 0,void 0,(function(){var e,t,n;return xe(this,(function(r){return e="https://"+this._config.domain+"/logout?",t=u(this._config)?this._cognitoClientId:this._config.oauth.clientID,n=u(this._config)?this._config.redirectSignOut:this._config.returnTo,e+=Object.entries({client_id:t,logout_uri:encodeURIComponent(n)}).map((function(e){var t=Te(e,2),n=t[0],r=t[1];return n+"="+r})).join("&"),Me("oAuthSignOut",{oAuth:"signOut"},"Signing out from "+e),Ne.debug("Signing out from "+e),[2,this._urlOpener(e)]}))}))},e.prototype._generateState=function(e){for(var t="",n=e,r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";n>0;--n)t+=r[Math.round(Math.random()*(r.length-1))];return t},e.prototype._generateChallenge=function(e){return this._base64URL(Ce()(e))},e.prototype._base64URL=function(e){return e.toString(Ue.a).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},e.prototype._generateRandom=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=new Uint8Array(e);if("undefined"!==typeof window&&window.crypto)window.crypto.getRandomValues(n);else for(var r=0;r<e;r+=1)n[r]=Math.random()*t.length|0;return this._bufferToString(n)},e.prototype._bufferToString=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=[],r=0;r<e.byteLength;r+=1){var i=e[r]%t.length;n.push(t[i])}return n.join("")},e}(),Le=Re,He=function(e){if(I["a"].browserOrNode().isBrowser&&window.location){var t=window.location.href;e({url:t})}else if(!I["a"].browserOrNode().isNode)throw new Error("Not supported")};(function(e){e["DEFAULT_MSG"]="Authentication Error",e["EMPTY_USERNAME"]="Username cannot be empty",e["INVALID_USERNAME"]="The username should either be a string or one of the sign in types",e["EMPTY_PASSWORD"]="Password cannot be empty",e["EMPTY_CODE"]="Confirmation code cannot be empty",e["SIGN_UP_ERROR"]="Error creating account",e["NO_MFA"]="No valid MFA method provided",e["INVALID_MFA"]="Invalid MFA type",e["EMPTY_CHALLENGE"]="Challenge response cannot be empty",e["NO_USER_SESSION"]="Failed to get the session because the user is empty"})(me||(me={}));var De=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ge=new l["a"]("AuthError"),Be=function(e){function t(n){var r=this,i=ze[n],o=i.message,s=i.log;return r=e.call(this,o)||this,r.constructor=t,Object.setPrototypeOf(r,t.prototype),r.name="AuthError",r.log=s||o,Ge.error(r.log),r}return De(t,e),t}(Error),We=function(e){function t(n){var r=e.call(this,n)||this;return r.constructor=t,Object.setPrototypeOf(r,t.prototype),r.name="NoUserPoolError",r}return De(t,e),t}(Be),ze={noConfig:{message:me.DEFAULT_MSG,log:"\n Error: Amplify has not been configured correctly.\n This error is typically caused by one of the following scenarios:\n\n 1. Make sure you're passing the awsconfig object to Amplify.configure() in your app's entry point\n See https://aws-amplify.github.io/docs/js/authentication#configure-your-app for more information\n \n 2. There might be multiple conflicting versions of aws-amplify or amplify packages in your node_modules.\n Try deleting your node_modules folder and reinstalling the dependencies with `yarn install`\n "},missingAuthConfig:{message:me.DEFAULT_MSG,log:"\n Error: Amplify has not been configured correctly. \n The configuration object is missing required auth properties. \n Did you run `amplify push` after adding auth via `amplify add auth`?\n See https://aws-amplify.github.io/docs/js/authentication#amplify-project-setup for more information\n "},emptyUsername:{message:me.EMPTY_USERNAME},invalidUsername:{message:me.INVALID_USERNAME},emptyPassword:{message:me.EMPTY_PASSWORD},emptyCode:{message:me.EMPTY_CODE},signUpError:{message:me.SIGN_UP_ERROR,log:"The first parameter should either be non-null string or object"},noMFA:{message:me.NO_MFA},invalidMFA:{message:me.INVALID_MFA},emptyChallengeResponse:{message:me.EMPTY_CHALLENGE},noUserSession:{message:me.NO_USER_SESSION},default:{message:me.DEFAULT_MSG}},Ve=function(){return Ve=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ve.apply(this,arguments)},qe=function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}
1return new(n||(n=Promise))((function(n,o){function s(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r["throw"](e))}catch(t){o(t)}}function u(e){e.done?n(e.value):i(e.value).then(s,a)}u((r=r.apply(e,t||[])).next())}))},Ke=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return u([e,t])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(s)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!(i=i.length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},Ye=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{while((void 0===t||t-- >0)&&!(r=o.next()).done)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return s},Je=new l["a"]("AuthClass"),Qe="aws.cognito.signin.user.admin",Xe=1e4,Ze="undefined"!==typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",$e=function(e,t,n){b.dispatch("auth",{event:e,data:t,message:n},"Auth",Ze)},et=function(){function e(e){var t=this;this.userPool=null,this.user=null,this.oAuthFlowInProgress=!1,this.Credentials=ue,this.wrapRefreshSessionCallback=function(e){var t=function(t,n){return n?$e("tokenRefresh",void 0,"New token retrieved"):$e("tokenRefresh_failure",t,"Failed to retrieve new token"),e(t,n)};return t},this.configure(e),this.currentCredentials=this.currentCredentials.bind(this),this.currentUserCredentials=this.currentUserCredentials.bind(this),b.listen("auth",(function(e){var n=e.payload,r=n.event;switch(r){case"signIn":t._storage.setItem("amplify-signin-with-hostedUI","false");break;case"signOut":t._storage.removeItem("amplify-signin-with-hostedUI");break;case"cognitoHostedUI":t._storage.setItem("amplify-signin-with-hostedUI","true");break}}))}return e.prototype.getModuleName=function(){return"Auth"},e.prototype.configure=function(e){var t=this;if(!e)return this._config||{};Je.debug("configure Auth");var n=Object.assign({},this._config,fe.parseMobilehubConfig(e).Auth,e);this._config=n;var r=this._config,i=r.userPoolId,o=r.userPoolWebClientId,s=r.cookieStorage,a=r.oauth,c=r.region,l=r.identityPoolId,f=r.mandatorySignIn,d=r.refreshHandlers,h=r.identityPoolRegion,p=r.clientMetadata,g=r.endpoint;if(this._config.storage){if(!this._isValidAuthStorage(this._config.storage))throw Je.error("The storage in the Auth config is not valid!"),new Error("Empty storage object");this._storage=this._config.storage}else this._storage=s?new be["i"](s):e.ssr?new pe:(new _).getStorage();if(this._storageSync=Promise.resolve(),"function"===typeof this._storage["sync"]&&(this._storageSync=this._storage["sync"]()),i){var y={UserPoolId:i,ClientId:o,endpoint:g};y.Storage=this._storage,this.userPool=new be["g"](y,this.wrapRefreshSessionCallback)}this.Credentials.configure({mandatorySignIn:f,region:h||c,userPoolId:i,identityPoolId:l,refreshHandlers:d,storage:this._storage});var m=a?u(this._config.oauth)?a:a.awsCognito:void 0;if(m){var b=Object.assign({cognitoClientId:o,UserPoolId:i,domain:m["domain"],scopes:m["scope"],redirectSignIn:m["redirectSignIn"],redirectSignOut:m["redirectSignOut"],responseType:m["responseType"],Storage:this._storage,urlOpener:m["urlOpener"],clientMetadata:p},m["options"]);this._oAuthHandler=new Le({scopes:b.scopes,config:b,cognitoClientId:b.cognitoClientId});var v={};He((function(e){var n=e.url;v[n]||(v[n]=!0,t._handleAuthResponse(n))}))}return $e("configured",null,"The Auth category has been configured successfully"),this._config},e.prototype.signUp=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(!this.userPool)return this.rejectNoUserPool();var o,s=null,a=null,u=[],c=null;if(e&&"string"===typeof e){s=e,a=n?n[0]:null;var l=n?n[1]:null,f=n?n[2]:null;l&&u.push(new be["f"]({Name:"email",Value:l})),f&&u.push(new be["f"]({Name:"phone_number",Value:f}))}else{if(!e||"object"!==typeof e)return this.rejectAuthError(i.SignUpError);s=e["username"],a=e["password"],e&&e.clientMetadata?o=e.clientMetadata:this._config.clientMetadata&&(o=this._config.clientMetadata);var d=e["attributes"];d&&Object.keys(d).map((function(e){u.push(new be["f"]({Name:e,Value:d[e]}))}));var h=e["validationData"];h&&(c=[],Object.keys(h).map((function(e){c.push(new be["f"]({Name:e,Value:d[e]}))})))}return s?a?(Je.debug("signUp attrs:",u),Je.debug("signUp validation data:",c),new Promise((function(e,n){t.userPool.signUp(s,a,u,c,(function(t,r){t?($e("signUp_failure",t,s+" failed to signup"),n(t)):($e("signUp",r,s+" has signed up successfully"),e(r))}),o)}))):this.rejectAuthError(i.EmptyPassword):this.rejectAuthError(i.EmptyUsername)}
1,e.prototype.confirmSignUp=function(e,t,n){if(!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.EmptyUsername);if(!t)return this.rejectAuthError(i.EmptyCode);var r,o=this.createCognitoUser(e),s=!n||"boolean"!==typeof n.forceAliasCreation||n.forceAliasCreation;return n&&n.clientMetadata?r=n.clientMetadata:this._config.clientMetadata&&(r=this._config.clientMetadata),new Promise((function(e,n){o.confirmRegistration(t,s,(function(t,r){t?n(t):e(r)}),r)}))},e.prototype.resendSignUp=function(e,t){if(void 0===t&&(t=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.EmptyUsername);var n=this.createCognitoUser(e);return new Promise((function(e,r){n.resendConfirmationCode((function(t,n){t?r(t):e(n)}),t)}))},e.prototype.signIn=function(e,t,n){if(void 0===n&&(n=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();var r=null,o=null,s={};if("string"===typeof e)r=e,o=t;else{if(!c(e))return this.rejectAuthError(i.InvalidUsername);"undefined"!==typeof t&&Je.warn("The password should be defined under the first parameter object!"),r=e.username,o=e.password,s=e.validationData}if(!r)return this.rejectAuthError(i.EmptyUsername);var a=new be["a"]({Username:r,Password:o,ValidationData:s,ClientMetadata:n});return o?this.signInWithPassword(a):this.signInWithoutPassword(a)},e.prototype.authCallbacks=function(e,t,n){var r=this,i=this;return{onSuccess:function(o){return qe(r,void 0,void 0,(function(){var r,s,a,u;return Ke(this,(function(c){switch(c.label){case 0:Je.debug(o),delete e["challengeName"],delete e["challengeParam"],c.label=1;case 1:return c.trys.push([1,4,5,9]),[4,this.Credentials.clear()];case 2:return c.sent(),[4,this.Credentials.set(o,"session")];case 3:return r=c.sent(),Je.debug("succeed to get cognito credentials",r),[3,9];case 4:return s=c.sent(),Je.debug("cannot get cognito credentials",s),[3,9];case 5:return c.trys.push([5,7,,8]),[4,this.currentUserPoolUser()];case 6:return a=c.sent(),i.user=a,$e("signIn",a,"A user "+e.getUsername()+" has been signed in"),t(a),[3,8];case 7:return u=c.sent(),Je.error("Failed to get the signed in user",u),n(u),[3,8];case 8:return[7];case 9:return[2]}}
1))}))},onFailure:function(t){Je.debug("signIn failure",t),$e("signIn_failure",t,e.getUsername()+" failed to signin"),n(t)},customChallenge:function(n){Je.debug("signIn custom challenge answer required"),e["challengeName"]="CUSTOM_CHALLENGE",e["challengeParam"]=n,t(e)},mfaRequired:function(n,r){Je.debug("signIn MFA required"),e["challengeName"]=n,e["challengeParam"]=r,t(e)},mfaSetup:function(n,r){Je.debug("signIn mfa setup",n),e["challengeName"]=n,e["challengeParam"]=r,t(e)},newPasswordRequired:function(n,r){Je.debug("signIn new password"),e["challengeName"]="NEW_PASSWORD_REQUIRED",e["challengeParam"]={userAttributes:n,requiredAttributes:r},t(e)},totpRequired:function(n,r){Je.debug("signIn totpRequired"),e["challengeName"]=n,e["challengeParam"]=r,t(e)},selectMFAType:function(n,r){Je.debug("signIn selectMFAType",n),e["challengeName"]=n,e["challengeParam"]=r,t(e)}}},e.prototype.signInWithPassword=function(e){var t=this;if(this.pendingSignIn)throw new Error("Pending sign-in attempt already in progress");var n=this.createCognitoUser(e.getUsername());return this.pendingSignIn=new Promise((function(r,i){n.authenticateUser(e,t.authCallbacks(n,(function(e){t.pendingSignIn=null,r(e)}),(function(e){t.pendingSignIn=null,i(e)})))})),this.pendingSignIn},e.prototype.signInWithoutPassword=function(e){var t=this,n=this.createCognitoUser(e.getUsername());return n.setAuthenticationFlowType("CUSTOM_AUTH"),new Promise((function(r,i){n.initiateAuth(e,t.authCallbacks(n,r,i))}))},e.prototype.getMFAOptions=function(e){return new Promise((function(t,n){e.getMFAOptions((function(e,r){if(e)return Je.debug("get MFA Options failed",e),void n(e);Je.debug("get MFA options success",r),t(r)}))}))},e.prototype.getPreferredMFA=function(e,t){var n=this,r=this;return new Promise((function(i,o){var s=n._config.clientMetadata,a=!!t&&t.bypassCache;e.getUserData((function(e,t){if(e)return Je.debug("getting preferred mfa failed",e),void o(e);var n=r._getMfaTypeFromUserData(t);return n?void i(n):void o("invalid MFA Type")}),{bypassCache:a,clientMetadata:s})}))},e.prototype._getMfaTypeFromUserData=function(e){var t=null,n=e.PreferredMfaSetting;if(n)t=n;else{var r=e.UserMFASettingList;if(r)0===r.length?t="NOMFA":Je.debug("invalid case for getPreferredMFA",e);else{var i=e.MFAOptions;t=i?"SMS_MFA":"NOMFA"}}return t},e.prototype._getUserData=function(e,t){return new Promise((function(n,r){e.getUserData((function(e,t){return e?(Je.debug("getting user data failed",e),void r(e)):void n(t)}),t)}))},e.prototype.setPreferredMFA=function(e,t){return qe(this,void 0,void 0,(function(){var n,r,o,s,a,u,c;return Ke(this,(function(l){switch(l.label){case 0:return n=this._config.clientMetadata,[4,this._getUserData(e,{bypassCache:!0,clientMetadata:n})];case 1:switch(r=l.sent(),o=null,s=null,a=t,a){case"TOTP":return[3,2];case"SMS":return[3,3];case"NOMFA":return[3,4]}return[3,6];case 2:return s={PreferredMfa:!0,Enabled:!0},[3,7];case 3:return o={PreferredMfa:!0,Enabled:!0},[3,7];case 4:return u=r["UserMFASettingList"],[4,this._getMfaTypeFromUserData(r)];case 5:if(c=l.sent(),"NOMFA"===c)return[2,Promise.resolve("No change for mfa type")];if("SMS_MFA"===c)o={PreferredMfa:!1,Enabled:!1};else{if("SOFTWARE_TOKEN_MFA"!==c)return[2,this.rejectAuthError(i.InvalidMFA)];s={PreferredMfa:!1,Enabled:!1}}return u&&0!==u.length&&u.forEach((function(e){"SMS_MFA"===e?o={PreferredMfa:!1,Enabled:!1}:"SOFTWARE_TOKEN_MFA"===e&&(s={PreferredMfa:!1,Enabled:!1})})),[3,7];case 6:return Je.debug("no validmfa method provided"),[2,this.rejectAuthError(i.NoMFA)];case 7:return this,[2,new Promise((function(t,r){e.setUserMfaPreference(o,s,(function(i,o){if(i)return Je.debug("Set user mfa preference error",i),r(i);Je.debug("Set user mfa success",o),Je.debug("Caching the latest user data into local"),e.getUserData((function(e,n){return e?(Je.debug("getting user data failed",e),r(e)):t(o)}),{bypassCache:!0,clientMetadata:n})}))}))]}}))}))},e.prototype.disableSMS=function(e){return new Promise((function(t,n){e.disableMFA((function(e,r){if(e)return Je.debug("disable mfa failed",e),void n(e);Je.debug("disable mfa succeed",r),t(r)}))}))},e.prototype.enableSMS=function(e){return new Promise((function(t,n){e.enableMFA((function(e,r){if(e)return Je.debug("enable mfa failed",e),void n(e);Je.debug("enable mfa succeed",r),t(r)}))}))},e.prototype.setupTOTP=function(e){return new Promise((function(t,n){e.associateSoftwareToken({onFailure:function(e){Je.debug("associateSoftwareToken failed",e),n(e)},associateSecretCode:function(e){Je.debug("associateSoftwareToken sucess",e),t(e)}})}))},e.prototype.verifyTotpToken=function(e,t){return Je.debug("verification totp token",e,t),new Promise((function(n,r){e.verifySoftwareToken(t,"My TOTP device",{onFailure:function(e){Je.debug("verifyTotpToken failed",e),r(e)},onSuccess:function(t){$e("signIn",e,"A user "+e.getUsername()+" has been signed in"),Je.debug("verifyTotpToken success",t),n(t)}})}))},e.prototype.confirmSignIn=function(e,t,n,r){var o=this;if(void 0===r&&(r=this._config.clientMetadata),!t)return this.rejectAuthError(i.EmptyCode);var s=this;return new Promise((function(i,a){e.sendMFACode(t,{onSuccess:function(t){return qe(o,void 0,void 0,(function(){var n,r;return Ke(this,(function(o){switch(o.label){case 0:Je.debug(t),o.label=1;case 1:return o.trys.push([1,4,5,6]),[4,this.Credentials.clear()];case 2:return o.sent(),[4,this.Credentials.set(t,"session")];case 3:return n=o.sent(),Je.debug("succeed to get cognito credentials",n),[3,6];case 4:return r=o.sent(),Je.debug("cannot get cognito credentials",r),[3,6];case 5:return s.user=e,$e("signIn",e,"A user "+e.getUsername()+" has been signed in"),i(e),[7];case 6:return[2]}}
1))}))},onFailure:function(e){Je.debug("confirm signIn failure",e),a(e)}},n,r)}))},e.prototype.completeNewPassword=function(e,t,n,r){var o=this;if(void 0===n&&(n={}),void 0===r&&(r=this._config.clientMetadata),!t)return this.rejectAuthError(i.EmptyPassword);var s=this;return new Promise((function(i,a){e.completeNewPasswordChallenge(t,n,{onSuccess:function(t){return qe(o,void 0,void 0,(function(){var n,r;return Ke(this,(function(o){switch(o.label){case 0:Je.debug(t),o.label=1;case 1:return o.trys.push([1,4,5,6]),[4,this.Credentials.clear()];case 2:return o.sent(),[4,this.Credentials.set(t,"session")];case 3:return n=o.sent(),Je.debug("succeed to get cognito credentials",n),[3,6];case 4:return r=o.sent(),Je.debug("cannot get cognito credentials",r),[3,6];case 5:return s.user=e,$e("signIn",e,"A user "+e.getUsername()+" has been signed in"),i(e),[7];case 6:return[2]}}))}))},onFailure:function(e){Je.debug("completeNewPassword failure",e),$e("completeNewPassword_failure",e,o.user+" failed to complete the new password flow"),a(e)},mfaRequired:function(t,n){Je.debug("signIn MFA required"),e["challengeName"]=t,e["challengeParam"]=n,i(e)},mfaSetup:function(t,n){Je.debug("signIn mfa setup",t),e["challengeName"]=t,e["challengeParam"]=n,i(e)},totpRequired:function(t,n){Je.debug("signIn mfa setup",t),e["challengeName"]=t,e["challengeParam"]=n,i(e)}},r)}))},e.prototype.sendCustomChallengeAnswer=function(e,t,n){var r=this;if(void 0===n&&(n=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!t)return this.rejectAuthError(i.EmptyChallengeResponse);return new Promise((function(i,o){e.sendCustomChallengeAnswer(t,r.authCallbacks(e,i,o),n)}))},e.prototype.updateUserAttributes=function(e,t,n){void 0===n&&(n=this._config.clientMetadata);var r=[],i=this;return new Promise((function(o,s){i.userSession(e).then((function(i){for(var a in t)if("sub"!==a&&a.indexOf("_verified")<0){var u={Name:a,Value:t[a]};r.push(u)}e.updateAttributes(r,(function(e,t){return e?s(e):o(t)}),n)}))}))},e.prototype.userAttributes=function(e){var t=this;return new Promise((function(n,r){t.userSession(e).then((function(t){e.getUserAttributes((function(e,t){e?r(e):n(t)}))}))}))},e.prototype.verifiedContact=function(e){var t=this;return this.userAttributes(e).then((function(e){var n=t.attributesToObject(e),r={},i={};return n["email"]&&(n["email_verified"]?i["email"]=n["email"]:r["email"]=n["email"]),n["phone_number"]&&(n["phone_number_verified"]?i["phone_number"]=n["phone_number"]:r["phone_number"]=n["phone_number"]),{verified:i,unverified:r}}))},e.prototype.currentUserPoolUser=function(e){var t=this;return this.userPool?new Promise((function(n,r){t._storageSync.then((function(){return qe(t,void 0,void 0,(function(){var t,i,o=this;return Ke(this,(function(s){switch(s.label){case 0:return this.isOAuthInProgress()?(Je.debug("OAuth signIn in progress, waiting for resolution..."),[4,new Promise((function(e){var t=setTimeout((function(){Je.debug("OAuth signIn in progress timeout"),b.remove("auth",n),e()}),Xe);function n(r){var i=r.payload,o=i.event;"cognitoHostedUI"!==o&&"cognitoHostedUI_failure"!==o||(Je.debug("OAuth signIn resolved: "+o),clearTimeout(t),b.remove("auth",n),e())}b.listen("auth",n)}))]):[3,2];case 1:s.sent(),s.label=2;case 2:return t=this.userPool.getCurrentUser(),t?(i=this._config.clientMetadata,t.getSession((function(i,s){return qe(o,void 0,void 0,(function(){var o,a,u,c,l=this;return Ke(this,(function(f){switch(f.label){case 0:return i?(Je.debug("Failed to get the user session",i),r(i),[2]):(o=!!e&&e.bypassCache,o?[4,this.Credentials.clear()]:[3,2]);case 1:f.sent(),f.label=2;case 2:return a=this._config.clientMetadata,u=s.getAccessToken().decodePayload().scope,c=void 0===u?"":u,c.split(" ").includes(Qe)?(t.getUserData((function(e,i){if(e)return Je.debug("getting user data failed",e),void("User is disabled."===e.message||"User does not exist."===e.message||"Access Token has been revoked"===e.message?r(e):n(t));for(var o=i.PreferredMfaSetting||"NOMFA",s=[],a=0;a<i.UserAttributes.length;a++){var u={Name:i.UserAttributes[a].Name,Value:i.UserAttributes[a].Value},c=new be["f"](u);s.push(c)}var f=l.attributesToObject(s);return Object.assign(t,{attributes:f,preferredMFA:o}),n(t)}),{bypassCache:o,clientMetadata:a}),[2]):(Je.debug("Unable to get the user data because the "+Qe+" is not in the scopes of the access token"),[2,n(t)])}}))}))}),{clientMetadata:i}),[2]):(Je.debug("Failed to get user from user pool"),r("No current user"),[2])}}))}))})).catch((function(e){return Je.debug("Failed to sync cache info into memory",e),r(e)}))})):this.rejectNoUserPool()},e.prototype.isOAuthInProgress=function(){return this.oAuthFlowInProgress},e.prototype.currentAuthenticatedUser=function(e){return qe(this,void 0,void 0,(function(){var t,n,r,i,o;return Ke(this,(function(s){switch(s.label){case 0:Je.debug("getting current authenticated user"),t=null,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this._storageSync];case 2:return s.sent(),[3,4];case 3:throw n=s.sent(),Je.debug("Failed to sync cache info into memory",n),n;case 4:try{r=JSON.parse(this._storage.getItem("aws-amplify-federatedInfo")),r&&(t=Ve(Ve({},r.user),{token:r.token}))}catch(a){Je.debug("cannot load federated user from auth storage")}return t?(this.user=t,Je.debug("get current authenticated federated user",this.user),[2,this.user]):[3,5];case 5:Je.debug("get current authenticated userpool user"),i=null,s.label=6;case 6:return s.trys.push([6,8,,9]),[4,this.currentUserPoolUser(e)];case 7:return i=s.sent(),[3,9];case 8:return o=s.sent(),"No userPool"===o&&Je.error("Cannot get the current user because the user pool is missing. Please make sure the Auth module is configured with a valid Cognito User Pool ID"),Je.debug("The user is not authenticated by the error",o),[2,Promise.reject("The user is not authenticated")];case 9:return this.user=i,[2,this.user]}}
1))}))},e.prototype.currentSession=function(){var e=this;return Je.debug("Getting current session"),this.userPool?new Promise((function(t,n){e.currentUserPoolUser().then((function(r){e.userSession(r).then((function(e){t(e)})).catch((function(e){Je.debug("Failed to get the current session",e),n(e)}))})).catch((function(e){Je.debug("Failed to get the current user",e),n(e)}))})):Promise.reject()},e.prototype.userSession=function(e){if(!e)return Je.debug("the user is null"),this.rejectAuthError(i.NoUserSession);var t=this._config.clientMetadata;return new Promise((function(n,r){Je.debug("Getting the session from this user:",e),e.getSession((function(t,i){return t?(Je.debug("Failed to get the session from user",e),void r(t)):(Je.debug("Succeed to get the user session",i),void n(i))}),{clientMetadata:t})}))},e.prototype.currentUserCredentials=function(){return qe(this,void 0,void 0,(function(){var e,t,n=this;return Ke(this,(function(r){switch(r.label){case 0:Je.debug("Getting current user credentials"),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._storageSync];case 2:return r.sent(),[3,4];case 3:throw e=r.sent(),Je.debug("Failed to sync cache info into memory",e),e;case 4:t=null;try{t=JSON.parse(this._storage.getItem("aws-amplify-federatedInfo"))}catch(i){Je.debug("failed to get or parse item aws-amplify-federatedInfo",i)}return t?[2,this.Credentials.refreshFederatedToken(t)]:[2,this.currentSession().then((function(e){return Je.debug("getting session success",e),n.Credentials.set(e,"session")})).catch((function(e){return Je.debug("getting session failed",e),n.Credentials.set(null,"guest")}))]}}))}))},e.prototype.currentCredentials=function(){return Je.debug("getting current credentials"),this.Credentials.get()},e.prototype.verifyUserAttribute=function(e,t,n){return void 0===n&&(n=this._config.clientMetadata),new Promise((function(r,i){e.getAttributeVerificationCode(t,{onSuccess:function(){return r()},onFailure:function(e){return i(e)}},n)}))},e.prototype.verifyUserAttributeSubmit=function(e,t,n){return n?new Promise((function(r,i){e.verifyAttribute(t,n,{onSuccess:function(e){r(e)},onFailure:function(e){i(e)}})})):this.rejectAuthError(i.EmptyCode)},e.prototype.verifyCurrentUserAttribute=function(e){var t=this;return t.currentUserPoolUser().then((function(n){return t.verifyUserAttribute(n,e)}))},e.prototype.verifyCurrentUserAttributeSubmit=function(e,t){var n=this;return n.currentUserPoolUser().then((function(r){return n.verifyUserAttributeSubmit(r,e,t)}))},e.prototype.cognitoIdentitySignOut=function(e,t){return qe(this,void 0,void 0,(function(){var n,r,i=this;return Ke(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._storageSync];case 1:return o.sent(),[3,3];case 2:throw n=o.sent(),Je.debug("Failed to sync cache info into memory",n),n;case 3:return r=this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI"),[2,new Promise((function(n,o){if(e&&e.global){Je.debug("user global sign out",t);var s=i._config.clientMetadata;t.getSession((function(e,s){if(e)return Je.debug("failed to get the user session",e),o(e);t.globalSignOut({onSuccess:function(e){if(Je.debug("global sign out success"),!r)return n();i.oAuthSignOutRedirect(n,o)},onFailure:function(e){return Je.debug("global sign out failed",e),o(e)}})}),{clientMetadata:s})}else{if(Je.debug("user sign out",t),t.signOut(),!r)return n();i.oAuthSignOutRedirect(n,o)}}))]}}))}))},e.prototype.oAuthSignOutRedirect=function(e,t){var n=I["a"].browserOrNode().isBrowser;n?this.oAuthSignOutRedirectOrReject(t):this.oAuthSignOutAndResolve(e)},e.prototype.oAuthSignOutAndResolve=function(e){this._oAuthHandler.signOut(),e()},e.prototype.oAuthSignOutRedirectOrReject=function(e){this._oAuthHandler.signOut(),setTimeout((function(){return e("Signout timeout fail")}),3e3)},e.prototype.signOut=function(e){return qe(this,void 0,void 0,(function(){var t;return Ke(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.cleanCachedItems()];case 1:return n.sent(),[3,3];case 2:return n.sent(),Je.debug("failed to clear cached items"),[3,3];case 3:return this.userPool?(t=this.userPool.getCurrentUser(),t?[4,this.cognitoIdentitySignOut(e,t)]:[3,5]):[3,7];case 4:return n.sent(),[3,6];case 5:Je.debug("no current Cognito user"),n.label=6;case 6:return[3,8];case 7:Je.debug("no Congito User pool"),n.label=8;case 8:return $e("signOut",this.user,"A user has been signed out"),this.user=null,[2]}}))}))},e.prototype.cleanCachedItems=function(){return qe(this,void 0,void 0,(function(){return Ke(this,(function(e){switch(e.label){case 0:return[4,this.Credentials.clear()];case 1:return e.sent(),[2]}}))}))},e.prototype.changePassword=function(e,t,n,r){var i=this;return void 0===r&&(r=this._config.clientMetadata),new Promise((function(o,s){i.userSession(e).then((function(i){e.changePassword(t,n,(function(e,t){return e?(Je.debug("change password failure",e),s(e)):o(t)}),r)}))}))},e.prototype.forgotPassword=function(e,t){if(void 0===t&&(t=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.EmptyUsername);var n=this.createCognitoUser(e);return new Promise((function(r,i){n.forgotPassword({onSuccess:function(){r()},onFailure:function(t){Je.debug("forgot password failure",t),$e("forgotPassword_failure",t,e+" forgotPassword failed"),i(t)},inputVerificationCode:function(t){$e("forgotPassword",n,e+" has initiated forgot password flow"),r(t)}},t)}))},e.prototype.forgotPasswordSubmit=function(e,t,n,r){if(void 0===r&&(r=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.EmptyUsername);if(!t)return this.rejectAuthError(i.EmptyCode);if(!n)return this.rejectAuthError(i.EmptyPassword);var o=this.createCognitoUser(e);return new Promise((function(i,s){o.confirmPassword(t,n,{onSuccess:function(){$e("forgotPasswordSubmit",o,e+" forgotPasswordSubmit successful"),i()},onFailure:function(t){$e("forgotPasswordSubmit_failure",t,e+" forgotPasswordSubmit failed"),s(t)}},r)}))},e.prototype.currentUserInfo=function(){return qe(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a;return Ke(this,(function(u){switch(u.label){case 0:return e=this.Credentials.getCredSource(),e&&"aws"!==e&&"userPool"!==e?[3,9]:[4,this.currentUserPoolUser().catch((function(e){return Je.debug(e)}))];case 1:if(a=u.sent(),!a)return[2,null];u.label=2;case 2:return u.trys.push([2,8,,9]),[4,this.userAttributes(a)];case 3:t=u.sent(),n=this.attributesToObject(t),r=null,u.label=4;case 4:return u.trys.push([4,6,,7]),[4,this.currentCredentials()];case 5:return r=u.sent(),[3,7];case 6:return i=u.sent(),Je.debug("Failed to retrieve credentials while getting current user info",i),[3,7];case 7:return o={id:r?r.identityId:void 0,username:a.getUsername(),attributes:n},[2,o];case 8:return s=u.sent(),Je.debug("currentUserInfo error",s),[2,{}];case 9:return"federated"===e?(a=this.user,[2,a||{}]):[2]}}))}))},e.prototype.federatedSignIn=function(e,t,n){return qe(this,void 0,void 0,(function(){var i,c,l,f,d,h,p,g,y,m,b;return Ke(this,(function(v){switch(v.label){case 0:if(!this._config.identityPoolId&&!this._config.userPoolId)throw new Error("Federation requires either a User Pool or Identity Pool in config");if("undefined"===typeof e&&this._config.identityPoolId&&!this._config.userPoolId)throw new Error("Federation with Identity Pools requires tokens passed as arguments");return o(e)||s(e)||a(e)||"undefined"===typeof e?(i=e||{provider:r.Cognito},d=o(i)?i.provider:i.customProvider,o(i),c=i.customState,this._config.userPoolId&&(l=u(this._config.oauth)?this._config.userPoolWebClientId:this._config.oauth.clientID,f=u(this._config.oauth)?this._config.oauth.redirectSignIn:this._config.oauth.redirectUri,this._oAuthHandler.oauthSignIn(this._config.oauth.responseType,this._config.oauth.domain,f,l,d,c)),[3,4]):[3,1];case 1:d=e;try{h=JSON.stringify(JSON.parse(this._storage.getItem("aws-amplify-federatedInfo")).user),h&&Je.warn("There is already a signed in user: "+h+" in your app.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tYou should not call Auth.federatedSignIn method again as it may cause unexpected behavior.")}catch(w){}return p=t.token,g=t.identity_id,y=t.expires_at,[4,this.Credentials.set({provider:d,token:p,identity_id:g,user:n,expires_at:y},"federation")];case 2:return m=v.sent(),[4,this.currentAuthenticatedUser()];case 3:return b=v.sent(),$e("signIn",b,"A user "+b.username+" has been signed in"),Je.debug("federated sign in credentials",m),[2,m];case 4:return[2]}}
1))}))},e.prototype._handleAuthResponse=function(e){return qe(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u,c,l,f,d,h,p;return Ke(this,(function(g){switch(g.label){case 0:if(this.oAuthFlowInProgress)return Je.debug("Skipping URL "+e+" current flow in progress"),[2];g.label=1;case 1:if(g.trys.push([1,,8,9]),this.oAuthFlowInProgress=!0,!this._config.userPoolId)throw new Error("OAuth responses require a User Pool defined in config");if($e("parsingCallbackUrl",{url:e},"The callback url is being parsed"),t=e||(I["a"].browserOrNode().isBrowser?window.location.href:""),n=!!(Object(ve["parse"])(t).query||"").split("&").map((function(e){return e.split("=")})).find((function(e){var t=Ye(e,1),n=t[0];return"code"===n||"error"===n})),r=!!(Object(ve["parse"])(t).hash||"#").substr(1).split("&").map((function(e){return e.split("=")})).find((function(e){var t=Ye(e,1),n=t[0];return"access_token"===n||"error"===n})),!n&&!r)return[3,7];this._storage.setItem("amplify-redirected-from-hosted-ui","true"),g.label=2;case 2:return g.trys.push([2,6,,7]),[4,this._oAuthHandler.handleAuthResponse(t)];case 3:return i=g.sent(),o=i.accessToken,s=i.idToken,a=i.refreshToken,u=i.state,c=new be["h"]({IdToken:new be["c"]({IdToken:s}),RefreshToken:new be["d"]({RefreshToken:a}),AccessToken:new be["b"]({AccessToken:o})}),l=void 0,this._config.identityPoolId?[4,this.Credentials.set(c,"session")]:[3,5];case 4:l=g.sent(),Je.debug("AWS credentials",l),g.label=5;case 5:return f=/-/.test(u),d=this.createCognitoUser(c.getIdToken().decodePayload()["cognito:username"]),d.setSignInUserSession(c),window&&"undefined"!==typeof window.history&&window.history.replaceState({},null,this._config.oauth.redirectSignIn),$e("signIn",d,"A user "+d.getUsername()+" has been signed in"),$e("cognitoHostedUI",d,"A user "+d.getUsername()+" has been signed in via Cognito Hosted UI"),f&&(h=u.split("-").splice(1).join("-"),$e("customOAuthState",ye(h),"State for user "+d.getUsername())),[2,l];case 6:return p=g.sent(),Je.debug("Error in cognito hosted auth response",p),$e("signIn_failure",p,"The OAuth response flow failed"),$e("cognitoHostedUI_failure",p,"A failure occurred when returning to the Cognito Hosted UI"),$e("customState_failure",p,"A failure occurred when returning state"),[3,7];case 7:return[3,9];case 8:return this.oAuthFlowInProgress=!1,[7];case 9:return[2]}}
1))}))},e.prototype.essentialCredentials=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e.prototype.attributesToObject=function(e){var t={};return e&&e.map((function(e){"email_verified"===e.Name||"phone_number_verified"===e.Name?t[e.Name]="true"===e.Value||!0===e.Value:t[e.Name]=e.Value})),t},e.prototype.createCognitoUser=function(e){var t={Username:e,Pool:this.userPool};t.Storage=this._storage;var n=this._config.authenticationFlowType,r=new be["e"](t);return n&&r.setAuthenticationFlowType(n),r},e.prototype._isValidAuthStorage=function(e){return!!e&&"function"===typeof e.getItem&&"function"===typeof e.setItem&&"function"===typeof e.removeItem&&"function"===typeof e.clear},e.prototype.noUserPoolErrorHandler=function(e){return!e||e.userPoolId&&e.identityPoolId?i.NoConfig:i.MissingAuthConfig},e.prototype.rejectAuthError=function(e){return Promise.reject(new Be(e))},e.prototype.rejectNoUserPool=function(){var e=this.noUserPoolErrorHandler(this._config);return Promise.reject(new We(e))},e}(),tt=new et(null);X["a"].register(tt)}}]); 2//# sourceMappingURL=chunk-vendors~bfebd808.2dd5aa3a.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.