mainstack-payments 2.0.1 → 2.0.2

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,7 +1,7 @@
1
1
  import { jsxs as m, jsx as a } from "react/jsx-runtime";
2
- import { u as I, a as A, v as N, C as S } from "./index-Da917IzI.js";
2
+ import { u as I, a as A, v as N, C as S } from "./index-BWm87vgg.js";
3
3
  import { toast as z, BodyText as B, ChevronRightIcon as E } from "mainstack-design-system";
4
- import { u as H } from "./payments-B3Hm80pK.js";
4
+ import { u as H } from "./payments-CjiNVkeO.js";
5
5
  import { memo as $, useState as b, useCallback as P } from "react";
6
6
  const j = (i) => /* @__PURE__ */ m(
7
7
  "svg",
@@ -1,7 +1,7 @@
1
1
  import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
- import { u as x, a as v, C as I, v as S } from "./index-Da917IzI.js";
2
+ import { u as x, a as v, C as I, v as S } from "./index-BWm87vgg.js";
3
3
  import { BodyText as E, ChevronRightIcon as z, toast as N } from "mainstack-design-system";
4
- import { u as $ } from "./payments-B3Hm80pK.js";
4
+ import { u as $ } from "./payments-CjiNVkeO.js";
5
5
  import { useState as b } from "react";
6
6
  const j = (i) => /* @__PURE__ */ l(
7
7
  "svg",
@@ -1,7 +1,7 @@
1
1
  import { jsx as s, Fragment as Q, jsxs as p } from "react/jsx-runtime";
2
2
  import { ModalRoot as ol, ModalPortal as cl, ModalOverlay as dl, ModalBody as ul, ModalContentSlot as ml, ModalContentHeader as pl, ModalClose as gl, ModalContentMain as fl, HeadlineText as Yt, BodyText as P, ModalContentFooter as hl, Button as Ba, FormItem as Ea, FormLabel as $e, Input as Ia, FormErrorStatus as xt, PhoneNumberInput as zs, Spinner as Vs, ButtonRoot as qt, ButtonLabel as Jt, ButtonIcon as Xt, ChevronRightIcon as ia, useMatchMedia as lt, useDisclosure as Da, KeyboardBackSpaceIcon as Hs, KeyboardArrowDownIcon as It, toast as Ae, MainstackDesignSystemProvider as Zs, Toaster as Ws, TooltipRoot as ur, TooltipTrigger as mr, InfoIcon as pr, TooltipContent as gr, TooltipHeader as fr, TooltipTitle as hr, TooltipBody as yr, CountrySelect as Ys, LockIcon as qs, CancelIcon as vr } from "mainstack-design-system";
3
3
  import { useState as G, useEffect as le, useRef as pe, useCallback as Y, useMemo as st, createContext as Js, useLayoutEffect as Xs, forwardRef as yl, createElement as Qs, useContext as ei, lazy as ca, useImperativeHandle as ai, Suspense as aa, isValidElement as ti, memo as ni } from "react";
4
- import { g as vl, r as ri, l as li, E as si, u as bl, a as Sl, C as br, b as ii, c as oi } from "./payments-B3Hm80pK.js";
4
+ import { g as vl, r as ri, l as li, E as si, u as bl, a as Sl, C as br, b as ii, c as oi } from "./payments-CjiNVkeO.js";
5
5
  import ci from "axios";
6
6
  import './index.css';const Qt = ({
7
7
  queryFn: e,
@@ -878,7 +878,7 @@ function gu(e) {
878
878
  function Wl(e) {
879
879
  return Ka(e) ? Hl(e, pu) : dn(e) ? [e] : Bl(mu(gu(e)));
880
880
  }
881
- var Yl = ri(), fu = {
881
+ var Yl = ri, fu = {
882
882
  $$typeof: !0,
883
883
  render: !0,
884
884
  defaultProps: !0,
@@ -9018,7 +9018,7 @@ const Im = (e) => /* @__PURE__ */ p(
9018
9018
  },
9019
9019
  children: /* @__PURE__ */ s("div", { className: "mpl:overflow-hidden", children: a })
9020
9020
  }
9021
- ), jm = ca(() => Promise.resolve().then(() => Wm)), Rm = ca(() => Promise.resolve().then(() => ap)), Lm = ca(() => import("./CashAppPayment-B8Nptk48.js")), Km = ca(() => import("./CryptoPayments-T-b2WqT2.js")), zm = ca(() => Promise.resolve().then(() => Jm)), Vm = ca(
9021
+ ), jm = ca(() => Promise.resolve().then(() => Wm)), Rm = ca(() => Promise.resolve().then(() => ap)), Lm = ca(() => import("./CashAppPayment-ByktxjXA.js")), Km = ca(() => import("./CryptoPayments-BkqcfMtz.js")), zm = ca(() => Promise.resolve().then(() => Jm)), Vm = ca(
9022
9022
  () => Promise.resolve().then(() => sp)
9023
9023
  ), Hm = ca(
9024
9024
  () => Promise.resolve().then(() => np).then((e) => ({
@@ -1,4 +1,4 @@
1
- import { b as e, c as t, S as n, M as y, d as P, P as m, e as r, f as o, W as c, g as u, h as i, i as k, u as d, a as l, j as M, k as C } from "./index-Da917IzI.js";
1
+ import { b as e, c as t, S as n, M as y, d as P, P as m, e as r, f as o, W as c, g as u, h as i, i as k, u as d, a as l, j as M, k as C } from "./index-BWm87vgg.js";
2
2
  export {
3
3
  e as CheckoutForm,
4
4
  t as ContactForm,
@@ -1,8 +1,8 @@
1
1
  import _ from "react";
2
- function Ge(r) {
2
+ function Ke(r) {
3
3
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
4
4
  }
5
- var Ee = { exports: {} }, ue = { exports: {} }, R = {};
5
+ var he = { exports: {} }, Ee = { exports: {} }, R = {};
6
6
  /** @license React v16.13.1
7
7
  * react-is.production.min.js
8
8
  *
@@ -12,7 +12,7 @@ var Ee = { exports: {} }, ue = { exports: {} }, R = {};
12
12
  * LICENSE file in the root directory of this source tree.
13
13
  */
14
14
  var Te;
15
- function He() {
15
+ function Ge() {
16
16
  if (Te) return R;
17
17
  Te = 1;
18
18
  var r = typeof Symbol == "function" && Symbol.for, e = r ? Symbol.for("react.element") : 60103, t = r ? Symbol.for("react.portal") : 60106, n = r ? Symbol.for("react.fragment") : 60107, c = r ? Symbol.for("react.strict_mode") : 60108, a = r ? Symbol.for("react.profiler") : 60114, p = r ? Symbol.for("react.provider") : 60109, l = r ? Symbol.for("react.context") : 60110, f = r ? Symbol.for("react.async_mode") : 60111, h = r ? Symbol.for("react.concurrent_mode") : 60111, d = r ? Symbol.for("react.forward_ref") : 60112, y = r ? Symbol.for("react.suspense") : 60113, g = r ? Symbol.for("react.suspense_list") : 60120, A = r ? Symbol.for("react.memo") : 60115, I = r ? Symbol.for("react.lazy") : 60116, O = r ? Symbol.for("react.block") : 60121, k = r ? Symbol.for("react.fundamental") : 60117, Y = r ? Symbol.for("react.responder") : 60118, X = r ? Symbol.for("react.scope") : 60119;
@@ -87,7 +87,7 @@ var x = {};
87
87
  * LICENSE file in the root directory of this source tree.
88
88
  */
89
89
  var Pe;
90
- function Xe() {
90
+ function He() {
91
91
  return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && function() {
92
92
  var r = typeof Symbol == "function" && Symbol.for, e = r ? Symbol.for("react.element") : 60103, t = r ? Symbol.for("react.portal") : 60106, n = r ? Symbol.for("react.fragment") : 60107, c = r ? Symbol.for("react.strict_mode") : 60108, a = r ? Symbol.for("react.profiler") : 60114, p = r ? Symbol.for("react.provider") : 60109, l = r ? Symbol.for("react.context") : 60110, f = r ? Symbol.for("react.async_mode") : 60111, h = r ? Symbol.for("react.concurrent_mode") : 60111, d = r ? Symbol.for("react.forward_ref") : 60112, y = r ? Symbol.for("react.suspense") : 60113, g = r ? Symbol.for("react.suspense_list") : 60120, A = r ? Symbol.for("react.memo") : 60115, I = r ? Symbol.for("react.lazy") : 60116, O = r ? Symbol.for("react.block") : 60121, k = r ? Symbol.for("react.fundamental") : 60117, Y = r ? Symbol.for("react.responder") : 60118, X = r ? Symbol.for("react.scope") : 60119;
93
93
  function $(u) {
@@ -169,19 +169,17 @@ function Xe() {
169
169
  x.AsyncMode = s, x.ConcurrentMode = z, x.ContextConsumer = ee, x.ContextProvider = re, x.Element = te, x.ForwardRef = K, x.Fragment = V, x.Lazy = G, x.Memo = ne, x.Portal = J, x.Profiler = W, x.StrictMode = F, x.Suspense = D, x.isAsyncMode = Z, x.isConcurrentMode = o, x.isContextConsumer = i, x.isContextProvider = C, x.isElement = E, x.isForwardRef = v, x.isFragment = S, x.isLazy = m, x.isMemo = b, x.isPortal = T, x.isProfiler = w, x.isStrictMode = P, x.isSuspense = U, x.isValidElementType = $, x.typeOf = M;
170
170
  }()), x;
171
171
  }
172
- var Oe;
173
- function We() {
174
- return Oe || (Oe = 1, process.env.NODE_ENV === "production" ? ue.exports = He() : ue.exports = Xe()), ue.exports;
175
- }
172
+ process.env.NODE_ENV === "production" ? Ee.exports = Ge() : Ee.exports = He();
173
+ var qe = Ee.exports;
176
174
  /*
177
175
  object-assign
178
176
  (c) Sindre Sorhus
179
177
  @license MIT
180
178
  */
181
- var pe, Re;
182
- function Ze() {
183
- if (Re) return pe;
184
- Re = 1;
179
+ var le, Oe;
180
+ function Xe() {
181
+ if (Oe) return le;
182
+ Oe = 1;
185
183
  var r = Object.getOwnPropertySymbols, e = Object.prototype.hasOwnProperty, t = Object.prototype.propertyIsEnumerable;
186
184
  function n(a) {
187
185
  if (a == null)
@@ -210,7 +208,7 @@ function Ze() {
210
208
  return !1;
211
209
  }
212
210
  }
213
- return pe = c() ? Object.assign : function(a, p) {
211
+ return le = c() ? Object.assign : function(a, p) {
214
212
  for (var l, f = n(a), h, d = 1; d < arguments.length; d++) {
215
213
  l = Object(arguments[d]);
216
214
  for (var y in l)
@@ -222,27 +220,27 @@ function Ze() {
222
220
  }
223
221
  }
224
222
  return f;
225
- }, pe;
223
+ }, le;
226
224
  }
227
- var de, xe;
225
+ var pe, Re;
228
226
  function Ce() {
229
- if (xe) return de;
230
- xe = 1;
227
+ if (Re) return pe;
228
+ Re = 1;
231
229
  var r = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
232
- return de = r, de;
230
+ return pe = r, pe;
233
231
  }
234
- var ve, we;
235
- function Ye() {
236
- return we || (we = 1, ve = Function.call.bind(Object.prototype.hasOwnProperty)), ve;
232
+ var de, xe;
233
+ function We() {
234
+ return xe || (xe = 1, de = Function.call.bind(Object.prototype.hasOwnProperty)), de;
237
235
  }
238
- var ye, _e;
239
- function Qe() {
240
- if (_e) return ye;
241
- _e = 1;
236
+ var ve, we;
237
+ function Ze() {
238
+ if (we) return ve;
239
+ we = 1;
242
240
  var r = function() {
243
241
  };
244
242
  if (process.env.NODE_ENV !== "production") {
245
- var e = Ce(), t = {}, n = Ye();
243
+ var e = Ce(), t = {}, n = We();
246
244
  r = function(a) {
247
245
  var p = "Warning: " + a;
248
246
  typeof console < "u" && console.error(p);
@@ -282,13 +280,13 @@ function Qe() {
282
280
  }
283
281
  return c.resetWarningCache = function() {
284
282
  process.env.NODE_ENV !== "production" && (t = {});
285
- }, ye = c, ye;
283
+ }, ve = c, ve;
286
284
  }
287
- var me, Ae;
288
- function er() {
289
- if (Ae) return me;
290
- Ae = 1;
291
- var r = We(), e = Ze(), t = Ce(), n = Ye(), c = Qe(), a = function() {
285
+ var ye, _e;
286
+ function Qe() {
287
+ if (_e) return ye;
288
+ _e = 1;
289
+ var r = qe, e = Xe(), t = Ce(), n = We(), c = Ze(), a = function() {
292
290
  };
293
291
  process.env.NODE_ENV !== "production" && (a = function(l) {
294
292
  var f = "Warning: " + l;
@@ -301,7 +299,7 @@ function er() {
301
299
  function p() {
302
300
  return null;
303
301
  }
304
- return me = function(l, f) {
302
+ return ye = function(l, f) {
305
303
  var h = typeof Symbol == "function" && Symbol.iterator, d = "@@iterator";
306
304
  function y(o) {
307
305
  var i = o && (h && o[h] || o[d]);
@@ -603,18 +601,18 @@ Valid keys: ` + JSON.stringify(Object.keys(o), null, " ")
603
601
  return !o.constructor || !o.constructor.name ? g : o.constructor.name;
604
602
  }
605
603
  return A.checkPropTypes = c, A.resetWarningCache = c.resetWarningCache, A.PropTypes = A, A;
606
- }, me;
604
+ }, ye;
607
605
  }
608
- var he, je;
609
- function rr() {
610
- if (je) return he;
611
- je = 1;
606
+ var me, Ae;
607
+ function er() {
608
+ if (Ae) return me;
609
+ Ae = 1;
612
610
  var r = Ce();
613
611
  function e() {
614
612
  }
615
613
  function t() {
616
614
  }
617
- return t.resetWarningCache = e, he = function() {
615
+ return t.resetWarningCache = e, me = function() {
618
616
  function n(p, l, f, h, d, y) {
619
617
  if (y !== r) {
620
618
  var g = new Error(
@@ -651,16 +649,16 @@ function rr() {
651
649
  resetWarningCache: e
652
650
  };
653
651
  return a.PropTypes = a, a;
654
- }, he;
652
+ }, me;
655
653
  }
656
654
  if (process.env.NODE_ENV !== "production") {
657
- var tr = We(), nr = !0;
658
- Ee.exports = er()(tr.isElement, nr);
655
+ var rr = qe, tr = !0;
656
+ he.exports = Qe()(rr.isElement, tr);
659
657
  } else
660
- Ee.exports = rr()();
661
- var or = Ee.exports;
662
- const j = /* @__PURE__ */ Ge(or);
663
- function ke(r, e) {
658
+ he.exports = er()();
659
+ var nr = he.exports;
660
+ const j = /* @__PURE__ */ Ke(nr);
661
+ function je(r, e) {
664
662
  var t = Object.keys(r);
665
663
  if (Object.getOwnPropertySymbols) {
666
664
  var n = Object.getOwnPropertySymbols(r);
@@ -670,26 +668,26 @@ function ke(r, e) {
670
668
  }
671
669
  return t;
672
670
  }
673
- function Ie(r) {
671
+ function ke(r) {
674
672
  for (var e = 1; e < arguments.length; e++) {
675
673
  var t = arguments[e] != null ? arguments[e] : {};
676
- e % 2 ? ke(Object(t), !0).forEach(function(n) {
677
- De(r, n, t[n]);
678
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : ke(Object(t)).forEach(function(n) {
674
+ e % 2 ? je(Object(t), !0).forEach(function(n) {
675
+ Ye(r, n, t[n]);
676
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : je(Object(t)).forEach(function(n) {
679
677
  Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(t, n));
680
678
  });
681
679
  }
682
680
  return r;
683
681
  }
684
- function fe(r) {
682
+ function ce(r) {
685
683
  "@babel/helpers - typeof";
686
- return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? fe = function(e) {
684
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? ce = function(e) {
687
685
  return typeof e;
688
- } : fe = function(e) {
686
+ } : ce = function(e) {
689
687
  return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
690
- }, fe(r);
688
+ }, ce(r);
691
689
  }
692
- function De(r, e, t) {
690
+ function Ye(r, e, t) {
693
691
  return e in r ? Object.defineProperty(r, e, {
694
692
  value: t,
695
693
  enumerable: !0,
@@ -697,13 +695,13 @@ function De(r, e, t) {
697
695
  writable: !0
698
696
  }) : r[e] = t, r;
699
697
  }
700
- function Ue(r, e) {
701
- return ar(r) || ir(r, e) || ur(r, e) || sr();
698
+ function De(r, e) {
699
+ return or(r) || ar(r, e) || ir(r, e) || ur();
702
700
  }
703
- function ar(r) {
701
+ function or(r) {
704
702
  if (Array.isArray(r)) return r;
705
703
  }
706
- function ir(r, e) {
704
+ function ar(r, e) {
707
705
  var t = r && (typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"]);
708
706
  if (t != null) {
709
707
  var n = [], c = !0, a = !1, p, l;
@@ -722,20 +720,20 @@ function ir(r, e) {
722
720
  return n;
723
721
  }
724
722
  }
725
- function ur(r, e) {
723
+ function ir(r, e) {
726
724
  if (r) {
727
- if (typeof r == "string") return Me(r, e);
725
+ if (typeof r == "string") return Ie(r, e);
728
726
  var t = Object.prototype.toString.call(r).slice(8, -1);
729
727
  if (t === "Object" && r.constructor && (t = r.constructor.name), t === "Map" || t === "Set") return Array.from(r);
730
- if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Me(r, e);
728
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Ie(r, e);
731
729
  }
732
730
  }
733
- function Me(r, e) {
731
+ function Ie(r, e) {
734
732
  (e == null || e > r.length) && (e = r.length);
735
733
  for (var t = 0, n = new Array(e); t < e; t++) n[t] = r[t];
736
734
  return n;
737
735
  }
738
- function sr() {
736
+ function ur() {
739
737
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
740
738
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
741
739
  }
@@ -760,17 +758,17 @@ var N = function(e, t, n) {
760
758
  t.current = e;
761
759
  }, [e]), t.current;
762
760
  }, Q = function(e) {
763
- return e !== null && fe(e) === "object";
764
- }, cr = function(e) {
761
+ return e !== null && ce(e) === "object";
762
+ }, sr = function(e) {
765
763
  return Q(e) && typeof e.then == "function";
766
- }, fr = function(e) {
764
+ }, cr = function(e) {
767
765
  return Q(e) && typeof e.elements == "function" && typeof e.createToken == "function" && typeof e.createPaymentMethod == "function" && typeof e.confirmCardPayment == "function";
768
- }, $e = "[object Object]", lr = function r(e, t) {
766
+ }, Me = "[object Object]", fr = function r(e, t) {
769
767
  if (!Q(e) || !Q(t))
770
768
  return e === t;
771
769
  var n = Array.isArray(e), c = Array.isArray(t);
772
770
  if (n !== c) return !1;
773
- var a = Object.prototype.toString.call(e) === $e, p = Object.prototype.toString.call(t) === $e;
771
+ var a = Object.prototype.toString.call(e) === Me, p = Object.prototype.toString.call(t) === Me;
774
772
  if (a !== p) return !1;
775
773
  if (!a && !n) return e === t;
776
774
  var l = Object.keys(e), f = Object.keys(t);
@@ -786,33 +784,33 @@ var N = function(e, t, n) {
786
784
  return r(A[Y], I[Y]);
787
785
  };
788
786
  return g.every(O);
789
- }, Ne = function(e, t, n) {
787
+ }, Ue = function(e, t, n) {
790
788
  return Q(e) ? Object.keys(e).reduce(function(c, a) {
791
- var p = !Q(t) || !lr(e[a], t[a]);
792
- return n.includes(a) ? (p && console.warn("Unsupported prop change: options.".concat(a, " is not a mutable property.")), c) : p ? Ie(Ie({}, c || {}), {}, De({}, a, e[a])) : c;
789
+ var p = !Q(t) || !fr(e[a], t[a]);
790
+ return n.includes(a) ? (p && console.warn("Unsupported prop change: options.".concat(a, " is not a mutable property.")), c) : p ? ke(ke({}, c || {}), {}, Ye({}, a, e[a])) : c;
793
791
  }, null) : null;
794
- }, Fe = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", Le = function(e) {
795
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Fe;
796
- if (e === null || fr(e))
792
+ }, Ne = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", $e = function(e) {
793
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ne;
794
+ if (e === null || cr(e))
797
795
  return e;
798
796
  throw new Error(t);
799
- }, pr = function(e) {
800
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Fe;
801
- if (cr(e))
797
+ }, lr = function(e) {
798
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ne;
799
+ if (sr(e))
802
800
  return {
803
801
  tag: "async",
804
802
  stripePromise: Promise.resolve(e).then(function(c) {
805
- return Le(c, t);
803
+ return $e(c, t);
806
804
  })
807
805
  };
808
- var n = Le(e, t);
806
+ var n = $e(e, t);
809
807
  return n === null ? {
810
808
  tag: "empty"
811
809
  } : {
812
810
  tag: "sync",
813
811
  stripe: n
814
812
  };
815
- }, dr = function(e) {
813
+ }, pr = function(e) {
816
814
  !e || !e._registerWrapper || !e.registerAppInfo || (e._registerWrapper({
817
815
  name: "react-stripe-js",
818
816
  version: "2.7.0"
@@ -821,21 +819,21 @@ var N = function(e, t, n) {
821
819
  version: "2.7.0",
822
820
  url: "https://stripe.com/docs/stripe-js/react"
823
821
  }));
824
- }, le = /* @__PURE__ */ _.createContext(null);
825
- le.displayName = "ElementsContext";
826
- var Be = function(e, t) {
822
+ }, fe = /* @__PURE__ */ _.createContext(null);
823
+ fe.displayName = "ElementsContext";
824
+ var Fe = function(e, t) {
827
825
  if (!e)
828
826
  throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t, " in an <Elements> provider."));
829
827
  return e;
830
- }, vr = function(e) {
828
+ }, dr = function(e) {
831
829
  var t = e.stripe, n = e.options, c = e.children, a = _.useMemo(function() {
832
- return pr(t);
830
+ return lr(t);
833
831
  }, [t]), p = _.useState(function() {
834
832
  return {
835
833
  stripe: a.tag === "sync" ? a.stripe : null,
836
834
  elements: a.tag === "sync" ? a.stripe.elements(n) : null
837
835
  };
838
- }), l = Ue(p, 2), f = l[0], h = l[1];
836
+ }), l = De(p, 2), f = l[0], h = l[1];
839
837
  _.useEffect(function() {
840
838
  var g = !0, A = function(O) {
841
839
  h(function(k) {
@@ -858,49 +856,49 @@ var Be = function(e, t) {
858
856
  var y = be(n);
859
857
  return _.useEffect(function() {
860
858
  if (f.elements) {
861
- var g = Ne(n, y, ["clientSecret", "fonts"]);
859
+ var g = Ue(n, y, ["clientSecret", "fonts"]);
862
860
  g && f.elements.update(g);
863
861
  }
864
862
  }, [n, y, f.elements]), _.useEffect(function() {
865
- dr(f.stripe);
866
- }, [f.stripe]), /* @__PURE__ */ _.createElement(le.Provider, {
863
+ pr(f.stripe);
864
+ }, [f.stripe]), /* @__PURE__ */ _.createElement(fe.Provider, {
867
865
  value: f
868
866
  }, c);
869
867
  };
870
- vr.propTypes = {
868
+ dr.propTypes = {
871
869
  stripe: j.any,
872
870
  options: j.object
873
871
  };
874
- var yr = function(e) {
875
- var t = _.useContext(le);
876
- return Be(t, e);
877
- }, wr = function() {
878
- var e = yr("calls useElements()"), t = e.elements;
872
+ var vr = function(e) {
873
+ var t = _.useContext(fe);
874
+ return Fe(t, e);
875
+ }, xr = function() {
876
+ var e = vr("calls useElements()"), t = e.elements;
879
877
  return t;
880
878
  };
881
879
  j.func.isRequired;
882
- var ze = /* @__PURE__ */ _.createContext(null);
883
- ze.displayName = "CustomCheckoutSdkContext";
884
- var mr = function(e, t) {
880
+ var Be = /* @__PURE__ */ _.createContext(null);
881
+ Be.displayName = "CustomCheckoutSdkContext";
882
+ var yr = function(e, t) {
885
883
  if (!e)
886
884
  throw new Error("Could not find CustomCheckoutProvider context; You need to wrap the part of your app that ".concat(t, " in an <CustomCheckoutProvider> provider."));
887
885
  return e;
888
- }, hr = /* @__PURE__ */ _.createContext(null);
889
- hr.displayName = "CustomCheckoutContext";
886
+ }, mr = /* @__PURE__ */ _.createContext(null);
887
+ mr.displayName = "CustomCheckoutContext";
890
888
  j.any, j.shape({
891
889
  clientSecret: j.string.isRequired,
892
890
  elementsOptions: j.object
893
891
  }).isRequired;
894
892
  var ge = function(e) {
895
- var t = _.useContext(ze), n = _.useContext(le);
893
+ var t = _.useContext(Be), n = _.useContext(fe);
896
894
  if (t && n)
897
895
  throw new Error("You cannot wrap the part of your app that ".concat(e, " in both <CustomCheckoutProvider> and <Elements> providers."));
898
- return t ? mr(t, e) : Be(n, e);
899
- }, Er = function(e) {
896
+ return t ? yr(t, e) : Fe(n, e);
897
+ }, hr = function(e) {
900
898
  return e.charAt(0).toUpperCase() + e.slice(1);
901
899
  }, L = function(e, t) {
902
- var n = "".concat(Er(e), "Element"), c = function(f) {
903
- var h = f.id, d = f.className, y = f.options, g = y === void 0 ? {} : y, A = f.onBlur, I = f.onFocus, O = f.onReady, k = f.onChange, Y = f.onEscape, X = f.onClick, $ = f.onLoadError, M = f.onLoaderStart, s = f.onNetworksChange, z = f.onConfirm, ee = f.onCancel, re = f.onShippingAddressChange, te = f.onShippingRateChange, K = ge("mounts <".concat(n, ">")), V = "elements" in K ? K.elements : null, G = "customCheckoutSdk" in K ? K.customCheckoutSdk : null, ne = _.useState(null), J = Ue(ne, 2), W = J[0], F = J[1], D = _.useRef(null), H = _.useRef(null);
900
+ var n = "".concat(hr(e), "Element"), c = function(f) {
901
+ var h = f.id, d = f.className, y = f.options, g = y === void 0 ? {} : y, A = f.onBlur, I = f.onFocus, O = f.onReady, k = f.onChange, Y = f.onEscape, X = f.onClick, $ = f.onLoadError, M = f.onLoaderStart, s = f.onNetworksChange, z = f.onConfirm, ee = f.onCancel, re = f.onShippingAddressChange, te = f.onShippingRateChange, K = ge("mounts <".concat(n, ">")), V = "elements" in K ? K.elements : null, G = "customCheckoutSdk" in K ? K.customCheckoutSdk : null, ne = _.useState(null), J = De(ne, 2), W = J[0], F = J[1], D = _.useRef(null), H = _.useRef(null);
904
902
  N(W, "blur", A), N(W, "focus", I), N(W, "escape", Y), N(W, "click", X), N(W, "loaderror", $), N(W, "loaderstart", M), N(W, "networkschange", s), N(W, "confirm", z), N(W, "cancel", ee), N(W, "shippingaddresschange", re), N(W, "shippingratechange", te), N(W, "change", k);
905
903
  var Z;
906
904
  O && (e === "expressCheckout" ? Z = O : Z = function() {
@@ -914,7 +912,7 @@ var ge = function(e) {
914
912
  var o = be(g);
915
913
  return _.useEffect(function() {
916
914
  if (D.current) {
917
- var i = Ne(g, o, ["paymentRequest"]);
915
+ var i = Ue(g, o, ["paymentRequest"]);
918
916
  i && D.current.update(i);
919
917
  }
920
918
  }, [g, o]), _.useLayoutEffect(function() {
@@ -956,15 +954,15 @@ var ge = function(e) {
956
954
  onShippingRateChange: j.func,
957
955
  options: j.object
958
956
  }, p.displayName = n, p.__elementType = e, p;
959
- }, q = typeof window > "u", br = /* @__PURE__ */ _.createContext(null);
960
- br.displayName = "EmbeddedCheckoutProviderContext";
961
- var _r = function() {
957
+ }, q = typeof window > "u", Er = /* @__PURE__ */ _.createContext(null);
958
+ Er.displayName = "EmbeddedCheckoutProviderContext";
959
+ var wr = function() {
962
960
  var e = ge("calls useStripe()"), t = e.stripe;
963
961
  return t;
964
962
  };
965
963
  L("auBankAccount", q);
966
964
  L("card", q);
967
- var Ar = L("cardNumber", q), jr = L("cardExpiry", q), kr = L("cardCvc", q);
965
+ var _r = L("cardNumber", q), Ar = L("cardExpiry", q), jr = L("cardCvc", q);
968
966
  L("fpxBank", q);
969
967
  L("iban", q);
970
968
  L("idealBank", q);
@@ -979,36 +977,36 @@ L("shippingAddress", q);
979
977
  L("paymentMethodMessaging", q);
980
978
  L("affirmMessage", q);
981
979
  L("afterpayClearpayMessage", q);
982
- var Ve = "https://js.stripe.com/v3", gr = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
983
- var Cr = function() {
984
- for (var e = document.querySelectorAll('script[src^="'.concat(Ve, '"]')), t = 0; t < e.length; t++) {
980
+ var ze = "https://js.stripe.com/v3", br = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
981
+ var gr = function() {
982
+ for (var e = document.querySelectorAll('script[src^="'.concat(ze, '"]')), t = 0; t < e.length; t++) {
985
983
  var n = e[t];
986
- if (gr.test(n.src))
984
+ if (br.test(n.src))
987
985
  return n;
988
986
  }
989
987
  return null;
990
- }, qe = function(e) {
988
+ }, Le = function(e) {
991
989
  var t = "", n = document.createElement("script");
992
- n.src = "".concat(Ve).concat(t);
990
+ n.src = "".concat(ze).concat(t);
993
991
  var c = document.head || document.body;
994
992
  if (!c)
995
993
  throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
996
994
  return c.appendChild(n), n;
997
- }, Sr = function(e, t) {
995
+ }, Cr = function(e, t) {
998
996
  !e || !e._registerWrapper || e._registerWrapper({
999
997
  name: "stripe-js",
1000
998
  version: "3.5.0",
1001
999
  startTime: t
1002
1000
  });
1003
- }, oe = null, se = null, ce = null, Tr = function(e) {
1001
+ }, oe = null, ue = null, se = null, Sr = function(e) {
1004
1002
  return function() {
1005
1003
  e(new Error("Failed to load Stripe.js"));
1006
1004
  };
1007
- }, Pr = function(e, t) {
1005
+ }, Tr = function(e, t) {
1008
1006
  return function() {
1009
1007
  window.Stripe ? e(window.Stripe) : t(new Error("Stripe.js not available"));
1010
1008
  };
1011
- }, Or = function(e) {
1009
+ }, Pr = function(e) {
1012
1010
  return oe !== null ? oe : (oe = new Promise(function(t, n) {
1013
1011
  if (typeof window > "u" || typeof document > "u") {
1014
1012
  t(null);
@@ -1019,16 +1017,16 @@ var Cr = function() {
1019
1017
  return;
1020
1018
  }
1021
1019
  try {
1022
- var c = Cr();
1020
+ var c = gr();
1023
1021
  if (!(c && e)) {
1024
1022
  if (!c)
1025
- c = qe(e);
1026
- else if (c && ce !== null && se !== null) {
1023
+ c = Le(e);
1024
+ else if (c && se !== null && ue !== null) {
1027
1025
  var a;
1028
- c.removeEventListener("load", ce), c.removeEventListener("error", se), (a = c.parentNode) === null || a === void 0 || a.removeChild(c), c = qe(e);
1026
+ c.removeEventListener("load", se), c.removeEventListener("error", ue), (a = c.parentNode) === null || a === void 0 || a.removeChild(c), c = Le(e);
1029
1027
  }
1030
1028
  }
1031
- ce = Pr(t, n), se = Tr(n), c.addEventListener("load", ce), c.addEventListener("error", se);
1029
+ se = Tr(t, n), ue = Sr(n), c.addEventListener("load", se), c.addEventListener("error", ue);
1032
1030
  } catch (p) {
1033
1031
  n(p);
1034
1032
  return;
@@ -1036,38 +1034,38 @@ var Cr = function() {
1036
1034
  }), oe.catch(function(t) {
1037
1035
  return oe = null, Promise.reject(t);
1038
1036
  }));
1039
- }, Rr = function(e, t, n) {
1037
+ }, Or = function(e, t, n) {
1040
1038
  if (e === null)
1041
1039
  return null;
1042
1040
  var c = e.apply(void 0, t);
1043
- return Sr(c, n), c;
1044
- }, ae, Je = !1, Ke = function() {
1045
- return ae || (ae = Or(null).catch(function(e) {
1041
+ return Cr(c, n), c;
1042
+ }, ae, Ve = !1, Je = function() {
1043
+ return ae || (ae = Pr(null).catch(function(e) {
1046
1044
  return ae = null, Promise.reject(e);
1047
1045
  }), ae);
1048
1046
  };
1049
1047
  Promise.resolve().then(function() {
1050
- return Ke();
1048
+ return Je();
1051
1049
  }).catch(function(r) {
1052
- Je || console.warn(r);
1050
+ Ve || console.warn(r);
1053
1051
  });
1054
- var Ir = function() {
1052
+ var kr = function() {
1055
1053
  for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
1056
1054
  t[n] = arguments[n];
1057
- Je = !0;
1055
+ Ve = !0;
1058
1056
  var c = Date.now();
1059
- return Ke().then(function(a) {
1060
- return Rr(a, t, c);
1057
+ return Je().then(function(a) {
1058
+ return Or(a, t, c);
1061
1059
  });
1062
1060
  };
1063
1061
  export {
1064
- Ar as C,
1065
- vr as E,
1066
- wr as a,
1067
- jr as b,
1068
- kr as c,
1069
- Ge as g,
1070
- Ir as l,
1071
- We as r,
1072
- _r as u
1062
+ _r as C,
1063
+ dr as E,
1064
+ xr as a,
1065
+ Ar as b,
1066
+ jr as c,
1067
+ Ke as g,
1068
+ kr as l,
1069
+ qe as r,
1070
+ wr as u
1073
1071
  };
package/package.json CHANGED
@@ -1,9 +1,17 @@
1
1
  {
2
2
  "name": "mainstack-payments",
3
3
  "type": "module",
4
- "version": "2.0.1",
4
+ "version": "2.0.2",
5
5
  "main": "build/mainstack-payments.js",
6
6
  "types": "build/src/index.d.ts",
7
+ "style": "build/style.css",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./build/src/index.d.ts",
11
+ "import": "./build/mainstack-payments.js"
12
+ },
13
+ "./style.css": "./build/style.css"
14
+ },
7
15
  "files": [
8
16
  "build"
9
17
  ],