vendor: 4,431 bytes, line 1
1import{b as t,p as e}from"./main.CXc3ct_j.js";for(var n={},o={byteLength:function(t){var e=c(t),n=e[0],o=e[1];return 3*(n+o)/4-o},toByteArray:function(t){var e,n,o=c(t),r=o[0],a=o[1],u=new s(function(t,e,n){return 3*(e+n)/4-n}(0,r,a)),l=0,h=a>0?r-4:r;for(n=0;n<h;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===a&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,u[l++]=255&e);1===a&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},fromByteArray:function(t){for(var e,n=t.length,o=n%3,i=[],s=16383,a=0,u=n-o;a<u;a+=s)i.push(h(t,a,a+s>u?u:a+s));1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return i.join("")}},r=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0;u<64;++u)r[u]=a[u],i[a.charCodeAt(u)]=u;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function h(t,e,n){for(var o,r=[],i=e;i<n;i+=3)o=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),r.push(l(o));return r.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63;var d={read:function(t,e,n,o,r){var i,s,a=8*r-o-1,u=(1<<a)-1,c=u>>1,l=-7,h=n?r-1:0,d=n?-1:1,f=t[e+h];for(h+=d,i=f&(1<<-l)-1,f>>=-l,l+=a;l>0;i=256*i+t[e+h],h+=d,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=o;l>0;s=256*s+t[e+h],h+=d,l-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,o),i-=c}return(f?-1:1)*s*Math.pow(2,i-o)},write:function(t,e,n,o,r,i){var s,a,u,c=8*i-r-1,l=(1<<c)-1,h=l>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=o?0:i-1,g=o?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*u-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[n+f]=255&a,f+=g,a/=256,r-=8);for(s=s<<r|a,c+=r;c>0;t[n+f]=255&s,f+=g,s/=256,c-=8);t[n+f-g]|=128*p}};!function(t){const e=o,n=d,r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i;const{Uint8Array:s,ArrayBuffer:a,SharedArrayBuffer:u}=globalThis;function c(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new s(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return g(t)}return h(t,e,n)}function h(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|w(t,e);let o=c(n);const r=o.write(t,e);r!==n&&(o=o.slice(0,r));return o}(t,e);if(a.isView(t))return function(t){if(X(t,s)){const e=new s(t);return y(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(X(t,a)||t&&X(t.buffer,a))return y(t,e,n);if(void 0!==u&&(X(t,u)||t&&X(t.buffer,u)))return y(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const o=t.valueOf&&t.valueOf();if(null!=o&&o!==t)return l.from(o,e,n);const r=function(t){if(l.isBuffer(t)){const e=0|m(t.length),n=c(e);return 0===n.length||t.copy(n,0,0,e),n}if(void 0!==t.length)return"number"!=typeof t.length||Z(t.length)?c(0):p(t);if("Buffer"===t.type&&Array.isArray(t.data))return p(t.data)}(t);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');
vendor: 5,464 bytes, line 1
1if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function g(t){return f(t),c(t<0?0:0|m(t))}function p(t){const e=t.length<0?0:0|m(t.length),n=c(e);for(let o=0;o<e;o+=1)n[o]=255&t[o];return n}function y(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let o;return o=void 0===e&&void 0===n?new s(t):void 0===n?new s(t,e):new s(t,e,n),Object.setPrototypeOf(o,l.prototype),o}function m(t){if(t>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function w(t,e){if(l.isBuffer(t))return t.length;if(a.isView(t)||X(t,a))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;let r=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Y(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(t).length;default:if(r)return o?-1:Y(t).length;e=(""+e).toLowerCase(),r=!0}}function I(t,e,n){let o=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,n);case"utf8":case"utf-8":return P(this,e,n);case"ascii":return R(this,e,n);case"latin1":case"binary":return U(this,e,n);case"base64":return T(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,n);default:if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}function v(t,e,n){const o=t[e];t[e]=t[n],t[n]=o}function S(t,e,n,o,r){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Z(n=+n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=l.from(e,o)),l.isBuffer(e))return 0===e.length?-1:b(t,e,n,o,r);if("number"==typeof e)return e&=255,"function"==typeof s.prototype.indexOf?r?s.prototype.indexOf.call(t,e,n):s.prototype.lastIndexOf.call(t,e,n):b(t,[e],n,o,r);throw new TypeError("val must be string, number or Buffer")}function b(t,e,n,o,r){let i,s=1,a=t.length,u=e.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(r){let o=-1;for(i=n;i<a;i++)if(c(t,i)===c(e,-1===o?0:i-o)){if(-1===o&&(o=i),i-o+1===u)return o*s}else-1!==o&&(i-=i-o),o=-1}else for(n+u>a&&(n=a-u),i=n;i>=0;i--){let n=!0;for(let o=0;o<u;o++)if(c(t,i+o)!==c(e,o)){n=!1;break}if(n)return i}return-1}function A(t,e,n,o){n=Number(n)||0;const r=t.length-n;o?(o=Number(o))>r&&(o=r):o=r;const i=e.length;let s;for(o>i/2&&(o=i/2),s=0;s<o;++s){const o=parseInt(e.substr(2*s,2),16);if(Z(o))return s;t[n+s]=o}return s}function E(t,e,n,o){return Q(Y(e,t.length-n),t,n,o)}function _(t,e,n,o){return Q(function(t){const e=[];for(let n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,o)}function C(t,e,n,o){return Q($(e),t,n,o)}function k(t,e,n,o){return Q(function(t,e){let n,o,r;const i=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),o=n>>8,r=n%256,i.push(r),i.push(o);return i}(e,t.length-n),t,n,o)}function T(t,n,o){return 0===n&&o===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(n,o))}function P(t,e,n){n=Math.min(t.length,n);const o=[];let r=e;for(;r<n;){const e=t[r];let i=null,s=e>239?4:e>223?3:e>191?2:1;if(r+s<=n){let n,o,a,u;switch(s){case 1:e<128&&(i=e);break;case 2:n=t[r+1],128==(192&n)&&(u=(31&e)<<6|63&n,u>127&&(i=u));break;case 3:n=t[r+1],o=t[r+2],128==(192&n)&&128==(192&o)&&(u=(15&e)<<12|(63&n)<<6|63&o,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:n=t[r+1],o=t[r+2],a=t[r+3],128==(192&n)&&128==(192&o)&&128==(192&a)&&(u=(15&e)<<18|(63&n)<<12|(63&o)<<6|63&a,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,o.push(i>>>10&1023|55296),i=56320|1023&i),o.push(i),r+=s}return function(t){const e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);let n="",o=0;for(;o<e;)n+=String.fromCharCode.apply(String,t.slice(o,o+=O));return n}(o)}l.TYPED_ARRAY_SUPPORT=function(){try{const t=new s(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,s.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(t,e,n){return h(t,e,n)},Object.setPrototypeOf(l.prototype,s.prototype),Object.setPrototypeOf(l,s),l.alloc=function(t,e,n){return function(t,e,n){return f(t),t<=0?c(t):void 0!==e?"string"==typeof n?c(t).fill(e,n):c(t).fill(e):c(t)}(t,e,n)},l.allocUnsafe=function(t){return g(t)},l.allocUnsafeSlow=function(t){return g(t)}
vendor: 11,252 bytes, line 1
1,l.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==l.prototype},l.compare=function(t,e){if(X(t,s)&&(t=l.from(t,t.offset,t.byteLength)),X(e,s)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,o=e.length;for(let r=0,i=Math.min(n,o);r<i;++r)if(t[r]!==e[r]){n=t[r],o=e[r];break}return n<o?-1:o<n?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);let n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const o=l.allocUnsafe(e);let r=0;for(n=0;n<t.length;++n){let e=t[n];if(X(e,s))r+e.length>o.length?(l.isBuffer(e)||(e=l.from(e)),e.copy(o,r)):s.prototype.set.call(o,e,r);else{if(!l.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(o,r)}r+=e.length}return o},l.byteLength=w,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)v(this,e,e+1);return this},l.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},l.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},l.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?P(this,0,t):I.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},r&&(l.prototype[r]=l.prototype.inspect),l.prototype.compare=function(t,e,n,o,r){if(X(t,s)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===r&&(r=this.length),e<0||n>t.length||o<0||r>this.length)throw new RangeError("out of range index");if(o>=r&&e>=n)return 0;if(o>=r)return-1;if(e>=n)return 1;if(this===t)return 0;let i=(r>>>=0)-(o>>>=0),a=(n>>>=0)-(e>>>=0);const u=Math.min(i,a),c=this.slice(o,r),h=t.slice(e,n);for(let s=0;s<u;++s)if(c[s]!==h[s]){i=c[s],a=h[s];break}return i<a?-1:a<i?1:0},l.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},l.prototype.indexOf=function(t,e,n){return S(this,t,e,n,!0)},l.prototype.lastIndexOf=function(t,e,n){return S(this,t,e,n,!1)},l.prototype.write=function(t,e,n,o){if(void 0===e)o="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)o=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===o&&(o="utf8")):(o=n,n=void 0)}const r=this.length-e;if((void 0===n||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let i=!1;for(;;)switch(o){case"hex":return A(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":case"latin1":case"binary":return _(this,t,e,n);case"base64":return C(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function R(t,e,n){let o="";n=Math.min(t.length,n);for(let r=e;r<n;++r)o+=String.fromCharCode(127&t[r]);return o}function U(t,e,n){let o="";n=Math.min(t.length,n);for(let r=e;r<n;++r)o+=String.fromCharCode(t[r]);return o}function x(t,e,n){const o=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>o)&&(n=o);let r="";for(let i=e;i<n;++i)r+=tt[t[i]];return r}function B(t,e,n){const o=t.slice(e,n);let r="";for(let i=0;i<o.length-1;i+=2)r+=String.fromCharCode(o[i]+256*o[i+1]);return r}function L(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,n,o,r,i){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<i)throw new RangeError('"value" argument is out of bounds');if(n+o>t.length)throw new RangeError("Index out of range")}function M(t,e,n,o,r){q(e,o,r,t,n,7);let i=Number(e&BigInt(4294967295));t[n++]=i,i>>=8,t[n++]=i,i>>=8,t[n++]=i,i>>=8,t[n++]=i;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s,n}function K(t,e,n,o,r){q(e,o,r,t,n,7);let i=Number(e&BigInt(4294967295));t[n+7]=i,i>>=8,t[n+6]=i,i>>=8,t[n+5]=i,i>>=8,t[n+4]=i;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=s,s>>=8,t[n+2]=s,s>>=8,t[n+1]=s,s>>=8,t[n]=s,n+8}function D(t,e,n,o,r,i){if(n+o>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function V(t,e,o,r,i){return e=+e,o>>>=0,i||D(t,0,o,4),n.write(t,e,o,r,23,4),o+4}function G(t,e,o,r,i){return e=+e,o>>>=0,i||D(t,0,o,8),n.write(t,e,o,r,52,8),o+8}l.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);const o=this.subarray(t,e);return Object.setPrototypeOf(o,l.prototype),o},l.prototype.readUintLE=l.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||L(t,e,this.length);let o=this[t],r=1,i=0;for(;++i<e&&(r*=256);)o+=this[t+i]*r;return o},l.prototype.readUintBE=l.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||L(t,e,this.length);let o=this[t+--e],r=1;for(;e>0&&(r*=256);)o+=this[t+--e]*r;return o},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readBigUInt64LE=et(function(t){z(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const o=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,r=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(o)+(BigInt(r)<<BigInt(32))}),l.prototype.readBigUInt64BE=et(function(t){z(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const o=e*2**24+65536*this[++t]+256*this[++t]+this[++t],r=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(o)<<BigInt(32))+BigInt(r)}),l.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||L(t,e,this.length);let o=this[t],r=1,i=0;for(;++i<e&&(r*=256);)o+=this[t+i]*r;return r*=128,o>=r&&(o-=Math.pow(2,8*e)),o},l.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||L(t,e,this.length);let o=e,r=1,i=this[t+--o];for(;o>0&&(r*=256);)i+=this[t+--o]*r;return r*=128,i>=r&&(i-=Math.pow(2,8*e)),i},l.prototype.readInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||L(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){t>>>=0,e||L(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readBigInt64LE=et(function(t){z(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const o=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(o)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)}),l.prototype.readBigInt64BE=et(function(t){z(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||H(t,this.length-8);const o=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(o)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+n)}),l.prototype.readFloatLE=function(t,e){return t>>>=0,e||L(t,4,this.length),n.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||L(t,4,this.length),n.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||L(t,8,this.length),n.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||L(t,8,this.length),n.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,n,o){if(t=+t,e>>>=0,n>>>=0,!o){N(this,t,e,n,Math.pow(2,8*n)-1,0)}let r=1,i=0;for(this[e]=255&t;++i<n&&(r*=256);)this[e+i]=t/r&255;return e+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(t,e,n,o){if(t=+t,e>>>=0,n>>>=0,!o){N(this,t,e,n,Math.pow(2,8*n)-1,0)}let r=n-1,i=1;for(this[e+r]=255&t;--r>=0&&(i*=256);)this[e+r]=t/i&255;return e+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigUInt64LE=et(function(t,e=0){return M(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=et(function(t,e=0){return K(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(t,e,n,o){if(t=+t,e>>>=0,!o){const o=Math.pow(2,8*n-1);N(this,t,e,n,o-1,-o)}let r=0,i=1,s=0;for(this[e]=255&t;++r<n&&(i*=256);)t<0&&0===s&&0!==this[e+r-1]&&(s=1),this[e+r]=(t/i|0)-s&255;return e+n},l.prototype.writeIntBE=function(t,e,n,o){if(t=+t,e>>>=0,!o){const o=Math.pow(2,8*n-1);N(this,t,e,n,o-1,-o)}let r=n-1,i=1,s=0;for(this[e+r]=255&t;--r>=0&&(i*=256);
1)t<0&&0===s&&0!==this[e+r+1]&&(s=1),this[e+r]=(t/i|0)-s&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigInt64LE=et(function(t,e=0){return M(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=et(function(t,e=0){return K(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeFloatLE=function(t,e,n){return V(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return V(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return G(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return G(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,o){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),o||0===o||(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o<n&&(o=n),o===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e<o-n&&(o=t.length-e+n);const r=o-n;return this===t&&"function"==typeof s.prototype.copyWithin?this.copyWithin(e,n,o):s.prototype.set.call(t,this.subarray(n,o),e),r},l.prototype.fill=function(t,e,n,o){if("string"==typeof t){if("string"==typeof e?(o=e,e=0,n=this.length):"string"==typeof n&&(o=n,n=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!l.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(1===t.length){const e=t.charCodeAt(0);("utf8"===o&&e<128||"latin1"===o)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;let r;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(r=e;r<n;++r)this[r]=t;else{const i=l.isBuffer(t)?t:l.from(t,o),s=i.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(r=0;r<n-e;++r)this[r+e]=i[r%s]}return this};const j={};function F(t,e,n){j[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name="".concat(this.name," [").concat(t,"]"),this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return"".concat(this.name," [").concat(t,"]: ").concat(this.message)}}}function W(t){let e="",n=t.length;const o="-"===t[0]?1:0;for(;n>=o+4;n-=3)e="_".concat(t.slice(n-3,n)).concat(e);return"".concat(t.slice(0,n)).concat(e)}function q(t,e,n,o,r,i){if(t>n||t<e){const n="bigint"==typeof e?"n":"";let o;throw o=0===e||e===BigInt(0)?">= 0".concat(n," and < 2").concat(n," ** ").concat(8*(i+1)).concat(n):">= -(2".concat(n," ** ").concat(8*(i+1)-1).concat(n,") and < 2 ** ")+"".concat(8*(i+1)-1).concat(n),new j.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,n){z(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||H(e,t.length-(n+1))}(o,r,i)}function z(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function H(t,e,n){if(Math.floor(t)!==t)throw z(t,n),new j.ERR_OUT_OF_RANGE("offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(e),t)}F("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),F("ERR_INVALID_ARG_TYPE",function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(typeof e)},TypeError),F("ERR_OUT_OF_RANGE",function(t,e,n){let o='The value of "'.concat(t,'" is out of range.'),r=n;return Number.isInteger(n)&&Math.abs(n)>2**32?r=W(String(n)):"bigint"==typeof n&&(r=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(r=W(r)),r+="n"),o+=" It must be ".concat(e,". Received ").concat(r),o},RangeError);const J=/[^+/0-9A-Za-z-_]/g;function Y(t,e){let n;e=e||1/0;const o=t.length;let r=null;const i=[];for(let s=0;s<o;
1++s){if(n=t.charCodeAt(s),n>55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===o){(e-=3)>-1&&i.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&i.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function $(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(J,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Q(t,e,n,o){let r;for(r=0;r<o&&!(r+n>=e.length||r>=t.length);++r)e[r+n]=t[r];return r}function X(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Z(t){return t!=t}const tt=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const o=16*n;for(let r=0;r<16;++r)e[o+r]=t[n]+t[r]}return e}();function et(t){return"undefined"==typeof BigInt?nt:t}function nt(){throw new Error("BigInt not supported")}}(n);const f=n.Buffer;var g,p;(p=g||(g={})).DEBUG="DEBUG",p.ERROR="ERROR",p.INFO="INFO",p.WARN="WARN",p.VERBOSE="VERBOSE",p.NONE="NONE";const y={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class m{constructor(t,e=g.WARN){this.name=t,this.level=e,this._pluggables=[]}_padding(t){return t<10?"0"+t:""+t}_ts(){const t=new Date;return[this._padding(t.getMinutes()),this._padding(t.getSeconds())].join(":")+"."+t.getMilliseconds()}configure(t){return t?(this._config=t,this._config):this._config}_log(t,...e){let n=this.level;m.LOG_LEVEL&&(n=m.LOG_LEVEL),"undefined"!=typeof window&&window.LOG_LEVEL&&(n=window.LOG_LEVEL);if(!(y[t]>=y[n]))return;let o=console.log.bind(console);t===g.ERROR&&console.error&&(o=console.error.bind(console)),t===g.WARN&&console.warn&&(o=console.warn.bind(console)),m.BIND_ALL_LOG_LEVELS&&(t===g.INFO&&console.info&&(o=console.info.bind(console)),t===g.DEBUG&&console.debug&&(o=console.debug.bind(console)));const r="[".concat(t,"] ").concat(this._ts()," ").concat(this.name);let i="";if(1===e.length&&"string"==typeof e[0])i="".concat(r," - ").concat(e[0]),o(i);else if(1===e.length)i="".concat(r," ").concat(e[0]),o(r,e[0]);else if("string"==typeof e[0]){let t=e.slice(1);1===t.length&&(t=t[0]),i="".concat(r," - ").concat(e[0]," ").concat(t),o("".concat(r," - ").concat(e[0]),t)}else i="".concat(r," ").concat(e),o(r,e);for(const s of this._pluggables){const t={message:i,timestamp:Date.now()};s.pushLogs([t])}}log(...t){this._log(g.INFO,...t)}info(...t){this._log(g.INFO,...t)}warn(...t){this._log(g.WARN,...t)}error(...t){this._log(g.ERROR,...t)}debug(...t){this._log(g.DEBUG,...t)}verbose(...t){this._log(g.VERBOSE,...t)}addPluggable(t){t&&"Logging"===t.getCategoryName()&&(this._pluggables.push(t),t.configure(this._config))}listPluggables(){return this._pluggables}}m.LOG_LEVEL=null,m.BIND_ALL_LOG_LEVELS=!1;class w extends Error{constructor({message:t,name:e,recoverySuggestion:n,underlyingError:o}){super(t),this.name=e,this.underlyingError=o,this.recoverySuggestion=n,this.constructor=w,Object.setPrototypeOf(this,w.prototype)}}var I,v;(v=I||(I={})).NoEndpointId="NoEndpointId",v.PlatformNotSupported="PlatformNotSupported",v.Unknown="Unknown",v.NetworkError="NetworkError";const S=(t,e=w)=>(n,o,r)=>{const{message:i,recoverySuggestion:s}=t[o];if(!n)throw new e({name:o,message:r?"".concat(i," ").concat(r):i,recoverySuggestion:s})},b="undefined"!=typeof Symbol?Symbol("amplify_default"):"@@amplify_default",A=new m("Hub");const E=new class{constructor(t){this.listeners=new Map,this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=t}_remove(t,e){const n=this.listeners.get(t);n?this.listeners.set(t,[...n.filter(({callback:t})=>t!==e)]):A.warn("No listeners for ".concat(t))}dispatch(t,e,n,o){if("string"==typeof t&&this.protectedChannels.indexOf(t)>-1){o===b||A.warn("WARNING: ".concat(t," is protected and dispatching on it can have unintended consequences"))}const r={channel:t,payload:{...e},source:n,patternInfo:[]};try{this._toListeners(r)}catch(i){A.error(i)}}listen(t,e,n="noname"){let o;if("function"!=typeof e)throw new w({name:"NoHubcallbackProvidedException",message:"No callback supplied to Hub"});o=e;let r=this.listeners.get(t);return r||(r=[],this.listeners.set(t,r)),r.push({name:n,callback:o}),()=>{this._remove(t,o)}}_toListeners(t){const{channel:e,payload:n}=t,o=this.listeners.get(e);o&&o.forEach(o=>{A.debug("Dispatching to ".concat(e," with "),n);try{o.callback(t)}catch(r){A.error(r)}})}}("__default__"),_={convert:t=>(()=>
1{if("undefined"!=typeof window&&"function"==typeof window.atob)return window.atob;if("function"==typeof atob)return atob;throw new w({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})})()(t)};var C,k;(k=C||(C={})).AuthTokenConfigException="AuthTokenConfigException",k.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",k.AuthUserPoolException="AuthUserPoolException",k.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",k.OAuthNotConfigureException="OAuthNotConfigureException";const T=S({[C.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[C.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[C.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[C.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[C.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}});function P(t){let e=!0;e=!!t&&(!!t.userPoolId&&!!t.userPoolClientId),T(e,C.AuthUserPoolException)}function O(t){const e=!!(null==t?void 0:t.identityPoolId);T(e,C.InvalidIdentityPoolIdException)}function R(t){const e=t.split(".");if(3!==e.length)throw new Error("Invalid token");try{const n=e[1].replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(_.convert(n).split("").map(t=>"%".concat("00".concat(t.charCodeAt(0).toString(16)).slice(-2))).join(""));return{toString:()=>t,payload:JSON.parse(o)}}catch(n){throw new Error("Invalid token payload")}}const U=t=>t&&t.nonRetryable,x=new m("retryUtil");const B=t=>{const e=Reflect.ownKeys(t);for(const n of e){const e=t[n];(e&&"object"==typeof e||"function"==typeof e)&&B(e)}return Object.freeze(t)},L=new m("parseAWSExports"),N={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},M=t=>{var e;return null!=(e=null==t?void 0:t.split(","))?e:[]},K=({domain:t,scope:e,redirectSignIn:n,redirectSignOut:o,responseType:r})=>({domain:t,scopes:e,redirectSignIn:M(n),redirectSignOut:M(o),responseType:r}),D=t=>t.map(t=>{const e=t.toLowerCase();return e.charAt(0).toUpperCase()+e.slice(1)}),V=Symbol("oauth-listener");let G;const j=new Uint8Array(16);function F(){if(!G&&(G="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!G))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return G(j)}const W=[];for(let Un=0;Un<256;++Un)W.push((Un+256).toString(16).slice(1));const q={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function z(t,e,n){if(q.randomUUID&&!t)return q.randomUUID();const o=(t=t||{}).random||(t.rng||F)();return o[6]=15&o[6]|64,o[8]=63&o[8]|128,function(t,e=0){return W[t[e+0]]+W[t[e+1]]+W[t[e+2]]+W[t[e+3]]+"-"+W[t[e+4]]+W[t[e+5]]+"-"+W[t[e+6]]+W[t[e+7]]+"-"+W[t[e+8]]+W[t[e+9]]+"-"+W[t[e+10]]+W[t[e+11]]+W[t[e+12]]+W[t[e+13]]+W[t[e+14]]+W[t[e+15]]}(o)}function H(t){const e={};return t.storage&&(e.Storage=function(t){if(!t)return;const{bucket_name:e,aws_region:n,buckets:o}=t;return{S3:{bucket:e,region:n,buckets:o&&X(o)}}}(t.storage)),t.auth&&(e.Auth=function(t){var e;if(!t)return;const{user_pool_id:n,user_pool_client_id:o,identity_pool_id:r,password_policy:i,mfa_configuration:s,mfa_methods:a,unauthenticated_identities_enabled:u,oauth:c,username_attributes:l,standard_required_attributes:h}=t,d={Cognito:{userPoolId:n,userPoolClientId:o}};return r&&(d.Cognito={...d.Cognito,identityPoolId:r}),i&&(d.Cognito.passwordFormat={requireLowercase:i.require_lowercase,requireNumbers:i.require_numbers,requireUppercase:i.require_uppercase,requireSpecialCharacters:i.require_symbols,minLength:null!=(e=i.min_length)?e:6}),s&&(d.Cognito.mfa={status:Q(s),smsEnabled:null==a?void 0:a.includes("SMS"),totpEnabled:null==a?void 0:a.includes("TOTP")}),u&&(d.Cognito.allowGuestAccess=u),c&&(d.Cognito.loginWith={oauth:{domain:c.domain,redirectSignIn:c.redirect_sign_in_uri,redirectSignOut:c.redirect_sign_out_uri,responseType:"token"===c.response_type?"token":"code",scopes:c.scopes,providers:$(c.identity_providers)}}),l&&(d.Cognito.loginWith={...d.Cognito.loginWith,email:l.includes("email"),phone:l.includes("phone_number"),username:l.includes("username")}),h&&(d.Cognito.userAttributes=h.reduce((t,e)=>({...t,[e]:{required:!0}}),{})),d}(t.auth)),t.analytics&&(e.Analytics=function(t){if(!(null==t?void 0:t.amazon_pinpoint))return;const{amazon_pinpoint:e}=t;return{Pinpoint:{appId:e.app_id,region:e.aws_region}}}(t.analytics)),t.geo&&(e.Geo=function(t){if(!t)return;const{aws_region:e,geofence_collections:n,maps:o,search_indices:r}=t;return{LocationService:{region:e,searchIndices:r,geofenceCollections:n,maps:o}}}(t.geo)),t.data&&(e.API=function(t){if(!t)return;const{aws_region:e,default_authorization_type:n,url:o,api_key:r,model_introspection:i}=t;var s;return{GraphQL:{endpoint:o,defaultAuthMode:(s=n,J[s]),region:e,apiKey:r,modelIntrospection:i}}}(t.data)),t.notifications&&(e.Notifications=function(t){if(!t)return;const{aws_region:e,channels:n,amazon_pinpoint_app_id:o}=t,r=n.includes("IN_APP_MESSAGING"),i=n.includes("APNS")||n.includes("FCM");if(!r&&!i)return;const s={};return r&&(s.InAppMessaging={Pinpoint:{appId:o,region:e}}),i&&(s.PushNotification={Pinpoint:{appId:o,region:e}}),s}(t.notifications)),e}const J={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"};const Y={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"};function $(t=[]){return t.reduce((t,e)=>(void 0!==Y[e]&&t.push(Y[e]),t),[])}function Q(t){return"OPTIONAL"===t?"optional":"REQUIRED"===t?"on":"off"}function X(t){const e={};return t.forEach(({name:t,bucket_name:n,aws_region:o})=>{if(t in e)throw new Error("Duplicate friendly name found: ".concat(t,". Name must be unique."));e[t]={bucketName:n,region:o}}),e}const Z=t=>Object.keys(t).some(t=>t.startsWith("aws_"))?((t={})=>{var e,n,o,r,i,s,a,u,c,l,h,d,f,g,p;if(!Object.prototype.hasOwnProperty.call(t,"aws_project_region"))throw new w({name:"InvalidParameterException",message:"Invalid config parameter.",recoverySuggestion:"Ensure passing the config object imported from `amplifyconfiguration.json`."});const{aws_appsync_apiKey:y,aws_appsync_authenticationType:m,aws_appsync_graphqlEndpoint:I,aws_appsync_regi
1on:v,aws_bots_config:S,aws_cognito_identity_pool_id:b,aws_cognito_sign_up_verification_method:A,aws_cognito_mfa_configuration:E,aws_cognito_mfa_types:_,aws_cognito_password_protection_settings:C,aws_cognito_verification_mechanisms:k,aws_cognito_signup_attributes:T,aws_cognito_social_providers:P,aws_cognito_username_attributes:O,aws_mandatory_sign_in:R,aws_mobile_analytics_app_id:U,aws_mobile_analytics_app_region:x,aws_user_files_s3_bucket:B,aws_user_files_s3_bucket_region:M,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:V,aws_user_pools_id:G,aws_user_pools_web_client_id:j,geo:F,oauth:W,predictions:q,aws_cloud_logic_custom:z,Notifications:H,modelIntrospection:J}=t,Y={};U&&(Y.Analytics={Pinpoint:{appId:U,region:x}});const{InAppMessaging:$,Push:Q}=null!=H?H:{};if((null==$?void 0:$.AWSPinpoint)||(null==Q?void 0:Q.AWSPinpoint)){if(null==$?void 0:$.AWSPinpoint){const{appId:t,region:e}=$.AWSPinpoint;Y.Notifications={InAppMessaging:{Pinpoint:{appId:t,region:e}}}}if(null==Q?void 0:Q.AWSPinpoint){const{appId:t,region:e}=Q.AWSPinpoint;Y.Notifications={...Y.Notifications,PushNotification:{Pinpoint:{appId:t,region:e}}}}}if(Array.isArray(S)&&(Y.Interactions={LexV1:Object.fromEntries(S.map(t=>[t.name,t]))}),I){const t=N[m];t||L.debug("Invalid authentication type ".concat(m,". Falling back to IAM.")),Y.API={GraphQL:{endpoint:I,apiKey:y,region:v,defaultAuthMode:null!=t?t:"iam"}},J&&(Y.API.GraphQL.modelIntrospection=J)}const X=E?{status:E&&E.toLowerCase(),totpEnabled:null!=(e=null==_?void 0:_.includes("TOTP"))&&e,smsEnabled:null!=(n=null==_?void 0:_.includes("SMS"))&&n}:void 0,Z=C?{minLength:C.passwordPolicyMinLength,requireLowercase:null!=(r=null==(o=C.passwordPolicyCharacters)?void 0:o.includes("REQUIRES_LOWERCASE"))&&r,requireUppercase:null!=(s=null==(i=C.passwordPolicyCharacters)?void 0:i.includes("REQUIRES_UPPERCASE"))&&s,requireNumbers:null!=(u=null==(a=C.passwordPolicyCharacters)?void 0:a.includes("REQUIRES_NUMBERS"))&&u,requireSpecialCharacters:null!=(l=null==(c=C.passwordPolicyCharacters)?void 0:c.includes("REQUIRES_SYMBOLS"))&&l}:void 0,tt=Array.from(new Set([...null!=k?k:[],...null!=T?T:[]])).reduce((t,e)=>({...t,[e.toLowerCase()]:{required:!0}}),{}),et=null!=(h=null==O?void 0:O.includes("EMAIL"))&&h,nt=null!=(d=null==O?void 0:O.includes("PHONE_NUMBER"))&&d;(b||G)&&(Y.Auth={Cognito:{identityPoolId:b,allowGuestAccess:"enable"!==R,signUpVerificationMethod:A,userAttributes:tt,userPoolClientId:j,userPoolId:G,mfa:X,passwordFormat:Z,loginWith:{username:!(et||nt),email:et,phone:nt}}});const ot=!!W&&Object.keys(W).length>0,rt=!!P&&P.length>0;if(Y.Auth&&ot&&(Y.Auth.Cognito.loginWith={...Y.Auth.Cognito.loginWith,oauth:{...K(W),...rt&&{providers:D(P)}}}),B&&(Y.Storage={S3:{bucket:B,region:M,dangerouslyConnectToHttpEndpointForTesting:V}}),F){const{amazon_location_service:t}=F;Y.Geo={LocationService:{maps:t.maps,geofenceCollections:t.geofenceCollections,searchIndices:t.search_indices,region:t.region}}}if(z&&(Y.API={...Y.API,REST:z.reduce((t,e)=>{const{name:n,endpoint:o,region:r,service:i}=e;return{...t,[n]:{endpoint:o,...i?{service:i}:void 0,...r?{region:r}:void 0}}},{})}),q){const{VoiceId:t}=null!=(p=null==(g=null==(f=null==q?void 0:q.convert)?void 0:f.speechGenerator)?void 0:g.defaults)?p:{};Y.Predictions=t?{...q,convert:{...q.convert,speechGenerator:{...q.convert.speechGenerator,defaults:{voiceId:t}}}}:q}return Y})(t):function(t){const{version:e}=t;return!!e&&e.startsWith("1")}(t)?H(t):t;function tt({expiresAt:t,clockDrift:e}){return Date.now()+e>t}class et{configure(t,e){this.authConfig=t,this.authOptions=e}async fetchAuthSession(t={}){var e,n,o,r,i,s;let a,u;const c=await this.getTokens(t);return c?(u=null==(n=null==(e=c.accessToken)?void 0:e.payload)?void 0:n.sub,a=await(null==(r=null==(o=this.authOptions)?void 0:o.credentialsProvider)?void 0:r.getCredentialsAndIdentityId({authConfig:this.authConfig,tokens:c,authenticated:!0,forceRefresh:t.forceRefresh}))):a=await(null==(s=null==(i=this.authOptions)?void 0:i.credentialsProvider)?void 0:s.getCredentialsAndIdentityId({authConfig:this.authConfig,authenticated:!1,forceRefresh:t.forceRefresh})),{tokens:c,credentials:null==a?void 0:a.credentials,identityId:null==a?void 0:a.identityId,userSub:u}}async clearCredentials(){var t,e;await(null==(e=null==(t=this.authOptions)?void 0:t.credentialsProvider)?void 0:e.clearCredentialsAndIdentityId())}async getTokens(t){var e,n,o;return null!=(o=await(null==(n=null==(e=this.authOptions)?void 0:e.tokenProvider)?void 0:n.getTokens(t)))?o:void 0}}
1function nt(t,e,n,o){return new(n||(n=Promise))(function(r,i){function s(t){try{u(o.next(t))}catch(e){i(e)}}function a(t){try{u(o.throw(t))}catch(e){i(e)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}u((o=o.apply(t,e||[])).next())})}function ot(t,e){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,o=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(6===a[0]&&i.label<r[1]){i.label=r[1],r=a;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(u){a=[6,u],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function rt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}"function"==typeof SuppressedError&&SuppressedError;var it=64,st=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),at=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],ut=Math.pow(2,53)-1,ct=function(){function t(){this.state=Int32Array.from(at),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return t.prototype.update=function(t){if(this.finished)throw new Error("Attempted to update an already finished hash.");var e=0,n=t.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>ut)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=t[e++],n--,this.bufferLength===it&&(this.hashBuffer(),this.bufferLength=0)},t.prototype.digest=function(){if(!this.finished){var t=8*this.bytesHashed,e=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(e.setUint8(this.bufferLength++,128),n%it>=56){for(var o=this.bufferLength;o<it;o++)e.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(o=this.bufferLength;o<56;o++)e.setUint8(o,0);e.setUint32(56,Math.floor(t/4294967296),!0),e.setUint32(60,t),this.hashBuffer(),this.finished=!0}var r=new Uint8Array(32);for(o=0;o<8;o++)r[4*o]=this.state[o]>>>24&255,r[4*o+1]=this.state[o]>>>16&255,r[4*o+2]=this.state[o]>>>8&255,r[4*o+3]=this.state[o]>>>0&255;return r},t.prototype.hashBuffer=function(){for(var t=this.buffer,e=this.state,n=e[0],o=e[1],r=e[2],i=e[3],s=e[4],a=e[5],u=e[6],c=e[7],l=0;l<it;l++){if(l<16)this.temp[l]=(255&t[4*l])<<24|(255&t[4*l+1])<<16|(255&t[4*l+2])<<8|255&t[4*l+3];else{var h=this.temp[l-2],d=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,f=((h=this.temp[l-15])>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;this.temp[l]=(d+this.temp[l-7]|0)+(f+this.temp[l-16]|0)}var g=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&a^~s&u)|0)+(c+(st[l]+this.temp[l]|0)|0)|0,p=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&o^n&r^o&r)|0;c=u,u=a,a=s,s=i+g|0,i=r,r=o,o=n,n=g+p|0}e[0]+=n,e[1]+=o,e[2]+=r,e[3]+=i,e[4]+=s,e[5]+=a,e[6]+=u,e[7]+=c},t}();var lt=void 0!==f&&f.from?function(t){return f.from(t,"utf8")}:t=>(new TextEncoder).encode(t);function ht(t){return t instanceof Uint8Array?t:"string"==typeof t?lt(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}function dt(t){return"string"==typeof t?0===t.length:0===t.byteLength}function ft(t){if(!Uint32Array.from){for(var e=new Uint32Array(t.length),n=0;n<t.length;)e[n]=t[n],n+=1;return e}return Uint32Array.from(t)}var gt,pt,yt,mt,wt,It,vt,St,bt,At,Et,_t,Ct,kt,Tt,Pt,Ot,Rt,Ut,xt,Bt,Lt,Nt,Mt,Kt=function(){function t(t){this.secret=t,this.hash=new ct,this.reset()}
1return t.prototype.update=function(t){if(!dt(t)&&!this.error)try{this.hash.update(ht(t))}catch(e){this.error=e}},t.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()},t.prototype.digest=function(){return nt(this,void 0,void 0,function(){return ot(this,function(t){return[2,this.digestSync()]})})},t.prototype.reset=function(){if(this.hash=new ct,this.secret){this.outer=new ct;var t=function(t){var e=ht(t);if(e.byteLength>it){var n=new ct;n.update(e),e=n.digest()}var o=new Uint8Array(it);return o.set(e),o}(this.secret),e=new Uint8Array(it);e.set(t);for(var n=0;n<it;n++)t[n]^=54,e[n]^=92;this.hash.update(t),this.outer.update(e);for(n=0;n<t.byteLength;n++)t[n]=0}},t}();for(let Un=0;Un<256;Un++){let t=Un.toString(16).toLowerCase();1===t.length&&(t="0".concat(t))}(pt=gt||(gt={})).WebUnknown="0",pt.React="1",pt.NextJs="2",pt.Angular="3",pt.VueJs="4",pt.Nuxt="5",pt.Svelte="6",pt.ServerSideUnknown="100",pt.ReactSSR="101",pt.NextJsSSR="102",pt.AngularSSR="103",pt.VueJsSSR="104",pt.NuxtSSR="105",pt.SvelteSSR="106",pt.ReactNative="201",pt.Expo="202",(mt=yt||(yt={})).API="api",mt.Auth="auth",mt.Analytics="analytics",mt.DataStore="datastore",mt.Geo="geo",mt.InAppMessaging="inappmessaging",mt.Interactions="interactions",mt.Predictions="predictions",mt.PubSub="pubsub",mt.PushNotification="pushnotification",mt.Storage="storage",(It=wt||(wt={})).Record="1",It.IdentifyUser="2",(St=vt||(vt={})).GraphQl="1",St.Get="2",St.Post="3",St.Put="4",St.Patch="5",St.Del="6",St.Head="7",(At=bt||(bt={})).SignUp="1",At.ConfirmSignUp="2",At.ResendSignUpCode="3",At.SignIn="4",At.FetchMFAPreference="6",At.UpdateMFAPreference="7",At.SetUpTOTP="10",At.VerifyTOTPSetup="11",At.ConfirmSignIn="12",At.DeleteUserAttributes="15",At.DeleteUser="16",At.UpdateUserAttributes="17",At.FetchUserAttributes="18",At.ConfirmUserAttribute="22",At.SignOut="26",At.UpdatePassword="27",At.ResetPassword="28",At.ConfirmResetPassword="29",At.FederatedSignIn="30",At.RememberDevice="32",At.ForgetDevice="33",At.FetchDevices="34",At.SendUserAttributeVerificationCode="35",At.SignInWithRedirect="36",(_t=Et||(Et={})).Subscribe="1",_t.GraphQl="2",(kt=Ct||(Ct={})).SearchByText="0",kt.SearchByCoordinates="1",kt.SearchForSuggestions="2",kt.SearchByPlaceId="3",kt.SaveGeofences="4",kt.GetGeofence="5",kt.ListGeofences="6",kt.DeleteGeofences="7",(Pt=Tt||(Tt={})).SyncMessages="1",Pt.IdentifyUser="2",Pt.NotifyMessageInteraction="3",(Ot||(Ot={})).None="0",(Ut=Rt||(Rt={})).Convert="1",Ut.Identify="2",Ut.Interpret="3",(xt||(xt={})).Subscribe="1",(Lt=Bt||(Bt={})).InitializePushNotifications="1",Lt.IdentifyUser="2",(Mt=Nt||(Nt={})).UploadData="1",Mt.DownloadData="2",Mt.List="3",Mt.Copy="4",Mt.Remove="5",Mt.GetProperties="6",Mt.GetUrl="7";const Dt=()=>void 0!==t,Vt=()=>"undefined"!=typeof window,Gt=()=>"undefined"!=typeof document,jt=()=>void 0!==e,Ft=(t,e)=>!!Object.keys(t).find(t=>t.startsWith(e));var Wt={};var qt={};var zt={};const Ht=[{platform:gt.Expo,detectionMethod:function(){return Dt()&&void 0!==t.expo}},{platform:gt.ReactNative,detectionMethod:function(){return"undefined"!=typeof navigator&&void 0!==navigator.product&&"ReactNative"===navigator.product}},{platform:gt.NextJs,detectionMethod:function(){return Vt()&&window.next&&"object"==typeof window.next}},{platform:gt.Nuxt,detectionMethod:function(){return Vt()&&(void 0!==window.__NUXT__||void 0!==window.$nuxt)}},{platform:gt.Angular,detectionMethod:function(){const t=Boolean(Gt()&&document.querySelector("[ng-version]")),e=Boolean(Vt()&&void 0!==window.ng);return t||e}},{platform:gt.React,detectionMethod:function(){const t=t=>t.startsWith("_react")||t.startsWith("__react");return Gt()&&Array.from(document.querySelectorAll("[id]")).some(e=>Object.keys(e).find(t))}},{platform:gt.VueJs,detectionMethod:function(){return Vt()&&Ft(window,"__VUE")}},{platform:gt.Svelte,detectionMethod:function(){return Vt()&&Ft(window,"__SVELTE")}},{platform:gt.WebUnknown,detectionMethod:function(){return Vt()}},{platform:gt.NextJsSSR,detectionMethod:function(){return Dt()&&(Ft(t,"__next")||Ft(t,"__NEXT"))}},{platform:gt.NuxtSSR,detectionMethod:function(){return Dt()&&void 0!==t.__NUXT_PATHS__}},{platform:gt.ReactSSR,detectionMethod:function(){return jt()&&!!Object.keys(Wt).find(t=>t.includes("react"))}},{platform:gt.VueJsSSR,detectionMethod:function(){return Dt()&&Ft(t,"__VUE")}},{platform:gt.AngularSSR,detectionMethod:function(){var t;return jt()&&(null==(t=zt.npm_lifecycle_script)?void 0:t.startsWith("ng "))||!1}},{platform:gt.SvelteSSR,detectionMethod:function(){return jt()&&!!Object.keys(qt).find(t=>t.includes("svelte"))}}];const Jt=new class{constructor(){this.oAuthListener=void 0,this.resourcesConfig={},this.libraryOptions={},this.Auth=new et}configure(t,e){const n=Z(t);this.resourcesConfig=n,e&&(this.libraryOptions=e),this.resourcesConfig=B(this.resourcesConfig),this.Auth.configure(this.resourcesConfig.Auth,this.libraryOptions.Auth),E.dispatch("core",{event:"configure",data:this.resourcesConfig},"Configure",b),this.notifyOAuthListener()}getConfig(){return this.resourcesConfig}[V](t){var e,n,o;(null==(n=null==(e=this.resourcesConfig.Auth)?void 0:e.Cognito.loginWith)?void 0:n.oauth)?t(null==(o=this.resourcesConfig.Auth)?void 0:o.Cognito):this.oAuthListener=t}notifyOAuthListener(){var t,e,n;(null==(e=null==(t=this.resourcesConfig.Auth)?void 0:t.Cognito.loginWith)?void 0:e.oauth)&&this.oAuthListener&&(this.oAuthListener(null==(n=this.resourcesConfig.Auth)?void 0:n.Cognito),this.oAuthListener=void 0)}},Yt=t=>((t,e)=>t.Auth.fetchAuthSession(e))(Jt,t),$t=t=>{var e,n;const{headers:o,statusCode:r}=t;return{...Qt(t)?t.$metadata:{},httpStatusCode:r,requestId:null!=(n=null!=(e=o["x-amzn-requestid"])?e:o["x-amzn-request-id"])?n:o["x-amz-request-id"],extendedRequestId:o["x-amz-id-2"],cfId:o["x-amz-cf-id"]}},Qt=t=>"object"==typeof(null==t?void 0:t.$metadata),Xt=async t=>{var e,n,o,r,i;if(!t||t.statusCode<300)return;const s=await Zt(t),a=(t=>{const[e]=t.toString().split(/[,:]+/);return e.includes("#")?e.split("#")[1]:e})(null!=(o=null!=(n=null!=(e=t.headers["x-amzn-errortype"])?e:s.code)?n:s.__type)?o:"UnknownError"),u=null!=(i=null!=(r=s.message)?r:s.Message)?i:"Unknown error",c=new Error(u);return Object.assign(c,{name:a,$metadata:$t(t)})},Zt=async t=>{if(!t.body)throw new Error("Missing response payload");const e=await t.body.json();return Object.assign(e,{$metadata:$t(t)})},te=(t,e,n,o)=>async(r,i)=>{const s={...o,...r},a=await s.endpointResolver(s,i),u=await e(i,a),c=await t(u,{...s});return n(c)},ee={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},ne={partitions:[ee,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},oe=t=>{const{partitions:e}=ne;for(const{regions:n,outputs:o,regionRegex:r}of e){const e=new RegExp(r);if(n.includes(t)||e.test(t))return o.dnsSuffix}return ee.outputs.dnsSuffix},re=(t,e)=>{if(null==e?void 0:e.aborted)return Promise.resolve();let n,o;const r=new Promise(e=>{o=e,n=setTimeout(e,t)});return null==e||e.addEventListener("abort",function t(r){clearTimeout(n),null==e||e.removeEventListener("abort",t),o()}),r},ie=(t,e)=>{var n;"[object Object]"===Object.prototype.toString.call(t)&&(t.$metadata={...null!=(n=t.$metadata)?n:{},attempts:e})},se=(t,e)=>(n,o)=>{const r={};let i=e=>t(e,o);for(let t=e.length-1;t>=0;t--){i=(0,e[t])(o)(i,r)}return i(n)},ae=t=>{let e;return()=>(e||(e=t()),e)},ue=t=>!["HEAD","GET","DELETE"].includes(t.toUpperCase()),ce=se(async({url:t,method:e,headers:n,body:o}
1,{abortSignal:r,cache:i,withCrossDomainCredentials:s})=>{var a,u;let c;try{c=await fetch(t,{method:e,headers:n,body:ue(e)?o:void 0,signal:r,cache:i,credentials:s?"include":"same-origin"})}catch(h){if(h instanceof TypeError)throw new w({name:I.NetworkError,message:"A network error has occurred.",underlyingError:h});throw h}const l={};null==(a=c.headers)||a.forEach((t,e)=>{l[e.toLowerCase()]=t});return{...{statusCode:c.status,headers:l,body:null},body:Object.assign(null!=(u=c.body)?u:{},{text:ae(()=>c.text()),blob:ae(()=>c.blob()),json:ae(()=>c.json())})}},[({userAgentHeader:t="x-amz-user-agent",userAgentValue:e=""})=>n=>async function(o){if(0===e.trim().length){return await n(o)}{const r=t.toLowerCase();o.headers[r]=o.headers[r]?"".concat(o.headers[r]," ").concat(e):e;return await n(o)}},({maxAttempts:t=3,retryDecider:e,computeDelay:n,abortSignal:o})=>{if(t<1)throw new Error("maxAttempts must be greater than 0");return(r,i)=>async function(s){var a,u,c;let l,h,d=null!=(a=i.attemptsCount)?a:0;const f=()=>{if(h)return ie(h,d),h;throw ie(l,d),l};for(;!(null==o?void 0:o.aborted)&&d<t;){try{h=await r(s),l=void 0}catch(g){l=g,h=void 0}if(d=(null!=(u=i.attemptsCount)?u:0)>d?null!=(c=i.attemptsCount)?c:0:d+1,i.attemptsCount=d,!(await e(h,l)))return f();if(!(null==o?void 0:o.aborted)&&d<t){const t=n(d);await re(t,o)}}if(null==o?void 0:o.aborted)throw new Error("Request aborted.");return f()}}]);function le(t=3e5){return e=>{const n=2**e*100+100*Math.random();return!(n>t)&&n}}const he=3e5,de=t=>{const e=le(he)(t);return!1===e?he:e},fe=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],ge=t=>async(e,n)=>{var o;const r=null!=(o=null!=n?n:await t(e))?o:void 0,i=(null==r?void 0:r.code)||(null==r?void 0:r.name),s=null==e?void 0:e.statusCode;return we(n)||me(s,i)||(t=>!!t&&fe.includes(t))(i)||Ie(s,i)},pe=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],ye=["TimeoutError","RequestTimeout","RequestTimeoutException"],me=(t,e)=>429===t||!!e&&pe.includes(e),we=t=>"Network error"===(null==t?void 0:t.name),Ie=(t,e)=>!!t&&[500,502,503,504].includes(t)||!!e&&ye.includes(e),ve=URL;let Se;const be=[];let Ae=!1;const Ee=()=>{var t;if(!Se){if(Se=function(){var t;return(null==(t=Ht.find(t=>t.detectionMethod()))?void 0:t.platform)||gt.ServerSideUnknown}(),Ae)for(;be.length;)null==(t=be.pop())||t();else be.forEach(t=>{t()});_e(gt.ServerSideUnknown,10),_e(gt.WebUnknown,10)}return Se};function _e(t,e){Se!==t||Ae||setTimeout(()=>{Se=void 0,Ae=!0,setTimeout(Ee,1e3)},e)}const Ce={},ke=({category:t,action:e}={})=>{const n=[["aws-amplify","6.6.3"]];if(t&&n.push([t,e]),n.push(["framework",Ee()]),t&&e){const o=((t,e)=>{var n,o;return null==(o=null==(n=Ce[t])?void 0:n[e])?void 0:o.additionalDetails})(t,e);o&&o.forEach(t=>{n.push(t)})}return n},Te=t=>ke(t).map(([t,e])=>t&&e?"".concat(t,"/").concat(e):t).join(" "),Pe=se(ce,[()=>t=>async function(e){return e.headers["cache-control"]="no-store",t(e)}]),Oe={service:"cognito-identity",endpointResolver:({region:t})=>({url:new ve("https://cognito-identity.".concat(t,".").concat(oe(t)))}),retryDecider:ge(Xt),computeDelay:de,userAgentValue:Te(),cache:"no-store"};var Re;Re=()=>{Oe.userAgentValue=Te()},Ae||be.push(Re);const Ue=t=>({"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.".concat(t)}),xe=({url:t},e,n)=>({headers:e,url:t,body:n,method:"POST"}),Be=te(Pe,(t,e)=>{const n=Ue("GetId"),o=JSON.stringify(t);return xe(e,n,o)},async t=>{if(t.statusCode>=300){throw await Xt(t)}return{IdentityId:(await Zt(t)).IdentityId,$metadata:$t(t)}},Oe),Le=({AccessKeyId:t,SecretKey:e,SessionToken:n,Expiration:o}={})=>({AccessKeyId:t,SecretKey:e,SessionToken:n,Expiration:o&&new Date(1e3*o)}),Ne=te(Pe,(t,e)=>{const n=Ue("GetCredentialsForIdentity"),o=JSON.stringify(t);return xe(e,n,o)},async t=>{if(t.statusCode>=300){throw await Xt(t)}{const e=await Zt(t);return{IdentityId:e.IdentityId,Credentials:Le(e.Credentials),$metadata:$t(t)}}},Oe);class Me extends w{constructor(){super({name:I.PlatformNotSupported,message:"Function not supported on current platform"})}}class Ke{constructor(t){this.storage=t}async setItem(t,e){if(!this.storage)throw new Me;this.storage.setItem(t,e)}async getItem(t){if(!this.storage)throw new Me;return this.storage.getItem(t)}async removeItem(t){if(!this.storage)throw new Me;this.storage.removeItem(t)}async clear(){if(!this.storage)throw new Me;this.storage.clear()}}class De{constructor(){this.storage=new Map}get length(){return this.storage.size}key(t){return t>this.length-1?null:Array.from(this.storage.keys())[t]}setItem(t,e){this.storage.set(t,e)}getItem(t){var e;return null!=(e=this.storage.get(t))?e:null}removeItem(t){this.storage.delete(t)}clear(){this.storage.clear()}}function Ve(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)t[o]=n[o]}return t}var Ge=function t(e,n){function o(t,o,r){if("undefined"!=typeof document){"number"==typeof(r=Ve({},n,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decode
1URIComponent).replace(/[()]/g,escape);var i="";for(var s in r)r[s]&&(i+="; "+s,!0!==r[s]&&(i+="="+r[s].split(";")[0]));return document.cookie=t+"="+e.write(o,t)+i}}return Object.create({set:o,get:function(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var n=document.cookie?document.cookie.split("; "):[],o={},r=0;r<n.length;r++){var i=n[r].split("="),s=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(o[a]=e.read(s,a),t===a)break}catch(u){}}return t?o[t]:o}},remove:function(t,e){o(t,"",Ve({},e,{expires:-1}))},withAttributes:function(e){return t(this.converter,Ve({},this.attributes,e))},withConverter:function(e){return t(Ve({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(e)}})}({read:function(t){return'"'===t[0]&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});class je{constructor(t={}){const{path:e,domain:n,expires:o,sameSite:r,secure:i}=t;if(this.domain=n,this.path=e||"/",this.expires=Object.prototype.hasOwnProperty.call(t,"expires")?o:365,this.secure=!Object.prototype.hasOwnProperty.call(t,"secure")||i,Object.prototype.hasOwnProperty.call(t,"sameSite")){if(!r||!["strict","lax","none"].includes(r))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if("none"===r&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=r}}async setItem(t,e){Ge.set(t,e,this.getData())}async getItem(t){const e=Ge.get(t);return null!=e?e:null}async removeItem(t){Ge.remove(t,this.getData())}async clear(){const t=Ge.get(),e=Object.keys(t).map(t=>this.removeItem(t));await Promise.all(e)}getData(){return{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure,...this.sameSite&&{sameSite:this.sameSite}}}}const Fe=new class extends Ke{constructor(){super("undefined"!=typeof window&&window.localStorage?window.localStorage:new De)}};new class extends Ke{constructor(){super("undefined"!=typeof window&&window.sessionStorage?window.sessionStorage:new De)}};const We=(t,e,n=3e5,o)=>async function(t,e,n){if("function"!=typeof t)throw Error("functionToRetry must be a function");return new Promise(async(o,r)=>{let i,s=0,a=()=>{};for(;;){s++,x.debug("".concat(t.name," attempt #").concat(s," with this vars: ").concat(JSON.stringify(e)));try{return void o(await t(...e))}catch(u){if(i=u,x.debug("error on ".concat(t.name),u),U(u))return x.debug("".concat(t.name," non retryable error"),u),void r(u);const o=n(s,e,u);if(x.debug("".concat(t.name," retrying in ").concat(o," ms")),!1===o)return void r(u);await new Promise(t=>{a=t,setTimeout(a,o)})}}r(i)})}(t,e,le(n));class qe extends w{constructor(t){super(t),this.constructor=qe,Object.setPrototypeOf(this,qe.prototype)}}function ze(t){if(!t||!t.includes(":"))throw new qe({name:"InvalidIdentityPoolIdException",message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."});return t.split(":")[0]}const He="UserUnAuthenticatedException";new qe({name:"InvalidRedirectException",message:"signInRedirect or signOutRedirect had an invalid format or was not found.",recoverySuggestion:"Please make sure the signIn/Out redirect in your oauth config is valid."}),new qe({name:"InvalidAppSchemeException",message:"A valid non-http app scheme was not found in the config.",recoverySuggestion:"Please make sure a valid custom app scheme is present in the config."}),new qe({name:"InvalidPreferredRedirectUrlException",message:"The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.",recoverySuggestion:"Please make sure a matching preferredRedirectUrl is provided."});new qe({name:"InvalidOriginException",message:"redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin",recoverySuggestion:"Please call signInWithRedirect from the same origin."});const Je=new qe({name:"TokenRefreshException",message:"Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow. \n\tPlease change your oauth configuration to use 'code grant' flow.",recoverySuggestion:"Please logout and change your Amplify configuration to use \"code grant\" flow. \n\tE.g { responseType: 'code' }"}),Ye=new qe({name:He,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function $e(t){if(function(t){return Xe(t)&&!(null==t?void 0:t.refreshToken)}(t))throw Je;if(!function(t){return Xe(t)&&(null==t?void 0:t.refreshToken)}(t))throw Ye}const Qe={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function Xe(t){return(null==t?void 0:t.accessToken)||(null==t?void 0:t.idToken)}const Ze=t=>({"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityProvi
1derService.".concat(t)}),tn=({url:t},e,n)=>({headers:e,url:t,body:n,method:"POST"});function en(t){if(!t||"Error"===t.name||t instanceof TypeError)throw new qe({name:I.Unknown,message:"An unknown error has occurred.",underlyingError:t})}const nn=se(ce,[()=>(t,e)=>async function(e){return e.headers["cache-control"]="no-store",t(e)}]),on="cognito-idp",rn={service:on,retryDecider:ge(Xt),computeDelay:de,userAgentValue:Te(),cache:"no-store"},sn=t=>{return te(nn,(e="InitiateAuth",(t,n)=>{const o=Ze(e),r=JSON.stringify(t);return tn(n,o,r)}),async t=>{if(t.statusCode>=300){const e=await Xt(t);throw en(e),new qe({name:e.name,message:e.message})}return Zt(t)},{...rn,...t});var e},an=({endpointOverride:t})=>e=>t?{url:new ve(t)}:(({region:t})=>({url:new ve("https://".concat(on,".").concat(t,".").concat(oe(t)))}))(e);const un=(t=>{let e;return async(...n)=>e||(e=new Promise((o,r)=>{t(...n).then(t=>{o(t)}).catch(t=>{r(t)}).finally(()=>{e=void 0})}),e)})(async({tokens:t,authConfig:e,username:n})=>{var o,r;P(null==e?void 0:e.Cognito);const{userPoolId:i,userPoolClientId:s,userPoolEndpoint:a}=e.Cognito,u=function(t){const e=null==t?void 0:t.split("_")[0];if(!t||t.indexOf("_")<0||!e||"string"!=typeof e)throw new qe({name:"InvalidUserPoolId",message:"Invalid user pool id provided."});return e}(i);$e(t);const c=t.refreshToken,l={REFRESH_TOKEN:c};(null==(o=t.deviceMetadata)?void 0:o.deviceKey)&&(l.DEVICE_KEY=t.deviceMetadata.deviceKey);const h=function({username:t,userPoolId:e,userPoolClientId:n}){if("undefined"==typeof window)return;const o=window.AmazonCognitoAdvancedSecurityData;if(void 0===o)return;const r=o.getData(t,e,n);if(r)return{EncodedData:r};return{}}({username:n,userPoolId:i,userPoolClientId:s}),d=sn({endpointResolver:an({endpointOverride:a})}),{AuthenticationResult:f}=await d({region:u},{ClientId:s,AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:l,UserContextData:h}),g=R(null!=(r=null==f?void 0:f.AccessToken)?r:""),p=(null==f?void 0:f.IdToken)?R(f.IdToken):void 0,{iat:y}=g.payload;if(!y)throw new qe({name:"iatNotFoundException",message:"iat not found in access token"});return{accessToken:g,idToken:p,clockDrift:1e3*y-(new Date).getTime(),refreshToken:c,username:n}}),cn={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetails:"signInDetails",oauthMetadata:"oauthMetadata"};var ln;(ln||(ln={})).InvalidAuthTokens="InvalidAuthTokens";const hn=S({[ln.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}});class dn{constructor(){this.name="CognitoIdentityServiceProvider"}getKeyValueStorage(){if(!this.keyValueStorage)throw new qe({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(t){this.keyValueStorage=t}setAuthConfig(t){this.authConfig=t}async loadTokens(){var t,e,n;try{const o=await this.getAuthKeys(),r=await this.getKeyValueStorage().getItem(o.accessToken);if(!r)throw new qe({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});const i=R(r),s=await this.getKeyValueStorage().getItem(o.idToken),a=s?R(s):void 0,u=null!=(t=await this.getKeyValueStorage().getItem(o.refreshToken))?t:void 0,c=null!=(e=await this.getKeyValueStorage().getItem(o.clockDrift))?e:"0",l=Number.parseInt(c),h=await this.getKeyValueStorage().getItem(o.signInDetails),d={accessToken:i,idToken:a,refreshToken:u,deviceMetadata:null!=(n=await this.getDeviceMetadata())?n:void 0,clockDrift:l,username:await this.getLastAuthUser()};return h&&(d.signInDetails=JSON.parse(h)),d}catch(o){return null}}async storeTokens(t){hn(void 0!==t,ln.InvalidAuthTokens),await this.clearTokens();const e=t.username;await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),e);const n=await this.getAuthKeys();await this.getKeyValueStorage().setItem(n.accessToken,t.accessToken.toString()),t.idToken&&await this.getKeyValueStorage().setItem(n.idToken,t.idToken.toString()),t.refreshToken&&await this.getKeyValueStorage().setItem(n.refreshToken,t.refreshToken),t.deviceMetadata&&(t.deviceMetadata.deviceKey&&await this.getKeyValueStorage().setItem(n.deviceKey,t.deviceMetadata.deviceKey),t.deviceMetadata.deviceGroupKey&&await this.getKeyValueStorage().setItem(n.deviceGroupKey,t.deviceMetadata.deviceGroupKey),await this.getKeyValueStorage().setItem(n.randomPasswordKey,t.deviceMetadata.randomPassword)),t.signInDetail
1s&&await this.getKeyValueStorage().setItem(n.signInDetails,JSON.stringify(t.signInDetails)),await this.getKeyValueStorage().setItem(n.clockDrift,"".concat(t.clockDrift))}async clearTokens(){const t=await this.getAuthKeys();await Promise.all([this.getKeyValueStorage().removeItem(t.accessToken),this.getKeyValueStorage().removeItem(t.idToken),this.getKeyValueStorage().removeItem(t.clockDrift),this.getKeyValueStorage().removeItem(t.refreshToken),this.getKeyValueStorage().removeItem(t.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),this.getKeyValueStorage().removeItem(t.oauthMetadata)])}async getDeviceMetadata(t){const e=await this.getAuthKeys(t),n=await this.getKeyValueStorage().getItem(e.deviceKey),o=await this.getKeyValueStorage().getItem(e.deviceGroupKey),r=await this.getKeyValueStorage().getItem(e.randomPasswordKey);return r&&o&&n?{deviceKey:n,deviceGroupKey:o,randomPassword:r}:null}async clearDeviceMetadata(t){const e=await this.getAuthKeys(t);await Promise.all([this.getKeyValueStorage().removeItem(e.deviceKey),this.getKeyValueStorage().removeItem(e.deviceGroupKey),this.getKeyValueStorage().removeItem(e.randomPasswordKey)])}async getAuthKeys(t){var e;P(null==(e=this.authConfig)?void 0:e.Cognito);const n=null!=t?t:await this.getLastAuthUser();return fn(this.name,"".concat(this.authConfig.Cognito.userPoolClientId,".").concat(n))}getLastAuthUserKey(){var t;P(null==(t=this.authConfig)?void 0:t.Cognito);const e=this.authConfig.Cognito.userPoolClientId;return"".concat(this.name,".").concat(e,".LastAuthUser")}async getLastAuthUser(){var t;return null!=(t=await this.getKeyValueStorage().getItem(this.getLastAuthUserKey()))?t:"username"}async setOAuthMetadata(t){const{oauthMetadata:e}=await this.getAuthKeys();await this.getKeyValueStorage().setItem(e,JSON.stringify(t))}async getOAuthMetadata(){const{oauthMetadata:t}=await this.getAuthKeys(),e=await this.getKeyValueStorage().getItem(t);return e&&JSON.parse(e)}}const fn=(t,e)=>gn(cn)("".concat(t),e);function gn(t){const e=Object.values({...t});return(t,n)=>e.reduce((e,o)=>({...e,[o]:"".concat(t,".").concat(n,".").concat(o)}),{})}const pn="amplify-signin-with-hostedUI",yn="CognitoIdentityServiceProvider";const mn=(t,e)=>gn(Qe)(t,e),wn=new class{constructor(t){this.keyValueStorage=t}async clearOAuthInflightData(){P(this.cognitoConfig);const t=mn(yn,this.cognitoConfig.userPoolClientId);await Promise.all([this.keyValueStorage.removeItem(t.inflightOAuth),this.keyValueStorage.removeItem(t.oauthPKCE),this.keyValueStorage.removeItem(t.oauthState)])}async clearOAuthData(){P(this.cognitoConfig);const t=mn(yn,this.cognitoConfig.userPoolClientId);return await this.clearOAuthInflightData(),await this.keyValueStorage.removeItem(pn),this.keyValueStorage.removeItem(t.oauthSignIn)}loadOAuthState(){P(this.cognitoConfig);const t=mn(yn,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(t.oauthState)}storeOAuthState(t){P(this.cognitoConfig);const e=mn(yn,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(e.oauthState,t)}loadPKCE(){P(this.cognitoConfig);const t=mn(yn,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(t.oauthPKCE)}storePKCE(t){P(this.cognitoConfig);const e=mn(yn,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(e.oauthPKCE,t)}setAuthConfig(t){this.cognitoConfig=t}async loadOAuthInFlight(){P(this.cognitoConfig);const t=mn(yn,this.cognitoConfig.userPoolClientId);return"true"===await this.keyValueStorage.getItem(t.inflightOAuth)}async storeOAuthInFlight(t){P(this.cognitoConfig);const e=mn(yn,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(e.inflightOAuth,"".concat(t))}async loadOAuthSignIn(){var t,e;P(this.cognitoConfig);const n=mn(yn,this.cognitoConfig.userPoolClientId),o=await this.keyValueStorage.getItem(pn),[r,i]=null!=(e=null==(t=await this.keyValueStorage.getItem(n.oauthSignIn))?void 0:t.split(","))?e:[];return{isOAuthSignIn:"true"===r||"true"===o,preferPrivateSession:"true"===i}}async storeOAuthSignIn(t,e=!1){P(this.cognitoConfig);const n=mn(yn,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(n.oauthSignIn,"".concat(t,",").concat(e))}}(Fe);class In{constructor(){this.waitForInflightOAuth="undefined"!=typeof window&&void 0!==window.document?async()=>
1{if(await wn.loadOAuthInFlight())return this.inflightPromise||(this.inflightPromise=new Promise((t,e)=>{})),this.inflightPromise}:async()=>{}}setAuthConfig(t){wn.setAuthConfig(t.Cognito),this.authConfig=t}setTokenRefresher(t){this.tokenRefresher=t}setAuthTokenStore(t){this.tokenStore=t}getTokenStore(){if(!this.tokenStore)throw new qe({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}getTokenRefresher(){if(!this.tokenRefresher)throw new qe({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}async getTokens(t){var e,n,o,r,i,s,a,u,c;let l;try{P(null==(e=this.authConfig)?void 0:e.Cognito)}catch(g){return null}await this.waitForInflightOAuth(),this.inflightPromise=void 0,l=await this.getTokenStore().loadTokens();const h=await this.getTokenStore().getLastAuthUser();if(null===l)return null;const d=!!(null==l?void 0:l.idToken)&&tt({expiresAt:1e3*(null!=(r=null==(o=null==(n=l.idToken)?void 0:n.payload)?void 0:o.exp)?r:0),clockDrift:null!=(i=l.clockDrift)?i:0}),f=tt({expiresAt:1e3*(null!=(u=null==(a=null==(s=l.accessToken)?void 0:s.payload)?void 0:a.exp)?u:0),clockDrift:null!=(c=l.clockDrift)?c:0});return((null==t?void 0:t.forceRefresh)||d||f)&&(l=await this.refreshTokens({tokens:l,username:h}),null===l)?null:{accessToken:null==l?void 0:l.accessToken,idToken:null==l?void 0:l.idToken,signInDetails:null==l?void 0:l.signInDetails}}async refreshTokens({tokens:t,username:e}){try{const{signInDetails:n}=t,o=await this.getTokenRefresher()({tokens:t,authConfig:this.authConfig,username:e});return o.signInDetails=n,await this.setTokens({tokens:o}),E.dispatch("auth",{event:"tokenRefresh"},"Auth",b),o}catch(n){return this.handleErrors(n)}}handleErrors(t){if(en(t),"Network error"!==t.message&&this.clearTokens(),E.dispatch("auth",{event:"tokenRefresh_failure",data:{error:t}},"Auth",b),t.name.startsWith("NotAuthorizedException"))return null;throw t}async setTokens({tokens:t}){return this.getTokenStore().storeTokens(t)}async clearTokens(){return this.getTokenStore().clearTokens()}getDeviceMetadata(t){return this.getTokenStore().getDeviceMetadata(t)}clearDeviceMetadata(t){return this.getTokenStore().clearDeviceMetadata(t)}setOAuthMetadata(t){return this.getTokenStore().setOAuthMetadata(t)}getOAuthMetadata(){return this.getTokenStore().getOAuthMetadata()}}const vn=new class{constructor(){this.authTokenStore=new dn,this.authTokenStore.setKeyValueStorage(Fe),this.tokenOrchestrator=new In,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(un)}getTokens({forceRefresh:t}={forceRefresh:!1}){return this.tokenOrchestrator.getTokens({forceRefresh:t})}setKeyValueStorage(t){this.authTokenStore.setKeyValueStorage(t)}
1setAuthConfig(t){this.authTokenStore.setAuthConfig(t),this.tokenOrchestrator.setAuthConfig(t)}},{tokenOrchestrator:Sn}=vn,bn={identityId:"identityId"},An=new m("DefaultIdentityIdStore");const En=(t,e)=>gn(bn)("com.amplify.".concat(t),e);function _n(t){const e=R(t).payload.iss,n={};if(!e)throw new qe({name:"InvalidIdTokenException",message:"Invalid Idtoken."});return n[e.replace(/(^\w+:|^)\/\//,"")]=t,n}const Cn=new m("CognitoIdentityIdProvider");async function kn(t,e){const n=null==e?void 0:e.identityPoolId,o=ze(n),r=(await Be({region:o},{IdentityPoolId:n,Logins:t})).IdentityId;if(!r)throw new qe({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return r}const Tn=new m("CognitoCredentialsProvider"),Pn=3e6;const On=new class{constructor(t){this._nextCredentialsRefresh=0,this._identityIdStore=t}async clearCredentialsAndIdentityId(){Tn.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){Tn.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(t){const e=t.authenticated,{tokens:n}=t,{authConfig:o}=t;try{O(null==o?void 0:o.Cognito)}catch(a){return}if(!e&&!o.Cognito.allowGuestAccess)return;const{forceRefresh:r}=t,i=this.hasTokenChanged(n),s=await async function({tokens:t,authConfig:e,identityIdStore:n}){n.setAuthConfig({Cognito:e});let o=await n.loadIdentityId();if(t){if(o&&"primary"===o.type)return o.id;{const n=t.idToken?_n(t.idToken.toString()):{},r=await kn(n,e);o&&o.id===r&&Cn.debug("The guest identity ".concat(o.id," has become the primary identity.")),o={id:r,type:"primary"}}}else{if(o&&"guest"===o.type)return o.id;o={id:await kn({},e),type:"guest"}}return n.storeIdentityId(o),o.id}({tokens:n,authConfig:o.Cognito,identityIdStore:this._identityIdStore});return(r||i)&&this.clearCredentials(),e?(function(t){if(!t||!t.idToken)throw new qe({name:He,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}(n),this.credsForOIDCTokens(o.Cognito,n,s)):this.getGuestCredentials(s,o.Cognito)}async getGuestCredentials(t,e){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&!1===this._credentialsAndIdentityId.isAuthenticatedCreds)return Tn.info("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const n=ze(e.identityPoolId),o=await Ne({region:n},{IdentityId:t});if(o.Credentials&&o.Credentials.AccessKeyId&&o.Credentials.SecretKey){this._nextCredentialsRefresh=(new Date).getTime()+Pn;const e={credentials:{accessKeyId:o.Credentials.AccessKeyId,secretAccessKey:o.Credentials.SecretKey,sessionToken:o.Credentials.SessionToken,expiration:o.Credentials.Expiration},identityId:t},n=o.IdentityId;return n&&(e.identityId=n,this._identityIdStore.storeIdentityId({id:n,type:"guest"})),this._credentialsAndIdentityId={...e,isAuthenticatedCreds:!1},e}throw new qe({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}async credsForOIDCTokens(t,e,n){var o;if(this._credentialsAndIdentityId&&!this.isPastTTL()&&!0===this._credentialsAndIdentityId.isAuthenticatedCreds)return Tn.debug("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const r=e.idToken?_n(e.idToken.toString()):{},i=ze(t.identityPoolId),s=await Ne({region:i},{IdentityId:n,Logins:r});if(s.Credentials&&s.Credentials.AccessKeyId&&s.Credentials.SecretKey){const t={credentials:{accessKeyId:s.Credentials.AccessKeyId,secretAccessKey:s.Credentials.SecretKey,sessionToken:s.Credentials.SessionToken,expiration:s.Credentials.Expiration},identityId:n};this._credentialsAndIdentityId={...t,isAuthenticatedCreds:!0,associatedIdToken:null==(o=e.idToken)?void 0:o.toString()},this._nextCredentialsRefresh=(new Date).getTime()+Pn;const r=s.IdentityId;return r&&(t.identityId=r,this._identityIdStore.storeIdentityId({id:r,type:"primary"})),t}throw new qe({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}isPastTTL(){return void 0===this._nextCredentialsRefresh||this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(t){var e,n;return!!t&&!!(null==(e=this._credentialsAndIdentityId)?void 0:e.associatedIdToken)&&(null==(n=t.idToken)?void 0:n.toString())!==this._credentialsAndIdentityId.associatedIdToken}}(new class{setAuthConfig(t){O(t.Cognito),this.authConfig=t,this._authKeys=En("Cognito",t.Cognito.identityPoolId)}constructor(t){this._authKeys={},this._hasGuestIdentityId=!1,this.keyValueStorage=t}async loadIdentityId(){var t;O(null==(t=this.authConfig)?void 0:t.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{const t=await this.keyValueStorage.getItem(this._authKeys.identityId);return t?(this._hasGuestIdentityId=!0,{id:t,type:"guest"}):null}}catch(e){return An.log("Error getting stored IdentityId.",e),null}}async storeIdentityId(t){var e;O(null==(e=this.authConfig)?void 0:e.Cognito),"guest"===t.type?(this.keyValueStorage.setItem(this._authKeys.identityId,t.id),this._primaryIdentityId=void 0,this._hasGuestIdentityId=!0):(this._primaryIdentityId=t.
1id,this._hasGuestIdentityId&&(this.keyValueStorage.removeItem(this._authKeys.identityId),this._hasGuestIdentityId=!1))}async clearIdentityId(){this._primaryIdentityId=void 0,await this.keyValueStorage.removeItem(this._authKeys.identityId)}}(Fe)),Rn={configure(t,e){const n=Z(t);if(n.Auth){if(!(null==e?void 0:e.Auth))return Jt.libraryOptions.Auth?e?(void 0!==e.ssr&&vn.setKeyValueStorage(e.ssr?new je({sameSite:"lax"}):Fe),void Jt.configure(n,{Auth:Jt.libraryOptions.Auth,...e})):void Jt.configure(n):(vn.setAuthConfig(n.Auth),vn.setKeyValueStorage((null==e?void 0:e.ssr)?new je({sameSite:"lax"}):Fe),void Jt.configure(n,{...e,Auth:{tokenProvider:vn,credentialsProvider:On}}));Jt.configure(n,e)}else Jt.configure(n,e)},getConfig:()=>Jt.getConfig()};export{f as B,Rn as D,Kt as S,rt as _,ht as c,Yt as f,Te as g,dt as i,We as j,ft as u,z as v};
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.