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/C,EAAS2B,EAAQ,EACtB,MAEAqB,CAAAA,EAAAA,EAAAA,GAAAA,EAAK9D,EAAe+D,QAAQ,CAAE,CAAE7D,MAAOA,EAAOkC,SAAUA,CAAS,EACrE","sources":["webpack://_N_E/./node_modules/next-auth/node_modules/@auth/core/errors.js","webpack://_N_E/./node_modules/next-auth/lib/client.js","webpack://_N_E/./node_modules/next-auth/react.js"],"sourcesContent":["/**\n * Base error class for all Auth.js errors.\n * It's optimized to be printed in the server logs in a nicely formatted way\n * via the [`logger.error`](https://authjs.dev/reference/core#logger) option.\n */\nexport class AuthError extends Error {\n constructor(message, errorOptions) {\n if (message instanceof Error) {\n super(undefined, {\n cause: { err: message, ...message.cause, ...errorOptions },\n });\n }\n else if (typeof message === \"string\") {\n if (errorOptions instanceof Error) {\n errorOptions = { err: errorOptions, ...errorOptions.cause };\n }\n super(message, errorOptions);\n }\n else {\n super(undefined, message);\n }\n this.name = this.constructor.name;\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/3841\n this.type = this.constructor.type ?? \"AuthError\";\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/3841\n this.kind = this.constructor.kind ?? \"error\";\n Error.captureStackTrace?.(this, this.constructor);\n const url = `https://errors.authjs.dev#${this.type.toLowerCase()}`;\n this.message += `${this.message ? \". \" : \"\"}Read more at ${url}`;\n }\n}\nexport class SignInError extends AuthError {\n}\nSignInError.kind = \"signIn\";\n/**\n * One of the database [`Adapter` methods](https://authjs.dev/reference/core/adapters#methods)\n * failed during execution.\n *\n * :::tip\n * If `debug: true` is set, you can check out `[auth][debug]` in the logs to learn more about the failed adapter method execution.\n * @example\n * ```sh\n * [auth][debug]: adapter_getUserByEmail\n * { \"args\": [undefined] }\n * ```\n * :::\n */\nexport class AdapterError extends AuthError {\n}\nAdapterError.type = \"AdapterError\";\n/**\n * Thrown when the execution of the [`signIn` callback](https://authjs.dev/reference/core/types#signin) fails\n * or if it returns `false`.\n */\nexport class AccessDenied extends AuthError {\n}\nAccessDenied.type = \"AccessDenied\";\n/**\n * This error occurs when the user cannot finish login.\n * Depending on the provider type, this could have happened for multiple reasons.\n *\n * :::tip\n * Check out `[auth][details]` in the logs to know which provider failed.\n * @example\n * ```sh\n * [auth][details]: { \"provider\": \"github\" }\n * ```\n * :::\n *\n * For an [OAuth provider](https://authjs.dev/getting-started/authentication/oauth), possible causes are:\n * - The user denied access to the application\n * - There was an error parsing the OAuth Profile:\n * Check out the provider's `profile` or `userinfo.request` method to make sure\n * it correctly fetches the user's profile.\n * - The `signIn` or `jwt` callback methods threw an uncaught error:\n * Check the callback method implementations.\n *\n * For an [Email provider](https://authjs.dev/getting-started/authentication/email), possible causes are:\n * - The provided email/token combination was invalid/missing:\n * Check if the provider's `sendVerificationRequest` method correctly sends the email.\n * - The provided email/token combination has expired:\n * Ask the user to log in again.\n * - There was an error with the database:\n * Check the database logs.\n *\n * For a [Credentials provider](https://authjs.dev/getting-started/authentication/credentials), possible causes are:\n * - The `authorize` method threw an uncaught error:\n * Check the provider's `authorize` method.\n * - The `signIn` or `jwt` callback methods threw an uncaught error:\n * Check the callback method implementations.\n *\n * :::tip\n * Check out `[auth][cause]` in the error message for more details.\n * It will show the original stack trace.\n * :::\n */\nexport class CallbackRouteError extends AuthError {\n}\nCallbackRouteError.type = \"CallbackRouteError\";\n/**\n * Thrown when Auth.js is misconfigured and accidentally tried to require authentication on a custom error page.\n * To prevent an infinite loop, Auth.js will instead render its default error page.\n *\n * To fix this, make sure that the `error` page does not require authentication.\n *\n * Learn more at [Guide: Error pages](https://authjs.dev/guides/pages/error)\n */\nexport class ErrorPageLoop extends AuthError {\n}\nErrorPageLoop.type = \"ErrorPageLoop\";\n/**\n * One of the [`events` methods](https://authjs.dev/reference/core/types#eventcallbacks)\n * failed during execution.\n *\n * Make sure that the `events` methods are implemented correctly and uncaught errors are handled.\n *\n * Learn more at [`events`](https://authjs.dev/reference/core/types#eventcallbacks)\n */\nexport class EventError extends AuthError {\n}\nEventError.type = \"EventError\";\n/**\n * Thrown when Auth.js is unable to verify a `callbackUrl` value.\n * The browser either disabled cookies or the `callbackUrl` is not a valid URL.\n *\n * Somebody might have tried to manipulate the callback URL that Auth.js uses to redirect the user back to the configured `callbackUrl`/page.\n * This could be a malicious hacker trying to redirect the user to a phishing site.\n * To prevent this, Auth.js checks if the callback URL is valid and throws this error if it is not.\n *\n * There is no action required, but it might be an indicator that somebody is trying to attack your application.\n */\nexport class InvalidCallbackUrl extends AuthError {\n}\nInvalidCallbackUrl.type = \"InvalidCallbackUrl\";\n/**\n * Can be thrown from the `authorize` callback of the Credentials provider.\n * When an error occurs during the `authorize` callback, two things can happen:\n * 1. The user is redirected to the signin page, with `error=CredentialsSignin&code=credentials` in the URL. `code` is configurable.\n * 2. If you throw this error in a framework that handles form actions server-side, this error is thrown, instead of redirecting the user, so you'll need to handle.\n */\nexport class CredentialsSignin extends Error {\n constructor() {\n super(...arguments);\n /**\n * The error code that is set in the `code` query parameter of the redirect URL.\n *\n *\n * ⚠ NOTE: This property is going to be included in the URL, so make sure it does not hint at sensitive errors.\n *\n * The full error is always logged on the server, if you need to debug.\n *\n * Generally, we don't recommend hinting specifically if the user had either a wrong username or password specifically,\n * try rather something like \"Invalid credentials\".\n */\n this.code = \"credentials\";\n }\n}\nCredentialsSignin.type = \"CredentialsSignin\";\n/**\n * One of the configured OAuth or OIDC providers is missing the `authorization`, `token` or `userinfo`, or `issuer` configuration.\n * To perform OAuth or OIDC sign in, at least one of these endpoints is required.\n *\n * Learn more at [`OAuth2Config`](https://authjs.dev/reference/core/providers#oauth2configprofile) or [Guide: OAuth Provider](https://authjs.dev/guides/configuring-oauth-providers)\n */\nexport class InvalidEndpoints extends AuthError {\n}\nInvalidEndpoints.type = \"InvalidEndpoints\";\n/**\n * Thrown when a PKCE, state or nonce OAuth check could not be performed.\n * This could happen if the OAuth provider is configured incorrectly or if the browser is blocking cookies.\n *\n * Learn more at [`checks`](https://authjs.dev/reference/core/providers#checks)\n */\nexport class InvalidCheck extends AuthError {\n}\nInvalidCheck.type = \"InvalidCheck\";\n/**\n * Logged on the server when Auth.js could not decode or encode a JWT-based (`strategy: \"jwt\"`) session.\n *\n * Possible causes are either a misconfigured `secret` or a malformed JWT or `encode/decode` methods.\n *\n * :::note\n * When this error is logged, the session cookie is destroyed.\n * :::\n *\n * Learn more at [`secret`](https://authjs.dev/reference/core#secret), [`jwt.encode`](https://authjs.dev/reference/core/jwt#encode-1) or [`jwt.decode`](https://authjs.dev/reference/core/jwt#decode-2) for more information.\n */\nexport class JWTSessionError extends AuthError {\n}\nJWTSessionError.type = \"JWTSessionError\";\n/**\n * Thrown if Auth.js is misonfigured. This could happen if you configured an Email provider but did not set up a database adapter,\n * or tried using a `strategy: \"database\"` session without a database adapter.\n * In both cases, make sure you either remove the configuration or add the missing adapter.\n *\n * Learn more at [Database Adapters](https://authjs.dev/getting-started/database), [Email provider](https://authjs.dev/getting-started/authentication/email) or [Concept: Database session strategy](https://authjs.dev/concepts/session-strategies#database-session)\n */\nexport class MissingAdapter extends AuthError {\n}\nMissingAdapter.type = \"MissingAdapter\";\n/**\n * Thrown similarily to [`MissingAdapter`](https://authjs.dev/reference/core/errors#missingadapter), but only some required methods were missing.\n *\n * Make sure you either remove the configuration or add the missing methods to the adapter.\n *\n * Learn more at [Database Adapters](https://authjs.dev/getting-started/database)\n */\nexport class MissingAdapterMethods extends AuthError {\n}\nMissingAdapterMethods.type = \"MissingAdapterMethods\";\n/**\n * Thrown when a Credentials provider is missing the `authorize` configuration.\n * To perform credentials sign in, the `authorize` method is required.\n *\n * Learn more at [Credentials provider](https://authjs.dev/getting-started/authentication/credentials)\n */\nexport class MissingAuthorize extends AuthError {\n}\nMissingAuthorize.type = \"MissingAuthorize\";\n/**\n * Auth.js requires a secret or multiple secrets to be set, but none was not found. This is used to encrypt cookies, JWTs and other sensitive data.\n *\n * :::note\n * If you are using a framework like Next.js, we try to automatically infer the secret from the `AUTH_SECRET`, `AUTH_SECRET_1`, etc. environment variables.\n * Alternatively, you can also explicitly set the [`AuthConfig.secret`](https://authjs.dev/reference/core#secret) option.\n * :::\n *\n *\n * :::tip\n * To generate a random string, you can use the Auth.js CLI: `npx auth secret`\n * :::\n */\nexport class MissingSecret extends AuthError {\n}\nMissingSecret.type = \"MissingSecret\";\n/**\n * Thrown when an Email address is already associated with an account\n * but the user is trying an OAuth account that is not linked to it.\n *\n * For security reasons, Auth.js does not automatically link OAuth accounts to existing accounts if the user is not signed in.\n *\n * :::tip\n * If you trust the OAuth provider to have verified the user's email address,\n * you can enable automatic account linking by setting [`allowDangerousEmailAccountLinking: true`](https://authjs.dev/reference/core/providers#allowdangerousemailaccountlinking)\n * in the provider configuration.\n * :::\n */\nexport class OAuthAccountNotLinked extends SignInError {\n}\nOAuthAccountNotLinked.type = \"OAuthAccountNotLinked\";\n/**\n * Thrown when an OAuth provider returns an error during the sign in process.\n * This could happen for example if the user denied access to the application or there was a configuration error.\n *\n * For a full list of possible reasons, check out the specification [Authorization Code Grant: Error Response](https://www.rfc-editor.org/rfc/rfc6749#section-4.1.2.1)\n */\nexport class OAuthCallbackError extends SignInError {\n}\nOAuthCallbackError.type = \"OAuthCallbackError\";\n/**\n * This error occurs during an OAuth sign in attempt when the provider's\n * response could not be parsed. This could for example happen if the provider's API\n * changed, or the [`OAuth2Config.profile`](https://authjs.dev/reference/core/providers#oauth2configprofile) method is not implemented correctly.\n */\nexport class OAuthProfileParseError extends AuthError {\n}\nOAuthProfileParseError.type = \"OAuthProfileParseError\";\n/**\n * Logged on the server when Auth.js could not retrieve a session from the database (`strategy: \"database\"`).\n *\n * The database adapter might be misconfigured or the database is not reachable.\n *\n * Learn more at [Concept: Database session strategy](https://authjs.dev/concepts/session-strategies#database)\n */\nexport class SessionTokenError extends AuthError {\n}\nSessionTokenError.type = \"SessionTokenError\";\n/**\n * Happens when login by [OAuth](https://authjs.dev/getting-started/authentication/oauth) could not be started.\n *\n * Possible causes are:\n * - The Authorization Server is not compliant with the [OAuth 2.0](https://www.ietf.org/rfc/rfc6749.html) or the [OIDC](https://openid.net/specs/openid-connect-core-1_0.html) specification.\n * Check the details in the error message.\n *\n * :::tip\n * Check out `[auth][details]` in the logs to know which provider failed.\n * @example\n * ```sh\n * [auth][details]: { \"provider\": \"github\" }\n * ```\n * :::\n */\nexport class OAuthSignInError extends SignInError {\n}\nOAuthSignInError.type = \"OAuthSignInError\";\n/**\n * Happens when the login by an [Email provider](https://authjs.dev/getting-started/authentication/email) could not be started.\n *\n * Possible causes are:\n * - The email sent from the client is invalid, could not be normalized by [`EmailConfig.normalizeIdentifier`](https://authjs.dev/reference/core/providers/email#normalizeidentifier)\n * - The provided email/token combination has expired:\n * Ask the user to log in again.\n * - There was an error with the database:\n * Check the database logs.\n */\nexport class EmailSignInError extends SignInError {\n}\nEmailSignInError.type = \"EmailSignInError\";\n/**\n * Represents an error that occurs during the sign-out process. This error\n * is logged when there are issues in terminating a user's session, either\n * by failing to delete the session from the database (in database session\n * strategies) or encountering issues during other parts of the sign-out\n * process, such as emitting sign-out events or clearing session cookies.\n *\n * The session cookie(s) are emptied even if this error is logged.\n *\n */\nexport class SignOutError extends AuthError {\n}\nSignOutError.type = \"SignOutError\";\n/**\n * Auth.js was requested to handle an operation that it does not support.\n *\n * See [`AuthAction`](https://authjs.dev/reference/core/types#authaction) for the supported actions.\n */\nexport class UnknownAction extends AuthError {\n}\nUnknownAction.type = \"UnknownAction\";\n/**\n * Thrown when a Credentials provider is present but the JWT strategy (`strategy: \"jwt\"`) is not enabled.\n *\n * Learn more at [`strategy`](https://authjs.dev/reference/core#strategy) or [Credentials provider](https://authjs.dev/getting-started/authentication/credentials)\n */\nexport class UnsupportedStrategy extends AuthError {\n}\nUnsupportedStrategy.type = \"UnsupportedStrategy\";\n/** Thrown when an endpoint was incorrectly called without a provider, or with an unsupported provider. */\nexport class InvalidProvider extends AuthError {\n}\nInvalidProvider.type = \"InvalidProvider\";\n/**\n * Thrown when the `trustHost` option was not set to `true`.\n *\n * Auth.js requires the `trustHost` option to be set to `true` since it's relying on the request headers' `host` value.\n *\n * :::note\n * Official Auth.js libraries might attempt to automatically set the `trustHost` option to `true` if the request is coming from a trusted host on a trusted platform.\n * :::\n *\n * Learn more at [`trustHost`](https://authjs.dev/reference/core#trusthost) or [Guide: Deployment](https://authjs.dev/getting-started/deployment)\n */\nexport class UntrustedHost extends AuthError {\n}\nUntrustedHost.type = \"UntrustedHost\";\n/**\n * The user's email/token combination was invalid.\n * This could be because the email/token combination was not found in the database,\n * or because the token has expired. Ask the user to log in again.\n */\nexport class Verification extends AuthError {\n}\nVerification.type = \"Verification\";\n/**\n * Error for missing CSRF tokens in client-side actions (`signIn`, `signOut`, `useSession#update`).\n * Thrown when actions lack the double submit cookie, essential for CSRF protection.\n *\n * CSRF ([Cross-Site Request Forgery](https://owasp.org/www-community/attacks/csrf))\n * is an attack leveraging authenticated user credentials for unauthorized actions.\n *\n * Double submit cookie pattern, a CSRF defense, requires matching values in a cookie\n * and request parameter. More on this at [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/Security/CSRF).\n */\nexport class MissingCSRF extends SignInError {\n}\nMissingCSRF.type = \"MissingCSRF\";\nconst clientErrors = new Set([\n \"CredentialsSignin\",\n \"OAuthAccountNotLinked\",\n \"OAuthCallbackError\",\n \"AccessDenied\",\n \"Verification\",\n \"MissingCSRF\",\n \"AccountNotLinked\",\n \"WebAuthnVerificationError\",\n]);\n/**\n * Used to only allow sending a certain subset of errors to the client.\n * Errors are always logged on the server, but to prevent leaking sensitive information,\n * only a subset of errors are sent to the client as-is.\n * @internal\n */\nexport function isClientError(error) {\n if (error instanceof AuthError)\n return clientErrors.has(error.type);\n return false;\n}\n/**\n * Thrown when multiple providers have `enableConditionalUI` set to `true`.\n * Only one provider can have this option enabled at a time.\n */\nexport class DuplicateConditionalUI extends AuthError {\n}\nDuplicateConditionalUI.type = \"DuplicateConditionalUI\";\n/**\n * Thrown when a WebAuthn provider has `enableConditionalUI` set to `true` but no formField has `webauthn` in its autocomplete param.\n *\n * The `webauthn` autocomplete param is required for conditional UI to work.\n */\nexport class MissingWebAuthnAutocomplete extends AuthError {\n}\nMissingWebAuthnAutocomplete.type = \"MissingWebAuthnAutocomplete\";\n/**\n * Thrown when a WebAuthn provider fails to verify a client response.\n */\nexport class WebAuthnVerificationError extends AuthError {\n}\nWebAuthnVerificationError.type = \"WebAuthnVerificationError\";\n/**\n * Thrown when an Email address is already associated with an account\n * but the user is trying an account that is not linked to it.\n *\n * For security reasons, Auth.js does not automatically link accounts to existing accounts if the user is not signed in.\n */\nexport class AccountNotLinked extends SignInError {\n}\nAccountNotLinked.type = \"AccountNotLinked\";\n/**\n * Thrown when an experimental feature is used but not enabled.\n */\nexport class ExperimentalFeatureNotEnabled extends AuthError {\n}\nExperimentalFeatureNotEnabled.type = \"ExperimentalFeatureNotEnabled\";\n","\"use client\";\nimport * as React from \"react\";\nimport { AuthError } from \"@auth/core/errors\";\n/** @todo */\nclass ClientFetchError extends AuthError {\n}\n/** @todo */\nexport class ClientSessionError extends AuthError {\n}\n// ------------------------ Internal ------------------------\n/**\n * If passed 'appContext' via getInitialProps() in _app.js\n * then get the req object from ctx and use that for the\n * req value to allow `fetchData` to\n * work seemlessly in getInitialProps() on server side\n * pages *and* in _app.js.\n * @internal\n */\nexport async function fetchData(path, __NEXTAUTH, logger, req = {}) {\n const url = `${apiBaseUrl(__NEXTAUTH)}/${path}`;\n try {\n const options = {\n headers: {\n \"Content-Type\": \"application/json\",\n ...(req?.headers?.cookie ? { cookie: req.headers.cookie } : {}),\n },\n };\n if (req?.body) {\n options.body = JSON.stringify(req.body);\n options.method = \"POST\";\n }\n const res = await fetch(url, options);\n const data = await res.json();\n if (!res.ok)\n throw data;\n return data;\n }\n catch (error) {\n logger.error(new ClientFetchError(error.message, error));\n return null;\n }\n}\n/** @internal */\nexport function apiBaseUrl(__NEXTAUTH) {\n if (typeof window === \"undefined\") {\n // Return absolute path when called server side\n return `${__NEXTAUTH.baseUrlServer}${__NEXTAUTH.basePathServer}`;\n }\n // Return relative path when called client side\n return __NEXTAUTH.basePath;\n}\n/** @internal */\nexport function useOnline() {\n const [isOnline, setIsOnline] = React.useState(typeof navigator !== \"undefined\" ? navigator.onLine : false);\n const setOnline = () => setIsOnline(true);\n const setOffline = () => setIsOnline(false);\n React.useEffect(() => {\n window.addEventListener(\"online\", setOnline);\n window.addEventListener(\"offline\", setOffline);\n return () => {\n window.removeEventListener(\"online\", setOnline);\n window.removeEventListener(\"offline\", setOffline);\n };\n }, []);\n return isOnline;\n}\n/**\n * Returns the number of seconds elapsed since January 1, 1970 00:00:00 UTC.\n * @internal\n */\nexport function now() {\n return Math.floor(Date.now() / 1000);\n}\n/**\n * Returns an `URL` like object to make requests/redirects from server-side\n * @internal\n */\nexport function parseUrl(url) {\n const defaultUrl = new URL(\"http://localhost:3000/api/auth\");\n if (url && !url.startsWith(\"http\")) {\n url = `https://${url}`;\n }\n const _url = new URL(url || defaultUrl);\n const path = (_url.pathname === \"/\" ? defaultUrl.pathname : _url.pathname)\n // Remove trailing slash\n .replace(/\\/$/, \"\");\n const base = `${_url.origin}${path}`;\n return {\n origin: _url.origin,\n host: _url.host,\n path,\n base,\n toString: () => base,\n };\n}\n","/**\n *\n * NextAuth.js methods and components that work in [Client components](https://nextjs.org/docs/app/building-your-application/rendering/client-components) and the [Pages Router](https://nextjs.org/docs/pages).\n *\n * For use in [Server Actions](https://nextjs.org/docs/app/api-reference/functions/server-actions), check out [these methods](https://authjs.dev/guides/upgrade-to-v5#methods)\n *\n * @module react\n */\n\"use client\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport * as React from \"react\";\nimport { apiBaseUrl, ClientSessionError, fetchData, now, parseUrl, useOnline, } from \"./lib/client.js\";\n// This behaviour mirrors the default behaviour for getting the site name that\n// happens server side in server/index.js\n// 1. An empty value is legitimate when the code is being invoked client side as\n// relative URLs are valid in that context and so defaults to empty.\n// 2. When invoked server side the value is picked up from an environment\n// variable and defaults to 'http://localhost:3000'.\nexport const __NEXTAUTH = {\n baseUrl: parseUrl(process.env.NEXTAUTH_URL ?? process.env.VERCEL_URL).origin,\n basePath: parseUrl(process.env.NEXTAUTH_URL).path,\n baseUrlServer: parseUrl(process.env.NEXTAUTH_URL_INTERNAL ??\n process.env.NEXTAUTH_URL ??\n process.env.VERCEL_URL).origin,\n basePathServer: parseUrl(process.env.NEXTAUTH_URL_INTERNAL ?? process.env.NEXTAUTH_URL).path,\n _lastSync: 0,\n _session: undefined,\n _getSession: () => { },\n};\nlet broadcastChannel = null;\nfunction broadcast() {\n if (typeof BroadcastChannel === \"undefined\") {\n return {\n postMessage: () => { },\n addEventListener: () => { },\n removeEventListener: () => { },\n };\n }\n if (broadcastChannel === null) {\n broadcastChannel = new BroadcastChannel(\"next-auth\");\n }\n return broadcastChannel;\n}\n// TODO:\nconst logger = {\n debug: console.debug,\n error: console.error,\n warn: console.warn,\n};\nexport const SessionContext = React.createContext?.(undefined);\n/**\n * React Hook that gives you access to the logged in user's session data and lets you modify it.\n *\n * :::info\n * `useSession` is for client-side use only and when using [Next.js App Router (`app/`)](https://nextjs.org/blog/next-13-4#nextjs-app-router) you should prefer the `auth()` export.\n * :::\n */\nexport function useSession(options) {\n if (!SessionContext) {\n throw new Error(\"React Context is unavailable in Server Components\");\n }\n // @ts-expect-error Satisfy TS if branch on line below\n const value = React.useContext(SessionContext);\n if (!value && process.env.NODE_ENV !== \"production\") {\n throw new Error(\"[next-auth]: `useSession` must be wrapped in a \");\n }\n const { required, onUnauthenticated } = options ?? {};\n const requiredAndNotLoading = required && value.status === \"unauthenticated\";\n React.useEffect(() => {\n if (requiredAndNotLoading) {\n const url = `${__NEXTAUTH.basePath}/signin?${new URLSearchParams({\n error: \"SessionRequired\",\n callbackUrl: window.location.href,\n })}`;\n if (onUnauthenticated)\n onUnauthenticated();\n else\n window.location.href = url;\n }\n }, [requiredAndNotLoading, onUnauthenticated]);\n if (requiredAndNotLoading) {\n return {\n data: value.data,\n update: value.update,\n status: \"loading\",\n };\n }\n return value;\n}\nexport async function getSession(params) {\n const session = await fetchData(\"session\", __NEXTAUTH, logger, params);\n if (params?.broadcast ?? true) {\n broadcast().postMessage({\n event: \"session\",\n data: { trigger: \"getSession\" },\n });\n }\n return session;\n}\n/**\n * Returns the current Cross-Site Request Forgery Token (CSRF Token)\n * required to make requests that changes state. (e.g. signing in or out, or updating the session).\n *\n * [CSRF Prevention: Double Submit Cookie](https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#double-submit-cookie)\n */\nexport async function getCsrfToken() {\n const response = await fetchData(\"csrf\", __NEXTAUTH, logger);\n return response?.csrfToken ?? \"\";\n}\n/**\n * Returns a client-safe configuration object of the currently\n * available providers.\n */\nexport async function getProviders() {\n return fetchData(\"providers\", __NEXTAUTH, logger);\n}\n/**\n * Initiate a signin flow or send the user to the signin page listing all possible providers.\n * Handles CSRF protection.\n */\nexport async function signIn(provider, options, authorizationParams) {\n const { callbackUrl = window.location.href, redirect = true } = options ?? {};\n const baseUrl = apiBaseUrl(__NEXTAUTH);\n const providers = await getProviders();\n if (!providers) {\n window.location.href = `${baseUrl}/error`;\n return;\n }\n if (!provider || !(provider in providers)) {\n window.location.href = `${baseUrl}/signin?${new URLSearchParams({\n callbackUrl,\n })}`;\n return;\n }\n const isCredentials = providers[provider].type === \"credentials\";\n const isEmail = providers[provider].type === \"email\";\n const isSupportingReturn = isCredentials || isEmail;\n const signInUrl = `${baseUrl}/${isCredentials ? \"callback\" : \"signin\"}/${provider}`;\n const csrfToken = await getCsrfToken();\n const res = await fetch(`${signInUrl}?${new URLSearchParams(authorizationParams)}`, {\n method: \"post\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"X-Auth-Return-Redirect\": \"1\",\n },\n // @ts-expect-error\n body: new URLSearchParams({\n ...options,\n csrfToken,\n callbackUrl,\n }),\n });\n const data = await res.json();\n // TODO: Do not redirect for Credentials and Email providers by default in next major\n if (redirect || !isSupportingReturn) {\n const url = data.url ?? callbackUrl;\n window.location.href = url;\n // If url contains a hash, the browser does not reload the page. We reload manually\n if (url.includes(\"#\"))\n window.location.reload();\n return;\n }\n const error = new URL(data.url).searchParams.get(\"error\");\n const code = new URL(data.url).searchParams.get(\"code\");\n if (res.ok) {\n await __NEXTAUTH._getSession({ event: \"storage\" });\n }\n return {\n error,\n code,\n status: res.status,\n ok: res.ok,\n url: error ? null : data.url,\n };\n}\n/**\n * Initiate a signout, by destroying the current session.\n * Handles CSRF protection.\n */\nexport async function signOut(options) {\n const { callbackUrl = window.location.href } = options ?? {};\n const baseUrl = apiBaseUrl(__NEXTAUTH);\n const csrfToken = await getCsrfToken();\n const res = await fetch(`${baseUrl}/signout`, {\n method: \"post\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"X-Auth-Return-Redirect\": \"1\",\n },\n body: new URLSearchParams({ csrfToken, callbackUrl }),\n });\n const data = await res.json();\n broadcast().postMessage({ event: \"session\", data: { trigger: \"signout\" } });\n if (options?.redirect ?? true) {\n const url = data.url ?? callbackUrl;\n window.location.href = url;\n // If url contains a hash, the browser does not reload the page. We reload manually\n if (url.includes(\"#\"))\n window.location.reload();\n // @ts-expect-error\n return;\n }\n await __NEXTAUTH._getSession({ event: \"storage\" });\n return data;\n}\n/**\n * [React Context](https://react.dev/learn/passing-data-deeply-with-context) provider to wrap the app (`pages/`) to make session data available anywhere.\n *\n * When used, the session state is automatically synchronized across all open tabs/windows and they are all updated whenever they gain or lose focus\n * or the state changes (e.g. a user signs in or out) when {@link SessionProviderProps.refetchOnWindowFocus} is `true`.\n *\n * :::info\n * `SessionProvider` is for client-side use only and when using [Next.js App Router (`app/`)](https://nextjs.org/blog/next-13-4#nextjs-app-router) you should prefer the `auth()` export.\n * :::\n */\nexport function SessionProvider(props) {\n if (!SessionContext) {\n throw new Error(\"React Context is unavailable in Server Components\");\n }\n const { children, basePath, refetchInterval, refetchWhenOffline } = props;\n if (basePath)\n __NEXTAUTH.basePath = basePath;\n /**\n * If session was `null`, there was an attempt to fetch it,\n * but it failed, but we still treat it as a valid initial value.\n */\n const hasInitialSession = props.session !== undefined;\n /** If session was passed, initialize as already synced */\n __NEXTAUTH._lastSync = hasInitialSession ? now() : 0;\n const [session, setSession] = React.useState(() => {\n if (hasInitialSession)\n __NEXTAUTH._session = props.session;\n return props.session;\n });\n /** If session was passed, initialize as not loading */\n const [loading, setLoading] = React.useState(!hasInitialSession);\n React.useEffect(() => {\n __NEXTAUTH._getSession = async ({ event } = {}) => {\n try {\n const storageEvent = event === \"storage\";\n // We should always update if we don't have a client session yet\n // or if there are events from other tabs/windows\n if (storageEvent || __NEXTAUTH._session === undefined) {\n __NEXTAUTH._lastSync = now();\n __NEXTAUTH._session = await getSession({\n broadcast: !storageEvent,\n });\n setSession(__NEXTAUTH._session);\n return;\n }\n if (\n // If there is no time defined for when a session should be considered\n // stale, then it's okay to use the value we have until an event is\n // triggered which updates it\n !event ||\n // If the client doesn't have a session then we don't need to call\n // the server to check if it does (if they have signed in via another\n // tab or window that will come through as a \"stroage\" event\n // event anyway)\n __NEXTAUTH._session === null ||\n // Bail out early if the client session is not stale yet\n now() < __NEXTAUTH._lastSync) {\n return;\n }\n // An event or session staleness occurred, update the client session.\n __NEXTAUTH._lastSync = now();\n __NEXTAUTH._session = await getSession();\n setSession(__NEXTAUTH._session);\n }\n catch (error) {\n logger.error(new ClientSessionError(error.message, error));\n }\n finally {\n setLoading(false);\n }\n };\n __NEXTAUTH._getSession();\n return () => {\n __NEXTAUTH._lastSync = 0;\n __NEXTAUTH._session = undefined;\n __NEXTAUTH._getSession = () => { };\n };\n }, []);\n React.useEffect(() => {\n const handle = () => __NEXTAUTH._getSession({ event: \"storage\" });\n // Listen for storage events and update session if event fired from\n // another window (but suppress firing another event to avoid a loop)\n // Fetch new session data but tell it to not to fire another event to\n // avoid an infinite loop.\n // Note: We could pass session data through and do something like\n // `setData(message.data)` but that can cause problems depending\n // on how the session object is being used in the client; it is\n // more robust to have each window/tab fetch it's own copy of the\n // session object rather than share it across instances.\n broadcast().addEventListener(\"message\", handle);\n return () => broadcast().removeEventListener(\"message\", handle);\n }, []);\n React.useEffect(() => {\n const { refetchOnWindowFocus = true } = props;\n // Listen for when the page is visible, if the user switches tabs\n // and makes our tab visible again, re-fetch the session, but only if\n // this feature is not disabled.\n const visibilityHandler = () => {\n if (refetchOnWindowFocus && document.visibilityState === \"visible\")\n __NEXTAUTH._getSession({ event: \"visibilitychange\" });\n };\n document.addEventListener(\"visibilitychange\", visibilityHandler, false);\n return () => document.removeEventListener(\"visibilitychange\", visibilityHandler, false);\n }, [props.refetchOnWindowFocus]);\n const isOnline = useOnline();\n // TODO: Flip this behavior in next major version\n const shouldRefetch = refetchWhenOffline !== false || isOnline;\n React.useEffect(() => {\n if (refetchInterval && shouldRefetch) {\n const refetchIntervalTimer = setInterval(() => {\n if (__NEXTAUTH._session) {\n __NEXTAUTH._getSession({ event: \"poll\" });\n }\n }, refetchInterval * 1000);\n return () => clearInterval(refetchIntervalTimer);\n }\n }, [refetchInterval, shouldRefetch]);\n const value = React.useMemo(() => ({\n data: session,\n status: loading\n ? \"loading\"\n : session\n ? \"authenticated\"\n : \"unauthenticated\",\n async update(data) {\n if (loading || !session)\n return;\n setLoading(true);\n const newSession = await fetchData(\"session\", __NEXTAUTH, logger, typeof data === \"undefined\"\n ? undefined\n : { body: { csrfToken: await getCsrfToken(), data } });\n setLoading(false);\n if (newSession) {\n setSession(newSession);\n broadcast().postMessage({\n event: \"session\",\n data: { trigger: \"getSession\" },\n });\n }\n return newSession;\n },\n }), [session, loading]);\n return (\n // @ts-expect-error\n _jsx(SessionContext.Provider, { value: value, children: children }));\n}\n"],"names":["AuthError","Error","constructor","message","errorOptions","undefined","cause","err","name","type","kind","captureStackTrace","url","toLowerCase","SignInError","AdapterError","AccessDenied","CallbackRouteError","ErrorPageLoop","EventError","InvalidCallbackUrl","CredentialsSignin","arguments","code","InvalidEndpoints","InvalidCheck","JWTSessionError","MissingAdapter","MissingAdapterMethods","MissingAuthorize","MissingSecret","OAuthAccountNotLinked","OAuthCallbackError","OAuthProfileParseError","SessionTokenError","OAuthSignInError","EmailSignInError","SignOutError","UnknownAction","UnsupportedStrategy","InvalidProvider","UntrustedHost","Verification","MissingCSRF","clientErrors","Set","isClientError","error","has","DuplicateConditionalUI","MissingWebAuthnAutocomplete","WebAuthnVerificationError","AccountNotLinked","ExperimentalFeatureNotEnabled","React","process","ClientFetchError","ClientSessionError","fetchData","path","__NEXTAUTH","logger","req","apiBaseUrl","concat","options","headers","cookie","body","JSON","stringify","method","res","fetch","data","json","ok","window","baseUrlServer","basePathServer","basePath","now","Math","floor","Date","parseUrl","defaultUrl","URL","startsWith","_url","pathname","replace","base","origin","host","toString","baseUrl","env","NEXTAUTH_URL_INTERNAL","VERCEL_URL","_lastSync","_session","_getSession","broadcastChannel","broadcast","BroadcastChannel","postMessage","addEventListener","removeEventListener","debug","console","warn","SessionContext","useSession","value","required","onUnauthenticated","requiredAndNotLoading","status","URLSearchParams","callbackUrl","location","href","update","getSession","params","session","event","trigger","getCsrfToken","response","csrfToken","getProviders","signIn","provider","authorizationParams","redirect","providers","isCredentials","isEmail","signInUrl","includes","reload","searchParams","get","signOut","SessionProvider","props","children","refetchInterval","refetchWhenOffline","hasInitialSession","setSession","loading","setLoading","length","storageEvent","handle","refetchOnWindowFocus","visibilityHandler","document","visibilityState","isOnline","useOnline","setIsOnline","navigator","onLine","setOnline","setOffline","shouldRefetch","refetchIntervalTimer","setInterval","clearInterval","newSession","_jsx","Provider"],"sourceRoot":""}