1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7521],{429:(e,t,o)=>{o.d(t,{x:()=>n});class n extends Error{constructor({message:e,name:t,recoverySuggestion:o,underlyingError:i,metadata:r}){if(super(e),this.name=t,this.underlyingError=i,this.recoverySuggestion=o,r){const{extendedRequestId:e,httpStatusCode:t,requestId:o}=r;this.metadata={extendedRequestId:e,httpStatusCode:t,requestId:o}}this.constructor=n,Object.setPrototypeOf(this,n.prototype)}}},1413:(e,t,o)=>{o.d(t,{A:()=>n});let n=(e,t,o,n)=>async(i,r)=>{let a={...n,...i},s=await a.endpointResolver(a,r),u=await t(r,s);return o(await e(u,{...a}))}},5375:(e,t,o)=>{o.d(t,{I:()=>l});var n=o(4902),i=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),r=[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],a=function(){function e(){this.state=Int32Array.from(r),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 Error("Attempted to update an already finished hash.");var t=0,o=e.byteLength;if(this.bytesHashed+=o,8*this.bytesHashed>0x1fffffffffffff)throw Error("Cannot hash more than 2^53 - 1 bits");for(;o>0;)this.buffer[this.bufferLength++]=e[t++],o--,64===this.bufferLength&&(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),o=this.bufferLength;if(t.setUint8(this.bufferLength++,128),o%64>=56){for(var n=this.bufferLength;n<64;n++)t.setUint8(n,0);this.hashBuffer(),this.bufferLength=0}for(var n=this.bufferLength;n<56;n++)t.setUint8(n,0);t.setUint32(56,Math.floor(e/0x100000000),!0),t.setUint32(60,e),this.hashBuffer(),this.finished=!0}for(var i=new Uint8Array(32),n=0;n<8;n++)i[4*n]=this.state[n]>>>24&255,i[4*n+1]=this.state[n]>>>16&255,i[4*n+2]=this.state[n]>>>8&255,i[4*n+3]=this.state[n]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,o=t[0],n=t[1],r=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],d=0;d<64;d++){if(d<16)this.temp[d]=(255&e[4*d])<<24|(255&e[4*d+1])<<16|(255&e[4*d+2])<<8|255&e[4*d+3];else{var h=this.temp[d-2],g=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,f=((h=this.temp[d-15])>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;this.temp[d]=(g+this.temp[d-7]|0)+(f+this.temp[d-16]|0)}var p=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&u^~s&c)|0)+(l+(i[d]+this.temp[d]|0)|0)|0,m=((o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+(o&n^o&r^n&r)|0;l=c,c=u,u=s,s=a+p|0,a=r,r=n,n=o,o=p+m|0}t[0]+=o,t[1]+=n,t[2]+=r,t[3]+=a,t[4]+=s,t[5]+=u,t[6]+=c,t[7]+=l},e}(),s=o(82909).Buffer,u=void 0!==s&&s.from?function(e){return s.from(e,"utf8")}:e=>new TextEncoder().encode(e);function c(e){return e instanceof Uint8Array?e:"string"==typeof e?u(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}var l=function(){function e(e){this.secret=e,this.hash=new a,this.reset()}return e.prototype.update=function(e){if(!("string"==typeof e?0===e.length:0===e.byteLength)&&!this.error)try{this.hash.update(c(e))}catch(e){this.error=e}},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(0,n.sH)(this,void 0,void 0,function(){return(0,n.YH)(this,function(e){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new a,this.secret){this.outer=new a;var e=function(e){var t=c(e);if(t.byteLength>64){var o=new a;o.update(t),t=o.digest()}var n=new Uint8Array(64);return n.set(t),n}(this.secret),t=new Uint8Array(64);t.set(e);for(var o=0;o<64;o++)e[o]^=54,t[o]^=92;this.hash.update(e),this.outer.update(t);for(var o=0;o<e.byteLength;o++)e[o]=0}},e}()},8305:(e,t,o)=>{o.d(t,{C:()=>s});var n=o(63253),i=o(49352),r=o(62437),a=o(28753);let s={service:o(75097).M,retryDecider:(0,n.D)(i.F),computeDelay:r.y,get userAgentValue(){return(0,a.fE)()},cache:"no-store"}},10964:(e,t,o)=>{var n,i;o.d(t,{m:()=>n}),(i=n||(n={})).NoEndpointId="NoEndpointId",i.PlatformNotSupported="PlatformNotSupported",i.Unknown="Unknown",i.NetworkError="NetworkError"},14228:(e,t,o)=>{o.d(t,{l:()=>i});var n=o(429);class i extends n.x{constructor(e){super(e),this.constructor=i,Object.setPrototypeOf(this,i.prototype)}}},14979:(e,t,o)=>{o.d(t,{$6:()=>l,A0:()=>s,Cs:()=>h,RW:()=>u,jK:()=>c,kM:()=>a,mh:()=>d,yA:()=>g,z0:()=>r,zz:()=>i});var n=o(14228);let i="UserUnAuthenticatedException",r="UserAlreadyAuthenticatedException",a="DeviceMetadataNotFoundException",s="AutoSignInException",u=new n.l({name:"InvalidRedirectException",message:"signInRedirect or signOutRedirect had an invali
1d format or was not found.",recoverySuggestion:"Please make sure the signIn/Out redirect in your oauth config is valid."});new n.l({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."});let c=new n.l({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."}),l=new n.l({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."}),d="OAuthSignOutException",h="TokenRefreshException",g="UnexpectedSignInInterruptionException"},16940:(e,t,o)=>{let n;o.d(t,{F:()=>m});var i=o(18393);let r=(e,t)=>{let o,n;if(t?.aborted)return Promise.resolve();let i=new Promise(t=>{n=t,o=setTimeout(t,e)});return t?.addEventListener("abort",function e(i){clearTimeout(o),t?.removeEventListener("abort",e),n()}),i},a=(e,t)=>{"[object Object]"===Object.prototype.toString.call(e)&&(e.$metadata={...e.$metadata??{},attempts:t})},s="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),u=new Uint8Array(16),c=[];for(let e=0;e<256;++e)c.push((e+256).toString(16).slice(1));let l=function(e,t,o){if(s&&!t&&!e)return s();let i=(e=e||{}).random??e.rng?.()??function(){if(!n){if("u"<typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");n=crypto.getRandomValues.bind(crypto)}return n(u)}();if(i.length<16)throw Error("Random bytes length must be >= 16");if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){if((o=o||0)<0||o+16>t.length)throw RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[o+e]=i[e];return t}return function(e,t=0){return(c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]).toLowerCase()}(i)};o(5375),o(89966);var d=o(65499),h=o(429),g=o(10964);let f=e=>{let t;return()=>(t||(t=e()),t)},p=async({url:e,method:t,headers:o,body:n},{abortSignal:i,cache:r,withCrossDomainCredentials:a})=>{let s;try{s=await fetch(e,{method:t,headers:o,body:["HEAD","GET"].includes(t.toUpperCase())?void 0:n,signal:i,cache:r,credentials:a?"include":"same-origin"})}catch(e){if(e instanceof TypeError)throw new h.x({name:g.m.NetworkError,message:"A network error has occurred.",underlyingError:e});throw e}let u={};s.headers?.forEach((e,t)=>{u[t.toLowerCase()]=e});let c={statusCode:s.status,headers:u,body:null},l=Object.assign(s.body??{},{text:f(()=>s.text()),blob:f(()=>s.blob()),json:f(()=>s.json())});return{...c,body:l}},m=(0,d.q)(p,[({userAgentHeader:e="x-amz-user-agent",userAgentValue:t=""})=>o=>async function(n){if(0===t.trim().length)return await o(n);{let i=e.toLowerCase();return n.headers[i]=n.headers[i]?`${n.headers[i]} ${t}`:t,await o(n)}},()=>e=>async function(t){return t.headers[i.jy]||(t.headers[i.jy]=l()),e(t)},({maxAttempts:e=i.K7,retryDecider:t,computeDelay:o,abortSignal:n})=>{if(e<1)throw Error("maxAttempts must be greater than 0");return(i,s)=>async function(u){let c,l,d=s.attemptsCount??0,h=()=>{if(l)return a(l,d),l;throw a(c,d),c};for(;!n?.aborted&&d<e;){try{l=await i(u),c=void 0}catch(e){c=e,l=void 0}d=(s.attemptsCount??0)>d?s.attemptsCount??0:d+1,s.attemptsCount=d;let{isCredentialsExpiredError:a,retryable:g}=await t(l,c,s);if(!g)return h();if(s.isCredentialsExpired=!!a,!n?.aborted&&d<e){let e=o(d);await r(e,n)}}if(!n?.aborted)return h();throw Error("Request aborted.")}},({maxAttempts:e=i.K7})=>(t,o)=>async function(n){let r=o.attemptsCount??0;return n.headers[i.Q8]=`attempt=${r+1}; max=${e}`,t(n)}])},18393:(e,t,o)=>{o.d(t,{K7:()=>n,Q8:()=>r,jy:()=>i,mU:()=>a});let n=3,i="amz-sdk-invocation-id",r="amz-sdk-request",a=3e5},18578:(e,t,o)=>{o.d(t,{Uv:()=>d,Qm:()=>g});var n,i=o(59166),r=o(14228);let a={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetail
1s:"signInDetails",oauthMetadata:"oauthMetadata"};var s=o(90811);(n||(n={})).InvalidAuthTokens="InvalidAuthTokens";let u={[n.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},c=(0,s.p)(u),l="CognitoIdentityServiceProvider";class d{getKeyValueStorage(){if(!this.keyValueStorage)throw new r.l({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(e){this.keyValueStorage=e}setAuthConfig(e){this.authConfig=e}async loadTokens(){try{let e=await this.getAuthKeys(),t=await this.getKeyValueStorage().getItem(e.accessToken);if(!t)throw new r.l({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});let o=(0,i.Cq)(t),n=await this.getKeyValueStorage().getItem(e.idToken),a=n?(0,i.Cq)(n):void 0,s=await this.getKeyValueStorage().getItem(e.refreshToken)??void 0,u=await this.getKeyValueStorage().getItem(e.clockDrift)??"0",c=Number.parseInt(u),l=await this.getKeyValueStorage().getItem(e.signInDetails),d={accessToken:o,idToken:a,refreshToken:s,deviceMetadata:await this.getDeviceMetadata()??void 0,clockDrift:c,username:await this.getLastAuthUser()};return l&&(d.signInDetails=JSON.parse(l)),d}catch(e){return null}}async storeTokens(e){c(void 0!==e,n.InvalidAuthTokens);let t=e.username;await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),t);let o=await this.getAuthKeys();await this.getKeyValueStorage().setItem(o.accessToken,e.accessToken.toString()),e.idToken?await this.getKeyValueStorage().setItem(o.idToken,e.idToken.toString()):await this.getKeyValueStorage().removeItem(o.idToken),e.refreshToken?await this.getKeyValueStorage().setItem(o.refreshToken,e.refreshToken):await this.getKeyValueStorage().removeItem(o.refreshToken),e.deviceMetadata&&(e.deviceMetadata.deviceKey&&await this.getKeyValueStorage().setItem(o.deviceKey,e.deviceMetadata.deviceKey),e.deviceMetadata.deviceGroupKey&&await this.getKeyValueStorage().setItem(o.deviceGroupKey,e.deviceMetadata.deviceGroupKey),await this.getKeyValueStorage().setItem(o.randomPasswordKey,e.deviceMetadata.randomPassword)),e.signInDetails?await this.getKeyValueStorage().setItem(o.signInDetails,JSON.stringify(e.signInDetails)):await this.getKeyValueStorage().removeItem(o.signInDetails),await this.getKeyValueStorage().setItem(o.clockDrift,`${e.clockDrift}`)}async clearTokens(){let e=await this.getAuthKeys();await Promise.all([this.getKeyValueStorage().removeItem(e.accessToken),this.getKeyValueStorage().removeItem(e.idToken),this.getKeyValueStorage().removeItem(e.clockDrift),this.getKeyValueStorage().removeItem(e.refreshToken),this.getKeyValueStorage().removeItem(e.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),this.getKeyValueStorage().removeItem(e.oauthMetadata)])}async getDeviceMetadata(e){let t=await this.getAuthKeys(e),o=await this.getKeyValueStorage().getItem(t.deviceKey),n=await this.getKeyValueStorage().getItem(t.deviceGroupKey),i=await this.getKeyValueStorage().getItem(t.randomPasswordKey);return i&&n&&o?{deviceKey:o,deviceGroupKey:n,randomPassword:i}:null}async clearDeviceMetadata(e){let t=await this.getAuthKeys(e);await Promise.all([this.getKeyValueStorage().removeItem(t.deviceKey),this.getKeyValueStorage().removeItem(t.deviceGroupKey),this.getKeyValueStorage().removeItem(t.randomPasswordKey)])}async getAuthKeys(e){(0,i.$y)(this.authConfig?.Cognito);let t=e??await this.getLastAuthUser();return h(l,`${this.authConfig.Cognito.userPoolClientId}.${t}`)}getLastAuthUserKey(){(0,i.$y)(this.authConfig?.Cognito);let e=this.authConfig.Cognito.userPoolClientId;return`${l}.${e}.LastAuthUser`}async getLastAuthUser(){return await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())??"username"}async setOAuthMetadata(e){let{oauthMetadata:t}=await this.getAuthKeys();await this.getKeyValueStorage().setItem(t,JSON.stringify(e))}async getOAuthMetadata(){let{oauthMetadata:e}=await this.getAuthKeys(),t=await this.getKeyValueStorage().getItem(e);return t&&JSON.parse(t)}}let h=(e,t)=>g(a)(`${e}`,t);function g(e){let t=Object.values({...e});return(e,o)=>t.reduce((t,n)=>({...t,[n]:`${e}.${o}.${n}`}),{})}},24194:(e,t,o)=>{o.d(t,{m:()=>i});var n=o(85248);let i={convert(e,t){let o=e;return t?.urlSafe&&(o=o.replace(/-/g,"+").replace(/_/g,"/")),(0,n.nW)()(o)}}},25419:(e,t,o)=>{o.d(t,{e:()=>r});var n=o(10964),i=o(14228);function r(e){if(!e||"Error"===e.name||e instanceof TypeError)throw new i.l({name:n.m.Unknown,message:"An unknown error has occurred.",underlyingError:e})}},28753:(e,t,o)=>{let n;o.d(t,{fE:()=>v});var i=o(66372);let r="6.20.0";var a=o(99742);let s=(e,t)=>!!Object.keys(e).find(e=>e.startsWith(t));var u=o(99742),c=o(99742),l=o(99742);let d=[{platform:i.dT.Expo,detectionMethod:function(){return"u">typeof global&&void 0!==global.expo}},{platform:i.dT.ReactNative,detectionMethod:function(){return"u">typeof navigator&&void 0!==navigator.product&&"ReactNative"===navigator.product}},{platform:i.dT.NextJs,detectionMethod:function(){return"u">typeof window&&window.next&&"object"==typeof window.next}},{platform:i.dT.Nuxt,detectionMethod:function(){return"u">typeof window&&(void 0!==window.__NUXT__||void 0!==window.$nuxt)}},{platform:i.dT.Angular,detectionMethod:function(){let e=!!("u">typeof document&&document.querySelector("[ng-version]")),t=!!("u">typeof window&&void 0!==window.ng);return e||t}},{platform:i.dT.React,detectionMethod:function(){let e=e=>e.startsWith("_react")||e.startsWith("__react");return"u">typeof document&&Array.from(document.querySelectorAll("[id]")).some(t=>Object.keys(t).find(e))}},{platform:i.dT.VueJs,detectionMethod:function(){return"u">typeof window&&s(window,"__VUE")}},{platform:i.dT.Svelte,detectionMethod:function(){return"u">typeof window&&s(window,"__SVELTE")}},{platform:i.dT.WebUnknown,detectionMethod:function(){return"u">typeof window}},{platform:i.dT.NextJsSSR,detectionMethod:function(){return"u">typeof global&&(s(global,"__next")||s(global,"__NEXT"))}},{platform:i.dT.NuxtSSR,detectionMethod:function(){return"u">typeof global&&void 0!==global.__NUXT_PATHS__}},{platform:i.dT.ReactSSR,detectionMethod:function(){return void 0!==a&&void 0!==u.env&&!!Object.keys(u.env).find(e=>e.includes("react"))}},{platform:i.dT.VueJsSSR,detectionMethod:function(){return"u">typeof global&&s(global,"__VUE")}},{platform:i.dT.AngularSSR,detectionMethod:function(){return void 0!==a&&"object"==typeof l.env&&l.env.npm_lifecycle_script?.startsWith("ng ")||!1}},{platform:i.dT.SvelteSSR,detectionMethod:function(){return void 0!==a&&void 0!==c.env&&!!Object.keys(c.env).find(e=>e.includes("svelte"))}}],h=[],g=!1,f=()=>
1{if(!n){if(n=d.find(e=>e.detectionMethod())?.platform||i.dT.ServerSideUnknown,g)for(;h.length;)h.pop()?.();else h.forEach(e=>{e()});p(i.dT.ServerSideUnknown,10),p(i.dT.WebUnknown,10)}return n};function p(e,t){n!==e||g||setTimeout(()=>{n=void 0,g=!0,setTimeout(f,1e3)},t)}let m={},y="aws-amplify";class w{constructor(){this.userAgent=`${y}/${(e=>e.replace(/\+.*/,""))(r)}`}get framework(){return f()}get isReactNative(){return this.framework===i.dT.ReactNative||this.framework===i.dT.Expo}observeFrameworkChanges(e){g||h.push(e)}}new w;let v=e=>(({category:e,action:t}={})=>{let o=[[y,r.replace(/\+.*/,"")]];if(e&&o.push([e,t]),o.push(["framework",f()]),e&&t){let n=m[e]?.[t]?.additionalDetails;n&&n.forEach(e=>{o.push(e)})}return o})(e).map(([e,t])=>e&&t?`${e}/${t}`:e).join(" ")},34653:(e,t,o)=>{o.d(t,{I:()=>i,i:()=>r});let n=[],i=e=>{n.push(e)},r=()=>{for(;n.length;)n.pop()?.()}},37521:(e,t,o)=>{let n;o.d(t,{Q:()=>k,o:()=>x});var i,r=o(42966),a=o(59166),s=o(92871),u=o(83068),c=o(14228),l=o(48423),d=o(1413),h=o(68993),g=o(82236),f=o(54134),p=o(8305);let m=(i=async({tokens:e,authConfig:t,username:o,clientMetadata:n})=>{let i;(0,a.$y)(t?.Cognito);let{userPoolId:r,userPoolClientId:m,userPoolEndpoint:y}=t.Cognito,w=(0,s.J)(r);(0,u.X4)(e);let v=(i={endpointResolver:(0,l.o)({endpointOverride:y})},(0,d.A)(f.e,(0,h._)("GetTokensFromRefreshToken"),(0,g.T)(),{...p.C,...i})),{AuthenticationResult:S}=await v({region:w},{ClientId:m,RefreshToken:e.refreshToken,DeviceKey:e.deviceMetadata?.deviceKey,ClientMetadata:n}),I=(0,a.Cq)(S?.AccessToken??""),A=S?.IdToken?(0,a.Cq)(S.IdToken):void 0,{iat:b}=I.payload;if(!b)throw new c.l({name:"iatNotFoundException",message:"iat not found in access token"});return{accessToken:I,idToken:A,clockDrift:1e3*b-new Date().getTime(),refreshToken:S?.RefreshToken??e.refreshToken,username:o}},async(...e)=>n||(n=new Promise((t,o)=>{i(...e).then(e=>{t(e)}).catch(e=>{o(e)}).finally(()=>{n=void 0})})));var y=o(18578),w=o(40247),v=o(60485);function S({expiresAt:e,clockDrift:t,tolerance:o=5e3}){return Date.now()+t+o>e}var I=o(25419),A=o(61279),b=o(34653);class C{constructor(){this.waitForInflightOAuth=(0,v.B)()?async()=>{if(await A.f.loadOAuthInFlight())return this.inflightPromise||(this.inflightPromise=new Promise((e,t)=>{(0,b.I)(e)})),this.inflightPromise}:async()=>{}}setAuthConfig(e){A.f.setAuthConfig(e.Cognito),this.authConfig=e}setTokenRefresher(e){this.tokenRefresher=e}setAuthTokenStore(e){this.tokenStore=e}getTokenStore(){if(!this.tokenStore)throw new c.l({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}getTokenRefresher(){if(!this.tokenRefresher)throw new c.l({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}setClientMetadataProvider(e){this.clientMetadataProvider=e}async getTokens(e){let t;try{(0,a.$y)(this.authConfig?.Cognito)}catch(e){return null}await this.waitForInflightOAuth(),this.inflightPromise=void 0,t=await this.getTokenStore().loadTokens();let o=await this.getTokenStore().getLastAuthUser();if(null===t)return null;let n=!!t?.idToken&&S({expiresAt:(t.idToken?.payload?.exp??0)*1e3,clockDrift:t.clockDrift??0}),i=S({expiresAt:(t.accessToken?.payload?.exp??0)*1e3,clockDrift:t.clockDrift??0});return(e?.forceRefresh||n||i)&&null===(t=await this.refreshTokens({tokens:t,username:o,clientMetadata:e?.clientMetadata??await this.clientMetadataProvider?.()}))?null:{accessToken:t?.accessToken,idToken:t?.idToken,signInDetails:t?.signInDetails}}async refreshTokens({tokens:e,username:t,clientMetadata:o}){try{let{signInDetails:n}=e,i=await this.getTokenRefresher()({tokens:e,authConfig:this.authConfig,username:t,clientMetadata:o});return i.signInDetails=n,await this.setTokens({tokens:i}),w.YZ.dispatch("auth",{event:"tokenRefresh"},"Auth",w.U9),i}catch(e){return this.handleErrors(e)}}handleErrors(e){if((0,I.e)(e),this.isAuthenticationError(e)&&this.clearTokens(),w.YZ.dispatch("auth",{event:"tokenRefresh_failure",data:{error:e}},"Auth",w.U9),e.name.startsWith("NotAuthorizedException"))return null;throw e}isAuthenticationError(e){return["NotAuthorizedException","TokenRevokedException","UserNotFoundException","PasswordResetRequiredException","UserNotConfirmedException","RefreshTokenReuseException"].some(t=>e?.name?.startsWith?.(t))}async setTokens({tokens:e}){return this.getTokenStore().storeTokens(e)}async clearTokens(){return this.getTokenStore().clearTokens()}getDeviceMetadata(e){return this.getTokenStore().getDeviceMetadata(e)}clearDeviceMetadata(e){return this.getTokenStore().clearDeviceMetadata(e)}setOAuthMetadata(e){return this.getTokenStore().setOAuthMetadata(e)}getOAuthMetadata(){return this.getTokenStore().getOAuthMetadata()}}class E{constructor(){this.authTokenStore=new y.Uv,this.authTokenStore.setKeyValueStorage(r.ZL),this.tokenOrchestrator=new C,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(m)}getTokens(e={}){return this.tokenOrchestrator.getTokens(e)}setKeyValueStorage(e){this.authTokenStore.setKeyValueStorage(e)}setClientMetadataProvider(e){this.tokenOrchestrator.setClientMetadataProvider(e)}setAuthConfig(e){this.authTokenStore.setAuthConfig(e),this.tokenOrchestrator.setAuthConfig(e)}}let k=new E,{tokenOrchestrator:x}=k},40247:(e,t,o)=>{o.d(t,{U9:()=>a,YZ:()=>c,f3:()=>l});var n=o(67598),i=o(53636),r=o(429);let a="u">typeof Symbol?Symbol("amplify_default"):"@@amplify_default",s=new n.C("Hub");class u{constructor(e){this.listeners=new Map,this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}_remove(e,t){let o=this.listeners.get(e);o?this.listeners.set(e,[...o.filter(({callback:e})=>e!==t)]):s.warn(`No listeners for ${e}`)}
1dispatch(e,t,o,n){"string"==typeof e&&this.protectedChannels.indexOf(e)>-1&&n!==a&&s.warn(`WARNING: ${e} is protected and dispatching on it can have unintended consequences`);let i={channel:e,payload:{...t},source:o,patternInfo:[]};try{this._toListeners(i)}catch(e){s.error(e)}}listen(e,t,o="noname"){if("function"!=typeof t)throw new r.x({name:i.d1,message:"No callback supplied to Hub"});let n=this.listeners.get(e);return n||(n=[],this.listeners.set(e,n)),n.push({name:o,callback:t}),()=>{this._remove(e,t)}}_toListeners(e){let{channel:t,payload:o}=e,n=this.listeners.get(t);n&&n.forEach(n=>{s.debug(`Dispatching to ${t} with `,o);try{n.callback(e)}catch(e){s.error(e)}})}}let c=new u("__default__"),l=new u("internal-hub")},42966:(e,t,o)=>{o.d(t,{ZL:()=>p,pR:()=>m});var n=o(10964),i=o(429);class r extends i.x{constructor(){super({name:n.m.PlatformNotSupported,message:"Function not supported on current platform"})}}class a{constructor(e){this.storage=e}async setItem(e,t){if(!this.storage)throw new r;this.storage.setItem(e,t)}async getItem(e){if(!this.storage)throw new r;return this.storage.getItem(e)}async removeItem(e){if(!this.storage)throw new r;this.storage.removeItem(e)}async clear(){if(!this.storage)throw new r;this.storage.clear()}}var s=o(67598);class u{constructor(){this.storage=new Map}get length(){return this.storage.size}key(e){return e>this.length-1?null:Array.from(this.storage.keys())[e]}setItem(e,t){this.storage.set(e,t)}getItem(e){return this.storage.get(e)??null}removeItem(e){this.storage.delete(e)}clear(){this.storage.clear()}}let c=new s.C("CoreStorageUtils"),l=()=>{try{if("u">typeof window&&window.sessionStorage)return window.sessionStorage.getItem("test"),window.sessionStorage;throw Error("sessionStorage is not defined")}catch(e){return c.info("sessionStorage not found. InMemoryStorage is used as a fallback."),new u}};class d extends a{constructor(){super((()=>{try{if("u">typeof window&&window.localStorage)return window.localStorage}catch(e){c.info("localStorage not found. InMemoryStorage is used as a fallback.")}return new u})())}}class h extends a{constructor(){super(l())}}class g{constructor(e){this._storage=e}get storage(){if(!this._storage)throw new r;return this._storage}setItem(e,t){this.storage.setItem(e,t)}getItem(e){return this.storage.getItem(e)}removeItem(e){this.storage.removeItem(e)}clear(){this.storage.clear()}}class f extends g{constructor(){super(l())}}let p=new d;new h;let m=new f;new a(new u)},48423:(e,t,o)=>{o.d(t,{o:()=>a});var n=o(94775),i=o(94395),r=o(75097);let a=({endpointOverride:e})=>t=>e?{url:new n.o(e)}:(({region:e})=>({url:new n.o(`https://${r.M}.${e}.${(0,i.R)(e)}`)}))(t)},49352:(e,t,o)=>{o.d(t,{F:()=>i,Y:()=>r});var n=o(97767);let i=async e=>{if(!e||e.statusCode<300)return;let t=await r(e),o=(e=>{let[t]=e.toString().split(/[,:]+/);return t.includes("#")?t.split("#")[1]:t})(e.headers["x-amzn-errortype"]??t.code??t.__type??"UnknownError");return Object.assign(Error(t.message??t.Message??"Unknown error"),{name:o,$metadata:(0,n.j)(e)})},r=async e=>{if(!e.body)throw Error("Missing response payload");return Object.assign(await e.body.json(),{$metadata:(0,n.j)(e)})}},53636:(e,t,o)=>{o.d(t,{OU:()=>n,YJ:()=>i,d1:()=>r});let n="Logging",i="x-amz-user-agent",r="NoHubcallbackProvidedException"},54134:(e,t,o)=>{o.d(t,{e:()=>a});var n=o(80024),i=o(65499),r=o(16940);let a=(0,i.q)(r.F,[()=>(e,t)=>async function(t){return t.headers={...t.headers,"cache-control":"no-store",...await n.H.libraryOptions?.Auth?.headers?.()},e(t)}])},55046:(e,t,o)=>{o.d(t,{$:()=>n});let n=Symbol("oauth-listener")},59166:(e,t,o)=>{o.d(t,{Eh:()=>d,G6:()=>l,$y:()=>c,Cq:()=>h});var n,i,r=o(24194),a=o(90811);(n=i||(i={})).AuthTokenConfigException="AuthTokenConfigException",n.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",n.AuthUserPoolException="AuthUserPoolException",n.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",n.OAuthNotConfigureException="OAuthNotConfigureException";let s={[i.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[i.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[i.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[i.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[i.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}},u=(0,a.p)(s);function c(e){u(!!e&&!!e.userPoolId&&!!e.userPoolClientId,i.AuthUserPoolException)}function l(e){u(!!e?.loginWith?.oauth?.domain&&!!e?.loginWith?.oauth?.redirectSignOut&&!!e?.loginWith?.oauth?.redirectSignIn&&!!e?.loginWith?.oauth?.responseType,i.OAuthNotConfigureException)}function d(e){u(!!e?.identityPoolId,i.InvalidIdentityPoolIdException)}function h(e){let t=e.split(".");if(3!==t.length)throw Error("Invalid token");try{let o=t[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(r.m.convert(o).split("").map(e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")),i=JSON.parse(n);return{toString:()=>e,payload:i}}catch(e){throw Error("Invalid token payload")}}},60485:(e,t,o)=>{o.d(t,{B:()=>n});let n=()=>"u">typeof window&&void 0!==window.document},61279:(e,t,o)=>{o.d(t,{f:()=>i});var n=o(42966);let i=new(o(63162)).S(n.ZL)},62437:(e,t,o)=>{o.d(t,{y:()=>i});var n=o(18393);let i=e=>{let t=(function(e=3e5){return t=>{let o=2**t*100+100*Math.random();return!(o>e)&&o}})(n.mU)(e);return!1===t?n.mU:t}},63162:(e,t,o)=>{o.d(t,{S:()=>u});var n=o(59166),i=o(18578),r=o(83068);let a="amplify-signin-with-hostedUI",s="CognitoIdentityServiceProvider";class u{constructor(e){this.keyValueStorage=e}async clearOAuthInflightData(){(0,n.$y)(this.cognitoConfig);let e=c(s,this.cognitoConfig.userPoolClientId);await Promise.all([this.keyValueStorage.removeItem(e.inflightOAuth),this.keyValueStorage.removeItem(e.oauthPKCE),this.keyValueStorage.removeItem(e.oauthState)])}async clearOAuthData(){(0,n.$y)(this.cognitoConfig);let e=c(s,this.cognitoConfig.userPoolClientId);return await this.clearOAuthInflightData(),await this.keyValueStorage.removeItem(a),this.keyValueStorage.removeItem(e.oauthSignIn)}loadOAuthState(){(0,n.$y)(this.cognitoConfig);let e=c(s,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(e.oauthState)}storeOAuthState(e){(0,n.$y)(this.cognitoConfig);let t=c(s,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(t.oauthState,e)}loadPKCE(){(0,n.$y)(this.cognitoConfig);let e=c(s,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(e.oauthPKCE)}storePKCE(e){(0,n.$y)(this.cognitoConfig);let t=c(s,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(t.oauthPKCE,e)}setAuthConfig(e){this.cognitoConfig=e}async loadOAuthInFlight(){(0,n.$y)(this.cognitoConfig);let e=c(s,this.cognitoConfig.userPoolClientId);return await this.keyValueStorage.getItem(e.inflightOAuth)==="true"}async storeOAuthInFlight(e){(0,n.$y)(this.cognitoConfig);let t=c(s,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(t.inflightOAuth,`${e}`)}async loadOAuthSignIn(){(0,n.$y)(this.cognitoConfig);let e=c(s,this.cognitoConfig.userPoolClientId),t=await this.keyValueStorage.getItem(a),[o,i]=(await this.keyValueStorage.getItem(e.oauthSignIn))?.split(",")??[];return{isOAuthSignIn:"true"===o||"true"===t,preferPrivateSession:"true"===i}}async storeOAuthSignIn(e,t=!1){(0,n.$y)(this.cognitoConfig);let o=c(s,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(o.oauthSignIn,`${e},${t}`)}}let c=(e,t)=>(0,i.Qm)(r.f3)(e,t)},63253:(e,t,o)=>{o.d(t,{D:()=>r});var n=o(10964);let i=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],r=e=>async(t,o)=>{let n=o??await e(t)??void 0,r=n?.code||n?.name,a=t?.statusCode;return{retryable:c(o)||u(a,r)||!!r&&i.includes(r)||l(a,r)}},a=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],s=["TimeoutError","RequestTimeout","RequestTimeoutException"],u=(e,t)=>
1429===e||!!t&&a.includes(t),c=e=>[n.m.NetworkError,"ERR_NETWORK"].includes(e?.name),l=(e,t)=>!!e&&[500,502,503,504].includes(e)||!!t&&s.includes(t)},65499:(e,t,o)=>{o.d(t,{q:()=>n});let n=(e,t)=>(o,n)=>{let i={},r=t=>e(t,n);for(let e=t.length-1;e>=0;e--)r=(0,t[e])(n)(r,i);return r(o)}},66372:(e,t,o)=>{var n,i,r,a,s,u,c,l,d,h,g,f,p,m,y,w,v,S,I,A,b,C,E,k,x,P;o.d(t,{BM:()=>u,b7:()=>i,dT:()=>n}),(y=n||(n={})).WebUnknown="0",y.React="1",y.NextJs="2",y.Angular="3",y.VueJs="4",y.Nuxt="5",y.Svelte="6",y.ServerSideUnknown="100",y.ReactSSR="101",y.NextJsSSR="102",y.AngularSSR="103",y.VueJsSSR="104",y.NuxtSSR="105",y.SvelteSSR="106",y.ReactNative="201",y.Expo="202",(w=i||(i={})).AI="ai",w.API="api",w.Auth="auth",w.Analytics="analytics",w.DataStore="datastore",w.Geo="geo",w.InAppMessaging="inappmessaging",w.Interactions="interactions",w.Predictions="predictions",w.PubSub="pubsub",w.PushNotification="pushnotification",w.Storage="storage",(v=r||(r={})).CreateConversation="1",v.GetConversation="2",v.ListConversations="3",v.DeleteConversation="4",v.SendMessage="5",v.ListMessages="6",v.OnMessage="7",v.Generation="8",v.UpdateConversation="9",(S=a||(a={})).Record="1",S.IdentifyUser="2",(I=s||(s={})).GraphQl="1",I.Get="2",I.Post="3",I.Put="4",I.Patch="5",I.Del="6",I.Head="7",(A=u||(u={})).SignUp="1",A.ConfirmSignUp="2",A.ResendSignUpCode="3",A.SignIn="4",A.FetchMFAPreference="6",A.UpdateMFAPreference="7",A.SetUpTOTP="10",A.VerifyTOTPSetup="11",A.ConfirmSignIn="12",A.DeleteUserAttributes="15",A.DeleteUser="16",A.UpdateUserAttributes="17",A.FetchUserAttributes="18",A.ConfirmUserAttribute="22",A.SignOut="26",A.UpdatePassword="27",A.ResetPassword="28",A.ConfirmResetPassword="29",A.FederatedSignIn="30",A.RememberDevice="32",A.ForgetDevice="33",A.FetchDevices="34",A.SendUserAttributeVerificationCode="35",A.SignInWithRedirect="36",A.StartWebAuthnRegistration="37",A.CompleteWebAuthnRegistration="38",A.ListWebAuthnCredentials="39",A.DeleteWebAuthnCredential="40",(b=c||(c={})).Subscribe="1",b.GraphQl="2",(C=l||(l={})).SearchByText="0",C.SearchByCoordinates="1",C.SearchForSuggestions="2",C.SearchByPlaceId="3",C.SaveGeofences="4",C.GetGeofence="5",C.ListGeofences="6",C.DeleteGeofences="7",(E=d||(d={})).SyncMessages="1",E.IdentifyUser="2",E.NotifyMessageInteraction="3",(h||(h={})).None="0",(k=g||(g={})).Convert="1",k.Identify="2",k.Interpret="3",(f||(f={})).Subscribe="1",(x=p||(p={})).InitializePushNotifications="1",x.IdentifyUser="2",x.RegisterDevice="3",x.RemoveDevice="4",(P=m||(m={})).UploadData="1",P.DownloadData="2",P.List="3",P.Copy="4",P.Remove="5",P.GetProperties="6",P.GetUrl="7",P.GetDataAccess="8",P.ListCallerAccessGrants="9"},67598:(e,t,o)=>{o.d(t,{C:()=>s});var n,i,r=o(53636);(n=i||(i={})).DEBUG="DEBUG",n.ERROR="ERROR",n.INFO="INFO",n.WARN="WARN",n.VERBOSE="VERBOSE",n.NONE="NONE";let a={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class s{constructor(e,t=i.WARN){this.name=e,this.level=t,this._pluggables=[]}_padding(e){return e<10?"0"+e:""+e}_ts(){let e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()}configure(e){return e&&(this._config=e),this._config}_log(e,...t){let o=this.level;s.LOG_LEVEL&&(o=s.LOG_LEVEL),"u">typeof window&&window.LOG_LEVEL&&(o=window.LOG_LEVEL);let n=a[o];if(!(a[e]>=n))return;let r=console.log.bind(console);e===i.ERROR&&console.error&&(r=console.error.bind(console)),e===i.WARN&&console.warn&&(r=console.warn.bind(console)),s.BIND_ALL_LOG_LEVELS&&(e===i.INFO&&console.info&&(r=console.info.bind(console)),e===i.DEBUG&&console.debug&&(r=console.debug.bind(console)));let u=`[${e}] ${this._ts()} ${this.name}`,c="";if(1===t.length&&"string"==typeof t[0])r(c=`${u} - ${t[0]}`);else if(1===t.length)c=`${u} ${t[0]}`,r(u,t[0]);else if("string"==typeof t[0]){let e=t.slice(1);1===e.length&&(e=e[0]),c=`${u} - ${t[0]} ${e}`,r(`${u} - ${t[0]}`,e)}else c=`${u} ${t}`,r(u,t);for(let e of this._pluggables){let t={message:c,timestamp:Date.now()};e.pushLogs([t])}}log(...e){this._log(i.INFO,...e)}info(...e){this._log(i.INFO,...e)}warn(...e){this._log(i.WARN,...e)}error(...e){this._log(i.ERROR,...e)}debug(...e){this._log(i.DEBUG,...e)}verbose(...e){this._log(i.VERBOSE,...e)}addPluggable(e){e&&e.getCategoryName()===r.OU&&(this._pluggables.push(e),e.configure(this._config))}listPluggables(){return this._pluggables}}s.LOG_LEVEL=null,s.BIND_ALL_LOG_LEVELS=!1},68993:(e,t,o)=>{o.d(t,{_:()=>n});let n=e=>(t,o)=>r(o,i(e),JSON.stringify(t)),i=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProvi
1derService.${e}`}),r=({url:e},t,o)=>({headers:t,url:e,body:o,method:"POST"})},75097:(e,t,o)=>{o.d(t,{M:()=>n});let n="cognito-idp"},75329:(e,t,o)=>{o.d(t,{M:()=>l});var n=o(67598),i=o(429);let r=new n.C("parseAWSExports"),a={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},s=e=>e?.split(",")??[],u={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"},c={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"},l=e=>{if(Object.keys(e).some(e=>e.startsWith("aws_")))return((e={})=>{if(!Object.prototype.hasOwnProperty.call(e,"aws_project_region"))throw new i.x({name:"InvalidParameterException",message:"Invalid config parameter.",recoverySuggestion:"Ensure passing the config object imported from `amplifyconfiguration.json`."});let{aws_appsync_apiKey:t,aws_appsync_authenticationType:o,aws_appsync_graphqlEndpoint:n,aws_appsync_region:u,aws_bots_config:c,aws_cognito_identity_pool_id:l,aws_cognito_sign_up_verification_method:d,aws_cognito_mfa_configuration:h,aws_cognito_mfa_types:g,aws_cognito_password_protection_settings:f,aws_cognito_verification_mechanisms:p,aws_cognito_signup_attributes:m,aws_cognito_social_providers:y,aws_cognito_username_attributes:w,aws_mandatory_sign_in:v,aws_mobile_analytics_app_id:S,aws_mobile_analytics_app_region:I,aws_user_files_s3_bucket:A,aws_user_files_s3_bucket_region:b,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:C,aws_user_pools_id:E,aws_user_pools_web_client_id:k,geo:x,oauth:P,predictions:T,aws_cloud_logic_custom:O,Notifications:_,modelIntrospection:R}=e,U={};S&&(U.Analytics={Pinpoint:{appId:S,region:I}});let{InAppMessaging:M,Push:N}=_??{};if(M?.AWSPinpoint||N?.AWSPinpoint){if(M?.AWSPinpoint){let{appId:e,region:t}=M.AWSPinpoint;U.Notifications={InAppMessaging:{Pinpoint:{appId:e,region:t}}}}if(N?.AWSPinpoint){let{appId:e,region:t}=N.AWSPinpoint;U.Notifications={...U.Notifications,PushNotification:{Pinpoint:{appId:e,region:t}}}}}if(Array.isArray(c)&&(U.Interactions={LexV1:Object.fromEntries(c.map(e=>[e.name,e]))}),n){let e=a[o];e||r.debug(`Invalid authentication type ${o}. Falling back to IAM.`),U.API={GraphQL:{endpoint:n,apiKey:t,region:u,defaultAuthMode:e??"iam"}},R&&(U.API.GraphQL.modelIntrospection=R)}let L=h?{status:h&&h.toLowerCase(),totpEnabled:g?.includes("TOTP")??!1,smsEnabled:g?.includes("SMS")??!1}:void 0,K=f?{minLength:f.passwordPolicyMinLength,requireLowercase:f.passwordPolicyCharacters?.includes("REQUIRES_LOWERCASE")??!1,requireUppercase:f.passwordPolicyCharacters?.includes("REQUIRES_UPPERCASE")??!1,requireNumbers:f.passwordPolicyCharacters?.includes("REQUIRES_NUMBERS")??!1,requireSpecialCharacters:f.passwordPolicyCharacters?.includes("REQUIRES_SYMBOLS")??!1}:void 0,V=Array.from(new Set([...p??[],...m??[]])).reduce((e,t)=>({...e,[t.toLowerCase()]:{required:!0}}),{}),D=w?.includes("EMAIL")??!1,$=w?.includes("PHONE_NUMBER")??!1;(l||E)&&(U.Auth={Cognito:{identityPoolId:l,allowGuestAccess:"enable"!==v,signUpVerificationMethod:d,userAttributes:V,userPoolClientId:k,userPoolId:E,mfa:L,passwordFormat:K,loginWith:{username:!(D||$),email:D,phone:$}}});let G=!!P&&Object.keys(P).length>0,W=!!y&&y.length>0;if(U.Auth&&G&&(U.Auth.Cognito.loginWith={...U.Auth.Cognito.loginWith,oauth:{...(({domain:e,scope:t,redirectSignIn:o,redirectSignOut:n,responseType:i})=>({domain:e,scopes:t,redirectSignIn:s(o),redirectSignOut:s(n),responseType:i}))(P),...W&&{providers:y.map(e=>{let t=e.toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)})}}}),A&&(U.Storage={S3:{bucket:A,region:b,dangerouslyConnectToHttpEndpointForTesting:C}}),x){let{amazon_location_service:e}=x;U.Geo={LocationService:{maps:e.maps,geofenceCollections:e.geofenceCollections,searchIndices:e.search_indices,region:e.region}}}if(O&&(U.API={...U.API,REST:O.reduce((e,t)=>{let{name:o,endpoint:n,region:i,service:r}=t;return{...e,[o]:{endpoint:n,...r?{service:r}:void 0,...i?{region:i}:void 0}}},{})}),T){let{VoiceId:e}=T?.convert?.speechGenerator?.defaults??{};U.Predictions=e?{...T,convert:{...T.convert,speechGenerator:{...T.convert.speechGenerator,defaults:{voiceId:e}}}}:T}return U})(e);if(!function(e){let{version:t}=e;return!!t&&t.startsWith("1")}(e))return e;let t={};if(e.storage&&(t.Storage=function(e){let t;if(!e)return;let{bucket_name:o,aws_region:n,buckets:i}=e;return{S3:{bucket:o,region:n,buckets:i&&(t={}
1,i.forEach(({name:e,bucket_name:o,aws_region:n,paths:i})=>{if(e in t)throw Error(`Duplicate friendly name found: ${e}. Name must be unique.`);let r=i?Object.entries(i).reduce((e,[t,o])=>(void 0!==o&&(e[t]=o),e),{}):void 0;t[e]={bucketName:o,region:n,paths:r}}),t)}}}(e.storage)),e.auth&&(t.Auth=function(e){var t;if(!e)return;let{user_pool_id:o,user_pool_client_id:n,identity_pool_id:i,password_policy:r,mfa_configuration:a,mfa_methods:s,unauthenticated_identities_enabled:u,oauth:l,username_attributes:d,standard_required_attributes:h,groups:g,passwordless:f}=e,p={Cognito:{userPoolId:o,userPoolClientId:n,groups:g}};return i&&(p.Cognito={...p.Cognito,identityPoolId:i}),r&&(p.Cognito.passwordFormat={requireLowercase:r.require_lowercase,requireNumbers:r.require_numbers,requireUppercase:r.require_uppercase,requireSpecialCharacters:r.require_symbols,minLength:r.min_length??6}),a&&(p.Cognito.mfa={status:"OPTIONAL"===(t=a)?"optional":"REQUIRED"===t?"on":"off",smsEnabled:s?.includes("SMS"),totpEnabled:s?.includes("TOTP")}),u&&(p.Cognito.allowGuestAccess=u),l&&(p.Cognito.loginWith={oauth:{domain:l.domain,redirectSignIn:l.redirect_sign_in_uri,redirectSignOut:l.redirect_sign_out_uri,responseType:"token"===l.response_type?"token":"code",scopes:l.scopes,providers:function(e=[]){return e.reduce((e,t)=>(void 0!==c[t]&&e.push(c[t]),e),[])}(l.identity_providers)}}),d&&(p.Cognito.loginWith={...p.Cognito.loginWith,email:d.includes("email"),phone:d.includes("phone_number"),username:d.includes("username")}),h&&(p.Cognito.userAttributes=h.reduce((e,t)=>({...e,[t]:{required:!0}}),{})),f&&(p.Cognito.passwordless={emailOtpEnabled:f.email_otp_enabled,smsOtpEnabled:f.sms_otp_enabled,webAuthn:f.web_authn?{relyingPartyId:f.web_authn.relying_party_id,userVerification:f.web_authn.user_verification}:void 0,preferredChallenge:f.preferred_challenge}),p}(e.auth)),e.analytics&&(t.Analytics=function(e){if(!e?.amazon_pinpoint)return;let{amazon_pinpoint:t}=e;return{Pinpoint:{appId:t.app_id,region:t.aws_region}}}(e.analytics)),e.geo&&(t.Geo=function(e){if(!e)return;let{aws_region:t,geofence_collections:o,maps:n,search_indices:i}=e;return{LocationService:{region:t,searchIndices:i,geofenceCollections:o,maps:n}}}(e.geo)),e.data&&(t.API=function(e){if(!e)return;let{aws_region:t,default_authorization_type:o,url:n,api_key:i,model_introspection:r}=e;return{GraphQL:{endpoint:n,defaultAuthMode:u[o],region:t,apiKey:i,modelIntrospection:r}}}(e.data)),e.custom){let o=function(e){if(!e?.events)return;let{url:t,aws_region:o,api_key:n,default_authorization_type:i}=e.events;return{Events:{endpoint:t,defaultAuthMode:u[i],region:o,apiKey:n}}}(e.custom);o&&"Events"in o&&(t.API={...t.API,...o})}return e.notifications&&(t.Notifications=function(e){if(!e)return;let{aws_region:t,channels:o,amazon_pinpoint_app_id:n,amazon_connect:i}=e,r=o??[],a=r.includes("IN_APP_MESSAGING"),s=r.includes("APNS")||r.includes("FCM"),u=!!i;if(!(a||s||u))return;let c={};a&&n&&t&&(c.InAppMessaging={Pinpoint:{appId:n,region:t}});let l={};return s&&n&&t&&(l.Pinpoint={appId:n,region:t}),i&&(l.CustomerProfiles={endpoint:i.endpoint,region:i.aws_region}),Object.keys(l).length>0&&(c.PushNotification=l),c}(e.notifications)),t}},80024:(e,t,o)=>{o.d(t,{H:()=>d});var n=o(40247);let i=e=>{for(let t of Reflect.ownKeys(e)){let o=e[t];(o&&"object"==typeof o||"function"==typeof o)&&i(o)}return Object.freeze(e)};var r=o(55046),a=o(75329);o(5375),o(89966);let s=new(o(67598)).C("Auth");class u{configure(e,t){this.authConfig=e,this.authOptions=t,e&&e.Cognito?.userPoolEndpoint&&s.warn(c("Amazon Cognito User Pool")),e&&e.Cognito?.identityPoolEndpoint&&s.warn(c("Amazon Cognito Identity Pool"))}async fetchAuthSession(e={}){let t,o,n=await this.getTokens(e);return n?(o=n.accessToken?.payload?.sub,t=await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,tokens:n,authenticated:!0,forceRefresh:e.forceRefresh})):t=await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,authenticated:!1,forceRefresh:e.forceRefresh}),{tokens:n,credentials:t?.credentials,identityId:t?.identityId,userSub:o}}async clearCredentials(){await this.authOptions?.credentialsProvider?.clearCredentialsAndIdentityId()}async getTokens(e){return await this.authOptions?.tokenProvider?.getTokens(e)??void 0}}let c=e=>`You are using a custom Amazon ${e} endpoint, ensure the endpoint is correct.`;class l{constructor(){this.oAuthListener=void 0,this.isConfigured=!1,this.resourcesConfig={},this.libraryOptions={},this.Auth=new u}configure(e,t){let o=(0,a.M)(e);this.resourcesConfig=o,t&&(this.libraryOptions=t),this.resourcesConfig=i(this.resourcesConfig),this.Auth.configure(this.resourcesConfig.Auth,this.libraryOptions.Auth),(this.resourcesConfig.Analytics?.Pinpoint||this.resourcesConfig.Notifications?.InAppMessaging?.Pinpoint||this.resourcesConfig.Notifications?.PushNotification?.Pinpoint)&&console.warn("AWS will end support for Amazon Pinpoint on October 30, 2026. The guidance is to use AWS End User Messaging for push notifications and
1SMS, Amazon Simple Email Service for sending emails, Amazon Connect for campaigns, journeys, endpoints, and engagement analytics. Pinpoint recommends Amazon Kinesis for event collection and mobile analytics."),n.YZ.dispatch("core",{event:"configure",data:this.resourcesConfig},"Configure",n.U9),this.notifyOAuthListener(),this.isConfigured=!0}getConfig(){return this.isConfigured||console.warn("Amplify has not been configured. Please call Amplify.configure() before using this service."),this.resourcesConfig}[r.$](e){this.resourcesConfig.Auth?.Cognito.loginWith?.oauth?e(this.resourcesConfig.Auth?.Cognito):this.oAuthListener=e}notifyOAuthListener(){this.resourcesConfig.Auth?.Cognito.loginWith?.oauth&&this.oAuthListener&&(this.oAuthListener(this.resourcesConfig.Auth?.Cognito),this.oAuthListener=void 0)}}let d=new l},82236:(e,t,o)=>{o.d(t,{T:()=>a});var n=o(49352),i=o(25419),r=o(14228);let a=()=>async e=>{if(e.statusCode>=300){let t=await (0,n.F)(e);throw(0,i.e)(t),new r.l({name:t.name,message:t.message,metadata:t.$metadata})}return(0,n.Y)(e)}},83068:(e,t,o)=>{o.d(t,{H0:()=>r,OW:()=>a,O_:()=>l,X4:()=>c,f3:()=>d});var n=o(14228),i=o(14979);function r(e){if(!e||!e.accessToken)throw new n.l({name:i.zz,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}function a(e){if(!e||!e.idToken)throw new n.l({name:i.zz,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}let s=new n.l({name:i.Cs,message:`Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow. 2 Please change your oauth configuration to use 'code grant' flow.`,recoverySuggestion:`Please logout and change your Amplify configuration to use "code grant" flow. 3 E.g { responseType: 'code' }`}),u=new n.l({name:i.zz,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function c(e){var t,o;if(h(t=e)&&!t?.refreshToken)throw s;if(!(h(o=e)&&o?.refreshToken))throw u}function l(e){if(!e||!e.deviceKey||!e.deviceGroupKey||!e.randomPassword)throw new n.l({name:i.kM,message:"Either deviceKey, deviceGroupKey or secretPassword were not found during the sign-in process.",recoverySuggestion:"Make sure to not clear storage after calling the signIn API."})}let d={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function h(e){return e?.accessToken||e?.idToken}},85248:(e,t,o)=>{o.d(t,{MY:()=>i,nW:()=>a,xA:()=>r});var n=o(429);let i=()=>{if("object"==typeof window&&"object"==typeof window.crypto)return window.crypto;if("object"==typeof crypto)return crypto;throw new n.x({name:"MissingPolyfill",message:"Cannot resolve the `crypto` function from the environment."})},r=()=>{if("u">typeof window&&"function"==typeof window.btoa)return window.btoa;if("function"==typeof btoa)return btoa;throw new n.x({name:"Base64EncoderError",message:"Cannot resolve the `btoa` function from the environment."})},a=()=>{if("u">typeof window&&"function"==typeof window.atob)return window.atob;if("function"==typeof atob)return atob;throw new n.x({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})}},89966:(e,t,o)=>{let n={},i={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();1===t.length&&(t=`0${t}`),n[e]=t,i[t]=e}},90811:(e,t,o)=>{o.d(t,{p:()=>i});var n=o(429);let i=(e,t=n.x)=>(o,n,i)=>{let{message:r,recoverySuggestion:a}=e[n];if(!o)throw new t({name:n,message:i?`${r} ${i}`:r,recoverySuggestion:a})}},92871:(e,t,o)=>{o.d(t,{C:()=>r,J:()=>i});var n=o(14228);function i(e){let t=e?.split("_")[0];if(!e||0>e.indexOf("_")||!t||"string"!=typeof t)throw new n.l({name:"InvalidUserPoolId",message:"Invalid user pool id provided."});return t}function r(e){if(!e||!e.includes(":"))throw new n.l({name:"InvalidIdentityPoolIdException",message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."});return e.split(":")[0]}},94395:(e,t,o)=>{o.d(t,{R:()=>r});let n={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},i={partitions:[n,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},r=e=>{let{partitions:t}=i;for(let{regions:o,outputs:n,regionRegex:i}
3of t){let t=new RegExp(i);if(o.includes(e)||t.test(e))return n.dnsSuffix}return n.outputs.dnsSuffix}},94775:(e,t,o)=>{o.d(t,{o:()=>n});let n=URL},97767:(e,t,o)=>{o.d(t,{j:()=>n});let n=e=>{let{headers:t,statusCode:o}=e;return{...i(e)?e.$metadata:{},httpStatusCode:o,requestId:t["x-amzn-requestid"]??t["x-amzn-request-id"]??t["x-amz-request-id"],extendedRequestId:t["x-amz-id-2"],cfId:t["x-amz-cf-id"]}},i=e=>"object"==typeof e?.$metadata}}]); 4//# sourceMappingURL=7521.a1a4d4d7087c094a.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.