/*! For license information please see main.1bd300ef.js.LICENSE.txt */ (()=>{var e={16(e,t,n){"use strict";e.exports=n(2563)},76(e,t,n){"use strict";e.exports=n(3472)},570(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},683(e,t,n){"use strict";n.d(t,{H:()=>a});var r=n(8592),i=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},o=new r.C("Amplify"),a=new(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.Geo=null,this.Notifications=null,this.Logger=r.C,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}())},765(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var r=n(7121),i=function(){function e(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var i=this.bufferLength;i>>24&255,o[4*i+1]=this.state[i]>>>16&255,o[4*i+2]=this.state[i]>>>8&255,o[4*i+3]=this.state[i]>>>0&255;return o},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],l=t[6],c=t[7],f=0;f>>17|h<<15)^(h>>>19|h<<13)^h>>>10,p=((h=this.temp[f-15])>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;this.temp[f]=(d+this.temp[f-7]|0)+(p+this.temp[f-16]|0)}var g=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&u^~s&l)|0)+(c+(r.KEY[f]+this.temp[f]|0)|0)|0,m=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&i^n&o^i&o)|0;c=l,l=u,u=s,s=a+g|0,a=o,o=i,i=n,n=g+m|0}t[0]+=n,t[1]+=i,t[2]+=o,t[3]+=a,t[4]+=s,t[5]+=u,t[6]+=l,t[7]+=c},e}();t.RawSha256=i},898(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(9620),i=n(7121),o=n(765),a=n(6581),s=function(){function e(e){if(this.hash=new o.RawSha256,e){this.outer=new o.RawSha256;var t=function(e){var t=(0,a.convertToBuffer)(e);if(t.byteLength>i.BLOCK_SIZE){var n=new o.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(i.BLOCK_SIZE);return r.set(t),r}(e),n=new Uint8Array(i.BLOCK_SIZE);n.set(t);for(var r=0;r=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(r)return z(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return U(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return P(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"===typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var f=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128===(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128===(192&o)&&128===(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(r,i),c=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return S(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function A(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function D(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function M(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function L(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,r,o){return o||L(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,o){return o||L(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||O(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);O(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function V(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function H(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}},1356(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(0,n(9620).__exportStar)(n(898),t)},1503(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Array.from){for(var t=new Uint32Array(e.length);0s})},2346(e,t,n){"use strict";e.exports=n(2467)},2467(e,t){"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0>>1,i=e[r];if(!(0>>1;ro(u,n))lo(c,u)?(e[r]=c,e[l]=n,r=l):(e[r]=u,e[s]=n,r=s);else{if(!(lo(c,n)))break e;e[r]=c,e[l]=n,r=l}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,u=s.now();t.unstable_now=function(){return s.now()-u}}var l=[],c=[],f=1,h=null,d=3,p=!1,g=!1,m=!1,y="function"===typeof setTimeout?setTimeout:null,v="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function w(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(l,t)}t=r(c)}}function S(e){if(m=!1,w(e),!g)if(null!==r(l))g=!0,O(_);else{var t=r(c);null!==t&&D(S,t.startTime-e)}}function _(e,n){g=!1,m&&(m=!1,v(C),C=-1),p=!0;var o=d;try{for(w(n),h=r(l);null!==h&&(!(h.expirationTime>n)||e&&!P());){var a=h.callback;if("function"===typeof a){h.callback=null,d=h.priorityLevel;var s=a(h.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?h.callback=s:h===r(l)&&i(l),w(n)}else i(l);h=r(l)}if(null!==h)var u=!0;else{var f=r(c);null!==f&&D(S,f.startTime-n),u=!1}return u}finally{h=null,d=o,p=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var k,I=!1,E=null,C=-1,T=5,A=-1;function P(){return!(t.unstable_now()-Ae||125a?(e.sortIndex=o,n(c,e),null===r(l)&&e===r(c)&&(m?(v(C),C=-1):m=!0,D(S,o-a))):(e.sortIndex=s,n(l,e),g||p||(g=!0,O(_))),e},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(e){var t=d;return function(){var n=d;d=t;try{return e.apply(this,arguments)}finally{d=n}}}},2563(e,t){"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),u=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),d=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,m={};function y(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||p}function v(){}function b(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||p}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=y.prototype;var w=b.prototype=new v;w.constructor=b,g(w,y.prototype),w.isPureReactComponent=!0;var S=Array.isArray,_=Object.prototype.hasOwnProperty,k={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function E(e,t,r){var i,o={},a=null,s=null;if(null!=t)for(i in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)_.call(t,i)&&!I.hasOwnProperty(i)&&(o[i]=t[i]);var u=arguments.length-2;if(1===u)o.children=r;else if(1>1,c=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=l}return(d?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[n+d]=255&a,d+=p,a/=256,l-=8);e[n+d-p]|=128*g}},3368(e){"use strict";e.exports={isString:function(e){return"string"===typeof e},isObject:function(e){return"object"===typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},3402(e,t,n){"use strict";function r(e,t){return t=t||{},new Promise(function(n,r){var i=new XMLHttpRequest,o=[],a=[],s={},u=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var l in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,n){o.push(t=t.toLowerCase()),a.push([t,n]),s[t]=s[t]?s[t]+","+n:n}),n(u())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(l,t.headers[l]);i.send(t.body||null)})}n.r(t),n.d(t,{default:()=>r})},3403(e,t,n){"use strict";var r;n.d(t,{C5:()=>U,Ix:()=>x,Rq:()=>u,V8:()=>P,ph:()=>y,sp:()=>s,wE:()=>R});var i=n(16),o=n(5496);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t{n.current=!0}),i.useCallback(function(r,i){void 0===i&&(i={}),n.current&&("number"===typeof r?e.navigate(r):e.navigate(r,a({fromRouteId:t},i)))},[e,t])}():function(){d()||(0,o.Oi)(!1);let e=i.useContext(s),{basename:t,future:n,navigator:r}=i.useContext(l),{matches:a}=i.useContext(f),{pathname:u}=p(),c=JSON.stringify((0,o.yD)(a,n.v7_relativeSplatPath)),h=i.useRef(!1);return g(()=>{h.current=!0}),i.useCallback(function(n,i){if(void 0===i&&(i={}),!h.current)return;if("number"===typeof n)return void r.go(n);let a=(0,o.Gh)(n,JSON.parse(c),u,"path"===i.relative);null==e&&"/"!==t&&(a.pathname="/"===a.pathname?t:(0,o.HS)([t,a.pathname])),(i.replace?r.replace:r.push)(a,i.state,i)},[t,r,c,u,e])}()}function y(e,t,n,r){d()||(0,o.Oi)(!1);let{navigator:s}=i.useContext(l),{matches:u}=i.useContext(f),h=u[u.length-1],g=h?h.params:{},m=(h&&h.pathname,h?h.pathnameBase:"/");h&&h.route;let y,v=p();if(t){var b;let e="string"===typeof t?(0,o.Rr)(t):t;"/"===m||(null==(b=e.pathname)?void 0:b.startsWith(m))||(0,o.Oi)(!1),y=e}else y=v;let w=y.pathname||"/",S=w;if("/"!==m){let e=m.replace(/^\//,"").split("/");S="/"+w.replace(/^\//,"").split("/").slice(e.length).join("/")}let k=(0,o.ue)(e,{pathname:S});let I=_(k&&k.map(e=>Object.assign({},e,{params:Object.assign({},g,e.params),pathname:(0,o.HS)([m,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?m:(0,o.HS)([m,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),u,n,r);return t&&I?i.createElement(c.Provider,{value:{location:a({pathname:"/",search:"",hash:"",state:null,key:"default"},y),navigationType:o.rc.Pop}},I):I}function v(){let e=function(){var e;let t=i.useContext(h),n=C(I.UseRouteError),r=T(I.UseRouteError);if(void 0!==t)return t;return null==(e=n.errors)?void 0:e[r]}(),t=(0,o.pX)(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r};return i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),n?i.createElement("pre",{style:a},n):null,null)}const b=i.createElement(v,null);class w extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?i.createElement(f.Provider,{value:this.props.routeContext},i.createElement(h.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function S(e){let{routeContext:t,match:n,children:r}=e,o=i.useContext(s);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),i.createElement(f.Provider,{value:t},r)}function _(e,t,n,r){var a;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===r&&(r=null),null==e){var s;if(!n)return null;if(n.errors)e=n.matches;else{if(!(null!=(s=r)&&s.v7_partialHydration&&0===t.length&&!n.initialized&&n.matches.length>0))return null;e=n.matches}}let u=e,l=null==(a=n)?void 0:a.errors;if(null!=l){let e=u.findIndex(e=>e.route.id&&void 0!==(null==l?void 0:l[e.route.id]));e>=0||(0,o.Oi)(!1),u=u.slice(0,Math.min(u.length,e+1))}let c=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let i=0;i=0?u.slice(0,f+1):[u[0]];break}}}return u.reduceRight((e,r,o)=>{let a,s=!1,h=null,d=null;var p;n&&(a=l&&r.route.id?l[r.route.id]:void 0,h=r.route.errorElement||b,c&&(f<0&&0===o?(p="route-fallback",!1||A[p]||(A[p]=!0),s=!0,d=null):f===o&&(s=!0,d=r.route.hydrateFallbackElement||null)));let g=t.concat(u.slice(0,o+1)),m=()=>{let t;return t=a?h:s?d:r.route.Component?i.createElement(r.route.Component,null):r.route.element?r.route.element:e,i.createElement(S,{match:r,routeContext:{outlet:e,matches:g,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?i.createElement(w,{location:n.location,revalidation:n.revalidation,component:h,error:a,children:m(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):m()},null)}var k=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(k||{}),I=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(I||{});function E(e){let t=i.useContext(s);return t||(0,o.Oi)(!1),t}function C(e){let t=i.useContext(u);return t||(0,o.Oi)(!1),t}function T(e){let t=function(){let e=i.useContext(f);return e||(0,o.Oi)(!1),e}(),n=t.matches[t.matches.length-1];return n.route.id||(0,o.Oi)(!1),n.route.id}const A={};function P(e,t){null==e||e.v7_startTransition,void 0===(null==e?void 0:e.v7_relativeSplatPath)&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}(r||(r=n.t(i,2))).startTransition;function U(e){let{to:t,replace:n,state:r,relative:a}=e;d()||(0,o.Oi)(!1);let{future:s,static:u}=i.useContext(l),{matches:c}=i.useContext(f),{pathname:h}=p(),g=m(),y=(0,o.Gh)(t,(0,o.yD)(c,s.v7_relativeSplatPath),h,"path"===a),v=JSON.stringify(y);return i.useEffect(()=>g(JSON.parse(v),{replace:n,state:r,relative:a}),[g,v,a,n,r]),null}function x(e){let{basename:t="/",children:n=null,location:r,navigationType:s=o.rc.Pop,navigator:u,static:f=!1,future:h}=e;d()&&(0,o.Oi)(!1);let p=t.replace(/^\/*/,"/"),g=i.useMemo(()=>({basename:p,navigator:u,static:f,future:a({v7_relativeSplatPath:!1},h)}),[p,h,u,f]);"string"===typeof r&&(r=(0,o.Rr)(r));let{pathname:m="/",search:y="",hash:v="",state:b=null,key:w="default"}=r,S=i.useMemo(()=>{let e=(0,o.pb)(m,p);return null==e?null:{location:{pathname:e,search:y,hash:v,state:b,key:w},navigationType:s}},[p,m,y,v,b,w,s]);return null==S?null:i.createElement(l.Provider,{value:g},i.createElement(c.Provider,{children:n,value:S}))}new Promise(()=>{});i.Component;function R(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:i.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:i.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:i.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}},3472(e,t,n){"use strict";var r=n(16),i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,n){var r,o={},l=null,c=null;for(r in void 0!==n&&(l=""+n),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(c=t.ref),t)a.call(t,r)&&!u.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:l,ref:c,props:o,_owner:s.current}}t.Fragment=o,t.jsx=l,t.jsxs=l},3481(e,t,n){"use strict";n.d(t,{O:()=>_r,X:()=>kr});var r=n(16),i=function(e,t){return i=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])},i(e,t)};function o(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a,s,u,l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function d(e){return e&&!!["provider"].find(function(t){return e.hasOwnProperty(t)})}function p(e){return void 0!==e.redirectSignIn}!function(e){e.Cognito="COGNITO",e.Google="Google",e.Facebook="Facebook",e.Amazon="LoginWithAmazon",e.Apple="SignInWithApple"}(a||(a={})),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.EmptyChallengeResponse="emptyChallengeResponse",e.NoUserSession="noUserSession",e.Default="default",e.DeviceConfig="deviceConfig",e.NetworkError="networkError",e.AutoSignInError="autoSignInError"}(s||(s={})),function(e){e.API_KEY="API_KEY",e.AWS_IAM="AWS_IAM",e.OPENID_CONNECT="OPENID_CONNECT",e.AMAZON_COGNITO_USER_POOLS="AMAZON_COGNITO_USER_POOLS",e.AWS_LAMBDA="AWS_LAMBDA"}(u||(u={}));var g=n(8592),m=function(){return m=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},v=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i-1)&&(r===w||b.warn("WARNING: ".concat(e," is protected and dispatching on it can have unintended consequences")));var i={channel:e,payload:m({},t),source:n,patternInfo:[]};try{this._toListeners(i)}catch(o){b.error(o)}},e.prototype.listen=function(e,t,n){var r,i=this;if(void 0===n&&(n="noname"),function(e){return void 0!==e.onHubCapsule}(t))b.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){b.debug("Dispatching to ".concat(t," with "),n);try{r.callback(e)}catch(i){b.error(i)}}),this.patterns.length>0){if(!n.message)return void b.warn("Cannot perform pattern matching without a message key");var i=n.message;this.patterns.forEach(function(t){var n=i.match(t.pattern);if(n){var r=y(n).slice(1),o=m(m({},e),{patternInfo:r});try{t.callback(o)}catch(a){b.error(a)}}})}},e}())("__default__"),_={},k=function(){function e(){}return e.setItem=function(e,t){return _[e]=t,_[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(_,e)?_[e]:void 0},e.removeItem=function(e){return delete _[e]},e.clear=function(){return _={}},e}(),I=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=k}}return e.prototype.getStorage=function(){return this.storageWindow},e}(),E=function(){return{isBrowser:"undefined"!==typeof window&&"undefined"!==typeof window.document,isNode:"undefined"!==typeof process&&null!=process.versions&&null!=process.versions.node}},C=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)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),T=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}u((r=r.apply(e,t||[])).next())})},A=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},U=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;ie)&&n}}var M,L,F,N,B,j,z,V,H,K,W,q,Y,G=function(e,t,n,r){return void 0===n&&(n=O),function(e,t,n,r){return T(this,void 0,void 0,function(){var i=this;return A(this,function(o){if("function"!==typeof e)throw Error("functionToRetry must be a function");return[2,new Promise(function(o,a){return T(i,void 0,void 0,function(){var i,s,u,l,c,f,h;return A(this,function(d){switch(d.label){case 0:i=0,s=!1,l=function(){},r&&r.then(function(){s=!0,clearTimeout(u),l()}),f=function(){var r,f,h,d;return A(this,function(p){switch(p.label){case 0:i++,x.debug("".concat(e.name," attempt #").concat(i," with this vars: ").concat(JSON.stringify(t))),p.label=1;case 1:return p.trys.push([1,3,,7]),r={},f=o,[4,e.apply(void 0,U([],P(t),!1))];case 2:return[2,(r.value=f.apply(void 0,[p.sent()]),r)];case 3:return h=p.sent(),c=h,x.debug("error on ".concat(e.name),h),(g=h)&&g.nonRetryable?(x.debug("".concat(e.name," non retryable error"),h),[2,{value:a(h)}]):(d=n(i,t,h),x.debug("".concat(e.name," retrying in ").concat(d," ms")),!1===d||s?[2,{value:a(h)}]:[3,4]);case 4:return[4,new Promise(function(e){l=e,u=setTimeout(l,d)})];case 5:p.sent(),p.label=6;case 6:return[3,7];case 7:return[2]}var g})},d.label=1;case 1:return s?[3,3]:[5,f()];case 2:return"object"===typeof(h=d.sent())?[2,h.value]:[3,1];case 3:return a(c),[2]}})})})]})})}(e,t,D(n),r)},$=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}u((r=r.apply(e,t||[])).next())})},X=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},fe=function(e){var t,n,r=le.partitions;try{for(var i=ce(r),o=i.next();!o.done;o=i.next()){var a=o.value,s=a.regions,u=a.outputs,l=a.regionRegex,c=new RegExp(l);if(s.includes(e)||c.test(e))return u.dnsSuffix}}catch(f){t={error:f}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return ue.outputs.dnsSuffix},he=function(){return he=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=0;a--){o=(0,t[a])(r)(o,i)}return o(n)}},we=(n(8632),function(e){var t;return function(){return t||(t=e()),t}}),Se=function(){return Se=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]l?t.attemptsCount:l+1,t.attemptsCount=l,[4,r(c,u)];case 6:return p.sent()?!(null===o||void 0===o?void 0:o.aborted)&&l0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Re=function(e){return Pe(void 0,void 0,void 0,function(){var t,n,r,i,o,a,s,u,l;return Ue(this,function(c){switch(c.label){case 0:return!e||e.statusCode<300?[2]:[4,Oe(e)];case 1:return t=c.sent(),n=function(e){var t=xe(e.toString().split(/[\,\:]+/),1)[0];return t.includes("#")?t.split("#")[1]:t}(null!==(s=null!==(a=null!==(o=e.headers["x-amzn-errortype"])&&void 0!==o?o:t.code)&&void 0!==a?a:t.__type)&&void 0!==s?s:"UnknownError"),r=null!==(l=null!==(u=t.message)&&void 0!==u?u:t.Message)&&void 0!==l?l:"Unknown error",i=new Error(r),[2,Object.assign(i,{name:n,$metadata:Te(e)})]}})})},Oe=function(e){return Pe(void 0,void 0,void 0,function(){var t;return Ue(this,function(n){switch(n.label){case 0:if(!e.body)throw new Error("Missing response payload");return[4,e.body.json()];case 1:return t=n.sent(),[2,Object.assign(t,{$metadata:Te(e)})]}})})},De=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],Me=function(e){return De.includes(e)},Le=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}u((r=r.apply(e,t||[])).next())})},Fe=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},ot="aws-amplify",at=new(function(){function e(){this.userAgent="".concat(ot,"/").concat(Ke)}return Object.defineProperty(e.prototype,"framework",{get:function(){return et()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isReactNative",{get:function(){return this.framework===M.ReactNative||this.framework===M.Expo},enumerable:!1,configurable:!0}),e.prototype.observeFrameworkChanges=function(e){tt(e)},e}()),st=function(e){return function(e){var t=void 0===e?{}:e,n=t.category,r=t.action,i=(t.framework,[[ot,Ke]]);return n&&i.push([n,r]),i.push(["framework",et()]),i}(e).map(function(e){var t=it(e,2),n=t[0],r=t[1];return"".concat(n,"/").concat(r)}).join(" ")},ut=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}u((r=r.apply(e,t||[])).next())})},lt=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=300?[4,Re(e)]:[3,2];case 1:throw t.sent();case 2:return[4,Oe(e)];case 3:return[2,{IdentityId:t.sent().IdentityId,$metadata:Te(e)}]}})})},ft),St=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}u((r=r.apply(e,t||[])).next())})},_t=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=300?[4,Re(e)]:[3,2];case 1:throw n.sent();case 2:return[4,Oe(e)];case 3:return[2,{IdentityId:(t=n.sent()).IdentityId,Credentials:kt(t.Credentials),$metadata:Te(e)}]}})})},ft),Et=function(){return Et=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1](new Date).getTime()?(xt.debug("token not expired"),this._setCredentialsFromFederation({provider:t,token:r,user:n,identity_id:i,expires_at:o})):a._refreshHandlers[t]&&"function"===typeof a._refreshHandlers[t]?(xt.debug("getting refreshed jwt token from federation provider"),this._providerRefreshWithRetry({refreshHandler:a._refreshHandlers[t],provider:t,user:n})):(xt.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;return G(n,[],1e4).then(function(e){return xt.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){return"string"===typeof e&&0===e.toLowerCase().lastIndexOf("network error",e.length)||t.clear(),xt.debug("refresh federated token failed",e),Promise.reject("refreshing federation token failed: "+e)})},e.prototype._isExpired=function(e){if(!e)return xt.debug("no credentials for expiration check"),!0;xt.debug("are these credentials expired?",e);var t=Date.now();return e.expiration.getTime()<=t},e.prototype._isPastTTL=function(){return this._nextCredentialsRefresh<=Date.now()},e.prototype._setCredentialsForGuest=function(){var e;return Pt(this,void 0,void 0,function(){var t,n,r,i,o,a,s,u,l,c,f=this;return Ut(this,function(h){switch(h.label){case 0:return xt.debug("setting credentials for guest"),(null===(e=this._config)||void 0===e?void 0:e.identityPoolId)||(this._config=Object.assign({},this._config,Tt(this._config||{}).Auth)),t=this._config,n=t.identityPoolId,r=t.region,i=t.mandatorySignIn,o=t.identityPoolRegion,i?[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")]:n?o||r?(s=this,[4,this._getGuestIdentityId()]):(xt.debug("region is not configured for getting the credentials"),[2,Promise.reject("region is not configured for getting the credentials")]):(xt.debug("No Cognito Identity pool provided for unauthenticated access"),[2,Promise.reject("No Cognito Identity pool provided for unauthenticated access")]);case 1:return a=s._identityId=h.sent(),u={region:null!==o&&void 0!==o?o:r},l=function(){return Pt(f,void 0,void 0,function(){var e,t;return Ut(this,function(r){switch(r.label){case 0:return a?[3,2]:[4,wt(u,{IdentityPoolId:n})];case 1:e=r.sent().IdentityId,this._identityId=e,r.label=2;case 2:return[4,It(u,{IdentityId:this._identityId})];case 3:return t=r.sent().Credentials,[2,{identityId:this._identityId,accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretKey,sessionToken:t.SessionToken,expiration:t.Expiration}]}})})},c=l().catch(function(e){return Pt(f,void 0,void 0,function(){return Ut(this,function(t){throw e})})}),[2,this._loadCredentials(c,"guest",!1,null).then(function(e){return e}).catch(function(e){return Pt(f,void 0,void 0,function(){var t,r=this;return Ut(this,function(i){switch(i.label){case 0:return"ResourceNotFoundException"!==e.name||e.message!=="Identity '".concat(a,"' not found.")?[3,2]:(xt.debug("Failed to load guest credentials"),[4,this._removeGuestIdentityId()]);case 1:return i.sent(),t=function(){return Pt(r,void 0,void 0,function(){var e,t;return Ut(this,function(r){switch(r.label){case 0:return[4,wt(u,{IdentityPoolId:n})];case 1:return e=r.sent().IdentityId,this._identityId=e,[4,It(u,{IdentityId:e})];case 2:return t=r.sent().Credentials,[2,{identityId:e,accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretKey,sessionToken:t.SessionToken,expiration:t.Expiration}]}})})},c=t().catch(function(e){return Pt(r,void 0,void 0,function(){return Ut(this,function(t){throw e})})}),[2,this._loadCredentials(c,"guest",!1,null)];case 2:return[2,e]}})})})]}})})},e.prototype._setCredentialsFromFederation=function(e){var t=this,n=e.provider,r=e.token,i=e.identity_id,o={google:"accounts.google.com",facebook:"graph.facebook.com",amazon:"www.amazon.com",developer:"cognito-identity.amazonaws.com"}[n]||n;if(!o)return Promise.reject("You must specify a federated provider");var a={};a[o]=r;var s=this._config,u=s.identityPoolId,l=s.region,c=s.identityPoolRegion;if(!u)return xt.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!c&&!l)return xt.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var f={region:null!==c&&void 0!==c?c:l},h=Pt(t,void 0,void 0,function(){var e,t;return Ut(this,function(n){switch(n.label){case 0:return i?[3,2]:[4,wt(f,{IdentityPoolId:u,Logins:a})];case 1:e=n.sent().IdentityId,i=e,n.label=2;case 2:return[4,It(f,{IdentityId:i,Logins:a})];case 3:return t=n.sent().Credentials,[2,{identityId:i,accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretKey,sessionToken:t.SessionToken,expiration:t.Expiration}]}})}).catch(function(e){return Pt(t,void 0,void 0,function(){return Ut(this,function(t){throw e})})});return this._loadCredentials(h,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){var t=this;xt.debug("set credentials from session");var n=e.getIdToken().getJwtToken(),r=this._config,i=r.region,o=r.userPoolId,a=r.identityPoolId,s=r.identityPoolRegion;if(!a)return xt.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!s&&!i)return xt.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var u={};u["cognito-idp."+i+".amazonaws.com/"+o]=n;var l={region:null!==s&&void 0!==s?s:i},c=Pt(t,void 0,void 0,function(){var e,t,n,r,i,o,s,c,f,h;return Ut(this,function(d){switch(d.label){case 0:return[4,this._getGuestIdentityId()];case 1:return(e=d.sent())?[3,3]:[4,wt(l,{IdentityPoolId:a,Logins:u})];case 2:n=d.sent().IdentityId,t=n,d.label=3;case 3:return[4,It(l,{IdentityId:e||t,Logins:u})];case 4:return r=d.sent(),i=r.Credentials,o=i.AccessKeyId,s=i.Expiration,c=i.SecretKey,f=i.SessionToken,h=r.IdentityId,this._identityId=h,e?(xt.debug("The guest identity ".concat(e," has been successfully linked to the logins")),e===h&&xt.debug("The guest identity ".concat(e," has become the primary identity")),[4,this._removeGuestIdentityId()]):[3,6];case 5:d.sent(),d.label=6;case 6:return[2,{accessKeyId:o,secretAccessKey:c,sessionToken:f,expiration:s,identityId:h}]}})}).catch(function(e){return Pt(t,void 0,void 0,function(){return Ut(this,function(t){throw e})})});return this._loadCredentials(c,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,n,r){var i=this,o=this;return new Promise(function(a,s){e.then(function(e){return Pt(i,void 0,void 0,function(){var i,s,u,l,c;return Ut(this,function(f){switch(f.label){case 0:if(xt.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()+3e6,"federated"===t){i=Object.assign({id:this._credentials.identityId},r.user),s=r.provider,u=r.token,l=r.expires_at,c=r.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:s,token:u,user:i,expires_at:l,identity_id:c}))}catch(h){xt.debug("Failed to put federated info into auth storage",h)}}return"guest"!==t?[3,2]:[4,this._setGuestIdentityId(e.identityId)];case 1:f.sent(),f.label=2;case 2:return a(o._credentials),[2]}})})}).catch(function(t){if(t)return xt.debug("Failed to load credentials",e),xt.debug("Error loading credentials",t),void s(t)})})},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(xt.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return Pt(this,void 0,void 0,function(){return Ut(this,function(e){return this._credentials=null,this._credentials_source=null,xt.debug("removing aws-amplify-federatedInfo from storage"),this._storage.removeItem("aws-amplify-federatedInfo"),[2]})})},e.prototype._getGuestIdentityId=function(){return Pt(this,void 0,void 0,function(){var e,t;return Ut(this,function(n){switch(n.label){case 0:e=this._config.identityPoolId,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._storageSync];case 2:return n.sent(),[2,this._storage.getItem(this._getCognitoIdentityIdStorageKey(e))];case 3:return t=n.sent(),xt.debug("Failed to get the cached guest identityId",t),[3,4];case 4:return[2]}})})},e.prototype._setGuestIdentityId=function(e){return Pt(this,void 0,void 0,function(){var t,n;return Ut(this,function(r){switch(r.label){case 0:t=this._config.identityPoolId,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._storageSync];case 2:return r.sent(),this._storage.setItem(this._getCognitoIdentityIdStorageKey(t),e),[3,4];case 3:return n=r.sent(),xt.debug("Failed to cache guest identityId",n),[3,4];case 4:return[2]}})})},e.prototype._removeGuestIdentityId=function(){return Pt(this,void 0,void 0,function(){var e;return Ut(this,function(t){return e=this._config.identityPoolId,xt.debug("removing ".concat(this._getCognitoIdentityIdStorageKey(e)," from storage")),this._storage.removeItem(this._getCognitoIdentityIdStorageKey(e)),[2]})})},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}(),Dt=new Ot(null);se.H.register(Dt);var Mt,Lt={};var Ft=function(){if(Mt)return Lt;Mt=1,Lt.parse=function(e,n){if("string"!==typeof e)throw new TypeError("argument str must be a string");var r={},i=e.length;if(i<2)return r;var o=n&&n.decode||u,c=0,f=0,h=0;do{if(-1===(f=e.indexOf("=",c)))break;if(-1===(h=e.indexOf(";",c)))h=i;else if(f>h){c=e.lastIndexOf(";",f-1)+1;continue}var d=a(e,c,f),p=s(e,f,d),g=e.slice(d,p);if(!t.call(r,g)){var m=a(e,f+1,h),y=s(e,h,m);34===e.charCodeAt(m)&&34===e.charCodeAt(y-1)&&(m++,y--);var v=e.slice(m,y);r[g]=l(v,o)}c=h+1}while(cn;){var r=e.charCodeAt(--t);if(32!==r&&9!==r)return t+1}return n}function u(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function l(e,t){try{return t(e)}catch(n){return e}}return Lt}();function Nt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=function(e){if(e&&"j"===e[0]&&":"===e[1])return e.substr(2);return e}(e);if(!t.doNotParse)try{return JSON.parse(n)}catch(r){}return e}class Bt{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;const e=this.cookies;this.cookies=Ft.parse(document.cookie),this._checkChanges(e)};const r="undefined"===typeof document?"":document.cookie;this.cookies=function(e){return"string"===typeof e?Ft.parse(e):"object"===typeof e&&null!==e?e:{}}(e||r),this.defaultSetOptions=t,this.HAS_DOCUMENT_COOKIE=function(){const e="undefined"===typeof n.g?void 0:n.g.TEST_HAS_DOCUMENT_COOKIE;return"boolean"===typeof e?e:"object"===typeof document&&"string"===typeof document.cookie}()}_emitChange(e){for(let t=0;t{e[t]!==this.cookies[t]&&this._emitChange({name:t,value:Nt(this.cookies[t])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.doNotUpdate||this.update(),Nt(this.cookies[e],t)}getAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.doNotUpdate||this.update();const t={};for(let n in this.cookies)t[n]=Nt(this.cookies[n],e);return t}set(e,t,n){n=n?Object.assign(Object.assign({},this.defaultSetOptions),n):this.defaultSetOptions;const r="string"===typeof t?t:JSON.stringify(t);this.cookies=Object.assign(Object.assign({},this.cookies),{[e]:r}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=Ft.serialize(e,r,n)),this._emitChange({name:e,value:t,options:n})}remove(e,t){const n=t=Object.assign(Object.assign(Object.assign({},this.defaultSetOptions),t),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=Ft.serialize(e,"",n)),this._emitChange({name:e,value:void 0,options:t})}addChangeListener(e){this.changeListeners.push(e),this.HAS_DOCUMENT_COOKIE&&1===this.changeListeners.length&&("object"===typeof window&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(e){const t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1),this.HAS_DOCUMENT_COOKIE&&0===this.changeListeners.length&&("object"===typeof window&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}}var jt=function(){return jt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")}(this)},e}(),Gt=n(1356);const $t=Xt;function Xt(e,t){null!=e&&this.fromString(e,t)}function Jt(){return new Xt(null)}var Qt;var Zt="undefined"!==typeof navigator;Zt&&"Microsoft Internet Explorer"==navigator.appName?(Xt.prototype.am=function(e,t,n,r,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var u=32767&this[e],l=this[e++]>>15,c=s*u+l*a;i=((u=a*u+((32767&c)<<15)+n[r]+(1073741823&i))>>>30)+(c>>>15)+s*l+(i>>>30),n[r++]=1073741823&u}return i},Qt=30):Zt&&"Netscape"!=navigator.appName?(Xt.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i},Qt=26):(Xt.prototype.am=function(e,t,n,r,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var u=16383&this[e],l=this[e++]>>14,c=s*u+l*a;i=((u=a*u+((16383&c)<<14)+n[r]+i)>>28)+(c>>14)+s*l,n[r++]=268435455&u}return i},Qt=28),Xt.prototype.DB=Qt,Xt.prototype.DM=(1<>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function un(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(t,t),t},un.prototype.revert=function(e){var t=Jt();return e.copyTo(t),this.reduce(t),t},un.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},un.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},un.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},Xt.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},Xt.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},Xt.prototype.fromString=function(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");n=2}this.t=0,this.s=0;for(var r=e.length,i=!1,o=0;--r>=0;){var a=on(e,r);a<0?"-"==e.charAt(r)&&(i=!0):(i=!1,0==o?this[this.t++]=a:o+n>this.DB?(this[this.t-1]|=(a&(1<>this.DB-o):this[this.t-1]|=a<=this.DB&&(o-=this.DB))}this.clamp(),i&&Xt.ZERO.subTo(this,this)},Xt.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},Xt.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},Xt.prototype.drShiftTo=function(e,t){for(var n=e;n=0;--n)t[n+a+1]=this[n]>>i|s,s=(this[n]&o)<=0;--n)t[n]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},Xt.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<>r;for(var a=n+1;a>r;r>0&&(t[this.t-n-1]|=(this.s&o)<>=this.DB;if(e.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},Xt.prototype.multiplyTo=function(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i=0;)e[n]=0;for(n=0;n=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},Xt.prototype.divRemTo=function(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t0?(r.lShiftTo(u,o),i.lShiftTo(u,n)):(r.copyTo(o),i.copyTo(n));var l=o.t,c=o[l-1];if(0!=c){var f=c*(1<1?o[l-2]>>this.F2:0),h=this.FV/f,d=(1<=0&&(n[n.t++]=1,n.subTo(y,n)),Xt.ONE.dlShiftTo(l,y),y.subTo(o,o);o.t=0;){var v=n[--g]==c?this.DM:Math.floor(n[g]*h+(n[g-1]+p)*d);if((n[g]+=o.am(0,v,n,m,0,l))0&&n.rShiftTo(u,n),a<0&&Xt.ZERO.subTo(n,n)}}},Xt.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},Xt.prototype.addTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n>=this.DB;if(e.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},Xt.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");t=2}var n,r=(1<0)for(s>s)>0&&(i=!0,o=rn(n));a>=0;)s>(s+=this.DB-t)):(n=this[a]>>(s-=t)&r,s<=0&&(s+=this.DB,--a)),n>0&&(i=!0),i&&(o+=rn(n));return i?o:"0"},Xt.prototype.negate=function(){var e=Jt();return Xt.ZERO.subTo(this,e),e},Xt.prototype.abs=function(){return this.s<0?this.negate():this},Xt.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},Xt.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+sn(this[this.t-1]^this.s&this.DM)},Xt.prototype.mod=function(e){var t=Jt();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(Xt.ZERO)>0&&e.subTo(t,t),t},Xt.prototype.equals=function(e){return 0==this.compareTo(e)},Xt.prototype.add=function(e){var t=Jt();return this.addTo(e,t),t},Xt.prototype.subtract=function(e){var t=Jt();return this.subTo(e,t),t},Xt.prototype.multiply=function(e){var t=Jt();return this.multiplyTo(e,t),t},Xt.prototype.divide=function(e){var t=Jt();return this.divRemTo(e,t,null),t},Xt.prototype.modPow=function(e,t,n){var r,i=e.bitLength(),o=an(1),a=new un(t);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6;var s=new Array,u=3,l=r-1,c=(1<1){var f=Jt();for(a.sqrTo(s[1],f);u<=c;)s[u]=Jt(),a.mulTo(f,s[u-2],s[u]),u+=2}var h,d,p=e.t-1,g=!0,m=Jt();for(i=sn(e[p])-1;p>=0;){for(i>=l?h=e[p]>>i-l&c:(h=(e[p]&(1<0&&(h|=e[p-1]>>this.DB+i-l)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--p),g)s[h].copyTo(o),g=!1;else{for(;u>1;)a.sqrTo(o,m),a.sqrTo(m,o),u-=2;u>0?a.sqrTo(o,m):(d=o,o=m,m=d),a.mulTo(m,s[h],o)}for(;p>=0&&0==(e[p]&1<e)&&i}}(n))})(function(t){return new Promise(function(n,i){r.request(e,t,function(e,t){e?i(e):n(t)})})},[t],5e3).then(function(e){return n(null,e)}).catch(function(e){return n(e)})},t.request=function(e,t,n){var r,i={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+e,"X-Amz-User-Agent":xn(),"Cache-Control":"no-store"},o=Object.assign({},this.fetchOptions,{headers:i,method:"POST",mode:"cors",body:JSON.stringify(t)});fetch(this.endpoint,o).then(function(e){return r=e,e},function(e){if(e instanceof TypeError)throw new Error("Network error");throw e}).then(function(e){return e.json().catch(function(){return{}})}).then(function(e){if(r.ok)return n(null,e);0;var t=(e.__type||e.code).split("#").pop(),i=new Error(e.message||e.Message||null);return i.name=t,i.code=t,n(i)}).catch(function(e){if(r&&r.headers&&r.headers.get("x-amzn-errortype"))try{var t=r.headers.get("x-amzn-errortype").split(":")[0],i=new Error(r.status?r.status.toString():null);return i.code=t,i.name=t,i.statusCode=r.status,n(i)}catch(o){return n(e)}else e instanceof Error&&"Network error"===e.message&&(e.code="NetworkError");return n(e)})},e}(),Bn=function(){};function jn(e,t,n,r){if(void 0===r&&(r=1),"function"!==typeof e)throw Error("functionToRetry must be a function");return Bn(e.name+" attempt #"+r+" with args: "+JSON.stringify(t)),e.apply(void 0,t).catch(function(i){if(Bn("error on "+e.name,i),(o=i)&&o.nonRetryable)throw Bn(e.name+" non retryable error",i),i;var o,a=n(r,t,i);if(Bn(e.name+" retrying in "+a+" ms"),!1!==a)return new Promise(function(e){return setTimeout(e,a)}).then(function(){return jn(e,t,n,r+1)});throw i})}var zn=function(){function e(e,t){var n=e||{},r=n.UserPoolId,i=n.ClientId,o=n.endpoint,a=n.fetchOptions,s=n.AdvancedSecurityDataCollectionFlag;if(!r||!i)throw new Error("Both UserPoolId and ClientId are required.");if(r.length>55||!/^[\w-]+_[0-9a-zA-Z]+$/.test(r))throw new Error("Invalid UserPoolId format.");var u=r.split("_")[0];this.userPoolId=r,this.clientId=i,this.client=new Nn(u,o,a),this.advancedSecurityDataCollectionFlag=!1!==s,this.storage=e.Storage||(new Cn).getStorage(),t&&(this.wrapRefreshSessionCallback=t)}var t=e.prototype;return t.getUserPoolId=function(){return this.userPoolId},t.getUserPoolName=function(){return this.getUserPoolId().split("_")[1]},t.getClientId=function(){return this.clientId},t.signUp=function(e,t,n,r,i,o){var a=this,s={ClientId:this.clientId,Username:e,Password:t,UserAttributes:n,ValidationData:r,ClientMetadata:o};this.getUserContextData(e)&&(s.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",s,function(t,n){if(t)return i(t,null);var r={Username:e,Pool:a,Storage:a.storage},o={user:new An(r),userConfirmed:n.UserConfirmed,userSub:n.UserSub,codeDeliveryDetails:n.CodeDeliveryDetails};return i(null,o)})},t.getCurrentUser=function(){var e="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",t=this.storage.getItem(e);if(t){var n={Username:t,Pool:this,Storage:this.storage};return new An(n)}return null},t.getUserContextData=function(e){if("undefined"!==typeof AmazonCognitoAdvancedSecurityData){var t=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var n=t.getData(e,this.userPoolId,this.clientId);if(n)return{EncodedData:n}}return{}}},e}(),Vn=n(4235),Hn=function(){function e(e){if(void 0===e&&(e={}),e.domain&&(this.domain=e.domain),e.path?this.path=e.path:this.path="/",Object.prototype.hasOwnProperty.call(e,"expires")?this.expires=e.expires:this.expires=365,Object.prototype.hasOwnProperty.call(e,"secure")?this.secure=e.secure:this.secure=!0,Object.prototype.hasOwnProperty.call(e,"sameSite")){if(!["strict","lax","none"].includes(e.sameSite))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if("none"===e.sameSite&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=e.sameSite}else this.sameSite=null}var t=e.prototype;return t.setItem=function(e,t){var n={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(n.sameSite=this.sameSite),Vn.set(e,t,n),Vn.get(e)},t.getItem=function(e){return Vn.get(e)},t.removeItem=function(e){var t={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(t.sameSite=this.sameSite),Vn.remove(e,t)},t.clear=function(){for(var e=Vn.get(),t=Object.keys(e).length,n=0;n0&&i[i.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]Qn)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===$n&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%$n>=56){for(var r=this.bufferLength;r<$n;r++)t.setUint8(r,0);this.hashBuffer(),this.bufferLength=0}for(r=this.bufferLength;r<56;r++)t.setUint8(r,0);t.setUint32(56,Math.floor(e/4294967296),!0),t.setUint32(60,e),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(32);for(r=0;r<8;r++)i[4*r]=this.state[r]>>>24&255,i[4*r+1]=this.state[r]>>>16&255,i[4*r+2]=this.state[r]>>>8&255,i[4*r+3]=this.state[r]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],l=t[7],c=0;c<$n;c++){if(c<16)this.temp[c]=(255&e[4*c])<<24|(255&e[4*c+1])<<16|(255&e[4*c+2])<<8|255&e[4*c+3];else{var f=this.temp[c-2],h=(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10,d=((f=this.temp[c-15])>>>7|f<<25)^(f>>>18|f<<14)^f>>>3;this.temp[c]=(h+this.temp[c-7]|0)+(d+this.temp[c-16]|0)}var p=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&s^~a&u)|0)+(l+(Xn[c]+this.temp[c]|0)|0)|0,g=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&r^n&i^r&i)|0;l=u,u=s,s=a,a=o+p|0,o=i,i=r,r=n,n=p+g|0}t[0]+=n,t[1]+=r,t[2]+=i,t[3]+=o,t[4]+=a,t[5]+=s,t[6]+=u,t[7]+=l},e}();var er="undefined"!==typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:e=>(new TextEncoder).encode(e);function tr(e){return e instanceof Uint8Array?e:"string"===typeof e?er(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}var nr=function(){function e(e){this.secret=e,this.hash=new Zn,this.reset()}return e.prototype.update=function(e){var t;if(("string"===typeof(t=e)?0!==t.length:0!==t.byteLength)&&!this.error)try{this.hash.update(tr(e))}catch(n){this.error=n}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return Yn(this,void 0,void 0,function(){return Gn(this,function(e){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new Zn,this.secret){this.outer=new Zn;var e=function(e){var t=tr(e);if(t.byteLength>$n){var n=new Zn;n.update(t),t=n.digest()}var r=new Uint8Array($n);return r.set(t),r}(this.secret),t=new Uint8Array($n);t.set(e);for(var n=0;n<$n;n++)e[n]^=54,t[n]^=92;this.hash.update(e),this.outer.update(t);for(n=0;n0;--n)t+=r[Math.round(61*Math.random())];return t},e.prototype._generateChallenge=function(e){var t=new nr;t.update(e);var n=t.digestSync(),r=qn.hp.from(n).toString("base64");return this._base64URL(r)},e.prototype._base64URL=function(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},e.prototype._generateRandom=function(e){var t=new Uint8Array(e);if("undefined"!==typeof window&&window.crypto)window.crypto.getRandomValues(t);else for(var n=0;n18e4?(clearInterval(r),mr("autoSignIn_failure",null,"Please confirm your account and use your credentials to sign in."),t._storage.removeItem("amplify-auto-sign-in")):t.signInAfterUserConfirmed(e,null,r)},5e3)},e.prototype.signInAfterUserConfirmed=function(e,t,n){return c(this,void 0,void 0,function(){var r,i,o=this;return f(this,function(a){switch(a.label){case 0:r=this.createCognitoUser(e.getUsername()),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,r.authenticateUser(e,this.authCallbacks(r,function(r){mr("autoSignIn",r,e.getUsername()+" has signed in successfully"),t&&S.remove("auth",t),n&&(clearInterval(n),o._storage.removeItem("amplify-polling-started")),o._storage.removeItem("amplify-auto-sign-in")},function(e){dr.error(e),o._storage.removeItem("amplify-auto-sign-in")}))];case 2:return a.sent(),[3,4];case 3:return i=a.sent(),dr.error(i),[3,4];case 4:return[2]}})})},e.prototype.confirmSignUp=function(e,t,n){var r=this;if(!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(s.EmptyUsername);if(!t)return this.rejectAuthError(s.EmptyCode);var i,o=this.createCognitoUser(e),a=!n||"boolean"!==typeof n.forceAliasCreation||n.forceAliasCreation;return n&&n.clientMetadata?i=n.clientMetadata:this._config.clientMetadata&&(i=this._config.clientMetadata),new Promise(function(n,u){o.confirmRegistration(t,a,function(t,i){t?u(t):(mr("confirmSignUp",i,e+" has been confirmed successfully"),r.isTrueStorageValue("amplify-auto-sign-in")&&!r.autoSignInInitiated&&(mr("autoSignIn_failure",null,s.AutoSignInError),r._storage.removeItem("amplify-auto-sign-in")),n(i))},i)})},e.prototype.isTrueStorageValue=function(e){var t=this._storage.getItem(e);return!!t&&"true"===t},e.prototype.resendSignUp=function(e,t){if(void 0===t&&(t=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(s.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,i=null,o={};if("string"===typeof e)r=e,i=t;else{if(!e.username)return this.rejectAuthError(s.InvalidUsername);"undefined"!==typeof t&&dr.warn("The password should be defined under the first parameter object!"),r=e.username,i=e.password,o=e.validationData}if(!r)return this.rejectAuthError(s.EmptyUsername);var a=new Kt({Username:r,Password:i,ValidationData:o,ClientMetadata:n});return i?this.signInWithPassword(a):this.signInWithoutPassword(a)},e.prototype.authCallbacks=function(e,t,n){var r=this,i=this;return{onSuccess:function(o){return c(r,void 0,void 0,function(){var r,a,s,u;return f(this,function(l){switch(l.label){case 0:dr.debug(o),delete e.challengeName,delete e.challengeParam,l.label=1;case 1:return l.trys.push([1,4,5,9]),[4,this.Credentials.clear()];case 2:return l.sent(),[4,this.Credentials.set(o,"session")];case 3:return r=l.sent(),dr.debug("succeed to get cognito credentials",r),[3,9];case 4:return a=l.sent(),dr.debug("cannot get cognito credentials",a),[3,9];case 5:return l.trys.push([5,7,,8]),[4,this.currentUserPoolUser()];case 6:return s=l.sent(),i.user=s,mr("signIn",s,"A user "+e.getUsername()+" has been signed in"),t(s),[3,8];case 7:return u=l.sent(),dr.error("Failed to get the signed in user",u),n(u),[3,8];case 8:return[7];case 9:return[2]}})})},onFailure:function(t){dr.debug("signIn failure",t),mr("signIn_failure",t,e.getUsername()+" failed to signin"),n(t)},customChallenge:function(n){dr.debug("signIn custom challenge answer required"),e.challengeName="CUSTOM_CHALLENGE",e.challengeParam=n,t(e)},mfaRequired:function(n,r){dr.debug("signIn MFA required"),e.challengeName=n,e.challengeParam=r,t(e)},mfaSetup:function(n,r){dr.debug("signIn mfa setup",n),e.challengeName=n,e.challengeParam=r,t(e)},newPasswordRequired:function(n,r){dr.debug("signIn new password"),e.challengeName="NEW_PASSWORD_REQUIRED",e.challengeParam={userAttributes:n,requiredAttributes:r},t(e)},totpRequired:function(n,r){dr.debug("signIn totpRequired"),e.challengeName=n,e.challengeParam=r,t(e)},selectMFAType:function(n,r){dr.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 dr.debug("get MFA Options failed",e),void n(e);dr.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 a=n._config.clientMetadata,s=!!t&&t.bypassCache;e.getUserData(function(t,a){return c(n,void 0,void 0,function(){var n,s;return f(this,function(u){switch(u.label){case 0:if(!t)return[3,5];if(dr.debug("getting preferred mfa failed",t),!this.isSessionInvalid(t))return[3,4];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return u.sent(),[3,4];case 3:return n=u.sent(),o(new Error("Session is invalid due to: "+t.message+" and failed to clean up invalid session: "+n.message)),[2];case 4:return o(t),[2];case 5:return(s=r._getMfaTypeFromUserData(a))?(i(s),[2]):(o("invalid MFA Type"),[2])}})})},{bypassCache:s,clientMetadata:a})})},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":dr.debug("invalid case for getPreferredMFA",e);else t=e.MFAOptions?"SMS_MFA":"NOMFA"}return t},e.prototype._getUserData=function(e,t){var n=this;return new Promise(function(r,i){e.getUserData(function(t,o){return c(n,void 0,void 0,function(){var n;return f(this,function(a){switch(a.label){case 0:if(!t)return[3,5];if(dr.debug("getting user data failed",t),!this.isSessionInvalid(t))return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return a.sent(),[3,4];case 3:return n=a.sent(),i(new Error("Session is invalid due to: "+t.message+" and failed to clean up invalid session: "+n.message)),[2];case 4:return i(t),[2];case 5:r(o),a.label=6;case 6:return[2]}})})},t)})},e.prototype.setPreferredMFA=function(e,t){return c(this,void 0,void 0,function(){var n,r,i,o,a,u,l=this;return f(this,function(h){switch(h.label){case 0:return n=this._config.clientMetadata,[4,this._getUserData(e,{bypassCache:!0,clientMetadata:n})];case 1:switch(r=h.sent(),i=null,o=null,t){case"TOTP":case"SOFTWARE_TOKEN_MFA":return[3,2];case"SMS":case"SMS_MFA":return[3,3];case"NOMFA":return[3,4]}return[3,6];case 2:return o={PreferredMfa:!0,Enabled:!0},[3,7];case 3:return i={PreferredMfa:!0,Enabled:!0},[3,7];case 4:return a=r.UserMFASettingList,[4,this._getMfaTypeFromUserData(r)];case 5:if("NOMFA"===(u=h.sent()))return[2,Promise.resolve("No change for mfa type")];if("SMS_MFA"===u)i={PreferredMfa:!1,Enabled:!1};else{if("SOFTWARE_TOKEN_MFA"!==u)return[2,this.rejectAuthError(s.InvalidMFA)];o={PreferredMfa:!1,Enabled:!1}}return a&&0!==a.length&&a.forEach(function(e){"SMS_MFA"===e?i={PreferredMfa:!1,Enabled:!1}:"SOFTWARE_TOKEN_MFA"===e&&(o={PreferredMfa:!1,Enabled:!1})}),[3,7];case 6:return dr.debug("no validmfa method provided"),[2,this.rejectAuthError(s.NoMFA)];case 7:return[2,new Promise(function(t,r){e.setUserMfaPreference(i,o,function(i,o){if(i)return dr.debug("Set user mfa preference error",i),r(i);dr.debug("Set user mfa success",o),dr.debug("Caching the latest user data into local"),e.getUserData(function(n,i){return c(l,void 0,void 0,function(){var i;return f(this,function(a){switch(a.label){case 0:if(!n)return[3,5];if(dr.debug("getting user data failed",n),!this.isSessionInvalid(n))return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return a.sent(),[3,4];case 3:return i=a.sent(),r(new Error("Session is invalid due to: "+n.message+" and failed to clean up invalid session: "+i.message)),[2];case 4:return[2,r(n)];case 5:return[2,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 dr.debug("disable mfa failed",e),void n(e);dr.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 dr.debug("enable mfa failed",e),void n(e);dr.debug("enable mfa succeed",r),t(r)})})},e.prototype.setupTOTP=function(e){return new Promise(function(t,n){e.associateSoftwareToken({onFailure:function(e){dr.debug("associateSoftwareToken failed",e),n(e)},associateSecretCode:function(e){dr.debug("associateSoftwareToken success",e),t(e)}})})},e.prototype.verifyTotpToken=function(e,t){var n;dr.debug("verification totp token",e,t),e&&"function"===typeof e.getSignInUserSession&&(n=e.getSignInUserSession());var r=null===n||void 0===n?void 0:n.isValid();return new Promise(function(n,i){e.verifySoftwareToken(t,"My TOTP device",{onFailure:function(e){dr.debug("verifyTotpToken failed",e),i(e)},onSuccess:function(t){r||mr("signIn",e,"A user "+e.getUsername()+" has been signed in"),mr("verify",e,"A user "+e.getUsername()+" has been verified"),dr.debug("verifyTotpToken success",t),n(t)}})})},e.prototype.confirmSignIn=function(e,t,n,r){var i=this;if(void 0===r&&(r=this._config.clientMetadata),!t)return this.rejectAuthError(s.EmptyCode);var o=this;return new Promise(function(a,s){e.sendMFACode(t,{onSuccess:function(t){return c(i,void 0,void 0,function(){var n,r,i,s;return f(this,function(u){switch(u.label){case 0:dr.debug(t),u.label=1;case 1:return u.trys.push([1,4,5,10]),[4,this.Credentials.clear()];case 2:return u.sent(),[4,this.Credentials.set(t,"session")];case 3:return n=u.sent(),dr.debug("succeed to get cognito credentials",n),[3,10];case 4:return r=u.sent(),dr.debug("cannot get cognito credentials",r),[3,10];case 5:o.user=e,u.label=6;case 6:return u.trys.push([6,8,,9]),[4,this.currentUserPoolUser()];case 7:return i=u.sent(),e.attributes=i.attributes,[3,9];case 8:return s=u.sent(),dr.debug("cannot get updated Cognito User",s),[3,9];case 9:return mr("signIn",e,"A user "+e.getUsername()+" has been signed in"),a(e),[7];case 10:return[2]}})})},onFailure:function(e){dr.debug("confirm signIn failure",e),s(e)}},n,r)})},e.prototype.completeNewPassword=function(e,t,n,r){var i=this;if(void 0===n&&(n={}),void 0===r&&(r=this._config.clientMetadata),!t)return this.rejectAuthError(s.EmptyPassword);var o=this;return new Promise(function(a,s){e.completeNewPasswordChallenge(t,n,{onSuccess:function(t){return c(i,void 0,void 0,function(){var n,r;return f(this,function(i){switch(i.label){case 0:dr.debug(t),i.label=1;case 1:return i.trys.push([1,4,5,6]),[4,this.Credentials.clear()];case 2:return i.sent(),[4,this.Credentials.set(t,"session")];case 3:return n=i.sent(),dr.debug("succeed to get cognito credentials",n),[3,6];case 4:return r=i.sent(),dr.debug("cannot get cognito credentials",r),[3,6];case 5:return o.user=e,mr("signIn",e,"A user "+e.getUsername()+" has been signed in"),a(e),[7];case 6:return[2]}})})},onFailure:function(e){dr.debug("completeNewPassword failure",e),mr("completeNewPassword_failure",e,i.user+" failed to complete the new password flow"),s(e)},mfaRequired:function(t,n){dr.debug("signIn MFA required"),e.challengeName=t,e.challengeParam=n,a(e)},mfaSetup:function(t,n){dr.debug("signIn mfa setup",t),e.challengeName=t,e.challengeParam=n,a(e)},totpRequired:function(t,n){dr.debug("signIn mfa setup",t),e.challengeName=t,e.challengeParam=n,a(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(s.EmptyChallengeResponse);return new Promise(function(i,o){e.sendCustomChallengeAnswer(t,r.authCallbacks(e,i,o),n)})},e.prototype.deleteUserAttributes=function(e,t){var n=this;return new Promise(function(r,i){n.userSession(e).then(function(n){e.deleteAttributes(t,function(e,t){return e?i(e):r(t)})})})},e.prototype.deleteUser=function(){return c(this,void 0,void 0,function(){var e,t,n=this;return f(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this._storageSync];case 1:return r.sent(),[3,3];case 2:throw e=r.sent(),dr.debug("Failed to sync cache info into memory",e),new Error(e);case 3:return t=this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI"),[2,new Promise(function(e,r){return c(n,void 0,void 0,function(){var n,i=this;return f(this,function(o){if(this.userPool){if(!(n=this.userPool.getCurrentUser()))return dr.debug("Failed to get user from user pool"),[2,r(new Error("No current user."))];n.getSession(function(o,a){return c(i,void 0,void 0,function(){var i,a=this;return f(this,function(s){switch(s.label){case 0:if(!o)return[3,5];if(dr.debug("Failed to get the user session",o),!this.isSessionInvalid(o))return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(n)];case 2:return s.sent(),[3,4];case 3:return i=s.sent(),r(new Error("Session is invalid due to: "+o.message+" and failed to clean up invalid session: "+i.message)),[2];case 4:return[2,r(o)];case 5:n.deleteUser(function(i,o){if(i)r(i);else{mr("userDeleted",o,"The authenticated user has been deleted."),n.signOut(),a.user=null;try{a.cleanCachedItems()}catch(s){dr.debug("failed to clear cached items")}t?a.oAuthSignOutRedirect(e,r):(mr("signOut",a.user,"A user has been signed out"),e(o))}}),s.label=6;case 6:return[2]}})})})}else dr.debug("no Congito User pool"),r(new Error("Cognito User pool does not exist"));return[2]})})})]}})})},e.prototype.updateUserAttributes=function(e,t,n){var r=this;void 0===n&&(n=this._config.clientMetadata);var i=[],o=this;return new Promise(function(a,s){o.userSession(e).then(function(o){for(var u in t)if("sub"!==u&&u.indexOf("_verified")<0){var l={Name:u,Value:t[u]};i.push(l)}e.updateAttributes(i,function(e,n,i){if(e)return mr("updateUserAttributes_failure",e,"Failed to update attributes"),s(e);var o=r.createUpdateAttributesResultList(t,null===i||void 0===i?void 0:i.CodeDeliveryDetailsList);return mr("updateUserAttributes",o,"Attributes successfully updated"),a(n)},n)})})},e.prototype.createUpdateAttributesResultList=function(e,t){var n={};return Object.keys(e).forEach(function(e){n[e]={isUpdated:!0};var r=null===t||void 0===t?void 0:t.find(function(t){return t.AttributeName===e});r&&(n[e].isUpdated=!1,n[e].codeDeliveryDetails=r)}),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.isErrorWithMessage=function(e){return"object"===typeof e&&Object.prototype.hasOwnProperty.call(e,"message")},e.prototype.isTokenRevokedError=function(e){return this.isErrorWithMessage(e)&&"Access Token has been revoked"===e.message},e.prototype.isRefreshTokenRevokedError=function(e){return this.isErrorWithMessage(e)&&"Refresh Token has been revoked"===e.message},e.prototype.isUserDisabledError=function(e){return this.isErrorWithMessage(e)&&"User is disabled."===e.message},e.prototype.isUserDoesNotExistError=function(e){return this.isErrorWithMessage(e)&&"User does not exist."===e.message},e.prototype.isRefreshTokenExpiredError=function(e){return this.isErrorWithMessage(e)&&"Refresh Token has expired"===e.message},e.prototype.isPasswordResetRequiredError=function(e){return this.isErrorWithMessage(e)&&"Password reset required for the user"===e.message},e.prototype.isSignedInHostedUI=function(){return this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI")},e.prototype.isSessionInvalid=function(e){return this.isUserDisabledError(e)||this.isUserDoesNotExistError(e)||this.isTokenRevokedError(e)||this.isRefreshTokenRevokedError(e)||this.isRefreshTokenExpiredError(e)||this.isPasswordResetRequiredError(e)},e.prototype.cleanUpInvalidSession=function(e){return c(this,void 0,void 0,function(){var t=this;return f(this,function(n){switch(n.label){case 0:e.signOut(),this.user=null,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.cleanCachedItems()];case 2:return n.sent(),[3,4];case 3:return n.sent(),dr.debug("failed to clear cached items"),[3,4];case 4:return this.isSignedInHostedUI()?[2,new Promise(function(e,n){t.oAuthSignOutRedirect(e,n)})]:(mr("signOut",this.user,"A user has been signed out"),[2])}})})},e.prototype.currentUserPoolUser=function(e){var t=this;return this.userPool?new Promise(function(n,r){t._storageSync.then(function(){return c(t,void 0,void 0,function(){var t,i,o,a,s,u,l=this;return f(this,function(h){switch(h.label){case 0:return this.isOAuthInProgress()?(dr.debug("OAuth signIn in progress, waiting for resolution..."),[4,new Promise(function(e){var t=setTimeout(function(){dr.debug("OAuth signIn in progress timeout"),S.remove("auth",n),e()},1e4);function n(r){var i=r.payload.event;"cognitoHostedUI"!==i&&"cognitoHostedUI_failure"!==i||(dr.debug("OAuth signIn resolved: "+i),clearTimeout(t),S.remove("auth",n),e())}S.listen("auth",n)})]):[3,2];case 1:h.sent(),h.label=2;case 2:if(!(t=this.userPool.getCurrentUser()))return dr.debug("Failed to get user from user pool"),r("No current user"),[2];h.label=3;case 3:return h.trys.push([3,7,,8]),[4,this._userSession(t)];case 4:return i=h.sent(),(o=!!e&&e.bypassCache)?[4,this.Credentials.clear()]:[3,6];case 5:h.sent(),h.label=6;case 6:return a=this._config.clientMetadata,s=i.getAccessToken().decodePayload().scope,(void 0===s?"":s).split(" ").includes(pr)?(t.getUserData(function(e,i){return c(l,void 0,void 0,function(){var o,a,s,u,l,c,h;return f(this,function(f){switch(f.label){case 0:if(!e)return[3,7];if(dr.debug("getting user data failed",e),!this.isSessionInvalid(e))return[3,5];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(t)];case 2:return f.sent(),[3,4];case 3:return o=f.sent(),r(new Error("Session is invalid due to: "+e.message+" and failed to clean up invalid session: "+o.message)),[2];case 4:return r(e),[3,6];case 5:n(t),f.label=6;case 6:return[2];case 7:for(a=i.PreferredMfaSetting||"NOMFA",s=[],u=0;u{!t&&i&&(s(),o(!1))},[t,i]);const s=()=>{vr.currentAuthenticatedUser().then(e=>{n(e)}).catch(e=>{console.error({ERROR:e})})},u={user:t,isAuthorized:void 0!==t,signIn:()=>{vr.federatedSignIn({customProvider:a.config.providerName})},getAuthenticatedUser:s};return(0,wr.jsx)(Sr.Provider,{value:u,children:e.children})}function kr(){return(0,r.useContext)(Sr)}},3841(e,t,n){"use strict";n.d(t,{T:()=>s,q:()=>u});var r=n(16);var i=n(7589),o=n(76);const a=(0,r.createContext)(null);function s(e){const t=(0,i.b)(),n=function(){const[e,t]=(0,r.useState)(!1),[n,i]=(0,r.useState)(null);return{closeDialog:e=>{i(null),t(!1)},item:n,open:e,openDialog:e=>{i(e),t(!0)}}}(),[s,u]=(0,r.useState)(function(){const e=[];for(let t=0;t<10;t++)e.push({label:"Message ".concat(t+1),recordingId:"".concat(t+1),audioUrl:null,hasRecording:"no",audio:null});return e}()),[l,c]=(0,r.useState)(!0),[f,h]=(0,r.useState)(!0),[d,p]=(0,r.useState)();(0,r.useEffect)(()=>{l&&(t.getRecordings().then(e=>{if(e&&"success"===e.status){const t=s.map(t=>{var n;const r=null===(n=e.response)||void 0===n?void 0:n.recordings.find(e=>e.recordingId===t.recordingId);return r||t});u(t)}}),c(!1))},[l]),(0,r.useEffect)(()=>{f&&d&&(t.getRecording(d).then(e=>{if(e)if("success"===e.status){const t=s.map(t=>(t.recordingId===d&&(t.audioUrl=e.response.preSignedUrl),t));u(t)}else console.error("could not get recording")}),h(!1),p(void 0))},[f,d]);const g={recordingDialog:n,recordings:s,updateRecording:e=>{p(e),h(!0)},refreshRecording:e=>{const t=s.map(t=>t.recordingId===e.recordingId?e:t);u(t)}};return(0,o.jsx)(a.Provider,{value:g,children:e.children})}function u(){return(0,r.useContext)(a)}},3977(e){var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},4174(e,t,n){"use strict";t.decode=t.parse=n(5394),t.encode=t.stringify=n(2646)},4235(e,t,n){var r,i;!function(o){if(void 0===(i="function"===typeof(r=o)?r.call(t,n,t,e):r)||(e.exports=i),e.exports=o(),!!0){var a=window.Cookies,s=window.Cookies=o();s.noConflict=function(){return window.Cookies=a,s}}}(function(){function e(){for(var e=0,t={};e