@clerk/chrome-extension 2.8.2-snapshot.v20251113231557 → 2.8.2-snapshot.v20251117183539

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.
@@ -1,8 +1,8 @@
1
- import { __export, buildErrorThrower, createDevOrStagingUrlCache, createClerkClient, isClerkAPIResponseError, ClerkRuntimeError, isPublishableKey } from './chunk-UW5JW3SJ.js';
1
+ import { __export, buildErrorThrower, createDevOrStagingUrlCache, createClerkClient, isClerkAPIResponseError, ClerkRuntimeError, isPublishableKey } from './chunk-ML4XGOW5.js';
2
2
  import React7, { createContext, useContext, useState, useRef, useEffect, createElement, useCallback, useMemo, useLayoutEffect, useDebugValue } from 'react';
3
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
3
  import { useSyncExternalStore } from 'use-sync-external-store/shim/index.js';
5
4
  import { createPortal } from 'react-dom';
5
+ import { jsx } from 'react/jsx-runtime';
6
6
 
7
7
  // ../shared/dist/runtime/authorization-XX4mKaAz.mjs
8
8
  var TYPES_TO_OBJECTS = {
@@ -178,7 +178,7 @@ var resolveAuthState = ({ authObject: { sessionId, sessionStatus, userId, actor,
178
178
  };
179
179
  };
180
180
 
181
- // ../shared/dist/runtime/telemetry-x9LpQpc1.mjs
181
+ // ../shared/dist/runtime/telemetry-wqMDWlvR.mjs
182
182
  var EVENT_METHOD_CALLED = "METHOD_CALLED";
183
183
  var EVENT_SAMPLING_RATE$2 = 0.1;
184
184
  function eventMethodCalled(method, payload) {
@@ -204,20 +204,19 @@ var isReverificationHint = (result) => {
204
204
  return result && typeof result === "object" && "clerk_error" in result && ((_a = result.clerk_error) == null ? void 0 : _a.type) === "forbidden" && ((_b = result.clerk_error) == null ? void 0 : _b.reason) === REVERIFICATION_REASON;
205
205
  };
206
206
 
207
- // ../shared/dist/runtime/noop-8bk75rVj.mjs
207
+ // ../shared/dist/runtime/noop-B3MbDAfb.mjs
208
208
  var noop = (..._args) => {
209
209
  };
210
210
 
211
- // ../shared/dist/runtime/createDeferredPromise-UKTFg5ib.mjs
211
+ // ../shared/dist/runtime/createDeferredPromise-CjYZzUuU.mjs
212
212
  var createDeferredPromise = () => {
213
213
  let resolve = noop;
214
214
  let reject = noop;
215
- const promise = new Promise((res, rej) => {
216
- resolve = res;
217
- reject = rej;
218
- });
219
215
  return {
220
- promise,
216
+ promise: new Promise((res, rej) => {
217
+ resolve = res;
218
+ reject = rej;
219
+ }),
221
220
  resolve,
222
221
  reject
223
222
  };
@@ -1534,7 +1533,7 @@ function dequal2(foo, bar) {
1534
1533
 
1535
1534
  // ../shared/dist/runtime/react/index.mjs
1536
1535
  function assertContextExists(contextVal, msgOrCtx) {
1537
- if (!contextVal) throw typeof msgOrCtx === "string" ? new Error(msgOrCtx) : new Error(`${msgOrCtx.displayName} not found`);
1536
+ if (!contextVal) throw typeof msgOrCtx === "string" ? new Error(msgOrCtx) : /* @__PURE__ */ new Error(`${msgOrCtx.displayName} not found`);
1538
1537
  }
1539
1538
  var createContextAndHook = (displayName, options) => {
1540
1539
  const { assertCtxFn = assertContextExists } = {};
@@ -1556,10 +1555,7 @@ var createContextAndHook = (displayName, options) => {
1556
1555
  ];
1557
1556
  };
1558
1557
  function SWRConfigCompat({ swrConfig, children }) {
1559
- return /* @__PURE__ */ jsx(SWRConfig2, {
1560
- value: swrConfig,
1561
- children
1562
- });
1558
+ return /* @__PURE__ */ React7.createElement(SWRConfig2, { value: swrConfig }, children);
1563
1559
  }
1564
1560
  var [ClerkInstanceContext, useClerkInstanceContext] = createContextAndHook("ClerkInstanceContext");
1565
1561
  var [UserContext, useUserContext] = createContextAndHook("UserContext");
@@ -1568,24 +1564,14 @@ var [SessionContext, useSessionContext] = createContextAndHook("SessionContext")
1568
1564
  React7.createContext({});
1569
1565
  var [CheckoutContext] = createContextAndHook("CheckoutContext");
1570
1566
  var __experimental_CheckoutProvider = ({ children, ...rest }) => {
1571
- return /* @__PURE__ */ jsx(CheckoutContext.Provider, {
1572
- value: { value: rest },
1573
- children
1574
- });
1567
+ return /* @__PURE__ */ React7.createElement(CheckoutContext.Provider, { value: { value: rest } }, children);
1575
1568
  };
1576
1569
  var [OrganizationContextInternal, useOrganizationContext] = createContextAndHook("OrganizationContext");
1577
1570
  var OrganizationProvider = ({ children, organization, swrConfig }) => {
1578
- return /* @__PURE__ */ jsx(SWRConfigCompat, {
1579
- swrConfig,
1580
- children: /* @__PURE__ */ jsx(OrganizationContextInternal.Provider, {
1581
- value: { value: { organization } },
1582
- children
1583
- })
1584
- });
1571
+ return /* @__PURE__ */ React7.createElement(SWRConfigCompat, { swrConfig }, /* @__PURE__ */ React7.createElement(OrganizationContextInternal.Provider, { value: { value: { organization } } }, children));
1585
1572
  };
1586
1573
  function useAssertWrappedByClerkProvider(displayNameOrFn) {
1587
- const ctx = React7.useContext(ClerkInstanceContext);
1588
- if (!ctx) {
1574
+ if (!React7.useContext(ClerkInstanceContext)) {
1589
1575
  if (typeof displayNameOrFn === "function") {
1590
1576
  displayNameOrFn();
1591
1577
  return;
@@ -1599,6 +1585,23 @@ Possible fixes:
1599
1585
  Learn more: https://clerk.com/docs/components/clerk-provider`.trim());
1600
1586
  }
1601
1587
  }
1588
+ function createCacheKeys(params) {
1589
+ return {
1590
+ queryKey: [
1591
+ params.stablePrefix,
1592
+ params.authenticated,
1593
+ params.tracked,
1594
+ params.untracked
1595
+ ],
1596
+ invalidationKey: [
1597
+ params.stablePrefix,
1598
+ params.authenticated,
1599
+ params.tracked
1600
+ ],
1601
+ stableKey: params.stablePrefix,
1602
+ authenticated: params.authenticated
1603
+ };
1604
+ }
1602
1605
  var useWithSafeValues = (params, defaultValues) => {
1603
1606
  var _a, _b, _c;
1604
1607
  const shouldUseDefaults = typeof params === "boolean" && params;
@@ -1635,51 +1638,51 @@ var cachingSWRInfiniteOptions = {
1635
1638
  ...cachingSWROptions,
1636
1639
  revalidateFirstPage: false
1637
1640
  };
1638
- var usePagesOrInfinite = (params, fetcher, config, cacheKeys) => {
1641
+ var usePagesOrInfinite = (params) => {
1639
1642
  var _a, _b, _c, _d, _e, _f, _g;
1640
- const [paginatedPage, setPaginatedPage] = useState((_a = params.initialPage) != null ? _a : 1);
1641
- const initialPageRef = useRef((_b = params.initialPage) != null ? _b : 1);
1642
- const pageSizeRef = useRef((_c = params.pageSize) != null ? _c : 10);
1643
+ const { fetcher, config, keys } = params;
1644
+ const [paginatedPage, setPaginatedPage] = useState((_a = config.initialPage) != null ? _a : 1);
1645
+ const initialPageRef = useRef((_b = config.initialPage) != null ? _b : 1);
1646
+ const pageSizeRef = useRef((_c = config.pageSize) != null ? _c : 10);
1643
1647
  const enabled = (_d = config.enabled) != null ? _d : true;
1644
1648
  const cacheMode = config.__experimental_mode === "cache";
1645
1649
  const triggerInfinite = (_e = config.infinite) != null ? _e : false;
1646
1650
  const keepPreviousData = (_f = config.keepPreviousData) != null ? _f : false;
1647
1651
  const isSignedIn = config.isSignedIn;
1648
1652
  const pagesCacheKey = {
1649
- ...cacheKeys,
1650
- ...params,
1653
+ type: keys.queryKey[0],
1654
+ ...keys.queryKey[2],
1655
+ ...keys.queryKey[3].args,
1651
1656
  initialPage: paginatedPage,
1652
1657
  pageSize: pageSizeRef.current
1653
1658
  };
1654
1659
  const previousIsSignedIn = usePreviousValue(isSignedIn);
1655
1660
  const shouldFetch = !triggerInfinite && enabled && (!cacheMode ? !!fetcher : true);
1656
- const swrKey = typeof isSignedIn === "boolean" ? previousIsSignedIn === true && isSignedIn === false ? pagesCacheKey : isSignedIn ? shouldFetch ? pagesCacheKey : null : null : shouldFetch ? pagesCacheKey : null;
1657
- const swrFetcher = !cacheMode && !!fetcher ? (cacheKeyParams) => {
1661
+ const { data: swrData, isValidating: swrIsValidating, isLoading: swrIsLoading, error: swrError, mutate: swrMutate } = useSWR(typeof isSignedIn === "boolean" ? previousIsSignedIn === true && isSignedIn === false ? pagesCacheKey : isSignedIn ? shouldFetch ? pagesCacheKey : null : null : shouldFetch ? pagesCacheKey : null, !cacheMode && !!fetcher ? (cacheKeyParams) => {
1658
1662
  if (isSignedIn === false || shouldFetch === false) return null;
1659
- const requestParams = getDifferentKeys(cacheKeyParams, cacheKeys);
1660
- return fetcher({
1661
- ...params,
1662
- ...requestParams
1663
- });
1664
- } : null;
1665
- const { data: swrData, isValidating: swrIsValidating, isLoading: swrIsLoading, error: swrError, mutate: swrMutate } = useSWR(swrKey, swrFetcher, {
1663
+ return fetcher(getDifferentKeys(cacheKeyParams, {
1664
+ type: keys.queryKey[0],
1665
+ ...keys.queryKey[2]
1666
+ }));
1667
+ } : null, {
1666
1668
  keepPreviousData,
1667
1669
  ...cachingSWROptions
1668
1670
  });
1669
1671
  const { data: swrInfiniteData, isLoading: swrInfiniteIsLoading, isValidating: swrInfiniteIsValidating, error: swrInfiniteError, size, setSize, mutate: swrInfiniteMutate } = useSWRInfinite((pageIndex) => {
1670
1672
  if (!triggerInfinite || !enabled || isSignedIn === false) return null;
1671
1673
  return {
1672
- ...params,
1673
- ...cacheKeys,
1674
+ type: keys.queryKey[0],
1675
+ ...keys.queryKey[2],
1676
+ ...keys.queryKey[3].args,
1674
1677
  initialPage: initialPageRef.current + pageIndex,
1675
1678
  pageSize: pageSizeRef.current
1676
1679
  };
1677
1680
  }, (cacheKeyParams) => {
1678
- const requestParams = getDifferentKeys(cacheKeyParams, cacheKeys);
1679
- return fetcher == null ? void 0 : fetcher({
1680
- ...params,
1681
- ...requestParams
1681
+ const requestParams = getDifferentKeys(cacheKeyParams, {
1682
+ type: keys.queryKey[0],
1683
+ ...keys.queryKey[2]
1682
1684
  });
1685
+ return fetcher == null ? void 0 : fetcher(requestParams);
1683
1686
  }, cachingSWRInfiniteOptions);
1684
1687
  const page = useMemo(() => {
1685
1688
  if (triggerInfinite) return size;
@@ -1725,11 +1728,6 @@ var usePagesOrInfinite = (params, fetcher, config, cacheKeys) => {
1725
1728
  fetchPage((n) => Math.max(0, n - 1));
1726
1729
  }, [fetchPage]);
1727
1730
  const offsetCount = (initialPageRef.current - 1) * pageSizeRef.current;
1728
- const pageCount = Math.ceil((count - offsetCount) / pageSizeRef.current);
1729
- const hasNextPage = count - offsetCount * pageSizeRef.current > page * pageSizeRef.current;
1730
- const hasPreviousPage = (page - 1) * pageSizeRef.current > offsetCount * pageSizeRef.current;
1731
- const setData = triggerInfinite ? (value) => swrInfiniteMutate(value, { revalidate: false }) : (value) => swrMutate(value, { revalidate: false });
1732
- const revalidate = triggerInfinite ? () => swrInfiniteMutate() : () => swrMutate();
1733
1731
  return {
1734
1732
  data,
1735
1733
  count,
@@ -1738,14 +1736,14 @@ var usePagesOrInfinite = (params, fetcher, config, cacheKeys) => {
1738
1736
  isFetching,
1739
1737
  isError,
1740
1738
  page,
1741
- pageCount,
1739
+ pageCount: Math.ceil((count - offsetCount) / pageSizeRef.current),
1742
1740
  fetchPage,
1743
1741
  fetchNext,
1744
1742
  fetchPrevious,
1745
- hasNextPage,
1746
- hasPreviousPage,
1747
- revalidate,
1748
- setData
1743
+ hasNextPage: count - offsetCount * pageSizeRef.current > page * pageSizeRef.current,
1744
+ hasPreviousPage: (page - 1) * pageSizeRef.current > offsetCount * pageSizeRef.current,
1745
+ revalidate: triggerInfinite ? () => swrInfiniteMutate() : () => swrMutate(),
1746
+ setData: triggerInfinite ? (value) => swrInfiniteMutate(value, { revalidate: false }) : (value) => swrMutate(value, { revalidate: false })
1749
1747
  };
1750
1748
  };
1751
1749
  var undefinedPaginatedResource$1 = {
@@ -1823,37 +1821,73 @@ function useOrganization(params) {
1823
1821
  pageSize: invitationsSafeValues.pageSize,
1824
1822
  status: invitationsSafeValues.status
1825
1823
  };
1826
- const domains = usePagesOrInfinite({ ...domainParams }, organization == null ? void 0 : organization.getDomains, {
1827
- keepPreviousData: domainSafeValues.keepPreviousData,
1828
- infinite: domainSafeValues.infinite,
1829
- enabled: !!domainParams
1830
- }, {
1831
- type: "domains",
1832
- organizationId: organization == null ? void 0 : organization.id
1824
+ const domains = usePagesOrInfinite({
1825
+ fetcher: organization == null ? void 0 : organization.getDomains,
1826
+ config: {
1827
+ keepPreviousData: domainSafeValues.keepPreviousData,
1828
+ infinite: domainSafeValues.infinite,
1829
+ enabled: !!domainParams,
1830
+ isSignedIn: Boolean(organization),
1831
+ initialPage: domainSafeValues.initialPage,
1832
+ pageSize: domainSafeValues.pageSize
1833
+ },
1834
+ keys: createCacheKeys({
1835
+ stablePrefix: "domains",
1836
+ authenticated: Boolean(organization),
1837
+ tracked: { organizationId: organization == null ? void 0 : organization.id },
1838
+ untracked: { args: domainParams }
1839
+ })
1833
1840
  });
1834
- const membershipRequests = usePagesOrInfinite({ ...membershipRequestParams }, organization == null ? void 0 : organization.getMembershipRequests, {
1835
- keepPreviousData: membershipRequestSafeValues.keepPreviousData,
1836
- infinite: membershipRequestSafeValues.infinite,
1837
- enabled: !!membershipRequestParams
1838
- }, {
1839
- type: "membershipRequests",
1840
- organizationId: organization == null ? void 0 : organization.id
1841
+ const membershipRequests = usePagesOrInfinite({
1842
+ fetcher: organization == null ? void 0 : organization.getMembershipRequests,
1843
+ config: {
1844
+ keepPreviousData: membershipRequestSafeValues.keepPreviousData,
1845
+ infinite: membershipRequestSafeValues.infinite,
1846
+ enabled: !!membershipRequestParams,
1847
+ isSignedIn: Boolean(organization),
1848
+ initialPage: membershipRequestSafeValues.initialPage,
1849
+ pageSize: membershipRequestSafeValues.pageSize
1850
+ },
1851
+ keys: createCacheKeys({
1852
+ stablePrefix: "membershipRequests",
1853
+ authenticated: Boolean(organization),
1854
+ tracked: { organizationId: organization == null ? void 0 : organization.id },
1855
+ untracked: { args: membershipRequestParams }
1856
+ })
1841
1857
  });
1842
- const memberships = usePagesOrInfinite(membersParams || {}, organization == null ? void 0 : organization.getMemberships, {
1843
- keepPreviousData: membersSafeValues.keepPreviousData,
1844
- infinite: membersSafeValues.infinite,
1845
- enabled: !!membersParams
1846
- }, {
1847
- type: "members",
1848
- organizationId: organization == null ? void 0 : organization.id
1858
+ const memberships = usePagesOrInfinite({
1859
+ fetcher: organization == null ? void 0 : organization.getMemberships,
1860
+ config: {
1861
+ keepPreviousData: membersSafeValues.keepPreviousData,
1862
+ infinite: membersSafeValues.infinite,
1863
+ enabled: !!membersParams,
1864
+ isSignedIn: Boolean(organization),
1865
+ initialPage: membersSafeValues.initialPage,
1866
+ pageSize: membersSafeValues.pageSize
1867
+ },
1868
+ keys: createCacheKeys({
1869
+ stablePrefix: "members",
1870
+ authenticated: Boolean(organization),
1871
+ tracked: { organizationId: organization == null ? void 0 : organization.id },
1872
+ untracked: { args: membersParams }
1873
+ })
1849
1874
  });
1850
- const invitations = usePagesOrInfinite({ ...invitationsParams }, organization == null ? void 0 : organization.getInvitations, {
1851
- keepPreviousData: invitationsSafeValues.keepPreviousData,
1852
- infinite: invitationsSafeValues.infinite,
1853
- enabled: !!invitationsParams
1854
- }, {
1855
- type: "invitations",
1856
- organizationId: organization == null ? void 0 : organization.id
1875
+ const invitations = usePagesOrInfinite({
1876
+ fetcher: organization == null ? void 0 : organization.getInvitations,
1877
+ config: {
1878
+ keepPreviousData: invitationsSafeValues.keepPreviousData,
1879
+ infinite: invitationsSafeValues.infinite,
1880
+ enabled: !!invitationsParams,
1881
+ isSignedIn: Boolean(organization),
1882
+ initialPage: invitationsSafeValues.initialPage,
1883
+ pageSize: invitationsSafeValues.pageSize
1884
+ },
1885
+ keys: createCacheKeys({
1886
+ stablePrefix: "invitations",
1887
+ authenticated: Boolean(organization),
1888
+ tracked: { organizationId: organization == null ? void 0 : organization.id },
1889
+ untracked: { args: invitationsParams }
1890
+ })
1857
1891
  });
1858
1892
  if (organization === void 0) return {
1859
1893
  isLoaded: false,
@@ -1951,29 +1985,56 @@ function useOrganizationList(params) {
1951
1985
  status: userSuggestionsSafeValues.status
1952
1986
  };
1953
1987
  const isClerkLoaded = !!(clerk.loaded && user);
1954
- const memberships = usePagesOrInfinite(userMembershipsParams || {}, user == null ? void 0 : user.getOrganizationMemberships, {
1955
- keepPreviousData: userMembershipsSafeValues.keepPreviousData,
1956
- infinite: userMembershipsSafeValues.infinite,
1957
- enabled: !!userMembershipsParams
1958
- }, {
1959
- type: "userMemberships",
1960
- userId: user == null ? void 0 : user.id
1988
+ const memberships = usePagesOrInfinite({
1989
+ fetcher: user == null ? void 0 : user.getOrganizationMemberships,
1990
+ config: {
1991
+ keepPreviousData: userMembershipsSafeValues.keepPreviousData,
1992
+ infinite: userMembershipsSafeValues.infinite,
1993
+ enabled: !!userMembershipsParams,
1994
+ isSignedIn: Boolean(user),
1995
+ initialPage: userMembershipsSafeValues.initialPage,
1996
+ pageSize: userMembershipsSafeValues.pageSize
1997
+ },
1998
+ keys: createCacheKeys({
1999
+ stablePrefix: "userMemberships",
2000
+ authenticated: Boolean(user),
2001
+ tracked: { userId: user == null ? void 0 : user.id },
2002
+ untracked: { args: userMembershipsParams }
2003
+ })
1961
2004
  });
1962
- const invitations = usePagesOrInfinite({ ...userInvitationsParams }, user == null ? void 0 : user.getOrganizationInvitations, {
1963
- keepPreviousData: userInvitationsSafeValues.keepPreviousData,
1964
- infinite: userInvitationsSafeValues.infinite,
1965
- enabled: !!userInvitationsParams
1966
- }, {
1967
- type: "userInvitations",
1968
- userId: user == null ? void 0 : user.id
2005
+ const invitations = usePagesOrInfinite({
2006
+ fetcher: user == null ? void 0 : user.getOrganizationInvitations,
2007
+ config: {
2008
+ keepPreviousData: userInvitationsSafeValues.keepPreviousData,
2009
+ infinite: userInvitationsSafeValues.infinite,
2010
+ enabled: !!userInvitationsParams,
2011
+ isSignedIn: Boolean(user),
2012
+ initialPage: userInvitationsSafeValues.initialPage,
2013
+ pageSize: userInvitationsSafeValues.pageSize
2014
+ },
2015
+ keys: createCacheKeys({
2016
+ stablePrefix: "userInvitations",
2017
+ authenticated: Boolean(user),
2018
+ tracked: { userId: user == null ? void 0 : user.id },
2019
+ untracked: { args: userInvitationsParams }
2020
+ })
1969
2021
  });
1970
- const suggestions = usePagesOrInfinite({ ...userSuggestionsParams }, user == null ? void 0 : user.getOrganizationSuggestions, {
1971
- keepPreviousData: userSuggestionsSafeValues.keepPreviousData,
1972
- infinite: userSuggestionsSafeValues.infinite,
1973
- enabled: !!userSuggestionsParams
1974
- }, {
1975
- type: "userSuggestions",
1976
- userId: user == null ? void 0 : user.id
2022
+ const suggestions = usePagesOrInfinite({
2023
+ fetcher: user == null ? void 0 : user.getOrganizationSuggestions,
2024
+ config: {
2025
+ keepPreviousData: userSuggestionsSafeValues.keepPreviousData,
2026
+ infinite: userSuggestionsSafeValues.infinite,
2027
+ enabled: !!userSuggestionsParams,
2028
+ isSignedIn: Boolean(user),
2029
+ initialPage: userSuggestionsSafeValues.initialPage,
2030
+ pageSize: userSuggestionsSafeValues.pageSize
2031
+ },
2032
+ keys: createCacheKeys({
2033
+ stablePrefix: "userSuggestions",
2034
+ authenticated: Boolean(user),
2035
+ tracked: { userId: user == null ? void 0 : user.id },
2036
+ untracked: { args: userSuggestionsParams }
2037
+ })
1977
2038
  });
1978
2039
  if (!isClerkLoaded) return {
1979
2040
  isLoaded: false,
@@ -2022,8 +2083,7 @@ var useSessionList = () => {
2022
2083
  useAssertWrappedByClerkProvider(hookName$2);
2023
2084
  const isomorphicClerk = useClerkInstanceContext();
2024
2085
  const client = useClientContext();
2025
- const clerk = useClerkInstanceContext();
2026
- (_a = clerk.telemetry) == null ? void 0 : _a.record(eventMethodCalled(hookName$2));
2086
+ (_a = useClerkInstanceContext().telemetry) == null ? void 0 : _a.record(eventMethodCalled(hookName$2));
2027
2087
  if (!client) return {
2028
2088
  isLoaded: false,
2029
2089
  sessions: void 0,
@@ -2040,8 +2100,7 @@ function useUser() {
2040
2100
  var _a;
2041
2101
  useAssertWrappedByClerkProvider(hookName$1);
2042
2102
  const user = useUserContext();
2043
- const clerk = useClerkInstanceContext();
2044
- (_a = clerk.telemetry) == null ? void 0 : _a.record(eventMethodCalled(hookName$1));
2103
+ (_a = useClerkInstanceContext().telemetry) == null ? void 0 : _a.record(eventMethodCalled(hookName$1));
2045
2104
  if (user === void 0) return {
2046
2105
  isLoaded: false,
2047
2106
  isSignedIn: void 0,
@@ -2076,7 +2135,7 @@ async function resolveResult(result) {
2076
2135
  }
2077
2136
  function createReverificationHandler(params) {
2078
2137
  function assertReverification(fetcher) {
2079
- return async (...args) => {
2138
+ return (async (...args) => {
2080
2139
  var _a, _b;
2081
2140
  let result = await resolveResult(fetcher(...args));
2082
2141
  if (isReverificationHint(result)) {
@@ -2104,7 +2163,7 @@ function createReverificationHandler(params) {
2104
2163
  result = await resolveResult(fetcher(...args));
2105
2164
  }
2106
2165
  return result;
2107
- };
2166
+ });
2108
2167
  }
2109
2168
  return assertReverification;
2110
2169
  }
@@ -2118,12 +2177,11 @@ var useReverification = (fetcher, options) => {
2118
2177
  optionsRef.current = options;
2119
2178
  });
2120
2179
  return useCallback((...args) => {
2121
- const handler = createReverificationHandler({
2180
+ return createReverificationHandler({
2122
2181
  openUIComponent: __internal_openReverification,
2123
2182
  telemetry,
2124
2183
  ...optionsRef.current
2125
- })(fetcherRef.current);
2126
- return handler(...args);
2184
+ })(fetcherRef.current)(...args);
2127
2185
  }, [__internal_openReverification, telemetry]);
2128
2186
  };
2129
2187
  var usePrevious = (value) => {
@@ -2184,11 +2242,9 @@ var PLAIN_OBJECT_STR = "[object Object]";
2184
2242
  var isEqual = (left, right) => {
2185
2243
  if (!isUnknownObject(left) || !isUnknownObject(right)) return left === right;
2186
2244
  const leftArray = Array.isArray(left);
2187
- const rightArray = Array.isArray(right);
2188
- if (leftArray !== rightArray) return false;
2245
+ if (leftArray !== Array.isArray(right)) return false;
2189
2246
  const leftPlainObject = Object.prototype.toString.call(left) === PLAIN_OBJECT_STR;
2190
- const rightPlainObject = Object.prototype.toString.call(right) === PLAIN_OBJECT_STR;
2191
- if (leftPlainObject !== rightPlainObject) return false;
2247
+ if (leftPlainObject !== (Object.prototype.toString.call(right) === PLAIN_OBJECT_STR)) return false;
2192
2248
  if (!leftPlainObject && !leftArray) return left === right;
2193
2249
  const leftKeys = Object.keys(left);
2194
2250
  const rightKeys = Object.keys(right);
@@ -2206,11 +2262,10 @@ var isEqual = (left, right) => {
2206
2262
  return allKeys.every(pred);
2207
2263
  };
2208
2264
  var useElementsOrCheckoutSdkContextWithUseCase = (useCaseString) => {
2209
- const elementsContext = React7.useContext(ElementsContext);
2210
- return parseElementsContext(elementsContext, useCaseString);
2265
+ return parseElementsContext(React7.useContext(ElementsContext), useCaseString);
2211
2266
  };
2212
2267
  var capitalized = (str) => str.charAt(0).toUpperCase() + str.slice(1);
2213
- var createElementComponent = (type, isServer$1) => {
2268
+ var createElementComponent = (type, isServer) => {
2214
2269
  const displayName = `${capitalized(type)}Element`;
2215
2270
  const ClientElement = ({ id, className, fallback, options = {}, onBlur, onFocus, onReady, onChange, onEscape, onClick, onLoadError, onLoaderStart, onNetworksChange, onConfirm, onCancel, onShippingAddressChange, onShippingRateChange }) => {
2216
2271
  const ctx = useElementsOrCheckoutSdkContextWithUseCase(`mounts <${displayName}>`);
@@ -2261,7 +2316,7 @@ var createElementComponent = (type, isServer$1) => {
2261
2316
  }
2262
2317
  };
2263
2318
  }, []);
2264
- return /* @__PURE__ */ jsxs(Fragment, { children: [!isReady && fallback, /* @__PURE__ */ jsx("div", {
2319
+ return /* @__PURE__ */ React7.createElement(React7.Fragment, null, !isReady && fallback, /* @__PURE__ */ React7.createElement("div", {
2265
2320
  id,
2266
2321
  style: {
2267
2322
  height: isReady ? "unset" : "0px",
@@ -2269,23 +2324,22 @@ var createElementComponent = (type, isServer$1) => {
2269
2324
  },
2270
2325
  className,
2271
2326
  ref: domNode
2272
- })] });
2327
+ }));
2273
2328
  };
2274
2329
  const ServerElement = (props) => {
2275
2330
  useElementsOrCheckoutSdkContextWithUseCase(`mounts <${displayName}>`);
2276
2331
  const { id, className } = props;
2277
- return /* @__PURE__ */ jsx("div", {
2332
+ return /* @__PURE__ */ React7.createElement("div", {
2278
2333
  id,
2279
2334
  className
2280
2335
  });
2281
2336
  };
2282
- const Element = isServer$1 ? ServerElement : ClientElement;
2337
+ const Element = isServer ? ServerElement : ClientElement;
2283
2338
  Element.displayName = displayName;
2284
2339
  Element.__elementType = type;
2285
2340
  return Element;
2286
2341
  };
2287
- var isServer = typeof window === "undefined";
2288
- createElementComponent("payment", isServer);
2342
+ createElementComponent("payment", typeof window === "undefined");
2289
2343
  createContextAndHook("StripeLibsContext");
2290
2344
  createContextAndHook("PaymentElementContext");
2291
2345
  createContextAndHook("StripeUtilsContext");
@@ -2469,7 +2523,7 @@ var withClerk = (Component, displayNameOrOptions) => {
2469
2523
  return HOC;
2470
2524
  };
2471
2525
 
2472
- // ../shared/dist/runtime/runtimeEnvironment-aTp6aZUT.mjs
2526
+ // ../shared/dist/runtime/runtimeEnvironment-BB2sO-19.mjs
2473
2527
  var isDevelopmentEnvironment = () => {
2474
2528
  try {
2475
2529
  return process.env.NODE_ENV === "development";
@@ -2492,7 +2546,7 @@ var isProductionEnvironment = () => {
2492
2546
  return false;
2493
2547
  };
2494
2548
 
2495
- // ../shared/dist/runtime/deprecated-CFM4jPRM.mjs
2549
+ // ../shared/dist/runtime/deprecated-BqlFbLHj.mjs
2496
2550
  var displayedWarnings = /* @__PURE__ */ new Set();
2497
2551
  var deprecated = (fnName, warning, key) => {
2498
2552
  const hideWarning = isTestEnvironment() || isProductionEnvironment();
@@ -2633,15 +2687,14 @@ var AuthenticateWithRedirectCallback = withClerk(
2633
2687
  "AuthenticateWithRedirectCallback"
2634
2688
  );
2635
2689
 
2636
- // ../shared/dist/runtime/handleValueOrFn-C3bdLKGZ.mjs
2690
+ // ../shared/dist/runtime/handleValueOrFn-CcwnRX-K.mjs
2637
2691
  function handleValueOrFn(value, url, defaultValue) {
2638
2692
  if (typeof value === "function") return value(url);
2639
2693
  if (typeof value !== "undefined") return value;
2640
2694
  if (typeof defaultValue !== "undefined") return defaultValue;
2641
- return void 0;
2642
2695
  }
2643
2696
 
2644
- // ../shared/dist/runtime/utils-DFvkL3Ii.mjs
2697
+ // ../shared/dist/runtime/utils-DnE51LOo.mjs
2645
2698
  var logErrorInDevMode = (message) => {
2646
2699
  if (isDevelopmentEnvironment()) console.error(`Clerk: ${message}`);
2647
2700
  };
@@ -3528,8 +3581,8 @@ var APIKeys = withClerk(
3528
3581
  ClerkHostRenderer,
3529
3582
  {
3530
3583
  component,
3531
- mount: clerk.mountApiKeys,
3532
- unmount: clerk.unmountApiKeys,
3584
+ mount: clerk.mountAPIKeys,
3585
+ unmount: clerk.unmountAPIKeys,
3533
3586
  updateProps: clerk.__unstable__updateProps,
3534
3587
  props,
3535
3588
  rootProps: rendererRootProps
@@ -3591,14 +3644,14 @@ var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError("Canno
3591
3644
  var __privateSet2 = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
3592
3645
  var __privateMethod2 = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
3593
3646
 
3594
- // ../shared/dist/runtime/loadClerkJsScript-Crtfd8i_.mjs
3647
+ // ../shared/dist/runtime/loadClerkJsScript-KVfSuKQ_.mjs
3595
3648
  var { isDevOrStagingUrl } = createDevOrStagingUrlCache();
3596
3649
  var errorThrower2 = buildErrorThrower({ packageName: "@clerk/shared" });
3597
3650
  function setClerkJsLoadingErrorPackageName(packageName) {
3598
3651
  errorThrower2.setPackageName({ packageName });
3599
3652
  }
3600
3653
 
3601
- // ../shared/dist/runtime/deriveState-BwW5Y_o5.mjs
3654
+ // ../shared/dist/runtime/deriveState-ChDqlleE.mjs
3602
3655
  var deriveState = (clerkOperational, state, initialState) => {
3603
3656
  if (!clerkOperational && initialState) return deriveFromSsrInitialState(initialState);
3604
3657
  return deriveFromClientSideState(state);
@@ -3609,28 +3662,20 @@ var deriveFromSsrInitialState = (initialState) => {
3609
3662
  const sessionId = initialState.sessionId;
3610
3663
  const sessionStatus = initialState.sessionStatus;
3611
3664
  const sessionClaims = initialState.sessionClaims;
3612
- const session = initialState.session;
3613
- const organization = initialState.organization;
3614
- const orgId = initialState.orgId;
3615
- const orgRole = initialState.orgRole;
3616
- const orgPermissions = initialState.orgPermissions;
3617
- const orgSlug = initialState.orgSlug;
3618
- const actor = initialState.actor;
3619
- const factorVerificationAge = initialState.factorVerificationAge;
3620
3665
  return {
3621
3666
  userId,
3622
3667
  user,
3623
3668
  sessionId,
3624
- session,
3669
+ session: initialState.session,
3625
3670
  sessionStatus,
3626
3671
  sessionClaims,
3627
- organization,
3628
- orgId,
3629
- orgRole,
3630
- orgPermissions,
3631
- orgSlug,
3632
- actor,
3633
- factorVerificationAge
3672
+ organization: initialState.organization,
3673
+ orgId: initialState.orgId,
3674
+ orgRole: initialState.orgRole,
3675
+ orgPermissions: initialState.orgPermissions,
3676
+ orgSlug: initialState.orgSlug,
3677
+ actor: initialState.actor,
3678
+ factorVerificationAge: initialState.factorVerificationAge
3634
3679
  };
3635
3680
  };
3636
3681
  var deriveFromClientSideState = (state) => {
@@ -3648,7 +3693,6 @@ var deriveFromClientSideState = (state) => {
3648
3693
  const orgSlug = organization == null ? void 0 : organization.slug;
3649
3694
  const membership = organization ? (_d = user == null ? void 0 : user.organizationMemberships) == null ? void 0 : _d.find((om) => om.organization.id === orgId) : organization;
3650
3695
  const orgPermissions = membership ? membership.permissions : membership;
3651
- const orgRole = membership ? membership.role : membership;
3652
3696
  return {
3653
3697
  userId,
3654
3698
  user,
@@ -3658,7 +3702,7 @@ var deriveFromClientSideState = (state) => {
3658
3702
  sessionClaims,
3659
3703
  organization,
3660
3704
  orgId,
3661
- orgRole,
3705
+ orgRole: membership ? membership.role : membership,
3662
3706
  orgSlug,
3663
3707
  orgPermissions,
3664
3708
  actor,
@@ -3666,12 +3710,12 @@ var deriveFromClientSideState = (state) => {
3666
3710
  };
3667
3711
  };
3668
3712
 
3669
- // ../shared/dist/runtime/browser-hvvxjQRr.mjs
3713
+ // ../shared/dist/runtime/browser-D5e8obql.mjs
3670
3714
  function inBrowser() {
3671
3715
  return typeof window !== "undefined";
3672
3716
  }
3673
3717
 
3674
- // ../shared/dist/runtime/eventBus-BcGgxxPn.mjs
3718
+ // ../shared/dist/runtime/eventBus-UpdW-1JB.mjs
3675
3719
  var _on = (eventToHandlersMap, latestPayloadMap, event, handler, opts) => {
3676
3720
  const { notify } = opts || {};
3677
3721
  let handlers = eventToHandlersMap.get(event);
@@ -3712,8 +3756,6 @@ var clerkEvents = { Status: "status" };
3712
3756
  var createClerkEventBus = () => {
3713
3757
  return createEventBus();
3714
3758
  };
3715
-
3716
- // ../react/dist/index.mjs
3717
3759
  if (typeof window !== "undefined" && !window.global) {
3718
3760
  window.global = typeof global === "undefined" ? window : global;
3719
3761
  }
@@ -4120,7 +4162,7 @@ if (typeof globalThis.__BUILD_DISABLE_RHC__ === "undefined") {
4120
4162
  }
4121
4163
  var SDK_METADATA = {
4122
4164
  name: "@clerk/clerk-react",
4123
- version: "5.55.1-snapshot.v20251113231557",
4165
+ version: "5.56.0-snapshot.v20251117183539",
4124
4166
  environment: process.env.NODE_ENV
4125
4167
  };
4126
4168
  var _status;
@@ -4159,7 +4201,7 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
4159
4201
  this.premountMethodCalls = /* @__PURE__ */ new Map();
4160
4202
  this.premountWaitlistNodes = /* @__PURE__ */ new Map();
4161
4203
  this.premountPricingTableNodes = /* @__PURE__ */ new Map();
4162
- this.premountApiKeysNodes = /* @__PURE__ */ new Map();
4204
+ this.premountAPIKeysNodes = /* @__PURE__ */ new Map();
4163
4205
  this.premountOAuthConsentNodes = /* @__PURE__ */ new Map();
4164
4206
  this.premountTaskChooseOrganizationNodes = /* @__PURE__ */ new Map();
4165
4207
  this.premountAddListenerCalls = /* @__PURE__ */ new Map();
@@ -4428,8 +4470,8 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
4428
4470
  this.premountPricingTableNodes.forEach((props, node) => {
4429
4471
  clerkjs.mountPricingTable(node, props);
4430
4472
  });
4431
- this.premountApiKeysNodes.forEach((props, node) => {
4432
- clerkjs.mountApiKeys(node, props);
4473
+ this.premountAPIKeysNodes.forEach((props, node) => {
4474
+ clerkjs.mountAPIKeys(node, props);
4433
4475
  });
4434
4476
  this.premountOAuthConsentNodes.forEach((props, node) => {
4435
4477
  clerkjs.__internal_mountOAuthConsent(node, props);
@@ -4779,18 +4821,18 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
4779
4821
  this.premountPricingTableNodes.delete(node);
4780
4822
  }
4781
4823
  };
4782
- this.mountApiKeys = (node, props) => {
4824
+ this.mountAPIKeys = (node, props) => {
4783
4825
  if (this.clerkjs && this.loaded) {
4784
- this.clerkjs.mountApiKeys(node, props);
4826
+ this.clerkjs.mountAPIKeys(node, props);
4785
4827
  } else {
4786
- this.premountApiKeysNodes.set(node, props);
4828
+ this.premountAPIKeysNodes.set(node, props);
4787
4829
  }
4788
4830
  };
4789
- this.unmountApiKeys = (node) => {
4831
+ this.unmountAPIKeys = (node) => {
4790
4832
  if (this.clerkjs && this.loaded) {
4791
- this.clerkjs.unmountApiKeys(node);
4833
+ this.clerkjs.unmountAPIKeys(node);
4792
4834
  } else {
4793
- this.premountApiKeysNodes.delete(node);
4835
+ this.premountAPIKeysNodes.delete(node);
4794
4836
  }
4795
4837
  };
4796
4838
  this.__internal_mountOAuthConsent = (node, props) => {
@@ -5462,6 +5504,7 @@ function ClerkProviderBase(props) {
5462
5504
  }
5463
5505
  var ClerkProvider = withMaxAllowedInstancesGuard(ClerkProviderBase, "ClerkProvider", multipleClerkProvidersError);
5464
5506
  ClerkProvider.displayName = "ClerkProvider";
5507
+ createContext(null);
5465
5508
  setErrorThrowerOptions({ packageName: "@clerk/clerk-react" });
5466
5509
  setClerkJsLoadingErrorPackageName("@clerk/clerk-react");
5467
5510
  function ClerkProvider2(props) {
@@ -5493,5 +5536,5 @@ function ClerkProvider2(props) {
5493
5536
  var GoogleOneTap2 = () => null;
5494
5537
 
5495
5538
  export { APIKeys, AuthenticateWithRedirectCallback, ClerkDegraded, ClerkFailed, ClerkLoaded, ClerkLoading, ClerkProvider2 as ClerkProvider, CreateOrganization, GoogleOneTap2 as GoogleOneTap, OrganizationList, OrganizationProfile, OrganizationSwitcher, PricingTable, Protect, RedirectToCreateOrganization, RedirectToOrganizationProfile, RedirectToSignIn, RedirectToSignUp, RedirectToUserProfile, SignIn, SignInButton, SignInWithMetamaskButton, SignOutButton, SignUp, SignUpButton, SignedIn, SignedOut, UserAvatar, UserButton, UserProfile, Waitlist, setErrorThrowerOptions, useAuth, useClerk, useEmailLink, useOrganization, useOrganizationList, useReverification, useSession, useSessionList, useSignIn, useSignUp, useUser };
5496
- //# sourceMappingURL=chunk-OYC5BDAX.js.map
5497
- //# sourceMappingURL=chunk-OYC5BDAX.js.map
5539
+ //# sourceMappingURL=chunk-S7XVNXDI.js.map
5540
+ //# sourceMappingURL=chunk-S7XVNXDI.js.map