@superlogic/spree-pay 0.5.3 → 0.5.5

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.
package/build/index.css CHANGED
@@ -926,6 +926,9 @@
926
926
  .sl-spreepay .opacity-70 {
927
927
  opacity: 70%;
928
928
  }
929
+ .sl-spreepay .opacity-75 {
930
+ opacity: 75%;
931
+ }
929
932
  .sl-spreepay .shadow-\(--primary\)\/20 {
930
933
  --tw-shadow-alpha: 20%;
931
934
  --tw-shadow: var(--primary);
package/build/index.js CHANGED
@@ -8,10 +8,10 @@ import {
8
8
  getSplitAmount,
9
9
  getTransactionFee,
10
10
  useSlapiBalance
11
- } from "./chunk-HZDR76ZV.js";
11
+ } from "./chunk-UVD3GGPC.js";
12
12
  import {
13
13
  Iframe3ds
14
- } from "./chunk-PMTKUR3L.js";
14
+ } from "./chunk-OTFCW74L.js";
15
15
  import {
16
16
  InfoBanner,
17
17
  LogLevel,
@@ -27,6 +27,7 @@ import {
27
27
  StaticConfigProvider,
28
28
  cn,
29
29
  configureLogger,
30
+ esm_default,
30
31
  isDeclineStatus,
31
32
  isNewCard,
32
33
  isPaymentError,
@@ -42,21 +43,19 @@ import {
42
43
  useSpreePayRegister,
43
44
  useSpreePaymentMethod,
44
45
  useStaticConfig
45
- } from "./chunk-NOTIAH6W.js";
46
+ } from "./chunk-WYLYH7AK.js";
46
47
 
47
48
  // src/SpreePay.tsx
48
- import { useCallback as useCallback8, useEffect as useEffect8, useMemo as useMemo9, useState as useState12 } from "react";
49
- import NiceModal4 from "@ebay/nice-modal-react";
49
+ import { useCallback as useCallback8, useEffect as useEffect9, useMemo as useMemo9, useState as useState12 } from "react";
50
50
  import { SWRConfig } from "swr";
51
51
 
52
52
  // src/SpreePayContent.tsx
53
- import { Suspense, lazy, useEffect as useEffect6 } from "react";
53
+ import { Suspense, lazy, useEffect as useEffect7 } from "react";
54
54
 
55
55
  // src/components/CreditCardTab/CreditCardTab.tsx
56
- import { useCallback as useCallback6, useEffect as useEffect5, useState as useState10 } from "react";
56
+ import { useCallback as useCallback6, useEffect as useEffect6, useState as useState10 } from "react";
57
57
 
58
58
  // src/hooks/payments/useCardPayment.ts
59
- import NiceModal from "@ebay/nice-modal-react";
60
59
  var cardPaymentLogger = logger.child("card-payment");
61
60
  var useCardPayment = () => {
62
61
  const { selectedPaymentMethod } = useSpreePaymentMethod();
@@ -120,7 +119,7 @@ var useCardPayment = () => {
120
119
  cardPaymentLogger.debug("Starting 3DS flow", {
121
120
  paymentId: paymentResData.id
122
121
  });
123
- const paymentIntent = await NiceModal.show(Iframe3ds, { url: paymentResData.redirectUrl });
122
+ const paymentIntent = await esm_default.show(Iframe3ds, { url: paymentResData.redirectUrl });
124
123
  if (paymentIntent) {
125
124
  cardPaymentLogger.debug("3DS completed, validating", {
126
125
  paymentId: paymentResData.id,
@@ -258,7 +257,6 @@ async function handleSendErc20(params) {
258
257
  }
259
258
 
260
259
  // src/hooks/payments/utils.ts
261
- import NiceModal2 from "@ebay/nice-modal-react";
262
260
  var REFRESH_INTERVAL = 3 * 1e3;
263
261
  var MAX_RETRIES = 10;
264
262
  async function longPollPoints(paymentId) {
@@ -303,7 +301,7 @@ async function longPollCardStatus(paymentId) {
303
301
  return detail.status;
304
302
  }
305
303
  if (!shown3ds && detail.card?.redirectUrl) {
306
- const paymentIntent = await NiceModal2.show(Iframe3ds, { url: detail.card?.redirectUrl });
304
+ const paymentIntent = await esm_default.show(Iframe3ds, { url: detail.card?.redirectUrl });
307
305
  shown3ds = true;
308
306
  if (paymentIntent) {
309
307
  await SlapiPaymentService.validate3DS({ paymentId });
@@ -424,7 +422,6 @@ var usePointsPayment = (mode = "web2") => {
424
422
  };
425
423
 
426
424
  // src/hooks/payments/useSplitCardPayments.ts
427
- import NiceModal3 from "@ebay/nice-modal-react";
428
425
  var splitPaymentLogger = logger.child("split-card-payment");
429
426
  var useSplitCardPayments = (mode = "web2") => {
430
427
  const { selectedPaymentMethod } = useSpreePaymentMethod();
@@ -480,7 +477,7 @@ var useSplitCardPayments = (mode = "web2") => {
480
477
  });
481
478
  if (paymentResData.redirectUrl) {
482
479
  splitPaymentLogger.debug("Starting 3DS flow for card portion", { paymentId: paymentResData.id });
483
- const paymentIntent = await NiceModal3.show(Iframe3ds, { url: paymentResData.redirectUrl });
480
+ const paymentIntent = await esm_default.show(Iframe3ds, { url: paymentResData.redirectUrl });
484
481
  if (paymentIntent) {
485
482
  splitPaymentLogger.debug("3DS completed, validating", { paymentId: paymentResData.id });
486
483
  await SlapiPaymentService.validate3DS({ paymentId: paymentResData.id });
@@ -570,7 +567,7 @@ var useCards = () => {
570
567
  };
571
568
 
572
569
  // src/components/CreditCardTab/CreditCard/CreditCard.tsx
573
- import { useCallback as useCallback2, useMemo as useMemo3, useState as useState3 } from "react";
570
+ import { useCallback as useCallback2, useEffect, useMemo as useMemo3, useRef, useState as useState3 } from "react";
574
571
  import { Elements } from "@stripe/react-stripe-js";
575
572
  import { loadStripe } from "@stripe/stripe-js";
576
573
 
@@ -747,7 +744,7 @@ var stripeElementClasses = {
747
744
  invalid: "focus-visible:ring-(--negative)",
748
745
  focus: "border-(--b-tertiary) ring-(--b-tertiary)/50 ring-2"
749
746
  };
750
- var CreditCardForm = ({ cancel, saveCard }) => {
747
+ var CreditCardForm = ({ cancel, saveCard, showCancel }) => {
751
748
  const [cardError, setCardError] = useState2(void 0);
752
749
  const [stripeStyles, setStripeStyles] = useState2({});
753
750
  const [shouldSaveCard, setShouldSaveCard] = useState2(true);
@@ -854,7 +851,7 @@ var CreditCardForm = ({ cancel, saveCard }) => {
854
851
  /* @__PURE__ */ jsx4(Label, { className: "text-sm font-medium", htmlFor: "saveCard", children: "Save card for future purchases" })
855
852
  ] }),
856
853
  /* @__PURE__ */ jsxs2("div", { className: "flex w-full justify-end gap-2", children: [
857
- /* @__PURE__ */ jsx4(
854
+ showCancel && /* @__PURE__ */ jsx4(
858
855
  Button,
859
856
  {
860
857
  variant: "outline",
@@ -879,15 +876,32 @@ var CreditCardForm = ({ cancel, saveCard }) => {
879
876
 
880
877
  // src/components/CreditCardTab/CreditCard/CreditCard.tsx
881
878
  import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
882
- var StripeWrapper = ({ onCancel, saveNewCard, publicKey }) => {
879
+ var StripeWrapper = ({ onCancel, saveNewCard, publicKey, showCancel }) => {
883
880
  const stripePromise = useMemo3(() => loadStripe(publicKey), [publicKey]);
884
- return /* @__PURE__ */ jsx5(Elements, { stripe: stripePromise, children: /* @__PURE__ */ jsx5(CreditCardForm, { cancel: onCancel, saveCard: saveNewCard }) });
881
+ return /* @__PURE__ */ jsx5(Elements, { stripe: stripePromise, children: /* @__PURE__ */ jsx5(CreditCardForm, { cancel: onCancel, saveCard: saveNewCard, showCancel }) });
885
882
  };
886
883
  var CreditCard = ({ newCards, setNewCards }) => {
887
884
  const [showForm, setShowForm] = useState3(false);
888
885
  const isLoggedIn = useIsLoggedIn();
889
886
  const { selectedPaymentMethod, setSelectedPaymentMethod } = useSpreePaymentMethod();
890
887
  const { spreePayConfig } = useSpreePayConfig();
888
+ const { cards, cardsIsLoading } = useCards();
889
+ const canUseForm = isLoggedIn && Boolean(spreePayConfig?.stripePublicKey);
890
+ const hasCards = cards.length + newCards.length > 0;
891
+ const formVisible = canUseForm && (showForm || !hasCards && !cardsIsLoading);
892
+ const didAutoSelect = useRef(false);
893
+ useEffect(() => {
894
+ if (!isLoggedIn) {
895
+ didAutoSelect.current = false;
896
+ return;
897
+ }
898
+ if (didAutoSelect.current || cardsIsLoading) return;
899
+ didAutoSelect.current = true;
900
+ const alreadySelected = selectedPaymentMethod.type === "CREDIT_CARD" /* CREDIT_CARD */ && Boolean(selectedPaymentMethod.method);
901
+ if (!alreadySelected && cards.length > 0) {
902
+ setSelectedPaymentMethod({ ...selectedPaymentMethod, type: "CREDIT_CARD" /* CREDIT_CARD */, method: cards[0] });
903
+ }
904
+ }, [isLoggedIn, cardsIsLoading, cards, selectedPaymentMethod, setSelectedPaymentMethod]);
891
905
  const setCard = (card) => {
892
906
  const isAlreadySelected = selectedPaymentMethod?.type === "CREDIT_CARD" /* CREDIT_CARD */ && selectedPaymentMethod.method?.id === card.id;
893
907
  setSelectedPaymentMethod({
@@ -920,7 +934,7 @@ var CreditCard = ({ newCards, setNewCards }) => {
920
934
  };
921
935
  return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col items-baseline gap-4", children: [
922
936
  /* @__PURE__ */ jsx5("h3", { className: "text-[22px] leading-9 font-medium text-(--brand-primary)", children: "Your Cards" }),
923
- !showForm && /* @__PURE__ */ jsxs3(Fragment2, { children: [
937
+ !formVisible && /* @__PURE__ */ jsxs3(Fragment2, { children: [
924
938
  /* @__PURE__ */ jsx5(
925
939
  CardsList,
926
940
  {
@@ -935,13 +949,21 @@ var CreditCard = ({ newCards, setNewCards }) => {
935
949
  "button",
936
950
  {
937
951
  onClick: handleAddNewCard,
938
- disabled: !isLoggedIn || !spreePayConfig?.stripePublicKey,
952
+ disabled: !canUseForm,
939
953
  className: "text-md text-(--brand-primary) hover:underline disabled:cursor-not-allowed disabled:no-underline disabled:opacity-50",
940
954
  children: "Add new card"
941
955
  }
942
956
  )
943
957
  ] }),
944
- isLoggedIn && spreePayConfig?.stripePublicKey && showForm && /* @__PURE__ */ jsx5(StripeWrapper, { onCancel: handleCancel, saveNewCard, publicKey: spreePayConfig.stripePublicKey })
958
+ formVisible && spreePayConfig?.stripePublicKey && /* @__PURE__ */ jsx5(
959
+ StripeWrapper,
960
+ {
961
+ onCancel: handleCancel,
962
+ saveNewCard,
963
+ publicKey: spreePayConfig.stripePublicKey,
964
+ showCancel: hasCards
965
+ }
966
+ )
945
967
  ] });
946
968
  };
947
969
 
@@ -949,7 +971,7 @@ var CreditCard = ({ newCards, setNewCards }) => {
949
971
  import { useState as useState9 } from "react";
950
972
 
951
973
  // src/components/CreditCardTab/Points/SplitBlock.tsx
952
- import { useCallback as useCallback5, useEffect as useEffect4, useRef as useRef5, useState as useState8 } from "react";
974
+ import { useCallback as useCallback5, useEffect as useEffect5, useRef as useRef6, useState as useState8 } from "react";
953
975
  import { BUILD_ENV as BUILD_ENV2 } from "@mocanetwork/airkit";
954
976
 
955
977
  // src/components/CreditCardTab/Points/PointsSelector.tsx
@@ -2007,8 +2029,10 @@ var PointsSelector = (props) => {
2007
2029
  Slider2,
2008
2030
  {
2009
2031
  value: [splitTokens],
2010
- onValueCommit: ([v]) => handleCommit(v),
2011
- onValueChange: ([v]) => setSplitTokens(v),
2032
+ onValueChange: ([v]) => {
2033
+ setSplitTokens(v);
2034
+ handleCommit(v);
2035
+ },
2012
2036
  onPointerDown: (e) => e.stopPropagation(),
2013
2037
  min,
2014
2038
  max,
@@ -2050,7 +2074,7 @@ var SplitBlock = (props) => {
2050
2074
  const { useWeb3Points, environment } = useSpreePayEnv();
2051
2075
  const hasForeignCurrency = !!(currencyCode && exchangeRate && foreignCurrencyAmount);
2052
2076
  const formatPointsValue = (usd) => hasForeignCurrency ? formatCurrency(usd / exchangeRate, currencyCode) : formatCurrency(usd);
2053
- const prevPointsChainRef = useRef5(spreePayConfig?.pointsChain);
2077
+ const prevPointsChainRef = useRef6(spreePayConfig?.pointsChain);
2054
2078
  const initWallet = useCallback5(
2055
2079
  async (pointsChain) => {
2056
2080
  if (!pointsChain) return;
@@ -2074,7 +2098,7 @@ var SplitBlock = (props) => {
2074
2098
  },
2075
2099
  [onToggle, environment]
2076
2100
  );
2077
- useEffect4(() => {
2101
+ useEffect5(() => {
2078
2102
  if (!useWeb3Points) return;
2079
2103
  const pointsChainChanged = prevPointsChainRef.current !== spreePayConfig?.pointsChain;
2080
2104
  prevPointsChainRef.current = spreePayConfig?.pointsChain;
@@ -2108,8 +2132,21 @@ var Points = () => {
2108
2132
  const [usePoints, setUsePoints] = useState9(false);
2109
2133
  const [selectedPointsType, setSelectedPointsType] = useState9(null);
2110
2134
  const { setSelectedPaymentMethod, selectedPaymentMethod } = useSpreePaymentMethod();
2111
- const { spreePayConfig } = useSpreePayConfig();
2135
+ const { spreePayConfig, configIsLoading } = useSpreePayConfig();
2112
2136
  const { appProps } = useStaticConfig();
2137
+ const { balance } = useSlapiBalance();
2138
+ const { useWeb3Points } = useSpreePayEnv();
2139
+ const pointsDisabled = !isLoggedIn || !spreePayConfig?.creditCard.enabled || !spreePayConfig?.creditCard.points || appProps.disabledPoints;
2140
+ const [didInit, setDidInit] = useState9(false);
2141
+ if (!isLoggedIn) {
2142
+ if (didInit) setDidInit(false);
2143
+ } else if (!didInit && balance !== void 0 && !configIsLoading) {
2144
+ setDidInit(true);
2145
+ if (!useWeb3Points && !pointsDisabled && balance.availablePoints > 0) {
2146
+ setUsePoints(true);
2147
+ setSelectedPointsType("air");
2148
+ }
2149
+ }
2113
2150
  const handleTogglePoints = (enabled) => {
2114
2151
  setUsePoints(enabled);
2115
2152
  if (!enabled) {
@@ -2124,7 +2161,7 @@ var Points = () => {
2124
2161
  value: usePoints,
2125
2162
  onChange: handleTogglePoints,
2126
2163
  message: spreePayConfig?.creditCard.pointsInfoMessage,
2127
- disabled: !isLoggedIn || !spreePayConfig?.creditCard.enabled || !spreePayConfig?.creditCard.points || appProps.disabledPoints
2164
+ disabled: pointsDisabled
2128
2165
  }
2129
2166
  ),
2130
2167
  usePoints && /* @__PURE__ */ jsx15(
@@ -2202,7 +2239,7 @@ var CreditCardTab = () => {
2202
2239
  mutateBalance
2203
2240
  ]
2204
2241
  );
2205
- useEffect5(() => {
2242
+ useEffect6(() => {
2206
2243
  register(handlePay);
2207
2244
  }, [register, handlePay]);
2208
2245
  return /* @__PURE__ */ jsxs9("div", { children: [
@@ -2232,12 +2269,13 @@ var TabButton = ({ isDisabled = false, isActive, children, onClick }) => {
2232
2269
  };
2233
2270
  var TabButtons = (props) => {
2234
2271
  const { value, onChange } = props;
2235
- const { spreePayConfig, configIsLoading } = useSpreePayConfig();
2272
+ const { spreePayConfig, configIsLoading, configError } = useSpreePayConfig();
2236
2273
  const handleChange = (type) => () => {
2237
2274
  if (value !== type) {
2238
2275
  onChange({ type, method: null });
2239
2276
  }
2240
2277
  };
2278
+ if (configError) return null;
2241
2279
  return /* @__PURE__ */ jsxs10("div", { className: "flex w-full gap-4 overflow-x-auto px-5 py-2 md:px-7", children: [
2242
2280
  configIsLoading && /* @__PURE__ */ jsx17("div", { className: "h-[74px] w-[180px] animate-pulse rounded-md bg-(--s-primary)" }),
2243
2281
  spreePayConfig?.creditCard.enabled && /* @__PURE__ */ jsxs10(TabButton, { onClick: handleChange("CREDIT_CARD" /* CREDIT_CARD */), isActive: value === "CREDIT_CARD" /* CREDIT_CARD */, children: [
@@ -2284,9 +2322,9 @@ var TabButtons = (props) => {
2284
2322
 
2285
2323
  // src/SpreePayContent.tsx
2286
2324
  import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
2287
- var CryptoTab = lazy(() => import("./CryptoTab-ODXWUOMD.js").then((module) => ({ default: module.CryptoTab })));
2325
+ var CryptoTab = lazy(() => import("./CryptoTab-ROWYOLOL.js").then((module) => ({ default: module.CryptoTab })));
2288
2326
  var CryptoComTab = lazy(
2289
- () => import("./CryptoComTab-GL5DOJ2P.js").then((module) => ({ default: module.CryptoComTab }))
2327
+ () => import("./CryptoComTab-3MCYJORT.js").then((module) => ({ default: module.CryptoComTab }))
2290
2328
  );
2291
2329
  var TabLoadingFallback = () => /* @__PURE__ */ jsx18("div", { className: "flex items-center justify-center px-5 py-8 md:px-7", children: /* @__PURE__ */ jsxs11("div", { className: "flex flex-col items-center gap-3", children: [
2292
2330
  /* @__PURE__ */ jsx18("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-(--border-component-specific-card) border-t-(--brand-primary)" }),
@@ -2295,22 +2333,36 @@ var TabLoadingFallback = () => /* @__PURE__ */ jsx18("div", { className: "flex i
2295
2333
  var SpreePayContent = () => {
2296
2334
  const isLoggedIn = useIsLoggedIn();
2297
2335
  const { selectedPaymentMethod, setSelectedPaymentMethod } = useSpreePaymentMethod();
2298
- useEffect6(() => {
2336
+ const { configError } = useSpreePayConfig();
2337
+ useEffect7(() => {
2299
2338
  if (!isLoggedIn) {
2300
2339
  setSelectedPaymentMethod({ type: "CREDIT_CARD" /* CREDIT_CARD */, method: null });
2301
2340
  }
2302
2341
  }, [isLoggedIn, setSelectedPaymentMethod]);
2303
- return /* @__PURE__ */ jsxs11("div", { className: "w-full overflow-hidden rounded-3xl border border-(--border-component-specific-card) bg-(--surface-component-specific-card-default-card) shadow-[0_6.25px_25px_0_var(--shadow-component-specific-card)]", children: [
2304
- /* @__PURE__ */ jsxs11("div", { className: "flex w-full flex-col gap-2 border-b border-b-(--border-component-specific-card) pt-5 pb-3 md:pt-6 md:pb-5", children: [
2305
- /* @__PURE__ */ jsx18("h2", { className: "px-5 text-[28px] leading-8 font-medium text-(--brand-primary) md:px-7", children: "Choose a payment method" }),
2306
- /* @__PURE__ */ jsx18(TabButtons, { value: selectedPaymentMethod.type, onChange: setSelectedPaymentMethod })
2307
- ] }),
2308
- selectedPaymentMethod.type === "CREDIT_CARD" /* CREDIT_CARD */ && /* @__PURE__ */ jsx18(CreditCardTab, {}),
2309
- /* @__PURE__ */ jsxs11(Suspense, { fallback: /* @__PURE__ */ jsx18(TabLoadingFallback, {}), children: [
2310
- selectedPaymentMethod.type === "CRYPTO" /* CRYPTO */ && /* @__PURE__ */ jsx18(CryptoTab, {}),
2311
- selectedPaymentMethod.type === "CDC" /* CDC */ && /* @__PURE__ */ jsx18(CryptoComTab, {})
2312
- ] })
2313
- ] });
2342
+ return (
2343
+ // Config failed: inert disables the whole widget and drops it from tab order + a11y.
2344
+ /* @__PURE__ */ jsxs11(
2345
+ "div",
2346
+ {
2347
+ inert: !!configError,
2348
+ className: cn(
2349
+ "w-full overflow-hidden rounded-3xl border border-(--border-component-specific-card) bg-(--surface-component-specific-card-default-card) shadow-[0_6.25px_25px_0_var(--shadow-component-specific-card)]",
2350
+ configError && "opacity-75"
2351
+ ),
2352
+ children: [
2353
+ /* @__PURE__ */ jsxs11("div", { className: "flex w-full flex-col gap-2 border-b border-b-(--border-component-specific-card) pt-5 pb-3 md:pt-6 md:pb-5", children: [
2354
+ /* @__PURE__ */ jsx18("h2", { className: "px-5 text-[28px] leading-8 font-medium text-(--brand-primary) md:px-7", children: "Choose a payment method" }),
2355
+ /* @__PURE__ */ jsx18(TabButtons, { value: selectedPaymentMethod.type, onChange: setSelectedPaymentMethod })
2356
+ ] }),
2357
+ selectedPaymentMethod.type === "CREDIT_CARD" /* CREDIT_CARD */ && /* @__PURE__ */ jsx18(CreditCardTab, {}),
2358
+ /* @__PURE__ */ jsxs11(Suspense, { fallback: /* @__PURE__ */ jsx18(TabLoadingFallback, {}), children: [
2359
+ selectedPaymentMethod.type === "CRYPTO" /* CRYPTO */ && /* @__PURE__ */ jsx18(CryptoTab, {}),
2360
+ selectedPaymentMethod.type === "CDC" /* CDC */ && /* @__PURE__ */ jsx18(CryptoComTab, {})
2361
+ ] })
2362
+ ]
2363
+ }
2364
+ )
2365
+ );
2314
2366
  };
2315
2367
 
2316
2368
  // src/components/ErrorBoundary.tsx
@@ -2362,16 +2414,16 @@ var ErrorBoundary = class extends Component {
2362
2414
  };
2363
2415
 
2364
2416
  // src/hooks/useKeycloakSSO.ts
2365
- import { useCallback as useCallback7, useEffect as useEffect7, useRef as useRef6, useState as useState11 } from "react";
2417
+ import { useCallback as useCallback7, useEffect as useEffect8, useRef as useRef7, useState as useState11 } from "react";
2366
2418
  import Keycloak from "keycloak-js";
2367
2419
  var refreshAheadSeconds = 60;
2368
2420
  var keycloakLogger = logger.child("keycloak");
2369
2421
  function useKeycloakSSO(config) {
2370
2422
  const { url, realm, clientId, ssoPageURI, enabled } = config;
2371
- const initRef = useRef6(false);
2372
- const kcRef = useRef6(null);
2373
- const refreshTimerRef = useRef6(null);
2374
- const scheduleRefreshRef = useRef6(() => {
2423
+ const initRef = useRef7(false);
2424
+ const kcRef = useRef7(null);
2425
+ const refreshTimerRef = useRef7(null);
2426
+ const scheduleRefreshRef = useRef7(() => {
2375
2427
  });
2376
2428
  const [error, setError] = useState11(null);
2377
2429
  const [isChecking, setIsChecking] = useState11(enabled);
@@ -2400,10 +2452,10 @@ function useKeycloakSSO(config) {
2400
2452
  });
2401
2453
  }, delayMs);
2402
2454
  }, []);
2403
- useEffect7(() => {
2455
+ useEffect8(() => {
2404
2456
  scheduleRefreshRef.current = scheduleRefresh;
2405
2457
  }, [scheduleRefresh]);
2406
- useEffect7(() => {
2458
+ useEffect8(() => {
2407
2459
  if (initRef.current || !enabled) return;
2408
2460
  initRef.current = true;
2409
2461
  const kc = new Keycloak({ url, realm, clientId });
@@ -2458,7 +2510,7 @@ var SpreePayInner = () => {
2458
2510
  setPortalEl(el ?? null);
2459
2511
  }, []);
2460
2512
  const { environment, tenantId, keycloakClientId, accessToken: envAccessToken, ssoPageURI } = useSpreePayEnv();
2461
- useEffect8(() => {
2513
+ useEffect9(() => {
2462
2514
  configureLogger({ environment });
2463
2515
  logger.logVersion();
2464
2516
  }, [environment]);
@@ -2498,7 +2550,7 @@ var SpreePayInner = () => {
2498
2550
  revalidateOnFocus: false,
2499
2551
  revalidateIfStale: false
2500
2552
  },
2501
- children: /* @__PURE__ */ jsx20(PortalContainerProvider, { container: portalEl, children: /* @__PURE__ */ jsx20(NiceModal4.Provider, { children: /* @__PURE__ */ jsx20(LoginStatusProvider, { isLoggedIn: Boolean(_accessToken), children: /* @__PURE__ */ jsx20(SpreePayContent, {}) }) }) })
2553
+ children: /* @__PURE__ */ jsx20(PortalContainerProvider, { container: portalEl, children: /* @__PURE__ */ jsx20(esm_default.Provider, { children: /* @__PURE__ */ jsx20(LoginStatusProvider, { isLoggedIn: Boolean(_accessToken), children: /* @__PURE__ */ jsx20(SpreePayContent, {}) }) }) })
2502
2554
  }
2503
2555
  );
2504
2556
  };
@@ -2512,9 +2564,9 @@ var SpreePay = (props) => {
2512
2564
  };
2513
2565
 
2514
2566
  // src/hooks/useCapture3DS.ts
2515
- import { useEffect as useEffect9 } from "react";
2567
+ import { useEffect as useEffect10 } from "react";
2516
2568
  var useCapture3DS = ({ paymentIntent }) => {
2517
- useEffect9(() => {
2569
+ useEffect10(() => {
2518
2570
  if (typeof window !== "undefined" && window.parent && paymentIntent) {
2519
2571
  window.parent.SP_EVENT_BUS?.emit("paymentIntent", { paymentIntent });
2520
2572
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superlogic/spree-pay",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "description": "Spree-pay React component and utilities",
5
5
  "private": false,
6
6
  "type": "module",
@@ -42,7 +42,6 @@
42
42
  "react-dom": "^18 || ^19"
43
43
  },
44
44
  "dependencies": {
45
- "@ebay/nice-modal-react": "^1.2.13",
46
45
  "@mocanetwork/airkit": "1.7.0",
47
46
  "@radix-ui/react-checkbox": "^1.1.3",
48
47
  "@radix-ui/react-dialog": "^1.1.15",
@@ -65,6 +64,7 @@
65
64
  "xss": "^1.0.15"
66
65
  },
67
66
  "devDependencies": {
67
+ "@ebay/nice-modal-react": "^1.2.13",
68
68
  "@repo/eslint-config": "^1.0.0",
69
69
  "@tailwindcss/postcss": "^4.3.0",
70
70
  "@types/react": "^19",
@@ -96,6 +96,8 @@
96
96
  "react-dom",
97
97
  "swr"
98
98
  ],
99
- "noExternal": []
99
+ "noExternal": [
100
+ "@ebay/nice-modal-react"
101
+ ]
100
102
  }
101
103
  }