{"version":3,"file":"clerk-vendor-CG8L0UKp.js","sources":["../../node_modules/@clerk/shared/dist/chunk-DL452J2I.mjs","../../node_modules/@clerk/shared/dist/chunk-7ELT755Q.mjs","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../../node_modules/use-sync-external-store/shim/index.js","../../node_modules/dequal/lite/index.mjs","../../node_modules/swr/dist/_internal/config-context-client-x_C9_NWC.mjs","../../node_modules/swr/dist/_internal/index.mjs","../../node_modules/swr/dist/index/index.mjs","../../node_modules/swr/dist/infinite/index.mjs","../../node_modules/dequal/dist/index.mjs","../../node_modules/@clerk/shared/dist/react/index.mjs","../../node_modules/@clerk/shared/dist/chunk-TETGTEI2.mjs","../../node_modules/@clerk/shared/dist/chunk-I6MTSTOF.mjs","../../node_modules/@clerk/shared/dist/chunk-NJGRVCG7.mjs","../../node_modules/@clerk/shared/dist/chunk-QMOEH4QX.mjs","../../node_modules/@clerk/shared/dist/chunk-4EIZQYWK.mjs","../../node_modules/@clerk/clerk-react/dist/chunk-GNFPFS75.mjs","../../node_modules/@clerk/clerk-react/dist/chunk-OANWQR3B.mjs","../../node_modules/@clerk/shared/dist/chunk-JMFHSME2.mjs","../../node_modules/@clerk/shared/dist/chunk-6NDGN2IU.mjs","../../node_modules/@clerk/shared/dist/chunk-IFTVZ2LQ.mjs","../../node_modules/@clerk/shared/dist/chunk-QE36JXB4.mjs","../../node_modules/@clerk/shared/dist/chunk-DKITONR4.mjs","../../node_modules/@clerk/shared/dist/chunk-6O4KFNGJ.mjs","../../node_modules/@clerk/shared/dist/chunk-CFXQSUF6.mjs","../../node_modules/@clerk/shared/dist/chunk-JNWT25N5.mjs","../../node_modules/@clerk/shared/dist/chunk-LJ4R7M7R.mjs","../../node_modules/@clerk/clerk-react/dist/index.mjs"],"sourcesContent":["// src/error.ts\nfunction isUnauthorizedError(e) {\n var _a, _b;\n const status = e == null ? void 0 : e.status;\n const code = (_b = (_a = e == null ? void 0 : e.errors) == null ? void 0 : _a[0]) == null ? void 0 : _b.code;\n return code === \"authentication_invalid\" && status === 401;\n}\nfunction isCaptchaError(e) {\n return [\"captcha_invalid\", \"captcha_not_enabled\", \"captcha_missing_token\"].includes(e.errors[0].code);\n}\nfunction is4xxError(e) {\n const status = e == null ? void 0 : e.status;\n return !!status && status >= 400 && status < 500;\n}\nfunction isNetworkError(e) {\n const message = (`${e.message}${e.name}` || \"\").toLowerCase().replace(/\\s+/g, \"\");\n return message.includes(\"networkerror\");\n}\nfunction isKnownError(error) {\n return isClerkAPIResponseError(error) || isMetamaskError(error) || isClerkRuntimeError(error);\n}\nfunction isClerkAPIResponseError(err) {\n return \"clerkError\" in err;\n}\nfunction isClerkRuntimeError(err) {\n return \"clerkRuntimeError\" in err;\n}\nfunction isMetamaskError(err) {\n return \"code\" in err && [4001, 32602, 32603].includes(err.code) && \"message\" in err;\n}\nfunction isUserLockedError(err) {\n var _a, _b;\n return isClerkAPIResponseError(err) && ((_b = (_a = err.errors) == null ? void 0 : _a[0]) == null ? void 0 : _b.code) === \"user_locked\";\n}\nfunction isPasswordPwnedError(err) {\n var _a, _b;\n return isClerkAPIResponseError(err) && ((_b = (_a = err.errors) == null ? void 0 : _a[0]) == null ? void 0 : _b.code) === \"form_password_pwned\";\n}\nfunction parseErrors(data = []) {\n return data.length > 0 ? data.map(parseError) : [];\n}\nfunction parseError(error) {\n var _a, _b, _c, _d, _e;\n return {\n code: error.code,\n message: error.message,\n longMessage: error.long_message,\n meta: {\n paramName: (_a = error == null ? void 0 : error.meta) == null ? void 0 : _a.param_name,\n sessionId: (_b = error == null ? void 0 : error.meta) == null ? void 0 : _b.session_id,\n emailAddresses: (_c = error == null ? void 0 : error.meta) == null ? void 0 : _c.email_addresses,\n identifiers: (_d = error == null ? void 0 : error.meta) == null ? void 0 : _d.identifiers,\n zxcvbn: (_e = error == null ? void 0 : error.meta) == null ? void 0 : _e.zxcvbn\n }\n };\n}\nfunction errorToJSON(error) {\n var _a, _b, _c, _d, _e;\n return {\n code: (error == null ? void 0 : error.code) || \"\",\n message: (error == null ? void 0 : error.message) || \"\",\n long_message: error == null ? void 0 : error.longMessage,\n meta: {\n param_name: (_a = error == null ? void 0 : error.meta) == null ? void 0 : _a.paramName,\n session_id: (_b = error == null ? void 0 : error.meta) == null ? void 0 : _b.sessionId,\n email_addresses: (_c = error == null ? void 0 : error.meta) == null ? void 0 : _c.emailAddresses,\n identifiers: (_d = error == null ? void 0 : error.meta) == null ? void 0 : _d.identifiers,\n zxcvbn: (_e = error == null ? void 0 : error.meta) == null ? void 0 : _e.zxcvbn\n }\n };\n}\nvar ClerkAPIResponseError = class _ClerkAPIResponseError extends Error {\n constructor(message, { data, status, clerkTraceId }) {\n super(message);\n this.toString = () => {\n let message = `[${this.name}]\nMessage:${this.message}\nStatus:${this.status}\nSerialized errors: ${this.errors.map(\n (e) => JSON.stringify(e)\n )}`;\n if (this.clerkTraceId) {\n message += `\nClerk Trace ID: ${this.clerkTraceId}`;\n }\n return message;\n };\n Object.setPrototypeOf(this, _ClerkAPIResponseError.prototype);\n this.status = status;\n this.message = message;\n this.clerkTraceId = clerkTraceId;\n this.clerkError = true;\n this.errors = parseErrors(data);\n }\n};\nvar ClerkRuntimeError = class _ClerkRuntimeError extends Error {\n constructor(message, { code }) {\n const prefix = \"\\u{1F512} Clerk:\";\n const regex = new RegExp(prefix.replace(\" \", \"\\\\s*\"), \"i\");\n const sanitized = message.replace(regex, \"\");\n const _message = `${prefix} ${sanitized.trim()}\n\n(code=\"${code}\")\n`;\n super(_message);\n /**\n * Returns a string representation of the error.\n *\n * @returns {string} A formatted string with the error name and message.\n * @memberof ClerkRuntimeError\n */\n this.toString = () => {\n return `[${this.name}]\nMessage:${this.message}`;\n };\n Object.setPrototypeOf(this, _ClerkRuntimeError.prototype);\n this.code = code;\n this.message = _message;\n this.clerkRuntimeError = true;\n this.name = \"ClerkRuntimeError\";\n }\n};\nvar EmailLinkError = class _EmailLinkError extends Error {\n constructor(code) {\n super(code);\n this.code = code;\n Object.setPrototypeOf(this, _EmailLinkError.prototype);\n }\n};\nfunction isEmailLinkError(err) {\n return err instanceof EmailLinkError;\n}\nvar EmailLinkErrorCode = {\n Expired: \"expired\",\n Failed: \"failed\",\n ClientMismatch: \"client_mismatch\"\n};\nvar DefaultMessages = Object.freeze({\n InvalidProxyUrlErrorMessage: `The proxyUrl passed to Clerk is invalid. The expected value for proxyUrl is an absolute URL or a relative path with a leading '/'. (key={{url}})`,\n InvalidPublishableKeyErrorMessage: `The publishableKey passed to Clerk is invalid. You can get your Publishable key at https://dashboard.clerk.com/last-active?path=api-keys. (key={{key}})`,\n MissingPublishableKeyErrorMessage: `Missing publishableKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.`,\n MissingSecretKeyErrorMessage: `Missing secretKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.`,\n MissingClerkProvider: `{{source}} can only be used within the component. Learn more: https://clerk.com/docs/components/clerk-provider`\n});\nfunction buildErrorThrower({ packageName, customMessages }) {\n let pkg = packageName;\n const messages = {\n ...DefaultMessages,\n ...customMessages\n };\n function buildMessage(rawMessage, replacements) {\n if (!replacements) {\n return `${pkg}: ${rawMessage}`;\n }\n let msg = rawMessage;\n const matches = rawMessage.matchAll(/{{([a-zA-Z0-9-_]+)}}/g);\n for (const match of matches) {\n const replacement = (replacements[match[1]] || \"\").toString();\n msg = msg.replace(`{{${match[1]}}}`, replacement);\n }\n return `${pkg}: ${msg}`;\n }\n return {\n setPackageName({ packageName: packageName2 }) {\n if (typeof packageName2 === \"string\") {\n pkg = packageName2;\n }\n return this;\n },\n setMessages({ customMessages: customMessages2 }) {\n Object.assign(messages, customMessages2 || {});\n return this;\n },\n throwInvalidPublishableKeyError(params) {\n throw new Error(buildMessage(messages.InvalidPublishableKeyErrorMessage, params));\n },\n throwInvalidProxyUrl(params) {\n throw new Error(buildMessage(messages.InvalidProxyUrlErrorMessage, params));\n },\n throwMissingPublishableKeyError() {\n throw new Error(buildMessage(messages.MissingPublishableKeyErrorMessage));\n },\n throwMissingSecretKeyError() {\n throw new Error(buildMessage(messages.MissingSecretKeyErrorMessage));\n },\n throwMissingClerkProviderError(params) {\n throw new Error(buildMessage(messages.MissingClerkProvider, params));\n },\n throw(message) {\n throw new Error(buildMessage(message));\n }\n };\n}\nvar ClerkWebAuthnError = class extends ClerkRuntimeError {\n constructor(message, { code }) {\n super(message, { code });\n this.code = code;\n }\n};\n\nexport {\n isUnauthorizedError,\n isCaptchaError,\n is4xxError,\n isNetworkError,\n isKnownError,\n isClerkAPIResponseError,\n isClerkRuntimeError,\n isMetamaskError,\n isUserLockedError,\n isPasswordPwnedError,\n parseErrors,\n parseError,\n errorToJSON,\n ClerkAPIResponseError,\n ClerkRuntimeError,\n EmailLinkError,\n isEmailLinkError,\n EmailLinkErrorCode,\n buildErrorThrower,\n ClerkWebAuthnError\n};\n//# sourceMappingURL=chunk-DL452J2I.mjs.map","var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\nvar __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, \"write to private field\"), setter ? setter.call(obj, value) : member.set(obj, value), value);\nvar __privateMethod = (obj, member, method) => (__accessCheck(obj, member, \"access private method\"), method);\n\nexport {\n __export,\n __reExport,\n __privateGet,\n __privateAdd,\n __privateSet,\n __privateMethod\n};\n//# sourceMappingURL=chunk-7ELT755Q.mjs.map","/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","var has = Object.prototype.hasOwnProperty;\n\nexport function dequal(foo, bar) {\n\tvar ctor, len;\n\tif (foo === bar) return true;\n\n\tif (foo && bar && (ctor=foo.constructor) === bar.constructor) {\n\t\tif (ctor === Date) return foo.getTime() === bar.getTime();\n\t\tif (ctor === RegExp) return foo.toString() === bar.toString();\n\n\t\tif (ctor === Array) {\n\t\t\tif ((len=foo.length) === bar.length) {\n\t\t\t\twhile (len-- && dequal(foo[len], bar[len]));\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (!ctor || typeof foo === 'object') {\n\t\t\tlen = 0;\n\t\t\tfor (ctor in foo) {\n\t\t\t\tif (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;\n\t\t\t\tif (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;\n\t\t\t}\n\t\t\treturn Object.keys(bar).length === len;\n\t\t}\n\t}\n\n\treturn foo !== foo && bar !== bar;\n}\n","'use client';\nimport React, { useEffect, useLayoutEffect, createContext, useContext, useMemo, useRef, createElement } from 'react';\nimport { dequal } from 'dequal/lite';\n\n// Global state used to deduplicate requests and store listeners\nconst SWRGlobalState = new WeakMap();\n\n// Shared state between server components and client components\nconst noop = ()=>{};\n// Using noop() as the undefined value as undefined can be replaced\n// by something else. Prettier ignore and extra parentheses are necessary here\n// to ensure that tsc doesn't remove the __NOINLINE__ comment.\n// prettier-ignore\nconst UNDEFINED = /*#__NOINLINE__*/ noop();\nconst OBJECT = Object;\nconst isUndefined = (v)=>v === UNDEFINED;\nconst isFunction = (v)=>typeof v == 'function';\nconst mergeObjects = (a, b)=>({\n ...a,\n ...b\n });\nconst isPromiseLike = (x)=>isFunction(x.then);\n\nconst EMPTY_CACHE = {};\nconst INITIAL_CACHE = {};\nconst STR_UNDEFINED = 'undefined';\n// NOTE: Use the function to guarantee it's re-evaluated between jsdom and node runtime for tests.\nconst isWindowDefined = typeof window != STR_UNDEFINED;\nconst isDocumentDefined = typeof document != STR_UNDEFINED;\nconst hasRequestAnimationFrame = ()=>isWindowDefined && typeof window['requestAnimationFrame'] != STR_UNDEFINED;\nconst createCacheHelper = (cache, key)=>{\n const state = SWRGlobalState.get(cache);\n return [\n // Getter\n ()=>!isUndefined(key) && cache.get(key) || EMPTY_CACHE,\n // Setter\n (info)=>{\n if (!isUndefined(key)) {\n const prev = cache.get(key);\n // Before writing to the store, we keep the value in the initial cache\n // if it's not there yet.\n if (!(key in INITIAL_CACHE)) {\n INITIAL_CACHE[key] = prev;\n }\n state[5](key, mergeObjects(prev, info), prev || EMPTY_CACHE);\n }\n },\n // Subscriber\n state[6],\n // Get server cache snapshot\n ()=>{\n if (!isUndefined(key)) {\n // If the cache was updated on the client, we return the stored initial value.\n if (key in INITIAL_CACHE) return INITIAL_CACHE[key];\n }\n // If we haven't done any client-side updates, we return the current value.\n return !isUndefined(key) && cache.get(key) || EMPTY_CACHE;\n }\n ];\n} // export { UNDEFINED, OBJECT, isUndefined, isFunction, mergeObjects, isPromiseLike }\n;\n\n/**\n * Due to the bug https://bugs.chromium.org/p/chromium/issues/detail?id=678075,\n * it's not reliable to detect if the browser is currently online or offline\n * based on `navigator.onLine`.\n * As a workaround, we always assume it's online on the first load, and change\n * the status upon `online` or `offline` events.\n */ let online = true;\nconst isOnline = ()=>online;\n// For node and React Native, `add/removeEventListener` doesn't exist on window.\nconst [onWindowEvent, offWindowEvent] = isWindowDefined && window.addEventListener ? [\n window.addEventListener.bind(window),\n window.removeEventListener.bind(window)\n] : [\n noop,\n noop\n];\nconst isVisible = ()=>{\n const visibilityState = isDocumentDefined && document.visibilityState;\n return isUndefined(visibilityState) || visibilityState !== 'hidden';\n};\nconst initFocus = (callback)=>{\n // focus revalidate\n if (isDocumentDefined) {\n document.addEventListener('visibilitychange', callback);\n }\n onWindowEvent('focus', callback);\n return ()=>{\n if (isDocumentDefined) {\n document.removeEventListener('visibilitychange', callback);\n }\n offWindowEvent('focus', callback);\n };\n};\nconst initReconnect = (callback)=>{\n // revalidate on reconnected\n const onOnline = ()=>{\n online = true;\n callback();\n };\n // nothing to revalidate, just update the status\n const onOffline = ()=>{\n online = false;\n };\n onWindowEvent('online', onOnline);\n onWindowEvent('offline', onOffline);\n return ()=>{\n offWindowEvent('online', onOnline);\n offWindowEvent('offline', onOffline);\n };\n};\nconst preset = {\n isOnline,\n isVisible\n};\nconst defaultConfigOptions = {\n initFocus,\n initReconnect\n};\n\nconst IS_REACT_LEGACY = !React.useId;\nconst IS_SERVER = !isWindowDefined || 'Deno' in globalThis;\n// Polyfill requestAnimationFrame\nconst rAF = (f)=>hasRequestAnimationFrame() ? window['requestAnimationFrame'](f) : setTimeout(f, 1);\n// React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser.\nconst useIsomorphicLayoutEffect = IS_SERVER ? useEffect : useLayoutEffect;\n// This assignment is to extend the Navigator type to use effectiveType.\nconst navigatorConnection = typeof navigator !== 'undefined' && navigator.connection;\n// Adjust the config based on slow connection status (<= 70Kbps).\nconst slowConnection = !IS_SERVER && navigatorConnection && ([\n 'slow-2g',\n '2g'\n].includes(navigatorConnection.effectiveType) || navigatorConnection.saveData);\n\n// use WeakMap to store the object->key mapping\n// so the objects can be garbage collected.\n// WeakMap uses a hashtable under the hood, so the lookup\n// complexity is almost O(1).\nconst table = new WeakMap();\nconst isObjectType = (value, type)=>OBJECT.prototype.toString.call(value) === `[object ${type}]`;\n// counter of the key\nlet counter = 0;\n// A stable hash implementation that supports:\n// - Fast and ensures unique hash properties\n// - Handles unserializable values\n// - Handles object key ordering\n// - Generates short results\n//\n// This is not a serialization function, and the result is not guaranteed to be\n// parsable.\nconst stableHash = (arg)=>{\n const type = typeof arg;\n const isDate = isObjectType(arg, 'Date');\n const isRegex = isObjectType(arg, 'RegExp');\n const isPlainObject = isObjectType(arg, 'Object');\n let result;\n let index;\n if (OBJECT(arg) === arg && !isDate && !isRegex) {\n // Object/function, not null/date/regexp. Use WeakMap to store the id first.\n // If it's already hashed, directly return the result.\n result = table.get(arg);\n if (result) return result;\n // Store the hash first for circular reference detection before entering the\n // recursive `stableHash` calls.\n // For other objects like set and map, we use this id directly as the hash.\n result = ++counter + '~';\n table.set(arg, result);\n if (Array.isArray(arg)) {\n // Array.\n result = '@';\n for(index = 0; index < arg.length; index++){\n result += stableHash(arg[index]) + ',';\n }\n table.set(arg, result);\n }\n if (isPlainObject) {\n // Object, sort keys.\n result = '#';\n const keys = OBJECT.keys(arg).sort();\n while(!isUndefined(index = keys.pop())){\n if (!isUndefined(arg[index])) {\n result += index + ':' + stableHash(arg[index]) + ',';\n }\n }\n table.set(arg, result);\n }\n } else {\n result = isDate ? arg.toJSON() : type == 'symbol' ? arg.toString() : type == 'string' ? JSON.stringify(arg) : '' + arg;\n }\n return result;\n};\n\nconst serialize = (key)=>{\n if (isFunction(key)) {\n try {\n key = key();\n } catch (err) {\n // dependencies not ready\n key = '';\n }\n }\n // Use the original key as the argument of fetcher. This can be a string or an\n // array of values.\n const args = key;\n // If key is not falsy, or not an empty array, hash it.\n key = typeof key == 'string' ? key : (Array.isArray(key) ? key.length : key) ? stableHash(key) : '';\n return [\n key,\n args\n ];\n};\n\n// Global timestamp.\nlet __timestamp = 0;\nconst getTimestamp = ()=>++__timestamp;\n\nconst FOCUS_EVENT = 0;\nconst RECONNECT_EVENT = 1;\nconst MUTATE_EVENT = 2;\nconst ERROR_REVALIDATE_EVENT = 3;\n\nvar events = {\n __proto__: null,\n ERROR_REVALIDATE_EVENT: ERROR_REVALIDATE_EVENT,\n FOCUS_EVENT: FOCUS_EVENT,\n MUTATE_EVENT: MUTATE_EVENT,\n RECONNECT_EVENT: RECONNECT_EVENT\n};\n\nasync function internalMutate(...args) {\n const [cache, _key, _data, _opts] = args;\n // When passing as a boolean, it's explicitly used to disable/enable\n // revalidation.\n const options = mergeObjects({\n populateCache: true,\n throwOnError: true\n }, typeof _opts === 'boolean' ? {\n revalidate: _opts\n } : _opts || {});\n let populateCache = options.populateCache;\n const rollbackOnErrorOption = options.rollbackOnError;\n let optimisticData = options.optimisticData;\n const rollbackOnError = (error)=>{\n return typeof rollbackOnErrorOption === 'function' ? rollbackOnErrorOption(error) : rollbackOnErrorOption !== false;\n };\n const throwOnError = options.throwOnError;\n // If the second argument is a key filter, return the mutation results for all\n // filtered keys.\n if (isFunction(_key)) {\n const keyFilter = _key;\n const matchedKeys = [];\n const it = cache.keys();\n for (const key of it){\n if (// Skip the special useSWRInfinite and useSWRSubscription keys.\n !/^\\$(inf|sub)\\$/.test(key) && keyFilter(cache.get(key)._k)) {\n matchedKeys.push(key);\n }\n }\n return Promise.all(matchedKeys.map(mutateByKey));\n }\n return mutateByKey(_key);\n async function mutateByKey(_k) {\n // Serialize key\n const [key] = serialize(_k);\n if (!key) return;\n const [get, set] = createCacheHelper(cache, key);\n const [EVENT_REVALIDATORS, MUTATION, FETCH, PRELOAD] = SWRGlobalState.get(cache);\n const startRevalidate = ()=>{\n const revalidators = EVENT_REVALIDATORS[key];\n const revalidate = isFunction(options.revalidate) ? options.revalidate(get().data, _k) : options.revalidate !== false;\n if (revalidate) {\n // Invalidate the key by deleting the concurrent request markers so new\n // requests will not be deduped.\n delete FETCH[key];\n delete PRELOAD[key];\n if (revalidators && revalidators[0]) {\n return revalidators[0](MUTATE_EVENT).then(()=>get().data);\n }\n }\n return get().data;\n };\n // If there is no new data provided, revalidate the key with current state.\n if (args.length < 3) {\n // Revalidate and broadcast state.\n return startRevalidate();\n }\n let data = _data;\n let error;\n // Update global timestamps.\n const beforeMutationTs = getTimestamp();\n MUTATION[key] = [\n beforeMutationTs,\n 0\n ];\n const hasOptimisticData = !isUndefined(optimisticData);\n const state = get();\n // `displayedData` is the current value on screen. It could be the optimistic value\n // that is going to be overridden by a `committedData`, or get reverted back.\n // `committedData` is the validated value that comes from a fetch or mutation.\n const displayedData = state.data;\n const currentData = state._c;\n const committedData = isUndefined(currentData) ? displayedData : currentData;\n // Do optimistic data update.\n if (hasOptimisticData) {\n optimisticData = isFunction(optimisticData) ? optimisticData(committedData, displayedData) : optimisticData;\n // When we set optimistic data, backup the current committedData data in `_c`.\n set({\n data: optimisticData,\n _c: committedData\n });\n }\n if (isFunction(data)) {\n // `data` is a function, call it passing current cache value.\n try {\n data = data(committedData);\n } catch (err) {\n // If it throws an error synchronously, we shouldn't update the cache.\n error = err;\n }\n }\n // `data` is a promise/thenable, resolve the final data first.\n if (data && isPromiseLike(data)) {\n // This means that the mutation is async, we need to check timestamps to\n // avoid race conditions.\n data = await data.catch((err)=>{\n error = err;\n });\n // Check if other mutations have occurred since we've started this mutation.\n // If there's a race we don't update cache or broadcast the change,\n // just return the data.\n if (beforeMutationTs !== MUTATION[key][0]) {\n if (error) throw error;\n return data;\n } else if (error && hasOptimisticData && rollbackOnError(error)) {\n // Rollback. Always populate the cache in this case but without\n // transforming the data.\n populateCache = true;\n // Reset data to be the latest committed data, and clear the `_c` value.\n set({\n data: committedData,\n _c: UNDEFINED\n });\n }\n }\n // If we should write back the cache after request.\n if (populateCache) {\n if (!error) {\n // Transform the result into data.\n if (isFunction(populateCache)) {\n const populateCachedData = populateCache(data, committedData);\n set({\n data: populateCachedData,\n error: UNDEFINED,\n _c: UNDEFINED\n });\n } else {\n // Only update cached data and reset the error if there's no error. Data can be `undefined` here.\n set({\n data,\n error: UNDEFINED,\n _c: UNDEFINED\n });\n }\n }\n }\n // Reset the timestamp to mark the mutation has ended.\n MUTATION[key][1] = getTimestamp();\n // Update existing SWR Hooks' internal states:\n Promise.resolve(startRevalidate()).then(()=>{\n // The mutation and revalidation are ended, we can clear it since the data is\n // not an optimistic value anymore.\n set({\n _c: UNDEFINED\n });\n });\n // Throw error or return data\n if (error) {\n if (throwOnError) throw error;\n return;\n }\n return data;\n }\n}\n\nconst revalidateAllKeys = (revalidators, type)=>{\n for(const key in revalidators){\n if (revalidators[key][0]) revalidators[key][0](type);\n }\n};\nconst initCache = (provider, options)=>{\n // The global state for a specific provider will be used to deduplicate\n // requests and store listeners. As well as a mutate function that is bound to\n // the cache.\n // The provider's global state might be already initialized. Let's try to get the\n // global state associated with the provider first.\n if (!SWRGlobalState.has(provider)) {\n const opts = mergeObjects(defaultConfigOptions, options);\n // If there's no global state bound to the provider, create a new one with the\n // new mutate function.\n const EVENT_REVALIDATORS = {};\n const mutate = internalMutate.bind(UNDEFINED, provider);\n let unmount = noop;\n const subscriptions = {};\n const subscribe = (key, callback)=>{\n const subs = subscriptions[key] || [];\n subscriptions[key] = subs;\n subs.push(callback);\n return ()=>subs.splice(subs.indexOf(callback), 1);\n };\n const setter = (key, value, prev)=>{\n provider.set(key, value);\n const subs = subscriptions[key];\n if (subs) {\n for (const fn of subs){\n fn(value, prev);\n }\n }\n };\n const initProvider = ()=>{\n if (!SWRGlobalState.has(provider)) {\n // Update the state if it's new, or if the provider has been extended.\n SWRGlobalState.set(provider, [\n EVENT_REVALIDATORS,\n {},\n {},\n {},\n mutate,\n setter,\n subscribe\n ]);\n if (!IS_SERVER) {\n // When listening to the native events for auto revalidations,\n // we intentionally put a delay (setTimeout) here to make sure they are\n // fired after immediate JavaScript executions, which can be\n // React's state updates.\n // This avoids some unnecessary revalidations such as\n // https://github.com/vercel/swr/issues/1680.\n const releaseFocus = opts.initFocus(setTimeout.bind(UNDEFINED, revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, FOCUS_EVENT)));\n const releaseReconnect = opts.initReconnect(setTimeout.bind(UNDEFINED, revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, RECONNECT_EVENT)));\n unmount = ()=>{\n releaseFocus && releaseFocus();\n releaseReconnect && releaseReconnect();\n // When un-mounting, we need to remove the cache provider from the state\n // storage too because it's a side-effect. Otherwise, when re-mounting we\n // will not re-register those event listeners.\n SWRGlobalState.delete(provider);\n };\n }\n }\n };\n initProvider();\n // This is a new provider, we need to initialize it and setup DOM events\n // listeners for `focus` and `reconnect` actions.\n // We might want to inject an extra layer on top of `provider` in the future,\n // such as key serialization, auto GC, etc.\n // For now, it's just a `Map` interface without any modifications.\n return [\n provider,\n mutate,\n initProvider,\n unmount\n ];\n }\n return [\n provider,\n SWRGlobalState.get(provider)[4]\n ];\n};\n\n// error retry\nconst onErrorRetry = (_, __, config, revalidate, opts)=>{\n const maxRetryCount = config.errorRetryCount;\n const currentRetryCount = opts.retryCount;\n // Exponential backoff\n const timeout = ~~((Math.random() + 0.5) * (1 << (currentRetryCount < 8 ? currentRetryCount : 8))) * config.errorRetryInterval;\n if (!isUndefined(maxRetryCount) && currentRetryCount > maxRetryCount) {\n return;\n }\n setTimeout(revalidate, timeout, opts);\n};\nconst compare = dequal;\n// Default cache provider\nconst [cache, mutate] = initCache(new Map());\n// Default config\nconst defaultConfig = mergeObjects({\n // events\n onLoadingSlow: noop,\n onSuccess: noop,\n onError: noop,\n onErrorRetry,\n onDiscarded: noop,\n // switches\n revalidateOnFocus: true,\n revalidateOnReconnect: true,\n revalidateIfStale: true,\n shouldRetryOnError: true,\n // timeouts\n errorRetryInterval: slowConnection ? 10000 : 5000,\n focusThrottleInterval: 5 * 1000,\n dedupingInterval: 2 * 1000,\n loadingTimeout: slowConnection ? 5000 : 3000,\n // providers\n compare,\n isPaused: ()=>false,\n cache,\n mutate,\n fallback: {}\n}, // use web preset by default\npreset);\n\nconst mergeConfigs = (a, b)=>{\n // Need to create a new object to avoid mutating the original here.\n const v = mergeObjects(a, b);\n // If two configs are provided, merge their `use` and `fallback` options.\n if (b) {\n const { use: u1, fallback: f1 } = a;\n const { use: u2, fallback: f2 } = b;\n if (u1 && u2) {\n v.use = u1.concat(u2);\n }\n if (f1 && f2) {\n v.fallback = mergeObjects(f1, f2);\n }\n }\n return v;\n};\n\nconst SWRConfigContext = createContext({});\nconst SWRConfig = (props)=>{\n const { value } = props;\n const parentConfig = useContext(SWRConfigContext);\n const isFunctionalConfig = isFunction(value);\n const config = useMemo(()=>isFunctionalConfig ? value(parentConfig) : value, [\n isFunctionalConfig,\n parentConfig,\n value\n ]);\n // Extend parent context values and middleware.\n const extendedConfig = useMemo(()=>isFunctionalConfig ? config : mergeConfigs(parentConfig, config), [\n isFunctionalConfig,\n parentConfig,\n config\n ]);\n // Should not use the inherited provider.\n const provider = config && config.provider;\n // initialize the cache only on first access.\n const cacheContextRef = useRef(UNDEFINED);\n if (provider && !cacheContextRef.current) {\n cacheContextRef.current = initCache(provider(extendedConfig.cache || cache), config);\n }\n const cacheContext = cacheContextRef.current;\n // Override the cache if a new provider is given.\n if (cacheContext) {\n extendedConfig.cache = cacheContext[0];\n extendedConfig.mutate = cacheContext[1];\n }\n // Unsubscribe events.\n useIsomorphicLayoutEffect(()=>{\n if (cacheContext) {\n cacheContext[2] && cacheContext[2]();\n return cacheContext[3];\n }\n }, []);\n return createElement(SWRConfigContext.Provider, mergeObjects(props, {\n value: extendedConfig\n }));\n};\n\nexport { noop as A, isPromiseLike as B, IS_REACT_LEGACY as I, OBJECT as O, SWRConfigContext as S, UNDEFINED as U, isFunction as a, SWRGlobalState as b, cache as c, defaultConfig as d, isUndefined as e, mergeConfigs as f, SWRConfig as g, events as h, isWindowDefined as i, initCache as j, mutate as k, compare as l, mergeObjects as m, stableHash as n, internalMutate as o, getTimestamp as p, preset as q, defaultConfigOptions as r, serialize as s, IS_SERVER as t, rAF as u, useIsomorphicLayoutEffect as v, slowConnection as w, isDocumentDefined as x, hasRequestAnimationFrame as y, createCacheHelper as z };\n","import { i as isWindowDefined, a as isFunction, m as mergeObjects, S as SWRConfigContext, d as defaultConfig, s as serialize, b as SWRGlobalState, c as cache, e as isUndefined, f as mergeConfigs } from './config-context-client-x_C9_NWC.mjs';\nexport { I as IS_REACT_LEGACY, t as IS_SERVER, O as OBJECT, g as SWRConfig, U as UNDEFINED, l as compare, z as createCacheHelper, r as defaultConfigOptions, p as getTimestamp, y as hasRequestAnimationFrame, j as initCache, o as internalMutate, x as isDocumentDefined, B as isPromiseLike, k as mutate, A as noop, q as preset, u as rAF, h as revalidateEvents, w as slowConnection, n as stableHash, v as useIsomorphicLayoutEffect } from './config-context-client-x_C9_NWC.mjs';\nimport React, { useContext } from 'react';\n\nconst INFINITE_PREFIX = '$inf$';\n\n// @ts-expect-error\nconst enableDevtools = isWindowDefined && window.__SWR_DEVTOOLS_USE__;\nconst use = enableDevtools ? window.__SWR_DEVTOOLS_USE__ : [];\nconst setupDevTools = ()=>{\n if (enableDevtools) {\n // @ts-expect-error\n window.__SWR_DEVTOOLS_REACT__ = React;\n }\n};\n\nconst normalize = (args)=>{\n return isFunction(args[1]) ? [\n args[0],\n args[1],\n args[2] || {}\n ] : [\n args[0],\n null,\n (args[1] === null ? args[2] : args[1]) || {}\n ];\n};\n\nconst useSWRConfig = ()=>{\n return mergeObjects(defaultConfig, useContext(SWRConfigContext));\n};\n\nconst preload = (key_, fetcher)=>{\n const [key, fnArg] = serialize(key_);\n const [, , , PRELOAD] = SWRGlobalState.get(cache);\n // Prevent preload to be called multiple times before used.\n if (PRELOAD[key]) return PRELOAD[key];\n const req = fetcher(fnArg);\n PRELOAD[key] = req;\n return req;\n};\nconst middleware = (useSWRNext)=>(key_, fetcher_, config)=>{\n // fetcher might be a sync function, so this should not be an async function\n const fetcher = fetcher_ && ((...args)=>{\n const [key] = serialize(key_);\n const [, , , PRELOAD] = SWRGlobalState.get(cache);\n if (key.startsWith(INFINITE_PREFIX)) {\n // we want the infinite fetcher to be called.\n // handling of the PRELOAD cache happens there.\n return fetcher_(...args);\n }\n const req = PRELOAD[key];\n if (isUndefined(req)) return fetcher_(...args);\n delete PRELOAD[key];\n return req;\n });\n return useSWRNext(key_, fetcher, config);\n };\n\nconst BUILT_IN_MIDDLEWARE = use.concat(middleware);\n\n// It's tricky to pass generic types as parameters, so we just directly override\n// the types here.\nconst withArgs = (hook)=>{\n return function useSWRArgs(...args) {\n // Get the default and inherited configuration.\n const fallbackConfig = useSWRConfig();\n // Normalize arguments.\n const [key, fn, _config] = normalize(args);\n // Merge configurations.\n const config = mergeConfigs(fallbackConfig, _config);\n // Apply middleware\n let next = hook;\n const { use } = config;\n const middleware = (use || []).concat(BUILT_IN_MIDDLEWARE);\n for(let i = middleware.length; i--;){\n next = middleware[i](next);\n }\n return next(key, fn || config.fetcher || null, config);\n };\n};\n\n// Add a callback function to a list of keyed callback functions and return\n// the unsubscribe function.\nconst subscribeCallback = (key, callbacks, callback)=>{\n const keyedRevalidators = callbacks[key] || (callbacks[key] = []);\n keyedRevalidators.push(callback);\n return ()=>{\n const index = keyedRevalidators.indexOf(callback);\n if (index >= 0) {\n // O(1): faster than splice\n keyedRevalidators[index] = keyedRevalidators[keyedRevalidators.length - 1];\n keyedRevalidators.pop();\n }\n };\n};\n\n// Create a custom hook with a middleware\nconst withMiddleware = (useSWR, middleware)=>{\n return (...args)=>{\n const [key, fn, config] = normalize(args);\n const uses = (config.use || []).concat(middleware);\n return useSWR(key, fn, {\n ...config,\n use: uses\n });\n };\n};\n\nsetupDevTools();\n\nexport { INFINITE_PREFIX, SWRGlobalState, cache, defaultConfig, isFunction, isUndefined, isWindowDefined, mergeConfigs, mergeObjects, normalize, preload, serialize, subscribeCallback, useSWRConfig, withArgs, withMiddleware };\n","import React, { useRef, useMemo, useCallback, useDebugValue } from 'react';\nimport { useSyncExternalStore } from 'use-sync-external-store/shim/index.js';\nimport { OBJECT as OBJECT$1, SWRConfig as SWRConfig$1, defaultConfig, withArgs, SWRGlobalState, serialize as serialize$1, createCacheHelper, isUndefined as isUndefined$1, UNDEFINED as UNDEFINED$1, isPromiseLike, getTimestamp, isFunction as isFunction$1, revalidateEvents, internalMutate, useIsomorphicLayoutEffect, subscribeCallback, IS_SERVER, rAF, IS_REACT_LEGACY, mergeObjects } from '../_internal/index.mjs';\nexport { mutate, preload, useSWRConfig } from '../_internal/index.mjs';\n\n// Shared state between server components and client components\nconst noop = ()=>{};\n// Using noop() as the undefined value as undefined can be replaced\n// by something else. Prettier ignore and extra parentheses are necessary here\n// to ensure that tsc doesn't remove the __NOINLINE__ comment.\n// prettier-ignore\nconst UNDEFINED = /*#__NOINLINE__*/ noop();\nconst OBJECT = Object;\nconst isUndefined = (v)=>v === UNDEFINED;\nconst isFunction = (v)=>typeof v == 'function';\n\n// use WeakMap to store the object->key mapping\n// so the objects can be garbage collected.\n// WeakMap uses a hashtable under the hood, so the lookup\n// complexity is almost O(1).\nconst table = new WeakMap();\nconst isObjectType = (value, type)=>OBJECT.prototype.toString.call(value) === `[object ${type}]`;\n// counter of the key\nlet counter = 0;\n// A stable hash implementation that supports:\n// - Fast and ensures unique hash properties\n// - Handles unserializable values\n// - Handles object key ordering\n// - Generates short results\n//\n// This is not a serialization function, and the result is not guaranteed to be\n// parsable.\nconst stableHash = (arg)=>{\n const type = typeof arg;\n const isDate = isObjectType(arg, 'Date');\n const isRegex = isObjectType(arg, 'RegExp');\n const isPlainObject = isObjectType(arg, 'Object');\n let result;\n let index;\n if (OBJECT(arg) === arg && !isDate && !isRegex) {\n // Object/function, not null/date/regexp. Use WeakMap to store the id first.\n // If it's already hashed, directly return the result.\n result = table.get(arg);\n if (result) return result;\n // Store the hash first for circular reference detection before entering the\n // recursive `stableHash` calls.\n // For other objects like set and map, we use this id directly as the hash.\n result = ++counter + '~';\n table.set(arg, result);\n if (Array.isArray(arg)) {\n // Array.\n result = '@';\n for(index = 0; index < arg.length; index++){\n result += stableHash(arg[index]) + ',';\n }\n table.set(arg, result);\n }\n if (isPlainObject) {\n // Object, sort keys.\n result = '#';\n const keys = OBJECT.keys(arg).sort();\n while(!isUndefined(index = keys.pop())){\n if (!isUndefined(arg[index])) {\n result += index + ':' + stableHash(arg[index]) + ',';\n }\n }\n table.set(arg, result);\n }\n } else {\n result = isDate ? arg.toJSON() : type == 'symbol' ? arg.toString() : type == 'string' ? JSON.stringify(arg) : '' + arg;\n }\n return result;\n};\n\nconst serialize = (key)=>{\n if (isFunction(key)) {\n try {\n key = key();\n } catch (err) {\n // dependencies not ready\n key = '';\n }\n }\n // Use the original key as the argument of fetcher. This can be a string or an\n // array of values.\n const args = key;\n // If key is not falsy, or not an empty array, hash it.\n key = typeof key == 'string' ? key : (Array.isArray(key) ? key.length : key) ? stableHash(key) : '';\n return [\n key,\n args\n ];\n};\n\nconst unstable_serialize = (key)=>serialize(key)[0];\n\n/// \nconst use = React.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax\n// and emitting an error.\n// We assume that this is only for the `use(thenable)` case, not `use(context)`.\n// https://github.com/facebook/react/blob/aed00dacfb79d17c53218404c52b1c7aa59c4a89/packages/react-server/src/ReactFizzThenable.js#L45\n((thenable)=>{\n switch(thenable.status){\n case 'pending':\n throw thenable;\n case 'fulfilled':\n return thenable.value;\n case 'rejected':\n throw thenable.reason;\n default:\n thenable.status = 'pending';\n thenable.then((v)=>{\n thenable.status = 'fulfilled';\n thenable.value = v;\n }, (e)=>{\n thenable.status = 'rejected';\n thenable.reason = e;\n });\n throw thenable;\n }\n});\nconst WITH_DEDUPE = {\n dedupe: true\n};\nconst useSWRHandler = (_key, fetcher, config)=>{\n const { cache, compare, suspense, fallbackData, revalidateOnMount, revalidateIfStale, refreshInterval, refreshWhenHidden, refreshWhenOffline, keepPreviousData } = config;\n const [EVENT_REVALIDATORS, MUTATION, FETCH, PRELOAD] = SWRGlobalState.get(cache);\n // `key` is the identifier of the SWR internal state,\n // `fnArg` is the argument/arguments parsed from the key, which will be passed\n // to the fetcher.\n // All of them are derived from `_key`.\n const [key, fnArg] = serialize$1(_key);\n // If it's the initial render of this hook.\n const initialMountedRef = useRef(false);\n // If the hook is unmounted already. This will be used to prevent some effects\n // to be called after unmounting.\n const unmountedRef = useRef(false);\n // Refs to keep the key and config.\n const keyRef = useRef(key);\n const fetcherRef = useRef(fetcher);\n const configRef = useRef(config);\n const getConfig = ()=>configRef.current;\n const isActive = ()=>getConfig().isVisible() && getConfig().isOnline();\n const [getCache, setCache, subscribeCache, getInitialCache] = createCacheHelper(cache, key);\n const stateDependencies = useRef({}).current;\n // Resolve the fallback data from either the inline option, or the global provider.\n // If it's a promise, we simply let React suspend and resolve it for us.\n const fallback = isUndefined$1(fallbackData) ? isUndefined$1(config.fallback) ? UNDEFINED$1 : config.fallback[key] : fallbackData;\n const isEqual = (prev, current)=>{\n for(const _ in stateDependencies){\n const t = _;\n if (t === 'data') {\n if (!compare(prev[t], current[t])) {\n if (!isUndefined$1(prev[t])) {\n return false;\n }\n if (!compare(returnedData, current[t])) {\n return false;\n }\n }\n } else {\n if (current[t] !== prev[t]) {\n return false;\n }\n }\n }\n return true;\n };\n const getSnapshot = useMemo(()=>{\n const shouldStartRequest = (()=>{\n if (!key) return false;\n if (!fetcher) return false;\n // If `revalidateOnMount` is set, we take the value directly.\n if (!isUndefined$1(revalidateOnMount)) return revalidateOnMount;\n // If it's paused, we skip revalidation.\n if (getConfig().isPaused()) return false;\n if (suspense) return false;\n return revalidateIfStale !== false;\n })();\n // Get the cache and merge it with expected states.\n const getSelectedCache = (state)=>{\n // We only select the needed fields from the state.\n const snapshot = mergeObjects(state);\n delete snapshot._k;\n if (!shouldStartRequest) {\n return snapshot;\n }\n return {\n isValidating: true,\n isLoading: true,\n ...snapshot\n };\n };\n const cachedData = getCache();\n const initialData = getInitialCache();\n const clientSnapshot = getSelectedCache(cachedData);\n const serverSnapshot = cachedData === initialData ? clientSnapshot : getSelectedCache(initialData);\n // To make sure that we are returning the same object reference to avoid\n // unnecessary re-renders, we keep the previous snapshot and use deep\n // comparison to check if we need to return a new one.\n let memorizedSnapshot = clientSnapshot;\n return [\n ()=>{\n const newSnapshot = getSelectedCache(getCache());\n const compareResult = isEqual(newSnapshot, memorizedSnapshot);\n if (compareResult) {\n // Mentally, we should always return the `memorizedSnapshot` here\n // as there's no change between the new and old snapshots.\n // However, since the `isEqual` function only compares selected fields,\n // the values of the unselected fields might be changed. That's\n // simply because we didn't track them.\n // To support the case in https://github.com/vercel/swr/pull/2576,\n // we need to update these fields in the `memorizedSnapshot` too\n // with direct mutations to ensure the snapshot is always up-to-date\n // even for the unselected fields, but only trigger re-renders when\n // the selected fields are changed.\n memorizedSnapshot.data = newSnapshot.data;\n memorizedSnapshot.isLoading = newSnapshot.isLoading;\n memorizedSnapshot.isValidating = newSnapshot.isValidating;\n memorizedSnapshot.error = newSnapshot.error;\n return memorizedSnapshot;\n } else {\n memorizedSnapshot = newSnapshot;\n return newSnapshot;\n }\n },\n ()=>serverSnapshot\n ];\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n cache,\n key\n ]);\n // Get the current state that SWR should return.\n const cached = useSyncExternalStore(useCallback((callback)=>subscribeCache(key, (current, prev)=>{\n if (!isEqual(prev, current)) callback();\n }), // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n cache,\n key\n ]), getSnapshot[0], getSnapshot[1]);\n const isInitialMount = !initialMountedRef.current;\n const hasRevalidator = EVENT_REVALIDATORS[key] && EVENT_REVALIDATORS[key].length > 0;\n const cachedData = cached.data;\n const data = isUndefined$1(cachedData) ? fallback && isPromiseLike(fallback) ? use(fallback) : fallback : cachedData;\n const error = cached.error;\n // Use a ref to store previously returned data. Use the initial data as its initial value.\n const laggyDataRef = useRef(data);\n const returnedData = keepPreviousData ? isUndefined$1(cachedData) ? laggyDataRef.current : cachedData : data;\n // - Suspense mode and there's stale data for the initial render.\n // - Not suspense mode and there is no fallback data and `revalidateIfStale` is enabled.\n // - `revalidateIfStale` is enabled but `data` is not defined.\n const shouldDoInitialRevalidation = (()=>{\n // if a key already has revalidators and also has error, we should not trigger revalidation\n if (hasRevalidator && !isUndefined$1(error)) return false;\n // If `revalidateOnMount` is set, we take the value directly.\n if (isInitialMount && !isUndefined$1(revalidateOnMount)) return revalidateOnMount;\n // If it's paused, we skip revalidation.\n if (getConfig().isPaused()) return false;\n // Under suspense mode, it will always fetch on render if there is no\n // stale data so no need to revalidate immediately mount it again.\n // If data exists, only revalidate if `revalidateIfStale` is true.\n if (suspense) return isUndefined$1(data) ? false : revalidateIfStale;\n // If there is no stale data, we need to revalidate when mount;\n // If `revalidateIfStale` is set to true, we will always revalidate.\n return isUndefined$1(data) || revalidateIfStale;\n })();\n // Resolve the default validating state:\n // If it's able to validate, and it should revalidate when mount, this will be true.\n const defaultValidatingState = !!(key && fetcher && isInitialMount && shouldDoInitialRevalidation);\n const isValidating = isUndefined$1(cached.isValidating) ? defaultValidatingState : cached.isValidating;\n const isLoading = isUndefined$1(cached.isLoading) ? defaultValidatingState : cached.isLoading;\n // The revalidation function is a carefully crafted wrapper of the original\n // `fetcher`, to correctly handle the many edge cases.\n const revalidate = useCallback(async (revalidateOpts)=>{\n const currentFetcher = fetcherRef.current;\n if (!key || !currentFetcher || unmountedRef.current || getConfig().isPaused()) {\n return false;\n }\n let newData;\n let startAt;\n let loading = true;\n const opts = revalidateOpts || {};\n // If there is no ongoing concurrent request, or `dedupe` is not set, a\n // new request should be initiated.\n const shouldStartNewRequest = !FETCH[key] || !opts.dedupe;\n /*\n For React 17\n Do unmount check for calls:\n If key has changed during the revalidation, or the component has been\n unmounted, old dispatch and old event callbacks should not take any\n effect\n\n For React 18\n only check if key has changed\n https://github.com/reactwg/react-18/discussions/82\n */ const callbackSafeguard = ()=>{\n if (IS_REACT_LEGACY) {\n return !unmountedRef.current && key === keyRef.current && initialMountedRef.current;\n }\n return key === keyRef.current;\n };\n // The final state object when the request finishes.\n const finalState = {\n isValidating: false,\n isLoading: false\n };\n const finishRequestAndUpdateState = ()=>{\n setCache(finalState);\n };\n const cleanupState = ()=>{\n // Check if it's still the same request before deleting it.\n const requestInfo = FETCH[key];\n if (requestInfo && requestInfo[1] === startAt) {\n delete FETCH[key];\n }\n };\n // Start fetching. Change the `isValidating` state, update the cache.\n const initialState = {\n isValidating: true\n };\n // It is in the `isLoading` state, if and only if there is no cached data.\n // This bypasses fallback data and laggy data.\n if (isUndefined$1(getCache().data)) {\n initialState.isLoading = true;\n }\n try {\n if (shouldStartNewRequest) {\n setCache(initialState);\n // If no cache is being rendered currently (it shows a blank page),\n // we trigger the loading slow event.\n if (config.loadingTimeout && isUndefined$1(getCache().data)) {\n setTimeout(()=>{\n if (loading && callbackSafeguard()) {\n getConfig().onLoadingSlow(key, config);\n }\n }, config.loadingTimeout);\n }\n // Start the request and save the timestamp.\n // Key must be truthy if entering here.\n FETCH[key] = [\n currentFetcher(fnArg),\n getTimestamp()\n ];\n }\n // Wait until the ongoing request is done. Deduplication is also\n // considered here.\n ;\n [newData, startAt] = FETCH[key];\n newData = await newData;\n if (shouldStartNewRequest) {\n // If the request isn't interrupted, clean it up after the\n // deduplication interval.\n setTimeout(cleanupState, config.dedupingInterval);\n }\n // If there're other ongoing request(s), started after the current one,\n // we need to ignore the current one to avoid possible race conditions:\n // req1------------------>res1 (current one)\n // req2---------------->res2\n // the request that fired later will always be kept.\n // The timestamp maybe be `undefined` or a number\n if (!FETCH[key] || FETCH[key][1] !== startAt) {\n if (shouldStartNewRequest) {\n if (callbackSafeguard()) {\n getConfig().onDiscarded(key);\n }\n }\n return false;\n }\n // Clear error.\n finalState.error = UNDEFINED$1;\n // If there're other mutations(s), that overlapped with the current revalidation:\n // case 1:\n // req------------------>res\n // mutate------>end\n // case 2:\n // req------------>res\n // mutate------>end\n // case 3:\n // req------------------>res\n // mutate-------...---------->\n // we have to ignore the revalidation result (res) because it's no longer fresh.\n // meanwhile, a new revalidation should be triggered when the mutation ends.\n const mutationInfo = MUTATION[key];\n if (!isUndefined$1(mutationInfo) && // case 1\n (startAt <= mutationInfo[0] || // case 2\n startAt <= mutationInfo[1] || // case 3\n mutationInfo[1] === 0)) {\n finishRequestAndUpdateState();\n if (shouldStartNewRequest) {\n if (callbackSafeguard()) {\n getConfig().onDiscarded(key);\n }\n }\n return false;\n }\n // Deep compare with the latest state to avoid extra re-renders.\n // For local state, compare and assign.\n const cacheData = getCache().data;\n // Since the compare fn could be custom fn\n // cacheData might be different from newData even when compare fn returns True\n finalState.data = compare(cacheData, newData) ? cacheData : newData;\n // Trigger the successful callback if it's the original request.\n if (shouldStartNewRequest) {\n if (callbackSafeguard()) {\n getConfig().onSuccess(newData, key, config);\n }\n }\n } catch (err) {\n cleanupState();\n const currentConfig = getConfig();\n const { shouldRetryOnError } = currentConfig;\n // Not paused, we continue handling the error. Otherwise, discard it.\n if (!currentConfig.isPaused()) {\n // Get a new error, don't use deep comparison for errors.\n finalState.error = err;\n // Error event and retry logic. Only for the actual request, not\n // deduped ones.\n if (shouldStartNewRequest && callbackSafeguard()) {\n currentConfig.onError(err, key, currentConfig);\n if (shouldRetryOnError === true || isFunction$1(shouldRetryOnError) && shouldRetryOnError(err)) {\n if (!getConfig().revalidateOnFocus || !getConfig().revalidateOnReconnect || isActive()) {\n // If it's inactive, stop. It will auto-revalidate when\n // refocusing or reconnecting.\n // When retrying, deduplication is always enabled.\n currentConfig.onErrorRetry(err, key, currentConfig, (_opts)=>{\n const revalidators = EVENT_REVALIDATORS[key];\n if (revalidators && revalidators[0]) {\n revalidators[0](revalidateEvents.ERROR_REVALIDATE_EVENT, _opts);\n }\n }, {\n retryCount: (opts.retryCount || 0) + 1,\n dedupe: true\n });\n }\n }\n }\n }\n }\n // Mark loading as stopped.\n loading = false;\n // Update the current hook's state.\n finishRequestAndUpdateState();\n return true;\n }, // `setState` is immutable, and `eventsCallback`, `fnArg`, and\n // `keyValidating` are depending on `key`, so we can exclude them from\n // the deps array.\n //\n // FIXME:\n // `fn` and `config` might be changed during the lifecycle,\n // but they might be changed every render like this.\n // `useSWR('key', () => fetch('/api/'), { suspense: true })`\n // So we omit the values from the deps array\n // even though it might cause unexpected behaviors.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n key,\n cache\n ]);\n // Similar to the global mutate but bound to the current cache and key.\n // `cache` isn't allowed to change during the lifecycle.\n const boundMutate = useCallback(// Use callback to make sure `keyRef.current` returns latest result every time\n (...args)=>{\n return internalMutate(cache, keyRef.current, ...args);\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n []);\n // The logic for updating refs.\n useIsomorphicLayoutEffect(()=>{\n fetcherRef.current = fetcher;\n configRef.current = config;\n // Handle laggy data updates. If there's cached data of the current key,\n // it'll be the correct reference.\n if (!isUndefined$1(cachedData)) {\n laggyDataRef.current = cachedData;\n }\n });\n // After mounted or key changed.\n useIsomorphicLayoutEffect(()=>{\n if (!key) return;\n const softRevalidate = revalidate.bind(UNDEFINED$1, WITH_DEDUPE);\n // Expose revalidators to global event listeners. So we can trigger\n // revalidation from the outside.\n let nextFocusRevalidatedAt = 0;\n const onRevalidate = (type, opts = {})=>{\n if (type == revalidateEvents.FOCUS_EVENT) {\n const now = Date.now();\n if (getConfig().revalidateOnFocus && now > nextFocusRevalidatedAt && isActive()) {\n nextFocusRevalidatedAt = now + getConfig().focusThrottleInterval;\n softRevalidate();\n }\n } else if (type == revalidateEvents.RECONNECT_EVENT) {\n if (getConfig().revalidateOnReconnect && isActive()) {\n softRevalidate();\n }\n } else if (type == revalidateEvents.MUTATE_EVENT) {\n return revalidate();\n } else if (type == revalidateEvents.ERROR_REVALIDATE_EVENT) {\n return revalidate(opts);\n }\n return;\n };\n const unsubEvents = subscribeCallback(key, EVENT_REVALIDATORS, onRevalidate);\n // Mark the component as mounted and update corresponding refs.\n unmountedRef.current = false;\n keyRef.current = key;\n initialMountedRef.current = true;\n // Keep the original key in the cache.\n setCache({\n _k: fnArg\n });\n // Trigger a revalidation\n if (shouldDoInitialRevalidation) {\n if (isUndefined$1(data) || IS_SERVER) {\n // Revalidate immediately.\n softRevalidate();\n } else {\n // Delay the revalidate if we have data to return so we won't block\n // rendering.\n rAF(softRevalidate);\n }\n }\n return ()=>{\n // Mark it as unmounted.\n unmountedRef.current = true;\n unsubEvents();\n };\n }, [\n key\n ]);\n // Polling\n useIsomorphicLayoutEffect(()=>{\n let timer;\n function next() {\n // Use the passed interval\n // ...or invoke the function with the updated data to get the interval\n const interval = isFunction$1(refreshInterval) ? refreshInterval(getCache().data) : refreshInterval;\n // We only start the next interval if `refreshInterval` is not 0, and:\n // - `force` is true, which is the start of polling\n // - or `timer` is not 0, which means the effect wasn't canceled\n if (interval && timer !== -1) {\n timer = setTimeout(execute, interval);\n }\n }\n function execute() {\n // Check if it's OK to execute:\n // Only revalidate when the page is visible, online, and not errored.\n if (!getCache().error && (refreshWhenHidden || getConfig().isVisible()) && (refreshWhenOffline || getConfig().isOnline())) {\n revalidate(WITH_DEDUPE).then(next);\n } else {\n // Schedule the next interval to check again.\n next();\n }\n }\n next();\n return ()=>{\n if (timer) {\n clearTimeout(timer);\n timer = -1;\n }\n };\n }, [\n refreshInterval,\n refreshWhenHidden,\n refreshWhenOffline,\n key\n ]);\n // Display debug info in React DevTools.\n useDebugValue(returnedData);\n // In Suspense mode, we can't return the empty `data` state.\n // If there is an `error`, the `error` needs to be thrown to the error boundary.\n // If there is no `error`, the `revalidation` promise needs to be thrown to\n // the suspense boundary.\n if (suspense && isUndefined$1(data) && key) {\n // SWR should throw when trying to use Suspense on the server with React 18,\n // without providing any fallback data. This causes hydration errors. See:\n // https://github.com/vercel/swr/issues/1832\n if (!IS_REACT_LEGACY && IS_SERVER) {\n throw new Error('Fallback data is required when using Suspense in SSR.');\n }\n // Always update fetcher and config refs even with the Suspense mode.\n fetcherRef.current = fetcher;\n configRef.current = config;\n unmountedRef.current = false;\n const req = PRELOAD[key];\n if (!isUndefined$1(req)) {\n const promise = boundMutate(req);\n use(promise);\n }\n if (isUndefined$1(error)) {\n const promise = revalidate(WITH_DEDUPE);\n if (!isUndefined$1(returnedData)) {\n promise.status = 'fulfilled';\n promise.value = true;\n }\n use(promise);\n } else {\n throw error;\n }\n }\n return {\n mutate: boundMutate,\n get data () {\n stateDependencies.data = true;\n return returnedData;\n },\n get error () {\n stateDependencies.error = true;\n return error;\n },\n get isValidating () {\n stateDependencies.isValidating = true;\n return isValidating;\n },\n get isLoading () {\n stateDependencies.isLoading = true;\n return isLoading;\n }\n };\n};\nconst SWRConfig = OBJECT$1.defineProperty(SWRConfig$1, 'defaultValue', {\n value: defaultConfig\n});\n/**\n * A hook to fetch data.\n *\n * @link https://swr.vercel.app\n * @example\n * ```jsx\n * import useSWR from 'swr'\n * function Profile() {\n * const { data, error, isLoading } = useSWR('/api/user', fetcher)\n * if (error) return
failed to load
\n * if (isLoading) return
loading...
\n * return
hello {data.name}!
\n * }\n * ```\n */ const useSWR = withArgs(useSWRHandler);\n\n// useSWR\n\nexport { SWRConfig, useSWR as default, unstable_serialize };\n","import { useRef, useCallback } from 'react';\nimport useSWR from '../index/index.mjs';\nimport { withMiddleware, SWRGlobalState, cache, INFINITE_PREFIX as INFINITE_PREFIX$1, createCacheHelper, isUndefined as isUndefined$1, useIsomorphicLayoutEffect, UNDEFINED as UNDEFINED$1, serialize as serialize$1, isFunction as isFunction$1 } from '../_internal/index.mjs';\nimport { useSyncExternalStore } from 'use-sync-external-store/shim/index.js';\n\n// Shared state between server components and client components\nconst noop = ()=>{};\n// Using noop() as the undefined value as undefined can be replaced\n// by something else. Prettier ignore and extra parentheses are necessary here\n// to ensure that tsc doesn't remove the __NOINLINE__ comment.\n// prettier-ignore\nconst UNDEFINED = /*#__NOINLINE__*/ noop();\nconst OBJECT = Object;\nconst isUndefined = (v)=>v === UNDEFINED;\nconst isFunction = (v)=>typeof v == 'function';\n\n// use WeakMap to store the object->key mapping\n// so the objects can be garbage collected.\n// WeakMap uses a hashtable under the hood, so the lookup\n// complexity is almost O(1).\nconst table = new WeakMap();\nconst isObjectType = (value, type)=>OBJECT.prototype.toString.call(value) === `[object ${type}]`;\n// counter of the key\nlet counter = 0;\n// A stable hash implementation that supports:\n// - Fast and ensures unique hash properties\n// - Handles unserializable values\n// - Handles object key ordering\n// - Generates short results\n//\n// This is not a serialization function, and the result is not guaranteed to be\n// parsable.\nconst stableHash = (arg)=>{\n const type = typeof arg;\n const isDate = isObjectType(arg, 'Date');\n const isRegex = isObjectType(arg, 'RegExp');\n const isPlainObject = isObjectType(arg, 'Object');\n let result;\n let index;\n if (OBJECT(arg) === arg && !isDate && !isRegex) {\n // Object/function, not null/date/regexp. Use WeakMap to store the id first.\n // If it's already hashed, directly return the result.\n result = table.get(arg);\n if (result) return result;\n // Store the hash first for circular reference detection before entering the\n // recursive `stableHash` calls.\n // For other objects like set and map, we use this id directly as the hash.\n result = ++counter + '~';\n table.set(arg, result);\n if (Array.isArray(arg)) {\n // Array.\n result = '@';\n for(index = 0; index < arg.length; index++){\n result += stableHash(arg[index]) + ',';\n }\n table.set(arg, result);\n }\n if (isPlainObject) {\n // Object, sort keys.\n result = '#';\n const keys = OBJECT.keys(arg).sort();\n while(!isUndefined(index = keys.pop())){\n if (!isUndefined(arg[index])) {\n result += index + ':' + stableHash(arg[index]) + ',';\n }\n }\n table.set(arg, result);\n }\n } else {\n result = isDate ? arg.toJSON() : type == 'symbol' ? arg.toString() : type == 'string' ? JSON.stringify(arg) : '' + arg;\n }\n return result;\n};\n\nconst serialize = (key)=>{\n if (isFunction(key)) {\n try {\n key = key();\n } catch (err) {\n // dependencies not ready\n key = '';\n }\n }\n // Use the original key as the argument of fetcher. This can be a string or an\n // array of values.\n const args = key;\n // If key is not falsy, or not an empty array, hash it.\n key = typeof key == 'string' ? key : (Array.isArray(key) ? key.length : key) ? stableHash(key) : '';\n return [\n key,\n args\n ];\n};\n\nconst INFINITE_PREFIX = '$inf$';\n\nconst getFirstPageKey = (getKey)=>{\n return serialize(getKey ? getKey(0, null) : null)[0];\n};\nconst unstable_serialize = (getKey)=>{\n return INFINITE_PREFIX + getFirstPageKey(getKey);\n};\n\n// We have to several type castings here because `useSWRInfinite` is a special\n// hook where `key` and return type are not like the normal `useSWR` types.\nconst EMPTY_PROMISE = Promise.resolve();\nconst infinite = (useSWRNext)=>(getKey, fn, config)=>{\n const didMountRef = useRef(false);\n const { cache: cache$1, initialSize = 1, revalidateAll = false, persistSize = false, revalidateFirstPage = true, revalidateOnMount = false, parallel = false } = config;\n const [, , , PRELOAD] = SWRGlobalState.get(cache);\n // The serialized key of the first page. This key will be used to store\n // metadata of this SWR infinite hook.\n let infiniteKey;\n try {\n infiniteKey = getFirstPageKey(getKey);\n if (infiniteKey) infiniteKey = INFINITE_PREFIX$1 + infiniteKey;\n } catch (err) {\n // Not ready yet.\n }\n const [get, set, subscribeCache] = createCacheHelper(cache$1, infiniteKey);\n const getSnapshot = useCallback(()=>{\n const size = isUndefined$1(get()._l) ? initialSize : get()._l;\n return size;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n cache$1,\n infiniteKey,\n initialSize\n ]);\n useSyncExternalStore(useCallback((callback)=>{\n if (infiniteKey) return subscribeCache(infiniteKey, ()=>{\n callback();\n });\n return ()=>{};\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n cache$1,\n infiniteKey\n ]), getSnapshot, getSnapshot);\n const resolvePageSize = useCallback(()=>{\n const cachedPageSize = get()._l;\n return isUndefined$1(cachedPageSize) ? initialSize : cachedPageSize;\n // `cache` isn't allowed to change during the lifecycle\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n infiniteKey,\n initialSize\n ]);\n // keep the last page size to restore it with the persistSize option\n const lastPageSizeRef = useRef(resolvePageSize());\n // When the page key changes, we reset the page size if it's not persisted\n useIsomorphicLayoutEffect(()=>{\n if (!didMountRef.current) {\n didMountRef.current = true;\n return;\n }\n if (infiniteKey) {\n // If the key has been changed, we keep the current page size if persistSize is enabled\n // Otherwise, we reset the page size to cached pageSize\n set({\n _l: persistSize ? lastPageSizeRef.current : resolvePageSize()\n });\n }\n // `initialSize` isn't allowed to change during the lifecycle\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n infiniteKey,\n cache$1\n ]);\n // Needs to check didMountRef during mounting, not in the fetcher\n const shouldRevalidateOnMount = revalidateOnMount && !didMountRef.current;\n // Actual SWR hook to load all pages in one fetcher.\n const swr = useSWRNext(infiniteKey, async (key)=>{\n // get the revalidate context\n const forceRevalidateAll = get()._i;\n const shouldRevalidatePage = get()._r;\n set({\n _r: UNDEFINED$1\n });\n // return an array of page data\n const data = [];\n const pageSize = resolvePageSize();\n const [getCache] = createCacheHelper(cache$1, key);\n const cacheData = getCache().data;\n const revalidators = [];\n let previousPageData = null;\n for(let i = 0; i < pageSize; ++i){\n const [pageKey, pageArg] = serialize$1(getKey(i, parallel ? null : previousPageData));\n if (!pageKey) {\n break;\n }\n const [getSWRCache, setSWRCache] = createCacheHelper(cache$1, pageKey);\n // Get the cached page data.\n let pageData = getSWRCache().data;\n // should fetch (or revalidate) if:\n // - `revalidateAll` is enabled\n // - `mutate()` called\n // - the cache is missing\n // - it's the first page and it's not the initial render\n // - `revalidateOnMount` is enabled and it's on mount\n // - cache for that page has changed\n const shouldFetchPage = revalidateAll || forceRevalidateAll || isUndefined$1(pageData) || revalidateFirstPage && !i && !isUndefined$1(cacheData) || shouldRevalidateOnMount || cacheData && !isUndefined$1(cacheData[i]) && !config.compare(cacheData[i], pageData);\n if (fn && (typeof shouldRevalidatePage === 'function' ? shouldRevalidatePage(pageData, pageArg) : shouldFetchPage)) {\n const revalidate = async ()=>{\n const hasPreloadedRequest = pageKey in PRELOAD;\n if (!hasPreloadedRequest) {\n pageData = await fn(pageArg);\n } else {\n const req = PRELOAD[pageKey];\n // delete the preload cache key before resolving it\n // in case there's an error\n delete PRELOAD[pageKey];\n // get the page data from the preload cache\n pageData = await req;\n }\n setSWRCache({\n data: pageData,\n _k: pageArg\n });\n data[i] = pageData;\n };\n if (parallel) {\n revalidators.push(revalidate);\n } else {\n await revalidate();\n }\n } else {\n data[i] = pageData;\n }\n if (!parallel) {\n previousPageData = pageData;\n }\n }\n // flush all revalidateions in parallel\n if (parallel) {\n await Promise.all(revalidators.map((r)=>r()));\n }\n // once we executed the data fetching based on the context, clear the context\n set({\n _i: UNDEFINED$1\n });\n // return the data\n return data;\n }, config);\n const mutate = useCallback(// eslint-disable-next-line func-names\n function(data, opts) {\n // When passing as a boolean, it's explicitly used to disable/enable\n // revalidation.\n const options = typeof opts === 'boolean' ? {\n revalidate: opts\n } : opts || {};\n // Default to true.\n const shouldRevalidate = options.revalidate !== false;\n // It is possible that the key is still falsy.\n if (!infiniteKey) return EMPTY_PROMISE;\n if (shouldRevalidate) {\n if (!isUndefined$1(data)) {\n // We only revalidate the pages that are changed\n set({\n _i: false,\n _r: options.revalidate\n });\n } else {\n // Calling `mutate()`, we revalidate all pages\n set({\n _i: true,\n _r: options.revalidate\n });\n }\n }\n return arguments.length ? swr.mutate(data, {\n ...options,\n revalidate: shouldRevalidate\n }) : swr.mutate();\n }, // swr.mutate is always the same reference\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n infiniteKey,\n cache$1\n ]);\n // Extend the SWR API\n const setSize = useCallback((arg)=>{\n // It is possible that the key is still falsy.\n if (!infiniteKey) return EMPTY_PROMISE;\n const [, changeSize] = createCacheHelper(cache$1, infiniteKey);\n let size;\n if (isFunction$1(arg)) {\n size = arg(resolvePageSize());\n } else if (typeof arg == 'number') {\n size = arg;\n }\n if (typeof size != 'number') return EMPTY_PROMISE;\n changeSize({\n _l: size\n });\n lastPageSizeRef.current = size;\n // Calculate the page data after the size change.\n const data = [];\n const [getInfiniteCache] = createCacheHelper(cache$1, infiniteKey);\n let previousPageData = null;\n for(let i = 0; i < size; ++i){\n const [pageKey] = serialize$1(getKey(i, previousPageData));\n const [getCache] = createCacheHelper(cache$1, pageKey);\n // Get the cached page data.\n const pageData = pageKey ? getCache().data : UNDEFINED$1;\n // Call `mutate` with infinte cache data if we can't get it from the page cache.\n if (isUndefined$1(pageData)) {\n return mutate(getInfiniteCache().data);\n }\n data.push(pageData);\n previousPageData = pageData;\n }\n return mutate(data);\n }, // exclude getKey from the dependencies, which isn't allowed to change during the lifecycle\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n infiniteKey,\n cache$1,\n mutate,\n resolvePageSize\n ]);\n // Use getter functions to avoid unnecessary re-renders caused by triggering\n // all the getters of the returned swr object.\n return {\n size: resolvePageSize(),\n setSize,\n mutate,\n get data () {\n return swr.data;\n },\n get error () {\n return swr.error;\n },\n get isValidating () {\n return swr.isValidating;\n },\n get isLoading () {\n return swr.isLoading;\n }\n };\n };\nconst useSWRInfinite = withMiddleware(useSWR, infinite);\n\nexport { useSWRInfinite as default, infinite, unstable_serialize };\n","var has = Object.prototype.hasOwnProperty;\n\nfunction find(iter, tar, key) {\n\tfor (key of iter.keys()) {\n\t\tif (dequal(key, tar)) return key;\n\t}\n}\n\nexport function dequal(foo, bar) {\n\tvar ctor, len, tmp;\n\tif (foo === bar) return true;\n\n\tif (foo && bar && (ctor=foo.constructor) === bar.constructor) {\n\t\tif (ctor === Date) return foo.getTime() === bar.getTime();\n\t\tif (ctor === RegExp) return foo.toString() === bar.toString();\n\n\t\tif (ctor === Array) {\n\t\t\tif ((len=foo.length) === bar.length) {\n\t\t\t\twhile (len-- && dequal(foo[len], bar[len]));\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (ctor === Set) {\n\t\t\tif (foo.size !== bar.size) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (len of foo) {\n\t\t\t\ttmp = len;\n\t\t\t\tif (tmp && typeof tmp === 'object') {\n\t\t\t\t\ttmp = find(bar, tmp);\n\t\t\t\t\tif (!tmp) return false;\n\t\t\t\t}\n\t\t\t\tif (!bar.has(tmp)) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tif (ctor === Map) {\n\t\t\tif (foo.size !== bar.size) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (len of foo) {\n\t\t\t\ttmp = len[0];\n\t\t\t\tif (tmp && typeof tmp === 'object') {\n\t\t\t\t\ttmp = find(bar, tmp);\n\t\t\t\t\tif (!tmp) return false;\n\t\t\t\t}\n\t\t\t\tif (!dequal(len[1], bar.get(tmp))) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tif (ctor === ArrayBuffer) {\n\t\t\tfoo = new Uint8Array(foo);\n\t\t\tbar = new Uint8Array(bar);\n\t\t} else if (ctor === DataView) {\n\t\t\tif ((len=foo.byteLength) === bar.byteLength) {\n\t\t\t\twhile (len-- && foo.getInt8(len) === bar.getInt8(len));\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (ArrayBuffer.isView(foo)) {\n\t\t\tif ((len=foo.byteLength) === bar.byteLength) {\n\t\t\t\twhile (len-- && foo[len] === bar[len]);\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (!ctor || typeof foo === 'object') {\n\t\t\tlen = 0;\n\t\t\tfor (ctor in foo) {\n\t\t\t\tif (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;\n\t\t\t\tif (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;\n\t\t\t}\n\t\t\treturn Object.keys(bar).length === len;\n\t\t}\n\t}\n\n\treturn foo !== foo && bar !== bar;\n}\n","import {\n eventMethodCalled\n} from \"../chunk-TUVJ3GI6.mjs\";\nimport {\n createDeferredPromise\n} from \"../chunk-BS4QFUKM.mjs\";\nimport \"../chunk-7FNX7RWY.mjs\";\nimport {\n ClerkRuntimeError,\n isClerkAPIResponseError,\n isClerkRuntimeError\n} from \"../chunk-DL452J2I.mjs\";\nimport {\n isReverificationHint,\n reverificationError\n} from \"../chunk-5C3LHKBE.mjs\";\nimport {\n validateReverificationConfig\n} from \"../chunk-X3VKQCBG.mjs\";\nimport {\n __export,\n __reExport\n} from \"../chunk-7ELT755Q.mjs\";\n\n// src/react/hooks/createContextAndHook.ts\nimport React from \"react\";\nfunction assertContextExists(contextVal, msgOrCtx) {\n if (!contextVal) {\n throw typeof msgOrCtx === \"string\" ? new Error(msgOrCtx) : new Error(`${msgOrCtx.displayName} not found`);\n }\n}\nvar createContextAndHook = (displayName, options) => {\n const { assertCtxFn = assertContextExists } = options || {};\n const Ctx = React.createContext(void 0);\n Ctx.displayName = displayName;\n const useCtx = () => {\n const ctx = React.useContext(Ctx);\n assertCtxFn(ctx, `${displayName} not found`);\n return ctx.value;\n };\n const useCtxWithoutGuarantee = () => {\n const ctx = React.useContext(Ctx);\n return ctx ? ctx.value : {};\n };\n return [Ctx, useCtx, useCtxWithoutGuarantee];\n};\n\n// src/react/contexts.tsx\nimport React2 from \"react\";\n\n// src/react/clerk-swr.ts\nvar clerk_swr_exports = {};\n__export(clerk_swr_exports, {\n SWRConfig: () => SWRConfig,\n useSWR: () => default2,\n useSWRInfinite: () => default3\n});\n__reExport(clerk_swr_exports, swr_star);\nimport * as swr_star from \"swr\";\nimport { default as default2, SWRConfig } from \"swr\";\nimport { default as default3 } from \"swr/infinite\";\n\n// src/react/contexts.tsx\nvar [ClerkInstanceContext, useClerkInstanceContext] = createContextAndHook(\"ClerkInstanceContext\");\nvar [UserContext, useUserContext] = createContextAndHook(\"UserContext\");\nvar [ClientContext, useClientContext] = createContextAndHook(\"ClientContext\");\nvar [SessionContext, useSessionContext] = createContextAndHook(\n \"SessionContext\"\n);\nvar OptionsContext = React2.createContext({});\nfunction useOptionsContext() {\n const context = React2.useContext(OptionsContext);\n if (context === void 0) {\n throw new Error(\"useOptions must be used within an OptionsContext\");\n }\n return context;\n}\nvar [OrganizationContextInternal, useOrganizationContext] = createContextAndHook(\"OrganizationContext\");\nvar OrganizationProvider = ({\n children,\n organization,\n swrConfig\n}) => {\n return /* @__PURE__ */ React2.createElement(SWRConfig, { value: swrConfig }, /* @__PURE__ */ React2.createElement(\n OrganizationContextInternal.Provider,\n {\n value: {\n value: { organization }\n }\n },\n children\n ));\n};\nfunction useAssertWrappedByClerkProvider(displayNameOrFn) {\n const ctx = React2.useContext(ClerkInstanceContext);\n if (!ctx) {\n if (typeof displayNameOrFn === \"function\") {\n displayNameOrFn();\n return;\n }\n throw new Error(\n `${displayNameOrFn} can only be used within the component.\n\nPossible fixes:\n1. Ensure that the is correctly wrapping your application where this component is used.\n2. Check for multiple versions of the \\`@clerk/shared\\` package in your project. Use a tool like \\`npm ls @clerk/shared\\` to identify multiple versions, and update your dependencies to only rely on one.\n\nLearn more: https://clerk.com/docs/components/clerk-provider`.trim()\n );\n }\n}\n\n// src/react/hooks/usePagesOrInfinite.ts\nimport { useCallback, useMemo, useRef, useState } from \"react\";\nfunction getDifferentKeys(obj1, obj2) {\n const keysSet = new Set(Object.keys(obj2));\n const differentKeysObject = {};\n for (const key1 of Object.keys(obj1)) {\n if (!keysSet.has(key1)) {\n differentKeysObject[key1] = obj1[key1];\n }\n }\n return differentKeysObject;\n}\nvar useWithSafeValues = (params, defaultValues) => {\n var _a, _b, _c;\n const shouldUseDefaults = typeof params === \"boolean\" && params;\n const initialPageRef = useRef(\n shouldUseDefaults ? defaultValues.initialPage : (_a = params == null ? void 0 : params.initialPage) != null ? _a : defaultValues.initialPage\n );\n const pageSizeRef = useRef(shouldUseDefaults ? defaultValues.pageSize : (_b = params == null ? void 0 : params.pageSize) != null ? _b : defaultValues.pageSize);\n const newObj = {};\n for (const key of Object.keys(defaultValues)) {\n newObj[key] = shouldUseDefaults ? defaultValues[key] : (_c = params == null ? void 0 : params[key]) != null ? _c : defaultValues[key];\n }\n return {\n ...newObj,\n initialPage: initialPageRef.current,\n pageSize: pageSizeRef.current\n };\n};\nvar cachingSWROptions = {\n dedupingInterval: 1e3 * 60,\n focusThrottleInterval: 1e3 * 60 * 2\n};\nvar usePagesOrInfinite = (params, fetcher, config, cacheKeys) => {\n var _a, _b, _c, _d, _e, _f, _g;\n const [paginatedPage, setPaginatedPage] = useState((_a = params.initialPage) != null ? _a : 1);\n const initialPageRef = useRef((_b = params.initialPage) != null ? _b : 1);\n const pageSizeRef = useRef((_c = params.pageSize) != null ? _c : 10);\n const enabled = (_d = config.enabled) != null ? _d : true;\n const triggerInfinite = (_e = config.infinite) != null ? _e : false;\n const keepPreviousData = (_f = config.keepPreviousData) != null ? _f : false;\n const pagesCacheKey = {\n ...cacheKeys,\n ...params,\n initialPage: paginatedPage,\n pageSize: pageSizeRef.current\n };\n const {\n data: swrData,\n isValidating: swrIsValidating,\n isLoading: swrIsLoading,\n error: swrError,\n mutate: swrMutate\n } = default2(\n !triggerInfinite && !!fetcher && enabled ? pagesCacheKey : null,\n (cacheKeyParams) => {\n const requestParams = getDifferentKeys(cacheKeyParams, cacheKeys);\n return fetcher == null ? void 0 : fetcher(requestParams);\n },\n { keepPreviousData, ...cachingSWROptions }\n );\n const {\n data: swrInfiniteData,\n isLoading: swrInfiniteIsLoading,\n isValidating: swrInfiniteIsValidating,\n error: swrInfiniteError,\n size,\n setSize,\n mutate: swrInfiniteMutate\n } = default3(\n (pageIndex) => {\n if (!triggerInfinite || !enabled) {\n return null;\n }\n return {\n ...params,\n ...cacheKeys,\n initialPage: initialPageRef.current + pageIndex,\n pageSize: pageSizeRef.current\n };\n },\n (cacheKeyParams) => {\n const requestParams = getDifferentKeys(cacheKeyParams, cacheKeys);\n return fetcher == null ? void 0 : fetcher(requestParams);\n },\n cachingSWROptions\n );\n const page = useMemo(() => {\n if (triggerInfinite) {\n return size;\n }\n return paginatedPage;\n }, [triggerInfinite, size, paginatedPage]);\n const fetchPage = useCallback(\n (numberOrgFn) => {\n if (triggerInfinite) {\n void setSize(numberOrgFn);\n return;\n }\n return setPaginatedPage(numberOrgFn);\n },\n [setSize]\n );\n const data = useMemo(() => {\n var _a2, _b2;\n if (triggerInfinite) {\n return (_a2 = swrInfiniteData == null ? void 0 : swrInfiniteData.map((a) => a == null ? void 0 : a.data).flat()) != null ? _a2 : [];\n }\n return (_b2 = swrData == null ? void 0 : swrData.data) != null ? _b2 : [];\n }, [triggerInfinite, swrData, swrInfiniteData]);\n const count = useMemo(() => {\n var _a2, _b2;\n if (triggerInfinite) {\n return ((_a2 = swrInfiniteData == null ? void 0 : swrInfiniteData[(swrInfiniteData == null ? void 0 : swrInfiniteData.length) - 1]) == null ? void 0 : _a2.total_count) || 0;\n }\n return (_b2 = swrData == null ? void 0 : swrData.total_count) != null ? _b2 : 0;\n }, [triggerInfinite, swrData, swrInfiniteData]);\n const isLoading = triggerInfinite ? swrInfiniteIsLoading : swrIsLoading;\n const isFetching = triggerInfinite ? swrInfiniteIsValidating : swrIsValidating;\n const error = (_g = triggerInfinite ? swrInfiniteError : swrError) != null ? _g : null;\n const isError = !!error;\n const fetchNext = useCallback(() => {\n fetchPage((n) => Math.max(0, n + 1));\n }, [fetchPage]);\n const fetchPrevious = useCallback(() => {\n fetchPage((n) => Math.max(0, n - 1));\n }, [fetchPage]);\n const offsetCount = (initialPageRef.current - 1) * pageSizeRef.current;\n const pageCount = Math.ceil((count - offsetCount) / pageSizeRef.current);\n const hasNextPage = count - offsetCount * pageSizeRef.current > page * pageSizeRef.current;\n const hasPreviousPage = (page - 1) * pageSizeRef.current > offsetCount * pageSizeRef.current;\n const setData = triggerInfinite ? (value) => swrInfiniteMutate(value, {\n revalidate: false\n }) : (value) => swrMutate(value, {\n revalidate: false\n });\n const revalidate = triggerInfinite ? () => swrInfiniteMutate() : () => swrMutate();\n return {\n data,\n count,\n error,\n isLoading,\n isFetching,\n isError,\n page,\n pageCount,\n fetchPage,\n fetchNext,\n fetchPrevious,\n hasNextPage,\n hasPreviousPage,\n // Let the hook return type define this type\n revalidate,\n // Let the hook return type define this type\n setData\n };\n};\n\n// src/react/hooks/useOrganization.tsx\nvar undefinedPaginatedResource = {\n data: void 0,\n count: void 0,\n error: void 0,\n isLoading: false,\n isFetching: false,\n isError: false,\n page: void 0,\n pageCount: void 0,\n fetchPage: void 0,\n fetchNext: void 0,\n fetchPrevious: void 0,\n hasNextPage: false,\n hasPreviousPage: false,\n revalidate: void 0,\n setData: void 0\n};\nvar useOrganization = (params) => {\n var _a;\n const {\n domains: domainListParams,\n membershipRequests: membershipRequestsListParams,\n memberships: membersListParams,\n invitations: invitationsListParams\n } = params || {};\n useAssertWrappedByClerkProvider(\"useOrganization\");\n const { organization } = useOrganizationContext();\n const session = useSessionContext();\n const domainSafeValues = useWithSafeValues(domainListParams, {\n initialPage: 1,\n pageSize: 10,\n keepPreviousData: false,\n infinite: false,\n enrollmentMode: void 0\n });\n const membershipRequestSafeValues = useWithSafeValues(membershipRequestsListParams, {\n initialPage: 1,\n pageSize: 10,\n status: \"pending\",\n keepPreviousData: false,\n infinite: false\n });\n const membersSafeValues = useWithSafeValues(membersListParams, {\n initialPage: 1,\n pageSize: 10,\n role: void 0,\n keepPreviousData: false,\n infinite: false\n });\n const invitationsSafeValues = useWithSafeValues(invitationsListParams, {\n initialPage: 1,\n pageSize: 10,\n status: [\"pending\"],\n keepPreviousData: false,\n infinite: false\n });\n const clerk = useClerkInstanceContext();\n (_a = clerk.telemetry) == null ? void 0 : _a.record(eventMethodCalled(\"useOrganization\"));\n const domainParams = typeof domainListParams === \"undefined\" ? void 0 : {\n initialPage: domainSafeValues.initialPage,\n pageSize: domainSafeValues.pageSize,\n enrollmentMode: domainSafeValues.enrollmentMode\n };\n const membershipRequestParams = typeof membershipRequestsListParams === \"undefined\" ? void 0 : {\n initialPage: membershipRequestSafeValues.initialPage,\n pageSize: membershipRequestSafeValues.pageSize,\n status: membershipRequestSafeValues.status\n };\n const membersParams = typeof membersListParams === \"undefined\" ? void 0 : {\n initialPage: membersSafeValues.initialPage,\n pageSize: membersSafeValues.pageSize,\n role: membersSafeValues.role\n };\n const invitationsParams = typeof invitationsListParams === \"undefined\" ? void 0 : {\n initialPage: invitationsSafeValues.initialPage,\n pageSize: invitationsSafeValues.pageSize,\n status: invitationsSafeValues.status\n };\n const domains = usePagesOrInfinite(\n {\n ...domainParams\n },\n organization == null ? void 0 : organization.getDomains,\n {\n keepPreviousData: domainSafeValues.keepPreviousData,\n infinite: domainSafeValues.infinite,\n enabled: !!domainParams\n },\n {\n type: \"domains\",\n organizationId: organization == null ? void 0 : organization.id\n }\n );\n const membershipRequests = usePagesOrInfinite(\n {\n ...membershipRequestParams\n },\n organization == null ? void 0 : organization.getMembershipRequests,\n {\n keepPreviousData: membershipRequestSafeValues.keepPreviousData,\n infinite: membershipRequestSafeValues.infinite,\n enabled: !!membershipRequestParams\n },\n {\n type: \"membershipRequests\",\n organizationId: organization == null ? void 0 : organization.id\n }\n );\n const memberships = usePagesOrInfinite(\n membersParams || {},\n organization == null ? void 0 : organization.getMemberships,\n {\n keepPreviousData: membersSafeValues.keepPreviousData,\n infinite: membersSafeValues.infinite,\n enabled: !!membersParams\n },\n {\n type: \"members\",\n organizationId: organization == null ? void 0 : organization.id\n }\n );\n const invitations = usePagesOrInfinite(\n {\n ...invitationsParams\n },\n organization == null ? void 0 : organization.getInvitations,\n {\n keepPreviousData: invitationsSafeValues.keepPreviousData,\n infinite: invitationsSafeValues.infinite,\n enabled: !!invitationsParams\n },\n {\n type: \"invitations\",\n organizationId: organization == null ? void 0 : organization.id\n }\n );\n if (organization === void 0) {\n return {\n isLoaded: false,\n organization: void 0,\n membership: void 0,\n domains: undefinedPaginatedResource,\n membershipRequests: undefinedPaginatedResource,\n memberships: undefinedPaginatedResource,\n invitations: undefinedPaginatedResource\n };\n }\n if (organization === null) {\n return {\n isLoaded: true,\n organization: null,\n membership: null,\n domains: null,\n membershipRequests: null,\n memberships: null,\n invitations: null\n };\n }\n if (!clerk.loaded && organization) {\n return {\n isLoaded: true,\n organization,\n membership: void 0,\n domains: undefinedPaginatedResource,\n membershipRequests: undefinedPaginatedResource,\n memberships: undefinedPaginatedResource,\n invitations: undefinedPaginatedResource\n };\n }\n return {\n isLoaded: clerk.loaded,\n organization,\n membership: getCurrentOrganizationMembership(session.user.organizationMemberships, organization.id),\n // your membership in the current org\n domains,\n membershipRequests,\n memberships,\n invitations\n };\n};\nfunction getCurrentOrganizationMembership(organizationMemberships, activeOrganizationId) {\n return organizationMemberships.find(\n (organizationMembership) => organizationMembership.organization.id === activeOrganizationId\n );\n}\n\n// src/react/hooks/useOrganizationList.tsx\nvar undefinedPaginatedResource2 = {\n data: void 0,\n count: void 0,\n error: void 0,\n isLoading: false,\n isFetching: false,\n isError: false,\n page: void 0,\n pageCount: void 0,\n fetchPage: void 0,\n fetchNext: void 0,\n fetchPrevious: void 0,\n hasNextPage: false,\n hasPreviousPage: false,\n revalidate: void 0,\n setData: void 0\n};\nvar useOrganizationList = (params) => {\n var _a;\n const { userMemberships, userInvitations, userSuggestions } = params || {};\n useAssertWrappedByClerkProvider(\"useOrganizationList\");\n const userMembershipsSafeValues = useWithSafeValues(userMemberships, {\n initialPage: 1,\n pageSize: 10,\n keepPreviousData: false,\n infinite: false\n });\n const userInvitationsSafeValues = useWithSafeValues(userInvitations, {\n initialPage: 1,\n pageSize: 10,\n status: \"pending\",\n keepPreviousData: false,\n infinite: false\n });\n const userSuggestionsSafeValues = useWithSafeValues(userSuggestions, {\n initialPage: 1,\n pageSize: 10,\n status: \"pending\",\n keepPreviousData: false,\n infinite: false\n });\n const clerk = useClerkInstanceContext();\n const user = useUserContext();\n (_a = clerk.telemetry) == null ? void 0 : _a.record(eventMethodCalled(\"useOrganizationList\"));\n const userMembershipsParams = typeof userMemberships === \"undefined\" ? void 0 : {\n initialPage: userMembershipsSafeValues.initialPage,\n pageSize: userMembershipsSafeValues.pageSize\n };\n const userInvitationsParams = typeof userInvitations === \"undefined\" ? void 0 : {\n initialPage: userInvitationsSafeValues.initialPage,\n pageSize: userInvitationsSafeValues.pageSize,\n status: userInvitationsSafeValues.status\n };\n const userSuggestionsParams = typeof userSuggestions === \"undefined\" ? void 0 : {\n initialPage: userSuggestionsSafeValues.initialPage,\n pageSize: userSuggestionsSafeValues.pageSize,\n status: userSuggestionsSafeValues.status\n };\n const isClerkLoaded = !!(clerk.loaded && user);\n const memberships = usePagesOrInfinite(\n userMembershipsParams || {},\n user == null ? void 0 : user.getOrganizationMemberships,\n {\n keepPreviousData: userMembershipsSafeValues.keepPreviousData,\n infinite: userMembershipsSafeValues.infinite,\n enabled: !!userMembershipsParams\n },\n {\n type: \"userMemberships\",\n userId: user == null ? void 0 : user.id\n }\n );\n const invitations = usePagesOrInfinite(\n {\n ...userInvitationsParams\n },\n user == null ? void 0 : user.getOrganizationInvitations,\n {\n keepPreviousData: userInvitationsSafeValues.keepPreviousData,\n infinite: userInvitationsSafeValues.infinite,\n enabled: !!userInvitationsParams\n },\n {\n type: \"userInvitations\",\n userId: user == null ? void 0 : user.id\n }\n );\n const suggestions = usePagesOrInfinite(\n {\n ...userSuggestionsParams\n },\n user == null ? void 0 : user.getOrganizationSuggestions,\n {\n keepPreviousData: userSuggestionsSafeValues.keepPreviousData,\n infinite: userSuggestionsSafeValues.infinite,\n enabled: !!userSuggestionsParams\n },\n {\n type: \"userSuggestions\",\n userId: user == null ? void 0 : user.id\n }\n );\n if (!isClerkLoaded) {\n return {\n isLoaded: false,\n createOrganization: void 0,\n setActive: void 0,\n userMemberships: undefinedPaginatedResource2,\n userInvitations: undefinedPaginatedResource2,\n userSuggestions: undefinedPaginatedResource2\n };\n }\n return {\n isLoaded: isClerkLoaded,\n setActive: clerk.setActive,\n createOrganization: clerk.createOrganization,\n userMemberships: memberships,\n userInvitations: invitations,\n userSuggestions: suggestions\n };\n};\n\n// src/react/hooks/useSafeLayoutEffect.tsx\nimport React3 from \"react\";\nvar useSafeLayoutEffect = typeof window !== \"undefined\" ? React3.useLayoutEffect : React3.useEffect;\n\n// src/react/hooks/useSession.ts\nvar useSession = () => {\n useAssertWrappedByClerkProvider(\"useSession\");\n const session = useSessionContext();\n if (session === void 0) {\n return { isLoaded: false, isSignedIn: void 0, session: void 0 };\n }\n if (session === null) {\n return { isLoaded: true, isSignedIn: false, session: null };\n }\n return { isLoaded: true, isSignedIn: true, session };\n};\n\n// src/react/hooks/useSessionList.ts\nvar useSessionList = () => {\n useAssertWrappedByClerkProvider(\"useSessionList\");\n const isomorphicClerk = useClerkInstanceContext();\n const client = useClientContext();\n if (!client) {\n return { isLoaded: false, sessions: void 0, setActive: void 0 };\n }\n return {\n isLoaded: true,\n sessions: client.sessions,\n setActive: isomorphicClerk.setActive\n };\n};\n\n// src/react/hooks/useUser.ts\nfunction useUser() {\n useAssertWrappedByClerkProvider(\"useUser\");\n const user = useUserContext();\n if (user === void 0) {\n return { isLoaded: false, isSignedIn: void 0, user: void 0 };\n }\n if (user === null) {\n return { isLoaded: true, isSignedIn: false, user: null };\n }\n return { isLoaded: true, isSignedIn: true, user };\n}\n\n// src/react/hooks/useClerk.ts\nvar useClerk = () => {\n useAssertWrappedByClerkProvider(\"useClerk\");\n return useClerkInstanceContext();\n};\n\n// src/react/hooks/useDeepEqualMemo.ts\nimport { dequal as deepEqual } from \"dequal\";\nimport React4 from \"react\";\nvar useDeepEqualMemoize = (value) => {\n const ref = React4.useRef(value);\n if (!deepEqual(value, ref.current)) {\n ref.current = value;\n }\n return React4.useMemo(() => ref.current, [ref.current]);\n};\nvar useDeepEqualMemo = (factory, dependencyArray) => {\n return React4.useMemo(factory, useDeepEqualMemoize(dependencyArray));\n};\nvar isDeeplyEqual = deepEqual;\n\n// src/react/hooks/useReverification.ts\nimport { useMemo as useMemo2, useRef as useRef2 } from \"react\";\nvar CLERK_API_REVERIFICATION_ERROR_CODE = \"session_reverification_required\";\nasync function resolveResult(result) {\n try {\n const r = await result;\n if (r instanceof Response) {\n return r.json();\n }\n return r;\n } catch (e) {\n if (isClerkAPIResponseError(e) && e.errors.find(({ code }) => code === CLERK_API_REVERIFICATION_ERROR_CODE)) {\n return reverificationError();\n }\n throw e;\n }\n}\nfunction createReverificationHandler(params) {\n function assertReverification(fetcher) {\n return async (...args) => {\n var _a, _b;\n let result = await resolveResult(fetcher(...args));\n if (isReverificationHint(result)) {\n const resolvers = createDeferredPromise();\n const isValidMetadata = validateReverificationConfig((_a = result.clerk_error.metadata) == null ? void 0 : _a.reverification);\n (_b = params.openUIComponent) == null ? void 0 : _b.call(params, {\n level: isValidMetadata ? isValidMetadata().level : void 0,\n afterVerification() {\n resolvers.resolve(true);\n },\n afterVerificationCancelled() {\n resolvers.reject(\n new ClerkRuntimeError(\"User cancelled attempted verification\", {\n code: \"reverification_cancelled\"\n })\n );\n }\n });\n try {\n await resolvers.promise;\n } catch (e) {\n if (params.onCancel) {\n params.onCancel();\n }\n if (isClerkRuntimeError(e) && e.code === \"reverification_cancelled\" && params.throwOnCancel) {\n throw e;\n }\n return null;\n }\n result = await resolveResult(fetcher(...args));\n }\n return result;\n };\n }\n return assertReverification;\n}\nfunction useReverification(fetcher, options) {\n const { __internal_openReverification } = useClerk();\n const fetcherRef = useRef2(fetcher);\n const optionsRef = useRef2(options);\n const handleReverification = useMemo2(() => {\n const handler = createReverificationHandler({\n openUIComponent: __internal_openReverification,\n ...optionsRef.current\n })(fetcherRef.current);\n return [handler];\n }, [__internal_openReverification, fetcherRef.current, optionsRef.current]);\n useSafeLayoutEffect(() => {\n fetcherRef.current = fetcher;\n optionsRef.current = options;\n });\n return handleReverification;\n}\nexport {\n ClerkInstanceContext,\n ClientContext,\n OptionsContext,\n OrganizationProvider,\n SessionContext,\n UserContext,\n assertContextExists,\n createContextAndHook,\n isDeeplyEqual,\n useAssertWrappedByClerkProvider,\n useClerk,\n useClerkInstanceContext,\n useClientContext,\n useDeepEqualMemo,\n useOptionsContext,\n useOrganization,\n useOrganizationContext,\n useOrganizationList,\n useReverification,\n useSafeLayoutEffect,\n useSession,\n useSessionContext,\n useSessionList,\n useUser,\n useUserContext\n};\n//# sourceMappingURL=index.mjs.map","// src/isomorphicAtob.ts\nvar isomorphicAtob = (data) => {\n if (typeof atob !== \"undefined\" && typeof atob === \"function\") {\n return atob(data);\n } else if (typeof global !== \"undefined\" && global.Buffer) {\n return new global.Buffer(data, \"base64\").toString();\n }\n return data;\n};\n\nexport {\n isomorphicAtob\n};\n//# sourceMappingURL=chunk-TETGTEI2.mjs.map","// src/constants.ts\nvar LEGACY_DEV_INSTANCE_SUFFIXES = [\".lcl.dev\", \".lclstage.dev\", \".lclclerk.com\"];\nvar CURRENT_DEV_INSTANCE_SUFFIXES = [\".accounts.dev\", \".accountsstage.dev\", \".accounts.lclclerk.com\"];\nvar DEV_OR_STAGING_SUFFIXES = [\n \".lcl.dev\",\n \".stg.dev\",\n \".lclstage.dev\",\n \".stgstage.dev\",\n \".dev.lclclerk.com\",\n \".stg.lclclerk.com\",\n \".accounts.lclclerk.com\",\n \"accountsstage.dev\",\n \"accounts.dev\"\n];\nvar LOCAL_ENV_SUFFIXES = [\".lcl.dev\", \"lclstage.dev\", \".lclclerk.com\", \".accounts.lclclerk.com\"];\nvar STAGING_ENV_SUFFIXES = [\".accountsstage.dev\"];\nvar LOCAL_API_URL = \"https://api.lclclerk.com\";\nvar STAGING_API_URL = \"https://api.clerkstage.dev\";\nvar PROD_API_URL = \"https://api.clerk.com\";\nfunction iconImageUrl(id, format = \"svg\") {\n return `https://img.clerk.com/static/${id}.${format}`;\n}\n\nexport {\n LEGACY_DEV_INSTANCE_SUFFIXES,\n CURRENT_DEV_INSTANCE_SUFFIXES,\n DEV_OR_STAGING_SUFFIXES,\n LOCAL_ENV_SUFFIXES,\n STAGING_ENV_SUFFIXES,\n LOCAL_API_URL,\n STAGING_API_URL,\n PROD_API_URL,\n iconImageUrl\n};\n//# sourceMappingURL=chunk-I6MTSTOF.mjs.map","import {\n isomorphicAtob\n} from \"./chunk-TETGTEI2.mjs\";\nimport {\n isomorphicBtoa\n} from \"./chunk-KOH7GTJO.mjs\";\nimport {\n DEV_OR_STAGING_SUFFIXES,\n LEGACY_DEV_INSTANCE_SUFFIXES\n} from \"./chunk-I6MTSTOF.mjs\";\n\n// src/keys.ts\nvar PUBLISHABLE_KEY_LIVE_PREFIX = \"pk_live_\";\nvar PUBLISHABLE_KEY_TEST_PREFIX = \"pk_test_\";\nvar PUBLISHABLE_FRONTEND_API_DEV_REGEX = /^(([a-z]+)-){2}([0-9]{1,2})\\.clerk\\.accounts([a-z.]*)(dev|com)$/i;\nfunction buildPublishableKey(frontendApi) {\n const isDevKey = PUBLISHABLE_FRONTEND_API_DEV_REGEX.test(frontendApi) || frontendApi.startsWith(\"clerk.\") && LEGACY_DEV_INSTANCE_SUFFIXES.some((s) => frontendApi.endsWith(s));\n const keyPrefix = isDevKey ? PUBLISHABLE_KEY_TEST_PREFIX : PUBLISHABLE_KEY_LIVE_PREFIX;\n return `${keyPrefix}${isomorphicBtoa(`${frontendApi}$`)}`;\n}\nfunction parsePublishableKey(key, options = {}) {\n key = key || \"\";\n if (!key || !isPublishableKey(key)) {\n if (options.fatal && !key) {\n throw new Error(\n \"Publishable key is missing. Ensure that your publishable key is correctly configured. Double-check your environment configuration for your keys, or access them here: https://dashboard.clerk.com/last-active?path=api-keys\"\n );\n }\n if (options.fatal && !isPublishableKey(key)) {\n throw new Error(\"Publishable key not valid.\");\n }\n return null;\n }\n const instanceType = key.startsWith(PUBLISHABLE_KEY_LIVE_PREFIX) ? \"production\" : \"development\";\n let frontendApi = isomorphicAtob(key.split(\"_\")[2]);\n frontendApi = frontendApi.slice(0, -1);\n if (options.proxyUrl) {\n frontendApi = options.proxyUrl;\n } else if (instanceType !== \"development\" && options.domain) {\n frontendApi = `clerk.${options.domain}`;\n }\n return {\n instanceType,\n frontendApi\n };\n}\nfunction isPublishableKey(key) {\n key = key || \"\";\n const hasValidPrefix = key.startsWith(PUBLISHABLE_KEY_LIVE_PREFIX) || key.startsWith(PUBLISHABLE_KEY_TEST_PREFIX);\n const hasValidFrontendApiPostfix = isomorphicAtob(key.split(\"_\")[2] || \"\").endsWith(\"$\");\n return hasValidPrefix && hasValidFrontendApiPostfix;\n}\nfunction createDevOrStagingUrlCache() {\n const devOrStagingUrlCache = /* @__PURE__ */ new Map();\n return {\n isDevOrStagingUrl: (url) => {\n if (!url) {\n return false;\n }\n const hostname = typeof url === \"string\" ? url : url.hostname;\n let res = devOrStagingUrlCache.get(hostname);\n if (res === void 0) {\n res = DEV_OR_STAGING_SUFFIXES.some((s) => hostname.endsWith(s));\n devOrStagingUrlCache.set(hostname, res);\n }\n return res;\n }\n };\n}\nfunction isDevelopmentFromPublishableKey(apiKey) {\n return apiKey.startsWith(\"test_\") || apiKey.startsWith(\"pk_test_\");\n}\nfunction isProductionFromPublishableKey(apiKey) {\n return apiKey.startsWith(\"live_\") || apiKey.startsWith(\"pk_live_\");\n}\nfunction isDevelopmentFromSecretKey(apiKey) {\n return apiKey.startsWith(\"test_\") || apiKey.startsWith(\"sk_test_\");\n}\nfunction isProductionFromSecretKey(apiKey) {\n return apiKey.startsWith(\"live_\") || apiKey.startsWith(\"sk_live_\");\n}\nasync function getCookieSuffix(publishableKey, subtle = globalThis.crypto.subtle) {\n const data = new TextEncoder().encode(publishableKey);\n const digest = await subtle.digest(\"sha-1\", data);\n const stringDigest = String.fromCharCode(...new Uint8Array(digest));\n return isomorphicBtoa(stringDigest).replace(/\\+/gi, \"-\").replace(/\\//gi, \"_\").substring(0, 8);\n}\nvar getSuffixedCookieName = (cookieName, cookieSuffix) => {\n return `${cookieName}_${cookieSuffix}`;\n};\n\nexport {\n buildPublishableKey,\n parsePublishableKey,\n isPublishableKey,\n createDevOrStagingUrlCache,\n isDevelopmentFromPublishableKey,\n isProductionFromPublishableKey,\n isDevelopmentFromSecretKey,\n isProductionFromSecretKey,\n getCookieSuffix,\n getSuffixedCookieName\n};\n//# sourceMappingURL=chunk-NJGRVCG7.mjs.map","// src/utils/runtimeEnvironment.ts\nvar isDevelopmentEnvironment = () => {\n try {\n return process.env.NODE_ENV === \"development\";\n } catch (err) {\n }\n return false;\n};\nvar isTestEnvironment = () => {\n try {\n return process.env.NODE_ENV === \"test\";\n } catch (err) {\n }\n return false;\n};\nvar isProductionEnvironment = () => {\n try {\n return process.env.NODE_ENV === \"production\";\n } catch (err) {\n }\n return false;\n};\n\nexport {\n isDevelopmentEnvironment,\n isTestEnvironment,\n isProductionEnvironment\n};\n//# sourceMappingURL=chunk-QMOEH4QX.mjs.map","import {\n isProductionEnvironment,\n isTestEnvironment\n} from \"./chunk-QMOEH4QX.mjs\";\n\n// src/deprecated.ts\nvar displayedWarnings = /* @__PURE__ */ new Set();\nvar deprecated = (fnName, warning, key) => {\n const hideWarning = isTestEnvironment() || isProductionEnvironment();\n const messageId = key != null ? key : fnName;\n if (displayedWarnings.has(messageId) || hideWarning) {\n return;\n }\n displayedWarnings.add(messageId);\n console.warn(\n `Clerk - DEPRECATION WARNING: \"${fnName}\" is deprecated and will be removed in the next major release.\n${warning}`\n );\n};\nvar deprecatedProperty = (cls, propName, warning, isStatic = false) => {\n const target = isStatic ? cls : cls.prototype;\n let value = target[propName];\n Object.defineProperty(target, propName, {\n get() {\n deprecated(propName, warning, `${cls.name}:${propName}`);\n return value;\n },\n set(v) {\n value = v;\n }\n });\n};\nvar deprecatedObjectProperty = (obj, propName, warning, key) => {\n let value = obj[propName];\n Object.defineProperty(obj, propName, {\n get() {\n deprecated(propName, warning, key);\n return value;\n },\n set(v) {\n value = v;\n }\n });\n};\n\nexport {\n deprecated,\n deprecatedProperty,\n deprecatedObjectProperty\n};\n//# sourceMappingURL=chunk-4EIZQYWK.mjs.map","// src/errors/errorThrower.ts\nimport { buildErrorThrower } from \"@clerk/shared/error\";\nvar errorThrower = buildErrorThrower({ packageName: \"@clerk/clerk-react\" });\nfunction setErrorThrowerOptions(options) {\n errorThrower.setMessages(options).setPackageName(options);\n}\n\n// src/hooks/useAuth.ts\nimport { createCheckAuthorization } from \"@clerk/shared/authorization\";\nimport { useCallback } from \"react\";\n\n// src/contexts/AuthContext.ts\nimport { createContextAndHook } from \"@clerk/shared/react\";\nvar [AuthContext, useAuthContext] = createContextAndHook(\"AuthContext\");\n\n// src/contexts/IsomorphicClerkContext.tsx\nimport { ClerkInstanceContext, useClerkInstanceContext } from \"@clerk/shared/react\";\nvar IsomorphicClerkContext = ClerkInstanceContext;\nvar useIsomorphicClerkContext = useClerkInstanceContext;\n\n// src/errors/messages.ts\nvar multipleClerkProvidersError = \"You've added multiple components in your React component tree. Wrap your components in a single .\";\nvar multipleChildrenInButtonComponent = (name) => `You've passed multiple children components to <${name}/>. You can only pass a single child component or text.`;\nvar invalidStateError = \"Invalid state. Feel free to submit a bug or reach out to support here: https://clerk.com/support\";\nvar unsupportedNonBrowserDomainOrProxyUrlFunction = \"Unsupported usage of isSatellite, domain or proxyUrl. The usage of isSatellite, domain or proxyUrl as function is not supported in non-browser environments.\";\nvar userProfilePageRenderedError = \" component needs to be a direct child of `` or ``.\";\nvar userProfileLinkRenderedError = \" component needs to be a direct child of `` or ``.\";\nvar organizationProfilePageRenderedError = \" component needs to be a direct child of `` or ``.\";\nvar organizationProfileLinkRenderedError = \" component needs to be a direct child of `` or ``.\";\nvar customPagesIgnoredComponent = (componentName) => `<${componentName} /> can only accept <${componentName}.Page /> and <${componentName}.Link /> as its children. Any other provided component will be ignored.`;\nvar customPageWrongProps = (componentName) => `Missing props. <${componentName}.Page /> component requires the following props: url, label, labelIcon, alongside with children to be rendered inside the page.`;\nvar customLinkWrongProps = (componentName) => `Missing props. <${componentName}.Link /> component requires the following props: url, label and labelIcon.`;\nvar noPathProvidedError = (componentName) => `The <${componentName}/> component uses path-based routing by default unless a different routing strategy is provided using the \\`routing\\` prop. When path-based routing is used, you need to provide the path where the component is mounted on by using the \\`path\\` prop. Example: <${componentName} path={'/my-path'} />`;\nvar incompatibleRoutingWithPathProvidedError = (componentName) => `The \\`path\\` prop will only be respected when the Clerk component uses path-based routing. To resolve this error, pass \\`routing='path'\\` to the <${componentName}/> component, or drop the \\`path\\` prop to switch to hash-based routing. For more details please refer to our docs: https://clerk.com/docs`;\nvar userButtonIgnoredComponent = ` can only accept , and as its children. Any other provided component will be ignored.`;\nvar customMenuItemsIgnoredComponent = \" component can only accept and as its children. Any other provided component will be ignored.\";\nvar userButtonMenuItemsRenderedError = \" component needs to be a direct child of ``.\";\nvar userButtonMenuActionRenderedError = \" component needs to be a direct child of ``.\";\nvar userButtonMenuLinkRenderedError = \" component needs to be a direct child of ``.\";\nvar userButtonMenuItemLinkWrongProps = \"Missing props. component requires the following props: href, label and labelIcon.\";\nvar userButtonMenuItemsActionWrongsProps = \"Missing props. component requires the following props: label.\";\n\n// src/hooks/useAssertWrappedByClerkProvider.ts\nimport { useAssertWrappedByClerkProvider as useSharedAssertWrappedByClerkProvider } from \"@clerk/shared/react\";\nvar useAssertWrappedByClerkProvider = (source) => {\n useSharedAssertWrappedByClerkProvider(() => {\n errorThrower.throwMissingClerkProviderError({ source });\n });\n};\n\n// src/hooks/utils.ts\nvar clerkLoaded = (isomorphicClerk) => {\n return new Promise((resolve) => {\n if (isomorphicClerk.loaded) {\n resolve();\n }\n isomorphicClerk.addOnLoaded(resolve);\n });\n};\nvar createGetToken = (isomorphicClerk) => {\n return async (options) => {\n await clerkLoaded(isomorphicClerk);\n if (!isomorphicClerk.session) {\n return null;\n }\n return isomorphicClerk.session.getToken(options);\n };\n};\nvar createSignOut = (isomorphicClerk) => {\n return async (...args) => {\n await clerkLoaded(isomorphicClerk);\n return isomorphicClerk.signOut(...args);\n };\n};\n\n// src/hooks/useAuth.ts\nvar useAuth = (initialAuthState = {}) => {\n useAssertWrappedByClerkProvider(\"useAuth\");\n const authContextFromHook = useAuthContext();\n let authContext = authContextFromHook;\n if (authContext.sessionId === void 0 && authContext.userId === void 0) {\n authContext = initialAuthState != null ? initialAuthState : {};\n }\n const { sessionId, userId, actor, orgId, orgRole, orgSlug, orgPermissions, factorVerificationAge } = authContext;\n const isomorphicClerk = useIsomorphicClerkContext();\n const getToken = useCallback(createGetToken(isomorphicClerk), [isomorphicClerk]);\n const signOut = useCallback(createSignOut(isomorphicClerk), [isomorphicClerk]);\n return useDerivedAuth({\n sessionId,\n userId,\n actor,\n orgId,\n orgSlug,\n orgRole,\n getToken,\n signOut,\n orgPermissions,\n factorVerificationAge\n });\n};\nfunction useDerivedAuth(authObject) {\n const {\n sessionId,\n userId,\n actor,\n orgId,\n orgSlug,\n orgRole,\n has,\n signOut,\n getToken,\n orgPermissions,\n factorVerificationAge\n } = authObject != null ? authObject : {};\n const derivedHas = useCallback(\n (params) => {\n if (has) {\n return has(params);\n }\n return createCheckAuthorization({\n userId,\n orgId,\n orgRole,\n orgPermissions,\n factorVerificationAge\n })(params);\n },\n [userId, factorVerificationAge, orgId, orgRole, orgPermissions]\n );\n if (sessionId === void 0 && userId === void 0) {\n return {\n isLoaded: false,\n isSignedIn: void 0,\n sessionId,\n userId,\n actor: void 0,\n orgId: void 0,\n orgRole: void 0,\n orgSlug: void 0,\n has: void 0,\n signOut,\n getToken\n };\n }\n if (sessionId === null && userId === null) {\n return {\n isLoaded: true,\n isSignedIn: false,\n sessionId,\n userId,\n actor: null,\n orgId: null,\n orgRole: null,\n orgSlug: null,\n has: () => false,\n signOut,\n getToken\n };\n }\n if (!!sessionId && !!userId && !!orgId && !!orgRole) {\n return {\n isLoaded: true,\n isSignedIn: true,\n sessionId,\n userId,\n actor: actor || null,\n orgId,\n orgRole,\n orgSlug: orgSlug || null,\n has: derivedHas,\n signOut,\n getToken\n };\n }\n if (!!sessionId && !!userId && !orgId) {\n return {\n isLoaded: true,\n isSignedIn: true,\n sessionId,\n userId,\n actor: actor || null,\n orgId: null,\n orgRole: null,\n orgSlug: null,\n has: derivedHas,\n signOut,\n getToken\n };\n }\n return errorThrower.throw(invalidStateError);\n}\n\n// src/hooks/useEmailLink.ts\nimport React from \"react\";\nfunction useEmailLink(resource) {\n const { startEmailLinkFlow, cancelEmailLinkFlow } = React.useMemo(() => resource.createEmailLinkFlow(), [resource]);\n React.useEffect(() => {\n return cancelEmailLinkFlow;\n }, []);\n return {\n startEmailLinkFlow,\n cancelEmailLinkFlow\n };\n}\n\n// src/hooks/useSignIn.ts\nimport { useClientContext } from \"@clerk/shared/react\";\nimport { eventMethodCalled } from \"@clerk/shared/telemetry\";\nvar useSignIn = () => {\n var _a;\n useAssertWrappedByClerkProvider(\"useSignIn\");\n const isomorphicClerk = useIsomorphicClerkContext();\n const client = useClientContext();\n (_a = isomorphicClerk.telemetry) == null ? void 0 : _a.record(eventMethodCalled(\"useSignIn\"));\n if (!client) {\n return { isLoaded: false, signIn: void 0, setActive: void 0 };\n }\n return {\n isLoaded: true,\n signIn: client.signIn,\n setActive: isomorphicClerk.setActive\n };\n};\n\n// src/hooks/useSignUp.ts\nimport { useClientContext as useClientContext2 } from \"@clerk/shared/react\";\nimport { eventMethodCalled as eventMethodCalled2 } from \"@clerk/shared/telemetry\";\nvar useSignUp = () => {\n var _a;\n useAssertWrappedByClerkProvider(\"useSignUp\");\n const isomorphicClerk = useIsomorphicClerkContext();\n const client = useClientContext2();\n (_a = isomorphicClerk.telemetry) == null ? void 0 : _a.record(eventMethodCalled2(\"useSignUp\"));\n if (!client) {\n return { isLoaded: false, signUp: void 0, setActive: void 0 };\n }\n return {\n isLoaded: true,\n signUp: client.signUp,\n setActive: isomorphicClerk.setActive\n };\n};\n\n// src/hooks/index.ts\nimport {\n useClerk,\n useOrganization,\n useOrganizationList,\n useSessionList,\n useUser,\n useSession,\n useReverification\n} from \"@clerk/shared/react\";\n\n// src/components/controlComponents.tsx\nimport { deprecated } from \"@clerk/shared/deprecated\";\nimport React3 from \"react\";\n\n// src/contexts/SessionContext.tsx\nimport { SessionContext, useSessionContext } from \"@clerk/shared/react\";\n\n// src/components/withClerk.tsx\nimport React2 from \"react\";\nvar withClerk = (Component, displayNameOrOptions) => {\n const passedDisplayedName = typeof displayNameOrOptions === \"string\" ? displayNameOrOptions : displayNameOrOptions == null ? void 0 : displayNameOrOptions.component;\n const displayName = passedDisplayedName || Component.displayName || Component.name || \"Component\";\n Component.displayName = displayName;\n const options = typeof displayNameOrOptions === \"string\" ? void 0 : displayNameOrOptions;\n const HOC = (props) => {\n useAssertWrappedByClerkProvider(displayName || \"withClerk\");\n const clerk = useIsomorphicClerkContext();\n if (!clerk.loaded && !(options == null ? void 0 : options.renderWhileLoading)) {\n return null;\n }\n return /* @__PURE__ */ React2.createElement(\n Component,\n {\n ...props,\n component: displayName,\n clerk\n }\n );\n };\n HOC.displayName = `withClerk(${displayName})`;\n return HOC;\n};\n\n// src/components/controlComponents.tsx\nvar SignedIn = ({ children }) => {\n useAssertWrappedByClerkProvider(\"SignedIn\");\n const { userId } = useAuthContext();\n if (userId) {\n return children;\n }\n return null;\n};\nvar SignedOut = ({ children }) => {\n useAssertWrappedByClerkProvider(\"SignedOut\");\n const { userId } = useAuthContext();\n if (userId === null) {\n return children;\n }\n return null;\n};\nvar ClerkLoaded = ({ children }) => {\n useAssertWrappedByClerkProvider(\"ClerkLoaded\");\n const isomorphicClerk = useIsomorphicClerkContext();\n if (!isomorphicClerk.loaded) {\n return null;\n }\n return children;\n};\nvar ClerkLoading = ({ children }) => {\n useAssertWrappedByClerkProvider(\"ClerkLoading\");\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.loaded) {\n return null;\n }\n return children;\n};\nvar Protect = ({ children, fallback, ...restAuthorizedParams }) => {\n useAssertWrappedByClerkProvider(\"Protect\");\n const { isLoaded, has, userId } = useAuth();\n if (!isLoaded) {\n return null;\n }\n const unauthorized = fallback != null ? fallback : null;\n const authorized = children;\n if (!userId) {\n return unauthorized;\n }\n if (typeof restAuthorizedParams.condition === \"function\") {\n if (restAuthorizedParams.condition(has)) {\n return authorized;\n }\n return unauthorized;\n }\n if (restAuthorizedParams.role || restAuthorizedParams.permission) {\n if (has(restAuthorizedParams)) {\n return authorized;\n }\n return unauthorized;\n }\n return authorized;\n};\nvar RedirectToSignIn = withClerk(({ clerk, ...props }) => {\n const { client, session } = clerk;\n const hasActiveSessions = client.activeSessions && client.activeSessions.length > 0;\n React3.useEffect(() => {\n if (session === null && hasActiveSessions) {\n void clerk.redirectToAfterSignOut();\n } else {\n void clerk.redirectToSignIn(props);\n }\n }, []);\n return null;\n}, \"RedirectToSignIn\");\nvar RedirectToSignUp = withClerk(({ clerk, ...props }) => {\n React3.useEffect(() => {\n void clerk.redirectToSignUp(props);\n }, []);\n return null;\n}, \"RedirectToSignUp\");\nvar RedirectToUserProfile = withClerk(({ clerk }) => {\n React3.useEffect(() => {\n deprecated(\"RedirectToUserProfile\", \"Use the `redirectToUserProfile()` method instead.\");\n void clerk.redirectToUserProfile();\n }, []);\n return null;\n}, \"RedirectToUserProfile\");\nvar RedirectToOrganizationProfile = withClerk(({ clerk }) => {\n React3.useEffect(() => {\n deprecated(\"RedirectToOrganizationProfile\", \"Use the `redirectToOrganizationProfile()` method instead.\");\n void clerk.redirectToOrganizationProfile();\n }, []);\n return null;\n}, \"RedirectToOrganizationProfile\");\nvar RedirectToCreateOrganization = withClerk(({ clerk }) => {\n React3.useEffect(() => {\n deprecated(\"RedirectToCreateOrganization\", \"Use the `redirectToCreateOrganization()` method instead.\");\n void clerk.redirectToCreateOrganization();\n }, []);\n return null;\n}, \"RedirectToCreateOrganization\");\nvar AuthenticateWithRedirectCallback = withClerk(\n ({ clerk, ...handleRedirectCallbackParams }) => {\n React3.useEffect(() => {\n void clerk.handleRedirectCallback(handleRedirectCallbackParams);\n }, []);\n return null;\n },\n \"AuthenticateWithRedirectCallback\"\n);\nvar MultisessionAppSupport = ({ children }) => {\n useAssertWrappedByClerkProvider(\"MultisessionAppSupport\");\n const session = useSessionContext();\n return /* @__PURE__ */ React3.createElement(React3.Fragment, { key: session ? session.id : \"no-users\" }, children);\n};\n\nexport {\n errorThrower,\n setErrorThrowerOptions,\n multipleClerkProvidersError,\n multipleChildrenInButtonComponent,\n unsupportedNonBrowserDomainOrProxyUrlFunction,\n userProfilePageRenderedError,\n userProfileLinkRenderedError,\n organizationProfilePageRenderedError,\n organizationProfileLinkRenderedError,\n customPagesIgnoredComponent,\n customPageWrongProps,\n customLinkWrongProps,\n noPathProvidedError,\n incompatibleRoutingWithPathProvidedError,\n userButtonIgnoredComponent,\n customMenuItemsIgnoredComponent,\n userButtonMenuItemsRenderedError,\n userButtonMenuActionRenderedError,\n userButtonMenuLinkRenderedError,\n userButtonMenuItemLinkWrongProps,\n userButtonMenuItemsActionWrongsProps,\n IsomorphicClerkContext,\n withClerk,\n AuthContext,\n useAuth,\n useDerivedAuth,\n useEmailLink,\n useSignIn,\n useSignUp,\n useClerk,\n useOrganization,\n useOrganizationList,\n useSessionList,\n useUser,\n useSession,\n useReverification,\n SignedIn,\n SignedOut,\n ClerkLoaded,\n ClerkLoading,\n Protect,\n RedirectToSignIn,\n RedirectToSignUp,\n RedirectToUserProfile,\n RedirectToOrganizationProfile,\n RedirectToCreateOrganization,\n AuthenticateWithRedirectCallback,\n MultisessionAppSupport\n};\n//# sourceMappingURL=chunk-GNFPFS75.mjs.map","var __typeError = (msg) => {\n throw TypeError(msg);\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\nvar __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, \"write to private field\"), setter ? setter.call(obj, value) : member.set(obj, value), value);\nvar __privateMethod = (obj, member, method) => (__accessCheck(obj, member, \"access private method\"), method);\n\nexport {\n __privateGet,\n __privateAdd,\n __privateSet,\n __privateMethod\n};\n//# sourceMappingURL=chunk-OANWQR3B.mjs.map","// src/versionSelector.ts\nvar versionSelector = (clerkJSVersion, packageVersion = \"5.43.3\") => {\n if (clerkJSVersion) {\n return clerkJSVersion;\n }\n const prereleaseTag = getPrereleaseTag(packageVersion);\n if (prereleaseTag) {\n if (prereleaseTag === \"snapshot\") {\n return \"5.43.3\";\n }\n return prereleaseTag;\n }\n return getMajorVersion(packageVersion);\n};\nvar getPrereleaseTag = (packageVersion) => {\n var _a;\n return (_a = packageVersion.trim().replace(/^v/, \"\").match(/-(.+?)(\\.|$)/)) == null ? void 0 : _a[1];\n};\nvar getMajorVersion = (packageVersion) => packageVersion.trim().replace(/^v/, \"\").split(\".\")[0];\n\nexport {\n versionSelector,\n getMajorVersion\n};\n//# sourceMappingURL=chunk-JMFHSME2.mjs.map","// src/proxy.ts\nfunction isValidProxyUrl(key) {\n if (!key) {\n return true;\n }\n return isHttpOrHttps(key) || isProxyUrlRelative(key);\n}\nfunction isHttpOrHttps(key) {\n return /^http(s)?:\\/\\//.test(key || \"\");\n}\nfunction isProxyUrlRelative(key) {\n return key.startsWith(\"/\");\n}\nfunction proxyUrlToAbsoluteURL(url) {\n if (!url) {\n return \"\";\n }\n return isProxyUrlRelative(url) ? new URL(url, window.location.origin).toString() : url;\n}\n\nexport {\n isValidProxyUrl,\n isHttpOrHttps,\n isProxyUrlRelative,\n proxyUrlToAbsoluteURL\n};\n//# sourceMappingURL=chunk-6NDGN2IU.mjs.map","import {\n isStaging\n} from \"./chunk-3TMSNP4L.mjs\";\nimport {\n CURRENT_DEV_INSTANCE_SUFFIXES,\n LEGACY_DEV_INSTANCE_SUFFIXES\n} from \"./chunk-I6MTSTOF.mjs\";\n\n// src/url.ts\nfunction parseSearchParams(queryString = \"\") {\n if (queryString.startsWith(\"?\")) {\n queryString = queryString.slice(1);\n }\n return new URLSearchParams(queryString);\n}\nfunction stripScheme(url = \"\") {\n return (url || \"\").replace(/^.+:\\/\\//, \"\");\n}\nfunction addClerkPrefix(str) {\n if (!str) {\n return \"\";\n }\n let regex;\n if (str.match(/^(clerk\\.)+\\w*$/)) {\n regex = /(clerk\\.)*(?=clerk\\.)/;\n } else if (str.match(/\\.clerk.accounts/)) {\n return str;\n } else {\n regex = /^(clerk\\.)*/gi;\n }\n const stripped = str.replace(regex, \"\");\n return `clerk.${stripped}`;\n}\nvar getClerkJsMajorVersionOrTag = (frontendApi, version) => {\n if (!version && isStaging(frontendApi)) {\n return \"canary\";\n }\n if (!version) {\n return \"latest\";\n }\n return version.split(\".\")[0] || \"latest\";\n};\nvar getScriptUrl = (frontendApi, { clerkJSVersion }) => {\n const noSchemeFrontendApi = frontendApi.replace(/http(s)?:\\/\\//, \"\");\n const major = getClerkJsMajorVersionOrTag(frontendApi, clerkJSVersion);\n return `https://${noSchemeFrontendApi}/npm/@clerk/clerk-js@${clerkJSVersion || major}/dist/clerk.browser.js`;\n};\nfunction isLegacyDevAccountPortalOrigin(host) {\n return LEGACY_DEV_INSTANCE_SUFFIXES.some((legacyDevSuffix) => {\n return host.startsWith(\"accounts.\") && host.endsWith(legacyDevSuffix);\n });\n}\nfunction isCurrentDevAccountPortalOrigin(host) {\n return CURRENT_DEV_INSTANCE_SUFFIXES.some((currentDevSuffix) => {\n return host.endsWith(currentDevSuffix) && !host.endsWith(\".clerk\" + currentDevSuffix);\n });\n}\nvar TRAILING_SLASH_RE = /\\/$|\\/\\?|\\/#/;\nfunction hasTrailingSlash(input = \"\", respectQueryAndFragment) {\n if (!respectQueryAndFragment) {\n return input.endsWith(\"/\");\n }\n return TRAILING_SLASH_RE.test(input);\n}\nfunction withTrailingSlash(input = \"\", respectQueryAndFragment) {\n if (!respectQueryAndFragment) {\n return input.endsWith(\"/\") ? input : input + \"/\";\n }\n if (hasTrailingSlash(input, true)) {\n return input || \"/\";\n }\n let path = input;\n let fragment = \"\";\n const fragmentIndex = input.indexOf(\"#\");\n if (fragmentIndex >= 0) {\n path = input.slice(0, fragmentIndex);\n fragment = input.slice(fragmentIndex);\n if (!path) {\n return fragment;\n }\n }\n const [s0, ...s] = path.split(\"?\");\n return s0 + \"/\" + (s.length > 0 ? `?${s.join(\"?\")}` : \"\") + fragment;\n}\nfunction withoutTrailingSlash(input = \"\", respectQueryAndFragment) {\n if (!respectQueryAndFragment) {\n return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || \"/\";\n }\n if (!hasTrailingSlash(input, true)) {\n return input || \"/\";\n }\n let path = input;\n let fragment = \"\";\n const fragmentIndex = input.indexOf(\"#\");\n if (fragmentIndex >= 0) {\n path = input.slice(0, fragmentIndex);\n fragment = input.slice(fragmentIndex);\n }\n const [s0, ...s] = path.split(\"?\");\n return (s0.slice(0, -1) || \"/\") + (s.length > 0 ? `?${s.join(\"?\")}` : \"\") + fragment;\n}\nfunction hasLeadingSlash(input = \"\") {\n return input.startsWith(\"/\");\n}\nfunction withoutLeadingSlash(input = \"\") {\n return (hasLeadingSlash(input) ? input.slice(1) : input) || \"/\";\n}\nfunction withLeadingSlash(input = \"\") {\n return hasLeadingSlash(input) ? input : \"/\" + input;\n}\nfunction cleanDoubleSlashes(input = \"\") {\n return input.split(\"://\").map((string_) => string_.replace(/\\/{2,}/g, \"/\")).join(\"://\");\n}\nfunction isNonEmptyURL(url) {\n return url && url !== \"/\";\n}\nvar JOIN_LEADING_SLASH_RE = /^\\.?\\//;\nfunction joinURL(base, ...input) {\n let url = base || \"\";\n for (const segment of input.filter((url2) => isNonEmptyURL(url2))) {\n if (url) {\n const _segment = segment.replace(JOIN_LEADING_SLASH_RE, \"\");\n url = withTrailingSlash(url) + _segment;\n } else {\n url = segment;\n }\n }\n return url;\n}\nvar ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\\d+\\-.]*?:/;\nvar isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);\n\nexport {\n parseSearchParams,\n stripScheme,\n addClerkPrefix,\n getClerkJsMajorVersionOrTag,\n getScriptUrl,\n isLegacyDevAccountPortalOrigin,\n isCurrentDevAccountPortalOrigin,\n hasTrailingSlash,\n withTrailingSlash,\n withoutTrailingSlash,\n hasLeadingSlash,\n withoutLeadingSlash,\n withLeadingSlash,\n cleanDoubleSlashes,\n isNonEmptyURL,\n joinURL,\n isAbsoluteUrl\n};\n//# sourceMappingURL=chunk-IFTVZ2LQ.mjs.map","import {\n isDevelopmentEnvironment\n} from \"./chunk-QMOEH4QX.mjs\";\n\n// src/utils/logErrorInDevMode.ts\nvar logErrorInDevMode = (message) => {\n if (isDevelopmentEnvironment()) {\n console.error(`Clerk: ${message}`);\n }\n};\n\n// src/utils/runWithExponentialBackOff.ts\nvar defaultOptions = {\n firstDelay: 125,\n maxDelay: 0,\n timeMultiple: 2,\n shouldRetry: () => true\n};\nvar sleep = async (ms) => new Promise((s) => setTimeout(s, ms));\nvar createExponentialDelayAsyncFn = (opts) => {\n let timesCalled = 0;\n const calculateDelayInMs = () => {\n const constant = opts.firstDelay;\n const base = opts.timeMultiple;\n const delay = constant * Math.pow(base, timesCalled);\n return Math.min(opts.maxDelay || delay, delay);\n };\n return async () => {\n await sleep(calculateDelayInMs());\n timesCalled++;\n };\n};\nvar runWithExponentialBackOff = async (callback, options = {}) => {\n let iterationsCount = 0;\n const { shouldRetry, firstDelay, maxDelay, timeMultiple } = {\n ...defaultOptions,\n ...options\n };\n const delay = createExponentialDelayAsyncFn({ firstDelay, maxDelay, timeMultiple });\n while (true) {\n try {\n return await callback();\n } catch (e) {\n iterationsCount++;\n if (!shouldRetry(e, iterationsCount)) {\n throw e;\n }\n await delay();\n }\n }\n};\n\n// src/utils/handleValueOrFn.ts\nfunction handleValueOrFn(value, url, defaultValue) {\n if (typeof value === \"function\") {\n return value(url);\n }\n if (typeof value !== \"undefined\") {\n return value;\n }\n if (typeof defaultValue !== \"undefined\") {\n return defaultValue;\n }\n return void 0;\n}\n\n// src/utils/fastDeepMerge.ts\nvar fastDeepMergeAndReplace = (source, target) => {\n if (!source || !target) {\n return;\n }\n for (const key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key) && source[key] !== null && typeof source[key] === `object`) {\n if (target[key] === void 0) {\n target[key] = new (Object.getPrototypeOf(source[key])).constructor();\n }\n fastDeepMergeAndReplace(source[key], target[key]);\n } else if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n};\nvar fastDeepMergeAndKeep = (source, target) => {\n if (!source || !target) {\n return;\n }\n for (const key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key) && source[key] !== null && typeof source[key] === `object`) {\n if (target[key] === void 0) {\n target[key] = new (Object.getPrototypeOf(source[key])).constructor();\n }\n fastDeepMergeAndKeep(source[key], target[key]);\n } else if (Object.prototype.hasOwnProperty.call(source, key) && target[key] === void 0) {\n target[key] = source[key];\n }\n }\n};\n\nexport {\n logErrorInDevMode,\n runWithExponentialBackOff,\n handleValueOrFn,\n fastDeepMergeAndReplace,\n fastDeepMergeAndKeep\n};\n//# sourceMappingURL=chunk-QE36JXB4.mjs.map","import {\n runWithExponentialBackOff\n} from \"./chunk-QE36JXB4.mjs\";\n\n// src/loadScript.ts\nvar NO_DOCUMENT_ERROR = \"loadScript cannot be called when document does not exist\";\nvar NO_SRC_ERROR = \"loadScript cannot be called without a src\";\nasync function loadScript(src = \"\", opts) {\n const { async, defer, beforeLoad, crossOrigin, nonce } = opts || {};\n const load = () => {\n return new Promise((resolve, reject) => {\n if (!src) {\n reject(NO_SRC_ERROR);\n }\n if (!document || !document.body) {\n reject(NO_DOCUMENT_ERROR);\n }\n const script = document.createElement(\"script\");\n crossOrigin && script.setAttribute(\"crossorigin\", crossOrigin);\n script.async = async || false;\n script.defer = defer || false;\n script.addEventListener(\"load\", () => {\n script.remove();\n resolve(script);\n });\n script.addEventListener(\"error\", () => {\n script.remove();\n reject();\n });\n script.src = src;\n script.nonce = nonce;\n beforeLoad == null ? void 0 : beforeLoad(script);\n document.body.appendChild(script);\n });\n };\n return runWithExponentialBackOff(load, { shouldRetry: (_, iterations) => iterations < 5 });\n}\n\nexport {\n loadScript\n};\n//# sourceMappingURL=chunk-DKITONR4.mjs.map","import {\n versionSelector\n} from \"./chunk-JMFHSME2.mjs\";\nimport {\n isValidProxyUrl,\n proxyUrlToAbsoluteURL\n} from \"./chunk-6NDGN2IU.mjs\";\nimport {\n addClerkPrefix\n} from \"./chunk-IFTVZ2LQ.mjs\";\nimport {\n loadScript\n} from \"./chunk-DKITONR4.mjs\";\nimport {\n buildErrorThrower\n} from \"./chunk-DL452J2I.mjs\";\nimport {\n createDevOrStagingUrlCache,\n parsePublishableKey\n} from \"./chunk-NJGRVCG7.mjs\";\n\n// src/loadClerkJsScript.ts\nvar FAILED_TO_LOAD_ERROR = \"Clerk: Failed to load Clerk\";\nvar { isDevOrStagingUrl } = createDevOrStagingUrlCache();\nvar errorThrower = buildErrorThrower({ packageName: \"@clerk/shared\" });\nfunction setClerkJsLoadingErrorPackageName(packageName) {\n errorThrower.setPackageName({ packageName });\n}\nvar loadClerkJsScript = async (opts) => {\n const existingScript = document.querySelector(\"script[data-clerk-js-script]\");\n if (existingScript) {\n return new Promise((resolve, reject) => {\n existingScript.addEventListener(\"load\", () => {\n resolve(existingScript);\n });\n existingScript.addEventListener(\"error\", () => {\n reject(FAILED_TO_LOAD_ERROR);\n });\n });\n }\n if (!(opts == null ? void 0 : opts.publishableKey)) {\n errorThrower.throwMissingPublishableKeyError();\n return;\n }\n return loadScript(clerkJsScriptUrl(opts), {\n async: true,\n crossOrigin: \"anonymous\",\n nonce: opts.nonce,\n beforeLoad: applyClerkJsScriptAttributes(opts)\n }).catch(() => {\n throw new Error(FAILED_TO_LOAD_ERROR);\n });\n};\nvar clerkJsScriptUrl = (opts) => {\n var _a, _b;\n const { clerkJSUrl, clerkJSVariant, clerkJSVersion, proxyUrl, domain, publishableKey } = opts;\n if (clerkJSUrl) {\n return clerkJSUrl;\n }\n let scriptHost = \"\";\n if (!!proxyUrl && isValidProxyUrl(proxyUrl)) {\n scriptHost = proxyUrlToAbsoluteURL(proxyUrl).replace(/http(s)?:\\/\\//, \"\");\n } else if (domain && !isDevOrStagingUrl(((_a = parsePublishableKey(publishableKey)) == null ? void 0 : _a.frontendApi) || \"\")) {\n scriptHost = addClerkPrefix(domain);\n } else {\n scriptHost = ((_b = parsePublishableKey(publishableKey)) == null ? void 0 : _b.frontendApi) || \"\";\n }\n const variant = clerkJSVariant ? `${clerkJSVariant.replace(/\\.+$/, \"\")}.` : \"\";\n const version = versionSelector(clerkJSVersion);\n return `https://${scriptHost}/npm/@clerk/clerk-js@${version}/dist/clerk.${variant}browser.js`;\n};\nvar buildClerkJsScriptAttributes = (options) => {\n const obj = {};\n if (options.publishableKey) {\n obj[\"data-clerk-publishable-key\"] = options.publishableKey;\n }\n if (options.proxyUrl) {\n obj[\"data-clerk-proxy-url\"] = options.proxyUrl;\n }\n if (options.domain) {\n obj[\"data-clerk-domain\"] = options.domain;\n }\n if (options.nonce) {\n obj.nonce = options.nonce;\n }\n return obj;\n};\nvar applyClerkJsScriptAttributes = (options) => (script) => {\n const attributes = buildClerkJsScriptAttributes(options);\n for (const attribute in attributes) {\n script.setAttribute(attribute, attributes[attribute]);\n }\n};\n\nexport {\n setClerkJsLoadingErrorPackageName,\n loadClerkJsScript,\n clerkJsScriptUrl,\n buildClerkJsScriptAttributes\n};\n//# sourceMappingURL=chunk-6O4KFNGJ.mjs.map","// src/object.ts\nvar without = (obj, ...props) => {\n const copy = { ...obj };\n for (const prop of props) {\n delete copy[prop];\n }\n return copy;\n};\nvar removeUndefined = (obj) => {\n return Object.entries(obj).reduce((acc, [key, value]) => {\n if (value !== void 0 && value !== null) {\n acc[key] = value;\n }\n return acc;\n }, {});\n};\nvar applyFunctionToObj = (obj, fn) => {\n const result = {};\n for (const key in obj) {\n result[key] = fn(obj[key], key);\n }\n return result;\n};\nvar filterProps = (obj, filter) => {\n const result = {};\n for (const key in obj) {\n if (obj[key] && filter(obj[key])) {\n result[key] = obj[key];\n }\n }\n return result;\n};\n\nexport {\n without,\n removeUndefined,\n applyFunctionToObj,\n filterProps\n};\n//# sourceMappingURL=chunk-CFXQSUF6.mjs.map","// src/deriveState.ts\nvar deriveState = (clerkLoaded, state, initialState) => {\n if (!clerkLoaded && initialState) {\n return deriveFromSsrInitialState(initialState);\n }\n return deriveFromClientSideState(state);\n};\nvar deriveFromSsrInitialState = (initialState) => {\n const userId = initialState.userId;\n const user = initialState.user;\n const sessionId = initialState.sessionId;\n const session = initialState.session;\n const organization = initialState.organization;\n const orgId = initialState.orgId;\n const orgRole = initialState.orgRole;\n const orgPermissions = initialState.orgPermissions;\n const orgSlug = initialState.orgSlug;\n const actor = initialState.actor;\n const factorVerificationAge = initialState.factorVerificationAge;\n return {\n userId,\n user,\n sessionId,\n session,\n organization,\n orgId,\n orgRole,\n orgPermissions,\n orgSlug,\n actor,\n factorVerificationAge\n };\n};\nvar deriveFromClientSideState = (state) => {\n var _a;\n const userId = state.user ? state.user.id : state.user;\n const user = state.user;\n const sessionId = state.session ? state.session.id : state.session;\n const session = state.session;\n const factorVerificationAge = state.session ? state.session.factorVerificationAge : null;\n const actor = session == null ? void 0 : session.actor;\n const organization = state.organization;\n const orgId = state.organization ? state.organization.id : state.organization;\n const orgSlug = organization == null ? void 0 : organization.slug;\n const membership = organization ? (_a = user == null ? void 0 : user.organizationMemberships) == null ? void 0 : _a.find((om) => om.organization.id === orgId) : organization;\n const orgPermissions = membership ? membership.permissions : membership;\n const orgRole = membership ? membership.role : membership;\n return {\n userId,\n user,\n sessionId,\n session,\n organization,\n orgId,\n orgRole,\n orgSlug,\n orgPermissions,\n actor,\n factorVerificationAge\n };\n};\n\nexport {\n deriveState\n};\n//# sourceMappingURL=chunk-JNWT25N5.mjs.map","// src/browser.ts\nfunction inBrowser() {\n return typeof window !== \"undefined\";\n}\nvar botAgents = [\n \"bot\",\n \"spider\",\n \"crawl\",\n \"APIs-Google\",\n \"AdsBot\",\n \"Googlebot\",\n \"mediapartners\",\n \"Google Favicon\",\n \"FeedFetcher\",\n \"Google-Read-Aloud\",\n \"DuplexWeb-Google\",\n \"googleweblight\",\n \"bing\",\n \"yandex\",\n \"baidu\",\n \"duckduck\",\n \"yahoo\",\n \"ecosia\",\n \"ia_archiver\",\n \"facebook\",\n \"instagram\",\n \"pinterest\",\n \"reddit\",\n \"slack\",\n \"twitter\",\n \"whatsapp\",\n \"youtube\",\n \"semrush\"\n];\nvar botAgentRegex = new RegExp(botAgents.join(\"|\"), \"i\");\nfunction userAgentIsRobot(userAgent) {\n return !userAgent ? false : botAgentRegex.test(userAgent);\n}\nfunction isValidBrowser() {\n const navigator = inBrowser() ? window == null ? void 0 : window.navigator : null;\n if (!navigator) {\n return false;\n }\n return !userAgentIsRobot(navigator == null ? void 0 : navigator.userAgent) && !(navigator == null ? void 0 : navigator.webdriver);\n}\nfunction isBrowserOnline() {\n var _a, _b;\n const navigator = inBrowser() ? window == null ? void 0 : window.navigator : null;\n if (!navigator) {\n return false;\n }\n const isNavigatorOnline = navigator == null ? void 0 : navigator.onLine;\n const isExperimentalConnectionOnline = ((_a = navigator == null ? void 0 : navigator.connection) == null ? void 0 : _a.rtt) !== 0 && ((_b = navigator == null ? void 0 : navigator.connection) == null ? void 0 : _b.downlink) !== 0;\n return isExperimentalConnectionOnline && isNavigatorOnline;\n}\nfunction isValidBrowserOnline() {\n return isBrowserOnline() && isValidBrowser();\n}\n\nexport {\n inBrowser,\n userAgentIsRobot,\n isValidBrowser,\n isBrowserOnline,\n isValidBrowserOnline\n};\n//# sourceMappingURL=chunk-LJ4R7M7R.mjs.map","import {\n AuthContext,\n AuthenticateWithRedirectCallback,\n ClerkLoaded,\n ClerkLoading,\n IsomorphicClerkContext,\n Protect,\n RedirectToCreateOrganization,\n RedirectToOrganizationProfile,\n RedirectToSignIn,\n RedirectToSignUp,\n RedirectToUserProfile,\n SignedIn,\n SignedOut,\n customLinkWrongProps,\n customMenuItemsIgnoredComponent,\n customPageWrongProps,\n customPagesIgnoredComponent,\n errorThrower,\n multipleChildrenInButtonComponent,\n multipleClerkProvidersError,\n organizationProfileLinkRenderedError,\n organizationProfilePageRenderedError,\n setErrorThrowerOptions,\n unsupportedNonBrowserDomainOrProxyUrlFunction,\n useAuth,\n useClerk,\n useEmailLink,\n useOrganization,\n useOrganizationList,\n useReverification,\n useSession,\n useSessionList,\n useSignIn,\n useSignUp,\n useUser,\n userButtonIgnoredComponent,\n userButtonMenuActionRenderedError,\n userButtonMenuItemLinkWrongProps,\n userButtonMenuItemsActionWrongsProps,\n userButtonMenuItemsRenderedError,\n userButtonMenuLinkRenderedError,\n userProfileLinkRenderedError,\n userProfilePageRenderedError,\n withClerk\n} from \"./chunk-GNFPFS75.mjs\";\nimport {\n __privateAdd,\n __privateGet,\n __privateMethod,\n __privateSet\n} from \"./chunk-OANWQR3B.mjs\";\n\n// src/polyfills.ts\nif (typeof window !== \"undefined\" && !window.global) {\n window.global = typeof global === \"undefined\" ? window : global;\n}\n\n// src/index.ts\nimport { setClerkJsLoadingErrorPackageName } from \"@clerk/shared/loadClerkJsScript\";\n\n// src/components/uiComponents.tsx\nimport { logErrorInDevMode as logErrorInDevMode3 } from \"@clerk/shared/utils\";\nimport React8, { createContext, createElement, useContext } from \"react\";\n\n// src/utils/childrenUtils.tsx\nimport React from \"react\";\nvar assertSingleChild = (children) => (name) => {\n try {\n return React.Children.only(children);\n } catch (e) {\n return errorThrower.throw(multipleChildrenInButtonComponent(name));\n }\n};\nvar normalizeWithDefaultValue = (children, defaultText) => {\n if (!children) {\n children = defaultText;\n }\n if (typeof children === \"string\") {\n children = /* @__PURE__ */ React.createElement(\"button\", null, children);\n }\n return children;\n};\nvar safeExecute = (cb) => (...args) => {\n if (cb && typeof cb === \"function\") {\n return cb(...args);\n }\n};\n\n// src/utils/isConstructor.ts\nfunction isConstructor(f) {\n return typeof f === \"function\";\n}\n\n// src/utils/useMaxAllowedInstancesGuard.tsx\nimport React2 from \"react\";\nvar counts = /* @__PURE__ */ new Map();\nfunction useMaxAllowedInstancesGuard(name, error, maxCount = 1) {\n React2.useEffect(() => {\n const count = counts.get(name) || 0;\n if (count == maxCount) {\n return errorThrower.throw(error);\n }\n counts.set(name, count + 1);\n return () => {\n counts.set(name, (counts.get(name) || 1) - 1);\n };\n }, []);\n}\nfunction withMaxAllowedInstancesGuard(WrappedComponent, name, error) {\n const displayName = WrappedComponent.displayName || WrappedComponent.name || name || \"Component\";\n const Hoc = (props) => {\n useMaxAllowedInstancesGuard(name, error);\n return /* @__PURE__ */ React2.createElement(WrappedComponent, { ...props });\n };\n Hoc.displayName = `withMaxAllowedInstancesGuard(${displayName})`;\n return Hoc;\n}\n\n// src/utils/useCustomElementPortal.tsx\nimport React3, { useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nvar useCustomElementPortal = (elements) => {\n const initialState = Array(elements.length).fill(null);\n const [nodes, setNodes] = useState(initialState);\n return elements.map((el, index) => ({\n id: el.id,\n mount: (node) => setNodes((prevState) => prevState.map((n, i) => i === index ? node : n)),\n unmount: () => setNodes((prevState) => prevState.map((n, i) => i === index ? null : n)),\n portal: () => /* @__PURE__ */ React3.createElement(React3.Fragment, null, nodes[index] ? createPortal(el.component, nodes[index]) : null)\n }));\n};\n\n// src/utils/useCustomPages.tsx\nimport { logErrorInDevMode } from \"@clerk/shared/utils\";\nimport React5 from \"react\";\n\n// src/utils/componentValidation.ts\nimport React4 from \"react\";\nvar isThatComponent = (v, component) => {\n return !!v && React4.isValidElement(v) && (v == null ? void 0 : v.type) === component;\n};\n\n// src/utils/useCustomPages.tsx\nvar useUserProfileCustomPages = (children, options) => {\n const reorderItemsLabels = [\"account\", \"security\"];\n return useCustomPages(\n {\n children,\n reorderItemsLabels,\n LinkComponent: UserProfileLink,\n PageComponent: UserProfilePage,\n MenuItemsComponent: MenuItems,\n componentName: \"UserProfile\"\n },\n options\n );\n};\nvar useOrganizationProfileCustomPages = (children, options) => {\n const reorderItemsLabels = [\"general\", \"members\"];\n return useCustomPages(\n {\n children,\n reorderItemsLabels,\n LinkComponent: OrganizationProfileLink,\n PageComponent: OrganizationProfilePage,\n componentName: \"OrganizationProfile\"\n },\n options\n );\n};\nvar useSanitizedChildren = (children) => {\n const sanitizedChildren = [];\n const excludedComponents = [\n OrganizationProfileLink,\n OrganizationProfilePage,\n MenuItems,\n UserProfilePage,\n UserProfileLink\n ];\n React5.Children.forEach(children, (child) => {\n if (!excludedComponents.some((component) => isThatComponent(child, component))) {\n sanitizedChildren.push(child);\n }\n });\n return sanitizedChildren;\n};\nvar useCustomPages = (params, options) => {\n const { children, LinkComponent, PageComponent, MenuItemsComponent, reorderItemsLabels, componentName } = params;\n const { allowForAnyChildren = false } = options || {};\n const validChildren = [];\n React5.Children.forEach(children, (child) => {\n if (!isThatComponent(child, PageComponent) && !isThatComponent(child, LinkComponent) && !isThatComponent(child, MenuItemsComponent)) {\n if (child && !allowForAnyChildren) {\n logErrorInDevMode(customPagesIgnoredComponent(componentName));\n }\n return;\n }\n const { props } = child;\n const { children: children2, label, url, labelIcon } = props;\n if (isThatComponent(child, PageComponent)) {\n if (isReorderItem(props, reorderItemsLabels)) {\n validChildren.push({ label });\n } else if (isCustomPage(props)) {\n validChildren.push({ label, labelIcon, children: children2, url });\n } else {\n logErrorInDevMode(customPageWrongProps(componentName));\n return;\n }\n }\n if (isThatComponent(child, LinkComponent)) {\n if (isExternalLink(props)) {\n validChildren.push({ label, labelIcon, url });\n } else {\n logErrorInDevMode(customLinkWrongProps(componentName));\n return;\n }\n }\n });\n const customPageContents = [];\n const customPageLabelIcons = [];\n const customLinkLabelIcons = [];\n validChildren.forEach((cp, index) => {\n if (isCustomPage(cp)) {\n customPageContents.push({ component: cp.children, id: index });\n customPageLabelIcons.push({ component: cp.labelIcon, id: index });\n return;\n }\n if (isExternalLink(cp)) {\n customLinkLabelIcons.push({ component: cp.labelIcon, id: index });\n }\n });\n const customPageContentsPortals = useCustomElementPortal(customPageContents);\n const customPageLabelIconsPortals = useCustomElementPortal(customPageLabelIcons);\n const customLinkLabelIconsPortals = useCustomElementPortal(customLinkLabelIcons);\n const customPages = [];\n const customPagesPortals = [];\n validChildren.forEach((cp, index) => {\n if (isReorderItem(cp, reorderItemsLabels)) {\n customPages.push({ label: cp.label });\n return;\n }\n if (isCustomPage(cp)) {\n const {\n portal: contentPortal,\n mount,\n unmount\n } = customPageContentsPortals.find((p) => p.id === index);\n const {\n portal: labelPortal,\n mount: mountIcon,\n unmount: unmountIcon\n } = customPageLabelIconsPortals.find((p) => p.id === index);\n customPages.push({ label: cp.label, url: cp.url, mount, unmount, mountIcon, unmountIcon });\n customPagesPortals.push(contentPortal);\n customPagesPortals.push(labelPortal);\n return;\n }\n if (isExternalLink(cp)) {\n const {\n portal: labelPortal,\n mount: mountIcon,\n unmount: unmountIcon\n } = customLinkLabelIconsPortals.find((p) => p.id === index);\n customPages.push({ label: cp.label, url: cp.url, mountIcon, unmountIcon });\n customPagesPortals.push(labelPortal);\n return;\n }\n });\n return { customPages, customPagesPortals };\n};\nvar isReorderItem = (childProps, validItems) => {\n const { children, label, url, labelIcon } = childProps;\n return !children && !url && !labelIcon && validItems.some((v) => v === label);\n};\nvar isCustomPage = (childProps) => {\n const { children, label, url, labelIcon } = childProps;\n return !!children && !!url && !!labelIcon && !!label;\n};\nvar isExternalLink = (childProps) => {\n const { children, label, url, labelIcon } = childProps;\n return !children && !!url && !!labelIcon && !!label;\n};\n\n// src/utils/useCustomMenuItems.tsx\nimport { logErrorInDevMode as logErrorInDevMode2 } from \"@clerk/shared/utils\";\nimport React6 from \"react\";\nvar useUserButtonCustomMenuItems = (children) => {\n const reorderItemsLabels = [\"manageAccount\", \"signOut\"];\n return useCustomMenuItems({\n children,\n reorderItemsLabels,\n MenuItemsComponent: MenuItems,\n MenuActionComponent: MenuAction,\n MenuLinkComponent: MenuLink,\n UserProfileLinkComponent: UserProfileLink,\n UserProfilePageComponent: UserProfilePage\n });\n};\nvar useCustomMenuItems = ({\n children,\n MenuItemsComponent,\n MenuActionComponent,\n MenuLinkComponent,\n UserProfileLinkComponent,\n UserProfilePageComponent,\n reorderItemsLabels\n}) => {\n const validChildren = [];\n const customMenuItems = [];\n const customMenuItemsPortals = [];\n React6.Children.forEach(children, (child) => {\n if (!isThatComponent(child, MenuItemsComponent) && !isThatComponent(child, UserProfileLinkComponent) && !isThatComponent(child, UserProfilePageComponent)) {\n if (child) {\n logErrorInDevMode2(userButtonIgnoredComponent);\n }\n return;\n }\n if (isThatComponent(child, UserProfileLinkComponent) || isThatComponent(child, UserProfilePageComponent)) {\n return;\n }\n const { props } = child;\n React6.Children.forEach(props.children, (child2) => {\n if (!isThatComponent(child2, MenuActionComponent) && !isThatComponent(child2, MenuLinkComponent)) {\n if (child2) {\n logErrorInDevMode2(customMenuItemsIgnoredComponent);\n }\n return;\n }\n const { props: props2 } = child2;\n const { label, labelIcon, href, onClick, open } = props2;\n if (isThatComponent(child2, MenuActionComponent)) {\n if (isReorderItem2(props2, reorderItemsLabels)) {\n validChildren.push({ label });\n } else if (isCustomMenuItem(props2)) {\n const baseItem = {\n label,\n labelIcon\n };\n if (onClick !== void 0) {\n validChildren.push({\n ...baseItem,\n onClick\n });\n } else if (open !== void 0) {\n validChildren.push({\n ...baseItem,\n open: open.startsWith(\"/\") ? open : `/${open}`\n });\n } else {\n logErrorInDevMode2(\"Custom menu item must have either onClick or open property\");\n return;\n }\n } else {\n logErrorInDevMode2(userButtonMenuItemsActionWrongsProps);\n return;\n }\n }\n if (isThatComponent(child2, MenuLinkComponent)) {\n if (isExternalLink2(props2)) {\n validChildren.push({ label, labelIcon, href });\n } else {\n logErrorInDevMode2(userButtonMenuItemLinkWrongProps);\n return;\n }\n }\n });\n });\n const customMenuItemLabelIcons = [];\n const customLinkLabelIcons = [];\n validChildren.forEach((mi, index) => {\n if (isCustomMenuItem(mi)) {\n customMenuItemLabelIcons.push({ component: mi.labelIcon, id: index });\n }\n if (isExternalLink2(mi)) {\n customLinkLabelIcons.push({ component: mi.labelIcon, id: index });\n }\n });\n const customMenuItemLabelIconsPortals = useCustomElementPortal(customMenuItemLabelIcons);\n const customLinkLabelIconsPortals = useCustomElementPortal(customLinkLabelIcons);\n validChildren.forEach((mi, index) => {\n if (isReorderItem2(mi, reorderItemsLabels)) {\n customMenuItems.push({\n label: mi.label\n });\n }\n if (isCustomMenuItem(mi)) {\n const {\n portal: iconPortal,\n mount: mountIcon,\n unmount: unmountIcon\n } = customMenuItemLabelIconsPortals.find((p) => p.id === index);\n const menuItem = {\n label: mi.label,\n mountIcon,\n unmountIcon\n };\n if (\"onClick\" in mi) {\n menuItem.onClick = mi.onClick;\n } else if (\"open\" in mi) {\n menuItem.open = mi.open;\n }\n customMenuItems.push(menuItem);\n customMenuItemsPortals.push(iconPortal);\n }\n if (isExternalLink2(mi)) {\n const {\n portal: iconPortal,\n mount: mountIcon,\n unmount: unmountIcon\n } = customLinkLabelIconsPortals.find((p) => p.id === index);\n customMenuItems.push({\n label: mi.label,\n href: mi.href,\n mountIcon,\n unmountIcon\n });\n customMenuItemsPortals.push(iconPortal);\n }\n });\n return { customMenuItems, customMenuItemsPortals };\n};\nvar isReorderItem2 = (childProps, validItems) => {\n const { children, label, onClick, labelIcon } = childProps;\n return !children && !onClick && !labelIcon && validItems.some((v) => v === label);\n};\nvar isCustomMenuItem = (childProps) => {\n const { label, labelIcon, onClick, open } = childProps;\n return !!labelIcon && !!label && (typeof onClick === \"function\" || typeof open === \"string\");\n};\nvar isExternalLink2 = (childProps) => {\n const { label, href, labelIcon } = childProps;\n return !!href && !!labelIcon && !!label;\n};\n\n// src/utils/useWaitForComponentMount.ts\nimport { useEffect, useRef, useState as useState2 } from \"react\";\nfunction waitForElementChildren(options) {\n const { root = document == null ? void 0 : document.body, selector, timeout = 0 } = options;\n return new Promise((resolve, reject) => {\n if (!root) {\n reject(new Error(\"No root element provided\"));\n return;\n }\n let elementToWatch = root;\n if (selector) {\n elementToWatch = root == null ? void 0 : root.querySelector(selector);\n }\n const isElementAlreadyPresent = (elementToWatch == null ? void 0 : elementToWatch.childElementCount) && elementToWatch.childElementCount > 0;\n if (isElementAlreadyPresent) {\n resolve();\n return;\n }\n const observer = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === \"childList\") {\n if (!elementToWatch && selector) {\n elementToWatch = root == null ? void 0 : root.querySelector(selector);\n }\n if ((elementToWatch == null ? void 0 : elementToWatch.childElementCount) && elementToWatch.childElementCount > 0) {\n observer.disconnect();\n resolve();\n return;\n }\n }\n }\n });\n observer.observe(root, { childList: true, subtree: true });\n if (timeout > 0) {\n setTimeout(() => {\n observer.disconnect();\n reject(new Error(`Timeout waiting for element children`));\n }, timeout);\n }\n });\n}\nfunction useWaitForComponentMount(component) {\n const watcherRef = useRef();\n const [status, setStatus] = useState2(\"rendering\");\n useEffect(() => {\n if (!component) {\n throw new Error(\"Clerk: no component name provided, unable to detect mount.\");\n }\n if (typeof window !== \"undefined\" && !watcherRef.current) {\n watcherRef.current = waitForElementChildren({ selector: `[data-clerk-component=\"${component}\"]` }).then(() => {\n setStatus(\"rendered\");\n }).catch(() => {\n setStatus(\"error\");\n });\n }\n }, [component]);\n return status;\n}\n\n// src/components/ClerkHostRenderer.tsx\nimport { without } from \"@clerk/shared/object\";\nimport { isDeeplyEqual } from \"@clerk/shared/react\";\nimport React7 from \"react\";\nvar isMountProps = (props) => {\n return \"mount\" in props;\n};\nvar isOpenProps = (props) => {\n return \"open\" in props;\n};\nvar ClerkHostRenderer = class extends React7.PureComponent {\n constructor() {\n super(...arguments);\n this.rootRef = React7.createRef();\n }\n componentDidUpdate(_prevProps) {\n var _a, _b, _c, _d;\n if (!isMountProps(_prevProps) || !isMountProps(this.props)) {\n return;\n }\n const prevProps = without(_prevProps.props, \"customPages\", \"customMenuItems\", \"children\");\n const newProps = without(this.props.props, \"customPages\", \"customMenuItems\", \"children\");\n const customPagesChanged = ((_a = prevProps.customPages) == null ? void 0 : _a.length) !== ((_b = newProps.customPages) == null ? void 0 : _b.length);\n const customMenuItemsChanged = ((_c = prevProps.customMenuItems) == null ? void 0 : _c.length) !== ((_d = newProps.customMenuItems) == null ? void 0 : _d.length);\n if (!isDeeplyEqual(prevProps, newProps) || customPagesChanged || customMenuItemsChanged) {\n if (this.rootRef.current) {\n this.props.updateProps({ node: this.rootRef.current, props: this.props.props });\n }\n }\n }\n componentDidMount() {\n if (this.rootRef.current) {\n if (isMountProps(this.props)) {\n this.props.mount(this.rootRef.current, this.props.props);\n }\n if (isOpenProps(this.props)) {\n this.props.open(this.props.props);\n }\n }\n }\n componentWillUnmount() {\n if (this.rootRef.current) {\n if (isMountProps(this.props)) {\n this.props.unmount(this.rootRef.current);\n }\n if (isOpenProps(this.props)) {\n this.props.close();\n }\n }\n }\n render() {\n const { hideRootHtmlElement = false } = this.props;\n const rootAttributes = {\n ref: this.rootRef,\n ...this.props.rootProps,\n ...this.props.component && { \"data-clerk-component\": this.props.component }\n };\n return /* @__PURE__ */ React7.createElement(React7.Fragment, null, !hideRootHtmlElement && /* @__PURE__ */ React7.createElement(\"div\", { ...rootAttributes }), this.props.children);\n }\n};\n\n// src/components/uiComponents.tsx\nvar CustomPortalsRenderer = (props) => {\n var _a, _b;\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, (_a = props == null ? void 0 : props.customPagesPortals) == null ? void 0 : _a.map((portal, index) => createElement(portal, { key: index })), (_b = props == null ? void 0 : props.customMenuItemsPortals) == null ? void 0 : _b.map((portal, index) => createElement(portal, { key: index })));\n};\nvar SignIn = withClerk(\n ({ clerk, component, fallback, ...props }) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === \"rendering\" || !clerk.loaded;\n const rendererRootProps = {\n ...shouldShowFallback && fallback && { style: { display: \"none\" } }\n };\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(\n ClerkHostRenderer,\n {\n component,\n mount: clerk.mountSignIn,\n unmount: clerk.unmountSignIn,\n updateProps: clerk.__unstable__updateProps,\n props,\n rootProps: rendererRootProps\n }\n ));\n },\n { component: \"SignIn\", renderWhileLoading: true }\n);\nvar SignUp = withClerk(\n ({ clerk, component, fallback, ...props }) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === \"rendering\" || !clerk.loaded;\n const rendererRootProps = {\n ...shouldShowFallback && fallback && { style: { display: \"none\" } }\n };\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(\n ClerkHostRenderer,\n {\n component,\n mount: clerk.mountSignUp,\n unmount: clerk.unmountSignUp,\n updateProps: clerk.__unstable__updateProps,\n props,\n rootProps: rendererRootProps\n }\n ));\n },\n { component: \"SignUp\", renderWhileLoading: true }\n);\nfunction UserProfilePage({ children }) {\n logErrorInDevMode3(userProfilePageRenderedError);\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);\n}\nfunction UserProfileLink({ children }) {\n logErrorInDevMode3(userProfileLinkRenderedError);\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);\n}\nvar _UserProfile = withClerk(\n ({\n clerk,\n component,\n fallback,\n ...props\n }) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === \"rendering\" || !clerk.loaded;\n const rendererRootProps = {\n ...shouldShowFallback && fallback && { style: { display: \"none\" } }\n };\n const { customPages, customPagesPortals } = useUserProfileCustomPages(props.children);\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, /* @__PURE__ */ React8.createElement(\n ClerkHostRenderer,\n {\n component,\n mount: clerk.mountUserProfile,\n unmount: clerk.unmountUserProfile,\n updateProps: clerk.__unstable__updateProps,\n props: { ...props, customPages },\n rootProps: rendererRootProps\n },\n /* @__PURE__ */ React8.createElement(CustomPortalsRenderer, { customPagesPortals })\n ));\n },\n { component: \"UserProfile\", renderWhileLoading: true }\n);\nvar UserProfile = Object.assign(_UserProfile, {\n Page: UserProfilePage,\n Link: UserProfileLink\n});\nvar UserButtonContext = createContext({\n mount: () => {\n },\n unmount: () => {\n },\n updateProps: () => {\n }\n});\nvar _UserButton = withClerk(\n ({\n clerk,\n component,\n fallback,\n ...props\n }) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === \"rendering\" || !clerk.loaded;\n const rendererRootProps = {\n ...shouldShowFallback && fallback && { style: { display: \"none\" } }\n };\n const { customPages, customPagesPortals } = useUserProfileCustomPages(props.children, {\n allowForAnyChildren: !!props.__experimental_asProvider\n });\n const userProfileProps = Object.assign(props.userProfileProps || {}, { customPages });\n const { customMenuItems, customMenuItemsPortals } = useUserButtonCustomMenuItems(props.children);\n const sanitizedChildren = useSanitizedChildren(props.children);\n const passableProps = {\n mount: clerk.mountUserButton,\n unmount: clerk.unmountUserButton,\n updateProps: clerk.__unstable__updateProps,\n props: { ...props, userProfileProps, customMenuItems }\n };\n const portalProps = {\n customPagesPortals,\n customMenuItemsPortals\n };\n return /* @__PURE__ */ React8.createElement(UserButtonContext.Provider, { value: passableProps }, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(\n ClerkHostRenderer,\n {\n component,\n ...passableProps,\n hideRootHtmlElement: !!props.__experimental_asProvider,\n rootProps: rendererRootProps\n },\n props.__experimental_asProvider ? sanitizedChildren : null,\n /* @__PURE__ */ React8.createElement(CustomPortalsRenderer, { ...portalProps })\n ));\n },\n { component: \"UserButton\", renderWhileLoading: true }\n);\nfunction MenuItems({ children }) {\n logErrorInDevMode3(userButtonMenuItemsRenderedError);\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);\n}\nfunction MenuAction({ children }) {\n logErrorInDevMode3(userButtonMenuActionRenderedError);\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);\n}\nfunction MenuLink({ children }) {\n logErrorInDevMode3(userButtonMenuLinkRenderedError);\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);\n}\nfunction UserButtonOutlet(outletProps) {\n const providerProps = useContext(UserButtonContext);\n const portalProps = {\n ...providerProps,\n props: {\n ...providerProps.props,\n ...outletProps\n }\n };\n return /* @__PURE__ */ React8.createElement(ClerkHostRenderer, { ...portalProps });\n}\nvar UserButton = Object.assign(_UserButton, {\n UserProfilePage,\n UserProfileLink,\n MenuItems,\n Action: MenuAction,\n Link: MenuLink,\n __experimental_Outlet: UserButtonOutlet\n});\nfunction OrganizationProfilePage({ children }) {\n logErrorInDevMode3(organizationProfilePageRenderedError);\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);\n}\nfunction OrganizationProfileLink({ children }) {\n logErrorInDevMode3(organizationProfileLinkRenderedError);\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);\n}\nvar _OrganizationProfile = withClerk(\n ({\n clerk,\n component,\n fallback,\n ...props\n }) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === \"rendering\" || !clerk.loaded;\n const rendererRootProps = {\n ...shouldShowFallback && fallback && { style: { display: \"none\" } }\n };\n const { customPages, customPagesPortals } = useOrganizationProfileCustomPages(props.children);\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(\n ClerkHostRenderer,\n {\n component,\n mount: clerk.mountOrganizationProfile,\n unmount: clerk.unmountOrganizationProfile,\n updateProps: clerk.__unstable__updateProps,\n props: { ...props, customPages },\n rootProps: rendererRootProps\n },\n /* @__PURE__ */ React8.createElement(CustomPortalsRenderer, { customPagesPortals })\n ));\n },\n { component: \"OrganizationProfile\", renderWhileLoading: true }\n);\nvar OrganizationProfile = Object.assign(_OrganizationProfile, {\n Page: OrganizationProfilePage,\n Link: OrganizationProfileLink\n});\nvar CreateOrganization = withClerk(\n ({ clerk, component, fallback, ...props }) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === \"rendering\" || !clerk.loaded;\n const rendererRootProps = {\n ...shouldShowFallback && fallback && { style: { display: \"none\" } }\n };\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(\n ClerkHostRenderer,\n {\n component,\n mount: clerk.mountCreateOrganization,\n unmount: clerk.unmountCreateOrganization,\n updateProps: clerk.__unstable__updateProps,\n props,\n rootProps: rendererRootProps\n }\n ));\n },\n { component: \"CreateOrganization\", renderWhileLoading: true }\n);\nvar OrganizationSwitcherContext = createContext({\n mount: () => {\n },\n unmount: () => {\n },\n updateProps: () => {\n }\n});\nvar _OrganizationSwitcher = withClerk(\n ({\n clerk,\n component,\n fallback,\n ...props\n }) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === \"rendering\" || !clerk.loaded;\n const rendererRootProps = {\n ...shouldShowFallback && fallback && { style: { display: \"none\" } }\n };\n const { customPages, customPagesPortals } = useOrganizationProfileCustomPages(props.children, {\n allowForAnyChildren: !!props.__experimental_asProvider\n });\n const organizationProfileProps = Object.assign(props.organizationProfileProps || {}, { customPages });\n const sanitizedChildren = useSanitizedChildren(props.children);\n const passableProps = {\n mount: clerk.mountOrganizationSwitcher,\n unmount: clerk.unmountOrganizationSwitcher,\n updateProps: clerk.__unstable__updateProps,\n props: { ...props, organizationProfileProps },\n rootProps: rendererRootProps,\n component\n };\n clerk.__experimental_prefetchOrganizationSwitcher();\n return /* @__PURE__ */ React8.createElement(OrganizationSwitcherContext.Provider, { value: passableProps }, /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(\n ClerkHostRenderer,\n {\n ...passableProps,\n hideRootHtmlElement: !!props.__experimental_asProvider\n },\n props.__experimental_asProvider ? sanitizedChildren : null,\n /* @__PURE__ */ React8.createElement(CustomPortalsRenderer, { customPagesPortals })\n )));\n },\n { component: \"OrganizationSwitcher\", renderWhileLoading: true }\n);\nfunction OrganizationSwitcherOutlet(outletProps) {\n const providerProps = useContext(OrganizationSwitcherContext);\n const portalProps = {\n ...providerProps,\n props: {\n ...providerProps.props,\n ...outletProps\n }\n };\n return /* @__PURE__ */ React8.createElement(ClerkHostRenderer, { ...portalProps });\n}\nvar OrganizationSwitcher = Object.assign(_OrganizationSwitcher, {\n OrganizationProfilePage,\n OrganizationProfileLink,\n __experimental_Outlet: OrganizationSwitcherOutlet\n});\nvar OrganizationList = withClerk(\n ({ clerk, component, fallback, ...props }) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === \"rendering\" || !clerk.loaded;\n const rendererRootProps = {\n ...shouldShowFallback && fallback && { style: { display: \"none\" } }\n };\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(\n ClerkHostRenderer,\n {\n component,\n mount: clerk.mountOrganizationList,\n unmount: clerk.unmountOrganizationList,\n updateProps: clerk.__unstable__updateProps,\n props,\n rootProps: rendererRootProps\n }\n ));\n },\n { component: \"OrganizationList\", renderWhileLoading: true }\n);\nvar GoogleOneTap = withClerk(\n ({ clerk, component, fallback, ...props }) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === \"rendering\" || !clerk.loaded;\n const rendererRootProps = {\n ...shouldShowFallback && fallback && { style: { display: \"none\" } }\n };\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(\n ClerkHostRenderer,\n {\n component,\n open: clerk.openGoogleOneTap,\n close: clerk.closeGoogleOneTap,\n updateProps: clerk.__unstable__updateProps,\n props,\n rootProps: rendererRootProps\n }\n ));\n },\n { component: \"GoogleOneTap\", renderWhileLoading: true }\n);\nvar Waitlist = withClerk(\n ({ clerk, component, fallback, ...props }) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === \"rendering\" || !clerk.loaded;\n const rendererRootProps = {\n ...shouldShowFallback && fallback && { style: { display: \"none\" } }\n };\n return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(\n ClerkHostRenderer,\n {\n component,\n mount: clerk.mountWaitlist,\n unmount: clerk.unmountWaitlist,\n updateProps: clerk.__unstable__updateProps,\n props,\n rootProps: rendererRootProps\n }\n ));\n },\n { component: \"Waitlist\", renderWhileLoading: true }\n);\n\n// src/components/SignInButton.tsx\nimport React9 from \"react\";\nvar SignInButton = withClerk(\n ({ clerk, children, ...props }) => {\n const {\n signUpFallbackRedirectUrl,\n forceRedirectUrl,\n fallbackRedirectUrl,\n signUpForceRedirectUrl,\n mode,\n initialValues,\n ...rest\n } = props;\n children = normalizeWithDefaultValue(children, \"Sign in\");\n const child = assertSingleChild(children)(\"SignInButton\");\n const clickHandler = () => {\n const opts = {\n forceRedirectUrl,\n fallbackRedirectUrl,\n signUpFallbackRedirectUrl,\n signUpForceRedirectUrl,\n initialValues\n };\n if (mode === \"modal\") {\n return clerk.openSignIn(opts);\n }\n return clerk.redirectToSignIn({\n ...opts,\n signInFallbackRedirectUrl: fallbackRedirectUrl,\n signInForceRedirectUrl: forceRedirectUrl\n });\n };\n const wrappedChildClickHandler = async (e) => {\n if (child && typeof child === \"object\" && \"props\" in child) {\n await safeExecute(child.props.onClick)(e);\n }\n return clickHandler();\n };\n const childProps = { ...rest, onClick: wrappedChildClickHandler };\n return React9.cloneElement(child, childProps);\n },\n { component: \"SignInButton\", renderWhileLoading: true }\n);\n\n// src/components/SignUpButton.tsx\nimport React10 from \"react\";\nvar SignUpButton = withClerk(\n ({ clerk, children, ...props }) => {\n const {\n fallbackRedirectUrl,\n forceRedirectUrl,\n signInFallbackRedirectUrl,\n signInForceRedirectUrl,\n mode,\n unsafeMetadata,\n initialValues,\n ...rest\n } = props;\n children = normalizeWithDefaultValue(children, \"Sign up\");\n const child = assertSingleChild(children)(\"SignUpButton\");\n const clickHandler = () => {\n const opts = {\n fallbackRedirectUrl,\n forceRedirectUrl,\n signInFallbackRedirectUrl,\n signInForceRedirectUrl,\n unsafeMetadata,\n initialValues\n };\n if (mode === \"modal\") {\n return clerk.openSignUp(opts);\n }\n return clerk.redirectToSignUp({\n ...opts,\n signUpFallbackRedirectUrl: fallbackRedirectUrl,\n signUpForceRedirectUrl: forceRedirectUrl\n });\n };\n const wrappedChildClickHandler = async (e) => {\n if (child && typeof child === \"object\" && \"props\" in child) {\n await safeExecute(child.props.onClick)(e);\n }\n return clickHandler();\n };\n const childProps = { ...rest, onClick: wrappedChildClickHandler };\n return React10.cloneElement(child, childProps);\n },\n { component: \"SignUpButton\", renderWhileLoading: true }\n);\n\n// src/components/SignOutButton.tsx\nimport React11 from \"react\";\nvar SignOutButton = withClerk(\n ({ clerk, children, ...props }) => {\n const { redirectUrl = \"/\", signOutOptions, ...rest } = props;\n children = normalizeWithDefaultValue(children, \"Sign out\");\n const child = assertSingleChild(children)(\"SignOutButton\");\n const clickHandler = () => clerk.signOut({ redirectUrl, ...signOutOptions });\n const wrappedChildClickHandler = async (e) => {\n await safeExecute(child.props.onClick)(e);\n return clickHandler();\n };\n const childProps = { ...rest, onClick: wrappedChildClickHandler };\n return React11.cloneElement(child, childProps);\n },\n { component: \"SignOutButton\", renderWhileLoading: true }\n);\n\n// src/components/SignInWithMetamaskButton.tsx\nimport React12 from \"react\";\nvar SignInWithMetamaskButton = withClerk(\n ({ clerk, children, ...props }) => {\n const { redirectUrl, ...rest } = props;\n children = normalizeWithDefaultValue(children, \"Sign in with Metamask\");\n const child = assertSingleChild(children)(\"SignInWithMetamaskButton\");\n const clickHandler = async () => {\n async function authenticate() {\n await clerk.authenticateWithMetamask({ redirectUrl: redirectUrl || void 0 });\n }\n void authenticate();\n };\n const wrappedChildClickHandler = async (e) => {\n await safeExecute(child.props.onClick)(e);\n return clickHandler();\n };\n const childProps = { ...rest, onClick: wrappedChildClickHandler };\n return React12.cloneElement(child, childProps);\n },\n { component: \"SignInWithMetamask\", renderWhileLoading: true }\n);\n\n// src/contexts/ClerkProvider.tsx\nimport { isPublishableKey } from \"@clerk/shared/keys\";\nimport React14 from \"react\";\n\n// src/contexts/ClerkContextProvider.tsx\nimport { deriveState } from \"@clerk/shared/deriveState\";\nimport { ClientContext, OrganizationProvider, SessionContext, UserContext } from \"@clerk/shared/react\";\nimport React13 from \"react\";\n\n// src/isomorphicClerk.ts\nimport { inBrowser } from \"@clerk/shared/browser\";\nimport { loadClerkJsScript } from \"@clerk/shared/loadClerkJsScript\";\nimport { handleValueOrFn } from \"@clerk/shared/utils\";\nif (typeof __BUILD_DISABLE_RHC__ === \"undefined\") {\n globalThis.__BUILD_DISABLE_RHC__ = false;\n}\nvar SDK_METADATA = {\n name: \"@clerk/clerk-react\",\n version: \"5.21.0\",\n environment: process.env.NODE_ENV\n};\nvar _loaded, _domain, _proxyUrl, _publishableKey, _instance, _IsomorphicClerk_instances, waitForClerkJS_fn;\nvar _IsomorphicClerk = class _IsomorphicClerk {\n constructor(options) {\n __privateAdd(this, _IsomorphicClerk_instances);\n this.clerkjs = null;\n this.preopenOneTap = null;\n this.preopenUserVerification = null;\n this.preopenSignIn = null;\n this.preopenSignUp = null;\n this.preopenUserProfile = null;\n this.preopenOrganizationProfile = null;\n this.preopenCreateOrganization = null;\n this.preOpenWaitlist = null;\n this.premountSignInNodes = /* @__PURE__ */ new Map();\n this.premountSignUpNodes = /* @__PURE__ */ new Map();\n this.premountUserProfileNodes = /* @__PURE__ */ new Map();\n this.premountUserButtonNodes = /* @__PURE__ */ new Map();\n this.premountOrganizationProfileNodes = /* @__PURE__ */ new Map();\n this.premountCreateOrganizationNodes = /* @__PURE__ */ new Map();\n this.premountOrganizationSwitcherNodes = /* @__PURE__ */ new Map();\n this.premountOrganizationListNodes = /* @__PURE__ */ new Map();\n this.premountMethodCalls = /* @__PURE__ */ new Map();\n this.premountWaitlistNodes = /* @__PURE__ */ new Map();\n // A separate Map of `addListener` method calls to handle multiple listeners.\n this.premountAddListenerCalls = /* @__PURE__ */ new Map();\n this.loadedListeners = [];\n __privateAdd(this, _loaded, false);\n __privateAdd(this, _domain);\n __privateAdd(this, _proxyUrl);\n __privateAdd(this, _publishableKey);\n this.buildSignInUrl = (opts) => {\n const callback = () => {\n var _a;\n return ((_a = this.clerkjs) == null ? void 0 : _a.buildSignInUrl(opts)) || \"\";\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"buildSignInUrl\", callback);\n }\n };\n this.buildSignUpUrl = (opts) => {\n const callback = () => {\n var _a;\n return ((_a = this.clerkjs) == null ? void 0 : _a.buildSignUpUrl(opts)) || \"\";\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"buildSignUpUrl\", callback);\n }\n };\n this.buildAfterSignInUrl = () => {\n const callback = () => {\n var _a;\n return ((_a = this.clerkjs) == null ? void 0 : _a.buildAfterSignInUrl()) || \"\";\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"buildAfterSignInUrl\", callback);\n }\n };\n this.buildAfterSignUpUrl = () => {\n const callback = () => {\n var _a;\n return ((_a = this.clerkjs) == null ? void 0 : _a.buildAfterSignUpUrl()) || \"\";\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"buildAfterSignUpUrl\", callback);\n }\n };\n this.buildAfterSignOutUrl = () => {\n const callback = () => {\n var _a;\n return ((_a = this.clerkjs) == null ? void 0 : _a.buildAfterSignOutUrl()) || \"\";\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"buildAfterSignOutUrl\", callback);\n }\n };\n this.buildAfterMultiSessionSingleSignOutUrl = () => {\n const callback = () => {\n var _a;\n return ((_a = this.clerkjs) == null ? void 0 : _a.buildAfterMultiSessionSingleSignOutUrl()) || \"\";\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"buildAfterMultiSessionSingleSignOutUrl\", callback);\n }\n };\n this.buildUserProfileUrl = () => {\n const callback = () => {\n var _a;\n return ((_a = this.clerkjs) == null ? void 0 : _a.buildUserProfileUrl()) || \"\";\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"buildUserProfileUrl\", callback);\n }\n };\n this.buildCreateOrganizationUrl = () => {\n const callback = () => {\n var _a;\n return ((_a = this.clerkjs) == null ? void 0 : _a.buildCreateOrganizationUrl()) || \"\";\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"buildCreateOrganizationUrl\", callback);\n }\n };\n this.buildOrganizationProfileUrl = () => {\n const callback = () => {\n var _a;\n return ((_a = this.clerkjs) == null ? void 0 : _a.buildOrganizationProfileUrl()) || \"\";\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"buildOrganizationProfileUrl\", callback);\n }\n };\n this.buildWaitlistUrl = () => {\n const callback = () => {\n var _a;\n return ((_a = this.clerkjs) == null ? void 0 : _a.buildWaitlistUrl()) || \"\";\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"buildWaitlistUrl\", callback);\n }\n };\n this.buildUrlWithAuth = (to) => {\n const callback = () => {\n var _a;\n return ((_a = this.clerkjs) == null ? void 0 : _a.buildUrlWithAuth(to)) || \"\";\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"buildUrlWithAuth\", callback);\n }\n };\n this.handleUnauthenticated = () => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.handleUnauthenticated();\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n void callback();\n } else {\n this.premountMethodCalls.set(\"handleUnauthenticated\", callback);\n }\n };\n this.addOnLoaded = (cb) => {\n this.loadedListeners.push(cb);\n if (this.loaded) {\n this.emitLoaded();\n }\n };\n this.emitLoaded = () => {\n this.loadedListeners.forEach((cb) => cb());\n this.loadedListeners = [];\n };\n this.hydrateClerkJS = (clerkjs) => {\n if (!clerkjs) {\n throw new Error(\"Failed to hydrate latest Clerk JS\");\n }\n this.clerkjs = clerkjs;\n this.premountMethodCalls.forEach((cb) => cb());\n this.premountAddListenerCalls.forEach((listenerHandlers, listener) => {\n listenerHandlers.nativeUnsubscribe = clerkjs.addListener(listener);\n });\n if (this.preopenSignIn !== null) {\n clerkjs.openSignIn(this.preopenSignIn);\n }\n if (this.preopenSignUp !== null) {\n clerkjs.openSignUp(this.preopenSignUp);\n }\n if (this.preopenUserProfile !== null) {\n clerkjs.openUserProfile(this.preopenUserProfile);\n }\n if (this.preopenUserVerification !== null) {\n clerkjs.__internal_openReverification(this.preopenUserVerification);\n }\n if (this.preopenOneTap !== null) {\n clerkjs.openGoogleOneTap(this.preopenOneTap);\n }\n if (this.preopenOrganizationProfile !== null) {\n clerkjs.openOrganizationProfile(this.preopenOrganizationProfile);\n }\n if (this.preopenCreateOrganization !== null) {\n clerkjs.openCreateOrganization(this.preopenCreateOrganization);\n }\n if (this.preOpenWaitlist !== null) {\n clerkjs.openWaitlist(this.preOpenWaitlist);\n }\n this.premountSignInNodes.forEach((props, node) => {\n clerkjs.mountSignIn(node, props);\n });\n this.premountSignUpNodes.forEach((props, node) => {\n clerkjs.mountSignUp(node, props);\n });\n this.premountUserProfileNodes.forEach((props, node) => {\n clerkjs.mountUserProfile(node, props);\n });\n this.premountUserButtonNodes.forEach((props, node) => {\n clerkjs.mountUserButton(node, props);\n });\n this.premountOrganizationListNodes.forEach((props, node) => {\n clerkjs.mountOrganizationList(node, props);\n });\n this.premountWaitlistNodes.forEach((props, node) => {\n clerkjs.mountWaitlist(node, props);\n });\n __privateSet(this, _loaded, true);\n this.emitLoaded();\n return this.clerkjs;\n };\n this.__unstable__updateProps = async (props) => {\n const clerkjs = await __privateMethod(this, _IsomorphicClerk_instances, waitForClerkJS_fn).call(this);\n if (clerkjs && \"__unstable__updateProps\" in clerkjs) {\n return clerkjs.__unstable__updateProps(props);\n }\n };\n /**\n * `setActive` can be used to set the active session and/or organization.\n */\n this.setActive = ({ session, organization, beforeEmit, redirectUrl }) => {\n if (this.clerkjs) {\n return this.clerkjs.setActive({ session, organization, beforeEmit, redirectUrl });\n } else {\n return Promise.reject();\n }\n };\n this.openSignIn = (props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.openSignIn(props);\n } else {\n this.preopenSignIn = props;\n }\n };\n this.closeSignIn = () => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.closeSignIn();\n } else {\n this.preopenSignIn = null;\n }\n };\n this.__internal_openReverification = (props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.__internal_openReverification(props);\n } else {\n this.preopenUserVerification = props;\n }\n };\n this.__internal_closeReverification = () => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.__internal_closeReverification();\n } else {\n this.preopenUserVerification = null;\n }\n };\n this.openGoogleOneTap = (props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.openGoogleOneTap(props);\n } else {\n this.preopenOneTap = props;\n }\n };\n this.closeGoogleOneTap = () => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.closeGoogleOneTap();\n } else {\n this.preopenOneTap = null;\n }\n };\n this.openUserProfile = (props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.openUserProfile(props);\n } else {\n this.preopenUserProfile = props;\n }\n };\n this.closeUserProfile = () => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.closeUserProfile();\n } else {\n this.preopenUserProfile = null;\n }\n };\n this.openOrganizationProfile = (props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.openOrganizationProfile(props);\n } else {\n this.preopenOrganizationProfile = props;\n }\n };\n this.closeOrganizationProfile = () => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.closeOrganizationProfile();\n } else {\n this.preopenOrganizationProfile = null;\n }\n };\n this.openCreateOrganization = (props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.openCreateOrganization(props);\n } else {\n this.preopenCreateOrganization = props;\n }\n };\n this.closeCreateOrganization = () => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.closeCreateOrganization();\n } else {\n this.preopenCreateOrganization = null;\n }\n };\n this.openWaitlist = (props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.openWaitlist(props);\n } else {\n this.preOpenWaitlist = props;\n }\n };\n this.closeWaitlist = () => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.closeWaitlist();\n } else {\n this.preOpenWaitlist = null;\n }\n };\n this.openSignUp = (props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.openSignUp(props);\n } else {\n this.preopenSignUp = props;\n }\n };\n this.closeSignUp = () => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.closeSignUp();\n } else {\n this.preopenSignUp = null;\n }\n };\n this.mountSignIn = (node, props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.mountSignIn(node, props);\n } else {\n this.premountSignInNodes.set(node, props);\n }\n };\n this.unmountSignIn = (node) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.unmountSignIn(node);\n } else {\n this.premountSignInNodes.delete(node);\n }\n };\n this.mountSignUp = (node, props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.mountSignUp(node, props);\n } else {\n this.premountSignUpNodes.set(node, props);\n }\n };\n this.unmountSignUp = (node) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.unmountSignUp(node);\n } else {\n this.premountSignUpNodes.delete(node);\n }\n };\n this.mountUserProfile = (node, props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.mountUserProfile(node, props);\n } else {\n this.premountUserProfileNodes.set(node, props);\n }\n };\n this.unmountUserProfile = (node) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.unmountUserProfile(node);\n } else {\n this.premountUserProfileNodes.delete(node);\n }\n };\n this.mountOrganizationProfile = (node, props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.mountOrganizationProfile(node, props);\n } else {\n this.premountOrganizationProfileNodes.set(node, props);\n }\n };\n this.unmountOrganizationProfile = (node) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.unmountOrganizationProfile(node);\n } else {\n this.premountOrganizationProfileNodes.delete(node);\n }\n };\n this.mountCreateOrganization = (node, props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.mountCreateOrganization(node, props);\n } else {\n this.premountCreateOrganizationNodes.set(node, props);\n }\n };\n this.unmountCreateOrganization = (node) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.unmountCreateOrganization(node);\n } else {\n this.premountCreateOrganizationNodes.delete(node);\n }\n };\n this.mountOrganizationSwitcher = (node, props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.mountOrganizationSwitcher(node, props);\n } else {\n this.premountOrganizationSwitcherNodes.set(node, props);\n }\n };\n this.unmountOrganizationSwitcher = (node) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.unmountOrganizationSwitcher(node);\n } else {\n this.premountOrganizationSwitcherNodes.delete(node);\n }\n };\n this.__experimental_prefetchOrganizationSwitcher = () => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.__experimental_prefetchOrganizationSwitcher();\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n void callback();\n } else {\n this.premountMethodCalls.set(\"__experimental_prefetchOrganizationSwitcher\", callback);\n }\n };\n this.mountOrganizationList = (node, props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.mountOrganizationList(node, props);\n } else {\n this.premountOrganizationListNodes.set(node, props);\n }\n };\n this.unmountOrganizationList = (node) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.unmountOrganizationList(node);\n } else {\n this.premountOrganizationListNodes.delete(node);\n }\n };\n this.mountUserButton = (node, userButtonProps) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.mountUserButton(node, userButtonProps);\n } else {\n this.premountUserButtonNodes.set(node, userButtonProps);\n }\n };\n this.unmountUserButton = (node) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.unmountUserButton(node);\n } else {\n this.premountUserButtonNodes.delete(node);\n }\n };\n this.mountWaitlist = (node, props) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.mountWaitlist(node, props);\n } else {\n this.premountWaitlistNodes.set(node, props);\n }\n };\n this.unmountWaitlist = (node) => {\n if (this.clerkjs && __privateGet(this, _loaded)) {\n this.clerkjs.unmountWaitlist(node);\n } else {\n this.premountWaitlistNodes.delete(node);\n }\n };\n this.addListener = (listener) => {\n if (this.clerkjs) {\n return this.clerkjs.addListener(listener);\n } else {\n const unsubscribe = () => {\n var _a;\n const listenerHandlers = this.premountAddListenerCalls.get(listener);\n if (listenerHandlers) {\n (_a = listenerHandlers.nativeUnsubscribe) == null ? void 0 : _a.call(listenerHandlers);\n this.premountAddListenerCalls.delete(listener);\n }\n };\n this.premountAddListenerCalls.set(listener, { unsubscribe, nativeUnsubscribe: void 0 });\n return unsubscribe;\n }\n };\n this.navigate = (to) => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.navigate(to);\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n void callback();\n } else {\n this.premountMethodCalls.set(\"navigate\", callback);\n }\n };\n this.redirectWithAuth = async (...args) => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.redirectWithAuth(...args);\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"redirectWithAuth\", callback);\n return;\n }\n };\n this.redirectToSignIn = async (opts) => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.redirectToSignIn(opts);\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"redirectToSignIn\", callback);\n return;\n }\n };\n this.redirectToSignUp = async (opts) => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.redirectToSignUp(opts);\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"redirectToSignUp\", callback);\n return;\n }\n };\n this.redirectToUserProfile = async () => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.redirectToUserProfile();\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"redirectToUserProfile\", callback);\n return;\n }\n };\n this.redirectToAfterSignUp = () => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.redirectToAfterSignUp();\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"redirectToAfterSignUp\", callback);\n }\n };\n this.redirectToAfterSignIn = () => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.redirectToAfterSignIn();\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n callback();\n } else {\n this.premountMethodCalls.set(\"redirectToAfterSignIn\", callback);\n }\n };\n this.redirectToAfterSignOut = () => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.redirectToAfterSignOut();\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n callback();\n } else {\n this.premountMethodCalls.set(\"redirectToAfterSignOut\", callback);\n }\n };\n this.redirectToOrganizationProfile = async () => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.redirectToOrganizationProfile();\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"redirectToOrganizationProfile\", callback);\n return;\n }\n };\n this.redirectToCreateOrganization = async () => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.redirectToCreateOrganization();\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"redirectToCreateOrganization\", callback);\n return;\n }\n };\n this.redirectToWaitlist = async () => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.redirectToWaitlist();\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"redirectToWaitlist\", callback);\n return;\n }\n };\n this.handleRedirectCallback = (params) => {\n var _a;\n const callback = () => {\n var _a2;\n return (_a2 = this.clerkjs) == null ? void 0 : _a2.handleRedirectCallback(params);\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n void ((_a = callback()) == null ? void 0 : _a.catch(() => {\n }));\n } else {\n this.premountMethodCalls.set(\"handleRedirectCallback\", callback);\n }\n };\n this.handleGoogleOneTapCallback = (signInOrUp, params) => {\n var _a;\n const callback = () => {\n var _a2;\n return (_a2 = this.clerkjs) == null ? void 0 : _a2.handleGoogleOneTapCallback(signInOrUp, params);\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n void ((_a = callback()) == null ? void 0 : _a.catch(() => {\n }));\n } else {\n this.premountMethodCalls.set(\"handleGoogleOneTapCallback\", callback);\n }\n };\n this.handleEmailLinkVerification = async (params) => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.handleEmailLinkVerification(params);\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"handleEmailLinkVerification\", callback);\n }\n };\n this.authenticateWithMetamask = async (params) => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.authenticateWithMetamask(params);\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"authenticateWithMetamask\", callback);\n }\n };\n this.authenticateWithCoinbaseWallet = async (params) => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.authenticateWithCoinbaseWallet(params);\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"authenticateWithCoinbaseWallet\", callback);\n }\n };\n this.authenticateWithOKXWallet = async (params) => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.authenticateWithOKXWallet(params);\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"authenticateWithOKXWallet\", callback);\n }\n };\n this.authenticateWithWeb3 = async (params) => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.authenticateWithWeb3(params);\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"authenticateWithWeb3\", callback);\n }\n };\n this.authenticateWithGoogleOneTap = async (params) => {\n const clerkjs = await __privateMethod(this, _IsomorphicClerk_instances, waitForClerkJS_fn).call(this);\n return clerkjs.authenticateWithGoogleOneTap(params);\n };\n this.createOrganization = async (params) => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.createOrganization(params);\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"createOrganization\", callback);\n }\n };\n this.getOrganization = async (organizationId) => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.getOrganization(organizationId);\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"getOrganization\", callback);\n }\n };\n this.joinWaitlist = async (params) => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.joinWaitlist(params);\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"joinWaitlist\", callback);\n }\n };\n this.signOut = async (signOutCallbackOrOptions, options) => {\n const callback = () => {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.signOut(signOutCallbackOrOptions, options);\n };\n if (this.clerkjs && __privateGet(this, _loaded)) {\n return callback();\n } else {\n this.premountMethodCalls.set(\"signOut\", callback);\n }\n };\n const { Clerk = null, publishableKey } = options || {};\n __privateSet(this, _publishableKey, publishableKey);\n __privateSet(this, _proxyUrl, options == null ? void 0 : options.proxyUrl);\n __privateSet(this, _domain, options == null ? void 0 : options.domain);\n this.options = options;\n this.Clerk = Clerk;\n this.mode = inBrowser() ? \"browser\" : \"server\";\n if (!this.options.sdkMetadata) {\n this.options.sdkMetadata = SDK_METADATA;\n }\n if (__privateGet(this, _publishableKey)) {\n void this.loadClerkJS();\n }\n }\n get publishableKey() {\n return __privateGet(this, _publishableKey);\n }\n get loaded() {\n return __privateGet(this, _loaded);\n }\n static getOrCreateInstance(options) {\n if (!inBrowser() || !__privateGet(this, _instance) || options.Clerk && __privateGet(this, _instance).Clerk !== options.Clerk || // Allow hot swapping PKs on the client\n __privateGet(this, _instance).publishableKey !== options.publishableKey) {\n __privateSet(this, _instance, new _IsomorphicClerk(options));\n }\n return __privateGet(this, _instance);\n }\n static clearInstance() {\n __privateSet(this, _instance, null);\n }\n get domain() {\n if (typeof window !== \"undefined\" && window.location) {\n return handleValueOrFn(__privateGet(this, _domain), new URL(window.location.href), \"\");\n }\n if (typeof __privateGet(this, _domain) === \"function\") {\n return errorThrower.throw(unsupportedNonBrowserDomainOrProxyUrlFunction);\n }\n return __privateGet(this, _domain) || \"\";\n }\n get proxyUrl() {\n if (typeof window !== \"undefined\" && window.location) {\n return handleValueOrFn(__privateGet(this, _proxyUrl), new URL(window.location.href), \"\");\n }\n if (typeof __privateGet(this, _proxyUrl) === \"function\") {\n return errorThrower.throw(unsupportedNonBrowserDomainOrProxyUrlFunction);\n }\n return __privateGet(this, _proxyUrl) || \"\";\n }\n __internal_getOption(key) {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.__internal_getOption(key);\n }\n get sdkMetadata() {\n var _a;\n return ((_a = this.clerkjs) == null ? void 0 : _a.sdkMetadata) || this.options.sdkMetadata || void 0;\n }\n get instanceType() {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.instanceType;\n }\n get frontendApi() {\n var _a;\n return ((_a = this.clerkjs) == null ? void 0 : _a.frontendApi) || \"\";\n }\n get isStandardBrowser() {\n var _a;\n return ((_a = this.clerkjs) == null ? void 0 : _a.isStandardBrowser) || this.options.standardBrowser || false;\n }\n get isSatellite() {\n if (typeof window !== \"undefined\" && window.location) {\n return handleValueOrFn(this.options.isSatellite, new URL(window.location.href), false);\n }\n if (typeof this.options.isSatellite === \"function\") {\n return errorThrower.throw(unsupportedNonBrowserDomainOrProxyUrlFunction);\n }\n return false;\n }\n async loadClerkJS() {\n var _a;\n if (this.mode !== \"browser\" || __privateGet(this, _loaded)) {\n return;\n }\n if (typeof window !== \"undefined\") {\n window.__clerk_publishable_key = __privateGet(this, _publishableKey);\n window.__clerk_proxy_url = this.proxyUrl;\n window.__clerk_domain = this.domain;\n }\n try {\n if (this.Clerk) {\n let c;\n if (isConstructor(this.Clerk)) {\n c = new this.Clerk(__privateGet(this, _publishableKey), {\n proxyUrl: this.proxyUrl,\n domain: this.domain\n });\n await c.load(this.options);\n } else {\n c = this.Clerk;\n if (!c.loaded) {\n await c.load(this.options);\n }\n }\n global.Clerk = c;\n } else if (!__BUILD_DISABLE_RHC__) {\n if (!global.Clerk) {\n await loadClerkJsScript({\n ...this.options,\n publishableKey: __privateGet(this, _publishableKey),\n proxyUrl: this.proxyUrl,\n domain: this.domain,\n nonce: this.options.nonce\n });\n }\n if (!global.Clerk) {\n throw new Error(\"Failed to download latest ClerkJS. Contact support@clerk.com.\");\n }\n await global.Clerk.load(this.options);\n }\n if ((_a = global.Clerk) == null ? void 0 : _a.loaded) {\n return this.hydrateClerkJS(global.Clerk);\n }\n return;\n } catch (err) {\n const error = err;\n if (process.env.NODE_ENV === \"production\") {\n console.error(error.stack || error.message || error);\n } else {\n throw err;\n }\n return;\n }\n }\n get version() {\n var _a;\n return (_a = this.clerkjs) == null ? void 0 : _a.version;\n }\n get client() {\n if (this.clerkjs) {\n return this.clerkjs.client;\n } else {\n return void 0;\n }\n }\n get session() {\n if (this.clerkjs) {\n return this.clerkjs.session;\n } else {\n return void 0;\n }\n }\n get user() {\n if (this.clerkjs) {\n return this.clerkjs.user;\n } else {\n return void 0;\n }\n }\n get organization() {\n if (this.clerkjs) {\n return this.clerkjs.organization;\n } else {\n return void 0;\n }\n }\n get telemetry() {\n if (this.clerkjs) {\n return this.clerkjs.telemetry;\n } else {\n return void 0;\n }\n }\n get __unstable__environment() {\n if (this.clerkjs) {\n return this.clerkjs.__unstable__environment;\n } else {\n return void 0;\n }\n }\n __unstable__setEnvironment(...args) {\n if (this.clerkjs && \"__unstable__setEnvironment\" in this.clerkjs) {\n this.clerkjs.__unstable__setEnvironment(args);\n } else {\n return void 0;\n }\n }\n};\n_loaded = new WeakMap();\n_domain = new WeakMap();\n_proxyUrl = new WeakMap();\n_publishableKey = new WeakMap();\n_instance = new WeakMap();\n_IsomorphicClerk_instances = new WeakSet();\nwaitForClerkJS_fn = function() {\n return new Promise((resolve) => {\n this.addOnLoaded(() => resolve(this.clerkjs));\n });\n};\n__privateAdd(_IsomorphicClerk, _instance);\nvar IsomorphicClerk = _IsomorphicClerk;\n\n// src/contexts/ClerkContextProvider.tsx\nfunction ClerkContextProvider(props) {\n const { isomorphicClerkOptions, initialState, children } = props;\n const { isomorphicClerk: clerk, loaded: clerkLoaded } = useLoadedIsomorphicClerk(isomorphicClerkOptions);\n const [state, setState] = React13.useState({\n client: clerk.client,\n session: clerk.session,\n user: clerk.user,\n organization: clerk.organization\n });\n React13.useEffect(() => {\n return clerk.addListener((e) => setState({ ...e }));\n }, []);\n const derivedState = deriveState(clerkLoaded, state, initialState);\n const clerkCtx = React13.useMemo(() => ({ value: clerk }), [clerkLoaded]);\n const clientCtx = React13.useMemo(() => ({ value: state.client }), [state.client]);\n const {\n sessionId,\n session,\n userId,\n user,\n orgId,\n actor,\n organization,\n orgRole,\n orgSlug,\n orgPermissions,\n factorVerificationAge\n } = derivedState;\n const authCtx = React13.useMemo(() => {\n const value = {\n sessionId,\n userId,\n actor,\n orgId,\n orgRole,\n orgSlug,\n orgPermissions,\n factorVerificationAge\n };\n return { value };\n }, [sessionId, userId, actor, orgId, orgRole, orgSlug, factorVerificationAge]);\n const sessionCtx = React13.useMemo(() => ({ value: session }), [sessionId, session]);\n const userCtx = React13.useMemo(() => ({ value: user }), [userId, user]);\n const organizationCtx = React13.useMemo(() => {\n const value = {\n organization\n };\n return { value };\n }, [orgId, organization]);\n return (\n // @ts-expect-error value passed is of type IsomorphicClerk where the context expects LoadedClerk\n /* @__PURE__ */ React13.createElement(IsomorphicClerkContext.Provider, { value: clerkCtx }, /* @__PURE__ */ React13.createElement(ClientContext.Provider, { value: clientCtx }, /* @__PURE__ */ React13.createElement(SessionContext.Provider, { value: sessionCtx }, /* @__PURE__ */ React13.createElement(OrganizationProvider, { ...organizationCtx.value }, /* @__PURE__ */ React13.createElement(AuthContext.Provider, { value: authCtx }, /* @__PURE__ */ React13.createElement(UserContext.Provider, { value: userCtx }, children))))))\n );\n}\nvar useLoadedIsomorphicClerk = (options) => {\n const [loaded, setLoaded] = React13.useState(false);\n const isomorphicClerk = React13.useMemo(() => IsomorphicClerk.getOrCreateInstance(options), []);\n React13.useEffect(() => {\n void isomorphicClerk.__unstable__updateProps({ appearance: options.appearance });\n }, [options.appearance]);\n React13.useEffect(() => {\n void isomorphicClerk.__unstable__updateProps({ options });\n }, [options.localization]);\n React13.useEffect(() => {\n isomorphicClerk.addOnLoaded(() => setLoaded(true));\n }, []);\n React13.useEffect(() => {\n return () => {\n IsomorphicClerk.clearInstance();\n setLoaded(false);\n };\n }, []);\n return { isomorphicClerk, loaded };\n};\n\n// src/contexts/ClerkProvider.tsx\nfunction ClerkProviderBase(props) {\n const { initialState, children, __internal_bypassMissingPublishableKey, ...restIsomorphicClerkOptions } = props;\n const { publishableKey = \"\", Clerk: userInitialisedClerk } = restIsomorphicClerkOptions;\n if (!userInitialisedClerk && !__internal_bypassMissingPublishableKey) {\n if (!publishableKey) {\n errorThrower.throwMissingPublishableKeyError();\n } else if (publishableKey && !isPublishableKey(publishableKey)) {\n errorThrower.throwInvalidPublishableKeyError({ key: publishableKey });\n }\n }\n return /* @__PURE__ */ React14.createElement(\n ClerkContextProvider,\n {\n initialState,\n isomorphicClerkOptions: restIsomorphicClerkOptions\n },\n children\n );\n}\nvar ClerkProvider = withMaxAllowedInstancesGuard(ClerkProviderBase, \"ClerkProvider\", multipleClerkProvidersError);\nClerkProvider.displayName = \"ClerkProvider\";\n\n// src/index.ts\nsetErrorThrowerOptions({ packageName: \"@clerk/clerk-react\" });\nsetClerkJsLoadingErrorPackageName(\"@clerk/clerk-react\");\nexport {\n AuthenticateWithRedirectCallback,\n ClerkLoaded,\n ClerkLoading,\n ClerkProvider,\n CreateOrganization,\n GoogleOneTap,\n OrganizationList,\n OrganizationProfile,\n OrganizationSwitcher,\n Protect,\n RedirectToCreateOrganization,\n RedirectToOrganizationProfile,\n RedirectToSignIn,\n RedirectToSignUp,\n RedirectToUserProfile,\n SignIn,\n SignInButton,\n SignInWithMetamaskButton,\n SignOutButton,\n SignUp,\n SignUpButton,\n SignedIn,\n SignedOut,\n UserButton,\n UserProfile,\n Waitlist,\n useAuth,\n useClerk,\n useEmailLink,\n useOrganization,\n useOrganizationList,\n useReverification,\n useSession,\n useSessionList,\n useSignIn,\n useSignUp,\n useUser\n};\n//# sourceMappingURL=index.mjs.map"],"names":["DefaultMessages","buildErrorThrower","packageName","customMessages","pkg","messages","buildMessage","rawMessage","replacements","msg","matches","match","replacement","packageName2","customMessages2","params","message","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__export","target","all","name","__copyProps","to","from","except","desc","key","__reExport","mod","secondTarget","React","require$$0","is","x","y","objectIs","useState","useEffect","useLayoutEffect","useDebugValue","useSyncExternalStore$2","subscribe","getSnapshot","value","_useState","inst","forceUpdate","checkIfSnapshotChanged","latestGetSnapshot","nextValue","useSyncExternalStore$1","shim","useSyncExternalStoreShim_production","shimModule","has","dequal","foo","bar","ctor","len","SWRGlobalState","noop","UNDEFINED","OBJECT","isUndefined","v","isFunction","mergeObjects","a","b","isPromiseLike","EMPTY_CACHE","INITIAL_CACHE","STR_UNDEFINED","isWindowDefined","isDocumentDefined","hasRequestAnimationFrame","createCacheHelper","cache","state","info","prev","online","isOnline","onWindowEvent","offWindowEvent","isVisible","visibilityState","initFocus","callback","initReconnect","onOnline","onOffline","preset","defaultConfigOptions","IS_REACT_LEGACY","IS_SERVER","rAF","f","useIsomorphicLayoutEffect","navigatorConnection","slowConnection","table","isObjectType","type","counter","stableHash","arg","isDate","isRegex","isPlainObject","result","index","keys","serialize","args","__timestamp","getTimestamp","FOCUS_EVENT","RECONNECT_EVENT","MUTATE_EVENT","ERROR_REVALIDATE_EVENT","events","internalMutate","_key","_data","_opts","options","populateCache","rollbackOnErrorOption","optimisticData","rollbackOnError","error","throwOnError","keyFilter","matchedKeys","it","mutateByKey","_k","get","set","EVENT_REVALIDATORS","MUTATION","FETCH","PRELOAD","startRevalidate","revalidators","data","beforeMutationTs","hasOptimisticData","displayedData","currentData","committedData","err","populateCachedData","revalidateAllKeys","initCache","provider","opts","mutate","unmount","subscriptions","subs","setter","fn","initProvider","releaseFocus","releaseReconnect","onErrorRetry","_","__","config","revalidate","maxRetryCount","currentRetryCount","timeout","compare","defaultConfig","mergeConfigs","u1","f1","u2","f2","SWRConfigContext","createContext","SWRConfig","props","parentConfig","useContext","isFunctionalConfig","useMemo","extendedConfig","cacheContextRef","useRef","cacheContext","createElement","INFINITE_PREFIX","enableDevtools","use","setupDevTools","normalize","useSWRConfig","preload","key_","fetcher","fnArg","req","middleware","useSWRNext","fetcher_","BUILT_IN_MIDDLEWARE","withArgs","hook","fallbackConfig","_config","next","i","subscribeCallback","callbacks","keyedRevalidators","withMiddleware","useSWR","uses","unstable_serialize","thenable","e","WITH_DEDUPE","useSWRHandler","suspense","fallbackData","revalidateOnMount","revalidateIfStale","refreshInterval","refreshWhenHidden","refreshWhenOffline","keepPreviousData","serialize$1","initialMountedRef","unmountedRef","keyRef","fetcherRef","configRef","getConfig","isActive","getCache","setCache","subscribeCache","getInitialCache","stateDependencies","fallback","isUndefined$1","UNDEFINED$1","isEqual","current","t","returnedData","shouldStartRequest","getSelectedCache","snapshot","cachedData","initialData","clientSnapshot","serverSnapshot","memorizedSnapshot","newSnapshot","cached","useSyncExternalStore","useCallback","isInitialMount","hasRevalidator","laggyDataRef","shouldDoInitialRevalidation","defaultValidatingState","isValidating","isLoading","revalidateOpts","currentFetcher","newData","startAt","loading","shouldStartNewRequest","callbackSafeguard","finalState","finishRequestAndUpdateState","cleanupState","requestInfo","initialState","mutationInfo","cacheData","currentConfig","shouldRetryOnError","isFunction$1","revalidateEvents","boundMutate","softRevalidate","nextFocusRevalidatedAt","unsubEvents","now","timer","interval","execute","promise","OBJECT$1","SWRConfig$1","getFirstPageKey","getKey","EMPTY_PROMISE","infinite","didMountRef","cache$1","initialSize","revalidateAll","persistSize","revalidateFirstPage","parallel","infiniteKey","INFINITE_PREFIX$1","resolvePageSize","cachedPageSize","lastPageSizeRef","shouldRevalidateOnMount","swr","forceRevalidateAll","shouldRevalidatePage","pageSize","previousPageData","pageKey","pageArg","getSWRCache","setSWRCache","pageData","shouldFetchPage","r","shouldRevalidate","setSize","changeSize","size","getInfiniteCache","useSWRInfinite","find","iter","tar","tmp","assertContextExists","contextVal","msgOrCtx","createContextAndHook","displayName","assertCtxFn","Ctx","ctx","clerk_swr_exports","default2","default3","swr_star","ClerkInstanceContext","useClerkInstanceContext","UserContext","useUserContext","ClientContext","useClientContext","SessionContext","useSessionContext","React2","OrganizationContextInternal","useOrganizationContext","OrganizationProvider","children","organization","swrConfig","useAssertWrappedByClerkProvider","displayNameOrFn","React3","isDeeplyEqual","deepEqual","isomorphicAtob","DEV_OR_STAGING_SUFFIXES","PUBLISHABLE_KEY_LIVE_PREFIX","PUBLISHABLE_KEY_TEST_PREFIX","parsePublishableKey","isPublishableKey","instanceType","frontendApi","hasValidPrefix","hasValidFrontendApiPostfix","createDevOrStagingUrlCache","devOrStagingUrlCache","url","hostname","res","s","isDevelopmentEnvironment","isTestEnvironment","isProductionEnvironment","displayedWarnings","deprecated","fnName","warning","hideWarning","messageId","errorThrower","setErrorThrowerOptions","AuthContext","useAuthContext","IsomorphicClerkContext","useIsomorphicClerkContext","multipleClerkProvidersError","multipleChildrenInButtonComponent","unsupportedNonBrowserDomainOrProxyUrlFunction","userProfilePageRenderedError","userProfileLinkRenderedError","organizationProfilePageRenderedError","organizationProfileLinkRenderedError","customPagesIgnoredComponent","componentName","customPageWrongProps","customLinkWrongProps","userButtonIgnoredComponent","customMenuItemsIgnoredComponent","userButtonMenuItemsRenderedError","userButtonMenuActionRenderedError","userButtonMenuLinkRenderedError","userButtonMenuItemLinkWrongProps","userButtonMenuItemsActionWrongsProps","source","useSharedAssertWrappedByClerkProvider","withClerk","Component","displayNameOrOptions","HOC","clerk","SignedIn","userId","SignedOut","client","session","hasActiveSessions","handleRedirectCallbackParams","__typeError","__accessCheck","obj","member","__privateGet","getter","__privateAdd","__privateSet","__privateMethod","method","versionSelector","clerkJSVersion","packageVersion","prereleaseTag","getPrereleaseTag","getMajorVersion","_a","isValidProxyUrl","isHttpOrHttps","isProxyUrlRelative","proxyUrlToAbsoluteURL","addClerkPrefix","str","regex","logErrorInDevMode","defaultOptions","sleep","ms","createExponentialDelayAsyncFn","timesCalled","calculateDelayInMs","constant","base","delay","runWithExponentialBackOff","iterationsCount","shouldRetry","firstDelay","maxDelay","timeMultiple","handleValueOrFn","defaultValue","NO_DOCUMENT_ERROR","NO_SRC_ERROR","loadScript","src","async","defer","beforeLoad","crossOrigin","nonce","resolve","reject","script","iterations","FAILED_TO_LOAD_ERROR","isDevOrStagingUrl","setClerkJsLoadingErrorPackageName","loadClerkJsScript","existingScript","clerkJsScriptUrl","applyClerkJsScriptAttributes","_b","clerkJSUrl","clerkJSVariant","proxyUrl","domain","publishableKey","scriptHost","variant","version","buildClerkJsScriptAttributes","attributes","attribute","without","copy","prop","deriveState","clerkLoaded","deriveFromSsrInitialState","deriveFromClientSideState","user","sessionId","orgId","orgRole","orgPermissions","orgSlug","actor","factorVerificationAge","membership","om","inBrowser","assertSingleChild","normalizeWithDefaultValue","defaultText","safeExecute","cb","isConstructor","counts","useMaxAllowedInstancesGuard","maxCount","count","withMaxAllowedInstancesGuard","WrappedComponent","Hoc","useCustomElementPortal","elements","nodes","setNodes","el","node","prevState","n","createPortal","isThatComponent","component","React4","useUserProfileCustomPages","useCustomPages","UserProfileLink","UserProfilePage","MenuItems","useOrganizationProfileCustomPages","OrganizationProfileLink","OrganizationProfilePage","useSanitizedChildren","sanitizedChildren","excludedComponents","React5","child","LinkComponent","PageComponent","MenuItemsComponent","reorderItemsLabels","allowForAnyChildren","validChildren","children2","label","labelIcon","isReorderItem","isCustomPage","isExternalLink","customPageContents","customPageLabelIcons","customLinkLabelIcons","cp","customPageContentsPortals","customPageLabelIconsPortals","customLinkLabelIconsPortals","customPages","customPagesPortals","contentPortal","mount","p","labelPortal","mountIcon","unmountIcon","childProps","validItems","useUserButtonCustomMenuItems","useCustomMenuItems","MenuAction","MenuLink","MenuActionComponent","MenuLinkComponent","UserProfileLinkComponent","UserProfilePageComponent","customMenuItems","customMenuItemsPortals","React6","logErrorInDevMode2","child2","props2","href","onClick","open","isReorderItem2","isCustomMenuItem","baseItem","isExternalLink2","customMenuItemLabelIcons","mi","customMenuItemLabelIconsPortals","iconPortal","menuItem","waitForElementChildren","root","selector","elementToWatch","observer","mutationsList","mutation","useWaitForComponentMount","watcherRef","status","setStatus","useState2","isMountProps","isOpenProps","ClerkHostRenderer","React7","_prevProps","_c","_d","prevProps","newProps","customPagesChanged","customMenuItemsChanged","hideRootHtmlElement","rootAttributes","CustomPortalsRenderer","React8","portal","SignIn","shouldShowFallback","rendererRootProps","SignUp","logErrorInDevMode3","_UserProfile","UserButtonContext","_UserButton","userProfileProps","passableProps","portalProps","UserButtonOutlet","outletProps","providerProps","UserButton","_OrganizationProfile","OrganizationSwitcherContext","_OrganizationSwitcher","organizationProfileProps","OrganizationSwitcherOutlet","signUpFallbackRedirectUrl","forceRedirectUrl","fallbackRedirectUrl","signUpForceRedirectUrl","mode","initialValues","rest","clickHandler","React9","signInFallbackRedirectUrl","signInForceRedirectUrl","unsafeMetadata","React10","redirectUrl","signOutOptions","React11","authenticate","React12","SDK_METADATA","_loaded","_domain","_proxyUrl","_publishableKey","_instance","_IsomorphicClerk_instances","waitForClerkJS_fn","_IsomorphicClerk","clerkjs","listenerHandlers","listener","beforeEmit","userButtonProps","unsubscribe","_a2","signInOrUp","organizationId","signOutCallbackOrOptions","Clerk","c","IsomorphicClerk","ClerkContextProvider","isomorphicClerkOptions","useLoadedIsomorphicClerk","setState","React13","derivedState","clerkCtx","clientCtx","authCtx","sessionCtx","userCtx","organizationCtx","loaded","setLoaded","isomorphicClerk","ClerkProviderBase","__internal_bypassMissingPublishableKey","restIsomorphicClerkOptions","userInitialisedClerk","React14","ClerkProvider"],"mappings":"sEAyIA,IAAIA,GAAkB,OAAO,OAAO,CAClC,4BAA6B,mJAC7B,kCAAmC,0JACnC,kCAAmC,yGACnC,6BAA8B,oGAC9B,qBAAsB,kIACxB,CAAC,EACD,SAASC,GAAkB,CAAE,YAAAC,EAAa,eAAAC,GAAkB,CAC1D,IAAIC,EAAMF,EACV,MAAMG,EAAW,CACf,GAAGL,GACH,GAAGG,CACJ,EACD,SAASG,EAAaC,EAAYC,EAAc,CAC9C,GAAI,CAACA,EACH,MAAO,GAAGJ,CAAG,KAAKG,CAAU,GAE9B,IAAIE,EAAMF,EACV,MAAMG,EAAUH,EAAW,SAAS,uBAAuB,EAC3D,UAAWI,KAASD,EAAS,CAC3B,MAAME,GAAeJ,EAAaG,EAAM,CAAC,CAAC,GAAK,IAAI,SAAU,EAC7DF,EAAMA,EAAI,QAAQ,KAAKE,EAAM,CAAC,CAAC,KAAMC,CAAW,CACtD,CACI,MAAO,GAAGR,CAAG,KAAKK,CAAG,EACzB,CACE,MAAO,CACL,eAAe,CAAE,YAAaI,GAAgB,CAC5C,OAAI,OAAOA,GAAiB,WAC1BT,EAAMS,GAED,IACR,EACD,YAAY,CAAE,eAAgBC,GAAmB,CAC/C,cAAO,OAAOT,EAAUS,GAAmB,CAAA,CAAE,EACtC,IACR,EACD,gCAAgCC,EAAQ,CACtC,MAAM,IAAI,MAAMT,EAAaD,EAAS,kCAAmCU,CAAM,CAAC,CACjF,EACD,qBAAqBA,EAAQ,CAC3B,MAAM,IAAI,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