@clerk/chrome-extension 2.8.5-canary.v20251124124818 → 3.0.0-canary-core3.v20251124161754

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@
3
3
  var React7 = require('react');
4
4
  require('use-sync-external-store/shim/index.js');
5
5
  var reactDom = require('react-dom');
6
+ var entry = require('@clerk/ui/entry');
6
7
  var noRhc = require('@clerk/clerk-js/no-rhc');
7
8
  var browser = require('webextension-polyfill');
8
9
  var jsxRuntime = require('react/jsx-runtime');
@@ -169,7 +170,7 @@ function buildErrorThrower({ packageName, customMessages }) {
169
170
  };
170
171
  }
171
172
  var _a4;
172
- (_a4 = class extends ClerkError {
173
+ var ClerkRuntimeError = (_a4 = class extends ClerkError {
173
174
  constructor(message, options) {
174
175
  super({
175
176
  ...options,
@@ -183,14 +184,27 @@ var _a4;
183
184
  }
184
185
  }, __publicField(_a4, "kind", "ClerkRuntimeError"), _a4);
185
186
 
186
- // ../shared/dist/runtime/isomorphicAtob-DybBXGFR.mjs
187
+ // ../shared/dist/runtime/constants-Bp0qtelQ.mjs
188
+ var DEV_OR_STAGING_SUFFIXES = [
189
+ ".lcl.dev",
190
+ ".stg.dev",
191
+ ".lclstage.dev",
192
+ ".stgstage.dev",
193
+ ".dev.lclclerk.com",
194
+ ".stg.lclclerk.com",
195
+ ".accounts.lclclerk.com",
196
+ "accountsstage.dev",
197
+ "accounts.dev"
198
+ ];
199
+
200
+ // ../shared/dist/runtime/isomorphicAtob-CYR5fxvZ.mjs
187
201
  var isomorphicAtob = (data) => {
188
202
  if (typeof atob !== "undefined" && typeof atob === "function") return atob(data);
189
203
  else if (typeof global !== "undefined" && global.Buffer) return new global.Buffer(data, "base64").toString();
190
204
  return data;
191
205
  };
192
206
 
193
- // ../shared/dist/runtime/keys-YNv6yjKk.mjs
207
+ // ../shared/dist/runtime/keys-BGyzAyGu.mjs
194
208
  var PUBLISHABLE_KEY_LIVE_PREFIX = "pk_live_";
195
209
  var PUBLISHABLE_KEY_TEST_PREFIX = "pk_test_";
196
210
  function isValidDecodedPublishableKey(decoded) {
@@ -238,8 +252,21 @@ function isPublishableKey(key = "") {
238
252
  return false;
239
253
  }
240
254
  }
255
+ function createDevOrStagingUrlCache() {
256
+ const devOrStagingUrlCache = /* @__PURE__ */ new Map();
257
+ return { isDevOrStagingUrl: (url) => {
258
+ if (!url) return false;
259
+ const hostname = typeof url === "string" ? url : url.hostname;
260
+ let res = devOrStagingUrlCache.get(hostname);
261
+ if (res === void 0) {
262
+ res = DEV_OR_STAGING_SUFFIXES.some((s) => hostname.endsWith(s));
263
+ devOrStagingUrlCache.set(hostname, res);
264
+ }
265
+ return res;
266
+ } };
267
+ }
241
268
 
242
- // ../../node_modules/.pnpm/swr@2.3.4_react@18.3.1/node_modules/swr/dist/_internal/events.mjs
269
+ // ../../node_modules/swr/dist/_internal/events.mjs
243
270
  var events_exports = {};
244
271
  __export(events_exports, {
245
272
  ERROR_REVALIDATE_EVENT: () => ERROR_REVALIDATE_EVENT,
@@ -252,7 +279,7 @@ var RECONNECT_EVENT = 1;
252
279
  var MUTATE_EVENT = 2;
253
280
  var ERROR_REVALIDATE_EVENT = 3;
254
281
 
255
- // ../../node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/lite/index.mjs
282
+ // ../../node_modules/dequal/lite/index.mjs
256
283
  var has = Object.prototype.hasOwnProperty;
257
284
  function dequal(foo, bar) {
258
285
  var ctor, len;
@@ -278,7 +305,7 @@ function dequal(foo, bar) {
278
305
  return foo !== foo && bar !== bar;
279
306
  }
280
307
 
281
- // ../../node_modules/.pnpm/swr@2.3.4_react@18.3.1/node_modules/swr/dist/_internal/config-context-client-BoS53ST9.mjs
308
+ // ../../node_modules/swr/dist/_internal/config-context-client-BoS53ST9.mjs
282
309
  var SWRGlobalState = /* @__PURE__ */ new WeakMap();
283
310
  var noop2 = () => {
284
311
  };
@@ -714,7 +741,7 @@ var SWRConfig = (props) => {
714
741
  }));
715
742
  };
716
743
 
717
- // ../../node_modules/.pnpm/swr@2.3.4_react@18.3.1/node_modules/swr/dist/_internal/constants.mjs
744
+ // ../../node_modules/swr/dist/_internal/constants.mjs
718
745
  var INFINITE_PREFIX = "$inf$";
719
746
  var enableDevtools = isWindowDefined && window.__SWR_DEVTOOLS_USE__;
720
747
  var use = enableDevtools ? window.__SWR_DEVTOOLS_USE__ : [];
@@ -768,7 +795,7 @@ var SWRConfig2 = OBJECT.defineProperty(SWRConfig, "defaultValue", {
768
795
  });
769
796
  Promise.resolve();
770
797
 
771
- // ../../node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/dist/index.mjs
798
+ // ../../node_modules/dequal/dist/index.mjs
772
799
  var has2 = Object.prototype.hasOwnProperty;
773
800
  function find(iter, tar, key) {
774
801
  for (key of iter.keys()) {
@@ -1058,13 +1085,20 @@ var createElementComponent = (type, isServer) => {
1058
1085
  createElementComponent("payment", typeof window === "undefined");
1059
1086
  createContextAndHook("PaymentElementContext");
1060
1087
  createContextAndHook("StripeUtilsContext");
1061
- var errorThrower = buildErrorThrower({ packageName: "@clerk/clerk-react" });
1088
+
1089
+ // ../react/dist/chunk-MB46WFKC.mjs
1090
+ var errorThrower = buildErrorThrower({ packageName: "@clerk/react" });
1062
1091
  function setErrorThrowerOptions(options) {
1063
1092
  errorThrower.setMessages(options).setPackageName(options);
1064
1093
  }
1065
- var [AuthContext] = createContextAndHook("AuthContext");
1066
1094
  var IsomorphicClerkContext = ClerkInstanceContext;
1067
1095
  var useIsomorphicClerkContext = useClerkInstanceContext;
1096
+ var useAssertWrappedByClerkProvider2 = (source) => {
1097
+ useAssertWrappedByClerkProvider(() => {
1098
+ errorThrower.throwMissingClerkProviderError({ source });
1099
+ });
1100
+ };
1101
+ var [AuthContext] = createContextAndHook("AuthContext");
1068
1102
  var multipleClerkProvidersError = "You've added multiple <ClerkProvider> components in your React component tree. Wrap your components in a single <ClerkProvider>.";
1069
1103
  var multipleChildrenInButtonComponent = (name) => `You've passed multiple children components to <${name}/>. You can only pass a single child component or text.`;
1070
1104
  var unsupportedNonBrowserDomainOrProxyUrlFunction = "Unsupported usage of isSatellite, domain or proxyUrl. The usage of isSatellite, domain or proxyUrl as function is not supported in non-browser environments.";
@@ -1082,11 +1116,6 @@ var userButtonMenuActionRenderedError = "<UserButton.Action /> component needs t
1082
1116
  var userButtonMenuLinkRenderedError = "<UserButton.Link /> component needs to be a direct child of `<UserButton.MenuItems />`.";
1083
1117
  var userButtonMenuItemLinkWrongProps = "Missing props. <UserButton.Link /> component requires the following props: href, label and labelIcon.";
1084
1118
  var userButtonMenuItemsActionWrongsProps = "Missing props. <UserButton.Action /> component requires the following props: label.";
1085
- var useAssertWrappedByClerkProvider2 = (source) => {
1086
- useAssertWrappedByClerkProvider(() => {
1087
- errorThrower.throwMissingClerkProviderError({ source });
1088
- });
1089
- };
1090
1119
  var withClerk = (Component, displayNameOrOptions) => {
1091
1120
  const passedDisplayedName = typeof displayNameOrOptions === "string" ? displayNameOrOptions : displayNameOrOptions == null ? void 0 : displayNameOrOptions.component;
1092
1121
  const displayName = passedDisplayedName || Component.displayName || Component.name || "Component";
@@ -1111,7 +1140,7 @@ var withClerk = (Component, displayNameOrOptions) => {
1111
1140
  return HOC;
1112
1141
  };
1113
1142
 
1114
- // ../shared/dist/runtime/runtimeEnvironment-BB2sO-19.mjs
1143
+ // ../shared/dist/runtime/runtimeEnvironment-D1yr0yUs.mjs
1115
1144
  var isDevelopmentEnvironment = () => {
1116
1145
  try {
1117
1146
  return process.env.NODE_ENV === "development";
@@ -1134,7 +1163,7 @@ var isProductionEnvironment = () => {
1134
1163
  return false;
1135
1164
  };
1136
1165
 
1137
- // ../shared/dist/runtime/deprecated-BqlFbLHj.mjs
1166
+ // ../shared/dist/runtime/deprecated--jK9xTNh.mjs
1138
1167
  var displayedWarnings = /* @__PURE__ */ new Set();
1139
1168
  var deprecated = (fnName, warning, key) => {
1140
1169
  const hideWarning = isTestEnvironment() || isProductionEnvironment();
@@ -1145,11 +1174,9 @@ var deprecated = (fnName, warning, key) => {
1145
1174
  ${warning}`);
1146
1175
  };
1147
1176
  withClerk(({ clerk: clerk2, ...props }) => {
1177
+ var _a5, _b;
1148
1178
  const { client, session } = clerk2;
1149
- const hasSignedInSessions = client.signedInSessions ? client.signedInSessions.length > 0 : (
1150
- // Compat for clerk-js<5.54.0 (which was released with the `signedInSessions` property)
1151
- client.activeSessions && client.activeSessions.length > 0
1152
- );
1179
+ const hasSignedInSessions = ((_b = (_a5 = client.signedInSessions) == null ? void 0 : _a5.length) != null ? _b : 0) > 0;
1153
1180
  React7__default.default.useEffect(() => {
1154
1181
  if (session === null && hasSignedInSessions) {
1155
1182
  void clerk2.redirectToAfterSignOut();
@@ -1202,19 +1229,19 @@ withClerk(
1202
1229
  "AuthenticateWithRedirectCallback"
1203
1230
  );
1204
1231
 
1205
- // ../shared/dist/runtime/handleValueOrFn-CcwnRX-K.mjs
1232
+ // ../shared/dist/runtime/handleValueOrFn-AOTAW6HQ.mjs
1206
1233
  function handleValueOrFn(value, url, defaultValue) {
1207
1234
  if (typeof value === "function") return value(url);
1208
1235
  if (typeof value !== "undefined") return value;
1209
1236
  if (typeof defaultValue !== "undefined") return defaultValue;
1210
1237
  }
1211
1238
 
1212
- // ../shared/dist/runtime/utils-DnE51LOo.mjs
1239
+ // ../shared/dist/runtime/utils-DIVknyRo.mjs
1213
1240
  var logErrorInDevMode = (message) => {
1214
1241
  if (isDevelopmentEnvironment()) console.error(`Clerk: ${message}`);
1215
1242
  };
1216
1243
 
1217
- // ../shared/dist/runtime/object-Be3MMNTQ.mjs
1244
+ // ../shared/dist/runtime/object-CPFrgK_j.mjs
1218
1245
  var without = (obj, ...props) => {
1219
1246
  const copy = { ...obj };
1220
1247
  for (const prop of props) delete copy[prop];
@@ -2158,12 +2185,219 @@ var __privateGet2 = (obj, member, getter) => (__accessCheck(obj, member, "read f
2158
2185
  var __privateAdd2 = (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);
2159
2186
  var __privateSet2 = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
2160
2187
  var __privateMethod2 = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
2188
+
2189
+ // ../shared/dist/runtime/retry-l1_iB-NH.mjs
2190
+ var defaultOptions = {
2191
+ initialDelay: 125,
2192
+ maxDelayBetweenRetries: 0,
2193
+ factor: 2,
2194
+ shouldRetry: (_, iteration) => iteration < 5,
2195
+ retryImmediately: false,
2196
+ jitter: true
2197
+ };
2198
+ var RETRY_IMMEDIATELY_DELAY = 100;
2199
+ var sleep = async (ms) => new Promise((s) => setTimeout(s, ms));
2200
+ var applyJitter = (delay, jitter) => {
2201
+ return jitter ? delay * (1 + Math.random()) : delay;
2202
+ };
2203
+ var createExponentialDelayAsyncFn = (opts) => {
2204
+ let timesCalled = 0;
2205
+ const calculateDelayInMs = () => {
2206
+ const constant = opts.initialDelay;
2207
+ const base = opts.factor;
2208
+ let delay = constant * Math.pow(base, timesCalled);
2209
+ delay = applyJitter(delay, opts.jitter);
2210
+ return Math.min(opts.maxDelayBetweenRetries || delay, delay);
2211
+ };
2212
+ return async () => {
2213
+ await sleep(calculateDelayInMs());
2214
+ timesCalled++;
2215
+ };
2216
+ };
2217
+ var retry = async (callback, options = {}) => {
2218
+ let iterations = 0;
2219
+ const { shouldRetry, initialDelay, maxDelayBetweenRetries, factor, retryImmediately, jitter, onBeforeRetry } = {
2220
+ ...defaultOptions,
2221
+ ...options
2222
+ };
2223
+ const delay = createExponentialDelayAsyncFn({
2224
+ initialDelay,
2225
+ maxDelayBetweenRetries,
2226
+ factor,
2227
+ jitter
2228
+ });
2229
+ while (true) try {
2230
+ return await callback();
2231
+ } catch (e) {
2232
+ iterations++;
2233
+ if (!shouldRetry(e, iterations)) throw e;
2234
+ if (onBeforeRetry) await onBeforeRetry(iterations);
2235
+ if (retryImmediately && iterations === 1) await sleep(applyJitter(RETRY_IMMEDIATELY_DELAY, jitter));
2236
+ else await delay();
2237
+ }
2238
+ };
2239
+
2240
+ // ../shared/dist/runtime/loadScript-DDWWb733.mjs
2241
+ var NO_DOCUMENT_ERROR = "loadScript cannot be called when document does not exist";
2242
+ var NO_SRC_ERROR = "loadScript cannot be called without a src";
2243
+ async function loadScript(src = "", opts) {
2244
+ const { async, defer, beforeLoad, crossOrigin, nonce } = opts || {};
2245
+ const load = () => {
2246
+ return new Promise((resolve, reject) => {
2247
+ if (!src) reject(new Error(NO_SRC_ERROR));
2248
+ if (!document || !document.body) reject(new Error(NO_DOCUMENT_ERROR));
2249
+ const script = document.createElement("script");
2250
+ if (crossOrigin) script.setAttribute("crossorigin", crossOrigin);
2251
+ script.async = async || false;
2252
+ script.defer = defer || false;
2253
+ script.addEventListener("load", () => {
2254
+ console.log("this loaded ", src);
2255
+ script.remove();
2256
+ resolve(script);
2257
+ });
2258
+ script.addEventListener("error", (event) => {
2259
+ var _a5;
2260
+ script.remove();
2261
+ reject((_a5 = event.error) != null ? _a5 : /* @__PURE__ */ new Error(`failed to load script: ${src}`));
2262
+ });
2263
+ script.src = src;
2264
+ script.nonce = nonce;
2265
+ beforeLoad == null ? void 0 : beforeLoad(script);
2266
+ document.body.appendChild(script);
2267
+ });
2268
+ };
2269
+ return retry(load, { shouldRetry: (_, iterations) => {
2270
+ console.log("nikos 3", _, iterations);
2271
+ return iterations <= 5;
2272
+ } });
2273
+ }
2274
+
2275
+ // ../shared/dist/runtime/proxy-C0HjCApu.mjs
2276
+ function isValidProxyUrl(key) {
2277
+ if (!key) return true;
2278
+ return isHttpOrHttps(key) || isProxyUrlRelative(key);
2279
+ }
2280
+ function isHttpOrHttps(key) {
2281
+ return /^http(s)?:\/\//.test(key || "");
2282
+ }
2283
+ function isProxyUrlRelative(key) {
2284
+ return key.startsWith("/");
2285
+ }
2286
+ function proxyUrlToAbsoluteURL(url) {
2287
+ if (!url) return "";
2288
+ return isProxyUrlRelative(url) ? new URL(url, window.location.origin).toString() : url;
2289
+ }
2290
+
2291
+ // ../shared/dist/runtime/url-DasDWsj9.mjs
2292
+ function addClerkPrefix(str) {
2293
+ if (!str) return "";
2294
+ let regex;
2295
+ if (str.match(/^(clerk\.)+\w*$/)) regex = /(clerk\.)*(?=clerk\.)/;
2296
+ else if (str.match(/\.clerk.accounts/)) return str;
2297
+ else regex = /^(clerk\.)*/gi;
2298
+ return `clerk.${str.replace(regex, "")}`;
2299
+ }
2300
+
2301
+ // ../shared/dist/runtime/loadClerkJsScript.mjs
2302
+ var { isDevOrStagingUrl } = createDevOrStagingUrlCache();
2161
2303
  var errorThrower2 = buildErrorThrower({ packageName: "@clerk/shared" });
2304
+ function isClerkGlobalProperlyLoaded(prop) {
2305
+ if (typeof window === "undefined" || !window[prop]) return false;
2306
+ return !!window[prop];
2307
+ }
2308
+ var isClerkUiProperlyLoaded = () => isClerkGlobalProperlyLoaded("__unstable_ClerkUiCtor");
2309
+ var loadClerkUiScript = async (opts) => {
2310
+ var _a5;
2311
+ const timeout = (_a5 = opts == null ? void 0 : opts.scriptLoadTimeout) != null ? _a5 : 15e3;
2312
+ const rejectWith = (error) => new ClerkRuntimeError("Failed to load Clerk UI" + ((error == null ? void 0 : error.message) ? `, ${error.message}` : ""), {
2313
+ code: "failed_to_load_clerk_ui",
2314
+ cause: error
2315
+ });
2316
+ if (isClerkUiProperlyLoaded()) return null;
2317
+ if (document.querySelector("script[data-clerk-ui-script]")) return waitForPredicateWithTimeout(timeout, isClerkUiProperlyLoaded, rejectWith());
2318
+ if (!(opts == null ? void 0 : opts.publishableKey)) {
2319
+ errorThrower2.throwMissingPublishableKeyError();
2320
+ return null;
2321
+ }
2322
+ const loadPromise = waitForPredicateWithTimeout(timeout, isClerkUiProperlyLoaded, rejectWith());
2323
+ loadScript(clerkUiScriptUrl(opts), {
2324
+ async: true,
2325
+ crossOrigin: "anonymous",
2326
+ nonce: opts.nonce,
2327
+ beforeLoad: applyAttributesToScript(buildClerkUiScriptAttributes(opts))
2328
+ }).catch((error) => {
2329
+ throw rejectWith(error);
2330
+ });
2331
+ return loadPromise;
2332
+ };
2333
+ var clerkUiScriptUrl = (opts) => {
2334
+ const { clerkUiUrl, proxyUrl, domain, publishableKey } = opts;
2335
+ if (clerkUiUrl) return clerkUiUrl;
2336
+ return `https://${buildScriptHost({
2337
+ publishableKey,
2338
+ proxyUrl,
2339
+ domain
2340
+ })}/npm/@clerk/ui@latest/dist/ui.browser.js`;
2341
+ };
2342
+ var buildClerkJsScriptAttributes = (options) => {
2343
+ const obj = {};
2344
+ if (options.publishableKey) obj["data-clerk-publishable-key"] = options.publishableKey;
2345
+ if (options.proxyUrl) obj["data-clerk-proxy-url"] = options.proxyUrl;
2346
+ if (options.domain) obj["data-clerk-domain"] = options.domain;
2347
+ if (options.nonce) obj.nonce = options.nonce;
2348
+ return obj;
2349
+ };
2350
+ var buildClerkUiScriptAttributes = (options) => {
2351
+ return buildClerkJsScriptAttributes(options);
2352
+ };
2353
+ var applyAttributesToScript = (attributes) => (script) => {
2354
+ for (const attribute in attributes) script.setAttribute(attribute, attributes[attribute]);
2355
+ };
2356
+ var buildScriptHost = (opts) => {
2357
+ var _a5, _b;
2358
+ const { proxyUrl, domain, publishableKey } = opts;
2359
+ if (!!proxyUrl && isValidProxyUrl(proxyUrl)) return proxyUrlToAbsoluteURL(proxyUrl).replace(/http(s)?:\/\//, "");
2360
+ else if (domain && !isDevOrStagingUrl(((_a5 = parsePublishableKey(publishableKey)) == null ? void 0 : _a5.frontendApi) || "")) return addClerkPrefix(domain);
2361
+ else return ((_b = parsePublishableKey(publishableKey)) == null ? void 0 : _b.frontendApi) || "";
2362
+ };
2363
+ function waitForPredicateWithTimeout(timeoutMs, predicate, rejectWith) {
2364
+ return new Promise((resolve, reject) => {
2365
+ let resolved = false;
2366
+ const cleanup = (timeoutId$1, pollInterval$1) => {
2367
+ clearTimeout(timeoutId$1);
2368
+ clearInterval(pollInterval$1);
2369
+ };
2370
+ const checkAndResolve = () => {
2371
+ if (resolved) return;
2372
+ if (predicate()) {
2373
+ resolved = true;
2374
+ cleanup(timeoutId, pollInterval);
2375
+ resolve(null);
2376
+ }
2377
+ };
2378
+ const handleTimeout = () => {
2379
+ if (resolved) return;
2380
+ resolved = true;
2381
+ cleanup(timeoutId, pollInterval);
2382
+ if (!predicate()) reject(rejectWith);
2383
+ else resolve(null);
2384
+ };
2385
+ const timeoutId = setTimeout(handleTimeout, timeoutMs);
2386
+ checkAndResolve();
2387
+ const pollInterval = setInterval(() => {
2388
+ if (resolved) {
2389
+ clearInterval(pollInterval);
2390
+ return;
2391
+ }
2392
+ checkAndResolve();
2393
+ }, 100);
2394
+ });
2395
+ }
2162
2396
  function setClerkJsLoadingErrorPackageName(packageName) {
2163
2397
  errorThrower2.setPackageName({ packageName });
2164
2398
  }
2165
2399
 
2166
- // ../shared/dist/runtime/deriveState-ChDqlleE.mjs
2400
+ // ../shared/dist/runtime/deriveState.mjs
2167
2401
  var deriveState = (clerkOperational, state, initialState) => {
2168
2402
  if (!clerkOperational && initialState) return deriveFromSsrInitialState(initialState);
2169
2403
  return deriveFromClientSideState(state);
@@ -2222,12 +2456,12 @@ var deriveFromClientSideState = (state) => {
2222
2456
  };
2223
2457
  };
2224
2458
 
2225
- // ../shared/dist/runtime/browser-D5e8obql.mjs
2459
+ // ../shared/dist/runtime/browser-DursrJlr.mjs
2226
2460
  function inBrowser() {
2227
2461
  return typeof window !== "undefined";
2228
2462
  }
2229
2463
 
2230
- // ../shared/dist/runtime/eventBus-UpdW-1JB.mjs
2464
+ // ../shared/dist/runtime/eventBus-TFTcHo0F.mjs
2231
2465
  var _on = (eventToHandlersMap, latestPayloadMap, event, handler, opts) => {
2232
2466
  const { notify } = opts || {};
2233
2467
  let handlers = eventToHandlersMap.get(event);
@@ -2436,6 +2670,9 @@ var StateProxy = class {
2436
2670
  signUpSignal() {
2437
2671
  return this.signUpSignalProxy;
2438
2672
  }
2673
+ checkoutSignal(params) {
2674
+ return this.buildCheckoutProxy(params);
2675
+ }
2439
2676
  buildSignInProxy() {
2440
2677
  const gateProperty = this.gateProperty.bind(this);
2441
2678
  const target = () => this.client.signIn.__internal_future;
@@ -2506,6 +2743,9 @@ var StateProxy = class {
2506
2743
  }
2507
2744
  });
2508
2745
  },
2746
+ get hasBeenFinalized() {
2747
+ return gateProperty(target, "hasBeenFinalized", false);
2748
+ },
2509
2749
  create: this.gateMethod(target, "create"),
2510
2750
  password: this.gateMethod(target, "password"),
2511
2751
  sso: this.gateMethod(target, "sso"),
@@ -2604,6 +2844,9 @@ var StateProxy = class {
2604
2844
  get isTransferable() {
2605
2845
  return gateProperty(target, "isTransferable", false);
2606
2846
  },
2847
+ get hasBeenFinalized() {
2848
+ return gateProperty(target, "hasBeenFinalized", false);
2849
+ },
2607
2850
  create: gateMethod(target, "create"),
2608
2851
  update: gateMethod(target, "update"),
2609
2852
  sso: gateMethod(target, "sso"),
@@ -2620,6 +2863,59 @@ var StateProxy = class {
2620
2863
  }
2621
2864
  };
2622
2865
  }
2866
+ buildCheckoutProxy(params) {
2867
+ const gateProperty = this.gateProperty.bind(this);
2868
+ const targetCheckout = () => this.checkout(params);
2869
+ const target = () => targetCheckout().checkout;
2870
+ return {
2871
+ errors: {
2872
+ raw: null,
2873
+ global: null
2874
+ },
2875
+ fetchStatus: "idle",
2876
+ checkout: {
2877
+ get status() {
2878
+ return gateProperty(target, "status", "needs_initialization");
2879
+ },
2880
+ get externalClientSecret() {
2881
+ return gateProperty(target, "externalClientSecret", null);
2882
+ },
2883
+ get externalGatewayId() {
2884
+ return gateProperty(target, "externalGatewayId", null);
2885
+ },
2886
+ get paymentMethod() {
2887
+ return gateProperty(target, "paymentMethod", null);
2888
+ },
2889
+ get plan() {
2890
+ return gateProperty(target, "plan", null);
2891
+ },
2892
+ get planPeriod() {
2893
+ return gateProperty(target, "planPeriod", null);
2894
+ },
2895
+ get totals() {
2896
+ return gateProperty(target, "totals", null);
2897
+ },
2898
+ get isImmediatePlanChange() {
2899
+ return gateProperty(target, "isImmediatePlanChange", false);
2900
+ },
2901
+ get freeTrialEndsAt() {
2902
+ return gateProperty(target, "freeTrialEndsAt", null);
2903
+ },
2904
+ get payer() {
2905
+ return gateProperty(target, "payer", null);
2906
+ },
2907
+ get planPeriodStart() {
2908
+ return gateProperty(target, "planPeriodStart", null);
2909
+ },
2910
+ get needsPaymentMethod() {
2911
+ return gateProperty(target, "needsPaymentMethod", null);
2912
+ },
2913
+ start: this.gateMethod(target, "start"),
2914
+ confirm: this.gateMethod(target, "confirm"),
2915
+ finalize: this.gateMethod(target, "finalize")
2916
+ }
2917
+ };
2918
+ }
2623
2919
  __internal_effect(_) {
2624
2920
  throw new Error("__internal_effect called before Clerk is loaded");
2625
2921
  }
@@ -2633,6 +2929,13 @@ var StateProxy = class {
2633
2929
  }
2634
2930
  return c;
2635
2931
  }
2932
+ get checkout() {
2933
+ const c = this.isomorphicClerk.__experimental_checkout;
2934
+ if (!c) {
2935
+ throw new Error("Clerk checkout not ready");
2936
+ }
2937
+ return c;
2938
+ }
2636
2939
  gateProperty(getTarget, key, defaultValue) {
2637
2940
  return (() => {
2638
2941
  if (!inBrowser() || !this.isomorphicClerk.loaded) {
@@ -2675,8 +2978,8 @@ if (typeof globalThis.__BUILD_DISABLE_RHC__ === "undefined") {
2675
2978
  globalThis.__BUILD_DISABLE_RHC__ = false;
2676
2979
  }
2677
2980
  var SDK_METADATA = {
2678
- name: "@clerk/clerk-react",
2679
- version: "5.56.3-canary.v20251124124818",
2981
+ name: "@clerk/react",
2982
+ version: "6.0.0-canary-core3.v20251124161754",
2680
2983
  environment: process.env.NODE_ENV
2681
2984
  };
2682
2985
  var _status;
@@ -2911,7 +3214,7 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
2911
3214
  throw new Error("Failed to hydrate latest Clerk JS");
2912
3215
  }
2913
3216
  };
2914
- this.hydrateClerkJS = (clerkjs) => {
3217
+ this.replayInterceptedInvocations = (clerkjs) => {
2915
3218
  var _a5, _b;
2916
3219
  if (!clerkjs) {
2917
3220
  throw new Error("Failed to hydrate latest Clerk JS");
@@ -3000,8 +3303,7 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
3000
3303
  return this.clerkjs;
3001
3304
  };
3002
3305
  this.__experimental_checkout = (...args) => {
3003
- var _a5;
3004
- return (_a5 = this.clerkjs) == null ? void 0 : _a5.__experimental_checkout(...args);
3306
+ return this.loaded && this.clerkjs ? this.clerkjs.__experimental_checkout(...args) : __privateGet2(this, _stateProxy).checkoutSignal(...args);
3005
3307
  };
3006
3308
  this.__unstable__updateProps = async (props) => {
3007
3309
  const clerkjs = await __privateMethod2(this, _IsomorphicClerk_instances, waitForClerkJS_fn).call(this);
@@ -3677,12 +3979,11 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
3677
3979
  this.premountMethodCalls.set("signOut", callback);
3678
3980
  }
3679
3981
  };
3680
- const { Clerk: Clerk2 = null, publishableKey } = options || {};
3681
- __privateSet2(this, _publishableKey, publishableKey);
3982
+ __privateSet2(this, _publishableKey, options == null ? void 0 : options.publishableKey);
3682
3983
  __privateSet2(this, _proxyUrl, options == null ? void 0 : options.proxyUrl);
3683
3984
  __privateSet2(this, _domain, options == null ? void 0 : options.domain);
3684
3985
  this.options = options;
3685
- this.Clerk = Clerk2;
3986
+ this.Clerk = (options == null ? void 0 : options.Clerk) || null;
3686
3987
  this.mode = inBrowser() ? "browser" : "server";
3687
3988
  __privateSet2(this, _stateProxy, new StateProxy(this));
3688
3989
  if (!this.options.sdkMetadata) {
@@ -3691,7 +3992,7 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
3691
3992
  __privateGet2(this, _eventBus).emit(clerkEvents.Status, "loading");
3692
3993
  __privateGet2(this, _eventBus).prioritizedOn(clerkEvents.Status, (status) => __privateSet2(this, _status, status));
3693
3994
  if (__privateGet2(this, _publishableKey)) {
3694
- void this.loadClerkJS();
3995
+ void this.getEntryChunks();
3695
3996
  }
3696
3997
  }
3697
3998
  get publishableKey() {
@@ -3780,8 +4081,7 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
3780
4081
  }
3781
4082
  return false;
3782
4083
  }
3783
- async loadClerkJS() {
3784
- var _a5;
4084
+ async getEntryChunks() {
3785
4085
  if (this.mode !== "browser" || this.loaded) {
3786
4086
  return;
3787
4087
  }
@@ -3791,28 +4091,15 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
3791
4091
  window.__clerk_domain = this.domain;
3792
4092
  }
3793
4093
  try {
3794
- if (this.Clerk) {
3795
- let c;
3796
- if (isConstructor(this.Clerk)) {
3797
- c = new this.Clerk(__privateGet2(this, _publishableKey), {
3798
- proxyUrl: this.proxyUrl,
3799
- domain: this.domain
3800
- });
3801
- this.beforeLoad(c);
3802
- await c.load(this.options);
3803
- } else {
3804
- c = this.Clerk;
3805
- if (!c.loaded) {
3806
- this.beforeLoad(c);
3807
- await c.load(this.options);
3808
- }
3809
- }
3810
- global.Clerk = c;
3811
- } else if (false) ;
3812
- if ((_a5 = global.Clerk) == null ? void 0 : _a5.loaded) {
3813
- return this.hydrateClerkJS(global.Clerk);
4094
+ const clerkUiCtor = this.getClerkUiEntryChunk();
4095
+ const clerk2 = await this.getClerkJsEntryChunk();
4096
+ if (!clerk2.loaded) {
4097
+ this.beforeLoad(clerk2);
4098
+ await clerk2.load({ ...this.options, clerkUiCtor });
4099
+ }
4100
+ if (clerk2.loaded) {
4101
+ this.replayInterceptedInvocations(clerk2);
3814
4102
  }
3815
- return;
3816
4103
  } catch (err) {
3817
4104
  const error = err;
3818
4105
  __privateGet2(this, _eventBus).emit(clerkEvents.Status, "error");
@@ -3820,6 +4107,32 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
3820
4107
  return;
3821
4108
  }
3822
4109
  }
4110
+ async getClerkJsEntryChunk() {
4111
+ if (!this.options.Clerk && false) ;
4112
+ if (this.options.Clerk) {
4113
+ global.Clerk = isConstructor(this.options.Clerk) ? new this.options.Clerk(__privateGet2(this, _publishableKey), { proxyUrl: this.proxyUrl, domain: this.domain }) : this.options.Clerk;
4114
+ }
4115
+ if (!global.Clerk) {
4116
+ throw new Error("Failed to download latest ClerkJS. Contact support@clerk.com.");
4117
+ }
4118
+ return global.Clerk;
4119
+ }
4120
+ async getClerkUiEntryChunk() {
4121
+ if (this.options.clerkUiCtor) {
4122
+ return this.options.clerkUiCtor;
4123
+ }
4124
+ await loadClerkUiScript({
4125
+ ...this.options,
4126
+ publishableKey: __privateGet2(this, _publishableKey),
4127
+ proxyUrl: this.proxyUrl,
4128
+ domain: this.domain,
4129
+ nonce: this.options.nonce
4130
+ });
4131
+ if (!global.__unstable_ClerkUiCtor) {
4132
+ throw new Error("Failed to download latest Clerk UI. Contact support@clerk.com.");
4133
+ }
4134
+ return global.__unstable_ClerkUiCtor;
4135
+ }
3823
4136
  get version() {
3824
4137
  var _a5;
3825
4138
  return (_a5 = this.clerkjs) == null ? void 0 : _a5.version;
@@ -4018,10 +4331,10 @@ function ClerkProviderBase(props) {
4018
4331
  }
4019
4332
  var ClerkProvider = withMaxAllowedInstancesGuard(ClerkProviderBase, "ClerkProvider", multipleClerkProvidersError);
4020
4333
  ClerkProvider.displayName = "ClerkProvider";
4021
- setErrorThrowerOptions({ packageName: "@clerk/clerk-react" });
4022
- setClerkJsLoadingErrorPackageName("@clerk/clerk-react");
4334
+ setErrorThrowerOptions({ packageName: "@clerk/react" });
4335
+ setClerkJsLoadingErrorPackageName("@clerk/react");
4023
4336
 
4024
- // ../shared/dist/runtime/devBrowser-Dm-lbUnV.mjs
4337
+ // ../shared/dist/runtime/devBrowser.mjs
4025
4338
  var DEV_BROWSER_JWT_KEY = "__clerk_db_jwt";
4026
4339
 
4027
4340
  // src/types.ts
@@ -4220,9 +4533,9 @@ var BrowserStorageCache = createBrowserStorageCache();
4220
4533
  var clerk;
4221
4534
  noRhc.Clerk.sdkMetadata = {
4222
4535
  name: "@clerk/chrome-extension",
4223
- version: "2.8.5-canary.v20251124124818"
4536
+ version: "3.0.0-canary-core3.v20251124161754"
4224
4537
  };
4225
- async function createClerkClient({
4538
+ function createClerkClient({
4226
4539
  __experimental_syncHostListener = false,
4227
4540
  publishableKey,
4228
4541
  scope,
@@ -4245,7 +4558,7 @@ async function createClerkClient({
4245
4558
  sync
4246
4559
  });
4247
4560
  const url = syncHost ? syncHost : DEFAULT_LOCAL_HOST_PERMISSION;
4248
- clerk = new noRhc.Clerk(publishableKey);
4561
+ clerk = new noRhc.Clerk(publishableKey, {});
4249
4562
  const jwtOptions = {
4250
4563
  frontendApi: key.frontendApi,
4251
4564
  name: isProd ? CLIENT_JWT_KEY : DEV_BROWSER_JWT_KEY,
@@ -4275,11 +4588,7 @@ function ClerkProvider2(props) {
4275
4588
  const { publishableKey = "" } = props;
4276
4589
  const [clerkInstance, setClerkInstance] = React7__default.default.useState(null);
4277
4590
  React7__default.default.useEffect(() => {
4278
- void (async () => {
4279
- setClerkInstance(
4280
- await createClerkClient({ publishableKey, storageCache, syncHost, __experimental_syncHostListener })
4281
- );
4282
- })();
4591
+ setClerkInstance(createClerkClient({ publishableKey, storageCache, syncHost, __experimental_syncHostListener }));
4283
4592
  }, [publishableKey, storageCache, syncHost, __experimental_syncHostListener]);
4284
4593
  if (!clerkInstance) {
4285
4594
  return null;
@@ -4289,6 +4598,7 @@ function ClerkProvider2(props) {
4289
4598
  {
4290
4599
  ...rest,
4291
4600
  Clerk: clerkInstance,
4601
+ clerkUiCtor: entry.ClerkUi,
4292
4602
  standardBrowser: !syncHost,
4293
4603
  children
4294
4604
  }